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);
}
}
}Code: Select all
void Player::SetNeededXP(int32 val){
GetInfoStruct()->xp_needed = val;
}
void Player::SetNeededXP(){
GetInfoStruct()->xp_needed = GetLevel() * 100;
}