OregonCore  revision fb2a440-git
Your Favourite TBC server
BattlegroundWS.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of the OregonCore 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 "Object.h"
19 #include "Player.h"
20 #include "Battleground.h"
21 #include "BattlegroundWS.h"
22 #include "GameObject.h"
23 #include "MapManager.h"
24 #include "Language.h"
25 
26 // these variables aren't used outside of this file, so declare them only here
28 {
33 };
34 
36 {
37  {20, 40, 40}, // normal honor
38  {60, 40, 80} // holiday
39 };
40 
42 {
43  {0, 35, 0}, // normal honor
44  {0, 45, 0} // holiday
45 };
46 
48 {
49  m_BothFlagsKept = false;
52 
57 }
58 
60 {
61 }
62 
64 {
66 
68  {
69  if (GetStartTime() >= 25 * MINUTE * IN_MILLISECONDS)
70  {
71  if (GetTeamScore(ALLIANCE) == 0)
72  {
73  if (GetTeamScore(HORDE) == 0) // No one scored - result is tie
75  else // Horde has more points and thus wins
77  }
78  else if (GetTeamScore(HORDE) == 0)
79  EndBattleground(ALLIANCE); // Alliance has > 0, Horde has 0, alliance wins
80  else if (GetTeamScore(HORDE) == GetTeamScore(ALLIANCE)) // Team score equal, winner is team that scored the first flag
82  else if (GetTeamScore(HORDE) > GetTeamScore(ALLIANCE)) // Last but not least, check who has the higher score
84  else
86  }
87  else if (GetStartTime() > m_minutesElapsed * MINUTE * IN_MILLISECONDS)
88  {
91  }
92 
94  {
96 
98  {
100  RespawnFlag(ALLIANCE, true);
101  }
102  }
104  {
106 
108  {
111  m_BothFlagsKept = false;
112  }
113  }
115  {
116  m_FlagsTimer[BG_TEAM_HORDE] -= diff;
117 
118  if (m_FlagsTimer[BG_TEAM_HORDE] < 0)
119  {
121  RespawnFlag(HORDE, true);
122  }
123  }
125  {
127 
129  {
132  m_BothFlagsKept = false;
133  }
134  }
135  if (m_BothFlagsKept)
136  {
137  m_FlagSpellForceTimer += diff;
138  if (m_FlagDebuffState == 0 && m_FlagSpellForceTimer >= 600000) //10 minutes
139  {
140  if (Player* plr = sObjectMgr.GetPlayer(m_FlagKeepers[0]))
141  plr->CastSpell(plr, WS_SPELL_FOCUSED_ASSAULT, true);
142  if (Player* plr = sObjectMgr.GetPlayer(m_FlagKeepers[1]))
143  plr->CastSpell(plr, WS_SPELL_FOCUSED_ASSAULT, true);
144  m_FlagDebuffState = 1;
145  }
146  else if (m_FlagDebuffState == 1 && m_FlagSpellForceTimer >= 900000) //15 minutes
147  {
148  if (Player* plr = sObjectMgr.GetPlayer(m_FlagKeepers[0]))
149  {
150  plr->RemoveAurasDueToSpell(WS_SPELL_FOCUSED_ASSAULT);
151  plr->CastSpell(plr, WS_SPELL_BRUTAL_ASSAULT, true);
152  }
153  if (Player* plr = sObjectMgr.GetPlayer(m_FlagKeepers[1]))
154  {
155  plr->RemoveAurasDueToSpell(WS_SPELL_FOCUSED_ASSAULT);
156  plr->CastSpell(plr, WS_SPELL_BRUTAL_ASSAULT, true);
157  }
158  m_FlagDebuffState = 2;
159  }
160  }
161  else
162  {
163  m_FlagSpellForceTimer = 0; //reset timer.
164  m_FlagDebuffState = 0;
165  }
166  }
167 }
168 
170 {
172  {
173  DoorClose(i);
175  }
178 }
179 
181 {
183  DoorOpen(i);
185  DoorOpen(i);
186 
191 
194 }
195 
197 {
199  //create score and add it to map, default values are set in constructor
201 
202  m_PlayerScores[plr->GetGUID()] = sc;
203 }
204 
206 {
207  if (Team == ALLIANCE)
208  {
209  sLog.outDebug("Respawn Alliance flag");
211  }
212  else
213  {
214  sLog.outDebug("Respawn Horde flag");
216  }
217 
218  if (captured)
219  {
220  //when map_update will be allowed for battlegrounds this code will be useless
224  PlaySoundToAll(BG_WS_SOUND_FLAGS_RESPAWNED); // flag respawned sound...
225  }
226  m_BothFlagsKept = false;
227 }
228 
230 {
231  if (GetStatus() != STATUS_IN_PROGRESS)
232  return;
233 
234  RespawnFlag(team, false);
235  if (team == ALLIANCE)
236  {
239  }
240  else
241  {
244  }
245 
247 
249  if (obj)
250  obj->Delete();
251  else
252  sLog.outError("unknown droped flag bg, guid: %u", GUID_LOPART(GetDroppedFlagGUID(team)));
253 
254  SetDroppedFlagGUID(0, team);
255  m_BothFlagsKept = false;
256 }
257 
259 {
260  if (GetStatus() != STATUS_IN_PROGRESS)
261  return;
262 
263  Team winner = TEAM_NONE;
264 
266  if (Source->GetTeam() == ALLIANCE)
267  {
268  if (!IsHordeFlagPickedup())
269  return;
270  SetHordeFlagPicker(0); // must be before aura remove to prevent 2 events (drop+capture) at the same time
271  // horde flag in base (but not respawned yet)
273  // Drop Horde Flag from Player
275  if (m_FlagDebuffState == 1)
277  if (m_FlagDebuffState == 2)
280  AddPoint(ALLIANCE, 1);
283  }
284  else
285  {
286  if (!IsAllianceFlagPickedup())
287  return;
288  SetAllianceFlagPicker(0); // must be before aura remove to prevent 2 events (drop+capture) at the same time
289  // alliance flag in base (but not respawned yet)
291  // Drop Alliance Flag from Player
293  if (m_FlagDebuffState == 1)
295  if (m_FlagDebuffState == 2)
298  AddPoint(HORDE, 1);
301  RewardHonorToTeam(BG_WSG_Honor[m_HonorMode][BG_WSG_FLAG_CAP], Source->GetTeam()); // +40 bonushonor
302  }
303 
306 
307  if (Source->GetTeam() == ALLIANCE)
309  else
311 
312  UpdateFlagState(Source->GetTeam(), 1); // flag state none
313  UpdateTeamScore(Source->GetTeam());
314  // only flag capture should be updated
315  UpdatePlayerScore(Source, SCORE_FLAG_CAPTURES, 1); // +1 flag captures
316 
318  SetFirstFlagCapture(Source->GetTeam());
319 
321  winner = ALLIANCE;
322 
324  winner = HORDE;
325 
326  if (winner)
327  {
332 
333  EndBattleground(winner);
334  }
335  else
337 }
338 
340 {
341  if (GetStatus() != STATUS_IN_PROGRESS)
342  {
343  // if not running, do not cast things at the dropper player (prevent spawning the "dropped" flag), neither send unnecessary messages
344  // just take off the aura
345  if (Source->GetTeam() == ALLIANCE)
346  {
347  if (!IsHordeFlagPickedup())
348  return;
349  if (GetHordeFlagPickerGUID() == Source->GetGUID())
350  {
353  }
354  }
355  else
356  {
357  if (!IsAllianceFlagPickedup())
358  return;
359  if (GetAllianceFlagPickerGUID() == Source->GetGUID())
360  {
363  }
364  }
365  return;
366  }
367 
368  bool set = false;
369 
370  if (Source->GetTeam() == ALLIANCE)
371  {
372  if (!IsHordeFlagPickedup())
373  return;
374  if (GetHordeFlagPickerGUID() == Source->GetGUID())
375  {
378  if (m_FlagDebuffState == 1)
380  if (m_FlagDebuffState == 2)
383  Source->CastSpell(Source, BG_WS_SPELL_WARSONG_FLAG_DROPPED, true);
384  set = true;
385  }
386  }
387  else
388  {
389  if (!IsAllianceFlagPickedup())
390  return;
391  if (GetAllianceFlagPickerGUID() == Source->GetGUID())
392  {
395  if (m_FlagDebuffState == 1)
397  if (m_FlagDebuffState == 2)
400  Source->CastSpell(Source, BG_WS_SPELL_SILVERWING_FLAG_DROPPED, true);
401  set = true;
402  }
403  }
404 
405  if (set)
406  {
407  Source->CastSpell(Source, SPELL_RECENTLY_DROPPED_FLAG, true);
408  UpdateFlagState(Source->GetTeam(), 1);
409 
410  if (Source->GetTeam() == ALLIANCE)
411  {
414  }
415  else
416  {
419  }
420 
422  }
423 }
424 
426 {
427  if (GetStatus() != STATUS_IN_PROGRESS)
428  return;
429 
430  int32 message_id = 0;
432 
433  //alliance flag picked up from base
435  && m_BgObjects[BG_WS_OBJECT_A_FLAG] == target_obj->GetGUID())
436  {
437  message_id = LANG_BG_WS_PICKEDUP_AF;
441  SetAllianceFlagPicker(Source->GetGUID());
443  //update world state to show correct flag carrier
446  Source->CastSpell(Source, BG_WS_SPELL_SILVERWING_FLAG, true);
447  if (m_FlagState[1] == BG_WS_FLAG_STATE_ON_PLAYER)
448  m_BothFlagsKept = true;
449  }
450 
451  //horde flag picked up from base
453  && m_BgObjects[BG_WS_OBJECT_H_FLAG] == target_obj->GetGUID())
454  {
455  message_id = LANG_BG_WS_PICKEDUP_HF;
459  SetHordeFlagPicker(Source->GetGUID());
461  //update world state to show correct flag carrier
464  Source->CastSpell(Source, BG_WS_SPELL_WARSONG_FLAG, true);
465  if (m_FlagState[0] == BG_WS_FLAG_STATE_ON_PLAYER)
466  m_BothFlagsKept = true;
467  }
468 
469  //Alliance flag on ground(not in base) (returned or picked up again from ground!)
471  {
472  if (Source->GetTeam() == ALLIANCE)
473  {
474  message_id = LANG_BG_WS_RETURNED_AF;
477  RespawnFlag(ALLIANCE, false);
481  m_BothFlagsKept = false;
482  }
483  else
484  {
485  message_id = LANG_BG_WS_PICKEDUP_AF;
489  SetAllianceFlagPicker(Source->GetGUID());
490  Source->CastSpell(Source, BG_WS_SPELL_SILVERWING_FLAG, true);
493  if (m_FlagDebuffState == 1)
494  Source->CastSpell(Source, WS_SPELL_FOCUSED_ASSAULT, true);
495  if (m_FlagDebuffState == 2)
496  Source->CastSpell(Source, WS_SPELL_BRUTAL_ASSAULT, true);
498  }
499  //called in HandleGameObjectUseOpcode:
500  //target_obj->Delete();
501  }
502 
503  //Horde flag on ground(not in base) (returned or picked up again)
504  if (GetFlagState(HORDE) == BG_WS_FLAG_STATE_ON_GROUND && Source->IsWithinDistInMap(target_obj, 10) && target_obj->GetGOInfo()->id == BG_OBJECT_H_FLAG_GROUND_WS_ENTRY)
505  {
506  if (Source->GetTeam() == HORDE)
507  {
508  message_id = LANG_BG_WS_RETURNED_HF;
511  RespawnFlag(HORDE, false);
515  m_BothFlagsKept = false;
516  }
517  else
518  {
519  message_id = LANG_BG_WS_PICKEDUP_HF;
523  SetHordeFlagPicker(Source->GetGUID());
524  Source->CastSpell(Source, BG_WS_SPELL_WARSONG_FLAG, true);
527  if (m_FlagDebuffState == 1)
528  Source->CastSpell(Source, WS_SPELL_FOCUSED_ASSAULT, true);
529  if (m_FlagDebuffState == 2)
530  Source->CastSpell(Source, WS_SPELL_BRUTAL_ASSAULT, true);
532  }
533  //called in HandleGameObjectUseOpcode:
534  //target_obj->Delete();
535  }
536 
537  if (!message_id)
538  return;
539 
540  SendMessageToAll(message_id, type, Source);
542 }
543 
545 {
546  // sometimes flag aura not removed :(
548  {
549  if (!plr)
550  {
551  sLog.outError("BattlegroundWS: Removing offline player who has the FLAG!!");
553  RespawnFlag(ALLIANCE, false);
554  }
555  else
557  }
559  {
560  if (!plr)
561  {
562  sLog.outError("BattlegroundWS: Removing offline player who has the FLAG!!");
564  RespawnFlag(HORDE, false);
565  }
566  else
568  }
569 }
570 
572 {
573  if (team == ALLIANCE)
575  else
577 }
578 
580 {
581  if (team == ALLIANCE)
583  else
585 }
586 
588 {
589  // this is wrong way to implement these things. On official it done by gameobject spell cast.
590  if (GetStatus() != STATUS_IN_PROGRESS)
591  return;
592 
593  //uint32 SpellId = 0;
594  //uint64 buff_guid = 0;
595  switch (Trigger)
596  {
597  case 3686: // Alliance elixir of speed spawn. Trigger not working, because located inside other areatrigger, can be replaced by IsWithinDist(object, dist) in BattleGround::Update().
598  case 3687: // Horde elixir of speed spawn. Trigger not working, because located inside other areatrigger, can be replaced by IsWithinDist(object, dist) in BattleGround::Update().
599  case 3706: // Alliance elixir of regeneration spawn
600  case 3708: // Horde elixir of regeneration spawn
601  case 3707: // Alliance elixir of berserk spawn
602  case 3709: // Horde elixir of berserk spawn
603  break;
604  case 3646: // Alliance Flag spawn
606  if (GetHordeFlagPickerGUID() == Source->GetGUID())
607  EventPlayerCapturedFlag(Source);
608  break;
609  case 3647: // Horde Flag spawn
610  if (m_FlagState[BG_TEAM_ALLIANCE] && !m_FlagState[BG_TEAM_HORDE])
611  if (GetAllianceFlagPickerGUID() == Source->GetGUID())
612  EventPlayerCapturedFlag(Source);
613  break;
614  case 3649: // unk1
615  case 3688: // unk2
616  case 4628: // unk3
617  case 4629: // unk4
618  break;
619  default:
620  sLog.outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
621  Source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", Trigger);
622  break;
623  }
624 }
625 
627 {
628  // flags
629  if ( !AddObject(BG_WS_OBJECT_A_FLAG, BG_OBJECT_A_FLAG_WS_ENTRY, 1540.423f, 1481.325f, 351.8284f, 3.089233f, 0, 0, 0.9996573f, 0.02617699f, BG_WS_FLAG_RESPAWN_TIME / 1000)
630  || !AddObject(BG_WS_OBJECT_H_FLAG, BG_OBJECT_H_FLAG_WS_ENTRY, 916.0226f, 1434.405f, 345.413f, 0.01745329f, 0, 0, 0.008726535f, 0.9999619f, BG_WS_FLAG_RESPAWN_TIME / 1000)
631  // buffs
632  || !AddObject(BG_WS_OBJECT_SPEEDBUFF_1, BG_OBJECTID_SPEEDBUFF_ENTRY, 1449.93f, 1470.71f, 342.6346f, -1.64061f, 0, 0, 0.7313537f, -0.6819983f, BUFF_RESPAWN_TIME)
633  || !AddObject(BG_WS_OBJECT_SPEEDBUFF_2, BG_OBJECTID_SPEEDBUFF_ENTRY, 1005.171f, 1447.946f, 335.9032f, 1.64061f, 0, 0, 0.7313537f, 0.6819984f, BUFF_RESPAWN_TIME)
634  || !AddObject(BG_WS_OBJECT_REGENBUFF_1, BG_OBJECTID_REGENBUFF_ENTRY, 1317.506f, 1550.851f, 313.2344f, -0.2617996f, 0, 0, 0.1305263f, -0.9914448f, BUFF_RESPAWN_TIME)
635  || !AddObject(BG_WS_OBJECT_REGENBUFF_2, BG_OBJECTID_REGENBUFF_ENTRY, 1110.451f, 1353.656f, 316.5181f, -0.6806787f, 0, 0, 0.333807f, -0.9426414f, BUFF_RESPAWN_TIME)
636  || !AddObject(BG_WS_OBJECT_BERSERKBUFF_1, BG_OBJECTID_BERSERKERBUFF_ENTRY, 1320.09f, 1378.79f, 314.7532f, 1.186824f, 0, 0, 0.5591929f, 0.8290376f, BUFF_RESPAWN_TIME)
637  || !AddObject(BG_WS_OBJECT_BERSERKBUFF_2, BG_OBJECTID_BERSERKERBUFF_ENTRY, 1139.688f, 1560.288f, 306.8432f, -2.443461f, 0, 0, 0.9396926f, -0.3420201f, BUFF_RESPAWN_TIME)
638  // alliance gates
639  || !AddObject(BG_WS_OBJECT_DOOR_A_1, BG_OBJECT_DOOR_A_1_WS_ENTRY, 1503.335f, 1493.466f, 352.1888f, 3.115414f, 0, 0, 0.9999143f, 0.01308903f, RESPAWN_IMMEDIATELY)
640  || !AddObject(BG_WS_OBJECT_DOOR_A_2, BG_OBJECT_DOOR_A_2_WS_ENTRY, 1492.478f, 1457.912f, 342.9689f, 3.115414f, 0, 0, 0.9999143f, 0.01308903f, RESPAWN_IMMEDIATELY)
641  || !AddObject(BG_WS_OBJECT_DOOR_A_3, BG_OBJECT_DOOR_A_3_WS_ENTRY, 1468.503f, 1494.357f, 351.8618f, 3.115414f, 0, 0, 0.9999143f, 0.01308903f, RESPAWN_IMMEDIATELY)
642  || !AddObject(BG_WS_OBJECT_DOOR_A_4, BG_OBJECT_DOOR_A_4_WS_ENTRY, 1471.555f, 1458.778f, 362.6332f, 3.115414f, 0, 0, 0.9999143f, 0.01308903f, RESPAWN_IMMEDIATELY)
643  || !AddObject(BG_WS_OBJECT_DOOR_A_5, BG_OBJECT_DOOR_A_5_WS_ENTRY, 1492.347f, 1458.34f, 342.3712f, -0.03490669f, 0, 0, 0.01745246f, -0.9998477f, RESPAWN_IMMEDIATELY)
644  || !AddObject(BG_WS_OBJECT_DOOR_A_6, BG_OBJECT_DOOR_A_6_WS_ENTRY, 1503.466f, 1493.367f, 351.7352f, -0.03490669f, 0, 0, 0.01745246f, -0.9998477f, RESPAWN_IMMEDIATELY)
645  // horde gates
646  || !AddObject(BG_WS_OBJECT_DOOR_H_1, BG_OBJECT_DOOR_H_1_WS_ENTRY, 949.1663f, 1423.772f, 345.6241f, -0.5756807f, -0.01673368f, -0.004956111f, -0.2839723f, 0.9586737f, RESPAWN_IMMEDIATELY)
647  || !AddObject(BG_WS_OBJECT_DOOR_H_2, BG_OBJECT_DOOR_H_2_WS_ENTRY, 953.0507f, 1459.842f, 340.6526f, -1.99662f, -0.1971825f, 0.1575096f, -0.8239487f, 0.5073641f, RESPAWN_IMMEDIATELY)
648  || !AddObject(BG_WS_OBJECT_DOOR_H_3, BG_OBJECT_DOOR_H_3_WS_ENTRY, 949.9523f, 1422.751f, 344.9273f, 0.0f, 0, 0, 0, 1, RESPAWN_IMMEDIATELY)
649  || !AddObject(BG_WS_OBJECT_DOOR_H_4, BG_OBJECT_DOOR_H_4_WS_ENTRY, 950.7952f, 1459.583f, 342.1523f, 0.05235988f, 0, 0, 0.02617695f, 0.9996573f, RESPAWN_IMMEDIATELY)
650  )
651  {
652  sLog.outErrorDb("BatteGroundWS: Failed to spawn some object Battleground not created!");
653  return false;
654  }
655 
657  if (!sg || !AddSpiritGuide(WS_SPIRIT_MAIN_ALLIANCE, sg->x, sg->y, sg->z, 3.124139f, ALLIANCE))
658  {
659  sLog.outErrorDb("BatteGroundWS: Failed to spawn Alliance spirit guide! Battleground not created!");
660  return false;
661  }
662 
664  if (!sg || !AddSpiritGuide(WS_SPIRIT_MAIN_HORDE, sg->x, sg->y, sg->z, 3.193953f, HORDE))
665  {
666  sLog.outErrorDb("BatteGroundWS: Failed to spawn Horde spirit guide! Battleground not created!");
667  return false;
668  }
669 
670  sLog.outDebug("BatteGroundWS: BG objects and spirit guides spawned");
671 
672  return true;
673 }
674 
676 {
685 
686  /* Spirit nodes is static at this BG and then not required deleting at BG reset.
687  if (m_BgCreatures[WS_SPIRIT_MAIN_ALLIANCE])
688  DelCreature(WS_SPIRIT_MAIN_ALLIANCE);
689 
690  if (m_BgCreatures[WS_SPIRIT_MAIN_HORDE])
691  DelCreature(WS_SPIRIT_MAIN_HORDE);
692  */
693 }
694 
696 {
697  // @todo BG Weekend Holiday
698 
699  //win reward
700  if (winner == ALLIANCE)
702  if (winner == HORDE)
704 
706 }
707 
709 {
710  if (GetStatus() != STATUS_IN_PROGRESS)
711  return;
712 
713  EventPlayerDroppedFlag(player);
714 
715  Battleground::HandleKillPlayer(player, killer);
716 }
717 
719 {
720  BattlegroundScoreMap::iterator itr = m_PlayerScores.find(Source->GetGUID());
721  if (itr == m_PlayerScores.end()) // player not found
722  return;
723 
724  switch (type)
725  {
726  case SCORE_FLAG_CAPTURES: // flags captured
727  ((BattlegroundWGScore*)itr->second)->FlagCaptures += value;
728  break;
729  case SCORE_FLAG_RETURNS: // flags returned
730  ((BattlegroundWGScore*)itr->second)->FlagReturns += value;
731  break;
732  default:
733  Battleground::UpdatePlayerScore(Source, type, value);
734  break;
735  }
736 }
737 
739 {
740  //if status in progress, it returns main graveyards with spiritguides
741  //else it will return the graveyard in the flagroom - this is especially good
742  //if a player dies in preparation phase - then the player can't cheat
743  //and teleport to the graveyard outside the flagroom
744  //and start running around, while the doors are still closed
745  if (player->GetTeam() == ALLIANCE)
746  {
747  if (GetStatus() == STATUS_IN_PROGRESS)
749  else
751  }
752  else
753  {
754  if (GetStatus() == STATUS_IN_PROGRESS)
755  return sWorldSafeLocsStore.LookupEntry(WS_GRAVEYARD_MAIN_HORDE);
756  else
758  }
759 }
760 
762 {
765 
767  data << uint32(BG_WS_FLAG_UNK_ALLIANCE) << uint32(-1);
769  data << uint32(BG_WS_FLAG_UNK_ALLIANCE) << uint32(1);
770  else
771  data << uint32(BG_WS_FLAG_UNK_ALLIANCE) << uint32(0);
772 
774  data << uint32(BG_WS_FLAG_UNK_HORDE) << uint32(-1);
776  data << uint32(BG_WS_FLAG_UNK_HORDE) << uint32(1);
777  else
778  data << uint32(BG_WS_FLAG_UNK_HORDE) << uint32(0);
779 
781 
783  data << uint32(BG_WS_FLAG_STATE_ALLIANCE) << uint32(2);
784  else
785  data << uint32(BG_WS_FLAG_STATE_ALLIANCE) << uint32(1);
786 
788  data << uint32(BG_WS_FLAG_STATE_HORDE) << uint32(2);
789  else
790  data << uint32(BG_WS_FLAG_STATE_HORDE) << uint32(1);
791 
792 }
793 
virtual void FillInitialWorldStates(WorldPacket &data)
DBCStorage< WorldSafeLocsEntry > sWorldSafeLocsStore(WorldSafeLocsEntryfmt)
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)
uint32 m_StartMessageIds[BG_STARTING_EVENT_COUNT]
Definition: Battleground.h:728
int32 m_TeamScores[BG_TEAMS_COUNT]
Definition: Battleground.h:704
virtual void HandleKillPlayer(Player *player, Player *killer)
int32 m_FlagsDropTimer[2]
void Update(uint32 diff)
#define GUID_LOPART(x)
Definition: ObjectGuid.h:110
void RewardReputationToTeam(uint32 faction_id, uint32 Reputation, uint32 TeamID)
void UpdatePlayerScore(Player *Source, uint32 type, uint32 value)
uint64 GetDroppedFlagGUID(uint32 TeamID)
virtual void EventPlayerCapturedFlag(Player *Source)
uint8 m_FlagState[2]
uint64 GetAllianceFlagPickerGUID() const
void UpdateTeamScore(uint32 team)
virtual void EventPlayerClickedOnFlag(Player *Source, GameObject *target_obj)
virtual void EventPlayerDroppedFlag(Player *Source)
int32 m_FlagSpellForceTimer
#define sLog
Log class singleton.
Definition: Log.h:187
ChatMsg
ACE_INT32 int32
Definition: Define.h:67
void HandleAreaTrigger(Player *Source, uint32 Trigger)
void SpawnBGObject(uint32 type, uint32 respawntime)
void RespawnFlagAfterDrop(uint32 Team)
uint64 m_DroppedFlagGUID[2]
uint8 GetFlagState(uint32 team)
void UpdateWorldState(uint32 Field, uint32 Value)
uint32 BG_WSG_Reputation[BG_HONOR_MODE_NUM][BG_WSG_REWARD_NUM]
uint32 GetStatus() const
Definition: Battleground.h:317
void EndBattleground(Team winner)
BattlegroundScoreMap m_PlayerScores
Definition: Battleground.h:713
#define sObjectMgr
Definition: ObjectMgr.h:1285
uint8 GetTeamIndexByTeamId(uint32 Team) const
Definition: Battleground.h:609
bool AddSpiritGuide(uint32 type, float x, float y, float z, float o, uint32 team)
void AddPoint(uint32 TeamID, uint32 Points=1)
uint64 GetHordeFlagPickerGUID() const
virtual void AddPlayer(Player *plr)
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true) const
Definition: Object.h:774
virtual WorldSafeLocsEntry const * GetClosestGraveYard(Player *player)
void RemoveAurasDueToSpell(uint32 spellId, Aura *except=NULL)
Definition: Unit.cpp:4371
BGCreatures m_BgCreatures
Definition: Battleground.h:673
void SetFirstFlagCapture(uint32 team)
Definition: Common.h:179
BattlegroundMap * GetBgMap()
Definition: Battleground.h:549
Team
BGObjects m_BgObjects
Definition: Battleground.h:672
uint64 m_FlagKeepers[2]
void SetDroppedFlagGUID(uint64 guid, uint32 TeamID)
void PlaySoundToAll(uint32 SoundID)
uint32 m_FirstFlagCaptureTeam
void RemoveAurasWithInterruptFlags(uint32 flags, uint32 except=0)
Definition: Unit.cpp:736
uint32 BG_WSG_Honor[BG_HONOR_MODE_NUM][BG_WSG_REWARD_NUM]
void HandleKillPlayer(Player *player, Player *killer)
void CastSpell(Unit *Victim, uint32 spellId, bool triggered, Item *castItem=NULL, Aura *triggeredByAura=NULL, uint64 originalCaster=0)
Definition: Unit.cpp:1223
etc mysql my cnf *Then change max_allowed_packet to a bigger value
bool IsHordeFlagPickedup() const
virtual void ResetBGSubclass()
virtual void UpdatePlayerScore(Player *Source, uint32 type, uint32 value)
virtual void StartingEventCloseDoors()
virtual void AddPlayer(Player *plr)
BG_WSG_Rewards
void RewardHonorToTeam(uint32 Honor, uint32 TeamID)
ACE_UINT64 uint64
Definition: Define.h:70
void DoorOpen(uint32 type)
bool IsAllianceFlagPickedup() const
uint32 GetStartTime() const
Definition: Battleground.h:321
GameObjectInfo const * GetGOInfo() const
Definition: GameObject.h:592
uint32 GetTeam() const
Definition: Player.h:2063
void SetAllianceFlagPicker(uint64 guid)
void SendAreaTriggerMessage(const char *Text,...) ATTR_PRINTF(2
int32 m_FlagsTimer[2]
WorldSession * GetSession() const
Definition: Player.h:1944
void EndBattleground(uint32 winner)
ACE_UINT32 uint32
Definition: Define.h:71
GameObject * GetGameObject(uint64 guid)
Definition: Map.cpp:2636
void RemovePlayer(Player *plr, uint64 guid)
void UpdateFlagState(uint32 team, uint32 value)
Definition: Player.h:922
void RespawnFlag(uint32 Team, bool captured)
virtual void StartingEventOpenDoors()
uint32 GetTeamScore(uint32 TeamID) const
void SetHordeFlagPicker(uint64 guid)
void DoorClose(uint32 type)
BGHonorMode m_HonorMode
Definition: Battleground.h:733
void SendMessageToAll(int32 entry, ChatMsg type, Player const *source=NULL)
void Delete()
Definition: GameObject.cpp:564
const uint64 & GetGUID() const
Definition: Object.h:162
virtual void Update(uint32 diff)