TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
BattlegroundAV Class Reference

#include <BattlegroundAV.h>

Public Member Functions

 BattlegroundAV ()
 
 ~BattlegroundAV ()
 
void AddPlayer (Player *player) override
 
void StartingEventCloseDoors () override
 
void StartingEventOpenDoors () override
 
void RemovePlayer (Player *player, ObjectGuid guid, uint32 team) override
 
void HandleAreaTrigger (Player *player, uint32 trigger, bool entered) override
 
bool SetupBattleground () override
 
void ResetBGSubclass () override
 
void UpdateScore (uint16 team, int16 points)
 
bool UpdatePlayerScore (Player *player, uint32 type, uint32 value, bool doAddHonor=true) override
 
void EventPlayerClickedOnFlag (Player *source, GameObject *target_obj) override
 
void HandleKillPlayer (Player *player, Player *killer) override
 
void HandleKillUnit (Creature *unit, Player *killer) override
 
void HandleQuestComplete (uint32 questid, Player *player) override
 
bool CanActivateGO (int32 GOId, uint32 team) const override
 
void EndBattleground (uint32 winner) override
 
WorldSafeLocsEntry constGetClosestGraveYard (Player *player) override
 
bool CheckAchievementCriteriaMeet (uint32 criteriaId, Player const *source, Unit const *target=nullptr, uint32 miscvalue1=0) override
 
uint32 GetPrematureWinner () override
 
- Public Member Functions inherited from Battleground
 Battleground ()
 
virtual ~Battleground ()
 
void Update (uint32 diff)
 
virtual void Reset ()
 
virtual void DestroyGate (Player *, GameObject *)
 
virtual bool IsAllNodesControlledByTeam (uint32) const
 
void StartTimedAchievement (AchievementCriteriaTimedTypes type, uint32 entry)
 
std::string constGetName () const
 
uint64 GetQueueId () const
 
BattlegroundTypeId GetTypeID (bool GetRandom=false) const
 
BattlegroundBracketId GetBracketId () const
 
uint32 GetInstanceID () const
 
BattlegroundStatus GetStatus () const
 
uint32 GetClientInstanceID () const
 
uint32 GetElapsedTime () const
 
uint32 GetRemainingTime () const
 
uint32 GetLastResurrectTime () const
 
uint32 GetMaxPlayers () const
 
uint32 GetMinPlayers () const
 
uint32 GetMinLevel () const
 
uint32 GetMaxLevel () const
 
uint32 GetMaxPlayersPerTeam () const
 
uint32 GetMinPlayersPerTeam () const
 
int32 GetStartDelayTime () const
 
uint8 GetArenaType () const
 
BattlegroundTeamId GetWinner () const
 
uint32 GetScriptId () const
 
uint32 GetBonusHonorFromKill (uint32 kills) const
 
bool IsRandom () const
 
void SetQueueId (uint64 queueId)
 
void SetName (std::string const &name)
 
void SetTypeID (BattlegroundTypeId TypeID)
 
void SetRandomTypeID (BattlegroundTypeId TypeID)
 
void SetBracket (PvPDifficultyEntry const *bracketEntry)
 
void SetInstanceID (uint32 InstanceID)
 
void SetStatus (BattlegroundStatus Status)
 
void SetClientInstanceID (uint32 InstanceID)
 
void SetElapsedTime (uint32 Time)
 
void SetRemainingTime (uint32 Time)
 
void SetLastResurrectTime (uint32 Time)
 
void SetMaxPlayers (uint32 MaxPlayers)
 
void SetMinPlayers (uint32 MinPlayers)
 
void SetLevelRange (uint32 min, uint32 max)
 
void SetRated (bool state)
 
void SetArenaType (uint8 type)
 
void SetArenaorBGType (bool _isArena)
 
void SetWinner (BattlegroundTeamId winnerTeamId)
 
void SetScriptId (uint32 scriptId)
 
void ModifyStartDelayTime (int diff)
 
void SetStartDelayTime (int Time)
 
void SetMaxPlayersPerTeam (uint32 MaxPlayers)
 
void SetMinPlayersPerTeam (uint32 MinPlayers)
 
void AddToBGFreeSlotQueue ()
 
void RemoveFromBGFreeSlotQueue ()
 
void DecreaseInvitedCount (uint32 team)
 
void IncreaseInvitedCount (uint32 team)
 
void SetRandom (bool isRandom)
 
uint32 GetInvitedCount (uint32 team) const
 
bool HasFreeSlots () const
 
uint32 GetFreeSlotsForTeam (uint32 Team) const
 
bool isArena () const
 
bool isBattleground () const
 
bool isRated () const
 
BattlegroundPlayerMap constGetPlayers () const
 
uint32 GetPlayersSize () const
 
uint32 GetPlayerScoresSize () const
 
uint32 GetReviveQueueSize () const
 
void AddPlayerToResurrectQueue (ObjectGuid npc_guid, ObjectGuid player_guid)
 
void RemovePlayerFromResurrectQueue (ObjectGuid player_guid)
 
void RelocateDeadPlayers (ObjectGuid guideGuid)
 Relocate all players in ReviveQueue to the closest graveyard. More...
 
void StartBattleground ()
 
GameObjectGetBGObject (uint32 type, bool logError=true)
 
CreatureGetBGCreature (uint32 type, bool logError=true)
 
void SetMapId (uint32 MapID)
 
uint32 GetMapId () const
 
void SetBgMap (BattlegroundMap *map)
 
BattlegroundMapGetBgMap () const
 
BattlegroundMapFindBgMap () const
 
void SetTeamStartPosition (TeamId teamId, Position const &pos)
 
Position constGetTeamStartPosition (TeamId teamId) const
 
void SetStartMaxDist (float startMaxDist)
 
float GetStartMaxDist () const
 
void SendPacketToTeam (uint32 TeamID, WorldPacket const *packet, Player *sender=NULL, bool self=true) const
 
void SendPacketToAll (WorldPacket const *packet) const
 
void SendChatMessage (Creature *source, uint8 textId, WorldObject *target=NULL)
 
template<class Do >
void BroadcastWorker (Do &_do)
 
void PlaySoundToTeam (uint32 SoundID, uint32 TeamID)
 
void PlaySoundToAll (uint32 SoundID)
 
void CastSpellOnTeam (uint32 SpellID, uint32 TeamID)
 
void RemoveAuraOnTeam (uint32 SpellID, uint32 TeamID)
 
void RewardHonorToTeam (uint32 Honor, uint32 TeamID)
 
void RewardReputationToTeam (uint32 faction_id, uint32 Reputation, uint32 TeamID)
 
void UpdateWorldState (uint32 variable, uint32 value, bool hidden=false)
 
void BlockMovement (Player *player)
 
void SendMessageToAll (uint32 entry, ChatMsg type, Player const *source=NULL)
 
void PSendMessageToAll (uint32 entry, ChatMsg type, Player const *source,...)
 
void SendMessage2ToAll (uint32 entry, ChatMsg type, Player const *source, uint32 strId1=0, uint32 strId2=0)
 
GroupGetBgRaid (uint32 TeamID) const
 
void SetBgRaid (uint32 TeamID, Group *bg_raid)
 
void BuildPvPLogDataPacket (WorldPackets::Battleground::PVPLogData &pvpLogData)
 
uint32 GetPlayersCountByTeam (uint32 Team) const
 
uint32 GetAlivePlayersCountByTeam (uint32 Team) const
 
void UpdatePlayersCountByTeam (uint32 Team, bool remove)
 
virtual void CheckWinConditions ()
 
void SetArenaTeamIdForTeam (uint32 Team, uint32 ArenaTeamId)
 
uint32 GetArenaTeamIdForTeam (uint32 Team) const
 
uint32 GetArenaTeamIdByIndex (uint32 index) const
 
void SetArenaMatchmakerRating (uint32 Team, uint32 MMR)
 
uint32 GetArenaMatchmakerRating (uint32 Team) const
 
virtual void EventPlayerDroppedFlag (Player *)
 
void EventPlayerLoggedIn (Player *player)
 
void EventPlayerLoggedOut (Player *player)
 
virtual void ProcessEvent (WorldObject *, uint32, WorldObject *=NULL)
 
virtual void DoAction (uint32, ObjectGuid)
 
virtual void HandlePlayerResurrect (Player *)
 
void AddOrSetPlayerToCorrectBgGroup (Player *player, uint32 team)
 
virtual void RemovePlayerAtLeave (ObjectGuid guid, bool Transport, bool SendPacket)
 
void HandleTriggerBuff (ObjectGuid go_guid)
 
void SetHoliday (bool is_holiday)
 
void SpawnBGObject (uint32 type, uint32 respawntime)
 
virtual 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, GOState goState=GO_STATE_READY)
 
bool AddObject (uint32 type, uint32 entry, Position const &pos, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime=0, GOState goState=GO_STATE_READY)
 
virtual CreatureAddCreature (uint32 entry, uint32 type, float x, float y, float z, float o, TeamId teamId=TEAM_NEUTRAL, uint32 respawntime=0, Transport *transport=NULL)
 
CreatureAddCreature (uint32 entry, uint32 type, Position const &pos, TeamId teamId=TEAM_NEUTRAL, uint32 respawntime=0, Transport *transport=NULL)
 
bool DelCreature (uint32 type)
 
bool DelObject (uint32 type)
 
virtual bool AddSpiritGuide (uint32 type, float x, float y, float z, float o, TeamId teamId=TEAM_NEUTRAL)
 
bool AddSpiritGuide (uint32 type, Position const &pos, TeamId teamId=TEAM_NEUTRAL)
 
int32 GetObjectType (ObjectGuid guid)
 
void DoorOpen (uint32 type)
 
void DoorClose (uint32 type)
 
virtual bool HandlePlayerUnderMap (Player *)
 
uint32 GetPlayerTeam (ObjectGuid guid) const
 
uint32 GetOtherTeam (uint32 teamId) const
 
bool IsPlayerInBattleground (ObjectGuid guid) const
 
bool ToBeDeleted () const
 
void SetDeleteThis ()
 
void RewardXPAtKill (Player *killer, Player *victim)
 
bool CanAwardArenaPoints () const
 
virtual ObjectGuid GetFlagPickerGUID (int32=-1) const
 
virtual void SetDroppedFlagGUID (ObjectGuid, int32=-1)
 
virtual bool IsSpellAllowed (uint32, Player const *) const
 
uint32 GetTeamScore (uint32 TeamID) const
 
uint8 GetUniqueBracketId () const
 

Private Member Functions

void PostUpdateImpl (uint32 diff) override
 Post-update hook. More...
 
void EventPlayerAssaultsPoint (Player *player, uint32 object)
 
void EventPlayerDefendsPoint (Player *player, uint32 object)
 
void EventPlayerDestroyedPoint (BG_AV_Nodes node)
 
void AssaultNode (BG_AV_Nodes node, uint16 team)
 
void DestroyNode (BG_AV_Nodes node)
 
void InitNode (BG_AV_Nodes node, uint16 team, bool tower)
 
void DefendNode (BG_AV_Nodes node, uint16 team)
 
void PopulateNode (BG_AV_Nodes node)
 
void DePopulateNode (BG_AV_Nodes node)
 
StaticNodeInfo constGetStaticNodeInfo (BG_AV_Nodes node) const
 
BG_AV_Nodes GetNodeThroughObject (uint32 object)
 
uint32 GetObjectThroughNode (BG_AV_Nodes node)
 
bool IsTower (BG_AV_Nodes node)
 
void ChangeMineOwner (uint8 mine, uint32 team, bool initial=false)
 
void FillInitialWorldStates (WorldPackets::WorldState::InitWorldStates &packet) override
 
void SendMineWorldStates (uint32 mine)
 
void UpdateNodeWorldState (BG_AV_Nodes node)
 
CreatureAddAVCreature (uint16 cinfoid, uint16 type)
 

Private Attributes

int32 m_Team_Scores [2]
 
uint32 m_Team_QuestStatus [2][9]
 
BG_AV_NodeInfo m_Nodes [BG_AV_NODES_MAX]
 
uint32 m_Mine_Owner [2]
 
uint32 m_Mine_PrevOwner [2]
 
int32 m_Mine_Timer
 
uint32 m_Mine_Reclaim_Timer [2]
 
uint32 m_CaptainBuffTimer [2]
 
bool m_CaptainAlive [2]
 
bool m_IsInformedNearVictory [2]
 

Additional Inherited Members

- Public Types inherited from Battleground
typedef std::map< ObjectGuid,
BattlegroundPlayer
BattlegroundPlayerMap
 
typedef std::map< ObjectGuid,
BattlegroundScore * > 
BattlegroundScoreMap
 
- Static Public Member Functions inherited from Battleground
static TeamId GetTeamIndexByTeamId (uint32 Team)
 
- Public Attributes inherited from Battleground
GuidVector BgObjects
 
GuidVector BgCreatures
 
- Protected Member Functions inherited from Battleground
void EndNow ()
 
void PlayerAddedToBGCheckIfBGIsRunning (Player *player)
 
Player_GetPlayer (ObjectGuid guid, bool offlineRemove, const char *context) const
 
Player_GetPlayer (BattlegroundPlayerMap::iterator itr, const char *context)
 
Player_GetPlayer (BattlegroundPlayerMap::const_iterator itr, const char *context) const
 
Player_GetPlayerForTeam (uint32 teamId, BattlegroundPlayerMap::const_iterator itr, const char *context) const
 
virtual bool PreUpdateImpl (uint32)
 Pre-update hook. More...
 
void _ProcessOfflineQueue ()
 
void _ProcessResurrect (uint32 diff)
 
void _ProcessProgress (uint32 diff)
 
void _ProcessLeave (uint32 diff)
 
void _ProcessJoin (uint32 diff)
 
void _CheckSafePositions (uint32 diff)
 
void _ProcessPlayerPositionBroadcast (uint32 diff)
 
virtual void GetPlayerPositionData (std::vector< WorldPackets::Battleground::BattlegroundPlayerPosition > *) const
 
- Protected Attributes inherited from Battleground
BattlegroundScoreMap PlayerScores
 
BattlegroundPlayerMap m_Players
 
std::map< ObjectGuid, GuidVectorm_ReviveQueue
 
uint8 m_Events
 
BattlegroundStartTimeIntervals StartDelayTimes [BG_STARTING_EVENT_COUNT]
 
uint32 StartMessageIds [BG_STARTING_EVENT_COUNT]
 
bool m_BuffChange
 
bool m_IsRandom
 
BGHonorMode m_HonorMode
 
int32 m_TeamScores [BG_TEAMS_COUNT]
 
ArenaTeamScore _arenaTeamScores [BG_TEAMS_COUNT]
 

Constructor & Destructor Documentation

BattlegroundAV::BattlegroundAV ( )
31 {
34 
35  for (uint8 i = 0; i < 2; i++)
36  {
37  for (uint8 j = 0; j < 9; j++)
38  m_Team_QuestStatus[i][j] = 0;
39  m_Team_Scores[i] = 0;
40  m_IsInformedNearVictory[i] = false;
41  m_CaptainAlive[i] = true;
42  m_CaptainBuffTimer[i] = 0;
43  m_Mine_Owner[i] = 0;
44  m_Mine_PrevOwner[i] = 0;
45  m_Mine_Reclaim_Timer[i] = 0;
46  }
47 
48  m_Mine_Timer = 0;
49 
51  InitNode(i, 0, false);
52 
57 }
BG_AV_Nodes
Definition: BattlegroundAV.h:160
Definition: Battleground.h:199
uint32 m_Mine_Reclaim_Timer[2]
Definition: BattlegroundAV.h:1690
uint32 m_Mine_PrevOwner[2]
Definition: BattlegroundAV.h:1688
Definition: Battleground.h:200
Definition: BattlegroundAV.h:162
uint32 m_Team_QuestStatus[2][9]
Definition: BattlegroundAV.h:1683
Definition: Language.h:1033
Definition: Battleground.h:198
bool m_IsInformedNearVictory[2]
Definition: BattlegroundAV.h:1694
int32 m_Team_Scores[2]
Definition: BattlegroundAV.h:1682
Definition: Language.h:1037
Definition: BattlegroundAV.h:311
GuidVector BgObjects
Definition: Battleground.h:452
GuidVector BgCreatures
Definition: Battleground.h:453
Definition: Language.h:1031
int32 m_Mine_Timer
Definition: BattlegroundAV.h:1689
uint32 StartMessageIds[BG_STARTING_EVENT_COUNT]
Definition: Battleground.h:556
uint32 m_CaptainBuffTimer[2]
Definition: BattlegroundAV.h:1691
uint32 m_Mine_Owner[2]
Definition: BattlegroundAV.h:1687
Definition: BattlegroundAV.h:106
Definition: BattlegroundAV.h:627
uint8_t uint8
Definition: Define.h:152
void InitNode(BG_AV_Nodes node, uint16 team, bool tower)
Definition: BattlegroundAV.cpp:1443
Definition: Language.h:1032
bool m_CaptainAlive[2]
Definition: BattlegroundAV.h:1692
Definition: BattlegroundAV.h:178
Definition: Battleground.h:197

+ Here is the call graph for this function:

BattlegroundAV::~BattlegroundAV ( )
59 { }

Member Function Documentation

Creature * BattlegroundAV::AddAVCreature ( uint16  cinfoid,
uint16  type 
)
private
Todo:
look if this can be done by database + also add this for the wingcommanders
Todo:
find a way to add a motionmaster without killing the creature (i
274 {
275  bool isStatic = false;
276  Creature* creature = NULL;
278  if (type >= AV_CPLACE_MAX) //static
279  {
280  type -= AV_CPLACE_MAX;
281  cinfoid = uint16(BG_AV_StaticCreaturePos[type][4]);
282  creature = AddCreature(BG_AV_StaticCreatureInfo[cinfoid],
283  type + AV_CPLACE_MAX,
284  BG_AV_StaticCreaturePos[type][0],
285  BG_AV_StaticCreaturePos[type][1],
286  BG_AV_StaticCreaturePos[type][2],
287  BG_AV_StaticCreaturePos[type][3]);
288  isStatic = true;
289  }
290  else
291  {
292  creature = AddCreature(BG_AV_CreatureInfo[cinfoid], type, BG_AV_CreaturePos[type]);
293  }
294  if (!creature)
295  return NULL;
297  creature->SetRespawnDelay(RESPAWN_ONE_DAY);
298 
299  if ((isStatic && cinfoid >= 10 && cinfoid <= 14) || (!isStatic && ((cinfoid >= AV_NPC_A_GRAVEDEFENSE0 && cinfoid <= AV_NPC_A_GRAVEDEFENSE3) ||
300  (cinfoid >= AV_NPC_H_GRAVEDEFENSE0 && cinfoid <= AV_NPC_H_GRAVEDEFENSE3))))
301  {
302  if (!isStatic && ((cinfoid >= AV_NPC_A_GRAVEDEFENSE0 && cinfoid <= AV_NPC_A_GRAVEDEFENSE3)
303  || (cinfoid >= AV_NPC_H_GRAVEDEFENSE0 && cinfoid <= AV_NPC_H_GRAVEDEFENSE3)))
304  {
305  CreatureData &data = sObjectMgr->NewOrExistCreatureData(creature->GetSpawnId());
306  data.spawndist = 5;
307  }
308  //else spawndist will be 15, so creatures move maximum=10
309  //creature->SetDefaultMovementType(RANDOM_MOTION_TYPE);
310  creature->GetMotionMaster()->Initialize();
311  creature->setDeathState(JUST_DIED);
312  creature->Respawn();
314  //just copied this code from a gm-command
315  }
316 
317  uint32 triggerSpawnID = 0;
318  uint32 newFaction = 0;
319  if (creature->GetEntry() == BG_AV_CreatureInfo[AV_NPC_A_CAPTAIN])
320  {
321  triggerSpawnID = AV_CPLACE_TRIGGER16;
322  newFaction = 84;
323  }
324  else if (creature->GetEntry() == BG_AV_CreatureInfo[AV_NPC_A_BOSS])
325  {
326  triggerSpawnID = AV_CPLACE_TRIGGER17;
327  newFaction = 84;
328  }
329  else if (creature->GetEntry() == BG_AV_CreatureInfo[AV_NPC_H_CAPTAIN])
330  {
331  triggerSpawnID = AV_CPLACE_TRIGGER18;
332  newFaction = 83;
333  }
334  else if (creature->GetEntry() == BG_AV_CreatureInfo[AV_NPC_H_BOSS])
335  {
336  triggerSpawnID = AV_CPLACE_TRIGGER19;
337  newFaction = 83;
338  }
339  if (triggerSpawnID && newFaction)
340  {
341  if (Creature* trigger = AddCreature(WORLD_TRIGGER, triggerSpawnID, BG_AV_CreaturePos[triggerSpawnID]))
342  {
343  trigger->setFaction(newFaction);
344  trigger->CastSpell(trigger, SPELL_HONORABLE_DEFENDER_25Y, false);
345  }
346  }
347 
348  return creature;
349 }
Definition: Creature.h:287
Definition: BattlegroundAV.h:994
Definition: BattlegroundAV.h:1004
Definition: BattlegroundAV.h:995
const float BG_AV_StaticCreaturePos[AV_STATICCPLACE_MAX][5]
Definition: BattlegroundAV.h:1105
Definition: BattlegroundAV.h:625
Definition: Unit.h:542
Definition: BattlegroundAV.h:999
MotionMaster * GetMotionMaster()
Definition: Unit.h:2101
#define WORLD_TRIGGER
Definition: Unit.h:33
virtual Creature * AddCreature(uint32 entry, uint32 type, float x, float y, float z, float o, TeamId teamId=TEAM_NEUTRAL, uint32 respawntime=0, Transport *transport=NULL)
Definition: Battleground.cpp:1580
ObjectGuid::LowType GetSpawnId() const
Definition: Creature.h:487
arena_t NULL
Definition: jemalloc_internal.h:624
float spawndist
Definition: Creature.h:303
Definition: Creature.h:467
Definition: BattlegroundAV.h:624
Definition: BattlegroundAV.h:622
#define sObjectMgr
Definition: ObjectMgr.h:1567
uint16_t uint16
Definition: g3dmath.h:166
bool isStatic(MovementGenerator *mv)
Definition: MotionMaster.cpp:34
Definition: BattlegroundAV.h:996
void setDeathState(DeathState s) override
Definition: Creature.cpp:1624
Definition: BattlegroundAV.h:991
uint32_t uint32
Definition: Define.h:150
Definition: Battleground.h:128
Definition: BattlegroundAV.h:1002
Definition: BattlegroundAV.h:106
Definition: Battleground.h:115
void Respawn(bool force=false)
Definition: Creature.cpp:1697
const uint32 BG_AV_StaticCreatureInfo[51]
Definition: BattlegroundAV.h:1233
Definition: BattlegroundAV.h:627
#define ASSERT
Definition: Errors.h:55
uint32 GetEntry() const
Definition: Object.h:107
Definition: BattlegroundAV.h:1003
void Initialize()
Definition: MotionMaster.cpp:39
void SetRespawnDelay(uint32 delay)
Definition: Creature.h:638
Position const BG_AV_CreaturePos[AV_CPLACE_MAX]
Definition: BattlegroundAV.h:630
Definition: BattlegroundAV.h:623
const uint32 BG_AV_CreatureInfo[AV_NPC_INFO_MAX]
Definition: BattlegroundAV.h:1045

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void BattlegroundAV::AddPlayer ( Player player)
overridevirtual

Reimplemented from Battleground.

436 {
437  Battleground::AddPlayer(player);
438  PlayerScores[player->GetGUID()] = new BattlegroundAVScore(player->GetGUID(), player->GetBGTeam());
439 }
Definition: BattlegroundAV.h:1552
virtual void AddPlayer(Player *player)
Definition: Battleground.cpp:1079
BattlegroundScoreMap PlayerScores
Definition: Battleground.h:543

+ Here is the call graph for this function:

void BattlegroundAV::AssaultNode ( BG_AV_Nodes  node,
uint16  team 
)
private
1403 {
1404  if (m_Nodes[node].TotalOwner == team)
1405  {
1406  TC_LOG_FATAL("bg.battleground", "Assaulting team is TotalOwner of node");
1407  ABORT();
1408  }
1409  if (m_Nodes[node].Owner == team)
1410  {
1411  TC_LOG_FATAL("bg.battleground", "Assaulting team is owner of node");
1412  ABORT();
1413  }
1414  if (m_Nodes[node].State == POINT_DESTROYED)
1415  {
1416  TC_LOG_FATAL("bg.battleground", "Destroyed node is being assaulted");
1417  ABORT();
1418  }
1419  if (m_Nodes[node].State == POINT_ASSAULTED && m_Nodes[node].TotalOwner) //only assault an assaulted node if no totalowner exists
1420  {
1421  TC_LOG_FATAL("bg.battleground", "Assault on an not assaulted node with total owner");
1422  ABORT();
1423  }
1424  //the timer gets another time, if the previous owner was 0 == Neutral
1426  m_Nodes[node].PrevOwner = m_Nodes[node].Owner;
1427  m_Nodes[node].Owner = team;
1428  m_Nodes[node].PrevState = m_Nodes[node].State;
1429  m_Nodes[node].State = POINT_ASSAULTED;
1430 }
Definition: BattlegroundAV.h:1323
uint16 Owner
Definition: BattlegroundAV.h:1545
#define BG_AV_SNOWFALL_FIRSTCAP
Definition: BattlegroundAV.h:27
uint16 PrevOwner
Definition: BattlegroundAV.h:1546
BG_AV_States State
Definition: BattlegroundAV.h:1541
#define TC_LOG_FATAL(filterType__,...)
Definition: Log.h:210
BG_AV_States PrevState
Definition: BattlegroundAV.h:1542
#define ABORT
Definition: Errors.h:56
uint32 Timer
Definition: BattlegroundAV.h:1543
#define BG_AV_CAPTIME
Definition: BattlegroundAV.h:26
BG_AV_NodeInfo m_Nodes[BG_AV_NODES_MAX]
Definition: BattlegroundAV.h:1685
Definition: BattlegroundAV.h:1324

+ Here is the caller graph for this function:

bool BattlegroundAV::CanActivateGO ( int32  GOId,
uint32  team 
) const
overridevirtual

Reimplemented from Battleground.

697 {
698  if (GOId == BG_AV_OBJECTID_MINE_N)
699  return (m_Mine_Owner[AV_NORTH_MINE] == team);
700  if (GOId == BG_AV_OBJECTID_MINE_S)
701  return (m_Mine_Owner[AV_SOUTH_MINE] == team);
702  return true; //cause it's no mine'object it is ok if this is true
703 }
Definition: BattlegroundAV.h:108
Definition: BattlegroundAV.h:153
uint32 m_Mine_Owner[2]
Definition: BattlegroundAV.h:1687
Definition: BattlegroundAV.h:154
Definition: BattlegroundAV.h:107
void BattlegroundAV::ChangeMineOwner ( uint8  mine,
uint32  team,
bool  initial = false 
)
private
Todo:
just set the respawntime to 999999
Todo:
here also
608 {
609  // mine=0 northmine mine=1 southmin
610  // changing the owner results in setting respawntim to infinite for current creatures,
611  // spawning new mine owners creatures and changing the chest-objects so that the current owning team can use them
612  ASSERT(mine == AV_NORTH_MINE || mine == AV_SOUTH_MINE);
613  if (team != ALLIANCE && team != HORDE)
614  team = AV_NEUTRAL_TEAM;
615 
616  if (m_Mine_Owner[mine] == team && !initial)
617  return;
618  m_Mine_PrevOwner[mine] = m_Mine_Owner[mine];
619  m_Mine_Owner[mine] = team;
620 
621  if (!initial)
622  {
623  TC_LOG_DEBUG("bg.battleground", "bg_av depopulating mine %i (0=north, 1=south)", mine);
624  if (mine == AV_SOUTH_MINE)
626  if (!BgCreatures[i].IsEmpty())
627  DelCreature(i);
629  if (!BgCreatures[i].IsEmpty())
630  DelCreature(i);
631  }
632  SendMineWorldStates(mine);
633 
634  TC_LOG_DEBUG("bg.battleground", "bg_av populating mine %i (0=north, 1=south)", mine);
635  uint16 miner;
636  //also neutral team exists.. after a big time, the neutral team tries to conquer the mine
637  if (mine == AV_NORTH_MINE)
638  {
639  if (team == ALLIANCE)
640  miner = AV_NPC_N_MINE_A_1;
641  else if (team == HORDE)
642  miner = AV_NPC_N_MINE_H_1;
643  else
644  miner = AV_NPC_N_MINE_N_1;
645  }
646  else
647  {
648  uint16 cinfo;
649  if (team == ALLIANCE)
650  miner = AV_NPC_S_MINE_A_1;
651  else if (team == HORDE)
652  miner = AV_NPC_S_MINE_H_1;
653  else
654  miner = AV_NPC_S_MINE_N_1;
655  //vermin
656  TC_LOG_DEBUG("bg.battleground", "spawning vermin");
657  if (team == ALLIANCE)
658  cinfo = AV_NPC_S_MINE_A_3;
659  else if (team == HORDE)
660  cinfo = AV_NPC_S_MINE_H_3;
661  else
662  cinfo = AV_NPC_S_MINE_N_S;
664  AddAVCreature(cinfo, i);
665  }
666  for (uint16 i=((mine == AV_NORTH_MINE)?AV_CPLACE_MINE_N_1_MIN:AV_CPLACE_MINE_S_1_MIN); i <= ((mine == AV_NORTH_MINE)?AV_CPLACE_MINE_N_1_MAX:AV_CPLACE_MINE_S_1_MAX); i++)
667  AddAVCreature(miner, i);
668  //the next chooses randomly between 2 cretures
670  AddAVCreature(miner+(urand(1, 2)), i);
671  AddAVCreature(miner+3, (mine == AV_NORTH_MINE)?AV_CPLACE_MINE_N_3:AV_CPLACE_MINE_S_3);
672 
673  if (team == ALLIANCE || team == HORDE)
674  {
676 
677  if (Creature* herold = GetBGCreature(AV_CPLACE_HERALD))
678  {
679  if (mine == AV_NORTH_MINE)
681  else if (mine == AV_SOUTH_MINE)
683  }
684  }
685  else
686  {
687  if (mine == AV_SOUTH_MINE) //i think this gets called all the time
688  {
689  if (Creature* creature = GetBGCreature(AV_CPLACE_MINE_S_3))
690  creature->AI()->Talk(TEXT_SNIVVLE_RANDOM);
691  }
692  }
693  return;
694 }
uint32 m_Mine_Reclaim_Timer[2]
Definition: BattlegroundAV.h:1690
Definition: BattlegroundAV.h:111
Definition: BattlegroundAV.h:594
uint32 m_Mine_PrevOwner[2]
Definition: BattlegroundAV.h:1688
Definition: BattlegroundAV.h:585
Definition: BattlegroundAV.h:108
Definition: BattlegroundAV.h:1536
Definition: BattlegroundAV.h:591
Definition: BattlegroundAV.h:587
Definition: BattlegroundAV.h:1014
Definition: BattlegroundAV.h:1033
Definition: BattlegroundAV.h:1022
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
Definition: Creature.h:467
Definition: BattlegroundAV.h:1035
Creature * AddAVCreature(uint16 cinfoid, uint16 type)
Definition: BattlegroundAV.cpp:273
Definition: BattlegroundAV.h:1528
Definition: BattlegroundAV.h:1037
Definition: SharedDefines.h:1000
Definition: BattlegroundAV.h:1529
Definition: BattlegroundAV.h:582
Definition: BattlegroundAV.h:590
Definition: BattlegroundAV.h:110
Definition: BattlegroundAV.h:1526
GuidVector BgCreatures
Definition: Battleground.h:453
Definition: BattlegroundAV.h:581
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:45
Definition: BattlegroundAV.h:597
uint16_t uint16
Definition: Define.h:151
Definition: BattlegroundAV.h:584
Definition: BattlegroundAV.h:596
uint32 m_Mine_Owner[2]
Definition: BattlegroundAV.h:1687
Definition: BattlegroundAV.h:593
Definition: SharedDefines.h:999
Definition: BattlegroundAV.h:1031
Definition: BattlegroundAV.h:1018
bool DelCreature(uint32 type)
Definition: Battleground.cpp:1640
Definition: BattlegroundAV.h:1527
void SendMineWorldStates(uint32 mine)
Definition: BattlegroundAV.cpp:1070
Definition: BattlegroundAV.h:1030
Definition: BattlegroundAV.h:1026
#define ASSERT
Definition: Errors.h:55
Definition: BattlegroundAV.h:602
Definition: BattlegroundAV.h:599
Creature * GetBGCreature(uint32 type, bool logError=true)
Definition: Battleground.cpp:1549
Definition: BattlegroundAV.h:107

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool BattlegroundAV::CheckAchievementCriteriaMeet ( uint32  criteriaId,
Player const source,
Unit const target = nullptr,
uint32  miscvalue1 = 0 
)
overridevirtual

Reimplemented from Battleground.

1498 {
1499  uint32 team = source->GetTeam();
1500  switch (criteriaId)
1501  {
1503  for (uint8 mine = 0; mine < 2; mine++)
1504  if (m_Mine_Owner[mine] != team)
1505  return false;
1506 
1507  return true;
1509  {
1510  if (team == ALLIANCE)
1511  {
1512  for (BG_AV_Nodes i = BG_AV_NODES_DUNBALDAR_SOUTH; i <= BG_AV_NODES_STONEHEART_BUNKER; ++i) // alliance towers controlled
1513  {
1514  if (m_Nodes[i].State == POINT_CONTROLED)
1515  {
1516  if (m_Nodes[i].Owner != ALLIANCE)
1517  return false;
1518  }
1519  else
1520  return false;
1521  }
1522 
1523  for (BG_AV_Nodes i = BG_AV_NODES_ICEBLOOD_TOWER; i <= BG_AV_NODES_FROSTWOLF_WTOWER; ++i) // horde towers destroyed
1524  if (m_Nodes[i].State != POINT_DESTROYED)
1525  return false;
1526 
1527  if (!m_CaptainAlive[0])
1528  return false;
1529 
1530  return true;
1531  }
1532  else if (team == HORDE)
1533  {
1534  for (BG_AV_Nodes i = BG_AV_NODES_ICEBLOOD_TOWER; i <= BG_AV_NODES_FROSTWOLF_WTOWER; ++i) // horde towers controlled
1535  {
1536  if (m_Nodes[i].State == POINT_CONTROLED)
1537  {
1538  if (m_Nodes[i].Owner != HORDE)
1539  return false;
1540  }
1541  else
1542  return false;
1543  }
1544 
1545  for (BG_AV_Nodes i = BG_AV_NODES_DUNBALDAR_SOUTH; i <= BG_AV_NODES_STONEHEART_BUNKER; ++i) // alliance towers destroyed
1546  if (m_Nodes[i].State != POINT_DESTROYED)
1547  return false;
1548 
1549  if (!m_CaptainAlive[1])
1550  return false;
1551 
1552  return true;
1553  }
1554  }
1555  }
1556 
1557  return Battleground::CheckAchievementCriteriaMeet(criteriaId, source, target, miscValue);
1558 }
Definition: Battleground.h:49
BG_AV_Nodes
Definition: BattlegroundAV.h:160
Definition: BattlegroundAV.h:176
Definition: BattlegroundAV.h:172
Definition: SharedDefines.h:1000
Definition: BattlegroundAV.h:173
Definition: BattlegroundAV.h:169
uint32_t uint32
Definition: Define.h:150
Definition: BattlegroundAV.h:1325
uint32 m_Mine_Owner[2]
Definition: BattlegroundAV.h:1687
Definition: SharedDefines.h:999
uint8_t uint8
Definition: Define.h:152
virtual bool CheckAchievementCriteriaMeet(uint32, Player const *, Unit const *=NULL, uint32=0)
Definition: Battleground.cpp:1939
bool m_CaptainAlive[2]
Definition: BattlegroundAV.h:1692
BG_AV_NodeInfo m_Nodes[BG_AV_NODES_MAX]
Definition: BattlegroundAV.h:1685
Definition: Battleground.h:50
Definition: BattlegroundAV.h:1324

+ Here is the call graph for this function:

void BattlegroundAV::DefendNode ( BG_AV_Nodes  node,
uint16  team 
)
private
1456 {
1457  ASSERT(m_Nodes[node].TotalOwner == team);
1458  ASSERT(m_Nodes[node].Owner != team);
1459  ASSERT(m_Nodes[node].State != POINT_CONTROLED && m_Nodes[node].State != POINT_DESTROYED);
1460  m_Nodes[node].PrevOwner = m_Nodes[node].Owner;
1461  m_Nodes[node].Owner = team;
1462  m_Nodes[node].PrevState = m_Nodes[node].State;
1463  m_Nodes[node].State = POINT_CONTROLED;
1464  m_Nodes[node].Timer = 0;
1465 }
uint16 Owner
Definition: BattlegroundAV.h:1545
uint16 PrevOwner
Definition: BattlegroundAV.h:1546
BG_AV_States State
Definition: BattlegroundAV.h:1541
Definition: BattlegroundAV.h:1325
BG_AV_States PrevState
Definition: BattlegroundAV.h:1542
#define ASSERT
Definition: Errors.h:55
uint32 Timer
Definition: BattlegroundAV.h:1543
BG_AV_NodeInfo m_Nodes[BG_AV_NODES_MAX]
Definition: BattlegroundAV.h:1685
Definition: BattlegroundAV.h:1324

+ Here is the caller graph for this function:

void BattlegroundAV::DePopulateNode ( BG_AV_Nodes  node)
private
760 {
761  uint32 c_place = AV_CPLACE_DEFENSE_STORM_AID + (4 * node);
762  for (uint8 i = 0; i < 4; i++)
763  if (!BgCreatures[c_place + i].IsEmpty())
764  DelCreature(c_place + i);
765  //spiritguide
766  if (!IsTower(node) && !BgCreatures[node].IsEmpty())
767  DelCreature(node);
768 
769  //remove bonus honor aura trigger creature when node is lost
770  if (node < BG_AV_NODES_MAX)//fail safe
771  DelCreature(node + 302);//NULL checks are in DelCreature! 0-302 spirit guides
772 }
Definition: BattlegroundAV.h:554
GuidVector BgCreatures
Definition: Battleground.h:453
bool IsTower(BG_AV_Nodes node)
Definition: BattlegroundAV.h:1668
uint32_t uint32
Definition: Define.h:150
bool DelCreature(uint32 type)
Definition: Battleground.cpp:1640
uint8_t uint8
Definition: Define.h:152
Definition: BattlegroundAV.h:178

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void BattlegroundAV::DestroyNode ( BG_AV_Nodes  node)
private
1433 {
1434  ASSERT(m_Nodes[node].State == POINT_ASSAULTED);
1435 
1436  m_Nodes[node].TotalOwner = m_Nodes[node].Owner;
1437  m_Nodes[node].PrevOwner = m_Nodes[node].Owner;
1438  m_Nodes[node].PrevState = m_Nodes[node].State;
1440  m_Nodes[node].Timer = 0;
1441 }
Definition: BattlegroundAV.h:1323
uint16 Owner
Definition: BattlegroundAV.h:1545
uint16 PrevOwner
Definition: BattlegroundAV.h:1546
BG_AV_States State
Definition: BattlegroundAV.h:1541
Definition: BattlegroundAV.h:1325
bool Tower
Definition: BattlegroundAV.h:1547
BG_AV_States PrevState
Definition: BattlegroundAV.h:1542
uint16 TotalOwner
Definition: BattlegroundAV.h:1544
#define ASSERT
Definition: Errors.h:55
uint32 Timer
Definition: BattlegroundAV.h:1543
BG_AV_NodeInfo m_Nodes[BG_AV_NODES_MAX]
Definition: BattlegroundAV.h:1685
Definition: BattlegroundAV.h:1324

+ Here is the caller graph for this function:

void BattlegroundAV::EndBattleground ( uint32  winner)
overridevirtual
Todo:
add enterevademode for all attacking creatures

Reimplemented from Battleground.

442 {
443  //calculate bonuskills for both teams:
444  //first towers:
445  uint8 kills[2] = {0, 0}; // 0 = Alliance 1 = Horde
446  uint8 rep[2] = {0, 0}; // 0 = Alliance 1 = Horde
448  {
449  if (m_Nodes[i].State == POINT_CONTROLED)
450  {
451  if (m_Nodes[i].Owner == ALLIANCE)
452  {
453  rep[0] += BG_AV_REP_SURVIVING_TOWER;
454  kills[0] += BG_AV_KILL_SURVIVING_TOWER;
455  }
456  else
457  {
458  rep[0] += BG_AV_KILL_SURVIVING_TOWER;
459  kills[1] += BG_AV_KILL_SURVIVING_TOWER;
460  }
461  }
462  }
463 
464  for (int i = TEAM_ALLIANCE; i <= TEAM_HORDE; ++i)
465  {
466  if (m_CaptainAlive[i])
467  {
468  kills[i] += BG_AV_KILL_SURVIVING_CAPTAIN;
469  rep[i] += BG_AV_REP_SURVIVING_CAPTAIN;
470  }
471  if (rep[i] != 0)
472  RewardReputationToTeam(i == 0 ? 730 : 729, rep[i], i == 0 ? ALLIANCE : HORDE);
473  if (kills[i] != 0)
474  RewardHonorToTeam(GetBonusHonorFromKill(kills[i]), i == 0 ? ALLIANCE : HORDE);
475  }
476 
479 }
BG_AV_Nodes
Definition: BattlegroundAV.h:160
void RewardReputationToTeam(uint32 faction_id, uint32 Reputation, uint32 TeamID)
Definition: Battleground.cpp:716
uint32 GetBonusHonorFromKill(uint32 kills) const
Definition: Battleground.cpp:907
Definition: BattlegroundAV.h:176
#define BG_AV_KILL_SURVIVING_TOWER
Definition: BattlegroundAV.h:45
Definition: SharedDefines.h:1000
Definition: BattlegroundAV.h:169
#define BG_AV_REP_SURVIVING_TOWER
Definition: BattlegroundAV.h:46
Definition: SharedDefines.h:992
#define BG_AV_KILL_SURVIVING_CAPTAIN
Definition: BattlegroundAV.h:48
Definition: BattlegroundAV.h:1325
void RewardHonorToTeam(uint32 Honor, uint32 TeamID)
Definition: Battleground.cpp:709
Definition: SharedDefines.h:999
uint8_t uint8
Definition: Define.h:152
virtual void EndBattleground(uint32 winner)
Definition: Battleground.cpp:744
bool m_CaptainAlive[2]
Definition: BattlegroundAV.h:1692
BG_AV_NodeInfo m_Nodes[BG_AV_NODES_MAX]
Definition: BattlegroundAV.h:1685
Definition: SharedDefines.h:993
#define BG_AV_REP_SURVIVING_CAPTAIN
Definition: BattlegroundAV.h:49

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void BattlegroundAV::EventPlayerAssaultsPoint ( Player player,
uint32  object 
)
private
931 {
933 
934  BG_AV_Nodes node = GetNodeThroughObject(object);
935  uint32 owner = m_Nodes[node].Owner; //maybe name it prevowner
936  uint32 team = player->GetTeam();
937  TC_LOG_DEBUG("bg.battleground", "bg_av: player assaults point object %i node %i", object, node);
938  if (owner == team || team == m_Nodes[node].TotalOwner)
939  return; //surely a gm used this object
940 
941  if (node == BG_AV_NODES_SNOWFALL_GRAVE) //snowfall is a bit special in capping + it gets eyecandy stuff
942  {
943  if (object == BG_AV_OBJECT_FLAG_N_SNOWFALL_GRAVE) //initial capping
944  {
945  if (!(owner == AV_NEUTRAL_TEAM && m_Nodes[node].TotalOwner == AV_NEUTRAL_TEAM))
946  return;
947 
948  if (team == ALLIANCE)
950  else
953  }
954  else if (m_Nodes[node].TotalOwner == AV_NEUTRAL_TEAM) //recapping, when no team owns this node realy
955  {
956  if (!(m_Nodes[node].State != POINT_CONTROLED))
957  return;
958 
959  if (team == ALLIANCE)
961  else
963  }
964  //eyecandy
965  uint32 spawn, despawn;
966  if (team == ALLIANCE)
967  {
970  }
971  else
972  {
975  }
976  for (uint8 i = 0; i < 4; i++)
977  {
978  SpawnBGObject(despawn+i, RESPAWN_ONE_DAY);
980  }
981  }
982 
983  //if snowfall gots capped it can be handled like all other graveyards
984  if (m_Nodes[node].TotalOwner != AV_NEUTRAL_TEAM)
985  {
986  ASSERT(m_Nodes[node].Owner != AV_NEUTRAL_TEAM);
987  if (team == ALLIANCE)
989  else
991  if (IsTower(node))
992  { //spawning/despawning of bigflag+aura
997  }
998  else
999  {
1000  //spawning/despawning of aura
1003 
1005  }
1006  DePopulateNode(node);
1007  }
1008 
1009  SpawnBGObject(object, RESPAWN_ONE_DAY); //delete old banner
1010  AssaultNode(node, team);
1011  UpdateNodeWorldState(node);
1012 
1013  if (StaticNodeInfo const* nodeInfo = GetStaticNodeInfo(node))
1014  if (Creature* herold = GetBGCreature(AV_CPLACE_HERALD))
1015  herold->AI()->Talk(team == ALLIANCE ? nodeInfo->TextIds.AllianceAttack : nodeInfo->TextIds.HordeAttack);
1016 
1017  // update the statistic for the assaulting player
1019 }
Definition: BattlegroundAV.h:302
Definition: BattlegroundAV.h:1323
BG_AV_Nodes
Definition: BattlegroundAV.h:160
Definition: Battleground.h:159
Definition: Battleground.h:129
void RelocateDeadPlayers(ObjectGuid guideGuid)
Relocate all players in ReviveQueue to the closest graveyard.
Definition: Battleground.cpp:1423
bool UpdatePlayerScore(Player *player, uint32 type, uint32 value, bool doAddHonor=true) override
Definition: BattlegroundAV.cpp:528
Definition: BattlegroundAV.h:236
Definition: BattlegroundAV.h:111
uint16 Owner
Definition: BattlegroundAV.h:1545
Definition: BattlegroundAV.h:276
BattlegroundStatus GetStatus() const
Definition: Battleground.h:266
Definition: BattlegroundAV.h:210
void SpawnBGObject(uint32 type, uint32 respawntime)
Definition: Battleground.cpp:1564
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
void AssaultNode(BG_AV_Nodes node, uint16 team)
Definition: BattlegroundAV.cpp:1402
Definition: Creature.h:467
Definition: BattlegroundAV.h:275
static TeamId GetTeamIndexByTeamId(uint32 Team)
Definition: Battleground.h:399
Definition: BattlegroundAV.h:198
void UpdateNodeWorldState(BG_AV_Nodes node)
Definition: BattlegroundAV.cpp:1053
Definition: SharedDefines.h:1000
Definition: BattlegroundAV.h:237
void DePopulateNode(BG_AV_Nodes node)
Definition: BattlegroundAV.cpp:759
GuidVector BgCreatures
Definition: Battleground.h:453
Definition: BattlegroundAV.h:169
bool IsTower(BG_AV_Nodes node)
Definition: BattlegroundAV.h:1668
uint32_t uint32
Definition: Define.h:150
Definition: BattlegroundAV.h:303
BG_AV_States State
Definition: BattlegroundAV.h:1541
Definition: BattlegroundAV.h:304
Definition: BattlegroundScore.h:45
Definition: Battleground.h:128
Definition: BattlegroundAV.h:1325
Definition: BattlegroundAV.h:165
Definition: SharedDefines.h:999
Definition: BattlegroundAV.h:259
StaticNodeInfo const * GetStaticNodeInfo(BG_AV_Nodes node) const
Definition: BattlegroundAV.h:1658
Definition: BattlegroundScore.h:43
uint8_t uint8
Definition: Define.h:152
#define ASSERT
Definition: Errors.h:55
Definition: BattlegroundAV.h:260
Definition: BattlegroundAV.h:602
Definition: BattlegroundAV.h:231
Creature * GetBGCreature(uint32 type, bool logError=true)
Definition: Battleground.cpp:1549
Definition: BattlegroundAV.h:1482
BG_AV_NodeInfo m_Nodes[BG_AV_NODES_MAX]
Definition: BattlegroundAV.h:1685
Definition: BattlegroundAV.h:305
BG_AV_Nodes GetNodeThroughObject(uint32 object)
Definition: BattlegroundAV.cpp:774

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void BattlegroundAV::EventPlayerClickedOnFlag ( Player source,
GameObject target_obj 
)
overridevirtual

Reimplemented from Battleground.

837 {
838  if (GetStatus() != STATUS_IN_PROGRESS)
839  return;
840  int32 object = GetObjectType(target_obj->GetGUID());
841  TC_LOG_DEBUG("bg.battleground", "BG_AV using gameobject %i with type %i", target_obj->GetEntry(), object);
842  if (object < 0)
843  return;
844  switch (target_obj->GetEntry())
845  {
851  EventPlayerAssaultsPoint(source, object);
852  break;
857  EventPlayerDefendsPoint(source, object);
858  break;
859  default:
860  break;
861  }
862 }
Definition: Battleground.h:159
Definition: BattlegroundAV.h:121
Definition: BattlegroundAV.h:123
BattlegroundStatus GetStatus() const
Definition: Battleground.h:266
void EventPlayerDefendsPoint(Player *player, uint32 object)
Definition: BattlegroundAV.cpp:864
Definition: BattlegroundAV.h:118
Definition: BattlegroundAV.h:127
Definition: BattlegroundAV.h:119
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
int32 GetObjectType(ObjectGuid guid)
Definition: Battleground.cpp:1880
Definition: BattlegroundAV.h:120
int32_t int32
Definition: Define.h:146
void EventPlayerAssaultsPoint(Player *player, uint32 object)
Definition: BattlegroundAV.cpp:930
ObjectGuid const & GetGUID() const
Definition: Object.h:105
Definition: BattlegroundAV.h:125
Definition: BattlegroundAV.h:124
Definition: BattlegroundAV.h:126
uint32 GetEntry() const
Definition: Object.h:107

+ Here is the call graph for this function:

void BattlegroundAV::EventPlayerDefendsPoint ( Player player,
uint32  object 
)
private
865 {
867  BG_AV_Nodes node = GetNodeThroughObject(object);
868 
869  uint32 owner = m_Nodes[node].Owner; //maybe should name it prevowner
870  uint32 team = player->GetTeam();
871 
872  if (owner == player->GetTeam() || m_Nodes[node].State != POINT_ASSAULTED)
873  return;
874  if (m_Nodes[node].TotalOwner == AV_NEUTRAL_TEAM)
875  { //until snowfall doesn't belong to anyone it is better handled in assault-code
876  ASSERT(node == BG_AV_NODES_SNOWFALL_GRAVE); //currently the only neutral grave
877  EventPlayerAssaultsPoint(player, object);
878  return;
879  }
880  TC_LOG_DEBUG("bg.battleground", "player defends point object: %i node: %i", object, node);
881  if (m_Nodes[node].PrevOwner != team)
882  {
883  TC_LOG_ERROR("bg.battleground", "BG_AV: player defends point which doesn't belong to his team %i", node);
884  return;
885  }
886 
887  //spawn new go :)
888  if (m_Nodes[node].Owner == ALLIANCE)
889  SpawnBGObject(object+22, RESPAWN_IMMEDIATELY); //spawn horde banner
890  else
891  SpawnBGObject(object-22, RESPAWN_IMMEDIATELY); //spawn alliance banner
892 
893  if (!IsTower(node))
894  {
897  }
898  // despawn old go
900 
901  DefendNode(node, team);
902  PopulateNode(node);
903  UpdateNodeWorldState(node);
904 
905  if (IsTower(node))
906  {
907  //spawn big flag+aura on top of tower
912  }
913  else if (node == BG_AV_NODES_SNOWFALL_GRAVE) //snowfall eyecandy
914  {
915  for (uint8 i = 0; i < 4; i++)
916  {
919  }
920  }
921 
922  if (StaticNodeInfo const* nodeInfo = GetStaticNodeInfo(node))
923  if (Creature* herold = GetBGCreature(AV_CPLACE_HERALD))
924  herold->AI()->Talk(team == ALLIANCE ? nodeInfo->TextIds.AllianceCapture : nodeInfo->TextIds.HordeCapture);
925 
926  // update the statistic for the defending player
928 }
Definition: BattlegroundAV.h:302
Definition: BattlegroundAV.h:1323
BG_AV_Nodes
Definition: BattlegroundAV.h:160
Definition: Battleground.h:159
Definition: Battleground.h:129
bool UpdatePlayerScore(Player *player, uint32 type, uint32 value, bool doAddHonor=true) override
Definition: BattlegroundAV.cpp:528
Definition: BattlegroundAV.h:236
void PopulateNode(BG_AV_Nodes node)
Definition: BattlegroundAV.cpp:705
Definition: BattlegroundAV.h:111
uint16 Owner
Definition: BattlegroundAV.h:1545
Definition: BattlegroundAV.h:276
BattlegroundStatus GetStatus() const
Definition: Battleground.h:266
void SpawnBGObject(uint32 type, uint32 respawntime)
Definition: Battleground.cpp:1564
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
Definition: Creature.h:467
Definition: BattlegroundScore.h:46
Definition: BattlegroundAV.h:275
static TeamId GetTeamIndexByTeamId(uint32 Team)
Definition: Battleground.h:399
void UpdateNodeWorldState(BG_AV_Nodes node)
Definition: BattlegroundAV.cpp:1053
Definition: BattlegroundScore.h:44
Definition: SharedDefines.h:1000
Definition: BattlegroundAV.h:237
Definition: BattlegroundAV.h:169
bool IsTower(BG_AV_Nodes node)
Definition: BattlegroundAV.h:1668
uint32_t uint32
Definition: Define.h:150
Definition: BattlegroundAV.h:303
BG_AV_States State
Definition: BattlegroundAV.h:1541
Definition: BattlegroundAV.h:304
Definition: Battleground.h:128
Definition: BattlegroundAV.h:165
Definition: SharedDefines.h:999
void EventPlayerAssaultsPoint(Player *player, uint32 object)
Definition: BattlegroundAV.cpp:930
Definition: BattlegroundAV.h:259
StaticNodeInfo const * GetStaticNodeInfo(BG_AV_Nodes node) const
Definition: BattlegroundAV.h:1658
void DefendNode(BG_AV_Nodes node, uint16 team)
Definition: BattlegroundAV.cpp:1455
uint8_t uint8
Definition: Define.h:152
#define ASSERT
Definition: Errors.h:55
Definition: BattlegroundAV.h:260
Definition: BattlegroundAV.h:602
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207
Creature * GetBGCreature(uint32 type, bool logError=true)
Definition: Battleground.cpp:1549
Definition: BattlegroundAV.h:1482
BG_AV_NodeInfo m_Nodes[BG_AV_NODES_MAX]
Definition: BattlegroundAV.h:1685
Definition: BattlegroundAV.h:305
BG_AV_Nodes GetNodeThroughObject(uint32 object)
Definition: BattlegroundAV.cpp:774

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void BattlegroundAV::EventPlayerDestroyedPoint ( BG_AV_Nodes  node)
private
554 {
555  uint32 object = GetObjectThroughNode(node);
556  TC_LOG_DEBUG("bg.battleground", "bg_av: player destroyed point node %i object %i", node, object);
557 
558  //despawn banner
560  DestroyNode(node);
561  UpdateNodeWorldState(node);
562 
563  uint32 owner = m_Nodes[node].Owner;
564  if (IsTower(node))
565  {
567  //despawn marshal
568  if (!BgCreatures[AV_CPLACE_A_MARSHAL_SOUTH + tmp].IsEmpty())
570  else
571  TC_LOG_ERROR("bg.battleground", "BG_AV: playerdestroyedpoint: marshal %i doesn't exist", AV_CPLACE_A_MARSHAL_SOUTH + tmp);
572  //spawn destroyed aura
573  for (uint8 i=0; i <= 9; i++)
575 
576  UpdateScore((owner == ALLIANCE) ? HORDE : ALLIANCE, -1 * BG_AV_RES_TOWER);
577  RewardReputationToTeam(owner == ALLIANCE ? 730 : 729, BG_AV_REP_TOWER, owner);
579 
582  }
583  else
584  {
585  if (owner == ALLIANCE)
587  else
591  PopulateNode(node);
592  if (node == BG_AV_NODES_SNOWFALL_GRAVE) //snowfall eyecandy
593  {
594  for (uint8 i = 0; i < 4; i++)
595  {
598  }
599  }
600  }
601 
602  if (StaticNodeInfo const* nodeInfo = GetStaticNodeInfo(node))
603  if (Creature* herold = GetBGCreature(AV_CPLACE_HERALD))
604  herold->AI()->Talk(owner == ALLIANCE ? nodeInfo->TextIds.AllianceCapture : nodeInfo->TextIds.HordeCapture);
605 }
Definition: BattlegroundAV.h:302
Definition: Battleground.h:129
Definition: BattlegroundAV.h:236
void PopulateNode(BG_AV_Nodes node)
Definition: BattlegroundAV.cpp:705
void RewardReputationToTeam(uint32 faction_id, uint32 Reputation, uint32 TeamID)
Definition: Battleground.cpp:716
uint32 GetBonusHonorFromKill(uint32 kills) const
Definition: Battleground.cpp:907
uint16 Owner
Definition: BattlegroundAV.h:1545
void SpawnBGObject(uint32 type, uint32 respawntime)
Definition: Battleground.cpp:1564
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
Definition: Creature.h:467
void DestroyNode(BG_AV_Nodes node)
Definition: BattlegroundAV.cpp:1432
Definition: BattlegroundAV.h:275
Definition: BattlegroundAV.h:571
Definition: BattlegroundAV.h:292
static TeamId GetTeamIndexByTeamId(uint32 Team)
Definition: Battleground.h:399
#define BG_AV_REP_TOWER
Definition: BattlegroundAV.h:40
void UpdateNodeWorldState(BG_AV_Nodes node)
Definition: BattlegroundAV.cpp:1053
Definition: SharedDefines.h:1000
Definition: BattlegroundAV.h:237
void UpdateScore(uint16 team, int16 points)
Definition: BattlegroundAV.cpp:250
GuidVector BgCreatures
Definition: Battleground.h:453
Definition: BattlegroundAV.h:169
bool IsTower(BG_AV_Nodes node)
Definition: BattlegroundAV.h:1668
uint32_t uint32
Definition: Define.h:150
Definition: BattlegroundAV.h:303
Definition: BattlegroundAV.h:304
Definition: Battleground.h:128
Definition: BattlegroundAV.h:165
void RewardHonorToTeam(uint32 Honor, uint32 TeamID)
Definition: Battleground.cpp:709
Definition: SharedDefines.h:999
bool DelCreature(uint32 type)
Definition: Battleground.cpp:1640
Definition: BattlegroundAV.h:259
#define BG_AV_RES_TOWER
Definition: BattlegroundAV.h:41
StaticNodeInfo const * GetStaticNodeInfo(BG_AV_Nodes node) const
Definition: BattlegroundAV.h:1658
uint8_t uint8
Definition: Define.h:152
uint32 GetObjectThroughNode(BG_AV_Nodes node)
Definition: BattlegroundAV.cpp:796
Definition: BattlegroundAV.h:602
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207
#define BG_AV_KILL_TOWER
Definition: BattlegroundAV.h:39
Creature * GetBGCreature(uint32 type, bool logError=true)
Definition: Battleground.cpp:1549
Definition: BattlegroundAV.h:1482
BG_AV_NodeInfo m_Nodes[BG_AV_NODES_MAX]
Definition: BattlegroundAV.h:1685
Definition: BattlegroundAV.h:305

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void BattlegroundAV::FillInitialWorldStates ( WorldPackets::WorldState::InitWorldStates packet)
overrideprivatevirtual

Reimplemented from Battleground.

1022 {
1024  {
1025  uint16 owner = m_Nodes[i].Owner;
1026  BG_AV_States state = m_Nodes[i].State;
1027 
1028  packet.Worldstates.emplace_back(uint32(BGAVNodeInfo[i].WorldStateIds.AllianceAssault), int32(owner == ALLIANCE && state == POINT_ASSAULTED));
1029  packet.Worldstates.emplace_back(uint32(BGAVNodeInfo[i].WorldStateIds.AllianceControl), int32(owner == ALLIANCE && state >= POINT_DESTROYED));
1030  packet.Worldstates.emplace_back(uint32(BGAVNodeInfo[i].WorldStateIds.HordeAssault), int32(owner == HORDE && state == POINT_ASSAULTED));
1031  packet.Worldstates.emplace_back(uint32(BGAVNodeInfo[i].WorldStateIds.HordeControl), int32(owner == HORDE && state >= POINT_DESTROYED));
1032  }
1033 
1035 
1036  packet.Worldstates.emplace_back(uint32(AV_Alliance_Score), int32(m_Team_Scores[0]));
1037  packet.Worldstates.emplace_back(uint32(AV_Horde_Score), int32(m_Team_Scores[1]));
1038 
1039  if (GetStatus() == STATUS_IN_PROGRESS){ //only if game started the teamscores are displayed
1040  packet.Worldstates.emplace_back(uint32(AV_SHOW_A_SCORE), 1);
1041  packet.Worldstates.emplace_back(uint32(AV_SHOW_H_SCORE), 1);
1042  }
1043  else
1044  {
1045  packet.Worldstates.emplace_back(uint32(AV_SHOW_A_SCORE), 0);
1046  packet.Worldstates.emplace_back(uint32(AV_SHOW_H_SCORE), 0);
1047  }
1048 
1051 }
Definition: BattlegroundAV.h:1323
Definition: Battleground.h:159
Definition: BattlegroundAV.h:1359
Definition: BattlegroundAV.h:111
uint16 Owner
Definition: BattlegroundAV.h:1545
Definition: BattlegroundAV.h:162
Definition: BattlegroundAV.h:108
BattlegroundStatus GetStatus() const
Definition: Battleground.h:266
std::list< WorldStateInfo > Worldstates
Definition: WorldStatePackets.h:47
uint32 HordeAssault
Definition: BattlegroundAV.h:1499
WorldStateIds
Definition: hyjal.h:51
Definition: SharedDefines.h:1000
int32 m_Team_Scores[2]
Definition: BattlegroundAV.h:1682
uint32 HordeControl
Definition: BattlegroundAV.h:1498
uint32 AllianceControl
Definition: BattlegroundAV.h:1496
int32_t int32
Definition: Define.h:146
Definition: BattlegroundAV.h:1330
BG_AV_States State
Definition: BattlegroundAV.h:1541
uint16_t uint16
Definition: Define.h:151
Definition: BattlegroundAV.h:1331
BG_AV_States
Definition: BattlegroundAV.h:1320
Definition: BattlegroundAV.h:165
Definition: SharedDefines.h:999
void SendMineWorldStates(uint32 mine)
Definition: BattlegroundAV.cpp:1070
uint32 AllianceAssault
Definition: BattlegroundAV.h:1497
int32_t int32
Definition: g3dmath.h:167
Definition: BattlegroundAV.h:1332
uint8_t uint8
Definition: Define.h:152
Definition: BattlegroundAV.h:1333
uint32_t uint32
Definition: g3dmath.h:168
BG_AV_NodeInfo m_Nodes[BG_AV_NODES_MAX]
Definition: BattlegroundAV.h:1685
static StaticNodeInfo const BGAVNodeInfo[]
Definition: BattlegroundAV.h:1503
Definition: BattlegroundAV.h:178
Definition: BattlegroundAV.h:107
Definition: BattlegroundAV.h:1324

+ Here is the call graph for this function:

WorldSafeLocsEntry const * BattlegroundAV::GetClosestGraveYard ( Player player)
overridevirtual

Reimplemented from Battleground.

1098 {
1099  WorldSafeLocsEntry const* pGraveyard = NULL;
1100  WorldSafeLocsEntry const* entry = NULL;
1101  float dist = 0;
1102  float minDist = 0;
1103  float x, y;
1104 
1105  player->GetPosition(x, y);
1106 
1107  pGraveyard = sWorldSafeLocsStore.LookupEntry(BG_AV_GraveyardIds[GetTeamIndexByTeamId(player->GetTeam())+7]);
1108  minDist = (pGraveyard->Loc.X - x)*(pGraveyard->Loc.X - x)+(pGraveyard->Loc.Y - y)*(pGraveyard->Loc.Y - y);
1109 
1111  if (m_Nodes[i].Owner == player->GetTeam() && m_Nodes[i].State == POINT_CONTROLED)
1112  {
1113  entry = sWorldSafeLocsStore.LookupEntry(BG_AV_GraveyardIds[i]);
1114  if (entry)
1115  {
1116  dist = (entry->Loc.X - x)*(entry->Loc.X - x)+(entry->Loc.Y - y)*(entry->Loc.Y - y);
1117  if (dist < minDist)
1118  {
1119  minDist = dist;
1120  pGraveyard = entry;
1121  }
1122  }
1123  }
1124  return pGraveyard;
1125 }
float Y
Definition: DBCEnums.h:35
DBCStorage< WorldSafeLocsEntry > sWorldSafeLocsStore(WorldSafeLocsfmt)
Definition: BattlegroundAV.h:162
Definition: DBCStructure.h:1434
arena_t NULL
Definition: jemalloc_internal.h:624
static TeamId GetTeamIndexByTeamId(uint32 Team)
Definition: Battleground.h:399
Definition: BattlegroundAV.h:168
G3D::int16 y
Definition: Vector2int16.h:38
BG_AV_States State
Definition: BattlegroundAV.h:1541
Definition: BattlegroundAV.h:1325
float X
Definition: DBCEnums.h:34
DBCPosition3D Loc
Definition: DBCStructure.h:1438
const uint32 BG_AV_GraveyardIds[9]
Definition: BattlegroundAV.h:1301
uint8_t uint8
Definition: Define.h:152
G3D::int16 x
Definition: Vector2int16.h:37
BG_AV_NodeInfo m_Nodes[BG_AV_NODES_MAX]
Definition: BattlegroundAV.h:1685

+ Here is the call graph for this function:

BG_AV_Nodes BattlegroundAV::GetNodeThroughObject ( uint32  object)
private
775 {
776  TC_LOG_DEBUG("bg.battleground", "bg_AV getnodethroughobject %i", object);
778  return BG_AV_Nodes(object);
780  return BG_AV_Nodes(object - 11);
782  return BG_AV_Nodes(object - 7);
784  return BG_AV_Nodes(object -22);
785  if (object <= BG_AV_OBJECT_FLAG_H_FROSTWOLF_HUT)
786  return BG_AV_Nodes(object - 33);
788  return BG_AV_Nodes(object - 29);
791  TC_LOG_ERROR("bg.battleground", "BattlegroundAV: ERROR! GetPlace got a wrong object :(");
792  ABORT();
793  return BG_AV_Nodes(0);
794 }
BG_AV_Nodes
Definition: BattlegroundAV.h:160
Definition: BattlegroundAV.h:201
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
Definition: BattlegroundAV.h:229
Definition: BattlegroundAV.h:225
Definition: BattlegroundAV.h:165
Definition: BattlegroundAV.h:193
Definition: BattlegroundAV.h:217
#define ABORT
Definition: Errors.h:56
Definition: BattlegroundAV.h:205
Definition: BattlegroundAV.h:231
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207

+ Here is the caller graph for this function:

uint32 BattlegroundAV::GetObjectThroughNode ( BG_AV_Nodes  node)
private
797 { //this function is the counterpart to GetNodeThroughObject()
798  TC_LOG_DEBUG("bg.battleground", "bg_AV GetObjectThroughNode %i", node);
799  if (m_Nodes[node].Owner == ALLIANCE)
800  {
801  if (m_Nodes[node].State == POINT_ASSAULTED)
802  {
803  if (node <= BG_AV_NODES_FROSTWOLF_HUT)
804  return node+11;
806  return node+7;
807  }
808  else if (m_Nodes[node].State == POINT_CONTROLED)
809  if (node <= BG_AV_NODES_STONEHEART_BUNKER)
810  return node;
811  }
812  else if (m_Nodes[node].Owner == HORDE)
813  {
814  if (m_Nodes[node].State == POINT_ASSAULTED)
815  {
816  if (node <= BG_AV_NODES_STONEHEART_BUNKER)
817  return node+22;
818  }
819  else if (m_Nodes[node].State == POINT_CONTROLED)
820  {
821  if (node <= BG_AV_NODES_FROSTWOLF_HUT)
822  return node+33;
824  return node+29;
825  }
826  }
827  else if (m_Nodes[node].Owner == AV_NEUTRAL_TEAM)
829  TC_LOG_ERROR("bg.battleground", "BattlegroundAV: Error! GetPlaceNode couldn't resolve node %i", node);
830  ABORT();
831  return 0;
832 }
Definition: BattlegroundAV.h:1323
Definition: BattlegroundAV.h:111
Definition: BattlegroundAV.h:176
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
Definition: BattlegroundAV.h:172
Definition: SharedDefines.h:1000
Definition: BattlegroundAV.h:173
Definition: BattlegroundAV.h:168
Definition: BattlegroundAV.h:1325
Definition: SharedDefines.h:999
#define ABORT
Definition: Errors.h:56
Definition: BattlegroundAV.h:231
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207
BG_AV_NodeInfo m_Nodes[BG_AV_NODES_MAX]
Definition: BattlegroundAV.h:1685

+ Here is the caller graph for this function:

uint32 BattlegroundAV::GetPrematureWinner ( )
overridevirtual

Reimplemented from Battleground.

1561 {
1564 
1565  if (allianceScore > hordeScore)
1566  return ALLIANCE;
1567  else if (hordeScore > allianceScore)
1568  return HORDE;
1569 
1571 }
virtual uint32 GetPrematureWinner()
Definition: Battleground.cpp:405
static TeamId GetTeamIndexByTeamId(uint32 Team)
Definition: Battleground.h:399
Definition: SharedDefines.h:1000
int32 m_Team_Scores[2]
Definition: BattlegroundAV.h:1682
uint32_t uint32
Definition: Define.h:150
Definition: SharedDefines.h:999

+ Here is the call graph for this function:

StaticNodeInfo const* BattlegroundAV::GetStaticNodeInfo ( BG_AV_Nodes  node) const
inlineprivate
1659  {
1660  for (uint8 i = 0; i < BG_AV_NODES_MAX; ++i)
1661  if (BGAVNodeInfo[i].NodeId == node)
1662  return &BGAVNodeInfo[i];
1663  return nullptr;
1664  }
uint8_t uint8
Definition: Define.h:152
static StaticNodeInfo const BGAVNodeInfo[]
Definition: BattlegroundAV.h:1503
Definition: BattlegroundAV.h:178

+ Here is the caller graph for this function:

void BattlegroundAV::HandleAreaTrigger ( Player player,
uint32  trigger,
bool  entered 
)
overridevirtual

Reimplemented from Battleground.

495 {
496  if (GetStatus() != STATUS_IN_PROGRESS)
497  return;
498 
499  switch (trigger)
500  {
501  case 95:
502  case 2608:
503  if (player->GetTeam() != ALLIANCE)
504  player->GetSession()->SendNotification("Only The Alliance can use that portal");
505  else
506  player->LeaveBattleground();
507  break;
508  case 2606:
509  if (player->GetTeam() != HORDE)
510  player->GetSession()->SendNotification("Only The Horde can use that portal");
511  else
512  player->LeaveBattleground();
513  break;
514  case 3326:
515  case 3327:
516  case 3328:
517  case 3329:
518  case 3330:
519  case 3331:
520  //Source->Unmount();
521  break;
522  default:
523  Battleground::HandleAreaTrigger(player, trigger, entered);
524  break;
525  }
526 }
Definition: Battleground.h:159
BattlegroundStatus GetStatus() const
Definition: Battleground.h:266
Definition: SharedDefines.h:1000
Definition: SharedDefines.h:999
virtual void HandleAreaTrigger(Player *, uint32, bool)
Definition: Battleground.cpp:1933

+ Here is the call graph for this function:

void BattlegroundAV::HandleKillPlayer ( Player player,
Player killer 
)
overridevirtual

Reimplemented from Battleground.

62 {
64  return;
65 
66  Battleground::HandleKillPlayer(player, killer);
67  UpdateScore(player->GetTeam(), -1);
68 }
Definition: Battleground.h:159
virtual void HandleKillPlayer(Player *player, Player *killer)
Definition: Battleground.cpp:1784
BattlegroundStatus GetStatus() const
Definition: Battleground.h:266
void UpdateScore(uint16 team, int16 points)
Definition: BattlegroundAV.cpp:250

+ Here is the call graph for this function:

void BattlegroundAV::HandleKillUnit ( Creature unit,
Player killer 
)
overridevirtual

Reimplemented from Battleground.

71 {
72  TC_LOG_DEBUG("bg.battleground", "bg_av HandleKillUnit %i", unit->GetEntry());
74  return;
75  uint32 entry = unit->GetEntry();
76  /*
77  uint32 triggerSpawnID = 0;
78  if (creature->GetEntry() == BG_AV_CreatureInfo[AV_NPC_A_CAPTAIN][0])
79  triggerSpawnID = AV_CPLACE_TRIGGER16;
80  else if (creature->GetEntry() == BG_AV_CreatureInfo[AV_NPC_A_BOSS][0])
81  triggerSpawnID = AV_CPLACE_TRIGGER17;
82  else if (creature->GetEntry() == BG_AV_CreatureInfo[AV_NPC_H_CAPTAIN][0])
83  triggerSpawnID = AV_CPLACE_TRIGGER18;
84  else if (creature->GetEntry() == BG_AV_CreatureInfo[AV_NPC_H_BOSS][0])
85  triggerSpawnID = AV_CPLACE_TRIGGER19;
86  */
87  if (entry == BG_AV_CreatureInfo[AV_NPC_A_BOSS])
88  {
89  CastSpellOnTeam(23658, HORDE); //this is a spell which finishes a quest where a player has to kill the boss
94  }
95  else if (entry == BG_AV_CreatureInfo[AV_NPC_H_BOSS])
96  {
97  CastSpellOnTeam(23658, ALLIANCE); //this is a spell which finishes a quest where a player has to kill the boss
102  }
103  else if (entry == BG_AV_CreatureInfo[AV_NPC_A_CAPTAIN])
104  {
105  if (!m_CaptainAlive[0])
106  {
107  TC_LOG_ERROR("bg.battleground", "Killed a Captain twice, please report this bug, if you haven't done \".respawn\"");
108  return;
109  }
110  m_CaptainAlive[0]=false;
114  //spawn destroyed aura
115  for (uint8 i=0; i <= 9; i++)
118 
119  if (Creature* herold = GetBGCreature(AV_CPLACE_HERALD))
120  herold->AI()->Talk(TEXT_STORMPIKE_GENERAL_DEAD);
121  }
122  else if (entry == BG_AV_CreatureInfo[AV_NPC_H_CAPTAIN])
123  {
124  if (!m_CaptainAlive[1])
125  {
126  TC_LOG_ERROR("bg.battleground", "Killed a Captain twice, please report this bug, if you haven't done \".respawn\"");
127  return;
128  }
129  m_CaptainAlive[1]=false;
133  //spawn destroyed aura
134  for (uint8 i=0; i <= 9; i++)
137 
138  if (Creature* herold = GetBGCreature(AV_CPLACE_HERALD))
139  herold->AI()->Talk(TEXT_FROSTWOLF_GENERAL_DEAD);
140  }
142  ChangeMineOwner(AV_NORTH_MINE, killer->GetTeam());
144  ChangeMineOwner(AV_SOUTH_MINE, killer->GetTeam());
145 }
Definition: Battleground.h:159
Definition: BattlegroundAV.h:1004
Definition: Battleground.h:129
Definition: BattlegroundAV.h:1531
Definition: BattlegroundAV.h:995
Definition: BattlegroundAV.h:1530
void RewardReputationToTeam(uint32 faction_id, uint32 Reputation, uint32 TeamID)
Definition: Battleground.cpp:716
uint32 GetBonusHonorFromKill(uint32 kills) const
Definition: Battleground.cpp:907
Definition: BattlegroundAV.h:625
Definition: BattlegroundAV.h:108
BattlegroundStatus GetStatus() const
Definition: Battleground.h:266
#define BG_AV_KILL_BOSS
Definition: BattlegroundAV.h:32
void SpawnBGObject(uint32 type, uint32 respawntime)
Definition: Battleground.cpp:1564
#define BG_AV_REP_CAPTAIN
Definition: BattlegroundAV.h:36
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
Definition: Creature.h:467
Definition: BattlegroundAV.h:624
Definition: BattlegroundAV.h:622
#define BG_AV_KILL_CAPTAIN
Definition: BattlegroundAV.h:35
Definition: SharedDefines.h:1000
Definition: BattlegroundAV.h:996
void UpdateScore(uint16 team, int16 points)
Definition: BattlegroundAV.cpp:250
void CastSpellOnTeam(uint32 SpellID, uint32 TeamID)
Definition: Battleground.cpp:695
uint32_t uint32
Definition: Define.h:150
Definition: BattlegroundAV.h:1029
void RewardHonorToTeam(uint32 Honor, uint32 TeamID)
Definition: Battleground.cpp:709
#define BG_AV_REP_BOSS
Definition: BattlegroundAV.h:33
Definition: SharedDefines.h:999
bool DelCreature(uint32 type)
Definition: Battleground.cpp:1640
void ChangeMineOwner(uint8 mine, uint32 team, bool initial=false)
Definition: BattlegroundAV.cpp:607
void EndBattleground(uint32 winner) override
Definition: BattlegroundAV.cpp:441
Definition: BattlegroundAV.h:1021
uint8_t uint8
Definition: Define.h:152
Definition: BattlegroundAV.h:602
Definition: BattlegroundAV.h:301
uint32 GetEntry() const
Definition: Object.h:107
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207
Definition: BattlegroundAV.h:300
Definition: BattlegroundAV.h:1003
Creature * GetBGCreature(uint32 type, bool logError=true)
Definition: Battleground.cpp:1549
bool m_CaptainAlive[2]
Definition: BattlegroundAV.h:1692
#define BG_AV_RES_CAPTAIN
Definition: BattlegroundAV.h:37
Definition: BattlegroundAV.h:107
Definition: BattlegroundAV.h:1038
Definition: BattlegroundAV.h:1034
Definition: BattlegroundAV.h:623
Definition: BattlegroundAV.h:1017
const uint32 BG_AV_CreatureInfo[AV_NPC_INFO_MAX]
Definition: BattlegroundAV.h:1045
Definition: BattlegroundAV.h:1025

+ Here is the call graph for this function:

void BattlegroundAV::HandleQuestComplete ( uint32  questid,
Player player 
)
overridevirtual
Todo:
add reputation, events (including quest not available anymore, next quest available, go/npc de/spawning)and maybe honor

Reimplemented from Battleground.

148 {
149  if (GetStatus() != STATUS_IN_PROGRESS)
150  return;//maybe we should log this, cause this must be a cheater or a big bug
151  uint8 team = GetTeamIndexByTeamId(player->GetTeam());
153  TC_LOG_DEBUG("bg.battleground", "BG_AV Quest %i completed", questid);
154  switch (questid)
155  {
156  case AV_QUEST_A_SCRAPS1:
157  case AV_QUEST_A_SCRAPS2:
158  case AV_QUEST_H_SCRAPS1:
159  case AV_QUEST_H_SCRAPS2:
160  m_Team_QuestStatus[team][0]+=20;
161  if (m_Team_QuestStatus[team][0] == 500 || m_Team_QuestStatus[team][0] == 1000 || m_Team_QuestStatus[team][0] == 1500) //25, 50, 75 turn ins
162  {
163  TC_LOG_DEBUG("bg.battleground", "BG_AV Quest %i completed starting with unit upgrading..", questid);
165  if (m_Nodes[i].Owner == player->GetTeam() && m_Nodes[i].State == POINT_CONTROLED)
166  {
167  DePopulateNode(i);
168  PopulateNode(i);
169  //maybe this is bad, because it will instantly respawn all creatures on every grave..
170  }
171  }
172  break;
175  m_Team_QuestStatus[team][1]++;
176  RewardReputationToTeam(team, 1, player->GetTeam());
177  if (m_Team_QuestStatus[team][1] == 30)
178  TC_LOG_DEBUG("bg.battleground", "BG_AV Quest %i completed (need to implement some events here", questid);
179  break;
182  m_Team_QuestStatus[team][2]++;
183  RewardReputationToTeam(team, 1, player->GetTeam());
184  if (m_Team_QuestStatus[team][2] == 60)
185  TC_LOG_DEBUG("bg.battleground", "BG_AV Quest %i completed (need to implement some events here", questid);
186  break;
189  m_Team_QuestStatus[team][3]++;
190  RewardReputationToTeam(team, 1, player->GetTeam());
191  if (m_Team_QuestStatus[team][3] == 120)
192  TC_LOG_DEBUG("bg.battleground", "BG_AV Quest %i completed (need to implement some events here", questid);
193  break;
194  case AV_QUEST_A_BOSS1:
195  case AV_QUEST_H_BOSS1:
196  m_Team_QuestStatus[team][4] += 9; //you can turn in 10 or 1 item..
197  case AV_QUEST_A_BOSS2:
198  case AV_QUEST_H_BOSS2:
199  m_Team_QuestStatus[team][4]++;
200  if (m_Team_QuestStatus[team][4] >= 200)
201  TC_LOG_DEBUG("bg.battleground", "BG_AV Quest %i completed (need to implement some events here", questid);
202  break;
205  m_Team_QuestStatus[team][5]++;
206  if (m_Team_QuestStatus[team][5] == 28)
207  {
208  TC_LOG_DEBUG("bg.battleground", "BG_AV Quest %i completed (need to implement some events here", questid);
209  if (m_Team_QuestStatus[team][6] == 7)
210  TC_LOG_DEBUG("bg.battleground", "BG_AV Quest %i completed (need to implement some events here - ground assault ready", questid);
211  }
212  break;
215  m_Team_QuestStatus[team][6]++;
216  if (m_Team_QuestStatus[team][6] == 7)
217  {
218  TC_LOG_DEBUG("bg.battleground", "BG_AV Quest %i completed (need to implement some events here", questid);
219  if (m_Team_QuestStatus[team][5] == 20)
220  TC_LOG_DEBUG("bg.battleground", "BG_AV Quest %i completed (need to implement some events here - ground assault ready", questid);
221  }
222  break;
225  m_Team_QuestStatus[team][7]++;
226  if (m_Team_QuestStatus[team][7] == 25)
227  {
228  TC_LOG_DEBUG("bg.battleground", "BG_AV Quest %i completed (need to implement some events here", questid);
229  if (m_Team_QuestStatus[team][8] == 25)
230  TC_LOG_DEBUG("bg.battleground", "BG_AV Quest %i completed (need to implement some events here - rider assault ready", questid);
231  }
232  break;
235  m_Team_QuestStatus[team][8]++;
236  if (m_Team_QuestStatus[team][8] == 25)
237  {
238  TC_LOG_DEBUG("bg.battleground", "BG_AV Quest %i completed (need to implement some events here", questid);
239  if (m_Team_QuestStatus[team][7] == 25)
240  TC_LOG_DEBUG("bg.battleground", "BG_AV Quest %i completed (need to implement some events here - rider assault ready", questid);
241  }
242  break;
243  default:
244  TC_LOG_DEBUG("bg.battleground", "BG_AV Quest %i completed but is not interesting at all", questid);
245  return; //was no interesting quest at all
246  break;
247  }
248 }
BG_AV_Nodes
Definition: BattlegroundAV.h:160
Definition: Battleground.h:159
Definition: BattlegroundAV.h:1453
void PopulateNode(BG_AV_Nodes node)
Definition: BattlegroundAV.cpp:705
Definition: BattlegroundAV.h:1471
Definition: BattlegroundAV.h:1454
void RewardReputationToTeam(uint32 faction_id, uint32 Reputation, uint32 TeamID)
Definition: Battleground.cpp:716
Definition: BattlegroundAV.h:162
uint32 m_Team_QuestStatus[2][9]
Definition: BattlegroundAV.h:1683
BattlegroundStatus GetStatus() const
Definition: Battleground.h:266
Definition: BattlegroundAV.h:1468
Definition: BattlegroundAV.h:1450
Definition: BattlegroundAV.h:1469
Definition: BattlegroundAV.h:1458
Definition: BattlegroundAV.h:1451
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
Definition: BattlegroundAV.h:1464
Definition: BattlegroundAV.h:1462
static TeamId GetTeamIndexByTeamId(uint32 Team)
Definition: Battleground.h:399
Definition: BattlegroundAV.h:1470
Definition: BattlegroundAV.h:1457
Definition: BattlegroundAV.h:1460
Definition: BattlegroundAV.h:1465
void DePopulateNode(BG_AV_Nodes node)
Definition: BattlegroundAV.cpp:759
Definition: BattlegroundAV.h:168
Definition: BattlegroundAV.h:1467
Definition: BattlegroundAV.h:1461
Definition: BattlegroundAV.h:1452
BG_AV_States State
Definition: BattlegroundAV.h:1541
Definition: BattlegroundAV.h:1456
Definition: BattlegroundAV.h:1325
Definition: BattlegroundAV.h:1463
uint8_t uint8
Definition: Define.h:152
Definition: BattlegroundAV.h:1466
BG_AV_NodeInfo m_Nodes[BG_AV_NODES_MAX]
Definition: BattlegroundAV.h:1685
Definition: BattlegroundAV.h:1455
Definition: BattlegroundAV.h:1459

+ Here is the call graph for this function:

void BattlegroundAV::InitNode ( BG_AV_Nodes  node,
uint16  team,
bool  tower 
)
private
1444 {
1445  m_Nodes[node].TotalOwner = team;
1446  m_Nodes[node].Owner = team;
1447  m_Nodes[node].PrevOwner = 0;
1448  m_Nodes[node].State = POINT_CONTROLED;
1449  m_Nodes[node].PrevState = m_Nodes[node].State;
1450  m_Nodes[node].State = POINT_CONTROLED;
1451  m_Nodes[node].Timer = 0;
1452  m_Nodes[node].Tower = tower;
1453 }
uint16 Owner
Definition: BattlegroundAV.h:1545
uint16 PrevOwner
Definition: BattlegroundAV.h:1546
BG_AV_States State
Definition: BattlegroundAV.h:1541
Definition: BattlegroundAV.h:1325
bool Tower
Definition: BattlegroundAV.h:1547
BG_AV_States PrevState
Definition: BattlegroundAV.h:1542
uint16 TotalOwner
Definition: BattlegroundAV.h:1544
uint32 Timer
Definition: BattlegroundAV.h:1543
BG_AV_NodeInfo m_Nodes[BG_AV_NODES_MAX]
Definition: BattlegroundAV.h:1685

+ Here is the caller graph for this function:

bool BattlegroundAV::IsTower ( BG_AV_Nodes  node)
inlineprivate
1668 { return m_Nodes[node].Tower; }
bool Tower
Definition: BattlegroundAV.h:1547
BG_AV_NodeInfo m_Nodes[BG_AV_NODES_MAX]
Definition: BattlegroundAV.h:1685

+ Here is the caller graph for this function:

void BattlegroundAV::PopulateNode ( BG_AV_Nodes  node)
private
706 {
707  uint32 owner = m_Nodes[node].Owner;
708  ASSERT(owner);
709 
710  uint32 c_place = AV_CPLACE_DEFENSE_STORM_AID + (4 * node);
711  uint32 creatureid;
712  if (IsTower(node))
714  else
715  {
716  uint8 team2 = GetTeamIndexByTeamId(owner);
717  if (m_Team_QuestStatus[team2][0] < 500)
718  creatureid = (owner == ALLIANCE)? AV_NPC_A_GRAVEDEFENSE0 : AV_NPC_H_GRAVEDEFENSE0;
719  else if (m_Team_QuestStatus[team2][0] < 1000)
720  creatureid = (owner == ALLIANCE)? AV_NPC_A_GRAVEDEFENSE1 : AV_NPC_H_GRAVEDEFENSE1;
721  else if (m_Team_QuestStatus[team2][0] < 1500)
722  creatureid = (owner == ALLIANCE)? AV_NPC_A_GRAVEDEFENSE2 : AV_NPC_H_GRAVEDEFENSE2;
723  else
724  creatureid = (owner == ALLIANCE)? AV_NPC_A_GRAVEDEFENSE3 : AV_NPC_H_GRAVEDEFENSE3;
725  //spiritguide
726  if (!BgCreatures[node].IsEmpty())
727  DelCreature(node);
728  if (!AddSpiritGuide(node, BG_AV_CreaturePos[node], GetTeamIndexByTeamId(owner)))
729  TC_LOG_ERROR("bg.battleground", "AV: couldn't spawn spiritguide at node %i", node);
730  }
731  for (uint8 i=0; i<4; i++)
732  AddAVCreature(creatureid, c_place+i);
733 
734  if (node >= BG_AV_NODES_MAX)//fail safe
735  return;
736  Creature* trigger = GetBGCreature(node + 302, false);//0-302 other creatures
737  if (!trigger)
738  {
739  trigger = AddCreature(WORLD_TRIGGER,
740  node + 302,
741  BG_AV_CreaturePos[node + 302],
742  GetTeamIndexByTeamId(owner));
743  }
744 
745  //add bonus honor aura trigger creature when node is accupied
746  //cast bonus aura (+50% honor in 25yards)
747  //aura should only apply to players who have accupied the node, set correct faction for trigger
748  if (trigger)
749  {
750  if (owner != ALLIANCE && owner != HORDE)//node can be neutral, remove trigger
751  {
752  DelCreature(node + 302);
753  return;
754  }
755  trigger->setFaction(owner == ALLIANCE ? 84 : 83);
756  trigger->CastSpell(trigger, SPELL_HONORABLE_DEFENDER_25Y, false);
757  }
758 }
Definition: BattlegroundAV.h:994
Definition: BattlegroundAV.h:554
virtual bool AddSpiritGuide(uint32 type, float x, float y, float z, float o, TeamId teamId=TEAM_NEUTRAL)
Definition: Battleground.cpp:1676
uint16 Owner
Definition: BattlegroundAV.h:1545
Definition: BattlegroundAV.h:1000
uint32 m_Team_QuestStatus[2][9]
Definition: BattlegroundAV.h:1683
Definition: BattlegroundAV.h:998
Definition: BattlegroundAV.h:999
#define WORLD_TRIGGER
Definition: Unit.h:33
virtual Creature * AddCreature(uint32 entry, uint32 type, float x, float y, float z, float o, TeamId teamId=TEAM_NEUTRAL, uint32 respawntime=0, Transport *transport=NULL)
Definition: Battleground.cpp:1580
Definition: BattlegroundAV.h:1001
Definition: Creature.h:467
Definition: BattlegroundAV.h:992
Creature * AddAVCreature(uint16 cinfoid, uint16 type)
Definition: BattlegroundAV.cpp:273
static TeamId GetTeamIndexByTeamId(uint32 Team)
Definition: Battleground.h:399
Definition: SharedDefines.h:1000
void setFaction(uint32 faction)
Definition: Unit.h:1467
GuidVector BgCreatures
Definition: Battleground.h:453
bool IsTower(BG_AV_Nodes node)
Definition: BattlegroundAV.h:1668
Definition: BattlegroundAV.h:993
Definition: BattlegroundAV.h:991
Definition: BattlegroundAV.h:990
uint32_t uint32
Definition: Define.h:150
Definition: BattlegroundAV.h:1002
Definition: Battleground.h:115
Definition: SharedDefines.h:999
bool DelCreature(uint32 type)
Definition: Battleground.cpp:1640
uint8_t uint8
Definition: Define.h:152
#define ASSERT
Definition: Errors.h:55
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207
Creature * GetBGCreature(uint32 type, bool logError=true)
Definition: Battleground.cpp:1549
BG_AV_NodeInfo m_Nodes[BG_AV_NODES_MAX]
Definition: BattlegroundAV.h:1685
Definition: BattlegroundAV.h:178
Position const BG_AV_CreaturePos[AV_CPLACE_MAX]
Definition: BattlegroundAV.h:630
void CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:869

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void BattlegroundAV::PostUpdateImpl ( uint32  )
overrideprivatevirtual

Post-update hook.

Will be called after battleground update has passed. May be used to implement custom update effects in subclasses.

Parameters
diffa time difference between two worldserver update loops in milliseconds.
See also
Update(), PreUpdateImpl().

Reimplemented from Battleground.

352 {
353  if (GetStatus() == STATUS_IN_PROGRESS)
354  {
355  for (uint8 i=0; i <= 1; i++)//0=alliance, 1=horde
356  {
357  if (!m_CaptainAlive[i])
358  continue;
359  if (m_CaptainBuffTimer[i] > diff)
360  m_CaptainBuffTimer[i] -= diff;
361  else
362  {
363  if (i == 0)
364  {
366  if (Creature* creature = GetBGCreature(AV_CPLACE_MAX + 61))
367  creature->AI()->DoAction(ACTION_BUFF_YELL);
368  }
369  else
370  {
372  if (Creature* creature = GetBGCreature(AV_CPLACE_MAX + 59))
373  creature->AI()->DoAction(ACTION_BUFF_YELL);
374  }
375  m_CaptainBuffTimer[i] = 120000 + urand(0, 4)* 60000; //as far as i could see, the buff is randomly so i make 2minutes (thats the duration of the buff itself) + 0-4minutes @todo get the right times
376  }
377  }
378  //add points from mine owning, and look if he neutral team wanrts to reclaim the mine
379  m_Mine_Timer -=diff;
380  for (uint8 mine=0; mine <2; mine++)
381  {
382  if (m_Mine_Owner[mine] == ALLIANCE || m_Mine_Owner[mine] == HORDE)
383  {
384  if (m_Mine_Timer <= 0)
385  UpdateScore(m_Mine_Owner[mine], 1);
386 
387  if (m_Mine_Reclaim_Timer[mine] > diff)
388  m_Mine_Reclaim_Timer[mine] -= diff;
389  else{ //we don't need to set this timer to 0 cause this codepart wont get called when this thing is 0
391  }
392  }
393  }
394  if (m_Mine_Timer <= 0)
395  m_Mine_Timer=AV_MINE_TICK_TIMER; //this is at the end, cause we need to update both mines
396 
397  //looks for all timers of the nodes and destroy the building (for graveyards the building wont get destroyed, it goes just to the other team
399  if (m_Nodes[i].State == POINT_ASSAULTED) //maybe remove this
400  {
401  if (m_Nodes[i].Timer > diff)
402  m_Nodes[i].Timer -= diff;
403  else
405  }
406  }
407 }
Definition: BattlegroundAV.h:1323
BG_AV_Nodes
Definition: BattlegroundAV.h:160
Definition: Battleground.h:159
uint32 m_Mine_Reclaim_Timer[2]
Definition: BattlegroundAV.h:1690
Definition: BattlegroundAV.h:111
Definition: BattlegroundAV.h:162
BattlegroundStatus GetStatus() const
Definition: Battleground.h:266
Definition: BattlegroundAV.h:1317
Definition: Creature.h:467
void EventPlayerDestroyedPoint(BG_AV_Nodes node)
Definition: BattlegroundAV.cpp:553
Definition: SharedDefines.h:1000
void UpdateScore(uint16 team, int16 points)
Definition: BattlegroundAV.cpp:250
void CastSpellOnTeam(uint32 SpellID, uint32 TeamID)
Definition: Battleground.cpp:695
int32 m_Mine_Timer
Definition: BattlegroundAV.h:1689
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:45
Definition: BattlegroundAV.h:1318
uint32 m_CaptainBuffTimer[2]
Definition: BattlegroundAV.h:1691
uint32 m_Mine_Owner[2]
Definition: BattlegroundAV.h:1687
Definition: SharedDefines.h:999
Definition: BattlegroundAV.h:55
Definition: BattlegroundAV.h:627
void ChangeMineOwner(uint8 mine, uint32 team, bool initial=false)
Definition: BattlegroundAV.cpp:607
uint8_t uint8
Definition: Define.h:152
uint32 Timer
Definition: BattlegroundAV.h:1543
Creature * GetBGCreature(uint32 type, bool logError=true)
Definition: Battleground.cpp:1549
bool m_CaptainAlive[2]
Definition: BattlegroundAV.h:1692
BG_AV_NodeInfo m_Nodes[BG_AV_NODES_MAX]
Definition: BattlegroundAV.h:1685
Definition: BattlegroundAV.h:178
Definition: BattlegroundAV.h:109

+ Here is the call graph for this function:

void BattlegroundAV::RemovePlayer ( Player player,
ObjectGuid  guid,
uint32  team 
)
overridevirtual
Todo:
search more buffs

Reimplemented from Battleground.

482 {
483  if (!player)
484  {
485  TC_LOG_ERROR("bg.battleground", "bg_AV no player at remove");
486  return;
487  }
489  player->RemoveAurasDueToSpell(AV_BUFF_ARMOR);
490  player->RemoveAurasDueToSpell(AV_BUFF_A_CAPTAIN);
491  player->RemoveAurasDueToSpell(AV_BUFF_H_CAPTAIN);
492 }
Definition: BattlegroundAV.h:1317
Definition: BattlegroundAV.h:1318
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207
Definition: BattlegroundAV.h:1316
void BattlegroundAV::ResetBGSubclass ( )
overridevirtual

Reimplemented from Battleground.

1468 {
1469  for (uint8 i=0; i<2; i++) //forloop for both teams (it just make 0 == alliance and 1 == horde also for both mines 0=north 1=south
1470  {
1471  for (uint8 j=0; j<9; j++)
1472  m_Team_QuestStatus[i][j]=0;
1474  m_IsInformedNearVictory[i]=false;
1475  m_CaptainAlive[i] = true;
1476  m_CaptainBuffTimer[i] = 120000 + urand(0, 4)* 60; //as far as i could see, the buff is randomly so i make 2minutes (thats the duration of the buff itself) + 0-4minutes @todo get the right times
1479  }
1480 
1481  for (BG_AV_Nodes i = BG_AV_NODES_FIRSTAID_STATION; i <= BG_AV_NODES_STONEHEART_GRAVE; ++i) //alliance graves
1482  InitNode(i, ALLIANCE, false);
1483  for (BG_AV_Nodes i = BG_AV_NODES_DUNBALDAR_SOUTH; i <= BG_AV_NODES_STONEHEART_BUNKER; ++i) //alliance towers
1484  InitNode(i, ALLIANCE, true);
1485  for (BG_AV_Nodes i = BG_AV_NODES_ICEBLOOD_GRAVE; i <= BG_AV_NODES_FROSTWOLF_HUT; ++i) //horde graves
1486  InitNode(i, HORDE, false);
1487  for (BG_AV_Nodes i = BG_AV_NODES_ICEBLOOD_TOWER; i <= BG_AV_NODES_FROSTWOLF_WTOWER; ++i) //horde towers
1488  InitNode(i, HORDE, true);
1489  InitNode(BG_AV_NODES_SNOWFALL_GRAVE, AV_NEUTRAL_TEAM, false); //give snowfall neutral owner
1490 
1492  for (uint16 i = 0; i < AV_CPLACE_MAX+AV_STATICCPLACE_MAX; i++)
1493  if (!BgCreatures[i].IsEmpty())
1494  DelCreature(i);
1495 }
BG_AV_Nodes
Definition: BattlegroundAV.h:160
Definition: BattlegroundAV.h:111
uint32 m_Mine_PrevOwner[2]
Definition: BattlegroundAV.h:1688
Definition: BattlegroundAV.h:162
uint32 m_Team_QuestStatus[2][9]
Definition: BattlegroundAV.h:1683
Definition: BattlegroundAV.h:176
bool m_IsInformedNearVictory[2]
Definition: BattlegroundAV.h:1694
Definition: BattlegroundAV.h:172
Definition: SharedDefines.h:1000
int32 m_Team_Scores[2]
Definition: BattlegroundAV.h:1682
#define BG_AV_SCORE_INITIAL_POINTS
Definition: BattlegroundAV.h:29
Definition: BattlegroundAV.h:173
GuidVector BgCreatures
Definition: Battleground.h:453
Definition: BattlegroundAV.h:169
int32 m_Mine_Timer
Definition: BattlegroundAV.h:1689
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:45
Definition: BattlegroundAV.h:168
uint16_t uint16
Definition: Define.h:151
Definition: BattlegroundAV.h:164
uint32 m_CaptainBuffTimer[2]
Definition: BattlegroundAV.h:1691
uint32 m_Mine_Owner[2]
Definition: BattlegroundAV.h:1687
Definition: BattlegroundAV.h:106
Definition: BattlegroundAV.h:165
Definition: SharedDefines.h:999
bool DelCreature(uint32 type)
Definition: Battleground.cpp:1640
Definition: BattlegroundAV.h:627
Definition: BattlegroundAV.h:166
uint8_t uint8
Definition: Define.h:152
void InitNode(BG_AV_Nodes node, uint16 team, bool tower)
Definition: BattlegroundAV.cpp:1443
bool m_CaptainAlive[2]
Definition: BattlegroundAV.h:1692
Definition: BattlegroundAV.h:109

+ Here is the call graph for this function:

void BattlegroundAV::SendMineWorldStates ( uint32  mine)
private
1071 {
1072  ASSERT(mine == AV_NORTH_MINE || mine == AV_SOUTH_MINE);
1073 // currently i'm sure, that this works (:
1074 // ASSERT(m_Mine_PrevOwner[mine] == ALLIANCE || m_Mine_PrevOwner[mine] == HORDE || m_Mine_PrevOwner[mine] == AV_NEUTRAL_TEAM);
1075 // ASSERT(m_Mine_Owner[mine] == ALLIANCE || m_Mine_Owner[mine] == HORDE || m_Mine_Owner[mine] == AV_NEUTRAL_TEAM);
1076 
1077  uint8 owner, prevowner, mine2; //those variables are needed to access the right worldstate in the BG_AV_MineWorldStates array
1078  mine2 = (mine == AV_NORTH_MINE)?0:1;
1079  if (m_Mine_PrevOwner[mine] == ALLIANCE)
1080  prevowner = 0;
1081  else if (m_Mine_PrevOwner[mine] == HORDE)
1082  prevowner = 2;
1083  else
1084  prevowner = 1;
1085  if (m_Mine_Owner[mine] == ALLIANCE)
1086  owner = 0;
1087  else if (m_Mine_Owner[mine] == HORDE)
1088  owner = 2;
1089  else
1090  owner = 1;
1091 
1092  UpdateWorldState(BG_AV_MineWorldStates[mine2][owner], 1);
1093  if (prevowner != owner)
1094  UpdateWorldState(BG_AV_MineWorldStates[mine2][prevowner], 0);
1095 }
uint32 m_Mine_PrevOwner[2]
Definition: BattlegroundAV.h:1688
Definition: BattlegroundAV.h:108
Definition: SharedDefines.h:1000
const uint32 BG_AV_MineWorldStates[2][3]
Definition: BattlegroundAV.h:1442
uint32 m_Mine_Owner[2]
Definition: BattlegroundAV.h:1687
Definition: SharedDefines.h:999
uint8_t uint8
Definition: Define.h:152
#define ASSERT
Definition: Errors.h:55
void UpdateWorldState(uint32 variable, uint32 value, bool hidden=false)
Definition: Battleground.cpp:735
Definition: BattlegroundAV.h:107

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool BattlegroundAV::SetupBattleground ( )
overridevirtual

Reimplemented from Battleground.

1128 {
1129  // Create starting objects
1130  if (// alliance gates
1131  !AddObject(BG_AV_OBJECT_DOOR_A, BG_AV_OBJECTID_GATE_A, BG_AV_DoorPositons[0], 0, 0, std::sin(BG_AV_DoorPositons[0].GetOrientation()/2), std::cos(BG_AV_DoorPositons[0].GetOrientation()/2), RESPAWN_IMMEDIATELY)
1132  // horde gates
1133  || !AddObject(BG_AV_OBJECT_DOOR_H, BG_AV_OBJECTID_GATE_H, BG_AV_DoorPositons[1], 0, 0, std::sin(BG_AV_DoorPositons[1].GetOrientation()/2), std::cos(BG_AV_DoorPositons[1].GetOrientation()/2), RESPAWN_IMMEDIATELY))
1134  {
1135  TC_LOG_ERROR("sql.sql", "BatteGroundAV: Failed to spawn some object Battleground not created!1");
1136  return false;
1137  }
1138 
1139  //spawn node-objects
1141  {
1142  if (i <= BG_AV_NODES_FROSTWOLF_HUT)
1143  {
1145  BG_AV_ObjectPos[i],
1146  0, 0, std::sin(BG_AV_ObjectPos[i].GetOrientation()/2), std::cos(BG_AV_ObjectPos[i].GetOrientation()/2), RESPAWN_ONE_DAY)
1148  BG_AV_ObjectPos[i],
1149  0, 0, std::sin(BG_AV_ObjectPos[i].GetOrientation()/2), std::cos(BG_AV_ObjectPos[i].GetOrientation()/2), RESPAWN_ONE_DAY)
1151  BG_AV_ObjectPos[i],
1152  0, 0, std::sin(BG_AV_ObjectPos[i].GetOrientation()/2), std::cos(BG_AV_ObjectPos[i].GetOrientation()/2), RESPAWN_ONE_DAY)
1154  BG_AV_ObjectPos[i],
1155  0, 0, std::sin(BG_AV_ObjectPos[i].GetOrientation()/2), std::cos(BG_AV_ObjectPos[i].GetOrientation()/2), RESPAWN_ONE_DAY)
1156  //aura
1158  BG_AV_ObjectPos[i],
1159  0, 0, std::sin(BG_AV_ObjectPos[i].GetOrientation()/2), std::cos(BG_AV_ObjectPos[i].GetOrientation()/2), RESPAWN_ONE_DAY)
1161  BG_AV_ObjectPos[i],
1162  0, 0, std::sin(BG_AV_ObjectPos[i].GetOrientation()/2), std::cos(BG_AV_ObjectPos[i].GetOrientation()/2), RESPAWN_ONE_DAY)
1164  BG_AV_ObjectPos[i],
1165  0, 0, std::sin(BG_AV_ObjectPos[i].GetOrientation()/2), std::cos(BG_AV_ObjectPos[i].GetOrientation()/2), RESPAWN_ONE_DAY))
1166  {
1167  TC_LOG_ERROR("bg.battleground", "BatteGroundAV: Failed to spawn some object Battleground not created!2");
1168  return false;
1169  }
1170  }
1171  else //towers
1172  {
1173  if (i <= BG_AV_NODES_STONEHEART_BUNKER) //alliance towers
1174  {
1176  BG_AV_ObjectPos[i],
1177  0, 0, std::sin(BG_AV_ObjectPos[i].GetOrientation()/2), std::cos(BG_AV_ObjectPos[i].GetOrientation()/2), RESPAWN_ONE_DAY)
1179  BG_AV_ObjectPos[i],
1180  0, 0, std::sin(BG_AV_ObjectPos[i].GetOrientation()/2), std::cos(BG_AV_ObjectPos[i].GetOrientation()/2), RESPAWN_ONE_DAY)
1182  BG_AV_ObjectPos[i+8],
1183  0, 0, std::sin(BG_AV_ObjectPos[i+8].GetOrientation()/2), std::cos(BG_AV_ObjectPos[i+8].GetOrientation()/2), RESPAWN_ONE_DAY)
1185  BG_AV_ObjectPos[i+8],
1186  0, 0, std::sin(BG_AV_ObjectPos[i+8].GetOrientation()/2), std::cos(BG_AV_ObjectPos[i+8].GetOrientation()/2), RESPAWN_ONE_DAY)
1188  BG_AV_ObjectPos[i+8],
1189  0, 0, std::sin(BG_AV_ObjectPos[i+8].GetOrientation()/2), std::cos(BG_AV_ObjectPos[i+8].GetOrientation()/2), RESPAWN_ONE_DAY)
1191  BG_AV_ObjectPos[i+8],
1192  0, 0, std::sin(BG_AV_ObjectPos[i+8].GetOrientation()/2), std::cos(BG_AV_ObjectPos[i+8].GetOrientation()/2), RESPAWN_ONE_DAY))
1193  {
1194  TC_LOG_ERROR("bg.battleground", "BatteGroundAV: Failed to spawn some object Battleground not created!3");
1195  return false;
1196  }
1197  }
1198  else //horde towers
1199  {
1201  BG_AV_ObjectPos[i],
1202  0, 0, std::sin(BG_AV_ObjectPos[i].GetOrientation()/2), std::cos(BG_AV_ObjectPos[i].GetOrientation()/2), RESPAWN_ONE_DAY)
1204  BG_AV_ObjectPos[i],
1205  0, 0, std::sin(BG_AV_ObjectPos[i].GetOrientation()/2), std::cos(BG_AV_ObjectPos[i].GetOrientation()/2), RESPAWN_ONE_DAY)
1207  BG_AV_ObjectPos[i+8],
1208  0, 0, std::sin(BG_AV_ObjectPos[i+8].GetOrientation()/2), std::cos(BG_AV_ObjectPos[i+8].GetOrientation()/2), RESPAWN_ONE_DAY)
1210  BG_AV_ObjectPos[i+8],
1211  0, 0, std::sin(BG_AV_ObjectPos[i+8].GetOrientation()/2), std::cos(BG_AV_ObjectPos[i+8].GetOrientation()/2), RESPAWN_ONE_DAY)
1213  BG_AV_ObjectPos[i+8],
1214  0, 0, std::sin(BG_AV_ObjectPos[i+8].GetOrientation()/2), std::cos(BG_AV_ObjectPos[i+8].GetOrientation()/2), RESPAWN_ONE_DAY)
1216  BG_AV_ObjectPos[i+8],
1217  0, 0, std::sin(BG_AV_ObjectPos[i+8].GetOrientation()/2), std::cos(BG_AV_ObjectPos[i+8].GetOrientation()/2), RESPAWN_ONE_DAY))
1218  {
1219  TC_LOG_ERROR("bg.battleground", "BatteGroundAV: Failed to spawn some object Battleground not created!4");
1220  return false;
1221  }
1222  }
1223  for (uint8 j=0; j <= 9; j++) //burning aura
1224  {
1228  0,
1229  0,
1230  std::sin(BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j].GetOrientation()/2),
1231  std::cos(BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j].GetOrientation()/2),
1232  RESPAWN_ONE_DAY))
1233  {
1234  TC_LOG_ERROR("bg.battleground", "BatteGroundAV: Failed to spawn some object Battleground not created!5.%i", i);
1235  return false;
1236  }
1237  }
1238  }
1239  }
1240  for (uint8 i=0; i<2; i++) //burning aura for buildings
1241  {
1242  for (uint8 j=0; j <= 9; j++)
1243  {
1244  if (j<5)
1245  {
1249  0,
1250  0,
1251  std::sin(BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j].GetOrientation()/2),
1252  std::cos(BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j].GetOrientation()/2),
1253  RESPAWN_ONE_DAY))
1254  {
1255  TC_LOG_ERROR("bg.battleground", "BatteGroundAV: Failed to spawn some object Battleground not created!6.%i", i);
1256  return false;
1257  }
1258  }
1259  else
1260  {
1264  0,
1265  0,
1266  std::sin(BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j].GetOrientation()/2),
1267  std::cos(BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j].GetOrientation()/2),
1268  RESPAWN_ONE_DAY))
1269  {
1270  TC_LOG_ERROR("bg.battleground", "BatteGroundAV: Failed to spawn some object Battleground not created!7.%i", i);
1271  return false;
1272  }
1273  }
1274  }
1275  }
1277  {
1281  0,
1282  0,
1283  std::sin(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i].GetOrientation()/2),
1284  std::cos(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i].GetOrientation()/2),
1285  RESPAWN_ONE_DAY))
1286  {
1287  TC_LOG_ERROR("bg.battleground", "BatteGroundAV: Failed to spawn some mine supplies Battleground not created!7.5.%i", i);
1288  return false;
1289  }
1290  }
1292  {
1296  0,
1297  0,
1298  std::sin(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i].GetOrientation()/2),
1299  std::cos(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i].GetOrientation()/2),
1300  RESPAWN_ONE_DAY))
1301  {
1302  TC_LOG_ERROR("bg.battleground", "BatteGroundAV: Failed to spawn some mine supplies Battleground not created!7.6.%i", i);
1303  return false;
1304  }
1305  }
1306 
1310  0,
1311  0,
1312  std::sin(BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE].GetOrientation()/2),
1313  std::cos(BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE].GetOrientation()/2),
1314  RESPAWN_ONE_DAY))
1315  {
1316  TC_LOG_ERROR("bg.battleground", "BatteGroundAV: Failed to spawn some object Battleground not created!8");
1317  return false;
1318  }
1319  for (uint8 i = 0; i < 4; i++)
1320  {
1323  0, 0, std::sin(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i].GetOrientation()/2), std::cos(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i].GetOrientation()/2), RESPAWN_ONE_DAY)
1326  0, 0, std::sin(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i].GetOrientation()/2), std::cos(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i].GetOrientation()/2), RESPAWN_ONE_DAY)
1329  0, 0, std::sin(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i].GetOrientation()/2), std::cos(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i].GetOrientation()/2), RESPAWN_ONE_DAY)
1332  0, 0, std::sin(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i].GetOrientation()/2), std::cos(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i].GetOrientation()/2), RESPAWN_ONE_DAY))
1333  {
1334  TC_LOG_ERROR("bg.battleground", "BatteGroundAV: Failed to spawn some object Battleground not created!9.%i", i);
1335  return false;
1336  }
1337  }
1338 
1339  uint16 i;
1340  TC_LOG_DEBUG("bg.battleground", "Alterac Valley: entering state STATUS_WAIT_JOIN ...");
1341  // Initial Nodes
1342  for (i = 0; i < BG_AV_OBJECT_MAX; i++)
1344 
1346  {
1349  }
1350 
1353 
1355  {
1359  }
1360 
1362  {
1364  SpawnBGObject(i+16, RESPAWN_IMMEDIATELY); //aura
1365  }
1366 
1368  {
1370  SpawnBGObject(i+16, RESPAWN_IMMEDIATELY); //aura
1371  }
1372 
1373  //snowfall and the doors
1376 
1378 
1379  //creatures
1380  TC_LOG_DEBUG("bg.battleground", "BG_AV start poputlating nodes");
1382  {
1383  if (m_Nodes[n].Owner)
1384  PopulateNode(n);
1385  }
1386  //all creatures which don't get despawned through the script are static
1387  TC_LOG_DEBUG("bg.battleground", "BG_AV: start spawning static creatures");
1388  for (i = 0; i < AV_STATICCPLACE_MAX; i++)
1389  AddAVCreature(0, i + AV_CPLACE_MAX);
1390  //mainspiritguides:
1391  TC_LOG_DEBUG("bg.battleground", "BG_AV: start spawning spiritguides creatures");
1394  //spawn the marshals (those who get deleted, if a tower gets destroyed)
1395  TC_LOG_DEBUG("bg.battleground", "BG_AV: start spawning marshal creatures");
1396  for (i = AV_NPC_A_MARSHAL_SOUTH; i <= AV_NPC_H_MARSHAL_WTOWER; i++)
1399  return true;
1400 }
Definition: BattlegroundAV.h:302
BG_AV_Nodes
Definition: BattlegroundAV.h:160
Definition: BattlegroundAV.h:1013
Definition: Battleground.h:129
virtual 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, GOState goState=GO_STATE_READY)
Definition: Battleground.cpp:1446
Definition: BattlegroundAV.h:185
Definition: BattlegroundAV.h:274
Definition: BattlegroundAV.h:236
void PopulateNode(BG_AV_Nodes node)
Definition: BattlegroundAV.cpp:705
Definition: BattlegroundAV.h:121
virtual bool AddSpiritGuide(uint32 type, float x, float y, float z, float o, TeamId teamId=TEAM_NEUTRAL)
Definition: Battleground.cpp:1676
Definition: BattlegroundAV.h:1006
Definition: BattlegroundAV.h:138
Definition: BattlegroundAV.h:265
Definition: BattlegroundAV.h:276
Definition: BattlegroundAV.h:162
Definition: BattlegroundAV.h:123
Definition: BattlegroundAV.h:149
Definition: BattlegroundAV.h:118
Definition: BattlegroundAV.h:127
Definition: BattlegroundAV.h:354
Definition: BattlegroundAV.h:119
void SpawnBGObject(uint32 type, uint32 respawntime)
Definition: Battleground.cpp:1564
Definition: BattlegroundAV.h:142
Definition: BattlegroundAV.h:233
Definition: BattlegroundAV.h:190
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
Position const BG_AV_ObjectPos[AV_OPLACE_MAX]
Definition: BattlegroundAV.h:362
Definition: BattlegroundAV.h:275
Definition: BattlegroundAV.h:571
Definition: BattlegroundAV.h:292
Definition: BattlegroundAV.h:120
Creature * AddAVCreature(uint16 cinfoid, uint16 type)
Definition: BattlegroundAV.cpp:273
Definition: BattlegroundAV.h:156
Definition: BattlegroundAV.h:356
Definition: BattlegroundAV.h:172
Definition: BattlegroundAV.h:130
Definition: BattlegroundAV.h:229
Definition: BattlegroundAV.h:183
Definition: BattlegroundAV.h:225
Definition: BattlegroundAV.h:136
Definition: BattlegroundAV.h:237
Definition: BattlegroundAV.h:223
Definition: BattlegroundAV.h:245
Definition: BattlegroundAV.h:153
Definition: BattlegroundAV.h:311
Position const BG_AV_DoorPositons[2]
Definition: BattlegroundAV.h:534
Definition: BattlegroundAV.h:169
Definition: BattlegroundAV.h:139
Definition: BattlegroundAV.h:168
Definition: BattlegroundAV.h:137
Definition: BattlegroundAV.h:303
uint16_t uint16
Definition: Define.h:151
Definition: BattlegroundAV.h:304
Definition: SharedDefines.h:992
Definition: Battleground.h:128
Definition: BattlegroundAV.h:106
Definition: BattlegroundAV.h:157
Definition: BattlegroundAV.h:165
Definition: BattlegroundAV.h:143
Definition: BattlegroundAV.h:1039
Definition: BattlegroundAV.h:193
Definition: BattlegroundAV.h:125
Definition: BattlegroundAV.h:627
Definition: BattlegroundAV.h:259
Definition: BattlegroundAV.h:350
Definition: BattlegroundAV.h:268
Definition: BattlegroundAV.h:124
Definition: BattlegroundAV.h:308
Definition: BattlegroundAV.h:132
Definition: BattlegroundAV.h:126
Definition: BattlegroundAV.h:238
Definition: BattlegroundAV.h:307
uint8_t uint8
Definition: Define.h:152
Definition: BattlegroundAV.h:260
Definition: BattlegroundAV.h:602
Definition: BattlegroundAV.h:231
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207
Definition: BattlegroundAV.h:300
Definition: BattlegroundAV.h:154
Definition: BattlegroundAV.h:144
Definition: BattlegroundAV.h:131
Definition: BattlegroundAV.h:340
BG_AV_NodeInfo m_Nodes[BG_AV_NODES_MAX]
Definition: BattlegroundAV.h:1685
Definition: BattlegroundAV.h:150
Definition: SharedDefines.h:993
Definition: BattlegroundAV.h:178
Position const BG_AV_CreaturePos[AV_CPLACE_MAX]
Definition: BattlegroundAV.h:630
Definition: BattlegroundAV.h:305
Definition: BattlegroundAV.h:306
Definition: BattlegroundAV.h:133
Definition: BattlegroundAV.h:309
Definition: BattlegroundAV.h:348
BG_AV_Nodes GetNodeThroughObject(uint32 object)
Definition: BattlegroundAV.cpp:774
Definition: BattlegroundAV.h:234

