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

#include <BattlegroundIC.h>

Public Member Functions

 BattlegroundIC ()
 
 ~BattlegroundIC ()
 
void AddPlayer (Player *player) override
 
void StartingEventCloseDoors () override
 
void StartingEventOpenDoors () override
 
void PostUpdateImpl (uint32 diff) override
 Post-update hook. More...
 
void RemovePlayer (Player *player, ObjectGuid guid, uint32 team) override
 
void HandleAreaTrigger (Player *player, uint32 trigger, bool entered) override
 
bool SetupBattleground () override
 
void SpawnLeader (uint32 teamid)
 
void HandleKillUnit (Creature *unit, Player *killer) override
 
void HandleKillPlayer (Player *player, Player *killer) override
 
void EndBattleground (uint32 winner) override
 
void EventPlayerClickedOnFlag (Player *source, GameObject *) override
 
void DestroyGate (Player *player, GameObject *go) override
 
WorldSafeLocsEntry constGetClosestGraveYard (Player *player) override
 
void FillInitialWorldStates (WorldPackets::WorldState::InitWorldStates &packet) override
 
void HandlePlayerResurrect (Player *player) override
 
uint32 GetNodeState (uint8 nodeType) const
 
bool IsAllNodesControlledByTeam (uint32 team) const override
 
bool IsSpellAllowed (uint32 spellId, Player const *player) const override
 
- Public Member Functions inherited from Battleground
 Battleground ()
 
virtual ~Battleground ()
 
void Update (uint32 diff)
 
virtual void Reset ()
 
virtual void ResetBGSubclass ()
 
void StartTimedAchievement (AchievementCriteriaTimedTypes type, uint32 entry)
 
virtual bool CheckAchievementCriteriaMeet (uint32, Player const *, Unit const *=NULL, uint32=0)
 
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)
 
virtual bool UpdatePlayerScore (Player *player, uint32 type, uint32 value, bool doAddHonor=true)
 
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)
 
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 void HandleQuestComplete (uint32, Player *)
 
virtual bool CanActivateGO (int32, uint32) const
 
uint32 GetTeamScore (uint32 TeamID) const
 
virtual uint32 GetPrematureWinner ()
 
uint8 GetUniqueBracketId () const
 

Private Member Functions

uint32 GetNextBanner (ICNodePoint *node, uint32 team, bool returnDefinitve)
 
uint32 GetGateIDFromEntry (uint32 id)
 
uint32 GetWorldStateFromGateEntry (uint32 id, bool open)
 
void UpdateNodeWorldState (ICNodePoint *node)
 
void HandleCapturedNodes (ICNodePoint *node, bool recapture)
 
void HandleContestedNodes (ICNodePoint *node)
 

Private Attributes

uint32 closeFortressDoorsTimer
 
bool doorsClosed
 
uint32 docksTimer
 
uint32 resourceTimer
 
uint32 siegeEngineWorkshopTimer
 
uint16 factionReinforcements [2]
 
BG_IC_GateState GateStatus [6]
 
ICNodePoint nodePoint [7]
 
TransportgunshipAlliance
 
TransportgunshipHorde
 

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

BattlegroundIC::BattlegroundIC ( )
31 {
34 
39 
40  for (uint8 i = 0; i < 2; ++i)
42 
43  for (uint8 i = 0; i < BG_IC_MAXDOOR; ++i)
45 
46  closeFortressDoorsTimer = CLOSE_DOORS_TIME; // the doors are closed again... in a special way
47  doorsClosed = false;
50 
51  for (uint8 i = NODE_TYPE_REFINERY; i < MAX_NODE_TYPES; ++i)
53 
55 
58 }
Definition: BattlegroundIC.h:447
BG_IC_GateState GateStatus[6]
Definition: BattlegroundIC.h:962
Definition: BattlegroundIC.h:455
bool doorsClosed
Definition: BattlegroundIC.h:957
Definition: Battleground.h:199
Definition: Language.h:1006
Definition: Battleground.h:200
Definition: BattlegroundIC.h:454
Definition: BattlegroundIC.h:450
uint32 siegeEngineWorkshopTimer
Definition: BattlegroundIC.h:960
Definition: BattlegroundIC.h:808
arena_t NULL
Definition: jemalloc_internal.h:624
uint32 closeFortressDoorsTimer
Definition: BattlegroundIC.h:956
Definition: BattlegroundIC.h:451
Definition: Battleground.h:198
Definition: BattlegroundIC.h:448
Definition: BattlegroundIC.h:452
Definition: BattlegroundIC.h:456
Definition: BattlegroundIC.h:198
uint32 resourceTimer
Definition: BattlegroundIC.h:959
#define MAX_REINFORCEMENTS
Definition: BattlegroundIC.h:191
GuidVector BgObjects
Definition: Battleground.h:452
Definition: Language.h:1007
GuidVector BgCreatures
Definition: Battleground.h:453
Definition: BattlegroundIC.h:195
Transport * gunshipAlliance
Definition: BattlegroundIC.h:965
uint32 StartMessageIds[BG_STARTING_EVENT_COUNT]
Definition: Battleground.h:556
Definition: BattlegroundIC.h:197
Definition: BattlegroundIC.h:449
const ICNodePoint nodePointInitial[7]
Definition: BattlegroundIC.h:866
uint32 docksTimer
Definition: BattlegroundIC.h:958
uint16 factionReinforcements[2]
Definition: BattlegroundIC.h:961
ICNodePoint nodePoint[7]
Definition: BattlegroundIC.h:963
Definition: BattlegroundIC.h:795
Definition: BattlegroundIC.h:813
Definition: BattlegroundIC.h:446
Definition: Language.h:1008
uint8_t uint8
Definition: Define.h:152
Definition: BattlegroundIC.h:445
Definition: BattlegroundIC.h:196
Definition: Language.h:1005
Definition: Battleground.h:197
Transport * gunshipHorde
Definition: BattlegroundIC.h:966
Definition: BattlegroundIC.h:823
BattlegroundIC::~BattlegroundIC ( )
60 { }

Member Function Documentation

void BattlegroundIC::AddPlayer ( Player player)
overridevirtual

Reimplemented from Battleground.

246 {
247  Battleground::AddPlayer(player);
248  PlayerScores[player->GetGUID()] = new BattlegroundICScore(player->GetGUID(), player->GetBGTeam());
249 
250  if (nodePoint[NODE_TYPE_QUARRY].nodeState == (player->GetTeamId() == TEAM_ALLIANCE ? NODE_STATE_CONTROLLED_A : NODE_STATE_CONTROLLED_H))
251  player->CastSpell(player, SPELL_QUARRY, true);
252 
253  if (nodePoint[NODE_TYPE_REFINERY].nodeState == (player->GetTeamId() == TEAM_ALLIANCE ? NODE_STATE_CONTROLLED_A : NODE_STATE_CONTROLLED_H))
254  player->CastSpell(player, SPELL_OIL_REFINERY, true);
255 }
Definition: BattlegroundIC.h:709
Definition: BattlegroundIC.h:883
Definition: SharedDefines.h:992
Definition: BattlegroundIC.h:831
ICNodePoint nodePoint[7]
Definition: BattlegroundIC.h:963
Definition: BattlegroundIC.h:813
virtual void AddPlayer(Player *player)
Definition: Battleground.cpp:1079
Definition: BattlegroundIC.h:814
Definition: BattlegroundIC.h:832
Definition: BattlegroundIC.h:710
BattlegroundScoreMap PlayerScores
Definition: Battleground.h:543

+ Here is the call graph for this function:

void BattlegroundIC::DestroyGate ( Player player,
GameObject go 
)
overridevirtual

Reimplemented from Battleground.

792 {
794  uint32 uws_open = GetWorldStateFromGateEntry(go->GetEntry(), true);
795  uint32 uws_close = GetWorldStateFromGateEntry(go->GetEntry(), false);
796  if (uws_open)
797  {
798  UpdateWorldState(uws_close, 0);
799  UpdateWorldState(uws_open, 1);
800  }
801  if (player->GetTeamId() == TEAM_ALLIANCE)
802  {
805  }
806  else
807  {
810  }
811 
812  uint32 lang_entry = 0;
813 
814  switch (go->GetEntry())
815  {
816  case GO_HORDE_GATE_1:
817  lang_entry = LANG_BG_IC_NORTH_GATE_DESTROYED;
818  break;
819  case GO_HORDE_GATE_2:
820  case GO_ALLIANCE_GATE_1:
821  lang_entry = LANG_BG_IC_WEST_GATE_DESTROYED;
822  break;
823  case GO_HORDE_GATE_3:
824  case GO_ALLIANCE_GATE_2:
825  lang_entry = LANG_BG_IC_EAST_GATE_DESTROYED;
826  break;
827  case GO_ALLIANCE_GATE_3:
828  lang_entry = LANG_BG_IC_SOUTH_GATE_DESTROYED;
829  break;
830  default:
831  break;
832  }
833 
834  if (go->GetEntry() == GO_HORDE_GATE_1 || go->GetEntry() == GO_HORDE_GATE_2 || go->GetEntry() == GO_HORDE_GATE_3)
835  {
837  TC_LOG_ERROR("bg.battleground", "Isle of Conquest: There was an error spawning creature %u", BG_IC_NpcSpawnlocs[BG_IC_NPC_OVERLORD_AGMAR].entry);
838  }
839  else if (go->GetEntry() == GO_ALLIANCE_GATE_1 || go->GetEntry() == GO_ALLIANCE_GATE_2 || go->GetEntry() == GO_ALLIANCE_GATE_3)
840  {
842  TC_LOG_ERROR("bg.battleground", "Isle of Conquest: There was an error spawning creature %u", BG_IC_NpcSpawnlocs[BG_IC_NPC_HIGH_COMMANDER_HALFORD_WYRMBANE].entry);
843  }
844 
846 }
BG_IC_GateState GateStatus[6]
Definition: BattlegroundIC.h:962
Definition: BattlegroundIC.h:291
Definition: SharedDefines.h:2125
Definition: Language.h:1013
uint32 GetWorldStateFromGateEntry(uint32 id, bool open)
Definition: BattlegroundIC.h:985
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
GameObject * GetBGObject(uint32 type, bool logError=true)
Definition: Battleground.cpp:1534
arena_t NULL
Definition: jemalloc_internal.h:624
BattlegroundMap * GetBgMap() const
Definition: Battleground.h:356
uint32 GetGateIDFromEntry(uint32 id)
Definition: BattlegroundIC.h:970
Definition: BattlegroundIC.h:113
const ICNpc BG_IC_NpcSpawnlocs[MAX_NORMAL_NPCS_SPAWNS]
Definition: BattlegroundIC.h:471
Definition: BattlegroundIC.h:59
Definition: SharedDefines.h:4267
GuidVector BgCreatures
Definition: Battleground.h:453
Definition: BattlegroundIC.h:360
Definition: BattlegroundIC.h:269
Definition: Language.h:1010
G3D::int16 z
Definition: Vector3int16.h:46
Definition: Language.h:1009
Definition: BattlegroundIC.h:285
uint32_t uint32
Definition: Define.h:150
G3D::int16 y
Definition: Vector2int16.h:38
Definition: SharedDefines.h:992
Definition: Battleground.h:128
Definition: BattlegroundIC.h:797
Definition: UpdateFields.h:319
Definition: BattlegroundIC.h:359
void RemoveFlag(uint16 index, uint32 oldFlag)
Definition: Object.cpp:1214
void DoorOpen(uint32 type)
Definition: Battleground.cpp:1522
Creature * GetCreature(ObjectGuid const &guid)
Definition: Map.cpp:3535
Definition: BattlegroundIC.h:114
void UpdateWorldState(uint32 variable, uint32 value, bool hidden=false)
Definition: Battleground.cpp:735
Definition: Language.h:1014
uint32 GetEntry() const
Definition: Object.h:107
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207
Definition: BattlegroundIC.h:221
Definition: BattlegroundIC.h:61
G3D::int16 x
Definition: Vector2int16.h:37
Definition: Language.h:1015
Definition: Language.h:1012
Definition: BattlegroundIC.h:112
Definition: BattlegroundIC.h:60
void SendMessage2ToAll(uint32 entry, ChatMsg type, Player const *source, uint32 strId1=0, uint32 strId2=0)
Definition: Battleground.cpp:1731

+ Here is the call graph for this function:

void BattlegroundIC::EndBattleground ( uint32  winner)
overridevirtual

Reimplemented from Battleground.

418 {
420 
422 }
Definition: Language.h:1027
arena_t NULL
Definition: jemalloc_internal.h:624
Definition: Language.h:1026
Definition: SharedDefines.h:1000
Definition: SharedDefines.h:4267
virtual void EndBattleground(uint32 winner)
Definition: Battleground.cpp:744
Definition: Language.h:1011
void SendMessage2ToAll(uint32 entry, ChatMsg type, Player const *source, uint32 strId1=0, uint32 strId2=0)
Definition: Battleground.cpp:1731

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Reimplemented from Battleground.

425 {
426  if (GetStatus() != STATUS_IN_PROGRESS)
427  return;
428 
429  // All the node points are iterated to find the clicked one
430  for (uint8 i = 0; i < MAX_NODE_TYPES; ++i)
431  {
432  if (nodePoint[i].gameobject_entry == target_obj->GetEntry())
433  {
434  // THIS SHOULD NEEVEER HAPPEN
435  if (nodePoint[i].faction == player->GetTeamId())
436  return;
437 
438  uint32 nextBanner = GetNextBanner(&nodePoint[i], player->GetTeamId(), false);
439 
440  // we set the new settings of the nodePoint
441  nodePoint[i].faction = player->GetTeamId();
443  nodePoint[i].gameobject_entry = nextBanner;
444 
445  // this is just needed if the next banner is grey
446  if (nodePoint[i].banners[BANNER_A_CONTESTED] == nextBanner || nodePoint[i].banners[BANNER_H_CONTESTED] == nextBanner)
447  {
448  nodePoint[i].timer = BANNER_STATE_CHANGE_TIME; // 1 minute for last change (real faction banner)
449  nodePoint[i].needChange = true;
450 
452 
453  // if we are here means that the point has been lost, or it is the first capture
454 
455  if (nodePoint[i].nodeType != NODE_TYPE_REFINERY && nodePoint[i].nodeType != NODE_TYPE_QUARRY)
456  if (!BgCreatures[BG_IC_NPC_SPIRIT_GUIDE_1 + (nodePoint[i].nodeType) - 2].IsEmpty())
457  DelCreature(BG_IC_NPC_SPIRIT_GUIDE_1 + (nodePoint[i].nodeType) - 2);
458 
460 
464  }
465  else if (nextBanner == nodePoint[i].banners[BANNER_A_CONTROLLED] || nextBanner == nodePoint[i].banners[BANNER_H_CONTROLLED]) // if we are going to spawn the definitve faction banner, we dont need the timer anymore
466  {
468  nodePoint[i].needChange = false;
470  HandleCapturedNodes(&nodePoint[i], true);
472  }
473 
474  GameObject* banner = GetBGObject(nodePoint[i].gameobject_type);
475 
476  if (!banner) // this should never happen
477  return;
478 
479  float cords[4] = {banner->GetPositionX(), banner->GetPositionY(), banner->GetPositionZ(), banner->GetOrientation() };
480 
481  DelObject(nodePoint[i].gameobject_type);
482  if (!AddObject(nodePoint[i].gameobject_type, nodePoint[i].gameobject_entry, cords[0], cords[1], cords[2], cords[3], 0, 0, 0, 0, RESPAWN_ONE_DAY))
483  {
484  TC_LOG_ERROR("bg.battleground", "Isle of Conquest: There was an error spawning a banner (type: %u, entry: %u). Isle of Conquest BG cancelled.", nodePoint[i].gameobject_type, nodePoint[i].gameobject_entry);
485  EndBattleground(0);
486  }
487 
489 
491  // we dont need iterating if we are here
492  // If the needChange bool was set true, we will handle the rest in the Update Map function.
493  return;
494  }
495  }
496 }
Definition: Battleground.h:159
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
void RelocateDeadPlayers(ObjectGuid guideGuid)
Relocate all players in ReviveQueue to the closest graveyard.
Definition: Battleground.cpp:1423
uint32 gameobject_entry
Definition: BattlegroundIC.h:854
Definition: Language.h:1027
virtual bool UpdatePlayerScore(Player *player, uint32 type, uint32 value, bool doAddHonor=true)
Definition: Battleground.cpp:1381
Definition: BattlegroundIC.h:440
uint32 last_entry
Definition: BattlegroundIC.h:860
BattlegroundStatus GetStatus() const
Definition: Battleground.h:266
Definition: BattlegroundIC.h:426
GameObject * GetBGObject(uint32 type, bool logError=true)
Definition: Battleground.cpp:1534
Definition: Language.h:1016
void SetUInt32Value(uint16 index, uint32 value)
Definition: Object.cpp:996
void HandleCapturedNodes(ICNodePoint *node, bool recapture)
Definition: BattlegroundIC.cpp:588
void HandleContestedNodes(ICNodePoint *node)
Definition: BattlegroundIC.cpp:548
Definition: BattlegroundIC.h:437
bool DelObject(uint32 type)
Definition: Battleground.cpp:1658
Definition: Language.h:1026
bool needChange
Definition: BattlegroundIC.h:858
TeamId faction
Definition: BattlegroundIC.h:855
Definition: BattlegroundIC.h:439
uint32 timer
Definition: BattlegroundIC.h:859
float GetOrientation() const
Definition: Position.h:107
void UpdateNodeWorldState(ICNodePoint *node)
Definition: BattlegroundIC.cpp:498
Definition: SharedDefines.h:4267
GuidVector BgCreatures
Definition: Battleground.h:453
Definition: BattlegroundIC.h:199
void EndBattleground(uint32 winner) override
Definition: BattlegroundIC.cpp:417
float GetPositionY() const
Definition: Position.h:105
Definition: Language.h:1017
Definition: BattlegroundScore.h:39
const uint32 BG_IC_Factions[2]
Definition: BattlegroundIC.h:27
float GetPositionZ() const
Definition: Position.h:106
uint32_t uint32
Definition: Define.h:150
Definition: SharedDefines.h:992
Definition: GameObject.h:880
Definition: Battleground.h:128
Definition: UpdateFields.h:321
Definition: BattlegroundIC.h:438
ICNodePoint nodePoint[7]
Definition: BattlegroundIC.h:963
bool DelCreature(uint32 type)
Definition: Battleground.cpp:1640
Definition: BattlegroundIC.h:813
Definition: Language.h:1018
Definition: BattlegroundIC.h:814
uint8_t uint8
Definition: Define.h:152
uint32 GetEntry() const
Definition: Object.h:107
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207
float GetPositionX() const
Definition: Position.h:104
Definition: BattlegroundScore.h:40
void SendMessage2ToAll(uint32 entry, ChatMsg type, Player const *source, uint32 strId1=0, uint32 strId2=0)
Definition: Battleground.cpp:1731
Definition: BattlegroundIC.h:823
uint32 GetNextBanner(ICNodePoint *node, uint32 team, bool returnDefinitve)
Definition: BattlegroundIC.cpp:523

+ Here is the call graph for this function:

void BattlegroundIC::FillInitialWorldStates ( WorldPackets::WorldState::InitWorldStates packet)
overridevirtual

Reimplemented from Battleground.

290 {
291  packet.Worldstates.emplace_back(uint32(BG_IC_ALLIANCE_RENFORT_SET), 1);
292  packet.Worldstates.emplace_back(uint32(BG_IC_HORDE_RENFORT_SET), 1);
295 
296  for (uint8 i = 0; i < MAX_FORTRESS_GATES_SPAWNS; ++i)
297  {
299  packet.Worldstates.emplace_back(uint32(uws), 1);
300  }
301 
302  for (uint8 i = 0; i < MAX_NODE_TYPES; ++i)
303  packet.Worldstates.emplace_back(uint32(nodePoint[i].worldStates[nodePoint[i].nodeState]), 1);
304 }
BG_IC_GateState GateStatus[6]
Definition: BattlegroundIC.h:962
Definition: BattlegroundIC.h:734
uint32 GetWorldStateFromGateEntry(uint32 id, bool open)
Definition: BattlegroundIC.h:985
std::list< WorldStateInfo > Worldstates
Definition: WorldStatePackets.h:47
uint32 GetGateIDFromEntry(uint32 id)
Definition: BattlegroundIC.h:970
Definition: BattlegroundIC.h:736
uint32_t uint32
Definition: Define.h:150
Definition: SharedDefines.h:992
Definition: BattlegroundIC.h:797
uint16 factionReinforcements[2]
Definition: BattlegroundIC.h:961
ICNodePoint nodePoint[7]
Definition: BattlegroundIC.h:963
int32_t int32
Definition: g3dmath.h:167
uint8_t uint8
Definition: Define.h:152
Definition: BattlegroundIC.h:453
Definition: BattlegroundIC.h:733
uint32_t uint32
Definition: g3dmath.h:168
Definition: SharedDefines.h:993
Definition: BattlegroundIC.h:735
const ICGo BG_IC_ObjSpawnlocs[MAX_NORMAL_GAMEOBJECTS_SPAWNS]
Definition: BattlegroundIC.h:606
Definition: BattlegroundIC.h:823

+ Here is the call graph for this function:

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

Reimplemented from Battleground.

849 {
850  TeamId teamIndex = GetTeamIndexByTeamId(player->GetTeam());
851 
852  // Is there any occupied node for this team?
853  std::vector<uint8> nodes;
854  for (uint8 i = 0; i < MAX_NODE_TYPES; ++i)
855  if (nodePoint[i].faction == player->GetTeamId())
856  nodes.push_back(i);
857 
858  WorldSafeLocsEntry const* good_entry = NULL;
859  // If so, select the closest node to place ghost on
860  if (!nodes.empty())
861  {
862  float player_x = player->GetPositionX();
863  float player_y = player->GetPositionY();
864 
865  float mindist = 999999.0f;
866  for (uint8 i = 0; i < nodes.size(); ++i)
867  {
868  WorldSafeLocsEntry const*entry = sWorldSafeLocsStore.LookupEntry(BG_IC_GraveyardIds[nodes[i]]);
869  if (!entry)
870  continue;
871  float dist = (entry->Loc.X - player_x)*(entry->Loc.X - player_x)+(entry->Loc.Y - player_y)*(entry->Loc.Y - player_y);
872  if (mindist > dist)
873  {
874  mindist = dist;
875  good_entry = entry;
876  }
877  }
878  nodes.clear();
879  }
880  // If not, place ghost on starting location
881  if (!good_entry)
882  good_entry = sWorldSafeLocsStore.LookupEntry(BG_IC_GraveyardIds[teamIndex+MAX_NODE_TYPES]);
883 
884  return good_entry;
885 }
float Y
Definition: DBCEnums.h:35
DBCStorage< WorldSafeLocsEntry > sWorldSafeLocsStore(WorldSafeLocsfmt)
Definition: DBCStructure.h:1434
arena_t NULL
Definition: jemalloc_internal.h:624
static TeamId GetTeamIndexByTeamId(uint32 Team)
Definition: Battleground.h:399
float X
Definition: DBCEnums.h:34
DBCPosition3D Loc
Definition: DBCStructure.h:1438
TeamId
Definition: SharedDefines.h:990
ICNodePoint nodePoint[7]
Definition: BattlegroundIC.h:963
const uint32 BG_IC_GraveyardIds[MAX_NODE_TYPES+2]
Definition: BattlegroundIC.h:835
uint8_t uint8
Definition: Define.h:152
Definition: BattlegroundIC.h:823

+ Here is the call graph for this function:

uint32 BattlegroundIC::GetGateIDFromEntry ( uint32  id)
inlineprivate
971  {
972  uint32 i = 0;
973  switch (id)
974  {
975  case GO_HORDE_GATE_1: i = BG_IC_H_FRONT ;break;
976  case GO_HORDE_GATE_2: i = BG_IC_H_WEST ;break;
977  case GO_HORDE_GATE_3: i = BG_IC_H_EAST ;break;
978  case GO_ALLIANCE_GATE_3: i = BG_IC_A_FRONT ;break;
979  case GO_ALLIANCE_GATE_1: i = BG_IC_A_WEST ;break;
980  case GO_ALLIANCE_GATE_2: i = BG_IC_A_EAST ;break;
981  }
982  return i;
983  }
Definition: BattlegroundIC.h:807
Definition: BattlegroundIC.h:806
Definition: BattlegroundIC.h:113
Definition: BattlegroundIC.h:59
uint32_t uint32
Definition: Define.h:150
Definition: BattlegroundIC.h:803
Definition: BattlegroundIC.h:802
Definition: BattlegroundIC.h:114
Definition: BattlegroundIC.h:61
Definition: BattlegroundIC.h:112
Definition: BattlegroundIC.h:60
Definition: BattlegroundIC.h:804
Definition: BattlegroundIC.h:805

+ Here is the caller graph for this function:

uint32 BattlegroundIC::GetNextBanner ( ICNodePoint node,
uint32  team,
bool  returnDefinitve 
)
private
524 {
525  // this is only used in the update map function
526  if (returnDefinitve)
527  // here is a special case, here we must return the definitve faction banner after the grey banner was spawned 1 minute
528  return node->banners[(team == TEAM_ALLIANCE ? BANNER_A_CONTROLLED : BANNER_H_CONTROLLED)];
529 
530  // there were no changes, this point has never been captured by any faction or at least clicked
531  if (node->last_entry == 0)
532  // 1 returns the CONTESTED ALLIANCE BANNER, 3 returns the HORDE one
533  return node->banners[(team == TEAM_ALLIANCE ? BANNER_A_CONTESTED : BANNER_H_CONTESTED)];
534 
535  // If the actual banner is the definitive faction banner, we must return the grey banner of the player's faction
537  return node->banners[(team == TEAM_ALLIANCE ? BANNER_A_CONTESTED : BANNER_H_CONTESTED)];
538 
539  // If the actual banner is the grey faction banner, we must return the previous banner
541  return node->last_entry;
542 
543  // we should never be here...
544  TC_LOG_ERROR("bg.battleground", "Isle Of Conquest: Unexpected return in GetNextBanner function");
545  return 0;
546 }
uint32 banners[4]
Definition: BattlegroundIC.h:857
uint32 gameobject_entry
Definition: BattlegroundIC.h:854
Definition: BattlegroundIC.h:440
uint32 last_entry
Definition: BattlegroundIC.h:860
Definition: BattlegroundIC.h:437
Definition: BattlegroundIC.h:439
Definition: SharedDefines.h:992
Definition: BattlegroundIC.h:438
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207

