Example #1
0
 void JustDied(Unit* killer)
 {
     if (pInstance)
         pInstance->SetData(DATA_EREGOS_EVENT, DONE);
 }
Example #2
0
    void JustDied(Unit* Killer)
    {
        pInstance->SetData(TYPE_MEDIVH, FAIL);

        DoScriptText(SAY_DEATH, m_creature);
    }
Example #3
0
 void JustReachedHome() override
 {
     if (m_pInstance)
         m_pInstance->SetData(TYPE_AKILZON, FAIL);
 }
Example #4
0
 void JustDied(Unit* /*killer*/)
 {
     if (pInstance)
         pInstance->SetData(DATA_WAVE_COUNT,pInstance->GetData(DATA_WAVE_COUNT)+1);
 }
Example #5
0
 void JustDied(Unit* pKiller)
 {
     DoScriptText(SAY_DEATH, me);
 if (pInstance)
         pInstance->SetData(DATA_BOSS_ICEHOWL, DONE);
 }
Example #6
0
 void EnterCombat(Unit* /*who*/)
 {
     if (pInstance)
         pInstance->SetData(DATA_HADRONOX_EVENT, IN_PROGRESS);
     me->SetInCombatWithZone();
 }
Example #7
0
 void EnterCombat(Unit* /*who*/)
 {
     DoScriptText(SAY_AGGRO, me);
     if (pInstance)
         pInstance->SetData(TYPE_KELRIS, IN_PROGRESS);
 }
 void JustDied(Unit* /*killer*/)
 {
     if (instance)
         instance->SetData(DATA_RELIQUARYOFSOULSEVENT, DONE);
 }
Example #9
0
 void DamageTaken(Unit *done_by, uint32 &damage)
 {
     if (me->GetHealth() <= damage)
         if (instance)
             instance->SetData(TYPE_DISTILLER, DONE);
 }
 void JustDied(Unit* /*pKiller*/) override
 {
     if (m_pInstance)
         m_pInstance->SetData(TYPE_VAELASTRASZ, DONE);
 }
 void JustReachedHome() override
 {
     if (m_pInstance)
         m_pInstance->SetData(TYPE_VAELASTRASZ, FAIL);
 }
 void JustReachedHome()
 {
     if(m_pInstance)
         m_pInstance->SetData(DATA_DEATHWHISPER_EVENT, FAIL);
 }
Example #13
0
 void JustReachedHome()
 {
     if (m_pInstance)
         m_pInstance->SetData(TYPE_SARTHARION_EVENT, NOT_STARTED);
 }
Example #14
0
 void EnterCombat(Unit* who)
 {
     if (pInstance)
         pInstance->SetData(DATA_EREGOS_EVENT, IN_PROGRESS);
 }
 void JustDied(Unit * killer)
 {
     if (pInstance)
         pInstance->SetData(DATA_BROODLORD_LASHLAYER_EVENT, DONE);
 }
 void JustReachedHome()
 {
     if (pInstance)
         pInstance->SetData(TYPE_THEKAL, NOT_STARTED);
 }
Example #17
0
 void JustDied(Unit* /*Killer*/)
 {
     if (pInstance)
         pInstance->SetData(DATA_HADRONOX_EVENT, DONE);
 }
Example #18
0
 void JustReachedHome() override
 {
     if (m_pInstance)
         m_pInstance->SetData(TYPE_JEDOGA, FAIL);
 }
 void JustReachedHome() override
 {
     if (m_pInstance)
         m_pInstance->SetData(TYPE_HYDROMANCER_THESPIA, FAIL);
 }
