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

Windows Avesta065e (exp stages)

siolyol

New Member
Joined
Feb 8, 2010
Messages
16
Reaction score
0
Hello i have a quick question, if the latest avesta have exp stages? I'm talking about avesta protocol 7.4 , 7.6 and 7.7.2
If so please tell me how to do it.
 
This version don't have folder XML.
stages.xml is in data/stages.xml
Old version avesta 0.6.1 to 0.6.3 have a folder xml and stages.xml. Latest version NO.
Who knows how to add exp stages to new version Avesta?
 
I don't know how it works, never checked the functions of avesta 0.6.5e

So difficult maybe someone else knows the solution.

So it looks like from the inside:
data\creaturescripts\scripts\stages.lua
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


data\creaturescripts\creaturescripts.xml
<?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>
 
Last edited:
Try this:

login.lua
Lua:
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

Now in creaturescripts.xml
PHP:
<event type="login" name="Login" script="login.lua" />
<event type="advance" name="Login" script="login.lua" />
 
Last edited:
Error Event onAdvence not found. data/creaturescript/script/login.lua...
So not declared Advance becouse folder scripts have a file:
kill
login
logout
stages
 
Ok ok and it does not work ;/
Can anyone help me?

- - - Updated - - -

Rly no one knows the solution? ;/

- - - Updated - - -

Problem solved missed several declarations, at several locations.
Thanks Nottinghster for tips and you wanted to help, but I worked it out myself
Thanks all who still gave and please close the topic.
 
Back
Top