void BossBloodPrinceValanarAI::InitializeAI()
{
    if (CreatureData const* data = sObjectMgr->GetCreatureData(me->GetDBTableGUIDLow()))
        if (data->curhealth)
            _spawnHealth = data->curhealth;

    if (!me->isDead())
        JustRespawned();

    me->SetReactState(REACT_DEFENSIVE);
}
Пример #2
0
 void ReceiveAIEvent(AIEventType eventType, Creature* /*pSender*/, Unit* pInvoker, uint32 /*uiMiscValue*/) override
 {
     // start following
     if (eventType == AI_EVENT_START_EVENT && pInvoker->GetTypeId() == TYPEID_PLAYER)
     {
         StartFollow((Player*)pInvoker);
         m_uiSubduedTimer = 3 * MINUTE * IN_MILLISECONDS;
     }
     // timeout; quest failed
     else if (eventType == AI_EVENT_CUSTOM_A)
     {
         // check if the quest isn't already completed
         if (!HasFollowState(STATE_FOLLOW_COMPLETE))
         {
             // force reset
             JustRespawned();
             ScriptedAI::EnterEvadeMode();
         }
     }
 }
Пример #3
0
    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);
    }
Пример #4
0
 npc_rabid_bearAI(Creature* pCreature) : ScriptedAI(pCreature)
 {
     Reset();
     JustRespawned();
 }