Example #20
0
        void UpdateAI(const uint32 uiDiff) override
        {
            if (m_uiVisualTimer)
            {
                if (m_uiVisualTimer <= uiDiff)
                {
                    if (m_pInstance)
                        m_pInstance->SetData(TYPE_DO_JEDOGA, 2);

                    if (DoCastSpellIfCan(m_creature, SPELL_LIGHTNING_VISUAL) == CAST_OK)
                        m_uiVisualTimer = 0;
                }
                else
                    m_uiVisualTimer -= uiDiff;
            }

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

            // Don't use abilities while sacrificing
            if (m_bIsSacrificing)
                return;

            // Note: this was changed in 3.3.2 and now it does this only once
            if (m_creature->GetHealthPercent() < 50.0f && !m_bSacrifice)
            {
                SetCombatMovement(false);
                m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
                m_creature->GetMotionMaster()->MovePoint(POINT_ID_SACRIFICE, aJedogaLandingLoc[0], aJedogaLandingLoc[1], aJedogaLandingLoc[2]);
                m_bSacrifice = true;
                m_bIsSacrificing = true;
            }

            if (m_uiThundershockTimer < uiDiff)
            {
                if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0))
                    DoCastSpellIfCan(pTarget, m_bIsRegularMode ? SPELL_THUNDERSHOCK : SPELL_THUNDERSHOCK_H);

                m_uiThundershockTimer = 40000;
            }
            else
                m_uiThundershockTimer -= uiDiff;

            if (m_uiLightningBoltTimer < uiDiff)
            {
                if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0))
                    DoCastSpellIfCan(pTarget, m_bIsRegularMode ? SPELL_LIGHTNING_BOLT : SPELL_LIGHTNING_BOLT_H);

                m_uiLightningBoltTimer = 7000;
            }
            else
                m_uiLightningBoltTimer -= uiDiff;

            if (m_uiCycloneStrikeTimer < uiDiff)
            {
                DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_CYCLONE_STRIKE : SPELL_CYCLONE_STRIKE_H);
                m_uiCycloneStrikeTimer = 15000;
            }
            else
                m_uiCycloneStrikeTimer -= uiDiff;

            DoMeleeAttackIfReady();
        }
Example #21
0
 void JustDied(Unit* /*killer*/)
 {
     DoScriptText(SAY_DEATH, me);
     if (pInstance)
         pInstance->SetData(TYPE_KELRIS, DONE);
 }
Example #22
0
 void JustDied(Unit* /*victim*/)
 {
     if (pInstance)
         pInstance->SetData(DATA_VEXALLUS_EVENT, DONE);
 }
Example #23
0
 void Aggro(Unit* pWho)
 {
     DoScriptText(SAY_AGGRO,me);
     if(pInstance)
         pInstance->SetData(DATA_BOSS_ICEHOWL, IN_PROGRESS);
 }
Example #24
0
 void JustReachedHome() override
 {
     if (m_pInstance)
         m_pInstance->SetData(TYPE_NEFARIAN, FAIL);
 }
Example #25
0
 void JustDied(Unit* /*pKiller*/) override
 {
     if (m_pInstance)
         m_pInstance->SetData(TYPE_JARAXXUS, DONE);
 }
Example #26
0
 void Reset()
 {
     if (pInstance)
         pInstance->SetData(DATA_VAROS_EVENT, NOT_STARTED);
 }
