aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/Battlegrounds/Battleground.h10
-rwxr-xr-xsrc/server/game/Battlegrounds/BattlegroundMgr.cpp40
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundBFG.cpp36
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundBFG.h40
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundTP.cpp36
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundTP.h40
-rw-r--r--src/server/game/Entities/Player/Player.cpp21
7 files changed, 219 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
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 98a424f1b72..7ff1438fdc0 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -9732,6 +9732,27 @@ void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid)
data << uint32(4131) << uint32(0); // 10 WORLDSTATE_CRATES_REVEALED
}
break;
+ // Twin Peaks
+ case 5031:
+ if (bg && bg->GetTypeID(true) == BATTLEGROUND_TP)
+ bg->FillInitialWorldStates(data);
+ else
+ {
+ data << uint32(0x62d) << uint32(0x0); // 7 1581 alliance flag captures
+ data << uint32(0x62e) << uint32(0x0); // 8 1582 horde flag captures
+ data << uint32(0x609) << uint32(0x0); // 9 1545 unk
+ data << uint32(0x60a) << uint32(0x0); // 10 1546 unk
+ data << uint32(0x60b) << uint32(0x2); // 11 1547 unk
+ data << uint32(0x641) << uint32(0x3); // 12 1601 unk
+ data << uint32(0x922) << uint32(0x1); // 13 2338 horde (0 - hide, 1 - flag ok, 2 - flag picked up (flashing), 3 - flag picked up (not flashing)
+ data << uint32(0x923) << uint32(0x1); // 14 2339 alliance (0 - hide, 1 - flag ok, 2 - flag picked up (flashing), 3 - flag picked up (not flashing)
+ }
+ break;
+ // Battle for Gilneas
+ case 5449:
+ if (bg && bg->GetTypeID(true) == BATTLEGROUND_BFG)
+ bg->FillInitialWorldStates(data);
+ break;
default:
data << uint32(0x914) << uint32(0x0); // 7
data << uint32(0x913) << uint32(0x0); // 8