mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/OutdoorPvP: Refactor OutdoorPvP creation to be linked to host map creation instead of having globally accessible objects
This commit is contained in:
@@ -1904,7 +1904,7 @@ ZoneScript* WorldObject::FindZoneScript() const
|
||||
if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(GetZoneId()))
|
||||
return bf;
|
||||
else
|
||||
return sOutdoorPvPMgr->GetZoneScript(GetZoneId());
|
||||
return sOutdoorPvPMgr->GetOutdoorPvPToZoneId(map, GetZoneId());
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
|
||||
@@ -25061,7 +25061,7 @@ void Player::AutoUnequipOffhandIfNeed(bool force /*= false*/)
|
||||
|
||||
OutdoorPvP* Player::GetOutdoorPvP() const
|
||||
{
|
||||
return sOutdoorPvPMgr->GetOutdoorPvPToZoneId(GetZoneId());
|
||||
return sOutdoorPvPMgr->GetOutdoorPvPToZoneId(GetMap(), GetZoneId());
|
||||
}
|
||||
|
||||
bool Player::HasItemFitToSpellRequirements(SpellInfo const* spellInfo, Item const* ignoreItem) const
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectGridLoader.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "OutdoorPvPMgr.h"
|
||||
#include "Pet.h"
|
||||
#include "PhasingHandler.h"
|
||||
#include "PoolMgr.h"
|
||||
@@ -94,6 +95,8 @@ Map::~Map()
|
||||
if (!m_scriptSchedule.empty())
|
||||
sMapMgr->DecreaseScheduledScriptCount(m_scriptSchedule.size());
|
||||
|
||||
sOutdoorPvPMgr->DestroyOutdoorPvPForMap(this);
|
||||
|
||||
if (m_parentMap == this)
|
||||
delete m_childTerrainMaps;
|
||||
|
||||
@@ -375,6 +378,8 @@ i_scriptLock(false), _respawnCheckTimer(0)
|
||||
|
||||
_worldStateValues = sWorldStateMgr->GetInitialWorldStatesForMap(this);
|
||||
|
||||
sOutdoorPvPMgr->CreateOutdoorPvPForMap(this);
|
||||
|
||||
sScriptMgr->OnCreateMap(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include "CellImpl.h"
|
||||
#include "ChatPackets.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "DB2Stores.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "Group.h"
|
||||
#include "Log.h"
|
||||
@@ -111,7 +110,7 @@ bool OPvPCapturePoint::SetCapturePointData(uint32 entry)
|
||||
return true;
|
||||
}
|
||||
|
||||
OutdoorPvP::OutdoorPvP() : m_TypeId(0), m_map(nullptr) { }
|
||||
OutdoorPvP::OutdoorPvP(Map* map) : m_TypeId(0), m_map(map) { }
|
||||
|
||||
OutdoorPvP::~OutdoorPvP() = default;
|
||||
|
||||
@@ -505,11 +504,3 @@ void OutdoorPvP::BroadcastWorker(Worker& _worker, uint32 zoneId)
|
||||
if (player->GetZoneId() == zoneId)
|
||||
_worker(player);
|
||||
}
|
||||
|
||||
void OutdoorPvP::SetMapFromZone(uint32 zone)
|
||||
{
|
||||
AreaTableEntry const* areaTable = sAreaTableStore.AssertEntry(zone);
|
||||
Map* map = sMapMgr->CreateBaseMap(areaTable->ContinentID);
|
||||
ASSERT(!map->Instanceable());
|
||||
m_map = map;
|
||||
}
|
||||
|
||||
@@ -161,7 +161,7 @@ class TC_GAME_API OutdoorPvP : public ZoneScript
|
||||
public:
|
||||
|
||||
// ctor
|
||||
OutdoorPvP();
|
||||
OutdoorPvP(Map* map);
|
||||
|
||||
// dtor
|
||||
virtual ~OutdoorPvP();
|
||||
@@ -260,9 +260,6 @@ class TC_GAME_API OutdoorPvP : public ZoneScript
|
||||
template<class Worker>
|
||||
void BroadcastWorker(Worker& _worker, uint32 zoneId);
|
||||
|
||||
// Hack to store map because this code is just shit
|
||||
void SetMapFromZone(uint32 zone);
|
||||
|
||||
Map* m_map;
|
||||
};
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "DB2Stores.h"
|
||||
#include "DisableMgr.h"
|
||||
#include "Log.h"
|
||||
#include "Map.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptMgr.h"
|
||||
@@ -29,12 +30,11 @@ OutdoorPvPMgr::OutdoorPvPMgr()
|
||||
m_UpdateTimer = 0;
|
||||
}
|
||||
|
||||
OutdoorPvPMgr::~OutdoorPvPMgr() = default;
|
||||
|
||||
void OutdoorPvPMgr::Die()
|
||||
{
|
||||
for (OutdoorPvPSet::iterator itr = m_OutdoorPvPSet.begin(); itr != m_OutdoorPvPSet.end(); ++itr)
|
||||
delete *itr;
|
||||
|
||||
m_OutdoorPvPSet.clear();
|
||||
m_OutdoorPvPByMap.clear();
|
||||
|
||||
m_OutdoorPvPDatas.fill(0);
|
||||
|
||||
@@ -77,23 +77,29 @@ void OutdoorPvPMgr::InitOutdoorPvP()
|
||||
continue;
|
||||
}
|
||||
|
||||
OutdoorPvPTypes realTypeId = OutdoorPvPTypes(typeId);
|
||||
m_OutdoorPvPDatas[realTypeId] = sObjectMgr->GetScriptId(fields[1].GetString());
|
||||
m_OutdoorPvPDatas[typeId] = sObjectMgr->GetScriptId(fields[1].GetString());
|
||||
|
||||
++count;
|
||||
}
|
||||
while (result->NextRow());
|
||||
|
||||
OutdoorPvP* pvp;
|
||||
TC_LOG_INFO("server.loading", ">> Loaded %u outdoor PvP definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
}
|
||||
|
||||
void OutdoorPvPMgr::CreateOutdoorPvPForMap(Map* map)
|
||||
{
|
||||
for (uint8 i = 1; i < MAX_OUTDOORPVP_TYPES; ++i)
|
||||
{
|
||||
if (map->GetId() != m_OutdoorMapIds[i])
|
||||
continue;
|
||||
|
||||
if (!m_OutdoorPvPDatas[i])
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Could not initialize OutdoorPvP object for type ID %u; no entry in database.", uint32(i));
|
||||
continue;
|
||||
}
|
||||
|
||||
pvp = sScriptMgr->CreateOutdoorPvP(m_OutdoorPvPDatas[i]);
|
||||
OutdoorPvP* pvp = sScriptMgr->CreateOutdoorPvP(m_OutdoorPvPDatas[i], map);
|
||||
if (!pvp)
|
||||
{
|
||||
TC_LOG_ERROR("outdoorpvp", "Could not initialize OutdoorPvP object for type ID %u; got NULL pointer from script.", uint32(i));
|
||||
@@ -107,20 +113,23 @@ void OutdoorPvPMgr::InitOutdoorPvP()
|
||||
continue;
|
||||
}
|
||||
|
||||
m_OutdoorPvPSet.push_back(pvp);
|
||||
m_OutdoorPvPByMap[map].emplace_back(pvp);
|
||||
}
|
||||
}
|
||||
|
||||
TC_LOG_INFO("server.loading", ">> Loaded %u outdoor PvP definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
void OutdoorPvPMgr::DestroyOutdoorPvPForMap(Map* map)
|
||||
{
|
||||
m_OutdoorPvPByMap.erase(map);
|
||||
}
|
||||
|
||||
void OutdoorPvPMgr::AddZone(uint32 zoneid, OutdoorPvP* handle)
|
||||
{
|
||||
m_OutdoorPvPMap[zoneid] = handle;
|
||||
m_OutdoorPvPMap[{ handle->GetMap(), zoneid }] = handle;
|
||||
}
|
||||
|
||||
void OutdoorPvPMgr::HandlePlayerEnterZone(Player* player, uint32 zoneid)
|
||||
{
|
||||
OutdoorPvPMap::iterator itr = m_OutdoorPvPMap.find(zoneid);
|
||||
OutdoorPvPMap::iterator itr = m_OutdoorPvPMap.find({ player->GetMap(), zoneid });
|
||||
if (itr == m_OutdoorPvPMap.end())
|
||||
return;
|
||||
|
||||
@@ -133,7 +142,7 @@ void OutdoorPvPMgr::HandlePlayerEnterZone(Player* player, uint32 zoneid)
|
||||
|
||||
void OutdoorPvPMgr::HandlePlayerLeaveZone(Player* player, uint32 zoneid)
|
||||
{
|
||||
OutdoorPvPMap::iterator itr = m_OutdoorPvPMap.find(zoneid);
|
||||
OutdoorPvPMap::iterator itr = m_OutdoorPvPMap.find({ player->GetMap(), zoneid });
|
||||
if (itr == m_OutdoorPvPMap.end())
|
||||
return;
|
||||
|
||||
@@ -145,9 +154,9 @@ void OutdoorPvPMgr::HandlePlayerLeaveZone(Player* player, uint32 zoneid)
|
||||
TC_LOG_DEBUG("outdoorpvp", "Player %s left outdoorpvp id %u", player->GetGUID().ToString().c_str(), itr->second->GetTypeId());
|
||||
}
|
||||
|
||||
OutdoorPvP* OutdoorPvPMgr::GetOutdoorPvPToZoneId(uint32 zoneid)
|
||||
OutdoorPvP* OutdoorPvPMgr::GetOutdoorPvPToZoneId(Map* map, uint32 zoneid)
|
||||
{
|
||||
OutdoorPvPMap::iterator itr = m_OutdoorPvPMap.find(zoneid);
|
||||
OutdoorPvPMap::iterator itr = m_OutdoorPvPMap.find({ map, zoneid });
|
||||
if (itr == m_OutdoorPvPMap.end())
|
||||
{
|
||||
// no handle for this zone, return
|
||||
@@ -161,77 +170,59 @@ void OutdoorPvPMgr::Update(uint32 diff)
|
||||
m_UpdateTimer += diff;
|
||||
if (m_UpdateTimer > OUTDOORPVP_OBJECTIVE_UPDATE_INTERVAL)
|
||||
{
|
||||
for (OutdoorPvPSet::iterator itr = m_OutdoorPvPSet.begin(); itr != m_OutdoorPvPSet.end(); ++itr)
|
||||
(*itr)->Update(m_UpdateTimer);
|
||||
for (auto mapItr = m_OutdoorPvPByMap.begin(); mapItr != m_OutdoorPvPByMap.end(); ++mapItr)
|
||||
for (auto itr = mapItr->second.begin(); itr != mapItr->second.end(); ++itr)
|
||||
(*itr)->Update(m_UpdateTimer);
|
||||
m_UpdateTimer = 0;
|
||||
}
|
||||
}
|
||||
|
||||
bool OutdoorPvPMgr::HandleCustomSpell(Player* player, uint32 spellId, GameObject* go)
|
||||
{
|
||||
for (OutdoorPvPSet::iterator itr = m_OutdoorPvPSet.begin(); itr != m_OutdoorPvPSet.end(); ++itr)
|
||||
{
|
||||
if ((*itr)->HandleCustomSpell(player, spellId, go))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (OutdoorPvP* pvp = player->GetOutdoorPvP())
|
||||
if (pvp->HasPlayer(player))
|
||||
return pvp->HandleCustomSpell(player, spellId, go);
|
||||
|
||||
ZoneScript* OutdoorPvPMgr::GetZoneScript(uint32 zoneId)
|
||||
{
|
||||
OutdoorPvPMap::iterator itr = m_OutdoorPvPMap.find(zoneId);
|
||||
if (itr != m_OutdoorPvPMap.end())
|
||||
return itr->second;
|
||||
else
|
||||
return nullptr;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool OutdoorPvPMgr::HandleOpenGo(Player* player, GameObject* go)
|
||||
{
|
||||
for (OutdoorPvPSet::iterator itr = m_OutdoorPvPSet.begin(); itr != m_OutdoorPvPSet.end(); ++itr)
|
||||
{
|
||||
if ((*itr)->HandleOpenGo(player, go))
|
||||
return true;
|
||||
}
|
||||
if (OutdoorPvP* pvp = player->GetOutdoorPvP())
|
||||
if (pvp->HasPlayer(player))
|
||||
return pvp->HandleOpenGo(player, go);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void OutdoorPvPMgr::HandleGossipOption(Player* player, Creature* creature, uint32 gossipid)
|
||||
{
|
||||
for (OutdoorPvPSet::iterator itr = m_OutdoorPvPSet.begin(); itr != m_OutdoorPvPSet.end(); ++itr)
|
||||
{
|
||||
if ((*itr)->HandleGossipOption(player, creature, gossipid))
|
||||
return;
|
||||
}
|
||||
if (OutdoorPvP* pvp = player->GetOutdoorPvP())
|
||||
if (pvp->HasPlayer(player))
|
||||
pvp->HandleGossipOption(player, creature, gossipid);
|
||||
}
|
||||
|
||||
bool OutdoorPvPMgr::CanTalkTo(Player* player, Creature* creature, GossipMenuItems const& gso)
|
||||
{
|
||||
for (OutdoorPvPSet::iterator itr = m_OutdoorPvPSet.begin(); itr != m_OutdoorPvPSet.end(); ++itr)
|
||||
{
|
||||
if ((*itr)->CanTalkTo(player, creature, gso))
|
||||
return true;
|
||||
}
|
||||
if (OutdoorPvP* pvp = player->GetOutdoorPvP())
|
||||
if (pvp->HasPlayer(player))
|
||||
return pvp->CanTalkTo(player, creature, gso);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void OutdoorPvPMgr::HandleDropFlag(Player* player, uint32 spellId)
|
||||
{
|
||||
for (OutdoorPvPSet::iterator itr = m_OutdoorPvPSet.begin(); itr != m_OutdoorPvPSet.end(); ++itr)
|
||||
{
|
||||
if ((*itr)->HandleDropFlag(player, spellId))
|
||||
return;
|
||||
}
|
||||
if (OutdoorPvP* pvp = player->GetOutdoorPvP())
|
||||
if (pvp->HasPlayer(player))
|
||||
pvp->HandleDropFlag(player, spellId);
|
||||
}
|
||||
|
||||
void OutdoorPvPMgr::HandlePlayerResurrects(Player* player, uint32 zoneid)
|
||||
{
|
||||
OutdoorPvPMap::iterator itr = m_OutdoorPvPMap.find(zoneid);
|
||||
if (itr == m_OutdoorPvPMap.end())
|
||||
return;
|
||||
|
||||
if (itr->second->HasPlayer(player))
|
||||
itr->second->HandlePlayerResurrects(player, zoneid);
|
||||
if (OutdoorPvP* pvp = player->GetOutdoorPvP())
|
||||
if (pvp->HasPlayer(player))
|
||||
pvp->HandlePlayerResurrects(player, zoneid);
|
||||
}
|
||||
|
||||
std::string OutdoorPvPMgr::GetDefenseMessage(uint32 zoneId, uint32 id, LocaleConstant locale) const
|
||||
|
||||
@@ -21,12 +21,16 @@
|
||||
#define OUTDOORPVP_OBJECTIVE_UPDATE_INTERVAL 1000
|
||||
|
||||
#include "OutdoorPvP.h"
|
||||
#include "Hash.h"
|
||||
#include <array>
|
||||
#include <memory>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
class Player;
|
||||
class GameObject;
|
||||
class Creature;
|
||||
class Map;
|
||||
class ZoneScript;
|
||||
struct GossipMenuItems;
|
||||
enum LocaleConstant : uint8;
|
||||
@@ -36,7 +40,7 @@ class TC_GAME_API OutdoorPvPMgr
|
||||
{
|
||||
private:
|
||||
OutdoorPvPMgr();
|
||||
~OutdoorPvPMgr() { };
|
||||
~OutdoorPvPMgr();
|
||||
|
||||
public:
|
||||
static OutdoorPvPMgr* instance();
|
||||
@@ -47,6 +51,10 @@ class TC_GAME_API OutdoorPvPMgr
|
||||
// cleanup
|
||||
void Die();
|
||||
|
||||
void CreateOutdoorPvPForMap(Map* map);
|
||||
|
||||
void DestroyOutdoorPvPForMap(Map* map);
|
||||
|
||||
// called when a player enters an outdoor pvp area
|
||||
void HandlePlayerEnterZone(Player* player, uint32 areaflag);
|
||||
|
||||
@@ -57,7 +65,7 @@ class TC_GAME_API OutdoorPvPMgr
|
||||
void HandlePlayerResurrects(Player* player, uint32 areaflag);
|
||||
|
||||
// return assigned outdoor pvp
|
||||
OutdoorPvP* GetOutdoorPvPToZoneId(uint32 zoneid);
|
||||
OutdoorPvP* GetOutdoorPvPToZoneId(Map* map, uint32 zoneid);
|
||||
|
||||
// handle custom (non-exist in dbc) spell if registered
|
||||
bool HandleCustomSpell(Player* player, uint32 spellId, GameObject* go);
|
||||
@@ -65,8 +73,6 @@ class TC_GAME_API OutdoorPvPMgr
|
||||
// handle custom go if registered
|
||||
bool HandleOpenGo(Player* player, GameObject* go);
|
||||
|
||||
ZoneScript* GetZoneScript(uint32 zoneId);
|
||||
|
||||
void AddZone(uint32 zoneid, OutdoorPvP* handle);
|
||||
|
||||
void Update(uint32 diff);
|
||||
@@ -80,19 +86,19 @@ class TC_GAME_API OutdoorPvPMgr
|
||||
std::string GetDefenseMessage(uint32 zoneId, uint32 id, LocaleConstant locale) const;
|
||||
|
||||
private:
|
||||
typedef std::vector<OutdoorPvP*> OutdoorPvPSet;
|
||||
typedef std::unordered_map<uint32 /*zoneid*/, OutdoorPvP*> OutdoorPvPMap;
|
||||
typedef std::unordered_map<std::pair<Map*, uint32 /*zoneid*/>, OutdoorPvP*> OutdoorPvPMap;
|
||||
typedef std::array<uint32, MAX_OUTDOORPVP_TYPES> OutdoorPvPScriptIds;
|
||||
|
||||
// contains all initiated outdoor pvp events
|
||||
// used when initing / cleaning up
|
||||
OutdoorPvPSet m_OutdoorPvPSet;
|
||||
std::unordered_map<Map*, std::vector<std::unique_ptr<OutdoorPvP>>> m_OutdoorPvPByMap;
|
||||
|
||||
// maps the zone ids to an outdoor pvp event
|
||||
// used in player event handling
|
||||
OutdoorPvPMap m_OutdoorPvPMap;
|
||||
|
||||
// Holds the outdoor PvP templates
|
||||
OutdoorPvPScriptIds m_OutdoorMapIds = { 0, 530, 530, 530, 530, 1 };
|
||||
OutdoorPvPScriptIds m_OutdoorPvPDatas = {};
|
||||
|
||||
// update interval
|
||||
|
||||
@@ -1750,10 +1750,10 @@ Battleground* ScriptMgr::CreateBattleground(BattlegroundTypeId /*typeId*/)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
OutdoorPvP* ScriptMgr::CreateOutdoorPvP(uint32 scriptId)
|
||||
OutdoorPvP* ScriptMgr::CreateOutdoorPvP(uint32 scriptId, Map* map)
|
||||
{
|
||||
GET_SCRIPT_RET(OutdoorPvPScript, scriptId, tmpscript, nullptr);
|
||||
return tmpscript->GetOutdoorPvP();
|
||||
return tmpscript->GetOutdoorPvP(map);
|
||||
}
|
||||
|
||||
Trinity::ChatCommands::ChatCommandTable ScriptMgr::GetChatCommands()
|
||||
|
||||
@@ -550,7 +550,7 @@ class TC_GAME_API OutdoorPvPScript : public ScriptObject
|
||||
~OutdoorPvPScript();
|
||||
|
||||
// Should return a fully valid OutdoorPvP object for the type ID.
|
||||
virtual OutdoorPvP* GetOutdoorPvP() const = 0;
|
||||
virtual OutdoorPvP* GetOutdoorPvP(Map* map) const = 0;
|
||||
};
|
||||
|
||||
class TC_GAME_API CommandScript : public ScriptObject
|
||||
@@ -1154,7 +1154,7 @@ class TC_GAME_API ScriptMgr
|
||||
|
||||
public: /* OutdoorPvPScript */
|
||||
|
||||
OutdoorPvP* CreateOutdoorPvP(uint32 scriptId);
|
||||
OutdoorPvP* CreateOutdoorPvP(uint32 scriptId, Map* map);
|
||||
|
||||
public: /* CommandScript */
|
||||
|
||||
|
||||
@@ -45,7 +45,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;
|
||||
@@ -56,7 +56,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)
|
||||
@@ -304,9 +303,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;
|
||||
|
||||
|
||||
@@ -37,7 +37,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;
|
||||
@@ -137,7 +137,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
|
||||
@@ -482,9 +481,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);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -148,7 +148,7 @@ class OPvPCapturePointNA : public OPvPCapturePoint
|
||||
class OutdoorPvPNA : public OutdoorPvP
|
||||
{
|
||||
public:
|
||||
OutdoorPvPNA();
|
||||
OutdoorPvPNA(Map* map);
|
||||
|
||||
void OnGameObjectCreate(GameObject* go) override;
|
||||
|
||||
|
||||
@@ -37,7 +37,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;
|
||||
@@ -57,8 +57,6 @@ void OutdoorPvPSI::SendRemoveWorldStates(Player* player)
|
||||
|
||||
bool OutdoorPvPSI::SetupOutdoorPvP()
|
||||
{
|
||||
SetMapFromZone(OutdoorPvPSIBuffZones[0]);
|
||||
|
||||
for (uint8 i = 0; i < OutdoorPvPSIBuffZonesNum; ++i)
|
||||
RegisterZone(OutdoorPvPSIBuffZones[i]);
|
||||
|
||||
@@ -196,9 +194,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);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ enum SI_WorldStates
|
||||
class OutdoorPvPSI : public OutdoorPvP
|
||||
{
|
||||
public:
|
||||
OutdoorPvPSI();
|
||||
OutdoorPvPSI(Map* map);
|
||||
|
||||
bool SetupOutdoorPvP() override;
|
||||
void HandlePlayerEnterZone(Player* player, uint32 zone) override;
|
||||
|
||||
@@ -81,7 +81,7 @@ uint32 const TFTowerPlayerLeaveEvents[TF_TOWER_NUM] =
|
||||
};
|
||||
*/
|
||||
|
||||
OutdoorPvPTF::OutdoorPvPTF()
|
||||
OutdoorPvPTF::OutdoorPvPTF(Map* map) : OutdoorPvP(map)
|
||||
{
|
||||
m_TypeId = OUTDOOR_PVP_TF;
|
||||
m_IsLocked = false;
|
||||
@@ -262,8 +262,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]);
|
||||
@@ -379,9 +377,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);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ class OPvPCapturePointTF : public OPvPCapturePoint
|
||||
class OutdoorPvPTF : public OutdoorPvP
|
||||
{
|
||||
public:
|
||||
OutdoorPvPTF();
|
||||
OutdoorPvPTF(Map* map);
|
||||
|
||||
bool SetupOutdoorPvP() override;
|
||||
void OnGameObjectCreate(GameObject* go) override;
|
||||
|
||||
@@ -171,7 +171,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;
|
||||
@@ -184,8 +184,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]);
|
||||
@@ -443,9 +441,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);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -140,7 +140,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