Ejemplo n.º 1
0
 // Wrapper to start phase 3
 void DoHandleRomuloResurrect()
 {
     m_creature->CastSpell(nullptr, SPELL_FULL_HEALTH, TRIGGERED_NONE);
     DoRemoveFakeDeath();
     DoCastSpellIfCan(m_creature, SPELL_UNDYING_LOVE);
     DoScriptText(SAY_JULIANNE_RESURRECT, m_creature);
 }
Ejemplo n.º 2
0
 // Wrapper to start phase 3
 void DoHandleRomuloResurrect()
 {
     if (DoCastSpellIfCan(m_creature, SPELL_UNDYING_LOVE) == CAST_OK)
     {
         DoCastSpellIfCan(m_creature, SPELL_FULL_HEALTH, CAST_TRIGGERED);
         DoScriptText(SAY_JULIANNE_RESURRECT, m_creature);
         DoRemoveFakeDeath();
     }
 }
Ejemplo n.º 3
0
    void UpdateAI(const uint32 uiDiff) override
    {
        // spawn Romulo on timer after fake death
        if (m_uiSummonRomuloTimer)
        {
            if (m_uiSummonRomuloTimer <= uiDiff)
            {
                m_creature->SummonCreature(NPC_ROMULO, afRomuloSpawnLoc[0], afRomuloSpawnLoc[1], afRomuloSpawnLoc[2], afRomuloSpawnLoc[3], TEMPSUMMON_DEAD_DESPAWN, 0);
                m_uiSummonRomuloTimer = 0;
            }
            else
                m_uiSummonRomuloTimer -= uiDiff;
        }

        if (m_uiResurrectSelfTimer)
        {
            if (m_uiResurrectSelfTimer <= uiDiff)
            {
                if (m_pInstance)
                {
                    if (Creature* pRomulo = m_pInstance->GetSingleCreatureFromStorage(NPC_ROMULO))
                    {
                        // if Romulos is dead, then self kill
                        if (pRomulo->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE))
                        {
                            m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false);
                            pRomulo->DealDamage(pRomulo, pRomulo->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false);
                        }
                        else
                        {
                            DoRemoveFakeDeath();
                            DoCastSpellIfCan(m_creature, SPELL_FULL_HEALTH, CAST_TRIGGERED);
                        }
                    }
                }
                m_uiResurrectSelfTimer = 0;
            }
            else
                m_uiResurrectSelfTimer -= uiDiff;
        }

        if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
            return;

        // don't use spells during transition
        if (m_bIsFakingDeath)
            return;

        if (m_uiBlindingPassionTimer < uiDiff)
        {
            if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0))
            {
                if (DoCastSpellIfCan(pTarget, SPELL_BLINDING_PASSION) == CAST_OK)
                    m_uiBlindingPassionTimer = urand(30000, 45000);
            }
        }
        else
            m_uiBlindingPassionTimer -= uiDiff;

        if (m_uiDevotionTimer < uiDiff)
        {
            if (DoCastSpellIfCan(m_creature, SPELL_DEVOTION) == CAST_OK)
                m_uiDevotionTimer = urand(15000, 45000);
        }
        else
            m_uiDevotionTimer -= uiDiff;

        if (m_uiPowerfulAttractionTimer < uiDiff)
        {
            if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0))
            {
                if (DoCastSpellIfCan(pTarget, SPELL_POWERFUL_ATTRACTION) == CAST_OK)
                    m_uiPowerfulAttractionTimer = urand(5000, 30000);
            }
        }
        else
            m_uiPowerfulAttractionTimer -= uiDiff;

        if (m_uiEternalAffectionTimer < uiDiff)
        {
            if (Unit* pTarget = DoSelectLowestHpFriendly(30.0f))
            {
                if (DoCastSpellIfCan(pTarget, SPELL_ETERNAL_AFFECTION) == CAST_OK)
                    m_uiEternalAffectionTimer = urand(45000, 60000);
            }
        }
        else
            m_uiEternalAffectionTimer -= uiDiff;

        DoMeleeAttackIfReady();
    }
Ejemplo n.º 4
0
    void UpdateAI(const uint32 uiDiff) override
    {
        // Resurrect both of them at the beginning of phase 3
        if (m_uiResurrectTimer)
        {
            if (m_uiResurrectTimer <= uiDiff)
            {
                if (m_pInstance)
                {
                    if (Creature* pJulianne = m_pInstance->GetSingleCreatureFromStorage(NPC_JULIANNE))
                    {
                        if (boss_julianneAI* pJulianneAI = dynamic_cast<boss_julianneAI*>(pJulianne->AI()))
                            pJulianneAI->DoHandleRomuloResurrect();
                    }
                }
                m_uiResurrectTimer = 0;
            }
            else
                m_uiResurrectTimer -= uiDiff;
        }

        if (m_uiResurrectSelfTimer)
        {
            if (m_uiResurrectSelfTimer <= uiDiff)
            {
                if (m_pInstance)
                {
                    if (Creature* pJulianne = m_pInstance->GetSingleCreatureFromStorage(NPC_JULIANNE))
                    {
                        // if Julianne is dead, then self kill
                        if (pJulianne->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE))
                        {
                            m_creature->DealDamage(m_creature, m_creature->GetHealth(), nullptr, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, nullptr, false);
                            pJulianne->DealDamage(pJulianne, pJulianne->GetHealth(), nullptr, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, nullptr, false);
                        }
                        else
                        {
                            DoRemoveFakeDeath();
                            DoScriptText(SAY_ROMULO_RESURRECT, m_creature);
                            DoCastSpellIfCan(m_creature, SPELL_FULL_HEALTH, CAST_TRIGGERED);
                        }
                    }
                }
                m_uiResurrectSelfTimer = 0;
            }
            else
                m_uiResurrectSelfTimer -= uiDiff;
        }

        if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
            return;

        // don't use spells on fake death
        if (m_bIsFakingDeath)
            return;

        if (m_uiBackwardLungeTimer < uiDiff)
        {
            if (DoCastSpellIfCan(m_creature, SPELL_BACKWARD_LUNGE) == CAST_OK)
                m_uiBackwardLungeTimer = urand(15000, 30000);
        }
        else
            m_uiBackwardLungeTimer -= uiDiff;

        if (m_uiDaringTimer < uiDiff)
        {
            if (DoCastSpellIfCan(m_creature, SPELL_DARING) == CAST_OK)
                m_uiDaringTimer = urand(20000, 40000);
        }
        else
            m_uiDaringTimer -= uiDiff;

        if (m_uiDeadlySwatheTimer < uiDiff)
        {
            if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_DEADLY_SWATHE) == CAST_OK)
                m_uiDeadlySwatheTimer = urand(15000, 25000);
        }
        else
            m_uiDeadlySwatheTimer -= uiDiff;

        if (m_uiPoisonThrustTimer < uiDiff)
        {
            if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_POISON_THRUST) == CAST_OK)
                m_uiPoisonThrustTimer = urand(10000, 20000);
        }
        else
            m_uiPoisonThrustTimer -= uiDiff;

        DoMeleeAttackIfReady();
    }
Ejemplo n.º 5
0
 void SpellHit(Unit* pCaster, const SpellEntry* pSpell) override
 {
     // remove fake death on res
     if (pSpell->Id == SPELL_UNDYING_LOVE && pCaster->GetEntry() == NPC_JULIANNE)
         DoRemoveFakeDeath();
 }