TrinityCore
Loading...
Searching...
No Matches
OutdoorPvP.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#include "OutdoorPvP.h"
19#include "CellImpl.h"
20#include "DatabaseEnv.h"
21#include "DBCStores.h"
22#include "GridNotifiersImpl.h"
23#include "Group.h"
24#include "Log.h"
25#include "Map.h"
26#include "MapManager.h"
27#include "ObjectAccessor.h"
28#include "ObjectMgr.h"
29#include "OutdoorPvPMgr.h"
30#include "WorldPacket.h"
31
33{
34 public:
36 : _zoneId(zoneId), _id(id) { }
37
38 void operator()(WorldPacket& data, LocaleConstant locale) const
39 {
40 std::string text = sOutdoorPvPMgr->GetDefenseMessage(_zoneId, _id, locale);
41
42 data.Initialize(SMSG_DEFENSE_MESSAGE, 4 + 4 + text.length());
43 data.append<uint32>(_zoneId);
44 data.append<uint32>(text.length());
45 data << text;
46 }
47
48 private:
51};
52
54 m_capturePointSpawnId(), m_capturePoint(nullptr), m_maxValue(0.0f), m_minValue(0.0f), m_maxSpeed(0),
55 m_value(0), m_team(TEAM_NEUTRAL), m_OldState(OBJECTIVESTATE_NEUTRAL),
56 m_State(OBJECTIVESTATE_NEUTRAL), m_neutralValuePct(0), m_PvP(pvp)
57{ }
58
69
76
78{
79 if (!m_capturePoint)
80 return;
81
82 // send this too, sometimes the slider disappears, dunno why :(
84 // send these updates to only the ones in this objective
86 // send this too, sometimes it resets :S
88}
89
91{
92 if (!entry)
93 {
94 GameObjectData const* data = sObjectMgr->GetGameObjectData(guid);
95 if (!data)
96 return;
97 entry = data->id;
98 }
99
100 m_Objects[type] = guid;
101 m_ObjectTypes[m_Objects[type]] = type;
102}
103
105{
106 if (!entry)
107 {
108 CreatureData const* data = sObjectMgr->GetCreatureData(guid);
109 if (!data)
110 return;
111 entry = data->id;
112 }
113
114 m_Creatures[type] = guid;
115 m_CreatureTypes[m_Creatures[type]] = type;
116}
117
118bool OPvPCapturePoint::AddObject(uint32 type, uint32 entry, uint32 map, Position const& pos, QuaternionData const& rot)
119{
120 if (ObjectGuid::LowType guid = sObjectMgr->AddGameObjectData(entry, map, pos, rot, 0))
121 {
122 AddGO(type, guid, entry);
123 return true;
124 }
125
126 return false;
127}
128
129bool OPvPCapturePoint::AddCreature(uint32 type, uint32 entry, uint32 map, Position const& pos, TeamId /*teamId = TEAM_NEUTRAL*/, uint32 spawntimedelay /*= 0*/)
130{
131 if (ObjectGuid::LowType guid = sObjectMgr->AddCreatureData(entry, map, pos, spawntimedelay))
132 {
133 AddCre(type, guid, entry);
134 return true;
135 }
136
137 return false;
138}
139
141{
142 TC_LOG_DEBUG("outdoorpvp", "Creating capture point {}", entry);
143
144 // check info existence
145 GameObjectTemplate const* goinfo = sObjectMgr->GetGameObjectTemplate(entry);
146 if (!goinfo || goinfo->type != GAMEOBJECT_TYPE_CAPTURE_POINT)
147 {
148 TC_LOG_ERROR("outdoorpvp", "OutdoorPvP: GO {} is not capture point!", entry);
149 return false;
150 }
151
152 m_capturePointSpawnId = sObjectMgr->AddGameObjectData(entry, map, pos, rot, 0);
153
154 if (m_capturePointSpawnId == 0)
155 return false;
156
157 // get the needed values from goinfo
158 m_maxValue = (float)goinfo->capturePoint.maxTime;
159 m_maxSpeed = m_maxValue / (goinfo->capturePoint.minTime ? goinfo->capturePoint.minTime : 60);
162
163 return true;
164}
165
167{
168 uint32 spawnId = m_Creatures[type];
169 if (!spawnId)
170 {
171 TC_LOG_DEBUG("outdoorpvp", "opvp creature type {} was already deleted", type);
172 return false;
173 }
174 TC_LOG_DEBUG("outdoorpvp", "deleting opvp creature type {}", type);
175 m_CreatureTypes[m_Creatures[type]] = 0;
176 m_Creatures[type] = 0;
177
178 return Creature::DeleteFromDB(spawnId);
179}
180
182{
183 uint32 spawnId = m_Objects[type];
184 if (!spawnId)
185 return false;
186
187 m_ObjectTypes[m_Objects[type]] = 0;
188 m_Objects[type] = 0;
189
190 return GameObject::DeleteFromDB(spawnId);
191}
192
194{
195 sObjectMgr->DeleteGameObjectData(m_capturePointSpawnId);
197
198 if (m_capturePoint)
199 {
200 m_capturePoint->SetRespawnTime(0); // not save respawn time
202 }
203
204 return true;
205}
206
208{
209 for (std::map<uint32, ObjectGuid::LowType>::iterator i = m_Objects.begin(); i != m_Objects.end(); ++i)
210 DelObject(i->first);
211 for (std::map<uint32, ObjectGuid::LowType>::iterator i = m_Creatures.begin(); i != m_Creatures.end(); ++i)
212 DelCreature(i->first);
214}
215
217{
218 // Remove script from any registered gameobjects/creatures
219 for (auto itr = m_GoScriptStore.begin(); itr != m_GoScriptStore.end(); ++itr)
220 {
221 if (GameObject* go = itr->second)
222 go->ClearZoneScript();
223 }
224 m_GoScriptStore.clear();
225
226 for (auto itr = m_CreatureScriptStore.begin(); itr != m_CreatureScriptStore.end(); ++itr)
227 {
228 if (Creature* creature = itr->second)
229 creature->ClearZoneScript();
230 }
231 m_CreatureScriptStore.clear();
232
233 for (OPvPCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr)
234 {
235 itr->second->DeleteSpawns();
236 delete itr->second;
237 }
238 m_capturePoints.clear();
239}
240
241OutdoorPvP::OutdoorPvP() : m_TypeId(0), m_sendUpdate(true), m_map(nullptr) { }
242
247
249{
250 m_players[player->GetTeamId()].insert(player->GetGUID());
251}
252
254{
255 // inform the objectives of the leaving
256 for (OPvPCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr)
257 itr->second->HandlePlayerLeave(player);
258 // remove the world state information from the player (we can't keep everyone up to date, so leave out those who are not in the concerning zones)
259 if (!player->GetSession()->PlayerLogout())
260 SendRemoveWorldStates(player);
261 m_players[player->GetTeamId()].erase(player->GetGUID());
262 TC_LOG_DEBUG("outdoorpvp", "Player {} left an outdoorpvp zone", player->GetName());
263}
264
265void OutdoorPvP::HandlePlayerResurrects(Player* /*player*/, uint32 /*zone*/) { }
266
268{
269 bool objective_changed = false;
270 for (OPvPCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr)
271 {
272 if (itr->second->Update(diff))
273 objective_changed = true;
274 }
275 return objective_changed;
276}
277
279{
280 if (!m_capturePoint)
281 return false;
282
283 float radius = (float)m_capturePoint->GetGOInfo()->capturePoint.radius;
284
285 for (uint32 team = 0; team < 2; ++team)
286 {
287 for (GuidSet::iterator itr = m_activePlayers[team].begin(); itr != m_activePlayers[team].end();)
288 {
289 ObjectGuid playerGuid = *itr;
290 ++itr;
291
292 if (Player* player = ObjectAccessor::FindPlayer(playerGuid))
293 if (!m_capturePoint->IsWithinDistInMap(player, radius) || !player->IsOutdoorPvPActive())
294 HandlePlayerLeave(player);
295 }
296 }
297
298 std::list<Player*> players;
301 Cell::VisitWorldObjects(m_capturePoint, searcher, radius);
302
303 for (std::list<Player*>::iterator itr = players.begin(); itr != players.end(); ++itr)
304 {
305 Player* const player = *itr;
306 if (player->IsOutdoorPvPActive())
307 {
308 if (m_activePlayers[player->GetTeamId()].insert(player->GetGUID()).second)
309 HandlePlayerEnter(*itr);
310 }
311 }
312
313 // get the difference of numbers
314 float fact_diff = ((float)m_activePlayers[0].size() - (float)m_activePlayers[1].size()) * diff / OUTDOORPVP_OBJECTIVE_UPDATE_INTERVAL;
315 if (!fact_diff)
316 return false;
317
318 uint32 Challenger = 0;
319 float maxDiff = m_maxSpeed * diff;
320
321 if (fact_diff < 0)
322 {
323 // horde is in majority, but it's already horde-controlled -> no change
325 return false;
326
327 if (fact_diff < -maxDiff)
328 fact_diff = -maxDiff;
329
330 Challenger = HORDE;
331 }
332 else
333 {
334 // ally is in majority, but it's already ally-controlled -> no change
336 return false;
337
338 if (fact_diff > maxDiff)
339 fact_diff = maxDiff;
340
341 Challenger = ALLIANCE;
342 }
343
344 float oldValue = m_value;
345 TeamId oldTeam = m_team;
346
348
349 m_value += fact_diff;
350
351 if (m_value < -m_minValue) // red
352 {
353 if (m_value < -m_maxValue)
357 }
358 else if (m_value > m_minValue) // blue
359 {
360 if (m_value > m_maxValue)
364 }
365 else if (oldValue * m_value <= 0) // grey, go through mid point
366 {
367 // if challenger is ally, then n->a challenge
368 if (Challenger == ALLIANCE)
370 // if challenger is horde, then n->h challenge
371 else if (Challenger == HORDE)
374 }
375 else // grey, did not go through mid point
376 {
377 // old phase and current are on the same side, so one team challenges the other
383 }
384
385 if (m_value != oldValue)
387
388 if (m_OldState != m_State)
389 {
390 //TC_LOG_ERROR("outdoorpvp", "{}->{}", m_OldState, m_State);
391 if (oldTeam != m_team)
392 ChangeTeam(oldTeam);
393 ChangeState();
394 return true;
395 }
396
397 return false;
398}
399
401{
402 if (m_sendUpdate)
403 for (int i = 0; i < 2; ++i)
404 for (GuidSet::iterator itr = m_players[i].begin(); itr != m_players[i].end(); ++itr)
405 if (Player* const player = ObjectAccessor::FindPlayer(*itr))
406 player->SendUpdateWorldState(field, value);
407}
408
410{
411 for (uint32 team = 0; team < 2; ++team)
412 {
413 // send to all players present in the area
414 for (GuidSet::iterator itr = m_activePlayers[team].begin(); itr != m_activePlayers[team].end(); ++itr)
415 if (Player* const player = ObjectAccessor::FindPlayer(*itr))
416 player->SendUpdateWorldState(field, value);
417 }
418}
419
421{
422 uint32 team;
423 switch (m_State)
424 {
426 team = 0;
427 break;
429 team = 1;
430 break;
431 default:
432 return;
433 }
434
435 // send to all players present in the area
436 for (GuidSet::iterator itr = m_activePlayers[team].begin(); itr != m_activePlayers[team].end(); ++itr)
437 if (Player* const player = ObjectAccessor::FindPlayer(*itr))
438 player->KilledMonsterCredit(id, guid);
439}
440
441void OutdoorPvP::HandleKill(Player* killer, Unit* killed)
442{
443 if (Group* group = killer->GetGroup())
444 {
445 for (GroupReference* itr = group->GetFirstMember(); itr != nullptr; itr = itr->next())
446 {
447 Player* groupGuy = itr->GetSource();
448
449 if (!groupGuy)
450 continue;
451
452 // skip if too far away
453 if (!groupGuy->IsAtGroupRewardDistance(killed))
454 continue;
455
456 // creature kills must be notified, even if not inside objective / not outdoor pvp active
457 // player kills only count if active and inside objective
458 if ((groupGuy->IsOutdoorPvPActive() && IsInsideObjective(groupGuy)) || killed->GetTypeId() == TYPEID_UNIT)
459 HandleKillImpl(groupGuy, killed);
460 }
461 }
462 else
463 {
464 // creature kills must be notified, even if not inside objective / not outdoor pvp active
465 if ((killer->IsOutdoorPvPActive() && IsInsideObjective(killer)) || killed->GetTypeId() == TYPEID_UNIT)
466 HandleKillImpl(killer, killed);
467 }
468}
469
471{
472 for (OPvPCapturePointMap::const_iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr)
473 if (itr->second->IsInsideObjective(player))
474 return true;
475
476 return false;
477}
478
480{
481 GuidSet const& plSet = m_activePlayers[player->GetTeamId()];
482 return plSet.find(player->GetGUID()) != plSet.end();
483}
484
486{
487 for (OPvPCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr)
488 if (itr->second->HandleCustomSpell(player, spellId, go))
489 return true;
490
491 return false;
492}
493
495{
496 if (!player->IsOutdoorPvPActive())
497 return false;
498 return true;
499}
500
502{
503 for (OPvPCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr)
504 if (itr->second->HandleOpenGo(player, go) >= 0)
505 return true;
506
507 return false;
508}
509
511{
512 for (OPvPCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr)
513 if (itr->second->HandleGossipOption(player, creature, id))
514 return true;
515
516 return false;
517}
518
520{
521 for (OPvPCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr)
522 if (itr->second->CanTalkTo(player, c, gso))
523 return true;
524
525 return false;
526}
527
529{
530 for (OPvPCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr)
531 if (itr->second->HandleDropFlag(player, id))
532 return true;
533
534 return false;
535}
536
537bool OPvPCapturePoint::HandleGossipOption(Player* /*player*/, Creature* /*guid*/, uint32 /*id*/)
538{
539 return false;
540}
541
542bool OPvPCapturePoint::CanTalkTo(Player* /*player*/, Creature* /*c*/, GossipMenuItems const& /*gso*/)
543{
544 return false;
545}
546
548{
549 return false;
550}
551
553{
554 std::map<ObjectGuid::LowType, uint32>::iterator itr = m_ObjectTypes.find(go->GetSpawnId());
555 if (itr != m_ObjectTypes.end())
556 return itr->second;
557
558 return -1;
559}
560
561bool OutdoorPvP::HandleAreaTrigger(Player* /*player*/, uint32 /*trigger*/)
562{
563 return false;
564}
565
567{
568 // This is faster than sWorld->SendZoneMessage
569 for (uint32 team = 0; team < PVP_TEAMS_COUNT; ++team)
570 for (GuidSet::const_iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr)
571 if (Player* const player = ObjectAccessor::FindPlayer(*itr))
572 player->SendDirectMessage(&data);
573}
574
576{
577 sOutdoorPvPMgr->AddZone(zoneId, this);
578}
579
580bool OutdoorPvP::HasPlayer(Player const* player) const
581{
582 GuidSet const& plSet = m_players[player->GetTeamId()];
583 return plSet.find(player->GetGUID()) != plSet.end();
584}
585
587{
588 if (spellId > 0)
589 {
590 for (GuidSet::iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr)
591 if (Player* const player = ObjectAccessor::FindPlayer(*itr))
592 player->CastSpell(player, (uint32)spellId, true);
593 }
594 else
595 {
596 for (GuidSet::iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr)
597 if (Player* const player = ObjectAccessor::FindPlayer(*itr))
598 player->RemoveAura((uint32)-spellId); // by stack?
599 }
600}
601
602void OutdoorPvP::TeamApplyBuff(TeamId team, uint32 spellId, uint32 spellId2)
603{
604 TeamCastSpell(team, spellId);
605 TeamCastSpell(OTHER_TEAM(team), spellId2 ? -(int32)spellId2 : -(int32)spellId);
606}
607
609{
610 GoScriptPair sp(go->GetGUID().GetCounter(), go);
611 m_GoScriptStore.insert(sp);
613 return;
614
616 cp->m_capturePoint = go;
617}
618
620{
621 m_GoScriptStore.erase(go->GetGUID().GetCounter());
622
624 return;
625
627 cp->m_capturePoint = nullptr;
628}
629
631{
632 CreatureScriptPair sp(creature->GetGUID().GetCounter(), creature);
633 m_CreatureScriptStore.insert(sp);
634}
635
637{
638 m_CreatureScriptStore.erase(creature->GetGUID().GetCounter());
639}
640
642{
643 DefenseMessageBuilder builder(zoneId, id);
645 BroadcastWorker(localizer, zoneId);
646}
647
648template<class Worker>
649void OutdoorPvP::BroadcastWorker(Worker& _worker, uint32 zoneId)
650{
651 for (uint32 i = 0; i < PVP_TEAMS_COUNT; ++i)
652 for (GuidSet::iterator itr = m_players[i].begin(); itr != m_players[i].end(); ++itr)
653 if (Player* player = ObjectAccessor::FindPlayer(*itr))
654 if (player->GetZoneId() == zoneId)
655 _worker(player);
656}
657
659{
660 AreaTableEntry const* areaTable = sAreaTableStore.AssertEntry(zone);
661 Map* map = sMapMgr->CreateBaseMap(areaTable->ContinentID);
662 ASSERT(!map->Instanceable());
663 m_map = map;
664}
LocaleConstant
Definition Common.h:48
DBCStorage< AreaTableEntry > sAreaTableStore(AreaTableEntryfmt)
int32_t int32
Definition Define.h:129
uint32_t uint32
Definition Define.h:133
#define ASSERT
Definition Errors.h:68
#define TC_LOG_DEBUG(filterType__,...)
Definition Log.h:156
#define TC_LOG_ERROR(filterType__,...)
Definition Log.h:165
#define sMapMgr
Definition MapManager.h:211
@ TYPEID_UNIT
Definition ObjectGuid.h:38
std::set< ObjectGuid > GuidSet
Definition ObjectGuid.h:260
#define sObjectMgr
Definition ObjectMgr.h:1721
#define sOutdoorPvPMgr
#define OUTDOORPVP_OBJECTIVE_UPDATE_INTERVAL
@ OBJECTIVESTATE_HORDE
Definition OutdoorPvP.h:43
@ OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE
Definition OutdoorPvP.h:45
@ OBJECTIVESTATE_ALLIANCE
Definition OutdoorPvP.h:42
@ OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE
Definition OutdoorPvP.h:44
@ OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE
Definition OutdoorPvP.h:47
@ OBJECTIVESTATE_NEUTRAL
Definition OutdoorPvP.h:41
@ OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE
Definition OutdoorPvP.h:46
#define OTHER_TEAM(a)
Definition OutdoorPvP.h:50
@ GAMEOBJECT_TYPE_CAPTURE_POINT
TeamId
@ TEAM_NEUTRAL
@ TEAM_ALLIANCE
@ TEAM_HORDE
uint8 constexpr PVP_TEAMS_COUNT
@ ALLIANCE
@ HORDE
T CalculatePct(T base, U pct)
Definition Util.h:71
void append(T value)
Definition ByteBuffer.h:129
static bool DeleteFromDB(ObjectGuid::LowType spawnId)
uint32 _zoneId
ZoneId.
void operator()(WorldPacket &data, LocaleConstant locale) const
DefenseMessageBuilder(uint32 zoneId, uint32 id)
uint32 _id
BroadcastTextId.
bool IsWithinDistInMap(Player const *player) const
GameObjectTemplate const * GetGOInfo() const
Definition GameObject.h:102
void Delete()
void SetRespawnTime(int32 respawn)
GameobjectTypes GetGoType() const
Definition GameObject.h:176
ObjectGuid::LowType GetSpawnId() const
Definition GameObject.h:112
static bool DeleteFromDB(ObjectGuid::LowType spawnId)
Definition Group.h:165
Definition Map.h:281
bool Instanceable() const
Definition Map.cpp:4226
OPvPCapturePoint(OutdoorPvP *pvp)
std::map< uint32, ObjectGuid::LowType > m_Creatures
Definition OutdoorPvP.h:179
virtual void ChangeState()=0
virtual bool HandleCustomSpell(Player *player, uint32 spellId, GameObject *go)
ObjectiveStates m_OldState
Definition OutdoorPvP.h:167
virtual bool HandleGossipOption(Player *player, Creature *guid, uint32 gossipid)
bool AddCreature(uint32 type, uint32 entry, uint32 map, Position const &pos, TeamId teamId=TEAM_NEUTRAL, uint32 spawntimedelay=0)
std::map< ObjectGuid::LowType, uint32 > m_ObjectTypes
Definition OutdoorPvP.h:180
virtual bool Update(uint32 diff)
std::map< ObjectGuid::LowType, uint32 > m_CreatureTypes
Definition OutdoorPvP.h:181
ObjectiveStates m_State
Definition OutdoorPvP.h:168
virtual void DeleteSpawns()
uint32 m_neutralValuePct
Definition OutdoorPvP.h:171
std::map< uint32, ObjectGuid::LowType > m_Objects
Definition OutdoorPvP.h:178
virtual bool CanTalkTo(Player *player, Creature *c, GossipMenuItems const &gso)
void AddCre(uint32 type, ObjectGuid::LowType guid, uint32 entry=0)
GuidSet m_activePlayers[2]
Definition OutdoorPvP.h:152
void SendUpdateWorldState(uint32 field, uint32 value)
virtual void HandlePlayerLeave(Player *player)
void SendObjectiveComplete(uint32 id, ObjectGuid guid)
GameObject * m_capturePoint
Definition OutdoorPvP.h:132
ObjectGuid::LowType m_capturePointSpawnId
Definition OutdoorPvP.h:130
virtual bool HandleDropFlag(Player *player, uint32 spellId)
virtual bool HandlePlayerEnter(Player *player)
bool SetCapturePointData(uint32 entry, uint32 map, Position const &pos, QuaternionData const &rot)
virtual void ChangeTeam(TeamId)
Definition OutdoorPvP.h:118
virtual int32 HandleOpenGo(Player *player, GameObject *go)
bool DelCreature(uint32 type)
bool AddObject(uint32 type, uint32 entry, uint32 map, Position const &pos, QuaternionData const &rot)
bool DelObject(uint32 type)
bool IsInsideObjective(Player *player) const
virtual void SendChangePhase()
void AddGO(uint32 type, ObjectGuid::LowType guid, uint32 entry=0)
LowType GetCounter() const
Definition ObjectGuid.h:156
uint32 LowType
Definition ObjectGuid.h:142
TypeID GetTypeId() const
Definition Object.h:93
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:78
virtual void HandlePlayerEnterZone(Player *player, uint32 zone)
void OnCreatureCreate(Creature *) override
OPvPCapturePointMap m_capturePoints
Definition OutdoorPvP.h:269
bool HasPlayer(Player const *player) const
GuidSet m_players[2]
Definition OutdoorPvP.h:271
virtual bool HandleAreaTrigger(Player *player, uint32 trigger)
virtual ~OutdoorPvP()
virtual bool Update(uint32 diff)
void TeamApplyBuff(TeamId team, uint32 spellId, uint32 spellId2=0)
void OnGameObjectRemove(GameObject *go) override
std::pair< ObjectGuid::LowType, Creature * > CreatureScriptPair
Definition OutdoorPvP.h:202
void OnGameObjectCreate(GameObject *go) override
void DeleteSpawns()
void RegisterZone(uint32 zoneid)
virtual void SendRemoveWorldStates(Player *)
Definition OutdoorPvP.h:278
virtual bool HandleCustomSpell(Player *player, uint32 spellId, GameObject *go)
OPvPCapturePoint * GetCapturePoint(ObjectGuid::LowType guid) const
Definition OutdoorPvP.h:292
void OnCreatureRemove(Creature *) override
virtual void HandlePlayerLeaveZone(Player *player, uint32 zone)
virtual bool HandleGossipOption(Player *player, Creature *creature, uint32 gossipid)
virtual bool HandleOpenGo(Player *player, GameObject *go)
void TeamCastSpell(TeamId team, int32 spellId)
virtual void HandlePlayerResurrects(Player *player, uint32 zone)
void SendUpdateWorldState(uint32 field, uint32 value)
std::map< ObjectGuid::LowType, Creature * > m_CreatureScriptStore
Definition OutdoorPvP.h:312
virtual bool CanTalkTo(Player *player, Creature *c, GossipMenuItems const &gso)
bool IsInsideObjective(Player *player) const
virtual void HandleKillImpl(Player *, Unit *)
Definition OutdoorPvP.h:231
void SetMapFromZone(uint32 zone)
std::pair< ObjectGuid::LowType, GameObject * > GoScriptPair
Definition OutdoorPvP.h:201
void BroadcastWorker(Worker &_worker, uint32 zoneId)
void SendDefenseMessage(uint32 zoneId, uint32 id)
void BroadcastPacket(WorldPacket &data) const
bool m_sendUpdate
Definition OutdoorPvP.h:275
std::map< ObjectGuid::LowType, GameObject * > m_GoScriptStore
Definition OutdoorPvP.h:311
virtual void HandleKill(Player *killer, Unit *killed)
virtual bool HandleDropFlag(Player *player, uint32 spellId)
Map * m_map
Definition OutdoorPvP.h:314
void SendUpdateWorldState(uint32 variable, uint32 value) const
Definition Player.cpp:8493
void SendDirectMessage(WorldPacket const *data) const
Definition Player.cpp:6161
bool IsAtGroupRewardDistance(WorldObject const *pRewardSource) const
Definition Player.cpp:23664
WorldSession * GetSession() const
Definition Player.h:1719
TeamId GetTeamId() const
Definition Player.h:1833
Group * GetGroup()
Definition Player.h:2171
bool IsOutdoorPvPActive() const
Definition Player.cpp:6932
Definition Unit.h:769
std::string const & GetName() const
Definition Object.h:382
void Initialize(uint16 opcode, size_t newres=200)
Definition WorldPacket.h:73
bool PlayerLogout() const
@ SMSG_DEFENSE_MESSAGE
Definition Opcodes.h:855
TC_GAME_API Player * FindPlayer(ObjectGuid const &)
static void VisitWorldObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)
Definition CellImpl.h:180
struct GameObjectTemplate::@191::@216 capturePoint
uint32 id
Definition SpawnData.h:96