TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
BfWGGameObjectBuilding Struct Reference

#include <BattlefieldWG.h>

Public Member Functions

 BfWGGameObjectBuilding (BattlefieldWG *wg, WintergraspGameObjectBuildingType type, uint32 worldState)
 
void Init (GameObject *go)
 
ObjectGuid constGetGUID () const
 
void Rebuild ()
 
void Damaged ()
 
void Destroyed ()
 
void UpdateCreatureAndGo ()
 
void UpdateTurretAttack (bool disable)
 
void FillInitialWorldStates (WorldPackets::WorldState::InitWorldStates &packet)
 
void Save ()
 

Private Attributes

BattlefieldWG_wg
 
ObjectGuid _buildGUID
 
TeamId _teamControl
 
WintergraspGameObjectBuildingType _type
 
uint32 _worldState
 
WintergraspGameObjectState _state
 
StaticWintergraspTowerInfo const_staticTowerInfo
 
GuidSet m_GameObjectList [BG_TEAMS_COUNT]
 
GuidSet m_CreatureBottomList [BG_TEAMS_COUNT]
 
GuidSet m_CreatureTopList [BG_TEAMS_COUNT]
 
GuidSet m_TowerCannonBottomList
 
GuidSet m_TurretTopList
 

Constructor & Destructor Documentation

BfWGGameObjectBuilding::BfWGGameObjectBuilding ( BattlefieldWG wg,
WintergraspGameObjectBuildingType  type,
uint32  worldState 
)
1055 {
1056  ASSERT(wg);
1057 
1058  _wg = wg;
1060  _type = type;
1061  _worldState = worldState;
1063  _staticTowerInfo = nullptr;
1064 }
Definition: SharedDefines.h:994
uint32 _worldState
Definition: BattlefieldWG.h:1114
StaticWintergraspTowerInfo const * _staticTowerInfo
Definition: BattlefieldWG.h:1118
TeamId _teamControl
Definition: BattlefieldWG.h:1111
BattlefieldWG * _wg
Definition: BattlefieldWG.h:1105
WintergraspGameObjectBuildingType _type
Definition: BattlefieldWG.h:1113
Definition: BattlefieldWG.h:463
#define ASSERT
Definition: Errors.h:55
WintergraspGameObjectState _state
Definition: BattlefieldWG.h:1116

Member Function Documentation

void BfWGGameObjectBuilding::Damaged ( )
1104 {
1105  // Update worldstate
1108 
1109  // Send warning message
1110  if (_staticTowerInfo)
1112 
1114  if (Creature* creature = _wg->GetCreature(guid))
1115  _wg->HideNpc(creature);
1116 
1117  for (ObjectGuid guid : m_TurretTopList)
1118  if (Creature* creature = _wg->GetCreature(guid))
1119  _wg->HideNpc(creature);
1120 
1125 }
struct StaticWintergraspTowerInfo::@210 TextIds
void HideNpc(Creature *creature)
Definition: Battlefield.cpp:472
Definition: BattlefieldWG.h:457
Definition: Creature.h:467
uint8 Damaged
Definition: BattlefieldWG.h:662
void SendWarning(uint8 id, WorldObject const *target=nullptr)
Definition: Battlefield.cpp:433
GuidSet m_TurretTopList
Definition: BattlefieldWG.h:1127
uint32 _worldState
Definition: BattlefieldWG.h:1114
StaticWintergraspTowerInfo const * _staticTowerInfo
Definition: BattlefieldWG.h:1118
GuidSet m_CreatureTopList[BG_TEAMS_COUNT]
Definition: BattlefieldWG.h:1125
Definition: BattlefieldWG.h:471
Creature * GetCreature(ObjectGuid guid)
Definition: Battlefield.cpp:845
TeamId _teamControl
Definition: BattlefieldWG.h:1111
BattlefieldWG * _wg
Definition: BattlefieldWG.h:1105
WintergraspGameObjectBuildingType _type
Definition: BattlefieldWG.h:1113
void UpdateDamagedTowerCount(TeamId team)
Called when a tower is damaged.
Definition: BattlefieldWG.cpp:943
TeamId GetAttackerTeam() const
Definition: Battlefield.h:272
void SendUpdateWorldState(uint32 variable, uint32 value, bool hidden=false)
Update data of a worldstate to all players present in zone.
Definition: Battlefield.cpp:439
WintergraspGameObjectState
Definition: BattlefieldWG.h:461
Definition: ObjectGuid.h:189
TeamId GetDefenderTeam() const
Definition: Battlefield.h:271
Definition: BattlefieldWG.h:458
WintergraspGameObjectState _state
Definition: BattlefieldWG.h:1116

+ Here is the call graph for this function:

void BfWGGameObjectBuilding::Destroyed ( )
1128 {
1129  // Update worldstate
1132 
1133  // Warn players
1134  if (_staticTowerInfo)
1136 
1137  switch (_type)
1138  {
1139  // Inform the global wintergrasp script of the destruction of this object
1143  break;
1145  if (GameObject* build = _wg->GetGameObject(_buildGUID))
1147  go->SetGoState(GO_STATE_ACTIVE);
1148  _wg->SetRelicInteractible(true);
1149  if (_wg->GetRelic())
1151  else
1152  TC_LOG_ERROR("bg.battlefield.wg", "Titan Relic not found.");
1153  break;
1154  default:
1155  break;
1156  }
1157 
1159 }
struct StaticWintergraspTowerInfo::@210 TextIds
Definition: BattlefieldWG.h:457
GameObject * FindNearestGameObject(uint32 entry, float range) const
Definition: Object.cpp:2452
ObjectGuid _buildGUID
Definition: BattlefieldWG.h:1108
Definition: BattlefieldWG.h:472
Definition: BattlefieldWG.h:580
Definition: SharedDefines.h:2121
void SendWarning(uint8 id, WorldObject const *target=nullptr)
Definition: Battlefield.cpp:433
Definition: BattlefieldWG.h:456
uint32 _worldState
Definition: BattlefieldWG.h:1114
StaticWintergraspTowerInfo const * _staticTowerInfo
Definition: BattlefieldWG.h:1118
void BrokenWallOrTower(TeamId team)
Called when a wall/tower is broken.
Definition: BattlefieldWG.cpp:853
Definition: GameObject.h:880
TeamId _teamControl
Definition: BattlefieldWG.h:1111
BattlefieldWG * _wg
Definition: BattlefieldWG.h:1105
Definition: UpdateFields.h:319
Definition: GameObject.h:822
GameObject * GetRelic()
Return pointer to relic object.
Definition: BattlefieldWG.h:383
WintergraspGameObjectBuildingType _type
Definition: BattlefieldWG.h:1113
void RemoveFlag(uint16 index, uint32 oldFlag)
Definition: Object.cpp:1214
void SetRelicInteractible(bool allow)
Define if player can interact with the relic.
Definition: BattlefieldWG.h:392
uint8 Destroyed
Definition: BattlefieldWG.h:663
void SendUpdateWorldState(uint32 variable, uint32 value, bool hidden=false)
Update data of a worldstate to all players present in zone.
Definition: Battlefield.cpp:439
WintergraspGameObjectState
Definition: BattlefieldWG.h:461
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207
Definition: BattlefieldWG.h:458
void UpdatedDestroyedTowerCount(TeamId team)
Called when tower is broken.
Definition: BattlefieldWG.cpp:867
WintergraspGameObjectState _state
Definition: BattlefieldWG.h:1116
GameObject * GetGameObject(ObjectGuid guid)
Definition: Battlefield.cpp:852

+ Here is the call graph for this function:

