Page 1 of 1

Adventure XP calcs

Posted: Wed Oct 10, 2012 8:24 pm
by John Adams
Do you think we're calculating Adventure XP accurately, or just some made up values from Emu v0.0.1? Take a look at this chart on eq2 wikia and let me know if this is accurate. I don't know that the calcs below match up, but not sure if SOE has just changed things since the beginning.

http://eq2.wikia.com/wiki/Character_Dev ... Experience

I think this is our current method:

Code: Select all

void PlayerInfo::CalculateXPPercentages(){
	if(info_struct->xp_needed > 0){
		float percentage = ((double)info_struct->xp / info_struct->xp_needed) * 1000;
		info_struct->xp_yellow = (int16)percentage;
		info_struct->xp_blue = (int16)(100-((ceil(percentage/100) - (percentage/100)) * 100));
		info_struct->xp_blue_vitality_bar = 0;
		info_struct->xp_yellow_vitality_bar = 0;
		if(player->GetXPVitality() > 0){
			float vitality_total = player->GetXPVitality()*10 + percentage;
			vitality_total -= ((int)(percentage/100)*100);
			if(vitality_total < 100){ //10%
				info_struct->xp_blue_vitality_bar = info_struct->xp_blue + (int16)(player->GetXPVitality() *10);
			}
			else
				info_struct->xp_yellow_vitality_bar = info_struct->xp_yellow + (int16)(player->GetXPVitality() *10);
		}
	}
}
Then I found these, too:

Code: Select all

void Player::SetNeededXP(int32 val){
	GetInfoStruct()->xp_needed = val;
}

void Player::SetNeededXP(){
	GetInfoStruct()->xp_needed = GetLevel() * 100;
}