当前位置: 首页>>代码示例>>C++>>正文


C++ DoOrSimulateScriptTextForThisInstance函数代码示例

本文整理汇总了C++中DoOrSimulateScriptTextForThisInstance函数的典型用法代码示例。如果您正苦于以下问题:C++ DoOrSimulateScriptTextForThisInstance函数的具体用法?C++ DoOrSimulateScriptTextForThisInstance怎么用?C++ DoOrSimulateScriptTextForThisInstance使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了DoOrSimulateScriptTextForThisInstance函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: switch

void instance_zulaman::DoTimeRunSay(RunEventSteps uiData)
{
    switch (uiData)
    {
        case RUN_START:     DoOrSimulateScriptTextForThisInstance(SAY_INST_BEGIN, NPC_MALACRASS); break;
        case RUN_FAIL:      DoOrSimulateScriptTextForThisInstance(urand(0, 1) ? SAY_INST_SACRIF1 : SAY_INST_SACRIF2, NPC_MALACRASS); break;
        case RUN_DONE:      DoOrSimulateScriptTextForThisInstance(SAY_INST_COMPLETE, NPC_MALACRASS); break;
        case RUN_PROGRESS:
            // This function is on progress called before the data is set to the array
            switch (GetKilledPreBosses() + 1)
            {
                case 1:     DoOrSimulateScriptTextForThisInstance(SAY_INST_PROGRESS_1, NPC_MALACRASS); break;
                case 2:     DoOrSimulateScriptTextForThisInstance(SAY_INST_PROGRESS_2, NPC_MALACRASS); break;
                case 3:     DoOrSimulateScriptTextForThisInstance(SAY_INST_PROGRESS_3, NPC_MALACRASS); break;
            }
            break;
        case RUN_FAIL_SOON:
            switch (GetKilledPreBosses())
            {
                case 0:     DoOrSimulateScriptTextForThisInstance(SAY_INST_WARN_1, NPC_MALACRASS); break;
                case 1:     DoOrSimulateScriptTextForThisInstance(SAY_INST_WARN_2, NPC_MALACRASS); break;
                case 2:     DoOrSimulateScriptTextForThisInstance(SAY_INST_WARN_3, NPC_MALACRASS); break;
                case 3:     DoOrSimulateScriptTextForThisInstance(SAY_INST_WARN_4, NPC_MALACRASS); break;
            }
            break;
    }
}
开发者ID:killerwife,项目名称:mangos-tbc,代码行数:27,代码来源:instance_zulaman.cpp

示例2: switch

void instance_naxxramas::DoTaunt()
{
    if (m_auiEncounter[TYPE_KELTHUZAD] != DONE)
    {
        uint8 uiWingsCleared = 0;

        if (m_auiEncounter[TYPE_MAEXXNA] == DONE)
            ++uiWingsCleared;

        if (m_auiEncounter[TYPE_LOATHEB] == DONE)
            ++uiWingsCleared;

        if (m_auiEncounter[TYPE_FOUR_HORSEMEN] == DONE)
            ++uiWingsCleared;

        if (m_auiEncounter[TYPE_THADDIUS] == DONE)
            ++uiWingsCleared;

        switch(uiWingsCleared)
        {
            case 1: DoOrSimulateScriptTextForThisInstance(SAY_KELTHUZAD_TAUNT1, NPC_KELTHUZAD); break;
            case 2: DoOrSimulateScriptTextForThisInstance(SAY_KELTHUZAD_TAUNT2, NPC_KELTHUZAD); break;
            case 3: DoOrSimulateScriptTextForThisInstance(SAY_KELTHUZAD_TAUNT3, NPC_KELTHUZAD); break;
            case 4: DoOrSimulateScriptTextForThisInstance(SAY_KELTHUZAD_TAUNT4, NPC_KELTHUZAD); break;
        }
    }
}
开发者ID:Bootz,项目名称:StrawberryCore,代码行数:27,代码来源:instance_naxxramas.cpp

示例3: DialogueUpdate

