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
@@ -2154,7 +2154,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;
|
||||
|
||||
@@ -23811,7 +23811,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
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
#include "OutdoorPvP.h"
|
||||
#include "CellImpl.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "DBCStores.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "Group.h"
|
||||
#include "Log.h"
|
||||
@@ -108,7 +107,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;
|
||||
|
||||
@@ -471,37 +470,22 @@ void OutdoorPvP::TeamApplyBuff(TeamId team, uint32 spellId, uint32 spellId2)
|
||||
|
||||
void OutdoorPvP::OnGameObjectCreate(GameObject* go)
|
||||
{
|
||||
GoScriptPair sp(go->GetGUID().GetCounter(), go);
|
||||
m_GoScriptStore.insert(sp);
|
||||
if (go->GetGoType() != GAMEOBJECT_TYPE_CAPTURE_POINT)
|
||||
return;
|
||||
|
||||
if (OPvPCapturePoint *cp = GetCapturePoint(go->GetSpawnId()))
|
||||
if (OPvPCapturePoint* cp = GetCapturePoint(go->GetSpawnId()))
|
||||
cp->m_capturePoint = go;
|
||||
}
|
||||
|
||||
void OutdoorPvP::OnGameObjectRemove(GameObject* go)
|
||||
{
|
||||
m_GoScriptStore.erase(go->GetGUID().GetCounter());
|
||||
|
||||
if (go->GetGoType() != GAMEOBJECT_TYPE_CAPTURE_POINT)
|
||||
return;
|
||||
|
||||
if (OPvPCapturePoint *cp = GetCapturePoint(go->GetSpawnId()))
|
||||
if (OPvPCapturePoint* cp = GetCapturePoint(go->GetSpawnId()))
|
||||
cp->m_capturePoint = nullptr;
|
||||
}
|
||||
|
||||
void OutdoorPvP::OnCreatureCreate(Creature* creature)
|
||||
{
|
||||
CreatureScriptPair sp(creature->GetGUID().GetCounter(), creature);
|
||||
m_CreatureScriptStore.insert(sp);
|
||||
}
|
||||
|
||||
void OutdoorPvP::OnCreatureRemove(Creature* creature)
|
||||
{
|
||||
m_CreatureScriptStore.erase(creature->GetGUID().GetCounter());
|
||||
}
|
||||
|
||||
void OutdoorPvP::SendDefenseMessage(uint32 zoneId, uint32 id)
|
||||
{
|
||||
DefenseMessageBuilder builder(zoneId, id);
|
||||
@@ -518,12 +502,3 @@ void OutdoorPvP::BroadcastWorker(Worker& _worker, uint32 zoneId)
|
||||
if (player->GetZoneId() == zoneId)
|
||||
_worker(player);
|
||||
}
|
||||
|
||||
void OutdoorPvP::SetMapFromZone(uint32 zone)
|
||||
{
|
||||
AreaTableEntry const* areaTable = sAreaTableStore.LookupEntry(zone);
|
||||
ASSERT(areaTable);
|
||||
Map* map = sMapMgr->CreateBaseMap(areaTable->ContinentID);
|
||||
ASSERT(!map->Instanceable());
|
||||
m_map = map;
|
||||
}
|
||||
@@ -164,7 +164,7 @@ class TC_GAME_API OutdoorPvP : public ZoneScript
|
||||
public:
|
||||
|
||||
// ctor
|
||||
OutdoorPvP();
|
||||
OutdoorPvP(Map* map);
|
||||
|
||||
// dtor
|
||||
virtual ~OutdoorPvP();
|
||||
@@ -187,8 +187,6 @@ class TC_GAME_API OutdoorPvP : public ZoneScript
|
||||
|
||||
void OnGameObjectCreate(GameObject* go) override;
|
||||
void OnGameObjectRemove(GameObject* go) override;
|
||||
void OnCreatureCreate(Creature*) override;
|
||||
void OnCreatureRemove(Creature*) override;
|
||||
|
||||
// send world state update to all players present
|
||||
int32 GetWorldState(int32 worldStateId) const;
|
||||
@@ -276,11 +274,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);
|
||||
std::map<ObjectGuid::LowType, GameObject*> m_GoScriptStore;
|
||||
std::map<ObjectGuid::LowType, Creature*> m_CreatureScriptStore;
|
||||
|
||||
Map* m_map;
|
||||
};
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "DatabaseEnv.h"
|
||||
#include "DisableMgr.h"
|
||||
#include "Log.h"
|
||||
#include "Map.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptMgr.h"
|
||||
@@ -28,15 +29,13 @@ 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_OutdoorPvPByMap.clear();
|
||||
|
||||
m_OutdoorPvPSet.clear();
|
||||
|
||||
for (uint32 i = 0; i < MAX_OUTDOORPVP_TYPES; ++i)
|
||||
m_OutdoorPvPDatas[i] = 0;
|
||||
m_OutdoorPvPDatas.fill(0);
|
||||
|
||||
m_OutdoorPvPMap.clear();
|
||||
}
|
||||
@@ -77,23 +76,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 nullptr pointer from script.", uint32(i));
|
||||
@@ -107,20 +112,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 +141,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 +153,9 @@ void OutdoorPvPMgr::HandlePlayerLeaveZone(Player* player, uint32 zoneid)
|
||||
TC_LOG_DEBUG("outdoorpvp", "Player %u left outdoorpvp id %u", player->GetGUID().GetCounter(), 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 +169,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;
|
||||
|
||||
@@ -35,7 +39,7 @@ class TC_GAME_API OutdoorPvPMgr
|
||||
{
|
||||
private:
|
||||
OutdoorPvPMgr();
|
||||
~OutdoorPvPMgr() { };
|
||||
~OutdoorPvPMgr();
|
||||
|
||||
public:
|
||||
static OutdoorPvPMgr* instance();
|
||||
@@ -46,6 +50,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);
|
||||
|
||||
@@ -56,7 +64,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);
|
||||
@@ -64,8 +72,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);
|
||||
@@ -79,19 +85,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
|
||||
|
||||
@@ -1586,10 +1586,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);
|
||||
}
|
||||
|
||||
std::vector<ChatCommand> ScriptMgr::GetChatCommands()
|
||||
|
||||
@@ -486,7 +486,7 @@ class TC_GAME_API OutdoorPvPScript : public ScriptObject
|
||||
public:
|
||||
|
||||
// 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
|
||||
@@ -956,7 +956,7 @@ class TC_GAME_API ScriptMgr
|
||||
|
||||
public: /* OutdoorPvPScript */
|
||||
|
||||
OutdoorPvP* CreateOutdoorPvP(uint32 scriptId);
|
||||
OutdoorPvP* CreateOutdoorPvP(uint32 scriptId, Map* map);
|
||||
|
||||
public: /* CommandScript */
|
||||
|
||||
|
||||
@@ -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