AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript Struct Reference
Inheritance diagram for instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript:
InstanceScript ZoneScript

Public Member Functions

 instance_blackrock_depths_InstanceMapScript (Map *map)
 
void OnPlayerEnter (Player *) override
 
void ReplaceMoiraIfSaved ()
 
void Initialize () override
 
void OnCreatureCreate (Creature *creature) override
 
void OnGameObjectCreate (GameObject *go) override
 
void OnUnitDeath (Unit *unit) override
 
void SetData (uint32 type, uint32 data) override
 
uint32 GetData (uint32 type) const override
 
ObjectGuid GetGuidData (uint32 data) const override
 
std::string GetSaveData () override
 
void Load (const char *in) override
 
void TombOfSevenEvent ()
 
void TombOfSevenReset ()
 
bool CheckTombReset (uint32 diff)
 
void Update (uint32 diff) override
 
- Public Member Functions inherited from InstanceScript
 InstanceScript (Map *map)
 
 ~InstanceScript () override
 
virtual void Initialize ()
 
virtual void Load (char const *data)
 
virtual void CreatureLooted (Creature *, LootType)
 
virtual std::string GetSaveData ()
 
void SaveToDB ()
 
virtual void Update (uint32)
 
virtual bool IsEncounterInProgress () const
 
void OnCreatureCreate (Creature *creature) override
 
void OnCreatureRemove (Creature *creature) override
 
void OnGameObjectCreate (GameObject *go) override
 
void OnGameObjectRemove (GameObject *go) override
 
ObjectGuid GetObjectGuid (uint32 type) const
 
ObjectGuid GetGuidData (uint32 type) const override
 
CreatureGetCreature (uint32 type)
 
GameObjectGetGameObject (uint32 type)
 
virtual void OnPlayerEnter (Player *)
 
virtual void OnPlayerAreaUpdate (Player *, uint32, uint32)
 
void HandleGameObject (ObjectGuid guid, bool open, GameObject *go=nullptr)
 
void DoUseDoorOrButton (ObjectGuid guid, uint32 withRestoreTime=0, bool useAlternativeState=false)
 
void DoRespawnGameObject (ObjectGuid guid, uint32 timeToDespawn=MINUTE)
 
void DoRespawnCreature (ObjectGuid guid, bool force=false)
 
void DoRespawnCreature (uint32 type, bool force=false)
 
void DoUpdateWorldState (uint32 worldstateId, uint32 worldstateValue)
 
void DoSendNotifyToInstance (char const *format,...)
 
void DoUpdateAchievementCriteria (AchievementCriteriaTypes type, uint32 miscValue1=0, uint32 miscValue2=0, Unit *unit=nullptr)
 
void DoStartTimedAchievement (AchievementCriteriaTimedTypes type, uint32 entry)
 
void DoStopTimedAchievement (AchievementCriteriaTimedTypes type, uint32 entry)
 
void DoRemoveAurasDueToSpellOnPlayers (uint32 spell)
 
void DoCastSpellOnPlayers (uint32 spell)
 
void DoCastSpellOnPlayer (Player *player, uint32 spell, bool includePets, bool includeControlled)
 
bool ServerAllowsTwoSideGroups ()
 
virtual bool SetBossState (uint32 id, EncounterState state)
 
EncounterState GetBossState (uint32 id) const
 
CreatureBoundary const * GetBossBoundary (uint32 id) const
 
BossInfo const * GetBossInfo (uint32 id) const
 
uint32 GetPersistentData (uint32 index) const
 
void StorePersistentData (uint32 index, uint32 data)
 
virtual bool CheckAchievementCriteriaMeet (uint32, Player const *, Unit const *=nullptr, uint32=0)
 
virtual bool CheckRequiredBosses (uint32, Player const *=nullptr) const
 
void SetCompletedEncountersMask (uint32 newMask, bool save)
 
uint32 GetCompletedEncounterMask () const
 
void SendEncounterUnit (uint32 type, Unit *unit=nullptr, uint8 param1=0, uint8 param2=0)
 
virtual void FillInitialWorldStates (WorldPacket &)
 
uint32 GetEncounterCount () const
 
void MarkAreaTriggerDone (uint32 id)
 
void ResetAreaTriggerDone (uint32 id)
 
bool IsAreaTriggerDone (uint32 id) const
 
virtual void DoAction (int32)
 
- Public Member Functions inherited from ZoneScript
 ZoneScript ()
 
virtual ~ZoneScript ()
 
virtual uint32 GetCreatureEntry (ObjectGuid::LowType, CreatureData const *data)
 
virtual uint32 GetGameObjectEntry (ObjectGuid::LowType, uint32 entry)
 
virtual void OnCreatureCreate (Creature *)
 
virtual void OnCreatureRemove (Creature *)
 
virtual void OnGameObjectCreate (GameObject *)
 
virtual void OnGameObjectRemove (GameObject *)
 
virtual void OnUnitDeath (Unit *)
 
virtual void OnCreatureEvade (Creature *)
 
virtual ObjectGuid GetGuidData (uint32) const
 
virtual void SetGuidData (uint32, ObjectGuid)
 
virtual uint64 GetData64 (uint32) const
 
virtual void SetData64 (uint32, uint64)
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual void ProcessEvent (WorldObject *, uint32)
 

Public Attributes

uint32 encounter [MAX_ENCOUNTER]
 
std::string str_data
 
ObjectGuid EmperorGUID
 
ObjectGuid PhalanxGUID
 
ObjectGuid MagmusGUID
 
ObjectGuid MoiraGUID
 
ObjectGuid PriestessGUID
 
ObjectGuid IronhandGUID [6]
 
ObjectGuid CorenGUID
 
ObjectGuid GoArena1GUID
 
ObjectGuid GoArena2GUID
 
ObjectGuid GoArena3GUID
 
ObjectGuid GoArena4GUID
 
ObjectGuid GoShadowLockGUID
 
ObjectGuid GoShadowMechGUID
 
ObjectGuid GoShadowGiantGUID
 
ObjectGuid GoShadowDummyGUID
 
ObjectGuid GoBarKegGUID
 
ObjectGuid GoBarKegTrapGUID
 
ObjectGuid GoBarDoorGUID
 
ObjectGuid GoTombEnterGUID
 
ObjectGuid GoTombExitGUID
 
ObjectGuid GoLyceumGUID
 
ObjectGuid GoSFSGUID
 
ObjectGuid GoSFNGUID
 
ObjectGuid GoGolemNGUID
 
ObjectGuid GoGolemSGUID
 
ObjectGuid GoThroneGUID
 
ObjectGuid GoChestGUID
 
ObjectGuid GoSpectralChaliceGUID
 
uint32 BarAleCount
 
uint32 GhostKillCount
 
ObjectGuid TombBossGUIDs [7]
 
uint32 tombResetTimer
 
uint32 TombTimer
 
uint32 TombEventCounter
 
uint32 OpenedCoofers
 
uint32 IronhandCounter
 
GuidList ArgelmachAdds
 
ObjectGuid ArgelmachGUID
 
TempSummonTempSummonGrimstone = nullptr
 
Position GrimstonePositon = Position(625.559f, -205.618f, -52.735f, 2.609f)
 
time_t timeRingFail = 0
 
uint8 arenaMobsToSpawn
 
uint8 arenaBossToSpawn
 
std::vector< ObjectGuidArenaSpectators
 
Position CenterOfRingOfLaw = Position(595.289, -186.56)
 
ObjectGuid EmperorSenators [5]
 
std::vector< ObjectGuidEmperorSenatorsVector
 
Position EmperorSpawnPos = Position(1380.52, -831, 115)
 
- Public Attributes inherited from InstanceScript
Mapinstance
 

Additional Inherited Members

- Static Public Member Functions inherited from InstanceScript
static std::string GetBossStateName (uint8 state)
 
- Protected Member Functions inherited from InstanceScript
void SetHeaders (std::string const &dataHeaders)
 
void SetBossNumber (uint32 number)
 
void SetPersistentDataCount (uint32 number)
 
void LoadBossBoundaries (BossBoundaryData const &data)
 
void LoadDoorData (DoorData const *data)
 
void LoadMinionData (MinionData const *data)
 
void LoadObjectData (ObjectData const *creatureData, ObjectData const *gameObjectData)
 
void AddObject (Creature *obj, bool add)
 
void AddObject (GameObject *obj, bool add)
 
void AddObject (WorldObject *obj, uint32 type, bool add)
 
void AddDoor (GameObject *door, bool add)
 
void AddMinion (Creature *minion, bool add)
 
void UpdateDoorState (GameObject *door)
 
void UpdateMinionState (Creature *minion, EncounterState state)
 
bool ReadSaveDataHeaders (std::istringstream &data)
 
void ReadSaveDataBossStates (std::istringstream &data)
 
void ReadSavePersistentData (std::istringstream &data)
 
virtual void ReadSaveDataMore (std::istringstream &)
 
void WriteSaveDataHeaders (std::ostringstream &data)
 
void WriteSaveDataBossStates (std::ostringstream &data)
 
void WritePersistentData (std::ostringstream &data)
 
virtual void WriteSaveDataMore (std::ostringstream &)
 

Detailed Description

Constructor & Destructor Documentation

◆ instance_blackrock_depths_InstanceMapScript()

instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::instance_blackrock_depths_InstanceMapScript ( Map map)
inline
110 : InstanceScript(map)
111 {
113 }
#define DataHeader
Definition: blackrock_depths.h:23
Definition: InstanceScript.h:140
void SetHeaders(std::string const &dataHeaders)
Definition: InstanceScript.cpp:137

References DataHeader, and InstanceScript::SetHeaders().

Member Function Documentation

◆ CheckTombReset()

bool instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::CheckTombReset ( uint32  diff)
inline
807 {
808 bool anyBossAlive = false; // status of the bosses up until the current one
809 for (uint8 i = 0; i < TombEventCounter; i++)
810 {
812 if (boss)
813 {
814 anyBossAlive |= boss->IsAlive();
815 if (boss->IsAlive() && boss->IsInCombat())
816 {
818 return false; // any boss in combat means we shouldn't reset.
819 }
820 }
821 }
822 if (!anyBossAlive) // no boss alive, put reset timer back up
823 {
825 }
826 tombResetTimer -= diff;
827 return tombResetTimer < diff;
828 }
std::uint8_t uint8
Definition: Define.h:110
@ TIMER_TOMB_RESET
Definition: instance_blackrock_depths.cpp:30
Definition: Creature.h:46
bool IsAlive() const
Definition: Unit.h:1808
bool IsInCombat() const
Definition: Unit.h:1688
Map * instance
Definition: InstanceScript.h:146
Creature * GetCreature(ObjectGuid const guid)
Definition: Map.cpp:3293
uint32 tombResetTimer
Definition: instance_blackrock_depths.cpp:151
ObjectGuid TombBossGUIDs[7]
Definition: instance_blackrock_depths.cpp:150
uint32 TombEventCounter
Definition: instance_blackrock_depths.cpp:153

References Map::GetCreature(), InstanceScript::instance, Unit::IsAlive(), Unit::IsInCombat(), TIMER_TOMB_RESET, TombBossGUIDs, TombEventCounter, and tombResetTimer.

Referenced by Update().

◆ GetData()

uint32 instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::GetData ( uint32  type) const
inlineoverridevirtual

Reimplemented from ZoneScript.

645 {
646 switch (type)
647 {
648 case TYPE_RING_OF_LAW:
649 return encounter[0];
650 case TYPE_VAULT:
651 return encounter[1];
652 case TYPE_BAR:
653 if (encounter[2] == IN_PROGRESS && BarAleCount == 3)
654 return SPECIAL;
655 else
656 return encounter[2];
658 return encounter[3];
659 case TYPE_LYCEUM:
660 return encounter[4];
661 case TYPE_IRON_HALL:
662 return encounter[5];
664 return timeRingFail;
665 case DATA_ARENA_MOBS:
666 return arenaMobsToSpawn;
667 case DATA_ARENA_BOSS:
668 return arenaBossToSpawn;
669 }
670 return 0;
671 }
@ IN_PROGRESS
Definition: InstanceScript.h:57
@ SPECIAL
Definition: InstanceScript.h:60
@ TYPE_RING_OF_LAW
Definition: blackrock_depths.h:40
@ TYPE_IRON_HALL
Definition: blackrock_depths.h:45
@ TYPE_BAR
Definition: blackrock_depths.h:42
@ TYPE_TOMB_OF_SEVEN
Definition: blackrock_depths.h:43
@ DATA_TIME_RING_FAIL
Definition: blackrock_depths.h:83
@ DATA_ARENA_BOSS
Definition: blackrock_depths.h:85
@ TYPE_LYCEUM
Definition: blackrock_depths.h:44
@ TYPE_VAULT
Definition: blackrock_depths.h:41
@ DATA_ARENA_MOBS
Definition: blackrock_depths.h:84
time_t timeRingFail
Definition: instance_blackrock_depths.cpp:162
uint8 arenaBossToSpawn
Definition: instance_blackrock_depths.cpp:164
uint32 encounter[MAX_ENCOUNTER]
Definition: instance_blackrock_depths.cpp:115
uint8 arenaMobsToSpawn
Definition: instance_blackrock_depths.cpp:163
uint32 BarAleCount
Definition: instance_blackrock_depths.cpp:148

References arenaBossToSpawn, arenaMobsToSpawn, BarAleCount, DATA_ARENA_BOSS, DATA_ARENA_MOBS, DATA_TIME_RING_FAIL, encounter, IN_PROGRESS, SPECIAL, timeRingFail, TYPE_BAR, TYPE_IRON_HALL, TYPE_LYCEUM, TYPE_RING_OF_LAW, TYPE_TOMB_OF_SEVEN, and TYPE_VAULT.

Referenced by Update().

◆ GetGuidData()

ObjectGuid instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::GetGuidData ( uint32  data) const
inlineoverridevirtual

Reimplemented from InstanceScript.

