mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 02:04:52 +01:00
Merge pull request #9193 from drskull/master
Core: Fix Feral Spirit attack speed and update attack power
This commit is contained in:
@@ -72,6 +72,7 @@ class Minion : public TempSummon
|
||||
float GetFollowAngle() const { return m_followAngle; }
|
||||
void SetFollowAngle(float angle) { m_followAngle = angle; }
|
||||
bool IsPetGhoul() const {return GetEntry() == 26125;} // Ghoul may be guardian or pet
|
||||
bool IsSpiritWolf() const {return GetEntry() == 29264;} // Spirit wolf from feral spirits
|
||||
bool IsGuardianPet() const;
|
||||
protected:
|
||||
Unit* const m_owner;
|
||||
|
||||
@@ -1003,15 +1003,11 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
|
||||
if (!pInfo)
|
||||
SetCreateHealth(30*petlevel);
|
||||
|
||||
float dmg_multiplier = 0.3f;
|
||||
if (m_owner->GetAuraEffect(63271, 0)) // Glyph of Feral Spirit
|
||||
dmg_multiplier = 0.6f;
|
||||
// wolf attack speed is 1.5s
|
||||
SetAttackTime(BASE_ATTACK, cinfo->baseattacktime);
|
||||
|
||||
SetBonusDamage(int32(m_owner->GetTotalAttackPowerValue(BASE_ATTACK) * dmg_multiplier));
|
||||
|
||||
// 14AP == 1dps, wolf's strike speed == 2s so dmg = basedmg + AP / 14 * 2
|
||||
SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float((petlevel * 4 - petlevel) + (m_owner->GetTotalAttackPowerValue(BASE_ATTACK) * dmg_multiplier * 2 / 14)));
|
||||
SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float((petlevel * 4 + petlevel) + (m_owner->GetTotalAttackPowerValue(BASE_ATTACK) * dmg_multiplier * 2 / 14)));
|
||||
SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float((petlevel * 4 - petlevel)));
|
||||
SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float((petlevel * 4 + petlevel)));
|
||||
|
||||
SetModifierValue(UNIT_MOD_ARMOR, BASE_VALUE, float(m_owner->GetArmor()) * 0.35f); // Bonus Armor (35% of player armor)
|
||||
SetModifierValue(UNIT_MOD_STAT_STAMINA, BASE_VALUE, float(m_owner->GetStat(STAT_STAMINA)) * 0.3f); // Bonus Stamina (30% of player stamina)
|
||||
|
||||
@@ -441,6 +441,7 @@ void Player::UpdateAttackPowerAndDamage(bool ranged)
|
||||
SetFloatValue(index_mult, attPowerMultiplier); //UNIT_FIELD_(RANGED)_ATTACK_POWER_MULTIPLIER field
|
||||
|
||||
Pet* pet = GetPet(); //update pet's AP
|
||||
Guardian* guardian = GetGuardianPet();
|
||||
//automatically update weapon damage after attack power modification
|
||||
if (ranged)
|
||||
{
|
||||
@@ -456,8 +457,11 @@ void Player::UpdateAttackPowerAndDamage(bool ranged)
|
||||
if (getClass() == CLASS_SHAMAN || getClass() == CLASS_PALADIN) // mental quickness
|
||||
UpdateSpellDamageAndHealingBonus();
|
||||
|
||||
if (pet && pet->IsPetGhoul()) // At ranged attack change for hunter pet
|
||||
if (pet && pet->IsPetGhoul()) // At melee attack power change for DK pet
|
||||
pet->UpdateAttackPowerAndDamage();
|
||||
|
||||
if (guardian && guardian->IsSpiritWolf()) // At melee attack power change for Shaman feral spirit
|
||||
guardian->UpdateAttackPowerAndDamage();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1305,6 +1309,14 @@ void Guardian::UpdateAttackPowerAndDamage(bool ranged)
|
||||
bonusAP = owner->GetTotalAttackPowerValue(BASE_ATTACK) * 0.22f;
|
||||
SetBonusDamage(int32(owner->GetTotalAttackPowerValue(BASE_ATTACK) * 0.1287f));
|
||||
}
|
||||
else if (IsSpiritWolf()) //wolf benefit from shaman's attack power
|
||||
{
|
||||
float dmg_multiplier = 0.31f;
|
||||
if (m_owner->GetAuraEffect(63271, 0)) // Glyph of Feral Spirit
|
||||
dmg_multiplier = 0.61f;
|
||||
bonusAP = owner->GetTotalAttackPowerValue(BASE_ATTACK) * dmg_multiplier;
|
||||
SetBonusDamage(int32(owner->GetTotalAttackPowerValue(BASE_ATTACK) * dmg_multiplier));
|
||||
}
|
||||
//demons benefit from warlocks shadow or fire damage
|
||||
else if (isPet())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user