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

[TFS] 2008-01-30 Fixed stages.xml

Lejjo

New Member
Joined
Sep 21, 2007
Messages
78
Reaction score
1
First off, if this is posted on wrong place, please put it on the right place since I got some other codes coming and I want to be on the right spot.

What is this code?
It is a fix in the creature.cpp where if you had a summon and killed a monster you wouldn't get the exp rate in the stages.xml, but in the confing.lua

I'm just changing one line so I can't give myself any credits to this, just a small change in the TFS stages version.

Start of the code:
creature.cpp

Change...
Code:
	uint64_t lostExperience = getLostExperience();

	return attacker->getPlayer() ? ((uint64_t)std::floor(getDamageRatio(attacker) * lostExperience * g_game.getExperienceStage(attacker->getPlayer()->getLevel()))) : ((uint64_t)std::floor(getDamageRatio(attacker) * lostExperience * g_config.getNumber(ConfigManager::RATE_EXPERIENCE)));

...to
Code:
	int64_t lostExperience = getLostExperience();

	Player* player = attacker->getPlayer();
	if(!player){
		player = attacker->getMaster()->getPlayer();
	}
	
	if(player){
		return (int64_t)std::floor(getDamageRatio(attacker) * lostExperience * g_game.getExperienceStage(player->getLevel()));
	}
End of the code:

And there you go :)





I didn't want to change
Code:
virtual uint64_t getGainedExperience(Creature* attacker) const;

into
Code:
virtual int64_t getGainedExperience(Creature* attacker) const;

inside player.h and creature.h because I rather keep it as it is since it works. If any of the 1337:)P) programmers can tell if its ok to change that too or not, since then I could change this too:
Code:
uint64_t Creature::getGainedExperience(Creature* attacker) const



Please leave a comment :)

Yours,
Kadj
 
Last edited:
i think thats useless cuz stages are working :p
you just need to enable it :p
like changing "0" to "1" on the beggining of the file :p
easy to find :p
if i am wrong.. sry :)
 
Hmm, this gave me a great idea of cheat leveling in OTServers which has set theirs stages to like 1x, 5x, 10x but 100x in config :rolleyes:
 
Back
Top