Advertisement
Rochet2

Yeti boss Runemaster

May 28th, 2012
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. };
  11.  
  12.  
  13. class Yeti_Boss : public CreatureScript
  14. {
  15. public:
  16.     Yeti_Boss()
  17.         : CreatureScript("Yeti_Boss") {}
  18.  
  19.     struct example_creatureAI : public ScriptedAI
  20.     {
  21.         example_creatureAI(Creature* creature) : ScriptedAI(creature) {}
  22.  
  23.         uint32 m_uiPhase;                                
  24.         uint32 m_uiFrostPunchTimer;                                        
  25.         uint32 m_uiRoarTimer;
  26.         uint32 m_uiEnrageTimer;
  27.  
  28.         void Reset()
  29.         {
  30.             m_uiPhase = 0;  
  31.             m_uiFrostPunchTimer = 12000;  
  32.             m_uiRoarTimer = 20000;  
  33.             m_uiEnrageTimer = 180000;
  34.             me->RestoreFaction();
  35.         }
  36.  
  37.         void EnterCombat(Unit* unit, Player* player)
  38.         {
  39.             if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
  40.             {
  41.                 DoCast(target, SPELL_ROAR);
  42.                 DoCast(target, SHAKE_CAMERA);
  43.                 // DoCast(target, SPELL_PUNCH); // NOT DEFINED SPELL_PUNCH
  44.                 DoCast(target, SPELL_FREEZE);
  45.                 /*
  46.                 // Not needed if $N works
  47.                 char message[250];
  48.                 snprintf(message, 250, "Yetiname glares at %s, roars, and casts Frost Punch!", player->GetName());
  49.                 */
  50.                 me->MonsterTextEmote("Yetiname glares at $N, roars, and casts Frost Punch!", player->GetGUID());
  51.             }
  52.         }
  53.  
  54.         void EnterEvadeMode()
  55.         {
  56.         }
  57.  
  58.         void UpdateAI(const uint32 uiDiff)
  59.         {
  60.             if (!UpdateVictim())
  61.                 return;
  62.  
  63.             if (m_uiFrostPunchTimer <= uiDiff)
  64.             {
  65.                 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0))
  66.                 {
  67.                     /*
  68.                     // Not needed if $N works
  69.                     char message[250];
  70.                     snprintf(message, 250, "Yetiname casts Frost Punch on %s!", target->GetName());
  71.                     */
  72.                     me->MonsterTextEmote("Yetiname casts Frost Punch on $N!", target->GetGUID());
  73.                     // DoCast(target, SPELL_PUNCH); // SPELL_PUNCH undefined
  74.                     DoCast(target, SPELL_FREEZE);
  75.                 }
  76.                 // m_uiSpell3Timer = 12000; // undefined m_uiSpell3Timer
  77.                 m_uiFrostPunchTimer = 12000; // meant this?
  78.             }
  79.             else
  80.                 m_uiFrostPunchTimer -= uiDiff;
  81.  
  82.             if (m_uiRoarTimer <= uiDiff)
  83.             {
  84.                 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0))
  85.                 {
  86.                     /*
  87.                     // Not needed if $N works
  88.                     char message[250];
  89.                     snprintf(message, 250, "Yetiname roars at %s!", target->GetName());
  90.                     */
  91.                     me->MonsterTextEmote("Yetiname roars at $N!", target->GetGUID());
  92.                     DoCast(target, SPELL_ROAR);
  93.                     DoCast(target, SHAKE_CAMERA);
  94.                 }
  95.                 m_uiRoarTimer = 20000;
  96.             }
  97.             else
  98.                 m_uiRoarTimer -= uiDiff;                       
  99.  
  100.             /*
  101.             // Undefined m_uiBeserkTimer
  102.             if (m_uiBeserkTimer <= uiDiff)
  103.             {
  104.             DoCast(me, SPELL_ENRAGE);
  105.             }
  106.             else
  107.             m_uiBeserkTimer -= uiDiff;
  108.             */
  109.  
  110.             DoMeleeAttackIfReady();
  111.         }
  112.     };
  113.  
  114.     CreatureAI* GetAI(Creature* creature) const
  115.     {
  116.         return new example_creatureAI(creature);
  117.     }
  118. };
  119.  
  120. void AddSC_Yeti_Boss()
  121. {
  122.     new Yeti_Boss();
  123. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement