feat(Core/Spell): Define SPELL_AURA_PREVENT_DURABILITY_LOSS (#5148)
This commit is contained in:
@@ -5570,6 +5570,11 @@ void Player::DurabilityPointsLossAll(int32 points, bool inventory)
|
|||||||
|
|
||||||
void Player::DurabilityPointsLoss(Item* item, int32 points)
|
void Player::DurabilityPointsLoss(Item* item, int32 points)
|
||||||
{
|
{
|
||||||
|
if (HasAuraType(SPELL_AURA_PREVENT_DURABILITY_LOSS))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int32 pMaxDurability = item->GetUInt32Value(ITEM_FIELD_MAXDURABILITY);
|
int32 pMaxDurability = item->GetUInt32Value(ITEM_FIELD_MAXDURABILITY);
|
||||||
int32 pOldDurability = item->GetUInt32Value(ITEM_FIELD_DURABILITY);
|
int32 pOldDurability = item->GetUInt32Value(ITEM_FIELD_DURABILITY);
|
||||||
int32 pNewDurability = pOldDurability - points;
|
int32 pNewDurability = pOldDurability - points;
|
||||||
|
|||||||
@@ -337,7 +337,7 @@ enum AuraType
|
|||||||
SPELL_AURA_ABILITY_PERIODIC_CRIT = 286,
|
SPELL_AURA_ABILITY_PERIODIC_CRIT = 286,
|
||||||
SPELL_AURA_DEFLECT_SPELLS = 287,
|
SPELL_AURA_DEFLECT_SPELLS = 287,
|
||||||
SPELL_AURA_IGNORE_HIT_DIRECTION = 288,
|
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_CRIT_PCT = 290,
|
||||||
SPELL_AURA_MOD_XP_QUEST_PCT = 291,
|
SPELL_AURA_MOD_XP_QUEST_PCT = 291,
|
||||||
SPELL_AURA_OPEN_STABLE = 292,
|
SPELL_AURA_OPEN_STABLE = 292,
|
||||||
|
|||||||
@@ -338,7 +338,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS] =
|
|||||||
&AuraEffect::HandleNoImmediateEffect, //286 SPELL_AURA_ABILITY_PERIODIC_CRIT implemented in AuraEffect::PeriodicTick
|
&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, //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::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::HandleAuraModCritPct, //290 SPELL_AURA_MOD_CRIT_PCT
|
||||||
&AuraEffect::HandleNoImmediateEffect, //291 SPELL_AURA_MOD_XP_QUEST_PCT implemented in Player::RewardQuest
|
&AuraEffect::HandleNoImmediateEffect, //291 SPELL_AURA_MOD_XP_QUEST_PCT implemented in Player::RewardQuest
|
||||||
&AuraEffect::HandleAuraOpenStable, //292 SPELL_AURA_OPEN_STABLE
|
&AuraEffect::HandleAuraOpenStable, //292 SPELL_AURA_OPEN_STABLE
|
||||||
|
|||||||
Reference in New Issue
Block a user