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


C++ SetData函数代码示例

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


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

示例1: switch

void instance_stratholme::SetData(uint32 uiType, uint32 uiData)
{
    // TODO: Remove the hard-coded indexes from array accessing
    switch (uiType)
    {
        case TYPE_BARON_RUN:
            switch (uiData)
            {
                case IN_PROGRESS:
                    if (m_auiEncounter[uiType] == IN_PROGRESS || m_auiEncounter[uiType] == FAIL)
                    {
                        break;
                    }

                    DoOrSimulateScriptTextForThisInstance(SAY_ANNOUNCE_RUN_START, NPC_BARON);

                    m_uiBaronRunTimer = 45 * MINUTE * IN_MILLISECONDS;
                    debug_log("SD2: Instance Stratholme: Baron run in progress.");
                    break;
                case FAIL:
                    // may add code to remove aura from players, but in theory the time should be up already and removed.
                    break;
                case DONE:
                    m_uiBaronRunTimer = 0;
                    break;
            }
            m_auiEncounter[uiType] = uiData;
            break;
        case TYPE_BARONESS:
        case TYPE_NERUB:
        case TYPE_PALLID:
            m_auiEncounter[uiType] = uiData;
            if (uiData == DONE)
            {
                DoSortZiggurats();
                DoUseDoorOrButton(m_zigguratStorage[uiType - TYPE_BARONESS].m_doorGuid);
            }
            if (uiData == SPECIAL)
            {
                StartSlaugtherSquare();
            }
            break;
        case TYPE_RAMSTEIN:
            if (uiData == SPECIAL)
            {
                if (m_auiEncounter[uiType] != SPECIAL && m_auiEncounter[uiType] != DONE)
                {
                    m_uiSlaugtherSquareTimer = 20000;       // TODO - unknown, also possible that this is not the very correct place..
                    DoUseDoorOrButton(GO_PORT_GAUNTLET);
                }

                uint32 uiCount = m_sAbomnationGUID.size();
                for (GuidSet::iterator itr = m_sAbomnationGUID.begin(); itr != m_sAbomnationGUID.end();)
                {
                    if (Creature* pAbom = instance->GetCreature(*itr))
                    {
                        ++itr;
                        if (!pAbom->IsAlive())
                        {
                            --uiCount;
                        }
                    }
                    else
                    {
                        // Remove obsolete guid from set and decrement count
                        m_sAbomnationGUID.erase(itr++);
                        --uiCount;
                    }
                }

                if (!uiCount)
                {
                    // Old Comment: a bit itchy, it should close GO_ZIGGURAT_DOOR_4 door after 10 secs, but it doesn't. skipping it for now.
                    // However looks like that this door is no more closed
                    DoUseDoorOrButton(GO_ZIGGURAT_DOOR_4);

                    // No more handlng of Abomnations
                    m_uiSlaugtherSquareTimer = 0;

                    if (Creature* pBaron = GetSingleCreatureFromStorage(NPC_BARON))
                    {
                        DoScriptText(SAY_ANNOUNCE_RAMSTEIN, pBaron);
                        if (Creature* pRamstein = pBaron->SummonCreature(NPC_RAMSTEIN, aStratholmeLocation[2].m_fX, aStratholmeLocation[2].m_fY, aStratholmeLocation[2].m_fZ, aStratholmeLocation[2].m_fO, TEMPSUMMON_DEAD_DESPAWN, 0))
                        {
                            pRamstein->GetMotionMaster()->MovePoint(0, aStratholmeLocation[3].m_fX, aStratholmeLocation[3].m_fY, aStratholmeLocation[3].m_fZ);
                        }

                        debug_log("SD2: Instance Stratholme - Slaugther event: Ramstein spawned.");
                    }
                }
                else
                {
                    debug_log("SD2: Instance Stratholme - Slaugther event: %u Abomnation left to kill.", uiCount);
                }
            }
            // After fail aggroing Ramstein means wipe on Ramstein, so close door again
            if (uiData == IN_PROGRESS && m_auiEncounter[uiType] == FAIL)
            {
                DoUseDoorOrButton(GO_PORT_GAUNTLET);
            }
//.........这里部分代码省略.........
开发者ID:0jpq0,项目名称:server,代码行数:101,代码来源:instance_stratholme.cpp

示例2: SetData

VectorBuffer::VectorBuffer(const PODVector<unsigned char>& data)
{
    SetData(data);
}
开发者ID:unixjet,项目名称:ktblaze,代码行数:4,代码来源:VectorBuffer.cpp

示例3: CCryTBBitmap

tb::TBBitmap* CCryTBRenderer::CreateBitmap(int width, int height, tb::uint32* data)
{
	auto pBM = new CCryTBBitmap(width, height);
	pBM->SetData(data);
	return pBM;
}
开发者ID:omggomb,项目名称:Plugin_TurboBadgerUI,代码行数:6,代码来源:CryTBRenderer.cpp

示例4: OnCreatureDeath

    void OnCreatureDeath(Creature* pCreature)
    {
        switch (pCreature->GetEntry())
        {
            case NPC_GREYMIST_COASTRUNNNER:
                if (pCreature->IsTemporarySummon())         // Only count the ones summoned for Murkdeep quest
                {
                    ++m_uiMurkdeepAdds_KilledAddCount;

                    // If all 3 coastrunners are killed, summon 2 warriors
                    if (m_uiMurkdeepAdds_KilledAddCount == 3)
                    {
                        float fX, fY, fZ;
                        for (uint8 i = 0; i < 2; ++i)
                        {
                            pCreature->GetRandomPoint(aSpawnLocations[POS_IDX_MURKDEEP_SPAWN][0], aSpawnLocations[POS_IDX_MURKDEEP_SPAWN][1], aSpawnLocations[POS_IDX_MURKDEEP_SPAWN][2], 5.0f, fX, fY, fZ);

                            if (Creature* pTemp = pCreature->SummonCreature(NPC_GREYMIST_WARRIOR, fX, fY, fZ, aSpawnLocations[POS_IDX_MURKDEEP_SPAWN][3], TEMPSPAWN_DEAD_DESPAWN, 0))
                            {
                                pTemp->SetWalk(false);
                                pTemp->GetRandomPoint(aSpawnLocations[POS_IDX_MURKDEEP_MOVE][0], aSpawnLocations[POS_IDX_MURKDEEP_MOVE][1], aSpawnLocations[POS_IDX_MURKDEEP_MOVE][2], 5.0f, fX, fY, fZ);
                                pTemp->GetMotionMaster()->MovePoint(0, fX, fY, fZ);
                            }
                        }

                        m_uiMurkdeepAdds_KilledAddCount = 0;
                    }
                }
                break;
            case NPC_GREYMIST_WARRIOR:
                if (pCreature->IsTemporarySummon())         // Only count the ones summoned for Murkdeep quest
                {
                    ++m_uiMurkdeepAdds_KilledAddCount;

                    // After the 2 warriors are killed, Murkdeep spawns, along with a hunter
                    if (m_uiMurkdeepAdds_KilledAddCount == 2)
                    {
                        float fX, fY, fZ;
                        for (uint8 i = 0; i < 2; ++i)
                        {
                            pCreature->GetRandomPoint(aSpawnLocations[POS_IDX_MURKDEEP_SPAWN][0], aSpawnLocations[POS_IDX_MURKDEEP_SPAWN][1], aSpawnLocations[POS_IDX_MURKDEEP_SPAWN][2], 5.0f, fX, fY, fZ);

                            if (Creature* pTemp = pCreature->SummonCreature(!i ? NPC_MURKDEEP : NPC_GREYMIST_HUNTER, fX, fY, fZ, aSpawnLocations[POS_IDX_MURKDEEP_SPAWN][3], TEMPSPAWN_DEAD_DESPAWN, 0))
                            {
                                pTemp->SetWalk(false);
                                pTemp->GetRandomPoint(aSpawnLocations[POS_IDX_MURKDEEP_MOVE][0], aSpawnLocations[POS_IDX_MURKDEEP_MOVE][1], aSpawnLocations[POS_IDX_MURKDEEP_MOVE][2], 5.0f, fX, fY, fZ);
                                pTemp->GetMotionMaster()->MovePoint(0, fX, fY, fZ);
                            }
                        }

                        m_uiMurkdeepAdds_KilledAddCount = 0;
                    }
                }
                break;
            case NPC_OMEN:
                SetData(TYPE_OMEN, DONE);
                break;
            case NPC_THE_WINDREAVER:
                DoDespawnElementalRifts(ELEMENTAL_AIR);
                break;
            case NPC_PRINCESS_TEMPESTRIA:
                DoDespawnElementalRifts(ELEMENTAL_WATER);
                break;
            case NPC_BARON_CHARR:
                DoDespawnElementalRifts(ELEMENTAL_FIRE);
                break;
            case NPC_AVALANCHION:
                DoDespawnElementalRifts(ELEMENTAL_EARTH);
                break;
        }
    }
开发者ID:Phatcat,项目名称:mangos-wotlk,代码行数:71,代码来源:world_map_scripts.cpp

示例5: switch

void instance_blackwing_lair::Update(uint32 uiDiff)
{
    // Scepter of the Shifting Sand epic quest line
    if (m_uiScepterEpicTimer)
    {
        if (m_uiScepterEpicTimer <= uiDiff)
        {
            switch (m_uiScepterQuestStep)
            {
                case 0:     // On quest acceptance
                    DoOrSimulateScriptTextForThisInstance(YELL_REDSHARD_TAUNT_1, NPC_LORD_VICTOR_NEFARIUS);
                    m_uiScepterEpicTimer = 2 * HOUR * IN_MILLISECONDS;
                    break;
                case 1:     // 2 hours time mark
                    switch (urand(0, 1))
                    {
                        case 0:
                            DoOrSimulateScriptTextForThisInstance(YELL_REDSHARD_TAUNT_2, NPC_LORD_VICTOR_NEFARIUS);
                            DoOrSimulateScriptTextForThisInstance(EMOTE_REDSHARD_TAUNT_1, NPC_LORD_VICTOR_NEFARIUS);
                            break;
                        case 1:
                            DoOrSimulateScriptTextForThisInstance(YELL_REDSHARD_TAUNT_3, NPC_LORD_VICTOR_NEFARIUS);
                            break;
                    }
                    m_uiScepterEpicTimer = 2 * HOUR * IN_MILLISECONDS;
                    break;
                case 2:     // 1 hour left
                    switch (urand(0, 1))
                    {
                        case 0:
                            DoOrSimulateScriptTextForThisInstance(YELL_REDSHARD_TAUNT_4, NPC_LORD_VICTOR_NEFARIUS);
                            break;
                        case 1:
                            DoOrSimulateScriptTextForThisInstance(YELL_REDSHARD_TAUNT_5, NPC_LORD_VICTOR_NEFARIUS);
                            break;
                    }
                    m_uiScepterEpicTimer = 30 * MINUTE * IN_MILLISECONDS;
                    break;
                case 3:     // 30 min left
                    DoOrSimulateScriptTextForThisInstance(YELL_REDSHARD_TAUNT_6, NPC_LORD_VICTOR_NEFARIUS);
                    m_uiScepterEpicTimer = 30 * MINUTE * IN_MILLISECONDS;
                    break;
                case 4:     // Failure
                    SetData(TYPE_QUEST_SCEPTER, FAIL);
                    if (GetData(TYPE_NEFARIAN) == NOT_STARTED)
                    {
                        DoOrSimulateScriptTextForThisInstance(EMOTE_REDSHARD_TAUNT_2, NPC_LORD_VICTOR_NEFARIUS);
                        DoOrSimulateScriptTextForThisInstance(YELL_REDSHARD_TAUNT_7, NPC_LORD_VICTOR_NEFARIUS);
                    }
                default:    // Something weird happened: stop timer and fail the event
                    m_uiScepterEpicTimer = 0;
                    SetData(TYPE_QUEST_SCEPTER, FAIL);
                    break;
            }
            m_uiScepterQuestStep++;
        }
        else
            m_uiScepterEpicTimer -= uiDiff;
    }

    // Reset Razorgore in case of wipe
    if (m_uiResetTimer)
    {
        if (m_uiResetTimer <= uiDiff)
        {
            // Respawn Razorgore
            if (Creature* pRazorgore = GetSingleCreatureFromStorage(NPC_RAZORGORE))
            {
                if (!pRazorgore->isAlive())
                    pRazorgore->Respawn();
            }

            // Respawn the Dragon Eggs
            for (GuidList::const_iterator itr = m_lDragonEggsGuids.begin(); itr != m_lDragonEggsGuids.end(); ++itr)
            {
                if (GameObject* pEgg = instance->GetGameObject(*itr))
                {
                    if (!pEgg->isSpawned())
                        pEgg->Respawn();
                }
            }

            m_uiResetTimer = 0;
        }
        else
            m_uiResetTimer -= uiDiff;
    }

    if (GetData(TYPE_RAZORGORE) != IN_PROGRESS)
        return;

    if (m_uiDefenseTimer < uiDiff)
    {
        // Randomize generators
        std::random_shuffle(m_vGeneratorGuids.begin(), m_vGeneratorGuids.end());

        // Spawn the defenders
        for (uint8 i = 0; i < MAX_EGGS_DEFENDERS; ++i)
        {
            Creature* pGenerator = instance->GetCreature(m_vGeneratorGuids[i]);
//.........这里部分代码省略.........
开发者ID:krullgor,项目名称:mangos-wotlk,代码行数:101,代码来源:instance_blackwing_lair.cpp

示例6: TombOfSevenStart

 void TombOfSevenStart()
 {
     HandleGameObject(GoTombExitGUID, false);//event started, close exit door
     HandleGameObject(GoTombEnterGUID, false);//event started, close entrance door
     SetData(TYPE_TOMB_OF_SEVEN, IN_PROGRESS);
 }
开发者ID:Albis,项目名称:TrinityCore,代码行数:6,代码来源:instance_blackrock_depths.cpp

示例7: SetData

void instance_blackrock_depths::OnCreatureEnterCombat(Creature* pCreature)
{
    if (pCreature->GetEntry() == NPC_MAGMUS)
        SetData(TYPE_IRON_HALL, IN_PROGRESS);
}
开发者ID:Exxenoz,项目名称:scriptdev2,代码行数:5,代码来源:instance_blackrock_depths.cpp

示例8: SpawnGameObject

void BattlefieldWG::OnBattleStart()
{
    // Spawn titan relic
    m_titansRelic = SpawnGameObject(GO_WINTERGRASP_TITAN_S_RELIC, 5440.0f, 2840.8f, 430.43f, 0);
    if (m_titansRelic)
    {
        // Update faction of relic, only attacker can click on
        m_titansRelic->SetUInt32Value(GAMEOBJECT_FACTION, WintergraspFaction[GetAttackerTeam()]);
        // Set in use (not allow to click on before last door is broken)
        m_titansRelic->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
    }
    else
        sLog->outError(LOG_FILTER_BATTLEFIELD, "WG: Failed to spawn titan relic.");


    // Update tower visibility and update faction
    for (GuidSet::const_iterator itr = CanonList.begin(); itr != CanonList.end(); ++itr)
    {
        if (Unit* unit = sObjectAccessor->FindUnit(*itr))
        {
            if (Creature* creature = unit->ToCreature())
            {
                ShowNpc(creature, true);
                creature->setFaction(WintergraspFaction[GetDefenderTeam()]);
            }
        }
    }

    // Rebuild all wall
    for (GameObjectBuilding::const_iterator itr = BuildingsInZone.begin(); itr != BuildingsInZone.end(); ++itr)
    {
        if (*itr)
        {
            (*itr)->Rebuild();
            (*itr)->UpdateTurretAttack(false);
        }
    }

    SetData(BATTLEFIELD_WG_DATA_BROKEN_TOWER_ATT, 0);
    SetData(BATTLEFIELD_WG_DATA_BROKEN_TOWER_DEF, 0);
    SetData(BATTLEFIELD_WG_DATA_DAMAGED_TOWER_ATT, 0);
    SetData(BATTLEFIELD_WG_DATA_DAMAGED_TOWER_DEF, 0);

    // Update graveyard (in no war time all graveyard is to deffender, in war time, depend of base)
    for (Workshop::const_iterator itr = WorkshopsList.begin(); itr != WorkshopsList.end(); ++itr)
        if (*itr)
            (*itr)->UpdateGraveyardAndWorkshop();

    for (uint8 team = 0; team < 2; ++team)
        for (GuidSet::const_iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr)
        {
            // Kick player in orb room, TODO: offline player ?
            if (Player* player = sObjectAccessor->FindPlayer(*itr))
            {
                float x, y, z;
                player->GetPosition(x, y, z);
                if (5500 > x && x > 5392 && y < 2880 && y > 2800 && z < 480)
                    player->TeleportTo(571, 5349.8686f, 2838.481f, 409.240f, 0.046328f);
                SendInitWorldStatesTo(player);
            }
        }
    // Initialize vehicle counter
    UpdateCounterVehicle(true);
    // Send start warning to all players
    SendWarningToAllInZone(BATTLEFIELD_WG_TEXT_START);
}
开发者ID:3DViking,项目名称:MistCore,代码行数:66,代码来源:BattlefieldWG.cpp

示例9: SetData

CharArrayHolder::CharArrayHolder(std::string data)
{
	SetData(data);
}
开发者ID:RoastedBard,项目名称:FulcrumSoftware-Test-Task,代码行数:4,代码来源:CharArrayHolder.cpp

示例10: switch

void instance_blackrock_depths::SetData(uint32 uiType, uint32 uiData)
{
    switch (uiType)
    {
        case TYPE_RING_OF_LAW:
            // If finished the arena event after theldren fight
            if (uiData == DONE && m_auiEncounter[0] == SPECIAL)
                DoRespawnGameObject(GO_ARENA_SPOILS, HOUR);
            else if (uiData == DONE)
            {
                for (GuidSet::const_iterator itr = m_sArenaCrowdNpcGuids.begin(); itr != m_sArenaCrowdNpcGuids.end(); ++itr)
                {
                    if (Creature* pSpectator = instance->GetCreature(*itr))
                        pSpectator->SetFactionTemporary(FACTION_ARENA_NEUTRAL, TEMPFACTION_RESTORE_RESPAWN);
                }
            }
            m_auiEncounter[0] = uiData;
            break;
        case TYPE_VAULT:
            if (uiData == SPECIAL)
            {
                ++m_uiCofferDoorsOpened;

                if (m_uiCofferDoorsOpened == MAX_RELIC_DOORS)
                {
                    SetData(TYPE_VAULT, IN_PROGRESS);

                    Creature* pConstruct = NULL;

                    // Activate vault constructs
                    for (GuidSet::const_iterator itr = m_sVaultNpcGuids.begin(); itr != m_sVaultNpcGuids.end(); ++itr)
                    {
                        pConstruct = instance->GetCreature(*itr);
                        if (pConstruct)
                            pConstruct->RemoveAurasDueToSpell(SPELL_STONED);
                    }

                    if (!pConstruct)
                        return;

                    // Summon doomgrip
                    pConstruct->SummonCreature(NPC_WATCHER_DOOMGRIP, aVaultPositions[0], aVaultPositions[1], aVaultPositions[2], aVaultPositions[3], TEMPSUMMON_DEAD_DESPAWN, 0);
                }
                // No need to store in this case
                return;
            }
            if (uiData == DONE)
            {
                DoUseDoorOrButton(GO_SECRET_DOOR);
                DoToggleGameObjectFlags(GO_SECRET_SAFE, GO_FLAG_NO_INTERACT, false);
            }
            m_auiEncounter[1] = uiData;
            break;
        case TYPE_BAR:
            if (uiData == SPECIAL)
                ++m_uiBarAleCount;
            else
                m_auiEncounter[2] = uiData;
            break;
        case TYPE_TOMB_OF_SEVEN:
            // Don't set the same data twice
            if (uiData == m_auiEncounter[3])
                break;
            // Combat door
            DoUseDoorOrButton(GO_TOMB_ENTER);
            // Start the event
            if (uiData == IN_PROGRESS)
                DoCallNextDwarf();
            if (uiData == FAIL)
            {
                // Reset dwarfes
                for (uint8 i = 0; i < MAX_DWARFS; ++i)
                {
                    if (Creature* pDwarf = GetSingleCreatureFromStorage(aTombDwarfes[i]))
                    {
                        if (!pDwarf->isAlive())
                            pDwarf->Respawn();
                    }
                }

                m_uiDwarfRound = 0;
                m_uiDwarfFightTimer = 0;
            }
            if (uiData == DONE)
            {
                DoRespawnGameObject(GO_CHEST_SEVEN, HOUR);
                DoUseDoorOrButton(GO_TOMB_EXIT);
            }
            m_auiEncounter[3] = uiData;
            break;
        case TYPE_LYCEUM:
            if (uiData == DONE)
            {
                DoUseDoorOrButton(GO_GOLEM_ROOM_N);
                DoUseDoorOrButton(GO_GOLEM_ROOM_S);
            }
            m_auiEncounter[4] = uiData;
            break;
        case TYPE_IRON_HALL:
            switch (uiData)
//.........这里部分代码省略.........
开发者ID:Exxenoz,项目名称:scriptdev2,代码行数:101,代码来源:instance_blackrock_depths.cpp

示例11: Update

 virtual void Update(uint32 diff)
 {
     switch (PyramidPhase)
     {
         case PYRAMID_NOT_STARTED:
         case PYRAMID_KILLED_ALL_TROLLS:
             break;
         case PYRAMID_ARRIVED_AT_STAIR:
             SpawnPyramidWave(1);
             SetData(EVENT_PYRAMID, PYRAMID_WAVE_1);
             major_wave_Timer = 120000;
             minor_wave_Timer = 0;
             addGroupSize = 2;
             break;
         case PYRAMID_WAVE_1:
             if (IsWaveAllDead())
             {
                 SetData(EVENT_PYRAMID, PYRAMID_PRE_WAVE_2);
                 major_wave_Timer = 10000; //give players a few seconds before wave 2 starts to rebuff
             }
             else if (minor_wave_Timer < diff)
             {
                 SendAddsUpStairs(addGroupSize++);
                 minor_wave_Timer = 10000;
             }
             else
                 minor_wave_Timer -= diff;
             break;
         case PYRAMID_PRE_WAVE_2:
             if (major_wave_Timer < diff)
             {
                 // beginning 2nd wave!
                 SpawnPyramidWave(2);
                 SetData(EVENT_PYRAMID, PYRAMID_WAVE_2);
                 minor_wave_Timer = 0;
                 addGroupSize = 2;
             }
             else
                 major_wave_Timer -= diff;
             break;
         case PYRAMID_WAVE_2:
             if (IsWaveAllDead())
             {
                 SpawnPyramidWave(3);
                 SetData(EVENT_PYRAMID, PYRAMID_PRE_WAVE_3);
                 major_wave_Timer = 5000; //give NPCs time to return to their home spots
             }
             else if (minor_wave_Timer < diff)
             {
                 SendAddsUpStairs(addGroupSize++);
                 minor_wave_Timer = 10000;
             }
             else
                 minor_wave_Timer -= diff;
             break;
         case PYRAMID_PRE_WAVE_3:
             if (major_wave_Timer < diff)
             {
                 // move NPCs to bottom of stair
                 MoveNPCIfAlive(ENTRY_BLY, 1887.92f, 1228.179f, 9.98f, 4.78f);
                 MoveNPCIfAlive(ENTRY_MURTA, 1891.57f, 1228.68f, 9.69f, 4.78f);
                 MoveNPCIfAlive(ENTRY_ORO, 1897.23f, 1228.34f, 9.43f, 4.78f);
                 MoveNPCIfAlive(ENTRY_RAVEN, 1883.68f, 1227.95f, 9.543f, 4.78f);
                 MoveNPCIfAlive(ENTRY_WEEGLI, 1878.02f, 1227.65f, 9.485f, 4.78f);
                 SetData(EVENT_PYRAMID, PYRAMID_WAVE_3);
             }
             else
                 major_wave_Timer -= diff;
             break;
         case PYRAMID_WAVE_3:
             if (IsWaveAllDead()) // move NPCS to their final positions
             {
                 SetData(EVENT_PYRAMID, PYRAMID_KILLED_ALL_TROLLS);
                 MoveNPCIfAlive(ENTRY_BLY, 1883.82f, 1200.83f, 8.87f, 1.32f);
                 MoveNPCIfAlive(ENTRY_MURTA, 1891.83f, 1201.45f, 8.87f, 1.32f);
                 MoveNPCIfAlive(ENTRY_ORO, 1894.50f, 1204.40f, 8.87f, 1.32f);
                 MoveNPCIfAlive(ENTRY_RAVEN, 1874.11f, 1206.17f, 8.87f, 1.32f);
                 MoveNPCIfAlive(ENTRY_WEEGLI, 1877.52f, 1199.63f, 8.87f, 1.32f);
             }
             break;
     };
 }
开发者ID:Maduse,项目名称:server,代码行数:82,代码来源:instance_zulfarrak.cpp

示例12: GetSingleCreatureFromStorage

void instance_stratholme::Update(uint32 uiDiff)
{
    if (m_uiBarthilasRunTimer)
    {
        if (m_uiBarthilasRunTimer <= uiDiff)
        {
            Creature* pBarthilas = GetSingleCreatureFromStorage(NPC_BARTHILAS);
            if (pBarthilas && pBarthilas->IsAlive() && !pBarthilas->IsInCombat())
            {
                pBarthilas->NearTeleportTo(aStratholmeLocation[1].m_fX, aStratholmeLocation[1].m_fY, aStratholmeLocation[1].m_fZ, aStratholmeLocation[1].m_fO);
            }

            SetData(TYPE_BARTHILAS_RUN, DONE);
            m_uiBarthilasRunTimer = 0;
        }
        else
        {
            m_uiBarthilasRunTimer -= uiDiff;
        }
    }

    if (m_uiBaronRunTimer)
    {
        if (m_uiYellCounter == 0 && m_uiBaronRunTimer <= 10 * MINUTE * IN_MILLISECONDS)
        {
            DoOrSimulateScriptTextForThisInstance(SAY_ANNOUNCE_RUN_10_MIN, NPC_BARON);
            ++m_uiYellCounter;
        }
        else if (m_uiYellCounter == 1 && m_uiBaronRunTimer <= 5 * MINUTE * IN_MILLISECONDS)
        {
            DoOrSimulateScriptTextForThisInstance(SAY_ANNOUNCE_RUN_5_MIN, NPC_BARON);
            ++m_uiYellCounter;
        }

        if (m_uiBaronRunTimer <= uiDiff)
        {
            SetData(TYPE_BARON_RUN, FAIL);

            DoOrSimulateScriptTextForThisInstance(SAY_ANNOUNCE_RUN_FAIL, NPC_BARON);

            m_uiBaronRunTimer = 0;
            debug_log("SD2: Instance Stratholme: Baron run event reached end. Event has state %u.", GetData(TYPE_BARON_RUN));
        }
        else
        {
            m_uiBaronRunTimer -= uiDiff;
        }
    }

    if (m_uiMindlessSummonTimer)
    {
        if (m_uiMindlessCount < 30)
        {
            if (m_uiMindlessSummonTimer <= uiDiff)
            {
                if (Creature* pBaron = GetSingleCreatureFromStorage(NPC_BARON))
                {
                    // Summon mindless skeletons and move them to random point in the center of the square
                    if (Creature* pTemp = pBaron->SummonCreature(NPC_MINDLESS_UNDEAD, aStratholmeLocation[4].m_fX, aStratholmeLocation[4].m_fY, aStratholmeLocation[4].m_fZ, aStratholmeLocation[4].m_fO, TEMPSUMMON_DEAD_DESPAWN, 0))
                    {
                        float fX, fY, fZ;
                        pBaron->GetRandomPoint(aStratholmeLocation[5].m_fX, aStratholmeLocation[5].m_fY, aStratholmeLocation[5].m_fZ, 20.0f, fX, fY, fZ);
                        pTemp->GetMotionMaster()->MovePoint(0, fX, fY, fZ);
                        m_luiUndeadGUIDs.push_back(pTemp->GetObjectGuid());
                        ++m_uiMindlessCount;
                    }
                }
                m_uiMindlessSummonTimer = 400;
            }
            else
            {
                m_uiMindlessSummonTimer -= uiDiff;
            }
        }
        else
        {
            m_uiMindlessSummonTimer = 0;
        }
    }

    if (m_uiSlaugtherSquareTimer)
    {
        if (m_uiSlaugtherSquareTimer <= uiDiff)
        {
            // Call next Abomnations
            for (GuidSet::const_iterator itr = m_sAbomnationGUID.begin(); itr != m_sAbomnationGUID.end(); ++itr)
            {
                Creature* pAbom = instance->GetCreature(*itr);
                // Skip killed and already walking Abomnations
                if (!pAbom || !pAbom->IsAlive() || pAbom->GetMotionMaster()->GetCurrentMovementGeneratorType() == POINT_MOTION_TYPE)
                {
                    continue;
                }

                // Let Move to somewhere in the middle
                if (!pAbom->IsInCombat())
                {
                    if (GameObject* pDoor = GetSingleGameObjectFromStorage(GO_PORT_SLAUGTHER))
                    {
                        float fX, fY, fZ;
//.........这里部分代码省略.........
开发者ID:0jpq0,项目名称:server,代码行数:101,代码来源:instance_stratholme.cpp

示例13: SetData

void instance_draktharon_keep::OnCreatureEvade(Creature* pCreature)
{
    if (pCreature->GetEntry() == NPC_KING_DRED)
        SetData(TYPE_KING_DRED, FAIL);
}
开发者ID:Calixa,项目名称:murlocs_434,代码行数:5,代码来源:instance_draktharon_keep.cpp

示例14: switch

/* Keyword メッセージ処理 */
INT_PTR CPropKeyword::DispatchEvent(
	HWND	hwndDlg,	// handle to dialog box
	UINT	uMsg,		// message
	WPARAM	wParam,		// first message parameter
	LPARAM	lParam 		// second message parameter
)
{
	WORD				wNotifyCode;
	WORD				wID;
	HWND				hwndCtl;
	NMHDR*				pNMHDR;
	int					nIndex1;
	int					i;
	LV_COLUMN			lvc;
	LV_ITEM*			plvi;
	static HWND			hwndCOMBO_SET;
	static HWND			hwndLIST_KEYWORD;
	RECT				rc;
	CDlgInput1			cDlgInput1;
	wchar_t				szKeyWord[MAX_KEYWORDLEN + 1];
	LONG_PTR			lStyle;
	LV_DISPINFO*		plvdi;
	LV_KEYDOWN*			pnkd;

	switch( uMsg ){
	case WM_INITDIALOG:
		/* ダイアログデータの設定 Keyword */
		SetData( hwndDlg );
		// Modified by KEITA for WIN64 2003.9.6
		::SetWindowLongPtr( hwndDlg, DWLP_USER, lParam );
		if( wParam == IDOK ){ // 独立ウィンドウ
			hwndCtl = ::GetDlgItem( hwndDlg, IDOK );
			GetWindowRect( hwndCtl, &rc );
			i = rc.bottom; // OK,CANCELボタンの下端

			GetWindowRect( hwndDlg, &rc );
			SetWindowPos( hwndDlg, NULL, 0, 0, rc.right-rc.left, i-rc.top+10, SWP_NOZORDER|SWP_NOMOVE );
			std::tstring title = LS(STR_PROPCOMMON);
			title += _T(" - ");
			title += LS(STR_PROPCOMMON_KEYWORD);
			SetWindowText( hwndDlg, title.c_str() );

			hwndCOMBO_SET = ::GetDlgItem( hwndDlg, IDC_COMBO_SET );
			Combo_SetCurSel( hwndCOMBO_SET, m_nKeywordSet1 );
		}
		else{
			hwndCtl = ::GetDlgItem( hwndDlg, IDOK );
			ShowWindow( hwndCtl, SW_HIDE );
			hwndCtl = ::GetDlgItem( hwndDlg, IDCANCEL );
			ShowWindow( hwndCtl, SW_HIDE );
		}

		/* コントロールのハンドルを取得 */
		hwndCOMBO_SET = ::GetDlgItem( hwndDlg, IDC_COMBO_SET );
		hwndLIST_KEYWORD = ::GetDlgItem( hwndDlg, IDC_LIST_KEYWORD );
		::GetWindowRect( hwndLIST_KEYWORD, &rc );
		lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
		lvc.fmt = LVCFMT_LEFT;
		lvc.cx = rc.right - rc.left;
		lvc.pszText = const_cast<TCHAR*>(_T(""));
		lvc.iSubItem = 0;
		ListView_InsertColumn( hwndLIST_KEYWORD, 0, &lvc );

		lStyle = ::GetWindowLongPtr( hwndLIST_KEYWORD, GWL_STYLE );
		::SetWindowLongPtr( hwndLIST_KEYWORD, GWL_STYLE, lStyle | LVS_SHOWSELALWAYS );


		/* コントロール更新のタイミング用のタイマーを起動 */
		::SetTimer( hwndDlg, 1, 300, NULL );

		return TRUE;

	case WM_NOTIFY:
		pNMHDR = (NMHDR*)lParam;
		pnkd = (LV_KEYDOWN *)lParam;
		plvdi = (LV_DISPINFO*)lParam;
		plvi = &plvdi->item;

		if( hwndLIST_KEYWORD == pNMHDR->hwndFrom ){
			switch( pNMHDR->code ){
			case NM_DBLCLK:
//				MYTRACE( _T("NM_DBLCLK     \n") );
				/* リスト中で選択されているキーワードを編集する */
				Edit_List_KeyWord( hwndDlg, hwndLIST_KEYWORD );
				return TRUE;
			case LVN_BEGINLABELEDIT:
#ifdef _DEBUG
				MYTRACE( _T("LVN_BEGINLABELEDIT\n") );
												MYTRACE( _T("	plvi->mask =[%xh]\n"), plvi->mask );
												MYTRACE( _T("	plvi->iItem =[%d]\n"), plvi->iItem );
												MYTRACE( _T("	plvi->iSubItem =[%d]\n"), plvi->iSubItem );
				if (plvi->mask & LVIF_STATE)	MYTRACE( _T("	plvi->state =[%xf]\n"), plvi->state );
												MYTRACE( _T("	plvi->stateMask =[%xh]\n"), plvi->stateMask );
				if (plvi->mask & LVIF_TEXT)		MYTRACE( _T("	plvi->pszText =[%ts]\n"), plvi->pszText );
												MYTRACE( _T("	plvi->cchTextMax=[%d]\n"), plvi->cchTextMax );
				if (plvi->mask & LVIF_IMAGE)	MYTRACE( _T("	plvi->iImage=[%d]\n"), plvi->iImage );
				if (plvi->mask & LVIF_PARAM)	MYTRACE( _T("	plvi->lParam=[%xh(%d)]\n"), plvi->lParam, plvi->lParam );
#endif
				return TRUE;
//.........这里部分代码省略.........
开发者ID:lunaplus,项目名称:sakura-editor-fork,代码行数:101,代码来源:CPropComKeyword.cpp

示例15: SetData

void instance_karazhan::Update(uint32 uiDiff)
{
    if (m_uiChessResetTimer)
    {
        // respawn all chess pieces and side stalkers on the original position
        if (m_uiChessResetTimer <= uiDiff)
        {
            for (GuidList::const_iterator itr = m_lChessPiecesAlliance.begin(); itr != m_lChessPiecesAlliance.end(); ++itr)
            {
                if (Creature* pTemp = instance->GetCreature(*itr))
                    pTemp->Respawn();
            }
            for (GuidList::const_iterator itr = m_lChessPiecesHorde.begin(); itr != m_lChessPiecesHorde.end(); ++itr)
            {
                if (Creature* pTemp = instance->GetCreature(*itr))
                    pTemp->Respawn();
            }

            for (GuidList::const_iterator itr = m_lChessAllianceStalkerList.begin(); itr != m_lChessAllianceStalkerList.end(); ++itr)
            {
                if (Creature* pTemp = instance->GetCreature(*itr))
                {
                    pTemp->Respawn();
                    pTemp->HandleEmote(EMOTE_STATE_NONE);
                }
            }
            for (GuidList::const_iterator itr = m_lChessHordeStalkerList.begin(); itr != m_lChessHordeStalkerList.end(); ++itr)
            {
                if (Creature* pTemp = instance->GetCreature(*itr))
                {
                    pTemp->Respawn();
                    pTemp->HandleEmote(EMOTE_STATE_NONE);
                }
            }

            if (GetData(TYPE_CHESS) == FAIL)
                SetData(TYPE_CHESS, NOT_STARTED);
            else if (GetData(TYPE_CHESS) == DONE)
                m_bFriendlyGame = true;

            m_uiChessResetTimer = 0;
        }
        else
            m_uiChessResetTimer -= uiDiff;
    }

    if (m_uiChessEndingTimer)
    {
        if (m_uiChessEndingTimer <= uiDiff)
        {
            m_uiChessEndingTimer = 0;
        }
        else
        {
            if (m_uiChessEndingTimer == 30000) // pick first 4 spots for visual
            {
                m_uiVictoryControllerTimer = 1000;
                bool tools[8];

                for (uint32 i = 0; i < 8; ++i)
                {
                    m_uiVictoryToolTimers[i] = 0;
                    tools[i] = false;
                    m_uiVictoryTimersPhase[i] = false;
                }

                if (Creature* pController = GetSingleCreatureFromStorage(NPC_CHESS_VICTORY_CONTROLLER))
                    pController->CastSpell(pController, SPELL_VICTORY_VISUAL, TRIGGERED_OLD_TRIGGERED);

                uint8 previous = 0;
                for (uint32 i = 0; i < 4; ++i)
                {
                    int k;
                    previous = (previous + urand(0, 7)) % 8;
                    for (k = previous; tools[k % 8] && k < 16; ++k);
                    previous = k % 8;
                    tools[previous] = true;
                    m_uiVictoryToolTimers[previous] = urand(4, 6) * 500;
                }

                for (uint32 i = 0; i < 8; i++)
                {
                    if (tools[i])
                    {
                        if (Creature* tool = instance->GetCreature(m_vVictoryDummyTools[i]))
                            tool->CastSpell(tool, SPELL_BOARD_VISUAL, TRIGGERED_OLD_TRIGGERED);
                    }
                    else
                        m_uiVictoryToolTimers[i] = urand(4, 6) * 500;
                }
            }
            else
            {
                if (m_uiVictoryControllerTimer <= uiDiff) // randomized visual all over the chess board
                {
                    m_uiVictoryControllerTimer = 1000;
                    if (Creature* pController = GetSingleCreatureFromStorage(NPC_CHESS_VICTORY_CONTROLLER))
                        pController->CastSpell(pController, SPELL_VICTORY_VISUAL, TRIGGERED_NONE);
                }
                else
//.........这里部分代码省略.........
开发者ID:Phatcat,项目名称:mangos-wotlk,代码行数:101,代码来源:karazhan.cpp


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