mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 09:17:36 +01:00
Backed out changeset: ad4f100c0a9d
--HG-- branch : trunk
This commit is contained in:
@@ -51,17 +51,24 @@ bool Player::UpdateStats(Stats stat)
|
||||
switch(stat)
|
||||
{
|
||||
case STAT_STRENGTH:
|
||||
UpdateAttackPowerAndDamage();
|
||||
UpdateShieldBlockValue();
|
||||
break;
|
||||
case STAT_AGILITY:
|
||||
UpdateArmor();
|
||||
UpdateAttackPowerAndDamage(true);
|
||||
if(getClass() == CLASS_ROGUE || getClass() == CLASS_HUNTER || getClass() == CLASS_DRUID && m_form==FORM_CAT)
|
||||
UpdateAttackPowerAndDamage();
|
||||
|
||||
UpdateAllCritPercentages();
|
||||
UpdateDodgePercentage();
|
||||
break;
|
||||
|
||||
case STAT_STAMINA: UpdateMaxHealth(); break;
|
||||
case STAT_INTELLECT:
|
||||
UpdateMaxPower(POWER_MANA);
|
||||
UpdateAllSpellCritChances();
|
||||
UpdateAttackPowerAndDamage(true); //SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT, only intellect currently
|
||||
UpdateArmor(); //SPELL_AURA_MOD_RESISTANCE_OF_INTELLECT_PERCENT, only armor currently
|
||||
break;
|
||||
|
||||
@@ -71,25 +78,8 @@ bool Player::UpdateStats(Stats stat)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
// Need update (exist AP from stat auras)
|
||||
UpdateAttackPowerAndDamage();
|
||||
UpdateAttackPowerAndDamage(true);
|
||||
|
||||
UpdateSpellDamageAndHealingBonus();
|
||||
UpdateManaRegen();
|
||||
|
||||
// Update ratings in exist SPELL_AURA_MOD_RATING_FROM_STAT and only depends from stat
|
||||
uint32 mask = 0;
|
||||
AuraList const& modRatingFromStat = GetAurasByType(SPELL_AURA_MOD_RATING_FROM_STAT);
|
||||
for(AuraList::const_iterator i = modRatingFromStat.begin();i != modRatingFromStat.end(); ++i)
|
||||
if (Stats((*i)->GetMiscBValue()) == stat)
|
||||
mask |= (*i)->GetMiscValue();
|
||||
if (mask)
|
||||
{
|
||||
for (uint32 rating = 0; rating < MAX_COMBAT_RATING; ++rating)
|
||||
if (mask & (1 << rating))
|
||||
ApplyRatingMod(CombatRating(rating), 0, true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -265,7 +255,6 @@ void Player::UpdateAttackPowerAndDamage(bool ranged )
|
||||
{
|
||||
case CLASS_WARRIOR: val2 = level*3.0f + GetStat(STAT_STRENGTH)*2.0f - 20.0f; break;
|
||||
case CLASS_PALADIN: val2 = level*3.0f + GetStat(STAT_STRENGTH)*2.0f - 20.0f; break;
|
||||
case CLASS_DEATH_KNIGHT: val2 = level*3.0f + GetStat(STAT_STRENGTH)*2.0f - 20.0f; break;
|
||||
case CLASS_ROGUE: val2 = level*2.0f + GetStat(STAT_STRENGTH) + GetStat(STAT_AGILITY) - 20.0f; break;
|
||||
case CLASS_HUNTER: val2 = level*2.0f + GetStat(STAT_STRENGTH) + GetStat(STAT_AGILITY) - 20.0f; break;
|
||||
case CLASS_SHAMAN: val2 = level*2.0f + GetStat(STAT_STRENGTH)*2.0f - 20.0f; break;
|
||||
@@ -320,20 +309,11 @@ void Player::UpdateAttackPowerAndDamage(bool ranged )
|
||||
float attPowerMod = GetModifierValue(unitMod, TOTAL_VALUE);
|
||||
|
||||
//add dynamic flat mods
|
||||
if ((getClassMask() & CLASSMASK_WAND_USERS)==0)
|
||||
if( ranged && (getClassMask() & CLASSMASK_WAND_USERS)==0)
|
||||
{
|
||||
if( ranged )
|
||||
{
|
||||
AuraList const& mRAPbyIntellect = GetAurasByType(SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT);
|
||||
for(AuraList::const_iterator i = mRAPbyIntellect.begin();i != mRAPbyIntellect.end(); ++i)
|
||||
attPowerMod += int32(GetStat(Stats((*i)->GetModifier()->m_miscvalue)) * (*i)->GetModifier()->m_amount / 100.0f);
|
||||
}
|
||||
else
|
||||
{
|
||||
AuraList const& mRAPbyIntellect = GetAurasByType(SPELL_AURA_MOD_ATTACK_POWER_OF_STAT_PERCENT);
|
||||
for(AuraList::const_iterator i = mRAPbyIntellect.begin();i != mRAPbyIntellect.end(); ++i)
|
||||
attPowerMod += int32(GetStat(Stats((*i)->GetModifier()->m_miscvalue)) * (*i)->GetModifier()->m_amount / 100.0f);
|
||||
}
|
||||
AuraList const& mRAPbyIntellect = GetAurasByType(SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT);
|
||||
for(AuraList::const_iterator i = mRAPbyIntellect.begin();i != mRAPbyIntellect.end(); ++i)
|
||||
attPowerMod += int32(GetStat(Stats((*i)->GetModifier()->m_miscvalue)) * (*i)->GetModifierValue() / 100.0f);
|
||||
}
|
||||
|
||||
float attPowerMultiplier = GetModifierValue(unitMod, TOTAL_PCT) - 1.0f;
|
||||
@@ -574,24 +554,6 @@ void Player::UpdateSpellCritChance(uint32 school)
|
||||
SetFloatValue(PLAYER_SPELL_CRIT_PERCENTAGE1 + school, crit);
|
||||
}
|
||||
|
||||
void Player::UpdateMeleeHitChances()
|
||||
{
|
||||
m_modMeleeHitChance = GetTotalAuraModifier(SPELL_AURA_MOD_HIT_CHANCE);
|
||||
m_modMeleeHitChance+= GetRatingBonusValue(CR_HIT_MELEE);
|
||||
}
|
||||
|
||||
void Player::UpdateRangedHitChances()
|
||||
{
|
||||
m_modRangedHitChance = GetTotalAuraModifier(SPELL_AURA_MOD_HIT_CHANCE);
|
||||
m_modRangedHitChance+= GetRatingBonusValue(CR_HIT_RANGED);
|
||||
}
|
||||
|
||||
void Player::UpdateSpellHitChances()
|
||||
{
|
||||
m_modSpellHitChance = GetTotalAuraModifier(SPELL_AURA_MOD_SPELL_HIT_CHANCE);
|
||||
m_modSpellHitChance+= GetRatingBonusValue(CR_HIT_SPELL);
|
||||
}
|
||||
|
||||
void Player::UpdateAllSpellCritChances()
|
||||
{
|
||||
for (int i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; i++)
|
||||
@@ -662,9 +624,9 @@ void Player::UpdateManaRegen()
|
||||
int32 modManaRegenInterrupt = GetTotalAuraModifier(SPELL_AURA_MOD_MANA_REGEN_INTERRUPT);
|
||||
if (modManaRegenInterrupt > 100)
|
||||
modManaRegenInterrupt = 100;
|
||||
SetStatFloatValue(UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER, power_regen_mp5 + power_regen * modManaRegenInterrupt / 100.0f);
|
||||
SetStatFloatValue(PLAYER_FIELD_MOD_MANA_REGEN_INTERRUPT, power_regen_mp5 + power_regen * modManaRegenInterrupt / 100.0f);
|
||||
|
||||
SetStatFloatValue(UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER, power_regen_mp5 + power_regen);
|
||||
SetStatFloatValue(PLAYER_FIELD_MOD_MANA_REGEN, power_regen_mp5 + power_regen);
|
||||
}
|
||||
|
||||
void Player::_ApplyAllStatBonuses()
|
||||
@@ -961,7 +923,7 @@ void Pet::UpdateAttackPowerAndDamage(bool ranged)
|
||||
if(getPetType() == HUNTER_PET) //hunter pets benefit from owner's attack power
|
||||
{
|
||||
bonusAP = owner->GetTotalAttackPowerValue(RANGED_ATTACK) * 0.22f;
|
||||
SetBonusDamage( int32(owner->GetTotalAttackPowerValue(RANGED_ATTACK) * 0.1287f));
|
||||
SetBonusDamage( int32(owner->GetTotalAttackPowerValue(RANGED_ATTACK) * 0.125f));
|
||||
}
|
||||
//demons benefit from warlocks shadow or fire damage
|
||||
else if(getPetType() == SUMMON_PET && owner->getClass() == CLASS_WARLOCK)
|
||||
|
||||
Reference in New Issue
Block a user