View Single Post
  #1  
Old 08-25-2007, 10:44 AM
TheLieka
Developer
 
Join Date: Oct 2004
Location: THE ATL (wut wut)
Posts: 325
Default Fix: Zone_Exp_Multiplier not used to factor XP

When I set up my server with the intention of having "hotspot" zones, I noticed that the zone_exp_multiplier from the zone table was not being used to calculated the xp for a kill.

I'm sure there are better ways to do this, but here's what I changed in my code to make this work:

I made the following change to the void Client::AddEXP function within exp.cpp

Code:
void Client::AddEXP(int32 add_exp, int8 conlevel, bool resexp) {
	if (m_epp.perAA<0 || m_epp.perAA>100)
		m_epp.perAA=0;	// stop exploit with sanity check
	
	int32 add_aaxp;
	if(resexp) {
		add_aaxp = 0;
	} else {
		//figure out how much of this goes to AAs
		add_aaxp = add_exp * m_epp.perAA / 100;
		//take that ammount away from regular exp
		add_exp -= add_aaxp;
	
		float totalmod = 1.0;
		//get modifiers
		if (zone->GetEXPMod() > 0) {
			totalmod = zone->GetEXPMod();
		//Lieka:  Add in the zone_exp_multiplier value from the database
			totalmod *= zone->newzone_data.zone_exp_multiplier;
		}

		if(RuleR(Character, ExpMultiplier) >= 0){
			totalmod *= RuleR(Character, ExpMultiplier);
		}
		

		add_exp = int32(float(add_exp) * totalmod);
Thanks,
Daxum
__________________
Daxum



Former ServerOp - Vallon Zek / Tallon Zek Emu Server - Legit / Guild PvP - (2007 - 2011 RIP)

Last edited by TheLieka; 08-25-2007 at 06:47 PM..
Reply With Quote