Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
BattlegroundAB.cpp
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
6#include "BattlegroundAB.h"
7#include "BattlegroundMgr.h"
8#include "Creature.h"
9#include "Language.h"
10#include "Object.h"
11#include "ObjectMgr.h"
12#include "Player.h"
13#include "Util.h"
14#include "World.h"
15#include "WorldPacket.h"
16#include "WorldSession.h"
17
29
31
33{
35 {
36 int team_points[BG_TEAMS_COUNT] = { 0, 0 };
37
38 for (int node = 0; node < BG_AB_DYNAMIC_NODES_COUNT; ++node)
39 {
40 // 3 sec delay to spawn new banner instead previous despawned one
41 if (m_BannerTimers[node].timer)
42 {
43 if (m_BannerTimers[node].timer > diff)
44 m_BannerTimers[node].timer -= diff;
45 else
46 {
47 m_BannerTimers[node].timer = 0;
48 _CreateBanner(node, m_BannerTimers[node].type, m_BannerTimers[node].teamIndex, false);
49 }
50 }
51
52 // 1-minute to occupy a node from contested state
53 if (m_NodeTimers[node])
54 {
55 if (m_NodeTimers[node] > diff)
56 m_NodeTimers[node] -= diff;
57 else
58 {
59 m_NodeTimers[node] = 0;
60 // Change from contested to occupied !
61 uint8 teamIndex = m_Nodes[node] - 1;
62 m_prevNodes[node] = m_Nodes[node];
63 m_Nodes[node] += 2;
64 // burn current contested banner
65 _DelBanner(node, BG_AB_NODE_TYPE_CONTESTED, teamIndex);
66 // create new occupied banner
67 _CreateBanner(node, BG_AB_NODE_TYPE_OCCUPIED, teamIndex, true);
68 _SendNodeUpdate(node);
69 _NodeOccupied(node, (teamIndex == 0) ? ALLIANCE : HORDE);
70 // Message to chatlog
71
72 if (teamIndex == 0)
73 {
74 // FIXME: team and node names not localized
77 }
78 else
79 {
80 // FIXME: team and node names not localized
83 }
84 }
85 }
86
87 for (int team = 0; team < BG_TEAMS_COUNT; ++team)
88 if (m_Nodes[node] == team + BG_AB_NODE_TYPE_OCCUPIED)
89 ++team_points[team];
90 }
91
92 // Accumulate points
93 for (int team = 0; team < BG_TEAMS_COUNT; ++team)
94 {
95 int points = team_points[team];
96 if (!points)
97 continue;
98
99 m_lastTick[team] += diff;
100
101 if (m_lastTick[team] > BG_AB_TickIntervals[points])
102 {
103 m_lastTick[team] -= BG_AB_TickIntervals[points];
104 m_TeamScores[team] += BG_AB_TickPoints[points];
105 m_HonorScoreTics[team] += BG_AB_TickPoints[points];
107
109 {
112 }
113
114 if (m_HonorScoreTics[team] >= m_HonorTics)
115 {
118 }
119
121 {
122 if (team == TEAM_ALLIANCE)
124 else
128 }
129
132
133 if (team == TEAM_ALLIANCE)
135 else if (team == TEAM_HORDE)
137 // update achievement flags
138 // we increased m_TeamScores[team] so we just need to check if it is 500 more than other teams resources
139 uint8 otherTeam = (team + 1) % BG_TEAMS_COUNT;
140 if (m_TeamScores[team] > m_TeamScores[otherTeam] + 500)
141 m_TeamScores500Disadvantage[otherTeam] = true;
142 }
143 }
144
145 // Test win condition
150 }
151}
152
171
173{
174 // spawn neutral banners
175 for (int banner = BG_AB_OBJECT_BANNER_NEUTRAL, i = 0; i < 5; banner += 8, ++i)
177 for (int i = 0; i < BG_AB_DYNAMIC_NODES_COUNT; ++i)
178 {
179 //randomly select buff to spawn
180 uint8 buff = std::rand() % 2;
182 }
185
186 // Achievement: Let's Get This Done
188}
189
191{
193 //create score and add it to map, default values are set in the constructor
195
196 PlayerScores[player->GetGUID()] = sc;
197}
198
199void BattlegroundAB::RemovePlayer(Player* /*player*/, uint64 /*guid*/, uint32 /*team*/) { }
200
202{
204 return;
205
206 switch (trigger)
207 {
208 case 3948: // Arathi Basin Alliance Exit.
209 if (player->GetTeam() != ALLIANCE)
210 player->GetSession()->SendNotification("Only The Alliance can use that portal");
211 else
212 player->LeaveBattleground();
213 break;
214 case 3949: // Arathi Basin Horde Exit.
215 if (player->GetTeam() != HORDE)
216 player->GetSession()->SendNotification("Only The Horde can use that portal");
217 else
218 player->LeaveBattleground();
219 break;
220 case 3866: // Stables
221 case 3869: // Gold Mine
222 case 3867: // Farm
223 case 3868: // Lumber Mill
224 case 3870: // Black Smith
225 case 4020: // Unk1
226 case 4021: // Unk2
227 case 4674: // Unk3
228 //break;
229 default:
230 Battleground::HandleAreaTrigger(player, trigger);
231 break;
232 }
233}
234
235void BattlegroundAB::_CreateBanner(uint8 node, uint8 type, uint8 teamIndex, bool delay)
236{
237 // Just put it into the queue
238 if (delay)
239 {
240 m_BannerTimers[node].timer = 2000;
241 m_BannerTimers[node].type = type;
242 m_BannerTimers[node].teamIndex = teamIndex;
243 return;
244 }
245
246 uint8 obj = node * 8 + type + teamIndex;
247
249
250 // handle aura with banner
251 if (!type)
252 return;
253 obj = node * 8 + ((type == BG_AB_NODE_TYPE_OCCUPIED) ? (5 + teamIndex) : 7);
255}
256
257void BattlegroundAB::_DelBanner(uint8 node, uint8 type, uint8 teamIndex)
258{
259 uint8 obj = node * 8 + type + teamIndex;
261
262 // handle aura with banner
263 if (!type)
264 return;
265 obj = node * 8 + ((type == BG_AB_NODE_TYPE_OCCUPIED) ? (5 + teamIndex) : 7);
267}
268
270{
271 switch (node)
272 {
278 default:
279 ASSERT(false);
280 }
281 return 0;
282}
283
285{
286 const uint8 plusArray[] = { 0, 2, 3, 0, 1 };
287
288 // Node icons
289 for (uint8 node = 0; node < BG_AB_DYNAMIC_NODES_COUNT; ++node)
290 builder.AppendState(BG_AB_OP_NODEICONS[node], (m_Nodes[node] == 0) ? 1 : 0);
291
292 // Node occupied states
293 for (uint8 node = 0; node < BG_AB_DYNAMIC_NODES_COUNT; ++node)
294 for (uint8 i = 1; i < BG_AB_DYNAMIC_NODES_COUNT; ++i)
295 builder.AppendState(BG_AB_OP_NODESTATES[node] + plusArray[i], (m_Nodes[node] == i) ? 1 : 0);
296
297 // How many bases each team owns
298 uint8 ally = 0, horde = 0;
299 for (uint8 node = 0; node < BG_AB_DYNAMIC_NODES_COUNT; ++node)
301 ++ally;
303 ++horde;
304
307
308 // Team scores
313
314 // other unknown
315 builder.AppendState(0x745, 0x2); // 37 1861 unk
316}
317
319{
320 // Send node owner state update to refresh map icons on client
321 const uint8 plusArray[] = { 0, 2, 3, 0, 1 };
322
323 if (m_prevNodes[node])
324 UpdateWorldState(BG_AB_OP_NODESTATES[node] + plusArray[m_prevNodes[node]], 0);
325 else
327
328 UpdateWorldState(BG_AB_OP_NODESTATES[node] + plusArray[m_Nodes[node]], 1);
329
330 // How many bases each team owns
331 uint8 ally = 0, horde = 0;
332 for (uint8 i = 0; i < BG_AB_DYNAMIC_NODES_COUNT; ++i)
334 ++ally;
336 ++horde;
337
340}
341
343{
344 if (!AddSpiritGuide(node, BG_AB_SpiritGuidePos[node][0], BG_AB_SpiritGuidePos[node][1], BG_AB_SpiritGuidePos[node][2], BG_AB_SpiritGuidePos[node][3], team))
345 SF_LOG_ERROR("bg.battleground", "Failed to spawn spirit guide! point: %u, team: %u, ", node, team);
346
347 if (node >= BG_AB_DYNAMIC_NODES_COUNT)//only dynamic nodes, no start points
348 return;
349
350 uint8 capturedNodes = 0;
351 for (uint8 i = 0; i < BG_AB_DYNAMIC_NODES_COUNT; ++i)
353 ++capturedNodes;
354
355 if (capturedNodes >= 5)
357 if (capturedNodes >= 4)
359
360 Creature* trigger = BgCreatures[node + 7] ? GetBGCreature(node + 7) : NULL;//0-6 spirit guides
361 if (!trigger)
362 trigger = AddCreature(WORLD_TRIGGER, node + 7, team, BG_AB_NodePositions[node][0], BG_AB_NodePositions[node][1], BG_AB_NodePositions[node][2], BG_AB_NodePositions[node][3]);
363
364 //add bonus honor aura trigger creature when node is accupied
365 //cast bonus aura (+50% honor in 25yards)
366 //aura should only apply to players who have accupied the node, set correct faction for trigger
367 if (trigger)
368 {
369 trigger->setFaction(team == ALLIANCE ? 84 : 83);
370 trigger->CastSpell(trigger, SPELL_HONORABLE_DEFENDER_25Y, false);
371 }
372}
373
375{
376 if (node >= BG_AB_DYNAMIC_NODES_COUNT)
377 return;
378
379 //remove bonus honor aura trigger creature when node is lost
380 if (node < BG_AB_DYNAMIC_NODES_COUNT)//only dynamic nodes, no start points
381 DelCreature(node + 7);//NULL checks are in DelCreature! 0-6 spirit guides
382
384
385 DelCreature(node);
386
387 // buff object isn't despawned
388}
389
390/* Invoked if a player used a banner as a gameobject */
392{
394 return;
395
397 GameObject* obj = GetBgMap()->GetGameObject(BgObjects[node * 8 + 7]);
398 while ((node < BG_AB_DYNAMIC_NODES_COUNT) && ((!obj) || (!source->IsWithinDistInMap(obj, 10))))
399 {
400 ++node;
402 }
403
404 if (node == BG_AB_DYNAMIC_NODES_COUNT)
405 {
406 // this means our player isn't close to any of banners - maybe cheater ??
407 return;
408 }
409
410 TeamId teamIndex = GetTeamIndexByTeamId(source->GetTeam());
411
412 // Check if player really could use this banner, not cheated
413 if (!(m_Nodes[node] == 0 || teamIndex == m_Nodes[node] % 2))
414 return;
415
417 uint32 sound = 0;
418 // If node is neutral, change to contested
419 if (m_Nodes[node] == BG_AB_NODE_TYPE_NEUTRAL)
420 {
422 m_prevNodes[node] = m_Nodes[node];
423 m_Nodes[node] = teamIndex + 1;
424 // burn current neutral banner
426 // create new contested banner
427 _CreateBanner(node, BG_AB_NODE_TYPE_CONTESTED, teamIndex, true);
428 _SendNodeUpdate(node);
430
431 // FIXME: team and node names not localized
432 if (teamIndex == 0)
434 else
436
438 }
439 // If node is contested
441 {
442 // If last state is NOT occupied, change node to enemy-contested
444 {
446 m_prevNodes[node] = m_Nodes[node];
447 m_Nodes[node] = teamIndex + BG_AB_NODE_TYPE_CONTESTED;
448 // burn current contested banner
449 _DelBanner(node, BG_AB_NODE_TYPE_CONTESTED, !teamIndex);
450 // create new contested banner
451 _CreateBanner(node, BG_AB_NODE_TYPE_CONTESTED, teamIndex, true);
452 _SendNodeUpdate(node);
454
455 // FIXME: node names not localized
456 if (teamIndex == TEAM_ALLIANCE)
458 else
460 }
461 // If contested, change back to occupied
462 else
463 {
465 m_prevNodes[node] = m_Nodes[node];
466 m_Nodes[node] = teamIndex + BG_AB_NODE_TYPE_OCCUPIED;
467 // burn current contested banner
468 _DelBanner(node, BG_AB_NODE_TYPE_CONTESTED, !teamIndex);
469 // create new occupied banner
470 _CreateBanner(node, BG_AB_NODE_TYPE_OCCUPIED, teamIndex, true);
471 _SendNodeUpdate(node);
472 m_NodeTimers[node] = 0;
473 _NodeOccupied(node, (teamIndex == TEAM_ALLIANCE) ? ALLIANCE : HORDE);
474
475 // FIXME: node names not localized
476 if (teamIndex == TEAM_ALLIANCE)
478 else
480 }
482 }
483 // If node is occupied, change to enemy-contested
484 else
485 {
487 m_prevNodes[node] = m_Nodes[node];
488 m_Nodes[node] = teamIndex + BG_AB_NODE_TYPE_CONTESTED;
489 // burn current occupied banner
490 _DelBanner(node, BG_AB_NODE_TYPE_OCCUPIED, !teamIndex);
491 // create new contested banner
492 _CreateBanner(node, BG_AB_NODE_TYPE_CONTESTED, teamIndex, true);
493 _SendNodeUpdate(node);
494 _NodeDeOccupied(node);
496
497 // FIXME: node names not localized
498 if (teamIndex == TEAM_ALLIANCE)
500 else
502
504 }
505
506 // If node is occupied again, send "X has taken the Y" msg.
508 {
509 // FIXME: team and node names not localized
510 if (teamIndex == TEAM_ALLIANCE)
512 else
514 }
515 PlaySoundToAll(sound);
516}
517
519{
520 // How many bases each team owns
521 uint8 ally = 0, horde = 0;
522 for (uint8 i = 0; i < BG_AB_DYNAMIC_NODES_COUNT; ++i)
524 ++ally;
526 ++horde;
527
528 if (ally > horde)
529 return ALLIANCE;
530 else if (horde > ally)
531 return HORDE;
532
533 // If the values are equal, fall back to the original result (based on number of players on each team)
535}
536
538{
539 for (int i = 0; i < BG_AB_DYNAMIC_NODES_COUNT; ++i)
540 {
549 )
550 {
551 SF_LOG_ERROR("sql.sql", "BatteGroundAB: Failed to spawn some object Battleground not created!");
552 return false;
553 }
554 }
557 )
558 {
559 SF_LOG_ERROR("sql.sql", "BatteGroundAB: Failed to spawn door object Battleground not created!");
560 return false;
561 }
562 //buffs
563 for (int i = 0; i < BG_AB_DYNAMIC_NODES_COUNT; ++i)
564 {
568 )
569 SF_LOG_ERROR("sql.sql", "BatteGroundAB: Failed to spawn buff object!");
570 }
571
572 return true;
573}
574
576{
577 //call parent's class reset
579
589 bool isBGWeekend = sBattlegroundMgr->IsBGWeekend(GetTypeID());
594
595 for (uint8 i = 0; i < BG_AB_DYNAMIC_NODES_COUNT; ++i)
596 {
597 m_Nodes[i] = 0;
598 m_prevNodes[i] = 0;
599 m_NodeTimers[i] = 0;
600 m_BannerTimers[i].timer = 0;
601 }
602
603 for (uint8 i = 0; i < BG_AB_ALL_NODES_COUNT + 5; ++i)//+5 for aura triggers
604 if (BgCreatures[i])
605 DelCreature(i);
606}
607
609{
610 // Win reward
611 if (winner == ALLIANCE)
613 if (winner == HORDE)
615 // Complete map_end rewards (even if no team wins)
618
620}
621
623{
624 TeamId teamIndex = GetTeamIndexByTeamId(player->GetTeam());
625
626 // Is there any occupied node for this team?
627 std::vector<uint8> nodes;
628 for (uint8 i = 0; i < BG_AB_DYNAMIC_NODES_COUNT; ++i)
629 if (m_Nodes[i] == teamIndex + 3)
630 nodes.push_back(i);
631
632 WorldSafeLocsEntry const* good_entry = NULL;
633 // If so, select the closest node to place ghost on
634 if (!nodes.empty())
635 {
636 float plr_x = player->GetPositionX();
637 float plr_y = player->GetPositionY();
638
639 float mindist = 999999.0f;
640 for (uint8 i = 0; i < nodes.size(); ++i)
641 {
642 WorldSafeLocsEntry const* entry = sWorldSafeLocsStore.LookupEntry(BG_AB_GraveyardIds[nodes[i]]);
643 if (!entry)
644 continue;
645 float dist = (entry->x - plr_x) * (entry->x - plr_x) + (entry->y - plr_y) * (entry->y - plr_y);
646 if (mindist > dist)
647 {
648 mindist = dist;
649 good_entry = entry;
650 }
651 }
652 nodes.clear();
653 }
654 // If not, place ghost on starting location
655 if (!good_entry)
656 good_entry = sWorldSafeLocsStore.LookupEntry(BG_AB_GraveyardIds[teamIndex + 5]);
657
658 return good_entry;
659}
660
661void BattlegroundAB::UpdatePlayerScore(Player* Source, uint32 type, uint32 value, bool doAddHonor)
662{
663 BattlegroundScoreMap::iterator itr = PlayerScores.find(Source->GetGUID());
664 if (itr == PlayerScores.end()) // player not found...
665 return;
666
667 switch (type)
668 {
670 ((BattlegroundABScore*)itr->second)->BasesAssaulted += value;
672 break;
674 ((BattlegroundABScore*)itr->second)->BasesDefended += value;
676 break;
677 default:
678 Battleground::UpdatePlayerScore(Source, type, value, doAddHonor);
679 break;
680 }
681}
682
684{
685 uint32 count = 0;
686 for (int i = 0; i < BG_AB_DYNAMIC_NODES_COUNT; ++i)
687 if ((team == ALLIANCE && m_Nodes[i] == BG_AB_NODE_STATUS_ALLY_OCCUPIED) ||
689 ++count;
690
691 return count == BG_AB_DYNAMIC_NODES_COUNT;
692}
693
694bool BattlegroundAB::CheckAchievementCriteriaMeet(uint32 criteriaId, Player const* player, Unit const* target, uint32 miscvalue)
695{
696 switch (criteriaId)
697 {
700 }
701
702 return Battleground::CheckAchievementCriteriaMeet(criteriaId, player, target, miscvalue);
703}
@ BG_CRITERIA_CHECK_RESILIENT_VICTORY
@ RESPAWN_IMMEDIATELY
@ RESPAWN_ONE_DAY
uint32 const Buff_Entries[3]
@ SPELL_HONORABLE_DEFENDER_25Y
@ SCORE_BASES_ASSAULTED
@ SCORE_BASES_DEFENDED
#define BG_TEAMS_COUNT
@ STATUS_IN_PROGRESS
@ SPELL_AB_QUEST_REWARD_4_BASES
@ SPELL_AB_QUEST_REWARD_5_BASES
@ BG_STARTING_EVENT_THIRD
@ BG_STARTING_EVENT_SECOND
@ BG_STARTING_EVENT_FIRST
@ BG_STARTING_EVENT_FOURTH
#define BG_AB_ABBGWeekendReputationTicks
const uint32 BG_AB_TickPoints[6]
@ BG_AB_OBJECT_BANNER_HORDE
@ BG_AB_OBJECT_BANNER_ALLY
@ BG_AB_OBJECT_GATE_A
@ BG_AB_OBJECT_AURA_HORDE
@ BG_AB_OBJECT_MAX
@ BG_AB_OBJECT_GATE_H
@ BG_AB_OBJECT_BANNER_NEUTRAL
@ BG_AB_OBJECT_BANNER_CONT_H
@ BG_AB_OBJECT_SPEEDBUFF_STABLES
@ BG_AB_OBJECT_BANNER_CONT_A
@ BG_AB_OBJECT_AURA_ALLY
@ BG_AB_OBJECT_AURA_CONTESTED
#define AB_EVENT_START_BATTLE
const float BG_AB_BuffPositions[BG_AB_DYNAMIC_NODES_COUNT][4]
@ BG_AB_NODE_TYPE_OCCUPIED
@ BG_AB_NODE_STATUS_ALLY_CONTESTED
@ BG_AB_NODE_STATUS_ALLY_OCCUPIED
@ BG_AB_NODE_STATUS_HORDE_OCCUPIED
@ BG_AB_NODE_STATUS_HORDE_CONTESTED
@ BG_AB_NODE_TYPE_NEUTRAL
@ BG_AB_NODE_TYPE_CONTESTED
const uint32 BG_AB_TickIntervals[6]
const float BG_AB_DoorPositions[2][8]
const uint32 BG_AB_GraveyardIds[BG_AB_ALL_NODES_COUNT]
@ BG_AB_OBJECTID_BANNER_CONT_A
@ BG_AB_OBJECTID_BANNER_A
@ BG_AB_OBJECTID_AURA_A
@ BG_AB_OBJECTID_BANNER_H
@ BG_AB_OBJECTID_AURA_C
@ BG_AB_OBJECTID_AURA_H
@ BG_AB_OBJECTID_GATE_A
@ BG_AB_OBJECTID_BANNER_CONT_H
@ BG_AB_OBJECTID_GATE_H
@ BG_AB_NODE_BLACKSMITH
@ BG_AB_NODE_STABLES
@ BG_AB_ALL_NODES_COUNT
@ BG_AB_NODE_LUMBER_MILL
@ BG_AB_DYNAMIC_NODES_COUNT
@ BG_AB_NODE_FARM
@ BG_AB_SPIRIT_HORDE
@ BG_AB_NODE_GOLD_MINE
@ BG_AB_SPIRIT_ALIANCE
const float BG_AB_SpiritGuidePos[BG_AB_ALL_NODES_COUNT][4]
#define BG_AB_NotABBGWeekendReputationTicks
#define BG_AB_NotABBGWeekendHonorTicks
const uint32 BG_AB_OP_NODEICONS[5]
@ BG_AB_OBJECTID_NODE_BANNER_0
@ BG_AB_FLAG_CAPTURING_TIME
#define BG_AB_ABBGWeekendHonorTicks
@ AB_OBJECTIVE_ASSAULT_BASE
@ AB_OBJECTIVE_DEFEND_BASE
const uint32 BG_AB_OP_NODESTATES[5]
@ BG_AB_OP_RESOURCES_ALLY
@ BG_AB_OP_RESOURCES_MAX
@ BG_AB_OP_OCCUPIED_BASES_HORDE
@ BG_AB_OP_RESOURCES_HORDE
@ BG_AB_OP_RESOURCES_WARNING
@ BG_AB_OP_OCCUPIED_BASES_ALLY
@ BG_AB_WARNING_NEAR_VICTORY_SCORE
@ BG_AB_MAX_TEAM_SCORE
const float BG_AB_NodePositions[BG_AB_DYNAMIC_NODES_COUNT][4]
@ BG_AB_SOUND_NODE_CAPTURED_HORDE
@ BG_AB_SOUND_NODE_ASSAULTED_ALLIANCE
@ BG_AB_SOUND_NEAR_VICTORY
@ BG_AB_SOUND_NODE_ASSAULTED_HORDE
@ BG_AB_SOUND_NODE_CLAIMED
@ BG_AB_SOUND_NODE_CAPTURED_ALLIANCE
#define sBattlegroundMgr
@ ACHIEVEMENT_TIMED_TYPE_EVENT
Definition DBCEnums.h:158
@ ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE
Definition DBCEnums.h:195
DBCStorage< WorldSafeLocsEntry > sWorldSafeLocsStore(WorldSafeLocsEntryfmt)
std::int32_t int32
Definition Define.h:73
std::uint8_t uint8
Definition Define.h:79
std::uint32_t uint32
Definition Define.h:77
std::uint64_t uint64
Definition Define.h:76
#define ASSERT
Definition Errors.h:29
@ LANG_BG_AB_START_HALF_MINUTE
Definition Language.h:650
@ LANG_BG_AB_NODE_FARM
Definition Language.h:640
@ LANG_BG_AB_HAS_BEGUN
Definition Language.h:651
@ LANG_BG_AB_NODE_TAKEN
Definition Language.h:643
@ LANG_BG_AB_NODE_ASSAULTED
Definition Language.h:645
@ LANG_BG_AB_START_ONE_MINUTE
Definition Language.h:649
@ LANG_BG_AB_NODE_BLACKSMITH
Definition Language.h:639
@ LANG_BG_AB_H_NEAR_VICTORY
Definition Language.h:653
@ LANG_BG_AB_NODE_DEFENDED
Definition Language.h:644
@ LANG_BG_AB_NODE_STABLES
Definition Language.h:638
@ LANG_BG_AB_NODE_LUMBER_MILL
Definition Language.h:641
@ LANG_BG_AB_START_TWO_MINUTES
Definition Language.h:648
@ LANG_BG_AB_NODE_GOLD_MINE
Definition Language.h:642
@ LANG_BG_AB_ALLY
Definition Language.h:636
@ LANG_BG_AB_HORDE
Definition Language.h:637
@ LANG_BG_AB_NODE_CLAIMED
Definition Language.h:646
@ LANG_BG_AB_A_NEAR_VICTORY
Definition Language.h:652
#define SF_LOG_ERROR(filterType__,...)
Definition Log.h:143
@ CHAT_MSG_BG_SYSTEM_ALLIANCE
@ CHAT_MSG_BG_SYSTEM_NEUTRAL
@ CHAT_MSG_BG_SYSTEM_HORDE
TeamId
@ TEAM_ALLIANCE
@ TEAM_HORDE
@ ALLIANCE
@ HORDE
@ AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT
Definition Unit.h:64
#define WORLD_TRIGGER
Definition Unit.h:20
bool SetupBattleground() OVERRIDE
void RemovePlayer(Player *player, uint64 guid, uint32 team) OVERRIDE
void _NodeOccupied(uint8 node, Team team)
int32 _GetNodeNameId(uint8 node)
void Reset() OVERRIDE
void UpdatePlayerScore(Player *Source, uint32 type, uint32 value, bool doAddHonor=true) OVERRIDE
bool m_TeamScores500Disadvantage[BG_TEAMS_COUNT]
bool CheckAchievementCriteriaMeet(uint32, Player const *, Unit const *=NULL, uint32=0) OVERRIDE
void _SendNodeUpdate(uint8 node)
bool IsAllNodesControlledByTeam(uint32 team) const OVERRIDE
void FillInitialWorldStates(WorldStateBuilder &builder) OVERRIDE
uint32 m_NodeTimers[BG_AB_DYNAMIC_NODES_COUNT]
uint32 m_lastTick[BG_TEAMS_COUNT]
uint8 m_Nodes[BG_AB_DYNAMIC_NODES_COUNT]
void AddPlayer(Player *player) OVERRIDE
void _CreateBanner(uint8 node, uint8 type, uint8 teamIndex, bool delay)
void StartingEventCloseDoors() OVERRIDE
void _DelBanner(uint8 node, uint8 type, uint8 teamIndex)
uint32 m_ReputationScoreTics[BG_TEAMS_COUNT]
void StartingEventOpenDoors() OVERRIDE
uint8 m_prevNodes[BG_AB_DYNAMIC_NODES_COUNT]
void PostUpdateImpl(uint32 diff) OVERRIDE
Post-update hook.
uint32 m_HonorScoreTics[BG_TEAMS_COUNT]
void _NodeDeOccupied(uint8 node)
void HandleAreaTrigger(Player *Source, uint32 Trigger) OVERRIDE
BG_AB_BannerTimer m_BannerTimers[BG_AB_DYNAMIC_NODES_COUNT]
WorldSafeLocsEntry const * GetClosestGraveYard(Player *player) OVERRIDE
void EventPlayerClickedOnFlag(Player *source, GameObject *target_obj) OVERRIDE
void EndBattleground(uint32 winner)
uint32 GetPrematureWinner() OVERRIDE
virtual void AddPlayer(Player *player)
BattlegroundTypeId GetTypeID(bool GetRandom=false) const
void EndBattleground(uint32 winner)
void CastSpellOnTeam(uint32 SpellID, uint32 TeamID)
static TeamId GetTeamIndexByTeamId(uint32 Team)
void DoorOpen(uint32 type)
bool DelCreature(uint32 type)
void SpawnBGObject(uint32 type, uint32 respawntime)
virtual void Reset()
void PlaySoundToAll(uint32 SoundID)
BattlegroundMap * GetBgMap() const
void DoorClose(uint32 type)
void RelocateDeadPlayers(uint64 queueIndex)
Relocate all players in ReviveQueue to the closest graveyard.
BGObjects BgObjects
void UpdateWorldState(uint32 Field, uint32 Value)
BattlegroundScoreMap PlayerScores
void RewardHonorToTeam(uint32 Honor, uint32 TeamID)
bool AddSpiritGuide(uint32 type, float x, float y, float z, float o, uint32 team)
BattlegroundStatus GetStatus() const
virtual bool CheckAchievementCriteriaMeet(uint32, Player const *, Unit const *=NULL, uint32=0)
virtual void HandleAreaTrigger(Player *, uint32)
BGCreatures BgCreatures
void StartTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry)
void SendMessage2ToAll(int32 entry, ChatMsg type, Player const *source, int32 strId1=0, int32 strId2=0)
uint32 GetBonusHonorFromKill(uint32 kills) const
void RewardReputationToTeam(uint32 faction_id, uint32 Reputation, uint32 TeamID)
virtual void UpdatePlayerScore(Player *player, uint32 type, uint32 value, bool doAddHonor=true)
Creature * AddCreature(uint32 entry, uint32 type, uint32 teamval, float x, float y, float z, float o, uint32 respawntime=0)
void SendMessageToAll(int32 entry, ChatMsg type, Player const *source=NULL)
int32 m_TeamScores[BG_TEAMS_COUNT]
Creature * GetBGCreature(uint32 type)
bool AddObject(uint32 type, uint32 entry, float x, float y, float z, float o, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime=0)
virtual uint32 GetPrematureWinner()
uint32 StartMessageIds[BG_STARTING_EVENT_COUNT]
GameObject * GetGameObject(uint64 guid)
Definition Map.cpp:3184
uint64 GetGUID() const
Definition Object.h:119
uint32 GetTeam() const
Definition Player.h:2527
void LeaveBattleground(bool teleportToEntryPoint=true)
Definition Player.cpp:17984
WorldSession * GetSession() const
Definition Player.h:2417
void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint64 miscValue1=0, uint64 miscValue2=0, uint64 miscValue3=0, Unit *unit=NULL)
Definition Player.cpp:21033
Definition Unit.h:1367
void setFaction(uint32 faction)
Definition Unit.h:1699
void CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, uint64 originalCaster=0)
void RemoveAurasWithInterruptFlags(uint32 flag, uint32 except=0)
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true) const
Definition Object.cpp:1735
void SendNotification(const char *format,...) ATTR_PRINTF(2
void AppendState(uint32 worldstate, uint32 value)
float GetPositionX() const
Definition Object.h:328
float GetPositionY() const
Definition Object.h:329
float x
float y