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:
@@ -251,8 +251,9 @@ namespace Game.Entities
|
||||
else if (slot == EquipmentSlot.OffHand)
|
||||
attType = WeaponAttackType.OffAttack;
|
||||
|
||||
uint itemLevel = item.GetItemLevel(this);
|
||||
float minDamage, maxDamage;
|
||||
item.GetDamage(this, out minDamage, out maxDamage);
|
||||
proto.GetDamage(itemLevel, out minDamage, out maxDamage);
|
||||
|
||||
if (minDamage > 0)
|
||||
{
|
||||
@@ -270,6 +271,22 @@ namespace Game.Entities
|
||||
if (proto.GetDelay() != 0 && !(shapeshift != null && shapeshift.CombatRoundTime != 0))
|
||||
SetBaseAttackTime(attType, apply ? proto.GetDelay() : SharedConst.BaseAttackTime);
|
||||
|
||||
int weaponBasedAttackPower = apply ? (int)(proto.GetDPS(itemLevel) * 6.0f) : 0;
|
||||
switch (attType)
|
||||
{
|
||||
case WeaponAttackType.BaseAttack:
|
||||
SetMainHandWeaponAttackPower(weaponBasedAttackPower);
|
||||
break;
|
||||
case WeaponAttackType.OffAttack:
|
||||
SetOffHandWeaponAttackPower(weaponBasedAttackPower);
|
||||
break;
|
||||
case WeaponAttackType.RangedAttack:
|
||||
SetRangedWeaponAttackPower(weaponBasedAttackPower);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (CanModifyStats() && (damage != 0 || proto.GetDelay() != 0))
|
||||
UpdateDamagePhysical(attType);
|
||||
}
|
||||
|
||||
@@ -4230,21 +4230,12 @@ namespace Game.Entities
|
||||
}
|
||||
}
|
||||
|
||||
uint armor = item.GetArmor(this);
|
||||
uint armor = proto.GetArmor(itemLevel);
|
||||
if (armor != 0)
|
||||
HandleStatFlatModifier(UnitMods.Armor, UnitModifierFlatType.Base, (float)armor, apply);
|
||||
|
||||
WeaponAttackType attType = WeaponAttackType.BaseAttack;
|
||||
if (slot == EquipmentSlot.MainHand && (proto.GetInventoryType() == InventoryType.Ranged || proto.GetInventoryType() == InventoryType.RangedRight))
|
||||
{
|
||||
attType = WeaponAttackType.RangedAttack;
|
||||
}
|
||||
else if (slot == EquipmentSlot.OffHand)
|
||||
{
|
||||
attType = WeaponAttackType.OffAttack;
|
||||
}
|
||||
|
||||
if (CanUseAttackType(attType))
|
||||
WeaponAttackType attType = GetAttackBySlot(slot, proto.GetInventoryType());
|
||||
if (attType != WeaponAttackType.Max && CanUseAttackType(attType))
|
||||
_ApplyWeaponDamage(slot, item, apply);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user