mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 10:37:02 +00:00
[10755] Use class specific combat rating factors from gtOCTClassCombatRatingScalarStore.dbc
* Some classes had effect of melee haste buffed * Change to armor penetration rating was hidden there too
This commit is contained in:
parent
92ed528eb9
commit
7663cf6329
7 changed files with 24 additions and 11 deletions
|
|
@ -5125,22 +5125,24 @@ float Player::GetSpellCritFromIntellect()
|
|||
return crit*100.0f;
|
||||
}
|
||||
|
||||
float Player::GetRatingCoefficient(CombatRating cr) const
|
||||
float Player::GetRatingMultiplier(CombatRating cr) const
|
||||
{
|
||||
uint32 level = getLevel();
|
||||
|
||||
if (level>GT_MAX_LEVEL) level = GT_MAX_LEVEL;
|
||||
|
||||
GtCombatRatingsEntry const *Rating = sGtCombatRatingsStore.LookupEntry(cr*GT_MAX_LEVEL+level-1);
|
||||
if (Rating == NULL)
|
||||
// gtOCTClassCombatRatingScalarStore.dbc starts with 1, CombatRating with zero, so cr+1
|
||||
GtOCTClassCombatRatingScalarEntry const *classRating = sGtOCTClassCombatRatingScalarStore.LookupEntry((getClass()-1)*GT_MAX_RATING+cr+1);
|
||||
if (!Rating || !classRating)
|
||||
return 1.0f; // By default use minimum coefficient (not must be called)
|
||||
|
||||
return Rating->ratio;
|
||||
return classRating->ratio / Rating->ratio;
|
||||
}
|
||||
|
||||
float Player::GetRatingBonusValue(CombatRating cr) const
|
||||
{
|
||||
return float(GetUInt32Value(PLAYER_FIELD_COMBAT_RATING_1 + cr)) / GetRatingCoefficient(cr);
|
||||
return float(GetUInt32Value(PLAYER_FIELD_COMBAT_RATING_1 + cr)) * GetRatingMultiplier(cr);
|
||||
}
|
||||
|
||||
float Player::GetExpertiseDodgeOrParryReduction(WeaponAttackType attType) const
|
||||
|
|
@ -5205,20 +5207,20 @@ void Player::ApplyRatingMod(CombatRating cr, int32 value, bool apply)
|
|||
{
|
||||
case CR_HASTE_MELEE:
|
||||
{
|
||||
float RatingChange = value / GetRatingCoefficient(cr);
|
||||
float RatingChange = value * GetRatingMultiplier(cr);
|
||||
ApplyAttackTimePercentMod(BASE_ATTACK,RatingChange,apply);
|
||||
ApplyAttackTimePercentMod(OFF_ATTACK,RatingChange,apply);
|
||||
break;
|
||||
}
|
||||
case CR_HASTE_RANGED:
|
||||
{
|
||||
float RatingChange = value / GetRatingCoefficient(cr);
|
||||
float RatingChange = value * GetRatingMultiplier(cr);
|
||||
ApplyAttackTimePercentMod(RANGED_ATTACK, RatingChange, apply);
|
||||
break;
|
||||
}
|
||||
case CR_HASTE_SPELL:
|
||||
{
|
||||
float RatingChange = value / GetRatingCoefficient(cr);
|
||||
float RatingChange = value * GetRatingMultiplier(cr);
|
||||
ApplyCastTimePercentMod(RatingChange,apply);
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue