Advertisement
Guest User

soulwell talent fix

a guest
Sep 22nd, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 36.52 KB | None | 0 0
  1. *
  2. * Copyright (C)
  3. * Copyright (C)
  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. /* ContentData
  20. go_cat_figurine (the "trap" version of GO, two different exist)
  21. go_barov_journal
  22. go_ethereum_prison
  23. go_ethereum_stasis
  24. go_sacred_fire_of_life
  25. go_shrine_of_the_birds
  26. go_southfury_moonstone
  27. go_resonite_cask
  28. go_tablet_of_madness
  29. go_tablet_of_the_seven
  30. go_tele_to_dalaran_crystal
  31. go_tele_to_violet_stand
  32. go_scourge_cage
  33. go_jotunheim_cage
  34. go_table_theka
  35. go_soulwell
  36. go_bashir_crystalforge
  37. go_soulwell
  38. go_dragonflayer_cage
  39. go_tadpole_cage
  40. go_amberpine_outhouse
  41. go_hive_pod
  42. go_veil_skith_cage
  43. EndContentData */
  44.  
  45. #include "ScriptMgr.h"
  46. #include "ScriptedCreature.h"
  47. #include "ScriptedGossip.h"
  48. #include "GameObjectAI.h"
  49. #include "Spell.h"
  50. #include "Player.h"
  51. #include "WorldSession.h"
  52. #include "Unit.h"
  53.  
  54. // Ours
  55. /*######
  56. ## go_noblegarden_colored_egg
  57. ######*/
  58. class go_noblegarden_colored_egg : public GameObjectScript
  59. {
  60. public:
  61. go_noblegarden_colored_egg() : GameObjectScript("go_noblegarden_colored_egg") { }
  62.  
  63. bool OnGossipHello(Player* player, GameObject* /*pGO*/)
  64. {
  65. if (roll_chance_i(5))
  66. player->CastSpell(player, 61734, true); // SPELL NOBLEGARDEN BUNNY
  67. return false;
  68. }
  69. };
  70.  
  71. class go_seer_of_zebhalak : public GameObjectScript
  72. {
  73. public:
  74. go_seer_of_zebhalak() : GameObjectScript("go_seer_of_zebhalak") { }
  75.  
  76. bool OnGossipHello(Player* player, GameObject* /*pGO*/)
  77. {
  78. if (player->GetQuestStatus(12007) == QUEST_STATUS_INCOMPLETE)
  79. player->CastSpell(player, 47293, true);
  80. return true;
  81. }
  82. };
  83.  
  84. class go_mistwhisper_treasure : public GameObjectScript
  85. {
  86. public:
  87. go_mistwhisper_treasure() : GameObjectScript("go_mistwhisper_treasure") { }
  88.  
  89. bool OnGossipHello(Player* pPlayer, GameObject *pGo)
  90. {
  91. if (!pGo->FindNearestCreature(28105, 30.0f)) // Tartek
  92. {
  93. if (Creature *cr = pGo->SummonCreature(28105, 6708.7f, 5115.45f, -18.3f, 0.7f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000))
  94. {
  95. cr->MonsterYell("My treasure! You no steal from Tartek, dumb big-tongue traitor thing. Tartek and nasty dragon going to kill you! You so dumb.", LANG_UNIVERSAL, 0);
  96. cr->AI()->AttackStart(pPlayer);
  97. }
  98. }
  99. return false;
  100. }
  101. };
  102.  
  103. class go_witherbark_totem_bundle : public GameObjectScript
  104. {
  105. public:
  106. go_witherbark_totem_bundle() : GameObjectScript("go_witherbark_totem_bundle") { }
  107.  
  108. struct go_witherbark_totem_bundleAI : public GameObjectAI
  109. {
  110. go_witherbark_totem_bundleAI(GameObject* gameObject) : GameObjectAI(gameObject)
  111. {
  112. _timer = 1;
  113. }
  114.  
  115. void UpdateAI(uint32 diff)
  116. {
  117. if (_timer)
  118. {
  119. _timer += diff;
  120. if (_timer > 5000)
  121. {
  122. go->CastSpell(NULL, 9056);
  123. go->DestroyForNearbyPlayers();
  124. _timer = 0;
  125. }
  126. }
  127. }
  128.  
  129. uint32 _timer;
  130. };
  131.  
  132. GameObjectAI* GetAI(GameObject* go) const
  133. {
  134. return new go_witherbark_totem_bundleAI(go);
  135. }
  136. };
  137.  
  138. class go_arena_ready_marker : public GameObjectScript
  139. {
  140. public:
  141. go_arena_ready_marker() : GameObjectScript("go_arena_ready_marker") { }
  142.  
  143. bool OnGossipHello(Player* player, GameObject *go)
  144. {
  145. if (Battleground* bg = player->GetBattleground())
  146. bg->ReadyMarkerClicked(player);
  147.  
  148. return false;
  149. }
  150. };
  151.  
  152. /*######
  153. ## go_ethereum_prison
  154. ######*/
  155.  
  156. enum EthereumPrison
  157. {
  158. SPELL_REP_LC = 39456,
  159. SPELL_REP_SHAT = 39457,
  160. SPELL_REP_CE = 39460,
  161. SPELL_REP_CON = 39474,
  162. SPELL_REP_KT = 39475,
  163. SPELL_REP_SPOR = 39476
  164. };
  165.  
  166. const uint32 NpcPrisonEntry[] =
  167. {
  168. 22810, 22811, 22812, 22813, 22814, 22815, //good guys
  169. 20783, 20784, 20785, 20786, 20788, 20789, 20790 //bad guys
  170. };
  171.  
  172. class go_ethereum_prison : public GameObjectScript
  173. {
  174. public:
  175. go_ethereum_prison() : GameObjectScript("go_ethereum_prison") { }
  176.  
  177. bool OnGossipHello(Player* player, GameObject* go)
  178. {
  179. int Random = rand() % (sizeof(NpcPrisonEntry) / sizeof(uint32));
  180.  
  181. if (Creature* creature = player->SummonCreature(NpcPrisonEntry[Random], go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), go->GetAngle(player),
  182. TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000))
  183. {
  184. if (!creature->IsHostileTo(player))
  185. {
  186. uint32 Spell = 0;
  187.  
  188. switch (creature->GetEntry())
  189. {
  190. case 22811: Spell = SPELL_REP_LC; break;
  191. case 22812: Spell = SPELL_REP_SHAT; break;
  192. case 22810: Spell = SPELL_REP_CE; break;
  193. case 22813: Spell = SPELL_REP_CON; break;
  194. case 22815: Spell = SPELL_REP_KT; break;
  195. case 22814: Spell = SPELL_REP_SPOR; break;
  196. }
  197.  
  198. if (Spell)
  199. creature->CastSpell(player, Spell, false);
  200. }
  201. }
  202.  
  203. return false;
  204. }
  205. };
  206.  
  207. /*######
  208. ## go_ethereum_stasis
  209. ######*/
  210.  
  211. const uint32 NpcStasisEntry[] =
  212. {
  213. 22825, 20888, 22827, 22826, 22828
  214. };
  215.  
  216. class go_ethereum_stasis : public GameObjectScript
  217. {
  218. public:
  219. go_ethereum_stasis() : GameObjectScript("go_ethereum_stasis") { }
  220.  
  221. bool OnGossipHello(Player* player, GameObject* go)
  222. {
  223. int Random = rand() % (sizeof(NpcStasisEntry) / sizeof(uint32));
  224.  
  225. player->SummonCreature(NpcStasisEntry[Random], go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), go->GetAngle(player),
  226. TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
  227.  
  228. return false;
  229. }
  230. };
  231.  
  232. /*######
  233. ## go_resonite_cask
  234. ######*/
  235.  
  236. enum ResoniteCask
  237. {
  238. NPC_GOGGEROC = 11920
  239. };
  240.  
  241. class go_resonite_cask : public GameObjectScript
  242. {
  243. public:
  244. go_resonite_cask() : GameObjectScript("go_resonite_cask") { }
  245.  
  246. bool OnGossipHello(Player* /*player*/, GameObject* go)
  247. {
  248. // xinef: prevent spawning hundreds of them
  249. if (go->GetGoType() == GAMEOBJECT_TYPE_GOOBER && !go->FindNearestCreature(NPC_GOGGEROC, 20.0f))
  250. go->SummonCreature(NPC_GOGGEROC, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 300000);
  251.  
  252. return false;
  253. }
  254. };
  255.  
  256. /*######
  257. ## Quest 11560: Oh Noes, the Tadpoles!
  258. ## go_tadpole_cage
  259. ######*/
  260.  
  261. enum Tadpoles
  262. {
  263. QUEST_OH_NOES_THE_TADPOLES = 11560,
  264. NPC_WINTERFIN_TADPOLE = 25201
  265. };
  266.  
  267. class go_tadpole_cage : public GameObjectScript
  268. {
  269. public:
  270. go_tadpole_cage() : GameObjectScript("go_tadpole_cage") { }
  271.  
  272. struct go_tadpole_cageAI : public GameObjectAI
  273. {
  274. go_tadpole_cageAI(GameObject* gameObject) : GameObjectAI(gameObject)
  275. {
  276. requireSummon = 2;
  277. }
  278.  
  279. uint8 requireSummon;
  280.  
  281. void SummonTadpoles()
  282. {
  283. requireSummon = 0;
  284. int8 count = urand(1, 3);
  285. for (int8 i = 0; i < count; ++i)
  286. go->SummonCreature(NPC_WINTERFIN_TADPOLE, go->GetPositionX()+cos(2*M_PI*i/3.0f)*0.60f, go->GetPositionY()+sin(2*M_PI*i/3.0f)*0.60f, go->GetPositionZ()+0.5f, go->GetOrientation(), TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
  287. }
  288.  
  289. void OnStateChanged(uint32 state, Unit* unit)
  290. {
  291. if (requireSummon == 1 && state == GO_READY)
  292. requireSummon = 2;
  293. }
  294.  
  295. void UpdateAI(uint32 diff)
  296. {
  297. if (go->isSpawned() && requireSummon == 2)
  298. SummonTadpoles();
  299. }
  300.  
  301. bool GossipHello(Player* player, bool reportUse)
  302. {
  303. if (requireSummon)
  304. return false;
  305.  
  306. requireSummon = 1;
  307. if (player->GetQuestStatus(QUEST_OH_NOES_THE_TADPOLES) == QUEST_STATUS_INCOMPLETE)
  308. {
  309. std::list<Creature*> cList;
  310. GetCreatureListWithEntryInGrid(cList, go, NPC_WINTERFIN_TADPOLE, 5.0f);
  311. for (std::list<Creature*>::const_iterator itr = cList.begin(); itr != cList.end(); ++itr)
  312. {
  313. player->KilledMonsterCredit(NPC_WINTERFIN_TADPOLE, 0);
  314. (*itr)->DespawnOrUnsummon(urand(45000, 60000));
  315. (*itr)->GetMotionMaster()->MoveFollow(player, 1.0f, frand(0.0f, 2*M_PI), MOTION_SLOT_CONTROLLED);
  316. }
  317. }
  318. return false;
  319. }
  320. };
  321.  
  322. GameObjectAI* GetAI(GameObject* go) const
  323. {
  324. return new go_tadpole_cageAI(go);
  325. }
  326. };
  327.  
  328.  
  329.  
  330. // Theirs
  331. /*######
  332. ## go_cat_figurine
  333. ######*/
  334.  
  335. enum CatFigurine
  336. {
  337. SPELL_SUMMON_GHOST_SABER = 5968,
  338. };
  339.  
  340. class go_cat_figurine : public GameObjectScript
  341. {
  342. public:
  343. go_cat_figurine() : GameObjectScript("go_cat_figurine") { }
  344.  
  345. bool OnGossipHello(Player* player, GameObject* /*go*/)
  346. {
  347. player->CastSpell(player, SPELL_SUMMON_GHOST_SABER, true);
  348. return false;
  349. }
  350. };
  351.  
  352. /*######
  353. ## go_gilded_brazier (Paladin First Trail quest (9678))
  354. ######*/
  355.  
  356. enum GildedBrazier
  357. {
  358. NPC_STILLBLADE = 17716,
  359. };
  360.  
  361. class go_gilded_brazier : public GameObjectScript
  362. {
  363. public:
  364. go_gilded_brazier() : GameObjectScript("go_gilded_brazier") { }
  365.  
  366. bool OnGossipHello(Player* player, GameObject* go)
  367. {
  368. if (go->GetGoType() == GAMEOBJECT_TYPE_GOOBER)
  369. {
  370. if (player->GetQuestStatus(9678) == QUEST_STATUS_INCOMPLETE)
  371. {
  372. if (Creature* Stillblade = player->SummonCreature(NPC_STILLBLADE, 8106.11f, -7542.06f, 151.775f, 3.02598f, TEMPSUMMON_DEAD_DESPAWN, 60000))
  373. Stillblade->AI()->AttackStart(player);
  374. }
  375. }
  376. return true;
  377. }
  378. };
  379.  
  380. /*######
  381. ## go_tablet_of_madness
  382. ######*/
  383.  
  384. class go_tablet_of_madness : public GameObjectScript
  385. {
  386. public:
  387. go_tablet_of_madness() : GameObjectScript("go_tablet_of_madness") { }
  388.  
  389. bool OnGossipHello(Player* player, GameObject* /*go*/)
  390. {
  391. if (player->HasSkill(SKILL_ALCHEMY) && player->GetSkillValue(SKILL_ALCHEMY) >= 300 && !player->HasSpell(24266))
  392. player->CastSpell(player, 24267, false);
  393.  
  394. return true;
  395. }
  396. };
  397.  
  398. /*######
  399. ## go_tablet_of_the_seven
  400. ######*/
  401.  
  402. class go_tablet_of_the_seven : public GameObjectScript
  403. {
  404. public:
  405. go_tablet_of_the_seven() : GameObjectScript("go_tablet_of_the_seven") { }
  406.  
  407. //TODO: use gossip option ("Transcript the Tablet") instead, if Trinity adds support.
  408. bool OnGossipHello(Player* player, GameObject* go)
  409. {
  410. if (go->GetGoType() != GAMEOBJECT_TYPE_QUESTGIVER)
  411. return true;
  412.  
  413. if (player->GetQuestStatus(4296) == QUEST_STATUS_INCOMPLETE)
  414. player->CastSpell(player, 15065, false);
  415.  
  416. return true;
  417. }
  418. };
  419.  
  420. /*#####
  421. ## go_jump_a_tron
  422. ######*/
  423.  
  424. class go_jump_a_tron : public GameObjectScript
  425. {
  426. public:
  427. go_jump_a_tron() : GameObjectScript("go_jump_a_tron") { }
  428.  
  429. bool OnGossipHello(Player* player, GameObject* /*go*/)
  430. {
  431. if (player->GetQuestStatus(10111) == QUEST_STATUS_INCOMPLETE)
  432. player->CastSpell(player, 33382, true);
  433.  
  434. return true;
  435. }
  436. };
  437.  
  438. /*######
  439. ## go_sacred_fire_of_life
  440. ######*/
  441.  
  442. enum SacredFireOfLife
  443. {
  444. NPC_ARIKARA = 10882
  445. };
  446.  
  447. class go_sacred_fire_of_life : public GameObjectScript
  448. {
  449. public:
  450. go_sacred_fire_of_life() : GameObjectScript("go_sacred_fire_of_life") { }
  451.  
  452. bool OnGossipHello(Player* player, GameObject* go)
  453. {
  454. if (go->GetGoType() == GAMEOBJECT_TYPE_GOOBER)
  455. player->SummonCreature(NPC_ARIKARA, -5008.338f, -2118.894f, 83.657f, 0.874f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
  456.  
  457. return true;
  458. }
  459. };
  460.  
  461. /*######
  462. ## go_shrine_of_the_birds
  463. ######*/
  464.  
  465. enum ShrineOfTheBirds
  466. {
  467. NPC_HAWK_GUARD = 22992,
  468. NPC_EAGLE_GUARD = 22993,
  469. NPC_FALCON_GUARD = 22994,
  470. GO_SHRINE_HAWK = 185551,
  471. GO_SHRINE_EAGLE = 185547,
  472. GO_SHRINE_FALCON = 185553
  473. };
  474.  
  475. class go_shrine_of_the_birds : public GameObjectScript
  476. {
  477. public:
  478. go_shrine_of_the_birds() : GameObjectScript("go_shrine_of_the_birds") { }
  479.  
  480. bool OnGossipHello(Player* player, GameObject* go)
  481. {
  482. uint32 BirdEntry = 0;
  483.  
  484. float fX, fY, fZ;
  485. go->GetClosePoint(fX, fY, fZ, go->GetObjectSize(), INTERACTION_DISTANCE);
  486.  
  487. switch (go->GetEntry())
  488. {
  489. case GO_SHRINE_HAWK:
  490. BirdEntry = NPC_HAWK_GUARD;
  491. break;
  492. case GO_SHRINE_EAGLE:
  493. BirdEntry = NPC_EAGLE_GUARD;
  494. break;
  495. case GO_SHRINE_FALCON:
  496. BirdEntry = NPC_FALCON_GUARD;
  497. break;
  498. }
  499.  
  500. if (BirdEntry)
  501. player->SummonCreature(BirdEntry, fX, fY, fZ, go->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
  502.  
  503. return false;
  504. }
  505. };
  506.  
  507. /*######
  508. ## go_southfury_moonstone
  509. ######*/
  510.  
  511. enum Southfury
  512. {
  513. NPC_RIZZLE = 23002,
  514. SPELL_BLACKJACK = 39865, //stuns player
  515. SPELL_SUMMON_RIZZLE = 39866
  516. };
  517.  
  518. class go_southfury_moonstone : public GameObjectScript
  519. {
  520. public:
  521. go_southfury_moonstone() : GameObjectScript("go_southfury_moonstone") { }
  522.  
  523. bool OnGossipHello(Player* player, GameObject* /*go*/)
  524. {
  525. //implicitTarget=48 not implemented as of writing this code, and manual summon may be just ok for our purpose
  526. //player->CastSpell(player, SPELL_SUMMON_RIZZLE, false);
  527.  
  528. if (Creature* creature = player->SummonCreature(NPC_RIZZLE, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_DEAD_DESPAWN, 0))
  529. creature->CastSpell(player, SPELL_BLACKJACK, false);
  530.  
  531. return false;
  532. }
  533. };
  534.  
  535. /*######
  536. ## go_tele_to_dalaran_crystal
  537. ######*/
  538.  
  539. enum DalaranCrystal
  540. {
  541. QUEST_LEARN_LEAVE_RETURN = 12790,
  542. QUEST_TELE_CRYSTAL_FLAG = 12845
  543. };
  544.  
  545. #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."
  546.  
  547. class go_tele_to_dalaran_crystal : public GameObjectScript
  548. {
  549. public:
  550. go_tele_to_dalaran_crystal() : GameObjectScript("go_tele_to_dalaran_crystal") { }
  551.  
  552. bool OnGossipHello(Player* player, GameObject* /*go*/)
  553. {
  554. if (player->GetQuestRewardStatus(QUEST_TELE_CRYSTAL_FLAG))
  555. return false;
  556.  
  557. player->GetSession()->SendNotification(GO_TELE_TO_DALARAN_CRYSTAL_FAILED);
  558.  
  559. return true;
  560. }
  561. };
  562.  
  563. /*######
  564. ## go_tele_to_violet_stand
  565. ######*/
  566.  
  567. class go_tele_to_violet_stand : public GameObjectScript
  568. {
  569. public:
  570. go_tele_to_violet_stand() : GameObjectScript("go_tele_to_violet_stand") { }
  571.  
  572. bool OnGossipHello(Player* player, GameObject* /*go*/)
  573. {
  574. if (player->GetQuestRewardStatus(QUEST_LEARN_LEAVE_RETURN) || player->GetQuestStatus(QUEST_LEARN_LEAVE_RETURN) == QUEST_STATUS_INCOMPLETE)
  575. return false;
  576.  
  577. return true;
  578. }
  579. };
  580.  
  581. /*######
  582. ## go_fel_crystalforge
  583. ######*/
  584.  
  585. #define GOSSIP_FEL_CRYSTALFORGE_TEXT 31000
  586. #define GOSSIP_FEL_CRYSTALFORGE_ITEM_TEXT_RETURN 31001
  587. #define GOSSIP_FEL_CRYSTALFORGE_ITEM_1 "Purchase 1 Unstable Flask of the Beast for the cost of 10 Apexis Shards"
  588. #define GOSSIP_FEL_CRYSTALFORGE_ITEM_5 "Purchase 5 Unstable Flask of the Beast for the cost of 50 Apexis Shards"
  589. #define GOSSIP_FEL_CRYSTALFORGE_ITEM_RETURN "Use the fel crystalforge to make another purchase."
  590.  
  591. enum FelCrystalforge
  592. {
  593. SPELL_CREATE_1_FLASK_OF_BEAST = 40964,
  594. SPELL_CREATE_5_FLASK_OF_BEAST = 40965,
  595. };
  596.  
  597. class go_fel_crystalforge : public GameObjectScript
  598. {
  599. public:
  600. go_fel_crystalforge() : GameObjectScript("go_fel_crystalforge") { }
  601.  
  602. bool OnGossipHello(Player* player, GameObject* go)
  603. {
  604. if (go->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER) /* != GAMEOBJECT_TYPE_QUESTGIVER) */
  605. player->PrepareQuestMenu(go->GetGUID()); /* return true*/
  606.  
  607. player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FEL_CRYSTALFORGE_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
  608. player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FEL_CRYSTALFORGE_ITEM_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
  609.  
  610. player->SEND_GOSSIP_MENU(GOSSIP_FEL_CRYSTALFORGE_TEXT, go->GetGUID());
  611.  
  612. return true;
  613. }
  614.  
  615. bool OnGossipSelect(Player* player, GameObject* go, uint32 /*sender*/, uint32 action)
  616. {
  617. player->PlayerTalkClass->ClearMenus();
  618. switch (action)
  619. {
  620. case GOSSIP_ACTION_INFO_DEF:
  621. player->CastSpell(player, SPELL_CREATE_1_FLASK_OF_BEAST, false);
  622. player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FEL_CRYSTALFORGE_ITEM_RETURN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
  623. player->SEND_GOSSIP_MENU(GOSSIP_FEL_CRYSTALFORGE_ITEM_TEXT_RETURN, go->GetGUID());
  624. break;
  625. case GOSSIP_ACTION_INFO_DEF + 1:
  626. player->CastSpell(player, SPELL_CREATE_5_FLASK_OF_BEAST, false);
  627. player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FEL_CRYSTALFORGE_ITEM_RETURN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
  628. player->SEND_GOSSIP_MENU(GOSSIP_FEL_CRYSTALFORGE_ITEM_TEXT_RETURN, go->GetGUID());
  629. break;
  630. case GOSSIP_ACTION_INFO_DEF + 2:
  631. player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FEL_CRYSTALFORGE_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
  632. player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FEL_CRYSTALFORGE_ITEM_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
  633. player->SEND_GOSSIP_MENU(GOSSIP_FEL_CRYSTALFORGE_TEXT, go->GetGUID());
  634. break;
  635. }
  636. return true;
  637. }
  638. };
  639.  
  640. /*######
  641. ## go_bashir_crystalforge
  642. ######*/
  643.  
  644. #define GOSSIP_BASHIR_CRYSTALFORGE_TEXT 31100
  645. #define GOSSIP_BASHIR_CRYSTALFORGE_ITEM_TEXT_RETURN 31101
  646. #define GOSSIP_BASHIR_CRYSTALFORGE_ITEM_1 "Purchase 1 Unstable Flask of the Sorcerer for the cost of 10 Apexis Shards"
  647. #define GOSSIP_BASHIR_CRYSTALFORGE_ITEM_5 "Purchase 5 Unstable Flask of the Sorcerer for the cost of 50 Apexis Shards"
  648. #define GOSSIP_BASHIR_CRYSTALFORGE_ITEM_RETURN "Use the bashir crystalforge to make another purchase."
  649.  
  650. enum BashirCrystalforge
  651. {
  652. SPELL_CREATE_1_FLASK_OF_SORCERER = 40968,
  653. SPELL_CREATE_5_FLASK_OF_SORCERER = 40970,
  654. };
  655.  
  656. class go_bashir_crystalforge : public GameObjectScript
  657. {
  658. public:
  659. go_bashir_crystalforge() : GameObjectScript("go_bashir_crystalforge") { }
  660.  
  661. bool OnGossipHello(Player* player, GameObject* go)
  662. {
  663. if (go->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER) /* != GAMEOBJECT_TYPE_QUESTGIVER) */
  664. player->PrepareQuestMenu(go->GetGUID()); /* return true*/
  665.  
  666. player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BASHIR_CRYSTALFORGE_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
  667. player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BASHIR_CRYSTALFORGE_ITEM_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
  668.  
  669. player->SEND_GOSSIP_MENU(GOSSIP_BASHIR_CRYSTALFORGE_TEXT, go->GetGUID());
  670.  
  671. return true;
  672. }
  673.  
  674. bool OnGossipSelect(Player* player, GameObject* go, uint32 /*sender*/, uint32 action)
  675. {
  676. player->PlayerTalkClass->ClearMenus();
  677. switch (action)
  678. {
  679. case GOSSIP_ACTION_INFO_DEF:
  680. player->CastSpell(player, SPELL_CREATE_1_FLASK_OF_SORCERER, false);
  681. player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BASHIR_CRYSTALFORGE_ITEM_RETURN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
  682. player->SEND_GOSSIP_MENU(GOSSIP_BASHIR_CRYSTALFORGE_ITEM_TEXT_RETURN, go->GetGUID());
  683. break;
  684. case GOSSIP_ACTION_INFO_DEF + 1:
  685. player->CastSpell(player, SPELL_CREATE_5_FLASK_OF_SORCERER, false);
  686. player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BASHIR_CRYSTALFORGE_ITEM_RETURN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
  687. player->SEND_GOSSIP_MENU(GOSSIP_BASHIR_CRYSTALFORGE_ITEM_TEXT_RETURN, go->GetGUID());
  688. break;
  689. case GOSSIP_ACTION_INFO_DEF + 2:
  690. player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BASHIR_CRYSTALFORGE_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
  691. player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BASHIR_CRYSTALFORGE_ITEM_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
  692. player->SEND_GOSSIP_MENU(GOSSIP_BASHIR_CRYSTALFORGE_TEXT, go->GetGUID());
  693. break;
  694. }
  695. return true;
  696. }
  697. };
  698.  
  699. /*######
  700. ## go_scourge_cage
  701. ######*/
  702.  
  703. enum ScourgeCage
  704. {
  705. NPC_SCOURGE_PRISONER = 25610
  706. };
  707.  
  708. class go_scourge_cage : public GameObjectScript
  709. {
  710. public:
  711. go_scourge_cage() : GameObjectScript("go_scourge_cage") { }
  712.  
  713. bool OnGossipHello(Player* player, GameObject* go)
  714. {
  715. go->UseDoorOrButton();
  716. if (Creature* pNearestPrisoner = go->FindNearestCreature(NPC_SCOURGE_PRISONER, 5.0f, true))
  717. {
  718. player->KilledMonsterCredit(NPC_SCOURGE_PRISONER, pNearestPrisoner->GetGUID());
  719. pNearestPrisoner->DisappearAndDie();
  720. }
  721.  
  722. return true;
  723. }
  724. };
  725.  
  726. /*######
  727. ## go_arcane_prison
  728. ######*/
  729.  
  730. enum ArcanePrison
  731. {
  732. QUEST_PRISON_BREAK = 11587,
  733. SPELL_ARCANE_PRISONER_KILL_CREDIT = 45456
  734. };
  735.  
  736. class go_arcane_prison : public GameObjectScript
  737. {
  738. public:
  739. go_arcane_prison() : GameObjectScript("go_arcane_prison") { }
  740.  
  741. bool OnGossipHello(Player* player, GameObject* go)
  742. {
  743. // xinef: prevent spawning hundreds of them
  744. if (player->GetQuestStatus(QUEST_PRISON_BREAK) == QUEST_STATUS_INCOMPLETE && !go->FindNearestCreature(25318, 20.0f))
  745. {
  746. go->SummonCreature(25318, 3485.089844f, 6115.7422188f, 70.966812f, 0, TEMPSUMMON_TIMED_DESPAWN, 60000);
  747. player->CastSpell(player, SPELL_ARCANE_PRISONER_KILL_CREDIT, true);
  748. return true;
  749. }
  750. return false;
  751. }
  752. };
  753.  
  754. /*######
  755. ## go_jotunheim_cage
  756. ######*/
  757.  
  758. enum JotunheimCage
  759. {
  760. NPC_EBON_BLADE_PRISONER_HUMAN = 30186,
  761. NPC_EBON_BLADE_PRISONER_NE = 30194,
  762. NPC_EBON_BLADE_PRISONER_TROLL = 30196,
  763. NPC_EBON_BLADE_PRISONER_ORC = 30195,
  764.  
  765. SPELL_SUMMON_BLADE_KNIGHT_H = 56207,
  766. SPELL_SUMMON_BLADE_KNIGHT_NE = 56209,
  767. SPELL_SUMMON_BLADE_KNIGHT_ORC = 56212,
  768. SPELL_SUMMON_BLADE_KNIGHT_TROLL = 56214
  769. };
  770.  
  771. class go_jotunheim_cage : public GameObjectScript
  772. {
  773. public:
  774. go_jotunheim_cage() : GameObjectScript("go_jotunheim_cage") { }
  775.  
  776. bool OnGossipHello(Player* player, GameObject* go)
  777. {
  778. go->UseDoorOrButton();
  779. Creature* pPrisoner = go->FindNearestCreature(NPC_EBON_BLADE_PRISONER_HUMAN, 5.0f, true);
  780. if (!pPrisoner)
  781. {
  782. pPrisoner = go->FindNearestCreature(NPC_EBON_BLADE_PRISONER_TROLL, 5.0f, true);
  783. if (!pPrisoner)
  784. {
  785. pPrisoner = go->FindNearestCreature(NPC_EBON_BLADE_PRISONER_ORC, 5.0f, true);
  786. if (!pPrisoner)
  787. pPrisoner = go->FindNearestCreature(NPC_EBON_BLADE_PRISONER_NE, 5.0f, true);
  788. }
  789. }
  790. if (!pPrisoner || !pPrisoner->IsAlive())
  791. return false;
  792.  
  793. pPrisoner->DespawnOrUnsummon();
  794. player->KilledMonsterCredit(NPC_EBON_BLADE_PRISONER_HUMAN, 0);
  795. switch (pPrisoner->GetEntry())
  796. {
  797. case NPC_EBON_BLADE_PRISONER_HUMAN:
  798. player->CastSpell(player, SPELL_SUMMON_BLADE_KNIGHT_H, true);
  799. break;
  800. case NPC_EBON_BLADE_PRISONER_NE:
  801. player->CastSpell(player, SPELL_SUMMON_BLADE_KNIGHT_NE, true);
  802. break;
  803. case NPC_EBON_BLADE_PRISONER_TROLL:
  804. player->CastSpell(player, SPELL_SUMMON_BLADE_KNIGHT_TROLL, true);
  805. break;
  806. case NPC_EBON_BLADE_PRISONER_ORC:
  807. player->CastSpell(player, SPELL_SUMMON_BLADE_KNIGHT_ORC, true);
  808. break;
  809. }
  810. return true;
  811. }
  812. };
  813.  
  814. enum TableTheka
  815. {
  816. GOSSIP_TABLE_THEKA = 1653,
  817.  
  818. QUEST_SPIDER_GOLD = 2936
  819. };
  820.  
  821. class go_table_theka : public GameObjectScript
  822. {
  823. public:
  824. go_table_theka() : GameObjectScript("go_table_theka") { }
  825.  
  826. bool OnGossipHello(Player* player, GameObject* go)
  827. {
  828. if (player->GetQuestStatus(QUEST_SPIDER_GOLD) == QUEST_STATUS_INCOMPLETE)
  829. player->AreaExploredOrEventHappens(QUEST_SPIDER_GOLD);
  830.  
  831. player->SEND_GOSSIP_MENU(GOSSIP_TABLE_THEKA, go->GetGUID());
  832.  
  833. return true;
  834. }
  835. };
  836.  
  837. /*######
  838. ## go_inconspicuous_landmark
  839. ######*/
  840.  
  841. enum InconspicuousLandmark
  842. {
  843. SPELL_SUMMON_PIRATES_TREASURE_AND_TRIGGER_MOB = 11462,
  844. ITEM_CUERGOS_KEY = 9275,
  845. };
  846.  
  847. class go_inconspicuous_landmark : public GameObjectScript
  848. {
  849. public:
  850. go_inconspicuous_landmark() : GameObjectScript("go_inconspicuous_landmark")
  851. {
  852. _lastUsedTime = time(NULL);
  853. }
  854.  
  855. bool OnGossipHello(Player* player, GameObject* /*go*/)
  856. {
  857. if (player->HasItemCount(ITEM_CUERGOS_KEY))
  858. return true;
  859.  
  860. if (_lastUsedTime > time(NULL))
  861. return true;
  862.  
  863. _lastUsedTime = time(NULL) + MINUTE;
  864. player->CastSpell(player, SPELL_SUMMON_PIRATES_TREASURE_AND_TRIGGER_MOB, true);
  865. return true;
  866. }
  867.  
  868. private:
  869. uint32 _lastUsedTime;
  870. };
  871.  
  872. /*######
  873. ## go_soulwell
  874. ######*/
  875.  
  876. enum SoulWellData
  877. {
  878. GO_SOUL_WELL_R1 = 181621,
  879. GO_SOUL_WELL_R2 = 193169,
  880.  
  881. SPELL_IMPROVED_HEALTH_STONE_R1 = 18692,
  882. SPELL_IMPROVED_HEALTH_STONE_R2 = 18693,
  883.  
  884. SPELL_CREATE_MASTER_HEALTH_STONE_R0 = 34130,
  885. SPELL_CREATE_MASTER_HEALTH_STONE_R1 = 34149,
  886. SPELL_CREATE_MASTER_HEALTH_STONE_R2 = 34150,
  887.  
  888. SPELL_CREATE_FEL_HEALTH_STONE_R0 = 58890,
  889. SPELL_CREATE_FEL_HEALTH_STONE_R1 = 58896,
  890. SPELL_CREATE_FEL_HEALTH_STONE_R2 = 58898,
  891. };
  892.  
  893. class go_soulwell : public GameObjectScript
  894. {
  895. public:
  896. go_soulwell() : GameObjectScript("go_soulwell") { }
  897.  
  898. struct go_soulwellAI : public GameObjectAI
  899. {
  900. go_soulwellAI(GameObject* go) : GameObjectAI(go) { }
  901.  
  902. /// Due to the fact that this GameObject triggers CMSG_GAMEOBJECT_USE
  903. /// _and_ CMSG_GAMEOBJECT_REPORT_USE, this GossipHello hook is called
  904. /// twice. The script's handling is fine as it won't remove two charges
  905. /// on the well. We have to find how to segregate REPORT_USE and USE.
  906. bool GossipHello(Player* player, bool reportUse)
  907. {
  908. if (reportUse)
  909. return false;
  910.  
  911. _stoneSpell = 0;
  912. _stoneId = 0;
  913. Unit* owner = go->GetOwner();
  914. switch (go->GetEntry())
  915. {
  916. case GO_SOUL_WELL_R1:
  917. if (owner->HasAura(SPELL_IMPROVED_HEALTH_STONE_R1))
  918. _stoneSpell = SPELL_CREATE_MASTER_HEALTH_STONE_R1;
  919. else if (owner->HasAura(SPELL_IMPROVED_HEALTH_STONE_R2))
  920. _stoneSpell = SPELL_CREATE_MASTER_HEALTH_STONE_R2;
  921. else
  922. _stoneSpell = SPELL_CREATE_MASTER_HEALTH_STONE_R0;
  923. break;
  924. case GO_SOUL_WELL_R2:
  925. if (owner->HasAura(SPELL_IMPROVED_HEALTH_STONE_R1))
  926. _stoneSpell = SPELL_CREATE_FEL_HEALTH_STONE_R1;
  927. else if (owner->HasAura(SPELL_IMPROVED_HEALTH_STONE_R2))
  928. _stoneSpell = SPELL_CREATE_FEL_HEALTH_STONE_R2;
  929. else
  930. _stoneSpell = SPELL_CREATE_FEL_HEALTH_STONE_R0;
  931. break;
  932. }
  933.  
  934. SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(_stoneSpell);
  935. if (!spellInfo)
  936. return true;
  937.  
  938. _stoneId = spellInfo->Effects[EFFECT_0].ItemType;
  939. if (_stoneSpell == 0 || _stoneId == 0)
  940. {
  941. if (SpellInfo const* spell = sSpellMgr->GetSpellInfo(_stoneSpell))
  942. Spell::SendCastResult(player, spell, 0, SPELL_FAILED_ERROR);
  943. return true;
  944. }
  945.  
  946. if (!owner || owner->GetTypeId() != TYPEID_PLAYER || !player->IsInSameRaidWith(owner->ToPlayer()))
  947. {
  948. if (SpellInfo const* spell = sSpellMgr->GetSpellInfo(_stoneSpell))
  949. Spell::SendCastResult(player, spell, 0, SPELL_FAILED_TARGET_NOT_IN_RAID);
  950. return true;
  951. }
  952.  
  953. // Don't try to add a stone if we already have one.
  954. if (player->HasItemCount(_stoneId))
  955. {
  956. if (SpellInfo const* spell = sSpellMgr->GetSpellInfo(_stoneSpell))
  957. Spell::SendCastResult(player, spell, 0, SPELL_FAILED_TOO_MANY_OF_ITEM);
  958. return true;
  959. }
  960.  
  961. player->CastSpell(player, _stoneSpell, false);
  962.  
  963. // Item has to actually be created to remove a charge on the well.
  964. if (player->HasItemCount(_stoneId))
  965. go->AddUse();
  966.  
  967. return true;
  968. }
  969.  
  970. private:
  971. uint32 _stoneSpell;
  972. uint32 _stoneId;
  973. };
  974.  
  975. GameObjectAI* GetAI(GameObject* go) const
  976. {
  977. return new go_soulwellAI(go);
  978. }
  979. };
  980.  
  981. /*######
  982. ## Quest 11255: Prisoners of Wyrmskull
  983. ## go_dragonflayer_cage
  984. ######*/
  985.  
  986. enum PrisonersOfWyrmskull
  987. {
  988. QUEST_PRISONERS_OF_WYRMSKULL = 11255,
  989. NPC_PRISONER_PRIEST = 24086,
  990. NPC_PRISONER_MAGE = 24088,
  991. NPC_PRISONER_WARRIOR = 24089,
  992. NPC_PRISONER_PALADIN = 24090
  993. };
  994.  
  995. class go_dragonflayer_cage : public GameObjectScript
  996. {
  997. public:
  998. go_dragonflayer_cage() : GameObjectScript("go_dragonflayer_cage") { }
  999.  
  1000. bool OnGossipHello(Player* player, GameObject* go)
  1001. {
  1002. go->UseDoorOrButton();
  1003. if (player->GetQuestStatus(QUEST_PRISONERS_OF_WYRMSKULL) != QUEST_STATUS_INCOMPLETE)
  1004. return true;
  1005.  
  1006. Creature* pPrisoner = go->FindNearestCreature(NPC_PRISONER_PRIEST, 2.0f);
  1007. if (!pPrisoner)
  1008. {
  1009. pPrisoner = go->FindNearestCreature(NPC_PRISONER_MAGE, 2.0f);
  1010. if (!pPrisoner)
  1011. {
  1012. pPrisoner = go->FindNearestCreature(NPC_PRISONER_WARRIOR, 2.0f);
  1013. if (!pPrisoner)
  1014. pPrisoner = go->FindNearestCreature(NPC_PRISONER_PALADIN, 2.0f);
  1015. }
  1016. }
  1017.  
  1018. if (!pPrisoner || !pPrisoner->IsAlive())
  1019. return true;
  1020.  
  1021. Quest const* qInfo = sObjectMgr->GetQuestTemplate(QUEST_PRISONERS_OF_WYRMSKULL);
  1022. if (qInfo)
  1023. {
  1024. /// @todo prisoner should help player for a short period of time
  1025. player->KilledMonsterCredit(qInfo->RequiredNpcOrGo[0], 0);
  1026. pPrisoner->DisappearAndDie();
  1027. }
  1028. return true;
  1029. }
  1030. };
  1031.  
  1032. /*######
  1033. ## go_amberpine_outhouse
  1034. ######*/
  1035.  
  1036. #define GOSSIP_USE_OUTHOUSE "Use the outhouse."
  1037. #define GO_ANDERHOLS_SLIDER_CIDER_NOT_FOUND "Quest item Anderhol's Slider Cider not found."
  1038.  
  1039. enum AmberpineOuthouse
  1040. {
  1041. ITEM_ANDERHOLS_SLIDER_CIDER = 37247,
  1042. NPC_OUTHOUSE_BUNNY = 27326,
  1043. QUEST_DOING_YOUR_DUTY = 12227,
  1044. SPELL_INDISPOSED = 53017,
  1045. SPELL_INDISPOSED_III = 48341,
  1046. SPELL_CREATE_AMBERSEEDS = 48330,
  1047. GOSSIP_OUTHOUSE_INUSE = 12775,
  1048. GOSSIP_OUTHOUSE_VACANT = 12779
  1049. };
  1050.  
  1051. class go_amberpine_outhouse : public GameObjectScript
  1052. {
  1053. public:
  1054. go_amberpine_outhouse() : GameObjectScript("go_amberpine_outhouse") { }
  1055.  
  1056. bool OnGossipHello(Player* player, GameObject* go)
  1057. {
  1058. QuestStatus status = player->GetQuestStatus(QUEST_DOING_YOUR_DUTY);
  1059. if (status == QUEST_STATUS_INCOMPLETE || status == QUEST_STATUS_COMPLETE || status == QUEST_STATUS_REWARDED)
  1060. {
  1061. player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_USE_OUTHOUSE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
  1062. player->SEND_GOSSIP_MENU(GOSSIP_OUTHOUSE_VACANT, go->GetGUID());
  1063. }
  1064. else
  1065. player->SEND_GOSSIP_MENU(GOSSIP_OUTHOUSE_INUSE, go->GetGUID());
  1066.  
  1067. return true;
  1068. }
  1069.  
  1070. bool OnGossipSelect(Player* player, GameObject* go, uint32 /*sender*/, uint32 action)
  1071. {
  1072. player->PlayerTalkClass->ClearMenus();
  1073. if (action == GOSSIP_ACTION_INFO_DEF +1)
  1074. {
  1075. player->CLOSE_GOSSIP_MENU();
  1076. Creature* target = GetClosestCreatureWithEntry(player, NPC_OUTHOUSE_BUNNY, 3.0f);
  1077. if (target)
  1078. {
  1079. target->AI()->SetData(1, player->getGender());
  1080. go->CastSpell(target, SPELL_INDISPOSED_III);
  1081. }
  1082. go->CastSpell(player, SPELL_INDISPOSED);
  1083. if (player->HasItemCount(ITEM_ANDERHOLS_SLIDER_CIDER))
  1084. player->CastSpell(player, SPELL_CREATE_AMBERSEEDS, true);
  1085. return true;
  1086. }
  1087. else
  1088. {
  1089. player->CLOSE_GOSSIP_MENU();
  1090. player->GetSession()->SendNotification(GO_ANDERHOLS_SLIDER_CIDER_NOT_FOUND);
  1091. return false;
  1092. }
  1093. }
  1094. };
  1095.  
  1096. /*######
  1097. ## Quest 1126: Hive in the Tower
  1098. ## go_hive_pod
  1099. ######*/
  1100.  
  1101. enum Hives
  1102. {
  1103. QUEST_HIVE_IN_THE_TOWER = 9544,
  1104. NPC_HIVE_AMBUSHER = 13301
  1105. };
  1106.  
  1107. class go_hive_pod : public GameObjectScript
  1108. {
  1109. public:
  1110. go_hive_pod() : GameObjectScript("go_hive_pod") { }
  1111.  
  1112. bool OnGossipHello(Player* player, GameObject* go)
  1113. {
  1114. player->SendLoot(go->GetGUID(), LOOT_CORPSE);
  1115.  
  1116. // xinef: prevent spawning hundreds of them
  1117. if (go->FindNearestCreature(NPC_HIVE_AMBUSHER, 20.0f))
  1118. return true;
  1119.  
  1120. go->SummonCreature(NPC_HIVE_AMBUSHER, go->GetPositionX()+1, go->GetPositionY(), go->GetPositionZ(), go->GetAngle(player), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000);
  1121. go->SummonCreature(NPC_HIVE_AMBUSHER, go->GetPositionX(), go->GetPositionY()+1, go->GetPositionZ(), go->GetAngle(player), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000);
  1122. return true;
  1123. }
  1124. };
  1125.  
  1126. class go_massive_seaforium_charge : public GameObjectScript
  1127. {
  1128. public:
  1129. go_massive_seaforium_charge() : GameObjectScript("go_massive_seaforium_charge") { }
  1130.  
  1131. bool OnGossipHello(Player* /*player*/, GameObject* go)
  1132. {
  1133. go->SetLootState(GO_JUST_DEACTIVATED);
  1134. return true;
  1135. }
  1136. };
  1137.  
  1138. /*########
  1139. #### go_veil_skith_cage
  1140. #####*/
  1141.  
  1142. enum MissingFriends
  1143. {
  1144. QUEST_MISSING_FRIENDS = 10852,
  1145. NPC_CAPTIVE_CHILD = 22314,
  1146. SAY_FREE_0 = 0,
  1147. };
  1148.  
  1149. class go_veil_skith_cage : public GameObjectScript
  1150. {
  1151. public:
  1152. go_veil_skith_cage() : GameObjectScript("go_veil_skith_cage") { }
  1153.  
  1154. bool OnGossipHello(Player* player, GameObject* go)
  1155. {
  1156. go->UseDoorOrButton();
  1157. if (player->GetQuestStatus(QUEST_MISSING_FRIENDS) == QUEST_STATUS_INCOMPLETE)
  1158. {
  1159. std::list<Creature*> childrenList;
  1160. GetCreatureListWithEntryInGrid(childrenList, go, NPC_CAPTIVE_CHILD, INTERACTION_DISTANCE);
  1161. for (std::list<Creature*>::const_iterator itr = childrenList.begin(); itr != childrenList.end(); ++itr)
  1162. {
  1163. player->KilledMonsterCredit(NPC_CAPTIVE_CHILD, (*itr)->GetGUID());
  1164. (*itr)->DespawnOrUnsummon(5000);
  1165. (*itr)->GetMotionMaster()->MovePoint(1, go->GetPositionX()+5, go->GetPositionY(), go->GetPositionZ());
  1166. (*itr)->AI()->Talk(SAY_FREE_0);
  1167. (*itr)->GetMotionMaster()->Clear();
  1168. }
  1169. }
  1170. return false;
  1171. }
  1172. };
  1173.  
  1174. void AddSC_go_scripts()
  1175. {
  1176. // Ours
  1177. new go_noblegarden_colored_egg();
  1178. new go_seer_of_zebhalak();
  1179. new go_mistwhisper_treasure();
  1180. new go_witherbark_totem_bundle();
  1181. new go_arena_ready_marker();
  1182. new go_ethereum_prison();
  1183. new go_ethereum_stasis();
  1184. new go_resonite_cask();
  1185. new go_tadpole_cage();
  1186.  
  1187. // Theirs
  1188. new go_cat_figurine();
  1189. new go_gilded_brazier();
  1190. new go_shrine_of_the_birds();
  1191. new go_southfury_moonstone();
  1192. new go_tablet_of_madness();
  1193. new go_tablet_of_the_seven();
  1194. new go_jump_a_tron();
  1195. new go_sacred_fire_of_life();
  1196. new go_tele_to_dalaran_crystal();
  1197. new go_tele_to_violet_stand();
  1198. new go_fel_crystalforge();
  1199. new go_bashir_crystalforge();
  1200. new go_scourge_cage();
  1201. new go_arcane_prison();
  1202. new go_jotunheim_cage();
  1203. new go_table_theka();
  1204. new go_inconspicuous_landmark();
  1205. new go_soulwell();
  1206. new go_dragonflayer_cage();
  1207. new go_amberpine_outhouse();
  1208. new go_hive_pod();
  1209. new go_massive_seaforium_charge();
  1210. new go_veil_skith_cage();
  1211. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement