Advertisement
MichaelCrow

[trinity] Yeti Boss

May 28th, 2012
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.13 KB | None | 0 0
  1. #include "ScriptPCH.h"
  2.  
  3. enum Spells
  4. {
  5. SPELL_ROAR = 42398,
  6. SHAKE_CAMERA = 46853,
  7. SPELL_FREEZE = 58534,
  8. SPELL_ENRAGE = 23537,
  9. SPELL_KNOCKBACK = 46360,
  10. SPELL_KNOCKUP = 29190,
  11. };
  12.  
  13.  
  14. class Yeti_Boss : public CreatureScript
  15. {
  16. public:
  17. Yeti_Boss()
  18. : CreatureScript("Yeti_Boss") {}
  19.  
  20. struct example_creatureAI : public ScriptedAI
  21. {
  22. example_creatureAI(Creature* creature) : ScriptedAI(creature) {}
  23.  
  24. uint32 m_uiPhase;
  25. uint32 m_uiFrostPunchTimer;
  26. uint32 m_uiRoarTimer;
  27. uint32 m_uiIceQuakeTimer;
  28. uint32 m_uiEnrageTimer;
  29.  
  30. void Reset()
  31. {
  32. m_uiPhase = 0;
  33. m_uiFrostPunchTimer = 13000;
  34. m_uiRoarTimer = 18000;
  35. m_uiIceQuakeTimer = 25000;
  36. m_uiEnrageTimer = 180000;
  37. me->RestoreFaction();
  38. }
  39.  
  40. void EnterCombat(Unit* unit)
  41. {
  42. {
  43. DoCast(me->getVictim(), SPELL_ROAR);
  44. DoCast(me->getVictim(), SHAKE_CAMERA);
  45. DoCast(me->getVictim(), SPELL_KNOCKBACK);
  46. DoCast(me->getVictim(), SPELL_FREEZE);
  47. me->MonsterTextEmote("The Yeti Matriarch glares at $N, roars, and casts Frost Punch!", me->getVictim());
  48.  
  49. }
  50. }
  51.  
  52. void EnterEvadeMode()
  53. {
  54. }
  55.  
  56. void UpdateAI(const uint32 uiDiff)
  57. {
  58. if (!UpdateVictim())
  59. return;
  60.  
  61. if (m_uiFrostPunchTimer <= uiDiff)
  62. {
  63. std::list<Unit*> targets;
  64. SelectTargetList(targets, 1, SELECT_TARGET_RANDOM, me->GetMeleeReach()*1, true);
  65. for (std::list<Unit*>::const_iterator i = targets.begin(); i != targets.end(); ++i)
  66. if (!me->IsWithinMeleeRange(*i))
  67. {
  68. DoCast(*i, SPELL_KNOCKBACK);
  69. DoCast(*i, SPELL_FREEZE);
  70. me->MonsterTextEmote("The Yeti Matriarch casts Frost Punch on $N!", *i);
  71. break;
  72. }
  73.  
  74. m_uiFrostPunchTimer = 12000;
  75. }
  76. else
  77. m_uiFrostPunchTimer -= uiDiff;
  78.  
  79. if (m_uiRoarTimer <= uiDiff)
  80. {
  81. DoCast(me->getVictim(), SPELL_ROAR);
  82. DoCast(me->getVictim(), SHAKE_CAMERA);
  83. me->MonsterTextEmote("The Yeti Matriarch angrily roars!", NULL);
  84. break;
  85. }
  86. m_uiRoarTimer = 20000;
  87. }
  88. else
  89. m_uiRoarTimer -= uiDiff;
  90.  
  91. if (m_uiIceQuakeTimer <= uiDiff)
  92. {
  93. std::list<Unit*> targets;
  94. SelectTargetList(targets, 5, SELECT_TARGET_RANDOM, me->GetMeleeReach()*5, true);
  95. for (std::list<Unit*>::const_iterator i = targets.begin(); i != targets.end(); ++i)
  96. if (!me->IsWithinMeleeRange(*i))
  97. {
  98. DoCast(me->getVictim(), SPELL_KNOCKUP);
  99. DoCast(me->getVictim(), CAMERA_SHAKE);
  100. DoCast(*i, SPELL_FREEZE);
  101. me->MonsterTextEmote("The Yeti Matriarch stomps angrily, causing an Ice Quake!", NULL);
  102. break;
  103. }
  104.  
  105. m_uiIceQuakeTimer = 15000;
  106. }
  107. else
  108. m_uiIceQuakeTimer -= uiDiff;
  109.  
  110. if (m_uiEnrageTimer <= uiDiff)
  111. {
  112. DoCast(me, SPELL_ENRAGE);
  113. }
  114. else
  115. m_uiEnrageTimer -= uiDiff;
  116.  
  117.  
  118. DoMeleeAttackIfReady();
  119. }
  120. };
  121.  
  122. CreatureAI* GetAI(Creature* creature) const
  123. {
  124. return new Yeti_BossAI(creature);
  125. }
  126. };
  127.  
  128. void AddSC_Yeti_Boss()
  129. {
  130. new Yeti_Boss();
  131. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement