Synthetic_
deathzot.net
- Joined
- Dec 30, 2008
- Messages
- 2,535
- Reaction score
- 574
Well I know this is a very easy piece of code, but I think its a cool idea and some of you might want to use it. When you level up, it will give you full health & mana and do a cool effect.
Credits: Kekox for helping me understand onAdvance, and http://otland.net/f35/full-hp-mana-each-level-50544/
TESTED ON TFS0.3.5.PL1
Lets start;
Advance.lua
Then in creaturescripts.xml
Then in login.lua add
Credits: Kekox for helping me understand onAdvance, and http://otland.net/f35/full-hp-mana-each-level-50544/
TESTED ON TFS0.3.5.PL1
Lets start;
Advance.lua
Lua:
-- Credits: Synthetic @ OTFans & OTLand
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
Then in creaturescripts.xml
Code:
<event type="advance" name="Advance" event="script" value="Advance.lua"/>
Then in login.lua add
Lua:
registerCreatureEvent(cid, "Advance")
Last edited: