casucristy

ss

Jul 23rd, 2012
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 6.21 KB | None | 0 0
  1. From 4367e51ed12b2dcc0f6249eab9407c313b67d7b7 Mon Sep 17 00:00:00 2001
  2. From: unknown <cristi@cristis-PC.(none)>
  3. Date: Mon, 23 Jul 2012 23:30:36 +0300
  4. Subject: [PATCH] Fix quest Audience with the Stonemother
  5.  
  6. ---
  7.  src/server/scripts/Maelstrom/deepholm.cpp |  135 +++++++++++++++++++++++++++++
  8.  1 file changed, 135 insertions(+)
  9.  
  10. diff --git a/src/server/scripts/Maelstrom/deepholm.cpp b/src/server/scripts/Maelstrom/deepholm.cpp
  11. index e3da6b2..8027806 100644
  12. --- a/src/server/scripts/Maelstrom/deepholm.cpp
  13. +++ b/src/server/scripts/Maelstrom/deepholm.cpp
  14. @@ -1037,6 +1037,140 @@ public:
  15.      }
  16.  };
  17.  
  18. +/*####
  19. +## Support for quest An Audience with the Stonemother
  20. +##########*/
  21. +
  22. +enum eTherazaneEntries
  23. +{
  24. +   QUEST_AN_AUDIENCE_WITH_THE_STONEMOTHER      =   26752,
  25. +   NPC_EARTHCALLER_TORUNSCAR                   =   43809,
  26. +   QUEST_CREDIT                                =   44051
  27. +};
  28. +
  29. +#define THERAZANE_EMOTE_01     "Stay where you are..."
  30. +
  31. +//therazane text
  32. +#define TEXT_THEREZANE_01 "So small. So soft. It's a wonder you've even lasted this long down here, fleshling."
  33. +#define TEXT_THEREZANE_02 "Or perhaps a testament to your abilities?"
  34. +#define TEXT_THEREZANE_03 "All of this for a piece of the World Pillar? What exactly shaman do you intend to do with it?"
  35. +#define TEXT_THEREZANE_04 "And what then? Will you leave Deepholm to its denizens?"
  36. +#define TEXT_THEREZANE_05 "I'm glad you're at least that perceptive."
  37. +#define TEXT_THEREZANE_06 "I propose this: We will march on the Twilight cult and extinguish any utterings of Deathwing's name from this realm. Your Earthen Ring will march with us."
  38. +#define TEXT_THEREZANE_07 "You do this, and I will send Gorsik to the temple with our piece of the World Pillar."
  39. +#define TEXT_THEREZANE_08 "Seal the rift and leave this place."
  40. +#define TEXT_THEREZANE_09 "Save your thanks. We march upon the Twilight Precipice as soon as our forces are gathered. I expect to see you on the battlefield."
  41. +//earthcaller text
  42. +#define TEXT_EARTHCALLER_01 "We came here to seal da rift Deathwing tore into Azeroth. We need the World Pillar to repair da hole on dis side."
  43. +#define TEXT_EARTHCALLER_02 "We'll leave. We've no desire to be stayin' where we're not welcome."
  44. +#define TEXT_EARTHCALLER_03 "We'll be doin' exactly that then. Ya have our tanks, Stonemother."
  45. +
  46. +class npc_therazane: public CreatureScript
  47. +{
  48. +    public:
  49. +        npc_therazane() : CreatureScript("npc_therazane") { }
  50. +
  51. +       bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest)
  52. +       {
  53. +           if (quest->GetQuestId() == QUEST_AN_AUDIENCE_WITH_THE_STONEMOTHER)
  54. +           {
  55. +               creature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NOT_SELECTABLE);
  56. +               creature->MonsterTextEmote(THERAZANE_EMOTE_01,player->GetGUID(),true);
  57. +               if (npc_therazane::npc_therazaneAI* pTherazane = CAST_AI(npc_therazane::npc_therazaneAI, creature->AI()))
  58. +               {
  59. +                   pTherazane->bAudienceWithTheStonemother = true;
  60. +                   pTherazane->pQuestOwner = player;
  61. +               }
  62. +           }
  63. +           return true;
  64. +       }
  65. +
  66. +       bool OnGossipHello(Player* player, Creature* creature)
  67. +       {
  68. +           if (creature->isQuestGiver())
  69. +               player->PrepareQuestMenu(creature->GetGUID());
  70. +
  71. +           player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
  72. +
  73. +           return true;
  74. +       }
  75. +
  76. +       struct npc_therazaneAI : public ScriptedAI
  77. +       {
  78. +           npc_therazaneAI(Creature* creature) : ScriptedAI(creature)
  79. +           { pQuestOwner = NULL; }
  80. +
  81. +           bool    bAudienceWithTheStonemother;
  82. +           uint32  m_saytimer;
  83. +           uint32  m_phase;
  84. +           Player* pQuestOwner;
  85. +           Unit*   pEarthCaller;
  86. +
  87. +           void Reset()
  88. +           {
  89. +               me->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NOT_SELECTABLE);
  90. +               me->SetFlag(UNIT_NPC_FLAGS,UNIT_NPC_FLAG_GOSSIP+UNIT_NPC_FLAG_QUESTGIVER);
  91. +               bAudienceWithTheStonemother = false;
  92. +               m_saytimer = 3000;
  93. +               m_phase = 0;
  94. +               pQuestOwner = NULL;
  95. +               pEarthCaller = me->FindNearestCreature(NPC_EARTHCALLER_TORUNSCAR,100.0f);
  96. +           }
  97. +
  98. +           void UpdateAI(uint32 const diff)
  99. +           {
  100. +               if(bAudienceWithTheStonemother)
  101. +               {
  102. +                   if(m_saytimer <= diff)
  103. +                   {
  104. +                       if(pQuestOwner && pQuestOwner->isAlive() && me->GetDistance(pQuestOwner) <= 50.0f && pEarthCaller)
  105. +                       {
  106. +                           switch (m_phase)
  107. +                           {
  108. +                               case 0: me->MonsterYell(TEXT_THEREZANE_01,LANG_UNIVERSAL,pQuestOwner->GetGUID());m_phase++;break;
  109. +                               case 1: me->MonsterYell(TEXT_THEREZANE_02,LANG_UNIVERSAL,pQuestOwner->GetGUID());m_phase++;break;
  110. +                               case 2: me->MonsterYell(TEXT_THEREZANE_03,LANG_UNIVERSAL,pQuestOwner->GetGUID());m_phase++;break;
  111. +                               case 3: pEarthCaller->MonsterYell(TEXT_EARTHCALLER_01,LANG_UNIVERSAL,pQuestOwner->GetGUID());m_phase++;break;
  112. +                               case 4: me->MonsterYell(TEXT_THEREZANE_04,LANG_UNIVERSAL,pQuestOwner->GetGUID());m_phase++;break;
  113. +                               case 5: pEarthCaller->MonsterYell(TEXT_EARTHCALLER_02,LANG_UNIVERSAL,pQuestOwner->GetGUID());m_phase++;break;
  114. +                               case 6: me->MonsterYell(TEXT_THEREZANE_05,LANG_UNIVERSAL,pQuestOwner->GetGUID());m_phase++;break;
  115. +                               case 7: me->MonsterYell(TEXT_THEREZANE_06,LANG_UNIVERSAL,pQuestOwner->GetGUID());m_phase++;break;
  116. +                               case 8: me->MonsterYell(TEXT_THEREZANE_07,LANG_UNIVERSAL,pQuestOwner->GetGUID());m_phase++;break;
  117. +                               case 9: me->MonsterYell(TEXT_THEREZANE_08,LANG_UNIVERSAL,pQuestOwner->GetGUID());m_phase++;break;
  118. +                               case 10: pEarthCaller->MonsterYell(TEXT_EARTHCALLER_03,LANG_UNIVERSAL,pQuestOwner->GetGUID());m_phase++;break;
  119. +                               case 11: me->MonsterYell(TEXT_THEREZANE_09,LANG_UNIVERSAL,pQuestOwner->GetGUID());m_phase++;break;
  120. +                               default: break;
  121. +                           }
  122. +
  123. +                           if(m_phase == 12 && pQuestOwner->isAlive())
  124. +                           {
  125. +                               pQuestOwner->KilledMonsterCredit(QUEST_CREDIT,0);
  126. +                               me->GetAI()->Reset();
  127. +                               return;
  128. +                           }
  129. +
  130. +                           m_saytimer = 3000;
  131. +                       }
  132. +                       else
  133. +                           me->GetAI()->Reset();
  134. +                   }
  135. +                   else m_saytimer -= diff;
  136. +               }
  137. +
  138. +               if(!UpdateVictim())
  139. +                   return;
  140. +
  141. +               DoMeleeAttackIfReady();
  142. +           }
  143. +
  144. +       };
  145. +
  146. +       CreatureAI* GetAI(Creature *creature) const
  147. +       {
  148. +           return new npc_therazaneAI(creature);
  149. +       }
  150. +};
  151. +
  152.  void AddSC_deepholm()
  153.  {
  154.      new npc_lodestone();
  155. @@ -1058,4 +1192,5 @@ void AddSC_deepholm()
  156.     new npc_bound_elemental();
  157.     new go_rod_of_subjugations();
  158.     new spell_smash_chains();
  159. +   new npc_therazane();
  160.  }
  161. --
  162. 1.7.10.msysgit.1
Advertisement
Add Comment
Please, Sign In to add comment