674 {
675 switch (data)
676 {
677 case DATA_EMPEROR:
678 return EmperorGUID;
679 case DATA_PHALANX:
680 return PhalanxGUID;
681 case DATA_MOIRA:
682 return MoiraGUID;
683 case DATA_COREN:
684 return CorenGUID;
685 case DATA_ARENA1:
686 return GoArena1GUID;
687 case DATA_ARENA2:
688 return GoArena2GUID;
689 case DATA_ARENA3:
690 return GoArena3GUID;
691 case DATA_ARENA4:
692 return GoArena4GUID;
693 case DATA_GO_BAR_KEG:
694 return GoBarKegGUID;
696 return GoBarKegTrapGUID;
697 case DATA_GO_BAR_DOOR:
698 return GoBarDoorGUID;
700 return GoSFNGUID;
702 return GoSFSGUID;
703 case DATA_THRONE_DOOR:
704 return GoThroneGUID;
706 return GoGolemNGUID;
708 return GoGolemSGUID;
709 case DATA_GO_CHALICE:
711 case DATA_MAGMUS:
712 {
713 return MagmusGUID;
714 }
715 }
716
717 return ObjectGuid::Empty;
718 }
@ DATA_PHALANX
Definition: blackrock_depths.h:48
@ DATA_COREN
Definition: blackrock_depths.h:75
@ DATA_EMPEROR
Definition: blackrock_depths.h:47
@ DATA_GO_BAR_KEG
Definition: blackrock_depths.h:55
@ DATA_MAGMUS
Definition: blackrock_depths.h:73
@ DATA_ARENA3
Definition: blackrock_depths.h:52
@ DATA_ARENA2
Definition: blackrock_depths.h:51
@ DATA_GO_CHALICE
Definition: blackrock_depths.h:58
@ DATA_MOIRA
Definition: blackrock_depths.h:67
@ DATA_GOLEM_DOOR_S
Definition: blackrock_depths.h:61
@ DATA_GOLEM_DOOR_N
Definition: blackrock_depths.h:60
@ DATA_THRONE_DOOR
Definition: blackrock_depths.h:63
@ DATA_SF_BRAZIER_N
Definition: blackrock_depths.h:65
@ DATA_ARENA4
Definition: blackrock_depths.h:53
@ DATA_GO_BAR_KEG_TRAP
Definition: blackrock_depths.h:56
@ DATA_ARENA1
Definition: blackrock_depths.h:50
@ DATA_SF_BRAZIER_S
Definition: blackrock_depths.h:66
@ DATA_GO_BAR_DOOR
Definition: blackrock_depths.h:57
static ObjectGuid const Empty
Definition: ObjectGuid.h:122
ObjectGuid GoArena2GUID
Definition: instance_blackrock_depths.cpp:127
ObjectGuid GoGolemSGUID
Definition: instance_blackrock_depths.cpp:143
ObjectGuid GoArena3GUID
Definition: instance_blackrock_depths.cpp:128
ObjectGuid CorenGUID
Definition: instance_blackrock_depths.cpp:124
ObjectGuid GoSpectralChaliceGUID
Definition: instance_blackrock_depths.cpp:146
ObjectGuid GoBarKegTrapGUID
Definition: instance_blackrock_depths.cpp:135
ObjectGuid PhalanxGUID
Definition: instance_blackrock_depths.cpp:119
ObjectGuid GoGolemNGUID
Definition: instance_blackrock_depths.cpp:142
ObjectGuid MagmusGUID
Definition: instance_blackrock_depths.cpp:120
ObjectGuid EmperorGUID
Definition: instance_blackrock_depths.cpp:118
ObjectGuid GoSFNGUID
Definition: instance_blackrock_depths.cpp:141
ObjectGuid GoArena1GUID
Definition: instance_blackrock_depths.cpp:126
ObjectGuid GoBarKegGUID
Definition: instance_blackrock_depths.cpp:134
ObjectGuid GoBarDoorGUID
Definition: instance_blackrock_depths.cpp:136
ObjectGuid GoArena4GUID
Definition: instance_blackrock_depths.cpp:129
ObjectGuid GoThroneGUID
Definition: instance_blackrock_depths.cpp:144
ObjectGuid MoiraGUID
Definition: instance_blackrock_depths.cpp:121
ObjectGuid GoSFSGUID
Definition: instance_blackrock_depths.cpp:140

References CorenGUID, DATA_ARENA1, DATA_ARENA2, DATA_ARENA3, DATA_ARENA4, DATA_COREN, DATA_EMPEROR, DATA_GO_BAR_DOOR, DATA_GO_BAR_KEG, DATA_GO_BAR_KEG_TRAP, DATA_GO_CHALICE, DATA_GOLEM_DOOR_N, DATA_GOLEM_DOOR_S, DATA_MAGMUS, DATA_MOIRA, DATA_PHALANX, DATA_SF_BRAZIER_N, DATA_SF_BRAZIER_S, DATA_THRONE_DOOR, EmperorGUID, ObjectGuid::Empty, GoArena1GUID, GoArena2GUID, GoArena3GUID, GoArena4GUID, GoBarDoorGUID, GoBarKegGUID, GoBarKegTrapGUID, GoGolemNGUID, GoGolemSGUID, GoSFNGUID, GoSFSGUID, GoSpectralChaliceGUID, GoThroneGUID, MagmusGUID, MoiraGUID, and PhalanxGUID.

Referenced by SetData().

◆ GetSaveData()

std::string instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::GetSaveData ( )
inlineoverridevirtual

Reimplemented from InstanceScript.

721 {
722 return str_data;
723 }
std::string str_data
Definition: instance_blackrock_depths.cpp:116

References str_data.

◆ Initialize()

void instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::Initialize ( )
inlineoverridevirtual

Reimplemented from InstanceScript.

218 {
219 memset(&encounter, 0, sizeof(encounter));
220
221 BarAleCount = 0;
222 GhostKillCount = 0;
225 tombResetTimer = 0;
226 OpenedCoofers = 0;
227 IronhandCounter = 0;
228 ArenaSpectators.clear();
229
230 // these are linked to the dungeon and not how many times the arena started.
231 arenaMobsToSpawn = urand(0, 5);
232 arenaBossToSpawn = urand(0, 5);
233 }
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:44
@ TIMER_TOMB_START
Definition: instance_blackrock_depths.cpp:29
uint32 IronhandCounter
Definition: instance_blackrock_depths.cpp:155
uint32 TombTimer
Definition: instance_blackrock_depths.cpp:152
std::vector< ObjectGuid > ArenaSpectators
Definition: instance_blackrock_depths.cpp:166
uint32 OpenedCoofers
Definition: instance_blackrock_depths.cpp:154
uint32 GhostKillCount
Definition: instance_blackrock_depths.cpp:149

References arenaBossToSpawn, arenaMobsToSpawn, ArenaSpectators, BarAleCount, encounter, GhostKillCount, IronhandCounter, OpenedCoofers, TIMER_TOMB_START, TombEventCounter, tombResetTimer, TombTimer, and urand().

◆ Load()

void instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::Load ( const char *  in)
inlineoverridevirtual

Reimplemented from InstanceScript.

726 {
727 if (!in)
728 {
730 return;
731 }
732
734
735 std::istringstream loadStream(in);
736 loadStream >> encounter[0] >> encounter[1] >> encounter[2] >> encounter[3]
737 >> encounter[4] >> encounter[5] >> GhostKillCount;
738
739 for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
740 if (encounter[i] == IN_PROGRESS)
742 if (GhostKillCount > 0 && GhostKillCount < 7)
743 GhostKillCount = 0;//reset tomb of seven event
744 if (GhostKillCount >= 7)
745 GhostKillCount = 7;
746
748 }
#define OUT_LOAD_INST_DATA_FAIL
Definition: InstanceScript.h:31
@ NOT_STARTED
Definition: InstanceScript.h:56
#define OUT_LOAD_INST_DATA_COMPLETE
Definition: InstanceScript.h:30
#define OUT_LOAD_INST_DATA(a)
Definition: InstanceScript.h:29
constexpr auto MAX_ENCOUNTER
Definition: instance_blackrock_depths.cpp:24

References encounter, GhostKillCount, IN_PROGRESS, MAX_ENCOUNTER, NOT_STARTED, OUT_LOAD_INST_DATA, OUT_LOAD_INST_DATA_COMPLETE, and OUT_LOAD_INST_DATA_FAIL.

◆ OnCreatureCreate()

void instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::OnCreatureCreate ( Creature creature)
inlineoverridevirtual

Reimplemented from InstanceScript.

236 {
237 switch (creature->GetEntry())
238 {
239 case NPC_EMPEROR:
240 EmperorGUID = creature->GetGUID();
241 break;
242 case NPC_PHALANX:
243 PhalanxGUID = creature->GetGUID();
244 break;
245 case NPC_MOIRA:
246 MoiraGUID = creature->GetGUID();
247 break;
249 CorenGUID = creature->GetGUID();
250 break;
251 case NPC_ANGERREL:
252 TombBossGUIDs[0] = creature->GetGUID();
253 break;
254 case NPC_SEETHREL:
255 TombBossGUIDs[1] = creature->GetGUID();
256 break;
257 case NPC_DOPEREL:
258 TombBossGUIDs[2] = creature->GetGUID();
259 break;
260 case NPC_GLOOMREL:
261 TombBossGUIDs[3] = creature->GetGUID();
262 break;
263 case NPC_VILEREL:
264 TombBossGUIDs[4] = creature->GetGUID();
265 break;
266 case NPC_HATEREL:
267 TombBossGUIDs[5] = creature->GetGUID();
268 break;
269 case NPC_DOOMREL:
270 TombBossGUIDs[6] = creature->GetGUID();
271 break;
272 case NPC_MAGMUS:
273 MagmusGUID = creature->GetGUID();
274 if (!creature->IsAlive())
275 HandleGameObject(GoThroneGUID, true); // if Magmus is dead open door to last boss
276 break;
281 if (creature->IsAlive() && creature->GetPositionZ() < -51.5f && creature->GetPositionZ() > -55.f)
282 {
283 ArgelmachAdds.push_back(creature->GetGUID());
284 }
285 break;
287 ArgelmachGUID = creature->GetGUID();
288 break;
290 IronhandGUID[IronhandCounter] = creature->GetGUID();
292 break;
294 ArenaSpectators.push_back(creature->GetGUID());
295 if (encounter[TYPE_RING_OF_LAW] == DONE) // added for crashes
296 {
297 creature->SetFaction(FACTION_NEUTRAL);
299 }
300 break;
302 case NPC_SHADOWFORCE_CITIZEN: // both do the same
304 {
305 ArenaSpectators.push_back(creature->GetGUID());
306 }
307 if (encounter[TYPE_RING_OF_LAW] == DONE) // added for crashes
308 {
309 creature->SetFaction(FACTION_NEUTRAL);
311 }
312 break;
314 // keep track of Senators that are not too far from emperor. Can't really use emperor as creature due to him possibly not being spawned.
315 // some senators spawn at ring of law
317 {
318 EmperorSenatorsVector.push_back(creature->GetGUID());
319 }
320 break;
321 default:
322 break;
323 }
324 }
@ REACT_DEFENSIVE
Definition: Unit.h:1024
@ DONE
Definition: InstanceScript.h:59
@ NPC_EMPEROR
Definition: blackrock_depths.h:90
@ NPC_COREN_DIREBREW
Definition: blackrock_depths.h:110
@ NPC_IRONHAND_GUARDIAN
Definition: blackrock_depths.h:112
@ NPC_SHADOWFORGE_SENATOR
Definition: blackrock_depths.h:118
@ NPC_DOOMREL
Definition: blackrock_depths.h:98
@ NPC_VILEREL
Definition: blackrock_depths.h:95
@ NPC_RAGEREAVER_GOLEM
Definition: blackrock_depths.h:106
@ NPC_ANGERREL
Definition: blackrock_depths.h:92
@ NPC_WEAPON_TECHNICIAN
Definition: blackrock_depths.h:104
@ NPC_DOOMFORGE_ARCANASMITH
Definition: blackrock_depths.h:105
@ NPC_SHADOWFORCE_CITIZEN
Definition: blackrock_depths.h:116
@ NPC_HATEREL
Definition: blackrock_depths.h:94
@ NPC_MAGMUS
Definition: blackrock_depths.h:120
@ NPC_GOLEM_LORD_ARGELMACH
Definition: blackrock_depths.h:108
@ NPC_SHADOWFORGE_PEASANT
Definition: blackrock_depths.h:115
@ NPC_WRATH_HAMMER_CONSTRUCT
Definition: blackrock_depths.h:107
@ NPC_DOPEREL
Definition: blackrock_depths.h:93
@ NPC_PHALANX
Definition: blackrock_depths.h:91
@ NPC_GLOOMREL
Definition: blackrock_depths.h:97
@ NPC_ARENA_SPECTATOR
Definition: blackrock_depths.h:114
@ NPC_SEETHREL
Definition: blackrock_depths.h:96
@ NPC_MOIRA
Definition: blackrock_depths.h:99
@ FACTION_NEUTRAL
Definition: blackrock_depths.h:28
@ DISTANCE_EMPEROR_ROOM
Definition: instance_blackrock_depths.cpp:36
@ RADIUS_RING_OF_LAW
Definition: instance_blackrock_depths.cpp:35
void SetReactState(ReactStates st)
Definition: Creature.h:89
uint32 GetEntry() const
Definition: Object.h:109
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:106
float GetDistance2d(WorldObject const *obj) const
Definition: Object.cpp:1263
float GetPositionZ() const
Definition: Position.h:119
float GetPositionX() const
Definition: Position.h:117
float GetPositionY() const
Definition: Position.h:118
void SetFaction(uint32 faction)
Definition: Unit.cpp:10029
void HandleGameObject(ObjectGuid guid, bool open, GameObject *go=nullptr)
Definition: InstanceScript.cpp:109
Position EmperorSpawnPos
Definition: instance_blackrock_depths.cpp:171
Position CenterOfRingOfLaw
Definition: instance_blackrock_depths.cpp:167
GuidList ArgelmachAdds
Definition: instance_blackrock_depths.cpp:157
std::vector< ObjectGuid > EmperorSenatorsVector
Definition: instance_blackrock_depths.cpp:170
ObjectGuid IronhandGUID[6]
Definition: instance_blackrock_depths.cpp:123
ObjectGuid ArgelmachGUID
Definition: instance_blackrock_depths.cpp:158

References ArenaSpectators, ArgelmachAdds, ArgelmachGUID, CenterOfRingOfLaw, CorenGUID, DISTANCE_EMPEROR_ROOM, DONE, EmperorGUID, EmperorSenatorsVector, EmperorSpawnPos, encounter, FACTION_NEUTRAL, WorldObject::GetDistance2d(), Object::GetEntry(), Object::GetGUID(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), GoThroneGUID, InstanceScript::HandleGameObject(), IronhandCounter, IronhandGUID, Unit::IsAlive(), MagmusGUID, MoiraGUID, NPC_ANGERREL, NPC_ARENA_SPECTATOR, NPC_COREN_DIREBREW, NPC_DOOMFORGE_ARCANASMITH, NPC_DOOMREL, NPC_DOPEREL, NPC_EMPEROR, NPC_GLOOMREL, NPC_GOLEM_LORD_ARGELMACH, NPC_HATEREL, NPC_IRONHAND_GUARDIAN, NPC_MAGMUS, NPC_MOIRA, NPC_PHALANX, NPC_RAGEREAVER_GOLEM, NPC_SEETHREL, NPC_SHADOWFORCE_CITIZEN, NPC_SHADOWFORGE_PEASANT, NPC_SHADOWFORGE_SENATOR, NPC_VILEREL, NPC_WEAPON_TECHNICIAN, NPC_WRATH_HAMMER_CONSTRUCT, PhalanxGUID, RADIUS_RING_OF_LAW, REACT_DEFENSIVE, Unit::SetFaction(), Creature::SetReactState(), TombBossGUIDs, and TYPE_RING_OF_LAW.

◆ OnGameObjectCreate()

void instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::OnGameObjectCreate ( GameObject go)
inlineoverridevirtual

Reimplemented from InstanceScript.

327 {
328 switch (go->GetEntry())
329 {
330 case GO_ARENA1:
331 GoArena1GUID = go->GetGUID();
332 break;
333 case GO_ARENA2:
334 GoArena2GUID = go->GetGUID();
335 break;
336 case GO_ARENA3:
337 GoArena3GUID = go->GetGUID();
338 break;
339 case GO_ARENA4:
340 GoArena4GUID = go->GetGUID();
341 break;
342 case GO_SHADOW_LOCK:
344 break;
347 break;
350 break;
351 case GO_SHADOW_DUMMY:
353 break;
354 case GO_BAR_KEG_SHOT:
355 GoBarKegGUID = go->GetGUID();
356 break;
357 case GO_BAR_KEG_TRAP:
359 break;
360 case GO_BAR_DOOR:
361 GoBarDoorGUID = go->GetGUID();
362 break;
363 case GO_TOMB_ENTER:
364 GoTombEnterGUID = go->GetGUID();
365 break;
366 case GO_TOMB_EXIT:
367 GoTombExitGUID = go->GetGUID();
368 if (GhostKillCount >= 7)
370 else
372 break;
373 case GO_LYCEUM:
374 GoLyceumGUID = go->GetGUID();
375 break;
376 case GO_SF_S:
377 GoSFSGUID = go->GetGUID();
378 break;
379 case GO_SF_N:
380 GoSFNGUID = go->GetGUID();
381 break;
382 case GO_GOLEM_ROOM_N:
383 GoGolemNGUID = go->GetGUID();
384 break;
385 case GO_GOLEM_ROOM_S:
386 GoGolemSGUID = go->GetGUID();
387 break;
388 case GO_THRONE_ROOM:
389 GoThroneGUID = go->GetGUID();
390 break;
391 case GO_CHEST_SEVEN:
392 GoChestGUID = go->GetGUID();
393 break;
396 break;
397 }
398 }
@ GO_SHADOW_MECHANISM
Definition: instance_blackrock_depths.cpp:52
@ GO_ARENA3
Definition: instance_blackrock_depths.cpp:49
@ GO_GOLEM_ROOM_N
Definition: instance_blackrock_depths.cpp:63
@ GO_SHADOW_LOCK
Definition: instance_blackrock_depths.cpp:51
@ GO_SHADOW_GIANT_DOOR
Definition: instance_blackrock_depths.cpp:53
@ GO_TOMB_EXIT
Definition: instance_blackrock_depths.cpp:59
@ GO_LYCEUM
Definition: instance_blackrock_depths.cpp:60
@ GO_SHADOW_DUMMY
Definition: instance_blackrock_depths.cpp:54
@ GO_SF_S
Definition: instance_blackrock_depths.cpp:62
@ GO_TOMB_ENTER
Definition: instance_blackrock_depths.cpp:58
@ GO_ARENA2
Definition: instance_blackrock_depths.cpp:48
@ GO_GOLEM_ROOM_S
Definition: instance_blackrock_depths.cpp:64
@ GO_BAR_DOOR
Definition: instance_blackrock_depths.cpp:57
@ GO_SF_N
Definition: instance_blackrock_depths.cpp:61
@ GO_BAR_KEG_SHOT
Definition: instance_blackrock_depths.cpp:55
@ GO_ARENA4
Definition: instance_blackrock_depths.cpp:50
@ GO_ARENA1
Definition: instance_blackrock_depths.cpp:47
@ GO_SPECTRAL_CHALICE
Definition: instance_blackrock_depths.cpp:66
@ GO_BAR_KEG_TRAP
Definition: instance_blackrock_depths.cpp:56
@ GO_THRONE_ROOM
Definition: instance_blackrock_depths.cpp:65
@ GO_CHEST_SEVEN
Definition: instance_blackrock_depths.cpp:67
ObjectGuid GoShadowGiantGUID
Definition: instance_blackrock_depths.cpp:132
ObjectGuid GoShadowMechGUID
Definition: instance_blackrock_depths.cpp:131
ObjectGuid GoTombEnterGUID
Definition: instance_blackrock_depths.cpp:137
ObjectGuid GoShadowDummyGUID
Definition: instance_blackrock_depths.cpp:133
ObjectGuid GoShadowLockGUID
Definition: instance_blackrock_depths.cpp:130
ObjectGuid GoLyceumGUID
Definition: instance_blackrock_depths.cpp:139
ObjectGuid GoTombExitGUID
Definition: instance_blackrock_depths.cpp:138
ObjectGuid GoChestGUID
Definition: instance_blackrock_depths.cpp:145

References ObjectGuid::Empty, Object::GetEntry(), Object::GetGUID(), GhostKillCount, GO_ARENA1, GO_ARENA2, GO_ARENA3, GO_ARENA4, GO_BAR_DOOR, GO_BAR_KEG_SHOT, GO_BAR_KEG_TRAP, GO_CHEST_SEVEN, GO_GOLEM_ROOM_N, GO_GOLEM_ROOM_S, GO_LYCEUM, GO_SF_N, GO_SF_S, GO_SHADOW_DUMMY, GO_SHADOW_GIANT_DOOR, GO_SHADOW_LOCK, GO_SHADOW_MECHANISM, GO_SPECTRAL_CHALICE, GO_THRONE_ROOM, GO_TOMB_ENTER, GO_TOMB_EXIT, GoArena1GUID, GoArena2GUID, GoArena3GUID, GoArena4GUID, GoBarDoorGUID, GoBarKegGUID, GoBarKegTrapGUID, GoChestGUID, GoGolemNGUID, GoGolemSGUID, GoLyceumGUID, GoSFNGUID, GoSFSGUID, GoShadowDummyGUID, GoShadowGiantGUID, GoShadowLockGUID, GoShadowMechGUID, GoSpectralChaliceGUID, GoThroneGUID, GoTombEnterGUID, GoTombExitGUID, and InstanceScript::HandleGameObject().

◆ OnPlayerEnter()

void instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::OnPlayerEnter ( Player )
inlineoverridevirtual

Reimplemented from InstanceScript.

174 {
175 ReplaceMoiraIfSaved(); // In case a player joins the party during the run
176 // SetData(TYPE_RING_OF_LAW, DONE);
177 }
void ReplaceMoiraIfSaved()
Definition: instance_blackrock_depths.cpp:179

References ReplaceMoiraIfSaved().

◆ OnUnitDeath()

void instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::OnUnitDeath ( Unit unit)
inlineoverridevirtual

Reimplemented from ZoneScript.

401 {
402 uint32 deadSenators = 0;
403 switch (unit->GetEntry())
404 {
409 ArgelmachAdds.remove(unit->GetGUID());
410 break;
411 case NPC_MAGMUS:
413 break;
415 deadSenators = 1; //hacky, but we cannot count the unit that just died through its state because OnUnitDeath() is called before the state is set.
416 for (const auto &senatorGUID: EmperorSenatorsVector)
417 {
418 if (Creature* senator = instance->GetCreature(senatorGUID))
419 {
420 if (!senator->IsAlive() || senator->isDying())
421 {
422 deadSenators++;
423 }
424 }
425 }
426
427 if (Creature* emperor = instance->GetCreature(EmperorGUID))
428 {
429 // send % of senators that died
430 emperor->AI()->SetData(0, (100 * deadSenators) / EmperorSenatorsVector.size());
431 }
432 break;
433 case NPC_ANGERREL:
434 case NPC_DOPEREL:
435 case NPC_HATEREL:
436 case NPC_VILEREL:
437 case NPC_SEETHREL:
438 case NPC_GLOOMREL:
439 case NPC_DOOMREL:
441 if (GhostKillCount >= 7)
442 {
444 }
445 break;
446 default:
447 break;
448 }
449 }
std::uint32_t uint32
Definition: Define.h:108
void SetData(uint32 type, uint32 data) override
Definition: instance_blackrock_depths.cpp:451

References ArgelmachAdds, DONE, EmperorGUID, EmperorSenatorsVector, Map::GetCreature(), Object::GetEntry(), Object::GetGUID(), GhostKillCount, InstanceScript::instance, NPC_ANGERREL, NPC_DOOMFORGE_ARCANASMITH, NPC_DOOMREL, NPC_DOPEREL, NPC_GLOOMREL, NPC_HATEREL, NPC_MAGMUS, NPC_RAGEREAVER_GOLEM, NPC_SEETHREL, NPC_SHADOWFORGE_SENATOR, NPC_VILEREL, NPC_WEAPON_TECHNICIAN, NPC_WRATH_HAMMER_CONSTRUCT, SetData(), TYPE_IRON_HALL, and TYPE_TOMB_OF_SEVEN.

◆ ReplaceMoiraIfSaved()

void instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::ReplaceMoiraIfSaved ( )
inline
180 {
181 ObjectGuid* GUIDToReplace = &PriestessGUID; // default to having Moira
182 ObjectGuid* GUIDToSpawn = &MoiraGUID;
183 uint32 NPCEntry = NPC_MOIRA;
184 bool MoiraSaved = true;
185
186 // check if all players saved her.
187 Map::PlayerList const& lPlayers = instance->GetPlayers();
188 if (!lPlayers.IsEmpty())
189 {
190 for (Map::PlayerList::const_iterator itr = lPlayers.begin(); itr != lPlayers.end(); ++itr)
191 {
192 if (Player* player = itr->GetSource())
193 {
194 // set to false if this player hasn't saved her. Another player can't put it to true.
195 MoiraSaved = MoiraSaved && ((player->GetQuestStatus(PRINCESS_QUEST_HORDE) == QUEST_STATUS_REWARDED)
196 || (player->GetQuestStatus(PRINCESS_QUEST_ALLIANCE) == QUEST_STATUS_REWARDED));
197 }
198 }
199 }
200
201 // assign correct GUIDs and spawn targets
202 if (MoiraSaved)
203 {
204 GUIDToReplace = &MoiraGUID;
205 GUIDToSpawn = &PriestessGUID;
206 NPCEntry = NPC_PRIESTESS;
207 }
208
209 if (Creature* CreatureToReplace = instance->GetCreature(*GUIDToReplace))
210 {
211 Creature* NewSpawn = instance->SummonCreature(NPCEntry, CreatureToReplace->GetPosition());
212 CreatureToReplace->RemoveFromWorld();
213 *GUIDToSpawn = NewSpawn->GetGUID();
214 }
215 }
@ QUEST_STATUS_REWARDED
Definition: QuestDef.h:106
@ NPC_PRIESTESS
Definition: blackrock_depths.h:100
@ PRINCESS_QUEST_HORDE
Definition: instance_blackrock_depths.cpp:41
@ PRINCESS_QUEST_ALLIANCE
Definition: instance_blackrock_depths.cpp:42
bool IsEmpty() const
Definition: LinkedList.h:97
Definition: LinkedList.h:139
void RemoveFromWorld() override
Definition: TemporarySummon.cpp:327
Definition: ObjectGuid.h:120
Definition: Player.h:1046
PlayerList const & GetPlayers() const
Definition: Map.h:484
TempSummon * SummonCreature(uint32 entry, Position const &pos, SummonPropertiesEntry const *properties=nullptr, uint32 duration=0, WorldObject *summoner=nullptr, uint32 spellId=0, uint32 vehId=0, bool visibleBySummonerOnly=false)
Definition: Object.cpp:2129
Definition: MapRefMgr.h:26
iterator begin()
Definition: MapRefMgr.h:36
iterator end()
Definition: MapRefMgr.h:37
ObjectGuid PriestessGUID
Definition: instance_blackrock_depths.cpp:122

References MapRefMgr::begin(), MapRefMgr::end(), Map::GetCreature(), Object::GetGUID(), Map::GetPlayers(), InstanceScript::instance, LinkedListHead::IsEmpty(), MoiraGUID, NPC_MOIRA, NPC_PRIESTESS, PriestessGUID, PRINCESS_QUEST_ALLIANCE, PRINCESS_QUEST_HORDE, QUEST_STATUS_REWARDED, TempSummon::RemoveFromWorld(), and Map::SummonCreature().

Referenced by OnPlayerEnter(), and SetData().

◆ SetData()

void instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::SetData ( uint32  type,
uint32  data 
)
inlineoverridevirtual

Reimplemented from ZoneScript.

452 {
453 LOG_DEBUG("scripts.ai", "Instance Blackrock Depths: SetData update (Type: {} Data {})", type, data);
454
455 switch (type)
456 {
457 case TYPE_RING_OF_LAW:
458 encounter[0] = data;
459 switch(data)
460 {
461 case IN_PROGRESS:
463 break;
464 case FAIL:
466 {
468 TempSummonGrimstone = nullptr;
470 }
472 break;
473 case DONE:
474 for (const auto& itr : ArenaSpectators)
475 {
476 if (Creature* spectator = instance->GetCreature(itr))
477 {
478 spectator->SetFaction(FACTION_NEUTRAL);
479 spectator->SetReactState(REACT_DEFENSIVE);
480 }
481 }
482 break;
483 default:
484 break;
485 }
486 break;
487 case TYPE_VAULT:
488 encounter[1] = data;
489 break;
490 case TYPE_BAR:
491 if (data == SPECIAL)
492 ++BarAleCount;
493 else
494 encounter[2] = data;
495 break;
497 encounter[3] = data;
498 switch (data)
499 {
500 case IN_PROGRESS:
503 break;
504 case DONE:
508 break;
509 }
510 break;
511 case TYPE_LYCEUM:
512 encounter[4] = data;
513 if (data == DONE)
514 {
517 if (Creature* magmus = instance->GetCreature(MagmusGUID))
518 {
519 magmus->AI()->Talk(0);
520 }
521 ReplaceMoiraIfSaved(); // Need to place the correct final boss, but we need her to be spawned first.
522 }
523 break;
524 case TYPE_IRON_HALL:
525 encounter[5] = data;
526 switch (data)
527 {
528 case NOT_STARTED:
529 case IN_PROGRESS:
530 for (int i = 0; i < 6; i++)
531 {
532 if (Creature* ironhand = instance->GetCreature(IronhandGUID[i]))
533 {
534 ironhand->AI()->SetData(0, data == IN_PROGRESS);
535 }
536 }
537 break;
538 case DONE:
540 break;
541 default:
542 break;
543 }
544 break;
546 OpenedCoofers += 1;
547 if (OpenedCoofers == 12)
548 {
549 Position pos = {812.15f, -348.91f, -50.579f, 0.7f};
551 summon->SetTempSummonType(TEMPSUMMON_MANUAL_DESPAWN);
552 }
553 break;
555 {
556 if (Creature* argelmach = instance->GetCreature(ArgelmachGUID))
557 {
558 GuidList adds = ArgelmachAdds;
559 for (GuidList::const_iterator itr = adds.begin(); itr != adds.end();)
560 {
561 if (Creature* argelmachAdd = instance->GetCreature(*itr))
562 {
563 if (argelmachAdd->GetEntry() == NPC_WRATH_HAMMER_CONSTRUCT)
564 {
565 argelmachAdd->RemoveAurasDueToSpell(SPELL_STONED);
566 argelmachAdd->AI()->AttackStart(argelmach->GetVictim());
567 itr = adds.erase(itr);
568 }
569 else if (argelmachAdd->GetEntry() == NPC_RAGEREAVER_GOLEM)
570 {
571 if (argelmachAdd->IsWithinDist2d(argelmach, 10.f))
572 {
573 argelmachAdd->RemoveAurasDueToSpell(SPELL_STONED);
574 argelmachAdd->AI()->AttackStart(argelmach->GetVictim());
575 itr = adds.erase(itr);
576 }
577 else
578 ++itr;
579 }
580 else
581 {
582 ++itr;
583 }
584 }
585 else
586 {
587 ++itr;
588 }
589 }
590
591 if (!adds.empty())
592 {
593 argelmach->SetReactState(REACT_PASSIVE);
594 argelmach->SetTarget();
595 argelmach->AI()->SetData(DATA_GOLEM_LORD_ARGELMACH_INIT, IN_PROGRESS);
596 }
597 else
598 {
599 argelmach->AI()->SetData(DATA_GOLEM_LORD_ARGELMACH_INIT, DONE);
600 }
601 }
602 break;
603 }
605 {
606 if (Creature* argelmach = instance->GetCreature(ArgelmachGUID))
607 {
608 argelmach->HandleEmoteCommand(EMOTE_ONESHOT_SHOUT);
609 argelmach->m_Events.AddEvent(new RestoreAttack(argelmach), argelmach->m_Events.CalculateTime(3000));
610
611 for (ObjectGuid const& argelmachAddGUID : ArgelmachAdds)
612 {
613 if (Creature* argelmachAdd = instance->GetCreature(argelmachAddGUID))
614 {
615 if (!argelmachAdd->IsInCombat())
616 {
617 argelmachAdd->RemoveAurasDueToSpell(SPELL_STONED);
618 argelmachAdd->AI()->AttackStart(argelmach->GetVictim());
619 }
620 }
621 }
622 }
623 break;
624 }
625 default:
626 break;
627 }
628
629 if (data == DONE || GhostKillCount >= 7)
630 {
632
633 std::ostringstream saveStream;
634 saveStream << encounter[0] << ' ' << encounter[1] << ' ' << encounter[2] << ' '
635 << encounter[3] << ' ' << encounter[4] << ' ' << encounter[5] << ' ' << GhostKillCount;
636
637 str_data = saveStream.str();
638
639 SaveToDB();
641 }
642 }
constexpr auto DAY
Definition: Common.h:58
#define LOG_DEBUG(filterType__,...)
Definition: Log.h:171
@ TEMPSUMMON_MANUAL_DESPAWN
Definition: Object.h:49
std::list< ObjectGuid > GuidList
Definition: ObjectGuid.h:256
@ REACT_PASSIVE
Definition: Unit.h:1023
@ FAIL
Definition: InstanceScript.h:58
#define OUT_SAVE_INST_DATA_COMPLETE
Definition: InstanceScript.h:28
#define OUT_SAVE_INST_DATA
Definition: InstanceScript.h:27
@ NPC_WATCHMAN_DOOMGRIP
Definition: blackrock_depths.h:102
@ NPC_GRIMSTONE
Definition: blackrock_depths.h:142
@ DATA_GOLEM_LORD_ARGELMACH_ADDS
Definition: blackrock_depths.h:72
@ DATA_GOLEM_LORD_ARGELMACH_INIT
Definition: blackrock_depths.h:71
@ DATA_OPEN_COFFER_DOORS
Definition: blackrock_depths.h:69
@ SPELL_STONED
Definition: instance_blackrock_depths.cpp:72
@ EMOTE_ONESHOT_SHOUT
Definition: SharedDefines.h:1886
Seconds GetGameTime()
Definition: GameTime.cpp:38
Definition: TemporarySummon.h:40
Definition: Position.h:28
void SaveToDB()
Definition: InstanceScript.cpp:41
void DoRespawnGameObject(ObjectGuid guid, uint32 timeToDespawn=MINUTE)
Definition: InstanceScript.cpp:487
Definition: instance_blackrock_depths.cpp:76
TempSummon * TempSummonGrimstone
Definition: instance_blackrock_depths.cpp:160
Position GrimstonePositon
Definition: instance_blackrock_depths.cpp:161
ObjectGuid GetGuidData(uint32 data) const override
Definition: instance_blackrock_depths.cpp:673

References ArenaSpectators, ArgelmachAdds, ArgelmachGUID, BarAleCount, DATA_GOLEM_DOOR_N, DATA_GOLEM_DOOR_S, DATA_GOLEM_LORD_ARGELMACH_ADDS, DATA_GOLEM_LORD_ARGELMACH_INIT, DATA_OPEN_COFFER_DOORS, DATA_THRONE_DOOR, DAY, DONE, InstanceScript::DoRespawnGameObject(), EMOTE_ONESHOT_SHOUT, encounter, FACTION_NEUTRAL, FAIL, Map::GetCreature(), GameTime::GetGameTime(), GetGuidData(), GhostKillCount, GoChestGUID, GoTombEnterGUID, GoTombExitGUID, GrimstonePositon, InstanceScript::HandleGameObject(), IN_PROGRESS, InstanceScript::instance, IronhandGUID, LOG_DEBUG, MagmusGUID, NOT_STARTED, NPC_GRIMSTONE, NPC_RAGEREAVER_GOLEM, NPC_WATCHMAN_DOOMGRIP, NPC_WRATH_HAMMER_CONSTRUCT, OpenedCoofers, OUT_SAVE_INST_DATA, OUT_SAVE_INST_DATA_COMPLETE, REACT_DEFENSIVE, REACT_PASSIVE, TempSummon::RemoveFromWorld(), ReplaceMoiraIfSaved(), InstanceScript::SaveToDB(), SetData(), SPECIAL, SPELL_STONED, str_data, Map::SummonCreature(), TEMPSUMMON_MANUAL_DESPAWN, TempSummonGrimstone, timeRingFail, TYPE_BAR, TYPE_IRON_HALL, TYPE_LYCEUM, TYPE_RING_OF_LAW, TYPE_TOMB_OF_SEVEN, and TYPE_VAULT.

Referenced by OnUnitDeath(), SetData(), and TombOfSevenReset().

◆ TombOfSevenEvent()

void instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::TombOfSevenEvent ( )
inline
751 {
753 {
755 {
757 boss->SetFaction(FACTION_DARK_IRON_DWARVES);
758 boss->SetImmuneToPC(false);
759
760 // find suitable target here.
761 Player* target = boss->SelectNearestPlayer(130);
762 if (target && boss->CanCreatureAttack(target, true))
763 {
764 boss->AI()->AttackStart(target);
765 boss->AI()->DoZoneInCombat();
767 }
768 }
769 }
770 }
@ FACTION_DARK_IRON_DWARVES
Definition: SharedDefines.h:194
Player * SelectNearestPlayer(float distance=0) const
Definition: Object.cpp:2436

References FACTION_DARK_IRON_DWARVES, Map::GetCreature(), GhostKillCount, InstanceScript::instance, WorldObject::SelectNearestPlayer(), TIMER_TOMB_RESET, TombBossGUIDs, TombEventCounter, and tombResetTimer.

Referenced by Update().

◆ TombOfSevenReset()

void instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::TombOfSevenReset ( )
inline
773 {
774 HandleGameObject(GoTombExitGUID, false);// close exit door
775 HandleGameObject(GoTombEnterGUID, true);// open entrance door
776 for (uint8 i = 0; i < 7; ++i)
777 {
779 {
780 if (!boss->IsAlive())
781 {
782 //do not call EnterEvadeMode(), it will create infinit loops
783 boss->Respawn();
784 boss->RemoveAllAuras();
785 boss->GetThreatMgr().ClearAllThreat();
786 boss->CombatStop(true);
787 boss->LoadCreaturesAddon(true);
788 boss->GetMotionMaster()->MoveTargetedHome();
789 boss->SetLootRecipient(nullptr);
790 }
791 boss->SetFaction(FACTION_FRIENDLY);
792 boss->SetImmuneToPC(true); // think this is useless
793 if (i == 6) // doomrel needs explicit reset
794 {
795 boss->AI()->Reset();
796 }
797 }
798 }
799
800 GhostKillCount = 0;
804 }
@ FACTION_FRIENDLY
Definition: SharedDefines.h:173

References FACTION_FRIENDLY, Map::GetCreature(), GhostKillCount, GoTombEnterGUID, GoTombExitGUID, InstanceScript::HandleGameObject(), InstanceScript::instance, NOT_STARTED, SetData(), TIMER_TOMB_START, TombBossGUIDs, TombEventCounter, TombTimer, and TYPE_TOMB_OF_SEVEN.

Referenced by Update().

◆ Update()

void instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::Update ( uint32  diff)
inlineoverridevirtual

Reimplemented from InstanceScript.

831 {
833 {
834 if (TombTimer <= diff)
835 {
838 }
839 else
840 {
841 TombTimer -= diff;
842 }
843
844 if (CheckTombReset(diff))
845 {
847 }
848 }
849 }
@ TIMER_TOMBOFTHESEVEN
Definition: instance_blackrock_depths.cpp:28
uint32 GetData(uint32 type) const override
Definition: instance_blackrock_depths.cpp:644
bool CheckTombReset(uint32 diff)
Definition: instance_blackrock_depths.cpp:806
void TombOfSevenReset()
Definition: instance_blackrock_depths.cpp:772
void TombOfSevenEvent()
Definition: instance_blackrock_depths.cpp:750

References CheckTombReset(), GetData(), GhostKillCount, IN_PROGRESS, TIMER_TOMBOFTHESEVEN, TombOfSevenEvent(), TombOfSevenReset(), TombTimer, and TYPE_TOMB_OF_SEVEN.

Member Data Documentation

◆ arenaBossToSpawn

uint8 instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::arenaBossToSpawn

Referenced by GetData(), and Initialize().

◆ arenaMobsToSpawn

uint8 instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::arenaMobsToSpawn

Referenced by GetData(), and Initialize().

◆ ArenaSpectators

std::vector<ObjectGuid> instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::ArenaSpectators

◆ ArgelmachAdds

GuidList instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::ArgelmachAdds

◆ ArgelmachGUID

ObjectGuid instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::ArgelmachGUID

Referenced by OnCreatureCreate(), and SetData().

◆ BarAleCount

uint32 instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::BarAleCount

Referenced by GetData(), Initialize(), and SetData().

◆ CenterOfRingOfLaw

Position instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::CenterOfRingOfLaw = Position(595.289, -186.56)

Referenced by OnCreatureCreate().

◆ CorenGUID

ObjectGuid instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::CorenGUID

Referenced by GetGuidData(), and OnCreatureCreate().

◆ EmperorGUID

ObjectGuid instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::EmperorGUID

◆ EmperorSenators

ObjectGuid instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::EmperorSenators[5]

◆ EmperorSenatorsVector

std::vector<ObjectGuid> instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::EmperorSenatorsVector

Referenced by OnCreatureCreate(), and OnUnitDeath().

◆ EmperorSpawnPos

Position instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::EmperorSpawnPos = Position(1380.52, -831, 115)

Referenced by OnCreatureCreate().

◆ encounter

uint32 instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::encounter[MAX_ENCOUNTER]

◆ GhostKillCount

uint32 instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::GhostKillCount

◆ GoArena1GUID

ObjectGuid instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::GoArena1GUID

Referenced by GetGuidData(), and OnGameObjectCreate().

◆ GoArena2GUID

ObjectGuid instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::GoArena2GUID

Referenced by GetGuidData(), and OnGameObjectCreate().

◆ GoArena3GUID

ObjectGuid instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::GoArena3GUID

Referenced by GetGuidData(), and OnGameObjectCreate().

◆ GoArena4GUID

ObjectGuid instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::GoArena4GUID

Referenced by GetGuidData(), and OnGameObjectCreate().

◆ GoBarDoorGUID

ObjectGuid instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::GoBarDoorGUID

Referenced by GetGuidData(), and OnGameObjectCreate().

◆ GoBarKegGUID

ObjectGuid instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::GoBarKegGUID

Referenced by GetGuidData(), and OnGameObjectCreate().

◆ GoBarKegTrapGUID

ObjectGuid instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::GoBarKegTrapGUID

Referenced by GetGuidData(), and OnGameObjectCreate().

◆ GoChestGUID

ObjectGuid instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::GoChestGUID

Referenced by OnGameObjectCreate(), and SetData().

◆ GoGolemNGUID

ObjectGuid instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::GoGolemNGUID

Referenced by GetGuidData(), and OnGameObjectCreate().

◆ GoGolemSGUID

ObjectGuid instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::GoGolemSGUID

Referenced by GetGuidData(), and OnGameObjectCreate().

◆ GoLyceumGUID

ObjectGuid instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::GoLyceumGUID

Referenced by OnGameObjectCreate().

◆ GoSFNGUID

ObjectGuid instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::GoSFNGUID

Referenced by GetGuidData(), and OnGameObjectCreate().

◆ GoSFSGUID

ObjectGuid instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::GoSFSGUID

Referenced by GetGuidData(), and OnGameObjectCreate().

◆ GoShadowDummyGUID

ObjectGuid instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::GoShadowDummyGUID

Referenced by OnGameObjectCreate().

◆ GoShadowGiantGUID

ObjectGuid instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::GoShadowGiantGUID

Referenced by OnGameObjectCreate().

◆ GoShadowLockGUID

ObjectGuid instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::GoShadowLockGUID

Referenced by OnGameObjectCreate().

◆ GoShadowMechGUID

ObjectGuid instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::GoShadowMechGUID

Referenced by OnGameObjectCreate().

◆ GoSpectralChaliceGUID

ObjectGuid instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::GoSpectralChaliceGUID

Referenced by GetGuidData(), and OnGameObjectCreate().

◆ GoThroneGUID

ObjectGuid instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::GoThroneGUID

◆ GoTombEnterGUID

ObjectGuid instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::GoTombEnterGUID

◆ GoTombExitGUID

ObjectGuid instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::GoTombExitGUID

◆ GrimstonePositon

Position instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::GrimstonePositon = Position(625.559f, -205.618f, -52.735f, 2.609f)

Referenced by SetData().

◆ IronhandCounter

uint32 instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::IronhandCounter

Referenced by Initialize(), and OnCreatureCreate().

◆ IronhandGUID

ObjectGuid instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::IronhandGUID[6]

Referenced by OnCreatureCreate(), and SetData().

◆ MagmusGUID

ObjectGuid instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::MagmusGUID

◆ MoiraGUID

ObjectGuid instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::MoiraGUID

◆ OpenedCoofers

uint32 instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::OpenedCoofers

Referenced by Initialize(), and SetData().

◆ PhalanxGUID

ObjectGuid instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::PhalanxGUID

Referenced by GetGuidData(), and OnCreatureCreate().

◆ PriestessGUID

ObjectGuid instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::PriestessGUID

Referenced by ReplaceMoiraIfSaved().

◆ str_data

std::string instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::str_data

Referenced by GetSaveData(), and SetData().

◆ TempSummonGrimstone

TempSummon* instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::TempSummonGrimstone = nullptr

Referenced by SetData().

◆ timeRingFail

time_t instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::timeRingFail = 0

Referenced by GetData(), and SetData().

◆ TombBossGUIDs

ObjectGuid instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::TombBossGUIDs[7]

◆ TombEventCounter

uint32 instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::TombEventCounter

◆ tombResetTimer

uint32 instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::tombResetTimer

◆ TombTimer

uint32 instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::TombTimer