son_of_sillve |
Wysłany: Wto 9:28, 15 Maj 2007 Temat postu: Skrypt na sklejacza run |
|
7.6 version :
Dziala to tak iz : na 1 pozycji kladziemy 5x runa (bylejakiego) i na drugiej pozycji drugi runek tego samego rodzaju 5x. Przelaczamy i otrzymujemy 10x runa, zamiast 2 runek 5x mamy 1 10x.
1.Do actions.xml dodajemy linijke (jak macie uniqua na mapie to inne)
Kod: |
<action uniqueid="6999" script="sklejacz.lua" /> |
2. Robimy plik sklejacz.lua i do niego wklejamy
Kod: |
function onUse(cid, item, frompos, item2, topos)
if item.uid == 6999 then
rune1pos = {x=127, y=58, z=6, stackpos=1}
rune1 = getThingfromPos(rune1pos)
rune2pos = {x=129, y=58, z=6, stackpos=1}
rune2 = getThingfromPos(rune2pos)
if (item.itemid == 1945) then
if (rune1.itemid >= 2261 and rune1.itemid <= 2316) then
if (getPlayerMana(cid) < 20) then
doPlayerSendTextMessage(cid, 22, "You need 20 mana to perform this merge this.")
else
if (rune1.itemid == rune2.itemid) then
doPlayerAddMana(cid, -20)
rune1x = rune1.type
rune2x = rune2.type
runetotal = rune1x + rune2x
if (runetotal <= 200) then
newrune1 = runetotal
newrune2 = 0
else
newrune1 = 200
newrune2 = runetotal-200
doPlayerSendTextMessage(cid, 22, "The new merged rune can not have more than 200 charges. One full rune will be made and one with restoring charges.")
end
if (newrune1 > 0) then
doCreateItem(rune1.itemid, newrune1, rune1pos)
end
if (newrune2 > 0) then
doCreateItem(rune1.itemid, newrune2, rune2pos)
end
doRemoveItem(rune1.uid, rune1.type)
doRemoveItem(rune2.uid, rune2.type)
doSendMagicEffect(rune1pos, 11)
doSendMagicEffect(rune2pos, 11)
doSendMagicEffect(getPlayerPosition(cid), 14)
doTransformItem(item.uid, item.itemid + 1)
else
doPlayerSendTextMessage(cid, 22, "Runes missmatch. Put two runes of the same type on each basin.")
end
end
else
doPlayerSendTextMessage(cid, 22, "You can only merge runes together.")
end
elseif (item.itemid == 1946) then
doTransformItem(item.uid, item.itemid - 1)
else
doPlayerSendTextMessage(cid, 22, "Sorry, not possible.")
end
end
end |
3. Robimy na mapie co trzeba: obydwie pozycje i switcha dajemy uniqua jakiego podalismy
Modyfikujemy
Kod: |
rune1pos = {x=127, y=58, z=6, stackpos=1} |
Zmieniamy na swoja pozycje 1 runy
Kod: |
rune2pos = {x=129, y=58, z=6, stackpos=1} |
Zmieniamy na swoja pozycje 2 runy
Kod: |
if (getPlayerMana(cid) < 20) then |
Tu mozemy zmienic ile many ciagnie sklejanie.
Oczywiscie mozecie sobie zmienic rowniez magic efekty.
Pare ssow.
http://img478.imageshack.us/img478/7651/19jd.jpg
http://img469.imageshack.us/img469/6595/23wa.jpg
http://img391.imageshack.us/img391/3177/34cf.jpg |
|