void instance_sunwell_plateau::Update(uint32 uiDiff)
{
    DialogueUpdate(uiDiff);

    if (m_uiKalecRespawnTimer)
    {
        if (m_uiKalecRespawnTimer <= uiDiff)
        {
            if (Creature* pKalecDragon = GetSingleCreatureFromStorage(NPC_KALECGOS_DRAGON))
                pKalecDragon->Respawn();
            if (Creature* pKalecHuman = GetSingleCreatureFromStorage(NPC_KALECGOS_HUMAN))
                pKalecHuman->Respawn();
            m_uiKalecRespawnTimer = 0;
        }
        else
            m_uiKalecRespawnTimer -= uiDiff;
    }

    // Muru berserk timer; needs to be done here because it involves two distinct creatures
    if (m_auiEncounter[TYPE_MURU] == IN_PROGRESS)
    {
        if (m_uiMuruBerserkTimer < uiDiff)
        {
            if (Creature* pEntrpius = GetSingleCreatureFromStorage(NPC_ENTROPIUS, true))
                pEntrpius->CastSpell(pEntrpius, SPELL_MURU_BERSERK, true);
            else if (Creature* pMuru = GetSingleCreatureFromStorage(NPC_MURU))
                pMuru->CastSpell(pMuru, SPELL_MURU_BERSERK, true);

            m_uiMuruBerserkTimer = 10 * MINUTE * IN_MILLISECONDS;
        }
        else
            m_uiMuruBerserkTimer -= uiDiff;
    }

    if (m_auiEncounter[TYPE_KILJAEDEN] == NOT_STARTED || m_auiEncounter[TYPE_KILJAEDEN] == FAIL)
    {
        if (m_uiKiljaedenYellTimer < uiDiff)
        {
            switch (urand(0, 4))
            {
                case 0: DoOrSimulateScriptTextForThisInstance(SAY_ORDER_1, NPC_KILJAEDEN_CONTROLLER); break;
                case 1: DoOrSimulateScriptTextForThisInstance(SAY_ORDER_2, NPC_KILJAEDEN_CONTROLLER); break;
                case 2: DoOrSimulateScriptTextForThisInstance(SAY_ORDER_3, NPC_KILJAEDEN_CONTROLLER); break;
                case 3: DoOrSimulateScriptTextForThisInstance(SAY_ORDER_4, NPC_KILJAEDEN_CONTROLLER); break;
                case 4: DoOrSimulateScriptTextForThisInstance(SAY_ORDER_5, NPC_KILJAEDEN_CONTROLLER); break;
            }
            m_uiKiljaedenYellTimer = 90000;
        }
        else
            m_uiKiljaedenYellTimer -= uiDiff;
    }
}
开发者ID:AlexHjelm,项目名称:Core,代码行数:52,代码来源:instance_sunwell_plateau.cpp

示例4: DoOrSimulateScriptTextForThisInstance

void instance_zulgurub::DoYellAtTriggerIfCan(uint32 uiTriggerId)
{
    if (uiTriggerId == AREATRIGGER_ENTER && !m_bHasIntroYelled)
    {
        DoOrSimulateScriptTextForThisInstance(SAY_HAKKAR_PROTECT, NPC_HAKKAR);
        m_bHasIntroYelled = true;
    }
    else if (uiTriggerId == AREATRIGGER_ALTAR && !m_bHasAltarYelled)
    {
        DoOrSimulateScriptTextForThisInstance(SAY_MINION_DESTROY, NPC_HAKKAR);
        m_bHasAltarYelled = true;
    }
}
开发者ID:Atari007,项目名称:master,代码行数:13,代码来源:instance_zulgurub.cpp

示例5: DoOrSimulateScriptTextForThisInstance

