• 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!

On level up, auto fill HP and MP to max?

kito2

www.masteria.net
Joined
Mar 9, 2009
Messages
3,764
Solutions
1
Reaction score
227
Location
Chile, Santiago
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.

That script is only for advance to lvl 30.

I wrote for every advance in Exp Level
[Tested on TFS 0.3.6]
creaturescripts/scripts/advance.lua
LUA:
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

for advance to x lvl
LUA:
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
and lines for both of them
Creaturescripts/creaturescripts.xml

LUA:
<event type="advance" name="reward" event="script" value="up.lua"/>

Creaturescripts/scripts/login.lua
under
Code:
function onLogin(cid)
add
LUA:
registerCreatureEvent(cid, "reward")
rep if I helped :)
 
Last edited:
Yes, I understood that this event he need, I don't know what he means "one level up"
1. Every one lvl up
2. One lvl i character life xD

If the second option I'm sorry - my mistake :P
 
Back
Top