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


C++ Battleground::GetStartDelayTime方法代码示例

本文整理汇总了C++中Battleground::GetStartDelayTime方法的典型用法代码示例。如果您正苦于以下问题:C++ Battleground::GetStartDelayTime方法的具体用法?C++ Battleground::GetStartDelayTime怎么用?C++ Battleground::GetStartDelayTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Battleground的用法示例。


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

示例1: OnGossipHello

    bool OnGossipHello(Player* player, GameObject* /*pGO*/)
    {


        if (player->HasAura(32727))
        {
            player->m_clicked = true;

            Battleground* battleground = player->GetBattleground();
            uint8 numOfReadyPlrs = 0;

            for (Battleground::BattlegroundPlayerMap::const_iterator itr = battleground->GetPlayers().begin(); itr != battleground->GetPlayers().end(); ++itr)
            {
                if (Player *plr = sObjectAccessor->FindPlayer(itr->first))
                {
                    if (plr->m_clicked == true)
                        ++numOfReadyPlrs;
                }
            }

            // 0 by se nemela vypsat nikdy, ale co uz...
            if (numOfReadyPlrs == 0 && battleground->GetArenaType() == 2)
                ChatHandler(player->GetSession()).PSendSysMessage("Je pripraveno %u hracu ze %u potrebnych.", numOfReadyPlrs, battleground->GetArenaType()*2);
            // 2v2
            else if (numOfReadyPlrs == 1 && battleground->GetArenaType() == 2)
                ChatHandler(player->GetSession()).PSendSysMessage("Je pripraven %u hrac ze %u potrebnych.", numOfReadyPlrs, battleground->GetArenaType()*2);
            else if ((numOfReadyPlrs == 2 || numOfReadyPlrs == 3) && battleground->GetArenaType() == 2)
                ChatHandler(player->GetSession()).PSendSysMessage("Jsou pripraveni %u hraci ze %u potrebnych.", numOfReadyPlrs, battleground->GetArenaType()*2);
            else if (numOfReadyPlrs == 4 && battleground->GetArenaType() == 2)
                ChatHandler(player->GetSession()).PSendSysMessage("Jsou pripraveni vsichni hraci.", numOfReadyPlrs, battleground->GetArenaType()*2);
            // 3v3
            else if (numOfReadyPlrs == 0 && battleground->GetArenaType() == 3)
                ChatHandler(player->GetSession()).PSendSysMessage("Je pripraveno %u hracu z %u potrebnych.", numOfReadyPlrs, battleground->GetArenaType()*2);
            else if (numOfReadyPlrs == 1 && battleground->GetArenaType() == 3)
                ChatHandler(player->GetSession()).PSendSysMessage("Je pripraven %u hrac z %u potrebnych.", numOfReadyPlrs, battleground->GetArenaType()*2);
            else if ((numOfReadyPlrs == 2 || numOfReadyPlrs == 3 || numOfReadyPlrs == 4) && battleground->GetArenaType() == 3)
                ChatHandler(player->GetSession()).PSendSysMessage("Jsou pripraveni %u hraci z %u potrebnych.", numOfReadyPlrs, battleground->GetArenaType()*2);
            else if (numOfReadyPlrs == 5 && battleground->GetArenaType() == 3)
                ChatHandler(player->GetSession()).PSendSysMessage("Je pripraveno %u hracu z %u potrebnych.", numOfReadyPlrs, battleground->GetArenaType()*2);
            else if (numOfReadyPlrs == 6 && battleground->GetArenaType() == 3)
                ChatHandler(player->GetSession()).PSendSysMessage("Jsou pripraveni vsichni hraci.", numOfReadyPlrs, battleground->GetArenaType()*2);
            // Todle je pro 5v5 a a ja jsem linej vypisovat vsechny mozny kombinace. Pokud se nekomu chce, muze to doplnit, ale me to prijde zbytecny.
            else
                ChatHandler(player->GetSession()).PSendSysMessage("Je pripraveno %u hracu z %u potrebnych.", numOfReadyPlrs, battleground->GetArenaType()*2);

            if ((battleground->GetStartDelayTime() - player->timeDiff) <= 15000)
            {
                player->GetSession()->SendAreaTriggerMessage("Arena za chvili zacina");
            }
            else
            {
                player->GetSession()->SendAreaTriggerMessage("Jste oznacen jako pripaven");
            }
        }
        return true;
    }
开发者ID:GetPlay,项目名称:TC,代码行数:56,代码来源:object_arena_crystal.cpp


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