hello i try add effect to this manarune
but i got error
PHP:
function getPlayerManaMax(cid)manaNow = getPlayerMana(cid)doPlayerAddMana(cid,1000000)manaMax = getPlayerMana(cid)doPlayerAddMana(cid,manaNow-manaMax)
return manaMax
endfunction onUse(cid, item, frompos, item2, topos)local config = {ended = true,effect_enable = true,effect = 13,text_enable = true,text_colour = 191,exh =
{exh_enable = true,exh_time = 1.4,storage = 12345, -- liczba przechowujaca exhausted}
}local voctab =
{
{minn=5, maxx=750, lvmul=2, mlmul=35},
{minn=150, maxx=550, lvmul=12, mlmul=1},
{minn=50, maxx=550, lvmul=5, mlmul=45},
{minn=150, maxx=1550, lvmul=3, mlmul=15}
}topos.stackpos = 253
player = getThingfromPos(topos)playerpos = getPlayerPosition(player.uid)cidpos = getPlayerPosition(cid)used = false
canUse = true
maglv = getPlayerMagLevel(cid)voc = getPlayerVocation(cid)lv=getPlayerLevel(cid)vocc=voctab[voc]addminn=vocc.minn +(vocc.lvmul*lv)+(vocc.mlmul*maglv)addmaxx=vocc.maxx +(vocc.lvmul*lv)+(vocc.mlmul*maglv)add=math.random(addminn,addmaxx)
if player.uid > 0 thenif getPlayerMana(player.uid) == getPlayerManaMax(player.uid) then
doPlayerSendCancel(cid, "Mana "..getPlayerName(player.uid).." is full!")
return 1
endelse
if getPlayerMana(cid) == getPlayerManaMax(cid) then
doPlayerSendCancel(cid, "Your mana is full.")
return 1
end
endif(os.time() < getPlayerStorageValue(cid, config.exh.storage)) then
doPlayerSendCancel(cid,"You are exhausted.")canUse = false
endif (canUse) thenif player.itemid > 0 thenif (config.effect_enable) then
doSendMagicEffect(playerpos, config.effect)endif (config.text_enable) then
player:say("add", TALKTYPE_MONSTER_SAY)end
doPlayerAddMana(player.uid,add)used = trueelse
if config.effect_enable then
doSendMagicEffect(cidpos, config.effect)endif (config.text_enable) then
player:say("add", TALKTYPE_MONSTER_SAY)end
doPlayerAddMana(cid,add)used = true
end
endif (used) and (canUse) thenif (config.exh.exh_enable) then
setPlayerStorageValue(cid, config.exh.storage, os.time() + config.exh.exh_time)endif (config.ended) thenif item.type > 1 then
doChangeTypeItem(item.uid,item.type-1)
elsedoRemoveItem(item.uid,1)end
end
endreturn 1
end