Core/Spells: Fixed unapplying rockbiter weapon

Port From (https://github.com/TrinityCore/TrinityCore/commit/ba2586c92f87230c6380d7a2fe2d52c52471b9cb)
This commit is contained in:
hondacrx
2021-11-18 20:16:46 -05:00
parent a1e0e2e1d0
commit 0a2425a790
3 changed files with 8 additions and 5 deletions
+2 -2
View File
@@ -578,7 +578,7 @@ namespace Game.Entities
{
WeaponAttackType attackType = Player.GetAttackBySlot(item.GetSlot(), item.GetTemplate().GetInventoryType());
if (attackType != WeaponAttackType.Max)
UpdateDamageDoneMods(attackType);
UpdateDamageDoneMods(attackType, apply ? -1 : (int)slot);
}
break;
case ItemEnchantmentType.EquipSpell:
@@ -795,7 +795,7 @@ namespace Game.Entities
{
WeaponAttackType attackType = Player.GetAttackBySlot(item.GetSlot(), item.GetTemplate().GetInventoryType());
if (attackType != WeaponAttackType.Max)
UpdateDamageDoneMods(attackType);
UpdateDamageDoneMods(attackType, apply ? -1 : (int)slot);
break;
}
case ItemEnchantmentType.UseSpell:
+5 -2
View File
@@ -6581,9 +6581,9 @@ namespace Game.Entities
UpdateBaseModGroup(modGroup);
}
public override void UpdateDamageDoneMods(WeaponAttackType attackType)
public override void UpdateDamageDoneMods(WeaponAttackType attackType, int skipEnchantSlot = -1)
{
base.UpdateDamageDoneMods(attackType);
base.UpdateDamageDoneMods(attackType, skipEnchantSlot);
UnitMods unitMod = attackType switch
{
@@ -6600,6 +6600,9 @@ namespace Game.Entities
for (var slot = EnchantmentSlot.Perm; slot < EnchantmentSlot.Max; ++slot)
{
if (skipEnchantSlot == (int)slot)
continue;
SpellItemEnchantmentRecord enchantmentEntry = CliDB.SpellItemEnchantmentStorage.LookupByKey(item.GetEnchantmentId(slot));
if (enchantmentEntry == null)
continue;
+1 -1
View File
@@ -3811,7 +3811,7 @@ namespace Game.Entities
public virtual SpellSchoolMask GetMeleeDamageSchoolMask(WeaponAttackType attackType = WeaponAttackType.BaseAttack) { return SpellSchoolMask.None; }
public virtual void UpdateDamageDoneMods(WeaponAttackType attackType)
public virtual void UpdateDamageDoneMods(WeaponAttackType attackType, int skipEnchantSlot = -1)
{
UnitMods unitMod = attackType switch
{