+ Here is the call graph for this function:

void BattlegroundAV::StartingEventCloseDoors ( )
overridevirtual

Reimplemented from Battleground.

410 {
413 }
Definition: BattlegroundAV.h:233
void DoorClose(uint32 type)
Definition: Battleground.cpp:1506
Definition: BattlegroundAV.h:234

+ Here is the call graph for this function:

void BattlegroundAV::StartingEventOpenDoors ( )
overridevirtual

Reimplemented from Battleground.

416 {
417  TC_LOG_DEBUG("bg.battleground", "BG_AV: start spawning mine stuff");
422  for (uint8 mine = AV_NORTH_MINE; mine <= AV_SOUTH_MINE; mine++) //mine population
423  ChangeMineOwner(mine, AV_NEUTRAL_TEAM, true);
424 
427 
430 
431  // Achievement: The Alterac Blitz
433 }
Definition: Battleground.h:129
void StartTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry)
Definition: Battleground.cpp:1905
Definition: BattlegroundAV.h:111
Definition: BattlegroundAV.h:108
Definition: DBCEnums.h:183
void SpawnBGObject(uint32 type, uint32 respawntime)
Definition: Battleground.cpp:1564
Definition: BattlegroundAV.h:233
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
#define BG_AV_EVENT_START_BATTLE
Definition: BattlegroundAV.h:51
uint16_t uint16
Definition: Define.h:151
void DoorOpen(uint32 type)
Definition: Battleground.cpp:1522
void ChangeMineOwner(uint8 mine, uint32 team, bool initial=false)
Definition: BattlegroundAV.cpp:607
Definition: BattlegroundAV.h:308
Definition: BattlegroundAV.h:307
Definition: BattlegroundAV.h:1332
uint8_t uint8
Definition: Define.h:152
Definition: BattlegroundAV.h:1333
void UpdateWorldState(uint32 variable, uint32 value, bool hidden=false)
Definition: Battleground.cpp:735
Definition: BattlegroundAV.h:107
Definition: BattlegroundAV.h:306
Definition: BattlegroundAV.h:309
Definition: BattlegroundAV.h:234

+ Here is the call graph for this function:

void BattlegroundAV::UpdateNodeWorldState ( BG_AV_Nodes  node)
private
1054 {
1055  if (StaticNodeInfo const* nodeInfo = GetStaticNodeInfo(node))
1056  {
1057  uint16 owner = m_Nodes[node].Owner;
1058  BG_AV_States state = m_Nodes[node].State;
1059 
1060  UpdateWorldState(nodeInfo->WorldStateIds.AllianceAssault, owner == ALLIANCE && state == POINT_ASSAULTED);
1061  UpdateWorldState(nodeInfo->WorldStateIds.AllianceControl, owner == ALLIANCE && state >= POINT_DESTROYED);
1062  UpdateWorldState(nodeInfo->WorldStateIds.HordeAssault, owner == HORDE && state == POINT_ASSAULTED);
1063  UpdateWorldState(nodeInfo->WorldStateIds.HordeControl, owner == HORDE && state >= POINT_DESTROYED);
1064  }
1065 
1066  if (node == BG_AV_NODES_SNOWFALL_GRAVE)
1068 }
Definition: BattlegroundAV.h:1323
Definition: BattlegroundAV.h:1359
Definition: BattlegroundAV.h:111
uint16 Owner
Definition: BattlegroundAV.h:1545
Definition: SharedDefines.h:1000
BG_AV_States State
Definition: BattlegroundAV.h:1541
uint16_t uint16
Definition: Define.h:151
BG_AV_States
Definition: BattlegroundAV.h:1320
Definition: BattlegroundAV.h:165
Definition: SharedDefines.h:999
StaticNodeInfo const * GetStaticNodeInfo(BG_AV_Nodes node) const
Definition: BattlegroundAV.h:1658
void UpdateWorldState(uint32 variable, uint32 value, bool hidden=false)
Definition: Battleground.cpp:735
Definition: BattlegroundAV.h:1482
BG_AV_NodeInfo m_Nodes[BG_AV_NODES_MAX]
Definition: BattlegroundAV.h:1685
Definition: BattlegroundAV.h:1324

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool BattlegroundAV::UpdatePlayerScore ( Player player,
uint32  type,
uint32  value,
bool  doAddHonor = true 
)
overridevirtual

