void WorldPvPNA::ProcessCaptureEvent(uint32 uiCaptureType, uint32 uiTeam) { if (uiCaptureType == WIN) { if (m_uiZoneController != NEUTRAL) { DoSetGraveyard((Team)uiTeam, true); DoProcessTeamBuff((Team)m_uiZoneController, SPELL_STRENGTH_HALAANI, true); sWorld.SendZoneText(ZONE_ID_NAGRAND, sObjectMgr.GetMangosStringForDBCLocale(uiTeam == ALLIANCE ? LANG_OPVP_NA_LOOSE_H: LANG_OPVP_NA_LOOSE_A)); } UpdateWorldState(0); m_uiZoneController = uiTeam; DoRespawnSoldiers(uiTeam); DoSetGraveyard((Team)uiTeam); m_uiControllerWorldState = uiTeam == ALLIANCE ? WORLD_STATE_NA_GUARDS_ALLIANCE : WORLD_STATE_NA_GUARDS_HORDE; m_uiControllerMapState = uiTeam == ALLIANCE ? WORLD_STATE_NA_HALAA_ALLIANCE : WORLD_STATE_NA_HALAA_HORDE; SetBannerArtKit(uiTeam == ALLIANCE ? GO_ARTKIT_BANNER_ALLIANCE : GO_ARTKIT_BANNER_HORDE); DoHandleFactionObjects(uiTeam); UpdateWorldState(1); DoProcessTeamBuff((Team)m_uiZoneController, SPELL_STRENGTH_HALAANI); sWorld.SendZoneText(ZONE_ID_NAGRAND, sObjectMgr.GetMangosStringForDBCLocale(uiTeam == ALLIANCE ? LANG_OPVP_NA_CAPTURE_A: LANG_OPVP_NA_CAPTURE_H)); } }
void WorldPvPTF::Update(uint32 diff) { if (m_uiZoneLockTimer) { if (m_uiZoneLockTimer < diff) { // remove buffs DoProcessTeamBuff(ALLIANCE, SPELL_AUCHINDOUN_BLESSING, true); DoProcessTeamBuff(HORDE, SPELL_AUCHINDOUN_BLESSING, true); // reset world states and towers UpdateWorldState(0); m_uiZoneController = NEUTRAL; m_uiControllerWorldState = WORLD_STATE_TF_TOWERS_CONTROLLED; m_uiTowersAlly = 0; m_uiTowersHorde = 0; m_uiTowerWorldState[0] = WORLD_STATE_TOWER_1_NEUTRAL; m_uiTowerWorldState[1] = WORLD_STATE_TOWER_2_NEUTRAL; m_uiTowerWorldState[2] = WORLD_STATE_TOWER_3_NEUTRAL; m_uiTowerWorldState[3] = WORLD_STATE_TOWER_4_NEUTRAL; m_uiTowerWorldState[4] = WORLD_STATE_TOWER_5_NEUTRAL; UpdateWorldState(1); // update towers count SendUpdateWorldState(WORLD_STATE_TF_TOWER_COUNT_A, m_uiTowersAlly); SendUpdateWorldState(WORLD_STATE_TF_TOWER_COUNT_H, m_uiTowersHorde); for (uint8 i = 0; i < MAX_TF_TOWERS; ++i) { SetBannerArtKit(m_TowerBannerGUID[i], GO_ARTKIT_BANNER_NEUTRAL); // if grid is unloaded the slider reset is enough ResetCapturePoint(aTerokkarTowers[i], CAPTURE_SLIDER_NEUTRAL); // if grid is not unloaded then reset the tower manually DoResetCapturePoints(m_TowerBannerGUID[i]); LockCapturePoint(aTerokkarTowers[i], false); } m_uiZoneLockTimer = 0; } else { if (m_uiZoneUpdateTimer < diff) { // update timer UpdateTimerWorldState(); m_uiZoneUpdateTimer = TIMER_TF_UPDATE_TIME; } else m_uiZoneUpdateTimer -= diff; m_uiZoneLockTimer -= diff; } } }
bool WorldPvPZM::HandleObjectUse(Player* pPlayer, GameObject* pGo) { if (!pPlayer->HasAura(pPlayer->GetTeam() == ALLIANCE ? SPELL_BATTLE_STANDARD_ALY : SPELL_BATTLE_STANDARD_HORDE)) return false; switch (pGo->GetEntry()) { case GO_ZANGA_BANNER_CENTER_ALY: // clicked only by the horde if (pPlayer->GetTeam() == ALLIANCE) return false; // change banners SendUpdateWorldState(m_uiGraveyardWorldState, 0); DoHandleBanners(m_TowerBannerCenterAlyGUID, false); DoHandleBanners(m_TowerBannerCenterHordeGUID, true); DoSetBeaconArtkit(m_BeamCenterBlueGUID, false); sWorld.SendZoneText(ZONE_ID_ZANGARMARSH, sObjectMgr.GetMangosStringForDBCLocale(LANG_OPVP_ZM_LOOSE_GY_A)); // remove buff and graveyard from ally DoProcessTeamBuff(ALLIANCE, SPELL_TWIN_SPIRE_BLESSING, true); DoSetGraveyard(ALLIANCE, true); // add the buff and the graveyard to horde m_uiGraveyardWorldState = WORLD_STATE_GRAVEYARD_HORDE; SendUpdateWorldState(m_uiGraveyardWorldState, 1); DoProcessTeamBuff(HORDE, SPELL_TWIN_SPIRE_BLESSING); DoSetGraveyard(HORDE); // reset scout and remove player aura DoResetScouts(HORDE); m_uiGraveyardController = HORDE; pPlayer->RemoveAurasDueToSpell(SPELL_BATTLE_STANDARD_HORDE); DoSetBeaconArtkit(m_BeamCenterRedGUID, true); sWorld.SendZoneText(ZONE_ID_ZANGARMARSH, sObjectMgr.GetMangosStringForDBCLocale(LANG_OPVP_ZM_CAPTURE_GY_H)); return true; case GO_ZANGA_BANNER_CENTER_HORDE: // clicked only by the alliance if (pPlayer->GetTeam() == HORDE) return false; // change banners SendUpdateWorldState(m_uiGraveyardWorldState, 0); DoHandleBanners(m_TowerBannerCenterHordeGUID, false); DoHandleBanners(m_TowerBannerCenterAlyGUID, true); DoSetBeaconArtkit(m_BeamCenterRedGUID, false); sWorld.SendZoneText(ZONE_ID_ZANGARMARSH, sObjectMgr.GetMangosStringForDBCLocale(LANG_OPVP_ZM_LOOSE_GY_H)); // remove buff and graveyard from ally DoProcessTeamBuff(HORDE, SPELL_TWIN_SPIRE_BLESSING, true); DoSetGraveyard(HORDE, true); // add the buff and the graveyard to horde m_uiGraveyardWorldState = WORLD_STATE_GRAVEYARD_ALY; SendUpdateWorldState(m_uiGraveyardWorldState, 1); DoProcessTeamBuff(ALLIANCE, SPELL_TWIN_SPIRE_BLESSING); DoSetGraveyard(ALLIANCE); // reset scout and remove player aura DoResetScouts(ALLIANCE); m_uiGraveyardController = ALLIANCE; pPlayer->RemoveAurasDueToSpell(SPELL_BATTLE_STANDARD_ALY); DoSetBeaconArtkit(m_BeamCenterBlueGUID, true); sWorld.SendZoneText(ZONE_ID_ZANGARMARSH, sObjectMgr.GetMangosStringForDBCLocale(LANG_OPVP_ZM_CAPTURE_GY_A)); return true; case GO_ZANGA_BANNER_CENTER_NEUTRAL: // remove old world state SendUpdateWorldState(m_uiGraveyardWorldState, 0); if (pPlayer->GetTeam() == ALLIANCE) { // change banners DoHandleBanners(m_TowerBannerCenterNeutralGUID, false); DoHandleBanners(m_TowerBannerCenterAlyGUID, true); // add the buff and the graveyard to horde m_uiGraveyardWorldState= WORLD_STATE_GRAVEYARD_ALY; DoProcessTeamBuff(ALLIANCE, SPELL_TWIN_SPIRE_BLESSING); DoSetGraveyard(ALLIANCE); // reset scout and remove player aura DoResetScouts(ALLIANCE); m_uiGraveyardController = ALLIANCE; pPlayer->RemoveAurasDueToSpell(SPELL_BATTLE_STANDARD_ALY); DoSetBeaconArtkit(m_BeamCenterBlueGUID, true); sWorld.SendZoneText(ZONE_ID_ZANGARMARSH, sObjectMgr.GetMangosStringForDBCLocale(LANG_OPVP_ZM_CAPTURE_GY_H)); } else if (pPlayer->GetTeam() == HORDE) { // change banners DoHandleBanners(m_TowerBannerCenterNeutralGUID, false); DoHandleBanners(m_TowerBannerCenterHordeGUID, true); // add the buff and the graveyard to horde m_uiGraveyardWorldState = WORLD_STATE_GRAVEYARD_HORDE; DoProcessTeamBuff(HORDE, SPELL_TWIN_SPIRE_BLESSING); DoSetGraveyard(HORDE); // reset scout and remove player aura DoResetScouts(HORDE); m_uiGraveyardController = HORDE; pPlayer->RemoveAurasDueToSpell(SPELL_BATTLE_STANDARD_HORDE); DoSetBeaconArtkit(m_BeamCenterRedGUID, true); sWorld.SendZoneText(ZONE_ID_ZANGARMARSH, sObjectMgr.GetMangosStringForDBCLocale(LANG_OPVP_ZM_CAPTURE_GY_H)); } // add new world state SendUpdateWorldState(m_uiGraveyardWorldState, 1); return true; } return false; }
void WorldPvPTF::ProcessCaptureEvent(uint32 uiCaptureType, uint32 uiTeam, uint32 uiNewWorldState, uint32 uiTower) { for (uint8 i = 0; i < MAX_TF_TOWERS; ++i) { if (uiTower == i) { // remove old tower state SendUpdateWorldState(m_uiTowerWorldState[i], 0); if (uiCaptureType == PROGRESS) { SetBannerArtKit(m_TowerBannerGUID[i], uiTeam == ALLIANCE ? GO_ARTKIT_BANNER_ALLIANCE : GO_ARTKIT_BANNER_HORDE); if (uiTeam == ALLIANCE) ++m_uiTowersAlly; else ++m_uiTowersHorde; } else if (uiCaptureType == NEUTRAL) { SetBannerArtKit(m_TowerBannerGUID[i], GO_ARTKIT_BANNER_NEUTRAL); if (uiTeam == ALLIANCE) --m_uiTowersHorde; else --m_uiTowersAlly; } // send new tower state m_uiTowerWorldState[i] = uiNewWorldState; SendUpdateWorldState(m_uiTowerWorldState[i], 1); } } // update towers count SendUpdateWorldState(WORLD_STATE_TF_TOWER_COUNT_A, m_uiTowersAlly); SendUpdateWorldState(WORLD_STATE_TF_TOWER_COUNT_H, m_uiTowersHorde); // If all towers are captured then process event if (m_uiTowersAlly == MAX_TF_TOWERS) { SendUpdateWorldState(m_uiControllerWorldState, 0); m_uiControllerWorldState = WORLD_STATE_TF_LOCKED_ALLIANCE; SendUpdateWorldState(m_uiControllerWorldState, 1); m_uiZoneLockTimer = TIMER_TF_LOCK_TIME; UpdateTimerWorldState(); m_uiZoneController = ALLIANCE; DoProcessTeamBuff(ALLIANCE, SPELL_AUCHINDOUN_BLESSING); // lock the towers for (uint8 i = 0; i < MAX_TF_TOWERS; i++) LockCapturePoint(aTerokkarTowers[i], true); } else if (m_uiTowersHorde == MAX_TF_TOWERS) { SendUpdateWorldState(m_uiControllerWorldState, 0); m_uiControllerWorldState = WORLD_STATE_TF_LOCKED_HORDE; SendUpdateWorldState(m_uiControllerWorldState, 1); m_uiZoneLockTimer = TIMER_TF_LOCK_TIME; UpdateTimerWorldState(); m_uiZoneController = HORDE; DoProcessTeamBuff(HORDE, SPELL_AUCHINDOUN_BLESSING); // lock the towers for (uint8 i = 0; i < MAX_TF_TOWERS; i++) LockCapturePoint(aTerokkarTowers[i], true); } }
void WorldPvPEP::SetData(uint32 uiType, uint32 uiData) { switch(uiType) { case TYPE_CROWNGUARD_CONTROLLER: if (uiData == ALLIANCE) { if (GetData(TYPE_CROWNGUARD_STATE) == NEUTRAL) { // in neutral case the team id is the opposite team // the team who captured the tower and set it to neutral --m_uiTowersHorde; m_uiCrownguardWorldState = WORLD_STATE_CROWNGUARD_NEUTRAL; // unsummon soldiers DoSetGraveyard(ALLIANCE, true); // set artkit SetBannersArtKit(m_lCrownguardTowerBanners, GO_ARTKIT_BANNER_NEUTRAL); } else if (GetData(TYPE_CROWNGUARD_STATE) == PROGRESS) { m_uiCrownguardWorldState = WORLD_STATE_CROWNGUARD_PROG_ALY; // increase tower count only if the controller is changed if (uiData != GetData(TYPE_CROWNGUARD_CONTROLLER)) { // summon alliance soldiers DoSetGraveyard(ALLIANCE); ++m_uiTowersAlly; // set artkit SetBannersArtKit(m_lCrownguardTowerBanners, GO_ARTKIT_BANNER_ALLIANCE); } } // contested states are also sent by the opposite team // alliance contests horde tower else if (GetData(TYPE_CROWNGUARD_STATE) == CONTESTED) m_uiCrownguardWorldState = WORLD_STATE_CROWNGUARD_CONT_HORDE; else if (GetData(TYPE_CROWNGUARD_STATE) == WIN) m_uiCrownguardWorldState = WORLD_STATE_CROWNGUARD_ALY; } else if (uiData == HORDE) { if (GetData(TYPE_CROWNGUARD_STATE) == NEUTRAL) { // in neutral case the team id is the opposite team // the team who captured the tower and set it to neutral --m_uiTowersAlly; m_uiCrownguardWorldState = WORLD_STATE_CROWNGUARD_NEUTRAL; // unsummon soldiers DoSetGraveyard(HORDE, true); // set artkit SetBannersArtKit(m_lCrownguardTowerBanners, GO_ARTKIT_BANNER_NEUTRAL); } if (GetData(TYPE_CROWNGUARD_STATE) == PROGRESS) { m_uiCrownguardWorldState = WORLD_STATE_CROWNGUARD_PROG_HORDE; // increase tower count only if the controller is changed if (uiData != GetData(TYPE_CROWNGUARD_CONTROLLER)) { // summon horde soldiers DoSetGraveyard(HORDE); ++m_uiTowersHorde; // set artkit SetBannersArtKit(m_lCrownguardTowerBanners, GO_ARTKIT_BANNER_HORDE); } } // contested states are also sent by the opposite team // horde contests alliance tower else if (GetData(TYPE_CROWNGUARD_STATE) == CONTESTED) m_uiCrownguardWorldState = WORLD_STATE_CROWNGUARD_CONT_ALY; else if (GetData(TYPE_CROWNGUARD_STATE) == WIN) m_uiCrownguardWorldState = WORLD_STATE_CROWNGUARD_HORDE; } // set controller only for progress and neutral if (GetData(TYPE_CROWNGUARD_STATE) == PROGRESS) m_uiCrownguardController = uiData; else if (GetData(TYPE_CROWNGUARD_STATE) == NEUTRAL) m_uiCrownguardController = 0; break; case TYPE_EASTWALL_CONTROLLER: if (uiData == ALLIANCE) { if (GetData(TYPE_EASTWALL_STATE) == NEUTRAL) { // in neutral case the team id is the opposite team // the team who captured the tower and set it to neutral --m_uiTowersHorde; m_uiEastwallWorldState = WORLD_STATE_EASTWALL_NEUTRAL; // unsummon soldiers DoUnsummonSoldiers(); // set artkit SetBannersArtKit(m_lEastwallTowerBanners, GO_ARTKIT_BANNER_NEUTRAL); } else if (GetData(TYPE_EASTWALL_STATE) == PROGRESS) { m_uiEastwallWorldState = WORLD_STATE_EASTWALL_PROG_ALY; // increase tower count only if the controller is changed if (uiData != GetData(TYPE_EASTWALL_CONTROLLER)) { // summon alliance soldiers DoSummonSoldiersIfCan(ALLIANCE); ++m_uiTowersAlly; // set artkit SetBannersArtKit(m_lEastwallTowerBanners, GO_ARTKIT_BANNER_ALLIANCE); } } // contested states are also sent by the opposite team // alliance contests horde tower else if (GetData(TYPE_EASTWALL_STATE) == CONTESTED) m_uiEastwallWorldState = WORLD_STATE_EASTWALL_CONT_HORDE; else if (GetData(TYPE_EASTWALL_STATE) == WIN) m_uiEastwallWorldState = WORLD_STATE_EASTWALL_ALY; } else if (uiData == HORDE) { if (GetData(TYPE_EASTWALL_STATE) == NEUTRAL) { // in neutral case the team id is the opposite team // the team who captured the tower and set it to neutral --m_uiTowersAlly; m_uiEastwallWorldState = WORLD_STATE_EASTWALL_NEUTRAL; // unsummon soldiers DoUnsummonSoldiers(); // set artkit SetBannersArtKit(m_lEastwallTowerBanners, GO_ARTKIT_BANNER_NEUTRAL); } if (GetData(TYPE_EASTWALL_STATE) == PROGRESS) { m_uiEastwallWorldState = WORLD_STATE_EASTWALL_PROG_HORDE; // increase tower count only if the controller is changed if (uiData != GetData(TYPE_EASTWALL_CONTROLLER)) { // summon horde soldiers DoSummonSoldiersIfCan(HORDE); ++m_uiTowersHorde; // set artkit SetBannersArtKit(m_lEastwallTowerBanners, GO_ARTKIT_BANNER_HORDE); } } // contested states are also sent by the opposite team // horde contests alliance tower else if (GetData(TYPE_EASTWALL_STATE) == CONTESTED) m_uiEastwallWorldState = WORLD_STATE_EASTWALL_CONT_ALY; else if (GetData(TYPE_EASTWALL_STATE) == WIN) m_uiEastwallWorldState = WORLD_STATE_EASTWALL_HORDE; } // set controller only for progress and neutral if (GetData(TYPE_EASTWALL_STATE) == PROGRESS) m_uiEastwallController = uiData; else if (GetData(TYPE_EASTWALL_STATE) == NEUTRAL) m_uiEastwallController = 0; break; case TYPE_NORTHPASS_CONTROLLER: if (uiData == ALLIANCE) { if (GetData(TYPE_NORTHPASS_STATE) == NEUTRAL) { // in neutral case the team id is the opposite team // the team who captured the tower and set it to neutral --m_uiTowersHorde; m_uiNorthpassWorldState = WORLD_STATE_NORTHPASS_NEUTRAL; // delete aly shrine DoUpdateShrine(m_uiLordaeronShrineHordeGUID, true); // set artkit SetBannersArtKit(m_lNorthpassTowerBanners, GO_ARTKIT_BANNER_NEUTRAL); } else if (GetData(TYPE_NORTHPASS_STATE) == PROGRESS) { m_uiNorthpassWorldState = WORLD_STATE_NORTHPASS_PROG_ALY; // increase tower count only if the controller is changed if (uiData != GetData(TYPE_NORTHPASS_CONTROLLER)) { DoUpdateShrine(m_uiLordaeronShrineAlyGUID); ++m_uiTowersAlly; // set artkit SetBannersArtKit(m_lNorthpassTowerBanners, GO_ARTKIT_BANNER_ALLIANCE); } } // contested states are also sent by the opposite team // alliance contests horde tower else if (GetData(TYPE_NORTHPASS_STATE) == CONTESTED) m_uiNorthpassWorldState = WORLD_STATE_NORTHPASS_CONT_HORDE; else if (GetData(TYPE_NORTHPASS_STATE) == WIN) m_uiNorthpassWorldState = WORLD_STATE_NORTHPASS_ALY; } else if (uiData == HORDE) { if (GetData(TYPE_NORTHPASS_STATE) == NEUTRAL) { // in neutral case the team id is the opposite team // the team who captured the tower and set it to neutral --m_uiTowersAlly; m_uiNorthpassWorldState = WORLD_STATE_NORTHPASS_NEUTRAL; // delete aly shrine DoUpdateShrine(m_uiLordaeronShrineAlyGUID, true); // set artkit SetBannersArtKit(m_lNorthpassTowerBanners, GO_ARTKIT_BANNER_NEUTRAL); } if (GetData(TYPE_NORTHPASS_STATE) == PROGRESS) { m_uiNorthpassWorldState = WORLD_STATE_NORTHPASS_PROG_HORDE; // increase tower count only if the controller is changed if (uiData != GetData(TYPE_NORTHPASS_CONTROLLER)) { // respawn horde shrine DoUpdateShrine(m_uiLordaeronShrineHordeGUID); ++m_uiTowersHorde; // set artkit SetBannersArtKit(m_lNorthpassTowerBanners, GO_ARTKIT_BANNER_HORDE); } } // contested states are also sent by the opposite team // horde contests alliance tower else if (GetData(TYPE_NORTHPASS_STATE) == CONTESTED) m_uiNorthpassWorldState = WORLD_STATE_NORTHPASS_CONT_ALY; else if (GetData(TYPE_NORTHPASS_STATE) == WIN) m_uiNorthpassWorldState = WORLD_STATE_NORTHPASS_HORDE; } // set controller only for progress and neutral if (GetData(TYPE_NORTHPASS_STATE) == PROGRESS) m_uiNorthpassController = uiData; else if (GetData(TYPE_NORTHPASS_STATE) == NEUTRAL) m_uiNorthpassController = 0; break; case TYPE_PLAGUEWOOD_CONTROLLER: if (uiData == ALLIANCE) { if (GetData(TYPE_PLAGUEWOOD_STATE) == NEUTRAL) { // in neutral case the team id is the opposite team // the team who captured the tower and set it to neutral --m_uiTowersHorde; m_uiPlaguewoodWorldState = WORLD_STATE_PLAGUEWOOD_NEUTRAL; // unsummon flightmaster DoUnsummonFlightMaster(); // set artkit SetBannersArtKit(m_lPlaguewoodTowerBanners, GO_ARTKIT_BANNER_NEUTRAL); } else if (GetData(TYPE_PLAGUEWOOD_STATE) == PROGRESS) { m_uiPlaguewoodWorldState = WORLD_STATE_PLAGUEWOOD_PROG_ALY; // increase tower count only if the controller is changed if (uiData != GetData(TYPE_PLAGUEWOOD_CONTROLLER)) { DoSummonFlightMasterIfCan(ALLIANCE); ++m_uiTowersAlly; // set artkit SetBannersArtKit(m_lPlaguewoodTowerBanners, GO_ARTKIT_BANNER_ALLIANCE); } } // contested states are also sent by the opposite team // alliance contests horde tower else if (GetData(TYPE_PLAGUEWOOD_STATE) == CONTESTED) m_uiPlaguewoodWorldState = WORLD_STATE_PLAGUEWOOD_CONT_HORDE; else if (GetData(TYPE_PLAGUEWOOD_STATE) == WIN) m_uiPlaguewoodWorldState = WORLD_STATE_PLAGUEWOOD_ALY; } else if (uiData == HORDE) { if (GetData(TYPE_PLAGUEWOOD_STATE) == NEUTRAL) { // in neutral case the team id is the opposite team // the team who captured the tower and set it to neutral --m_uiTowersAlly; m_uiPlaguewoodWorldState = WORLD_STATE_PLAGUEWOOD_NEUTRAL; // unsummon flightmaster DoUnsummonFlightMaster(); // set artkit SetBannersArtKit(m_lPlaguewoodTowerBanners, GO_ARTKIT_BANNER_NEUTRAL); } if (GetData(TYPE_PLAGUEWOOD_STATE) == PROGRESS) { m_uiPlaguewoodWorldState = WORLD_STATE_PLAGUEWOOD_PROG_HORDE; // increase tower count only if the controller is changed if (uiData != GetData(TYPE_PLAGUEWOOD_CONTROLLER)) { DoSummonFlightMasterIfCan(HORDE); ++m_uiTowersHorde; // set artkit SetBannersArtKit(m_lPlaguewoodTowerBanners, GO_ARTKIT_BANNER_HORDE); } } // contested states are also sent by the opposite team // horde contests alliance tower else if (GetData(TYPE_PLAGUEWOOD_STATE) == CONTESTED) m_uiPlaguewoodWorldState = WORLD_STATE_PLAGUEWOOD_CONT_ALY; else if (GetData(TYPE_PLAGUEWOOD_STATE) == WIN) m_uiPlaguewoodWorldState = WORLD_STATE_PLAGUEWOOD_HORDE; } // set controller only for progress and neutral if (GetData(TYPE_PLAGUEWOOD_STATE) == PROGRESS) m_uiPlaguewoodController = uiData; else if (GetData(TYPE_PLAGUEWOOD_STATE) == NEUTRAL) m_uiPlaguewoodController = 0; break; case TYPE_CROWNGUARD_STATE: m_uiCrownguardState = uiData; return; case TYPE_EASTWALL_STATE: m_uiEastwallState = uiData; return; case TYPE_NORTHPASS_STATE: m_uiNorthpassState = uiData; return; case TYPE_PLAGUEWOOD_STATE: m_uiPlaguewoodState = uiData; return; } // update buffs for (uint8 i = 0; i < MAX_TOWERS; i++) { // buff alliance if (m_uiTowersAlly == m_aPlaguelandsTowerBuffs[i].uiTowers) DoProcessTeamBuff(ALLIANCE, m_aPlaguelandsTowerBuffs[i].uiSpellIdAlly); // buff horde if (m_uiTowersHorde == m_aPlaguelandsTowerBuffs[i].uiTowers) DoProcessTeamBuff(HORDE, m_aPlaguelandsTowerBuffs[i].uiSpellIdHorde); } // debuff players if towers == 0; spell to remove will be always the first if (m_uiTowersHorde == 0) DoProcessTeamBuff(HORDE, m_aPlaguelandsTowerBuffs[0].uiSpellIdHorde, true); if (m_uiTowersAlly == 0) DoProcessTeamBuff(ALLIANCE, m_aPlaguelandsTowerBuffs[0].uiSpellIdAlly, true); // update states counters // the map tower states are updated in the ProcessCaptureEvent function UpdateWorldState(); }
void worldmap_eastern_kingdoms::SetData(uint32 uiType, uint32 uiData) { switch(uiType) { case TYPE_CROWNGUARD_CONTROLLER: m_uiCrownguardController = uiData; break; case TYPE_EASTWALL_CONTROLLER: m_uiEastwallController = uiData; break; case TYPE_NORTHPASS_CONTROLLER: m_uiNorthpassController = uiData; break; case TYPE_PLAGUEWOOD_CONTROLLER: if (uiData == ALLIANCE) { if (GetData(TYPE_PLAGUEWOOD_STATE) == NEUTRAL) { // in neutral case the team id is the opposite team // the team who captured the tower and set it to neutral --m_uiTowersHorde; m_uiPlaguewoodWorldState = WORLD_STATE_PLAGUEWOOD_NEUTRAL; // unsummon flightmaster DoUnsummonFlightMaster(); } else if (GetData(TYPE_PLAGUEWOOD_STATE) == PROGRESS) { m_uiPlaguewoodWorldState = WORLD_STATE_PLAGUEWOOD_PROG_ALY; // increase tower count only if the controller is changed if (uiData != GetData(TYPE_PLAGUEWOOD_CONTROLLER)) { DoSummonFlightMasterIfCan(); ++m_uiTowersAlly; } } // contested states are also sent by the opposite team // alliance contests horde tower else if (GetData(TYPE_PLAGUEWOOD_STATE) == CONTESTED) m_uiPlaguewoodWorldState = WORLD_STATE_NORTHPASS_CONT_HORDE; else if (GetData(TYPE_PLAGUEWOOD_STATE) == WIN) m_uiPlaguewoodWorldState = WORLD_STATE_NORTHPASS_ALY; } else if (uiData == HORDE) { if (GetData(TYPE_PLAGUEWOOD_STATE) == NEUTRAL) { // in neutral case the team id is the opposite team // the team who captured the tower and set it to neutral --m_uiTowersAlly; m_uiPlaguewoodWorldState = WORLD_STATE_PLAGUEWOOD_NEUTRAL; // unsummon flightmaster DoUnsummonFlightMaster(); } if (GetData(TYPE_PLAGUEWOOD_STATE) == PROGRESS) { m_uiPlaguewoodWorldState = WORLD_STATE_PLAGUEWOOD_PROG_HORDE; // increase tower count only if the controller is changed if (uiData != GetData(TYPE_PLAGUEWOOD_CONTROLLER)) { DoSummonFlightMasterIfCan(); ++m_uiTowersHorde; } } // contested states are also sent by the opposite team // horde contests alliance tower else if (GetData(TYPE_PLAGUEWOOD_STATE) == CONTESTED) m_uiPlaguewoodWorldState = WORLD_STATE_NORTHPASS_CONT_ALY; else if (GetData(TYPE_PLAGUEWOOD_STATE) == WIN) m_uiPlaguewoodWorldState = WORLD_STATE_NORTHPASS_HORDE; } // set controller only for progress and neutral if (GetData(TYPE_PLAGUEWOOD_STATE) == PROGRESS) m_uiPlaguewoodController = uiData; else if (GetData(TYPE_PLAGUEWOOD_STATE) == NEUTRAL) m_uiPlaguewoodController = 0; break; case TYPE_CROWNGUARD_STATE: m_uiCrownguardState = uiData; break; case TYPE_EASTWALL_STATE: m_uiEastwallState = uiData; break; case TYPE_NORTHPASS_STATE: m_uiNorthpassState = uiData; break; case TYPE_PLAGUEWOOD_STATE: m_uiPlaguewoodState = uiData; break; } // update buffs for (uint8 i = 0; i < 4; i++) { // buff alliance if (m_uiTowersAlly == m_aPlaguelandsTowerBuffs[i].uiTowers) DoProcessTeamBuff(ALLIANCE, m_aPlaguelandsTowerBuffs[i].uiSpellIdAlly); // buff horde if (m_uiTowersHorde == m_aPlaguelandsTowerBuffs[i].uiTowers) DoProcessTeamBuff(HORDE, m_aPlaguelandsTowerBuffs[i].uiSpellIdHorde); } // debuff players if towers == 0; spell to remove will be always the first if (m_uiTowersHorde == 0) DoProcessTeamBuff(HORDE, m_aPlaguelandsTowerBuffs[0].uiSpellIdHorde, true); if (m_uiTowersAlly == 0) DoProcessTeamBuff(ALLIANCE, m_aPlaguelandsTowerBuffs[0].uiSpellIdAlly, true); // update states counters // the map tower states are updated in the ProcessCaptureEvent function UpdateZoneWorldState(WORLD_STATE_TOWER_COUNT_ALY, m_uiTowersAlly); UpdateZoneWorldState(WORLD_STATE_TOWER_COUNT_HORDE, m_uiTowersHorde); }