void UpdateAI(const uint32 diff) { if (!UpdateVictim()) return; _DoAggroPulse(diff); if (enterHardMode) { SetPhaseOne(); enterHardMode = false; } // Handles spell casting. These spells only occur during phase 1 or hard mode if (phase == 1 || hardMode) { if (uiSearingLightTimer <= diff) { if (!me->HasAura(SPELL_TYMPANIC_TANTRUM)) DoCast(me, RAID_MODE<uint32>(SPELL_SEARING_LIGHT_10, SPELL_SEARING_LIGHT_25), true); uiSearingLightTimer = TIMER_SEARING_LIGHT; } else uiSearingLightTimer -= diff; if (uiGravityBombTimer <= diff) { if (!me->HasAura(SPELL_TYMPANIC_TANTRUM)) DoCast(me, RAID_MODE<uint32>(SPELL_GRAVITY_BOMB_10, SPELL_GRAVITY_BOMB_25), true); uiGravityBombTimer = TIMER_GRAVITY_BOMB; } else uiGravityBombTimer -= diff; if (uiTympanicTantrumTimer <= diff) { DoScriptText(SAY_TYMPANIC_TANTRUM, me); me->MonsterTextEmote(EMOTE_TYMPANIC, 0, true); DoCast(SPELL_TYMPANIC_TANTRUM); uiTympanicTantrumTimer = TIMER_TYMPANIC_TANTRUM; } else uiTympanicTantrumTimer -= diff; } if (!hardMode) { if (phase == 1) { if (HealthBelowPct(100 - (heart_exposed + 1) * 25)) exposeHeart(); DoMeleeAttackIfReady(); } else { // Start summoning adds if (uiSpawnAddTimer <= diff) { DoScriptText(SAY_SUMMON, me); // Spawn Pummeller switch (rand() % 4) { case 0: me->SummonCreature(NPC_XM024_PUMMELLER, LR_X, LR_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break; case 1: me->SummonCreature(NPC_XM024_PUMMELLER, LL_X, LL_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break; case 2: me->SummonCreature(NPC_XM024_PUMMELLER, UR_X, UR_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break; case 3: me->SummonCreature(NPC_XM024_PUMMELLER, UL_X, UL_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break; } // Spawn 5 Scrapbots for (int8 n = 0; n < 5; n++) { // Some randomes are added so they wont spawn in a pile switch(rand() % 4) { case 0: me->SummonCreature(NPC_XS013_SCRAPBOT, float(irand(LR_X - 3, LR_X + 3)), float(irand(LR_Y - 3, LR_Y + 3)), SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break; case 1: me->SummonCreature(NPC_XS013_SCRAPBOT, float(irand(LL_X - 3, LL_X + 3)), float(irand(LL_Y - 3, LL_Y + 3)), SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break; case 2: me->SummonCreature(NPC_XS013_SCRAPBOT, float(irand(UR_X - 3, UR_X + 3)), float(irand(UR_Y - 3, UR_Y + 3)), SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break; case 3: me->SummonCreature(NPC_XS013_SCRAPBOT, float(irand(UL_X - 3, UL_X + 3)), float(irand(UL_Y - 3, UL_Y + 3)), SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break; } } // Spawn 3 Bombs for (int8 n = 0; n < 3; n++) { switch (rand() % 4) { case 0: me->SummonCreature(NPC_XE321_BOOMBOT, LR_X, LR_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break; case 1: me->SummonCreature(NPC_XE321_BOOMBOT, LL_X, LL_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break; case 2: me->SummonCreature(NPC_XE321_BOOMBOT, UR_X, UR_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break; case 3: me->SummonCreature(NPC_XE321_BOOMBOT, UL_X, UL_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break; } } uiSpawnAddTimer = TIMER_SPAWN_ADD; } else uiSpawnAddTimer -= diff; // Is the phase over? if (uiHeartPhaseTimer <= diff) { DoScriptText(SAY_HEART_CLOSED, me); SetPhaseOne(); } else uiHeartPhaseTimer -= diff; } } else { // Adding life sparks when searing light debuff runs out if hard mode if (searing_light_active) { if (uiSpawnLifeSparkTimer <= diff) { Unit* searingLightTarget = me->GetUnit(*me, uiSearingLightTarget); if (searingLightTarget && searingLightTarget->isAlive()) me->SummonCreature(NPC_LIFE_SPARK, *searingLightTarget); uiSpawnLifeSparkTimer = TIMER_SPAWN_LIFE_SPARK; searing_light_active = false; } else uiSpawnLifeSparkTimer -= diff; } if (gravity_bomb_active) { if (uiGravityBombAuraTimer <= diff) { Unit* gravityBombTarget = me->GetUnit(*me, uiGravityBombTarget); if (gravityBombTarget && gravityBombTarget->isAlive()) me->SummonCreature(NPC_VOID_ZONE, *gravityBombTarget, TEMPSUMMON_TIMED_DESPAWN, 180000); uiGravityBombAuraTimer = TIMER_GRAVITY_BOMB_AURA; gravity_bomb_active = false; } else uiGravityBombAuraTimer -= diff; } DoMeleeAttackIfReady(); } //Enrage stuff if (!enraged) { if (uiEnrageTimer <= diff) { DoScriptText(SAY_BERSERK, me); DoCast(me, SPELL_ENRAGE); enraged = true; } else uiEnrageTimer -= diff; }else { if (!me->HasAura(SPELL_ENRAGE)) DoCast(me, SPELL_ENRAGE); } }
void UpdateAI(const uint32 diff) { if (!UpdateVictim()) return; if (enterHardMode) { SetPhaseOne(); enterHardMode = false; } EncounterTime += diff; // Handles spell casting. These spells only occur during phase 1 and hard mode if (phase == 1 || hardMode) { if (uiSearingLightTimer <= diff) { if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) { me->AddAura(RAID_MODE(SPELL_SEARING_LIGHT_10, SPELL_SEARING_LIGHT_25), pTarget); uiSearingLightTarget = pTarget->GetGUID(); } uiSpawnLifeSparkTimer = TIMER_SPAWN_LIFE_SPARK; if (hardMode) searing_light_active = true; uiSearingLightTimer = TIMER_SEARING_LIGHT; } else uiSearingLightTimer -= diff; // Gravity Bomb if (uiGravityBombTimer <= diff) { if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) { me->AddAura(RAID_MODE(SPELL_GRAVITY_BOMB_10,SPELL_GRAVITY_BOMB_25), pTarget); uiGravityBombTarget = pTarget->GetGUID(); } uiGravityBombTimer = TIMER_GRAVITY_BOMB; if (hardMode) gravity_bomb_active = true; } else uiGravityBombTimer -= diff; // Tympanic Tantrum if (uiTympanicTantrumTimer <= diff) { DoScriptText(SAY_TYMPANIC_TANTRUM, me); me->MonsterTextEmote(EMOTE_TYMPANIC, 0, true); DoCast(SPELL_TYMPANIC_TANTRUM); uiTympanicTantrumTimer = TIMER_TYMPANIC_TANTRUM; } else uiTympanicTantrumTimer -= diff; } if (!hardMode) { if (phase == 1) { if (HealthBelowPct(75) && heart_exposed == 0) exposeHeart(); else if (HealthBelowPct(50) && heart_exposed == 1) exposeHeart(); else if (HealthBelowPct(25) && heart_exposed == 2) exposeHeart(); DoMeleeAttackIfReady(); } else { //Start summoning adds if (uiSpawnAddTimer <= diff) { //DoScriptText(SAY_SUMMON, me); // Spawn Pummeller switch (rand() % 4) { case 0: me->SummonCreature(NPC_XM024_PUMMELLER, LR_X, LR_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break; case 1: me->SummonCreature(NPC_XM024_PUMMELLER, LL_X, LL_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break; case 2: me->SummonCreature(NPC_XM024_PUMMELLER, UR_X, UR_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break; case 3: me->SummonCreature(NPC_XM024_PUMMELLER, UL_X, UL_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break; } //Spawn 5 Scrapbots for (int8 n = 0; n < 5; n++) { //Some randomes are added so they wont spawn in a pile switch (rand() % 4) { case 0: me->SummonCreature(NPC_XS013_SCRAPBOT, irand(LR_X - 3, LR_X + 3), irand(LR_Y - 3, LR_Y + 3), SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break; case 1: me->SummonCreature(NPC_XS013_SCRAPBOT, irand(LL_X - 3, LL_X + 3), irand(LL_Y - 3, LL_Y + 3), SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break; case 2: me->SummonCreature(NPC_XS013_SCRAPBOT, irand(UR_X - 3, UR_X + 3), irand(UR_Y - 3, UR_Y + 3), SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break; case 3: me->SummonCreature(NPC_XS013_SCRAPBOT, irand(UL_X - 3, UL_X + 3), irand(UL_Y - 3, UL_Y + 3), SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break; } } //Spawn 5 Bombs switch (rand() % 4) { case 0: me->SummonCreature(NPC_XE321_BOOMBOT, LR_X, LR_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break; case 1: me->SummonCreature(NPC_XE321_BOOMBOT, LL_X, LL_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break; case 2: me->SummonCreature(NPC_XE321_BOOMBOT, UR_X, UR_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break; case 3: me->SummonCreature(NPC_XE321_BOOMBOT, UL_X, UL_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break; } uiSpawnAddTimer = TIMER_SPAWN_ADD; } else uiSpawnAddTimer -= diff; // Is the phase over? if (uiHeartPhaseTimer <= diff) { DoScriptText(SAY_HEART_CLOSED, me); SetPhaseOne(); } else uiHeartPhaseTimer -= diff; } } else { // Adding life sparks when searing light debuff runs out if hard mode if (searing_light_active) { if (uiSpawnLifeSparkTimer <= diff) { if (Unit *pSearingLightTarget = me->GetUnit(*me, uiSearingLightTarget)) pSearingLightTarget->SummonCreature(NPC_LIFE_SPARK, pSearingLightTarget->GetPositionX(), pSearingLightTarget->GetPositionY(), pSearingLightTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); uiSpawnLifeSparkTimer = TIMER_SPAWN_LIFE_SPARK; searing_light_active = false; } else uiSpawnLifeSparkTimer -= diff; } // Adding void zones when gravity bomb debuff runs out if hard mode if (gravity_bomb_active) { if (uiSpawnGravityBombTimer <= diff) { if (Unit *pGravityBombTarget = me->GetUnit(*me, uiGravityBombTarget)) DoCast(pGravityBombTarget, RAID_MODE(SPELL_VOID_ZONE_10, SPELL_VOID_ZONE_25)); uiSpawnGravityBombTimer = TIMER_SPAWN_GRAVITY_BOMB; gravity_bomb_active = false; } else uiSpawnGravityBombTimer -= diff; } DoMeleeAttackIfReady(); } //Enrage stuff if (!enraged) if (uiEnrageTimer <= diff) { DoScriptText(SAY_BERSERK, me); DoCast(me, SPELL_ENRAGE); enraged = true; } else uiEnrageTimer -= diff; }
void UpdateAI(uint32 const diff) { if (!UpdateVictim()) return; _DoAggroPulse(diff); if (_enterHardMode) { SetPhaseOne(); _enterHardMode = false; } // Handles spell casting. These spells only occur during phase 1 or hard mode if (_phase == 1 || _hardMode) { if (_searingLightTimer <= diff) { if (!me->HasAura(SPELL_TYMPANIC_TANTRUM)) DoCast(me, RAID_MODE<uint32>(SPELL_SEARING_LIGHT_10, SPELL_SEARING_LIGHT_25), true); _searingLightTimer = 20*IN_MILLISECONDS; } else _searingLightTimer -= diff; if (_gravityBombTimer <= diff) { if (!me->HasAura(SPELL_TYMPANIC_TANTRUM)) DoCast(me, RAID_MODE<uint32>(SPELL_GRAVITY_BOMB_10, SPELL_GRAVITY_BOMB_25), true); _gravityBombTimer = 20*IN_MILLISECONDS; } else _gravityBombTimer -= diff; if (_tympanicTantrumTimer <= diff) { DoScriptText(SAY_TYMPANIC_TANTRUM, me); me->MonsterTextEmote(EMOTE_TYMPANIC, 0, true); DoCast(SPELL_TYMPANIC_TANTRUM); _tympanicTantrumTimer = 1*MINUTE*IN_MILLISECONDS; } else _tympanicTantrumTimer -= diff; } if (!_hardMode) { if (_phase == 1) { if (HealthBelowPct(100 - (_heartExposed + 1) * 25)) exposeHeart(); DoMeleeAttackIfReady(); } else { // Start summoning adds if (_spawnAddTimer <= diff) { DoScriptText(SAY_SUMMON, me); // Spawn Pummeller switch (rand() % 4) { case 0: me->SummonCreature(NPC_XM024_PUMMELLER, LR_X, LR_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break; case 1: me->SummonCreature(NPC_XM024_PUMMELLER, LL_X, LL_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break; case 2: me->SummonCreature(NPC_XM024_PUMMELLER, UR_X, UR_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break; case 3: me->SummonCreature(NPC_XM024_PUMMELLER, UL_X, UL_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break; } // Spawn 5 Scrapbots for (int8 n = 0; n < 5; ++n) { // Some randomes are added so they wont spawn in a pile switch (rand() % 4) { case 0: me->SummonCreature(NPC_XS013_SCRAPBOT, float(irand(LR_X - 3, LR_X + 3)), float(irand(LR_Y - 3, LR_Y + 3)), SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break; case 1: me->SummonCreature(NPC_XS013_SCRAPBOT, float(irand(LL_X - 3, LL_X + 3)), float(irand(LL_Y - 3, LL_Y + 3)), SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break; case 2: me->SummonCreature(NPC_XS013_SCRAPBOT, float(irand(UR_X - 3, UR_X + 3)), float(irand(UR_Y - 3, UR_Y + 3)), SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break; case 3: me->SummonCreature(NPC_XS013_SCRAPBOT, float(irand(UL_X - 3, UL_X + 3)), float(irand(UL_Y - 3, UL_Y + 3)), SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break; } } // Spawn 3 Bombs for (int8 n = 0; n < 3; ++n) { switch (rand() % 4) { case 0: me->SummonCreature(NPC_XE321_BOOMBOT, LR_X, LR_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break; case 1: me->SummonCreature(NPC_XE321_BOOMBOT, LL_X, LL_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break; case 2: me->SummonCreature(NPC_XE321_BOOMBOT, UR_X, UR_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break; case 3: me->SummonCreature(NPC_XE321_BOOMBOT, UL_X, UL_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break; } } _spawnAddTimer = 12*IN_MILLISECONDS; } else _spawnAddTimer -= diff; // Is the phase over? if (_heartPhaseTimer <= diff) { DoScriptText(SAY_HEART_CLOSED, me); SetPhaseOne(); } else _heartPhaseTimer -= diff; } } else DoMeleeAttackIfReady(); if (!_enraged) { if (_enrageTimer <= diff) { DoScriptText(SAY_BERSERK, me); DoCast(me, SPELL_ENRAGE, true); _enraged = true; } else _enrageTimer -= diff; } }