diff options
author | thesensei <aconstantgoal@abv.bg> | 2012-08-28 20:58:03 +0300 |
---|---|---|
committer | Subv <s.v.h21@hotmail.com> | 2012-08-28 20:10:01 -0500 |
commit | 8f9dad3d7637a18a5e3cc96dfe32826c810f17b3 (patch) | |
tree | 2205cab3abbf78b0712e7183ea627f7c1314547d | |
parent | 6af514d592115dda44dde46a2f2420b35cbd08a9 (diff) |
Core/Spells: Destabilize Azure Dragonshrine
*Spell script support for spell 49370
-rw-r--r-- | sql/updates/world/2012_08_28_00_world_spell_script_name.sql | 4 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_quest.cpp | 41 |
2 files changed, 45 insertions, 0 deletions
diff --git a/sql/updates/world/2012_08_28_00_world_spell_script_name.sql b/sql/updates/world/2012_08_28_00_world_spell_script_name.sql new file mode 100644 index 00000000000..9cc18a4fa5a --- /dev/null +++ b/sql/updates/world/2012_08_28_00_world_spell_script_name.sql @@ -0,0 +1,4 @@ +-- Spell script name linking for Defending Wyrmrest Temple: Destabilize Azure Dragonshrine Effect +DELETE FROM `spell_script_names` WHERE `spell_id`=49370 ; +INSERT INTO `spell_script_names` VALUES +(49370,'spell_q12372_destabilize_azure_dragonshrine_dummy');
\ No newline at end of file diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index 8b67a52d300..759dbfe802d 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -1276,6 +1276,46 @@ class spell_q12372_cast_from_gossip_trigger : public SpellScriptLoader } }; +// http://www.wowhead.com/quest=12372 Defending Wyrmrest Temple +// 49370 - Wyrmrest Defender: Destabilize Azure Dragonshrine Effect +enum eQuest12372Data +{ + NPC_WYRMREST_TEMPLE_CREDIT = 27698, +}; + +class spell_q12372_destabilize_azure_dragonshrine_dummy : public SpellScriptLoader +{ + public: + spell_q12372_destabilize_azure_dragonshrine_dummy() : SpellScriptLoader("spell_q12372_destabilize_azure_dragonshrine_dummy") { } + + class spell_q12372_destabilize_azure_dragonshrine_dummy_SpellScript : public SpellScript + { + PrepareSpellScript(spell_q12372_destabilize_azure_dragonshrine_dummy_SpellScript); + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + if (GetHitCreature()) + { + if (Unit* caster = GetOriginalCaster()) + if (Vehicle* vehicle = caster->GetVehicleKit()) + if (Unit* passenger = vehicle->GetPassenger(0)) + if (Player* player = passenger->ToPlayer()) + player->KilledMonsterCredit(NPC_WYRMREST_TEMPLE_CREDIT, 0); + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_q12372_destabilize_azure_dragonshrine_dummy_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_q12372_destabilize_azure_dragonshrine_dummy_SpellScript(); + } +}; + void AddSC_quest_spell_scripts() { new spell_q55_sacred_cleansing(); @@ -1306,4 +1346,5 @@ void AddSC_quest_spell_scripts() new spell_q12066_bunny_kill_credit(); new spell_q12735_song_of_cleansing(); new spell_q12372_cast_from_gossip_trigger(); + new spell_q12372_destabilize_azure_dragonshrine_dummy(); } |