+ Here is the caller graph for this function:

uint32 BattlegroundIC::GetNodeState ( uint8  nodeType) const
inline
949 { return (uint8)nodePoint[nodeType].nodeState; }
ICNodeState nodeState
Definition: BattlegroundIC.h:862
ICNodePoint nodePoint[7]
Definition: BattlegroundIC.h:963
uint8_t uint8
Definition: Define.h:152

+ Here is the caller graph for this function:

uint32 BattlegroundIC::GetWorldStateFromGateEntry ( uint32  id,
bool  open 
)
inlineprivate
986  {
987  uint32 uws = 0;
988 
989  switch (id)
990  {
991  case GO_HORDE_GATE_1:
993  break;
994  case GO_HORDE_GATE_2:
996  break;
997  case GO_HORDE_GATE_3:
999  break;
1000  case GO_ALLIANCE_GATE_3:
1002  break;
1003  case GO_ALLIANCE_GATE_1:
1005  break;
1006  case GO_ALLIANCE_GATE_2:
1008  break;
1009  }
1010  return uws;
1011  }
Definition: BattlegroundIC.h:743
Definition: BattlegroundIC.h:740
Definition: BattlegroundIC.h:741
Definition: BattlegroundIC.h:747
Definition: BattlegroundIC.h:113
Definition: BattlegroundIC.h:59
Definition: BattlegroundIC.h:744
Definition: BattlegroundIC.h:748
uint32_t uint32
Definition: Define.h:150
Definition: BattlegroundIC.h:738
Definition: BattlegroundIC.h:737
Definition: BattlegroundIC.h:745
Definition: BattlegroundIC.h:114
Definition: BattlegroundIC.h:742
Definition: BattlegroundIC.h:61
Definition: BattlegroundIC.h:746
Definition: BattlegroundIC.h:739
Definition: BattlegroundIC.h:112
Definition: BattlegroundIC.h:60

+ Here is the caller graph for this function:

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

: this spell should be cast by npc 22515 (World Trigger) and not by the player

Reimplemented from Battleground.

267 {
268  // this is wrong way to implement these things. On official it done by gameobject spell cast.
269  if (GetStatus() != STATUS_IN_PROGRESS)
270  return;
271 
273  if (trigger == 5555 && player->GetTeamId() == TEAM_HORDE)
274  {
278  player->CastSpell(player, SPELL_BACK_DOOR_JOB_ACHIEVEMENT, true);
279  }
280  else if (trigger == 5535 && player->GetTeamId() == TEAM_ALLIANCE)
281  {
285  player->CastSpell(player, SPELL_BACK_DOOR_JOB_ACHIEVEMENT, true);
286  }
287 }
Definition: Battleground.h:159
BG_IC_GateState GateStatus[6]
Definition: BattlegroundIC.h:962
Definition: BattlegroundIC.h:807
BattlegroundStatus GetStatus() const
Definition: Battleground.h:266
Definition: BattlegroundIC.h:806
Definition: SharedDefines.h:992
Definition: BattlegroundIC.h:797
Definition: BattlegroundIC.h:803
Definition: BattlegroundIC.h:714
Definition: BattlegroundIC.h:802
Definition: SharedDefines.h:993
Definition: BattlegroundIC.h:804
Definition: BattlegroundIC.h:805

+ Here is the call graph for this function:

void BattlegroundIC::HandleCapturedNodes ( ICNodePoint node,
bool  recapture 
)
private
589 {
590  if (node->nodeType != NODE_TYPE_REFINERY && node->nodeType != NODE_TYPE_QUARRY)
591  {
593  TC_LOG_ERROR("bg.battleground", "Isle of Conquest: Failed to spawn spirit guide! point: %u, team: %u, ", node->nodeType, node->faction);
594  }
595 
596  switch (node->gameobject_type)
597  {
599  {
600  if (!gunshipAlliance || !gunshipHorde)
601  break;
602 
603  std::list<Creature*> cannons;
604  if (node->faction == TEAM_ALLIANCE)
606  else
608 
609  for (Creature* cannon : cannons)
610  cannon->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
611 
612  for (uint8 u = 0; u < MAX_HANGAR_TELEPORTERS_SPAWNS; ++u)
613  {
616  TC_LOG_ERROR("bg.battleground", "Isle of Conquest: There was an error spawning a gunship portal. Type: %u", BG_IC_GO_HANGAR_TELEPORTER_1 + u);
617  }
618 
619  for (uint8 u = 0; u < MAX_HANGAR_TELEPORTER_EFFECTS_SPAWNS; ++u)
620  {
623  TC_LOG_ERROR("bg.battleground", "Isle of Conquest: There was an error spawning a gunship portal effects. Type: %u", BG_IC_GO_HANGAR_TELEPORTER_1 + u);
624  }
625 
626  for (uint8 u = 0; u < MAX_TRIGGER_SPAWNS_PER_FACTION; ++u)
627  {
629  TC_LOG_ERROR("bg.battleground", "Isle of Conquest: There was an error spawning a world trigger. Type: %u", BG_IC_NPC_WORLD_TRIGGER_NOT_FLOATING);
630  }
631 
632  for (uint8 u = 0; u < MAX_CAPTAIN_SPAWNS_PER_FACTION; ++u)
633  {
635 
636  if (type == BG_IC_NPC_GUNSHIP_CAPTAIN_1)
639 
640  if (type == BG_IC_NPC_GUNSHIP_CAPTAIN_2)
641  if (!AddCreature(node->faction == TEAM_ALLIANCE ? NPC_ALLIANCE_GUNSHIP_CAPTAIN : NPC_HORDE_GUNSHIP_CAPTAIN, type, BG_IC_HangarCaptains[node->faction == TEAM_ALLIANCE ? 3 : 1], node->faction, RESPAWN_ONE_DAY, node->faction == TEAM_ALLIANCE ? gunshipAlliance : gunshipHorde))
642  TC_LOG_ERROR("bg.battleground", "Isle of Conquest: There was an error spawning a world trigger. Type: %u", BG_IC_NPC_GUNSHIP_CAPTAIN_2);
643  }
644 
645  (node->faction == TEAM_ALLIANCE ? gunshipAlliance : gunshipHorde)->EnableMovement(true);
646  break;
647  }
651  break;
655  break;
657  if (recapture)
658  break;
659 
662 
663  // we must del opposing faction vehicles when the node is captured (unused ones)
665  {
666  if (Creature* glaiveThrower = GetBGCreature(i, false))
667  {
668  if (Vehicle* vehicleGlaive = glaiveThrower->GetVehicleKit())
669  {
670  if (!vehicleGlaive->GetPassenger(0))
671  DelCreature(i);
672  }
673  }
674  }
675 
677  {
678  if (Creature* catapult = GetBGCreature(i, false))
679  {
680  if (Vehicle* vehicleGlaive = catapult->GetVehicleKit())
681  {
682  if (!vehicleGlaive->GetPassenger(0))
683  DelCreature(i);
684  }
685  }
686  }
687 
688  // spawning glaive throwers
689  for (uint8 i = 0; i < MAX_GLAIVE_THROWERS_SPAWNS_PER_FACTION; ++i)
690  {
691  uint8 type = (node->faction == TEAM_ALLIANCE ? BG_IC_NPC_GLAIVE_THROWER_1_A : BG_IC_NPC_GLAIVE_THROWER_1_H)+i;
692 
693  if (GetBGCreature(type, false) && GetBGCreature(type)->IsAlive())
694  continue;
695 
697  GetBGCreature(type)->setFaction(BG_IC_Factions[(node->faction == TEAM_ALLIANCE ? 0 : 1)]);
698  }
699 
700  // spawning catapults
701  for (uint8 i = 0; i < MAX_CATAPULTS_SPAWNS_PER_FACTION; ++i)
702  {
703  uint8 type = (node->faction == TEAM_ALLIANCE ? BG_IC_NPC_CATAPULT_1_A : BG_IC_NPC_CATAPULT_1_H)+i;
704 
705  if (GetBGCreature(type, false) && GetBGCreature(type)->IsAlive())
706  continue;
707 
709  GetBGCreature(type)->setFaction(BG_IC_Factions[(node->faction == TEAM_ALLIANCE ? 0 : 1)]);
710  }
711  break;
713  {
716 
717  if (!recapture)
718  {
719  // we must del opposing faction vehicles when the node is captured (unused ones)
721  {
722  if (Creature* demolisher = GetBGCreature(i, false))
723  {
724  if (Vehicle* vehicleDemolisher = demolisher->GetVehicleKit())
725  {
726  // is IsVehicleInUse working as expected?
727  if (!vehicleDemolisher->IsVehicleInUse())
728  DelCreature(i);
729  }
730  }
731  }
732 
733  for (uint8 i = 0; i < MAX_DEMOLISHERS_SPAWNS_PER_FACTION; ++i)
734  {
735  uint8 type = (node->faction == TEAM_ALLIANCE ? BG_IC_NPC_DEMOLISHER_1_A : BG_IC_NPC_DEMOLISHER_1_H)+i;
736 
737  if (GetBGCreature(type, false) && GetBGCreature(type)->IsAlive())
738  continue;
739 
741  GetBGCreature(type)->setFaction(BG_IC_Factions[(node->faction == TEAM_ALLIANCE ? 0 : 1)]);
742  }
743 
744  // we check if the opossing siege engine is in use
746 
747  if (Creature* siegeEngine = GetBGCreature(enemySiege, false))
748  {
749  if (Vehicle* vehicleSiege = siegeEngine->GetVehicleKit())
750  {
751  // is VehicleInUse working as expected ?
752  if (!vehicleSiege->IsVehicleInUse())
753  DelCreature(enemySiege);
754  }
755  }
756 
758  if (!GetBGCreature(siegeType, false) || !GetBGCreature(siegeType)->IsAlive())
759  {
762 
763  if (Creature* siegeEngine = GetBGCreature(siegeType))
764  {
766  siegeEngine->setFaction(BG_IC_Factions[(node->faction == TEAM_ALLIANCE ? 0 : 1)]);
767  }
768  }
769  }
770 
771  for (uint8 i = 0; i < MAX_WORKSHOP_BOMBS_SPAWNS_PER_FACTION; ++i)
772  {
774  workshopBombs[i].GetPositionX(), workshopBombs[i].GetPositionY(),
775  workshopBombs[i].GetPositionZ(), workshopBombs[i].GetOrientation(),
776  0, 0, 0, 0, 10);
777 
778  if (GameObject* seaforiumBombs = GetBGObject(BG_IC_GO_SEAFORIUM_BOMBS_1+i))
779  {
780  seaforiumBombs->SetRespawnTime(10);
781  seaforiumBombs->SetFaction(BG_IC_Factions[(node->faction == TEAM_ALLIANCE ? 0 : 1)]);
782  }
783  }
784  break;
785  }
786  default:
787  break;
788  }
789 }
Definition: BattlegroundIC.h:48
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: BattlegroundIC.h:409
Definition: BattlegroundIC.h:44
const Position workshopBombs[2]
Definition: BattlegroundIC.h:701
Definition: BattlegroundIC.h:118
Definition: Vehicle.h:32
int8_t int8
Definition: Define.h:148
Definition: BattlegroundIC.h:116
virtual bool AddSpiritGuide(uint32 type, float x, float y, float z, float o, TeamId teamId=TEAM_NEUTRAL)
Definition: Battleground.cpp:1676
Definition: BattlegroundIC.h:293
const Position BG_IC_HangarCaptains[4]
Definition: BattlegroundIC.h:555
Definition: BattlegroundIC.h:408
Definition: BattlegroundIC.h:405
Definition: BattlegroundIC.h:450
uint32 siegeEngineWorkshopTimer
Definition: BattlegroundIC.h:960
Definition: BattlegroundIC.h:300
Definition: BattlegroundIC.h:464
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: BattlegroundIC.h:426
Definition: BattlegroundIC.h:420
Definition: BattlegroundIC.h:422
GameObject * GetBGObject(uint32 type, bool logError=true)
Definition: Battleground.cpp:1534
Definition: BattlegroundIC.h:318
Position const BG_IC_SpiritGuidePos[MAX_NODE_TYPES+2]
Definition: BattlegroundIC.h:837
Definition: BattlegroundIC.h:40
Definition: BattlegroundIC.h:463
Definition: BattlegroundIC.h:42
Definition: BattlegroundIC.h:451
Definition: BattlegroundIC.h:397
Definition: BattlegroundIC.h:258
Definition: BattlegroundIC.h:395
Definition: Creature.h:467
Definition: BattlegroundIC.h:46
Definition: BattlegroundIC.h:394
Definition: BattlegroundIC.h:709
Definition: BattlegroundIC.h:41
Definition: Unit.h:681
TeamId faction
Definition: BattlegroundIC.h:855
Definition: BattlegroundIC.h:50
void GetCreatureListWithEntryInGrid(std::list< Creature * > &lList, uint32 uiEntry, float fMaxSearchRange) const
Definition: Object.cpp:2483
Definition: BattlegroundIC.h:417
Definition: SharedDefines.h:1000
void setFaction(uint32 faction)
Definition: Unit.h:1467
Definition: BattlegroundIC.h:325
const Position BG_IC_WorkshopVehicles[5]
Definition: BattlegroundIC.h:512
Definition: BattlegroundIC.h:424
Definition: BattlegroundIC.h:321
void CastSpellOnTeam(uint32 SpellID, uint32 TeamID)
Definition: Battleground.cpp:695
Definition: BattlegroundIC.h:47
Definition: BattlegroundIC.h:410
bool IsAlive() const
Definition: Unit.h:1692
Definition: BattlegroundIC.h:195
Transport * gunshipAlliance
Definition: BattlegroundIC.h:965
const Position BG_IC_HangarTrigger[2]
Definition: BattlegroundIC.h:549
const Position BG_IC_DocksVehiclesGlaives[2]
Definition: BattlegroundIC.h:521
const uint32 BG_IC_Factions[2]
Definition: BattlegroundIC.h:27
Definition: SharedDefines.h:992
Definition: GameObject.h:880
virtual void DoAction(int32)
Definition: UnitAI.h:138
Definition: Battleground.h:128
uint32 docksTimer
Definition: BattlegroundIC.h:958
uint32 gameobject_type
Definition: BattlegroundIC.h:853
Definition: SharedDefines.h:999
Definition: GameObject.h:822
Definition: BattlegroundIC.h:43
UnitAI * GetAI()
Definition: Unit.h:1331
void RemoveAuraOnTeam(uint32 SpellID, uint32 TeamID)
Definition: Battleground.cpp:702
Definition: BattlegroundIC.h:302
Definition: BattlegroundIC.h:423
const Position BG_IC_DocksVehiclesCatapults[4]
Definition: BattlegroundIC.h:527
bool DelCreature(uint32 type)
Definition: Battleground.cpp:1640
Definition: BattlegroundIC.h:813
ICNodePointType nodeType
Definition: BattlegroundIC.h:856
const Position BG_IC_HangarTeleporterEffects[3]
Definition: BattlegroundIC.h:542
Definition: UpdateFields.h:109
Definition: BattlegroundIC.h:468
Definition: BattlegroundIC.h:402
Definition: BattlegroundIC.h:467
const Position BG_IC_HangarTeleporters[3]
Definition: BattlegroundIC.h:535
Definition: BattlegroundIC.h:65
Definition: BattlegroundIC.h:814
uint8_t uint8
Definition: Define.h:152
Definition: BattlegroundIC.h:415
Definition: BattlegroundIC.h:412
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207
Definition: BattlegroundIC.h:407
Definition: BattlegroundIC.h:49
Definition: BattlegroundIC.h:63
Definition: BattlegroundIC.h:196
Definition: BattlegroundIC.h:459
Creature * GetBGCreature(uint32 type, bool logError=true)
Definition: Battleground.cpp:1549
Definition: BattlegroundIC.h:45
Definition: BattlegroundIC.h:127
Definition: BattlegroundIC.h:400
Definition: Unit.h:687
Definition: BattlegroundIC.h:710
Definition: Unit.h:698
Definition: BattlegroundIC.h:283
Definition: BattlegroundIC.h:460
Transport * gunshipHorde
Definition: BattlegroundIC.h:966
Definition: BattlegroundIC.h:205

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void BattlegroundIC::HandleContestedNodes ( ICNodePoint node)
private
549 {
550  if (node->nodeType == NODE_TYPE_HANGAR)
551  {
553  (node->faction == TEAM_ALLIANCE ? gunshipHorde : gunshipAlliance)->EnableMovement(false);
554 
556  DelObject(u);
557 
559  DelObject(u);
560 
562 
563  for (uint8 u = 0; u < MAX_CAPTAIN_SPAWNS_PER_FACTION; ++u)
564  {
566  DelCreature(type);
567  }
568 
569  std::list<Creature*> cannons;
570  if (node->faction == TEAM_HORDE)
572  else
574 
575  for (Creature* cannon : cannons)
576  {
577  cannon->GetVehicleKit()->RemoveAllPassengers();
578  cannon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
579  }
580  }
581  else if (node->nodeType == NODE_TYPE_WORKSHOP)
582  {
585  }
586 }
Definition: BattlegroundIC.h:323
Definition: BattlegroundIC.h:817
Definition: BattlegroundIC.h:422
Definition: BattlegroundIC.h:318
Definition: Creature.h:467
bool DelObject(uint32 type)
Definition: Battleground.cpp:1658
Definition: BattlegroundIC.h:46
TeamId faction
Definition: BattlegroundIC.h:855
void GetCreatureListWithEntryInGrid(std::list< Creature * > &lList, uint32 uiEntry, float fMaxSearchRange) const
Definition: Object.cpp:2483
Definition: BattlegroundIC.h:325
Definition: BattlegroundIC.h:321
Definition: BattlegroundIC.h:47
Transport * gunshipAlliance
Definition: BattlegroundIC.h:965
Definition: BattlegroundIC.h:816
Definition: SharedDefines.h:992
Definition: BattlegroundIC.h:423
Definition: BattlegroundIC.h:319
bool DelCreature(uint32 type)
Definition: Battleground.cpp:1640
ICNodePointType nodeType
Definition: BattlegroundIC.h:856
Definition: UpdateFields.h:109
Definition: BattlegroundIC.h:468
uint8_t uint8
Definition: Define.h:152
Definition: SharedDefines.h:993
Definition: Unit.h:698
Definition: BattlegroundIC.h:327
Transport * gunshipHorde
Definition: BattlegroundIC.h:966

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Reimplemented from Battleground.

