Core/Spells: Implemented using base weapon damage in spell attack power formulas
Port From (https://github.com/TrinityCore/TrinityCore/commit/dd21e7ff404aed1d449b09db2b7fcbe2be8536c3)
This commit is contained in:
@@ -2253,18 +2253,30 @@ namespace Game.Entities
|
||||
return weapon.GetTemplate().GetDelay() / 1000.0f;
|
||||
}
|
||||
}
|
||||
public float GetTotalAttackPowerValue(WeaponAttackType attType)
|
||||
public float GetTotalAttackPowerValue(WeaponAttackType attType, bool includeWeapon = true)
|
||||
{
|
||||
if (attType == WeaponAttackType.RangedAttack)
|
||||
{
|
||||
int ap = m_unitData.RangedAttackPower;
|
||||
float ap = m_unitData.RangedAttackPower + m_unitData.RangedAttackPowerModPos + m_unitData.RangedAttackPowerModNeg;
|
||||
if (includeWeapon)
|
||||
ap += Math.Max(m_unitData.MainHandWeaponAttackPower, m_unitData.RangedWeaponAttackPower);
|
||||
if (ap < 0)
|
||||
return 0.0f;
|
||||
return ap * (1.0f + m_unitData.RangedAttackPowerMultiplier);
|
||||
}
|
||||
else
|
||||
{
|
||||
int ap = m_unitData.AttackPower;
|
||||
float ap = m_unitData.AttackPower + m_unitData.AttackPowerModPos + m_unitData.AttackPowerModNeg;
|
||||
if (includeWeapon)
|
||||
{
|
||||
if (attType == WeaponAttackType.BaseAttack)
|
||||
ap += Math.Max(m_unitData.MainHandWeaponAttackPower, m_unitData.RangedWeaponAttackPower);
|
||||
else
|
||||
{
|
||||
ap += m_unitData.OffHandWeaponAttackPower;
|
||||
ap /= 2;
|
||||
}
|
||||
}
|
||||
if (ap < 0)
|
||||
return 0.0f;
|
||||
return ap * (1.0f + m_unitData.AttackPowerMultiplier);
|
||||
|
||||
@@ -128,8 +128,14 @@ namespace Game.Entities
|
||||
ApCoeffMod /= 100.0f;
|
||||
}
|
||||
|
||||
WeaponAttackType attType = (spellProto.IsRangedWeaponSpell() && spellProto.DmgClass != SpellDmgClass.Melee) ? WeaponAttackType.RangedAttack : WeaponAttackType.BaseAttack;
|
||||
float APbonus = victim.GetTotalAuraModifier(attType == WeaponAttackType.BaseAttack ? AuraType.MeleeAttackPowerAttackerBonus : AuraType.RangedAttackPowerAttackerBonus);
|
||||
WeaponAttackType attType = WeaponAttackType.BaseAttack;
|
||||
if ((spellProto.IsRangedWeaponSpell() && spellProto.DmgClass != SpellDmgClass.Melee))
|
||||
attType = WeaponAttackType.RangedAttack;
|
||||
|
||||
if (spellProto.HasAttribute(SpellAttr3.ReqOffhand) && !spellProto.HasAttribute(SpellAttr3.MainHand))
|
||||
attType = WeaponAttackType.OffAttack;
|
||||
|
||||
float APbonus = (float)(victim.GetTotalAuraModifier(attType != WeaponAttackType.RangedAttack ? AuraType.MeleeAttackPowerAttackerBonus : AuraType.RangedAttackPowerAttackerBonus));
|
||||
APbonus += GetTotalAttackPowerValue(attType);
|
||||
DoneTotal += (int)(stack * ApCoeffMod * APbonus);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user