View Single Post
  #5  
Old 05-10-2011, 06:15 AM
rdurbin
Fire Beetle
 
Join Date: Jan 2006
Posts: 16
Default

that last line was just a workaround I know its sloppy but was a quick fix originally the file passes set_exp not add_exp. what I did is made it pass add_exp instead and than put that data into set_exp. the reasoning for this is so I can display the add_exp data which is the actualy xp you get, set_exp is just the new xp total, which would not work. for example if you have 0 xp at start and kill a enemy worth 250, both set_exp and add_exp would be the same. but on the next kill it will screw up. basically it would say the next kill would be 500 xp, because its using the total xp instead of xp for last kill. So yeah it was my way to get the add_exp variable into that functions that contains the function to display the xp for that kill.

Im sure it could of been done better, like probably displaying the xp earned before you even go in the set_exp function.

Im sure the group xp thing is wrong, really I have no way to test it with people in different levels, I only tested it with chars of same level, but im 100% sure the solo xp is correct. Ill try changing group xp to what its passing, should work...

------------------------------------
EDIT:

Ok fixed the problem with the group xp, I just moved it to same place near the solo xp displaying, since they are displayed after it calculates the xp for group xp it passes through all the other modifers, including mobcolor, if your server uses that rule. to be safe i just commented the old spot group xp was in. here is the new change

(can prob show raid xp using the exact same line as well)

Code:
SetEXP(add_exp, aaexp, resexp);
}

void Client::SetEXP(int32 add_exp, int32 set_aaxp, bool isrezzexp) {
	int32 set_exp = GetEXP() + add_exp;
	_log(CLIENT__EXP, "Attempting to Set Exp for %s (XP: %u, AAXP: %u, Rez: %s)", this->GetCleanName(), set_exp, set_aaxp, isrezzexp ? "true" : "false");
	//max_AAXP = GetEXPForLevel(52) - GetEXPForLevel(51);	//GetEXPForLevel() doesn't depend on class/race, just level, so it shouldn't change between Clients
	max_AAXP = RuleI(AA, ExpPerPoint);	//this may be redundant since we're doing this in Client::FinishConnState2()
	if (max_AAXP == 0 || GetEXPForLevel(GetLevel()) == 0xFFFFFFFF) {
		Message(13, "Error in Client::SetEXP. EXP not set.");
		return; // Must be invalid class/race
	}
	
	
	if ((set_exp + set_aaxp) > (m_pp.exp+m_pp.expAA)) {
		if (isrezzexp)
			this->Message_StringID(MT_Experience, REZ_REGAIN);
		else{
			if(this->IsGrouped())
				//this->Message_StringID(MT_Experience, GAIN_GROUPXP);
				//int a=1;
				this->Message(15,"Your share of the Group XP is %u",  add_exp);
			else if(IsRaidGrouped())
				Message_StringID(MT_Experience, GAIN_RAIDEXP);
			else
				//this->Message_StringID(MT_Experience, GAIN_XP);
				this->Message(15,"You have gained %u XP.", add_exp);
		}
	}

Last edited by rdurbin; 05-10-2011 at 06:41 AM.. Reason: fixed the group xp code
Reply With Quote