Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
BattlegroundTP.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 "Battleground.h"
7#include "BattlegroundMgr.h"
8#include "BattlegroundTP.h"
9#include "Creature.h"
10#include "GameObject.h"
11#include "Language.h"
12#include "Object.h"
13#include "ObjectMgr.h"
14#include "Player.h"
15#include "World.h"
16#include "WorldPacket.h"
17
25
27{
28 {20, 40, 40}, // normal honor
29 {60, 40, 80} // holiday
30};
31
33{
34 {0, 35, 0}, // normal honor
35 {0, 45, 0} // holiday
36};
37
52
53
57
58
60{
62 {
64 {
66 {
67 if (GetTeamScore(TEAM_HORDE) == 0) // No one scored - result is tie
69 else // Horde has more points and thus wins
71 }
72 else if (GetTeamScore(TEAM_HORDE) == 0)
73 EndBattleground(ALLIANCE); // Alliance has > 0, Horde has 0, alliance wins
74 else if (GetTeamScore(TEAM_HORDE) == GetTeamScore(TEAM_ALLIANCE)) // Team score equal, winner is team that scored the last flag
76 else if (GetTeamScore(TEAM_HORDE) > GetTeamScore(TEAM_ALLIANCE)) // Last but not least, check who has the higher score
78 else
80 }
81 // first update needed after 1 minute of game already in progress
83 {
86 }
87
88
90 {
92
93
95 {
97 RespawnFlag(ALLIANCE, true);
98 }
99 }
100
101
103 {
105
106
108 {
111 _bothFlagsKept = false;
112 }
113 }
114
115
117 {
118 _flagsTimer[TEAM_HORDE] -= diff;
119
120
121 if (_flagsTimer[TEAM_HORDE] < 0)
122 {
124 RespawnFlag(HORDE, true);
125 }
126 }
127
128
130 {
132
133
135 {
138 _bothFlagsKept = false;
139 }
140 }
141
142
143 if (_bothFlagsKept)
144 {
145 _flagSpellForceTimer += diff;
146 if (_flagDebuffState == 0 && _flagSpellForceTimer >= 10 * MINUTE * IN_MILLISECONDS) //10 minutes
147 {
149 player->CastSpell(player, TP_SPELL_FOCUSED_ASSAULT, true);
151 player->CastSpell(player, TP_SPELL_FOCUSED_ASSAULT, true);
153 }
154 else if (_flagDebuffState == 1 && _flagSpellForceTimer >= 900000) // 15 minutes
155 {
157 {
158 player->RemoveAurasDueToSpell(TP_SPELL_FOCUSED_ASSAULT);
159 player->CastSpell(player, TP_SPELL_BRUTAL_ASSAULT, true);
160 }
162 {
163 player->RemoveAurasDueToSpell(TP_SPELL_FOCUSED_ASSAULT);
164 player->CastSpell(player, TP_SPELL_BRUTAL_ASSAULT, true);
165 }
167 }
168 }
169 else
170 {
172 {
173 player->RemoveAurasDueToSpell(TP_SPELL_FOCUSED_ASSAULT);
174 player->RemoveAurasDueToSpell(TP_SPELL_BRUTAL_ASSAULT);
175 }
177 {
178 player->RemoveAurasDueToSpell(TP_SPELL_FOCUSED_ASSAULT);
179 player->RemoveAurasDueToSpell(TP_SPELL_BRUTAL_ASSAULT);
180 }
181
182
183 _flagSpellForceTimer = 0; //reset timer.
185 }
186 }
187}
188
189
204
205
207{
216
217
220
221
222 // players joining later are not eligible
223 //StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, TP_EVENT_START_BATTLE);
224}
225
226
228{
230 //create score and add it to map, default values are set in constructor
232
233
234 PlayerScores[player->GetGUID()] = sc;
235}
236
237
239{
240 if (Team == ALLIANCE)
241 {
242 SF_LOG_DEBUG("bg.battleground", "Respawn Alliance flag");
244 }
245 else
246 {
247 SF_LOG_DEBUG("bg.battleground", "Respawn Horde flag");
249 }
250
251
252 if (captured)
253 {
254 //when map_update will be allowed for battlegrounds this code will be useless
258 PlaySoundToAll(BG_TP_SOUND_FLAGS_RESPAWNED); // flag respawned sound...
259 }
260 _bothFlagsKept = false;
261}
262
263
265{
267 return;
268
269
270 RespawnFlag(team, false);
271 if (team == ALLIANCE)
272 {
275 }
276 else
277 {
280 }
281
282
284
285
286 if (GameObject* obj = GetBgMap()->GetGameObject(GetDroppedFlagGUID(team)))
287 obj->Delete();
288 else
289 SF_LOG_ERROR("bg.battleground", "unknown droped flag bg, guid: %u", GUID_LOPART(GetDroppedFlagGUID(team)));
290
291
293 _bothFlagsKept = false;
294}
295
296
298{
300 return;
301
302
303 uint32 winner = 0;
304
305
307 if (Source->GetTeam() == ALLIANCE)
308 {
309 if (!IsHordeFlagPickedup())
310 return;
311 SetHordeFlagPicker(0); // must be before aura remove to prevent 2 events (drop+capture) at the same time
312 // horde flag in base (but not respawned yet)
314 // Drop Horde Flag from Player
316 if (_flagDebuffState == 1)
318 if (_flagDebuffState == 2)
321 AddPoint(ALLIANCE, 1);
324 }
325 else
326 {
328 return;
329 SetAllianceFlagPicker(0); // must be before aura remove to prevent 2 events (drop+capture) at the same time
330 // alliance flag in base (but not respawned yet)
332 // Drop Alliance Flag from Player
334 if (_flagDebuffState == 1)
336 if (_flagDebuffState == 2)
339 AddPoint(HORDE, 1);
342 }
343 //for flag capture is reward 2 honorable kills
345
346
349
350
351 if (Source->GetTeam() == ALLIANCE)
353 else
355
356
357 UpdateFlagState(Source->GetTeam(), 1); // flag state none
358 UpdateTeamScore(Source->GetTeamId());
359 // only flag capture should be updated
360 UpdatePlayerScore(Source, SCORE_FLAG_CAPTURES, 1); // +1 flag captures
361
362
363 // update last flag capture to be used if teamscore is equal
364 SetLastFlagCapture(Source->GetTeam());
365
366
368 winner = ALLIANCE;
369
370
372 winner = HORDE;
373
374
375 if (winner)
376 {
382
383
385 EndBattleground(winner);
386 }
387 else
388 {
390 }
391}
392
393
395{
397 {
398 // if not running, do not cast things at the dropper player (prevent spawning the "dropped" flag), neither send unnecessary messages
399 // just take off the aura
400 if (Source->GetTeam() == ALLIANCE)
401 {
402 if (!IsHordeFlagPickedup())
403 return;
404 if (GetFlagPickerGUID(TEAM_HORDE) == Source->GetGUID())
405 {
408 }
409 }
410 else
411 {
413 return;
414 if (GetFlagPickerGUID(TEAM_ALLIANCE) == Source->GetGUID())
415 {
418 }
419 }
420 return;
421 }
422
423
424 bool set = false;
425
426
427 if (Source->GetTeam() == ALLIANCE)
428 {
429 if (!IsHordeFlagPickedup())
430 return;
431 if (GetFlagPickerGUID(TEAM_HORDE) == Source->GetGUID())
432 {
435 if (_flagDebuffState == 1)
437 if (_flagDebuffState == 2)
440 Source->CastSpell(Source, BG_TP_SPELL_HORDE_FLAG_DROPPED, true);
441 set = true;
442 }
443 }
444 else
445 {
447 return;
448 if (GetFlagPickerGUID(TEAM_ALLIANCE) == Source->GetGUID())
449 {
452 if (_flagDebuffState == 1)
454 if (_flagDebuffState == 2)
457 Source->CastSpell(Source, BG_TP_SPELL_ALLIANCE_FLAG_DROPPED, true);
458 set = true;
459 }
460 }
461
462
463 if (set)
464 {
465 Source->CastSpell(Source, SPELL_RECENTLY_DROPPED_FLAG, true);
466 UpdateFlagState(Source->GetTeam(), 1);
467
468
469 if (Source->GetTeam() == ALLIANCE)
470 {
473 }
474 else
475 {
478 }
479
480
482 }
483}
484
485
487{
489 return;
490
491
492 int32 message_id = 0;
494
495
496 //alliance flag picked up from base
498 && BgObjects[BG_TP_OBJECT_A_FLAG] == target_obj->GetGUID())
499 {
500 message_id = LANG_BG_TP_PICKEDUP_AF;
506 //update world state to show correct flag carrier
509 Source->CastSpell(Source, BG_TP_SPELL_ALLIANCE_FLAG, true);
512 _bothFlagsKept = true;
513 }
514
515
516 //horde flag picked up from base
518 && BgObjects[BG_TP_OBJECT_H_FLAG] == target_obj->GetGUID())
519 {
520 message_id = LANG_BG_TP_PICKEDUP_HF;
524 SetHordeFlagPicker(Source->GetGUID());
526 //update world state to show correct flag carrier
529 Source->CastSpell(Source, BG_TP_SPELL_HORDE_FLAG, true);
532 _bothFlagsKept = true;
533 }
534
535
536 //Alliance flag on ground(not in base) (returned or picked up again from ground!)
537 if (GetFlagState(ALLIANCE) == BG_TP_FLAG_STATE_ON_GROUND && Source->IsWithinDistInMap(target_obj, 10)
539 {
540 if (Source->GetTeam() == ALLIANCE)
541 {
542 message_id = LANG_BG_TP_RETURNED_AF;
545 RespawnFlag(ALLIANCE, false);
549 _bothFlagsKept = false;
550 }
551 else
552 {
553 message_id = LANG_BG_TP_PICKEDUP_AF;
558 Source->CastSpell(Source, BG_TP_SPELL_ALLIANCE_FLAG, true);
561 if (_flagDebuffState == 1)
562 Source->CastSpell(Source, TP_SPELL_FOCUSED_ASSAULT, true);
563 if (_flagDebuffState == 2)
564 Source->CastSpell(Source, TP_SPELL_BRUTAL_ASSAULT, true);
566 }
567 //called in HandleGameObjectUseOpcode:
568 //target_obj->Delete();
569 }
570
571
572 //Horde flag on ground(not in base) (returned or picked up again)
573 if (GetFlagState(HORDE) == BG_TP_FLAG_STATE_ON_GROUND && Source->IsWithinDistInMap(target_obj, 10)
575 {
576 if (Source->GetTeam() == HORDE)
577 {
578 message_id = LANG_BG_TP_RETURNED_HF;
581 RespawnFlag(HORDE, false);
585 _bothFlagsKept = false;
586 }
587 else
588 {
589 message_id = LANG_BG_TP_PICKEDUP_HF;
593 SetHordeFlagPicker(Source->GetGUID());
594 Source->CastSpell(Source, BG_TP_SPELL_HORDE_FLAG, true);
597 if (_flagDebuffState == 1)
598 Source->CastSpell(Source, TP_SPELL_FOCUSED_ASSAULT, true);
599 if (_flagDebuffState == 2)
600 Source->CastSpell(Source, TP_SPELL_BRUTAL_ASSAULT, true);
602 }
603 //called in HandleGameObjectUseOpcode:
604 //target_obj->Delete();
605 }
606
607
608 if (!message_id)
609 return;
610
611
612 SendMessageToAll(message_id, type, Source);
614}
615
616
618{
619 // sometimes flag aura not removed :(
621 {
622 if (!player)
623 {
624 SF_LOG_ERROR("bg.battleground", "BattlegroundTP: Removing offline player who has the FLAG!!");
626 RespawnFlag(ALLIANCE, false);
627 }
628 else
630 }
632 {
633 if (!player)
634 {
635 SF_LOG_ERROR("bg.battleground", "BattlegroundTP: Removing offline player who has the FLAG!!");
637 RespawnFlag(HORDE, false);
638 }
639 else
641 }
642}
643
644
652
653
661
662
664{
666 return;
667
668
669 //uint32 SpellId = 0;
670 //uint64 buff_guid = 0;
671 switch (trigger)
672 {
673 case 5904: // Alliance Flag spawn
675 if (GetFlagPickerGUID(TEAM_HORDE) == player->GetGUID())
677 break;
678 case 5905: // Horde Flag spawn
680 if (GetFlagPickerGUID(TEAM_ALLIANCE) == player->GetGUID())
682 break;
683 case 5908: // Horde Tower
684 case 5909: // Twin Peak House big
685 case 5910: // Horde House
686 case 5911: // Twin Peak House small
687 case 5914: // Alliance Start right
688 case 5916: // Alliance Start
689 case 5917: // Alliance Start left
690 case 5918: // Horde Start
691 case 5920: // Horde Start Front entrance
692 case 5921: // Horde Start left Water channel
693 break;
694 default:
695 Battleground::HandleAreaTrigger(player, trigger);
696 break;
697 }
698
699
700 //if (buff_guid)
701 // HandleTriggerBuff(buff_guid, Source);
702}
703
704
706{
707 // flags X Y Z Orientation Rotation2 Rotation3
708 if (!AddObject(BG_TP_OBJECT_A_FLAG, BG_OBJECT_A_FLAG_TP_ENTRY, 2118.210f, 191.621f, 44.052f, 5.741259f, 0, 0, 0.9996573f, 0.02617699f, BG_TP_FLAG_RESPAWN_TIME / 1000)
709 || !AddObject(BG_TP_OBJECT_H_FLAG, BG_OBJECT_H_FLAG_TP_ENTRY, 1578.380f, 344.037f, 2.419f, 3.055978f, 0, 0, 0.008726535f, 0.9999619f, BG_TP_FLAG_RESPAWN_TIME / 1000)
710 // buffs
711 || !AddObject(BG_TP_OBJECT_SPEEDBUFF_1, BG_OBJECTID_SPEEDBUFF_ENTRY, 1545.402f, 304.028f, 0.5923f, -1.64061f, 0, 0, 0.7313537f, -0.6819983f, BUFF_RESPAWN_TIME)
712 || !AddObject(BG_TP_OBJECT_SPEEDBUFF_2, BG_OBJECTID_SPEEDBUFF_ENTRY, 2171.279f, 222.334f, 43.8001f, 2.663309f, 0, 0, 0.7313537f, 0.6819984f, BUFF_RESPAWN_TIME)
713 || !AddObject(BG_TP_OBJECT_REGENBUFF_1, BG_OBJECTID_REGENBUFF_ENTRY, 1753.957f, 242.092f, -14.1170f, 1.105848f, 0, 0, 0.1305263f, -0.9914448f, BUFF_RESPAWN_TIME)
714 || !AddObject(BG_TP_OBJECT_REGENBUFF_2, BG_OBJECTID_REGENBUFF_ENTRY, 1952.121f, 383.857f, -10.2870f, 4.192612f, 0, 0, 0.333807f, -0.9426414f, BUFF_RESPAWN_TIME)
715 || !AddObject(BG_TP_OBJECT_BERSERKBUFF_1, BG_OBJECTID_BERSERKERBUFF_ENTRY, 1934.369f, 226.064f, -17.0441f, 2.499154f, 0, 0, 0.5591929f, 0.8290376f, BUFF_RESPAWN_TIME)
716 || !AddObject(BG_TP_OBJECT_BERSERKBUFF_2, BG_OBJECTID_BERSERKERBUFF_ENTRY, 1725.240f, 446.431f, -7.8327f, 5.709677f, 0, 0, 0.9396926f, -0.3420201f, BUFF_RESPAWN_TIME)
717 // alliance gates
718 || !AddObject(BG_TP_OBJECT_DOOR_A_1, BG_OBJECT_DOOR_A_1_TP_ENTRY, 2115.399f, 150.175f, 43.526f, 2.544690f, 0, 0, 0, 0, RESPAWN_IMMEDIATELY)
719 || !AddObject(BG_TP_OBJECT_DOOR_A_2, BG_OBJECT_DOOR_A_2_TP_ENTRY, 2156.803f, 220.331f, 43.482f, 2.544690f, 0, 0, 0, 0, RESPAWN_IMMEDIATELY)
720 || !AddObject(BG_TP_OBJECT_DOOR_A_3, BG_OBJECT_DOOR_A_3_TP_ENTRY, 2127.512f, 223.711f, 43.640f, 2.544690f, 0, 0, 0, 0, RESPAWN_IMMEDIATELY)
721 || !AddObject(BG_TP_OBJECT_DOOR_A_4, BG_OBJECT_DOOR_A_4_TP_ENTRY, 2096.102f, 166.920f, 54.230f, 2.544690f, 0, 0, 0, 0, RESPAWN_IMMEDIATELY)
722 // horde gates
723 || !AddObject(BG_TP_OBJECT_DOOR_H_1, BG_OBJECT_DOOR_H_1_TP_ENTRY, 1556.595f, 314.502f, 1.2230f, 6.179126f, 0, 0, 0, 0, RESPAWN_IMMEDIATELY)
724 || !AddObject(BG_TP_OBJECT_DOOR_H_2, BG_OBJECT_DOOR_H_2_TP_ENTRY, 1587.093f, 319.853f, 1.5233f, 6.179126f, 0, 0, 0, 0, RESPAWN_IMMEDIATELY)
725 || !AddObject(BG_TP_OBJECT_DOOR_H_3, BG_OBJECT_DOOR_H_3_TP_ENTRY, 1591.463f, 365.732f, 13.494f, 6.179126f, 0, 0, 0, 0, RESPAWN_IMMEDIATELY)
726 || !AddObject(BG_TP_OBJECT_DOOR_H_4, BG_OBJECT_DOOR_H_4_TP_ENTRY, 1558.315f, 372.709f, 1.4840f, 6.179126f, 0, 0, 0, 0, RESPAWN_IMMEDIATELY)
727 )
728 {
729 SF_LOG_ERROR("sql.sql", "BatteGroundTP: Failed to spawn some objects Battleground not created!");
730 return false;
731 }
732
733
735 if (!sg || !AddSpiritGuide(TP_SPIRIT_ALLIANCE, sg->x, sg->y, sg->z, 3.641396f, ALLIANCE))
736 {
737 SF_LOG_ERROR("sql.sql", "BatteGroundTP: Failed to spawn Alliance spirit guides! Battleground not created!");
738 return false;
739 }
740
741
743 if (!sg || !AddSpiritGuide(TP_SPIRIT_ALLIANCE, sg->x, sg->y, sg->z, 3.641396f, ALLIANCE))
744 {
745 SF_LOG_ERROR("sql.sql", "BatteGroundTP: Failed to spawn Alliance start spirit guides! Battleground not created!");
746 return false;
747 }
748
749
751 if (!sg || !AddSpiritGuide(TP_SPIRIT_HORDE, sg->x, sg->y, sg->z, 3.641396f, HORDE))
752 {
753 SF_LOG_ERROR("sql.sql", "BatteGroundTP: Failed to spawn Horde spirit guides! Battleground not created!");
754 return false;
755 }
757 if (!sg || !AddSpiritGuide(TP_SPIRIT_ALLIANCE, sg->x, sg->y, sg->z, 3.641396f, HORDE))
758 {
759 SF_LOG_ERROR("sql.sql", "BatteGroundTP: Failed to spawn Horde start spirit guide! Battleground not created!");
760 return false;
761 }
762
763
764 SF_LOG_DEBUG("bg.battleground", "BatteGroundTP: BG objects and spirit guides spawned");
765
766
767 return true;
768}
769
770
809
810
825
826
828{
830 return;
831
832
834
835
836 Battleground::HandleKillPlayer(player, killer);
837}
838
839
840void BattlegroundTP::UpdatePlayerScore(Player* Source, uint32 type, uint32 value, bool doAddHonor)
841{
842 BattlegroundScoreMap::iterator itr = PlayerScores.find(Source->GetGUID());
843 if (itr == PlayerScores.end()) // player not found
844 return;
845
846
847 switch (type)
848 {
849 case SCORE_FLAG_CAPTURES: // flags captured
850 ((BattlegroundTPScore*)itr->second)->FlagCaptures += value;
852 break;
853 case SCORE_FLAG_RETURNS: // flags returned
854 ((BattlegroundTPScore*)itr->second)->FlagReturns += value;
856 break;
857 default:
858 Battleground::UpdatePlayerScore(Source, type, value, doAddHonor);
859 break;
860 }
861}
862
863
865{
866 // if status in progress, it returns main or start graveyards with spiritguides
867 // else it will return the graveyard in the flagroom - this is especially good
868 // if a player dies in preparation phase - then the player can't cheat
869 // and teleport to the graveyard outside the flagroom
870 // and start running around, while the doors are still closed
871 if (player->GetTeam() == ALLIANCE)
872 {
875 else
877 }
878 else
879 {
882 else
884 }
885}
886
887
889{
892
893
898 else
900
901
906 else
908
909
911
912
914 {
917 }
918 else
920
921
924 else
926
927
930 else
932}
933
934
@ WINNER_NONE
@ RESPAWN_IMMEDIATELY
@ BUFF_RESPAWN_TIME
@ RESPAWN_ONE_DAY
@ BG_OBJECTID_REGENBUFF_ENTRY
@ BG_OBJECTID_BERSERKERBUFF_ENTRY
@ BG_OBJECTID_SPEEDBUFF_ENTRY
@ BG_HONOR_MODE_NUM
@ SPELL_RECENTLY_DROPPED_FLAG
@ SCORE_FLAG_CAPTURES
@ SCORE_FLAG_RETURNS
@ STATUS_IN_PROGRESS
@ BG_STARTING_EVENT_THIRD
@ BG_STARTING_EVENT_SECOND
@ BG_STARTING_EVENT_FIRST
@ BG_STARTING_EVENT_FOURTH
#define sBattlegroundMgr
uint32 BG_TP_Honor[BG_HONOR_MODE_NUM][BG_TP_REWARD_NUM]
BG_TP_Rewards
@ BG_TP_FLAG_CAP
@ BG_TP_REWARD_NUM
@ BG_TP_WIN
@ BG_TP_MAP_COMPLETE
uint32 BG_TP_Reputation[BG_HONOR_MODE_NUM][BG_TP_REWARD_NUM]
@ BG_TP_FLAG_RESPAWN_TIME
@ BG_TP_FLAG_DROP_TIME
@ BG_TP_MAX_TEAM_SCORE
@ TP_SPELL_FOCUSED_ASSAULT
@ TP_SPELL_BRUTAL_ASSAULT
@ BG_TP_SOUND_ALLIANCE_FLAG_PICKED_UP
@ BG_TP_SOUND_FLAG_CAPTURED_HORDE
@ BG_TP_SOUND_HORDE_FLAG_PICKED_UP
@ BG_TP_SOUND_FLAG_CAPTURED_ALLIANCE
@ BG_TP_SOUND_FLAGS_RESPAWNED
@ BG_TP_SOUND_FLAG_RETURNED
@ TP_OBJECTIVE_RETURN_FLAG
@ TP_OBJECTIVE_CAPTURE_FLAG
@ BG_TP_STATE_TIMER_ACTIVE
@ BG_TP_FLAG_CAPTURES_MAX
@ BG_TP_FLAG_UNK_HORDE
@ BG_TP_FLAG_STATE_HORDE
@ BG_TP_FLAG_STATE_ALLIANCE
@ BG_TP_FLAG_CAPTURES_HORDE
@ BG_TP_STATE_TIMER
@ BG_TP_FLAG_CAPTURES_ALLIANCE
@ BG_TP_FLAG_UNK_ALLIANCE
@ BG_OBJECT_DOOR_H_4_TP_ENTRY
@ BG_OBJECT_DOOR_A_3_TP_ENTRY
@ BG_OBJECT_DOOR_H_2_TP_ENTRY
@ BG_OBJECT_H_FLAG_GROUND_TP_ENTRY
@ BG_OBJECT_DOOR_H_1_TP_ENTRY
@ BG_OBJECT_DOOR_A_1_TP_ENTRY
@ BG_OBJECT_DOOR_A_2_TP_ENTRY
@ BG_OBJECT_H_FLAG_TP_ENTRY
@ BG_OBJECT_A_FLAG_GROUND_TP_ENTRY
@ BG_OBJECT_DOOR_H_3_TP_ENTRY
@ BG_OBJECT_DOOR_A_4_TP_ENTRY
@ BG_OBJECT_A_FLAG_TP_ENTRY
@ TP_SPIRIT_HORDE
@ TP_SPIRIT_ALLIANCE
@ BG_CREATURES_MAX_TP
@ BG_TP_SPELL_ALLIANCE_FLAG
@ BG_TP_SPELL_HORDE_FLAG_DROPPED
@ BG_TP_SPELL_HORDE_FLAG
@ BG_TP_SPELL_ALLIANCE_FLAG_PICKED
@ BG_TP_SPELL_HORDE_FLAG_PICKED
@ BG_TP_SPELL_ALLIANCE_FLAG_DROPPED
@ BG_TP_FLAG_STATE_ON_GROUND
@ BG_TP_FLAG_STATE_WAIT_RESPAWN
@ BG_TP_FLAG_STATE_ON_PLAYER
@ BG_TP_FLAG_STATE_ON_BASE
@ BG_TP_OBJECT_DOOR_A_2
@ BG_TP_OBJECT_SPEEDBUFF_2
@ BG_TP_OBJECT_A_FLAG
@ BG_TP_OBJECT_DOOR_A_1
@ BG_TP_OBJECT_DOOR_H_4
@ BG_TP_OBJECT_DOOR_H_1
@ BG_TP_OBJECT_SPEEDBUFF_1
@ BG_TP_OBJECT_DOOR_H_2
@ BG_TP_OBJECT_DOOR_H_3
@ BG_TP_OBJECT_REGENBUFF_1
@ BG_TP_OBJECT_DOOR_A_4
@ BG_TP_OBJECT_MAX
@ BG_TP_OBJECT_DOOR_A_3
@ BG_TP_OBJECT_BERSERKBUFF_1
@ BG_TP_OBJECT_H_FLAG
@ BG_TP_OBJECT_BERSERKBUFF_2
@ BG_TP_OBJECT_REGENBUFF_2
@ TP_GRAVEYARD_MIDDLE_ALLIANCE
@ TP_GRAVEYARD_START_ALLIANCE
@ TP_GRAVEYARD_START_HORDE
@ TP_GRAVEYARD_FLAGROOM_ALLIANCE
@ TP_GRAVEYARD_MIDDLE_HORDE
@ TP_GRAVEYARD_FLAGROOM_HORDE
@ IN_MILLISECONDS
Definition Common.h:125
@ MINUTE
Definition Common.h:119
@ ACHIEVEMENT_TIMED_TYPE_SPELL_TARGET
Definition DBCEnums.h:161
@ ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE
Definition DBCEnums.h:195
DBCStorage< WorldSafeLocsEntry > sWorldSafeLocsStore(WorldSafeLocsEntryfmt)
std::int32_t int32
Definition Define.h:73
std::uint32_t uint32
Definition Define.h:77
std::uint64_t uint64
Definition Define.h:76
@ LANG_BG_TP_PICKEDUP_AF
Definition Language.h:1251
@ LANG_BG_TP_HORDE_FLAG_RESPAWNED
Definition Language.h:1254
@ LANG_BG_TP_DROPPED_AF
Definition Language.h:1247
@ LANG_BG_TP_START_ONE_MINUTE
Definition Language.h:1241
@ LANG_BG_TP_START_HALF_MINUTE
Definition Language.h:1242
@ LANG_BG_TP_F_PLACED
Definition Language.h:1252
@ LANG_BG_TP_START_TWO_MINUTES
Definition Language.h:1240
@ LANG_BG_TP_CAPTURED_HF
Definition Language.h:1244
@ LANG_BG_TP_HAS_BEGUN
Definition Language.h:1243
@ LANG_BG_TP_ALLIANCE_FLAG_RESPAWNED
Definition Language.h:1253
@ LANG_BG_TP_CAPTURED_AF
Definition Language.h:1245
@ LANG_BG_TP_RETURNED_AF
Definition Language.h:1248
@ LANG_BG_TP_PICKEDUP_HF
Definition Language.h:1250
@ LANG_BG_TP_RETURNED_HF
Definition Language.h:1249
@ LANG_BG_TP_DROPPED_HF
Definition Language.h:1246
#define SF_LOG_DEBUG(filterType__,...)
Definition Log.h:134
#define SF_LOG_ERROR(filterType__,...)
Definition Log.h:143
uint32 GUID_LOPART(uint64 x)
ChatMsg
@ CHAT_MSG_BG_SYSTEM_ALLIANCE
@ CHAT_MSG_BG_SYSTEM_NEUTRAL
@ CHAT_MSG_BG_SYSTEM_HORDE
@ TEAM_ALLIANCE
@ TEAM_HORDE
@ ALLIANCE
@ HORDE
@ AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT
Definition Unit.h:64
virtual void AddPlayer(Player *player)
BattlegroundTypeId GetTypeID(bool GetRandom=false) const
void EndBattleground(uint32 winner)
BGHonorMode m_HonorMode
virtual void HandleKillPlayer(Player *player, Player *killer)
static TeamId GetTeamIndexByTeamId(uint32 Team)
void DoorOpen(uint32 type)
void SpawnBGObject(uint32 type, uint32 respawntime)
virtual void Reset()
void PlaySoundToAll(uint32 SoundID)
BattlegroundMap * GetBgMap() const
void DoorClose(uint32 type)
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 void HandleAreaTrigger(Player *, uint32)
BGCreatures BgCreatures
uint32 GetTeamScore(uint32 TeamID) const
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)
uint32 GetElapsedTime() const
void SendMessageToAll(int32 entry, ChatMsg type, Player const *source=NULL)
int32 m_TeamScores[BG_TEAMS_COUNT]
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]
void AddPlayer(Player *player) OVERRIDE
uint32 m_ReputationCapture
void SetDroppedFlagGUID(uint64 guid, int32 team=-1) OVERRIDE
void RespawnFlagAfterDrop(uint32 Team)
uint64 GetFlagPickerGUID(int32 team) const OVERRIDE
void FillInitialWorldStates(WorldStateBuilder &builder) OVERRIDE
void SetLastFlagCapture(uint32 team)
void EventPlayerDroppedFlag(Player *Source) OVERRIDE
void SetHordeFlagPicker(uint64 guid)
void HandleKillPlayer(Player *player, Player *killer) OVERRIDE
uint64 m_FlagKeepers[2]
void RemovePlayer(Player *player, uint64 guid, uint32 team) OVERRIDE
void PostUpdateImpl(uint32 diff) OVERRIDE
Post-update hook.
bool IsAllianceFlagPickedup() const
uint32 _lastFlagCaptureTeam
void Reset() OVERRIDE
void AddPoint(uint32 TeamID, uint32 Points=1)
void UpdatePlayerScore(Player *Source, uint32 type, uint32 value, bool doAddHonor=true) OVERRIDE
void StartingEventCloseDoors() OVERRIDE
uint8 GetFlagState(uint32 team) const
int32 _flagsDropTimer[2]
void RespawnFlag(uint32 Team, bool captured)
uint32 GetPrematureWinner() OVERRIDE
void EndBattleground(uint32 winner)
bool SetupBattleground() OVERRIDE
void SetAllianceFlagPicker(uint64 guid)
void StartingEventOpenDoors() OVERRIDE
bool IsHordeFlagPickedup() const
uint64 m_DroppedFlagGUID[2]
void UpdateTeamScore(uint32 team)
void EventPlayerCapturedFlag(Player *Source)
void UpdateFlagState(uint32 team, uint32 value)
WorldSafeLocsEntry const * GetClosestGraveYard(Player *player) OVERRIDE
void EventPlayerClickedOnFlag(Player *Source, GameObject *target_obj) OVERRIDE
void HandleAreaTrigger(Player *Source, uint32 Trigger) OVERRIDE
uint64 GetDroppedFlagGUID(uint32 TeamID) const
GameObjectTemplate const * GetGOInfo() const
Definition GameObject.h:643
static Player * FindPlayer(uint64)
uint64 GetGUID() const
Definition Object.h:119
uint32 GetTeam() const
Definition Player.h:2527
void StartTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry, uint32 timeLost=0)
Definition Player.cpp:21018
TeamId GetTeamId() const
Definition Player.h:2531
void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint64 miscValue1=0, uint64 miscValue2=0, uint64 miscValue3=0, Unit *unit=NULL)
Definition Player.cpp:21033
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)
void RemoveAurasDueToSpell(uint32 spellId, uint64 casterGUID=0, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true) const
Definition Object.cpp:1735
void AppendState(uint32 worldstate, uint32 value)
float x
float z
float y