Advertisement
cyphric

yup

Dec 28th, 2012
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.05 KB | None | 0 0
  1. /* ScriptData
  2. SDName: Erados
  3. SD%Complete: 100 hopefully
  4. SDComment: Multi-phase boss
  5. SDCategory: Learning
  6. EndScriptData */
  7.  
  8. #include "ScriptMgr.h"
  9. #include "ScriptedCreature.h"
  10. #include "ScriptedGossip.h"
  11. #include "Player.h"
  12.  
  13. enum Yells //Defining yells
  14. {
  15. SAY_AGGRO = 0;
  16. SAY_EVADE = 6;
  17. SAY_RANDOM = 1;
  18. SAY_PHASE = 3;
  19.  
  20. };
  21.  
  22.  
  23. enum Spells
  24. {
  25.  
  26. SPELL_ONE = 72906, // frostbolt volley
  27. SPELL_ONE_ALT = 24099, // poison volley
  28. SPELL_TWO = 65791, // Arcane blast
  29. SPELL_THREE = 70464, // ice lance volley
  30. SPELL_BERSERK = 32965, // berserk
  31. SPELL_FULLHEAL = 9257, //lay on hands
  32. };
  33.  
  34. class erados_creature : public CreatureScript
  35. {
  36. public:
  37.  
  38. erados_creature()
  39. : CreatureScript("erados_creature")
  40. {
  41. }
  42.  
  43. struct erados_creatureAI : public ScriptedAI
  44. {
  45. erados_creatureAI(Creature* creature) : ScriptedAI(creature) {}
  46.  
  47. uint32 m_uISayTimer;
  48. uint32 m_uiRebuffTimer;
  49. uint32 m_uiSpell1Timer;
  50. uint32 m_uiSpell2Timer;
  51. uint32 m_uiSpell3Timer;
  52. uint32 m_uiBerserkTimer;
  53. uint32 m_uiPhase;
  54. uint32 m_uiPhaseTimer;
  55.  
  56. void Reset()
  57. {
  58. m_uiPhase = 1;
  59. m_uiPhaseTimer = 60000;
  60. m_uiSpell1Timer = 9000;
  61. m_uiSpell2Timer = 25000;
  62. m_uiSpell3Timer = 15000;
  63. m_uiBerserkTimer = 250000;
  64. }
  65.  
  66. void EnterCombat(Unit* who)
  67. {
  68. Talk(SAY_AGGRO, who->GetGUID());
  69. }
  70.  
  71. void AttackStart(Unit* who)
  72. {
  73. ScriptedAI::AttackStart(who);
  74. }
  75.  
  76. void EnterEvadeMode()
  77. {
  78. Talk(SAY_EVADE);
  79. }
  80.  
  81.  
  82. void updateAI(const uint32 uiDiff)
  83. {
  84.  
  85. if(!me->getVictim())
  86. {
  87. if(m_uiSayTimer <= uiDiff)
  88. {
  89. Talk(SAY_RANDOM);
  90.  
  91. m_uiSayTimer = 45000;
  92. }
  93. else
  94. m_uiSayTimer -= uiDiff;
  95. }
  96.  
  97. if(!UpdateVictim())
  98. return;
  99. //spell 1
  100. if(m_uiSpellTimer <= uiDiff)
  101. {
  102. if(rand()%50 > 10)
  103. DoCast(me->getVictim(), SPELL_ONE_ALT);
  104. else if(me->IsWithinDist(me->getVictim(), 25.0f))
  105. DoCast(me->getVictim(), SPELL_ONE);
  106.  
  107. m_uiSpell1Timer = 10000;
  108. }
  109. else
  110. m_uiSpell1Timer -= uiDiff;
  111.  
  112. //spell 2
  113. if (m_uiSpellTimer <= uiDiff)
  114. {
  115. DoCast(me->getVictim(), SPELL_TWO);
  116. m_uiSpell2Timer = 12000;
  117. }
  118. else
  119. m_uiSpell2Timer -= uiDiff;
  120.  
  121. //berserk timer
  122. if (m_uiPhase > 1)
  123. {
  124. if(m_uiSpell3Timer <= uiDiff)
  125. {
  126. DoCast(me->getVictim(), SPELL_THREE);
  127.  
  128. m_uiSpell3Timer = 19000;
  129. }
  130. else
  131. m_uiSpell3Timer -= uiDiff;
  132.  
  133. if (m_uiBerserkTimer <= uiDiff)
  134. {
  135. Talk(SAY_BERSERK, me->getVictim() ? me->getVictim()->GetGUID() : 0);
  136. DoCast(me->getVictim(), SPELL_BERSERK);
  137.  
  138. m_uiBerserkTimer = 12000;
  139. }
  140. else
  141. m_uiBerserkTimer -= uiDiff;
  142. }
  143.  
  144. else if(m_uiPhase == 1)
  145. {
  146. if(m_uiPhaseTimer <= uiDiff)
  147. {
  148. ++m_uiPhase;
  149. Talk(SAY_PHASE);
  150. DoCast(me, SPELL_FULLHEAL)
  151. }
  152. else
  153. m_uiPhaseTimer -= uiDiff;
  154.  
  155. }
  156.  
  157. DoMeleeAttackIfReady();
  158.  
  159. }
  160.  
  161. };
  162.  
  163. CreatureAI* GetAI(Creature* creature) const
  164. {
  165. return new erados_creatureAI(creature);
  166. }
  167.  
  168. void AddSC_erados_creature()
  169. {
  170. new erados_creature();
  171. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement