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

Public Member Functions

 instance_culling_of_stratholme_InstanceMapScript (Map *pMap)
 
bool IsEncounterInProgress () const override
 
void FillInitialWorldStates (WorldPacket &data) override
 
void OnPlayerEnter (Player *plr) override
 
void OnCreatureCreate (Creature *creature) override
 
void OnGameObjectCreate (GameObject *go) override
 
void SetData (uint32 type, uint32 data) override
 
uint32 GetData (uint32 type) const override
 
ObjectGuid GetGuidData (uint32 identifier) const override
 
void Update (uint32 diff) override
 
void UpdateEventState ()
 
void ChromieWhisper (uint8 textId)
 
void Reposition (Creature *arthas)
 
void EnsureGridLoaded ()
 
std::string GetSaveData () override
 
void Load (const char *in) 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 Attributes

ObjectGuid _arthasGUID
 
ObjectGuid _infiniteGUID
 
ObjectGuid _shkafGateGUID
 
ObjectGuid _exitGateGUID
 
uint32 _encounterState
 
uint32 _crateCount
 
uint32 _showCrateTimer
 
uint32 _guardianTimer
 
bool _respawnAndReposition
 
uint32 _loadTimer
 

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_culling_of_stratholme_InstanceMapScript()

instance_culling_of_stratholme::instance_culling_of_stratholme_InstanceMapScript::instance_culling_of_stratholme_InstanceMapScript ( Map pMap)
inline
39 : InstanceScript(pMap)
40 {
41 // Instance
43 _crateCount = 0;
48 _loadTimer = 0;
49 }
#define DataHeader
Definition: blackrock_depths.h:23
@ COS_PROGRESS_NOT_STARTED
Definition: culling_of_stratholme.h:125
Definition: InstanceScript.h:142
void SetHeaders(std::string const &dataHeaders)
Definition: InstanceScript.cpp:138
uint32 _encounterState
Definition: instance_culling_of_stratholme.cpp:414
uint32 _crateCount
Definition: instance_culling_of_stratholme.cpp:415
uint32 _loadTimer
Definition: instance_culling_of_stratholme.cpp:420
uint32 _guardianTimer
Definition: instance_culling_of_stratholme.cpp:417
uint32 _showCrateTimer
Definition: instance_culling_of_stratholme.cpp:416
bool _respawnAndReposition
Definition: instance_culling_of_stratholme.cpp:419

References _crateCount, _encounterState, _guardianTimer, _loadTimer, _respawnAndReposition, _showCrateTimer, COS_PROGRESS_NOT_STARTED, DataHeader, and InstanceScript::SetHeaders().

Member Function Documentation

◆ ChromieWhisper()

void instance_culling_of_stratholme::instance_culling_of_stratholme_InstanceMapScript::ChromieWhisper ( uint8  textId)
inline
302 {
303 if (!instance->GetPlayers().IsEmpty())
304 if (Player* player = instance->GetPlayers().getFirst()->GetSource())
305 {
306 Position pos = player->GetPosition();
308 {
309 cr->SetVisible(false);
310 cr->DespawnOrUnsummon(1000);
311 sCreatureTextMgr->SendChat(cr, textId, player, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_MAP);
312 }
313 }
314 }
#define sCreatureTextMgr
Definition: CreatureTextMgr.h:119
@ TEXT_RANGE_MAP
Definition: CreatureTextMgr.h:33
@ NPC_CHROMIE_MIDDLE
Definition: culling_of_stratholme.h:61
@ CHAT_MSG_ADDON
Definition: SharedDefines.h:3151
@ LANG_ADDON
Definition: SharedDefines.h:753
bool IsEmpty() const
Definition: LinkedList.h:97
FROM * GetSource() const
Definition: Reference.h:97
Definition: Creature.h:46
Definition: Position.h:28
void GetPosition(float &x, float &y) const
Definition: Position.h:122
Definition: Player.h:1064
Map * instance
Definition: InstanceScript.h:148
PlayerList const & GetPlayers() const
Definition: Map.h:486
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
MapReference * getFirst()
Definition: MapRefMgr.h:31

References CHAT_MSG_ADDON, MapRefMgr::getFirst(), Map::GetPlayers(), Position::GetPosition(), Reference< TO, FROM >::GetSource(), InstanceScript::instance, LinkedListHead::IsEmpty(), LANG_ADDON, NPC_CHROMIE_MIDDLE, sCreatureTextMgr, Map::SummonCreature(), and TEXT_RANGE_MAP.

Referenced by Update(), and UpdateEventState().

◆ EnsureGridLoaded()

void instance_culling_of_stratholme::instance_culling_of_stratholme_InstanceMapScript::EnsureGridLoaded ( )
inline
356 {
363 }
const Position LeaderIntroPos6
Definition: culling_of_stratholme.h:158
const Position LeaderIntroPos5
Definition: culling_of_stratholme.h:157
const Position LeaderIntroPos2
Definition: culling_of_stratholme.h:153
const Position LeaderIntroPos3
Definition: culling_of_stratholme.h:155
const Position LeaderIntroPos4
Definition: culling_of_stratholme.h:156
const Position LeaderIntroPos1
Definition: culling_of_stratholme.h:152
float GetPositionX() const
Definition: Position.h:117
float GetPositionY() const
Definition: Position.h:118
void LoadGrid(float x, float y)
Definition: Map.cpp:492

References Position::GetPositionX(), Position::GetPositionY(), InstanceScript::instance, LeaderIntroPos1, LeaderIntroPos2, LeaderIntroPos3, LeaderIntroPos4, LeaderIntroPos5, LeaderIntroPos6, and Map::LoadGrid().

Referenced by OnPlayerEnter(), and Update().

◆ FillInitialWorldStates()

void instance_culling_of_stratholme::instance_culling_of_stratholme_InstanceMapScript::FillInitialWorldStates ( WorldPacket data)
inlineoverridevirtual

Reimplemented from InstanceScript.

57 {
60 data << uint32(WORLDSTATE_WAVE_COUNT) << uint32(0);
63 }
std::uint32_t uint32
Definition: Define.h:107
@ WORLDSTATE_SHOW_CRATES
Definition: culling_of_stratholme.h:78
@ WORLDSTATE_WAVE_COUNT
Definition: culling_of_stratholme.h:80
@ WORLDSTATE_CRATES_REVEALED
Definition: culling_of_stratholme.h:79
@ WORLDSTATE_TIME_GUARDIAN
Definition: culling_of_stratholme.h:81
@ WORLDSTATE_TIME_GUARDIAN_SHOW
Definition: culling_of_stratholme.h:82

References _crateCount, WORLDSTATE_CRATES_REVEALED, WORLDSTATE_SHOW_CRATES, WORLDSTATE_TIME_GUARDIAN, WORLDSTATE_TIME_GUARDIAN_SHOW, and WORLDSTATE_WAVE_COUNT.

◆ GetData()

uint32 instance_culling_of_stratholme::instance_culling_of_stratholme_InstanceMapScript::GetData ( uint32  type) const
inlineoverridevirtual

Reimplemented from ZoneScript.

183 {
184 switch (type)
185 {
187 return _encounterState;
189 return _guardianTimer;
190 }
191 return 0;
192 }
@ DATA_GUARDIANTIME_EVENT
Definition: culling_of_stratholme.h:29
@ DATA_ARTHAS_EVENT
Definition: culling_of_stratholme.h:28

References _encounterState, _guardianTimer, DATA_ARTHAS_EVENT, and DATA_GUARDIANTIME_EVENT.

Referenced by Reposition(), and SetData().

◆ GetGuidData()

ObjectGuid instance_culling_of_stratholme::instance_culling_of_stratholme_InstanceMapScript::GetGuidData ( uint32  identifier) const
inlineoverridevirtual

Reimplemented from InstanceScript.

