Advertisement
Guest User

Untitled

a guest
Feb 1st, 2011
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 40.40 KB | None | 0 0
  1. /*
  2.  * Copyright (C) 2008-2010 TrinityCore <http://www.trinitycore.org/>
  3.  * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
  4.  *
  5.  * This program is free software; you can redistribute it and/or modify it
  6.  * under the terms of the GNU General Public License as published by the
  7.  * Free Software Foundation; either version 2 of the License, or (at your
  8.  * option) any later version.
  9.  *
  10.  * This program is distributed in the hope that it will be useful, but WITHOUT
  11.  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12.  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  13.  * more details.
  14.  *
  15.  * You should have received a copy of the GNU General Public License along
  16.  * with this program. If not, see <http://www.gnu.org/licenses/>.
  17.  */
  18.  
  19. /* ScriptData
  20. SDName: GO_Scripts
  21. SD%Complete: 100
  22. SDComment: Quest support: 4285,4287,4288(crystal pylons), 4296, 6481, 10990, 10991, 10992, Field_Repair_Bot->Teaches spell 22704. Barov_journal->Teaches spell 26089,12843,12982, 2936. Soulwell
  23. SDCategory: Game Objects
  24. EndScriptData */
  25.  
  26. /* ContentData
  27. go_cat_figurine (the "trap" version of GO, two different exist)
  28. go_northern_crystal_pylon
  29. go_eastern_crystal_pylon
  30. go_western_crystal_pylon
  31. go_barov_journal
  32. go_ethereum_prison
  33. go_ethereum_stasis
  34. go_sacred_fire_of_life
  35. go_shrine_of_the_birds
  36. go_southfury_moonstone
  37. go_field_repair_bot_74A
  38. go_orb_of_command
  39. go_resonite_cask
  40. go_tablet_of_madness
  41. go_tablet_of_the_seven
  42. go_tele_to_dalaran_crystal
  43. go_tele_to_violet_stand
  44. go_rusty_cage
  45. go_scourge_cage
  46. go_jotunheim_cage
  47. go_table_theka
  48. go_soulwell
  49. go_bashir_crystalforge
  50. go_buffer
  51. EndContentData */
  52.  
  53. #include "ScriptPCH.h"
  54.  
  55. /*######
  56. ## go_cat_figurine
  57. ######*/
  58.  
  59. enum eCatFigurine
  60. {
  61.     SPELL_SUMMON_GHOST_SABER    = 5968,
  62. };
  63.  
  64. class go_cat_figurine : public GameObjectScript
  65. {
  66. public:
  67.     go_cat_figurine() : GameObjectScript("go_cat_figurine") { }
  68.  
  69.     bool OnGossipHello(Player *pPlayer, GameObject * /*pGO*/)
  70.     {
  71.         pPlayer->CastSpell(pPlayer,SPELL_SUMMON_GHOST_SABER,true);
  72.         return false;
  73.     }
  74. };
  75.  
  76. /*######
  77. ## go_crystal_pylons (3x)
  78. ######*/
  79. class go_northern_crystal_pylon : public GameObjectScript
  80. {
  81. public:
  82.     go_northern_crystal_pylon() : GameObjectScript("go_northern_crystal_pylon") { }
  83.  
  84.     bool OnGossipHello(Player *pPlayer, GameObject *pGO)
  85.     {
  86.         if (pGO->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER)
  87.         {
  88.             pPlayer->PrepareQuestMenu(pGO->GetGUID());
  89.             pPlayer->SendPreparedQuest(pGO->GetGUID());
  90.         }
  91.  
  92.         if (pPlayer->GetQuestStatus(4285) == QUEST_STATUS_INCOMPLETE)
  93.             pPlayer->AreaExploredOrEventHappens(4285);
  94.  
  95.         return true;
  96.     }
  97. };
  98.  
  99. class go_eastern_crystal_pylon : public GameObjectScript
  100. {
  101. public:
  102.     go_eastern_crystal_pylon() : GameObjectScript("go_eastern_crystal_pylon") { }
  103.  
  104.     bool OnGossipHello(Player *pPlayer, GameObject *pGO)
  105.     {
  106.         if (pGO->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER)
  107.         {
  108.             pPlayer->PrepareQuestMenu(pGO->GetGUID());
  109.             pPlayer->SendPreparedQuest(pGO->GetGUID());
  110.         }
  111.  
  112.         if (pPlayer->GetQuestStatus(4287) == QUEST_STATUS_INCOMPLETE)
  113.             pPlayer->AreaExploredOrEventHappens(4287);
  114.  
  115.         return true;
  116.     }
  117. };
  118.  
  119. class go_western_crystal_pylon : public GameObjectScript
  120. {
  121. public:
  122.     go_western_crystal_pylon() : GameObjectScript("go_western_crystal_pylon") { }
  123.  
  124.     bool OnGossipHello(Player *pPlayer, GameObject *pGO)
  125.     {
  126.         if (pGO->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER)
  127.         {
  128.             pPlayer->PrepareQuestMenu(pGO->GetGUID());
  129.             pPlayer->SendPreparedQuest(pGO->GetGUID());
  130.         }
  131.  
  132.         if (pPlayer->GetQuestStatus(4288) == QUEST_STATUS_INCOMPLETE)
  133.             pPlayer->AreaExploredOrEventHappens(4288);
  134.  
  135.         return true;
  136.     }
  137. };
  138.  
  139. /*######
  140. ## go_barov_journal
  141. ######*/
  142.  
  143. class go_barov_journal : public GameObjectScript
  144. {
  145. public:
  146.     go_barov_journal() : GameObjectScript("go_barov_journal") { }
  147.  
  148.     bool OnGossipHello(Player *pPlayer, GameObject * /*pGO*/)
  149.     {
  150.         if (pPlayer->HasSkill(SKILL_TAILORING) && pPlayer->GetBaseSkillValue(SKILL_TAILORING) >= 280 && !pPlayer->HasSpell(26086))
  151.         {
  152.             pPlayer->CastSpell(pPlayer,26095,false);
  153.         }
  154.         return true;
  155.     }
  156. };
  157.  
  158. /*######
  159. ## go_field_repair_bot_74A
  160. ######*/
  161.  
  162. class go_field_repair_bot_74A : public GameObjectScript
  163. {
  164. public:
  165.     go_field_repair_bot_74A() : GameObjectScript("go_field_repair_bot_74A") { }
  166.  
  167.     bool OnGossipHello(Player *pPlayer, GameObject * /*pGO*/)
  168.     {
  169.         if (pPlayer->HasSkill(SKILL_ENGINERING) && pPlayer->GetBaseSkillValue(SKILL_ENGINERING) >= 300 && !pPlayer->HasSpell(22704))
  170.         {
  171.             pPlayer->CastSpell(pPlayer,22864,false);
  172.         }
  173.         return true;
  174.     }
  175. };
  176.  
  177. /*######
  178. ## go_gilded_brazier (Paladin First Trail quest (9678))
  179. ######*/
  180.  
  181. enum eGildedBrazier
  182. {
  183.     NPC_STILLBLADE  = 17716,
  184. };
  185.  
  186. class go_gilded_brazier : public GameObjectScript
  187. {
  188. public:
  189.     go_gilded_brazier() : GameObjectScript("go_gilded_brazier") { }
  190.  
  191.     bool OnGossipHello(Player *pPlayer, GameObject *pGO)
  192.     {
  193.         if (pGO->GetGoType() == GAMEOBJECT_TYPE_GOOBER)
  194.         {
  195.             if (pPlayer->GetQuestStatus(9678) == QUEST_STATUS_INCOMPLETE)
  196.             {
  197.                 if (Creature* Stillblade = pPlayer->SummonCreature(NPC_STILLBLADE, 8106.11f, -7542.06f, 151.775f, 3.02598f, TEMPSUMMON_DEAD_DESPAWN, 60000))
  198.                     Stillblade->AI()->AttackStart(pPlayer);
  199.             }
  200.         }
  201.         return true;
  202.     }
  203. };
  204.  
  205. /*######
  206. ## go_orb_of_command
  207. ######*/
  208.  
  209. class go_orb_of_command : public GameObjectScript
  210. {
  211. public:
  212.     go_orb_of_command() : GameObjectScript("go_orb_of_command") { }
  213.  
  214.     bool OnGossipHello(Player *pPlayer, GameObject * /*pGO*/)
  215.     {
  216.         if (pPlayer->GetQuestRewardStatus(7761))
  217.             pPlayer->CastSpell(pPlayer,23460,true);
  218.  
  219.         return true;
  220.     }
  221. };
  222.  
  223. /*######
  224. ## go_tablet_of_madness
  225. ######*/
  226.  
  227. class go_tablet_of_madness : public GameObjectScript
  228. {
  229. public:
  230.     go_tablet_of_madness() : GameObjectScript("go_tablet_of_madness") { }
  231.  
  232.     bool OnGossipHello(Player *pPlayer, GameObject * /*pGO*/)
  233.     {
  234.         if (pPlayer->HasSkill(SKILL_ALCHEMY) && pPlayer->GetSkillValue(SKILL_ALCHEMY) >= 300 && !pPlayer->HasSpell(24266))
  235.         {
  236.             pPlayer->CastSpell(pPlayer,24267,false);
  237.         }
  238.         return true;
  239.     }
  240. };
  241.  
  242. /*######
  243. ## go_tablet_of_the_seven
  244. ######*/
  245.  
  246. class go_tablet_of_the_seven : public GameObjectScript
  247. {
  248. public:
  249.     go_tablet_of_the_seven() : GameObjectScript("go_tablet_of_the_seven") { }
  250.  
  251.     //TODO: use gossip option ("Transcript the Tablet") instead, if Trinity adds support.
  252.     bool OnGossipHello(Player *pPlayer, GameObject *pGO)
  253.     {
  254.         if (pGO->GetGoType() != GAMEOBJECT_TYPE_QUESTGIVER)
  255.             return true;
  256.  
  257.         if (pPlayer->GetQuestStatus(4296) == QUEST_STATUS_INCOMPLETE)
  258.             pPlayer->CastSpell(pPlayer,15065,false);
  259.  
  260.         return true;
  261.     }
  262. };
  263.  
  264. /*#####
  265. ## go_jump_a_tron
  266. ######*/
  267.  
  268. class go_jump_a_tron : public GameObjectScript
  269. {
  270. public:
  271.     go_jump_a_tron() : GameObjectScript("go_jump_a_tron") { }
  272.  
  273.     bool OnGossipHello(Player *pPlayer, GameObject * /*pGO*/)
  274.     {
  275.         if (pPlayer->GetQuestStatus(10111) == QUEST_STATUS_INCOMPLETE)
  276.          pPlayer->CastSpell(pPlayer,33382,true);
  277.  
  278.         return true;
  279.     }
  280. };
  281.  
  282. /*######
  283. ## go_ethereum_prison
  284. ######*/
  285.  
  286. enum eEthereumPrison
  287. {
  288.     SPELL_REP_LC        = 39456,
  289.     SPELL_REP_SHAT      = 39457,
  290.     SPELL_REP_CE        = 39460,
  291.     SPELL_REP_CON       = 39474,
  292.     SPELL_REP_KT        = 39475,
  293.     SPELL_REP_SPOR      = 39476
  294. };
  295.  
  296. const uint32 NpcPrisonEntry[] =
  297. {
  298.     22810, 22811, 22812, 22813, 22814, 22815,               //good guys
  299.     20783, 20784, 20785, 20786, 20788, 20789, 20790         //bad guys
  300. };
  301.  
  302. class go_ethereum_prison : public GameObjectScript
  303. {
  304. public:
  305.     go_ethereum_prison() : GameObjectScript("go_ethereum_prison") { }
  306.  
  307.     bool OnGossipHello(Player *pPlayer, GameObject *pGO)
  308.     {
  309.         int Random = rand() % (sizeof(NpcPrisonEntry) / sizeof(uint32));
  310.  
  311.         if (Creature* pCreature = pPlayer->SummonCreature(NpcPrisonEntry[Random],
  312.             pGO->GetPositionX(), pGO->GetPositionY(), pGO->GetPositionZ(), pGO->GetAngle(pPlayer),
  313.             TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000))
  314.         {
  315.             if (!pCreature->IsHostileTo(pPlayer))
  316.             {
  317.                 uint32 Spell = 0;
  318.  
  319.                 if (FactionTemplateEntry const* pFaction = pCreature->getFactionTemplateEntry())
  320.                 {
  321.                     switch(pFaction->faction)
  322.                     {
  323.                         case 1011: Spell = SPELL_REP_LC; break;
  324.                         case 935: Spell = SPELL_REP_SHAT; break;
  325.                         case 942: Spell = SPELL_REP_CE; break;
  326.                         case 933: Spell = SPELL_REP_CON; break;
  327.                         case 989: Spell = SPELL_REP_KT; break;
  328.                         case 970: Spell = SPELL_REP_SPOR; break;
  329.                     }
  330.  
  331.                     if (Spell)
  332.                         pCreature->CastSpell(pPlayer, Spell, false);
  333.                     else
  334.                         sLog.outError("TSCR: go_ethereum_prison summoned Creature (entry %u) but faction (%u) are not expected by script.", pCreature->GetEntry(), pCreature->getFaction());
  335.                 }
  336.             }
  337.         }
  338.  
  339.         return false;
  340.     }
  341. };
  342.  
  343. /*######
  344. ## go_ethereum_stasis
  345. ######*/
  346.  
  347. const uint32 NpcStasisEntry[] =
  348. {
  349.     22825, 20888, 22827, 22826, 22828
  350. };
  351.  
  352. class go_ethereum_stasis : public GameObjectScript
  353. {
  354. public:
  355.     go_ethereum_stasis() : GameObjectScript("go_ethereum_stasis") { }
  356.  
  357.     bool OnGossipHello(Player *pPlayer, GameObject *pGO)
  358.     {
  359.         int Random = rand() % (sizeof(NpcStasisEntry) / sizeof(uint32));
  360.  
  361.         pPlayer->SummonCreature(NpcStasisEntry[Random],
  362.             pGO->GetPositionX(), pGO->GetPositionY(), pGO->GetPositionZ(), pGO->GetAngle(pPlayer),
  363.             TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
  364.  
  365.         return false;
  366.     }
  367. };
  368.  
  369. /*######
  370. ## go_resonite_cask
  371. ######*/
  372.  
  373. enum eResoniteCask
  374. {
  375.     NPC_GOGGEROC    = 11920
  376. };
  377.  
  378. class go_resonite_cask : public GameObjectScript
  379. {
  380. public:
  381.     go_resonite_cask() : GameObjectScript("go_resonite_cask") { }
  382.  
  383.     bool OnGossipHello(Player * /*pPlayer*/, GameObject *pGO)
  384.     {
  385.         if (pGO->GetGoType() == GAMEOBJECT_TYPE_GOOBER)
  386.             pGO->SummonCreature(NPC_GOGGEROC, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 300000);
  387.  
  388.         return false;
  389.     }
  390. };
  391.  
  392. /*######
  393. ## go_sacred_fire_of_life
  394. ######*/
  395.  
  396. #define NPC_ARIKARA  10882
  397.  
  398. class go_sacred_fire_of_life : public GameObjectScript
  399. {
  400. public:
  401.     go_sacred_fire_of_life() : GameObjectScript("go_sacred_fire_of_life") { }
  402.  
  403.     bool OnGossipHello(Player *pPlayer, GameObject *pGO)
  404.     {
  405.         if (pGO->GetGoType() == GAMEOBJECT_TYPE_GOOBER)
  406.             pPlayer->SummonCreature(NPC_ARIKARA, -5008.338f, -2118.894f, 83.657f, 0.874f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
  407.  
  408.         return true;
  409.     }
  410. };
  411.  
  412. /*######
  413. ## go_shrine_of_the_birds
  414. ######*/
  415.  
  416. enum eShrineOfTheBirds
  417. {
  418.     NPC_HAWK_GUARD      = 22992,
  419.     NPC_EAGLE_GUARD     = 22993,
  420.     NPC_FALCON_GUARD    = 22994,
  421.     GO_SHRINE_HAWK      = 185551,
  422.     GO_SHRINE_EAGLE     = 185547,
  423.     GO_SHRINE_FALCON    = 185553
  424. };
  425.  
  426. class go_shrine_of_the_birds : public GameObjectScript
  427. {
  428. public:
  429.     go_shrine_of_the_birds() : GameObjectScript("go_shrine_of_the_birds") { }
  430.  
  431.     bool OnGossipHello(Player *pPlayer, GameObject *pGO)
  432.     {
  433.         uint32 BirdEntry = 0;
  434.  
  435.         float fX, fY, fZ;
  436.         pGO->GetClosePoint(fX, fY, fZ, pGO->GetObjectSize(), INTERACTION_DISTANCE);
  437.  
  438.         switch(pGO->GetEntry())
  439.         {
  440.             case GO_SHRINE_HAWK:
  441.                 BirdEntry = NPC_HAWK_GUARD;
  442.                 break;
  443.             case GO_SHRINE_EAGLE:
  444.                 BirdEntry = NPC_EAGLE_GUARD;
  445.                 break;
  446.             case GO_SHRINE_FALCON:
  447.                 BirdEntry = NPC_FALCON_GUARD;
  448.                 break;
  449.         }
  450.  
  451.         if (BirdEntry)
  452.             pPlayer->SummonCreature(BirdEntry, fX, fY, fZ, pGO->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
  453.  
  454.         return false;
  455.     }
  456. };
  457.  
  458. /*######
  459. ## go_southfury_moonstone
  460. ######*/
  461.  
  462. enum eSouthfury
  463. {
  464.     NPC_RIZZLE                  = 23002,
  465.     SPELL_BLACKJACK             = 39865, //stuns player
  466.     SPELL_SUMMON_RIZZLE         = 39866
  467. };
  468.  
  469. class go_southfury_moonstone : public GameObjectScript
  470. {
  471. public:
  472.     go_southfury_moonstone() : GameObjectScript("go_southfury_moonstone") { }
  473.  
  474.     bool OnGossipHello(Player *pPlayer, GameObject * /*pGO*/)
  475.     {
  476.         //implicitTarget=48 not implemented as of writing this code, and manual summon may be just ok for our purpose
  477.         //pPlayer->CastSpell(pPlayer,SPELL_SUMMON_RIZZLE,false);
  478.  
  479.         if (Creature* pCreature = pPlayer->SummonCreature(NPC_RIZZLE, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_DEAD_DESPAWN, 0))
  480.             pCreature->CastSpell(pPlayer,SPELL_BLACKJACK,false);
  481.  
  482.         return false;
  483.     }
  484. };
  485.  
  486. /*######
  487. ## go_tele_to_dalaran_crystal
  488. ######*/
  489.  
  490. enum eDalaranCrystal
  491. {
  492.     QUEST_LEARN_LEAVE_RETURN    = 12790,
  493.     QUEST_TELE_CRYSTAL_FLAG     = 12845
  494. };
  495.  
  496. #define GO_TELE_TO_DALARAN_CRYSTAL_FAILED   "This teleport crystal cannot be used until the teleport crystal in Dalaran has been used at least once."
  497. class go_tele_to_dalaran_crystal : public GameObjectScript
  498. {
  499. public:
  500.     go_tele_to_dalaran_crystal() : GameObjectScript("go_tele_to_dalaran_crystal") { }
  501.  
  502.     bool OnGossipHello(Player *pPlayer, GameObject * /*pGO*/)
  503.     {
  504.         if (pPlayer->GetQuestRewardStatus(QUEST_TELE_CRYSTAL_FLAG))
  505.         {
  506.             return false;
  507.         }
  508.         else
  509.             pPlayer->GetSession()->SendNotification(GO_TELE_TO_DALARAN_CRYSTAL_FAILED);
  510.  
  511.         return true;
  512.     }
  513. };
  514.  
  515. /*######
  516. ## go_tele_to_violet_stand
  517. ######*/
  518.  
  519. class go_tele_to_violet_stand : public GameObjectScript
  520. {
  521. public:
  522.     go_tele_to_violet_stand() : GameObjectScript("go_tele_to_violet_stand") { }
  523.  
  524.     bool OnGossipHello(Player *pPlayer, GameObject * /*pGO*/)
  525.     {
  526.         if (pPlayer->GetQuestRewardStatus(QUEST_LEARN_LEAVE_RETURN) || pPlayer->GetQuestStatus(QUEST_LEARN_LEAVE_RETURN) == QUEST_STATUS_INCOMPLETE)
  527.             return false;
  528.  
  529.         return true;
  530.     }
  531. };
  532.  
  533. /*######
  534. ## go_fel_crystalforge
  535. ######*/
  536.  
  537. #define GOSSIP_FEL_CRYSTALFORGE_TEXT 31000
  538. #define GOSSIP_FEL_CRYSTALFORGE_ITEM_TEXT_RETURN 31001
  539. #define GOSSIP_FEL_CRYSTALFORGE_ITEM_1 "Purchase 1 Unstable Flask of the Beast for the cost of 10 Apexis Shards"
  540. #define GOSSIP_FEL_CRYSTALFORGE_ITEM_5 "Purchase 5 Unstable Flask of the Beast for the cost of 50 Apexis Shards"
  541. #define GOSSIP_FEL_CRYSTALFORGE_ITEM_RETURN "Use the fel crystalforge to make another purchase."
  542.  
  543. enum eFelCrystalforge
  544. {
  545.     SPELL_CREATE_1_FLASK_OF_BEAST   = 40964,
  546.     SPELL_CREATE_5_FLASK_OF_BEAST   = 40965,
  547. };
  548.  
  549. class go_fel_crystalforge : public GameObjectScript
  550. {
  551. public:
  552.     go_fel_crystalforge() : GameObjectScript("go_fel_crystalforge") { }
  553.  
  554.     bool OnGossipHello(Player *pPlayer, GameObject *pGO)
  555.     {
  556.         if (pGO->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER) /* != GAMEOBJECT_TYPE_QUESTGIVER) */
  557.             pPlayer->PrepareQuestMenu(pGO->GetGUID()); /* return true*/
  558.  
  559.         pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FEL_CRYSTALFORGE_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
  560.         pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FEL_CRYSTALFORGE_ITEM_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
  561.  
  562.         pPlayer->SEND_GOSSIP_MENU(GOSSIP_FEL_CRYSTALFORGE_TEXT, pGO->GetGUID());
  563.  
  564.         return true;
  565.     }
  566.  
  567.     bool OnGossipSelect(Player *pPlayer, GameObject *pGO, uint32 /*uiSender*/, uint32 uiAction)
  568.     {
  569.         pPlayer->PlayerTalkClass->ClearMenus();
  570.         switch(uiAction)
  571.         {
  572.             case GOSSIP_ACTION_INFO_DEF:
  573.                 pPlayer->CastSpell(pPlayer,SPELL_CREATE_1_FLASK_OF_BEAST,false);
  574.                 pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FEL_CRYSTALFORGE_ITEM_RETURN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
  575.                 pPlayer->SEND_GOSSIP_MENU(GOSSIP_FEL_CRYSTALFORGE_ITEM_TEXT_RETURN, pGO->GetGUID());
  576.                 break;
  577.             case GOSSIP_ACTION_INFO_DEF + 1:
  578.                 pPlayer->CastSpell(pPlayer,SPELL_CREATE_5_FLASK_OF_BEAST,false);
  579.                 pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FEL_CRYSTALFORGE_ITEM_RETURN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
  580.                 pPlayer->SEND_GOSSIP_MENU(GOSSIP_FEL_CRYSTALFORGE_ITEM_TEXT_RETURN, pGO->GetGUID());
  581.                 break;
  582.         case GOSSIP_ACTION_INFO_DEF + 2:
  583.                 pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FEL_CRYSTALFORGE_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
  584.                 pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FEL_CRYSTALFORGE_ITEM_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
  585.                 pPlayer->SEND_GOSSIP_MENU(GOSSIP_FEL_CRYSTALFORGE_TEXT, pGO->GetGUID());
  586.                 break;
  587.         }
  588.         return true;
  589.     }
  590. };
  591.  
  592. /*######
  593. ## go_bashir_crystalforge
  594. ######*/
  595.  
  596. #define GOSSIP_BASHIR_CRYSTALFORGE_TEXT 31100
  597. #define GOSSIP_BASHIR_CRYSTALFORGE_ITEM_TEXT_RETURN 31101
  598. #define GOSSIP_BASHIR_CRYSTALFORGE_ITEM_1 "Purchase 1 Unstable Flask of the Sorcerer for the cost of 10 Apexis Shards"
  599. #define GOSSIP_BASHIR_CRYSTALFORGE_ITEM_5 "Purchase 5 Unstable Flask of the Sorcerer for the cost of 50 Apexis Shards"
  600. #define GOSSIP_BASHIR_CRYSTALFORGE_ITEM_RETURN "Use the bashir crystalforge to make another purchase."
  601.  
  602. enum eBashirCrystalforge
  603. {
  604.     SPELL_CREATE_1_FLASK_OF_SORCERER   = 40968,
  605.     SPELL_CREATE_5_FLASK_OF_SORCERER   = 40970,
  606. };
  607.  
  608. class go_bashir_crystalforge : public GameObjectScript
  609. {
  610. public:
  611.     go_bashir_crystalforge() : GameObjectScript("go_bashir_crystalforge") { }
  612.  
  613.     bool OnGossipHello(Player *pPlayer, GameObject *pGO)
  614.     {
  615.         if (pGO->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER) /* != GAMEOBJECT_TYPE_QUESTGIVER) */
  616.             pPlayer->PrepareQuestMenu(pGO->GetGUID()); /* return true*/
  617.  
  618.         pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BASHIR_CRYSTALFORGE_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
  619.         pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BASHIR_CRYSTALFORGE_ITEM_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
  620.  
  621.         pPlayer->SEND_GOSSIP_MENU(GOSSIP_BASHIR_CRYSTALFORGE_TEXT, pGO->GetGUID());
  622.  
  623.         return true;
  624.     }
  625.  
  626.     bool OnGossipSelect(Player *pPlayer, GameObject *pGO, uint32 /*uiSender*/, uint32 uiAction)
  627.     {
  628.         pPlayer->PlayerTalkClass->ClearMenus();
  629.         switch(uiAction)
  630.         {
  631.             case GOSSIP_ACTION_INFO_DEF:
  632.                 pPlayer->CastSpell(pPlayer,SPELL_CREATE_1_FLASK_OF_SORCERER,false);
  633.                 pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BASHIR_CRYSTALFORGE_ITEM_RETURN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
  634.                 pPlayer->SEND_GOSSIP_MENU(GOSSIP_BASHIR_CRYSTALFORGE_ITEM_TEXT_RETURN, pGO->GetGUID());
  635.                 break;
  636.             case GOSSIP_ACTION_INFO_DEF + 1:
  637.                 pPlayer->CastSpell(pPlayer,SPELL_CREATE_5_FLASK_OF_SORCERER,false);
  638.                 pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BASHIR_CRYSTALFORGE_ITEM_RETURN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
  639.                 pPlayer->SEND_GOSSIP_MENU(GOSSIP_BASHIR_CRYSTALFORGE_ITEM_TEXT_RETURN, pGO->GetGUID());
  640.                 break;
  641.             case GOSSIP_ACTION_INFO_DEF + 2:
  642.                 pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BASHIR_CRYSTALFORGE_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
  643.                 pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BASHIR_CRYSTALFORGE_ITEM_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
  644.                 pPlayer->SEND_GOSSIP_MENU(GOSSIP_BASHIR_CRYSTALFORGE_TEXT, pGO->GetGUID());
  645.                 break;
  646.         }
  647.         return true;
  648.     }
  649. };
  650.  
  651. /*######
  652. ## matrix_punchograph
  653. ######*/
  654.  
  655. enum eMatrixPunchograph
  656. {
  657.     ITEM_WHITE_PUNCH_CARD = 9279,
  658.     ITEM_YELLOW_PUNCH_CARD = 9280,
  659.     ITEM_BLUE_PUNCH_CARD = 9282,
  660.     ITEM_RED_PUNCH_CARD = 9281,
  661.     ITEM_PRISMATIC_PUNCH_CARD = 9316,
  662.     SPELL_YELLOW_PUNCH_CARD = 11512,
  663.     SPELL_BLUE_PUNCH_CARD = 11525,
  664.     SPELL_RED_PUNCH_CARD = 11528,
  665.     SPELL_PRISMATIC_PUNCH_CARD = 11545,
  666.     MATRIX_PUNCHOGRAPH_3005_A = 142345,
  667.     MATRIX_PUNCHOGRAPH_3005_B = 142475,
  668.     MATRIX_PUNCHOGRAPH_3005_C = 142476,
  669.     MATRIX_PUNCHOGRAPH_3005_D = 142696,
  670. };
  671.  
  672. class go_matrix_punchograph : public GameObjectScript
  673. {
  674. public:
  675.     go_matrix_punchograph() : GameObjectScript("go_matrix_punchograph") { }
  676.  
  677.     bool OnGossipHello(Player *pPlayer, GameObject *pGO)
  678.     {
  679.         switch(pGO->GetEntry())
  680.         {
  681.             case MATRIX_PUNCHOGRAPH_3005_A:
  682.                 if (pPlayer->HasItemCount(ITEM_WHITE_PUNCH_CARD, 1))
  683.                 {
  684.                     pPlayer->DestroyItemCount(ITEM_WHITE_PUNCH_CARD, 1, true);
  685.                     pPlayer->CastSpell(pPlayer,SPELL_YELLOW_PUNCH_CARD,true);
  686.                 }
  687.                 break;
  688.             case MATRIX_PUNCHOGRAPH_3005_B:
  689.                 if (pPlayer->HasItemCount(ITEM_YELLOW_PUNCH_CARD, 1))
  690.                 {
  691.                     pPlayer->DestroyItemCount(ITEM_YELLOW_PUNCH_CARD, 1, true);
  692.                     pPlayer->CastSpell(pPlayer,SPELL_BLUE_PUNCH_CARD,true);
  693.                 }
  694.                 break;
  695.             case MATRIX_PUNCHOGRAPH_3005_C:
  696.                 if (pPlayer->HasItemCount(ITEM_BLUE_PUNCH_CARD, 1))
  697.                 {
  698.                     pPlayer->DestroyItemCount(ITEM_BLUE_PUNCH_CARD, 1, true);
  699.                     pPlayer->CastSpell(pPlayer,SPELL_RED_PUNCH_CARD,true);
  700.                 }
  701.                 break;
  702.             case MATRIX_PUNCHOGRAPH_3005_D:
  703.                 if (pPlayer->HasItemCount(ITEM_RED_PUNCH_CARD, 1))
  704.                 {
  705.                     pPlayer->DestroyItemCount(ITEM_RED_PUNCH_CARD, 1, true);
  706.                     pPlayer->CastSpell(pPlayer, SPELL_PRISMATIC_PUNCH_CARD, true);
  707.                 }
  708.                 break;
  709.             default:
  710.                 break;
  711.         }
  712.         return false;
  713.     }
  714. };
  715.  
  716. /*######
  717. ## go_rusty_cage
  718. ######*/
  719.  
  720. enum eRustyCage
  721. {
  722.     NPC_GOBLIN_PRISIONER    = 29466
  723. };
  724.  
  725. class go_rusty_cage : public GameObjectScript
  726. {
  727. public:
  728.     go_rusty_cage() : GameObjectScript("go_rusty_cage") { }
  729.  
  730.     bool OnGossipHello(Player *pPlayer, GameObject *pGO)
  731.     {
  732.         if (Creature *pGoblinPrisoner = pGO->FindNearestCreature(NPC_GOBLIN_PRISIONER, 5.0f, true))
  733.         {
  734.             pGO->SetGoState(GO_STATE_ACTIVE);
  735.             pPlayer->KilledMonsterCredit(NPC_GOBLIN_PRISIONER, pGoblinPrisoner->GetGUID());
  736.             pGoblinPrisoner->DisappearAndDie();
  737.         }
  738.  
  739.         return true;
  740.     }
  741. };
  742.  
  743. /*######
  744. ## go_scourge_cage
  745. ######*/
  746.  
  747. enum eScourgeCage
  748. {
  749.     NPC_SCOURGE_PRISONER = 25610
  750. };
  751.  
  752. class go_scourge_cage : public GameObjectScript
  753. {
  754. public:
  755.     go_scourge_cage() : GameObjectScript("go_scourge_cage") { }
  756.  
  757.     bool OnGossipHello(Player *pPlayer, GameObject *pGO)
  758.     {
  759.         if (Creature *pNearestPrisoner = pGO->FindNearestCreature(NPC_SCOURGE_PRISONER, 5.0f, true))
  760.         {
  761.             pGO->SetGoState(GO_STATE_ACTIVE);
  762.             pPlayer->KilledMonsterCredit(NPC_SCOURGE_PRISONER, pNearestPrisoner->GetGUID());
  763.             pNearestPrisoner->DisappearAndDie();
  764.         }
  765.  
  766.         return true;
  767.     }
  768. };
  769.  
  770. /*######
  771. ## go_arcane_prison
  772. ######*/
  773.  
  774. enum eArcanePrison
  775. {
  776.     QUEST_PRISON_BREAK                  = 11587,
  777.     SPELL_ARCANE_PRISONER_KILL_CREDIT   = 45456
  778. };
  779.  
  780. class go_arcane_prison : public GameObjectScript
  781. {
  782. public:
  783.     go_arcane_prison() : GameObjectScript("go_arcane_prison") { }
  784.  
  785.     bool OnGossipHello(Player *pPlayer, GameObject *pGO)
  786.     {
  787.         if (pPlayer->GetQuestStatus(QUEST_PRISON_BREAK) == QUEST_STATUS_INCOMPLETE)
  788.         {
  789.             pGO->SummonCreature(25318, 3485.089844f, 6115.7422188f, 70.966812f, 0, TEMPSUMMON_TIMED_DESPAWN, 60000);
  790.             pPlayer->CastSpell(pPlayer, SPELL_ARCANE_PRISONER_KILL_CREDIT, true);
  791.             return true;
  792.         } else
  793.             return false;
  794.     }
  795. };
  796.  
  797. /*######
  798. ## go_blood_filled_orb
  799. ######*/
  800.  
  801. #define NPC_ZELEMAR  17830
  802.  
  803. class go_blood_filled_orb : public GameObjectScript
  804. {
  805. public:
  806.     go_blood_filled_orb() : GameObjectScript("go_blood_filled_orb") { }
  807.  
  808.     bool OnGossipHello(Player *pPlayer, GameObject *pGO)
  809.     {
  810.         if (pGO->GetGoType() == GAMEOBJECT_TYPE_GOOBER)
  811.             pPlayer->SummonCreature(NPC_ZELEMAR, -369.746f, 166.759f, -21.50f, 5.235f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
  812.  
  813.         return true;
  814.     }
  815. };
  816.  
  817. /*######
  818. ## go_jotunheim_cage
  819. ######*/
  820.  
  821. enum eJotunheimCage
  822. {
  823.     NPC_EBON_BLADE_PRISONER_HUMAN   = 30186,
  824.     NPC_EBON_BLADE_PRISONER_NE      = 30194,
  825.     NPC_EBON_BLADE_PRISONER_TROLL   = 30196,
  826.     NPC_EBON_BLADE_PRISONER_ORC     = 30195,
  827.  
  828.     SPELL_SUMMON_BLADE_KNIGHT_H     = 56207,
  829.     SPELL_SUMMON_BLADE_KNIGHT_NE    = 56209,
  830.     SPELL_SUMMON_BLADE_KNIGHT_ORC   = 56212,
  831.     SPELL_SUMMON_BLADE_KNIGHT_TROLL = 56214
  832. };
  833.  
  834. class go_jotunheim_cage : public GameObjectScript
  835. {
  836. public:
  837.     go_jotunheim_cage() : GameObjectScript("go_jotunheim_cage") { }
  838.  
  839.     bool OnGossipHello(Player* pPlayer, GameObject* pGO)
  840.     {
  841.         Creature* pPrisoner = pGO->FindNearestCreature(NPC_EBON_BLADE_PRISONER_HUMAN, 5.0f, true);
  842.         if (!pPrisoner)
  843.         {
  844.             pPrisoner = pGO->FindNearestCreature(NPC_EBON_BLADE_PRISONER_TROLL, 5.0f, true);
  845.             if (!pPrisoner)
  846.             {
  847.                 pPrisoner = pGO->FindNearestCreature(NPC_EBON_BLADE_PRISONER_ORC, 5.0f, true);
  848.                 if (!pPrisoner)
  849.                     pPrisoner = pGO->FindNearestCreature(NPC_EBON_BLADE_PRISONER_NE, 5.0f, true);
  850.             }
  851.         }
  852.         if (!pPrisoner || !pPrisoner->isAlive())
  853.             return false;
  854.  
  855.         pPrisoner->DisappearAndDie();
  856.         pPlayer->KilledMonsterCredit(NPC_EBON_BLADE_PRISONER_HUMAN, 0);
  857.         switch(pPrisoner->GetEntry())
  858.         {
  859.             case NPC_EBON_BLADE_PRISONER_HUMAN:
  860.                 pPlayer->CastSpell(pPlayer,SPELL_SUMMON_BLADE_KNIGHT_H,true);
  861.                 break;
  862.             case NPC_EBON_BLADE_PRISONER_NE:
  863.                 pPlayer->CastSpell(pPlayer,SPELL_SUMMON_BLADE_KNIGHT_NE,true);
  864.                 break;
  865.             case NPC_EBON_BLADE_PRISONER_TROLL:
  866.                 pPlayer->CastSpell(pPlayer,SPELL_SUMMON_BLADE_KNIGHT_TROLL,true);
  867.                 break;
  868.             case NPC_EBON_BLADE_PRISONER_ORC:
  869.                 pPlayer->CastSpell(pPlayer,SPELL_SUMMON_BLADE_KNIGHT_ORC,true);
  870.                 break;
  871.         }
  872.         return true;
  873.     }
  874. };
  875.  
  876. enum eTableTheka
  877. {
  878.     GOSSIP_TABLE_THEKA = 1653,
  879.  
  880.     QUEST_SPIDER_GOLD = 2936
  881. };
  882.  
  883. class go_table_theka : public GameObjectScript
  884. {
  885. public:
  886.     go_table_theka() : GameObjectScript("go_table_theka") { }
  887.  
  888.     bool OnGossipHello(Player* pPlayer, GameObject* pGO)
  889.     {
  890.         if (pPlayer->GetQuestStatus(QUEST_SPIDER_GOLD) == QUEST_STATUS_INCOMPLETE)
  891.             pPlayer->AreaExploredOrEventHappens(QUEST_SPIDER_GOLD);
  892.  
  893.         pPlayer->SEND_GOSSIP_MENU(GOSSIP_TABLE_THEKA, pGO->GetGUID());
  894.  
  895.         return true;
  896.     }
  897. };
  898.  
  899. /*######
  900. ## go_inconspicuous_landmark
  901. ######*/
  902.  
  903. enum eInconspicuousLandmark
  904. {
  905.     SPELL_SUMMON_PIRATES_TREASURE_AND_TRIGGER_MOB    = 11462,
  906.     ITEM_CUERGOS_KEY                                 = 9275,
  907. };
  908.  
  909. class go_inconspicuous_landmark : public GameObjectScript
  910. {
  911. public:
  912.     go_inconspicuous_landmark() : GameObjectScript("go_inconspicuous_landmark") { }
  913.  
  914.     bool OnGossipHello(Player *pPlayer, GameObject* /*pGO*/)
  915.     {
  916.         if (pPlayer->HasItemCount(ITEM_CUERGOS_KEY,1))
  917.             return false;
  918.  
  919.         pPlayer->CastSpell(pPlayer,SPELL_SUMMON_PIRATES_TREASURE_AND_TRIGGER_MOB,true);
  920.  
  921.         return true;
  922.     }
  923. };
  924.  
  925. /*######
  926. ## go_soulwell
  927. ######*/
  928.  
  929. class go_soulwell : public GameObjectScript
  930. {
  931. public:
  932.     go_soulwell() : GameObjectScript("go_soulwell") { }
  933.  
  934.     bool OnGossipHello(Player *pPlayer, GameObject* pGO)
  935.     {
  936.         Unit *caster = pGO->GetOwner();
  937.         if (!caster || caster->GetTypeId() != TYPEID_PLAYER)
  938.             return true;
  939.  
  940.         if (!pPlayer->IsInSameRaidWith(static_cast<Player *>(caster)))
  941.             return true;
  942.  
  943.         // Repeating this at every use is ugly and inefficient. But as long as we don't have proper
  944.         // GO scripting with at least On Create and On Update events, the other options are no less
  945.         // ugly and hacky.
  946.         uint32 newSpell = 0;
  947.         if (pGO->GetEntry() == 193169)                                  // Soulwell for rank 2
  948.         {
  949.             if (caster->HasAura(18693))      // Improved Healthstone rank 2
  950.                 newSpell = 58898;
  951.             else if (caster->HasAura(18692)) // Improved Healthstone rank 1
  952.                 newSpell = 58896;
  953.             else newSpell = 58890;
  954.         }
  955.         else if (pGO->GetEntry() == 181621)                             // Soulwell for rank 1
  956.         {
  957.             if (caster->HasAura(18693))      // Improved Healthstone rank 2
  958.                 newSpell = 34150;
  959.             else if (caster->HasAura(18692)) // Improved Healthstone rank 1
  960.                 newSpell = 34149;
  961.             else newSpell = 34130;
  962.         }
  963.  
  964.         pGO->AddUse();
  965.         pPlayer->CastSpell(pPlayer, newSpell, true);
  966.         return true;
  967.     }
  968. };
  969.  
  970. /*######
  971. ## Quest 11255: Prisoners of Wyrmskull
  972. ## go_dragonflayer_cage
  973. ######*/
  974.  
  975. enum ePrisonersOfWyrmskull
  976. {
  977.     QUEST_PRISONERS_OF_WYRMSKULL                  = 11255,
  978.     NPC_PRISONER_PRIEST                           = 24086,
  979.     NPC_PRISONER_MAGE                             = 24088,
  980.     NPC_PRISONER_WARRIOR                          = 24089,
  981.     NPC_PRISONER_PALADIN                          = 24090
  982. };
  983.  
  984. class go_dragonflayer_cage : public GameObjectScript
  985. {
  986. public:
  987.     go_dragonflayer_cage() : GameObjectScript("go_dragonflayer_cage") { }
  988.  
  989.     bool OnGossipHello(Player *pPlayer, GameObject *pGO)
  990.     {
  991.         if (pPlayer->GetQuestStatus(QUEST_PRISONERS_OF_WYRMSKULL) != QUEST_STATUS_INCOMPLETE)
  992.             return true;
  993.  
  994.         Creature* pPrisoner = pGO->FindNearestCreature(NPC_PRISONER_PRIEST, 2.0f);
  995.         if (!pPrisoner)
  996.         {
  997.             pPrisoner = pGO->FindNearestCreature(NPC_PRISONER_MAGE, 2.0f);
  998.             if (!pPrisoner)
  999.             {
  1000.                 pPrisoner = pGO->FindNearestCreature(NPC_PRISONER_WARRIOR, 2.0f);
  1001.                 if (!pPrisoner)
  1002.                     pPrisoner = pGO->FindNearestCreature(NPC_PRISONER_PALADIN, 2.0f);
  1003.             }
  1004.         }
  1005.  
  1006.         if (!pPrisoner || !pPrisoner->isAlive())
  1007.             return true;
  1008.  
  1009.         Quest const* qInfo = sObjectMgr.GetQuestTemplate(QUEST_PRISONERS_OF_WYRMSKULL);
  1010.         if (qInfo)
  1011.         {
  1012.             //TODO: prisoner should help player for a short period of time
  1013.             pPlayer->KilledMonsterCredit(qInfo->ReqCreatureOrGOId[0],0);
  1014.             pPrisoner->DisappearAndDie();
  1015.         }
  1016.         return true;
  1017.     }
  1018. };
  1019.  
  1020. /*######
  1021. ## Quest 11560: Oh Noes, the Tadpoles!
  1022. ## go_tadpole_cage
  1023. ######*/
  1024.  
  1025. enum eTadpoles
  1026. {
  1027.     QUEST_OH_NOES_THE_TADPOLES                    = 11560,
  1028.     NPC_WINTERFIN_TADPOLE                         = 25201
  1029. };
  1030.  
  1031. class go_tadpole_cage : public GameObjectScript
  1032. {
  1033. public:
  1034.     go_tadpole_cage() : GameObjectScript("go_tadpole_cage") { }
  1035.  
  1036.     bool OnGossipHello(Player *pPlayer, GameObject *pGO)
  1037.     {
  1038.         if (pPlayer->GetQuestStatus(QUEST_OH_NOES_THE_TADPOLES) == QUEST_STATUS_INCOMPLETE)
  1039.         {
  1040.             Creature *pTadpole = pGO->FindNearestCreature(NPC_WINTERFIN_TADPOLE,1.0f);
  1041.             if (pTadpole)
  1042.             {
  1043.                 pGO->UseDoorOrButton();
  1044.                 pTadpole->DisappearAndDie();
  1045.                 pPlayer->KilledMonsterCredit(NPC_WINTERFIN_TADPOLE,0);
  1046.                 //FIX: Summon minion tadpole
  1047.             }
  1048.         }
  1049.         return true;
  1050.     }
  1051. };
  1052.  
  1053. /*######
  1054. ## Quest 14096 & 14142: You've Really Done It This Time, Kul
  1055. ## go_black_cage
  1056. ######*/
  1057.  
  1058. enum eReallyDoneItThisTime
  1059. {
  1060.     QUEST_ALLIANCE_YOU_VE_REALLY_DONE_IT_THIS_TIME_KUL      = 14096,
  1061.     QUEST_HORDE_YOU_VE_REALLY_DONE_IT_THIS_TIME_KUL         = 14142,
  1062.     NPC_CAPTIVE_ASPIRANT                                    = 34716,
  1063.     NPC_KUL                                                 = 34956
  1064. };
  1065.  
  1066. class go_black_cage : public GameObjectScript
  1067. {
  1068. public:
  1069.     go_black_cage() : GameObjectScript("go_black_cage") { }
  1070.  
  1071.     bool OnGossipHello(Player *pPlayer, GameObject *pGO)
  1072.     {
  1073.         if ((pPlayer->GetTeamId() == TEAM_ALLIANCE && pPlayer->GetQuestStatus(QUEST_ALLIANCE_YOU_VE_REALLY_DONE_IT_THIS_TIME_KUL) == QUEST_STATUS_INCOMPLETE) ||
  1074.             (pPlayer->GetTeamId() == TEAM_HORDE && pPlayer->GetQuestStatus(QUEST_HORDE_YOU_VE_REALLY_DONE_IT_THIS_TIME_KUL) == QUEST_STATUS_INCOMPLETE))
  1075.         {
  1076.             Creature *pPrisoner = pGO->FindNearestCreature(NPC_CAPTIVE_ASPIRANT,1.0f);
  1077.             if (!pPrisoner)
  1078.                 pPrisoner = pGO->FindNearestCreature(NPC_KUL,1.0f);
  1079.             if (pPrisoner)
  1080.             {
  1081.                 pGO->UseDoorOrButton();
  1082.                 pPrisoner->DisappearAndDie();
  1083.                 pPlayer->KilledMonsterCredit(pPrisoner->GetEntry(),0);
  1084.             }
  1085.         }
  1086.         return true;
  1087.     }
  1088. };
  1089.  
  1090. /*######
  1091. ## go_amberpine_outhouse
  1092. ######*/
  1093.  
  1094. #define GOSSIP_USE_OUTHOUSE "Use the outhouse."
  1095. #define GO_ANDERHOLS_SLIDER_CIDER_NOT_FOUND "Quest item Anderhol's Slider Cider not found."
  1096.  
  1097. enum eAmberpineOuthouse
  1098. {
  1099.     ITEM_ANDERHOLS_SLIDER_CIDER     = 37247,
  1100.     NPC_OUTHOUSE_BUNNY              = 27326,
  1101.     QUEST_DOING_YOUR_DUTY           = 12227,
  1102.     SPELL_INDISPOSED                = 53017,
  1103.     SPELL_INDISPOSED_III            = 48341,
  1104.     SPELL_CREATE_AMBERSEEDS         = 48330,
  1105.     GOSSIP_OUTHOUSE_INUSE           = 12775,
  1106.     GOSSIP_OUTHOUSE_VACANT          = 12779
  1107. };
  1108.  
  1109. class go_amberpine_outhouse : public GameObjectScript
  1110. {
  1111. public:
  1112.     go_amberpine_outhouse() : GameObjectScript("go_amberpine_outhouse") { }
  1113.  
  1114.     bool OnGossipHello(Player *pPlayer, GameObject *pGO)
  1115.     {
  1116.         if (pPlayer->GetQuestStatus(QUEST_DOING_YOUR_DUTY) == QUEST_STATUS_INCOMPLETE ||
  1117.             (pPlayer->GetQuestStatus(QUEST_DOING_YOUR_DUTY) == QUEST_STATUS_COMPLETE))
  1118.         {
  1119.             pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_USE_OUTHOUSE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
  1120.             pPlayer->SEND_GOSSIP_MENU(GOSSIP_OUTHOUSE_VACANT, pGO->GetGUID());
  1121.             return true;
  1122.         }
  1123.         else
  1124.             pPlayer->SEND_GOSSIP_MENU(GOSSIP_OUTHOUSE_INUSE, pGO->GetGUID());
  1125.             return true;
  1126.     }
  1127.  
  1128.     bool OnGossipSelect(Player *pPlayer, GameObject *pGO, uint32 /*uiSender*/, uint32 uiAction)
  1129.     {
  1130.         pPlayer->PlayerTalkClass->ClearMenus();
  1131.         if (uiAction == GOSSIP_ACTION_INFO_DEF +1)
  1132.         {
  1133.             pPlayer->CLOSE_GOSSIP_MENU();
  1134.             Creature* pTarget = GetClosestCreatureWithEntry(pPlayer, NPC_OUTHOUSE_BUNNY, 3.0f);
  1135.             if (pTarget)
  1136.             {
  1137.                 pTarget->AI()->SetData(1,pPlayer->getGender());
  1138.                 pGO->CastSpell(pTarget, SPELL_INDISPOSED_III);
  1139.             }
  1140.             pGO->CastSpell(pPlayer, SPELL_INDISPOSED);
  1141.             if (pPlayer->HasItemCount(ITEM_ANDERHOLS_SLIDER_CIDER,1))
  1142.                 pGO->CastSpell(pPlayer, SPELL_CREATE_AMBERSEEDS);
  1143.             return true;
  1144.         }
  1145.         else
  1146.         {
  1147.             pPlayer->CLOSE_GOSSIP_MENU();
  1148.             pPlayer->GetSession()->SendNotification(GO_ANDERHOLS_SLIDER_CIDER_NOT_FOUND);
  1149.             return false;
  1150.         }
  1151.     }
  1152. };
  1153. /*#################################################################################################################################
  1154. ## Buffer GameObject PvP
  1155. ###################################################################################################################################*/
  1156.  
  1157. enum Spells
  1158. {
  1159.     SPELL_FORTITUDE                                     = 48161,
  1160.     SPELL_KINGS                                         = 25898,
  1161.     SPELL_MIGHTS                                        = 48934,
  1162.     SPELL_WISDOM                                        = 48938,
  1163.     SPELL_WILD                                          = 48469,
  1164.     SPELL_INTELLECT                                     = 42995,
  1165.     SPELL_SOUL_STONE                                    = 47883,
  1166.     SPELL_THORNS                                        = 53307,
  1167.     SPELL_DIVINE                                        = 48073,
  1168.     SPELL_SHADOW                                        = 48169,
  1169. }
  1170.  
  1171. class go_buffer : public GameObjectScript
  1172. {
  1173. public:
  1174.     go_buffer() : GameObjectScript("go_buffer") { }
  1175.  
  1176.     bool OnGossipHello(Player *pPlayer, GameObject *pGO)
  1177.     {
  1178.         pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_BATTLE, "[Buff]Power Word: Fortitude, Rank 8", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
  1179.         pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_BATTLE, "[Buff]Greater Blessing of Kings", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
  1180.         pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_BATTLE, "[Buff]Greater Bleesing of Mights", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
  1181.         pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_BATTLE, "[Buff]Greater Blessing of Wisdom", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
  1182.         pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_BATTLE, "[Buff]Mark of the Wild, Rank 9", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
  1183.         pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_BATTLE, "[Buff]Arcane Intellect, Rank 7", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6);
  1184.         pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_BATTLE, "[Buff]Soul Stone", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+7);
  1185.         pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_BATTLE, "[Buff]Thorns, Rank 8", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+8);
  1186.         pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_BATTLE, "[Buff]Divine Spirit, Rank 8", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+9);
  1187.         pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_BATTLE, "[Buff]Shadow Protection, Rank 5", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+10);
  1188.         pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_BATTLE, "Sickness Remove", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+11);
  1189.         pPlayer->SEND_GOSSIP_MENU(1, pGO->GetGUID());
  1190.         return true;
  1191.     }
  1192.  
  1193.     bool OnGossipSelect(Player *pPlayer, GameObject *pGO, uint32 /*uiSender*/, uint32 uiAction)
  1194.     {
  1195.         switch (uiAction)
  1196.         {
  1197.             case GOSSIP_ACTION_INFO_DEF+1:
  1198.                 pPlayer->CLOSE_GOSSIP_MENU();
  1199.                 go->CastSpell(pPlayer, SPELL_FORTITUDE, true);
  1200.             break;
  1201.  
  1202.             case GOSSIP_ACTION_INFO_DEF+2:
  1203.                 pPlayer->CLOSE_GOSSIP_MENU();
  1204.                 go->CastSpell(pPlayer, SPELL_KINGS, true);
  1205.             break;
  1206.  
  1207.             case GOSSIP_ACTION_INFO_DEF+3:
  1208.                 pPlayer->CLOSE_GOSSIP_MENU();
  1209.                 go->CastSpell(pPlayer, SPELL_MIGHTS, true);
  1210.             break;
  1211.  
  1212.             case GOSSIP_ACTION_INFO_DEF+4:
  1213.                 pPlayer->CLOSE_GOSSIP_MENU();
  1214.                 go->CastSpell(pPlayer, SPELL_WISDOM, true);
  1215.             break;
  1216.  
  1217.             case GOSSIP_ACTION_INFO_DEF+5:
  1218.                 pPlayer->CLOSE_GOSSIP_MENU();
  1219.                 go->CastSpell(pPlayer, SPELL_WILD, true);
  1220.             break;
  1221.  
  1222.             case GOSSIP_ACTION_INFO_DEF+6:
  1223.                 pPlayer->CLOSE_GOSSIP_MENU();
  1224.                 go->CastSpell(pPlayer, SPELL_INTELLECT, true);
  1225.             break;
  1226.  
  1227.             case GOSSIP_ACTION_INFO_DEF+7:
  1228.                 pPlayer->CLOSE_GOSSIP_MENU();
  1229.                 go->CastSpell(pPlayer, SPELL_SOUL_STONE, true);
  1230.             break;
  1231.  
  1232.             case GOSSIP_ACTION_INFO_DEF+8:
  1233.                 pPlayer->CLOSE_GOSSIP_MENU();
  1234.                 go->CastSpell(pPlayer, SPELL_THORNS, true);
  1235.             break;
  1236.  
  1237.             case GOSSIP_ACTION_INFO_DEF+9:
  1238.                 pPlayer->CLOSE_GOSSIP_MENU();
  1239.                 go->CastSpell(pPlayer, SPELL_DIVINE, true);
  1240.             break;
  1241.  
  1242.             case GOSSIP_ACTION_INFO_DEF+10:
  1243.                 pPlayer->CLOSE_GOSSIP_MENU();
  1244.                 go->CastSpell(pPlayer, SPELL_SHADOW, true);
  1245.             break;
  1246.  
  1247.             case GOSSIP_ACTION_INFO_DEF+11:
  1248.                 if(pPlayer->HasAura(15007, 0, 0))
  1249.                 {
  1250.                     pPlayer->CLOSE_GOSSIP_MENU();
  1251.                     pPlayer->RemoveAura(15007, AURA_REMOVE_BY_DEFAULT);
  1252.                 }
  1253.             break;
  1254.         }
  1255.         return true;
  1256.     }
  1257. };
  1258.  
  1259. /*######
  1260. ## Quest 1126: Hive in the Tower
  1261. ######*/
  1262.  
  1263. enum eHives
  1264. {
  1265.     QUEST_HIVE_IN_THE_TOWER                       = 9544,
  1266.     NPC_HIVE_AMBUSHER                             = 13301
  1267. };
  1268.  
  1269. class go_hive_pod : public GameObjectScript
  1270. {
  1271. public:
  1272.     go_hive_pod() : GameObjectScript("go_hive_pod") { }
  1273.  
  1274.     bool OnGossipHello(Player *pPlayer, GameObject *pGO)
  1275.     {
  1276.         pPlayer->SendLoot(pGO->GetGUID(), LOOT_CORPSE);
  1277.         pGO->SummonCreature(NPC_HIVE_AMBUSHER,pGO->GetPositionX()+1,pGO->GetPositionY(),pGO->GetPositionZ(),pGO->GetAngle(pPlayer),TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000);
  1278.         pGO->SummonCreature(NPC_HIVE_AMBUSHER,pGO->GetPositionX(),pGO->GetPositionY()+1,pGO->GetPositionZ(),pGO->GetAngle(pPlayer),TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000);
  1279.         return true;
  1280.     }
  1281. };
  1282.  
  1283. class go_massive_seaforium_charge : public GameObjectScript
  1284. {
  1285. public:
  1286.     go_massive_seaforium_charge() : GameObjectScript("go_massive_seaforium_charge") { }
  1287.  
  1288.     bool OnGossipHello(Player* /*pPlayer*/, GameObject *pGo)
  1289.     {
  1290.         pGo->SetLootState(GO_JUST_DEACTIVATED);
  1291.         return true;
  1292.     }
  1293. };
  1294.  
  1295. void AddSC_go_scripts()
  1296. {
  1297.     new go_cat_figurine;
  1298.     new go_northern_crystal_pylon;
  1299.     new go_eastern_crystal_pylon;
  1300.     new go_western_crystal_pylon;
  1301.     new go_barov_journal;
  1302.     new go_field_repair_bot_74A;
  1303.     new go_gilded_brazier;
  1304.     new go_orb_of_command;
  1305.     new go_shrine_of_the_birds;
  1306.     new go_southfury_moonstone;
  1307.     new go_tablet_of_madness;
  1308.     new go_tablet_of_the_seven;
  1309.     new go_jump_a_tron;
  1310.     new go_ethereum_prison;
  1311.     new go_ethereum_stasis;
  1312.     new go_resonite_cask;
  1313.     new go_sacred_fire_of_life;
  1314.     new go_tele_to_dalaran_crystal;
  1315.     new go_tele_to_violet_stand;
  1316.     new go_fel_crystalforge;
  1317.     new go_bashir_crystalforge;
  1318.     new go_matrix_punchograph;
  1319.     new go_rusty_cage;
  1320.     new go_scourge_cage;
  1321.     new go_arcane_prison;
  1322.     new go_blood_filled_orb;
  1323.     new go_jotunheim_cage;
  1324.     new go_table_theka;
  1325.     new go_inconspicuous_landmark;
  1326.     new go_soulwell;
  1327.     new go_tadpole_cage;
  1328.     new go_dragonflayer_cage;
  1329.     new go_black_cage;
  1330.     new go_amberpine_outhouse;
  1331.     new go_buffer;
  1332.     new go_hive_pod;
  1333.     new go_massive_seaforium_charge;
  1334. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement