Exemple #1
0
    void DamageTaken(Unit* pDoneBy, uint32& uiDamage)
    {
        if (uiDamage < me->GetHealth())
            return;

        if (pInstance && (pInstance->GetData(TYPE_EMALON) != DONE))
        {
            uiDamage = 0;
            FakeDeath();
        }
    }
    void DamageTaken(Unit* /*pDoneBy*/, uint32 &uiDamage)
    {
        if (uiDamage < me->GetHealth() || ZathDead)
            return;

        if (!instance)
            return;

        ZathDead = true;

        FakeDeath(me);

        if (!LorkhanDead && !ThekalDead)
            CheckDeath_Timer = 10000;

        uiDamage = 0;
    }
Exemple #3
0
    void UpdateAI(const uint32 diff)
    {
		if (!CanDoSomething())
            return;

        if (m_uiEvadeCheckCooldown < diff)
        {
            Creature* pEmalon = (Creature*)Unit::GetUnit((*me), pInstance->GetData64(DATA_EMALON));
            if ((pEmalon && pEmalon->IsInEvadeMode()) || (me->GetDistance2d(-219.119f, -289.037f) > 80.0f))
            {
                EnterEvadeMode();
                return;
            }
            m_uiEvadeCheckCooldown = 2000;
        }
        else
            m_uiEvadeCheckCooldown -= diff;

        if (m_bTimeToDie)
        {
            FakeDeath();
            return;
        }

        if (m_bDead)
        {
            if (m_uiRespawnTimer < diff)
            {
                me->SetHealth(me->GetMaxHealth());
                me->SetVisibility(VISIBILITY_OFF);
                Init();
				Speak(CHAT_TYPE_BOSS_EMOTE,0,"Un seide de la tempete vient defendre Emalon !");
                me->SetInCombatWithZone();
                DoResetThreat();
                if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
                    me->GetMotionMaster()->MoveChase(pTarget);

            }
            else
                m_uiRespawnTimer -= diff;

            return;
        }

        if (m_uiOverchargedStacksCheckTimer < diff)
        {
            m_uiOverchargedStacksCheckTimer = 2000;
            Aura* pAuraOvercharged = me->GetAura(SPELL_OVERCHARGED, 0);
            if(pAuraOvercharged && pAuraOvercharged->GetStackAmount() >= 10)
            {
                DoCast(me, SPELL_OVERCHARGED_BLAST);
                m_bTimeToDie = true;
                return;
            }
        }
        else
            m_uiOverchargedStacksCheckTimer -= diff;

		Tasks.UpdateEvent(diff);

        DoMeleeAttackIfReady();
    }
    void UpdateAI(const uint32 uiDiff)
    {
        if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
            return;

        if (m_uiEvadeCheckCooldown < uiDiff)
        {
            Creature* pEmalon = m_pInstance->GetSingleCreatureFromStorage(NPC_EMALON);
            if ((pEmalon && pEmalon->IsInEvadeMode()) || (m_creature->GetDistance2d(-219.119f, -289.037f) > 80.0f))
            {
                EnterEvadeMode();
                return;
            }
            m_uiEvadeCheckCooldown = 2000;
        }
        else
            m_uiEvadeCheckCooldown -= uiDiff;

        if (m_bTimeToDie)
        {
            FakeDeath();
            return;
        }

        if (m_bDead)
        {
            if (m_uiRespawnTimer < uiDiff)
            {
                m_creature->SetHealth(m_creature->GetMaxHealth());
                m_creature->SetVisibility(VISIBILITY_OFF);
                Init();
                m_creature->MonsterTextEmote("%s appears to defend Emalon!", NULL, true);
                m_creature->SetInCombatWithZone();
                DoResetThreat();
                if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0))
                    m_creature->GetMotionMaster()->MoveChase(pTarget);
            }
            else
                m_uiRespawnTimer -= uiDiff;

            return;
        }

        if (m_uiOverchargedStacksCheckTimer < uiDiff)
        {
            m_uiOverchargedStacksCheckTimer = 2000;
            Aura* pAuraOvercharged = m_creature->GetAura(SPELL_OVERCHARGED, EFFECT_INDEX_0);
            if(pAuraOvercharged && pAuraOvercharged->GetStackAmount() >= 10)
            {
                DoCastSpellIfCan(m_creature, SPELL_OVERCHARGED_BLAST);
                m_bTimeToDie = true;
                return;
            }
        }
        else
            m_uiOverchargedStacksCheckTimer -= uiDiff;

        if (m_uiShockTimer < uiDiff)
        {
            DoCastSpellIfCan(m_creature->getVictim(), SPELL_SHOCK);
            m_uiShockTimer = 8000+rand()%4000;
        }
        else
            m_uiShockTimer -= uiDiff;

        DoMeleeAttackIfReady();
    }
Exemple #5
0
    void UpdateAI(const uint32 uiDiff)
    {  
        if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
            return;

        if (m_bTimeToDie)
        {
            FakeDeath();
            return;
        }
        
        if (m_bDead)
        {
            if (m_uiRespawnTimer < uiDiff)
            {
                m_creature->SetHealth(m_creature->GetMaxHealth());
                m_creature->SetVisibility(VISIBILITY_OFF);
                Init();
                m_creature->MonsterTextEmote("%s appears to defend Emalon!", 0, true);
                if (m_pInstance)
                {
                    Creature* pEmalon = (Creature*)Unit::GetUnit((*m_creature), m_pInstance->GetData64(DATA_EMALON));
                    if (pEmalon)
                    {
                        Unit* pTarget = pEmalon->getVictim();
                        if (pTarget)
                            m_creature->GetMotionMaster()->MoveChase(pTarget);
                    }
                }
                return;
            }
            else
            {
                m_uiRespawnTimer -= uiDiff;
                return;
            }
        }

        Aura* pAuraOvercharged = m_creature->GetAura(SPELL_OVERCHARGED, 0);
        if(pAuraOvercharged && pAuraOvercharged->GetStackAmount() >= 10)
        {
            DoCast(m_creature, SPELL_OVERCHARGED_BLAST);
            m_bTimeToDie = true;
            return;
        }

        if(m_uiShockTimer < uiDiff)
        {
            DoCast(m_creature->getVictim(), SPELL_SHOCK);
            m_uiShockTimer = 8000+rand()%4000;
        }
        else
            m_uiShockTimer -= uiDiff;

	if(m_uiEvadeCheckTimer < uiDiff)
	  {
	    if(m_creature->GetDistance2d(-229.11f, -289.03f) > 70.0f)
	      EnterEvadeMode();

	    m_uiEvadeCheckTimer = 2000;
	  }
	else
	  m_uiEvadeCheckTimer -= uiDiff;

        DoMeleeAttackIfReady();
    }