void instance_stratholme::ThazudinAcolyteJustDied(Creature* pCreature)
{
    for (uint8 i = 0; i < MAX_ZIGGURATS; ++i)
    {
        if (m_zigguratStorage[i].m_lZigguratAcolyteGuid.empty())
            continue;                               // nothing to do anymore for this ziggurat

        m_zigguratStorage[i].m_lZigguratAcolyteGuid.remove(pCreature->GetObjectGuid());
        if (m_zigguratStorage[i].m_lZigguratAcolyteGuid.empty())
        {
            // A random zone yell after one is cleared
            int32 aAnnounceSay[MAX_ZIGGURATS] = {SAY_ANNOUNCE_ZIGGURAT_1, SAY_ANNOUNCE_ZIGGURAT_2, SAY_ANNOUNCE_ZIGGURAT_3};
            DoOrSimulateScriptTextForThisInstance(aAnnounceSay[i], NPC_THUZADIN_ACOLYTE);

            // Kill Crystal
            if (Creature* pCrystal = instance->GetCreature(m_zigguratStorage[i].m_crystalGuid))
                pCrystal->DealDamage(pCrystal, pCrystal->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);

            switch (i)
            {
                case 0: SetData(TYPE_BARONESS, SPECIAL); break;
                case 1: SetData(TYPE_NERUB, SPECIAL);    break;
                case 2: SetData(TYPE_PALLID, SPECIAL);   break;
            }
        }
    }
}
开发者ID:przemratajczak,项目名称:scriptdev2,代码行数:27,代码来源:instance_stratholme.cpp

示例6: switch

void instance_ulduar::JustDidDialogueStep(int32 iEntry)
{
    switch (iEntry)
    {
        case SAY_PRE_LEVIATHAN_1:
        case SAY_PRE_LEVIATHAN_2:
        case SAY_PRE_LEVIATHAN_3:
            DoOrSimulateScriptTextForThisInstance(iEntry, NPC_BRONZEBEARD_RADIO);
            break;
        case NPC_LEVIATHAN:
            // move the leviathan in the arena
            if (Creature* pLeviathan = GetSingleCreatureFromStorage(NPC_LEVIATHAN))
            {
                // the boss has increased speed for this move; handled as custom
                float fSpeedRate = pLeviathan->GetSpeedRate(MOVE_RUN);
                pLeviathan->SetWalk(false);
                pLeviathan->SetSpeedRate(MOVE_RUN, 5);
                pLeviathan->GetMotionMaster()->MovePoint(1, afLeviathanMovePos[0], afLeviathanMovePos[1], afLeviathanMovePos[2]);
                pLeviathan->SetSpeedRate(MOVE_RUN, fSpeedRate);

                // modify respawn / home position to the center of arena
                pLeviathan->SetRespawnCoord(afLeviathanMovePos[0], afLeviathanMovePos[1], afLeviathanMovePos[2], afLeviathanMovePos[3]);
            }

            // Note: starting 4.x this gate is a GO 33 and it's destroyed at this point
            DoUseDoorOrButton(GO_LEVIATHAN_GATE);
            break;
    }
}
开发者ID:wowfactory,项目名称:scriptdev2,代码行数:29,代码来源:instance_ulduar.cpp

示例7: GetSingleCreatureFromStorage

