diff options
-rw-r--r-- | sql/updates/world/2013_06_20_01_world_misc.sql | 7 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_generic.cpp | 39 |
2 files changed, 46 insertions, 0 deletions
diff --git a/sql/updates/world/2013_06_20_01_world_misc.sql b/sql/updates/world/2013_06_20_01_world_misc.sql new file mode 100644 index 00000000000..426e898f601 --- /dev/null +++ b/sql/updates/world/2013_06_20_01_world_misc.sql @@ -0,0 +1,7 @@ +DELETE FROM `spell_script_names` WHERE `spell_id`=55945; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(55945,"spell_gen_spectator_cheer_trigger"); + +DELETE FROM `creature_template_addon` WHERE `entry` IN (30102,30193); +INSERT INTO `creature_template_addon` (`entry`,`bytes2`,`auras`) VALUES +(30102,1, '55944 56060'),(30193,1, '55944 56060'); 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; } |