STiX
Intermediate OT User
I'm going to change this so upon gaining a normal level your hp and mana restores its self to full.
Sorry, now work perfectly for me!
function onThink(cid, interval)
if OLD_LEVELS[cid] == nil then
OLD_LEVELS[cid] = getPlayerLevel(cid)
OLD_MAGLEVELS[cid] = getPlayerMagLevel(cid)
OLD_FIST[cid] = getPlayerSkill(cid,SKILL_FIST)
OLD_CLUB[cid] = getPlayerSkill(cid,SKILL_CLUB)
OLD_AXE[cid] = getPlayerSkill(cid,SKILL_AXE)
OLD_SWORD[cid] = getPlayerSkill(cid,SKILL_SWORD)
OLD_DISTANCE[cid] = getPlayerSkill(cid,SKILL_DISTANCE)
OLD_SHIELD[cid] = getPlayerSkill(cid,SKILL_SHIELD)
OLD_FISHING[cid] = getPlayerSkill(cid,SKILL_FISHING)
else
dofile("./data/creaturescripts/scripts/onAdvance.lua")
onAdvanceController(cid)
return TRUE
end
end
Actually function "onAdvance" is in TFS sources. You don't have to use LUA function "onThink" to check is someone advanced. I'll post later how to use new function.
In login.lua in onLogin function add:Doesnt work for me... using latest tags revision.
registerCreatureEvent(cid, "PlayerThink")
#GesiorIn login.lua in onLogin function add:
Without it scripts won't work! This line start scriptPHP:registerCreatureEvent(cid, "PlayerThink")
#Gesior
Do I have in every script to add?
--onAdvance system by 4220niller
--xmlReader might be implemented later so that you can have multiple scripts
function onAdvance(cid, oldlevel, newlevel)
local lvl = getPlayerLevel(cid)
local hp = getPlayerHealth(cid)
if newlevel == level+1
then
doPlayerHealth(cid,10*hp)
end
end
doPlayerHealth(cid,10*hp) ??My code of Level.lua - I want to this script give all of hp when player adv from lvl xx to lvl yy - Where are error?Code:--onAdvance system by 4220niller --xmlReader might be implemented later so that you can have multiple scripts function onAdvance(cid, oldlevel, newlevel) local lvl = getPlayerLevel(cid) local hp = getPlayerHealth(cid) if newlevel == level+1 then doPlayerHealth(cid,10*hp) end end
function onAdvance(cid, oldlevel, newlevel)
doCreatureAddHealth(cid,999999)
end