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


C++ OutdoorPvPWG类代码示例

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


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

示例1: HandleWGEntryInviteResponse

// Send by client on clicking in accept or refuse of invitation windows for join game(NEED TEST)
void WorldSession::HandleWGEntryInviteResponse(WorldPacket &recv_data)
{
    OutdoorPvPWG *pvpWG = (OutdoorPvPWG*)sOutdoorPvPMgr->GetOutdoorPvPToZoneId(4197);
    if(!pvpWG || !_player)
        return;

    uint32 BattleId;
    uint8 Accepted;



    recv_data >> BattleId >> Accepted;
    sLog->outError("HandleBattlefieldInviteResponse: BattleID:%u Accepted:%u",BattleId,Accepted);

    // If player accept invitation
    if(Accepted)
    {
        if (_player->GetSession())
            _player->GetSession()->SendWGEntered(pvpWG->GetBattleId());
    }
    else
    {
        if(_player->GetZoneId() == 4197)
            pvpWG->KickPlayerFromWG(_player, false);
    }

    _player->WGBattleBox = false;
    _player->WGBattleBoxTimer = 0;
}
开发者ID:AwkwardDev,项目名称:StrawberryCore,代码行数:30,代码来源:BattleGroundHandler.cpp

示例2: GetPlayer

void WorldSession::HandleAreaSpiritHealerQueueOpcode(WorldPacket & recv_data)
{
    sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_AREA_SPIRIT_HEALER_QUEUE");

    Battleground* bg = _player->GetBattleground();

    uint64 guid;
    recv_data >> guid;

    Creature* unit = GetPlayer()->GetMap()->GetCreature(guid);
    if (!unit)
        return;

    if (!unit->isSpiritService())                            // it's not spirit service
        return;

    if (bg)
        bg->AddPlayerToResurrectQueue(guid, _player->GetGUID());
    else
    {  // Wintergrasp Hack till 3.3.5 and it's implemented as BG
        if (GetPlayer()->GetZoneId() == 4197)
        {
            OutdoorPvPWG *pvpWG = (OutdoorPvPWG*)sOutdoorPvPMgr->GetOutdoorPvPToZoneId(4197);
            if (pvpWG && pvpWG->isWarTime())
                pvpWG->AddPlayerToResurrectQueue(guid, _player->GetGUID());
        }
    }
}
开发者ID:kmN666,项目名称:Leroy,代码行数:28,代码来源:BattleGroundHandler.cpp

示例3: GetPlayer

void WorldSession::HandleAreaSpiritHealerQueryOpcode(WorldPacket & recv_data)
{
    sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_AREA_SPIRIT_HEALER_QUERY");

    Battleground* bg = _player->GetBattleground();

    uint64 guid;
    recv_data >> guid;

    Creature* unit = GetPlayer()->GetMap()->GetCreature(guid);
    if (!unit)
        return;

    if (!unit->isSpiritService())                            // it's not spirit service
        return;

    if (bg)
        sBattlegroundMgr->SendAreaSpiritHealerQueryOpcode(_player, bg, guid);
	else if (GetPlayer()->GetZoneId() == 4197)
    {
        OutdoorPvPWG* pvpWG = (OutdoorPvPWG*)sOutdoorPvPMgr->GetOutdoorPvPToZoneId(4197);
        if (pvpWG && pvpWG->isWarTime())
            pvpWG->SendAreaSpiritHealerQueryOpcode(_player, guid);
    }
}
开发者ID:NoRRt,项目名称:FaceCore,代码行数:25,代码来源:BattleGroundHandler.cpp

示例4: GetPlayer

void WorldSession::HandleAreaSpiritHealerQueueOpcode(WorldPacket & recv_data)
{
    sLog->outDebug("WORLD: CMSG_AREA_SPIRIT_HEALER_QUEUE");

    Battleground *bg = _player->GetBattleground();

    uint64 guid;
    recv_data >> guid;

    Creature* unit = GetPlayer()->GetMap()->GetCreature(guid);
    if (!unit)
        return;

    if (!unit->isSpiritService())                            // it's not spirit service
        return;

    if (bg)
        bg->AddPlayerToResurrectQueue(guid, _player->GetGUID());
    else
    {
        // Wintergrasp Hack till 3.2 and it's implemented as BG
        if (GetPlayer()->GetZoneId() == 4197)
        {
            OutdoorPvPWG *pvpWG = (OutdoorPvPWG*)sOutdoorPvPMgr->GetOutdoorPvPToZoneId(4197);
            if (pvpWG && pvpWG != 0)
                if (QueryResult result = CharacterDatabase.PQuery("SELECT value FROM worldstates WHERE value= '%u' AND entry = '%u'", 1, 31001))
                    pvpWG->SendAreaSpiritHealerQueryOpcode(_player, guid);
        }
    }
}
开发者ID:AwkwardDev,项目名称:StrawberryCore,代码行数:30,代码来源:BattleGroundHandler.cpp

