aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2016-05-17 00:02:55 +0200
committerShauren <shauren.trinity@gmail.com>2016-05-17 17:47:55 +0200
commit6cf1446d39db994cdca2db8f7f61da8423672bb3 (patch)
tree660201701b405c41b7d4d5e601deae66b41f8d68 /src
parentf064e782cdf4c37a740d1938f9830d0c462768c9 (diff)
Core/Auras: Implemented auras SPELL_AURA_PREVENT_DURABILITY_LOSS and SPELL_AURA_PREVENT_DURABILITY_LOSS_FROM_COMBAT
(cherry picked from commit 17118f4832d527f160dc300a52db7ba6c255bce2)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Player/Player.cpp3
-rw-r--r--src/server/game/Spells/Auras/SpellAuraDefines.h2
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.cpp2
3 files changed, 5 insertions, 2 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 50e27d9afa9..7c22a712aa4 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -4941,6 +4941,9 @@ void Player::DurabilityPointsLossAll(int32 points, bool inventory)
void Player::DurabilityPointsLoss(Item* item, int32 points)
{
+ if (HasAuraType(SPELL_AURA_PREVENT_DURABILITY_LOSS))
+ return;
+
int32 pMaxDurability = item->GetUInt32Value(ITEM_FIELD_MAXDURABILITY);
int32 pOldDurability = item->GetUInt32Value(ITEM_FIELD_DURABILITY);
int32 pNewDurability = pOldDurability - points;
diff --git a/src/server/game/Spells/Auras/SpellAuraDefines.h b/src/server/game/Spells/Auras/SpellAuraDefines.h
index e0daf59fcc2..02dd88e582a 100644
--- a/src/server/game/Spells/Auras/SpellAuraDefines.h
+++ b/src/server/game/Spells/Auras/SpellAuraDefines.h
@@ -348,7 +348,7 @@ enum AuraType
SPELL_AURA_ABILITY_PERIODIC_CRIT = 286,
SPELL_AURA_DEFLECT_SPELLS = 287,
SPELL_AURA_IGNORE_HIT_DIRECTION = 288,
- SPELL_AURA_289 = 289,
+ SPELL_AURA_PREVENT_DURABILITY_LOSS = 289,
SPELL_AURA_MOD_CRIT_PCT = 290,
SPELL_AURA_MOD_XP_QUEST_PCT = 291,
SPELL_AURA_OPEN_STABLE = 292,
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index ffe79293430..4133d0c8d65 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -346,7 +346,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]=
&AuraEffect::HandleNoImmediateEffect, //286 SPELL_AURA_ABILITY_PERIODIC_CRIT implemented in AuraEffect::PeriodicTick
&AuraEffect::HandleNoImmediateEffect, //287 SPELL_AURA_DEFLECT_SPELLS implemented in Unit::MagicSpellHitResult and Unit::MeleeSpellHitResult
&AuraEffect::HandleNoImmediateEffect, //288 SPELL_AURA_IGNORE_HIT_DIRECTION implemented in Unit::MagicSpellHitResult and Unit::MeleeSpellHitResult Unit::RollMeleeOutcomeAgainst
- &AuraEffect::HandleNULL, //289 unused (3.2.0)
+ &AuraEffect::HandleNoImmediateEffect, //289 SPELL_AURA_PREVENT_DURABILITY_LOSS implemented in Player::DurabilityPointsLoss
&AuraEffect::HandleAuraModCritPct, //290 SPELL_AURA_MOD_CRIT_PCT
&AuraEffect::HandleNoImmediateEffect, //291 SPELL_AURA_MOD_XP_QUEST_PCT implemented in Player::RewardQuest
&AuraEffect::HandleAuraOpenStable, //292 SPELL_AURA_OPEN_STABLE