mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-24 14:16:31 +00:00
feat(Core/Misc): implement ObjectGuid class (port from TC) (#4885)
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#include "GameObject.h"
|
||||
#include "GossipDef.h"
|
||||
#include "Language.h"
|
||||
#include "MapManager.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "OutdoorPvPEP.h"
|
||||
@@ -70,22 +71,20 @@ void OPvPCapturePointEP_EWT::ChangeState()
|
||||
break;
|
||||
}
|
||||
|
||||
GameObject* flag = HashMapHolder<GameObject>::Find(m_capturePointGUID);
|
||||
GameObject* flag2 = HashMapHolder<GameObject>::Find(m_Objects[EP_EWT_FLAGS]);
|
||||
if (flag)
|
||||
{
|
||||
flag->SetGoArtKit(artkit);
|
||||
}
|
||||
if (flag2)
|
||||
{
|
||||
flag2->SetGoArtKit(artkit);
|
||||
}
|
||||
Map* map = sMapMgr->FindMap(0, 0);
|
||||
auto bounds = map->GetGameObjectBySpawnIdStore().equal_range(m_capturePointSpawnId);
|
||||
for (auto itr = bounds.first; itr != bounds.second; ++itr)
|
||||
itr->second->SetGoArtKit(artkit);
|
||||
|
||||
bounds = map->GetGameObjectBySpawnIdStore().equal_range(m_Objects[EP_EWT_FLAGS]);
|
||||
for (auto itr = bounds.first; itr != bounds.second; ++itr)
|
||||
itr->second->SetGoArtKit(artkit);
|
||||
|
||||
UpdateTowerState();
|
||||
|
||||
// complete quest objective
|
||||
if (m_TowerState == EP_TS_A || m_TowerState == EP_TS_H)
|
||||
SendObjectiveComplete(EP_EWT_CM, 0);
|
||||
SendObjectiveComplete(EP_EWT_CM);
|
||||
}
|
||||
|
||||
void OPvPCapturePointEP_EWT::SendChangePhase()
|
||||
@@ -218,22 +217,20 @@ void OPvPCapturePointEP_NPT::ChangeState()
|
||||
break;
|
||||
}
|
||||
|
||||
GameObject* flag = HashMapHolder<GameObject>::Find(m_capturePointGUID);
|
||||
GameObject* flag2 = HashMapHolder<GameObject>::Find(m_Objects[EP_NPT_FLAGS]);
|
||||
if (flag)
|
||||
{
|
||||
flag->SetGoArtKit(artkit);
|
||||
}
|
||||
if (flag2)
|
||||
{
|
||||
flag2->SetGoArtKit(artkit);
|
||||
}
|
||||
Map* map = sMapMgr->FindMap(0, 0);
|
||||
auto bounds = map->GetGameObjectBySpawnIdStore().equal_range(m_capturePointSpawnId);
|
||||
for (auto itr = bounds.first; itr != bounds.second; ++itr)
|
||||
itr->second->SetGoArtKit(artkit);
|
||||
|
||||
bounds = map->GetGameObjectBySpawnIdStore().equal_range(m_Objects[EP_NPT_FLAGS]);
|
||||
for (auto itr = bounds.first; itr != bounds.second; ++itr)
|
||||
itr->second->SetGoArtKit(artkit);
|
||||
|
||||
UpdateTowerState();
|
||||
|
||||
// complete quest objective
|
||||
if (m_TowerState == EP_TS_A || m_TowerState == EP_TS_H)
|
||||
SendObjectiveComplete(EP_NPT_CM, 0);
|
||||
SendObjectiveComplete(EP_NPT_CM);
|
||||
}
|
||||
|
||||
void OPvPCapturePointEP_NPT::SendChangePhase()
|
||||
@@ -291,9 +288,11 @@ void OPvPCapturePointEP_NPT::SummonGO(TeamId teamId)
|
||||
m_SummonedGOSideId = teamId;
|
||||
DelObject(EP_NPT_BUFF);
|
||||
AddObject(EP_NPT_BUFF, EP_NPT_LordaeronShrine.entry, EP_NPT_LordaeronShrine.map, EP_NPT_LordaeronShrine.x, EP_NPT_LordaeronShrine.y, EP_NPT_LordaeronShrine.z, EP_NPT_LordaeronShrine.o, EP_NPT_LordaeronShrine.rot0, EP_NPT_LordaeronShrine.rot1, EP_NPT_LordaeronShrine.rot2, EP_NPT_LordaeronShrine.rot3);
|
||||
GameObject* go = HashMapHolder<GameObject>::Find(m_Objects[EP_NPT_BUFF]);
|
||||
if (go)
|
||||
go->SetUInt32Value(GAMEOBJECT_FACTION, (teamId == TEAM_ALLIANCE ? 84 : 83));
|
||||
Map* map = sMapMgr->FindMap(0, 0);
|
||||
auto bounds = map->GetGameObjectBySpawnIdStore().equal_range(m_Objects[EP_NPT_BUFF]);
|
||||
for (auto itr = bounds.first; itr != bounds.second; ++itr)
|
||||
if (GameObject* go = itr->second)
|
||||
go->SetUInt32Value(GAMEOBJECT_FACTION, (teamId == TEAM_ALLIANCE ? 84 : 83));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -350,22 +349,20 @@ void OPvPCapturePointEP_CGT::ChangeState()
|
||||
break;
|
||||
}
|
||||
|
||||
GameObject* flag = HashMapHolder<GameObject>::Find(m_capturePointGUID);
|
||||
GameObject* flag2 = HashMapHolder<GameObject>::Find(m_Objects[EP_CGT_FLAGS]);
|
||||
if (flag)
|
||||
{
|
||||
flag->SetGoArtKit(artkit);
|
||||
}
|
||||
if (flag2)
|
||||
{
|
||||
flag2->SetGoArtKit(artkit);
|
||||
}
|
||||
Map* map = sMapMgr->FindMap(0, 0);
|
||||
auto bounds = map->GetGameObjectBySpawnIdStore().equal_range(m_capturePointSpawnId);
|
||||
for (auto itr = bounds.first; itr != bounds.second; ++itr)
|
||||
itr->second->SetGoArtKit(artkit);
|
||||
|
||||
bounds = map->GetGameObjectBySpawnIdStore().equal_range(m_Objects[EP_CGT_FLAGS]);
|
||||
for (auto itr = bounds.first; itr != bounds.second; ++itr)
|
||||
itr->second->SetGoArtKit(artkit);
|
||||
|
||||
UpdateTowerState();
|
||||
|
||||
// complete quest objective
|
||||
if (m_TowerState == EP_TS_A || m_TowerState == EP_TS_H)
|
||||
SendObjectiveComplete(EP_CGT_CM, 0);
|
||||
SendObjectiveComplete(EP_CGT_CM);
|
||||
}
|
||||
|
||||
void OPvPCapturePointEP_CGT::SendChangePhase()
|
||||
@@ -489,22 +486,20 @@ void OPvPCapturePointEP_PWT::ChangeState()
|
||||
break;
|
||||
}
|
||||
|
||||
GameObject* flag = HashMapHolder<GameObject>::Find(m_capturePointGUID);
|
||||
GameObject* flag2 = HashMapHolder<GameObject>::Find(m_Objects[EP_PWT_FLAGS]);
|
||||
if (flag)
|
||||
{
|
||||
flag->SetGoArtKit(artkit);
|
||||
}
|
||||
if (flag2)
|
||||
{
|
||||
flag2->SetGoArtKit(artkit);
|
||||
}
|
||||
Map* map = sMapMgr->FindMap(0, 0);
|
||||
auto bounds = map->GetGameObjectBySpawnIdStore().equal_range(m_capturePointSpawnId);
|
||||
for (auto itr = bounds.first; itr != bounds.second; ++itr)
|
||||
itr->second->SetGoArtKit(artkit);
|
||||
|
||||
bounds = map->GetGameObjectBySpawnIdStore().equal_range(m_Objects[EP_PWT_FLAGS]);
|
||||
for (auto itr = bounds.first; itr != bounds.second; ++itr)
|
||||
itr->second->SetGoArtKit(artkit);
|
||||
|
||||
UpdateTowerState();
|
||||
|
||||
// complete quest objective
|
||||
if (m_TowerState == EP_TS_A || m_TowerState == EP_TS_H)
|
||||
SendObjectiveComplete(EP_PWT_CM, 0);
|
||||
SendObjectiveComplete(EP_PWT_CM);
|
||||
}
|
||||
|
||||
void OPvPCapturePointEP_PWT::SendChangePhase()
|
||||
@@ -619,10 +614,13 @@ bool OutdoorPvPEP::SetupOutdoorPvP()
|
||||
for (uint8 i = 0; i < EPBuffZonesNum; ++i)
|
||||
RegisterZone(EPBuffZones[i]);
|
||||
|
||||
SetMapFromZone(EPBuffZones[0]);
|
||||
|
||||
AddCapturePoint(new OPvPCapturePointEP_EWT(this));
|
||||
AddCapturePoint(new OPvPCapturePointEP_PWT(this));
|
||||
AddCapturePoint(new OPvPCapturePointEP_CGT(this));
|
||||
AddCapturePoint(new OPvPCapturePointEP_NPT(this));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include "GameEventMgr.h"
|
||||
#include "Language.h"
|
||||
#include "MapManager.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "OutdoorPvPGH.h"
|
||||
#include "OutdoorPvPMgr.h"
|
||||
@@ -22,6 +23,8 @@ OutdoorPvPGH::OutdoorPvPGH()
|
||||
bool OutdoorPvPGH::SetupOutdoorPvP()
|
||||
{
|
||||
RegisterZone(GH_ZONE);
|
||||
SetMapFromZone(GH_ZONE);
|
||||
|
||||
if ((m_obj = new OPvPCapturePointGH(this)))
|
||||
{
|
||||
AddCapturePoint(m_obj);
|
||||
@@ -99,8 +102,10 @@ void OPvPCapturePointGH::ChangeState()
|
||||
break;
|
||||
}
|
||||
|
||||
if (GameObject* flag = HashMapHolder<GameObject>::Find(m_capturePointGUID))
|
||||
flag->SetGoArtKit(artkit);
|
||||
Map* map = sMapMgr->FindMap(571, 0);
|
||||
auto bounds = map->GetGameObjectBySpawnIdStore().equal_range(m_capturePointSpawnId);
|
||||
for (auto itr = bounds.first; itr != bounds.second; ++itr)
|
||||
itr->second->SetGoArtKit(artkit);
|
||||
}
|
||||
|
||||
class OutdoorPvP_grizzly_hills : public OutdoorPvPScript
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
#include "Language.h"
|
||||
#include "MapManager.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "OutdoorPvP.h"
|
||||
#include "OutdoorPvPHP.h"
|
||||
@@ -63,6 +64,8 @@ bool OutdoorPvPHP::SetupOutdoorPvP()
|
||||
for (int i = 0; i < OutdoorPvPHPBuffZonesNum; ++i)
|
||||
RegisterZone(OutdoorPvPHPBuffZones[i]);
|
||||
|
||||
SetMapFromZone(OutdoorPvPHPBuffZones[0]);
|
||||
|
||||
AddCapturePoint(new OPvPCapturePointHP(this, HP_TOWER_BROKEN_HILL));
|
||||
|
||||
AddCapturePoint(new OPvPCapturePointHP(this, HP_TOWER_OVERLOOK));
|
||||
@@ -241,16 +244,14 @@ void OPvPCapturePointHP::ChangeState()
|
||||
break;
|
||||
}
|
||||
|
||||
GameObject* flag = HashMapHolder<GameObject>::Find(m_capturePointGUID);
|
||||
GameObject* flag2 = HashMapHolder<GameObject>::Find(m_Objects[m_TowerType]);
|
||||
if (flag)
|
||||
{
|
||||
flag->SetGoArtKit(artkit);
|
||||
}
|
||||
if (flag2)
|
||||
{
|
||||
flag2->SetGoArtKit(artkit2);
|
||||
}
|
||||
Map* map = sMapMgr->FindMap(530, 0);
|
||||
auto bounds = map->GetGameObjectBySpawnIdStore().equal_range(m_capturePointSpawnId);
|
||||
for (auto itr = bounds.first; itr != bounds.second; ++itr)
|
||||
itr->second->SetGoArtKit(artkit);
|
||||
|
||||
bounds = map->GetGameObjectBySpawnIdStore().equal_range(m_Objects[m_TowerType]);
|
||||
for (auto itr = bounds.first; itr != bounds.second; ++itr)
|
||||
itr->second->SetGoArtKit(artkit2);
|
||||
|
||||
// send world state update
|
||||
if (field)
|
||||
@@ -258,7 +259,7 @@ void OPvPCapturePointHP::ChangeState()
|
||||
|
||||
// complete quest objective
|
||||
if (m_State == OBJECTIVESTATE_ALLIANCE || m_State == OBJECTIVESTATE_HORDE)
|
||||
SendObjectiveComplete(HP_CREDITMARKER[m_TowerType], 0);
|
||||
SendObjectiveComplete(HP_CREDITMARKER[m_TowerType]);
|
||||
}
|
||||
|
||||
void OPvPCapturePointHP::SendChangePhase()
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
#include "GameGraveyard.h"
|
||||
#include "MapManager.h"
|
||||
#include "Language.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "OutdoorPvPMgr.h"
|
||||
@@ -24,7 +25,7 @@ void OutdoorPvPNA::HandleKillImpl(Player* player, Unit* killed)
|
||||
{
|
||||
if (killed->GetTypeId() == TYPEID_PLAYER && player->GetTeamId() != killed->ToPlayer()->GetTeamId())
|
||||
{
|
||||
player->KilledMonsterCredit(NA_CREDIT_MARKER, 0); // 0 guid, btw it isn't even used in killedmonster function :S
|
||||
player->KilledMonsterCredit(NA_CREDIT_MARKER);
|
||||
player->CastSpell(player, player->GetTeamId() == TEAM_ALLIANCE ? NA_KILL_TOKEN_ALLIANCE : NA_KILL_TOKEN_HORDE, true);
|
||||
}
|
||||
}
|
||||
@@ -32,7 +33,7 @@ void OutdoorPvPNA::HandleKillImpl(Player* player, Unit* killed)
|
||||
uint32 OPvPCapturePointNA::GetAliveGuardsCount()
|
||||
{
|
||||
uint32 cnt = 0;
|
||||
for (std::map<uint32, uint64>::iterator itr = m_Creatures.begin(); itr != m_Creatures.end(); ++itr)
|
||||
for (std::map<uint32, ObjectGuid::LowType>::iterator itr = m_Creatures.begin(); itr != m_Creatures.end(); ++itr)
|
||||
{
|
||||
switch (itr->first)
|
||||
{
|
||||
@@ -51,10 +52,13 @@ uint32 OPvPCapturePointNA::GetAliveGuardsCount()
|
||||
case NA_NPC_GUARD_13:
|
||||
case NA_NPC_GUARD_14:
|
||||
case NA_NPC_GUARD_15:
|
||||
if (Creature const* const cr = HashMapHolder<Creature>::Find(itr->second))
|
||||
if (cr->IsAlive())
|
||||
{
|
||||
auto bounds = m_PvP->GetMap()->GetCreatureBySpawnIdStore().equal_range(itr->second);
|
||||
for (auto itr2 = bounds.first; itr2 != bounds.second; ++itr2)
|
||||
if (itr2->second->IsAlive())
|
||||
++cnt;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -199,6 +203,7 @@ 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
|
||||
RegisterZone(NA_BUFF_ZONE);
|
||||
SetMapFromZone(NA_BUFF_ZONE);
|
||||
|
||||
// halaa
|
||||
m_obj = new OPvPCapturePointNA(this);
|
||||
@@ -393,9 +398,9 @@ bool OPvPCapturePointNA::HandleCustomSpell(Player* player, uint32 spellId, GameO
|
||||
return false;
|
||||
}
|
||||
|
||||
int32 OPvPCapturePointNA::HandleOpenGo(Player* player, uint64 guid)
|
||||
int32 OPvPCapturePointNA::HandleOpenGo(Player* player, GameObject* go)
|
||||
{
|
||||
int32 retval = OPvPCapturePoint::HandleOpenGo(player, guid);
|
||||
int32 retval = OPvPCapturePoint::HandleOpenGo(player, go);
|
||||
if (retval >= 0)
|
||||
{
|
||||
const go_type* gos = nullptr;
|
||||
@@ -588,11 +593,9 @@ void OPvPCapturePointNA::ChangeState()
|
||||
break;
|
||||
}
|
||||
|
||||
GameObject* flag = HashMapHolder<GameObject>::Find(m_capturePointGUID);
|
||||
if (flag)
|
||||
{
|
||||
flag->SetGoArtKit(artkit);
|
||||
}
|
||||
auto bounds = sMapMgr->FindMap(530, 0)->GetGameObjectBySpawnIdStore().equal_range(m_capturePointSpawnId);
|
||||
for (auto itr = bounds.first; itr != bounds.second; ++itr)
|
||||
itr->second->SetGoArtKit(artkit);
|
||||
|
||||
UpdateHalaaWorldState();
|
||||
}
|
||||
|
||||
@@ -258,7 +258,7 @@ public:
|
||||
|
||||
bool HandleCustomSpell(Player* player, uint32 spellId, GameObject* go) override;
|
||||
|
||||
int32 HandleOpenGo(Player* player, uint64 guid) override;
|
||||
int32 HandleOpenGo(Player* player, GameObject* go) override;
|
||||
|
||||
uint32 GetAliveGuardsCount();
|
||||
TeamId GetControllingFaction() const;
|
||||
|
||||
@@ -50,6 +50,9 @@ bool OutdoorPvPSI::SetupOutdoorPvP()
|
||||
{
|
||||
for (uint8 i = 0; i < OutdoorPvPSIBuffZonesNum; ++i)
|
||||
RegisterZone(OutdoorPvPSIBuffZones[i]);
|
||||
|
||||
SetMapFromZone(OutdoorPvPSIBuffZones[0]);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -101,7 +104,7 @@ bool OutdoorPvPSI::HandleAreaTrigger(Player* player, uint32 trigger)
|
||||
// add 20 cenarion circle repu
|
||||
player->GetReputationMgr().ModifyReputation(sFactionStore.LookupEntry(609), 20);
|
||||
// complete quest
|
||||
player->KilledMonsterCredit(SI_TURNIN_QUEST_CM_A, 0);
|
||||
player->KilledMonsterCredit(SI_TURNIN_QUEST_CM_A);
|
||||
}
|
||||
return true;
|
||||
case SI_AREATRIGGER_H:
|
||||
@@ -127,7 +130,7 @@ bool OutdoorPvPSI::HandleAreaTrigger(Player* player, uint32 trigger)
|
||||
// add 20 cenarion circle repu
|
||||
player->GetReputationMgr().ModifyReputation(sFactionStore.LookupEntry(609), 20);
|
||||
// complete quest
|
||||
player->KilledMonsterCredit(SI_TURNIN_QUEST_CM_H, 0);
|
||||
player->KilledMonsterCredit(SI_TURNIN_QUEST_CM_H);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -158,7 +161,7 @@ bool OutdoorPvPSI::HandleDropFlag(Player* player, uint32 spellId)
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!go->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT), SI_SILITHYST_MOUND, map, player->GetPhaseMask(), player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetOrientation(), G3D::Quat(), 100, GO_STATE_READY))
|
||||
if (!go->Create(map->GenerateLowGuid<HighGuid::GameObject>(), SI_SILITHYST_MOUND, map, player->GetPhaseMask(), player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetOrientation(), G3D::Quat(), 100, GO_STATE_READY))
|
||||
{
|
||||
delete go;
|
||||
return true;
|
||||
@@ -192,7 +195,7 @@ bool OutdoorPvPSI::HandleDropFlag(Player* player, uint32 spellId)
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!go->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT), SI_SILITHYST_MOUND, map, player->GetPhaseMask(), player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetOrientation(), G3D::Quat(), 100, GO_STATE_READY))
|
||||
if (!go->Create(map->GenerateLowGuid<HighGuid::GameObject>(), SI_SILITHYST_MOUND, map, player->GetPhaseMask(), player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetOrientation(), G3D::Quat(), 100, GO_STATE_READY))
|
||||
{
|
||||
delete go;
|
||||
return true;
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
#include "Language.h"
|
||||
#include "MapManager.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "OutdoorPvP.h"
|
||||
#include "OutdoorPvPMgr.h"
|
||||
@@ -250,6 +251,8 @@ bool OutdoorPvPTF::SetupOutdoorPvP()
|
||||
for (uint8 i = 0; i < OutdoorPvPTFBuffZonesNum; ++i)
|
||||
RegisterZone(OutdoorPvPTFBuffZones[i]);
|
||||
|
||||
SetMapFromZone(OutdoorPvPTFBuffZones[0]);
|
||||
|
||||
AddCapturePoint(new OPvPCapturePointTF(this, TF_TOWER_NW));
|
||||
AddCapturePoint(new OPvPCapturePointTF(this, TF_TOWER_N));
|
||||
AddCapturePoint(new OPvPCapturePointTF(this, TF_TOWER_NE));
|
||||
@@ -329,9 +332,9 @@ void OPvPCapturePointTF::ChangeState()
|
||||
break;
|
||||
}
|
||||
|
||||
GameObject* flag = HashMapHolder<GameObject>::Find(m_capturePointGUID);
|
||||
if (flag)
|
||||
flag->SetGoArtKit(artkit);
|
||||
auto bounds = sMapMgr->FindMap(530, 0)->GetGameObjectBySpawnIdStore().equal_range(m_capturePointSpawnId);
|
||||
for (auto itr = bounds.first; itr != bounds.second; ++itr)
|
||||
itr->second->SetGoArtKit(artkit);
|
||||
|
||||
UpdateTowerState();
|
||||
}
|
||||
|
||||
@@ -177,6 +177,8 @@ bool OutdoorPvPZM::SetupOutdoorPvP()
|
||||
for (uint8 i = 0; i < OutdoorPvPZMBuffZonesNum; ++i)
|
||||
RegisterZone(OutdoorPvPZMBuffZones[i]);
|
||||
|
||||
SetMapFromZone(OutdoorPvPZMBuffZones[0]);
|
||||
|
||||
AddCapturePoint(new OPvPCapturePointZM_Beacon(this, ZM_BEACON_WEST));
|
||||
AddCapturePoint(new OPvPCapturePointZM_Beacon(this, ZM_BEACON_EAST));
|
||||
m_GraveYard = new OPvPCapturePointZM_GraveYard(this);
|
||||
@@ -203,9 +205,9 @@ bool OPvPCapturePointZM_GraveYard::Update(uint32 /*diff*/)
|
||||
return retval;
|
||||
}
|
||||
|
||||
int32 OPvPCapturePointZM_GraveYard::HandleOpenGo(Player* player, uint64 guid)
|
||||
int32 OPvPCapturePointZM_GraveYard::HandleOpenGo(Player* player, GameObject* go)
|
||||
{
|
||||
int32 retval = OPvPCapturePoint::HandleOpenGo(player, guid);
|
||||
int32 retval = OPvPCapturePoint::HandleOpenGo(player, go);
|
||||
if (retval >= 0)
|
||||
{
|
||||
if (player->HasAura(ZM_BATTLE_STANDARD_A) && m_GraveYardState != ZM_GRAVEYARD_A)
|
||||
@@ -244,7 +246,7 @@ OPvPCapturePointZM_GraveYard::OPvPCapturePointZM_GraveYard(OutdoorPvP* pvp)
|
||||
{
|
||||
m_BothControllingFactionId = TEAM_NEUTRAL;
|
||||
m_GraveYardState = ZM_GRAVEYARD_N;
|
||||
m_FlagCarrierGUID = 0;
|
||||
m_FlagCarrierGUID.Clear();
|
||||
// add field scouts here
|
||||
AddCreature(ZM_ALLIANCE_FIELD_SCOUT, ZM_AllianceFieldScout.entry, ZM_AllianceFieldScout.map, ZM_AllianceFieldScout.x, ZM_AllianceFieldScout.y, ZM_AllianceFieldScout.z, ZM_AllianceFieldScout.o);
|
||||
AddCreature(ZM_HORDE_FIELD_SCOUT, ZM_HordeFieldScout.entry, ZM_HordeFieldScout.map, ZM_HordeFieldScout.x, ZM_HordeFieldScout.y, ZM_HordeFieldScout.z, ZM_HordeFieldScout.o);
|
||||
@@ -312,7 +314,7 @@ void OPvPCapturePointZM_GraveYard::SetBeaconState(TeamId controlling_factionId)
|
||||
p->RemoveAurasDueToSpell(ZM_BATTLE_STANDARD_A);
|
||||
p->RemoveAurasDueToSpell(ZM_BATTLE_STANDARD_H);
|
||||
}
|
||||
m_FlagCarrierGUID = 0;
|
||||
m_FlagCarrierGUID.Clear();
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -323,8 +325,8 @@ void OPvPCapturePointZM_GraveYard::SetBeaconState(TeamId controlling_factionId)
|
||||
|
||||
bool OPvPCapturePointZM_GraveYard::CanTalkTo(Player* player, Creature* c, GossipMenuItems const& /*gso*/)
|
||||
{
|
||||
uint64 guid = c->GetGUID();
|
||||
std::map<uint64, uint32>::iterator itr = m_CreatureTypes.find(guid);
|
||||
ObjectGuid guid = c->GetGUID();
|
||||
std::map<ObjectGuid::LowType, uint32>::iterator itr = m_CreatureTypes.find(guid.GetCounter());
|
||||
if (itr != m_CreatureTypes.end())
|
||||
{
|
||||
if (itr->second == ZM_ALLIANCE_FIELD_SCOUT && player->GetTeamId() == TEAM_ALLIANCE && m_BothControllingFactionId == TEAM_ALLIANCE && !m_FlagCarrierGUID && m_GraveYardState != ZM_GRAVEYARD_A)
|
||||
@@ -335,27 +337,26 @@ bool OPvPCapturePointZM_GraveYard::CanTalkTo(Player* player, Creature* c, Gossip
|
||||
return false;
|
||||
}
|
||||
|
||||
bool OPvPCapturePointZM_GraveYard::HandleGossipOption(Player* player, uint64 guid, uint32 /*gossipid*/)
|
||||
bool OPvPCapturePointZM_GraveYard::HandleGossipOption(Player* player, Creature* creature, uint32 /*gossipid*/)
|
||||
{
|
||||
std::map<uint64, uint32>::iterator itr = m_CreatureTypes.find(guid);
|
||||
std::map<ObjectGuid::LowType, uint32>::iterator itr = m_CreatureTypes.find(creature->GetSpawnId());
|
||||
if (itr != m_CreatureTypes.end())
|
||||
{
|
||||
Creature* cr = HashMapHolder<Creature>::Find(guid);
|
||||
if (!cr)
|
||||
return true;
|
||||
// if the flag is already taken, then return
|
||||
if (m_FlagCarrierGUID)
|
||||
return true;
|
||||
|
||||
if (itr->second == ZM_ALLIANCE_FIELD_SCOUT)
|
||||
{
|
||||
cr->CastSpell(player, ZM_BATTLE_STANDARD_A, true);
|
||||
creature->CastSpell(player, ZM_BATTLE_STANDARD_A, true);
|
||||
m_FlagCarrierGUID = player->GetGUID();
|
||||
}
|
||||
else if (itr->second == ZM_HORDE_FIELD_SCOUT)
|
||||
{
|
||||
cr->CastSpell(player, ZM_BATTLE_STANDARD_H, true);
|
||||
creature->CastSpell(player, ZM_BATTLE_STANDARD_H, true);
|
||||
m_FlagCarrierGUID = player->GetGUID();
|
||||
}
|
||||
|
||||
UpdateTowerState();
|
||||
player->PlayerTalkClass->SendCloseGossip();
|
||||
return true;
|
||||
@@ -368,10 +369,10 @@ bool OPvPCapturePointZM_GraveYard::HandleDropFlag(Player* /*player*/, uint32 spe
|
||||
switch (spellId)
|
||||
{
|
||||
case ZM_BATTLE_STANDARD_A:
|
||||
m_FlagCarrierGUID = 0;
|
||||
m_FlagCarrierGUID.Clear();
|
||||
return true;
|
||||
case ZM_BATTLE_STANDARD_H:
|
||||
m_FlagCarrierGUID = 0;
|
||||
m_FlagCarrierGUID.Clear();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -197,11 +197,11 @@ public:
|
||||
|
||||
void UpdateTowerState();
|
||||
|
||||
int32 HandleOpenGo(Player* player, uint64 guid) override;
|
||||
int32 HandleOpenGo(Player* player, GameObject* go) override;
|
||||
|
||||
void SetBeaconState(TeamId controlling_teamId); // not good atm
|
||||
|
||||
bool HandleGossipOption(Player* player, uint64 guid, uint32 gossipid) override;
|
||||
bool HandleGossipOption(Player* player, Creature* creature, uint32 gossipid) override;
|
||||
|
||||
bool HandleDropFlag(Player* player, uint32 spellId) override;
|
||||
|
||||
@@ -214,7 +214,7 @@ private:
|
||||
|
||||
protected:
|
||||
TeamId m_BothControllingFactionId;
|
||||
uint64 m_FlagCarrierGUID;
|
||||
ObjectGuid m_FlagCarrierGUID;
|
||||
};
|
||||
|
||||
class OutdoorPvPZM : public OutdoorPvP
|
||||
|
||||
Reference in New Issue
Block a user