diff --git a/Source/Framework/Constants/Spells/SpellConst.cs b/Source/Framework/Constants/Spells/SpellConst.cs index 8f2fab150..78b61fbb2 100644 --- a/Source/Framework/Constants/Spells/SpellConst.cs +++ b/Source/Framework/Constants/Spells/SpellConst.cs @@ -1683,7 +1683,7 @@ namespace Framework.Constants Unk2 = 0x04, // 2 BlockableSpell = 0x08, // 3 Only Dmg Class Melee In 3.1.3 IgnoreResurrectionTimer = 0x10, // 4 You Don'T Have To Wait To Be Resurrected With These Spells - Unk5 = 0x20, // 5 + NoDurabilityLoss = 0x20, // 5 No Durability Loss Unk6 = 0x40, // 6 StackForDiffCasters = 0x80, // 7 Separate Stack For Every Caster OnlyTargetPlayers = 0x100, // 8 Can Only Target Players diff --git a/Source/Game/Entities/Unit/Unit.cs b/Source/Game/Entities/Unit/Unit.cs index b358c0c91..3e6f63031 100644 --- a/Source/Game/Entities/Unit/Unit.cs +++ b/Source/Game/Entities/Unit/Unit.cs @@ -2585,6 +2585,9 @@ namespace Game.Entities } } + if (spellProto != null && spellProto.HasAttribute(SpellAttr3.NoDurabilityLoss)) + durabilityLoss = false; + if (killed) Kill(attacker, victim, durabilityLoss, skipSettingDeathState); else @@ -2609,7 +2612,7 @@ namespace Game.Entities else // victim is a player { // random durability for items (HIT TAKEN) - if (WorldConfig.GetFloatValue(WorldCfg.RateDurabilityLossDamage) > RandomHelper.randChance()) + if (durabilityLoss && WorldConfig.GetFloatValue(WorldCfg.RateDurabilityLossDamage) > RandomHelper.randChance()) { byte slot = (byte)RandomHelper.IRand(0, EquipmentSlot.End - 1); victim.ToPlayer().DurabilityPointLossForEquipSlot(slot); @@ -2619,7 +2622,7 @@ namespace Game.Entities if (attacker != null && attacker.IsPlayer()) { // random durability for items (HIT DONE) - if (RandomHelper.randChance(WorldConfig.GetFloatValue(WorldCfg.RateDurabilityLossDamage))) + if (durabilityLoss && RandomHelper.randChance(WorldConfig.GetFloatValue(WorldCfg.RateDurabilityLossDamage))) { byte slot = (byte)RandomHelper.IRand(0, EquipmentSlot.End - 1); attacker.ToPlayer().DurabilityPointLossForEquipSlot(slot);