diff options
author | Malcrom <malcromdev@gmail.com> | 2013-06-20 17:15:27 -0230 |
---|---|---|
committer | Malcrom <malcromdev@gmail.com> | 2013-06-20 17:15:27 -0230 |
commit | 1554ca8b1ffd88c314199f03d37f5fd4eb3ac928 (patch) | |
tree | 78ca151f394ec029680006947c8d5f745d8a01f7 /src | |
parent | 8224116f89f1b37f67a9faff5104582d7e5a519c (diff) |
Core/Scripting: Add spell script for spell 55945 Spectator - Cheer Trigger
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/Spells/spell_generic.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index c591f3141ed..8919244308a 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -3601,6 +3601,44 @@ class spell_gen_whisper_gulch_yogg_saron_whisper : public SpellScriptLoader } }; +enum SpectatorCheerTrigger + +{ + EMOTE_ONE_SHOT_CHEER = 4, + EMOTE_ONE_SHOT_EXCLAMATION = 5, + EMOTE_ONE_SHOT_APPLAUD = 21 +}; + +uint8 const EmoteArray [3] = { EMOTE_ONE_SHOT_CHEER, EMOTE_ONE_SHOT_EXCLAMATION, EMOTE_ONE_SHOT_APPLAUD }; + +class spell_gen_spectator_cheer_trigger : public SpellScriptLoader +{ + public: + spell_gen_spectator_cheer_trigger() : SpellScriptLoader("spell_gen_spectator_cheer_trigger") { } + + class spell_gen_spectator_cheer_trigger_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gen_spectator_cheer_trigger_SpellScript) + + void HandleDummy(SpellEffIndex /* effIndex */) + { + if (Unit* caster = GetCaster()) + caster->HandleEmoteCommand(EmoteArray [urand(0,2)]); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_gen_spectator_cheer_trigger_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_gen_spectator_cheer_trigger_SpellScript(); + } + +}; + void AddSC_generic_spell_scripts() { new spell_gen_absorb0_hitlimit1(); @@ -3682,4 +3720,5 @@ void AddSC_generic_spell_scripts() new spell_gen_aura_service_uniform(); new spell_gen_orc_disguise(); new spell_gen_whisper_gulch_yogg_saron_whisper(); + new spell_gen_spectator_cheer_trigger; } |