I'm trying to make a spell that heals knights health more than the other vocations but i can't seem to get it working (this worked before i added the knights variation)
Please tell me where i've gone wrong and how to fix it please, thank you in advance.
Please tell me where i've gone wrong and how to fix it please, thank you in advance.
Code:
function onCastSpell(cid, var)
local minhealth = (getPlayerLevel(cid) * 11.0) + (getPlayerMagLevel(cid) * 4)
local maxhealth = (getPlayerLevel(cid) * 13.0) + (getPlayerMagLevel(cid) * 4)
local minmana = (getPlayerLevel(cid) * 6.5) + (getPlayerMagLevel(cid) * 4)
local maxmana = (getPlayerLevel(cid) * 7.5) + (getPlayerMagLevel(cid) * 4)
local randommana = math.ceil(math.random(minmana,maxmana))
local randomhealth = math.ceil(math.random(minhealth,maxhealth))
local playerVoc = getPlayerVocation(cid)
if playerVoc == 4 or playerVoc == 8 or playerVoc == 12 then
doCreatureAddMana(cid, randommana)
doCreatureAddHealth(cid, randomhealth)
doSendMagicEffect(getCreaturePosition(cid), 49)
doSendAnimatedText(getCreaturePosition(cid), randommana, COLOR_YELLOW)
elseif playerVoc == 1 or playerVoc == 5 or playerVoc == 9 or playerVoc == 2 or playerVoc == 6 or playerVoc == 10 or playerVoc == 3 or playerVoc == 7 or playerVoc == 11 then
doCreatureAddMana(cid, randommana)
doCreatureAddHealth(cid, randommana)
doSendMagicEffect(getCreaturePosition(cid), 49)
doSendAnimatedText(getCreaturePosition(cid), randommana, COLOR_YELLOW)
return true
end
end