• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ OpenDoorEvent函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: OpenDoorEvent

void BattleGroundAB::StartingEventOpenDoors()
{
    OpenDoorEvent(BG_EVENT_DOOR);

    // Players that join battleground after start are not eligible to get achievement.
    StartTimedAchievement(ACHIEVEMENT_CRITERIA_TYPE_WIN_BG, AB_EVENT_START_BATTLE);
}
开发者ID:Chuck5ta,项目名称:server-4,代码行数:7,代码来源:BattleGroundAB.cpp


示例2: OpenDoorEvent

void BattleGroundSA::StartShips()
{
    if(ShipsStarted)
        return;

    OpenDoorEvent(100);
    /*DoorOpen(BG_SA_BOAT_ONE);
    DoorOpen(BG_SA_BOAT_TWO);*/

    for(int i = BG_SA_BOAT_ONE; i <= BG_SA_BOAT_TWO; i++)
    {
        for( BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end();itr++)
        {
            if(Player* p = sObjectMgr.GetPlayer(itr->first))
            {
                if(p->GetBGTeam() != attackers)
                    continue;

                /*UpdateData data;
                WorldPacket pkt;
                GetBGObject(i)->BuildValuesUpdateBlockForPlayer(&data, p);
                data.BuildPacket(&pkt);
                p->GetSession()->SendPacket(&pkt);*/
            }
        }
    }
  
    ShipsStarted = true;
}
开发者ID:Lirok,项目名称:mangos,代码行数:29,代码来源:BattleGroundSA.cpp


示例3: OpenDoorEvent

