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

Public Member Functions

 instance_stratholme_InstanceMapScript (Map *map)
 
void Initialize () override
 
void OnPlayerEnter (Player *player) override
 
void OnCreatureCreate (Creature *creature) override
 
void ProcessSlaughterEvent ()
 
void OnUnitDeath (Unit *unit) override
 
void OnGameObjectCreate (GameObject *go) override
 
void CheckZiggurats ()
 
void DoSpawnPlaguedCritters (uint8, Player *player)
 
void SetData (uint32 type, uint32 data) override
 
void ReadSaveDataMore (std::istringstream &data) override
 
void WriteSaveDataMore (std::ostringstream &data) override
 
uint32 GetData (uint32 type) const override
 
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)
 

Private Member Functions

void gate_delay (int gate)
 
void gate_critter_delay (int gate)
 

Private Attributes

uint32 _baronRunProgress
 
uint32 _baronRunTime
 
uint32 _zigguratState1
 
uint32 _zigguratState2
 
uint32 _zigguratState3
 
uint32 _slaughterProgress
 
uint32 _slaughterNPCs
 
uint32 _postboxesOpened
 
EventMap events
 
ObjectGuid _zigguratDoorsGUID1
 
ObjectGuid _zigguratDoorsGUID2
 
ObjectGuid _zigguratDoorsGUID3
 
ObjectGuid _zigguratDoorsGUID4
 
ObjectGuid _zigguratDoorsGUID5
 
ObjectGuid _slaughterGateGUID
 
ObjectGuid _gauntletGateGUID
 
ObjectGuid _baronRivendareGUID
 
bool _gateTrapsCooldown [2]
 
ObjectGuid _trappedPlayerGUID
 
ObjectGuid _trapGatesGUIDs [4]
 

Additional Inherited Members

- Static Public Member Functions inherited from InstanceScript
static std::string GetBossStateName (uint8 state)
 
- Public Attributes inherited from InstanceScript
Mapinstance
 
- 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_stratholme_InstanceMapScript()

instance_stratholme::instance_stratholme_InstanceMapScript::instance_stratholme_InstanceMapScript ( Map map)
inline
61 : InstanceScript(map)
62 {
64 }
#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

◆ CheckZiggurats()

void instance_stratholme::instance_stratholme_InstanceMapScript::CheckZiggurats ( )
inline
249 {
250 if (_zigguratState1 == 2 && _zigguratState2 == 2 && _zigguratState3 == 2)
251 {
252 instance->LoadGrid(4035.83f, -3336.31f);
254 baron->AI()->Talk(SAY_BRAON_ZIGGURAT_FALL_YELL);
255
257 gate->SetGoState(GO_STATE_ACTIVE);
259 gate->SetGoState(GO_STATE_ACTIVE);
260 }
261 }
@ GO_STATE_ACTIVE
Definition: GameObjectData.h:690
@ SAY_BRAON_ZIGGURAT_FALL_YELL
Definition: stratholme.h:86
Definition: Creature.h:46
Definition: GameObject.h:122
Map * instance
Definition: InstanceScript.h:146
void LoadGrid(float x, float y)
Definition: Map.cpp:494
GameObject * GetGameObject(ObjectGuid const guid)
Definition: Map.cpp:3298
Creature * GetCreature(ObjectGuid const guid)
Definition: Map.cpp:3293
ObjectGuid _slaughterGateGUID
Definition: instance_stratholme.cpp:581
ObjectGuid _gauntletGateGUID
Definition: instance_stratholme.cpp:582
uint32 _zigguratState3
Definition: instance_stratholme.cpp:570
uint32 _zigguratState2
Definition: instance_stratholme.cpp:569
ObjectGuid _baronRivendareGUID
Definition: instance_stratholme.cpp:583
uint32 _zigguratState1
Definition: instance_stratholme.cpp:568

References _baronRivendareGUID, _gauntletGateGUID, _slaughterGateGUID, _zigguratState1, _zigguratState2, _zigguratState3, Map::GetCreature(), Map::GetGameObject(), GO_STATE_ACTIVE, InstanceScript::instance, Map::LoadGrid(), and SAY_BRAON_ZIGGURAT_FALL_YELL.

Referenced by SetData().

◆ DoSpawnPlaguedCritters()

void instance_stratholme::instance_stratholme_InstanceMapScript::DoSpawnPlaguedCritters ( uint8  ,
Player player 
)
inline
264 {
265 if (!player)
266 return;
267
268 uint32 uiEntry = aPlaguedCritters[urand(0, 2)];
269 for (uint8 i = 0; i < 30; ++i)
270 {
271 float x, y, z;
272 const Position pPos = { player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetOrientation() };
273 player->GetRandomPoint(pPos, 8.0f, x, y, z);
274 z = player->GetPositionZ() + 1;
275 player->SummonCreature(uiEntry, x, y, z, 0, TEMPSUMMON_DEAD_DESPAWN, 0)->AI()->AttackStart(player);
276 }
277 }
std::uint8_t uint8
Definition: Define.h:110
std::uint32_t uint32
Definition: Define.h:108
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:44
@ TEMPSUMMON_DEAD_DESPAWN
Definition: Object.h:48
static const uint32 aPlaguedCritters[]
Definition: instance_stratholme.cpp:40
virtual void AttackStart(Unit *)
Definition: UnitAI.cpp:28
CreatureAI * AI() const
Definition: Creature.h:135
TempSummon * SummonCreature(uint32 id, const Position &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
Definition: Object.cpp:2318
void GetRandomPoint(const Position &srcPos, float distance, float &rand_x, float &rand_y, float &rand_z) const
Definition: Object.cpp:1502
Definition: Position.h:28
float GetPositionZ() const
Definition: Position.h:119
float GetOrientation() const
Definition: Position.h:120
float GetPositionX() const
Definition: Position.h:117
float GetPositionY() const
Definition: Position.h:118

References Creature::AI(), aPlaguedCritters, UnitAI::AttackStart(), Position::GetOrientation(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), WorldObject::GetRandomPoint(), WorldObject::SummonCreature(), TEMPSUMMON_DEAD_DESPAWN, and urand().

Referenced by gate_critter_delay().

◆ gate_critter_delay()

void instance_stratholme::instance_stratholme_InstanceMapScript::gate_critter_delay ( int  gate)
inlineprivate
602 {
604 {
606 {
607 DoSpawnPlaguedCritters(gate, pPlayer);
608 }
609 }
610 }
Player * GetPlayer(Map const *, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:225
Definition: Player.h:1046
ObjectGuid _trappedPlayerGUID
Definition: instance_stratholme.cpp:586
void DoSpawnPlaguedCritters(uint8, Player *player)
Definition: instance_stratholme.cpp:263

References _trappedPlayerGUID, DoSpawnPlaguedCritters(), ObjectAccessor::GetPlayer(), and InstanceScript::instance.

Referenced by Update().

◆ gate_delay()

void instance_stratholme::instance_stratholme_InstanceMapScript::gate_delay ( int  gate)
inlineprivate
590 {
591 if (_trapGatesGUIDs[2 * gate])
592 {
594 }
595 if (_trapGatesGUIDs[2 * gate + 1])
596 {
597 DoUseDoorOrButton(_trapGatesGUIDs[2 * gate + 1]);
598 }
599 }
void DoUseDoorOrButton(ObjectGuid guid, uint32 withRestoreTime=0, bool useAlternativeState=false)
Definition: InstanceScript.cpp:466
ObjectGuid _trapGatesGUIDs[4]
Definition: instance_stratholme.cpp:587

References _trapGatesGUIDs, and InstanceScript::DoUseDoorOrButton().

Referenced by Update().

◆ GetData()

uint32 instance_stratholme::instance_stratholme_InstanceMapScript::GetData ( uint32  type) const
inlineoverridevirtual

Reimplemented from ZoneScript.

381 {
382 switch (type)
383 {
384 case TYPE_ZIGGURAT1:
385 return _zigguratState1;
386 case TYPE_ZIGGURAT2:
387 return _zigguratState2;
388 case TYPE_ZIGGURAT3:
389 return _zigguratState3;
390 case TYPE_MALLOW:
391 return _postboxesOpened;
392 }
393 return 0;
394 }
@ TYPE_ZIGGURAT3
Definition: stratholme.h:31
@ TYPE_ZIGGURAT1
Definition: stratholme.h:29
@ TYPE_ZIGGURAT2
Definition: stratholme.h:30
@ TYPE_MALLOW
Definition: stratholme.h:33
uint32 _postboxesOpened
Definition: instance_stratholme.cpp:573

References _postboxesOpened, _zigguratState1, _zigguratState2, _zigguratState3, TYPE_MALLOW, TYPE_ZIGGURAT1, TYPE_ZIGGURAT2, and TYPE_ZIGGURAT3.

Referenced by OnGameObjectCreate().

◆ Initialize()

void instance_stratholme::instance_stratholme_InstanceMapScript::Initialize ( )
inlineoverridevirtual

Reimplemented from InstanceScript.

67 {
69 _baronRunTime = 0;
76
77 _gateTrapsCooldown[0] = false;
78 _gateTrapsCooldown[1] = false;
79
80 events.Reset();
81 }
events
Definition: boss_sartura.cpp:43
uint32 _slaughterNPCs
Definition: instance_stratholme.cpp:572
bool _gateTrapsCooldown[2]
Definition: instance_stratholme.cpp:585
uint32 _baronRunTime
Definition: instance_stratholme.cpp:567
uint32 _baronRunProgress
Definition: instance_stratholme.cpp:566
uint32 _slaughterProgress
Definition: instance_stratholme.cpp:571

References _baronRunProgress, _baronRunTime, _gateTrapsCooldown, _postboxesOpened, _slaughterNPCs, _slaughterProgress, _zigguratState1, _zigguratState2, and _zigguratState3.

◆ OnCreatureCreate()

void instance_stratholme::instance_stratholme_InstanceMapScript::OnCreatureCreate ( Creature creature)
inlineoverridevirtual

Reimplemented from InstanceScript.

91 {
92 switch (creature->GetEntry())
93 {
95 _baronRivendareGUID = creature->GetGUID();
96 break;
98 case NPC_BILE_SPEWER:
99 if (_slaughterProgress == 0)
101 break;
103 if (_slaughterProgress == 1)
105 break;
107 if (_slaughterProgress == 2)
109 break;
110 case NPC_BLACK_GUARD:
111 if (_slaughterProgress == 3)
113 break;
114 }
115 }
@ NPC_MINDLESS_UNDEAD
Definition: stratholme.h:47
@ NPC_BLACK_GUARD
Definition: stratholme.h:48
@ NPC_BILE_SPEWER
Definition: stratholme.h:44
@ NPC_BARON_RIVENDARE
Definition: stratholme.h:43
@ NPC_RAMSTEIN_THE_GORGER
Definition: stratholme.h:46
@ NPC_VENOM_BELCHER
Definition: stratholme.h:45
uint32 GetEntry() const
Definition: Object.h:109
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:106

References _baronRivendareGUID, _slaughterNPCs, _slaughterProgress, Object::GetEntry(), Object::GetGUID(), NPC_BARON_RIVENDARE, NPC_BILE_SPEWER, NPC_BLACK_GUARD, NPC_MINDLESS_UNDEAD, NPC_RAMSTEIN_THE_GORGER, and NPC_VENOM_BELCHER.

◆ OnGameObjectCreate()

void instance_stratholme::instance_stratholme_InstanceMapScript::OnGameObjectCreate ( GameObject go)
inlineoverridevirtual

Reimplemented from InstanceScript.

172 {
173 switch (go->GetEntry())
174 {
176 case GO_HOARD_DOOR:
180 go->UpdateSaveToDb(true);
181 break;
183 go->UpdateSaveToDb(true);
185 if (GetData(TYPE_ZIGGURAT1) >= 1)
187 break;
189 go->UpdateSaveToDb(true);
191 if (GetData(TYPE_ZIGGURAT2) >= 1)
193 break;
195 go->UpdateSaveToDb(true);
197 if (GetData(TYPE_ZIGGURAT3) >= 1)
199 break;
200 case GO_GAUNTLET_GATE:
201 go->UpdateSaveToDb(true);
203 if (_zigguratState1 == 2 && _zigguratState2 == 2 && _zigguratState3 == 2)
205 break;
207 go->UpdateSaveToDb(true);
209 if (_zigguratState1 == 2 && _zigguratState2 == 2 && _zigguratState3 == 2)
211 break;
213 go->UpdateSaveToDb(true);
215 if (_slaughterProgress == 4)
217 break;
219 go->UpdateSaveToDb(true);
221 if (_slaughterProgress == 4)
223 break;
225 go->UpdateSaveToDb(true);
226 if (_slaughterProgress >= 2)
228 break;
230 go->UpdateSaveToDb(true);
231 _trapGatesGUIDs[0] = go->GetGUID();
232 break;
234 go->UpdateSaveToDb(true);
235 _trapGatesGUIDs[1] = go->GetGUID();
236 break;
238 go->UpdateSaveToDb(true);
239 _trapGatesGUIDs[2] = go->GetGUID();
240 break;
242 go->UpdateSaveToDb(true);
243 _trapGatesGUIDs[3] = go->GetGUID();
244 break;
245 }
246 }
@ GO_PORT_TRAP_GATE_4
Definition: stratholme.h:78
@ GO_PORT_TRAP_GATE_1
Definition: stratholme.h:75
@ GO_SLAUGTHER_GATE
Definition: stratholme.h:72
@ GO_GAUNTLET_DOOR_1
Definition: stratholme.h:64
@ GO_ZIGGURAT_DOORS4
Definition: stratholme.h:69
@ GO_HALL_OF_HIGH_COMMAND
Definition: stratholme.h:63
@ GO_ZIGGURAT_DOORS1
Definition: stratholme.h:66
@ GO_PORT_TRAP_GATE_3
Definition: stratholme.h:77
@ GO_ZIGGURAT_DOORS5
Definition: stratholme.h:70
@ GO_GAUNTLET_GATE
Definition: stratholme.h:71
@ GO_ZIGGURAT_DOORS2
Definition: stratholme.h:67
@ GO_PORT_TRAP_GATE_2
Definition: stratholme.h:76
@ GO_ZIGGURAT_DOORS3
Definition: stratholme.h:68
@ GO_GAUNTLET_DOOR_2
Definition: stratholme.h:65
@ GO_CRUSADER_SQUARE_DOOR
Definition: stratholme.h:61
@ GO_SLAUGHTER_GATE_SIDE
Definition: stratholme.h:73
@ GO_HOARD_DOOR
Definition: stratholme.h:62
void SetGoState(GOState state)
Definition: GameObject.cpp:2467
void UpdateSaveToDb(bool enable)
Definition: GameObject.cpp:2575
ObjectGuid _zigguratDoorsGUID4
Definition: instance_stratholme.cpp:579
ObjectGuid _zigguratDoorsGUID1
Definition: instance_stratholme.cpp:576
ObjectGuid _zigguratDoorsGUID2
Definition: instance_stratholme.cpp:577
ObjectGuid _zigguratDoorsGUID5
Definition: instance_stratholme.cpp:580
ObjectGuid _zigguratDoorsGUID3
Definition: instance_stratholme.cpp:578
uint32 GetData(uint32 type) const override
Definition: instance_stratholme.cpp:380

References _gauntletGateGUID, _slaughterGateGUID, _slaughterProgress, _trapGatesGUIDs, _zigguratDoorsGUID1, _zigguratDoorsGUID2, _zigguratDoorsGUID3, _zigguratDoorsGUID4, _zigguratDoorsGUID5, _zigguratState1, _zigguratState2, _zigguratState3, GetData(), Object::GetEntry(), Object::GetGUID(), GO_CRUSADER_SQUARE_DOOR, GO_GAUNTLET_DOOR_1, GO_GAUNTLET_DOOR_2, GO_GAUNTLET_GATE, GO_HALL_OF_HIGH_COMMAND, GO_HOARD_DOOR, GO_PORT_TRAP_GATE_1, GO_PORT_TRAP_GATE_2, GO_PORT_TRAP_GATE_3, GO_PORT_TRAP_GATE_4, GO_SLAUGHTER_GATE_SIDE, GO_SLAUGTHER_GATE, GO_STATE_ACTIVE, GO_ZIGGURAT_DOORS1, GO_ZIGGURAT_DOORS2, GO_ZIGGURAT_DOORS3, GO_ZIGGURAT_DOORS4, GO_ZIGGURAT_DOORS5, GameObject::SetGoState(), TYPE_ZIGGURAT1, TYPE_ZIGGURAT2, TYPE_ZIGGURAT3, and GameObject::UpdateSaveToDb().

◆ OnPlayerEnter()

void instance_stratholme::instance_stratholme_InstanceMapScript::OnPlayerEnter ( Player player)
inlineoverridevirtual

Reimplemented from InstanceScript.

84 {
85 if (_baronRunTime > 0)
86 if (Aura* aura = player->AddAura(SPELL_BARON_ULTIMATUM, player))
87 aura->SetDuration(_baronRunTime * MINUTE * IN_MILLISECONDS);
88 }
constexpr auto IN_MILLISECONDS
Definition: Common.h:62
constexpr auto MINUTE
Definition: Common.h:56
@ SPELL_BARON_ULTIMATUM
Definition: stratholme.h:105
Aura * AddAura(uint32 spellId, Unit *target)
Definition: Unit.cpp:19031
Definition: SpellAuras.h:87

References _baronRunTime, Unit::AddAura(), IN_MILLISECONDS, MINUTE, and SPELL_BARON_ULTIMATUM.

◆ OnUnitDeath()

void instance_stratholme::instance_stratholme_InstanceMapScript::OnUnitDeath ( Unit unit)
inlineoverridevirtual

Reimplemented from ZoneScript.

149 {
150 switch (unit->GetEntry())
151 {
153 case NPC_BILE_SPEWER:
156 case NPC_BLACK_GUARD:
157 if (--_slaughterNPCs == 0)
158 {
161 SaveToDB();
162 }
163 break;
165 events.CancelEvent(EVENT_BARON_TIME);
167 break;
168 }
169 }
@ EVENT_BARON_TIME
Definition: stratholme.h:93
void DoRemoveAurasDueToSpellOnPlayers(uint32 spell)
Definition: InstanceScript.cpp:587
void SaveToDB()
Definition: InstanceScript.cpp:41
void ProcessSlaughterEvent()
Definition: instance_stratholme.cpp:117

References _slaughterNPCs, _slaughterProgress, InstanceScript::DoRemoveAurasDueToSpellOnPlayers(), EVENT_BARON_TIME, Object::GetEntry(), NPC_BARON_RIVENDARE, NPC_BILE_SPEWER, NPC_BLACK_GUARD, NPC_MINDLESS_UNDEAD, NPC_RAMSTEIN_THE_GORGER, NPC_VENOM_BELCHER, ProcessSlaughterEvent(), InstanceScript::SaveToDB(), and SPELL_BARON_ULTIMATUM.

◆ ProcessSlaughterEvent()

void instance_stratholme::instance_stratholme_InstanceMapScript::ProcessSlaughterEvent ( )
inline
118 {
119 if (_slaughterProgress == 1)
120 {
122 baron->AI()->Talk(SAY_BRAON_SUMMON_RAMSTEIN);
123
124 Position pos = {4032.20f, -3378.06f, 119.75f, 4.67f};
126 }
127 if (_slaughterProgress == 2)
128 {
129 for (uint32 i = 0; i < 33; ++i)
130 events.ScheduleEvent(EVENT_SPAWN_MINDLESS, 5000 + i * 210);
132 if (GameObject* gate = baron->FindNearestGameObject(GO_SLAUGHTER_GATE_SIDE, 200.0f))
133 gate->SetGoState(GO_STATE_ACTIVE);
134 }
135 if (_slaughterProgress == 3)
136 {
137 events.ScheduleEvent(EVENT_SPAWN_BLACK_GUARD, 20000);
138 }
139 if (_slaughterProgress == 4)
140 {
142 baron->AI()->Talk(SAY_BARON_GUARD_DEAD);
144 gate->SetGoState(GO_STATE_ACTIVE);
145 }
146 }
@ SAY_BRAON_SUMMON_RAMSTEIN
Definition: stratholme.h:90
@ SAY_BARON_GUARD_DEAD
Definition: stratholme.h:91
@ EVENT_SPAWN_MINDLESS
Definition: stratholme.h:94
@ EVENT_SPAWN_BLACK_GUARD
Definition: stratholme.h:96
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr, Milliseconds delay=0s)
Causes the creature to talk/say the text assigned to their entry in the creature_text database table.
Definition: CreatureAI.cpp:50
GameObject * FindNearestGameObject(uint32 entry, float range, bool onlySpawned=false) const
Definition: Object.cpp:2418
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

References _baronRivendareGUID, _slaughterProgress, _zigguratDoorsGUID5, Creature::AI(), EVENT_SPAWN_BLACK_GUARD, EVENT_SPAWN_MINDLESS, WorldObject::FindNearestGameObject(), Map::GetCreature(), Map::GetGameObject(), GO_SLAUGHTER_GATE_SIDE, GO_STATE_ACTIVE, InstanceScript::instance, NPC_RAMSTEIN_THE_GORGER, SAY_BARON_GUARD_DEAD, SAY_BRAON_SUMMON_RAMSTEIN, Map::SummonCreature(), and CreatureAI::Talk().

Referenced by OnUnitDeath(), and Update().

◆ ReadSaveDataMore()

void instance_stratholme::instance_stratholme_InstanceMapScript::ReadSaveDataMore ( std::istringstream &  data)
inlineoverridevirtual

Reimplemented from InstanceScript.

349 {
350 data >> _baronRunProgress;
351 data >> _baronRunTime;
352 data >> _zigguratState1;
353 data >> _zigguratState2;
354 data >> _zigguratState3;
355 data >> _slaughterProgress;
356 data >> _postboxesOpened;
357
358 if (_baronRunTime)
359 {
360 events.ScheduleEvent(EVENT_BARON_TIME, 60000);
361 }
362
364 {
365 events.ScheduleEvent(EVENT_FORCE_SLAUGHTER_EVENT, 5000);
366 }
367 }
@ EVENT_FORCE_SLAUGHTER_EVENT
Definition: stratholme.h:95

References _baronRunProgress, _baronRunTime, _postboxesOpened, _slaughterProgress, _zigguratState1, _zigguratState2, _zigguratState3, EVENT_BARON_TIME, and EVENT_FORCE_SLAUGHTER_EVENT.

◆ SetData()

void instance_stratholme::instance_stratholme_InstanceMapScript::SetData ( uint32  type,
uint32  data 
)
inlineoverridevirtual

Reimplemented from ZoneScript.

280 {
281 switch (type)
282 {
283 case TYPE_BARON_RUN:
284 {
286 {
288 _baronRunTime = 45;
290 events.ScheduleEvent(EVENT_BARON_TIME, 60000);
291
292 instance->LoadGrid(4035.83f, -3336.31f);
294 baron->AI()->Talk(SAY_BARON_INIT_YELL);
295 }
296 break;
297 }
298 case TYPE_ZIGGURAT1:
299 {
300 if (data == _zigguratState1 + 1)
302
303 if (_zigguratState1 == 1)
305 ziggurat->SetGoState(GO_STATE_ACTIVE);
306
308 break;
309 }
310 case TYPE_ZIGGURAT2:
311 {
312 if (data == _zigguratState2 + 1)
314
315 if (_zigguratState2 == 1)
317 ziggurat->SetGoState(GO_STATE_ACTIVE);
318
320 break;
321 }
322 case TYPE_ZIGGURAT3:
323 {
324 if (data == _zigguratState3 + 1)
326
327 if (_zigguratState3 == 1)
329 ziggurat->SetGoState(GO_STATE_ACTIVE);
330
332 break;
333 }
334 case TYPE_BARON_FIGHT:
335 {
337 gate->SetGoState(data == IN_PROGRESS ? GO_STATE_READY : GO_STATE_ACTIVE);
338 return;
339 }
340 case TYPE_MALLOW:
342 break;
343 }
344
345 SaveToDB();
346 }
@ GO_STATE_READY
Definition: GameObjectData.h:691
@ IN_PROGRESS
Definition: InstanceScript.h:57
@ SAY_BARON_INIT_YELL
Definition: stratholme.h:85
@ TYPE_BARON_FIGHT
Definition: stratholme.h:32
@ DATA_BARON_RUN_NONE
Definition: stratholme.h:35
@ DATA_BARON_RUN_GATE
Definition: stratholme.h:36
@ TYPE_BARON_RUN
Definition: stratholme.h:28
void DoCastSpellOnPlayers(uint32 spell)
Definition: InstanceScript.cpp:605
void CheckZiggurats()
Definition: instance_stratholme.cpp:248

References _baronRivendareGUID, _baronRunProgress, _baronRunTime, _postboxesOpened, _zigguratDoorsGUID1, _zigguratDoorsGUID2, _zigguratDoorsGUID3, _zigguratDoorsGUID5, _zigguratState1, _zigguratState2, _zigguratState3, CheckZiggurats(), DATA_BARON_RUN_GATE, DATA_BARON_RUN_NONE, InstanceScript::DoCastSpellOnPlayers(), EVENT_BARON_TIME, Map::GetCreature(), Map::GetGameObject(), GO_STATE_ACTIVE, GO_STATE_READY, IN_PROGRESS, InstanceScript::instance, Map::LoadGrid(), InstanceScript::SaveToDB(), SAY_BARON_INIT_YELL, SPELL_BARON_ULTIMATUM, TYPE_BARON_FIGHT, TYPE_BARON_RUN, TYPE_MALLOW, TYPE_ZIGGURAT1, TYPE_ZIGGURAT2, and TYPE_ZIGGURAT3.

◆ Update()

void instance_stratholme::instance_stratholme_InstanceMapScript::Update ( uint32  diff)
inlineoverridevirtual

Reimplemented from InstanceScript.

397 {
398 events.Update(diff);
399
400 Map::PlayerList const& players = instance->GetPlayers();
401 // Loop over the two Gate traps, each one has up to three timers (trap reset, gate opening delay, critters spawning delay)
402 for (uint8 i = 0; i < 2; i++)
403 {
404 // if the gate is in cooldown, skip the other checks
405 if (_gateTrapsCooldown[i])
406 break;
407
408 // Check that the trap is not on cooldown, if so check if player/pet is in range
409 for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
410 {
411 if (Player* player = itr->GetSource())
412 {
413 // should pet also trigger the trap? could not find any source for it
414 if (!player->IsGameMaster() && player->IsWithinDist2d(aGateTrap[i].m_positionX, aGateTrap[i].m_positionY, 5.5f))
415 {
416 // Check if timer was not already set by another player/pet a few milliseconds before
417 if (_gateTrapsCooldown[i])
418 return;
419
420 _gateTrapsCooldown[i] = true;
421
422 // close the gates
423 if (_trapGatesGUIDs[2 * i])
425 if (_trapGatesGUIDs[2 * i + 1])
427
428 _trappedPlayerGUID = player->GetGUID();
429
430 if (i == 0)
431 {
432 // set timer to reset the trap
433 events.ScheduleEvent(EVENT_GATE1_TRAP, 30 * MINUTE * IN_MILLISECONDS);
434 // set timer to reopen gates
435 events.ScheduleEvent(EVENT_GATE1_DELAY, 20 * IN_MILLISECONDS);
436 // set timer to spawn the plagued critters
438 }
439 else if (i == 1)
440 {
441 // set timer to reset the trap
442 events.ScheduleEvent(EVENT_GATE2_TRAP, 30 * MINUTE * IN_MILLISECONDS);
443 // set timer to reopen gates
444 events.ScheduleEvent(EVENT_GATE2_DELAY, 20 * IN_MILLISECONDS);
445 // set timer to spawn the plagued critters
447 }
448 }
449 }
450 }
451 }
452
453 const int GATE1 = 0;
454 const int GATE2 = 1;
455
456 switch (events.ExecuteEvent())
457 {
458 case EVENT_GATE1_TRAP:
459 _gateTrapsCooldown[GATE1] = false;
460 break;
461 case EVENT_GATE2_TRAP:
462 _gateTrapsCooldown[GATE2] = false;
463 break;
465 gate_delay(GATE1);
466 break;
468 gate_delay(GATE2);
469 break;
471 gate_critter_delay(GATE1);
472 break;
474 gate_critter_delay(GATE2);
475 break;
476 case EVENT_BARON_TIME:
477 {
479 instance->LoadGrid(4035.83f, -3336.31f);
481 if (baron && !baron->IsInCombat())
482 {
483 switch (_baronRunTime)
484 {
485 case 10:
486 baron->AI()->Talk(SAY_BARON_10M);
487 break;
488 case 5:
489 baron->AI()->Talk(SAY_BARON_5M);
490 if (Creature* ysida = baron->FindNearestCreature(NPC_YSIDA, 50.0f))
491 ysida->AI()->SetData(1, 1);
492 break;
493 case 0:
494 baron->AI()->Talk(SAY_BARON_0M);
496 break;
497 }
498 }
499
500 if (_baronRunTime > 0)
501 events.ScheduleEvent(EVENT_BARON_TIME, 60s);
502 else
503 events.ScheduleEvent(EVENT_EXECUTE_PRISONER, 0ms);
504
505 SaveToDB();
506 break;
507 }
509 {
510 instance->LoadGrid(4035.83f, -3336.31f);
512 if (baron && baron->IsAlive())
513 {
514 if (!baron->IsInCombat())
515 {
517 if (Creature* ysida = baron->FindNearestCreature(NPC_YSIDA, 50.0f))
518 Unit::Kill(baron, ysida);
519 }
520 else
521 events.ScheduleEvent(EVENT_EXECUTE_PRISONER, 1s);
522 }
523 break;
524 }
526 {
527 Position pos = {3941.75f, -3393.06f, 119.70f, 0.0f};
529 break;
530 }
532 {
533 Map::PlayerList const& PlayerList = instance->GetPlayers();
534 if (!PlayerList.IsEmpty())
535 for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
536 if (Player* player = i->GetSource())
537 if (player->GetDistance2d(4034.97f, -3402.13f) < 50.0f)
538 {
540 return;
541 }
542
543 events.ScheduleEvent(EVENT_FORCE_SLAUGHTER_EVENT, 3s);
544 break;
545 }
547 {
548 for (uint8 i = 0; i < 5; ++i)
550 {
551 guard->SetWalk(true);
552 guard->GetMotionMaster()->MovePoint(0, BlackGuardPos[i + 5]);
553 guard->SetHomePosition(BlackGuardPos[i + 5]);
554 if (i == 0 && guard->AI())
555 guard->AI()->Talk(SAY_BLACK_GUARD_INIT);
556 }
557
559 gate->SetGoState(GO_STATE_ACTIVE);
560 break;
561 }
562 }
563 }
const Position BlackGuardPos[10]
Definition: instance_stratholme.cpp:24
static const Position aGateTrap[]
Definition: instance_stratholme.cpp:46
@ EVENT_GATE1_TRAP
Definition: stratholme.h:98
@ SAY_BLACK_GUARD_INIT
Definition: stratholme.h:84
@ SAY_BARON_10M
Definition: stratholme.h:87
@ SAY_BARON_0M
Definition: stratholme.h:89
@ EVENT_GATE1_DELAY
Definition: stratholme.h:99
@ EVENT_GATE1_CRITTER_DELAY
Definition: stratholme.h:100
@ SAY_BARON_5M
Definition: stratholme.h:88
@ EVENT_GATE2_CRITTER_DELAY
Definition: stratholme.h:103
@ EVENT_GATE2_DELAY
Definition: stratholme.h:102
@ EVENT_EXECUTE_PRISONER
Definition: stratholme.h:97
@ EVENT_GATE2_TRAP
Definition: stratholme.h:101
@ NPC_YSIDA
Definition: stratholme.h:49
@ EMOTE_ONESHOT_ATTACK1H
Definition: SharedDefines.h:1898
bool IsEmpty() const
Definition: LinkedList.h:97
Definition: LinkedList.h:139
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2409
float m_positionX
Definition: Position.h:56
float m_positionY
Definition: Position.h:57
static void Kill(Unit *killer, Unit *victim, bool durabilityLoss=true, WeaponAttackType attackType=BASE_ATTACK, SpellInfo const *spellProto=nullptr, Spell const *spell=nullptr)
Definition: Unit.cpp:17862
bool IsAlive() const
Definition: Unit.h:1808
void HandleEmoteCommand(uint32 emoteId)
Definition: Unit.cpp:1970
bool IsInCombat() const
Definition: Unit.h:1688
PlayerList const & GetPlayers() const
Definition: Map.h:484
Definition: MapRefMgr.h:26
iterator begin()
Definition: MapRefMgr.h:36
iterator end()
Definition: MapRefMgr.h:37
void gate_delay(int gate)
Definition: instance_stratholme.cpp:589
void gate_critter_delay(int gate)
Definition: instance_stratholme.cpp:601

References _baronRivendareGUID, _baronRunTime, _gateTrapsCooldown, _trapGatesGUIDs, _trappedPlayerGUID, _zigguratDoorsGUID4, aGateTrap, Creature::AI(), MapRefMgr::begin(), BlackGuardPos, InstanceScript::DoRemoveAurasDueToSpellOnPlayers(), InstanceScript::DoUseDoorOrButton(), EMOTE_ONESHOT_ATTACK1H, MapRefMgr::end(), EVENT_BARON_TIME, EVENT_EXECUTE_PRISONER, EVENT_FORCE_SLAUGHTER_EVENT, EVENT_GATE1_CRITTER_DELAY, EVENT_GATE1_DELAY, EVENT_GATE1_TRAP, EVENT_GATE2_CRITTER_DELAY, EVENT_GATE2_DELAY, EVENT_GATE2_TRAP, EVENT_SPAWN_BLACK_GUARD, EVENT_SPAWN_MINDLESS, WorldObject::FindNearestCreature(), gate_critter_delay(), gate_delay(), Map::GetCreature(), Map::GetGameObject(), Map::GetPlayers(), GO_STATE_ACTIVE, Unit::HandleEmoteCommand(), IN_MILLISECONDS, InstanceScript::instance, Unit::IsAlive(), LinkedListHead::IsEmpty(), Unit::IsInCombat(), Unit::Kill(), Map::LoadGrid(), Position::m_positionX, Position::m_positionY, MINUTE, NPC_BLACK_GUARD, NPC_MINDLESS_UNDEAD, NPC_YSIDA, ProcessSlaughterEvent(), InstanceScript::SaveToDB(), SAY_BARON_0M, SAY_BARON_10M, SAY_BARON_5M, SAY_BLACK_GUARD_INIT, SPELL_BARON_ULTIMATUM, Map::SummonCreature(), and CreatureAI::Talk().

◆ WriteSaveDataMore()

void instance_stratholme::instance_stratholme_InstanceMapScript::WriteSaveDataMore ( std::ostringstream &  data)
inlineoverridevirtual

Reimplemented from InstanceScript.

370 {
371 data << _baronRunProgress << ' '
372 << _baronRunTime << ' '
373 << _zigguratState1 << ' '
374 << _zigguratState2 << ' '
375 << _zigguratState3 << ' '
376 << _slaughterProgress << ' '
378 }

References _baronRunProgress, _baronRunTime, _postboxesOpened, _slaughterProgress, _zigguratState1, _zigguratState2, and _zigguratState3.

Member Data Documentation

◆ _baronRivendareGUID

ObjectGuid instance_stratholme::instance_stratholme_InstanceMapScript::_baronRivendareGUID
private

◆ _baronRunProgress

uint32 instance_stratholme::instance_stratholme_InstanceMapScript::_baronRunProgress
private

◆ _baronRunTime

uint32 instance_stratholme::instance_stratholme_InstanceMapScript::_baronRunTime
private

◆ _gateTrapsCooldown

bool instance_stratholme::instance_stratholme_InstanceMapScript::_gateTrapsCooldown[2]
private

Referenced by Initialize(), and Update().

◆ _gauntletGateGUID

ObjectGuid instance_stratholme::instance_stratholme_InstanceMapScript::_gauntletGateGUID
private

◆ _postboxesOpened

uint32 instance_stratholme::instance_stratholme_InstanceMapScript::_postboxesOpened
private

◆ _slaughterGateGUID

ObjectGuid instance_stratholme::instance_stratholme_InstanceMapScript::_slaughterGateGUID
private

◆ _slaughterNPCs

uint32 instance_stratholme::instance_stratholme_InstanceMapScript::_slaughterNPCs
private

◆ _slaughterProgress

uint32 instance_stratholme::instance_stratholme_InstanceMapScript::_slaughterProgress
private

◆ _trapGatesGUIDs

ObjectGuid instance_stratholme::instance_stratholme_InstanceMapScript::_trapGatesGUIDs[4]
private

◆ _trappedPlayerGUID

ObjectGuid instance_stratholme::instance_stratholme_InstanceMapScript::_trappedPlayerGUID
private

Referenced by gate_critter_delay(), and Update().

◆ _zigguratDoorsGUID1

ObjectGuid instance_stratholme::instance_stratholme_InstanceMapScript::_zigguratDoorsGUID1
private

Referenced by OnGameObjectCreate(), and SetData().

◆ _zigguratDoorsGUID2

ObjectGuid instance_stratholme::instance_stratholme_InstanceMapScript::_zigguratDoorsGUID2
private

Referenced by OnGameObjectCreate(), and SetData().

◆ _zigguratDoorsGUID3

ObjectGuid instance_stratholme::instance_stratholme_InstanceMapScript::_zigguratDoorsGUID3
private

Referenced by OnGameObjectCreate(), and SetData().

◆ _zigguratDoorsGUID4

ObjectGuid instance_stratholme::instance_stratholme_InstanceMapScript::_zigguratDoorsGUID4
private

Referenced by OnGameObjectCreate(), and Update().

◆ _zigguratDoorsGUID5

ObjectGuid instance_stratholme::instance_stratholme_InstanceMapScript::_zigguratDoorsGUID5
private

◆ _zigguratState1

uint32 instance_stratholme::instance_stratholme_InstanceMapScript::_zigguratState1
private

◆ _zigguratState2

uint32 instance_stratholme::instance_stratholme_InstanceMapScript::_zigguratState2
private

◆ _zigguratState3

uint32 instance_stratholme::instance_stratholme_InstanceMapScript::_zigguratState3
private

◆ events

EventMap instance_stratholme::instance_stratholme_InstanceMapScript::events
private