diff options
author | Shauren <shauren.trinity@gmail.com> | 2016-05-28 11:33:06 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2016-05-28 11:33:06 +0200 |
commit | cd51e27e195c67bc9f2e3a38c1e5e8a5a243e6bf (patch) | |
tree | 46cb1a2a968eda9c500a05ffbba0eda6ae8c393c | |
parent | 468dbd8a65e6362552edcc2f24f94b9e394d37b7 (diff) |
Core/Auras: Implemented aura 475 - SPELL_AURA_ALLOW_USING_GAMEOBJECTS_WHILE_MOUNTED
-rw-r--r-- | src/server/game/Spells/Auras/SpellAuraDefines.h | 2 | ||||
-rw-r--r-- | src/server/game/Spells/Auras/SpellAuraEffects.cpp | 16 | ||||
-rw-r--r-- | src/server/game/Spells/Auras/SpellAuraEffects.h | 1 |
3 files changed, 17 insertions, 2 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuraDefines.h b/src/server/game/Spells/Auras/SpellAuraDefines.h index d781a8822b8..3663843868a 100644 --- a/src/server/game/Spells/Auras/SpellAuraDefines.h +++ b/src/server/game/Spells/Auras/SpellAuraDefines.h @@ -531,7 +531,7 @@ enum AuraType SPELL_AURA_472 = 472, SPELL_AURA_PREVENT_DURABILITY_LOSS_FROM_COMBAT = 473, // Prevents durability loss from dealing/taking damage SPELL_AURA_474 = 474, - SPELL_AURA_475 = 475, + SPELL_AURA_ALLOW_USING_GAMEOBJECTS_WHILE_MOUNTED = 475, SPELL_AURA_476 = 476, SPELL_AURA_477 = 477, SPELL_AURA_478 = 478, diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index d866691bda5..a5926e8f85c 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -534,7 +534,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]= &AuraEffect::HandleNULL, //472 &AuraEffect::HandleNoImmediateEffect, //473 SPELL_AURA_PREVENT_DURABILITY_LOSS_FROM_COMBAT implemented in Player::DurabilityPointLossForEquipSlot &AuraEffect::HandleNULL, //474 - &AuraEffect::HandleNULL, //475 + &AuraEffect::HandleAllowUsingGameobjectsWhileMounted, //475 SPELL_AURA_ALLOW_USING_GAMEOBJECTS_WHILE_MOUNTED &AuraEffect::HandleNULL, //476 &AuraEffect::HandleNULL, //477 &AuraEffect::HandleNULL, //478 @@ -6674,3 +6674,17 @@ void AuraEffect::HandleOverridePetSpecs(AuraApplication const* aurApp, uint8 mod pet->SetSpecialization(sChrSpecializationByIndexStore[apply ? PET_SPEC_OVERRIDE_CLASS_INDEX : 0][currSpec->OrderIndex]->ID); } + +void AuraEffect::HandleAllowUsingGameobjectsWhileMounted(AuraApplication const* aurApp, uint8 mode, bool apply) const +{ + if (!(mode & AURA_EFFECT_HANDLE_REAL)) + return; + + if (aurApp->GetTarget()->GetTypeId() != TYPEID_PLAYER) + return; + + if (apply) + aurApp->GetTarget()->SetFlag(PLAYER_FIELD_LOCAL_FLAGS, PLAYER_LOCAL_FLAG_CAN_USE_OBJECTS_MOUNTED); + else if (!aurApp->GetTarget()->HasAuraType(SPELL_AURA_ALLOW_USING_GAMEOBJECTS_WHILE_MOUNTED)) + aurApp->GetTarget()->RemoveFlag(PLAYER_FIELD_LOCAL_FLAGS, PLAYER_LOCAL_FLAG_CAN_USE_OBJECTS_MOUNTED); +} diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.h b/src/server/game/Spells/Auras/SpellAuraEffects.h index 512852a39ec..39b1cdf3eb8 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.h +++ b/src/server/game/Spells/Auras/SpellAuraEffects.h @@ -305,6 +305,7 @@ class TC_GAME_API AuraEffect void HandleEnableAltPower(AuraApplication const* aurApp, uint8 mode, bool apply) const; void HandleModSpellCategoryCooldown(AuraApplication const* aurApp, uint8 mode, bool apply) const; void HandleOverridePetSpecs(AuraApplication const* aurApp, uint8 mode, bool apply) const; + void HandleAllowUsingGameobjectsWhileMounted(AuraApplication const* aurApp, uint8 mode, bool apply) const; // aura effect periodic tick handlers void HandlePeriodicDummyAuraTick(Unit* target, Unit* caster) const; |