示例5: HandleWGQueueInviteResponse

// Send that packet when player click on accept or refuse for queue(NEED TEST)
void WorldSession::HandleWGQueueInviteResponse(WorldPacket &recv_data)
{
    OutdoorPvPWG *pvpWG = (OutdoorPvPWG*)sOutdoorPvPMgr->GetOutdoorPvPToZoneId(4197);
    if(!pvpWG || !_player)
        return;

    pvpWG->QueueBoxSendedToPlayer(_player);

    uint32 BattleId;                                             
    uint8 Accepted;             

    _player->WGQueueBox = true;
    _player->WGQueueBoxTimer = 20000;

    recv_data >> BattleId >> Accepted;
    sLog->outError("HandleQueueInviteResponse: BattleID:%u Accepted:%u",BattleId,Accepted);

    bool Answer;
    if (Accepted)
        Answer = true;
    else
        Answer = false;

    _player->WGQueueBox = false;
    _player->WGQueueBoxTimer = 0;
    pvpWG->PlayerAnsweredForInviteToQueue(_player, Answer);
}
开发者ID:AwkwardDev,项目名称:StrawberryCore,代码行数:28,代码来源:BattleGroundHandler.cpp

示例6: GossipHello_npc_demolisher_engineerer

bool GossipHello_npc_demolisher_engineerer(Player* pPlayer, Creature* pCreature)
{
    OutdoorPvPWG *pvpWG = (OutdoorPvPWG*) sOutdoorPvPMgr.GetOutdoorPvPToZoneId(NORTHREND_WINTERGRASP);

    if (!pvpWG)
        return false;

    if (pCreature->isQuestGiver())
        pPlayer->PrepareQuestMenu(pCreature->GetGUID());

    if (pPlayer->isGameMaster() || pCreature->GetZoneScript() && pCreature->GetZoneScript()->GetData(pCreature->GetDBTableGUIDLow()))
    {
        if (pPlayer->HasAura(SPELL_CORPORAL))
            pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, pvpWG->GetLocaleString(WG_STRING_ENG_GOSSIP_1, sWorld.GetDefaultDbcLocale()), GOSSIP_SENDER_MAIN,   GOSSIP_ACTION_INFO_DEF);
        else if (pPlayer->HasAura(SPELL_LIEUTENANT))
        {
            pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, pvpWG->GetLocaleString(WG_STRING_ENG_GOSSIP_1, sWorld.GetDefaultDbcLocale()), GOSSIP_SENDER_MAIN,   GOSSIP_ACTION_INFO_DEF);
            pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, pvpWG->GetLocaleString(WG_STRING_ENG_GOSSIP_2, sWorld.GetDefaultDbcLocale()), GOSSIP_SENDER_MAIN,   GOSSIP_ACTION_INFO_DEF+1);
            pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, pvpWG->GetLocaleString(WG_STRING_ENG_GOSSIP_3, sWorld.GetDefaultDbcLocale()), GOSSIP_SENDER_MAIN,   GOSSIP_ACTION_INFO_DEF+2);
        }
    }
    else
        pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, pvpWG->GetLocaleString(WG_STRING_ENG_GOSSIP_4, sWorld.GetDefaultDbcLocale()), GOSSIP_SENDER_MAIN,   GOSSIP_ACTION_INFO_DEF+9);

    pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());

    return true;
}
开发者ID:LolJK,项目名称:PhantomCore,代码行数:28,代码来源:wintergrasp.cpp

示例7: HandleWintergraspTimerCommand

