• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

If advance magic, restore all mana, if advance level restore all health

something like this

Code:
    function onAdvance(cid, skill, oldlevel, newlevel)
local pPos = getPlayerPosition(cid)
         if skill == 8 then
    doSendAnimatedText(pPos, "Level Up", 210)
    doSendMagicEffect(pPos, 28)    
    doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
    doCreatureAddMana(cid, getCreatureMaxMana(cid))    
        end
         return TRUE
end
 
Lua:
function onAdvance(cid, skill, oldlevel, newlevel)
local ppos = getPlayerPosition(cid)
if newlevel > oldlevel then
    doSendAnimatedText(ppos, "Level Up", 210)
    doSendMagicEffect(ppos, 28)    
    doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
    doPlayerAddMana(cid, getCreatureMaxMana(cid))    
    end
return true
end
 
Lua:
function onAdvance(cid, skill, oldlevel, newlevel)
local ppos = getPlayerPosition(cid)
if newlevel > oldlevel then
    doSendAnimatedText(ppos, "Level Up", 210)
    doSendMagicEffect(ppos, 28)    
    doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
    doPlayerAddMana(cid, getCreatureMaxMana(cid))    
    end
return true
end
how i apply that in creaturescripts.xml?
 
Back
Top