mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 15:40:45 +01:00
Core/Scripts: prevent applying Aspect of the Beast on pet load if owner has switched aspects
This commit is contained in:
3
sql/updates/world/3.3.5/2017_12_28_06_world.sql
Normal file
3
sql/updates/world/3.3.5/2017_12_28_06_world.sql
Normal file
@@ -0,0 +1,3 @@
|
||||
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_hun_aspect_of_the_beast_pet';
|
||||
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
|
||||
(61669, 'spell_hun_aspect_of_the_beast_pet');
|
||||
@@ -32,6 +32,7 @@
|
||||
|
||||
enum HunterSpells
|
||||
{
|
||||
SPELL_HUNTER_ASPECT_OF_THE_BEAST = 13161,
|
||||
SPELL_HUNTER_ASPECT_OF_THE_BEAST_PET = 61669,
|
||||
SPELL_HUNTER_ASPECT_OF_THE_VIPER = 34074,
|
||||
SPELL_HUNTER_ASPECT_OF_THE_VIPER_ENERGIZE = 34075,
|
||||
@@ -119,6 +120,34 @@ class spell_hun_aspect_of_the_beast : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// 61669 - Aspect of the Beast
|
||||
class spell_hun_aspect_of_the_beast_pet : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_hun_aspect_of_the_beast_pet);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_HUNTER_ASPECT_OF_THE_BEAST });
|
||||
}
|
||||
|
||||
bool Load() override
|
||||
{
|
||||
return GetUnitOwner()->GetSpellModOwner();
|
||||
}
|
||||
|
||||
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Player* owner = GetUnitOwner()->GetSpellModOwner();
|
||||
if (!owner->HasAura(SPELL_HUNTER_ASPECT_OF_THE_BEAST))
|
||||
Remove();
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_hun_aspect_of_the_beast_pet::OnApply, EFFECT_0, SPELL_AURA_UNTRACKABLE, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
// 34074 - Aspect of the Viper
|
||||
class spell_hun_ascpect_of_the_viper : public SpellScriptLoader
|
||||
{
|
||||
@@ -1593,6 +1622,7 @@ class spell_hun_viper_attack_speed : public SpellScriptLoader
|
||||
void AddSC_hunter_spell_scripts()
|
||||
{
|
||||
new spell_hun_aspect_of_the_beast();
|
||||
RegisterAuraScript(spell_hun_aspect_of_the_beast_pet);
|
||||
new spell_hun_ascpect_of_the_viper();
|
||||
new spell_hun_chimera_shot();
|
||||
new spell_hun_cobra_strikes();
|
||||
|
||||
Reference in New Issue
Block a user