diff options
Diffstat (limited to 'src')
21 files changed, 151 insertions, 178 deletions
diff --git a/src/server/authserver/Main.cpp b/src/server/authserver/Main.cpp index 69e0d5a1e64..701792293de 100644 --- a/src/server/authserver/Main.cpp +++ b/src/server/authserver/Main.cpp @@ -78,8 +78,8 @@ int main(int argc, char** argv) TC_LOG_INFO("server.authserver", "%s (authserver)", _FULLVERSION); TC_LOG_INFO("server.authserver", "<Ctrl-C> to stop.\n"); TC_LOG_INFO("server.authserver", "Using configuration file %s.", configFile.c_str()); - TC_LOG_INFO("server.worldserver", "Using SSL version: %s (library: %s)", OPENSSL_VERSION_TEXT, SSLeay_version(SSLEAY_VERSION)); - TC_LOG_INFO("server.worldserver", "Using Boost version: %i.%i.%i", BOOST_VERSION / 100000, BOOST_VERSION / 100 % 1000, BOOST_VERSION % 100); + TC_LOG_INFO("server.authserver", "Using SSL version: %s (library: %s)", OPENSSL_VERSION_TEXT, SSLeay_version(SSLEAY_VERSION)); + TC_LOG_INFO("server.authserver", "Using Boost version: %i.%i.%i", BOOST_VERSION / 100000, BOOST_VERSION / 100 % 1000, BOOST_VERSION % 100); // authserver PID file creation std::string pidFile = sConfigMgr->GetStringDefault("PidFile", ""); diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index d54b0572252..e38b9f352e9 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -60,7 +60,7 @@ namespace Trinity private: Player const* _player; ChatMsg _msgType; - int32 _textId; + uint32 _textId; uint32 _achievementId; }; } // namespace Trinity diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index ee93fc09f5e..ba8e8eafe79 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -2965,14 +2965,6 @@ void Player::GiveXP(uint32 xp, Unit* victim, float group_rate) sScriptMgr->OnGivePlayerXP(this, xp, victim); - // Favored experience increase START - uint32 zone = GetZoneId(); - float favored_exp_mult = 0; - if ((HasAura(32096) || HasAura(32098)) && (zone == 3483 || zone == 3562 || zone == 3836 || zone == 3713 || zone == 3714)) - favored_exp_mult = 0.05f; // Thrallmar's Favor and Honor Hold's Favor - xp = uint32(xp * (1 + favored_exp_mult)); - // Favored experience increase END - // XP to money conversion processed in Player::RewardQuest if (level >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) return; diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h index 3a680e30217..f4d1bc03144 100644 --- a/src/server/game/Miscellaneous/Language.h +++ b/src/server/game/Miscellaneous/Language.h @@ -1136,59 +1136,6 @@ enum TrinityStrings // Use for not-in-offcial-sources patches // 10000-10999 - // opvp hp - LANG_OPVP_HP_CAPTURE_OVERLOOK_H = 10001, - LANG_OPVP_HP_CAPTURE_OVERLOOK_A = 10002, - LANG_OPVP_HP_CAPTURE_STADIUM_H = 10003, - LANG_OPVP_HP_CAPTURE_STADIUM_A = 10004, - LANG_OPVP_HP_CAPTURE_BROKENHILL_H = 10005, - LANG_OPVP_HP_CAPTURE_BROKENHILL_A = 10006, - LANG_OPVP_HP_LOSE_OVERLOOK_H = 10007, - LANG_OPVP_HP_LOSE_OVERLOOK_A = 10008, - LANG_OPVP_HP_LOSE_STADIUM_H = 10009, - LANG_OPVP_HP_LOSE_STADIUM_A = 10010, - LANG_OPVP_HP_LOSE_BROKENHILL_H = 10011, - LANG_OPVP_HP_LOSE_BROKENHILL_A = 10012, - // opvp zm - LANG_OPVP_ZM_CAPTURE_WEST_H = 10013, - LANG_OPVP_ZM_CAPTURE_WEST_A = 10014, - LANG_OPVP_ZM_CAPTURE_EAST_H = 10015, - LANG_OPVP_ZM_CAPTURE_EAST_A = 10016, - LANG_OPVP_ZM_CAPTURE_GY_H = 10017, - LANG_OPVP_ZM_CAPTURE_GY_A = 10018, - LANG_OPVP_ZM_LOSE_WEST_H = 10019, - LANG_OPVP_ZM_LOSE_WEST_A = 10020, - LANG_OPVP_ZM_LOSE_EAST_H = 10021, - LANG_OPVP_ZM_LOSE_EAST_A = 10022, - LANG_OPVP_ZM_LOSE_GY_H = 10023, - LANG_OPVP_ZM_LOSE_GY_A = 10024, - // opvp na - LANG_OPVP_NA_CAPTURE_H = 10025, - LANG_OPVP_NA_CAPTURE_A = 10026, - LANG_OPVP_NA_LOSE_H = 10027, - LANG_OPVP_NA_LOSE_A = 10028, - // opvp tf - LANG_OPVP_TF_CAPTURE_H = 10029, - LANG_OPVP_TF_CAPTURE_A = 10030, - LANG_OPVP_TF_LOSE_H = 10031, - LANG_OPVP_TF_LOSE_A = 10032, - // opvp ep - LANG_OPVP_EP_CAPTURE_NPT_H = 10033, - LANG_OPVP_EP_CAPTURE_NPT_A = 10034, - LANG_OPVP_EP_CAPTURE_EWT_H = 10035, - LANG_OPVP_EP_CAPTURE_EWT_A = 10036, - LANG_OPVP_EP_CAPTURE_CGT_H = 10037, - LANG_OPVP_EP_CAPTURE_CGT_A = 10038, - LANG_OPVP_EP_CAPTURE_PWT_H = 10039, - LANG_OPVP_EP_CAPTURE_PWT_A = 10040, - LANG_OPVP_EP_LOSE_NPT_H = 10041, - LANG_OPVP_EP_LOSE_NPT_A = 10042, - LANG_OPVP_EP_LOSE_EWT_H = 10043, - LANG_OPVP_EP_LOSE_EWT_A = 10044, - LANG_OPVP_EP_LOSE_CGT_H = 10045, - LANG_OPVP_EP_LOSE_CGT_A = 10046, - LANG_OPVP_EP_LOSE_PWT_H = 10047, - LANG_OPVP_EP_LOSE_PWT_A = 10048, // opvp si LANG_OPVP_SI_CAPTURE_H = 10049, LANG_OPVP_SI_CAPTURE_A = 10050, diff --git a/src/server/game/OutdoorPvP/OutdoorPvP.cpp b/src/server/game/OutdoorPvP/OutdoorPvP.cpp index cacec14d5e6..976b5d3c0d7 100644 --- a/src/server/game/OutdoorPvP/OutdoorPvP.cpp +++ b/src/server/game/OutdoorPvP/OutdoorPvP.cpp @@ -25,10 +25,29 @@ #include "WorldPacket.h" #include "GridNotifiers.h" #include "GridNotifiersImpl.h" -#include "GridNotifiers.h" -#include "GridNotifiersImpl.h" #include "CellImpl.h" +class DefenseMessageBuilder +{ + public: + DefenseMessageBuilder(uint32 zoneId, uint32 id) + : _zoneId(zoneId), _id(id) { } + + void operator()(WorldPacket& data, LocaleConstant locale) const + { + std::string text = sOutdoorPvPMgr->GetDefenseMessage(_zoneId, _id, locale); + + data.Initialize(SMSG_DEFENSE_MESSAGE, 4 + 4 + text.length()); + data.append<uint32>(_zoneId); + data.append<uint32>(text.length()); + data << text; + } + + private: + uint32 _zoneId; ///< ZoneId + uint32 _id; ///< BroadcastTextId +}; + OPvPCapturePoint::OPvPCapturePoint(OutdoorPvP* pvp): m_capturePointGUID(0), m_capturePoint(NULL), m_maxValue(0.0f), m_minValue(0.0f), m_maxSpeed(0), m_value(0), m_team(TEAM_NEUTRAL), m_OldState(OBJECTIVESTATE_NEUTRAL), @@ -616,3 +635,10 @@ void OutdoorPvP::OnGameObjectRemove(GameObject* go) if (OPvPCapturePoint *cp = GetCapturePoint(go->GetDBTableGUIDLow())) cp->m_capturePoint = NULL; } + +void OutdoorPvP::SendDefenseMessage(uint32 zoneId, uint32 id) +{ + DefenseMessageBuilder builder(zoneId, id); + Trinity::LocalizedPacketDo<DefenseMessageBuilder> localizer(builder); + BroadcastWorker(localizer, zoneId); +} diff --git a/src/server/game/OutdoorPvP/OutdoorPvP.h b/src/server/game/OutdoorPvP/OutdoorPvP.h index 9a7cc92c2ed..ba2d7ae9d1b 100644 --- a/src/server/game/OutdoorPvP/OutdoorPvP.h +++ b/src/server/game/OutdoorPvP/OutdoorPvP.h @@ -261,6 +261,8 @@ class OutdoorPvP : public ZoneScript } } + void SendDefenseMessage(uint32 zoneId, uint32 id); + protected: // the map of the objectives belonging to this outdoorpvp @@ -300,6 +302,16 @@ class OutdoorPvP : public ZoneScript bool HasPlayer(Player const* player) const; void TeamCastSpell(TeamId team, int32 spellId); + + template<class Worker> + void BroadcastWorker(Worker& _worker, uint32 zoneId) + { + for (uint32 i = 0; i < BG_TEAMS_COUNT; ++i) + for (PlayerSet::iterator itr = m_players[i].begin(); itr != m_players[i].end(); ++itr) + if (Player* player = ObjectAccessor::FindPlayer(*itr)) + if (player->GetZoneId() == zoneId) + _worker(player); + } }; #endif /*OUTDOOR_PVP_H_*/ diff --git a/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp b/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp index 2b05f7255f6..5306a3ca3c1 100644 --- a/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp +++ b/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp @@ -228,3 +228,12 @@ void OutdoorPvPMgr::HandlePlayerResurrects(Player* player, uint32 zoneid) if (itr->second->HasPlayer(player)) itr->second->HandlePlayerResurrects(player, zoneid); } + +std::string OutdoorPvPMgr::GetDefenseMessage(uint32 zoneId, uint32 id, LocaleConstant locale) const +{ + if (BroadcastText const* bct = sObjectMgr->GetBroadcastText(id)) + return bct->GetText(locale); + + TC_LOG_ERROR("outdoorpvp", "Can not find DefenseMessage (Zone: %u, Id: %u). BroadcastText (Id: %u) does not exist.", zoneId, id, id); + return ""; +} diff --git a/src/server/game/OutdoorPvP/OutdoorPvPMgr.h b/src/server/game/OutdoorPvP/OutdoorPvPMgr.h index 1a9db2b682e..bf2f14a291f 100644 --- a/src/server/game/OutdoorPvP/OutdoorPvPMgr.h +++ b/src/server/game/OutdoorPvP/OutdoorPvPMgr.h @@ -84,6 +84,8 @@ class OutdoorPvPMgr void HandleDropFlag(Player* player, uint32 spellId); + std::string GetDefenseMessage(uint32 zoneId, uint32 id, LocaleConstant locale) const; + private: typedef std::vector<OutdoorPvP*> OutdoorPvPSet; typedef std::map<uint32 /* zoneid */, OutdoorPvP*> OutdoorPvPMap; diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index 99c2d27ed03..e5fea7e6b6b 100644 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -199,7 +199,7 @@ void WorldSocket::HandleAuthSession(WorldPacket& recvPacket) unk3, clientSeed); - // Get the account information from the realmd database + // Get the account information from the auth database // 0 1 2 3 4 5 6 7 8 // SELECT id, sessionkey, last_ip, locked, expansion, mutetime, locale, recruiter, os FROM account WHERE username = ? PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_INFO_BY_NAME); @@ -239,7 +239,7 @@ void WorldSocket::HandleAuthSession(WorldPacket& recvPacket) // id has to be fetched at this point, so that first actual account response that fails can be logged id = fields[0].GetUInt32(); - ///- Re-check ip locking (same check as in realmd). + ///- Re-check ip locking (same check as in auth). if (fields[3].GetUInt8() == 1) // if ip is locked { if (strcmp(fields[2].GetCString(), address.c_str())) @@ -299,7 +299,7 @@ void WorldSocket::HandleAuthSession(WorldPacket& recvPacket) security = fields[0].GetUInt8(); } - // Re-check account ban (same check as in realmd) + // Re-check account ban (same check as in auth) stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_BANS); stmt->setUInt32(0, id); diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp index 687eb3f388d..45d52d7f560 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp @@ -24,8 +24,6 @@ #include "ObjectAccessor.h" #include "OutdoorPvPMgr.h" #include "Creature.h" -#include "Language.h" -#include "World.h" #include "GossipDef.h" OPvPCapturePointEP_EWT::OPvPCapturePointEP_EWT(OutdoorPvP* pvp) @@ -38,16 +36,8 @@ OPvPCapturePointEP_EWT::OPvPCapturePointEP_EWT(OutdoorPvP* pvp) void OPvPCapturePointEP_EWT::ChangeState() { // if changing from controlling alliance to horde or vice versa - if ( m_OldState == OBJECTIVESTATE_ALLIANCE && m_OldState != m_State ) - { - sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_EWT_A)); + if (m_OldState == OBJECTIVESTATE_ALLIANCE || m_OldState == OBJECTIVESTATE_HORDE) ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_EWT, 0); - } - else if ( m_OldState == OBJECTIVESTATE_HORDE && m_OldState != m_State ) - { - sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_EWT_H)); - ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_EWT, 0); - } uint32 artkit = 21; @@ -58,14 +48,14 @@ void OPvPCapturePointEP_EWT::ChangeState() artkit = 2; SummonSupportUnitAtNorthpassTower(ALLIANCE); ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_EWT, ALLIANCE); - if (m_OldState != m_State) sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_EWT_A)); + m_PvP->SendDefenseMessage(EP_GraveYardZone, TEXT_EASTWALL_TOWER_TAKEN_ALLIANCE); break; case OBJECTIVESTATE_HORDE: m_TowerState = EP_TS_H; artkit = 1; SummonSupportUnitAtNorthpassTower(HORDE); ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_EWT, HORDE); - if (m_OldState != m_State) sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_EWT_H)); + m_PvP->SendDefenseMessage(EP_GraveYardZone, TEXT_EASTWALL_TOWER_TAKEN_HORDE); break; case OBJECTIVESTATE_NEUTRAL: m_TowerState = EP_TS_N; @@ -176,16 +166,8 @@ OPvPCapturePointEP_NPT::OPvPCapturePointEP_NPT(OutdoorPvP* pvp) void OPvPCapturePointEP_NPT::ChangeState() { // if changing from controlling alliance to horde or vice versa - if ( m_OldState == OBJECTIVESTATE_ALLIANCE && m_OldState != m_State ) - { - sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_NPT_A)); + if (m_OldState == OBJECTIVESTATE_ALLIANCE || m_OldState == OBJECTIVESTATE_HORDE) ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_NPT, 0); - } - else if ( m_OldState == OBJECTIVESTATE_HORDE && m_OldState != m_State ) - { - sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_NPT_H)); - ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_NPT, 0); - } uint32 artkit = 21; @@ -196,14 +178,14 @@ void OPvPCapturePointEP_NPT::ChangeState() artkit = 2; SummonGO(ALLIANCE); ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_NPT, ALLIANCE); - if (m_OldState != m_State) sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_NPT_A)); + m_PvP->SendDefenseMessage(EP_GraveYardZone, TEXT_NORTHPASS_TOWER_TAKEN_ALLIANCE); break; case OBJECTIVESTATE_HORDE: m_TowerState = EP_TS_H; artkit = 1; SummonGO(HORDE); ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_NPT, HORDE); - if (m_OldState != m_State) sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_NPT_H)); + m_PvP->SendDefenseMessage(EP_GraveYardZone, TEXT_NORTHPASS_TOWER_TAKEN_HORDE); break; case OBJECTIVESTATE_NEUTRAL: m_TowerState = EP_TS_N; @@ -318,16 +300,8 @@ OPvPCapturePointEP_CGT::OPvPCapturePointEP_CGT(OutdoorPvP* pvp) void OPvPCapturePointEP_CGT::ChangeState() { // if changing from controlling alliance to horde or vice versa - if ( m_OldState == OBJECTIVESTATE_ALLIANCE && m_OldState != m_State ) - { - sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_CGT_A)); + if (m_OldState == OBJECTIVESTATE_ALLIANCE || m_OldState == OBJECTIVESTATE_HORDE) ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_CGT, 0); - } - else if ( m_OldState == OBJECTIVESTATE_HORDE && m_OldState != m_State ) - { - sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_CGT_H)); - ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_CGT, 0); - } uint32 artkit = 21; @@ -338,14 +312,14 @@ void OPvPCapturePointEP_CGT::ChangeState() artkit = 2; LinkGraveYard(ALLIANCE); ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_CGT, ALLIANCE); - if (m_OldState != m_State) sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_CGT_A)); + m_PvP->SendDefenseMessage(EP_GraveYardZone, TEXT_CROWN_GUARD_TOWER_TAKEN_ALLIANCE); break; case OBJECTIVESTATE_HORDE: m_TowerState = EP_TS_H; artkit = 1; LinkGraveYard(HORDE); ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_CGT, HORDE); - if (m_OldState != m_State) sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_CGT_H)); + m_PvP->SendDefenseMessage(EP_GraveYardZone, TEXT_CROWN_GUARD_TOWER_TAKEN_HORDE); break; case OBJECTIVESTATE_NEUTRAL: m_TowerState = EP_TS_N; @@ -447,16 +421,8 @@ OPvPCapturePointEP_PWT::OPvPCapturePointEP_PWT(OutdoorPvP* pvp) void OPvPCapturePointEP_PWT::ChangeState() { // if changing from controlling alliance to horde or vice versa - if ( m_OldState == OBJECTIVESTATE_ALLIANCE && m_OldState != m_State ) - { - sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_PWT_A)); + if ( m_OldState == OBJECTIVESTATE_ALLIANCE || m_OldState == OBJECTIVESTATE_HORDE) ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_PWT, 0); - } - else if ( m_OldState == OBJECTIVESTATE_HORDE && m_OldState != m_State ) - { - sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_PWT_H)); - ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_PWT, 0); - } uint32 artkit = 21; @@ -467,14 +433,14 @@ void OPvPCapturePointEP_PWT::ChangeState() SummonFlightMaster(ALLIANCE); artkit = 2; ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_PWT, ALLIANCE); - if (m_OldState != m_State) sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_PWT_A)); + m_PvP->SendDefenseMessage(EP_GraveYardZone, TEXT_PLAGUEWOOD_TOWER_TAKEN_ALLIANCE); break; case OBJECTIVESTATE_HORDE: m_TowerState = EP_TS_H; SummonFlightMaster(HORDE); artkit = 1; ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_PWT, HORDE); - if (m_OldState != m_State) sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_PWT_H)); + m_PvP->SendDefenseMessage(EP_GraveYardZone, TEXT_PLAGUEWOOD_TOWER_TAKEN_HORDE); break; case OBJECTIVESTATE_NEUTRAL: m_TowerState = EP_TS_N; diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPEP.h b/src/server/scripts/OutdoorPvP/OutdoorPvPEP.h index 50b412348cf..923010e7192 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPEP.h +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPEP.h @@ -18,9 +18,22 @@ #ifndef OUTDOOR_PVP_EP_ #define OUTDOOR_PVP_EP_ -#include "DBCStructure.h" #include "OutdoorPvP.h" +enum DefenseMessages +{ + TEXT_PLAGUEWOOD_TOWER_TAKEN_ALLIANCE = 13629, // '|cffffff00The Plaguewood Tower has been taken by the Alliance!|r' + TEXT_NORTHPASS_TOWER_TAKEN_ALLIANCE = 13630, // '|cffffff00Northpass Tower has been taken by the Alliance!|r' + TEXT_EASTWALL_TOWER_TAKEN_ALLIANCE = 13631, // '|cffffff00Eastwall Tower has been taken by the Alliance!|r' + TEXT_CROWN_GUARD_TOWER_TAKEN_ALLIANCE = 13632, // '|cffffff00Crown Guard Tower has been taken by the Alliance!|r' + TEXT_PLAGUEWOOD_TOWER_TAKEN_HORDE = 13634, // '|cffffff00The Plaguewood Tower has been taken by the Horde!|r' + TEXT_NORTHPASS_TOWER_TAKEN_HORDE = 13635, // '|cffffff00Northpass Tower has been taken by the Horde!|r' + TEXT_EASTWALL_TOWER_TAKEN_HORDE = 13636, // '|cffffff00Eastwall Tower has been taken by the Horde!|r' + TEXT_CROWN_GUARD_TOWER_TAKEN_HORDE = 13633, // '|cffffff00Crown Guard Tower has been taken by the Horde!|r' + TEXT_ALL_TOWERS_IN_CONTROL_ALLIANCE = 13638, // (NYI) '|cff33ccffAll four towers are now in control of the Alliance!|r' + TEXT_ALL_TOWERS_IN_CONTROL_HORDE = 13637, // (NYI) '|cffff0000All four towers are now in control of the Horde!|r' +}; + const uint32 EP_AllianceBuffs[4] = {11413, 11414, 11415, 1386}; const uint32 EP_HordeBuffs[4] = {30880, 30683, 30682, 29520}; diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp index 99b782336ec..d8f5c0f654f 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp @@ -20,18 +20,12 @@ #include "OutdoorPvP.h" #include "OutdoorPvPMgr.h" #include "Player.h" -#include "WorldPacket.h" -#include "World.h" #include "ObjectMgr.h" -#include "Language.h" - -const uint32 HP_LANG_LOSE_A[HP_TOWER_NUM] = {LANG_OPVP_HP_LOSE_BROKENHILL_A, LANG_OPVP_HP_LOSE_OVERLOOK_A, LANG_OPVP_HP_LOSE_STADIUM_A}; - -const uint32 HP_LANG_LOSE_H[HP_TOWER_NUM] = {LANG_OPVP_HP_LOSE_BROKENHILL_H, LANG_OPVP_HP_LOSE_OVERLOOK_H, LANG_OPVP_HP_LOSE_STADIUM_H}; +#include "WorldPacket.h" -const uint32 HP_LANG_CAPTURE_A[HP_TOWER_NUM] = {LANG_OPVP_HP_CAPTURE_BROKENHILL_A, LANG_OPVP_HP_CAPTURE_OVERLOOK_A, LANG_OPVP_HP_CAPTURE_STADIUM_A}; +const uint32 HP_LANG_CAPTURE_A[HP_TOWER_NUM] = { TEXT_BROKEN_HILL_TAKEN_ALLIANCE, TEXT_OVERLOOK_TAKEN_ALLIANCE, TEXT_STADIUM_TAKEN_ALLIANCE }; -const uint32 HP_LANG_CAPTURE_H[HP_TOWER_NUM] = {LANG_OPVP_HP_CAPTURE_BROKENHILL_H, LANG_OPVP_HP_CAPTURE_OVERLOOK_H, LANG_OPVP_HP_CAPTURE_STADIUM_H}; +const uint32 HP_LANG_CAPTURE_H[HP_TOWER_NUM] = { TEXT_BROKEN_HILL_TAKEN_HORDE, TEXT_OVERLOOK_TAKEN_HORDE, TEXT_STADIUM_TAKEN_HORDE }; OPvPCapturePointHP::OPvPCapturePointHP(OutdoorPvP* pvp, OutdoorPvPHPTowerType type) : OPvPCapturePoint(pvp), m_TowerType(type) @@ -177,13 +171,11 @@ void OPvPCapturePointHP::ChangeState() field = HP_MAP_A[m_TowerType]; if (uint32 alliance_towers = ((OutdoorPvPHP*)m_PvP)->GetAllianceTowersControlled()) ((OutdoorPvPHP*)m_PvP)->SetAllianceTowersControlled(--alliance_towers); - sWorld->SendZoneText(OutdoorPvPHPBuffZones[0], sObjectMgr->GetTrinityStringForDBCLocale(HP_LANG_LOSE_A[m_TowerType])); break; case OBJECTIVESTATE_HORDE: field = HP_MAP_H[m_TowerType]; if (uint32 horde_towers = ((OutdoorPvPHP*)m_PvP)->GetHordeTowersControlled()) ((OutdoorPvPHP*)m_PvP)->SetHordeTowersControlled(--horde_towers); - sWorld->SendZoneText(OutdoorPvPHPBuffZones[0], sObjectMgr->GetTrinityStringForDBCLocale(HP_LANG_LOSE_H[m_TowerType])); break; case OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE: field = HP_MAP_N[m_TowerType]; @@ -220,7 +212,7 @@ void OPvPCapturePointHP::ChangeState() uint32 alliance_towers = ((OutdoorPvPHP*)m_PvP)->GetAllianceTowersControlled(); if (alliance_towers < 3) ((OutdoorPvPHP*)m_PvP)->SetAllianceTowersControlled(++alliance_towers); - sWorld->SendZoneText(OutdoorPvPHPBuffZones[0], sObjectMgr->GetTrinityStringForDBCLocale(HP_LANG_CAPTURE_A[m_TowerType])); + m_PvP->SendDefenseMessage(OutdoorPvPHPBuffZones[0], HP_LANG_CAPTURE_A[m_TowerType]); break; } case OBJECTIVESTATE_HORDE: @@ -231,7 +223,7 @@ void OPvPCapturePointHP::ChangeState() uint32 horde_towers = ((OutdoorPvPHP*)m_PvP)->GetHordeTowersControlled(); if (horde_towers < 3) ((OutdoorPvPHP*)m_PvP)->SetHordeTowersControlled(++horde_towers); - sWorld->SendZoneText(OutdoorPvPHPBuffZones[0], sObjectMgr->GetTrinityStringForDBCLocale(HP_LANG_CAPTURE_H[m_TowerType])); + m_PvP->SendDefenseMessage(OutdoorPvPHPBuffZones[0], HP_LANG_CAPTURE_H[m_TowerType]); break; } case OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE: diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPHP.h b/src/server/scripts/OutdoorPvP/OutdoorPvPHP.h index fa78da4732d..e2140ac9941 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPHP.h +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPHP.h @@ -20,6 +20,16 @@ #include "OutdoorPvP.h" +enum DefenseMessages +{ + TEXT_OVERLOOK_TAKEN_ALLIANCE = 14841, // '|cffffff00The Overlook has been taken by the Alliance!|r' + TEXT_OVERLOOK_TAKEN_HORDE = 14842, // '|cffffff00The Overlook has been taken by the Horde!|r' + TEXT_STADIUM_TAKEN_ALLIANCE = 14843, // '|cffffff00The Stadium has been taken by the Alliance!|r' + TEXT_STADIUM_TAKEN_HORDE = 14844, // '|cffffff00The Stadium has been taken by the Horde!|r' + TEXT_BROKEN_HILL_TAKEN_ALLIANCE = 14845, // '|cffffff00Broken Hill has been taken by the Alliance!|r' + TEXT_BROKEN_HILL_TAKEN_HORDE = 14846, // '|cffffff00Broken Hill has been taken by the Horde!|r' +}; + #define OutdoorPvPHPBuffZonesNum 6 // HP, citadel, ramparts, blood furnace, shattered halls, mag's lair const uint32 OutdoorPvPHPBuffZones[OutdoorPvPHPBuffZonesNum] = { 3483, 3563, 3562, 3713, 3714, 3836 }; diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp index 9008b0867d7..1b6b19115b9 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp @@ -21,8 +21,6 @@ #include "ObjectMgr.h" #include "OutdoorPvPMgr.h" #include "WorldPacket.h" -#include "Language.h" -#include "World.h" OutdoorPvPNA::OutdoorPvPNA() { @@ -135,10 +133,6 @@ void OPvPCapturePointNA::FactionTakeOver(uint32 team) { if (m_ControllingFaction) sObjectMgr->RemoveGraveYardLink(NA_HALAA_GRAVEYARD, NA_HALAA_GRAVEYARD_ZONE, m_ControllingFaction, false); - if (m_ControllingFaction == ALLIANCE) - sWorld->SendZoneText(NA_HALAA_GRAVEYARD_ZONE, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_NA_LOSE_A)); - else if (m_ControllingFaction == HORDE) - sWorld->SendZoneText(NA_HALAA_GRAVEYARD_ZONE, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_NA_LOSE_H)); m_ControllingFaction = team; if (m_ControllingFaction) @@ -160,7 +154,7 @@ void OPvPCapturePointNA::FactionTakeOver(uint32 team) m_PvP->SendUpdateWorldState(NA_UI_HORDE_GUARDS_SHOW, 0); m_PvP->SendUpdateWorldState(NA_UI_ALLIANCE_GUARDS_SHOW, 1); m_PvP->SendUpdateWorldState(NA_UI_GUARDS_LEFT, m_GuardsAlive); - sWorld->SendZoneText(NA_HALAA_GRAVEYARD_ZONE, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_NA_CAPTURE_A)); + m_PvP->SendDefenseMessage(NA_HALAA_GRAVEYARD_ZONE, TEXT_HALAA_TAKEN_ALLIANCE); } else { @@ -172,7 +166,7 @@ void OPvPCapturePointNA::FactionTakeOver(uint32 team) m_PvP->SendUpdateWorldState(NA_UI_HORDE_GUARDS_SHOW, 1); m_PvP->SendUpdateWorldState(NA_UI_ALLIANCE_GUARDS_SHOW, 0); m_PvP->SendUpdateWorldState(NA_UI_GUARDS_LEFT, m_GuardsAlive); - sWorld->SendZoneText(NA_HALAA_GRAVEYARD_ZONE, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_NA_CAPTURE_H)); + m_PvP->SendDefenseMessage(NA_HALAA_GRAVEYARD_ZONE, TEXT_HALAA_TAKEN_HORDE); } UpdateWyvernRoostWorldState(NA_ROOST_S); UpdateWyvernRoostWorldState(NA_ROOST_N); diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPNA.h b/src/server/scripts/OutdoorPvP/OutdoorPvPNA.h index 011775e1715..eccf74afa35 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPNA.h +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPNA.h @@ -20,6 +20,16 @@ #include "OutdoorPvP.h" +enum DefenseMessages +{ + TEXT_ALL_GUARDS_DEFEATED = 15017, // (NYI) '|cffffff00All the guards have been defeated!|r' + TEXT_HALAA_TAKEN_ALLIANCE = 15018, // '|cffffff00The Alliance has taken control of Halaa!|r' + TEXT_HALAA_TAKEN_HORDE = 15019, // '|cffffff00The Horde has taken control of Halaa!|r' + TEXT_HALAA_DEFENSELESS = 15020, // (NYI) '|cffffff00Halaa is defenseless!|r' + TEXT_HALAA_GAINING_CONTROL_HORDE = 15493, // (NYI) '|cffffff00The Horde is gaining control of Halaa!|r' + TEXT_HALAA_GAINING_CONTROL_ALLIANCE = 15494 // (NYI) '|cffffff00The Alliance is gaining control of Halaa!|r' +}; + /// @todo "sometimes" set to neutral enum OutdoorPvPNASpells diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp index a3ef9ce7b5c..66c7564fc5c 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp @@ -95,6 +95,7 @@ bool OutdoorPvPSI::HandleAreaTrigger(Player* player, uint32 trigger) if (m_Gathered_A >= SI_MAX_RESOURCES) { TeamApplyBuff(TEAM_ALLIANCE, SI_CENARION_FAVOR); + /// @todo: confirm this text sWorld->SendZoneText(OutdoorPvPSIBuffZones[0], sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_SI_CAPTURE_A)); m_LastController = ALLIANCE; m_Gathered_A = 0; @@ -120,6 +121,7 @@ bool OutdoorPvPSI::HandleAreaTrigger(Player* player, uint32 trigger) if (m_Gathered_H >= SI_MAX_RESOURCES) { TeamApplyBuff(TEAM_HORDE, SI_CENARION_FAVOR); + /// @todo: confirm this text sWorld->SendZoneText(OutdoorPvPSIBuffZones[0], sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_SI_CAPTURE_H)); m_LastController = HORDE; m_Gathered_A = 0; diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp index c8c707a1958..cafbd2188fb 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp @@ -22,8 +22,6 @@ #include "WorldPacket.h" #include "Player.h" #include "ObjectMgr.h" -#include "Language.h" -#include "World.h" OutdoorPvPTF::OutdoorPvPTF() { @@ -286,14 +284,14 @@ void OPvPCapturePointTF::ChangeState() { if (uint32 alliance_towers = ((OutdoorPvPTF*)m_PvP)->GetAllianceTowersControlled()) ((OutdoorPvPTF*)m_PvP)->SetAllianceTowersControlled(--alliance_towers); - sWorld->SendZoneText(OutdoorPvPTFBuffZones[0], sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_TF_LOSE_A)); + m_PvP->SendDefenseMessage(OutdoorPvPTFBuffZones[0], TEXT_SPIRIT_TOWER_LOSE_ALLIANCE); } // if changing from controlling horde to alliance else if (m_OldState == OBJECTIVESTATE_HORDE) { if (uint32 horde_towers = ((OutdoorPvPTF*)m_PvP)->GetHordeTowersControlled()) ((OutdoorPvPTF*)m_PvP)->SetHordeTowersControlled(--horde_towers); - sWorld->SendZoneText(OutdoorPvPTFBuffZones[0], sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_TF_LOSE_H)); + m_PvP->SendDefenseMessage(OutdoorPvPTFBuffZones[0], TEXT_SPIRIT_TOWER_LOSE_HORDE); } uint32 artkit = 21; @@ -308,7 +306,7 @@ void OPvPCapturePointTF::ChangeState() if (alliance_towers < TF_TOWER_NUM) ((OutdoorPvPTF*)m_PvP)->SetAllianceTowersControlled(++alliance_towers); - sWorld->SendZoneText(OutdoorPvPTFBuffZones[0], sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_TF_CAPTURE_A)); + m_PvP->SendDefenseMessage(OutdoorPvPTFBuffZones[0], TEXT_SPIRIT_TOWER_TAKEN_ALLIANCE); for (PlayerSet::iterator itr = m_activePlayers[0].begin(); itr != m_activePlayers[0].end(); ++itr) if (Player* player = ObjectAccessor::FindPlayer(*itr)) @@ -323,7 +321,7 @@ void OPvPCapturePointTF::ChangeState() if (horde_towers < TF_TOWER_NUM) ((OutdoorPvPTF*)m_PvP)->SetHordeTowersControlled(++horde_towers); - sWorld->SendZoneText(OutdoorPvPTFBuffZones[0], sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_TF_CAPTURE_H)); + m_PvP->SendDefenseMessage(OutdoorPvPTFBuffZones[0], TEXT_SPIRIT_TOWER_TAKEN_HORDE); for (PlayerSet::iterator itr = m_activePlayers[1].begin(); itr != m_activePlayers[1].end(); ++itr) if (Player* player = ObjectAccessor::FindPlayer(*itr)) diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPTF.h b/src/server/scripts/OutdoorPvP/OutdoorPvPTF.h index 2c4ad0445be..6d2d5e45575 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPTF.h +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPTF.h @@ -20,6 +20,16 @@ #include "OutdoorPvP.h" +enum DefenseMessages +{ + TEXT_BONE_WASTES_TAKEN_ALLIANCE = 16120, // (NYI) '|cffffff00The Alliance has taken control of The Bone Wastes!|r' + TEXT_BONE_WASTES_TAKEN_HORDE = 16119, // (NYI) '|cffffff00The Horde has taken control of The Bone Wastes!|r' + TEXT_SPIRIT_TOWER_TAKEN_ALLIANCE = 18285, // '|cffffff00The Alliance has taken control of a Spirit Tower!|r' + TEXT_SPIRIT_TOWER_TAKEN_HORDE = 18286, // '|cffffff00The Horde has taken control of a Spirit Tower!|r' + TEXT_SPIRIT_TOWER_LOSE_ALLIANCE = 18288, // '|cffffff00The Alliance has lost control of a Spirit Tower!|r' + TEXT_SPIRIT_TOWER_LOSE_HORDE = 18287 // '|cffffff00The Horde has lost control of a Spirit Tower!|r' +}; + const uint8 OutdoorPvPTFBuffZonesNum = 5; const uint32 OutdoorPvPTFBuffZones[OutdoorPvPTFBuffZonesNum] = diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp index d54a4f7d4d7..85978b64eed 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp @@ -24,7 +24,6 @@ #include "ObjectAccessor.h" #include "WorldPacket.h" #include "GossipDef.h" -#include "World.h" OPvPCapturePointZM_Beacon::OPvPCapturePointZM_Beacon(OutdoorPvP* pvp, ZM_BeaconType type) : OPvPCapturePoint(pvp), m_TowerType(type), m_TowerState(ZM_TOWERSTATE_N) @@ -78,14 +77,12 @@ void OPvPCapturePointZM_Beacon::ChangeState() { if (uint32 alliance_towers = ((OutdoorPvPZM*)m_PvP)->GetAllianceTowersControlled()) ((OutdoorPvPZM*)m_PvP)->SetAllianceTowersControlled(--alliance_towers); - sWorld->SendZoneText(ZM_GRAVEYARD_ZONE, sObjectMgr->GetTrinityStringForDBCLocale(ZMBeaconLoseA[m_TowerType])); } // if changing from controlling horde to alliance else if (m_OldState == OBJECTIVESTATE_HORDE) { if (uint32 horde_towers = ((OutdoorPvPZM*)m_PvP)->GetHordeTowersControlled()) ((OutdoorPvPZM*)m_PvP)->SetHordeTowersControlled(--horde_towers); - sWorld->SendZoneText(ZM_GRAVEYARD_ZONE, sObjectMgr->GetTrinityStringForDBCLocale(ZMBeaconLoseH[m_TowerType])); } switch (m_State) @@ -96,7 +93,7 @@ void OPvPCapturePointZM_Beacon::ChangeState() uint32 alliance_towers = ((OutdoorPvPZM*)m_PvP)->GetAllianceTowersControlled(); if (alliance_towers < ZM_NUM_BEACONS) ((OutdoorPvPZM*)m_PvP)->SetAllianceTowersControlled(++alliance_towers); - sWorld->SendZoneText(ZM_GRAVEYARD_ZONE, sObjectMgr->GetTrinityStringForDBCLocale(ZMBeaconCaptureA[m_TowerType])); + m_PvP->SendDefenseMessage(ZM_GRAVEYARD_ZONE, ZMBeaconCaptureA[m_TowerType]); break; } case OBJECTIVESTATE_HORDE: @@ -105,7 +102,7 @@ void OPvPCapturePointZM_Beacon::ChangeState() uint32 horde_towers = ((OutdoorPvPZM*)m_PvP)->GetHordeTowersControlled(); if (horde_towers < ZM_NUM_BEACONS) ((OutdoorPvPZM*)m_PvP)->SetHordeTowersControlled(++horde_towers); - sWorld->SendZoneText(ZM_GRAVEYARD_ZONE, sObjectMgr->GetTrinityStringForDBCLocale(ZMBeaconCaptureH[m_TowerType])); + m_PvP->SendDefenseMessage(ZM_GRAVEYARD_ZONE, ZMBeaconCaptureH[m_TowerType]); break; } case OBJECTIVESTATE_NEUTRAL: @@ -220,8 +217,6 @@ int32 OPvPCapturePointZM_GraveYard::HandleOpenGo(Player* player, uint64 guid) { if (player->HasAura(ZM_BATTLE_STANDARD_A) && m_GraveYardState != ZM_GRAVEYARD_A) { - if (m_GraveYardState == ZM_GRAVEYARD_H) - sWorld->SendZoneText(ZM_GRAVEYARD_ZONE, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_ZM_LOSE_GY_H)); m_GraveYardState = ZM_GRAVEYARD_A; DelObject(0); // only one gotype is used in the whole outdoor pvp, no need to call it a constant AddObject(0, ZM_Banner_A.entry, ZM_Banner_A.map, ZM_Banner_A.x, ZM_Banner_A.y, ZM_Banner_A.z, ZM_Banner_A.o, ZM_Banner_A.rot0, ZM_Banner_A.rot1, ZM_Banner_A.rot2, ZM_Banner_A.rot3); @@ -229,12 +224,10 @@ int32 OPvPCapturePointZM_GraveYard::HandleOpenGo(Player* player, uint64 guid) sObjectMgr->AddGraveYardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, ALLIANCE, false); // add gy m_PvP->TeamApplyBuff(TEAM_ALLIANCE, ZM_CAPTURE_BUFF); player->RemoveAurasDueToSpell(ZM_BATTLE_STANDARD_A); - sWorld->SendZoneText(ZM_GRAVEYARD_ZONE, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_ZM_CAPTURE_GY_A)); + m_PvP->SendDefenseMessage(ZM_GRAVEYARD_ZONE, TEXT_TWIN_SPIRE_RUINS_TAKEN_ALLIANCE); } else if (player->HasAura(ZM_BATTLE_STANDARD_H) && m_GraveYardState != ZM_GRAVEYARD_H) { - if (m_GraveYardState == ZM_GRAVEYARD_A) - sWorld->SendZoneText(ZM_GRAVEYARD_ZONE, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_ZM_LOSE_GY_A)); m_GraveYardState = ZM_GRAVEYARD_H; DelObject(0); // only one gotype is used in the whole outdoor pvp, no need to call it a constant AddObject(0, ZM_Banner_H.entry, ZM_Banner_H.map, ZM_Banner_H.x, ZM_Banner_H.y, ZM_Banner_H.z, ZM_Banner_H.o, ZM_Banner_H.rot0, ZM_Banner_H.rot1, ZM_Banner_H.rot2, ZM_Banner_H.rot3); @@ -242,7 +235,7 @@ int32 OPvPCapturePointZM_GraveYard::HandleOpenGo(Player* player, uint64 guid) sObjectMgr->AddGraveYardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, HORDE, false); // add gy m_PvP->TeamApplyBuff(TEAM_HORDE, ZM_CAPTURE_BUFF); player->RemoveAurasDueToSpell(ZM_BATTLE_STANDARD_H); - sWorld->SendZoneText(ZM_GRAVEYARD_ZONE, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_ZM_CAPTURE_GY_H)); + m_PvP->SendDefenseMessage(ZM_GRAVEYARD_ZONE, TEXT_TWIN_SPIRE_RUINS_TAKEN_HORDE); } UpdateTowerState(); } @@ -454,11 +447,7 @@ void OutdoorPvPZM::SendRemoveWorldStates(Player* player) class OutdoorPvP_zangarmarsh : public OutdoorPvPScript { public: - - OutdoorPvP_zangarmarsh() - : OutdoorPvPScript("outdoorpvp_zm") - { - } + OutdoorPvP_zangarmarsh() : OutdoorPvPScript("outdoorpvp_zm") { } OutdoorPvP* GetOutdoorPvP() const override { diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPZM.h b/src/server/scripts/OutdoorPvP/OutdoorPvPZM.h index fdd093a1bfe..b7a092f74bd 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPZM.h +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPZM.h @@ -18,9 +18,22 @@ #ifndef OUTDOOR_PVP_ZM_ #define OUTDOOR_PVP_ZM_ -#include "Language.h" #include "OutdoorPvP.h" +enum DefenseMessages +{ + TEXT_WEST_BEACON_TAKEN_ALLIANCE = 15541, // '|cffffff00The Alliance has taken control of the West Beacon!|r' + TEXT_WEST_BEACON_TAKEN_HORDE = 15543, // '|cffffff00The Horde has taken control of the West Beacon!|r' + TEXT_EAST_BEACON_TAKEN_ALLIANCE = 15546, // '|cffffff00The Alliance has taken control of the East Beacon!|r' + TEXT_EAST_BEACON_TAKEN_HORDE = 15545, // '|cffffff00The Horde has taken control of the East Beacon!|r' + TEXT_TWIN_SPIRE_RUINS_TAKEN_ALLIANCE = 15591, // '|cffffff00The Alliance has taken control of Twin Spire Ruins!|r' + TEXT_TWIN_SPIRE_RUINS_TAKEN_HORDE = 15590, // '|cffffff00The Horde has taken control of Twin Spire Ruins!|r' + TEXT_BOTH_BEACONS_TAKEN_ALLIANCE = 16284, // (NYI) '|cffffff00The Alliance has taken control of both beacons!|r' + TEXT_BOTH_BEACONS_TAKEN_HORDE = 16285, // (NYI) '|cffffff00The Horde has taken control of both beacons!|r' + TEXT_BATTLE_STANDARDS_ALLIANCE = 16287, // (NYI) '|cffffff00The Alliance Field Scout is now issuing battle standards.|r' + TEXT_BATTLE_STANDARDS_HORDE = 16288 // (NYI) '|cffffff00The Horde Field Scout is now issuing battle standards.|r' +}; + const uint8 OutdoorPvPZMBuffZonesNum = 5; // the buff is cast in these zones @@ -94,26 +107,14 @@ const zm_beacon ZMBeaconInfo[ZM_NUM_BEACONS] = const uint32 ZMBeaconCaptureA[ZM_NUM_BEACONS] = { - LANG_OPVP_ZM_CAPTURE_EAST_A, - LANG_OPVP_ZM_CAPTURE_WEST_A + TEXT_EAST_BEACON_TAKEN_ALLIANCE, + TEXT_WEST_BEACON_TAKEN_ALLIANCE }; const uint32 ZMBeaconCaptureH[ZM_NUM_BEACONS] = { - LANG_OPVP_ZM_CAPTURE_EAST_H, - LANG_OPVP_ZM_CAPTURE_WEST_H -}; - -const uint32 ZMBeaconLoseA[ZM_NUM_BEACONS] = -{ - LANG_OPVP_ZM_LOSE_EAST_A, - LANG_OPVP_ZM_LOSE_WEST_A -}; - -const uint32 ZMBeaconLoseH[ZM_NUM_BEACONS] = -{ - LANG_OPVP_ZM_LOSE_EAST_H, - LANG_OPVP_ZM_LOSE_WEST_H + TEXT_EAST_BEACON_TAKEN_HORDE, + TEXT_WEST_BEACON_TAKEN_HORDE }; const go_type ZMCapturePoints[ZM_NUM_BEACONS] = diff --git a/src/server/shared/Database/Implementation/LoginDatabase.cpp b/src/server/shared/Database/Implementation/LoginDatabase.cpp index 488ff18dca4..a2b9091a8d5 100644 --- a/src/server/shared/Database/Implementation/LoginDatabase.cpp +++ b/src/server/shared/Database/Implementation/LoginDatabase.cpp @@ -26,13 +26,13 @@ void LoginDatabaseConnection::DoPrepareStatements() PrepareStatement(LOGIN_DEL_EXPIRED_IP_BANS, "DELETE FROM ip_banned WHERE unbandate<>bandate AND unbandate<=UNIX_TIMESTAMP()", CONNECTION_ASYNC); PrepareStatement(LOGIN_UPD_EXPIRED_ACCOUNT_BANS, "UPDATE account_banned SET active = 0 WHERE active = 1 AND unbandate<>bandate AND unbandate<=UNIX_TIMESTAMP()", CONNECTION_SYNCH); PrepareStatement(LOGIN_SEL_IP_BANNED, "SELECT * FROM ip_banned WHERE ip = ?", CONNECTION_SYNCH); - PrepareStatement(LOGIN_INS_IP_AUTO_BANNED, "INSERT INTO ip_banned (ip, bandate, unbandate, bannedby, banreason) VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, 'Trinity realmd', 'Failed login autoban')", CONNECTION_ASYNC); + PrepareStatement(LOGIN_INS_IP_AUTO_BANNED, "INSERT INTO ip_banned (ip, bandate, unbandate, bannedby, banreason) VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, 'Trinity Auth', 'Failed login autoban')", CONNECTION_ASYNC); PrepareStatement(LOGIN_SEL_IP_BANNED_ALL, "SELECT ip, bandate, unbandate, bannedby, banreason FROM ip_banned WHERE (bandate = unbandate OR unbandate > UNIX_TIMESTAMP()) ORDER BY unbandate", CONNECTION_SYNCH); PrepareStatement(LOGIN_SEL_IP_BANNED_BY_IP, "SELECT ip, bandate, unbandate, bannedby, banreason FROM ip_banned WHERE (bandate = unbandate OR unbandate > UNIX_TIMESTAMP()) AND ip LIKE CONCAT('%%', ?, '%%') ORDER BY unbandate", CONNECTION_SYNCH); PrepareStatement(LOGIN_SEL_ACCOUNT_BANNED, "SELECT bandate, unbandate FROM account_banned WHERE id = ? AND active = 1", CONNECTION_SYNCH); PrepareStatement(LOGIN_SEL_ACCOUNT_BANNED_ALL, "SELECT account.id, username FROM account, account_banned WHERE account.id = account_banned.id AND active = 1 GROUP BY account.id", CONNECTION_SYNCH); PrepareStatement(LOGIN_SEL_ACCOUNT_BANNED_BY_USERNAME, "SELECT account.id, username FROM account, account_banned WHERE account.id = account_banned.id AND active = 1 AND username LIKE CONCAT('%%', ?, '%%') GROUP BY account.id", CONNECTION_SYNCH); - PrepareStatement(LOGIN_INS_ACCOUNT_AUTO_BANNED, "INSERT INTO account_banned VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, 'Trinity realmd', 'Failed login autoban', 1)", CONNECTION_ASYNC); + PrepareStatement(LOGIN_INS_ACCOUNT_AUTO_BANNED, "INSERT INTO account_banned VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, 'Trinity Auth', 'Failed login autoban', 1)", CONNECTION_ASYNC); PrepareStatement(LOGIN_DEL_ACCOUNT_BANNED, "DELETE FROM account_banned WHERE id = ?", CONNECTION_ASYNC); PrepareStatement(LOGIN_SEL_SESSIONKEY, "SELECT a.sessionkey, a.id, aa.gmlevel FROM account a LEFT JOIN account_access aa ON (a.id = aa.id) WHERE username = ?", CONNECTION_SYNCH); PrepareStatement(LOGIN_UPD_VS, "UPDATE account SET v = ?, s = ? WHERE username = ?", CONNECTION_ASYNC); |