// Function that spawns next scourge wave
void instance_culling_of_stratholme::DoSpawnNextScourgeWave()
{
    Creature* pSummoner = GetSingleCreatureFromStorage(NPC_ARTHAS);
    if (!pSummoner)
        return;

    DoOrSimulateScriptTextForThisInstance(m_aScourgeWavesLocs[m_uiCurrentUndeadPos].m_iYellId, NPC_LORDAERON_CRIER);

    for (uint8 i = 0; i < MAX_SCOURGE_TYPE_PER_WAVE; ++i)
    {
        // get the mob entry
        uint32 uiEntry = GetRandomMobOfType(uiScourgeWaveDef[m_uiScourgeWaveCount - 1][i]);
        if (!uiEntry)
            continue;

        float fX, fY, fZ, fO;
        fO = m_aScourgeWavesLocs[m_uiCurrentUndeadPos].m_fO;

        // bosses get exact location
        if (uiScourgeWaveDef[m_uiScourgeWaveCount - 1][i] == SCOURGE_TYPE_BOSS || uiScourgeWaveDef[m_uiScourgeWaveCount - 1][i] == SCOURGE_TYPE_ACOLYTES)
        {
            fX = m_aScourgeWavesLocs[m_uiCurrentUndeadPos].m_fX;
            fY = m_aScourgeWavesLocs[m_uiCurrentUndeadPos].m_fY;
            fZ = m_aScourgeWavesLocs[m_uiCurrentUndeadPos].m_fZ;
        }
        // random position around point
        else
            pSummoner->GetRandomPoint(m_aScourgeWavesLocs[m_uiCurrentUndeadPos].m_fX, m_aScourgeWavesLocs[m_uiCurrentUndeadPos].m_fY, m_aScourgeWavesLocs[m_uiCurrentUndeadPos].m_fZ, 5.0f, fX, fY, fZ);

        // special requirement for acolytes - spawn a pack of 4
        if (uiScourgeWaveDef[m_uiScourgeWaveCount - 1][i] == SCOURGE_TYPE_ACOLYTES)
        {
            for (uint8 j = 0; j < 4; ++j)
            {
                pSummoner->GetRandomPoint(m_aScourgeWavesLocs[m_uiCurrentUndeadPos].m_fX, m_aScourgeWavesLocs[m_uiCurrentUndeadPos].m_fY, m_aScourgeWavesLocs[m_uiCurrentUndeadPos].m_fZ, 5.0f, fX, fY, fZ);
                pSummoner->SummonCreature(uiEntry, fX, fY, fZ, fO, TEMPSUMMON_DEAD_DESPAWN, 0);
            }
        }
        // spawn the selected mob
        else
            pSummoner->SummonCreature(uiEntry, fX, fY, fZ, fO, TEMPSUMMON_DEAD_DESPAWN, 0);
    }

    // start infinite curruptor event on the first wave
    if (m_uiScourgeWaveCount == 1 && !instance->IsRegularDifficulty() && GetData(TYPE_INFINITE_CORRUPTER) != DONE)
        SetData(TYPE_INFINITE_CORRUPTER, IN_PROGRESS);

    // get a random position that is different from the previous one for the next round
    uint8 uiCurrentPos = urand(POS_FESTIVAL_LANE, POS_ELDERS_SQUARE);

    while (uiCurrentPos == m_uiCurrentUndeadPos)
        uiCurrentPos = urand(POS_FESTIVAL_LANE, POS_ELDERS_SQUARE);

    m_uiCurrentUndeadPos = uiCurrentPos;
}
开发者ID:AwkwardDev,项目名称:mangos-d3,代码行数:56,代码来源:instance_culling_of_stratholme.cpp

示例8: switch

void instance_ruins_of_ahnqiraj::SetData(uint32 uiType, uint32 uiData)
{
    switch (uiType)
    {
        case TYPE_KURINNAXX:
            if (uiData == DONE)
            {
                DoSapwnAndorovIfCan();

                // Yell after kurinnaxx
                DoOrSimulateScriptTextForThisInstance(SAY_OSSIRIAN_INTRO, NPC_OSSIRIAN);
            }
            m_auiEncounter[uiType] = uiData;
            break;
        case TYPE_RAJAXX:
            m_auiEncounter[uiType] = uiData;
            if (uiData == IN_PROGRESS)
            {
                DoSortArmyWaves();
            }
            if (uiData == DONE)
            {
                if (Creature* pAndorov = GetSingleCreatureFromStorage(NPC_GENERAL_ANDOROV))
                {
                    if (pAndorov->IsAlive())
                    {
                        pAndorov->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
                    }
                }
            }
            break;
        case TYPE_MOAM:
        case TYPE_BURU:
        case TYPE_AYAMISS:
        case TYPE_OSSIRIAN:
            m_auiEncounter[uiType] = uiData;
            break;
    }

    if (uiData == DONE)
    {
        OUT_SAVE_INST_DATA;

        std::ostringstream saveStream;
        saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2]
                   << " " << m_auiEncounter[3] << " " << m_auiEncounter[4] << " " << m_auiEncounter[5];

        m_strInstData = saveStream.str();

        SaveToDB();
        OUT_SAVE_INST_DATA_COMPLETE;
    }
}
开发者ID:Aincent,项目名称:server,代码行数:53,代码来源:instance_ruins_of_ahnqiraj.cpp

示例9: switch