bool ChatHandler::HandleWintergraspTimerCommand(const char* args)
{
    if(!*args)
        return false;

    OutdoorPvPWG *pvpWG = (OutdoorPvPWG*)sOutdoorPvPMgr->GetOutdoorPvPToZoneId(4197);

    if (!pvpWG)
    {
        SendSysMessage(LANG_BG_WG_DISABLE);
        SetSentErrorMessage(true);
        return false;
    }

    int32 time = atoi (args);

    // Min value 1 min
    if (1 > time)
        time = 1;
    // Max value during wartime = 60. No wartime = 1440 (day)
    if (pvpWG->isWarTime())
    {
        if (60 < time)
            return false;
    }
    else
        if (1440 < time)
            return false;
    time *= MINUTE * IN_MILLISECONDS;

    pvpWG->setTimer((uint32)time);
    sWorld->SendWintergraspState(); //Update WG time at bg tab
    PSendSysMessage(LANG_BG_WG_CHANGE_TIMER, secsToTimeString(pvpWG->GetTimer(), true).c_str());
    return true;
}
开发者ID:aedansilver,项目名称:CzechFunCore,代码行数:35,代码来源:Level2.cpp

示例8: GetPlayer

void WorldSession::HandleAreaSpiritHealerQueryOpcode(WorldPacket & recv_data)
{
    sLog.outDebug("WORLD: CMSG_AREA_SPIRIT_HEALER_QUERY");

    Battleground *bg = _player->GetBattleground();

    uint64 guid;
    recv_data >> guid;

    Creature *unit = GetPlayer()->GetMap()->GetCreature(guid);
    if (!unit)
        return;

    if (!unit->isSpiritService())                            // it's not spirit service
        return;

    if (bg)
    {
        sBattlegroundMgr.SendAreaSpiritHealerQueryOpcode(_player, bg, guid);
    }
    else
    {   // Wintergrasp Hack till 3.2 and it's implemented as BG
        if (GetPlayer()->GetZoneId() == 4197)
        {
            OutdoorPvPWG *pvpWG = (OutdoorPvPWG*)sOutdoorPvPMgr.GetOutdoorPvPToZoneId(4197);
            if (pvpWG && pvpWG->isWarTime())
                pvpWG->SendAreaSpiritHealerQueryOpcode(_player, guid);
        }
    }

}
开发者ID:ice74,项目名称:blizzwow,代码行数:31,代码来源:BattleGroundHandler.cpp

示例9: HandleWgTimerCommand

    static bool HandleWgTimerCommand(ChatHandler* handler, const char* args)
    {
        if (!*args)
            return false;

        OutdoorPvPWG *pvpWG = (OutdoorPvPWG*)sOutdoorPvPMgr->GetOutdoorPvPToZoneId(4197);
        if (!pvpWG || !sWorld->getBoolConfig(CONFIG_OUTDOORPVP_WINTERGRASP_ENABLED))
        {
            handler->SendSysMessage(LANG_BG_WG_DISABLE);
            handler->SetSentErrorMessage(true);
            return false;
        }

        int32 time = atoi (args);

        if (1 > time)
            time = 1;
        if (pvpWG->isWarTime())
        {
            if (60 < time)
                return false;
        }
        else if (1440 < time)
            return false;

        time *= MINUTE * IN_MILLISECONDS;
        pvpWG->setTimer((uint32)time);
        sWorld->SendWintergraspState();
        handler->PSendSysMessage(LANG_BG_WG_CHANGE_TIMER, secsToTimeString(pvpWG->GetTimer(), true).c_str());

        return true;
    }
开发者ID:Anonymus123,项目名称:AtomicCore-3.3.5a,代码行数:32,代码来源:cs_wg.cpp

示例10: SendWGEntered

