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) <action uniqueid="6999" script="sklejacz.lua" />
2. Robimy plik sklejacz.lua i do niego wklejamy
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
rune1pos = {x=127, y=58, z=6, stackpos=1} Zmieniamy na swoja pozycje 1 runy rune2pos = {x=129, y=58, z=6, stackpos=1} Zmieniamy na swoja pozycje 2 runy 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/23w http://img391.imageshack.us/img391/3177/34cf.jpg
Jesli chcecie wersje 7.5 to tak.
Ta linijke \/ if (rune1.itemid >= 2261 and rune1.itemid <= 2316) then Zamien na if (rune1.itemid >= 3086 and rune1.itemid <= 3141) then
Wszystkie 1945 zamien na 2711 oraz 1946 na 2712 (1945 bylo za czasow 7.4 hihi) Mam nadzieje ze sie przyda.
Autor opublikowal nowa wersje, latwiej w niej zmieniac poszczegolne wartosci. Zamiast starego wklejamy nowe sklejacz.lua, pamietajmy aby uid z actions.xml zgadzalo sie z leveruid.
function onUse(cid, item, frompos, item2, topos)
-- Rune merger by Alreth - v1.50
-- Edit these variables so they fit to your map and server settings. -- leveruid = 6999 -- UniqueID of lever rune1pos = {x=127, y=58, z=6} -- Positions of the first rune that will be merged rune2pos = {x=129, y=58, z=6} -- Positions of the second rune that will be merged leverid = 1945 -- Itemid of the lever (default/middle position) runesidmin = 2260 -- Itemid of the first rune on the server runesidmax = 2316 -- Itemid of the last rune on the server manacost = 20 -- Mana spent every time runes are merged maxcharges = 200 -- Max amount of charges allowed for runes (value has to be min 2 and max 250) -- Stop editing here unless you know what you are doing. --
if (item.uid == leveruid) then rune1pos = {x=rune1pos.x, y=rune1pos.y, z=rune1pos.z, stackpos=1} rune2pos = {x=rune2pos.x, y=rune2pos.y, z=rune2pos.z, stackpos=1} rune1 = getThingfromPos(rune1pos) rune2 = getThingfromPos(rune2pos)
if (item.itemid == leverid) then if (rune1.itemid >= runesidmin and rune1.itemid <= runesidmax) then if (getPlayerMana(cid) < manacost) then doPlayerSendTextMessage(cid, 22, "You need "..manacost.." mana to perform this merge this.") else if (rune1.itemid == rune2.itemid) then doPlayerAddMana(cid, -manacost) rune1x = rune1.type rune2x = rune2.type
if (rune1x == 0) then rune1x = 1 end if (rune2x == 0) then rune2x = 1 end
runetotal = rune1x + rune2x if (runetotal <= maxcharges) then newrune1 = runetotal newrune2 = 0 else newrune1 = maxcharges newrune2 = runetotal-maxcharges doPlayerSendTextMessage(cid, 22, "The new merged rune can not have more than "..maxcharges.." 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 == leverid+1) then doTransformItem(item.uid, item.itemid-1) else doPlayerSendTextMessage(cid, 22, "Sorry, not possible.") end end -- end of rune merger script --
end
|