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)); } }
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 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(); }