本文整理汇总了C++中OutdoorPvPWG::GetTimer方法的典型用法代码示例。如果您正苦于以下问题:C++ OutdoorPvPWG::GetTimer方法的具体用法?C++ OutdoorPvPWG::GetTimer怎么用?C++ OutdoorPvPWG::GetTimer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OutdoorPvPWG
的用法示例。
在下文中一共展示了OutdoorPvPWG::GetTimer方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
示例2: 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;
}
示例3: HandleWintergraspSwitchTeamCommand
bool ChatHandler::HandleWintergraspSwitchTeamCommand(const char* /*args*/)
{
OutdoorPvPWG *pvpWG = (OutdoorPvPWG*)sOutdoorPvPMgr->GetOutdoorPvPToZoneId(4197);
if (!pvpWG)
{
SendSysMessage(LANG_BG_WG_DISABLE);
SetSentErrorMessage(true);
return false;
}
uint32 timer = pvpWG->GetTimer();
pvpWG->forceChangeTeam();
pvpWG->setTimer(timer);
PSendSysMessage(LANG_BG_WG_SWITCH_FACTION, GetTrinityString(pvpWG->getDefenderTeam() == TEAM_ALLIANCE ? LANG_BG_AB_ALLY : LANG_BG_AB_HORDE));
return true;
}
示例4: CanBeAttacked
bool OutdoorPvPMgr::CanBeAttacked(Creature *pCreature)
{
OutdoorPvPWG *pvpWG = (OutdoorPvPWG*)GetOutdoorPvPToZoneId(NORTHREND_WINTERGRASP);
if (!pvpWG)
return false;
// Toravon
if (pCreature->GetEntry() == 38433 && (pvpWG->GetTimer()/60) <= 15)
return false;
// All
if (pvpWG->isWarTime())
return false;
return true;
}
示例5: HandleWgSwitchCommand
static bool HandleWgSwitchCommand(ChatHandler* handler, const char* /*args*/)
{
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;
}
pvpWG->forceChangeTeam();
pvpWG->setTimer(pvpWG->GetTimer());
handler->PSendSysMessage(LANG_BG_WG_SWITCH_FACTION, handler->GetTrinityString(pvpWG->getDefenderTeam() == TEAM_ALLIANCE ? LANG_BG_AB_ALLY : LANG_BG_AB_HORDE));
return true;
}
示例6: HandleWintergraspStatusCommand
bool ChatHandler::HandleWintergraspStatusCommand(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;
}
PSendSysMessage(LANG_BG_WG_STATUS, sObjectMgr->GetTrinityStringForDBCLocale(
pvpWG->getDefenderTeam() == TEAM_ALLIANCE ? LANG_BG_AB_ALLY : LANG_BG_AB_HORDE),
secsToTimeString(pvpWG->GetTimer(), true).c_str(),
pvpWG->isWarTime() ? "Yes" : "No",
pvpWG->GetNumPlayersH(),
pvpWG->GetNumPlayersA());
return true;
}
示例7: OnGossipSelect
bool OnGossipSelect(Player* pPlayer, Creature* /*pCreature*/, uint32 /*uiSender*/, uint32 /*uiAction*/)
{
pPlayer->CLOSE_GOSSIP_MENU();
OutdoorPvPWG *BfWG = (OutdoorPvPWG*)sOutdoorPvPMgr->GetOutdoorPvPToZoneId(4197);
if (BfWG && pPlayer->getLevel() > sWorld->getIntConfig(CONFIG_CONFIG_OUTDOORPVP_WINTERGRASP_MINLEVEL))
{
if(BfWG->isWarTime())
{ if(!BfWG->isWarForTeamFull(pPlayer))
BfWG->InvitePlayerToWar(pPlayer);
}
else
{
uint32 uiTime=BfWG->GetTimer();
if(uiTime<15*MINUTE)
BfWG->InvitePlayerToQueue(pPlayer);
}
}
return true;
}
示例8: OnGossipHello
bool OnGossipHello(Player* pPlayer, Creature* pCreature)
{
if (pCreature->isQuestGiver())
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
OutdoorPvPWG *BfWG = (OutdoorPvPWG*)sOutdoorPvPMgr->GetOutdoorPvPToZoneId(4197);
if (BfWG && pPlayer->getLevel() > sWorld->getIntConfig(CONFIG_CONFIG_OUTDOORPVP_WINTERGRASP_MINLEVEL))
{
if(BfWG->isWarTime())
{
if (!BfWG->isWarForTeamFull(pPlayer))
{
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT,sObjectMgr->GetTrinityStringForDBCLocale(WG_NPCQUEUE_TEXTOPTION_JOIN), GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
pPlayer->SEND_GOSSIP_MENU(BfWG->getDefenderTeam()?WG_NPCQUEUE_TEXT_H_WAR:WG_NPCQUEUE_TEXT_A_WAR, pCreature->GetGUID());
}
else
{
pPlayer->SEND_GOSSIP_MENU(BfWG->getDefenderTeam()?WG_NPCQUEUE_TEXT_H_NOWAR:WG_NPCQUEUE_TEXT_A_NOWAR, pCreature->GetGUID());
}
}
else
{
uint32 uiTime=BfWG->GetTimer();
pPlayer->SendUpdateWorldState(4354,time(NULL)+uiTime);
if(uiTime<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(BfWG->getDefenderTeam()?WG_NPCQUEUE_TEXT_H_QUEUE:WG_NPCQUEUE_TEXT_A_QUEUE, pCreature->GetGUID());
}
else
{
pPlayer->SEND_GOSSIP_MENU(BfWG->getDefenderTeam()?WG_NPCQUEUE_TEXT_H_NOWAR:WG_NPCQUEUE_TEXT_A_NOWAR, pCreature->GetGUID());
}
}
}
return true;
}