Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
BattlegroundBFG.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 "AchievementMgr.h"
7#include "Battleground.h"
8#include "BattlegroundBFG.h"
9#include "BattlegroundMgr.h"
10#include "Creature.h"
11#include "Language.h"
12#include "Object.h"
13#include "ObjectMgr.h"
14#include "Player.h"
15#include "Util.h"
16#include "World.h"
17#include "WorldPacket.h"
18#include "WorldSession.h"
19
53
55
57{
59 int team_points[BG_TEAMS_COUNT] = { 0, 0 };
60
61 for (int node = 0; node < GILNEAS_BG_DYNAMIC_NODES_COUNT; ++node)
62 {
63 // 3 sec delay to spawn new banner instead previous despawned one
64 if (m_BannerTimers[node].timer) {
65 if (m_BannerTimers[node].timer > diff)
66 m_BannerTimers[node].timer -= diff;
67 else
68 {
69 m_BannerTimers[node].timer = 0;
70 _CreateBanner(node, m_BannerTimers[node].type, m_BannerTimers[node].teamIndex, false);
71 }
72 }
73
74 // 1-minute to occupy a node from contested state
75 if (m_NodeTimers[node])
76 {
77 if (m_NodeTimers[node] > diff)
78 m_NodeTimers[node] -= diff;
79 else
80 {
81 m_NodeTimers[node] = 0;
82 // Change from contested to occupied !
83 uint8 teamIndex = m_Nodes[node] - 1;
84 m_prevNodes[node] = m_Nodes[node];
85 m_Nodes[node] += 2;
86 // burn current contested banner
88 // create new occupied banner
89 _CreateBanner(node, GILNEAS_BG_NODE_TYPE_OCCUPIED, teamIndex, true);
90 _SendNodeUpdate(node);
91 _NodeOccupied(node, (teamIndex == 0) ? ALLIANCE : HORDE);
92 // Message to chatlog
93
94 if (teamIndex == 0)
95 {
96 // FIXME: team and node names not localized
99 }
100 else
101 {
102 // FIXME: team and node names not localized
105 }
106 }
107 }
108
109 for (int team = 0; team < BG_TEAMS_COUNT; ++team)
110 if (m_Nodes[node] == team + GILNEAS_BG_NODE_TYPE_OCCUPIED)
111 ++team_points[team];
112 }
113
114 // Accumulate points
115 for (int team = 0; team < BG_TEAMS_COUNT; ++team)
116 {
117 int points = team_points[team];
118 if (!points)
119 continue;
120
121 m_lastTick[team] += diff;
122
123 if (m_lastTick[team] > GILNEAS_BG_TickIntervals[points])
124 {
125 m_lastTick[team] -= GILNEAS_BG_TickIntervals[points];
126 m_TeamScores[team] += GILNEAS_BG_TickPoints[points];
129
131 {
134 }
135
136 if (m_HonorScoreTics[team] >= m_HonorTics)
137 {
140 }
141
143 {
144 if (team == TEAM_ALLIANCE)
146 else
150 }
151
154
155 if (team == TEAM_ALLIANCE)
157 else if (team == TEAM_HORDE)
159 // update achievement flags
160 // we increased m_TeamScores[team] so we just need to check if it is 500 more than other teams resources
161 uint8 otherTeam = (team + 1) % BG_TEAMS_COUNT;
162 if (m_TeamScores[team] > m_TeamScores[otherTeam] + 500)
163 m_TeamScores500Disadvantage[otherTeam] = true;
164 }
165 }
166
167 // Test win condition
172 }
173}
174
193
195{
196 // spawn neutral banners
197 for (int banner = GILNEAS_BG_OBJECT_BANNER_NEUTRAL, i = 0; i < 3; banner += 8, ++i)
199 for (int i = 0; i < GILNEAS_BG_DYNAMIC_NODES_COUNT; ++i)
200 {
201 //randomly select buff to spawn
202 uint8 buff = std::rand() % 2;
204 }
207
208 // Achievement: Let's Get This Done
210}
211
213{
216 PlayerScores[player->GetGUID()] = sc;
217}
218
219void BattlegroundBFG::RemovePlayer(Player* /*player*/, uint64 /*guid*/, uint32 /*team*/) { }
220
222{
224 return;
225
226 switch (trigger)
227 {
228 case 6447: // Alliance start
229 case 6448: // Horde start
230 case 6265: // Waterworks heal
231 case 6266: // Mine speed
232 case 6267: // Waterworks speed
233 case 6268: // Mine berserk
234 case 6269: // Lighthouse berserk
235 break;
236 default:
237 Battleground::HandleAreaTrigger(player, trigger);
238 break;
239 }
240}
241
242void BattlegroundBFG::_CreateBanner(uint8 node, uint8 type, uint8 teamIndex, bool delay)
243{
244 // Just put it into the queue
245 if (delay)
246 {
247 m_BannerTimers[node].timer = 2000;
248 m_BannerTimers[node].type = type;
249 m_BannerTimers[node].teamIndex = teamIndex;
250 return;
251 }
252
253 uint8 obj = node * 8 + type + teamIndex;
254
256
257 // handle aura with banner
258 if (!type)
259 return;
260 obj = node * 8 + ((type == GILNEAS_BG_NODE_TYPE_OCCUPIED) ? (3 + teamIndex) : 7);
262}
263
264void BattlegroundBFG::_DelBanner(uint8 node, uint8 type, uint8 teamIndex)
265{
266 uint8 obj = node * 8 + type + teamIndex;
268
269 // handle aura with banner
270 if (!type)
271 return;
272 obj = node * 8 + ((type == GILNEAS_BG_NODE_TYPE_OCCUPIED) ? (3 + teamIndex) : 7);
274}
275
277{
278 switch (node)
279 {
283 default:
284 ASSERT(false);
285 }
286 return 0;
287}
288
290{
291 const uint8 plusArray[] = { 0, 2, 3, 0, 1 };
292
293 // Node icons
294 for (uint8 node = 0; node < GILNEAS_BG_DYNAMIC_NODES_COUNT; ++node)
295 builder.AppendState(GILNEAS_BG_OP_NODEICONS[node], (m_Nodes[node] == 0) ? 1 : 0);
296
297 // Node occupied states
298 for (uint8 node = 0; node < GILNEAS_BG_DYNAMIC_NODES_COUNT; ++node)
299 for (uint8 i = 1; i < GILNEAS_BG_DYNAMIC_NODES_COUNT; ++i)
300 builder.AppendState(GILNEAS_BG_OP_NODESTATES[node] + plusArray[i], (m_Nodes[node] == i) ? 1 : 0);
301
302 // How many bases each team owns
303 uint8 ally = 0, horde = 0;
304 for (uint8 node = 0; node < GILNEAS_BG_DYNAMIC_NODES_COUNT; ++node)
306 ++ally;
308 ++horde;
309
312
313 // Team scores
318
319 // other unknown
320 builder.AppendState(0x745, 0x2); // 37 1861 unk
321}
322
324{
325 // Send node owner state update to refresh map icons on client
326 const uint8 plusArray[] = { 0, 2, 3, 0, 1 };
327
328 if (m_prevNodes[node])
329 UpdateWorldState(GILNEAS_BG_OP_NODESTATES[node] + plusArray[m_prevNodes[node]], 0);
330 else
332
333 UpdateWorldState(GILNEAS_BG_OP_NODESTATES[node] + plusArray[m_Nodes[node]], 1);
334
335 // How many bases each team owns
336 uint8 ally = 0, horde = 0;
337 for (uint8 i = 0; i < GILNEAS_BG_DYNAMIC_NODES_COUNT; ++i)
339 ++ally;
341 ++horde;
342
345}
346
348{
350 SF_LOG_ERROR("bg.battleground", "Failed to spawn spirit guide! point: %u, team: %u, ", node, team);
351
352 if (node >= GILNEAS_BG_DYNAMIC_NODES_COUNT)//only dynamic nodes, no start points
353 return;
354
355 uint8 capturedNodes = 0;
356 for (uint8 i = 0; i < GILNEAS_BG_DYNAMIC_NODES_COUNT; ++i)
358 ++capturedNodes;
359
360 Creature* trigger = BgCreatures[node + 5] ? GetBGCreature(node + 5) : NULL; // 0-5 spirit guides
361 if (!trigger)
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{
377 return;
378
379 //remove bonus honor aura trigger creature when node is lost
380 if (node < GILNEAS_BG_DYNAMIC_NODES_COUNT)//only dynamic nodes, no start points
381 DelCreature(node + 5);//NULL checks are in DelCreature! 0-5 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 + 5]);
398 while ((node < GILNEAS_BG_DYNAMIC_NODES_COUNT) && ((!obj) || (!source->IsWithinDistInMap(obj, 10))))
399 {
400 ++node;
402 }
403
404 // this means our player isn't close to any of banners - maybe cheater ??
406 return;
407
408 TeamId teamIndex = GetTeamIndexByTeamId(source->GetTeam());
409
410 // Check if player really could use this banner, not cheated
411 if (!(m_Nodes[node] == 0 || teamIndex == m_Nodes[node] % 2))
412 return;
413
415 uint32 sound = 0;
416 // If node is neutral, change to contested
418 {
420 m_prevNodes[node] = m_Nodes[node];
421 m_Nodes[node] = teamIndex + 1;
422 // burn current neutral banner
424 // create new contested banner
425 _CreateBanner(node, GILNEAS_BG_NODE_TYPE_CONTESTED, teamIndex, true);
426 _SendNodeUpdate(node);
428
429 // FIXME: team and node names not localized
430 if (teamIndex == 0)
432 else
434
436 }
437 // If node is contested
439 {
440 // If last state is NOT occupied, change node to enemy-contested
443 m_prevNodes[node] = m_Nodes[node];
444 m_Nodes[node] = teamIndex + GILNEAS_BG_NODE_TYPE_CONTESTED;
445 // burn current contested banner
447 // create new contested banner
448 _CreateBanner(node, GILNEAS_BG_NODE_TYPE_CONTESTED, teamIndex, true);
449 _SendNodeUpdate(node);
451
452 // FIXME: node names not localized
453 if (teamIndex == TEAM_ALLIANCE)
455 else
457 }
458 // If contested, change back to occupied
459 else
460 {
462 m_prevNodes[node] = m_Nodes[node];
463 m_Nodes[node] = teamIndex + GILNEAS_BG_NODE_TYPE_OCCUPIED;
464 // burn current contested banner
466 // create new occupied banner
467 _CreateBanner(node, GILNEAS_BG_NODE_TYPE_OCCUPIED, teamIndex, true);
468 _SendNodeUpdate(node);
469 m_NodeTimers[node] = 0;
470 _NodeOccupied(node, (teamIndex == TEAM_ALLIANCE) ? ALLIANCE : HORDE);
471
472 // FIXME: node names not localized
473 if (teamIndex == TEAM_ALLIANCE)
475 else
477 }
479 }
480 // If node is occupied, change to enemy-contested
481 else
482 {
484 m_prevNodes[node] = m_Nodes[node];
485 m_Nodes[node] = teamIndex + GILNEAS_BG_NODE_TYPE_CONTESTED;
486 // burn current occupied banner
487 _DelBanner(node, GILNEAS_BG_NODE_TYPE_OCCUPIED, !teamIndex);
488 // create new contested banner
489 _CreateBanner(node, GILNEAS_BG_NODE_TYPE_CONTESTED, teamIndex, true);
490 _SendNodeUpdate(node);
491 _NodeDeOccupied(node);
493
494 // FIXME: node names not localized
495 if (teamIndex == TEAM_ALLIANCE)
497 else
499
501 }
502
503 // If node is occupied again, send "X has taken the Y" msg.
505 {
506 // FIXME: team and node names not localized
507 if (teamIndex == TEAM_ALLIANCE)
509 else
511 }
512 PlaySoundToAll(sound);
513}
514
516{
517 // How many bases each team owns
518 uint8 ally = 0, horde = 0;
519 for (uint8 i = 0; i < GILNEAS_BG_DYNAMIC_NODES_COUNT; ++i)
521 ++ally;
523 ++horde;
524
525 if (ally > horde)
526 return ALLIANCE;
527 else if (horde > ally)
528 return HORDE;
529
530 // If the values are equal, fall back to the original result (based on number of players on each team)
532}
533
535 for (int i = 0; i < GILNEAS_BG_DYNAMIC_NODES_COUNT; ++i)
536 {
545 {
546 SF_LOG_ERROR("sql.sql", "BatteGroundAB: Failed to spawn some object Battleground not created!");
547 return false;
548 }
549 }
550
553 {
554 SF_LOG_ERROR("sql.sql", "BatteGroundBGF: Failed to spawn door object Battleground not created!");
555 return false;
556 }
557
558 // Buffs
559 for (int i = 0; i < GILNEAS_BG_DYNAMIC_NODES_COUNT; ++i)
560 {
564 SF_LOG_ERROR("sql.sql", "BatteGroundBGF: Failed to spawn buff object!");
565 }
566
567 return true;
568}
569
571{
572 //call parent's class reset
574
584 bool isBGWeekend = sBattlegroundMgr->IsBGWeekend(GetTypeID());
589
590 for (uint8 i = 0; i < GILNEAS_BG_DYNAMIC_NODES_COUNT; ++i)
591 {
592 m_Nodes[i] = 0;
593 m_prevNodes[i] = 0;
594 m_NodeTimers[i] = 0;
595 m_BannerTimers[i].timer = 0;
596 }
597
598 for (uint8 i = 0; i < GILNEAS_BG_ALL_NODES_COUNT + 3; ++i)//+3 for aura triggers
599 if (BgCreatures[i])
600 DelCreature(i);
601}
602
604{
605 // Win reward
606 if (winner == ALLIANCE)
608 if (winner == HORDE)
610 // Complete map_end rewards (even if no team wins)
613
615}
616
618{
619 TeamId teamIndex = GetTeamIndexByTeamId(player->GetTeam());
620
621 // Is there any occupied node for this team?
622 std::vector<uint8> nodes;
623 for (uint8 i = 0; i < GILNEAS_BG_DYNAMIC_NODES_COUNT; ++i)
624 if (m_Nodes[i] == teamIndex + 3)
625 nodes.push_back(i);
626
627 WorldSafeLocsEntry const* good_entry = NULL;
628 // If so, select the closest node to place ghost on
629 if (!nodes.empty()) {
630 float plr_x = player->GetPositionX();
631 float plr_y = player->GetPositionY();
632
633 float mindist = 999999.0f;
634 for (uint8 i = 0; i < nodes.size(); ++i) {
635 WorldSafeLocsEntry const* entry = sWorldSafeLocsStore.LookupEntry(GILNEAS_BG_GraveyardIds[nodes[i]]);
636 if (!entry)
637 continue;
638 float dist = (entry->x - plr_x) * (entry->x - plr_x) + (entry->y - plr_y) * (entry->y - plr_y);
639 if (mindist > dist) {
640 mindist = dist;
641 good_entry = entry;
642 }
643 }
644 nodes.clear();
645 }
646 // If not, place ghost on starting location
647 if (!good_entry)
648 good_entry = sWorldSafeLocsStore.LookupEntry(GILNEAS_BG_GraveyardIds[teamIndex + 5]);
649
650 return good_entry;
651}
652
653/*WorldSafeLocsEntry const* BattlegroundBFG::GetExploitTeleportLocation(Team team)
654{
655 return sWorldSafeLocsStore.LookupEntry(team == ALLIANCE ? GILNEAS_EXPLOIT_TELEPORT_LOCATION_ALLIANCE : GILNEAS_EXPLOIT_TELEPORT_LOCATION_HORDE);
656}*/
657
658void BattlegroundBFG::UpdatePlayerScore(Player* Source, uint32 type, uint32 value, bool doAddHonor)
659{
660 BattlegroundScoreMap::iterator itr = PlayerScores.find(Source->GetGUID());
661 if (itr == PlayerScores.end()) // player not found...
662 return;
663
664 switch (type)
665 {
667 ((BattlegroundBFGScore*)itr->second)->BasesAssaulted += value;
669 break;
671 ((BattlegroundBFGScore*)itr->second)->BasesDefended += value;
673 break;
674 default:
675 Battleground::UpdatePlayerScore(Source, type, value, doAddHonor);
676 break;
677 }
678}
679
681{
682 uint32 count = 0;
683 for (int i = 0; i < GILNEAS_BG_DYNAMIC_NODES_COUNT; ++i)
686 ++count;
687
688 return count == GILNEAS_BG_DYNAMIC_NODES_COUNT;
689}
690
691bool BattlegroundBFG::CheckAchievementCriteriaMeet(uint32 criteriaId, Player const* player, Unit const* target, uint32 miscvalue)
692{
693 switch (criteriaId)
694 {
697 }
698
699 return Battleground::CheckAchievementCriteriaMeet(criteriaId, player, target, miscvalue);
700}
@ 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
@ BG_STARTING_EVENT_THIRD
@ BG_STARTING_EVENT_SECOND
@ BG_STARTING_EVENT_FIRST
@ BG_STARTING_EVENT_FOURTH
#define GILNEAS_BG_BGWeekendRepTicks
#define GILNEAS_BG_BGWeekendHonorTicks
@ GILNEAS_BG_SOUND_NODE_CAPTURED_HORDE
@ GILNEAS_BG_SOUND_NODE_ASSAULTED_ALLIANCE
@ GILNEAS_BG_SOUND_NODE_CLAIMED
@ GILNEAS_BG_SOUND_NODE_ASSAULTED_HORDE
@ GILNEAS_BG_SOUND_NODE_CAPTURED_ALLIANCE
@ GILNEAS_BG_SOUND_NEAR_VICTORY
const float GILNEAS_BG_BuffPositions[GILNEAS_BG_DYNAMIC_NODES_COUNT][4]
#define BG_EVENT_START_BATTLE
@ GILNEAS_BG_OBJECT_BANNER_NEUTRAL
@ GILNEAS_BG_OBJECT_AURA_CONTESTED
@ GILNEAS_BG_OBJECT_SPEEDBUFF_LIGHTHOUSE
@ GILNEAS_BG_OBJECT_BANNER_HORDE
@ GILNEAS_BG_OBJECT_BANNER_ALLY
@ GILNEAS_BG_OBJECT_GATE_A_1
@ GILNEAS_BG_OBJECT_AURA_HORDE
@ GILNEAS_BG_OBJECT_BANNER_CONT_H
@ GILNEAS_BG_OBJECT_BANNER_CONT_A
@ GILNEAS_BG_OBJECT_AURA_ALLY
@ GILNEAS_BG_OBJECT_GATE_H_1
@ GILNEAS_BG_OBJECT_MAX
const float GILNEAS_BG_DoorPositions[4][8]
const uint32 GILNEAS_BG_GraveyardIds[GILNEAS_BG_ALL_NODES_COUNT]
#define GILNEAS_BG_NotBGWeekendHonorTicks
const uint32 GILNEAS_BG_OP_NODESTATES[3]
@ GILNEAS_BG_OBJECTID_NODE_BANNER_0
const float GILNEAS_BG_NodePositions[GILNEAS_BG_DYNAMIC_NODES_COUNT][4]
const uint32 GILNEAS_BG_OP_NODEICONS[3]
const uint32 GILNEAS_BG_TickPoints[4]
@ BG_OBJECTIVE_ASSAULT_BASE
@ BG_OBJECTIVE_DEFEND_BASE
@ GILNEAS_BG_FLAG_CAPTURING_TIME
const float GILNEAS_BG_SpiritGuidePos[GILNEAS_BG_ALL_NODES_COUNT][4]
#define GILNEAS_BG_NotBGWeekendRepTicks
@ GILNEAS_BG_DYNAMIC_NODES_COUNT
@ GILNEAS_BG_SPIRIT_ALIANCE
@ GILNEAS_BG_NODE_MINE
@ GILNEAS_BG_NODE_WATERWORKS
@ GILNEAS_BG_NODE_LIGHTHOUSE
@ GILNEAS_BG_ALL_NODES_COUNT
@ GILNEAS_BG_SPIRIT_HORDE
@ GILNEAS_BG_OBJECTID_BANNER_CONT_H
@ GILNEAS_BG_OBJECTID_AURA_C
@ GILNEAS_BG_OBJECTID_GATE_H_1
@ GILNEAS_BG_OBJECTID_AURA_A
@ GILNEAS_BG_OBJECTID_AURA_H
@ GILNEAS_BG_OBJECTID_BANNER_A
@ GILNEAS_BG_OBJECTID_BANNER_H
@ GILNEAS_BG_OBJECTID_GATE_A_1
@ GILNEAS_BG_OBJECTID_BANNER_CONT_A
@ GILNEAS_BG_NODE_TYPE_NEUTRAL
@ GILNEAS_BG_NODE_STATUS_HORDE_CONTESTED
@ GILNEAS_BG_NODE_TYPE_CONTESTED
@ GILNEAS_BG_NODE_STATUS_HORDE_OCCUPIED
@ GILNEAS_BG_NODE_STATUS_ALLY_CONTESTED
@ GILNEAS_BG_NODE_TYPE_OCCUPIED
@ GILNEAS_BG_NODE_STATUS_ALLY_OCCUPIED
@ GILNEAS_BG_OP_RESOURCES_HORDE
@ GILNEAS_BG_OP_OCCUPIED_BASES_HORDE
@ GILNEAS_BG_OP_RESOURCES_ALLY
@ GILNEAS_BG_OP_RESOURCES_MAX
@ GILNEAS_BG_OP_RESOURCES_WARNING
@ GILNEAS_BG_OP_OCCUPIED_BASES_ALLY
const uint32 GILNEAS_BG_TickIntervals[4]
@ GILNEAS_BG_WARNING_NEAR_VICTORY_SCORE
@ GILNEAS_BG_MAX_TEAM_SCORE
#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_BFG_HORDE
Definition Language.h:1265
@ LANG_BG_BFG_START_HALF_MINUTE
Definition Language.h:1261
@ LANG_BG_BFG_NODE_WATERWORKS
Definition Language.h:1267
@ LANG_BG_BFG_NODE_DEFENDED
Definition Language.h:1270
@ LANG_BG_BFG_START_TWO_MINUTES
Definition Language.h:1259
@ LANG_BG_BFG_H_NEAR_VICTORY
Definition Language.h:1274
@ LANG_BG_BFG_START_ONE_MINUTE
Definition Language.h:1260
@ LANG_BG_BFG_ALLY
Definition Language.h:1264
@ LANG_BG_BFG_A_NEAR_VICTORY
Definition Language.h:1273
@ LANG_BG_BFG_NODE_CLAIMED
Definition Language.h:1272
@ LANG_BG_BFG_NODE_LIGHTHOUSE
Definition Language.h:1266
@ LANG_BG_BFG_HAS_BEGUN
Definition Language.h:1262
@ LANG_BG_BFG_NODE_ASSAULTED
Definition Language.h:1271
@ LANG_BG_BFG_NODE_TAKEN
Definition Language.h:1269
@ LANG_BG_BFG_NODE_MINE
Definition Language.h:1268
#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
void RemovePlayer(Player *player, uint64 guid, uint32 team) OVERRIDE
void StartingEventOpenDoors() OVERRIDE
bool IsAllNodesControlledByTeam(uint32 team) const OVERRIDE
bool SetupBattleground() OVERRIDE
bool m_TeamScores500Disadvantage[BG_TEAMS_COUNT]
void StartingEventCloseDoors() OVERRIDE
void _SendNodeUpdate(uint8 node)
uint32 m_NodeTimers[GILNEAS_BG_DYNAMIC_NODES_COUNT]
uint8 m_Nodes[GILNEAS_BG_DYNAMIC_NODES_COUNT]
uint32 m_ReputationScoreTics[BG_TEAMS_COUNT]
bool CheckAchievementCriteriaMeet(uint32, Player const *, Unit const *=NULL, uint32=0) OVERRIDE
void Reset() OVERRIDE
void _NodeDeOccupied(uint8 node)
void PostUpdateImpl(uint32 diff) OVERRIDE
Post-update hook.
WorldSafeLocsEntry const * GetClosestGraveYard(Player *player) OVERRIDE
void _CreateBanner(uint8 node, uint8 type, uint8 teamIndex, bool delay)
void EndBattleground(uint32 winner)
void _DelBanner(uint8 node, uint8 type, uint8 teamIndex)
void FillInitialWorldStates(WorldStateBuilder &builder) OVERRIDE
uint8 m_prevNodes[GILNEAS_BG_DYNAMIC_NODES_COUNT]
void AddPlayer(Player *player) OVERRIDE
void HandleAreaTrigger(Player *Source, uint32 Trigger) OVERRIDE
void UpdatePlayerScore(Player *Source, uint32 type, uint32 value, bool doAddHonor=true) OVERRIDE
void _NodeOccupied(uint8 node, Team team)
GILNEAS_BG_BannerTimer m_BannerTimers[GILNEAS_BG_DYNAMIC_NODES_COUNT]
int32 _GetNodeNameId(uint8 node)
uint32 m_HonorScoreTics[BG_TEAMS_COUNT]
uint32 GetPrematureWinner() OVERRIDE
void EventPlayerClickedOnFlag(Player *source, GameObject *target_obj) OVERRIDE
uint32 m_lastTick[BG_TEAMS_COUNT]
virtual void AddPlayer(Player *player)
BattlegroundTypeId GetTypeID(bool GetRandom=false) const
void EndBattleground(uint32 winner)
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 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 AppendState(uint32 worldstate, uint32 value)
float GetPositionX() const
Definition Object.h:328
float GetPositionY() const
Definition Object.h:329
float x
float y