195 {
196 switch (identifier)
197 {
198 case DATA_SHKAF_GATE:
199 return _shkafGateGUID;
200 case DATA_ARTHAS:
201 return _arthasGUID;
202 case DATA_EXIT_GATE:
203 return _exitGateGUID;
204 }
205
206 return ObjectGuid::Empty;
207 }
@ DATA_SHKAF_GATE
Definition: culling_of_stratholme.h:43
@ DATA_EXIT_GATE
Definition: culling_of_stratholme.h:44
@ DATA_ARTHAS
Definition: culling_of_stratholme.h:41
static ObjectGuid const Empty
Definition: ObjectGuid.h:120
ObjectGuid _arthasGUID
Definition: instance_culling_of_stratholme.cpp:408
ObjectGuid _shkafGateGUID
Definition: instance_culling_of_stratholme.cpp:412
ObjectGuid _exitGateGUID
Definition: instance_culling_of_stratholme.cpp:413

References _arthasGUID, _exitGateGUID, _shkafGateGUID, DATA_ARTHAS, DATA_EXIT_GATE, DATA_SHKAF_GATE, and ObjectGuid::Empty.

◆ GetSaveData()

std::string instance_culling_of_stratholme::instance_culling_of_stratholme_InstanceMapScript::GetSaveData ( )
inlineoverridevirtual

Reimplemented from InstanceScript.

366 {
368
369 std::ostringstream saveStream;
370 saveStream << "C S " << _encounterState << ' ' << _guardianTimer;
371
373 return saveStream.str();
374 }
#define OUT_SAVE_INST_DATA_COMPLETE
Definition: InstanceScript.h:29
#define OUT_SAVE_INST_DATA
Definition: InstanceScript.h:28

References _encounterState, _guardianTimer, OUT_SAVE_INST_DATA, and OUT_SAVE_INST_DATA_COMPLETE.

◆ IsEncounterInProgress()

bool instance_culling_of_stratholme::instance_culling_of_stratholme_InstanceMapScript::IsEncounterInProgress ( ) const
inlineoverridevirtual

Reimplemented from InstanceScript.

52 {
53 return false;
54 }

◆ Load()

void instance_culling_of_stratholme::instance_culling_of_stratholme_InstanceMapScript::Load ( const char *  in)
inlineoverridevirtual

Reimplemented from InstanceScript.

377 {
378 if (!in)
379 {
381 return;
382 }
383
385
386 char dataHead1, dataHead2;
387 uint32 data0, data1;
388
389 std::istringstream loadStream(in);
390 loadStream >> dataHead1 >> dataHead2 >> data0 >> data1;
391
392 if (dataHead1 == 'C' && dataHead2 == 'S')
393 {
394 _encounterState = data0;
395 _guardianTimer = data1;
396
397 //UpdateEventState();
398 _loadTimer++;
399 }
400 else
402
404 }
#define OUT_LOAD_INST_DATA_FAIL
Definition: InstanceScript.h:32
#define OUT_LOAD_INST_DATA_COMPLETE
Definition: InstanceScript.h:31
#define OUT_LOAD_INST_DATA(a)
Definition: InstanceScript.h:30

References _encounterState, _guardianTimer, _loadTimer, OUT_LOAD_INST_DATA, OUT_LOAD_INST_DATA_COMPLETE, and OUT_LOAD_INST_DATA_FAIL.

◆ OnCreatureCreate()

void instance_culling_of_stratholme::instance_culling_of_stratholme_InstanceMapScript::OnCreatureCreate ( Creature creature)
inlineoverridevirtual

Reimplemented from InstanceScript.

77 {
78 switch (creature->GetEntry())
79 {
80 case NPC_ARTHAS:
81 _arthasGUID = creature->GetGUID();
83 creature->SetVisible(false);
84 else
85 Reposition(creature);
86 break;
87 case NPC_INFINITE:
88 _infiniteGUID = creature->GetGUID();
89 break;
90 }
91 }
@ NPC_ARTHAS
Definition: culling_of_stratholme.h:54
@ NPC_INFINITE
Definition: culling_of_stratholme.h:53
@ COS_PROGRESS_FINISHED
Definition: culling_of_stratholme.h:136
uint32 GetEntry() const
Definition: Object.h:112
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:109
void SetVisible(bool x)
Definition: Unit.cpp:14189
void Reposition(Creature *arthas)
Definition: instance_culling_of_stratholme.cpp:316
ObjectGuid _infiniteGUID
Definition: instance_culling_of_stratholme.cpp:409

References _arthasGUID, _encounterState, _infiniteGUID, COS_PROGRESS_FINISHED, Object::GetEntry(), Object::GetGUID(), NPC_ARTHAS, NPC_INFINITE, Reposition(), and Unit::SetVisible().

◆ OnGameObjectCreate()

void instance_culling_of_stratholme::instance_culling_of_stratholme_InstanceMapScript::OnGameObjectCreate ( GameObject go)
inlineoverridevirtual

Reimplemented from InstanceScript.

94 {
95 switch (go->GetEntry())
96 {
97 case GO_SHKAF_GATE:
98 _shkafGateGUID = go->GetGUID();
101 break;
102 case GO_EXIT_GATE:
103 _exitGateGUID = go->GetGUID();
106 break;
107 }
108 }
@ GO_STATE_ACTIVE
Definition: GameObjectData.h:690
@ GO_EXIT_GATE
Definition: stratholme.h:74
@ GO_SHKAF_GATE
Definition: culling_of_stratholme.h:68
@ COS_PROGRESS_KILLED_EPOCH
Definition: culling_of_stratholme.h:133
void SetGoState(GOState state)
Definition: GameObject.cpp:2477

References _encounterState, _exitGateGUID, _shkafGateGUID, COS_PROGRESS_FINISHED, COS_PROGRESS_KILLED_EPOCH, Object::GetEntry(), Object::GetGUID(), GO_EXIT_GATE, GO_SHKAF_GATE, GO_STATE_ACTIVE, and GameObject::SetGoState().

◆ OnPlayerEnter()

void instance_culling_of_stratholme::instance_culling_of_stratholme_InstanceMapScript::OnPlayerEnter ( Player plr)
inlineoverridevirtual

Reimplemented from InstanceScript.

66 {
69
71
72 if (plr->getRace() != RACE_HUMAN && plr->getRace() != RACE_DWARF && plr->getRace() != RACE_GNOME)
73 plr->CastSpell(plr, ((plr->getGender() == GENDER_MALE) ? SPELL_HUMAN_MALE : SPELL_HUMAN_FEMALE), true);
74 }
@ SPELL_HUMAN_MALE
Definition: culling_of_stratholme.h:91
@ SPELL_HUMAN_FEMALE
Definition: culling_of_stratholme.h:90
@ DATA_ARTHAS_REPOSITION
Definition: culling_of_stratholme.h:36
@ GENDER_MALE
Definition: SharedDefines.h:61
@ RACE_DWARF
Definition: SharedDefines.h:73
@ RACE_GNOME
Definition: SharedDefines.h:77
@ RACE_HUMAN
Definition: SharedDefines.h:71
uint8 getGender() const
Definition: Unit.h:752
uint8 getRace(bool original=false) const
Definition: Unit.cpp:20962
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:1168
uint32 GetPlayersCountExceptGMs() const
Definition: Map.cpp:2745
void SetData(uint32 type, uint32 data) override
Definition: instance_culling_of_stratholme.cpp:110
void EnsureGridLoaded()
Definition: instance_culling_of_stratholme.cpp:355

References Unit::CastSpell(), DATA_ARTHAS_REPOSITION, EnsureGridLoaded(), GENDER_MALE, Unit::getGender(), Map::GetPlayersCountExceptGMs(), Unit::getRace(), InstanceScript::instance, RACE_DWARF, RACE_GNOME, RACE_HUMAN, SetData(), SPELL_HUMAN_FEMALE, and SPELL_HUMAN_MALE.