void instance_magtheridons_lair::Update(uint32 uiDiff)
{
    // Prepare to release Magtheridon
    if (m_uiCageBreakTimer)
    {
        if (m_uiCageBreakTimer <= uiDiff)
        {
            switch (m_uiCageBreakStage)
            {
                case 0:
                    if (Creature* pMagtheridon = GetSingleCreatureFromStorage(NPC_MAGTHERIDON))
                    {
                        if (pMagtheridon->isAlive())
                        {
                            DoScriptText(EMOTE_NEARLY_FREE, pMagtheridon);
                            m_uiCageBreakTimer = MINUTE * IN_MILLISECONDS;
                        }
                    }
                    break;
                case 1:
                    SetData(TYPE_MAGTHERIDON_EVENT, IN_PROGRESS);
                    m_uiCageBreakTimer = 0;
                    break;
            }

            ++m_uiCageBreakStage;
        }
        else
            m_uiCageBreakTimer -= uiDiff;
    }

    // no yell if event is in progress or finished
    if (m_auiEncounter[TYPE_CHANNELER_EVENT] == IN_PROGRESS || m_auiEncounter[TYPE_MAGTHERIDON_EVENT] == DONE)
        return;

    if (m_uiRandYellTimer < uiDiff)
    {
        DoOrSimulateScriptTextForThisInstance(aRandomTaunt[urand(0, 5)], NPC_MAGTHERIDON);
        m_uiRandYellTimer = 90000;
    }
    else
        m_uiRandYellTimer -= uiDiff;
}
开发者ID:kotishe,项目名称:server-1,代码行数:43,代码来源:instance_magtheridons_lair.cpp

示例10: switch

void instance_shattered_halls::Update(uint32 uiDiff)
{
    if (m_auiEncounter[TYPE_EXECUTION] != IN_PROGRESS)
        return;

    if (m_uiExecutionTimer < uiDiff)
    {
        switch (m_uiExecutionStage)
        {
            case 0:
                // Kill the officer
                if (Creature* pSoldier = GetSingleCreatureFromStorage(m_uiTeam == ALLIANCE ? NPC_OFFICER_ALLIANCE : NPC_OFFICER_HORDE))
                    pSoldier->DealDamage(pSoldier, pSoldier->GetHealth(), nullptr, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, nullptr, false);

                // Make Kargath yell
                DoOrSimulateScriptTextForThisInstance(m_uiTeam == ALLIANCE ? SAY_KARGATH_EXECUTE_ALLY : SAY_KARGATH_EXECUTE_HORDE, NPC_KARGATH_BLADEFIST);

                // Set timer for the next execution
                DoCastGroupDebuff(SPELL_KARGATH_EXECUTIONER_2);
                m_uiExecutionTimer = 10 * MINUTE * IN_MILLISECONDS;
                break;
            case 1:
                if (Creature* pSoldier = GetSingleCreatureFromStorage(m_uiTeam == ALLIANCE ? NPC_SOLDIER_ALLIANCE_2 : NPC_SOLDIER_HORDE_2))
                    pSoldier->DealDamage(pSoldier, pSoldier->GetHealth(), nullptr, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, nullptr, false);

                DoCastGroupDebuff(SPELL_KARGATH_EXECUTIONER_3);
                m_uiExecutionTimer = 15 * MINUTE * IN_MILLISECONDS;
                break;
            case 2:
                if (Creature* pSoldier = GetSingleCreatureFromStorage(m_uiTeam == ALLIANCE ? NPC_SOLDIER_ALLIANCE_3 : NPC_SOLDIER_HORDE_3))
                    pSoldier->DealDamage(pSoldier, pSoldier->GetHealth(), nullptr, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, nullptr, false);

                SetData(TYPE_EXECUTION, FAIL);
                m_uiExecutionTimer = 0;
                break;
        }
        ++m_uiExecutionStage;
    }
    else
        m_uiExecutionTimer -= uiDiff;
}
开发者ID:Phatcat,项目名称:mangos-wotlk,代码行数:41,代码来源:instance_shattered_halls.cpp

示例11: switch