Example #27
0
    void UpdateAI(const uint32 diff)
    {
        if (Delay_Timer)
        {
            if (Delay_Timer <= diff)
            {
                if (Delay)
                    DoScriptText(SAY_INTRO, m_creature);
                Delay_Timer = 0;
            }
            else
                Delay_Timer -= diff;
        }

        if (SpellCorrupt_Timer)
        {
            if (SpellCorrupt_Timer <= diff)
            {
                pInstance->SetData(TYPE_MEDIVH,SPECIAL);

                if (m_creature->HasAura(SPELL_CORRUPT_AEONUS,0))
                    SpellCorrupt_Timer = 1000;
                else if (m_creature->HasAura(SPELL_CORRUPT,0))
                    SpellCorrupt_Timer = 3000;
                else
                    SpellCorrupt_Timer = 0;
            }
            else
                SpellCorrupt_Timer -= diff;
        }

        if (DamageMelee_Timer)
        {
            if (DamageMelee_Timer <= diff)
            {
                pInstance->SetData(TYPE_MEDIVH,SPECIAL);
                DamageMelee_Timer = 0;
            }
            else
                DamageMelee_Timer -= diff;
        }

        if (Check_Timer)
        {
            if (Check_Timer <= diff)
            {
                uint32 pct = pInstance->GetData(DATA_SHIELD);

                Check_Timer = 5000;

                if (Life25 && pct <= 25)
                {
                    DoScriptText(SAY_WEAK25, m_creature);
                    Life25 = false;
                    Check_Timer = 0;
                }
                else if (Life50 && pct <= 50)
                {
                    DoScriptText(SAY_WEAK50, m_creature);
                    Life50 = false;
                }
                else if (Life75 && pct <= 75)
                {
                    DoScriptText(SAY_WEAK75, m_creature);
                    Life75 = false;
                }

                //if we reach this it means event was running but at some point reset.
                if (pInstance->GetData(TYPE_MEDIVH) == NOT_STARTED)
                {
                    m_creature->DealDamage(m_creature, m_creature->GetHealth(), DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
                    m_creature->RemoveCorpse();
                    m_creature->Respawn();
                    return;
                }

                if (pInstance->GetData(TYPE_MEDIVH) == DONE)
                {
                    DoScriptText(SAY_WIN, m_creature);
                    Check_Timer = 0;
                    //TODO: start the post-event here
                }
            }
            else
                Check_Timer -= diff;
        }
    }
Example #28
0
 void Aggro(Unit* /*pWho*/) override
 {
     if (m_pInstance)
         m_pInstance->SetData(TYPE_OURO, IN_PROGRESS);
 }
Example #29
0
 void JustReachedHome() override
 {
     if (m_pInstance)
         m_pInstance->SetData(TYPE_MALACRASS, FAIL);
 }
Example #30
0
    void UpdateAI(const uint32 diff)
    {
        if (!Intro)
        {
            if (!pInstance)
                return;

            if (Intro_Timer <= diff)
            {
                switch(Intro_Phase)
                {
                    case 1:
                        DoScriptText(SAY_INTRO, m_creature);
                        pInstance->HandleGameObject(pInstance->GetData64(DATA_SPHERE_SHIELD), true);
                        ++Intro_Phase;
                        Intro_Timer = 25000;
                        break;
                    case 2:
                        DoScriptText(SAY_AGGRO, m_creature);
                        if (Unit *mellic = Unit::GetUnit(*m_creature,pInstance->GetData64(DATA_MELLICHAR)))
                        {
                            //should have a better way to do this. possibly spell exist.
                            mellic->setDeathState(JUST_DIED);
                            mellic->SetHealth(0);
                            pInstance->SetData(TYPE_SHIELD_OPEN,IN_PROGRESS);
                        }
                        ++Intro_Phase;
                        Intro_Timer = 3000;
                        break;
                    case 3:
                        m_creature->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_OOC_NOT_ATTACKABLE);
                        Intro = true;
                        break;
                }
            } else Intro_Timer -=diff;
        }

        if (!UpdateVictim())
            return;

        if (!IsImage66 && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 66))
        {
            DoSplit(66);
            IsImage66 = true;
        }
        if (!IsImage33 && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 33))
        {
            DoSplit(33);
            IsImage33 = true;
        }

        if (MindRend_Timer <= diff)
        {
            if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1))
                DoCast(pTarget, DUNGEON_MODE(SPELL_MIND_REND, H_SPELL_MIND_REND));
            else
                DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_MIND_REND, H_SPELL_MIND_REND));

            MindRend_Timer = 8000;
        } else MindRend_Timer -=diff;

        if (Fear_Timer <= diff)
        {
            if (m_creature->IsNonMeleeSpellCasted(false))
                return;

            DoScriptText(RAND(SAY_FEAR_1,SAY_FEAR_2), m_creature);

            if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1))
                DoCast(pTarget, SPELL_FEAR);
            else
                DoCast(m_creature->getVictim(), SPELL_FEAR);

            Fear_Timer = 25000;
        } else Fear_Timer -=diff;

        if (Domination_Timer <= diff)
        {
            if (m_creature->IsNonMeleeSpellCasted(false))
                return;

            DoScriptText(RAND(SAY_MIND_1,SAY_MIND_2), m_creature);

            if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1))
                DoCast(pTarget, DUNGEON_MODE(SPELL_DOMINATION, H_SPELL_DOMINATION));
            else
                DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_DOMINATION, H_SPELL_DOMINATION));

            Domination_Timer = 16000+rand()%16000;
        } else Domination_Timer -=diff;

        if (IsHeroic())
        {
            if (ManaBurn_Timer <= diff)
            {
                if (m_creature->IsNonMeleeSpellCasted(false))
                    return;

                if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1))
                    DoCast(pTarget, H_SPELL_MANA_BURN);

                ManaBurn_Timer = 16000+rand()%16000;
            } else ManaBurn_Timer -=diff;
        }

        DoMeleeAttackIfReady();
    }