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)
 
virtual void OnPlayerInWaterStateUpdate (Player *, bool)
 
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)
 
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
 
- 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 _barthilasrunProgress {}
 
uint32 _postboxesOpened
 
EventMap events
 
ObjectGuid _zigguratDoorsGUID1
 
ObjectGuid _zigguratDoorsGUID2
 
ObjectGuid _zigguratDoorsGUID3
 
ObjectGuid _zigguratDoorsGUID4
 
ObjectGuid _zigguratDoorsGUID5
 
ObjectGuid _slaughterGateGUID
 
ObjectGuid _gauntletGateGUID
 
ObjectGuid _baronRivendareGUID
 
ObjectGuid _barthilasGUID
 
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
 
TaskScheduler scheduler
 
- 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=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_stratholme_InstanceMapScript()

instance_stratholme::instance_stratholme_InstanceMapScript::instance_stratholme_InstanceMapScript ( Map map)
inline
65 : InstanceScript(map)
66 {
68 }
#define DataHeader
Definition: blackrock_depths.h:23
Definition: InstanceScript.h:142
void SetHeaders(std::string const &dataHeaders)
Definition: InstanceScript.cpp:138

References DataHeader, and InstanceScript::SetHeaders().

Member Function Documentation

◆ CheckZiggurats()

void instance_stratholme::instance_stratholme_InstanceMapScript::CheckZiggurats ( )
inline
261 {
262 if (_zigguratState1 == 2 && _zigguratState2 == 2 && _zigguratState3 == 2)
263 {
264 instance->LoadGrid(4035.83f, -3336.31f);
266 baron->AI()->Talk(SAY_BRAON_ZIGGURAT_FALL_YELL);
267
269 gate->SetGoState(GO_STATE_ACTIVE);
271 gate->SetGoState(GO_STATE_ACTIVE);
272 }
273 }
@ GO_STATE_ACTIVE
Definition: GameObjectData.h:690
@ SAY_BRAON_ZIGGURAT_FALL_YELL
Definition: stratholme.h:86
Definition: Creature.h:46
Definition: GameObject.h:121
Map * instance
Definition: InstanceScript.h:148
void LoadGrid(float x, float y)
Definition: Map.cpp:492
GameObject * GetGameObject(ObjectGuid const guid)
Definition: Map.cpp:3319
Creature * GetCreature(ObjectGuid const guid)
Definition: Map.cpp:3314
ObjectGuid _slaughterGateGUID
Definition: instance_stratholme.cpp:612
ObjectGuid _gauntletGateGUID
Definition: instance_stratholme.cpp:613
uint32 _zigguratState3
Definition: instance_stratholme.cpp:600
uint32 _zigguratState2
Definition: instance_stratholme.cpp:599
ObjectGuid _baronRivendareGUID
Definition: instance_stratholme.cpp:614
uint32 _zigguratState1
Definition: instance_stratholme.cpp:598

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
276 {
277 if (!player)
278 return;
279
280 uint32 uiEntry = aPlaguedCritters[urand(0, 2)];
281 for (uint8 i = 0; i < 30; ++i)
282 {
283 float x, y, z;
284 const Position pPos = { player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetOrientation() };
285 player->GetRandomPoint(pPos, 8.0f, x, y, z);
286 z = player->GetPositionZ() + 1;
287 player->SummonCreature(uiEntry, x, y, z, 0, TEMPSUMMON_DEAD_DESPAWN, 0)->AI()->AttackStart(player);
288 }
289 }
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:44
std::uint8_t uint8
Definition: Define.h:109
std::uint32_t uint32
Definition: Define.h:107
@ TEMPSUMMON_DEAD_DESPAWN
Definition: Object.h:51
static const uint32 aPlaguedCritters[]
Definition: instance_stratholme.cpp:40
virtual void AttackStart(Unit *)
Definition: UnitAI.cpp:27
CreatureAI * AI() const
Definition: Creature.h:143
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:2355
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
634 {
636 {
638 {
639 DoSpawnPlaguedCritters(gate, pPlayer);
640 }
641 }
642 }
Player * GetPlayer(Map const *, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:223
Definition: Player.h:1064
ObjectGuid _trappedPlayerGUID
Definition: instance_stratholme.cpp:618
void DoSpawnPlaguedCritters(uint8, Player *player)
Definition: instance_stratholme.cpp:275

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

Referenced by Update().

◆ gate_delay()

void instance_stratholme::instance_stratholme_InstanceMapScript::gate_delay ( int  gate)
inlineprivate
622 {
623 if (_trapGatesGUIDs[2 * gate])
624 {
626 }
627 if (_trapGatesGUIDs[2 * gate + 1])
628 {
629 DoUseDoorOrButton(_trapGatesGUIDs[2 * gate + 1]);
630 }
631 }
void DoUseDoorOrButton(ObjectGuid guid, uint32 withRestoreTime=0, bool useAlternativeState=false)
Definition: InstanceScript.cpp:514
ObjectGuid _trapGatesGUIDs[4]
Definition: instance_stratholme.cpp:619

References _trapGatesGUIDs, and InstanceScript::DoUseDoorOrButton().

Referenced by Update().

◆ GetData()

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

Reimplemented from ZoneScript.

408 {
409 switch (type)
410 {
411 case TYPE_ZIGGURAT1:
412 return _zigguratState1;
413 case TYPE_ZIGGURAT2:
414 return _zigguratState2;
415 case TYPE_ZIGGURAT3:
416 return _zigguratState3;
417 case TYPE_MALLOW:
418 return _postboxesOpened;
421 }
422 return 0;
423 }
@ TYPE_ZIGGURAT3
Definition: stratholme.h:29
@ TYPE_ZIGGURAT1
Definition: stratholme.h:27
@ TYPE_ZIGGURAT2
Definition: stratholme.h:28
@ TYPE_BARTHILAS_RUN
Definition: stratholme.h:32
@ TYPE_MALLOW
Definition: stratholme.h:31
uint32 _postboxesOpened
Definition: instance_stratholme.cpp:604
uint32 _barthilasrunProgress
Definition: instance_stratholme.cpp:603

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

Referenced by OnGameObjectCreate().

◆ Initialize()

void instance_stratholme::instance_stratholme_InstanceMapScript::Initialize ( )
inlineoverridevirtual

Reimplemented from InstanceScript.

71 {
73 _baronRunTime = 0;
80
81 _gateTrapsCooldown[0] = false;
82 _gateTrapsCooldown[1] = false;
83
84 events.Reset();
85 }
events
Definition: boss_sartura.cpp:43
uint32 _slaughterNPCs
Definition: instance_stratholme.cpp:602
bool _gateTrapsCooldown[2]
Definition: instance_stratholme.cpp:617
uint32 _baronRunTime
Definition: instance_stratholme.cpp:597
uint32 _baronRunProgress
Definition: instance_stratholme.cpp:596
uint32 _slaughterProgress
Definition: instance_stratholme.cpp:601

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.

97 {
98 switch (creature->GetEntry())
99 {
101 _baronRivendareGUID = creature->GetGUID();
102 break;
104 case NPC_BILE_SPEWER:
105 if (_slaughterProgress == 0)
107 break;
109 if (_slaughterProgress == 1)
111 break;
113 if (_slaughterProgress == 2)
115 break;
116 case NPC_BLACK_GUARD:
117 if (_slaughterProgress == 3)
119 break;
120 case NPC_BARTHILAS:
121 _barthilasGUID = creature->GetGUID();
122 break;
123 default:
124 break;
125 }
126 }
@ 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_BARTHILAS
Definition: stratholme.h:42
@ NPC_VENOM_BELCHER
Definition: stratholme.h:45
uint32 GetEntry() const
Definition: Object.h:112
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:109
ObjectGuid _barthilasGUID
Definition: instance_stratholme.cpp:615

References _baronRivendareGUID, _barthilasGUID, _slaughterNPCs, _slaughterProgress, Object::GetEntry(), Object::GetGUID(), NPC_BARON_RIVENDARE, NPC_BARTHILAS, 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.

182 {
183 switch (go->GetEntry())
184 {
186 case GO_HOARD_DOOR:
190 go->AllowSaveToDB(true);
191 break;
193 go->AllowSaveToDB(true);
195 if (GetData(TYPE_ZIGGURAT1) >= 1)
197 break;
199 go->AllowSaveToDB(true);
201 if (GetData(TYPE_ZIGGURAT2) >= 1)
203 break;
205 go->AllowSaveToDB(true);
207 if (GetData(TYPE_ZIGGURAT3) >= 1)
209 break;
210 case GO_GAUNTLET_GATE:
211 go->AllowSaveToDB(true);
213 if (_zigguratState1 == 2 && _zigguratState2 == 2 && _zigguratState3 == 2)
215 break;
217 go->AllowSaveToDB(true);
219 if (_zigguratState1 == 2 && _zigguratState2 == 2 && _zigguratState3 == 2)
221 break;
223 go->AllowSaveToDB(true);
225 if (_slaughterProgress == 4)
227 break;
229 go->AllowSaveToDB(true);
231 if (_slaughterProgress == 4)
233 break;
235 go->AllowSaveToDB(true);
236 if (_slaughterProgress >= 2)
238 break;
240 go->AllowSaveToDB(true);
241 _trapGatesGUIDs[0] = go->GetGUID();
242 break;
244 go->AllowSaveToDB(true);
245 _trapGatesGUIDs[1] = go->GetGUID();
246 break;
248 go->AllowSaveToDB(true);
249 _trapGatesGUIDs[2] = go->GetGUID();
250 break;
252 go->AllowSaveToDB(true);
253 _trapGatesGUIDs[3] = go->GetGUID();
254 break;
255 default:
256 break;
257 }
258 }
@ 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:2477
void AllowSaveToDB(bool enable)
Definition: GameObject.h:362
ObjectGuid _zigguratDoorsGUID4
Definition: instance_stratholme.cpp:610
ObjectGuid _zigguratDoorsGUID1
Definition: instance_stratholme.cpp:607
ObjectGuid _zigguratDoorsGUID2
Definition: instance_stratholme.cpp:608
ObjectGuid _zigguratDoorsGUID5
Definition: instance_stratholme.cpp:611
ObjectGuid _zigguratDoorsGUID3
Definition: instance_stratholme.cpp:609
uint32 GetData(uint32 type) const override
Definition: instance_stratholme.cpp:407

References _gauntletGateGUID, _slaughterGateGUID, _slaughterProgress, _trapGatesGUIDs, _zigguratDoorsGUID1, _zigguratDoorsGUID2, _zigguratDoorsGUID3, _zigguratDoorsGUID4, _zigguratDoorsGUID5, _zigguratState1, _zigguratState2, _zigguratState3, GameObject::AllowSaveToDB(), 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, and TYPE_ZIGGURAT3.

◆ OnPlayerEnter()

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

Reimplemented from InstanceScript.

88 {
89 if (_baronRunTime > 0)
90 if (Aura* aura = player->AddAura(SPELL_BARON_ULTIMATUM, player))
91 aura->SetDuration(_baronRunTime * MINUTE * IN_MILLISECONDS);
93 instance->LoadGrid(3663.229980f, -3619.139893f);
94 }
constexpr auto IN_MILLISECONDS
Definition: Common.h:53
constexpr auto MINUTE
Definition: Common.h:47
@ DONE
Definition: InstanceScript.h:60
@ SPELL_BARON_ULTIMATUM
Definition: stratholme.h:105
Aura * AddAura(uint32 spellId, Unit *target)
Definition: Unit.cpp:18819
Definition: SpellAuras.h:87

References _baronRunTime, _barthilasrunProgress, Unit::AddAura(), DONE, IN_MILLISECONDS, InstanceScript::instance, Map::LoadGrid(), MINUTE, and SPELL_BARON_ULTIMATUM.

◆ OnUnitDeath()

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

Reimplemented from ZoneScript.

159 {
160 switch (unit->GetEntry())
161 {
163 case NPC_BILE_SPEWER:
166 case NPC_BLACK_GUARD:
167 if (--_slaughterNPCs == 0)
168 {
171 SaveToDB();
172 }
173 break;
175 events.CancelEvent(EVENT_BARON_TIME);
177 break;
178 }
179 }
@ EVENT_BARON_TIME
Definition: stratholme.h:93
void DoRemoveAurasDueToSpellOnPlayers(uint32 spell)
Definition: InstanceScript.cpp:639
void SaveToDB()
Definition: InstanceScript.cpp:41
void ProcessSlaughterEvent()
Definition: instance_stratholme.cpp:128

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
129 {
130 if (_slaughterProgress == 1)
131 {
133 baron->AI()->Talk(SAY_BRAON_SUMMON_RAMSTEIN);
134
136 }
137 if (_slaughterProgress == 2)
138 {
139 for (uint32 i = 0; i < 33; ++i)
140 events.ScheduleEvent(EVENT_SPAWN_MINDLESS, 5000 + i * 210);
142 if (GameObject* gate = baron->FindNearestGameObject(GO_SLAUGHTER_GATE_SIDE, 200.0f))
143 gate->SetGoState(GO_STATE_ACTIVE);
144 }
145 if (_slaughterProgress == 3)
146 {
147 events.ScheduleEvent(EVENT_SPAWN_BLACK_GUARD, 20000);
148 }
149 if (_slaughterProgress == 4)
150 {
152 baron->AI()->Talk(SAY_BARON_GUARD_DEAD);
154 gate->SetGoState(GO_STATE_ACTIVE);
155 }
156 }
@ 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
Position const SlaughterPos
Definition: instance_stratholme.cpp:54
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:2455
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:2163

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, SlaughterPos, 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.

375 {
376 data >> _baronRunProgress;
377 data >> _baronRunTime;
378 data >> _zigguratState1;
379 data >> _zigguratState2;
380 data >> _zigguratState3;
381 data >> _slaughterProgress;
382 data >> _postboxesOpened;
383 data >> _barthilasrunProgress;
384 if (_baronRunTime)
385 {
386 events.ScheduleEvent(EVENT_BARON_TIME, 60000);
387 }
388
390 {
391 events.ScheduleEvent(EVENT_FORCE_SLAUGHTER_EVENT, 5000);
392 }
393 }
@ EVENT_FORCE_SLAUGHTER_EVENT
Definition: stratholme.h:95

References _baronRunProgress, _baronRunTime, _barthilasrunProgress, _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.

292 {
293 switch (type)
294 {
295 case TYPE_BARON_RUN:
296 {
298 {
300 _baronRunTime = 45;
302 events.ScheduleEvent(EVENT_BARON_TIME, 60000);
303
304 instance->LoadGrid(4035.83f, -3336.31f);
306 baron->AI()->Talk(SAY_BARON_INIT_YELL);
307 }
308 break;
309 }
310 case TYPE_ZIGGURAT1:
311 {
312 if (data == _zigguratState1 + 1)
314
315 if (_zigguratState1 == 1)
317 ziggurat->SetGoState(GO_STATE_ACTIVE);
318
320 break;
321 }
322 case TYPE_ZIGGURAT2:
323 {
324 if (data == _zigguratState2 + 1)
326
327 if (_zigguratState2 == 1)
329 ziggurat->SetGoState(GO_STATE_ACTIVE);
330
332 break;
333 }
334 case TYPE_ZIGGURAT3:
335 {
336 if (data == _zigguratState3 + 1)
338
339 if (_zigguratState3 == 1)
341 ziggurat->SetGoState(GO_STATE_ACTIVE);
342
344 break;
345 }
346 case TYPE_BARON_FIGHT:
347 {
349 gate->SetGoState(data == IN_PROGRESS ? GO_STATE_READY : GO_STATE_ACTIVE);
350 return;
351 }
352 case TYPE_MALLOW:
354 break;
356 if (data == DONE)
357 {
358 if (Creature* barthilas = instance->GetCreature(_barthilasGUID))
359 {
360 if (barthilas->IsAlive())
361 {
363 barthilas->SetHomePosition(BarthilasPos);
364 }
365 }
366 }
368 break;
369 }
370
371 SaveToDB();
372 }
@ IN_PROGRESS
Definition: InstanceScript.h:58
@ GO_STATE_READY
Definition: GameObjectData.h:691
@ SAY_BARON_INIT_YELL
Definition: stratholme.h:85
@ TYPE_BARON_FIGHT
Definition: stratholme.h:30
@ DATA_BARON_RUN_NONE
Definition: stratholme.h:34
@ DATA_BARON_RUN_GATE
Definition: stratholme.h:35
@ TYPE_BARON_RUN
Definition: stratholme.h:26
Position const BarthilasPos
Definition: instance_stratholme.cpp:53
void DoCastSpellOnPlayers(uint32 spell)
Definition: InstanceScript.cpp:650
void CheckZiggurats()
Definition: instance_stratholme.cpp:260

References _baronRivendareGUID, _baronRunProgress, _baronRunTime, _barthilasGUID, _barthilasrunProgress, _postboxesOpened, _zigguratDoorsGUID1, _zigguratDoorsGUID2, _zigguratDoorsGUID3, _zigguratDoorsGUID5, _zigguratState1, _zigguratState2, _zigguratState3, BarthilasPos, CheckZiggurats(), DATA_BARON_RUN_GATE, DATA_BARON_RUN_NONE, InstanceScript::DoCastSpellOnPlayers(), DONE, EVENT_BARON_TIME, Map::GetCreature(), Map::GetGameObject(), Position::GetOrientation(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), 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_BARTHILAS_RUN, TYPE_MALLOW, TYPE_ZIGGURAT1, TYPE_ZIGGURAT2, and TYPE_ZIGGURAT3.

◆ Update()

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

Reimplemented from InstanceScript.

426 {
427 events.Update(diff);
428
429 Map::PlayerList const& players = instance->GetPlayers();
430 // Loop over the two Gate traps, each one has up to three timers (trap reset, gate opening delay, critters spawning delay)
431 for (uint8 i = 0; i < 2; i++)
432 {
433 // if the gate is in cooldown, skip the other checks
434 if (_gateTrapsCooldown[i])
435 break;
436
437 // Check that the trap is not on cooldown, if so check if player/pet is in range
438 for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
439 {
440 if (Player* player = itr->GetSource())
441 {
442 // should pet also trigger the trap? could not find any source for it
443 if (!player->IsGameMaster() && player->IsWithinDist2d(aGateTrap[i].m_positionX, aGateTrap[i].m_positionY, 5.5f))
444 {
445 // Check if timer was not already set by another player/pet a few milliseconds before
446 if (_gateTrapsCooldown[i])
447 return;
448
449 _gateTrapsCooldown[i] = true;
450
451 // close the gates
452 if (_trapGatesGUIDs[2 * i])
454 if (_trapGatesGUIDs[2 * i + 1])
456
457 _trappedPlayerGUID = player->GetGUID();
458
459 if (i == 0)
460 {
461 // set timer to reset the trap
462 events.ScheduleEvent(EVENT_GATE1_TRAP, 30 * MINUTE * IN_MILLISECONDS);
463 // set timer to reopen gates
464 events.ScheduleEvent(EVENT_GATE1_DELAY, 20 * IN_MILLISECONDS);
465 // set timer to spawn the plagued critters
467 }
468 else if (i == 1)
469 {
470 // set timer to reset the trap
471 events.ScheduleEvent(EVENT_GATE2_TRAP, 30 * MINUTE * IN_MILLISECONDS);
472 // set timer to reopen gates
473 events.ScheduleEvent(EVENT_GATE2_DELAY, 20 * IN_MILLISECONDS);
474 // set timer to spawn the plagued critters
476 }
477 }
478 }
479 }
480 }
481
482 const int GATE1 = 0;
483 const int GATE2 = 1;
484
485 switch (events.ExecuteEvent())
486 {
487 case EVENT_GATE1_TRAP:
488 _gateTrapsCooldown[GATE1] = false;
489 break;
490 case EVENT_GATE2_TRAP:
491 _gateTrapsCooldown[GATE2] = false;
492 break;
494 gate_delay(GATE1);
495 break;
497 gate_delay(GATE2);
498 break;
500 gate_critter_delay(GATE1);
501 break;
503 gate_critter_delay(GATE2);
504 break;
505 case EVENT_BARON_TIME:
506 {
508 instance->LoadGrid(4035.83f, -3336.31f);
510 if (baron && !baron->IsInCombat())
511 {
512 switch (_baronRunTime)
513 {
514 case 10:
515 baron->AI()->Talk(SAY_BARON_10M);
516 break;
517 case 5:
518 baron->AI()->Talk(SAY_BARON_5M);
519 if (Creature* ysida = baron->FindNearestCreature(NPC_YSIDA, 50.0f))
520 ysida->AI()->SetData(1, 1);
521 break;
522 case 0:
523 baron->AI()->Talk(SAY_BARON_0M);
525 break;
526 }
527 }
528
529 if (_baronRunTime > 0)
530 events.ScheduleEvent(EVENT_BARON_TIME, 60s);
531 else
532 events.ScheduleEvent(EVENT_EXECUTE_PRISONER, 0ms);
533
534 SaveToDB();
535 break;
536 }
538 {
539 instance->LoadGrid(4035.83f, -3336.31f);
541 if (baron && baron->IsAlive())
542 {
543 if (!baron->IsInCombat())
544 {
546 if (Creature* ysida = baron->FindNearestCreature(NPC_YSIDA, 50.0f))
547 Unit::Kill(baron, ysida);
548 }
549 else
550 events.ScheduleEvent(EVENT_EXECUTE_PRISONER, 1s);
551 }
552 break;
553 }
555 {
557 break;
558 }
560 {
561 Map::PlayerList const& PlayerList = instance->GetPlayers();
562 if (!PlayerList.IsEmpty())
563 for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
564 if (Player* player = i->GetSource())
565 if (player->GetDistance2d(4034.97f, -3402.13f) < 50.0f)
566 {
568 return;
569 }
570
571 events.ScheduleEvent(EVENT_FORCE_SLAUGHTER_EVENT, 3s);
572 break;
573 }
575 {
576 for (uint8 i = 0; i < 5; ++i)
578 {
579 guard->SetWalk(true);
580 guard->GetMotionMaster()->MovePoint(0, BlackGuardPos[i + 5]);
581 guard->SetHomePosition(BlackGuardPos[i + 5]);
582 if (i == 0 && guard->AI())
583 guard->AI()->Talk(SAY_BLACK_GUARD_INIT);
584 }
585
587 gate->SetGoState(GO_STATE_ACTIVE);
588 break;
589 }
590 default:
591 break;
592 }
593 }
@ 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
Position const MindlessUndeadPos
Definition: instance_stratholme.cpp:52
const Position BlackGuardPos[10]
Definition: instance_stratholme.cpp:24
static const Position aGateTrap[]
Definition: instance_stratholme.cpp:46
@ EMOTE_ONESHOT_ATTACK1H
Definition: SharedDefines.h:1926
bool IsEmpty() const
Definition: LinkedList.h:97
Definition: LinkedList.h:139
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2446
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:17658
bool IsAlive() const
Definition: Unit.h:1204
void HandleEmoteCommand(uint32 emoteId)
Definition: Unit.cpp:1984
bool IsInCombat() const
Definition: Unit.h:820
PlayerList const & GetPlayers() const
Definition: Map.h:486
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:621
void gate_critter_delay(int gate)
Definition: instance_stratholme.cpp:633

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, MindlessUndeadPos, 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.

396 {
397 data << _baronRunProgress << ' '
398 << _baronRunTime << ' '
399 << _zigguratState1 << ' '
400 << _zigguratState2 << ' '
401 << _zigguratState3 << ' '
402 << _slaughterProgress << ' '
403 << _postboxesOpened << ' '
405 }

References _baronRunProgress, _baronRunTime, _barthilasrunProgress, _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

◆ _barthilasGUID

ObjectGuid instance_stratholme::instance_stratholme_InstanceMapScript::_barthilasGUID
private

Referenced by OnCreatureCreate(), and SetData().

◆ _barthilasrunProgress

uint32 instance_stratholme::instance_stratholme_InstanceMapScript::_barthilasrunProgress {}
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