예제 #1
0
void instance_violet_hold::ResetAll()
{
    ResetVariables();
    UpdateWorldState(false);
    CallGuards(true);
    SetIntroPortals(false);
}
예제 #2
0
void instance_violet_hold::ResetAll()
{
    ResetVariables();
    UpdateWorldState(false);
    CallGuards(true);
    SetIntroPortals(false);

    for (std::vector<BossSpawn*>::const_iterator itr = m_vRandomBosses.begin(); itr != m_vRandomBosses.end(); ++itr)
    {
        const BossInformation* pData = GetBossInformation((*itr)->uiEntry);
        if (pData && m_auiEncounter[pData->uiType] == DONE)
        {
            if (Creature* pGhostBoss = GetSingleCreatureFromStorage(pData->uiGhostEntry))
            {
                if (!pGhostBoss->isAlive())
                    pGhostBoss->Respawn();
            }
            else if (Creature* pSummoner = GetSingleCreatureFromStorage(NPC_SINCLARI_ALT))
                pSummoner->SummonCreature(pData->uiGhostEntry, (*itr)->fX, (*itr)->fY, (*itr)->fZ, (*itr)->fO, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600*IN_MILLISECONDS);

            // Close Door if still open
            UpdateCellForBoss(pData->uiEntry, true);
        }
    }
}
예제 #3
0
void instance_violet_hold::ResetAll()
{
    ResetVariables();
    UpdateWorldState(false);
    CallGuards(true);
    SetIntroPortals(false);
    // ToDo: reset the activation crystals when implemented

    for (std::vector<BossSpawn*>::const_iterator itr = m_vRandomBosses.begin(); itr != m_vRandomBosses.end(); ++itr)
    {
        const BossInformation* pData = GetBossInformation((*itr)->uiEntry);
        if (pData && m_auiEncounter[pData->uiType] == DONE)
        {
            // Despawn ghost boss
            if (Creature* pGhostBoss = GetSingleCreatureFromStorage(pData->uiGhostEntry))
                pGhostBoss->ForcedDespawn();

            // Spawn new boss replacement
            if (Creature* pSummoner = GetSingleCreatureFromStorage(NPC_SINCLARI_ALT))
                pSummoner->SummonCreature(pData->uiGhostEntry, (*itr)->fX, (*itr)->fY, (*itr)->fZ, (*itr)->fO, TEMPSUMMON_DEAD_DESPAWN, 0);

            // Replace Erekem guards
            if (pData->uiType == TYPE_EREKEM)
            {
                // Despawn ghost guards
                for (GuidList::const_iterator itr = m_lArakkoaGuardList.begin(); itr != m_lArakkoaGuardList.end(); ++itr)
                {
                    if (Creature* pGhostGuard = instance->GetCreature(*itr))
                        pGhostGuard->ForcedDespawn();
                }

                m_lArakkoaGuardList.clear();

                // Spawn new guards replacement
                float fX, fY, fZ, fO;
                for (GuidList::const_iterator itr = m_lErekemGuardList.begin(); itr != m_lErekemGuardList.end(); ++itr)
                {
                    if (Creature* pGuard = instance->GetCreature(*itr))
                    {
                        // Don't allow alive original guards while the boss is dead
                        if (!pGuard->isDead())
                            pGuard->ForcedDespawn();

                        // Spawn a ghost guard for each original guard
                        pGuard->GetRespawnCoord(fX, fY, fZ, &fO);
                        pGuard->SummonCreature(NPC_ARAKKOA_GUARD, fX, fY, fZ, fO, TEMPSUMMON_DEAD_DESPAWN, 0);
                    }
                }
            }
        }

        // Close Door if still open
        if (pData && (m_auiEncounter[pData->uiType] == DONE || m_auiEncounter[pData->uiType] == FAIL))
            UpdateCellForBoss(pData->uiEntry, true);
    }
}
예제 #4
0
void instance_violet_hold::ResetAll()
{
    ResetVariables();
    UpdateWorldState(false);
    CallGuards(true);
    SetIntroPortals(false);
    // ToDo: reset the activation crystals when implemented

    // open instance door
    DoUseDoorOrButton(GO_PRISON_SEAL_DOOR);

    for (std::vector<BossSpawn*>::const_iterator itr = m_vRandomBosses.begin(); itr != m_vRandomBosses.end(); ++itr)
    {
        const BossInformation* pData = GetBossInformation((*itr)->uiEntry);
        if (pData && m_auiEncounter[pData->uiType] == DONE)
        {
            if (Creature* pGhostBoss = GetSingleCreatureFromStorage(pData->uiGhostEntry))
            {
                if (!pGhostBoss->isAlive())
                    pGhostBoss->Respawn();

                // Reset passive flags
                pGhostBoss->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PASSIVE);
            }
            else if (Creature* pSummoner = GetSingleCreatureFromStorage(NPC_SINCLARI_ALT))
                pSummoner->SummonCreature(pData->uiGhostEntry, (*itr)->fX, (*itr)->fY, (*itr)->fZ, (*itr)->fO, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600 * IN_MILLISECONDS);

            // Respawn Erekem guards
            if (pData->uiType == TYPE_EREKEM)
            {
                for (GuidList::const_iterator itr = m_lErekemGuardList.begin(); itr != m_lErekemGuardList.end(); ++itr)
                {
                    if (Creature* pGuard = instance->GetCreature(*itr))
                    {
                        pGuard->Respawn();
                        pGuard->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PASSIVE);
                    }
                }
            }
        }

        // Close Door if still open
        if (pData && (m_auiEncounter[pData->uiType] == DONE || m_auiEncounter[pData->uiType] == FAIL))
            UpdateCellForBoss(pData->uiEntry, true);
    }
}
예제 #5
0
    void UpdateAI(const uint32 uiDiff)
    {
        if (m_bIntro && m_uiIntroTimer <= uiDiff)
        {
            switch (m_uiStage)
            {
            case 0:
                DoScriptText(SAY_INTRO_01, m_creature);
                m_uiStage = 1;
                m_uiIntroTimer = 5*IN_MILLISECONDS;
                break;
            case 1:
                DoScriptText(SAY_INTRO_02, m_creature);
                m_uiStage = 2;
                m_uiIntroTimer = 5*IN_MILLISECONDS;
                break;
            case 2:
                DoScriptText(SAY_INTRO_03, m_creature);
                m_uiStage = 3;
                m_bIntro = false;
                break;
            default:
                break;
            }
        }
        else
            m_uiIntroTimer -= uiDiff;

        if (m_creature->HasAura(SPELL_MANA_BARRIER))
        {
            if (m_creature->GetHealth() <= m_creature->GetMaxHealth())
            {
                if (m_creature->GetPower(POWER_MANA) > (m_creature->GetMaxHealth() - m_creature->GetHealth()))
                {
                    m_creature->SetPower(POWER_MANA, m_creature->GetPower(POWER_MANA) - (m_creature->GetMaxHealth() - m_creature->GetHealth()));
                    m_creature->SetHealth(m_creature->GetMaxHealth());
                }
                else
                    m_creature->SetPower(POWER_MANA, 0);
            }
        }

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

        if (m_bMovementStarted)
            return;

        DoControlObsessedPlayers();

        switch (m_uiStage)
        {
        case 3:
            if (IsCombatMovement())
                SetCombatMovement(false);

            if (m_uiShadowBoltTimer <= uiDiff)
            {
                if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0))
                {
                    switch (m_uiMode)
                    {
                    case RAID_DIFFICULTY_10MAN_NORMAL:
                    case RAID_DIFFICULTY_10MAN_HEROIC:
                        DoCast(pTarget, SPELL_SHADOW_BOLT_N);
                        break;
                    case RAID_DIFFICULTY_25MAN_NORMAL:
                    case RAID_DIFFICULTY_25MAN_HEROIC:
                        DoCast(pTarget, SPELL_SHADOW_BOLT_H);
                        break;
                    }
                    m_uiShadowBoltTimer = urand(5*IN_MILLISECONDS, 8*IN_MILLISECONDS);
                }
            }
            else
                m_uiShadowBoltTimer -= uiDiff;

            if (m_uiSummonGuardsTimer <= uiDiff)
            {
                switch (m_uiMode)
                {
                case RAID_DIFFICULTY_10MAN_NORMAL:
                    CallGuards();
                    m_uiSummonGuardsTimer = MINUTE*IN_MILLISECONDS;
                    break;
                case RAID_DIFFICULTY_25MAN_NORMAL:
                    CallGuards();
                    m_uiSummonGuardsTimer = 40*IN_MILLISECONDS;
                    break;
                case RAID_DIFFICULTY_10MAN_HEROIC:
                    CallGuards();
                    m_uiSummonGuardsTimer = MINUTE*IN_MILLISECONDS;
                    break;
                case RAID_DIFFICULTY_25MAN_HEROIC:
                    CallGuards();
                    m_uiSummonGuardsTimer = 40*IN_MILLISECONDS;
                    break;
                default:
                    m_uiSummonGuardsTimer = MINUTE*IN_MILLISECONDS;
                    break;
                }
            }
            else
                m_uiSummonGuardsTimer -= uiDiff;

            break;
        case 4:
            if (m_uiFrostboltTimer <= uiDiff)
            {
                switch (m_uiMode)
                {
                case RAID_DIFFICULTY_10MAN_NORMAL:
                    DoCast(m_creature->getVictim(), SPELL_FROSTBOLT_10_N);
                    break;
                case RAID_DIFFICULTY_25MAN_NORMAL:
                case RAID_DIFFICULTY_10MAN_HEROIC:
                case RAID_DIFFICULTY_25MAN_HEROIC:
                    DoCast(m_creature->getVictim(), SPELL_FROSTBOLT_25);
                    break;
                default:
                    break;
                }
                m_uiFrostboltTimer = urand(10*IN_MILLISECONDS, 20*IN_MILLISECONDS);
            }
            else
                m_uiFrostboltTimer -= uiDiff;

            if (m_uiFrostboltVolleyTimer <= uiDiff)
            {
                switch (m_uiMode)
                {
                case RAID_DIFFICULTY_10MAN_NORMAL:
                    DoCast(m_creature->getVictim(), SPELL_FROSTBOLT_VOLLEY_10_N);
                    break;
                case RAID_DIFFICULTY_25MAN_NORMAL:
                    DoCast(m_creature->getVictim(), SPELL_FROSTBOLT_VOLLEY_25_N);
                    break;
                case RAID_DIFFICULTY_10MAN_HEROIC:
                case RAID_DIFFICULTY_25MAN_HEROIC:
                    DoCast(m_creature->getVictim(), SPELL_FROSTBOLT_VOLLEY_H);
                    break;
                default:
                    break;
                }
                m_uiFrostboltVolleyTimer = urand(10*IN_MILLISECONDS, 20*IN_MILLISECONDS);
            }
            else
                m_uiFrostboltVolleyTimer -= uiDiff;

            if (m_uiTouchOfInsignificanceTimer <= uiDiff)
            {
                DoCast(m_creature->getVictim(), SPELL_TOUCH_OF_INSIGNIFICANCE);
                m_uiTouchOfInsignificanceTimer = urand(10*IN_MILLISECONDS, 20*IN_MILLISECONDS);
            }
            else
                m_uiTouchOfInsignificanceTimer -= uiDiff;

            if (m_uiSummonSpiritTimer <= uiDiff)
            {
                CallSpirit();
                m_uiSummonSpiritTimer = urand(8*IN_MILLISECONDS, 15*IN_MILLISECONDS);
            }
            else
                m_uiSummonSpiritTimer -= uiDiff;

            if (m_uiSummonGuardsTimer <= uiDiff)
            {
                switch (m_uiMode)
                {
                case RAID_DIFFICULTY_10MAN_NORMAL:
                    break;
                case RAID_DIFFICULTY_25MAN_NORMAL:
                    break;
                case RAID_DIFFICULTY_10MAN_HEROIC:
                    CallGuard();
                    m_uiSummonGuardsTimer = 45*IN_MILLISECONDS;
                    break;
                case RAID_DIFFICULTY_25MAN_HEROIC:
                    CallGuards();
                    m_uiSummonGuardsTimer = 60*IN_MILLISECONDS;
                    break;
                default:
                    break;
                }
            }
            else
                m_uiSummonGuardsTimer -= uiDiff;

            break;
        }

        if (m_uiMode != RAID_DIFFICULTY_10MAN_NORMAL)
        {
            if (m_uiDominateMindTimer <= uiDiff)
            {
                DominateMind();

                switch (m_uiMode)
                {
                case RAID_DIFFICULTY_10MAN_HEROIC:
                case RAID_DIFFICULTY_25MAN_NORMAL:
                    m_uiDominateMindTimer = urand(12*IN_MILLISECONDS, 15*IN_MILLISECONDS);
                    break;
                case RAID_DIFFICULTY_25MAN_HEROIC:
                    m_uiDominateMindTimer = urand(4*IN_MILLISECONDS, 6*IN_MILLISECONDS);
                    break;
                default:
                    m_uiDominateMindTimer = 0;
                    break;
                }
            }
            else
                m_uiDominateMindTimer -= uiDiff;
        }

        if (m_uiDeathAndDecayTimer <= uiDiff)
        {
            if(Unit *pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0))
            {
                if(pTarget)
                {
                    switch (m_uiMode)
                    {
                    case RAID_DIFFICULTY_10MAN_NORMAL:
                    case RAID_DIFFICULTY_10MAN_HEROIC:
                        DoCast(pTarget, SPELL_DEATH_AND_DECAY_10);
                        break;
                    case RAID_DIFFICULTY_25MAN_NORMAL:
                        DoCast(pTarget, SPELL_DEATH_AND_DECAY_25_N);
                        break;
                    case RAID_DIFFICULTY_25MAN_HEROIC:
                        DoCast(pTarget, SPELL_DEATH_AND_DECAY_25_H);
                        break;
                    default:
                        break;
                    }
                }
            }
            m_uiDeathAndDecayTimer = urand(10*IN_MILLISECONDS, 20*IN_MILLISECONDS);
        }
        else
            m_uiDeathAndDecayTimer -= uiDiff;

        if(!m_creature->HasAura(SPELL_MANA_BARRIER) && m_uiStage == 3)
        {
            m_uiStage = 4;
            DoScriptText(SAY_PHASE2_01, m_creature);
            SetCombatMovement(false);
            m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
        }

        if(m_uiBerserkTimer <= uiDiff)
        {
            DoCast(m_creature, SPELL_BERSERK);
            DoScriptText(SAY_BERSERK_01, m_creature);
        };

        if (m_uiStage == 4)
            DoMeleeAttackIfReady();
    }
예제 #6
0
   void UpdateAI(const uint32 diff)
    {
        if (m_pInstance->GetData(TYPE_FALRIC) == SPECIAL ) {
            if (m_uiSummon_Timer < diff) {
                    ++SummonCount;
                    if (SummonCount > MOB_WAVES_NUM_1) {
                             m_pInstance->SetData(TYPE_FALRIC, IN_PROGRESS);
                             me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
                             me->SetVisibility(VISIBILITY_ON);
                             me->SetInCombatWithZone();
                             }
                    else CallGuards(TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60000);
                    m_uiSummon_Timer = MOB_WAVES_DELAY_1;
                    } else m_uiSummon_Timer -= diff;
        }

        if (UpdateVictim())
            return;

        switch(stage)
        {
            case 0: {
                    break;}
            case 1: {
                    if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
                    DoCast(pTarget, SPELL_HOPELESSNESS);
                    stage = 2;
                    break;}
            case 2: {
                    break;}
            case 3: {
                    if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
                    DoCast(pTarget, SPELL_HOPELESSNESS);
                    stage = 4;
                    break;}
            case 4: {
                    break;}
            case 5: {
                    if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
                    DoCast(pTarget, SPELL_HOPELESSNESS);
                    stage = 6;
                    break;}
            case 6: {
                    break;}
        }
                    if (m_uiDespair_Timer < diff) {
                    if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
                    DoCast(pTarget, SPELL_IMPENDING_DESPAIR);
                    m_uiDespair_Timer= Regular ? 40000 : 30000;
                    } else m_uiDespair_Timer -= diff;

                    if (m_uiStrike_Timer < diff)
                    {DoCast(me->getVictim(), Regular ? SPELL_QUIVERING_STRIKE_N : SPELL_QUIVERING_STRIKE_H);
                    m_uiStrike_Timer=urand(10000,15000);
                    } else m_uiStrike_Timer -= diff;

                    if (m_uiHorror_Timer < diff) {
                    if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
                    DoCast(pTarget, Regular ? SPELL_DEFILING_HORROR_N : SPELL_DEFILING_HORROR_H);
                    m_uiHorror_Timer=urand(25000,35000);
                    } else m_uiHorror_Timer -= diff;

        health = me->GetHealth()*100 / me->GetMaxHealth();
        if (health <= 66 && stage == 0) stage = 1;
        if (health <= 33 && stage == 2) stage = 3;
        if (health <= 10 && stage == 4) stage = 5;

        if (m_uiBerserk_Timer < diff)
        {
            DoCast(me, SPELL_BERSERK);
            m_uiBerserk_Timer = 180000;
        } else  m_uiBerserk_Timer -= diff;

        DoMeleeAttackIfReady();      
    }