Guest User

rochiiie

a guest
Apr 25th, 2012
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.23 KB | None | 0 0
  1. #include "ScriptPCH.h"
  2.  
  3. enum eNums
  4. {
  5.     SPELL_ICEARMOR = 36881,
  6.     SPELL_FROSTBOLT = 59251,
  7.     SPELL_PESTILENCE = 50842,
  8.     SPELL_ENRAGE = 54287
  9.  
  10. };
  11.  
  12. class example : public CreatureScript
  13. {
  14.     public:
  15.         example() : CreatureScript("example"){}
  16.        
  17.         CreatureAI* GetAI_example(Creature* pCreature) const
  18.         {
  19.             return new exampleAI(pCreature);
  20.         }
  21.  
  22.         struct exampleAI : public ScriptedAI
  23.         {
  24.         exampleAI(Craeture *c) : ScriptedAI(c) {}
  25.  
  26.     uint32 Icearmor_Timer;
  27.     uint32 Frostbolt_Timer;
  28.     uint32 Pestilence_Timer;
  29.     uint32 Enrage_Timer;
  30.  
  31.    
  32.    
  33.             void Reset()
  34.             {
  35.                 Icearmor_Timer = 0;
  36.                 Frostbolt_Timer = 0;
  37.                 Pestilence_Timer = 5000;
  38.                 Enrage_Timer = 1500;
  39.                
  40.                 Phase = 1;
  41.             }
  42.  
  43.             void KilledUnit(Unit * /*victim*/)
  44.             {
  45.             }
  46.            
  47.             void JustDied(Unit * /*victim*/)
  48.             {
  49.             }
  50.  
  51.             void EnterCombat(Unit * /*who*/)
  52.             {
  53.             me->Monsteryell(Test,"if you see this then it works good job!", LANG_UNIVERSAL, NULL);
  54.             }
  55.  
  56.             void UpdateAI(const uint32 uiDiff)
  57.             {
  58.                 if (!me->getVictim())
  59.             {
  60.                     if (Icearmor_Timer <= uiDiff)
  61.             {
  62.                     DoCast(me, SPELL_ICEARMOR);
  63.                     Icearmor_Timer = 18000000;
  64.             }
  65.             else
  66.                     Icearmor_Timer -= uiDiff;
  67.             }
  68.                
  69.                 if (!UpdateVictim())
  70.                     return;
  71.                    
  72.                     if (Enrage_Timer <=uiDIff)
  73.                     {
  74.                         DoCast(me, SPELL_ENRAGE);
  75.                     }
  76.                    
  77.                         if (((me->GetHealth()*100 / me->GetMaxHealth())) <55) && (Phase == 1))
  78.                         {
  79.                             Phase = 2;
  80.                         }
  81.                        
  82.                         if (Phasae == 1)
  83.                         {
  84.                        
  85.                     if (Frostbolt_Timer <= uiDiff)
  86.                     {
  87.                             Docast(me->getVictim(), SPELL_FROSTBOLT);
  88.                             Frostbolt_Timer = 3000;
  89.                     }
  90.                     else
  91.                             Frostbolt_Timer -= uiDiff;
  92.                     if (Pestilence_Timer <= uiDiff;)
  93.                     {
  94.                             if (Unit *ptarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
  95.                                                 DoCast(pTarget, SPELL_PESTILENCE);
  96.                                                
  97.                                         Pestilence_Timer = 10000;
  98.                             }
  99.                             else
  100.                                         Pestilence_Timer -= uiDiff;
  101.                             }
  102.                            
  103.                             if (Phase == 2)
  104.                             {
  105.                                     DoCast(me->getVictim(), SPELL_FROSTBOLT);
  106.                                     Frostbolt_Timer = 3000
  107.                             }
  108.                             else
  109.                                     Frostbolt_Timer -= uiDIff;
  110.                             }
  111.                                    
  112.             DoMeleeAttackIfReady();
  113.             }
  114.         };
  115. };
  116.  
  117. void AddSC_example()
  118. {
  119.     new example();
  120. }
Advertisement
Add Comment
Please, Sign In to add comment