402 {
403  if (GetStatus() != STATUS_IN_PROGRESS)
404  return;
405 
406  Battleground::HandleKillPlayer(player, killer);
407 
408  factionReinforcements[player->GetTeamId()] -= 1;
409 
410  UpdateWorldState((player->GetTeamId() == TEAM_ALLIANCE ? BG_IC_ALLIANCE_RENFORT : BG_IC_HORDE_RENFORT), factionReinforcements[player->GetTeamId()]);
411 
412  // we must end the battleground
413  if (factionReinforcements[player->GetTeamId()] < 1)
414  EndBattleground(killer->GetTeam());
415 }
Definition: Battleground.h:159
virtual void HandleKillPlayer(Player *player, Player *killer)
Definition: Battleground.cpp:1784
BattlegroundStatus GetStatus() const
Definition: Battleground.h:266
Definition: BattlegroundIC.h:736
void EndBattleground(uint32 winner) override
Definition: BattlegroundIC.cpp:417
Definition: SharedDefines.h:992
uint16 factionReinforcements[2]
Definition: BattlegroundIC.h:961
void UpdateWorldState(uint32 variable, uint32 value, bool hidden=false)
Definition: Battleground.cpp:735
Definition: BattlegroundIC.h:735

+ Here is the call graph for this function:

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

Reimplemented from Battleground.

379 {
380  if (GetStatus() != STATUS_IN_PROGRESS)
381  return;
382 
383  uint32 entry = unit->GetEntry();
385  {
388  }
389  else if (entry == NPC_OVERLORD_AGMAR)
390  {
393  }
394 
395  //Achievement Mowed Down
396  // TO-DO: This should be done on the script of each vehicle of the BG.
397  if (unit->IsVehicle())
398  killer->CastSpell(killer, SPELL_DESTROYED_VEHICLE_ACHIEVEMENT, true);
399 }
Definition: Battleground.h:159
bool IsVehicle() const
Definition: Unit.h:1406
BattlegroundStatus GetStatus() const
Definition: Battleground.h:266
Definition: SharedDefines.h:1000
Definition: BattlegroundIC.h:35
void EndBattleground(uint32 winner) override
Definition: BattlegroundIC.cpp:417
Definition: BattlegroundIC.h:713
uint32_t uint32
Definition: Define.h:150
void RewardHonorToTeam(uint32 Honor, uint32 TeamID)
Definition: Battleground.cpp:709
Definition: SharedDefines.h:999
Definition: BattlegroundIC.h:36
Definition: BattlegroundIC.h:880
uint32 GetEntry() const
Definition: Object.h:107

+ Here is the call graph for this function:

void BattlegroundIC::HandlePlayerResurrect ( Player player)
overridevirtual

Reimplemented from Battleground.

63 {
64  if (nodePoint[NODE_TYPE_QUARRY].nodeState == (player->GetTeamId() == TEAM_ALLIANCE ? NODE_STATE_CONTROLLED_A : NODE_STATE_CONTROLLED_H))
65  player->CastSpell(player, SPELL_QUARRY, true);
66 
67  if (nodePoint[NODE_TYPE_REFINERY].nodeState == (player->GetTeamId() == TEAM_ALLIANCE ? NODE_STATE_CONTROLLED_A : NODE_STATE_CONTROLLED_H))
68  player->CastSpell(player, SPELL_OIL_REFINERY, true);
69 }
Definition: BattlegroundIC.h:709
Definition: SharedDefines.h:992
Definition: BattlegroundIC.h:831
ICNodePoint nodePoint[7]
Definition: BattlegroundIC.h:963
Definition: BattlegroundIC.h:813
Definition: BattlegroundIC.h:814
Definition: BattlegroundIC.h:832
Definition: BattlegroundIC.h:710
bool BattlegroundIC::IsAllNodesControlledByTeam ( uint32  team) const
overridevirtual

Reimplemented from Battleground.

888 {
889  uint32 count = 0;
891  for (int i = 0; i < NODE_TYPE_WORKSHOP; ++i)
892  {
893  if (nodePoint[i].nodeState == controlledState)
894  ++count;
895  }
896 
897  return count == NODE_TYPE_WORKSHOP;
898 }
Definition: BattlegroundIC.h:817
Definition: SharedDefines.h:1000
uint32_t uint32
Definition: Define.h:150
ICNodeState
Definition: BattlegroundIC.h:826
Definition: BattlegroundIC.h:831
ICNodePoint nodePoint[7]
Definition: BattlegroundIC.h:963
Definition: BattlegroundIC.h:832
bool BattlegroundIC::IsSpellAllowed ( uint32  spellId,
Player const player 
) const
overridevirtual

Reimplemented from Battleground.

901 {
902  switch (spellId)
903  {
904  case SPELL_OIL_REFINERY:
905  case SPELL_QUARRY:
906  {
907  uint32 team = player->GetTeamId();
910  return GetNodeState(nodeType) == nodeState;
911  }
912  default:
913  break;
914  }
915 
916  return true;
917 }
Definition: BattlegroundIC.h:709
uint32_t uint32
Definition: Define.h:150
Definition: SharedDefines.h:992
Definition: BattlegroundIC.h:831
Definition: BattlegroundIC.h:813
Definition: BattlegroundIC.h:814
uint8_t uint8
Definition: Define.h:152
Definition: BattlegroundIC.h:832
uint32 GetNodeState(uint8 nodeType) const
Definition: BattlegroundIC.h:949
Definition: BattlegroundIC.h:710

+ Here is the call graph for this function:

void BattlegroundIC::PostUpdateImpl ( uint32  )
overridevirtual

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.

72 {
74  return;
75 
76  if (!doorsClosed)
77  {
78  if (closeFortressDoorsTimer <= diff)
79  {
86 
93 
94  doorsClosed = true;
95  } else closeFortressDoorsTimer -= diff;
96  }
97 
98  for (uint8 i = NODE_TYPE_REFINERY; i < MAX_NODE_TYPES; ++i)
99  {
100  if (nodePoint[i].nodeType == NODE_TYPE_DOCKS)
101  {
102  if (nodePoint[i].nodeState == NODE_STATE_CONTROLLED_A ||
103  nodePoint[i].nodeState == NODE_STATE_CONTROLLED_H)
104  {
105  if (docksTimer <= diff)
106  {
107  // we need to confirm this, i am not sure if this every 3 minutes
109  {
110  if (Creature* catapult = GetBGCreature(u))
111  {
112  if (!catapult->IsAlive())
113  catapult->Respawn(true);
114  }
115  }
116 
117  // we need to confirm this is blizzlike, not sure if it is every 3 minutes
119  {
120  if (Creature* glaiveThrower = GetBGCreature(u))
121  {
122  if (!glaiveThrower->IsAlive())
123  glaiveThrower->Respawn(true);
124  }
125  }
126 
128  } else docksTimer -= diff;
129  }
130  }
131 
132  if (nodePoint[i].nodeType == NODE_TYPE_WORKSHOP)
133  {
134  if (nodePoint[i].nodeState == NODE_STATE_CONTROLLED_A ||
135  nodePoint[i].nodeState == NODE_STATE_CONTROLLED_H)
136  {
137  if (siegeEngineWorkshopTimer <= diff)
138  {
140 
141  if (Creature* siege = GetBGCreature(siegeType)) // this always should be true
142  {
143  if (siege->IsAlive())
144  {
146  // following sniffs the vehicle always has UNIT_FLAG_UNK_14
148  else
149  siege->SetHealth(siege->GetMaxHealth());
150  }
151  else
152  siege->Respawn(true);
153  }
154 
155  // we need to confirm if it is every 3 minutes
157  {
158  if (Creature* demolisher = GetBGCreature(u))
159  {
160  if (!demolisher->IsAlive())
161  demolisher->Respawn(true);
162  }
163  }
165  } else siegeEngineWorkshopTimer -= diff;
166  }
167  }
168 
169  // the point is waiting for a change on its banner
170  if (nodePoint[i].needChange)
171  {
172  if (nodePoint[i].timer <= diff)
173  {
174  uint32 nextBanner = GetNextBanner(&nodePoint[i], nodePoint[i].faction, true);
175 
177  nodePoint[i].gameobject_entry = nextBanner;
178  // nodePoint[i].faction = the faction should be the same one...
179 
180  GameObject* banner = GetBGObject(nodePoint[i].gameobject_type);
181 
182  if (!banner) // this should never happen
183  return;
184 
185  float cords[4] = {banner->GetPositionX(), banner->GetPositionY(), banner->GetPositionZ(), banner->GetOrientation() };
186 
187  DelObject(nodePoint[i].gameobject_type);
188  AddObject(nodePoint[i].gameobject_type, nodePoint[i].gameobject_entry, cords[0], cords[1], cords[2], cords[3], 0, 0, 0, 0, RESPAWN_ONE_DAY);
189 
191 
193  HandleCapturedNodes(&nodePoint[i], false);
194 
196 
197  nodePoint[i].needChange = false;
199  } else nodePoint[i].timer -= diff;
200  }
201  }
202 
203  if (resourceTimer <= diff)
204  {
205  for (uint8 i = 0; i < NODE_TYPE_DOCKS; ++i)
206  {
207  if (nodePoint[i].nodeState == NODE_STATE_CONTROLLED_A ||
208  nodePoint[i].nodeState == NODE_STATE_CONTROLLED_H)
209  {
212  UpdateWorldState((nodePoint[i].faction == TEAM_ALLIANCE ? BG_IC_ALLIANCE_RENFORT : BG_IC_HORDE_RENFORT), factionReinforcements[nodePoint[i].faction]);
213  }
214  }
216  } else resourceTimer -= diff;
217 }
Definition: Battleground.h:159
Definition: BattlegroundIC.h:264
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: BattlegroundIC.h:409
uint32 gameobject_entry
Definition: BattlegroundIC.h:854
Definition: Language.h:1027
bool doorsClosed
Definition: BattlegroundIC.h:957
Definition: BattlegroundIC.h:287
Definition: BattlegroundIC.h:265
Definition: BattlegroundIC.h:817
Definition: BattlegroundIC.h:408
uint32 last_entry
Definition: BattlegroundIC.h:860
Definition: BattlegroundIC.h:405
uint32 siegeEngineWorkshopTimer
Definition: BattlegroundIC.h:960
BattlegroundStatus GetStatus() const
Definition: Battleground.h:266
Definition: BattlegroundIC.h:420
GameObject * GetBGObject(uint32 type, bool logError=true)
Definition: Battleground.cpp:1534
arena_t NULL
Definition: jemalloc_internal.h:624
void SetUInt32Value(uint16 index, uint32 value)
Definition: Object.cpp:996
void HandleCapturedNodes(ICNodePoint *node, bool recapture)
Definition: BattlegroundIC.cpp:588
uint32 closeFortressDoorsTimer
Definition: BattlegroundIC.h:956
Definition: BattlegroundIC.h:397
Definition: BattlegroundIC.h:395
Definition: Creature.h:467
bool DelObject(uint32 type)
Definition: Battleground.cpp:1658
Definition: BattlegroundIC.h:289
Definition: Language.h:1026
bool needChange
Definition: BattlegroundIC.h:858
Definition: BattlegroundIC.h:736
Definition: BattlegroundIC.h:394
void RemoveFromWorld() override
Definition: GameObject.cpp:152
Definition: Unit.h:681
TeamId faction
Definition: BattlegroundIC.h:855
Definition: BattlegroundIC.h:225
Definition: BattlegroundIC.h:417
Definition: SharedDefines.h:2145
Definition: SharedDefines.h:1000
uint32 resourceTimer
Definition: BattlegroundIC.h:959
uint32 timer
Definition: BattlegroundIC.h:859
float GetOrientation() const
Definition: Position.h:107
void UpdateNodeWorldState(ICNodePoint *node)
Definition: BattlegroundIC.cpp:498
Definition: SharedDefines.h:4267
Definition: BattlegroundIC.h:288
Definition: BattlegroundIC.h:199
Definition: BattlegroundIC.h:410
float GetPositionY() const
Definition: Position.h:105
Definition: BattlegroundIC.h:195
Definition: BattlegroundIC.h:815
Definition: BattlegroundIC.h:197
Definition: BattlegroundIC.h:314
Definition: BattlegroundIC.h:223
const uint32 BG_IC_Factions[2]
Definition: BattlegroundIC.h:27
float GetPositionZ() const
Definition: Position.h:106
uint32_t uint32
Definition: Define.h:150
Definition: BattlegroundIC.h:315
Definition: SharedDefines.h:992
Definition: GameObject.h:880
Definition: Battleground.h:128
uint32 docksTimer
Definition: BattlegroundIC.h:958
Definition: UpdateFields.h:321
uint16 factionReinforcements[2]
Definition: BattlegroundIC.h:961
void RewardHonorToTeam(uint32 Honor, uint32 TeamID)
Definition: Battleground.cpp:709
Definition: SharedDefines.h:999
Definition: BattlegroundIC.h:831
ICNodePoint nodePoint[7]
Definition: BattlegroundIC.h:963
Definition: BattlegroundIC.h:879
Definition: BattlegroundIC.h:813
Definition: UpdateFields.h:109
Definition: BattlegroundIC.h:224
Definition: BattlegroundIC.h:402
Definition: BattlegroundIC.h:316
uint8_t uint8
Definition: Define.h:152
Definition: BattlegroundIC.h:415
Definition: BattlegroundIC.h:412
void UpdateWorldState(uint32 variable, uint32 value, bool hidden=false)
Definition: Battleground.cpp:735
Definition: BattlegroundIC.h:407
Definition: BattlegroundIC.h:832
Definition: BattlegroundIC.h:196
Creature * GetBGCreature(uint32 type, bool logError=true)
Definition: Battleground.cpp:1549
float GetPositionX() const
Definition: Position.h:104
void SetDestructibleState(GameObjectDestructibleState state, Player *eventInvoker=NULL, bool setHealth=false)
Definition: GameObject.cpp:2022
Definition: BattlegroundIC.h:263
Definition: Language.h:1019
Definition: BattlegroundIC.h:400
Definition: Unit.h:687
Definition: Unit.h:698
Definition: BattlegroundIC.h:735
void SendMessage2ToAll(uint32 entry, ChatMsg type, Player const *source, uint32 strId1=0, uint32 strId2=0)
Definition: Battleground.cpp:1731
Definition: BattlegroundIC.h:823
uint32 GetNextBanner(ICNodePoint *node, uint32 team, bool returnDefinitve)
Definition: BattlegroundIC.cpp:523

+ Here is the call graph for this function:

void BattlegroundIC::RemovePlayer ( Player player,
ObjectGuid  guid,
uint32  team 
)
overridevirtual

Reimplemented from Battleground.

258 {
259  if (player)
260  {
261  player->RemoveAura(SPELL_QUARRY);
262  player->RemoveAura(SPELL_OIL_REFINERY);
263  }
264 }
Definition: BattlegroundIC.h:709
Definition: BattlegroundIC.h:710
bool BattlegroundIC::SetupBattleground ( )
overridevirtual

Reimplemented from Battleground.

