diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/World/item_scripts.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
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(); } |