◆ Reposition()

void instance_culling_of_stratholme::instance_culling_of_stratholme_InstanceMapScript::Reposition ( Creature arthas)
inline
317 {
318 switch (GetData(DATA_ARTHAS_EVENT))
319 {
321 arthas->UpdatePosition(LeaderIntroPos2, true);
324 break;
331 break;
333 arthas->UpdatePosition(LeaderIntroPos3, true);
336 break;
338 arthas->UpdatePosition(LeaderIntroPos4, true);
341 break;
343 arthas->UpdatePosition(LeaderIntroPos5, true);
346 break;
348 arthas->UpdatePosition(LeaderIntroPos6, true);
351 break;
352 }
353 }
@ COS_PROGRESS_REACHED_TOWN_HALL
Definition: culling_of_stratholme.h:132
@ COS_PROGRESS_LAST_CITY
Definition: culling_of_stratholme.h:134
@ COS_PROGRESS_KILLED_MEATHOOK
Definition: culling_of_stratholme.h:130
@ COS_PROGRESS_FINISHED_CITY_INTRO
Definition: culling_of_stratholme.h:129
@ COS_PROGRESS_FINISHED_INTRO
Definition: culling_of_stratholme.h:128
@ COS_PROGRESS_KILLED_SALRAMM
Definition: culling_of_stratholme.h:131
@ COS_PROGRESS_BEFORE_MALGANIS
Definition: culling_of_stratholme.h:135
const Position LeaderIntroPos2special
Definition: culling_of_stratholme.h:154
void SetHomePosition(float x, float y, float z, float o)
Definition: Creature.h:337
float GetOrientation() const
Definition: Position.h:120
void SetFacingTo(float ori)
Definition: Unit.cpp:20483
virtual bool UpdatePosition(float x, float y, float z, float ang, bool teleport=false)
Definition: Unit.cpp:19983
uint32 GetData(uint32 type) const override
Definition: instance_culling_of_stratholme.cpp:182

References COS_PROGRESS_BEFORE_MALGANIS, COS_PROGRESS_FINISHED_CITY_INTRO, COS_PROGRESS_FINISHED_INTRO, COS_PROGRESS_KILLED_EPOCH, COS_PROGRESS_KILLED_MEATHOOK, COS_PROGRESS_KILLED_SALRAMM, COS_PROGRESS_LAST_CITY, COS_PROGRESS_REACHED_TOWN_HALL, DATA_ARTHAS_EVENT, GetData(), Position::GetOrientation(), LeaderIntroPos2, LeaderIntroPos2special, LeaderIntroPos3, LeaderIntroPos4, LeaderIntroPos5, LeaderIntroPos6, Unit::SetFacingTo(), Creature::SetHomePosition(), and Unit::UpdatePosition().

Referenced by OnCreatureCreate(), and SetData().

◆ SetData()

void instance_culling_of_stratholme::instance_culling_of_stratholme_InstanceMapScript::SetData ( uint32  type,
uint32  data 
)
inlineoverridevirtual

Reimplemented from ZoneScript.

