Guest User

Untitled

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