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;
        }
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;
}
Example #3
0
    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;
    }