void BfWGGameObjectBuilding::FillInitialWorldStates ( WorldPackets::WorldState::InitWorldStates packet)
1415 {
1416  packet.Worldstates.emplace_back(uint32(_worldState), int32(_state));
1417 }
std::list< WorldStateInfo > Worldstates
Definition: WorldStatePackets.h:47
uint32 _worldState
Definition: BattlefieldWG.h:1114
int32_t int32
Definition: g3dmath.h:167
uint32_t uint32
Definition: g3dmath.h:168
WintergraspGameObjectState _state
Definition: BattlefieldWG.h:1116
ObjectGuid const& BfWGGameObjectBuilding::GetGUID ( ) const
inline
1133 { return _buildGUID; }
ObjectGuid _buildGUID
Definition: BattlefieldWG.h:1108
void BfWGGameObjectBuilding::Init ( GameObject go)
1162 {
1163  if (!go)
1164  return;
1165 
1166  // GameObject associated to object
1167  _buildGUID = go->GetGUID();
1168 
1169  switch (_type)
1170  {
1175  _teamControl = _wg->GetDefenderTeam(); // Objects that are part of the keep should be the defender's
1176  break;
1178  _teamControl = _wg->GetAttackerTeam(); // The towers in the south should be the attacker's
1179  break;
1180  default:
1182  break;
1183  }
1184 
1186  switch (_state)
1187  {
1192  break;
1197  break;
1202  break;
1203  default:
1204  break;
1205  }
1206 
1207  int32 towerId = -1;
1208  switch (go->GetEntry())
1209  {
1212  break;
1215  break;
1218  break;
1221  break;
1224  break;
1227  break;
1230  break;
1231  }
1232 
1233  if (towerId > 3) // Attacker towers
1234  {
1235  // Spawn associate gameobjects
1236  for (uint8 i = 0; i < AttackTowers[towerId - 4].nbObject; i++)
1237  {
1238  WintergraspObjectPositionData const& gobData = AttackTowers[towerId - 4].GameObject[i];
1239  if (GameObject* goHorde = _wg->SpawnGameObject(gobData.entryHorde, gobData.x, gobData.y, gobData.z, gobData.o))
1240  m_GameObjectList[TEAM_HORDE].insert(goHorde->GetGUID());
1241  if (GameObject* goAlliance = _wg->SpawnGameObject(gobData.entryAlliance, gobData.x, gobData.y, gobData.z, gobData.o))
1242  m_GameObjectList[TEAM_ALLIANCE].insert(goAlliance->GetGUID());
1243  }
1244 
1245  // Spawn associate npc bottom
1246  for (uint8 i = 0; i < AttackTowers[towerId - 4].nbCreatureBottom; i++)
1247  {
1249  if (Creature* creature = _wg->SpawnCreature(creatureData.entryHorde, creatureData.x, creatureData.y, creatureData.z, creatureData.o, TEAM_HORDE))
1250  m_CreatureBottomList[TEAM_HORDE].insert(creature->GetGUID());
1251  if (Creature* creature = _wg->SpawnCreature(creatureData.entryAlliance, creatureData.x, creatureData.y, creatureData.z, creatureData.o, TEAM_ALLIANCE))
1252  m_CreatureBottomList[TEAM_ALLIANCE].insert(creature->GetGUID());
1253  }
1254 
1255  // Spawn associate npc top
1256  for (uint8 i = 0; i < AttackTowers[towerId - 4].nbCreatureTop; i++)
1257  {
1258  WintergraspObjectPositionData const& creatureData = AttackTowers[towerId - 4].CreatureTop[i];
1259  if (Creature* creature = _wg->SpawnCreature(creatureData.entryHorde, creatureData.x, creatureData.y, creatureData.z, creatureData.o, TEAM_HORDE))
1260  m_CreatureTopList[TEAM_HORDE].insert(creature->GetGUID());
1261  if (Creature* creature = _wg->SpawnCreature(creatureData.entryAlliance, creatureData.x, creatureData.y, creatureData.z, creatureData.o, TEAM_ALLIANCE))
1262  m_CreatureTopList[TEAM_ALLIANCE].insert(creature->GetGUID());
1263  }
1264  }
1265 
1266  if (towerId >= 0)
1267  {
1268  ASSERT(towerId < WG_MAX_TOWER);
1269  _staticTowerInfo = &TowerData[towerId];
1270 
1271  // Spawn Turret bottom
1272  for (uint8 i = 0; i < TowerCannon[towerId].nbTowerCannonBottom; i++)
1273  {
1274  Position const& turretPos = TowerCannon[towerId].TowerCannonBottom[i];
1276  {
1277  m_TowerCannonBottomList.insert(turret->GetGUID());
1278  switch (go->GetEntry())
1279  {
1284  turret->setFaction(WintergraspFaction[_wg->GetDefenderTeam()]);
1285  break;
1289  turret->setFaction(WintergraspFaction[_wg->GetAttackerTeam()]);
1290  break;
1291  }
1292  _wg->HideNpc(turret);
1293  }
1294  }
1295 
1296  // Spawn Turret top
1297  for (uint8 i = 0; i < TowerCannon[towerId].nbTurretTop; i++)
1298  {
1299  Position const& towerCannonPos = TowerCannon[towerId].TurretTop[i];
1300  if (Creature* turret = _wg->SpawnCreature(NPC_WINTERGRASP_TOWER_CANNON, towerCannonPos, TeamId(0)))
1301  {
1302  m_TurretTopList.insert(turret->GetGUID());
1303  switch (go->GetEntry())
1304  {
1309  turret->setFaction(WintergraspFaction[_wg->GetDefenderTeam()]);
1310  break;
1314  turret->setFaction(WintergraspFaction[_wg->GetAttackerTeam()]);
1315  break;
1316  }
1317  _wg->HideNpc(turret);
1318  }
1319  }
1321  }
1322 }
uint8 const WG_MAX_TOWER
Definition: BattlefieldWG.h:449
Definition: BattlefieldWG.h:479
Definition: BattlefieldWG.h:467
Definition: BattlefieldWG.h:483
void HideNpc(Creature *creature)
Definition: Battlefield.cpp:472
uint32 entryHorde
Definition: BattlefieldWG.h:604
Definition: BattlefieldWG.h:457
StaticWintergraspTowerInfo const TowerData[WG_MAX_TOWER]
Definition: BattlefieldWG.h:667
uint32 const WintergraspFaction[]
Definition: BattlefieldWG.h:438
uint8 nbCreatureTop
Definition: BattlefieldWG.h:807
Definition: BattlefieldWG.h:470
arena_t NULL
Definition: jemalloc_internal.h:624
ObjectGuid _buildGUID
Definition: BattlefieldWG.h:1108
WintergraspObjectPositionData CreatureTop[5]
Definition: BattlefieldWG.h:808
Definition: BattlefieldWG.h:472
ObjectData const creatureData[]
Definition: instance_blackrock_caverns.cpp:22
Definition: Creature.h:467
Definition: BattlefieldWG.h:214
Definition: BattlefieldWG.h:466
Position TowerCannonBottom[5]
Definition: BattlefieldWG.h:923
#define sWorld
Definition: World.h:887
float y
Definition: BattlefieldWG.h:601
GuidSet m_CreatureBottomList[BG_TEAMS_COUNT]
Definition: BattlefieldWG.h:1124
Definition: BattlefieldWG.h:455
Definition: BattlefieldWG.h:571
uint8 nbCreatureBottom
Definition: BattlefieldWG.h:805
const WintergraspTowerData AttackTowers[WG_MAX_ATTACKTOWERS]
Definition: BattlefieldWG.h:814
GameObject * SpawnGameObject(uint32 entry, float x, float y, float z, float o)
Definition: Battlefield.cpp:812
Definition: SharedDefines.h:994
Definition: BattlefieldWG.h:456
GuidSet m_TurretTopList
Definition: BattlefieldWG.h:1127
Definition: BattlefieldWG.h:480
Definition: SharedDefines.h:2145
virtual Creature * SpawnCreature(uint32 entry, float x, float y, float z, float o, TeamId)
Definition: Battlefield.cpp:777
uint8 nbTowerCannonBottom
Definition: BattlefieldWG.h:922
Definition: BattlefieldWG.h:482
uint32 _worldState
Definition: BattlefieldWG.h:1114
uint8 nbTurretTop
Definition: BattlefieldWG.h:924
Definition: BattlefieldWG.h:574
const WintergraspTowerCannonData TowerCannon[WG_MAX_TOWER_CANNON]
Definition: BattlefieldWG.h:930
Definition: BattlefieldWG.h:569
StaticWintergraspTowerInfo const * _staticTowerInfo
Definition: BattlefieldWG.h:1118
Definition: BattlefieldWG.h:468
Definition: SharedDefines.h:2146
GuidSet m_CreatureTopList[BG_TEAMS_COUNT]
Definition: BattlefieldWG.h:1125
Definition: BattlefieldWG.h:471
Definition: BattlefieldWG.h:477
Definition: BattlefieldWG.h:573
void UpdateCreatureAndGo()
Definition: BattlefieldWG.cpp:1324
int32_t int32
Definition: Define.h:146
float o
Definition: BattlefieldWG.h:603
Definition: SharedDefines.h:992
WintergraspObjectPositionData GameObject[6]
Definition: BattlefieldWG.h:802
Definition: GameObject.h:880
WintergraspObjectPositionData CreatureBottom[9]
Definition: BattlefieldWG.h:806
TeamId _teamControl
Definition: BattlefieldWG.h:1111
BattlefieldWG * _wg
Definition: BattlefieldWG.h:1105
TeamId
Definition: SharedDefines.h:990
Definition: BattlefieldWG.h:453
WintergraspGameObjectBuildingType _type
Definition: BattlefieldWG.h:1113
ObjectGuid const & GetGUID() const
Definition: Object.h:105
Definition: BattlefieldWG.h:478
TeamId GetAttackerTeam() const
Definition: Battlefield.h:272
Definition: BattlefieldWG.h:481
Definition: BattlefieldWG.h:598
Definition: BattlefieldWG.h:570
Definition: BattlefieldWG.h:575
Position TurretTop[5]
Definition: BattlefieldWG.h:925
GuidSet m_GameObjectList[BG_TEAMS_COUNT]
Definition: BattlefieldWG.h:1121
float x
Definition: BattlefieldWG.h:600
uint8 nbObject
Definition: BattlefieldWG.h:801
uint8_t uint8
Definition: Define.h:152
Definition: Position.h:27
#define ASSERT
Definition: Errors.h:55
WintergraspGameObjectState
Definition: BattlefieldWG.h:461
uint32 GetEntry() const
Definition: Object.h:107
TeamId GetDefenderTeam() const
Definition: Battlefield.h:271
GuidSet m_TowerCannonBottomList
Definition: BattlefieldWG.h:1126
Definition: SharedDefines.h:993
void SetDestructibleState(GameObjectDestructibleState state, Player *eventInvoker=NULL, bool setHealth=false)
Definition: GameObject.cpp:2022
Definition: BattlefieldWG.h:458
uint32 entryAlliance
Definition: BattlefieldWG.h:605
float z
Definition: BattlefieldWG.h:602
Definition: BattlefieldWG.h:465
WintergraspGameObjectState _state
Definition: BattlefieldWG.h:1116
Definition: BattlefieldWG.h:464
Definition: SharedDefines.h:2147
Definition: BattlefieldWG.h:469
Definition: BattlefieldWG.h:568

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void BfWGGameObjectBuilding::Rebuild ( )
1067 {
1068  switch (_type)
1069  {
1074  _teamControl = _wg->GetDefenderTeam(); // Objects that are part of the keep should be the defender's
1075  break;
1077  _teamControl = _wg->GetAttackerTeam(); // The towers in the south should be the attacker's
1078  break;
1079  default:
1081  break;
1082  }
1083 
1084  if (GameObject* build = _wg->GetGameObject(_buildGUID))
1085  {
1086  // Rebuild gameobject
1087  if (build->IsDestructibleBuilding())
1088  {
1089  build->SetDestructibleState(GO_DESTRUCTIBLE_REBUILDING, NULL, true);
1090  if (build->GetEntry() == GO_WINTERGRASP_VAULT_GATE)
1092  go->SetGoState(GO_STATE_READY);
1093 
1094  // Update worldstate
1097  }
1099  build->SetFaction(WintergraspFaction[_teamControl]);
1100  }
1101 }
Definition: BattlefieldWG.h:457
GameObject * FindNearestGameObject(uint32 entry, float range) const
Definition: Object.cpp:2452
uint32 const WintergraspFaction[]
Definition: BattlefieldWG.h:438
Definition: BattlefieldWG.h:470
arena_t NULL
Definition: jemalloc_internal.h:624
ObjectGuid _buildGUID
Definition: BattlefieldWG.h:1108
Definition: BattlefieldWG.h:578
Definition: BattlefieldWG.h:580
Definition: BattlefieldWG.h:455
Definition: SharedDefines.h:994
Definition: BattlefieldWG.h:456
uint32 _worldState
Definition: BattlefieldWG.h:1114
void UpdateCreatureAndGo()
Definition: BattlefieldWG.cpp:1324
Definition: GameObject.h:880
TeamId _teamControl
Definition: BattlefieldWG.h:1111
BattlefieldWG * _wg
Definition: BattlefieldWG.h:1105
Definition: BattlefieldWG.h:453
WintergraspGameObjectBuildingType _type
Definition: BattlefieldWG.h:1113
Definition: GameObject.h:823
TeamId GetAttackerTeam() const
Definition: Battlefield.h:272
void SendUpdateWorldState(uint32 variable, uint32 value, bool hidden=false)
Update data of a worldstate to all players present in zone.
Definition: Battlefield.cpp:439
WintergraspGameObjectState
Definition: BattlefieldWG.h:461
TeamId GetDefenderTeam() const
Definition: Battlefield.h:271
Definition: BattlefieldWG.h:458
WintergraspGameObjectState _state
Definition: BattlefieldWG.h:1116
GameObject * GetGameObject(ObjectGuid guid)
Definition: Battlefield.cpp:852
Definition: SharedDefines.h:2147

