Adventure XP calcs

EQ2Emulator Development forum.

Moderator: Team Members

Post Reply
User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Adventure XP calcs

Post by John Adams » Wed Oct 10, 2012 8:24 pm

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;
}

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests