diff options
-rw-r--r-- | sql/scripts/world_scripts_full.sql | 1 | ||||
-rw-r--r-- | sql/updates/world/2011_03_07_6_world_spell_script_names.sql | 3 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_item.cpp | 41 |
3 files changed, 45 insertions, 0 deletions
diff --git a/sql/scripts/world_scripts_full.sql b/sql/scripts/world_scripts_full.sql index 6a03f33eafd..3e914f259ad 100644 --- a/sql/scripts/world_scripts_full.sql +++ b/sql/scripts/world_scripts_full.sql @@ -2107,6 +2107,7 @@ INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES ( 26678, 'spell_item_create_heart_candy'), ( 64323, 'spell_item_book_of_glyph_mastery'), ( 52481, 'spell_item_gift_of_the_harvester'), +( 45853, 'spell_item_map_of_the_geyser_fields'), -- warrior ( 12975, 'spell_warr_last_stand'), ( 59725, 'spell_warr_improved_spell_reflection'), diff --git a/sql/updates/world/2011_03_07_6_world_spell_script_names.sql b/sql/updates/world/2011_03_07_6_world_spell_script_names.sql new file mode 100644 index 00000000000..fa9ffbbfc9a --- /dev/null +++ b/sql/updates/world/2011_03_07_6_world_spell_script_names.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_item_map_of_the_geyser_fields'; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(45853, 'spell_item_map_of_the_geyser_fields'); diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index dbe89f49c65..6728b25e2eb 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -922,6 +922,46 @@ class spell_item_gift_of_the_harvester : public SpellScriptLoader } }; +enum Sinkholes +{ + NPC_SOUTH_SIKNHOLE = 25664, + NPC_NORTHEAST_SIKNHOLE = 25665, + NPC_NORTHWEST_SIKNHOLE = 25666, +}; + +class spell_item_map_of_the_geyser_fields : public SpellScriptLoader +{ + public: + spell_item_map_of_the_geyser_fields() : SpellScriptLoader("spell_item_map_of_the_geyser_fields") {} + + class spell_item_map_of_the_geyser_fields_SpellScript : public SpellScript + { + PrepareSpellScript(spell_item_map_of_the_geyser_fields_SpellScript); + + SpellCastResult CheckSinkholes() + { + Unit* caster = GetCaster(); + if (caster->FindNearestCreature(NPC_SOUTH_SIKNHOLE, 5.0f, true) || + caster->FindNearestCreature(NPC_NORTHEAST_SIKNHOLE, 5.0f, true) || + caster->FindNearestCreature(NPC_NORTHWEST_SIKNHOLE, 5.0f, true)) + return SPELL_CAST_OK; + + SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_MUST_BE_CLOSE_TO_SINKHOLE); + return SPELL_FAILED_CUSTOM_ERROR; + } + + void Register() + { + OnCheckCast += SpellCheckCastFn(spell_item_map_of_the_geyser_fields_SpellScript::CheckSinkholes); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_item_map_of_the_geyser_fields_SpellScript(); + } +}; + void AddSC_item_spell_scripts() { // 23074 Arcanite Dragonling @@ -949,4 +989,5 @@ void AddSC_item_spell_scripts() new spell_item_create_heart_candy(); new spell_item_book_of_glyph_mastery(); new spell_item_gift_of_the_harvester(); + new spell_item_map_of_the_geyser_fields(); } |