According to WoWWiki, it takes 45.91 critical strike rating to increase the chance by one percent. Therefore you can do the math and get the rating but keep in mind that critical chance is also affected by agility so the best you can get is an approximation... I'm not aware of any method returning the total critical rating of the player (not saying there isnt one)
I see... well then you can get the chance and calculate the rating using the 45.91 (at level 80) convert rate but keep in mind that chance is also affected by talents, potions, whatever. It really depends on what you really need there
I understand, what's your code so far? I mean the modifications that you have already done
void Player::UpdateCritPercentage(WeaponAttackType attType)
{
BaseModGroup modGroup;
uint16 index;
CombatRating cr;
switch (attType)
{
case OFF_ATTACK:
modGroup = OFFHAND_CRIT_PERCENTAGE;
index = PLAYER_OFFHAND_CRIT_PERCENTAGE;
cr = CR_CRIT_MELEE;
break;
case RANGED_ATTACK:
modGroup = RANGED_CRIT_PERCENTAGE;
index = PLAYER_RANGED_CRIT_PERCENTAGE;
cr = CR_CRIT_RANGED;
break;
case BASE_ATTACK:
default:
modGroup = CRIT_PERCENTAGE;
index = PLAYER_CRIT_PERCENTAGE;
cr = CR_CRIT_MELEE;
break;
}
float value = 0;
if(this->GetLevel() >= 20)
// value = this->GetCritRating() * 0.1;
else if(this->GetLevel() >= 10)
// value = this-<GetCritRating() * 0.5;
else if (this->GetLevel() < 10)
// value = this->GetCritRating();
if (sWorld->getBoolConfig(CONFIG_STATS_LIMITS_ENABLE))
value = value > sWorld->getFloatConfig(CONFIG_STATS_LIMITS_CRIT) ? sWorld->getFloatConfig(CONFIG_STATS_LIMITS_CRIT) : value;
value = value < 0.0f ? 0.0f : value;
SetStatFloatValue(index, value);
// Applies rating mod change, so there you see where you can get base rating
float oldRating = m_baseRatingValue[cr];
m_baseRatingValue[cr]+=(apply ? value : -value);
// Sets the rating field for player (so just get it?)
SetUInt32Value(PLAYER_FIELD_COMBAT_RATING_1 + cr, uint32(amount));
See
ApplyRatingMod
UpdateRating
UpdateCritPercentage
In them you can see how the rating is got and how its calculated and set as the chance.
Some quotes:
I assume the problem was that you got the % value of the chance and not the actual critical hit rating value (IE 1000)
Not sure if this was at all what you were looking for. Somewhat at loss with stats since I havent played wow.