// Send that packet when player accept to join war(NEED TEST)
void WorldSession::SendWGEntered(uint32 BattleId)
{
    OutdoorPvPWG *pvpWG = (OutdoorPvPWG*)sOutdoorPvPMgr->GetOutdoorPvPToZoneId(4197);
    if(!pvpWG || !_player || !pvpWG->isWarTime())
        return;

    uint32 team = _player->GetTeamId();

    if (pvpWG->m_playersinwar[team].size() < (pvpWG->GetMaximumPlayerLimit()/2)+1){}else
        return;

    pvpWG->m_playersinwar[team].insert(_player);

    uint32 SPELL_TELEPORT_CAMP;
    if (team == TEAM_ALLIANCE)
        SPELL_TELEPORT_CAMP = SPELL_TELEPORT_ALLIENCE_CAMP;
    else
        SPELL_TELEPORT_CAMP = SPELL_TELEPORT_HORDE_CAMP;

    if (pvpWG->getAttackerTeam() == team)
        _player->CastSpell(_player, SPELL_TELEPORT_CAMP, false);
    else
        _player->CastSpell(_player, SPELL_TELEPORT_FORTRESS, false);

    WorldPacket data(SMSG_BATTLEFIELD_MGR_ENTERED, 7);
    data << uint32(BattleId); // Battle Id of Wintergrasp.
    data << uint8(1); //unk
    data << uint8(1); //unk
    data << uint8(_player->isAFK()?1:0); //Clear AFK

    SendPacket(&data);
}
开发者ID:AwkwardDev,项目名称:StrawberryCore,代码行数:33,代码来源:BattleGroundHandler.cpp

示例11: HandleWGLeaveRequest

// Leave Wintergrasp option from minimap (%100 Working)
void WorldSession::HandleWGLeaveRequest(WorldPacket &recv_data)
{
    OutdoorPvPWG *pvpWG = (OutdoorPvPWG*)sOutdoorPvPMgr->GetOutdoorPvPToZoneId(4197);
    if(!pvpWG || !_player)
        return;

    pvpWG->KickPlayerFromWG(_player, true);
}
开发者ID:AwkwardDev,项目名称:StrawberryCore,代码行数:9,代码来源:BattleGroundHandler.cpp

示例12: OnPlayerEnter

 void OnPlayerEnter(Player *player)
 {
     if (sWorld->getBoolConfig(CONFIG_OUTDOORPVP_WINTERGRASP_ENABLED))
     {
         OutdoorPvPWG *pvpWG = (OutdoorPvPWG*)sOutdoorPvPMgr->GetOutdoorPvPToZoneId(4197);
         if (pvpWG && !player->isGameMaster() && player->GetTeamId() != pvpWG->getDefenderTeam())
             player->CastSpell(player, SPELL_TELEPORT_FORTRESS, true);
     }
 }		
开发者ID:micheledark,项目名称:ArkCORE,代码行数:9,代码来源:instance_vault_of_archavon.cpp

示例13: CanEnterVaultOfArchavon

bool OutdoorPvPMgr::CanEnterVaultOfArchavon(Player *plr)
{
    OutdoorPvPWG *pvpWG = (OutdoorPvPWG*)GetOutdoorPvPToZoneId(NORTHREND_WINTERGRASP);
    if (!pvpWG)
        return false;

    if (pvpWG->getDefenderTeamId() != plr->GetTeamId() || pvpWG->isWarTime())
        return false;

    return true;
}
开发者ID:LolJK,项目名称:PhantomCore,代码行数:11,代码来源:OutdoorPvPMgr.cpp

示例14: HandleWGLeaveQueue

// Leave Queue option while in Queue from minimap(NEED TEST)
void WorldSession::HandleWGLeaveQueue(WorldPacket &recv_data)
{
    uint32 BattleId;

    recv_data >> BattleId;
    sLog->outError("HandleWGLeaveQueue: BattleID:%u ",BattleId);
    OutdoorPvPWG *pvpWG = (OutdoorPvPWG*)sOutdoorPvPMgr->GetOutdoorPvPToZoneId(4197);
    if(!pvpWG)
        return;

    pvpWG->KickPlayerFromWG(_player, false);
}
开发者ID:AwkwardDev,项目名称:StrawberryCore,代码行数:13,代码来源:BattleGroundHandler.cpp

示例15: HandleWintergraspStopCommand

bool ChatHandler::HandleWintergraspStopCommand(const char* /*args*/)
{
    OutdoorPvPWG *pvpWG = (OutdoorPvPWG*)sOutdoorPvPMgr->GetOutdoorPvPToZoneId(4197);

    if (!pvpWG || !sWorld->getBoolConfig(CONFIG_OUTDOORPVP_WINTERGRASP_ENABLED))
    {
        SendSysMessage(LANG_BG_WG_DISABLE);
        SetSentErrorMessage(true);
        return false;
    }
    pvpWG->forceStopBattle();
    PSendSysMessage(LANG_BG_WG_BATTLE_FORCE_STOP);
    return true;
}
开发者ID:aedansilver,项目名称:CzechFunCore,代码行数:14,代码来源:Level2.cpp


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