本文整理汇总了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;
}
示例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());
}
}
}
示例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);
}
}
示例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);
}
}
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
}
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
}
示例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;
}
示例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);
}
示例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;
}