casucristy

ss

Jul 20th, 2012
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 5.16 KB | None | 0 0
  1. From 9a5996b38a6b233b02b5001878f940dda489de48 Mon Sep 17 00:00:00 2001
  2. From: unknown <cristi@cristis-PC.(none)>
  3. Date: Fri, 20 Jul 2012 20:13:54 +0300
  4. Subject: [PATCH] Fix quests: Fungal Monstrosities and Sprout No More
  5.  
  6. ---
  7.  src/server/scripts/Maelstrom/deepholm.cpp |  159 +++++++++++++++++++++++++++++
  8.  1 file changed, 159 insertions(+)
  9.  
  10. diff --git a/src/server/scripts/Maelstrom/deepholm.cpp b/src/server/scripts/Maelstrom/deepholm.cpp
  11. index a4dbbac..5c0391e 100644
  12. --- a/src/server/scripts/Maelstrom/deepholm.cpp
  13. +++ b/src/server/scripts/Maelstrom/deepholm.cpp
  14. @@ -620,6 +620,162 @@ 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               =   8079,
  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. +               sLog->outError("1");
  81. +               //choking wound
  82. +               if(uiChokingWoundTimer <= diff)
  83. +               {   sLog->outError("2");
  84. +                   //if(Unit* victim = me->getVictim())
  85. +                       //me->CastSpell(victim,SPELL_CHOCKING_WOUND);
  86. +                   DoCastVictim(SPELL_CHOCKING_WOUND);
  87. +                   uiChokingWoundTimer = urand(20000,25000);
  88. +               }
  89. +               else    uiChokingWoundTimer -= diff;
  90. +
  91. +               //earth shok
  92. +               if(uiEarthShockTimer <= diff)
  93. +               {
  94. +                   DoCastVictim(SPELL_EARTH_SHOCK);
  95. +                   //if(Unit* victim = me->getVictim())
  96. +                       //me->CastSpell(victim,SPELL_EARTH_SHOCK);
  97. +                   uiEarthShockTimer = urand(5000,7000);
  98. +               }
  99. +               else    uiEarthShockTimer -= diff;
  100. +
  101. +               //ground smash
  102. +               if(uiGroundSmashTimer <= diff)
  103. +               {
  104. +                   //if(Unit* victim = me->getVictim())
  105. +                       //me->CastSpell(victim,SPELL_GROUND_SMASH);
  106. +                   DoCastVictim(SPELL_GROUND_SMASH);
  107. +                   uiGroundSmashTimer = urand(3000,5000);
  108. +               }
  109. +               else    uiGroundSmashTimer -= diff;
  110. +
  111. +               //thunderclap
  112. +               if(uiThunderClapTimer <= diff)
  113. +               {
  114. +                   DoCastVictim(SPELL_THUNDERCLAP);
  115. +                   //if(Unit* victim = me->getVictim())
  116. +                       //me->CastSpell(victim,SPELL_THUNDERCLAP);
  117. +                   uiThunderClapTimer = urand(12000,15000);
  118. +               }
  119. +               else    uiThunderClapTimer -= diff;
  120. +
  121. +               DoMeleeAttackIfReady();
  122. +           }
  123. +
  124. +       };
  125. +
  126. +       CreatureAI* GetAI(Creature *creature) const
  127. +       {
  128. +           return new npc_war_guardian_followerAI(creature);
  129. +       }
  130. +};
  131. +
  132. +
  133. +class npc_giant_mushroom : public CreatureScript
  134. +{
  135. +    public:
  136. +        npc_giant_mushroom() : CreatureScript("npc_giant_mushroom") { }
  137. +
  138. +       struct npc_giant_mushroomAI : public ScriptedAI
  139. +       {
  140. +           npc_giant_mushroomAI(Creature* creature) : ScriptedAI(creature) { }
  141. +
  142. +           void Reset()
  143. +           {
  144. +           }
  145. +
  146. +           void MoveInLineOfSight(Unit* who)
  147. +           {
  148. +               Player* player = who->ToPlayer();
  149. +
  150. +               if(player && (me->GetDistance(player) < 10.0f) &&
  151. +                   (player->GetQuestStatus(QUEST_FUNGAL_MONSTROSITIES)==QUEST_STATUS_INCOMPLETE))
  152. +               {
  153. +                   Unit* unit = player->GetSelectedUnit();
  154. +                   if(unit && unit->GetGUID() == me->GetGUID())
  155. +                   {
  156. +                       me->CastSpell(me,SPELL_EXPLODE);
  157. +                       player->KilledMonsterCredit(NPC_GIANT_MUSHROOM,0);
  158. +                       Unit* unit = me->SummonCreature(NPC_STONE_TROGG_EARTHRAGER,me->GetPositionX(),me->GetPositionY(),me->GetPositionZ(),0.0f);
  159. +                       me->DespawnOrUnsummon();
  160. +
  161. +                       if(unit)
  162. +                           unit->Attack(player,true);
  163. +                   }
  164. +               }
  165. +           }
  166. +       };
  167. +
  168. +       CreatureAI* GetAI(Creature *creature) const
  169. +       {
  170. +           return new npc_giant_mushroomAI(creature);
  171. +       }
  172. +};
  173. +
  174.  void AddSC_deepholm()
  175.  {
  176.      new npc_lodestone();
  177. @@ -633,4 +789,7 @@ void AddSC_deepholm()
  178.     new npc_red_mist();
  179.     new npc_terrath_the_steady();
  180.     new npc_opalescent_guardian();
  181. +   new npc_war_guardian();
  182. +   new npc_war_guardian_follower();
  183. +   new npc_giant_mushroom();
  184.  }
  185. --
  186. 1.7.10.msysgit.1
Advertisement
Add Comment
Please, Sign In to add comment