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


C++ Battlefield::GetTimer方法代码示例

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


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

示例1: OnGossipHello

        bool OnGossipHello(Player* player, Creature* creature) override
        {
            if (creature->IsQuestGiver())
                player->PrepareQuestMenu(creature->GetGUID());

            Battlefield* wintergrasp = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG);
            if (!wintergrasp)
                return true;

            if (wintergrasp->IsWarTime())
            {
                AddGossipItemFor(player, GOSSIP_ICON_CHAT, player->GetSession()->GetTrinityString(WG_NPCQUEUE_TEXTOPTION_JOIN), GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
                SendGossipMenuFor(player, wintergrasp->GetDefenderTeam() ? WG_NPCQUEUE_TEXT_H_WAR : WG_NPCQUEUE_TEXT_A_WAR, creature->GetGUID());
            }
            else
            {
                uint32 timer = wintergrasp->GetTimer() / 1000;
                player->SendUpdateWorldState(4354, time(NULL) + timer);
                if (timer < 15 * MINUTE)
                {
                    AddGossipItemFor(player, GOSSIP_ICON_CHAT, player->GetSession()->GetTrinityString(WG_NPCQUEUE_TEXTOPTION_JOIN), GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
                    SendGossipMenuFor(player, wintergrasp->GetDefenderTeam() ? WG_NPCQUEUE_TEXT_H_QUEUE : WG_NPCQUEUE_TEXT_A_QUEUE, creature->GetGUID());
                }
                else
                    SendGossipMenuFor(player, wintergrasp->GetDefenderTeam() ? WG_NPCQUEUE_TEXT_H_NOWAR : WG_NPCQUEUE_TEXT_A_NOWAR, creature->GetGUID());
            }
            return true;
        }
开发者ID:AvariusProject,项目名称:AvariusCore,代码行数:28,代码来源:zone_wintergrasp.cpp

示例2: OnGossipHello

bool npc_wg_queue::OnGossipHello(Player* pPlayer, Creature* pCreature)
{
    if (pCreature->isQuestGiver())
        pPlayer->PrepareQuestMenu(pCreature->GetGUID());

    Battlefield* wintergrasp = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG);
    if (!wintergrasp)
        return true;

    if (wintergrasp->IsWarTime())
    {
        pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, sObjectMgr->GetTrinityStringForDBCLocale(WG_NPCQUEUE_TEXTOPTION_JOIN), GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
        pPlayer->SEND_GOSSIP_MENU(wintergrasp->GetDefenderTeam() ? WG_NPCQUEUE_TEXT_H_WAR : WG_NPCQUEUE_TEXT_A_WAR, pCreature->GetGUID());
    }
    else
    {
        uint32 timer = wintergrasp->GetTimer() / 1000;
        pPlayer->SendUpdateWorldState(4354, time(NULL) + timer);
        if (timer < 15 * MINUTE)
        {
            pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, sObjectMgr->GetTrinityStringForDBCLocale(WG_NPCQUEUE_TEXTOPTION_JOIN), GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
            pPlayer->SEND_GOSSIP_MENU(wintergrasp->GetDefenderTeam() ? WG_NPCQUEUE_TEXT_H_QUEUE : WG_NPCQUEUE_TEXT_A_QUEUE, pCreature->GetGUID());
        }
        else
            pPlayer->SEND_GOSSIP_MENU(wintergrasp->GetDefenderTeam() ? WG_NPCQUEUE_TEXT_H_NOWAR : WG_NPCQUEUE_TEXT_A_NOWAR, pCreature->GetGUID());
    }
    return true;
}
开发者ID:Allowed,项目名称:Strawberry335,代码行数:28,代码来源:Npc_Wintergrasp.cpp

示例3: OnGossipHello

        bool OnGossipHello(Player* player, Creature* creature)
        {
            if (creature->IsQuestGiver())
                player->PrepareQuestMenu(creature->GetGUID());

            Battlefield* wintergrasp = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG);
            if (!wintergrasp)
                return true;

            if (wintergrasp->IsWarTime())
            {
                player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT_19, "Queue for Wintergrasp.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
                player->SEND_GOSSIP_MENU(wintergrasp->GetDefenderTeam()? WG_NPCQUEUE_TEXT_H_WAR : WG_NPCQUEUE_TEXT_A_WAR, creature->GetGUID());
            }
            else
            {
                uint32 timer = wintergrasp->GetTimer() / 1000;
                player->SendUpdateWorldState(4354, time(NULL) + timer);
                if (timer < 15 * MINUTE)
                {
                    player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Queue for Wintergrasp.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
                    player->SEND_GOSSIP_MENU(wintergrasp->GetDefenderTeam() ? WG_NPCQUEUE_TEXT_H_QUEUE : WG_NPCQUEUE_TEXT_A_QUEUE, creature->GetGUID());
                }
                else
                    player->SEND_GOSSIP_MENU(wintergrasp->GetDefenderTeam() ? WG_NPCQUEUE_TEXT_H_NOWAR : WG_NPCQUEUE_TEXT_A_NOWAR, creature->GetGUID());
            }
            return true;
        }
