// process the capture events bool OutdoorPvPNA::HandleEvent(uint32 eventId, GameObject* go, Unit* pInvoker, uint32 spellId) { // If we are not using the Halaa banner return if (go->GetEntry() != GO_HALAA_BANNER) return false; bool eventHandled = true; switch (eventId) { case EVENT_HALAA_BANNER_WIN_ALLIANCE: ProcessCaptureEvent(go, ALLIANCE); eventHandled = false; break; case EVENT_HALAA_BANNER_WIN_HORDE: ProcessCaptureEvent(go, HORDE); eventHandled = false; break; case EVENT_HALAA_BANNER_PROGRESS_ALLIANCE: SetBannerVisual(go, CAPTURE_ARTKIT_ALLIANCE, CAPTURE_ANIM_ALLIANCE); sWorld.SendDefenseMessage(ZONE_ID_NAGRAND, LANG_OPVP_NA_PROGRESS_A); break; case EVENT_HALAA_BANNER_PROGRESS_HORDE: SetBannerVisual(go, CAPTURE_ARTKIT_HORDE, CAPTURE_ANIM_HORDE); sWorld.SendDefenseMessage(ZONE_ID_NAGRAND, LANG_OPVP_NA_PROGRESS_H); break; } // there are some events which required further DB script return eventHandled; }
// process the capture events bool OutdoorPvPZM::HandleEvent(uint32 eventId, GameObject* go) { for (uint8 i = 0; i < MAX_ZM_TOWERS; ++i) { if (zangarmarshTowers[i] == go->GetEntry()) { for (uint8 j = 0; j < 4; ++j) { if (zangarmarshTowerEvents[i][j].eventEntry == eventId) { // prevent processing if the owner did not change (happens if progress event is called after contest event) if (zangarmarshTowerEvents[i][j].team != m_towerOwner[i]) { if (zangarmarshTowerEvents[i][j].defenseMessage) sWorld.SendDefenseMessage(ZONE_ID_ZANGARMARSH, zangarmarshTowerEvents[i][j].defenseMessage); return ProcessCaptureEvent(go, i, zangarmarshTowerEvents[i][j].team, zangarmarshTowerEvents[i][j].worldState, zangarmarshTowerEvents[i][j].mapState); } // no need to iterate other events or towers return false; } } // no need to iterate other towers return false; } } return false; }
// process the capture events bool OutdoorPvPHP::HandleEvent(uint32 eventId, GameObject* go) { for (uint8 i = 0; i < MAX_HP_TOWERS; ++i) { if (hellfireBanners[i] == go->GetEntry()) { for (uint8 j = 0; j < 4; ++j) { if (hellfireTowerEvents[i][j].eventEntry == eventId) { // prevent processing if the owner did not change (happens if progress event is called after contest event) if (hellfireTowerEvents[i][j].team != m_towerOwner[i]) { if (hellfireTowerEvents[i][j].defenseMessage) sWorld.SendDefenseMessage(ZONE_ID_HELLFIRE_PENINSULA, hellfireTowerEvents[i][j].defenseMessage); return ProcessCaptureEvent(go, i, hellfireTowerEvents[i][j].team, hellfireTowerEvents[i][j].worldState, hellfireTowerEvents[i][j].towerArtKit, hellfireTowerEvents[i][j].towerAnim); } // no need to iterate other events or towers return false; } } // no need to iterate other towers return false; } } return false; }
// process the capture events bool OutdoorPvPEP::HandleEvent(uint32 eventId, GameObject* go) { for (uint8 i = 0; i < MAX_EP_TOWERS; ++i) { if (plaguelandsBanners[i] == go->GetEntry()) { for (uint8 j = 0; j < 4; ++j) { if (plaguelandsTowerEvents[i][j].eventEntry == eventId) { // prevent processing if the owner did not change (happens if progress event is called after contest event) if (plaguelandsTowerEvents[i][j].team != m_towerOwner[i]) { if (plaguelandsTowerEvents[i][j].defenseMessage) sWorld.SendDefenseMessage(ZONE_ID_EASTERN_PLAGUELANDS, plaguelandsTowerEvents[i][j].defenseMessage); return ProcessCaptureEvent(go, i, plaguelandsTowerEvents[i][j].team, plaguelandsTowerEvents[i][j].worldState); } // no need to iterate other events or towers return false; } } // no need to iterate other towers return false; } } return false; }
// process the capture events void WorldPvPNA::ProcessEvent(GameObject* pGo, uint32 uiEventId, uint32 uiFaction) { // If we are not using the Halaa banner return if (pGo->GetEntry() != GO_HALAA_BANNER) return; switch (uiEventId) { case EVENT_HALAA_BANNER_WIN_ALLIANCE: case EVENT_HALAA_BANNER_WIN_HORDE: ProcessCaptureEvent(WIN, uiFaction); break; default: break; } }
// process the capture events void WorldPvPZM::ProcessEvent(GameObject* pGo, uint32 uiEventId, uint32 uiFaction) { for (uint8 i = 0; i < MAX_ZM_TOWERS; ++i) { if (pGo->GetEntry() == aZangaTowers[i]) { for (uint8 j = 0; j < 4; ++j) { if (uiEventId == aZangaTowerEvents[i][j].uiEventEntry) { ProcessCaptureEvent(aZangaTowerEvents[i][j].uiEventType, uiFaction, aZangaTowerEvents[i][j].uiWorldState, aZangaTowerEvents[i][j].uiMapState, i); sWorld.SendZoneText(ZONE_ID_ZANGARMARSH, sObjectMgr.GetMangosStringForDBCLocale(aZangaTowerEvents[i][j].uiZoneText)); break; } } } } }
// process the capture events void OutdoorPvPTF::ProcessEvent(uint32 uiEventId, GameObject* pGo) { for (uint8 i = 0; i < MAX_TF_TOWERS; ++i) { if (aTerokkarTowers[i] == pGo->GetEntry()) { for (uint8 j = 0; j < 4; ++j) { if (aTerokkarTowerEvents[i][j].uiEventEntry == uiEventId) { if (aTerokkarTowerEvents[i][j].team != m_capturePointOwner[i]) { ProcessCaptureEvent(pGo, i, aTerokkarTowerEvents[i][j].team, aTerokkarTowerEvents[i][j].uiWorldState); sWorld.SendZoneText(ZONE_ID_TEROKKAR, sObjectMgr.GetMangosStringForDBCLocale(aTerokkarTowerEvents[i][j].uiZoneText)); } return; } } return; } } }
// process the capture events void WorldPvPTF::ProcessEvent(GameObject* pGo, uint32 uiEventId, uint32 uiFaction) { // No events during the lock timer if (m_uiZoneLockTimer) return; for (uint8 i = 0; i < MAX_TF_TOWERS; ++i) { if (pGo->GetEntry() == aTerokkarTowers[i]) { for (uint8 j = 0; j < 4; ++j) { if (uiEventId == aTerokkarTowerEvents[i][j].uiEventEntry) { ProcessCaptureEvent(aTerokkarTowerEvents[i][j].uiEventType, uiFaction, aTerokkarTowerEvents[i][j].uiWorldState, i); sWorld.SendZoneText(ZONE_ID_TEROKKAR, sObjectMgr.GetMangosStringForDBCLocale(aTerokkarTowerEvents[i][j].uiZoneText)); break; } } } } }
// process the capture events void OutdoorPvPEP::ProcessEvent(uint32 uiEventId, GameObject* pGo) { for (uint8 i = 0; i < TOWER_COUNT; ++i) { if (aPlaguelandsBanners[i] == pGo->GetEntry()) { for (uint8 j = 0; j < 4; ++j) { if (aPlaguelandsTowerEvents[i][j].uiEventEntry == uiEventId) { if (aPlaguelandsTowerEvents[i][j].team != m_capturePointOwner[i]) { ProcessCaptureEvent(pGo, i, aPlaguelandsTowerEvents[i][j].team, aPlaguelandsTowerEvents[i][j].uiWorldState); sWorld.SendZoneText(ZONE_ID_EASTERN_PLAGUELANDS, sObjectMgr.GetMangosStringForDBCLocale(aPlaguelandsTowerEvents[i][j].uiZoneText)); } return; } } return; } } }
// process the capture events bool BattleGroundEY::HandleEvent(uint32 eventId, GameObject* go) { for (uint8 i = 0; i < EY_NODES_MAX; ++i) { if (eyTowers[i] == go->GetEntry()) { for (uint8 j = 0; j < 4; ++j) { if (eyTowerEvents[i][j].eventEntry == eventId) { ProcessCaptureEvent(go, i, eyTowerEvents[i][j].team, eyTowerEvents[i][j].worldState, eyTowerEvents[i][j].message); // no need to iterate other events or towers return false; } } // no need to iterate other towers return false; } } return false; }
// process the capture events void WorldPvPEP::ProcessEvent(GameObject* pGo, Player* pPlayer, uint32 uiEventId) { switch(pGo->GetEntry()) { case GO_BATTLEFIELD_BANNER_PLAGUELANDS_1: switch(uiEventId) { case EVENT_NORTHPASS_WIN_ALLIANCE: case EVENT_NORTHPASS_WIN_HORDE: ProcessCaptureEvent(WIN, pPlayer->GetTeam(), TOWER_ID_NORTHPASS); break; case EVENT_NORTHPASS_CONTEST_ALLIANCE: case EVENT_NORTHPASS_CONTEST_HORDE: // handle event - in this case player's team will be the opposite team ProcessCaptureEvent(CONTESTED, pPlayer->GetTeam(), TOWER_ID_NORTHPASS); break; case EVENT_NORTHPASS_PROGRESS_ALLIANCE: ProcessCaptureEvent(PROGRESS, pPlayer->GetTeam(), TOWER_ID_NORTHPASS); sWorld.SendZoneText(ZONE_ID_EASTERN_PLAGUELANDS, sObjectMgr.GetMangosStringForDBCLocale(LANG_OPVP_EP_CAPTURE_NPT_A)); break; case EVENT_NORTHPASS_PROGRESS_HORDE: ProcessCaptureEvent(PROGRESS, pPlayer->GetTeam(), TOWER_ID_NORTHPASS); sWorld.SendZoneText(ZONE_ID_EASTERN_PLAGUELANDS, sObjectMgr.GetMangosStringForDBCLocale(LANG_OPVP_EP_CAPTURE_NPT_H)); break; case EVENT_NORTHPASS_NEUTRAL_ALLIANCE: // handle event - in this case player's team will be the opposite team ProcessCaptureEvent(NEUTRAL, pPlayer->GetTeam(), TOWER_ID_NORTHPASS); sWorld.SendZoneText(ZONE_ID_EASTERN_PLAGUELANDS, sObjectMgr.GetMangosStringForDBCLocale(LANG_OPVP_EP_LOOSE_NPT_A)); break; case EVENT_NORTHPASS_NEUTRAL_HORDE: // handle event - in this case player's team will be the opposite team ProcessCaptureEvent(NEUTRAL, pPlayer->GetTeam(), TOWER_ID_NORTHPASS); sWorld.SendZoneText(ZONE_ID_EASTERN_PLAGUELANDS, sObjectMgr.GetMangosStringForDBCLocale(LANG_OPVP_EP_LOOSE_NPT_H)); break; } break; case GO_BATTLEFIELD_BANNER_PLAGUELANDS_2: switch(uiEventId) { case EVENT_CROWNGUARD_WIN_ALLIANCE: case EVENT_CROWNGUARD_WIN_HORDE: ProcessCaptureEvent(WIN, pPlayer->GetTeam(), TOWER_ID_CROWNGUARD); break; case EVENT_CROWNGUARD_CONTEST_ALLIANCE: case EVENT_CROWNGUARD_CONTEST_HORDE: // handle event - in this case player's team will be the opposite team ProcessCaptureEvent(CONTESTED, pPlayer->GetTeam(), TOWER_ID_CROWNGUARD); break; case EVENT_CROWNGUARD_PROGRESS_ALLIANCE: ProcessCaptureEvent(PROGRESS, pPlayer->GetTeam(), TOWER_ID_CROWNGUARD); sWorld.SendZoneText(ZONE_ID_EASTERN_PLAGUELANDS, sObjectMgr.GetMangosStringForDBCLocale(LANG_OPVP_EP_CAPTURE_CGT_A)); break; case EVENT_CROWNGUARD_PROGRESS_HORDE: ProcessCaptureEvent(PROGRESS, pPlayer->GetTeam(), TOWER_ID_CROWNGUARD); sWorld.SendZoneText(ZONE_ID_EASTERN_PLAGUELANDS, sObjectMgr.GetMangosStringForDBCLocale(LANG_OPVP_EP_CAPTURE_CGT_H)); break; case EVENT_CROWNGUARD_NEUTRAL_ALLIANCE: // handle event - in this case player's team will be the opposite team ProcessCaptureEvent(NEUTRAL, pPlayer->GetTeam(), TOWER_ID_CROWNGUARD); sWorld.SendZoneText(ZONE_ID_EASTERN_PLAGUELANDS, sObjectMgr.GetMangosStringForDBCLocale(LANG_OPVP_EP_LOOSE_CGT_A)); break; case EVENT_CROWNGUARD_NEUTRAL_HORDE: // handle event - in this case player's team will be the opposite team ProcessCaptureEvent(NEUTRAL, pPlayer->GetTeam(), TOWER_ID_CROWNGUARD); sWorld.SendZoneText(ZONE_ID_EASTERN_PLAGUELANDS, sObjectMgr.GetMangosStringForDBCLocale(LANG_OPVP_EP_LOOSE_CGT_H)); break; } break; case GO_BATTLEFIELD_BANNER_PLAGUELANDS_3: switch(uiEventId) { case EVENT_EASTWALL_WIN_ALLIANCE: case EVENT_EASTWALL_WIN_HORDE: ProcessCaptureEvent(WIN, pPlayer->GetTeam(), TOWER_ID_EASTWALL); break; case EVENT_EASTWALL_CONTEST_ALLIANCE: case EVENT_EASTWALL_CONTEST_HORDE: // handle event - in this case player's team will be the opposite team ProcessCaptureEvent(CONTESTED, pPlayer->GetTeam(), TOWER_ID_EASTWALL); break; case EVENT_EASTWALL_PROGRESS_ALLIANCE: ProcessCaptureEvent(PROGRESS, pPlayer->GetTeam(), TOWER_ID_EASTWALL); sWorld.SendZoneText(ZONE_ID_EASTERN_PLAGUELANDS, sObjectMgr.GetMangosStringForDBCLocale(LANG_OPVP_EP_CAPTURE_EWT_A)); break; case EVENT_EASTWALL_PROGRESS_HORDE: ProcessCaptureEvent(PROGRESS, pPlayer->GetTeam(), TOWER_ID_EASTWALL); sWorld.SendZoneText(ZONE_ID_EASTERN_PLAGUELANDS, sObjectMgr.GetMangosStringForDBCLocale(LANG_OPVP_EP_CAPTURE_EWT_H)); break; case EVENT_EASTWALL_NEUTRAL_ALLIANCE: // handle event - in this case player's team will be the opposite team ProcessCaptureEvent(NEUTRAL, pPlayer->GetTeam(), TOWER_ID_EASTWALL); sWorld.SendZoneText(ZONE_ID_EASTERN_PLAGUELANDS, sObjectMgr.GetMangosStringForDBCLocale(LANG_OPVP_EP_LOOSE_EWT_A)); break; case EVENT_EASTWALL_NEUTRAL_HORDE: // handle event - in this case player's team will be the opposite team ProcessCaptureEvent(NEUTRAL, pPlayer->GetTeam(), TOWER_ID_EASTWALL); sWorld.SendZoneText(ZONE_ID_EASTERN_PLAGUELANDS, sObjectMgr.GetMangosStringForDBCLocale(LANG_OPVP_EP_LOOSE_EWT_H)); break; } break; case GO_BATTLEFIELD_BANNER_PLAGUELANDS_4: switch(uiEventId) { case EVENT_PLAGUEWOOD_WIN_ALLIANCE: case EVENT_PLAGUEWOOD_WIN_HORDE: ProcessCaptureEvent(WIN, pPlayer->GetTeam(), TOWER_ID_PLAGUEWOOD); break; case EVENT_PLAGUEWOOD_CONTEST_ALLIANCE: case EVENT_PLAGUEWOOD_CONTEST_HORDE: // handle event - in this case player's team will be the opposite team ProcessCaptureEvent(CONTESTED, pPlayer->GetTeam(), TOWER_ID_PLAGUEWOOD); break; case EVENT_PLAGUEWOOD_PROGRESS_ALLIANCE: ProcessCaptureEvent(PROGRESS, pPlayer->GetTeam(), TOWER_ID_PLAGUEWOOD); sWorld.SendZoneText(ZONE_ID_EASTERN_PLAGUELANDS, sObjectMgr.GetMangosStringForDBCLocale(LANG_OPVP_EP_CAPTURE_PWT_A)); break; case EVENT_PLAGUEWOOD_PROGRESS_HORDE: ProcessCaptureEvent(PROGRESS, pPlayer->GetTeam(), TOWER_ID_PLAGUEWOOD); sWorld.SendZoneText(ZONE_ID_EASTERN_PLAGUELANDS, sObjectMgr.GetMangosStringForDBCLocale(LANG_OPVP_EP_CAPTURE_PWT_H)); break; case EVENT_PLAGUEWOOD_NEUTRAL_ALLIANCE: // handle event - in this case player's team will be the opposite team ProcessCaptureEvent(NEUTRAL, pPlayer->GetTeam(), TOWER_ID_PLAGUEWOOD); sWorld.SendZoneText(ZONE_ID_EASTERN_PLAGUELANDS, sObjectMgr.GetMangosStringForDBCLocale(LANG_OPVP_EP_LOOSE_PWT_A)); break; case EVENT_PLAGUEWOOD_NEUTRAL_HORDE: // handle event - in this case player's team will be the opposite team ProcessCaptureEvent(NEUTRAL, pPlayer->GetTeam(), TOWER_ID_PLAGUEWOOD); sWorld.SendZoneText(ZONE_ID_EASTERN_PLAGUELANDS, sObjectMgr.GetMangosStringForDBCLocale(LANG_OPVP_EP_LOOSE_PWT_H)); break; } break; } }