kito2
www.masteria.net
Hey there, as topic name says, is there a possibility to make an script that if the player raise one level, his HP and MP will setted to the max?
Get this script and remove the unnecessary parts.
function onAdvance(cid, skill, oldlevel, newlevel)
if skill == SKILL__LEVEL and newlevel == oldlevel+1 then
doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
doCreatureAddMana(cid, getCreatureMaxMana(cid))
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_BLUE)
end
return true
end
function onAdvance(cid, skill, oldlevel, newlevel)
if skill == SKILL__LEVEL and newlevel >= x) then
doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
doCreatureAddMana(cid, getCreatureMaxMana(cid))
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_BLUE)
return TRUE
end
<event type="advance" name="reward" event="script" value="up.lua"/>
function onLogin(cid)
registerCreatureEvent(cid, "reward")