Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.22 KB | None | 0 0
  1. #include "precompiled.h"
  2.  
  3.  
  4. enum
  5. {
  6.    
  7.  
  8.     SPELL_SOULFLAY              = 45442,
  9.     SPELL_LEGION_LIGHTNING      = 45664,
  10.     SPELL_FIRE_BLOOM            = 45641,
  11.     SPELL_SINISTER_REFLECTION   = 45892,
  12.     SPELL_SHADOW_SPIKE          = 46680,
  13.     SPELL_FLAME_DART            = 45737,
  14.     SPELL_DARNKESS              = 46605,
  15.     SPELL_ARMAGEDDON            = 45909,
  16.  
  17.  
  18.     SAY_AGGRO                   = -1999950,
  19.     SAY_SLAIN                   = -9233,
  20.     SAY_REACTS_PHASE4           = -9240,
  21.     SAY_FIRE_BLOOM              = -1999951,
  22.     SAY_LEGION                  = -1999953,
  23.     SAY_KILJAEDEN_REACTS        = -9243,
  24.     SAY_KILJAEDEN_PHASE4        = -9242,
  25.     SAY_KILJAEDEN_PHASE3        = -9241,
  26.     SAY_SPELL_SHADOWSPIKE       = -1999952,
  27.     SAY_SPELL_DARKNESS1         = -9228,
  28.     SAY_SPELL_DARNKESS2         = -9229,
  29.     SAY_SPELL_DARNKESS3         = -9230,
  30.     SAY_DEATH                   = -9245
  31.  
  32. };
  33.  
  34. struct MANGOS_DLL_DECL boss_kiljaedenAI : public ScriptedAI
  35. {
  36.     boss_kiljaedenAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();}
  37.  
  38.     uint32 soulflay_timer;
  39.     uint32 armageddon_timer;
  40.     uint32 legionlightning_timer;
  41.     uint32 firebloom_timer;
  42.     uint32 sinisterreflection_timer;
  43.     uint32 shadowspike_timer;
  44.     uint32 flamedart_timer;
  45.     uint32 darkness_timer;
  46.     uint32 phase;
  47.  
  48.     void Reset ()
  49.     {
  50.         DespawnAll();
  51.         armageddon_timer            = 5000;
  52.         soulflay_timer              = 2000;
  53.         legionlightning_timer       = 10000;
  54.         firebloom_timer             = 43000;
  55.         sinisterreflection_timer    = 30000;
  56.         shadowspike_timer           = 30000;
  57.         flamedart_timer             = 8000;
  58.         darkness_timer              = 50000;
  59.         phase                       = 1;
  60.     }
  61.  
  62.          void DespawnAll()
  63.     {
  64.         std::list<Creature*> m_pCursed;
  65.         GetCreatureListWithEntryInGrid(m_pCursed, m_creature, mob_shield_orb, DEFAULT_VISIBILITY_INSTANCE);
  66.  
  67.         if (!m_pCursed.empty())
  68.             for(std::list<Creature*>::iterator itr = m_pCursed.begin(); itr != m_pCursed.end(); ++itr)
  69.             {
  70.                 (*itr)->ForcedDespawn();
  71.             }
  72.          }
  73.  
  74.     void Aggro(Unit *Who)
  75.     {
  76.      m_creature->SetInCombatWithZone();
  77.      DoScriptText(SAY_AGGRO, m_creature);
  78.      SetCombatMovement(false);
  79.  
  80.    
  81.     }  
  82.         void JustSummoned(Creature* pSummon)
  83.     {
  84.         pSummon->AI()->AttackStart(m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)
  85.     }
  86.  
  87.  
  88.     void UpdateAI(const uint32 diff)
  89.     {
  90.         if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
  91.                 return;
  92.        
  93.                        
  94.         if (phase == 1)
  95.         {
  96.  
  97.  
  98.  
  99.         if (soulflay_timer < diff)
  100.         {
  101.            
  102.             DoCastSpellIfCan(m_creature->getVictim(),SPELL_SOULFLAY);
  103.             soulflay_timer = 2000;
  104.         } else soulflay_timer -=diff;
  105.        
  106.  
  107.         if (legionlightning_timer < diff)
  108.         {
  109.            
  110.             DoCastSpellIfCan(m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0),SPELL_LEGION_LIGHTNING);
  111.             legionlightning_timer = 10000;
  112.         } else legionlightning_timer -=diff;
  113.        
  114.         if (firebloom_timer < diff)
  115.         {
  116.             DoScriptText(SAY_FIRE_BLOOM, m_creature);
  117.             DoCast(m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0), SPELL_FIRE_BLOOM);
  118.             firebloom_timer = 25000;
  119.         } else firebloom_timer -=diff;
  120.        
  121.        
  122.  
  123.  
  124.        
  125.        
  126.    
  127.  
  128.    
  129.     }
  130. };
  131.  
  132. CreatureAI* GetAI_boss_kiljaeden(Creature* pCreature)
  133. {
  134.     return new boss_kiljaedenAI(pCreature);
  135. }
  136.  
  137. void AddSC_boss_kiljaeden()
  138. {
  139.     Script* NewScript;
  140.  
  141.     NewScript = new Script;
  142.     NewScript->Name = "boss_kiljaeden";
  143.     NewScript->GetAI = GetAI_boss_kiljaeden;
  144.     NewScript->RegisterSelf();
  145. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement