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);
        }
    }
}
示例#2
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);
    }
}
示例#3
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);
    }
}