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

Avesta - Exp stages

Tony32

Veteran OT User
Joined
Jun 6, 2008
Messages
1,268
Reaction score
353
I'm having trouble with stages. I am running rev 94 (0.6.5) but I just can't get the stages to work. I've tried to set expRate in config to stage, stages and 0. Still doesn't work. I'm trying to use the stages via creaturescripts.
creaturescripts.xml
Code:
<creaturescripts>
	<event type="login" name="stagesLogin" script="stages.lua" />
	<event type="advance" name="stagesAdvance" script="stages.lua" />
</creaturescripts>

stages.lua
Code:
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)
			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

I don't get any errors in the console, and yet I recive 1x experience from all monsters.

Anyone knows how this works on this distro? Would love to know. Thanks a lot in advance.

- - - Updated - - -

Edited this function to debug if it was working. It is indeed loading the output I get when I login. It says 150x exp for a new character. Still, when killing a rat. I get 5 experince (as in config lua). So somehow it doesn't really apply the change. D:
Code:
function checkStages(cid)
	doPlayerSendTextMessage(cid,22,"checked stages")
	local level = getPlayerLevel(cid)
	
	for i = 1, # STAGES do
		if level <= STAGES[i].level then
			doPlayerSetRate(cid, LEVEL_EXPERIENCE, STAGES[i].rate)
			doPlayerSendTextMessage(cid,22,STAGES[i].rate)
			return
		end
	end
	
	doPlayerSetRate(cid, LEVEL_EXPERIENCE, DEFAULT_RATE)
end

I've also tested setting the config.lua with stage/stages/staged and 0, still nothing changes.

Any help is appreciated.

Regards,
Tony
 
I know people are using exp stages on Avesta, but if it's the default system that comes with Avesta or something other, I do not know. How hard is it really to implement stages via c++? Are there any guides anywhere that works on Avesta?
I've tried contacting people that said they got it working, but they aren't responding D:
 
Yeah, "compile it" really helps!
I know how to compile already, I don't know what needs to be done for it to work.
 
I think so, I saw some people asking about it in other threads, and they didn't mention that it didn't work.
You can always try, but keep a copy of the original version.
 
In the configure.ac file (im compiling in linux) I can't find any parameters for enabling exp stage.. If so, it must be something with --enable-~~
 
Back
Top