diff options
author | Tuxity <kevin.darcel@gmail.com> | 2012-08-19 16:45:37 +0200 |
---|---|---|
committer | Tuxity <kevin.darcel@gmail.com> | 2012-08-19 16:45:37 +0200 |
commit | 23560b13acf12365ebd0acf5e835dab42958ed12 (patch) | |
tree | a6ba2b3a6362ca1f89d6bab3621c4a407dd12cf5 /src | |
parent | 69cfc0f7bfc927f209d326534e9ad35291f67ff0 (diff) |
Core/Battlegrounds: Implement basic structure and code for Battle for Gilneas and Twin Peaks.
Diffstat (limited to 'src')
-rwxr-xr-x | src/server/game/Battlegrounds/Battleground.h | 10 | ||||
-rwxr-xr-x | src/server/game/Battlegrounds/BattlegroundMgr.cpp | 40 | ||||
-rw-r--r-- | src/server/game/Battlegrounds/Zones/BattlegroundBFG.cpp | 36 | ||||
-rw-r--r-- | src/server/game/Battlegrounds/Zones/BattlegroundBFG.h | 40 | ||||
-rw-r--r-- | src/server/game/Battlegrounds/Zones/BattlegroundTP.cpp | 36 | ||||
-rw-r--r-- | src/server/game/Battlegrounds/Zones/BattlegroundTP.h | 40 |
6 files changed, 198 insertions, 4 deletions
diff --git a/src/server/game/Battlegrounds/Battleground.h b/src/server/game/Battlegrounds/Battleground.h index 01dfbb23033..234cda4105c 100755 --- a/src/server/game/Battlegrounds/Battleground.h +++ b/src/server/game/Battlegrounds/Battleground.h @@ -177,10 +177,12 @@ enum BattlegroundQueueTypeId BATTLEGROUND_QUEUE_EY = 4, BATTLEGROUND_QUEUE_SA = 5, BATTLEGROUND_QUEUE_IC = 6, - BATTLEGROUND_QUEUE_RB = 7, - BATTLEGROUND_QUEUE_2v2 = 8, - BATTLEGROUND_QUEUE_3v3 = 9, - BATTLEGROUND_QUEUE_5v5 = 10, + BATTLEGROUND_QUEUE_TP = 7, + BATTLEGROUND_QUEUE_BFG = 8, + BATTLEGROUND_QUEUE_RB = 9, + BATTLEGROUND_QUEUE_2v2 = 10, + BATTLEGROUND_QUEUE_3v3 = 11, + BATTLEGROUND_QUEUE_5v5 = 12, MAX_BATTLEGROUND_QUEUE_TYPES }; diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index 626ed04566b..86b06de2cec 100755 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -37,6 +37,8 @@ #include "BattlegroundRV.h" #include "BattlegroundIC.h" #include "BattlegroundRB.h" +#include "BattlegroundTP.h" +#include "BattlegroundBFG.h" #include "Chat.h" #include "Map.h" #include "MapInstanced.h" @@ -339,6 +341,16 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg) *data << uint32(0x00000002); // count of next fields *data << uint32(((BattlegroundICScore*)itr2->second)->BasesAssaulted); // bases asssulted *data << uint32(((BattlegroundICScore*)itr2->second)->BasesDefended); // bases defended + case 726: + *data << uint32(0x00000002); // count of next fields + *data << uint32(((BattlegroundTPScore*)itr2->second)->FlagCaptures); // flag captures + *data << uint32(((BattlegroundTPScore*)itr2->second)->FlagReturns); // flag returns + break; + case 761: + *data << uint32(0x00000002); // count of next fields + *data << uint32(((BattlegroundBFGScore*)itr2->second)->BasesAssaulted); // bases asssulted + *data << uint32(((BattlegroundBFGScore*)itr2->second)->BasesDefended); // bases defended + break; default: *data << uint32(0); break; @@ -375,6 +387,14 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg) *data << uint32(((BattlegroundICScore*)itr2->second)->BasesAssaulted); // bases asssulted *data << uint32(((BattlegroundICScore*)itr2->second)->BasesDefended); // bases defended break; + case BATTLEGROUND_TP: + *data << uint32(0x00000002); // count of next fields + *data << uint32(((BattlegroundTPScore*)itr2->second)->FlagCaptures); // flag captures + *data << uint32(((BattlegroundTPScore*)itr2->second)->FlagReturns); // flag returns + case BATTLEGROUND_BFG: + *data << uint32(0x00000002); // count of next fields + *data << uint32(((BattlegroundBFGScore*)itr2->second)->BasesAssaulted); // bases asssulted + *data << uint32(((BattlegroundBFGScore*)itr2->second)->BasesDefended); // bases defended case BATTLEGROUND_NA: case BATTLEGROUND_BE: case BATTLEGROUND_AA: @@ -595,6 +615,12 @@ Battleground* BattlegroundMgr::CreateNewBattleground(BattlegroundTypeId bgTypeId case BATTLEGROUND_IC: bg = new BattlegroundIC(*(BattlegroundIC*)bg_template); break; + case BATTLEGROUND_TP: + bg = new BattlegroundTP(*(BattlegroundTP*)bg_template); + break; + case BATTLEGROUND_BFG: + bg = new BattlegroundBFG(*(BattlegroundBFG*)bg_template); + break; case BATTLEGROUND_RB: bg = new BattlegroundRB(*(BattlegroundRB*)bg_template); break; @@ -643,6 +669,8 @@ uint32 BattlegroundMgr::CreateBattleground(CreateBattlegroundData& data) case BATTLEGROUND_DS: bg = new BattlegroundDS; break; case BATTLEGROUND_RV: bg = new BattlegroundRV; break; case BATTLEGROUND_IC: bg = new BattlegroundIC; break; + case BATTLEGROUND_TP: bg = new BattlegroundTP; break; + case BATTLEGROUND_BFG: bg = new BattlegroundBFG; break; case BATTLEGROUND_RB: bg = new BattlegroundRB; break; default: bg = new Battleground; @@ -934,6 +962,10 @@ BattlegroundQueueTypeId BattlegroundMgr::BGQueueTypeId(BattlegroundTypeId bgType return BATTLEGROUND_QUEUE_SA; case BATTLEGROUND_IC: return BATTLEGROUND_QUEUE_IC; + case BATTLEGROUND_TP: + return BATTLEGROUND_QUEUE_TP; + case BATTLEGROUND_BFG: + return BATTLEGROUND_QUEUE_BFG; case BATTLEGROUND_RB: return BATTLEGROUND_QUEUE_RB; case BATTLEGROUND_AA: @@ -974,6 +1006,10 @@ BattlegroundTypeId BattlegroundMgr::BGTemplateId(BattlegroundQueueTypeId bgQueue return BATTLEGROUND_SA; case BATTLEGROUND_QUEUE_IC: return BATTLEGROUND_IC; + case BATTLEGROUND_QUEUE_TP: + return BATTLEGROUND_TP; + case BATTLEGROUND_QUEUE_BFG: + return BATTLEGROUND_BFG; case BATTLEGROUND_QUEUE_RB: return BATTLEGROUND_RB; case BATTLEGROUND_QUEUE_2v2: @@ -1113,6 +1149,8 @@ HolidayIds BattlegroundMgr::BGTypeToWeekendHolidayId(BattlegroundTypeId bgTypeId case BATTLEGROUND_SA: return HOLIDAY_CALL_TO_ARMS_SA; case BATTLEGROUND_AB: return HOLIDAY_CALL_TO_ARMS_AB; case BATTLEGROUND_IC: return HOLIDAY_CALL_TO_ARMS_IC; + case BATTLEGROUND_TP: return HOLIDAY_CALL_TO_ARMS_TP; + case BATTLEGROUND_BFG: return HOLIDAY_CALL_TO_ARMS_BFG; default: return HOLIDAY_NONE; } } @@ -1127,6 +1165,8 @@ BattlegroundTypeId BattlegroundMgr::WeekendHolidayIdToBGType(HolidayIds holiday) case HOLIDAY_CALL_TO_ARMS_SA: return BATTLEGROUND_SA; case HOLIDAY_CALL_TO_ARMS_AB: return BATTLEGROUND_AB; case HOLIDAY_CALL_TO_ARMS_IC: return BATTLEGROUND_IC; + case HOLIDAY_CALL_TO_ARMS_TP: return BATTLEGROUND_TP; + case HOLIDAY_CALL_TO_ARMS_BFG: return BATTLEGROUND_BFG; default: return BATTLEGROUND_TYPE_NONE; } } diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundBFG.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundBFG.cpp new file mode 100644 index 00000000000..52af3e23e11 --- /dev/null +++ b/src/server/game/Battlegrounds/Zones/BattlegroundBFG.cpp @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#include "Battleground.h" +#include "BattlegroundBFG.h" +#include "Creature.h" +#include "GameObject.h" +#include "Language.h" +#include "Object.h" +#include "ObjectMgr.h" +#include "BattlegroundMgr.h" +#include "Player.h" +#include "World.h" +#include "WorldPacket.h" + +BattlegroundBFG::BattlegroundBFG() +{ +} + +BattlegroundBFG::~BattlegroundBFG() +{ +} diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundBFG.h b/src/server/game/Battlegrounds/Zones/BattlegroundBFG.h new file mode 100644 index 00000000000..35c9bef8b17 --- /dev/null +++ b/src/server/game/Battlegrounds/Zones/BattlegroundBFG.h @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef __BATTLEGROUNDBFG_H +#define __BATTLEGROUNDBFG_H + +#include "Battleground.h" + +class BattlegroundBFGScore : public BattlegroundScore +{ + public: + BattlegroundBFGScore(): BasesAssaulted(0), BasesDefended(0) {}; + virtual ~BattlegroundBFGScore() {}; + + uint32 BasesAssaulted; + uint32 BasesDefended; +}; + +class BattlegroundBFG : public Battleground +{ + public: + BattlegroundBFG(); + ~BattlegroundBFG(); +}; + +#endif diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundTP.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundTP.cpp new file mode 100644 index 00000000000..5a19dff589f --- /dev/null +++ b/src/server/game/Battlegrounds/Zones/BattlegroundTP.cpp @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#include "Battleground.h" +#include "BattlegroundTP.h" +#include "Creature.h" +#include "GameObject.h" +#include "Language.h" +#include "Object.h" +#include "ObjectMgr.h" +#include "BattlegroundMgr.h" +#include "Player.h" +#include "World.h" +#include "WorldPacket.h" + +BattlegroundTP::BattlegroundTP() +{ +} + +BattlegroundTP::~BattlegroundTP() +{ +} diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundTP.h b/src/server/game/Battlegrounds/Zones/BattlegroundTP.h new file mode 100644 index 00000000000..45be413e5cf --- /dev/null +++ b/src/server/game/Battlegrounds/Zones/BattlegroundTP.h @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef __BATTLEGROUNDTP_H +#define __BATTLEGROUNDTP_H + +#include "Battleground.h" + +class BattlegroundTPScore : public BattlegroundScore +{ + public: + BattlegroundTPScore() : FlagCaptures(0), FlagReturns(0) {}; + virtual ~BattlegroundTPScore() {}; + + uint32 FlagCaptures; + uint32 FlagReturns; +}; + +class BattlegroundTP : public Battleground +{ + public: + BattlegroundTP(); + ~BattlegroundTP(); +}; + +#endif |