开发者ID:Matt-One,项目名称:azerothcore-wotlk,代码行数:28,代码来源:zone_wintergrasp.cpp

示例4: OnGossipHello

    bool OnGossipHello(Player* player, Creature* creature)
    {
        if (creature->IsQuestGiver())
            player->PrepareQuestMenu(creature->GetGUID());

        Battlefield* BfTB = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_TB);
        if (BfTB)
        {
            if (BfTB->IsWarTime())
            {
                player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, sObjectMgr->GetTrinityStringForDBCLocale(TB_NPCQUEUE_TEXTOPTION_JOIN), GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
                player->SEND_GOSSIP_MENU(BfTB->GetDefenderTeam() ? TB_NPCQUEUE_TEXT_H_WAR : TB_NPCQUEUE_TEXT_A_WAR, creature->GetGUID());
            }
            else
            {
                uint32 uiTime = BfTB->GetTimer()/1000;
                player->SendUpdateWorldState(5332, time(NULL)+uiTime);
                if (uiTime < 15 * MINUTE)
                {
                    player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, sObjectMgr->GetTrinityStringForDBCLocale(TB_NPCQUEUE_TEXTOPTION_JOIN), GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
                    player->SEND_GOSSIP_MENU(BfTB->GetDefenderTeam() ? TB_NPCQUEUE_TEXT_H_QUEUE : TB_NPCQUEUE_TEXT_A_QUEUE, creature->GetGUID());
                }
                else
                {
                    player->SEND_GOSSIP_MENU(BfTB->GetDefenderTeam() ? TB_NPCQUEUE_TEXT_H_NOWAR:TB_NPCQUEUE_TEXT_A_NOWAR, creature->GetGUID());
                }
            }
        }
        return true;
    }
开发者ID:Caydan,项目名称:DeathCore,代码行数:30,代码来源:tolbarad.cpp

示例5: OnCheck

    bool OnCheck(Player*  /*source*/, Unit*  /*target*/)
    {
        Battlefield* wintergrasp = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG);
        if (!wintergrasp)
            return false;

        return wintergrasp->GetTimer() >= (20 * MINUTE * IN_MILLISECONDS);
    }
开发者ID:Matt-One,项目名称:azerothcore-wotlk,代码行数:8,代码来源:zone_wintergrasp.cpp

示例6: OnGossipSelect

bool npc_wg_queue::OnGossipSelect(Player* pPlayer, Creature* /*pCreature*/, uint32 /*sender*/, uint32 /*action*/)
{
    pPlayer->CLOSE_GOSSIP_MENU();

    Battlefield* wintergrasp = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG);
    if (!wintergrasp)
        return true;

    if (wintergrasp->IsWarTime())
        wintergrasp->InvitePlayerToWar(pPlayer);
    else
    {
        uint32 timer = wintergrasp->GetTimer() / 1000;
        if (timer < 15 * MINUTE)
            wintergrasp->InvitePlayerToQueue(pPlayer);
    }
    return true;
}
开发者ID:Allowed,项目名称:Strawberry335,代码行数:18,代码来源:Npc_Wintergrasp.cpp

示例7: OnGossipSelect

        bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 /*action*/) override
        {
            CloseGossipMenuFor(player);

            Battlefield* wintergrasp = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG);
            if (!wintergrasp)
                return true;

            if (wintergrasp->IsWarTime())
                wintergrasp->InvitePlayerToWar(player);
            else
            {
                uint32 timer = wintergrasp->GetTimer() / 1000;
                if (timer < 15 * MINUTE)
                    wintergrasp->InvitePlayerToQueue(player);
            }
            return true;
        }
开发者ID:AvariusProject,项目名称:AvariusCore,代码行数:18,代码来源:zone_wintergrasp.cpp

示例8: OnGossipSelect

    bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 /*action*/)
    {
        player->CLOSE_GOSSIP_MENU();

        Battlefield* BfTB = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_TB);
        if (BfTB)
        {
            if (BfTB->IsWarTime()){
                BfTB->InvitePlayerToWar(player);
            }
            else
            {
                uint32 uiTime = BfTB->GetTimer()/1000;
                if (uiTime < 15 * MINUTE)
                    BfTB->InvitePlayerToQueue(player);
            }
        }
        return true;
    }
开发者ID:Caydan,项目名称:DeathCore,代码行数:19,代码来源:tolbarad.cpp


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