Hi all, I've got a problem with script "transform"
Everything works perfect, except one thing:
When transform is activated I want to make this transform that it will waste your mana e.g. 50 mana per 2 second - I have this script but something is not working, PLEASE HELP because I don't know what's wrong with it
Engine: TFS 0.3.6pl1 (Tibia 8.54)
Everything works perfect, except one thing:
When transform is activated I want to make this transform that it will waste your mana e.g. 50 mana per 2 second - I have this script but something is not working, PLEASE HELP because I don't know what's wrong with it
Engine: TFS 0.3.6pl1 (Tibia 8.54)
Code:
function naruto(cid)
second =
if isPlayer(cid) == 1 then
if getPlayerVocation(cid) == 2 then
if getPlayerMana(cid) >= 200 then
doPlayerAddMana(cid,-50)
naruto = addEvent(naruto,second*1000,cid)
end
end
if getPlayerMana(cid) <= 100 then
stopEvent(naruto)
doPlayerAddHealthMax(cid,-(getPlayerLevel(cid)*20))
doPlayerAddManaMax(cid,-(getPlayerLevel(cid)*10))
doPlayerSetVocation(cid,1)
doRemoveCondition(cid, 6)
end
end
end
function naruto1(cid)
if isPlayer(cid) == 1 then
if getPlayerVocation(cid) == 3 then
if getPlayerMana(cid) >= 200 then
doPlayerAddMana(cid,-10)
naruto1 = addEvent(naruto1,second*1000,cid)
end
end
if getPlayerMana(cid) <= 100 then
stopEvent(naruto1)
doPlayerAddHealthMax(cid,-(getPlayerLevel(cid)*30))
doPlayerAddManaMax(cid,-(getPlayerLevel(cid)*20))
doPlayerSetVocation(cid,1)
doRemoveCondition(cid, 6)
end
end
end
function naruto2(cid)
if isPlayer(cid) == 1 then
if getPlayerVocation(cid) == 4 then
if getPlayerMana(cid) >= 200 then
doSendMagicEffect(getCreaturePosition(cid), 2)
doPlayerAddMana(cid,-10)
naruto2 = addEvent(naruto2,second*1000,cid)
end
end
if getPlayerMana(cid) <= 100 then
stopEvent(naruto2)
doPlayerAddHealthMax(cid,-(getPlayerLevel(cid)*40))
doPlayerAddManaMax(cid,-(getPlayerLevel(cid)*30))
doPlayerSetVocation(cid,1)
doRemoveCondition(cid, 6)
end
end
end
function onCastSpell(cid, var)
if getPlayerVocation(cid) == 3 then
if getPlayerLevel(cid) >= 120 then
doPlayerSetVocation(cid,4)
doCreatureChangeOutfit(cid, {lookType=400})
doSendMagicEffect(getCreaturePosition(cid), 2)
doPlayerAddHealthMax(cid, (getPlayerLevel(cid)*40))
doPlayerAddManaMax(cid, (getPlayerLevel(cid)*30))
naruto2 = addEvent(naruto2,second*1000,cid)
else
doSendMagicEffect(getCreaturePosition(cid), 2)
doPlayerSendCancel(cid, "You need 120 level to transform.")
end
end
if getPlayerVocation(cid) == 2 then
if getPlayerLevel(cid) >= 80 then
doPlayerSetVocation(cid,3)
doCreatureChangeOutfit(cid, {lookType=399})
doSendMagicEffect(getCreaturePosition(cid), 2)
doPlayerAddHealthMax(cid, (getPlayerLevel(cid)*30))
doPlayerAddManaMax(cid, (getPlayerLevel(cid)*20))
naruto1 = addEvent(naruto1,second*1000,cid)
else
doSendMagicEffect(getCreaturePosition(cid), 2)
doPlayerSendCancel(cid, "You need 80 level to transform.")
end
end
if getPlayerVocation(cid) == 1 then
if getPlayerLevel(cid) >= 40 then
doPlayerSetVocation(cid,2)
doCreatureChangeOutfit(cid, {lookType=398})
doSendMagicEffect(getCreaturePosition(cid), 2)
doPlayerAddHealthMax(cid, (getPlayerLevel(cid)*20))
doPlayerAddManaMax(cid, (getPlayerLevel(cid)*10))
doPlayerSay(cid,"Kyuubi Form",2)
naruto = addEvent(naruto,second*1000,cid)
else
doSendMagicEffect(getCreaturePosition(cid), 2)
doPlayerSendCancel(cid, "You need 40 level to transform.")
end
end
end