예제 #1
0
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;
}
예제 #2
0
    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;
    }