void instance_ruins_of_ahnqiraj::SetData(uint32 uiType, uint32 uiData)
{
    switch (uiType)
    {
    case TYPE_KURINNAXX:
        if (uiData == DONE)
        {
            DoSapwnAndorovIfCan();

            // Yell after kurinnaxx
            DoOrSimulateScriptTextForThisInstance(SAY_OSSIRIAN_INTRO, NPC_OSSIRIAN);
        }
        m_auiEncounter[uiType] = uiData;
        break;
    case TYPE_RAJAXX:
    case TYPE_MOAM:
    case TYPE_BURU:
    case TYPE_AYAMISS:
    case TYPE_OSSIRIAN:
        m_auiEncounter[uiType] = uiData;
        break;
    }

    if (uiData == DONE)
    {
        OUT_SAVE_INST_DATA;

        std::ostringstream saveStream;
        saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2]
                   << " " << m_auiEncounter[3] << " " << m_auiEncounter[4] << " " << m_auiEncounter[5];

        m_strInstData = saveStream.str();

        SaveToDB();
        OUT_SAVE_INST_DATA_COMPLETE;
    }
}
开发者ID:mynew3,项目名称:scriptdev0,代码行数:37,代码来源:instance_ruins_of_ahnqiraj.cpp

示例12: DoOrSimulateScriptTextForThisInstance

void instance_naxxramas::OnCreatureDeath(Creature* pCreature)
{
    if (pCreature->GetEntry() == NPC_MR_BIGGLESWORTH && m_auiEncounter[TYPE_KELTHUZAD] != DONE)
        DoOrSimulateScriptTextForThisInstance(SAY_KELTHUZAD_CAT_DIED, NPC_KELTHUZAD);
}
开发者ID:Bootz,项目名称:StrawberryCore,代码行数:5,代码来源:instance_naxxramas.cpp

示例13: SetData

void instance_culling_of_stratholme::Update(uint32 uiDiff)
{
    // 25min Run - decrease time, update worldstate every ~20s
    // as the time is always saved by m_auiEncounter[TYPE_INFINITE_CORRUPTER_TIME], there is no need for an extra timer
    if (m_auiEncounter[TYPE_INFINITE_CORRUPTER_TIME])
    {
        if (m_auiEncounter[TYPE_INFINITE_CORRUPTER_TIME] <= uiDiff)
            SetData(TYPE_INFINITE_CORRUPTER, FAIL);
        else
        {
            m_auiEncounter[TYPE_INFINITE_CORRUPTER_TIME] -= uiDiff;
            if (m_auiEncounter[TYPE_INFINITE_CORRUPTER_TIME] / IN_MILLISECONDS % 20 == 0)
                SetData(TYPE_INFINITE_CORRUPTER_TIME, m_auiEncounter[TYPE_INFINITE_CORRUPTER_TIME]);
        }

        // This part is needed for a small "hurry up guys" note, TODO, verify 20min
        if (m_auiEncounter[TYPE_INFINITE_CORRUPTER] == IN_PROGRESS && m_auiEncounter[TYPE_INFINITE_CORRUPTER_TIME] <= 24 * MINUTE * IN_MILLISECONDS)
            SetData(TYPE_INFINITE_CORRUPTER, SPECIAL);
    }

    // Small Timer, to remove Grain-Crate WorldState and Spawn Second Chromie
    if (m_uiRemoveCrateStateTimer)
    {
        if (m_uiRemoveCrateStateTimer <= uiDiff)
        {
            if (Player* pPlayer = GetPlayerInMap())
                DoSpawnChromieIfNeeded(pPlayer);

            DoUpdateWorldState(WORLD_STATE_CRATES, 0);
            DoChromieWhisper(WHISPER_CHROMIE_CRATES);
            m_uiRemoveCrateStateTimer = 0;
        }
        else
            m_uiRemoveCrateStateTimer -= uiDiff;
    }

    // Respawn Arthas after some time
    if (m_uiArthasRespawnTimer)
    {
        if (m_uiArthasRespawnTimer <= uiDiff)
        {
            if (Player* pPlayer = GetPlayerInMap())
                DoSpawnArthasIfNeeded(pPlayer);

            m_uiArthasRespawnTimer = 0;
        }
        else
            m_uiArthasRespawnTimer -= uiDiff;
    }

    // Handle undead waves
    if (m_uiScourgeWaveTimer)
    {
        if (m_uiScourgeWaveTimer <= uiDiff)
        {
            if (GetData(TYPE_SALRAMM_EVENT) == DONE)
            {
                DoOrSimulateScriptTextForThisInstance(SAY_MEET_TOWN_HALL, NPC_ARTHAS);
                DoUpdateWorldState(WORLD_STATE_WAVE, 0);    // Remove WaveCounter

                // despawn and respawn Arthas in the new location
                if (Creature* pArthas = GetSingleCreatureFromStorage(NPC_ARTHAS))
                    pArthas->ForcedDespawn();
                if (Player* pPlayer = GetPlayerInMap())
                    DoSpawnArthasIfNeeded(pPlayer);
            }
            else
            {
                ++m_uiScourgeWaveCount;
                DoUpdateWorldState(WORLD_STATE_WAVE, m_uiScourgeWaveCount);
                DoSpawnNextScourgeWave();
            }

            m_uiScourgeWaveTimer = 0;
        }
        else
            m_uiScourgeWaveTimer -= uiDiff;
    }
}
开发者ID:AwkwardDev,项目名称:mangos-d3,代码行数:79,代码来源:instance_culling_of_stratholme.cpp

