Core/OutdoorPvP: Refactor OutdoorPvP creation to be linked to host map creation instead of having globally accessible objects
This commit is contained in:
1 parent
51363865bc
commit
2a39dece9e
18 files changed
+92
-136
No files matched your search
@@ -55,7 +55,7 @@ OPvPCapturePointHP::OPvPCapturePointHP(OutdoorPvP* pvp, OutdoorPvPHPTowerType ty
|
||||
SetCapturePointData(go->GetEntry());
|
||||
}
|
||||
|
||||
OutdoorPvPHP::OutdoorPvPHP() : m_towerFlagSpawnIds()
|
||||
OutdoorPvPHP::OutdoorPvPHP(Map* map) : OutdoorPvP(map), m_towerFlagSpawnIds()
|
||||
{
|
||||
m_TypeId = OUTDOOR_PVP_HP;
|
||||
m_AllianceTowersControlled = 0;
|
||||
@@ -66,7 +66,6 @@ bool OutdoorPvPHP::SetupOutdoorPvP()
|
||||
{
|
||||
m_AllianceTowersControlled = 0;
|
||||
m_HordeTowersControlled = 0;
|
||||
SetMapFromZone(OutdoorPvPHPBuffZones[0]);
|
||||
|
||||
// add the zones affected by the pvp buff
|
||||
for (uint32 i = 0; i < OutdoorPvPHPBuffZonesNum; ++i)
|
||||
@@ -315,9 +314,9 @@ class OutdoorPvP_hellfire_peninsula : public OutdoorPvPScript
|
||||
public:
|
||||
OutdoorPvP_hellfire_peninsula() : OutdoorPvPScript("outdoorpvp_hp") { }
|
||||
|
||||
OutdoorPvP* GetOutdoorPvP() const override
|
||||
OutdoorPvP* GetOutdoorPvP(Map* map) const override
|
||||
{
|
||||
return new OutdoorPvPHP();
|
||||
return new OutdoorPvPHP(map);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ class OPvPCapturePointHP : public OPvPCapturePoint
|
||||
class OutdoorPvPHP : public OutdoorPvP
|
||||
{
|
||||
public:
|
||||
OutdoorPvPHP();
|
||||
OutdoorPvPHP(Map* map);
|
||||
|
||||
bool SetupOutdoorPvP() override;
|
||||
void OnGameObjectCreate(GameObject* go) override;
|
||||
|
||||
@@ -40,7 +40,7 @@ uint32 const FLIGHT_NODES_NUM = 4;
|
||||
uint32 const FlightPathStartNodes[FLIGHT_NODES_NUM] = { 103, 105, 107, 109 };
|
||||
uint32 const FlightPathEndNodes[FLIGHT_NODES_NUM] = { 104, 106, 108, 110 };
|
||||
|
||||
OutdoorPvPNA::OutdoorPvPNA()
|
||||
OutdoorPvPNA::OutdoorPvPNA(Map* map) : OutdoorPvP(map)
|
||||
{
|
||||
m_TypeId = OUTDOOR_PVP_NA;
|
||||
m_obj = nullptr;
|
||||
@@ -139,7 +139,6 @@ bool OutdoorPvPNA::SetupOutdoorPvP()
|
||||
{
|
||||
// m_TypeId = OUTDOOR_PVP_NA; _MUST_ be set in ctor, because of spawns cleanup
|
||||
// add the zones affected by the pvp buff
|
||||
SetMapFromZone(NA_BUFF_ZONE);
|
||||
RegisterZone(NA_BUFF_ZONE);
|
||||
|
||||
// halaa
|
||||
@@ -484,9 +483,9 @@ class OutdoorPvP_nagrand : public OutdoorPvPScript
|
||||
public:
|
||||
OutdoorPvP_nagrand() : OutdoorPvPScript("outdoorpvp_na") { }
|
||||
|
||||
OutdoorPvP* GetOutdoorPvP() const override
|
||||
OutdoorPvP* GetOutdoorPvP(Map* map) const override
|
||||
{
|
||||
return new OutdoorPvPNA();
|
||||
return new OutdoorPvPNA(map);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -157,7 +157,7 @@ class OPvPCapturePointNA : public OPvPCapturePoint
|
||||
class OutdoorPvPNA : public OutdoorPvP
|
||||
{
|
||||
public:
|
||||
OutdoorPvPNA();
|
||||
OutdoorPvPNA(Map* map);
|
||||
|
||||
void OnGameObjectCreate(GameObject* go) override;
|
||||
bool SetupOutdoorPvP() override;
|
||||
|
||||
@@ -42,7 +42,7 @@ uint32 const SI_SILITHYST_MOUND = 181597;
|
||||
uint8 const OutdoorPvPSIBuffZonesNum = 3;
|
||||
uint32 const OutdoorPvPSIBuffZones[OutdoorPvPSIBuffZonesNum] = { 1377, 3428, 3429 };
|
||||
|
||||
OutdoorPvPSI::OutdoorPvPSI()
|
||||
OutdoorPvPSI::OutdoorPvPSI(Map* map) : OutdoorPvP(map)
|
||||
{
|
||||
m_TypeId = OUTDOOR_PVP_SI;
|
||||
m_LastController = 0;
|
||||
@@ -62,8 +62,6 @@ void OutdoorPvPSI::SendRemoveWorldStates(Player* player)
|
||||
|
||||
bool OutdoorPvPSI::SetupOutdoorPvP()
|
||||
{
|
||||
SetMapFromZone(OutdoorPvPSIBuffZones[0]);
|
||||
|
||||
for (uint8 i = 0; i < OutdoorPvPSIBuffZonesNum; ++i)
|
||||
RegisterZone(OutdoorPvPSIBuffZones[i]);
|
||||
|
||||
@@ -244,9 +242,9 @@ class OutdoorPvP_silithus : public OutdoorPvPScript
|
||||
public:
|
||||
OutdoorPvP_silithus() : OutdoorPvPScript("outdoorpvp_si") { }
|
||||
|
||||
OutdoorPvP* GetOutdoorPvP() const override
|
||||
OutdoorPvP* GetOutdoorPvP(Map* map) const override
|
||||
{
|
||||
return new OutdoorPvPSI();
|
||||
return new OutdoorPvPSI(map);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ enum SI_WorldStates
|
||||
class OutdoorPvPSI : public OutdoorPvP
|
||||
{
|
||||
public:
|
||||
OutdoorPvPSI();
|
||||
OutdoorPvPSI(Map* map);
|
||||
|
||||
bool SetupOutdoorPvP() override;
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ uint32 const TFTowerPlayerLeaveEvents[TF_TOWER_NUM] =
|
||||
};
|
||||
*/
|
||||
|
||||
OutdoorPvPTF::OutdoorPvPTF()
|
||||
OutdoorPvPTF::OutdoorPvPTF(Map* map) : OutdoorPvP(map)
|
||||
{
|
||||
m_TypeId = OUTDOOR_PVP_TF;
|
||||
|
||||
@@ -268,8 +268,6 @@ bool OutdoorPvPTF::SetupOutdoorPvP()
|
||||
second_digit = 0;
|
||||
first_digit = 0;
|
||||
|
||||
SetMapFromZone(OutdoorPvPTFBuffZones[0]);
|
||||
|
||||
// add the zones affected by the pvp buff
|
||||
for (uint8 i = 0; i < OutdoorPvPTFBuffZonesNum; ++i)
|
||||
RegisterZone(OutdoorPvPTFBuffZones[i]);
|
||||
@@ -386,9 +384,9 @@ class OutdoorPvP_terokkar_forest : public OutdoorPvPScript
|
||||
public:
|
||||
OutdoorPvP_terokkar_forest() : OutdoorPvPScript("outdoorpvp_tf") { }
|
||||
|
||||
OutdoorPvP* GetOutdoorPvP() const override
|
||||
OutdoorPvP* GetOutdoorPvP(Map* map) const override
|
||||
{
|
||||
return new OutdoorPvPTF();
|
||||
return new OutdoorPvPTF(map);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ class OPvPCapturePointTF : public OPvPCapturePoint
|
||||
class OutdoorPvPTF : public OutdoorPvP
|
||||
{
|
||||
public:
|
||||
OutdoorPvPTF();
|
||||
OutdoorPvPTF(Map* map);
|
||||
|
||||
bool SetupOutdoorPvP() override;
|
||||
void OnGameObjectCreate(GameObject* go) override;
|
||||
|
||||
@@ -173,7 +173,7 @@ void OutdoorPvPZM::HandlePlayerLeaveZone(Player* player, uint32 zone)
|
||||
OutdoorPvP::HandlePlayerLeaveZone(player, zone);
|
||||
}
|
||||
|
||||
OutdoorPvPZM::OutdoorPvPZM()
|
||||
OutdoorPvPZM::OutdoorPvPZM(Map* map) : OutdoorPvP(map)
|
||||
{
|
||||
m_TypeId = OUTDOOR_PVP_ZM;
|
||||
m_Graveyard = nullptr;
|
||||
@@ -186,8 +186,6 @@ bool OutdoorPvPZM::SetupOutdoorPvP()
|
||||
m_AllianceTowersControlled = 0;
|
||||
m_HordeTowersControlled = 0;
|
||||
|
||||
SetMapFromZone(OutdoorPvPZMBuffZones[0]);
|
||||
|
||||
// add the zones affected by the pvp buff
|
||||
for (uint8 i = 0; i < OutdoorPvPZMBuffZonesNum; ++i)
|
||||
RegisterZone(OutdoorPvPZMBuffZones[i]);
|
||||
@@ -446,9 +444,9 @@ class OutdoorPvP_zangarmarsh : public OutdoorPvPScript
|
||||
public:
|
||||
OutdoorPvP_zangarmarsh() : OutdoorPvPScript("outdoorpvp_zm") { }
|
||||
|
||||
OutdoorPvP* GetOutdoorPvP() const override
|
||||
OutdoorPvP* GetOutdoorPvP(Map* map) const override
|
||||
{
|
||||
return new OutdoorPvPZM();
|
||||
return new OutdoorPvPZM(map);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -151,7 +151,7 @@ class OPvPCapturePointZM_Graveyard : public OPvPCapturePoint
|
||||
class OutdoorPvPZM : public OutdoorPvP
|
||||
{
|
||||
public:
|
||||
OutdoorPvPZM();
|
||||
OutdoorPvPZM(Map* map);
|
||||
|
||||
bool SetupOutdoorPvP() override;
|
||||
void OnGameObjectCreate(GameObject* go) override;
|
||||
|
||||
Reference in new issue
Block a user