Example #1
0
    void StartEvent(Unit *pTarget)
    {
        if (pTarget->isAlive())
        {
            m_council[0] = pInstance->GetData64(DATA_GATHIOSTHESHATTERER);
            m_council[1] = pInstance->GetData64(DATA_HIGHNETHERMANCERZEREVOR);
            m_council[2] = pInstance->GetData64(DATA_LADYMALANDE);
            m_council[3] = pInstance->GetData64(DATA_VERASDARKSHADOW);

            // Start the event for the Voice Trigger
            if (Creature *pTrigger = pInstance->GetCreature(pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE)))
                ((mob_blood_elf_council_voice_triggerAI*)pTrigger->AI())->AssignGUIDs();

            for (uint8 i = 0; i < 4; ++i)
            {
                if (m_council[i])
                {
                    if (Unit *pMember = pInstance->GetCreature(m_council[i]))
                    {
                        if (pMember->isAlive())
                            ((Creature*)pMember)->AI()->AttackStart(pTarget);
                    }
                }
            }
            pInstance->SetData(EVENT_ILLIDARICOUNCIL, IN_PROGRESS);
        }
    }
Example #2
0
    void UpdateAI(const uint32 diff)
    {
        if(DelayTimer > diff)
        {
            DelayTimer -= diff;
            return;
        }
        else if(DelayTimer)
        {
            DelayTimer = 0;
        }

        UpdateTarget(diff);

        if(CheckTeronTimer < diff)
        {
            Creature *pTeron = pInstance->GetCreature(pInstance->GetData64(DATA_TERONGOREFIEND));
            if(!pTeron || !pTeron->isInCombat())
                 m_creature->Kill(m_creature, false);

            CheckTeronTimer = 2000;
        }
        else
            CheckTeronTimer -= diff;

        DoMeleeAttackIfReady();
    }
Example #3
0
    void UpdateAI(const uint32 diff)
    {
        if(CheckTimer < diff)
        {
            if(pInstance)
            {
                Creature *pAnetheron = pInstance->GetCreature(pInstance->GetData64(DATA_ANETHERON));
                if(!pAnetheron || !pAnetheron->isAlive())
                {
                    m_creature->setDeathState(JUST_DIED);
                    m_creature->RemoveCorpse();
                    return;
                }
            }
            CheckTimer = 2000;
        }
        else
            CheckTimer -= diff;

        //Return since we have no target
        if (!UpdateVictim())
            return;

        if(WaitTimer > diff)
        {
            WaitTimer -= diff;
            return;
        }

        DoMeleeAttackIfReady();
    }
Example #4
0
    void EnterEvadeMode()
    {
        if (!pInstance)
            return;
        pInstance->SetData(EVENT_ILLIDARICOUNCIL, NOT_STARTED);

        if (Creature *pTrigger = pInstance->GetCreature(pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE)))
            pTrigger->AI()->EnterEvadeMode();
        ScriptedAI::EnterEvadeMode();
    }
Example #5
0
    void JustDied(Unit *pVictim)
    {
        if (Creature *pTrigger = pInstance->GetCreature(pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE)))
            pTrigger->Kill(pTrigger, false);

        pInstance->SetData(EVENT_ILLIDARICOUNCIL, DONE);

        if (Creature *pAkama = me->SummonCreature(23089, 671.309f, 305.427f, 271.689f, 6.068f, TEMPSUMMON_DEAD_DESPAWN, 0))
            pAkama->AI()->DoAction(6);
    }
Example #6
0
    void Reset()
    {
        pInstance->SetData(EVENT_ILLIDARICOUNCIL, NOT_STARTED);

        if (Creature *pTrigger = pInstance->GetCreature(pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE)))
            pTrigger->AI()->EnterEvadeMode();

        me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
        me->SetDisplayId(11686);
    }