void BattleGroundDS::Update(uint32 diff)
{
    BattleGround::Update(diff);
	if (GetStatus() == STATUS_IN_PROGRESS)
    {
        // first knockback
        if(m_uiKnockback < diff && KnockbackCheck)
        {
            //dalaran sewers = 617;
            for(BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
            {
                Player * plr = sObjectMgr.GetPlayer(itr->first);
                if (plr)
                {
                    if (plr->GetTeam() == ALLIANCE && plr->GetDistance2d(1214, 765) <= 50 && plr->GetPositionZ() > 10)
                        plr->KnockBackPlayerWithAngle(6.05f, 55, 7);
                    if (plr->GetTeam() == HORDE && plr->GetDistance2d(1369, 817) <= 50 && plr->GetPositionZ() > 10)
                        plr->KnockBackPlayerWithAngle(3.03f, 55, 7);
                }
            }
            KnockbackCheck = false;
                       
        }else m_uiKnockback -= diff;

        // just for sure if knockback wont work from any reason teleport down
        if(m_uiTeleport < diff && TeleportCheck)
        {
            //dalaran sewers = 617;
            for(BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
            {
                Player * plr = sObjectMgr.GetPlayer(itr->first);
                if (plr)
                {
                    if (plr->GetTeam() == ALLIANCE && plr->GetDistance2d(1214, 765) <= 50 && plr->GetPositionZ() > 10)
                        plr->TeleportTo(617, 1257+urand(0,2), 761+urand(0,2), 3.2f, 0.5f);
                    if (plr->GetTeam() == HORDE && plr->GetDistance2d(1369, 817) <= 50 && plr->GetPositionZ() > 10)
                        plr->TeleportTo(617, 1328+urand(0,2), 815+urand(0,2), 3.2f, 3.5f);
                }
            }
            TeleportCheck = false;
            // close the gate
            OpenDoorEvent(BG_EVENT_DOOR);
        }else m_uiTeleport -= diff;

		if (m_uiFall < diff)
		{
			for(BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
			{
				Player * plr = sObjectMgr.GetPlayer(itr->first);
                if (plr)
                {
                    if (plr->GetPositionZ() < 0.5)
                        plr->TeleportTo(617, plr->GetPositionX(), plr->GetPositionY(), plr->GetPositionZ() + 8, plr->GetOrientation());
                }
            }
		}else m_uiFall -= diff;
    }
}
开发者ID:SeTM,项目名称:mangos,代码行数:58,代码来源:BattleGroundDS.cpp


示例4: OpenDoorEvent

void BattleGroundIC::StartingEventOpenDoors()
{
    OpenDoorEvent(BG_EVENT_DOOR);                        // used for activating teleport effects + opening tower gates
    for (int i = BG_IC_GO_T_ALLIANCE_WEST; i <= BG_IC_GO_T_HORDE_FRONT; ++i)
        DoorOpen(m_BgObjects[i]);

    // make teleporters clickable
    MakeInteractive(IC_EVENT_ADD_TELEPORT, 0, true);
}
开发者ID:BACKUPLIB,项目名称:Infinity_MaNGOS,代码行数:9,代码来源:BattleGroundIC.cpp


示例5: UpdateWorldState

void BattleGroundAV::StartingEventOpenDoors()
{
    UpdateWorldState(BG_AV_SHOW_H_SCORE, WORLD_STATE_ADD);
    UpdateWorldState(BG_AV_SHOW_A_SCORE, WORLD_STATE_ADD);

    OpenDoorEvent(BG_EVENT_DOOR);
    // Players that join battleground after start are not available to get achievement.
    StartTimedAchievement(ACHIEVEMENT_CRITERIA_TYPE_WIN_BG, BG_AV_EVENT_START_BATTLE);
}
开发者ID:mangosfour,项目名称:server,代码行数:9,代码来源:BattleGroundAV.cpp


示例6: OpenDoorEvent

void BattleGroundWS::StartingEventOpenDoors()
{
    OpenDoorEvent(BG_EVENT_DOOR);

    // TODO implement timer to despawn doors after a short while

    SpawnEvent(WS_EVENT_SPIRITGUIDES_SPAWN, 0, true);
    SpawnEvent(WS_EVENT_FLAG_A, 0, true);
    SpawnEvent(WS_EVENT_FLAG_H, 0, true);
}
开发者ID:zeroR2,项目名称:mangos,代码行数:10,代码来源:BattleGroundWS.cpp


示例7: urand

void BattleGroundAB::StartingEventOpenDoors()
{
    for (uint8 i = 0; i < BG_AB_NODES_MAX; ++i)
    {
        // randomly select buff to spawn
        uint8 buff = urand(0, 2);
        SpawnBGObject(m_BgObjects[BG_AB_OBJECT_SPEEDBUFF_STABLES + buff + i * 3], RESPAWN_IMMEDIATELY);
    }
    OpenDoorEvent(BG_EVENT_DOOR);
}
开发者ID:bread-and-butter,项目名称:server,代码行数:10,代码来源:BattleGroundAB.cpp


示例8: ResetWorldStates

void BattleGroundSA::UpdatePhase()
{
    ResetWorldStates();

    if (Phase == SA_ROUND_TWO)
    {
        SpawnEvent(SA_EVENT_ADD_VECH_E, 0, false);
        SpawnEvent(SA_EVENT_ADD_VECH_W, 0, false);
        SpawnEvent(SA_EVENT_ADD_BOMB, 0, false);
        SpawnEvent(SA_EVENT_ADD_BOMB, 1, false);
        SpawnEvent(SA_EVENT_ADD_NPC, 0, false);
        OpenDoorEvent(SA_EVENT_OP_DOOR, 0);
        SpawnEvent(SA_EVENT_ADD_BOMB, 0, true);
    }

    _GydOccupied(3,GetDefender());

    if(Phase == SA_ROUND_ONE)
    {
        SpawnEvent(SA_EVENT_ADD_SPIR, BG_SA_GARVE_STATUS_HORDE_OCCUPIED, false);
        SpawnEvent(SA_EVENT_ADD_SPIR, BG_SA_GARVE_STATUS_ALLY_OCCUPIED, true);

        m_ActiveEvents[5] = GetDefender() == ALLIANCE ? BG_SA_GARVE_STATUS_ALLY_OCCUPIED : BG_SA_GARVE_STATUS_HORDE_OCCUPIED;

        for (uint8 i = 0; i < BG_SA_GRY_MAX; ++i)
        {
            for (uint8 z = 1; z < 5; ++z)
                SpawnEvent(i, z, false);

            m_prevGyd[i] = 0;
            m_GydTimers[i] = 0;
            m_BannerTimers[i].timer = 0;
            SpawnEvent(i, 3, true); 
            m_Gyd[i] = GetDefender() == ALLIANCE ? BG_SA_GARVE_STATUS_ALLY_OCCUPIED : BG_SA_GARVE_STATUS_HORDE_OCCUPIED;
            m_ActiveEvents[i] = GetDefender() == ALLIANCE ? BG_SA_GARVE_STATUS_ALLY_OCCUPIED : BG_SA_GARVE_STATUS_HORDE_OCCUPIED;
            _GydOccupied(i,GetDefender());
        }

        SpawnEvent(SA_EVENT_ADD_BOMB, 1, true);
        //SpawnEvent(SA_EVENT_ADD_NPC, 0, true);
    }
    // We already do it at ResetWorldStates
    /*for (uint32 z = 0; z <= BG_SA_GATE_MAX; ++z)
        UpdateWorldState(BG_SA_GateStatus[z], GateStatus[z]);*/

    if (Phase == SA_ROUND_TWO)
    {
        Round_timer = 0;
        SetStatus(STATUS_WAIT_JOIN);
        SendMessageToAll(LANG_BG_SA_START_TWO_MINUTE, CHAT_MSG_BG_SYSTEM_NEUTRAL, NULL);
    }

    SpawnEvent(SA_EVENT_ADD_GO, 0, false);
    SpawnEvent(SA_EVENT_ADD_GO, 0, true);
}
开发者ID:xXNembiXx,项目名称:mangos_335,代码行数:55,代码来源:BattleGroundSA.cpp


示例9: urand

void BattleGroundAB::StartingEventOpenDoors()
{
    for (int i = 0; i < BG_AB_NODES_MAX; ++i)
    {
        //randomly select buff to spawn
        uint8 buff = urand(0, 2);
        SpawnBGObject(m_BgObjects[BG_AB_OBJECT_SPEEDBUFF_STABLES + buff + i * 3], RESPAWN_IMMEDIATELY);
    }
    OpenDoorEvent(BG_EVENT_DOOR);

    // Players that join battleground after start are not eligible to get achievement.
    StartTimedAchievement(ACHIEVEMENT_CRITERIA_TYPE_WIN_BG, BG_AB_EVENT_START_BATTLE);
}
开发者ID:AlexDereka,项目名称:mangos,代码行数:13,代码来源:BattleGroundAB.cpp


示例10: GetTeamIndex

void BattleGroundIC::EventPlayerDamageGO(Player *player, GameObject* target_obj, uint32 eventId, uint32 doneBy)
{
    TeamIndex teamIndex = GetTeamIndex(player->GetTeam());

    // Seaforium Charge Explosion (A-bomb-inable)
    if (doneBy == 66676)
        player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL, 68366);

    // Huge Seaforium Charge Explosion (A-bomb-ination)
    if (doneBy == 66672)
        player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL, 68367);

    uint32 type = 0;
    switch (target_obj->GetEntry())
    {
        case BG_IC_GO_ALLIANCE_GATE_1:
        {
            type = BG_IC_GO_T_ALLIANCE_GATE_1;
            if (eventId == 22082)
            {
                SendMessage2ToAll(LANG_BG_IC_A_WEST_GATE_DESTROYED, CHAT_MSG_BG_SYSTEM_ALLIANCE, player, doneBy);
                UpdateWorldState(BG_IC_GateStatus[type][0], 0);             // needed for removing the old icon
                UpdateWorldState(BG_IC_GateStatus[type][1], 1);
                GateStatus[type] = BG_IC_GO_GATES_DAMAGE;                   // correct icon is at "damage" state (not flag), not "destroy"
                RewardHonorToTeam(85, (teamIndex == 0) ? ALLIANCE:HORDE);
                SpawnEvent(IC_EVENT_ADD_A_BOSS, 0, true);
                SpawnEvent(IC_EVENT_ADD_A_GUARDS, 0, true);

                // prevent closing of the boss gates by destroying another wall gate
                if (aOpen == false)
                {
                    OpenDoorEvent(IC_EVENT_BOSS_A);
                    aOpen = true;
                }
            }
            break;
        }
        case BG_IC_GO_ALLIANCE_GATE_2:
        {
            type = BG_IC_GO_T_ALLIANCE_GATE_2;
            if (eventId == 22078)
            {
                SendMessage2ToAll(LANG_BG_IC_A_EAST_GATE_DESTROYED, CHAT_MSG_BG_SYSTEM_ALLIANCE, player, doneBy);
                UpdateWorldState(BG_IC_GateStatus[type][0], 0);
                UpdateWorldState(BG_IC_GateStatus[type][1], 1);
                GateStatus[type] = BG_IC_GO_GATES_DAMAGE;
                RewardHonorToTeam(85, (teamIndex == 0) ? ALLIANCE:HORDE);
                SpawnEvent(IC_EVENT_ADD_A_BOSS, 0, true);
                SpawnEvent(IC_EVENT_ADD_A_GUARDS, 0, true);

                if (aOpen == false)
                {
                    OpenDoorEvent(IC_EVENT_BOSS_A);
                    aOpen = true;
                }
            }
            break;
        }
        case BG_IC_GO_ALLIANCE_GATE_3:
        {
            type = BG_IC_GO_T_ALLIANCE_GATE_3;
            if (eventId == 22080)
            {
                SendMessage2ToAll(LANG_BG_IC_A_FRONT_GATE_DESTROYED, CHAT_MSG_BG_SYSTEM_ALLIANCE, player, doneBy);
                UpdateWorldState(BG_IC_GateStatus[type][0], 0);
                UpdateWorldState(BG_IC_GateStatus[type][1], 1);
                GateStatus[type] = BG_IC_GO_GATES_DAMAGE;
                RewardHonorToTeam(85, (teamIndex == 0) ? ALLIANCE:HORDE);
                SpawnEvent(IC_EVENT_ADD_A_BOSS, 0, true);
                SpawnEvent(IC_EVENT_ADD_A_GUARDS, 0, true);

                if (aOpen == false)
                {
                    OpenDoorEvent(IC_EVENT_BOSS_A);
                    aOpen = true;
                }
            }
            break;
        }
        case BG_IC_GO_HORDE_GATE_1:
        {
            type = BG_IC_GO_T_HORDE_GATE_1;
            if (eventId == 22081)
            {
                SendMessage2ToAll(LANG_BG_IC_H_WEST_GATE_DESTROYED, CHAT_MSG_BG_SYSTEM_HORDE, player, doneBy);
                UpdateWorldState(BG_IC_GateStatus[type][0], 0);
                UpdateWorldState(BG_IC_GateStatus[type][1], 1);
                GateStatus[type] = BG_IC_GO_GATES_DAMAGE;
                RewardHonorToTeam(85, (teamIndex == 0) ? ALLIANCE:HORDE);
                SpawnEvent(IC_EVENT_ADD_H_BOSS, 0, true);
                SpawnEvent(IC_EVENT_ADD_H_GUARDS, 0, true);

                if (hOpen == false)
                {
                    OpenDoorEvent(IC_EVENT_BOSS_H);
                    hOpen = true;
                }
            }
            break;
        }
//.........这里部分代码省略.........
开发者ID:BACKUPLIB,项目名称:Infinity_MaNGOS,代码行数:101,代码来源:BattleGroundIC.cpp


示例11: OpenDoorEvent

void BattleGroundRL::StartingEventOpenDoors()
{
    OpenDoorEvent(BG_EVENT_DOOR);
}
开发者ID:120239197a,项目名称:SingleCore,代码行数:4,代码来源:BattleGroundRL.cpp


示例12: ModifyStartDelayTime

void BattleGroundWS::Update(uint32 diff)
{
    BattleGround::Update(diff);

    // after bg start we get there (once)
    if (GetStatus() == STATUS_WAIT_JOIN && GetPlayersSize())
    {
        ModifyStartDelayTime(diff);

        if (!(m_Events & 0x01))
        {
            m_Events |= 0x01;

            // setup here, only when at least one player has ported to the map
            if (!SetupBattleGround())
            {
                EndNow();
                return;
            }

            SetStartDelayTime(START_DELAY0);
        }
        // After 1 minute, warning is signalled
        else if (GetStartDelayTime() <= START_DELAY1 && !(m_Events & 0x04))
        {
            m_Events |= 0x04;
            SendMessageToAll(GetMangosString(LANG_BG_WS_ONE_MINUTE));
        }
        // After 1,5 minute, warning is signalled
        else if (GetStartDelayTime() <= START_DELAY2 && !(m_Events & 0x08))
        {
            m_Events |= 0x08;
            SendMessageToAll(GetMangosString(LANG_BG_WS_HALF_MINUTE));
        }
        // After 2 minutes, gates OPEN ! x)
        else if (GetStartDelayTime() < 0 && !(m_Events & 0x10))
        {
            m_Events |= 0x10;
            // TODO implement timer to despawn doors after a short while
            OpenDoorEvent(BG_EVENT_DOOR);

            SpawnEvent(WS_EVENT_SPIRITGUIDES_SPAWN, 0, true);
            SpawnEvent(WS_EVENT_FLAG_A, 0, true);
            SpawnEvent(WS_EVENT_FLAG_H, 0, true);

            SendMessageToAll(GetMangosString(LANG_BG_WS_BEGIN));

            PlaySoundToAll(SOUND_BG_START);
            SetStatus(STATUS_IN_PROGRESS);
        }
    }
    else if (GetStatus() == STATUS_IN_PROGRESS)
    {
        if (m_FlagState[BG_TEAM_ALLIANCE] == BG_WS_FLAG_STATE_WAIT_RESPAWN)
        {
            m_FlagsTimer[BG_TEAM_ALLIANCE] -= diff;

            if (m_FlagsTimer[BG_TEAM_ALLIANCE] < 0)
            {
                m_FlagsTimer[BG_TEAM_ALLIANCE] = 0;
                RespawnFlag(ALLIANCE, true);
            }
        }
        if (m_FlagState[BG_TEAM_ALLIANCE] == BG_WS_FLAG_STATE_ON_GROUND)
        {
            m_FlagsDropTimer[BG_TEAM_ALLIANCE] -= diff;

            if (m_FlagsDropTimer[BG_TEAM_ALLIANCE] < 0)
            {
                m_FlagsDropTimer[BG_TEAM_ALLIANCE] = 0;
                RespawnFlagAfterDrop(ALLIANCE);
            }
        }
        if (m_FlagState[BG_TEAM_HORDE] == BG_WS_FLAG_STATE_WAIT_RESPAWN)
        {
            m_FlagsTimer[BG_TEAM_HORDE] -= diff;

            if (m_FlagsTimer[BG_TEAM_HORDE] < 0)
            {
                m_FlagsTimer[BG_TEAM_HORDE] = 0;
                RespawnFlag(HORDE, true);
            }
        }
        if (m_FlagState[BG_TEAM_HORDE] == BG_WS_FLAG_STATE_ON_GROUND)
        {
            m_FlagsDropTimer[BG_TEAM_HORDE] -= diff;

            if (m_FlagsDropTimer[BG_TEAM_HORDE] < 0)
            {
                m_FlagsDropTimer[BG_TEAM_HORDE] = 0;
                RespawnFlagAfterDrop(HORDE);
            }
        }
    }
}
开发者ID:magomags,项目名称:mangoszero,代码行数:95,代码来源:BattleGroundWS.cpp


示例13: StartShips


//.........这里部分代码省略.........
            if(Phase == SA_ROUND_ONE) // Timeout of second round
            {
                PlaySoundToAll(BG_SA_SOUND_GYD_VICTORY);
                SendMessageToAll(defender == ALLIANCE ? LANG_BG_SA_ALLIANCE_TIMEOUT_END_1ROUND : LANG_BG_SA_HORDE_TIMEOUT_END_1ROUND, CHAT_MSG_BG_SYSTEM_NEUTRAL, NULL);
                RoundScores[0].winner = GetDefender();
                RoundScores[0].time = Round_timer;
				ResetBattle(0, defender);
            }
            else // Timeout of second round
            {
                SendMessageToAll(defender == ALLIANCE ? LANG_BG_SA_ALLIANCE_TIMEOUT_END_2ROUND : LANG_BG_SA_HORDE_TIMEOUT_END_2ROUND, CHAT_MSG_BG_SYSTEM_NEUTRAL, NULL);
                RoundScores[1].winner = GetDefender();
                RoundScores[1].time = Round_timer;
				EndBattleGround(TEAM_NONE);
                return;
            }
        } 
        else
            Round_timer += diff;

        for (int gyd = 0; gyd < BG_SA_GRY_MAX; ++gyd)
        {
            // 3 sec delay to spawn new banner instead previous despawned one
            if (m_BannerTimers[gyd].timer)
            {
                if (m_BannerTimers[gyd].timer > diff)
                    m_BannerTimers[gyd].timer -= diff;
                else
                {
                    m_BannerTimers[gyd].timer = 0;
                    _CreateBanner(gyd, m_BannerTimers[gyd].type, m_BannerTimers[gyd].teamIndex, false);
                }
            }
            // 1-minute to occupy a node from contested state
            if (m_GydTimers[gyd])
            {
                if (m_GydTimers[gyd] > diff)
                    m_GydTimers[gyd] -= diff;
                else
                {
                    m_GydTimers[gyd] = 0;
                    // Change from contested to occupied !
                    uint8 teamIndex = m_Gyd[gyd]-1;
                    m_prevGyd[gyd] = m_Gyd[gyd];
                    m_Gyd[gyd] += 2;
                    // create new occupied banner
                    _CreateBanner(gyd, BG_SA_GARVE_TYPE_OCCUPIED, teamIndex, true);
                    //_SendNodeUpdate(node);
                    _GydOccupied(gyd,(teamIndex == 0) ? ALLIANCE:HORDE);
                    // Message to chatlog
                    RewardHonorToTeam(85, (teamIndex == 0) ? ALLIANCE:HORDE);
                    RewardXpToTeam(0, 0.6f, (teamIndex == 0) ? ALLIANCE:HORDE);
                    RewardReputationToTeam((teamIndex == 0) ? 1050:1085, 65, (teamIndex == 0) ? ALLIANCE:HORDE);
                    switch(gyd)
                    {
                        case 0: SpawnEvent(SA_EVENT_ADD_VECH_W, 0, true);break;
                        case 1: SpawnEvent(SA_EVENT_ADD_VECH_E, 0, true);break;
                    }
                    if (teamIndex == 0)
                    {
                        // SendMessage2ToAll(LANG_BG_SA_AH_SEIZES_GRAVEYARD,CHAT_MSG_BG_SYSTEM_ALLIANCE,NULL,LANG_BG_ALLY,_GydName(gyd));
                        PlaySoundToAll(BG_SA_SOUND_GYD_CAPTURED_ALLIANCE);
                        SendWarningToAllSA(gyd, STATUS_CONQUESTED, ALLIANCE);
                    }
                    else
                    {
                        // SendMessage2ToAll(LANG_BG_SA_AH_SEIZES_GRAVEYARD,CHAT_MSG_BG_SYSTEM_HORDE,NULL,LANG_BG_HORDE,_GydName(gyd));
                        PlaySoundToAll(BG_SA_SOUND_GYD_CAPTURED_HORDE);
                        SendWarningToAllSA(gyd, STATUS_CONQUESTED, HORDE);
                    }
                }
            }
        }
        UpdateTimer();
    }
    if (GetStatus() == STATUS_WAIT_JOIN && Phase == SA_ROUND_TWO) // Round two, not yet started
    {
        if (!shipsStarted)
            if (shipsTimer <= diff)
            {
                SendMessageToAll(LANG_BG_SA_START_ONE_MINUTE, CHAT_MSG_BG_SYSTEM_NEUTRAL, NULL);
                StartShips();
            }
            else
                shipsTimer -= diff;
        if (TimeST2Round < diff)
        {
            Phase = 2;
            OpenDoorEvent(SA_EVENT_OP_DOOR, 0);
			SpawnEvent(SA_EVENT_ADD_NPC, 0, true);
            ToggleTimer();
            SetStatus(STATUS_IN_PROGRESS); // Start round two
            PlaySoundToAll(SOUND_BG_START);
            SendMessageToAll(LANG_BG_SA_HAS_BEGUN, CHAT_MSG_BG_SYSTEM_NEUTRAL, NULL);
            SendWarningToAll(LANG_BG_SA_HAS_BEGUN);
        }
        else
            TimeST2Round -= diff;
    }
}
开发者ID:xXNembiXx,项目名称:mangos_335,代码行数:101,代码来源:BattleGroundSA.cpp