示例14: switch

void instance_ruins_of_ahnqiraj::SetData(uint32 uiType, uint32 uiData)
{
    switch(uiType)
    {
        case TYPE_KURINNAXX:
            if (uiData == DONE)
            {
                DoSapwnAndorovIfCan();

                // Yell after kurinnaxx
                if (m_auiEncounter[uiType] != DONE)
				    DoOrSimulateScriptTextForThisInstance(YELL_OSSIRIAN_BREACHED, NPC_OSSIRIAN);
            }
            m_auiEncounter[uiType] = uiData;
            break;
        case TYPE_RAJAXX:
            m_auiEncounter[uiType] = uiData;
            if (uiData == IN_PROGRESS)
            {
                m_hasResetRajaxx = false;
                DoSortArmyWaves();
            }
            if (uiData == DONE)
            {
                Map::PlayerList const &PlayerList = instance->GetPlayers();
                for (Map::PlayerList::const_iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr)
                {
                    if (itr->getSource() && itr->getSource()->IsInWorld())
                        itr->getSource()->SetCombatTimer(0);
                }

                if (Creature* pAndorov = GetSingleCreatureFromStorage(NPC_GENERAL_ANDOROV))
                {
                    if (pAndorov->isAlive() && m_auiEncounter[TYPE_ANDOROV] != FAIL)
                    {
#if AQ_PATCH >= 10
                        pAndorov->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
#else
                        pAndorov->ForcedDespawn();
#endif
                        Map::PlayerList const& lPlayers = this->instance->GetPlayers();
                        
                        if (!lPlayers.isEmpty())
                            for (Map::PlayerList::const_iterator itr = lPlayers.begin(); itr != lPlayers.end(); ++itr)
                            {
                                if (Player* pPlayer = itr->getSource())
                                    pPlayer->RewardReputation(609, 150);
                            }
                    }
                }
            }
            break;
        case TYPE_MOAM:
        case TYPE_BURU:
        case TYPE_AYAMISS:
        case TYPE_OSSIRIAN:
        case TYPE_ANDOROV:
            m_auiEncounter[uiType] = uiData;
            break;
    }

    if (uiData == DONE || (uiType == TYPE_RAJAXX && uiData == IN_PROGRESS) || (uiType == TYPE_ANDOROV && uiData == FAIL))
    {
        OUT_SAVE_INST_DATA;

        std::ostringstream saveStream;
        saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2]
            << " " << m_auiEncounter[3] << " " << m_auiEncounter[4] << " " << m_auiEncounter[5]
            << " " << m_auiEncounter[6];

        m_strInstData = saveStream.str();

        SaveToDB();
        OUT_SAVE_INST_DATA_COMPLETE;
    }
}
开发者ID:yyhhrr,项目名称:mangospriv,代码行数:76,代码来源:instance_ruins_of_ahnqiraj.cpp

示例15: switch