Example #7
0
 void SharedRule(uint32 &damage)
 {
     uint32 HP = 0;
     bool canKill = false;
     // get shared HP
     for (uint8 i = 0; i < 4; ++i)
     {
         if (Creature *pUnit = pInstance->GetCreature(m_council[i]))
         {
             if (pUnit->GetHealth() == 0)
                 canKill = true;
             HP += pUnit->GetHealth();
             pUnit->LowerPlayerDamageReq(damage);
         }
     }
     // set shared HP
     for (uint8 i = 0; i < 4; ++i)
     {
         if (Creature *pUnit = pInstance->GetCreature(m_council[i]))
         {
             if (pUnit->isAlive())
             {
                 if (HP)
                     pUnit->SetHealth(HP/4);
             }
         }
     }
     // if one dies, they die all
     if (!canKill)
         return;
     for (uint8 i = 0; i < 4; ++i)
     {
         if (Creature *pUnit = pInstance->GetCreature(m_council[i]))
         {
             if (pUnit->isAlive())
                 pUnit->Kill(pUnit, false);
         }
     }
 }
Example #8
0
 void JustDied(Unit *pVictim)
 {
     switch (me->GetEntry())
     {
         case 22949: DoScriptText(SAY_GATH_DEATH, me); break; // Gathios
         case 22950: DoScriptText(SAY_ZERE_DEATH, me); break; // Zerevor
         case 22951: DoScriptText(SAY_MALA_DEATH, me); break; // Melande
         case 22952: DoScriptText(SAY_VERA_DEATH, me); break; // Veras
     }
     if (Creature *pCouncil = pInstance->GetCreature(pInstance->GetData64(DATA_ILLIDARICOUNCIL)))
     {
         if (pCouncil->isAlive())
             pCouncil->Kill(pCouncil, false);
     }
 }
Example #9
0
    void UpdateTarget(uint32 diff)
    {
        if(ChangeTarget < diff)
        {
            DoZoneInCombat();
            if(Creature* pTeron = pInstance->GetCreature(pInstance->GetData64(DATA_TERONGOREFIEND)))
            {
                if(Unit* pTarget = ((ScriptedAI*)pTeron->AI())->SelectUnit(SELECT_TARGET_RANDOM, 1, 100, true))
                    AttackStart(pTarget);
            }

            if(!UpdateVictim())
            {
                if(Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1, 200, true))
                    AttackStart(pTarget);
            }
        }
        else
            ChangeTarget -= diff;
    }
Example #10
0
    void UpdateAI(const uint32 diff)
    {
        if (pInstance->GetData(EVENT_ILLIDARICOUNCIL) != IN_PROGRESS)
            return;

        if (m_counter > 3)
            return;

        if (m_yellTimer < diff)
        {
            if (Unit *pMember = me->GetCreature(m_council[m_counter]))
            {
                DoScriptText(CouncilAggro[m_counter].entry, pMember);
                m_yellTimer = CouncilAggro[m_counter].timer;
            }

            m_counter += 1;
            if (m_counter > 3)
                m_counter = 0;                            // Reuse for Enrage Yells
        }
        else
            m_yellTimer -= diff;

        if (m_enrageTimer < diff)
        {
            if (Creature* pMember = pInstance->GetCreature(m_council[m_counter]))
            {
                pMember->CastSpell(pMember, SPELL_BERSERK, true);

                DoScriptText(CouncilEnrage[m_counter].entry, pMember);
                m_enrageTimer = CouncilEnrage[m_counter].timer;
            }

            m_counter += 1;
        }
        else
            m_enrageTimer -= diff;
    }
Example #11
0
    void EnterCombat(Unit *pWho)
    {
        if (Creature *pController = pInstance->GetCreature(pInstance->GetData64(DATA_ILLIDARICOUNCIL)))
            ((mob_illidari_councilAI*)pController->AI())->StartEvent(pWho);

        DoZoneInCombat();

        if (me->GetEntry() == 22950)  // Zerevor
        {
            ClearCastQueue();
            ForceSpellCast(me, SPELL_DAMPEN_MAGIC);
            AddSpellToCast(pWho, SPELL_ARCANE_BOLT);
            StartAutocast();
        }

        if (!loadedGUIDs)
        {
            m_council[0] = pInstance->GetData64(DATA_LADYMALANDE);
            m_council[1] = pInstance->GetData64(DATA_HIGHNETHERMANCERZEREVOR);
            m_council[2] = pInstance->GetData64(DATA_GATHIOSTHESHATTERER);
            m_council[3] = pInstance->GetData64(DATA_VERASDARKSHADOW);
            loadedGUIDs = true;
        }
    }