示例14: ModifyStartDelayTime

void BattleGroundAV::Update(uint32 diff)
{
    BattleGround::Update(diff);

    if (GetStatus() == STATUS_WAIT_JOIN && GetPlayersSize())
    {
        ModifyStartDelayTime(diff);

        if (!(m_Events & 0x01))
        {
            m_Events |= 0x01;

            if(!SetupBattleGround())
            {
                EndNow();
                return;
            }

            sLog.outDebug("Alterac Valley: entering state STATUS_WAIT_JOIN ...");
            SetStartDelayTime(START_DELAY0);
        }
        // After 1 minute, warning is signalled
        else if (GetStartDelayTime() <= START_DELAY1 && !(m_Events & 0x04))
        {
            m_Events |= 0x04;
            SendMessageToAll(GetMangosString(LANG_BG_AV_START_ONE_MINUTE));
        }
        // After 1,5 minute, warning is signalled
        else if (GetStartDelayTime() <= START_DELAY2 && !(m_Events & 0x08))
        {
            m_Events |= 0x08;
            SendMessageToAll(GetMangosString(LANG_BG_AV_START_HALF_MINUTE));
        }
        // After 2 minutes, gates OPEN ! x)
        else if (GetStartDelayTime() <= 0 && !(m_Events & 0x10))
        {
            UpdateWorldState(BG_AV_SHOW_H_SCORE, 1);
            UpdateWorldState(BG_AV_SHOW_A_SCORE, 1);

            m_Events |= 0x10;

            SendMessageToAll(GetMangosString(LANG_BG_AV_HAS_BEGUN));
            PlaySoundToAll(SOUND_BG_START);
            SetStatus(STATUS_IN_PROGRESS);

            OpenDoorEvent(BG_EVENT_DOOR);

            for(BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
                if(Player* plr = sObjectMgr.GetPlayer(itr->first))
                    plr->RemoveAurasDueToSpell(SPELL_PREPARATION);
        }
    }


    if (GetStatus() != STATUS_IN_PROGRESS)
        return;

    // add points from mine owning, and look if the neutral team can reclaim the mine
    for(uint8 mine = 0; mine < BG_AV_MAX_MINES; mine++)
    {
        if (m_Mine_Owner[mine] == BG_TEAM_ALLIANCE || m_Mine_Owner[mine] == BG_TEAM_HORDE)
        {
            m_Mine_Timer[mine] -=diff;
            if (m_Mine_Timer[mine] <= 0)
            {
                UpdateScore(BattleGroundTeamId(m_Mine_Owner[mine]), 1);
                m_Mine_Timer[mine] = BG_AV_MINE_TICK_TIMER;
            }

            if (m_Mine_Reclaim_Timer[mine] > diff)
                m_Mine_Reclaim_Timer[mine] -= diff;
            else
                ChangeMineOwner(mine, BG_AV_NEUTRAL_TEAM);
        }
    }

    // looks for all timers of the nodes and destroy the building (for graveyards the building wont get destroyed, it goes just to the other team
    for(BG_AV_Nodes i = BG_AV_NODES_FIRSTAID_STATION; i < BG_AV_NODES_MAX; ++i)
    {
        if (m_Nodes[i].State == POINT_ASSAULTED)
        {
            if (m_Nodes[i].Timer > diff)
                m_Nodes[i].Timer -= diff;
            else
                 EventPlayerDestroyedPoint(i);
        }
    }
}
开发者ID:Corenex,项目名称:mangoszero,代码行数:88,代码来源:BattleGroundAV.cpp


示例15: urand

void BattleGroundDS::Update(uint32 diff)
{
    BattleGround::Update(diff);
    if (GetStatus() == STATUS_IN_PROGRESS)
    {
        // push people from the tubes
        if (pushbackCheck)
        {
            // knockback
            if (m_uiKnockback < diff)
            {
                for (BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
                {
                    Player *plr = sObjectMgr.GetPlayer(itr->first);
                    if (!plr)
                        continue;

                    if (GameObject* obj = plr->GetGameObject(48018))                         // Remove Demonic Circle
                        obj->Delete();

                    if (plr->GetPositionZ() < 11.0f)
                        continue;

                    float angle = (plr->GetBGTeam() == ALLIANCE /*gold*/) ? plr->GetAngle(1259.58f, 764.43f) : plr->GetAngle(1325.84f, 817.304f);

                    plr->KnockBackPlayerWithAngle(angle, 45, 7);

                    if (plr->IsWithinDist2d(1214, 765, 50) && plr->IsWithinLOS(1214, 765, 14))
                        plr->KnockBackPlayerWithAngle(6.40f,55,7);

                    if (plr->IsWithinDist2d(1369, 817, 50) && plr->IsWithinLOS(1369, 817, 14))
                        plr->KnockBackPlayerWithAngle(3.03f,55,7);
                }
                pushbackCheck = false;
                m_uiKnockback = 1000;
            }
            else
                m_uiKnockback -= diff;
        }

        // in case pushback failed
        if (teleportCheck)
        {
            if (m_uiTeleport < diff)
            {
                for (BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
                {
                    if (Player *plr = sObjectMgr.GetPlayer(itr->first))
                    {
                        if (plr->GetPositionZ() < 11.0f)
                            continue;

                        float x, y;
                        if (plr->GetBGTeam() == ALLIANCE)
                        {
                            x = 1259.58f;
                            y = 764.43f;
                        }
                        else
                        {
                            x = 1325.84f;
                            y = 817.304f;
                        }
                        plr->TeleportTo(GetMapId(), x + urand(0,2), y + urand(0,2), 3.15f, plr->GetOrientation());
                    }
                }

                teleportCheck = false;

                // close the gate
                OpenDoorEvent(BG_EVENT_DOOR);
            }
            else
                m_uiTeleport -= diff;
        }

        // Waterfall
        if (m_uiWaterfall < diff)
        {
            if (waterfallActivated)
            {
                SpawnEvent(WATERFALL_EVENT, 0, false);
                waterfallActivated = false;
            }
            else
            {
                SpawnEvent(WATERFALL_EVENT, 0, true);
                waterfallActivated = true;

                for (BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
                {
                    Player * plr = sObjectMgr.GetPlayer(itr->first);
                    if (plr && plr->GetDistance2d(1291, 790) <= 6)
                        plr->KnockBackFrom(plr, -20.0f, 9.0f);
                }
            }
            m_uiWaterfall = urand(30,45)*IN_MILLISECONDS;
        }
        else
            m_uiWaterfall -= diff;
//.........这里部分代码省略.........
开发者ID:BACKUPLIB,项目名称:mangos,代码行数:101,代码来源:BattleGroundDS.cpp


示例16: OpenDoorEvent

void BattleGroundRV::StartingEventOpenDoors()
{
    OpenDoorEvent(BG_EVENT_DOOR);

    m_uiPillarTimer = 45000;
}
开发者ID:killerwife,项目名称:mangos-wotlk,代码行数:6,代码来源:BattleGroundRV.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ OpenEvent函数代码示例发布时间:2022-05-30
下一篇:
C++ OpenDoor函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap