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

Public Member Functions

 instance_blackrock_depths (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 (char const *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 CreatureLooted (Creature *, LootType)
 
void SaveToDB ()
 
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
 
Creature * GetCreature (uint32 type)
 
GameObject * GetGameObject (uint32 type)
 
virtual void OnPlayerLeave (Player *)
 
virtual void OnPlayerAreaUpdate (Player *, uint32, uint32)
 
virtual void OnPlayerInWaterStateUpdate (Player *, bool)
 
void HandleGameObject (ObjectGuid guid, bool open, GameObject *go=nullptr)
 Open or close a GameObject by GUID.
 
void HandleGameObject (uint32 type, bool open)
 Open or close a GameObject registered via LoadObjectData.
 
void DoUseDoorOrButton (ObjectGuid guid, uint32 withRestoreTime=0, bool useAlternativeState=false)
 
void DoRespawnGameObject (ObjectGuid guid, uint32 timeToDespawn=MINUTE)
 
void DoRespawnGameObject (uint32 type)
 
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
 
bool _SkipCheckRequiredBosses (Player const *player=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 (WorldPackets::WorldState::InitWorldStates &)
 
uint32 GetEncounterCount () const
 
void MarkAreaTriggerDone (uint32 id)
 
void ResetAreaTriggerDone (uint32 id)
 
bool IsAreaTriggerDone (uint32 id) const
 
virtual void DoAction (int32)
 
void DoForAllMinions (uint32 id, std::function< void(Creature *)> exec)
 
void StoreGameObjectState (ObjectGuid::LowType spawnId, uint8 state)
 
uint8 GetStoredGameObjectState (ObjectGuid::LowType spawnId) const
 
void LoadInstanceSavedGameobjectStateData ()
 
bool IsBossDone (uint32 bossId) const
 
bool AllBossesDone () const
 
bool AllBossesDone (std::initializer_list< uint32 > bossIds) const
 
TeamId GetTeamIdInInstance () const
 
void SetTeamIdInInstance (TeamId teamId)
 
bool IsTwoFactionInstance () const
 
- 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 OnCreatureEvade (Creature *)
 
virtual void SetGuidData (uint32, ObjectGuid)
 
virtual uint64 GetData64 (uint32) const
 
virtual void SetData64 (uint32, uint64)
 
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
 
GuidList VaultWarderGUIDs
 
ObjectGuid GoSecretDoorGUID
 
ObjectGuid GoSecretSafeGUID
 
Position VaultWarderCenter = Position(813.5f, -348.0f)
 
TempSummon * TempSummonGrimstone = nullptr
 
Position GrimstonePositon = Position(625.559f, -205.618f, -52.735f, 2.609f)
 
time_t timeRingFail = 0
 
uint8 arenaMobsToSpawn
 
uint8 arenaBossToSpawn
 
std::vector< ObjectGuid > ArenaSpectators
 
Position CenterOfRingOfLaw = Position(595.289, -186.56)
 
ObjectGuid EmperorSenators [5]
 
std::vector< ObjectGuid > EmperorSenatorsVector
 
Position EmperorSpawnPos = Position(1380.52, -831, 115)
 
- Public Attributes inherited from InstanceScript
Map * instance
 
TaskScheduler scheduler
 

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 LoadSummonData (ObjectData const *data)
 
void SetSummoner (Creature *creature)
 
void AddObject (Creature *obj, bool add=true)
 
void RemoveObject (Creature *obj)
 
void AddObject (GameObject *obj, bool add=true)
 
void RemoveObject (GameObject *obj)
 
void AddObject (WorldObject *obj, uint32 type, bool add=true)
 
void RemoveObject (WorldObject *obj, uint32 type)
 
void AddDoor (GameObject *door, bool add=true)
 
void RemoveDoor (GameObject *door)
 
void AddMinion (Creature *minion, bool add=true)
 
void RemoveMinion (Creature *minion)
 
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()

instance_blackrock_depths::instance_blackrock_depths ( Map *  map)
inline
103 : InstanceScript(map)
104 {
106 }
#define DataHeader
Definition blackrock_depths.h:23
Definition InstanceScript.h:143
void SetHeaders(std::string const &dataHeaders)
Definition InstanceScript.cpp:163

References DataHeader, and InstanceScript::SetHeaders().

Member Function Documentation

◆ CheckTombReset()

bool instance_blackrock_depths::CheckTombReset ( uint32  diff)
inline
850 {
851 bool anyBossAlive = false; // status of the bosses up until the current one
852 for (uint8 i = 0; i < TombEventCounter; i++)
853 {
855 if (boss)
856 {
857 anyBossAlive |= boss->IsAlive();
858 if (boss->IsAlive() && boss->IsInCombat())
859 {
861 return false; // any boss in combat means we shouldn't reset.
862 }
863 }
864 }
865 if (!anyBossAlive) // no boss alive, put reset timer back up
867 tombResetTimer -= diff;
868 return tombResetTimer < diff;
869 }
std::uint8_t uint8
Definition Define.h:109
Definition Creature.h:47
Map * instance
Definition InstanceScript.h:149
Creature * GetCreature(ObjectGuid const &guid)
Definition Map.cpp:2442
bool IsAlive() const
Definition Unit.h:1796
bool IsInCombat() const
Definition Unit.h:941
@ TIMER_TOMB_RESET
Definition instance_blackrock_depths.cpp:30
ObjectGuid TombBossGUIDs[7]
Definition instance_blackrock_depths.cpp:143
uint32 tombResetTimer
Definition instance_blackrock_depths.cpp:144
uint32 TombEventCounter
Definition instance_blackrock_depths.cpp:146

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

Referenced by Update().

◆ GetData()

uint32 instance_blackrock_depths::GetData ( uint32  type) const
inlineoverridevirtual

Reimplemented from ZoneScript.

692 {
693 switch (type)
694 {
695 case TYPE_RING_OF_LAW:
696 return encounter[0];
697 case TYPE_VAULT:
698 return encounter[1];
699 case TYPE_BAR:
700 if (encounter[2] == IN_PROGRESS && BarAleCount == 3)
701 return SPECIAL;
702 else
703 return encounter[2];
705 return encounter[3];
706 case TYPE_LYCEUM:
707 return encounter[4];
708 case TYPE_IRON_HALL:
709 return encounter[5];
711 return timeRingFail;
712 case DATA_ARENA_MOBS:
713 return arenaMobsToSpawn;
714 case DATA_ARENA_BOSS:
715 return arenaBossToSpawn;
716 }
717 return 0;
718 }
@ IN_PROGRESS
Definition InstanceScript.h:59
@ SPECIAL
Definition InstanceScript.h:62
@ 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
uint8 arenaBossToSpawn
Definition instance_blackrock_depths.cpp:163
time_t timeRingFail
Definition instance_blackrock_depths.cpp:161
uint32 BarAleCount
Definition instance_blackrock_depths.cpp:141
uint32 encounter[MAX_ENCOUNTER]
Definition instance_blackrock_depths.cpp:108
uint8 arenaMobsToSpawn
Definition instance_blackrock_depths.cpp:162

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 OnCreatureCreate(), OnGameObjectCreate(), OnUnitDeath(), SetData(), and Update().

◆ GetGuidData()

ObjectGuid instance_blackrock_depths::GetGuidData ( uint32  data) const
inlineoverridevirtual

Reimplemented from ZoneScript.

721 {
722 switch (data)
723 {
724 case DATA_EMPEROR:
725 return EmperorGUID;
726 case DATA_PHALANX:
727 return PhalanxGUID;
728 case DATA_MOIRA:
729 return MoiraGUID;
730 case DATA_COREN:
731 return CorenGUID;
732 case DATA_ARENA1:
733 return GoArena1GUID;
734 case DATA_ARENA2:
735 return GoArena2GUID;
736 case DATA_ARENA3:
737 return GoArena3GUID;
738 case DATA_ARENA4:
739 return GoArena4GUID;
740 case DATA_GO_BAR_KEG:
741 return GoBarKegGUID;
743 return GoBarKegTrapGUID;
744 case DATA_GO_BAR_DOOR:
745 return GoBarDoorGUID;
747 return GoSFNGUID;
749 return GoSFSGUID;
750 case DATA_THRONE_DOOR:
751 return GoThroneGUID;
753 return GoGolemNGUID;
755 return GoGolemSGUID;
756 case DATA_GO_CHALICE:
758 case DATA_MAGMUS:
759 {
760 return MagmusGUID;
761 }
762 }
763
764 return ObjectGuid::Empty;
765 }
@ 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:123
ObjectGuid GoBarKegTrapGUID
Definition instance_blackrock_depths.cpp:128
ObjectGuid MagmusGUID
Definition instance_blackrock_depths.cpp:113
ObjectGuid GoBarDoorGUID
Definition instance_blackrock_depths.cpp:129
ObjectGuid EmperorGUID
Definition instance_blackrock_depths.cpp:111
ObjectGuid GoArena3GUID
Definition instance_blackrock_depths.cpp:121
ObjectGuid GoGolemSGUID
Definition instance_blackrock_depths.cpp:136
ObjectGuid PhalanxGUID
Definition instance_blackrock_depths.cpp:112
ObjectGuid GoSFSGUID
Definition instance_blackrock_depths.cpp:133
ObjectGuid GoGolemNGUID
Definition instance_blackrock_depths.cpp:135
ObjectGuid GoArena1GUID
Definition instance_blackrock_depths.cpp:119
ObjectGuid GoSFNGUID
Definition instance_blackrock_depths.cpp:134
ObjectGuid GoBarKegGUID
Definition instance_blackrock_depths.cpp:127
ObjectGuid GoArena4GUID
Definition instance_blackrock_depths.cpp:122
ObjectGuid MoiraGUID
Definition instance_blackrock_depths.cpp:114
ObjectGuid GoThroneGUID
Definition instance_blackrock_depths.cpp:137
ObjectGuid GoArena2GUID
Definition instance_blackrock_depths.cpp:120
ObjectGuid CorenGUID
Definition instance_blackrock_depths.cpp:117
ObjectGuid GoSpectralChaliceGUID
Definition instance_blackrock_depths.cpp:139

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::GetSaveData ( )
inlineoverridevirtual

Reimplemented from InstanceScript.

768 {
769 return str_data;
770 }
std::string str_data
Definition instance_blackrock_depths.cpp:109

References str_data.

◆ Initialize()

void instance_blackrock_depths::Initialize ( )
inlineoverridevirtual

Reimplemented from InstanceScript.

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

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

◆ Load()

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

Reimplemented from InstanceScript.

773 {
774 if (!in)
775 {
777 return;
778 }
779
781
782 std::istringstream loadStream(in);
783 loadStream >> encounter[0] >> encounter[1] >> encounter[2] >> encounter[3]
784 >> encounter[4] >> encounter[5] >> GhostKillCount;
785
786 for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
787 if (encounter[i] == IN_PROGRESS)
789 if (GhostKillCount > 0 && GhostKillCount < 7)
790 GhostKillCount = 0;//reset tomb of seven event
791 if (GhostKillCount >= 7)
792 GhostKillCount = 7;
793
795 }
#define OUT_LOAD_INST_DATA_FAIL
Definition InstanceScript.h:33
#define OUT_LOAD_INST_DATA_COMPLETE
Definition InstanceScript.h:32
#define OUT_LOAD_INST_DATA(a)
Definition InstanceScript.h:31
@ NOT_STARTED
Definition InstanceScript.h:58
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::OnCreatureCreate ( Creature *  creature)
inlineoverridevirtual

Reimplemented from ZoneScript.

235 {
236 switch (creature->GetEntry())
237 {
238 case NPC_EMPEROR:
239 EmperorGUID = creature->GetGUID();
240 break;
241 case NPC_PHALANX:
242 PhalanxGUID = creature->GetGUID();
243 break;
244 case NPC_MOIRA:
245 MoiraGUID = creature->GetGUID();
246 break;
248 CorenGUID = creature->GetGUID();
249 break;
250 case NPC_ANGERREL:
251 TombBossGUIDs[0] = creature->GetGUID();
252 break;
253 case NPC_SEETHREL:
254 TombBossGUIDs[1] = creature->GetGUID();
255 break;
256 case NPC_DOPEREL:
257 TombBossGUIDs[2] = creature->GetGUID();
258 break;
259 case NPC_GLOOMREL:
260 TombBossGUIDs[3] = creature->GetGUID();
261 break;
262 case NPC_VILEREL:
263 TombBossGUIDs[4] = creature->GetGUID();
264 break;
265 case NPC_HATEREL:
266 TombBossGUIDs[5] = creature->GetGUID();
267 break;
268 case NPC_DOOMREL:
269 TombBossGUIDs[6] = creature->GetGUID();
270 break;
271 case NPC_MAGMUS:
272 MagmusGUID = creature->GetGUID();
273 if (!creature->IsAlive())
274 HandleGameObject(GoThroneGUID, true); // if Magmus is dead open door to last boss
275 break;
280 if (creature->IsAlive() && creature->GetPositionZ() < -51.5f && creature->GetPositionZ() > -55.f)
281 ArgelmachAdds.push_back(creature->GetGUID());
282 break;
284 ArgelmachGUID = creature->GetGUID();
285 break;
287 IronhandGUID[IronhandCounter] = creature->GetGUID();
289 break;
291 ArenaSpectators.push_back(creature->GetGUID());
292 // note: reads GetData, not encounter[TYPE_RING_OF_LAW]: the types are 1-based
293 // while the array is 0-based, so the raw index would hit the vault slot
294 if (GetData(TYPE_RING_OF_LAW) == DONE) // added for crashes
295 {
296 creature->SetFaction(FACTION_NEUTRAL);
298 }
299 break;
301 case NPC_SHADOWFORCE_CITIZEN: // both do the same
303 ArenaSpectators.push_back(creature->GetGUID());
304 // note: reads GetData, not encounter[TYPE_RING_OF_LAW]: the types are 1-based
305 // while the array is 0-based, so the raw index would hit the vault slot
306 if (GetData(TYPE_RING_OF_LAW) == DONE) // added for crashes
307 {
308 creature->SetFaction(FACTION_NEUTRAL);
310 }
311 break;
313 // 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.
314 // some senators spawn at ring of law
316 EmperorSenatorsVector.push_back(creature->GetGUID());
317 break;
319 // only the four constructs in the Relic Coffer room belong to the vault event,
320 // the rest of the Black Vault spawns are regular trash
322 break;
323 // dead spawns with a pending respawn are loaded too: a corpse must not be frozen or
324 // counted, or the restarted event could not complete until its respawn timer expires
325 if (!creature->IsAlive())
326 break;
327 // frozen until all 12 Relic Coffers have been opened. Stoned (statue visual) is cast
328 // here instead of creature_addon on purpose: addon auras get re-applied on every
329 // evade, which would turn the constructs back into statues after the event has started.
331 {
332 creature->CastSpell(creature, SPELL_STONED, true);
333 creature->SetImmuneToPC(true);
334 // untargetable while inert: the reference video (https://youtu.be/KE1nElNN1YY)
335 // shows the statues cannot be targeted until activated; vmangos likewise clears
336 // UNIT_FLAG_NOT_SELECTABLE on them when Doomgrip aggroes
338 creature->SetReactState(REACT_PASSIVE);
339 }
340 [[fallthrough]];
342 VaultWarderGUIDs.push_back(creature->GetGUID());
343 break;
344 default:
345 break;
346 }
347 }
@ DONE
Definition InstanceScript.h:61
@ UNIT_FLAG_NOT_SELECTABLE
Definition UnitDefines.h:282
@ REACT_DEFENSIVE
Definition Unit.h:568
@ REACT_PASSIVE
Definition Unit.h:567
@ NPC_EMPEROR
Definition blackrock_depths.h:90
@ NPC_COREN_DIREBREW
Definition blackrock_depths.h:111
@ NPC_IRONHAND_GUARDIAN
Definition blackrock_depths.h:113
@ NPC_SHADOWFORGE_SENATOR
Definition blackrock_depths.h:119
@ 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_WATCHMAN_DOOMGRIP
Definition blackrock_depths.h:102
@ NPC_SHADOWFORCE_CITIZEN
Definition blackrock_depths.h:117
@ NPC_HATEREL
Definition blackrock_depths.h:94
@ NPC_MAGMUS
Definition blackrock_depths.h:121
@ NPC_GOLEM_LORD_ARGELMACH
Definition blackrock_depths.h:108
@ NPC_SHADOWFORGE_PEASANT
Definition blackrock_depths.h:116
@ 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_WARBRINGER_CONSTRUCT
Definition blackrock_depths.h:109
@ NPC_ARENA_SPECTATOR
Definition blackrock_depths.h:115
@ NPC_SEETHREL
Definition blackrock_depths.h:96
@ NPC_MOIRA
Definition blackrock_depths.h:99
@ FACTION_NEUTRAL
Definition blackrock_depths.h:28
void SetReactState(ReactStates state)
A creature can have 3 ReactStates : Agressive, Passive, Neutral.
Definition Creature.h:100
void HandleGameObject(ObjectGuid guid, bool open, GameObject *go=nullptr)
Open or close a GameObject by GUID.
Definition InstanceScript.cpp:130
uint32 GetEntry() const
Definition Object.h:123
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:120
void SetFaction(uint32 faction)
Definition Unit.cpp:6850
SpellCastResult CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition Unit.cpp:1372
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:749
void SetImmuneToPC(bool apply, bool keepCombat=false)
Definition Unit.cpp:10379
float GetDistance2d(WorldObject const *obj) const
Definition Object.cpp:1322
@ SPELL_STONED
Definition instance_blackrock_depths.cpp:75
@ DISTANCE_EMPEROR_ROOM
Definition instance_blackrock_depths.cpp:36
@ DISTANCE_VAULT_WARDER
Definition instance_blackrock_depths.cpp:37
@ RADIUS_RING_OF_LAW
Definition instance_blackrock_depths.cpp:35
float GetPositionZ() const
Definition Position.h:123
float GetPositionX() const
Definition Position.h:121
float GetPositionY() const
Definition Position.h:122
GuidList ArgelmachAdds
Definition instance_blackrock_depths.cpp:150
uint32 GetData(uint32 type) const override
Definition instance_blackrock_depths.cpp:691
GuidList VaultWarderGUIDs
Definition instance_blackrock_depths.cpp:154
ObjectGuid IronhandGUID[6]
Definition instance_blackrock_depths.cpp:116
Position CenterOfRingOfLaw
Definition instance_blackrock_depths.cpp:166
std::vector< ObjectGuid > EmperorSenatorsVector
Definition instance_blackrock_depths.cpp:169
Position VaultWarderCenter
Definition instance_blackrock_depths.cpp:157
ObjectGuid ArgelmachGUID
Definition instance_blackrock_depths.cpp:151
Position EmperorSpawnPos
Definition instance_blackrock_depths.cpp:170

References ArenaSpectators, ArgelmachAdds, ArgelmachGUID, Unit::CastSpell(), CenterOfRingOfLaw, CorenGUID, DISTANCE_EMPEROR_ROOM, DISTANCE_VAULT_WARDER, DONE, EmperorGUID, EmperorSenatorsVector, EmperorSpawnPos, FACTION_NEUTRAL, GetData(), WorldObject::GetDistance2d(), Object::GetEntry(), Object::GetGUID(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), GoThroneGUID, InstanceScript::HandleGameObject(), IronhandCounter, IronhandGUID, Unit::IsAlive(), MagmusGUID, MoiraGUID, NOT_STARTED, 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_WARBRINGER_CONSTRUCT, NPC_WATCHMAN_DOOMGRIP, NPC_WEAPON_TECHNICIAN, NPC_WRATH_HAMMER_CONSTRUCT, PhalanxGUID, RADIUS_RING_OF_LAW, REACT_DEFENSIVE, REACT_PASSIVE, Unit::SetFaction(), Unit::SetImmuneToPC(), Creature::SetReactState(), Unit::SetUnitFlag(), SPELL_STONED, TombBossGUIDs, TYPE_RING_OF_LAW, TYPE_VAULT, UNIT_FLAG_NOT_SELECTABLE, VaultWarderCenter, and VaultWarderGUIDs.

◆ OnGameObjectCreate()

void instance_blackrock_depths::OnGameObjectCreate ( GameObject *  go)
inlineoverridevirtual

Reimplemented from ZoneScript.

350 {
351 switch (go->GetEntry())
352 {
353 case GO_ARENA1:
354 GoArena1GUID = go->GetGUID();
355 break;
356 case GO_ARENA2:
357 GoArena2GUID = go->GetGUID();
358 break;
359 case GO_ARENA3:
360 GoArena3GUID = go->GetGUID();
361 break;
362 case GO_ARENA4:
363 GoArena4GUID = go->GetGUID();
364 break;
365 case GO_SHADOW_LOCK:
367 break;
370 break;
373 break;
374 case GO_SHADOW_DUMMY:
376 break;
377 case GO_BAR_KEG_SHOT:
378 GoBarKegGUID = go->GetGUID();
379 break;
380 case GO_BAR_KEG_TRAP:
382 break;
383 case GO_BAR_DOOR:
384 GoBarDoorGUID = go->GetGUID();
385 break;
386 case GO_TOMB_ENTER:
387 GoTombEnterGUID = go->GetGUID();
388 break;
389 case GO_TOMB_EXIT:
390 GoTombExitGUID = go->GetGUID();
391 if (GhostKillCount >= 7)
393 else
395 break;
396 case GO_LYCEUM:
397 GoLyceumGUID = go->GetGUID();
398 break;
399 case GO_SF_S:
400 GoSFSGUID = go->GetGUID();
401 break;
402 case GO_SF_N:
403 GoSFNGUID = go->GetGUID();
404 break;
405 case GO_GOLEM_ROOM_N:
406 GoGolemNGUID = go->GetGUID();
407 break;
408 case GO_GOLEM_ROOM_S:
409 GoGolemSGUID = go->GetGUID();
410 break;
411 case GO_THRONE_ROOM:
412 GoThroneGUID = go->GetGUID();
413 break;
414 case GO_CHEST_SEVEN:
415 GoChestGUID = go->GetGUID();
416 break;
419 break;
420 case GO_SECRET_DOOR:
422 if (GetData(TYPE_VAULT) == DONE)
424 break;
425 case GO_SECRET_SAFE:
427 // non-interactable via gameobject_template_addon flags until the vault event is done
428 if (GetData(TYPE_VAULT) == DONE)
430 break;
431 }
432 }
@ GO_FLAG_NOT_SELECTABLE
Definition SharedDefines.h:1611
void RemoveGameObjectFlag(GameObjectFlags flags)
Definition GameObject.h:220
@ GO_SHADOW_MECHANISM
Definition instance_blackrock_depths.cpp:53
@ GO_ARENA3
Definition instance_blackrock_depths.cpp:50
@ GO_GOLEM_ROOM_N
Definition instance_blackrock_depths.cpp:64
@ GO_SECRET_DOOR
Definition instance_blackrock_depths.cpp:69
@ GO_SHADOW_LOCK
Definition instance_blackrock_depths.cpp:52
@ GO_SHADOW_GIANT_DOOR
Definition instance_blackrock_depths.cpp:54
@ GO_TOMB_EXIT
Definition instance_blackrock_depths.cpp:60
@ GO_LYCEUM
Definition instance_blackrock_depths.cpp:61
@ GO_SHADOW_DUMMY
Definition instance_blackrock_depths.cpp:55
@ GO_SF_S
Definition instance_blackrock_depths.cpp:63
@ GO_TOMB_ENTER
Definition instance_blackrock_depths.cpp:59
@ GO_ARENA2
Definition instance_blackrock_depths.cpp:49
@ GO_GOLEM_ROOM_S
Definition instance_blackrock_depths.cpp:65
@ GO_BAR_DOOR
Definition instance_blackrock_depths.cpp:58
@ GO_SF_N
Definition instance_blackrock_depths.cpp:62
@ GO_BAR_KEG_SHOT
Definition instance_blackrock_depths.cpp:56
@ GO_SECRET_SAFE
Definition instance_blackrock_depths.cpp:70
@ GO_ARENA4
Definition instance_blackrock_depths.cpp:51
@ GO_ARENA1
Definition instance_blackrock_depths.cpp:48
@ GO_SPECTRAL_CHALICE
Definition instance_blackrock_depths.cpp:67
@ GO_BAR_KEG_TRAP
Definition instance_blackrock_depths.cpp:57
@ GO_THRONE_ROOM
Definition instance_blackrock_depths.cpp:66
@ GO_CHEST_SEVEN
Definition instance_blackrock_depths.cpp:68
ObjectGuid GoTombExitGUID
Definition instance_blackrock_depths.cpp:131
ObjectGuid GoSecretDoorGUID
Definition instance_blackrock_depths.cpp:155
ObjectGuid GoShadowMechGUID
Definition instance_blackrock_depths.cpp:124
ObjectGuid GoShadowDummyGUID
Definition instance_blackrock_depths.cpp:126
ObjectGuid GoShadowGiantGUID
Definition instance_blackrock_depths.cpp:125
ObjectGuid GoSecretSafeGUID
Definition instance_blackrock_depths.cpp:156
ObjectGuid GoTombEnterGUID
Definition instance_blackrock_depths.cpp:130
ObjectGuid GoShadowLockGUID
Definition instance_blackrock_depths.cpp:123
ObjectGuid GoChestGUID
Definition instance_blackrock_depths.cpp:138
ObjectGuid GoLyceumGUID
Definition instance_blackrock_depths.cpp:132

References DONE, ObjectGuid::Empty, GetData(), 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_FLAG_NOT_SELECTABLE, GO_GOLEM_ROOM_N, GO_GOLEM_ROOM_S, GO_LYCEUM, GO_SECRET_DOOR, GO_SECRET_SAFE, 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, GoSecretDoorGUID, GoSecretSafeGUID, GoSFNGUID, GoSFSGUID, GoShadowDummyGUID, GoShadowGiantGUID, GoShadowLockGUID, GoShadowMechGUID, GoSpectralChaliceGUID, GoThroneGUID, GoTombEnterGUID, GoTombExitGUID, InstanceScript::HandleGameObject(), GameObject::RemoveGameObjectFlag(), and TYPE_VAULT.

◆ OnPlayerEnter()

void instance_blackrock_depths::OnPlayerEnter ( Player *  )
inlineoverridevirtual

Reimplemented from InstanceScript.

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

References ReplaceMoiraIfSaved().

◆ OnUnitDeath()

void instance_blackrock_depths::OnUnitDeath ( Unit *  unit)
inlineoverridevirtual

Reimplemented from ZoneScript.

435 {
436 uint32 deadSenators = 0;
437 switch (unit->GetEntry())
438 {
443 ArgelmachAdds.remove(unit->GetGUID());
444 break;
445 case NPC_MAGMUS:
447 break;
451 {
452 // regular Black Vault trash shares the entry but is not in the list,
453 // remove() is a no-op for it
454 VaultWarderGUIDs.remove(unit->GetGUID());
455 if (VaultWarderGUIDs.empty())
457 }
458 break;
460 deadSenators = 1; //hacky, but we cannot count the unit that just died through its state because OnUnitDeath() is called before the state is set.
461 for (auto const& senatorGUID: EmperorSenatorsVector)
462 if (Creature* senator = instance->GetCreature(senatorGUID))
463 if (!senator->IsAlive() || senator->isDying())
464 deadSenators++;
465
466 if (Creature* emperor = instance->GetCreature(EmperorGUID))
467 // send % of senators that died
468 emperor->AI()->SetData(0, (100 * deadSenators) / EmperorSenatorsVector.size());
469 break;
470 case NPC_ANGERREL:
471 case NPC_DOPEREL:
472 case NPC_HATEREL:
473 case NPC_VILEREL:
474 case NPC_SEETHREL:
475 case NPC_GLOOMREL:
476 case NPC_DOOMREL:
478 if (GhostKillCount >= 7)
480 break;
481 default:
482 break;
483 }
484 }
std::uint32_t uint32
Definition Define.h:107
Creature * GetCreature(uint32 type)
Definition InstanceScript.cpp:120
void SetData(uint32 type, uint32 data) override
Definition instance_blackrock_depths.cpp:486

References ArgelmachAdds, DONE, EmperorGUID, EmperorSenatorsVector, Map::GetCreature(), GetData(), Object::GetEntry(), Object::GetGUID(), GhostKillCount, IN_PROGRESS, 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_WARBRINGER_CONSTRUCT, NPC_WATCHMAN_DOOMGRIP, NPC_WEAPON_TECHNICIAN, NPC_WRATH_HAMMER_CONSTRUCT, SetData(), TYPE_IRON_HALL, TYPE_TOMB_OF_SEVEN, TYPE_VAULT, and VaultWarderGUIDs.

◆ ReplaceMoiraIfSaved()

void instance_blackrock_depths::ReplaceMoiraIfSaved ( )
inline
179 {
180 ObjectGuid* GUIDToReplace = &PriestessGUID; // default to having Moira
181 ObjectGuid* GUIDToSpawn = &MoiraGUID;
182 uint32 NPCEntry = NPC_MOIRA;
183 bool MoiraSaved = true;
184
185 // check if all players saved her.
186 Map::PlayerList const& lPlayers = instance->GetPlayers();
187 if (!lPlayers.IsEmpty())
188 {
189 for (Map::PlayerList::const_iterator itr = lPlayers.begin(); itr != lPlayers.end(); ++itr)
190 {
191 if (Player* player = itr->GetSource())
192 {
193 // set to false if this player hasn't saved her. Another player can't put it to true.
194 MoiraSaved = MoiraSaved && ((player->GetQuestStatus(PRINCESS_QUEST_HORDE) == QUEST_STATUS_REWARDED)
195 || (player->GetQuestStatus(PRINCESS_QUEST_ALLIANCE) == QUEST_STATUS_REWARDED));
196 }
197 }
198 }
199
200 // assign correct GUIDs and spawn targets
201 if (MoiraSaved)
202 {
203 GUIDToReplace = &MoiraGUID;
204 GUIDToSpawn = &PriestessGUID;
205 NPCEntry = NPC_PRIESTESS;
206 }
207
208 if (Creature* CreatureToReplace = instance->GetCreature(*GUIDToReplace))
209 {
210 Creature* NewSpawn = instance->SummonCreature(NPCEntry, CreatureToReplace->GetPosition());
211 CreatureToReplace->RemoveFromWorld();
212 *GUIDToSpawn = NewSpawn->GetGUID();
213 }
214 }
@ QUEST_STATUS_REWARDED
Definition QuestDef.h:106
@ NPC_PRIESTESS
Definition blackrock_depths.h:100
Definition LinkedList.h:139
bool IsEmpty() const
Definition LinkedList.h:97
Definition MapRefMgr.h:26
iterator begin()
Definition MapRefMgr.h:36
iterator end()
Definition MapRefMgr.h:37
PlayerList const & GetPlayers() const
Definition Map.h:335
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:2246
Definition ObjectGuid.h:121
Definition Player.h:1086
void RemoveFromWorld() override
Definition TemporarySummon.cpp:331
@ PRINCESS_QUEST_HORDE
Definition instance_blackrock_depths.cpp:42
@ PRINCESS_QUEST_ALLIANCE
Definition instance_blackrock_depths.cpp:43
ObjectGuid PriestessGUID
Definition instance_blackrock_depths.cpp:115

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::SetData ( uint32  type,
uint32  data 
)
inlineoverridevirtual

Reimplemented from ZoneScript.

487 {
488 LOG_DEBUG("scripts.ai", "Instance Blackrock Depths: SetData update (Type: {} Data {})", type, data);
489
490 switch (type)
491 {
492 case TYPE_RING_OF_LAW:
493 encounter[0] = data;
494 switch (data)
495 {
496 case IN_PROGRESS:
498 break;
499 case FAIL:
501 {
503 TempSummonGrimstone = nullptr;
505 }
507 break;
508 case DONE:
509 for (auto const& itr : ArenaSpectators)
510 if (Creature* spectator = instance->GetCreature(itr))
511 {
512 spectator->SetFaction(FACTION_NEUTRAL);
513 spectator->SetReactState(REACT_DEFENSIVE);
514 }
515 break;
516 default:
517 break;
518 }
519 break;
520 case TYPE_VAULT:
521 encounter[1] = data;
522 if (data == DONE)
523 {
524 // vault cleared: open the secret door and make the Secret Safe lootable
527 safe->RemoveGameObjectFlag(GO_FLAG_NOT_SELECTABLE);
528 }
529 break;
530 case TYPE_BAR:
531 if (data == SPECIAL)
532 ++BarAleCount;
533 else
534 encounter[2] = data;
535 break;
537 encounter[3] = data;
538 switch (data)
539 {
540 case IN_PROGRESS:
543 break;
544 case DONE:
548 break;
549 }
550 break;
551 case TYPE_LYCEUM:
552 encounter[4] = data;
553 if (data == DONE)
554 {
557 if (Creature* magmus = instance->GetCreature(MagmusGUID))
558 magmus->AI()->Talk(0);
559 ReplaceMoiraIfSaved(); // Need to place the correct final boss, but we need her to be spawned first.
560 }
561 break;
562 case TYPE_IRON_HALL:
563 encounter[5] = data;
564 switch (data)
565 {
566 case NOT_STARTED:
567 case IN_PROGRESS:
568 for (int i = 0; i < 6; i++)
569 if (Creature* ironhand = instance->GetCreature(IronhandGUID[i]))
570 ironhand->AI()->SetData(0, data == IN_PROGRESS);
571 break;
572 case DONE:
574 break;
575 default:
576 break;
577 }
578 break;
580 OpenedCoofers += 1;
581 // the coffer doors reset on every map load while the vault state persists: reopening
582 // them after the event has started must not restart it or summon a second Doomgrip
584 {
586
587 // awaken the Warbringer Constructs guarding the vault
588 for (ObjectGuid const& warderGUID : VaultWarderGUIDs)
589 {
590 if (Creature* warder = instance->GetCreature(warderGUID))
591 {
592 warder->RemoveAurasDueToSpell(SPELL_STONED);
593 warder->SetImmuneToPC(false);
594 warder->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
595 warder->SetReactState(REACT_AGGRESSIVE);
596 }
597 }
598
599 // spawns at the room entrance, not amidst the constructs (position from cmangos)
600 Position pos = {821.905f, -338.382f, -50.134f, 3.78736f};
602 summon->SetTempSummonType(TEMPSUMMON_MANUAL_DESPAWN);
603 }
604 break;
606 {
607 if (Creature* argelmach = instance->GetCreature(ArgelmachGUID))
608 {
609 GuidList adds = ArgelmachAdds;
610 for (GuidList::const_iterator itr = adds.begin(); itr != adds.end();)
611 {
612 if (Creature* argelmachAdd = instance->GetCreature(*itr))
613 {
614 if (argelmachAdd->GetEntry() == NPC_WRATH_HAMMER_CONSTRUCT)
615 {
616 argelmachAdd->RemoveAurasDueToSpell(SPELL_STONED);
617 argelmachAdd->AI()->AttackStart(argelmach->GetVictim());
618 itr = adds.erase(itr);
619 }
620 else if (argelmachAdd->GetEntry() == NPC_RAGEREAVER_GOLEM)
621 {
622 if (argelmachAdd->IsWithinDist2d(argelmach, 10.f))
623 {
624 argelmachAdd->RemoveAurasDueToSpell(SPELL_STONED);
625 argelmachAdd->AI()->AttackStart(argelmach->GetVictim());
626 itr = adds.erase(itr);
627 }
628 else
629 ++itr;
630 }
631 else
632 {
633 ++itr;
634 }
635 }
636 else
637 {
638 ++itr;
639 }
640 }
641
642 if (!adds.empty())
643 {
644 argelmach->SetReactState(REACT_PASSIVE);
645 argelmach->SetTarget();
646 argelmach->AI()->SetData(DATA_GOLEM_LORD_ARGELMACH_INIT, IN_PROGRESS);
647 }
648 else
649 {
650 argelmach->AI()->SetData(DATA_GOLEM_LORD_ARGELMACH_INIT, DONE);
651 }
652 }
653 break;
654 }
656 {
657 if (Creature* argelmach = instance->GetCreature(ArgelmachGUID))
658 {
659 argelmach->HandleEmoteCommand(EMOTE_ONESHOT_SHOUT);
660 argelmach->m_Events.AddEventAtOffset(new RestoreAttack(argelmach), 3s);
661
662 for (ObjectGuid const& argelmachAddGUID : ArgelmachAdds)
663 if (Creature* argelmachAdd = instance->GetCreature(argelmachAddGUID))
664 if (!argelmachAdd->IsInCombat())
665 {
666 argelmachAdd->RemoveAurasDueToSpell(SPELL_STONED);
667 argelmachAdd->AI()->AttackStart(argelmach->GetVictim());
668 }
669 }
670 break;
671 }
672 default:
673 break;
674 }
675
676 if (data == DONE || GhostKillCount >= 7)
677 {
679
680 std::ostringstream saveStream;
681 saveStream << encounter[0] << ' ' << encounter[1] << ' ' << encounter[2] << ' '
682 << encounter[3] << ' ' << encounter[4] << ' ' << encounter[5] << ' ' << GhostKillCount;
683
684 str_data = saveStream.str();
685
686 SaveToDB();
688 }
689 }
constexpr auto DAY
Definition Common.h:49
#define OUT_SAVE_INST_DATA_COMPLETE
Definition InstanceScript.h:30
#define OUT_SAVE_INST_DATA
Definition InstanceScript.h:29
@ FAIL
Definition InstanceScript.h:60
#define LOG_DEBUG(filterType__,...)
Definition Log.h:157
std::list< ObjectGuid > GuidList
Definition ObjectGuid.h:258
@ TEMPSUMMON_MANUAL_DESPAWN
Definition Object.h:57
@ EMOTE_ONESHOT_SHOUT
Definition SharedDefines.h:1918
@ REACT_AGGRESSIVE
Definition Unit.h:569
@ NPC_GRIMSTONE
Definition blackrock_depths.h:143
@ 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
Definition GameObject.h:120
void SaveToDB()
Definition InstanceScript.cpp:43
void DoRespawnGameObject(ObjectGuid guid, uint32 timeToDespawn=MINUTE)
Definition InstanceScript.cpp:591
GameObject * GetGameObject(ObjectGuid const &guid)
Definition Map.cpp:2447
Definition instance_blackrock_depths.cpp:79
Definition TemporarySummon.h:50
Seconds GetGameTime()
Definition GameTime.cpp:38
Definition Position.h:27
TempSummon * TempSummonGrimstone
Definition instance_blackrock_depths.cpp:159
Position GrimstonePositon
Definition instance_blackrock_depths.cpp:160
ObjectGuid GetGuidData(uint32 data) const override
Definition instance_blackrock_depths.cpp:720

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(), GetData(), Map::GetGameObject(), GameTime::GetGameTime(), GetGuidData(), GhostKillCount, GO_FLAG_NOT_SELECTABLE, GoChestGUID, GoSecretDoorGUID, GoSecretSafeGUID, 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_AGGRESSIVE, 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, TYPE_VAULT, UNIT_FLAG_NOT_SELECTABLE, and VaultWarderGUIDs.

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

◆ TombOfSevenEvent()

void instance_blackrock_depths::TombOfSevenEvent ( )
inline
798 {
800 {
802 {
804 boss->SetFaction(FACTION_DARK_IRON_DWARVES);
805 boss->SetImmuneToPC(false);
806
807 // find suitable target here.
808 Player* target = boss->SelectNearestPlayer(130);
809 if (target && boss->CanCreatureAttack(target, true))
810 {
811 boss->AI()->AttackStart(target);
812 boss->AI()->DoZoneInCombat();
814 }
815 }
816 }
817 }
@ FACTION_DARK_IRON_DWARVES
Definition SharedDefines.h:210
Player * SelectNearestPlayer(float distance=0) const
Definition Object.cpp:2585

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::TombOfSevenReset ( )
inline
820 {
821 HandleGameObject(GoTombExitGUID, false);// close exit door
822 HandleGameObject(GoTombEnterGUID, true);// open entrance door
823 for (uint8 i = 0; i < 7; ++i)
825 {
826 if (!boss->IsAlive())
827 {
828 //do not call EnterEvadeMode(), it will create infinit loops
829 boss->Respawn();
830 boss->RemoveAllAuras();
831 boss->GetThreatMgr().ClearAllThreat();
832 boss->CombatStop(true);
833 boss->LoadCreaturesAddon(true);
834 boss->GetMotionMaster()->MoveTargetedHome();
835 boss->SetLootRecipient(nullptr);
836 }
837 boss->SetFaction(FACTION_FRIENDLY);
838 boss->SetImmuneToPC(true); // think this is useless
839 if (i == 6) // doomrel needs explicit reset
840 boss->AI()->Reset();
841 }
842
843 GhostKillCount = 0;
847 }
@ FACTION_FRIENDLY
Definition SharedDefines.h:189

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::Update ( uint32  diff)
inlineoverridevirtual

Reimplemented from InstanceScript.

872 {
874 {
875 if (TombTimer <= diff)
876 {
879 }
880 else
881 {
882 TombTimer -= diff;
883 }
884
885 if (CheckTombReset(diff))
887 }
888 }
@ TIMER_TOMBOFTHESEVEN
Definition instance_blackrock_depths.cpp:28
void TombOfSevenReset()
Definition instance_blackrock_depths.cpp:819
void TombOfSevenEvent()
Definition instance_blackrock_depths.cpp:797
bool CheckTombReset(uint32 diff)
Definition instance_blackrock_depths.cpp:849

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

Member Data Documentation

◆ arenaBossToSpawn

uint8 instance_blackrock_depths::arenaBossToSpawn

Referenced by GetData(), and Initialize().

◆ arenaMobsToSpawn

uint8 instance_blackrock_depths::arenaMobsToSpawn

Referenced by GetData(), and Initialize().

◆ ArenaSpectators

std::vector<ObjectGuid> instance_blackrock_depths::ArenaSpectators

◆ ArgelmachAdds

GuidList instance_blackrock_depths::ArgelmachAdds

◆ ArgelmachGUID

ObjectGuid instance_blackrock_depths::ArgelmachGUID

Referenced by OnCreatureCreate(), and SetData().

◆ BarAleCount

uint32 instance_blackrock_depths::BarAleCount

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

◆ CenterOfRingOfLaw

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

Referenced by OnCreatureCreate().

◆ CorenGUID

ObjectGuid instance_blackrock_depths::CorenGUID

Referenced by GetGuidData(), and OnCreatureCreate().

◆ EmperorGUID

ObjectGuid instance_blackrock_depths::EmperorGUID

◆ EmperorSenators

ObjectGuid instance_blackrock_depths::EmperorSenators[5]

◆ EmperorSenatorsVector

std::vector<ObjectGuid> instance_blackrock_depths::EmperorSenatorsVector

Referenced by OnCreatureCreate(), and OnUnitDeath().

◆ EmperorSpawnPos

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

Referenced by OnCreatureCreate().

◆ encounter

uint32 instance_blackrock_depths::encounter[MAX_ENCOUNTER]

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

◆ GhostKillCount

uint32 instance_blackrock_depths::GhostKillCount

◆ GoArena1GUID

ObjectGuid instance_blackrock_depths::GoArena1GUID

Referenced by GetGuidData(), and OnGameObjectCreate().

◆ GoArena2GUID

ObjectGuid instance_blackrock_depths::GoArena2GUID

Referenced by GetGuidData(), and OnGameObjectCreate().

◆ GoArena3GUID

ObjectGuid instance_blackrock_depths::GoArena3GUID

Referenced by GetGuidData(), and OnGameObjectCreate().

◆ GoArena4GUID

ObjectGuid instance_blackrock_depths::GoArena4GUID

Referenced by GetGuidData(), and OnGameObjectCreate().

◆ GoBarDoorGUID

ObjectGuid instance_blackrock_depths::GoBarDoorGUID

Referenced by GetGuidData(), and OnGameObjectCreate().

◆ GoBarKegGUID

ObjectGuid instance_blackrock_depths::GoBarKegGUID

Referenced by GetGuidData(), and OnGameObjectCreate().

◆ GoBarKegTrapGUID

ObjectGuid instance_blackrock_depths::GoBarKegTrapGUID

Referenced by GetGuidData(), and OnGameObjectCreate().

◆ GoChestGUID

ObjectGuid instance_blackrock_depths::GoChestGUID

Referenced by OnGameObjectCreate(), and SetData().

◆ GoGolemNGUID

ObjectGuid instance_blackrock_depths::GoGolemNGUID

Referenced by GetGuidData(), and OnGameObjectCreate().

◆ GoGolemSGUID

ObjectGuid instance_blackrock_depths::GoGolemSGUID

Referenced by GetGuidData(), and OnGameObjectCreate().

◆ GoLyceumGUID

ObjectGuid instance_blackrock_depths::GoLyceumGUID

Referenced by OnGameObjectCreate().

◆ GoSecretDoorGUID

ObjectGuid instance_blackrock_depths::GoSecretDoorGUID

Referenced by OnGameObjectCreate(), and SetData().

◆ GoSecretSafeGUID

ObjectGuid instance_blackrock_depths::GoSecretSafeGUID

Referenced by OnGameObjectCreate(), and SetData().

◆ GoSFNGUID

ObjectGuid instance_blackrock_depths::GoSFNGUID

Referenced by GetGuidData(), and OnGameObjectCreate().

◆ GoSFSGUID

ObjectGuid instance_blackrock_depths::GoSFSGUID

Referenced by GetGuidData(), and OnGameObjectCreate().

◆ GoShadowDummyGUID

ObjectGuid instance_blackrock_depths::GoShadowDummyGUID

Referenced by OnGameObjectCreate().

◆ GoShadowGiantGUID

ObjectGuid instance_blackrock_depths::GoShadowGiantGUID

Referenced by OnGameObjectCreate().

◆ GoShadowLockGUID

ObjectGuid instance_blackrock_depths::GoShadowLockGUID

Referenced by OnGameObjectCreate().

◆ GoShadowMechGUID

ObjectGuid instance_blackrock_depths::GoShadowMechGUID

Referenced by OnGameObjectCreate().

◆ GoSpectralChaliceGUID

ObjectGuid instance_blackrock_depths::GoSpectralChaliceGUID

Referenced by GetGuidData(), and OnGameObjectCreate().

◆ GoThroneGUID

ObjectGuid instance_blackrock_depths::GoThroneGUID

◆ GoTombEnterGUID

ObjectGuid instance_blackrock_depths::GoTombEnterGUID

◆ GoTombExitGUID

ObjectGuid instance_blackrock_depths::GoTombExitGUID

◆ GrimstonePositon

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

Referenced by SetData().

◆ IronhandCounter

uint32 instance_blackrock_depths::IronhandCounter

Referenced by Initialize(), and OnCreatureCreate().

◆ IronhandGUID

ObjectGuid instance_blackrock_depths::IronhandGUID[6]

Referenced by OnCreatureCreate(), and SetData().

◆ MagmusGUID

ObjectGuid instance_blackrock_depths::MagmusGUID

◆ MoiraGUID

ObjectGuid instance_blackrock_depths::MoiraGUID

◆ OpenedCoofers

uint32 instance_blackrock_depths::OpenedCoofers

Referenced by Initialize(), and SetData().

◆ PhalanxGUID

ObjectGuid instance_blackrock_depths::PhalanxGUID

Referenced by GetGuidData(), and OnCreatureCreate().

◆ PriestessGUID

ObjectGuid instance_blackrock_depths::PriestessGUID

Referenced by ReplaceMoiraIfSaved().

◆ str_data

std::string instance_blackrock_depths::str_data

Referenced by GetSaveData(), and SetData().

◆ TempSummonGrimstone

TempSummon* instance_blackrock_depths::TempSummonGrimstone = nullptr

Referenced by SetData().

◆ timeRingFail

time_t instance_blackrock_depths::timeRingFail = 0

Referenced by GetData(), and SetData().

◆ TombBossGUIDs

ObjectGuid instance_blackrock_depths::TombBossGUIDs[7]

◆ TombEventCounter

uint32 instance_blackrock_depths::TombEventCounter

◆ tombResetTimer

uint32 instance_blackrock_depths::tombResetTimer

◆ TombTimer

uint32 instance_blackrock_depths::TombTimer

◆ VaultWarderCenter

Position instance_blackrock_depths::VaultWarderCenter = Position(813.5f, -348.0f)

Referenced by OnCreatureCreate().

◆ VaultWarderGUIDs

GuidList instance_blackrock_depths::VaultWarderGUIDs

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