+ Here is the call graph for this function:

void BfWGGameObjectBuilding::Save ( )
1420 {
1421  sWorld->setWorldState(_worldState, _state);
1422 }
#define sWorld
Definition: World.h:887
uint32 _worldState
Definition: BattlefieldWG.h:1114
WintergraspGameObjectState _state
Definition: BattlefieldWG.h:1116
void BfWGGameObjectBuilding::UpdateCreatureAndGo ( )
1325 {
1327  if (Creature* creature = _wg->GetCreature(guid))
1328  _wg->HideNpc(creature);
1329 
1331  if (Creature* creature = _wg->GetCreature(guid))
1332  _wg->ShowNpc(creature, true);
1333 
1335  if (Creature* creature = _wg->GetCreature(guid))
1336  _wg->HideNpc(creature);
1337 
1339  if (Creature* creature = _wg->GetCreature(guid))
1340  _wg->ShowNpc(creature, true);
1341 
1343  if (GameObject* go = _wg->GetGameObject(guid))
1344  go->SetRespawnTime(RESPAWN_ONE_DAY);
1345 
1347  if (GameObject* go = _wg->GetGameObject(guid))
1348  go->SetRespawnTime(RESPAWN_IMMEDIATELY);
1349 }
Definition: Battleground.h:129
void HideNpc(Creature *creature)
Definition: Battlefield.cpp:472
Definition: Creature.h:467
GuidSet m_CreatureBottomList[BG_TEAMS_COUNT]
Definition: BattlefieldWG.h:1124
void ShowNpc(Creature *creature, bool aggressive)
Definition: Battlefield.cpp:481
GuidSet m_CreatureTopList[BG_TEAMS_COUNT]
Definition: BattlefieldWG.h:1125
Creature * GetCreature(ObjectGuid guid)
Definition: Battlefield.cpp:845
Definition: GameObject.h:880
Definition: Battleground.h:128
BattlefieldWG * _wg
Definition: BattlefieldWG.h:1105
TeamId GetAttackerTeam() const
Definition: Battlefield.h:272
GuidSet m_GameObjectList[BG_TEAMS_COUNT]
Definition: BattlefieldWG.h:1121
Definition: ObjectGuid.h:189
TeamId GetDefenderTeam() const
Definition: Battlefield.h:271
GameObject * GetGameObject(ObjectGuid guid)
Definition: Battlefield.cpp:852

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void BfWGGameObjectBuilding::UpdateTurretAttack ( bool  disable)
1352 {
1353  for (ObjectGuid guid : m_TowerCannonBottomList)
1354  {
1355  if (Creature* creature = _wg->GetCreature(guid))
1356  {
1357  if (disable)
1358  _wg->HideNpc(creature);
1359  else
1360  _wg->ShowNpc(creature, true);
1361 
1362  switch (_buildGUID.GetEntry())
1363  {
1368  {
1369  creature->setFaction(WintergraspFaction[_wg->GetDefenderTeam()]);
1370  break;
1371  }
1375  {
1376  creature->setFaction(WintergraspFaction[_wg->GetAttackerTeam()]);
1377  break;
1378  }
1379  }
1380  }
1381  }
1382 
1383  for (ObjectGuid guid : m_TurretTopList)
1384  {
1385  if (Creature* creature = _wg->GetCreature(guid))
1386  {
1387  if (disable)
1388  _wg->HideNpc(creature);
1389  else
1390  _wg->ShowNpc(creature, true);
1391 
1392  switch (_buildGUID.GetEntry())
1393  {
1398  {
1399  creature->setFaction(WintergraspFaction[_wg->GetDefenderTeam()]);
1400  break;
1401  }
1405  {
1406  creature->setFaction(WintergraspFaction[_wg->GetAttackerTeam()]);
1407  break;
1408  }
1409  }
1410  }
1411  }
1412 }
void HideNpc(Creature *creature)
Definition: Battlefield.cpp:472
uint32 const WintergraspFaction[]
Definition: BattlefieldWG.h:438
ObjectGuid _buildGUID
Definition: BattlefieldWG.h:1108
Definition: Creature.h:467
Definition: BattlefieldWG.h:571
GuidSet m_TurretTopList
Definition: BattlefieldWG.h:1127
void ShowNpc(Creature *creature, bool aggressive)
Definition: Battlefield.cpp:481
Definition: BattlefieldWG.h:574
Definition: BattlefieldWG.h:569
Definition: BattlefieldWG.h:573
Creature * GetCreature(ObjectGuid guid)
Definition: Battlefield.cpp:845
BattlefieldWG * _wg
Definition: BattlefieldWG.h:1105
uint32 GetEntry() const
Definition: ObjectGuid.h:220
TeamId GetAttackerTeam() const
Definition: Battlefield.h:272
Definition: BattlefieldWG.h:570
Definition: BattlefieldWG.h:575
Definition: ObjectGuid.h:189
TeamId GetDefenderTeam() const
Definition: Battlefield.h:271
GuidSet m_TowerCannonBottomList
Definition: BattlefieldWG.h:1126
Definition: BattlefieldWG.h:568

+ Here is the call graph for this function:

Member Data Documentation

ObjectGuid BfWGGameObjectBuilding::_buildGUID
private
WintergraspGameObjectState BfWGGameObjectBuilding::_state
private
StaticWintergraspTowerInfo const* BfWGGameObjectBuilding::_staticTowerInfo
private
TeamId BfWGGameObjectBuilding::_teamControl
private
WintergraspGameObjectBuildingType BfWGGameObjectBuilding::_type
private
BattlefieldWG* BfWGGameObjectBuilding::_wg
private
uint32 BfWGGameObjectBuilding::_worldState
private
GuidSet BfWGGameObjectBuilding::m_CreatureBottomList[BG_TEAMS_COUNT]
private
GuidSet BfWGGameObjectBuilding::m_CreatureTopList[BG_TEAMS_COUNT]
private
GuidSet BfWGGameObjectBuilding::m_GameObjectList[BG_TEAMS_COUNT]
private
GuidSet BfWGGameObjectBuilding::m_TowerCannonBottomList
private
GuidSet BfWGGameObjectBuilding::m_TurretTopList
private

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