Reimplemented from Battleground.

529 {
530  if (!Battleground::UpdatePlayerScore(player, type, value, doAddHonor))
531  return false;
532 
533  switch (type)
534  {
537  break;
540  break;
543  break;
546  break;
547  default:
548  break;
549  }
550  return true;
551 }
virtual bool UpdatePlayerScore(Player *player, uint32 type, uint32 value, bool doAddHonor=true)
Definition: Battleground.cpp:1381
Definition: BattlegroundAV.h:1478
Definition: BattlegroundScore.h:46
Definition: BattlegroundScore.h:44
Definition: BattlegroundAV.h:1479
Definition: BattlegroundScore.h:45
Definition: BattlegroundAV.h:1477
Definition: BattlegroundScore.h:43
const FieldDescriptor value
Definition: descriptor.h:1522
Definition: BattlegroundAV.h:1476

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void BattlegroundAV::UpdateScore ( uint16  team,
int16  points 
)
251 { //note: to remove reinforcementpoints points must be negative, for adding reinforcements points must be positive
252  ASSERT(team == ALLIANCE || team == HORDE);
253  uint8 teamindex = GetTeamIndexByTeamId(team); //0=ally 1=horde
254  m_Team_Scores[teamindex] += points;
255 
257  if (points < 0)
258  {
259  if (m_Team_Scores[teamindex] < 1)
260  {
261  m_Team_Scores[teamindex]=0;
262  EndBattleground(((teamindex == a class="code" href="../../de/d0a/SharedDefines_8h.html#a7513eda5ac39f7f649b82c80de7c324da80bb98f9049563b07d3b738a0783366a">TEAM_HORDE)?ALLIANCE:HORDE));
263  }
264  else if (!m_IsInformedNearVictory[teamindex] && m_Team_Scores[teamindex] < SEND_MSG_NEAR_LOSE)
265  {
268  m_IsInformedNearVictory[teamindex] = true;
269  }
270  }
271 }
Definition: Language.h:1035
Definition: Language.h:1034
#define SEND_MSG_NEAR_LOSE
Definition: BattlegroundAV.h:30
bool m_IsInformedNearVictory[2]
Definition: BattlegroundAV.h:1694
static TeamId GetTeamIndexByTeamId(uint32 Team)
Definition: Battleground.h:399
Definition: SharedDefines.h:1000
int32 m_Team_Scores[2]
Definition: BattlegroundAV.h:1682
void SendMessageToAll(uint32 entry, ChatMsg type, Player const *source=NULL)
Definition: Battleground.cpp:1706
void PlaySoundToAll(uint32 SoundID)
Definition: Battleground.cpp:681
Definition: BattlegroundAV.h:92
Definition: BattlegroundAV.h:1330
Definition: BattlegroundAV.h:1331
Definition: SharedDefines.h:999
Definition: SharedDefines.h:4268
void EndBattleground(uint32 winner) override
Definition: BattlegroundAV.cpp:441
Definition: SharedDefines.h:4269
uint8_t uint8
Definition: Define.h:152
#define ASSERT
Definition: Errors.h:55
void UpdateWorldState(uint32 variable, uint32 value, bool hidden=false)
Definition: Battleground.cpp:735
Definition: SharedDefines.h:993

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

bool BattlegroundAV::m_CaptainAlive[2]
private
uint32 BattlegroundAV::m_CaptainBuffTimer[2]
private
bool BattlegroundAV::m_IsInformedNearVictory[2]
private
uint32 BattlegroundAV::m_Mine_Owner[2]
private
uint32 BattlegroundAV::m_Mine_PrevOwner[2]
private
uint32 BattlegroundAV::m_Mine_Reclaim_Timer[2]
private
int32 BattlegroundAV::m_Mine_Timer
private
BG_AV_NodeInfo BattlegroundAV::m_Nodes[BG_AV_NODES_MAX]
private
uint32 BattlegroundAV::m_Team_QuestStatus[2][9]
private
int32 BattlegroundAV::m_Team_Scores[2]
private

The documentation for this class was generated from the following files: