diff options
-rw-r--r-- | sql/scripts/world_scripts_full.sql | 1 | ||||
-rw-r--r-- | sql/updates/10490_world_scriptname.sql | 2 | ||||
-rw-r--r-- | src/server/scripts/World/item_scripts.cpp | 27 |
3 files changed, 30 insertions, 0 deletions
diff --git a/sql/scripts/world_scripts_full.sql b/sql/scripts/world_scripts_full.sql index 30b3c581523..f3ad34d4050 100644 --- a/sql/scripts/world_scripts_full.sql +++ b/sql/scripts/world_scripts_full.sql @@ -121,6 +121,7 @@ UPDATE `item_template` SET `ScriptName`='item_disgusting_jar' WHERE `entry` IN(4 UPDATE `item_template` SET `ScriptName`='item_harvesters_gift' WHERE `entry`=39253; UPDATE `item_template` SET `ScriptName`='item_petrov_cluster_bombs' WHERE `entry`=33098; UPDATE `item_template` SET `ScriptName`='item_Trident_of_Nazjan' WHERE `entry`=35850; +UPDATE `item_template` SET `ScriptName`='item_captured_frog' WHERE `entry`=53510; /* NPC (usually creatures to be found in more than one specific zone) */ UPDATE `creature_template` SET `ScriptName`='npc_air_force_bots' WHERE `entry` IN (2614,2615,21974,21993,21996,21997,21999,22001,22002,22003,22063,22065,22066,22068,22069,22070,22071,22078,22079,22080,22086,22087,22088,22090,22124,22125,22126); diff --git a/sql/updates/10490_world_scriptname.sql b/sql/updates/10490_world_scriptname.sql new file mode 100644 index 00000000000..ead063856bb --- /dev/null +++ b/sql/updates/10490_world_scriptname.sql @@ -0,0 +1,2 @@ +-- ScriptName for Captured Frog +UPDATE `item_template` SET `ScriptName`= 'item_captured_frog' WHERE `entry`=53510; diff --git a/src/server/scripts/World/item_scripts.cpp b/src/server/scripts/World/item_scripts.cpp index 8500c289119..fa77089f8c5 100644 --- a/src/server/scripts/World/item_scripts.cpp +++ b/src/server/scripts/World/item_scripts.cpp @@ -485,6 +485,32 @@ public: } }; +enum eCapturedFrog +{ + QUEST_THE_PERFECT_SPIES = 25444, + NPC_VANIRAS_SENTRY_TOTEM = 40187 +}; + +class item_captured_frog : public ItemScript +{ +public: + item_captured_frog() : ItemScript("item_captured_frog") { } + + bool OnUse(Player* pPlayer, Item* pItem, SpellCastTargets const& /*targets*/) + { + if (pPlayer->GetQuestStatus(QUEST_THE_PERFECT_SPIES) == QUEST_STATUS_INCOMPLETE) + { + if (Creature* target = pPlayer->FindNearestCreature(NPC_VANIRAS_SENTRY_TOTEM, 10.0f)) + return false; + else + pPlayer->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, pItem, NULL); + } + else + pPlayer->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, pItem, NULL); + return true; + } +}; + void AddSC_item_scripts() { new item_only_for_flight; @@ -500,4 +526,5 @@ void AddSC_item_scripts() new item_petrov_cluster_bombs; new item_dehta_trap_smasher; new item_trident_of_nazjan; + new item_captured_frog(); } |