111 {
112 switch (type)
113 {
114 case DATA_SHOW_CRATES:
116 return;
118 if (!instance->IsHeroic() || !_guardianTimer)
119 return;
122 if (data == 0)
123 {
124 _guardianTimer = 0;
125 SaveToDB();
126 }
127 else if (!_infiniteGUID)
129 return;
130 case DATA_START_WAVES:
132 if (instance->IsHeroic())
133 {
136 if (!_infiniteGUID)
138 }
139 return;
140 case DATA_CRATE_COUNT:
141 _crateCount++;
142 if (_crateCount == 5)
143 {
144 Map::PlayerList const& PlayerList = instance->GetPlayers();
145 if (!PlayerList.IsEmpty())
146 for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
147 i->GetSource()->KilledMonsterCredit(NPC_GRAIN_CREATE_TRIGGER);
148
152 }
153
155 return;
157 // Start Event
158 _encounterState = data;
159 if (data == COS_PROGRESS_START_INTRO)
160 {
162 arthas->AI()->DoAction(ACTION_START_EVENT);
163 }
164 else if (data == COS_PROGRESS_KILLED_SALRAMM)
165 {
167 arthas->AI()->DoAction(ACTION_KILLED_SALRAMM);
168 }
169 break;
171 if (data == 2)
173 else if (Creature* arthas = instance->GetCreature(_arthasGUID))
174 Reposition(arthas);
175 return;
176 }
177
178 if (type == DATA_ARTHAS_EVENT)
179 SaveToDB();
180 }
constexpr auto IN_MILLISECONDS
Definition: Common.h:53
constexpr auto MINUTE
Definition: Common.h:47
@ ACTION_START_EVENT
Definition: chapter5.cpp:193
@ ACTION_KILLED_SALRAMM
Definition: culling_of_stratholme.h:143
@ NPC_GRAIN_CREATE_TRIGGER
Definition: culling_of_stratholme.h:62
@ COS_PROGRESS_CRATES_FOUND
Definition: culling_of_stratholme.h:126
@ COS_PROGRESS_START_INTRO
Definition: culling_of_stratholme.h:127
@ EVENT_SRC_CORRUPTOR
Definition: culling_of_stratholme.h:119
const Position EventPos[]
Definition: culling_of_stratholme.h:160
@ DATA_SHOW_INFINITE_TIMER
Definition: culling_of_stratholme.h:35
@ DATA_START_WAVES
Definition: culling_of_stratholme.h:34
@ DATA_CRATE_COUNT
Definition: culling_of_stratholme.h:33
@ DATA_SHOW_CRATES
Definition: culling_of_stratholme.h:32
Definition: LinkedList.h:139
void SaveToDB()
Definition: InstanceScript.cpp:41
void DoUpdateWorldState(uint32 worldstateId, uint32 worldstateValue)
Definition: InstanceScript.cpp:577
Creature * GetCreature(ObjectGuid const guid)
Definition: Map.cpp:3314
bool IsHeroic() const
Definition: Map.h:452
Definition: MapRefMgr.h:26
iterator begin()
Definition: MapRefMgr.h:36
iterator end()
Definition: MapRefMgr.h:37

References _arthasGUID, _crateCount, _encounterState, _guardianTimer, _infiniteGUID, _respawnAndReposition, _showCrateTimer, ACTION_KILLED_SALRAMM, ACTION_START_EVENT, MapRefMgr::begin(), COS_PROGRESS_CRATES_FOUND, COS_PROGRESS_KILLED_SALRAMM, COS_PROGRESS_START_INTRO, DATA_ARTHAS_EVENT, DATA_ARTHAS_REPOSITION, DATA_CRATE_COUNT, DATA_SHOW_CRATES, DATA_SHOW_INFINITE_TIMER, DATA_START_WAVES, InstanceScript::DoUpdateWorldState(), MapRefMgr::end(), EVENT_SRC_CORRUPTOR, EventPos, Map::GetCreature(), GetData(), Map::GetPlayers(), IN_MILLISECONDS, InstanceScript::instance, LinkedListHead::IsEmpty(), Map::IsHeroic(), MINUTE, NPC_GRAIN_CREATE_TRIGGER, NPC_INFINITE, Reposition(), InstanceScript::SaveToDB(), SetData(), Map::SummonCreature(), WORLDSTATE_CRATES_REVEALED, WORLDSTATE_SHOW_CRATES, WORLDSTATE_TIME_GUARDIAN, WORLDSTATE_TIME_GUARDIAN_SHOW, and WORLDSTATE_WAVE_COUNT.

Referenced by OnPlayerEnter(), and SetData().

◆ Update()

void instance_culling_of_stratholme::instance_culling_of_stratholme_InstanceMapScript::Update ( uint32  diff)
inlineoverridevirtual

Reimplemented from InstanceScript.

210 {
211 if (_loadTimer)
212 {
213 _loadTimer += diff;
214 if (_loadTimer > 3000)
215 {
217 _loadTimer = 0;
218 }
219 }
220 // Used when arthas dies
222 {
224 {
225 if (!arthas->IsAlive())
226 {
228 arthas->setDeathState(DeathState::Dead);
229 arthas->Respawn();
230 }
231 else
232 {
233 arthas->AI()->Reset();
234 _respawnAndReposition = false;
235 }
236 }
237 }
238
239 // Used after 5-th crates is revealed
240 if (_showCrateTimer)
241 {
242 _showCrateTimer += diff;
243 if (_showCrateTimer >= 20000)
244 {
246 _showCrateTimer = 0; // just to be sure
247 }
248 }
249
250 // Used to display how much time players have
251 if (_guardianTimer)
252 {
254 _guardianTimer -= diff;
256
257 if (divAfter == 0)
258 {
259 _guardianTimer = 0;
261
262 // Inform infinite we run out of time
265 cr->AI()->DoAction(ACTION_RUN_OUT_OF_TIME);
266 }
267 else if (div > divAfter)
268 {
269 if (divAfter == 5)
271 else if (divAfter == 1)
273
275 SaveToDB();
276 }
277 }
278 }
@ ACTION_RUN_OUT_OF_TIME
Definition: culling_of_stratholme.h:147
void ChromieWhisper(uint8 textId)
Definition: instance_culling_of_stratholme.cpp:301
void UpdateEventState()
Definition: instance_culling_of_stratholme.cpp:280

References _arthasGUID, _guardianTimer, _infiniteGUID, _loadTimer, _respawnAndReposition, _showCrateTimer, ACTION_RUN_OUT_OF_TIME, ChromieWhisper(), InstanceScript::DoUpdateWorldState(), EnsureGridLoaded(), Map::GetCreature(), IN_MILLISECONDS, InstanceScript::instance, Map::IsHeroic(), MINUTE, InstanceScript::SaveToDB(), UpdateEventState(), WORLDSTATE_TIME_GUARDIAN, and WORLDSTATE_TIME_GUARDIAN_SHOW.

◆ UpdateEventState()

void instance_culling_of_stratholme::instance_culling_of_stratholme_InstanceMapScript::UpdateEventState ( )
inline

Member Data Documentation

◆ _arthasGUID

ObjectGuid instance_culling_of_stratholme::instance_culling_of_stratholme_InstanceMapScript::_arthasGUID
private

◆ _crateCount

uint32 instance_culling_of_stratholme::instance_culling_of_stratholme_InstanceMapScript::_crateCount
private

◆ _encounterState

uint32 instance_culling_of_stratholme::instance_culling_of_stratholme_InstanceMapScript::_encounterState
private

◆ _exitGateGUID

ObjectGuid instance_culling_of_stratholme::instance_culling_of_stratholme_InstanceMapScript::_exitGateGUID
private

Referenced by GetGuidData(), and OnGameObjectCreate().

◆ _guardianTimer

uint32 instance_culling_of_stratholme::instance_culling_of_stratholme_InstanceMapScript::_guardianTimer
private

◆ _infiniteGUID

ObjectGuid instance_culling_of_stratholme::instance_culling_of_stratholme_InstanceMapScript::_infiniteGUID
private

Referenced by OnCreatureCreate(), SetData(), and Update().

◆ _loadTimer

uint32 instance_culling_of_stratholme::instance_culling_of_stratholme_InstanceMapScript::_loadTimer
private

◆ _respawnAndReposition

bool instance_culling_of_stratholme::instance_culling_of_stratholme_InstanceMapScript::_respawnAndReposition
private

◆ _shkafGateGUID

ObjectGuid instance_culling_of_stratholme::instance_culling_of_stratholme_InstanceMapScript::_shkafGateGUID
private

Referenced by GetGuidData(), and OnGameObjectCreate().

◆ _showCrateTimer

uint32 instance_culling_of_stratholme::instance_culling_of_stratholme_InstanceMapScript::_showCrateTimer
private