307 {
308  for (uint8 i = 0; i < MAX_NORMAL_GAMEOBJECTS_SPAWNS; ++i)
309  {
311  {
312  TC_LOG_ERROR("bg.battleground", "Isle of Conquest: There was an error spawning gameobject %u", BG_IC_ObjSpawnlocs[i].entry);
313  return false;
314  }
315  }
316 
317  for (uint8 i = 0; i < MAX_FORTRESS_TELEPORTERS_SPAWNS; ++i)
318  {
320  {
321  TC_LOG_ERROR("bg.battleground", "Isle of Conquest | Starting Event Open Doors: There was an error spawning gameobject %u", BG_IC_Teleporters[i].entry);
322  return false;
323  }
324  }
325 
326  for (uint8 i = 0; i < MAX_FORTRESS_TELEPORTER_EFFECTS_SPAWNS; ++i)
327  {
329  {
330  TC_LOG_ERROR("bg.battleground", "Isle of Conquest | Starting Event Open Doors: There was an error spawning gameobject %u", BG_IC_Teleporters[i].entry);
331  return false;
332  }
333  }
334 
335  for (uint8 i = 2; i < MAX_NORMAL_NPCS_SPAWNS; ++i)
336  {
338  {
339  TC_LOG_ERROR("bg.battleground", "Isle of Conquest: There was an error spawning creature %u", BG_IC_NpcSpawnlocs[i].entry);
340  return false;
341  }
342  }
343 
348  {
349  TC_LOG_ERROR("bg.battleground", "Isle of Conquest: Failed to spawn initial spirit guide!");
350  return false;
351  }
352 
353  gunshipHorde = sTransportMgr->CreateTransport(GO_HORDE_GUNSHIP, UI64LIT(0), GetBgMap());
355 
356  if (!gunshipAlliance || !gunshipHorde)
357  {
358  TC_LOG_ERROR("bg.battleground", "Isle of Conquest: There was an error creating gunships!");
359  return false;
360  }
361 
364 
365  // setting correct factions for Keep Cannons
370 
371  // correcting spawn time for keeps bombs
373  GetBGObject(i)->SetRespawnTime(10);
374 
375  return true;
376 }
Definition: BattlegroundIC.h:380
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: BattlegroundIC.h:455
virtual bool AddSpiritGuide(uint32 type, float x, float y, float z, float o, TeamId teamId=TEAM_NEUTRAL)
Definition: Battleground.cpp:1676
Definition: BattlegroundIC.h:454
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: BattlegroundIC.h:426
GameObject * GetBGObject(uint32 type, bool logError=true)
Definition: Battleground.cpp:1534
#define UI64LIT(N)
Definition: Define.h:138
Position const BG_IC_SpiritGuidePos[MAX_NODE_TYPES+2]
Definition: BattlegroundIC.h:837
Definition: BattlegroundIC.h:392
#define sTransportMgr
Definition: TransportMgr.h:162
BattlegroundMap * GetBgMap() const
Definition: Battleground.h:356
void SetRespawnTime(int32 respawn)
Definition: GameObject.h:945
Definition: BattlegroundIC.h:304
Definition: BattlegroundIC.h:188
const ICNpc BG_IC_NpcSpawnlocs[MAX_NORMAL_NPCS_SPAWNS]
Definition: BattlegroundIC.h:471
void setFaction(uint32 faction)
Definition: Unit.h:1467
void EnableMovement(bool enabled)
Definition: Transport.cpp:557
Transport * gunshipAlliance
Definition: BattlegroundIC.h:965
G3D::int16 z
Definition: Vector3int16.h:46
const uint32 BG_IC_Factions[2]
Definition: BattlegroundIC.h:27
G3D::int16 y
Definition: Vector2int16.h:38
Definition: SharedDefines.h:992
Definition: Battleground.h:128
Definition: BattlegroundIC.h:369
const ICGo BG_IC_TeleporterEffects[MAX_FORTRESS_TELEPORTER_EFFECTS_SPAWNS]
Definition: BattlegroundIC.h:589
Definition: BattlegroundIC.h:446
Definition: BattlegroundIC.h:381
uint8_t uint8
Definition: Define.h:152
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207
const ICGo BG_IC_Teleporters[MAX_FORTRESS_TELEPORTERS_SPAWNS]
Definition: BattlegroundIC.h:573
Definition: BattlegroundIC.h:445
Definition: BattlegroundIC.h:312
G3D::int16 x
Definition: Vector2int16.h:37
Creature * GetBGCreature(uint32 type, bool logError=true)
Definition: Battleground.cpp:1549
Definition: SharedDefines.h:993
Definition: BattlegroundIC.h:187
Transport * gunshipHorde
Definition: BattlegroundIC.h:966
const ICGo BG_IC_ObjSpawnlocs[MAX_NORMAL_GAMEOBJECTS_SPAWNS]
Definition: BattlegroundIC.h:606

+ Here is the call graph for this function:

void BattlegroundIC::SpawnLeader ( uint32  teamid)
void BattlegroundIC::StartingEventCloseDoors ( )
overridevirtual

Reimplemented from Battleground.

220 {
221 }
void BattlegroundIC::StartingEventOpenDoors ( )
overridevirtual

Reimplemented from Battleground.

224 {
225  //after 20 seconds they should be despawned
232 
237 
238  for (uint8 i = 0; i < MAX_FORTRESS_TELEPORTERS_SPAWNS; ++i)
240 
241  for (uint8 i = 0; i < MAX_FORTRESS_TELEPORTER_EFFECTS_SPAWNS; ++i)
243 }
Definition: BattlegroundIC.h:264
Definition: BattlegroundIC.h:455
Definition: BattlegroundIC.h:265
Definition: SharedDefines.h:2125
Definition: BattlegroundIC.h:454
GameObject * GetBGObject(uint32 type, bool logError=true)
Definition: Battleground.cpp:1534
Definition: BattlegroundIC.h:260
Definition: BattlegroundIC.h:314
Definition: BattlegroundIC.h:315
Definition: UpdateFields.h:319
Definition: GameObject.h:822
void SetGoState(GOState state)
Definition: GameObject.cpp:2137
void RemoveFlag(uint16 index, uint32 oldFlag)
Definition: Object.cpp:1214
void DoorOpen(uint32 type)
Definition: Battleground.cpp:1522
const ICGo BG_IC_TeleporterEffects[MAX_FORTRESS_TELEPORTER_EFFECTS_SPAWNS]
Definition: BattlegroundIC.h:589
Definition: BattlegroundIC.h:272
Definition: BattlegroundIC.h:261
Definition: BattlegroundIC.h:316
Definition: BattlegroundIC.h:271
uint8_t uint8
Definition: Define.h:152
const ICGo BG_IC_Teleporters[MAX_FORTRESS_TELEPORTERS_SPAWNS]
Definition: BattlegroundIC.h:573
Definition: BattlegroundIC.h:263

+ Here is the call graph for this function:

void BattlegroundIC::UpdateNodeWorldState ( ICNodePoint node)
private
499 {
500  //updating worldstate
501  if (node->gameobject_entry == node->banners[BANNER_A_CONTROLLED])
503  else if (node->gameobject_entry == node->banners[BANNER_A_CONTESTED])
505  else if (node->gameobject_entry == node->banners[BANNER_H_CONTROLLED])
507  else if (node->gameobject_entry == node->banners[BANNER_H_CONTESTED])
509 
510  uint32 worldstate = node->worldStates[node->nodeState];
511 
512  // with this we are sure we dont bug the client
513  for (uint8 i = 0; i < 5; ++i)
514  {
515  if (node->worldStates[i] == worldstate)
516  continue;
517  UpdateWorldState(node->worldStates[i], 0);
518  }
519 
520  UpdateWorldState(worldstate, 1);
521 }
uint32 banners[4]
Definition: BattlegroundIC.h:857
uint32 gameobject_entry
Definition: BattlegroundIC.h:854
Definition: BattlegroundIC.h:829
Definition: BattlegroundIC.h:440
Definition: BattlegroundIC.h:830
Definition: BattlegroundIC.h:437
uint32 worldStates[5]
Definition: BattlegroundIC.h:861
Definition: BattlegroundIC.h:439
ICNodeState nodeState
Definition: BattlegroundIC.h:862
uint32_t uint32
Definition: Define.h:150
Definition: BattlegroundIC.h:438
Definition: BattlegroundIC.h:831
uint8_t uint8
Definition: Define.h:152
void UpdateWorldState(uint32 variable, uint32 value, bool hidden=false)
Definition: Battleground.cpp:735
Definition: BattlegroundIC.h:832

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

uint32 BattlegroundIC::closeFortressDoorsTimer
private
uint32 BattlegroundIC::docksTimer
private
bool BattlegroundIC::doorsClosed
private
uint16 BattlegroundIC::factionReinforcements[2]
private
BG_IC_GateState BattlegroundIC::GateStatus[6]
private
Transport* BattlegroundIC::gunshipAlliance
private
Transport* BattlegroundIC::gunshipHorde
private
ICNodePoint BattlegroundIC::nodePoint[7]
private
uint32 BattlegroundIC::resourceTimer
private
uint32 BattlegroundIC::siegeEngineWorkshopTimer
private

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