From ea9e88a48cb4c61755248e5ac4aa9d3dad6f2079 Mon Sep 17 00:00:00 2001 From: click Date: Sun, 21 Nov 2010 23:43:44 +0100 Subject: Core/Scripts: Add support for questID 25444 (Da Perfect Spies) --HG-- branch : trunk --- src/server/scripts/World/item_scripts.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src') 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(); } -- cgit v1.2.3