void OPvPCapturePointNA::ChangeState() { uint32 artkit = 21; switch (m_State) { case OBJECTIVESTATE_NEUTRAL: m_HalaaState = HALAA_N; break; case OBJECTIVESTATE_ALLIANCE: m_HalaaState = HALAA_A; FactionTakeOver(ALLIANCE); artkit = 2; break; case OBJECTIVESTATE_HORDE: m_HalaaState = HALAA_H; FactionTakeOver(HORDE); artkit = 1; break; case OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE: m_HalaaState = HALAA_N_A; break; case OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE: m_HalaaState = HALAA_N_H; break; case OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE: m_HalaaState = HALAA_N_A; artkit = 2; break; case OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE: m_HalaaState = HALAA_N_H; artkit = 1; break; } GameObject* flag = HashMapHolder<GameObject>::Find(m_capturePointGUID); if (flag) { flag->SetGoArtKit(artkit); } UpdateHalaaWorldState(); }
void OPvPCapturePointNA::ChangeState() { uint32 artkit = 21; switch(m_State) { case OBJECTIVESTATE_NEUTRAL: m_HalaaState = HALAA_N; break; case OBJECTIVESTATE_ALLIANCE: m_HalaaState = HALAA_A; FactionTakeOver(ALLIANCE); artkit = 2; break; case OBJECTIVESTATE_HORDE: m_HalaaState = HALAA_H; FactionTakeOver(HORDE); artkit = 1; break; case OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE: m_HalaaState = HALAA_N_A; break; case OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE: m_HalaaState = HALAA_N_H; break; case OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE: m_HalaaState = HALAA_N_A; artkit = 2; break; case OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE: m_HalaaState = HALAA_N_H; artkit = 1; break; } GameObject * flag = ObjectAccessor::GetGameObjectInWorld(ObjectGuid(HIGHGUID_GAMEOBJECT, m_capturePointGUID)); if(flag) { flag->SetGoArtKit(artkit); } UpdateHalaaWorldState(); }
void OPvPCapturePointNA::ChangeState() { uint32 artkit = 21; switch (m_State) { case OBJECTIVESTATE_NEUTRAL: m_HalaaState = HALAA_N; break; case OBJECTIVESTATE_ALLIANCE: m_HalaaState = HALAA_A; FactionTakeOver(ALLIANCE); artkit = 2; break; case OBJECTIVESTATE_HORDE: m_HalaaState = HALAA_H; FactionTakeOver(HORDE); artkit = 1; break; case OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE: m_HalaaState = HALAA_N_A; break; case OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE: m_HalaaState = HALAA_N_H; break; case OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE: m_HalaaState = HALAA_N_A; artkit = 2; break; case OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE: m_HalaaState = HALAA_N_H; artkit = 1; break; } auto bounds = sMapMgr->FindMap(530, 0)->GetGameObjectBySpawnIdStore().equal_range(m_capturePointSpawnId); for (auto itr = bounds.first; itr != bounds.second; ++itr) itr->second->SetGoArtKit(artkit); UpdateHalaaWorldState(); }
void OPvPCapturePointNA::ChangeState() { uint32 artkit = 21; switch (m_State) { case OBJECTIVESTATE_NEUTRAL: m_HalaaState = HALAA_N; break; case OBJECTIVESTATE_ALLIANCE: m_HalaaState = HALAA_A; FactionTakeOver(ALLIANCE); artkit = 2; break; case OBJECTIVESTATE_HORDE: m_HalaaState = HALAA_H; FactionTakeOver(HORDE); artkit = 1; break; case OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE: m_HalaaState = HALAA_N_A; break; case OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE: m_HalaaState = HALAA_N_H; break; case OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE: m_HalaaState = HALAA_N_A; artkit = 2; break; case OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE: m_HalaaState = HALAA_N_H; artkit = 1; break; } if (m_capturePoint) m_capturePoint->SetGoArtKit(artkit); UpdateHalaaWorldState(); }
bool OPvPCapturePointNA::Update(uint32 diff) { // let the controlling faction advance in phase bool capturable = false; if (m_ControllingFaction == ALLIANCE && m_activePlayers[0].size() > m_activePlayers[1].size()) capturable = true; else if (m_ControllingFaction == HORDE && m_activePlayers[0].size() < m_activePlayers[1].size()) capturable = true; if (m_GuardCheckTimer < diff) { m_GuardCheckTimer = NA_GUARD_CHECK_TIME; uint32 cnt = GetAliveGuardsCount(); if (cnt != m_GuardsAlive) { m_GuardsAlive = cnt; if (m_GuardsAlive == 0) m_capturable = true; // update the guard count for the players in zone m_PvP->SendUpdateWorldState(NA_UI_GUARDS_LEFT, m_GuardsAlive); } } else m_GuardCheckTimer -= diff; if (m_capturable || capturable) { if (m_RespawnTimer < diff) { // if the guards have been killed, then the challenger has one hour to take over halaa. // in case they fail to do it, the guards are respawned, and they have to start again. if (m_ControllingFaction) FactionTakeOver(m_ControllingFaction); m_RespawnTimer = NA_RESPAWN_TIME; } else m_RespawnTimer -= diff; return OPvPCapturePoint::Update(diff); } return false; }
void OPvPCapturePointGH::ChangeState() { switch (m_OldState) { case OBJECTIVESTATE_NEUTRAL: break; case OBJECTIVESTATE_ALLIANCE: sWorld->SendZoneText(GH_OUTDOORPVP_ZONE, sObjectMgr->GetArkCoreStringForDBCLocale(LANG_OPVP_GH_LOOSE_A)); DeSpawnNPCs(); break; case OBJECTIVESTATE_HORDE: sWorld->SendZoneText(GH_OUTDOORPVP_ZONE, sObjectMgr->GetArkCoreStringForDBCLocale(LANG_OPVP_GH_LOOSE_H)); DeSpawnNPCs(); break; case OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE: case OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE: case OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE: case OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE: break; } uint32 artkit = 21; switch (m_State) { case OBJECTIVESTATE_NEUTRAL: m_VentureState = VENTURE_N; break; case OBJECTIVESTATE_ALLIANCE: m_VentureState = VENTURE_A; FactionTakeOver(ALLIANCE); artkit = 2; sWorld->SendZoneText( GH_OUTDOORPVP_ZONE, sObjectMgr->GetArkCoreStringForDBCLocale( LANG_OPVP_GH_CAPTURE_A)); break; case OBJECTIVESTATE_HORDE: m_VentureState = VENTURE_H; FactionTakeOver(HORDE); artkit = 1; sWorld->SendZoneText( GH_OUTDOORPVP_ZONE, sObjectMgr->GetArkCoreStringForDBCLocale( LANG_OPVP_GH_CAPTURE_H)); break; case OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE: m_VentureState = VENTURE_N_A; break; case OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE: m_VentureState = VENTURE_N_H; break; case OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE: m_VentureState = VENTURE_N_A; artkit = 2; break; case OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE: m_VentureState = VENTURE_N_H; artkit = 1; break; } GameObject* flag = HashMapHolder<GameObject>::Find(m_capturePointGUID); if (flag) { flag->SetGoArtKit(artkit); } // ToDo: research about the world states! //this->UpdateVentureWorldState(); }
bool OutdoorPvPObjectiveNA::Update(uint32 diff) { // let the controlling faction advance in phase bool capturable = false; if(m_ControllingFaction == ALLIANCE && m_AllianceActivePlayerCount > m_HordeActivePlayerCount) capturable = true; else if(m_ControllingFaction == HORDE && m_AllianceActivePlayerCount < m_HordeActivePlayerCount) capturable = true; if(m_GuardCheckTimer < diff) { m_GuardCheckTimer = NA_GUARD_CHECK_TIME; uint32 cnt = GetAliveGuardsCount(); if(cnt != m_GuardsAlive) { m_GuardsAlive = cnt; if(m_GuardsAlive == 0) m_capturable = true; // update the guard count for the players in zone m_PvP->SendUpdateWorldState(NA_UI_GUARDS_LEFT,m_GuardsAlive); } } else m_GuardCheckTimer -= diff; if((m_capturable || capturable) && OutdoorPvPObjective::Update(diff)) { if(m_RespawnTimer < diff) { // if the guards have been killed, then the challenger has one hour to take over halaa. // in case they fail to do it, the guards are respawned, and they have to start again. if(m_ControllingFaction) FactionTakeOver(m_ControllingFaction); m_RespawnTimer = NA_RESPAWN_TIME; } else m_RespawnTimer -= diff; if(m_OldState != m_State) { uint8 artkit = 21; switch(m_State) { case OBJECTIVESTATE_NEUTRAL: m_HalaaState = HALAA_N; break; case OBJECTIVESTATE_ALLIANCE: m_HalaaState = HALAA_A; FactionTakeOver(ALLIANCE); artkit = 2; break; case OBJECTIVESTATE_HORDE: m_HalaaState = HALAA_H; FactionTakeOver(HORDE); artkit = 1; break; case OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE: m_HalaaState = HALAA_N_A; break; case OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE: m_HalaaState = HALAA_N_H; break; case OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE: m_HalaaState = HALAA_N_A; artkit = 2; break; case OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE: m_HalaaState = HALAA_N_H; artkit = 1; break; } Map* map = m_PvP->GetMap(); GameObject* flag = map->GetGameObject(m_CapturePoint); if(flag) flag->SetGoArtKit(artkit); UpdateHalaaWorldState(); } if(m_ShiftPhase != m_OldPhase) { // send this too, sometimes the slider disappears, dunno why :( SendUpdateWorldState(NA_UI_TOWER_SLIDER_DISPLAY, 1); // send these updates to only the ones in this objective uint32 phase = (uint32)ceil(( m_ShiftPhase + m_ShiftMaxPhase) / ( 2 * m_ShiftMaxPhase ) * 100.0f); SendUpdateWorldState(NA_UI_TOWER_SLIDER_POS, phase); SendUpdateWorldState(NA_UI_TOWER_SLIDER_N, m_NeutralValue); } return true; } return false; }