casucristy

ss

Jul 20th, 2012
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 4.74 KB | None | 0 0
  1. From 16f339a3418402eab0f6affd7ea84e458fa6251d Mon Sep 17 00:00:00 2001
  2. From: unknown <cristi@cristis-PC.(none)>
  3. Date: Fri, 20 Jul 2012 20:31:52 +0300
  4. Subject: [PATCH] Fix for quest Fungal Monstrosities and Sproud No More
  5.  
  6. ---
  7.  src/server/scripts/Maelstrom/deepholm.cpp |  151 +++++++++++++++++++++++++++++
  8.  1 file changed, 151 insertions(+)
  9.  
  10. diff --git a/src/server/scripts/Maelstrom/deepholm.cpp b/src/server/scripts/Maelstrom/deepholm.cpp
  11. index a4dbbac..94042bb 100644
  12. --- a/src/server/scripts/Maelstrom/deepholm.cpp
  13. +++ b/src/server/scripts/Maelstrom/deepholm.cpp
  14. @@ -620,6 +620,154 @@ class npc_terrath_the_steady: public CreatureScript
  15.         }
  16.  };
  17.  
  18. +/*##
  19. +#  Support for quests: - Fungal Monstrosities
  20. +#                      - Sprout No More
  21. +########*/
  22. +
  23. +enum eWarGuardianEntries
  24. +{
  25. +   QUEST_FUNGAL_MONSTROSITIES      =   26792,
  26. +   QUEST_SPROUT_NO_MORE            =   26791,
  27. +   SPELL_SUMMON_WAR_GUARDIAN       =   82535,
  28. +   SPELL_EXPLODE                   =   65429,
  29. +   SPELL_CHOCKING_WOUND            =   35247,
  30. +   SPELL_EARTH_SHOCK               =   25025,
  31. +   SPELL_GROUND_SMASH              =   82120,
  32. +   SPELL_THUNDERCLAP               =   8078,
  33. +   NPC_WAR_GUARDIAN_FOLLOWER       =   44118,
  34. +   NPC_GIANT_MUSHROOM              =   44049,
  35. +   NPC_STONE_TROGG_EARTHRAGER      =   43616
  36. +};
  37. +
  38. +class npc_war_guardian : public CreatureScript
  39. +{
  40. +    public:
  41. +        npc_war_guardian() : CreatureScript("npc_war_guardian") { }
  42. +
  43. +       bool OnGossipHello(Player* player, Creature* creature)
  44. +       {
  45. +           if(player->GetQuestStatus(QUEST_FUNGAL_MONSTROSITIES)==QUEST_STATUS_INCOMPLETE
  46. +               || player->GetQuestStatus(QUEST_SPROUT_NO_MORE)==QUEST_STATUS_INCOMPLETE)
  47. +           {
  48. +               player->CastSpell(player,SPELL_SUMMON_WAR_GUARDIAN);
  49. +           }
  50. +           return true;
  51. +       }
  52. +};
  53. +
  54. +class npc_war_guardian_follower : public CreatureScript
  55. +{
  56. +    public:
  57. +        npc_war_guardian_follower() : CreatureScript("npc_war_guardian_follower") { }
  58. +
  59. +       struct npc_war_guardian_followerAI : public ScriptedAI
  60. +       {
  61. +           npc_war_guardian_followerAI(Creature* creature) : ScriptedAI(creature) { }
  62. +
  63. +           uint32  uiChokingWoundTimer;
  64. +           uint32  uiEarthShockTimer;
  65. +           uint32  uiGroundSmashTimer;
  66. +           uint32  uiThunderClapTimer;
  67. +
  68. +           void Reset()
  69. +           {
  70. +               uiChokingWoundTimer =   urand(20000,25000);
  71. +               uiEarthShockTimer   =   urand(5000,7000);
  72. +               uiGroundSmashTimer  =   urand(3000,5000);
  73. +               uiThunderClapTimer  =   urand(12000,15000);
  74. +           }
  75. +
  76. +           void UpdateAI(uint32 const diff)
  77. +           {
  78. +               if (!UpdateVictim())
  79. +                   return;
  80. +
  81. +               //choking wound
  82. +               if(uiChokingWoundTimer <= diff)
  83. +               {
  84. +                   DoCastVictim(SPELL_CHOCKING_WOUND);
  85. +                   uiChokingWoundTimer = urand(20000,25000);
  86. +               }
  87. +               else    uiChokingWoundTimer -= diff;
  88. +
  89. +               //earth shok
  90. +               if(uiEarthShockTimer <= diff)
  91. +               {
  92. +                   DoCastVictim(SPELL_EARTH_SHOCK);
  93. +                   uiEarthShockTimer = urand(5000,7000);
  94. +               }
  95. +               else    uiEarthShockTimer -= diff;
  96. +
  97. +               //ground smash
  98. +               if(uiGroundSmashTimer <= diff)
  99. +               {
  100. +                   DoCastVictim(SPELL_GROUND_SMASH);
  101. +                   uiGroundSmashTimer = urand(3000,5000);
  102. +               }
  103. +               else    uiGroundSmashTimer -= diff;
  104. +
  105. +               //thunderclap
  106. +               if(uiThunderClapTimer <= diff)
  107. +               {
  108. +                   DoCastVictim(SPELL_THUNDERCLAP);
  109. +                   uiThunderClapTimer = urand(12000,15000);
  110. +               }
  111. +               else    uiThunderClapTimer -= diff;
  112. +
  113. +               DoMeleeAttackIfReady();
  114. +           }
  115. +
  116. +       };
  117. +
  118. +       CreatureAI* GetAI(Creature *creature) const
  119. +       {
  120. +           return new npc_war_guardian_followerAI(creature);
  121. +       }
  122. +};
  123. +
  124. +
  125. +class npc_giant_mushroom : public CreatureScript
  126. +{
  127. +    public:
  128. +        npc_giant_mushroom() : CreatureScript("npc_giant_mushroom") { }
  129. +
  130. +       struct npc_giant_mushroomAI : public ScriptedAI
  131. +       {
  132. +           npc_giant_mushroomAI(Creature* creature) : ScriptedAI(creature) { }
  133. +
  134. +           void Reset()
  135. +           {
  136. +           }
  137. +
  138. +           void MoveInLineOfSight(Unit* who)
  139. +           {
  140. +               Player* player = who->ToPlayer();
  141. +
  142. +               if(player && (me->GetDistance(player) < 10.0f) &&
  143. +                   (player->GetQuestStatus(QUEST_FUNGAL_MONSTROSITIES)==QUEST_STATUS_INCOMPLETE))
  144. +               {
  145. +                   Unit* unit = player->GetSelectedUnit();
  146. +                   if(unit && unit->GetGUID() == me->GetGUID())
  147. +                   {
  148. +                       me->CastSpell(me,SPELL_EXPLODE);
  149. +                       player->KilledMonsterCredit(NPC_GIANT_MUSHROOM,0);
  150. +                       Unit* unit = me->SummonCreature(NPC_STONE_TROGG_EARTHRAGER,me->GetPositionX(),me->GetPositionY(),me->GetPositionZ(),0.0f);
  151. +                       me->DespawnOrUnsummon(1000);
  152. +
  153. +                       if(unit)
  154. +                           unit->Attack(player,true);
  155. +                   }
  156. +               }
  157. +           }
  158. +       };
  159. +
  160. +       CreatureAI* GetAI(Creature *creature) const
  161. +       {
  162. +           return new npc_giant_mushroomAI(creature);
  163. +       }
  164. +};
  165. +
  166.  void AddSC_deepholm()
  167.  {
  168.      new npc_lodestone();
  169. @@ -633,4 +781,7 @@ void AddSC_deepholm()
  170.     new npc_red_mist();
  171.     new npc_terrath_the_steady();
  172.     new npc_opalescent_guardian();
  173. +   new npc_war_guardian();
  174. +   new npc_war_guardian_follower();
  175. +   new npc_giant_mushroom();
  176.  }
  177. --
  178. 1.7.10.msysgit.1
Advertisement
Add Comment
Please, Sign In to add comment