void Aggro(Unit* pWho) { if (!m_pInstance) return; m_pInstance->SetData(TYPE_THADDIUS, IN_PROGRESS); if (Creature* pOtherAdd = GetOtherAdd()) { if (!pOtherAdd->isInCombat()) pOtherAdd->AI()->AttackStart(pWho); } }
void JustReachedHome() override { if (!m_pInstance) return; if (Creature* pOther = GetOtherAdd()) { if (boss_thaddiusAddsAI* pOtherAI = dynamic_cast<boss_thaddiusAddsAI*>(pOther->AI())) { if (pOtherAI->IsCountingDead()) { pOther->ForcedDespawn(); pOther->Respawn(); } } } // Reapply Chains if needed if (!m_creature->HasAura(SPELL_FEUGEN_CHAIN) && !m_creature->HasAura(SPELL_STALAGG_CHAIN)) JustRespawned(); m_pInstance->SetData(TYPE_THADDIUS, FAIL); }
void UpdateAI(const uint32 uiDiff) override { if (m_bBothDead) // This is the case while fighting Thaddius return; if (m_bFakeDeath) { if (m_uiReviveTimer < uiDiff) { if (Creature* pOther = GetOtherAdd()) { if (boss_thaddiusAddsAI* pOtherAI = dynamic_cast<boss_thaddiusAddsAI*>(pOther->AI())) { if (!pOtherAI->IsCountingDead()) // Raid was to slow to kill the second add Revive(); else { m_bBothDead = true; // Now both adds are counting dead pOtherAI->m_bBothDead = true; // Set both Teslas to overload GuidList lTeslaGUIDList; m_pInstance->GetThadTeslaCreatures(lTeslaGUIDList); for (GuidList::const_iterator itr = lTeslaGUIDList.begin(); itr != lTeslaGUIDList.end(); ++itr) { if (Creature* pTesla = m_pInstance->instance->GetCreature(*itr)) { if (npc_tesla_coilAI* pTeslaAI = dynamic_cast<npc_tesla_coilAI*>(pTesla->AI())) pTeslaAI->SetOverloading(); } } } } } } else m_uiReviveTimer -= uiDiff; return; } if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) return; if (m_uiHoldTimer) // A short timer preventing combat movement after revive { if (m_uiHoldTimer <= uiDiff) { SetCombatMovement(true); m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); m_uiHoldTimer = 0; } else m_uiHoldTimer -= uiDiff; } if (m_uiWarStompTimer < uiDiff) { if (DoCastSpellIfCan(m_creature, SPELL_WARSTOMP) == CAST_OK) m_uiWarStompTimer = urand(8 * IN_MILLISECONDS, 10 * IN_MILLISECONDS); } else m_uiWarStompTimer -= uiDiff; UpdateAddAI(uiDiff); // For Add Specific Abilities DoMeleeAttackIfReady(); }