//.........这里部分代码省略.........
                    pArthas->ForcedDespawn();

                if (Player* pPlayer = GetPlayerInMap())
                    DoSpawnArthasIfNeeded(pPlayer);
            }
            break;
        case TYPE_EPOCH_EVENT:
            m_auiEncounter[uiType] = uiData;
            break;
        case TYPE_ARTHAS_ESCORT_EVENT:
            // use fail in order to respawn Arthas
            if (uiData == FAIL)
            {
                m_uiArthasRespawnTimer = 10000;

                // despawn the bosses if Arthas dies in order to avoid exploits
                if (Creature* pEpoch = GetSingleCreatureFromStorage(NPC_LORD_EPOCH, true))
                    pEpoch->ForcedDespawn();
                if (Creature* pMalganis = GetSingleCreatureFromStorage(NPC_MALGANIS, true))
                    pMalganis->ForcedDespawn();
            }
            else
                m_auiEncounter[uiType] = uiData;
            break;
        case TYPE_MALGANIS_EVENT:
            m_auiEncounter[uiType] = uiData;
            if (uiData == DONE)
            {
                DoUseDoorOrButton(GO_CITY_ENTRANCE_GATE);
                DoToggleGameObjectFlags(instance->IsRegularDifficulty() ? GO_DARK_RUNED_CHEST : GO_DARK_RUNED_CHEST_H, GO_FLAG_NO_INTERACT, false);
                DoRespawnGameObject(instance->IsRegularDifficulty() ? GO_DARK_RUNED_CHEST : GO_DARK_RUNED_CHEST_H, 30 * MINUTE);

                if (Player* pPlayer = GetPlayerInMap())
                    DoSpawnChromieIfNeeded(pPlayer);
            }
            break;
        case TYPE_INFINITE_CORRUPTER_TIME:
            m_auiEncounter[uiType] = uiData;
            if (!uiData)
            {
                DoUpdateWorldState(WORLD_STATE_TIME, 0);    // Remove Timer
                DoUpdateWorldState(WORLD_STATE_TIME_COUNTER, 0);
            }
            else
                DoUpdateWorldState(WORLD_STATE_TIME_COUNTER, uiData / (MINUTE * IN_MILLISECONDS));
            break;
        case TYPE_INFINITE_CORRUPTER:
            m_auiEncounter[uiType] = uiData;
            switch (uiData)
            {
                case IN_PROGRESS:
                    if (!GetData(TYPE_INFINITE_CORRUPTER_TIME))
                    {
                        SetData(TYPE_INFINITE_CORRUPTER_TIME, MINUTE * 25 * IN_MILLISECONDS);
                        DoUpdateWorldState(WORLD_STATE_TIME, 1);
                        DoChromieWhisper(WHISPER_CHROMIE_GUARDIAN);

                        // spawn the corruptor for the first time
                        if (Creature* pArthas = GetSingleCreatureFromStorage(NPC_ARTHAS))
                            DoSpawnCorruptorIfNeeded(pArthas);
                    }
                    break;
                case DONE:
                    // event completed - epilog handled by dbscript
                    SetData(TYPE_INFINITE_CORRUPTER_TIME, 0);
                    break;
                case SPECIAL:
                    DoChromieWhisper(WHISPER_CHROMIE_HURRY);
                    break;
                case FAIL:
                    // event failed - despawn the corruptor
                    SetData(TYPE_INFINITE_CORRUPTER_TIME, 0);
                    if (Creature* pCorrupter = GetSingleCreatureFromStorage(NPC_INFINITE_CORRUPTER))
                    {
                        DoOrSimulateScriptTextForThisInstance(SAY_CORRUPTOR_DESPAWN, NPC_INFINITE_CORRUPTER);

                        if (pCorrupter->isAlive())
                            pCorrupter->ForcedDespawn();
                    }
                    break;
            }
            break;
    }

    if (uiData == DONE || uiType == TYPE_INFINITE_CORRUPTER_TIME)
    {
        OUT_SAVE_INST_DATA;

        std::ostringstream saveStream;
        saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " "
                   << m_auiEncounter[3] << " " << m_auiEncounter[4] << " " << m_auiEncounter[5] << " "
                   << m_auiEncounter[6] << " " << m_auiEncounter[7] << " " << m_auiEncounter[8] << " "
                   << m_auiEncounter[9];

        m_strInstData = saveStream.str();

        SaveToDB();
        OUT_SAVE_INST_DATA_COMPLETE;
    }
}
开发者ID:AwkwardDev,项目名称:mangos-d3,代码行数:101,代码来源:instance_culling_of_stratholme.cpp


注:本文中的DoOrSimulateScriptTextForThisInstance函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。