registerCreatureEvent("stagesAdvance")
I don't know how it works, never checked the functions of avesta 0.6.5e
STAGES = {
{level = 10, rate = 150},
{level = 25, rate = 100},
{level = 50, rate = 75},
{level = 75, rate = 40},
{level = 100, rate = 20},
{level = 150, rate = 10}
}
DEFAULT_RATE = 5
function checkStages(cid)
local level = getPlayerLevel(cid)
for i = 1, # STAGES do
if level <= STAGES.level then
doPlayerSetRate(cid, LEVEL_EXPERIENCE, STAGES.rate)
return
end
end
doPlayerSetRate(cid, LEVEL_EXPERIENCE, DEFAULT_RATE)
end
function onLogin(cid)
registerCreatureEvent(cid, "stagesAdvance")
checkStages(cid)
return 1
end
function onAdvance(cid, type, oldlevel, newlevel)
if type == LEVEL_EXPERIENCE then
checkStages(cid)
end
return 1
end
<?xml version="1.0"?>
<creaturescripts>
<event type="login" name="stagesLogin" script="stages.lua" />
<event type="advance" name="stagesAdvance" script="stages.lua" />
<!--event type="login" name="PlayerLogin" script="login.lua" /-->
<!--event type="logout" name="Playerlogout" script="logout.lua"/-->
</creaturescripts>
it's .lua not .lau...
function onLogin(cid)
STAGES = {
{level = 10, rate = 150},
{level = 25, rate = 100},
{level = 50, rate = 75},
{level = 75, rate = 40},
{level = 100, rate = 20},
{level = 150, rate = 10}
}
DEFAULT_RATE = 5
function checkStages(cid)
local level = getPlayerLevel(cid)
for i = 1, #STAGES do
if level <= STAGES[i].level then
doPlayerSetRate(cid, LEVEL_EXPERIENCE, STAGES[i].rate)
end
end
doPlayerSetRate(cid, LEVEL_EXPERIENCE, DEFAULT_RATE)
end
function onAdvance(cid, type, oldlevel, newlevel)
if type == LEVEL_EXPERIENCE then
checkStages(cid)
end
end
return TRUE
end
<event type="login" name="Login" script="login.lua" />
<event type="advance" name="Login" script="login.lua" />
+1, I wonder as well.Dude, can you tell me how did you resolved this issue? I have the same problem with stages.