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

Public Member Functions

 instance_old_hillsbrad_InstanceMapScript (Map *map)
 
void Initialize () override
 
void OnPlayerEnter (Player *player) override
 
void CleanupInstance ()
 
void OnCreatureCreate (Creature *creature) override
 
void OnGameObjectCreate (GameObject *gameobject) override
 
void SetData (uint32 type, uint32 data) override
 
uint32 GetData (uint32 data) const override
 
ObjectGuid GetGuidData (uint32 data) const override
 
void Update (uint32 diff) override
 
void Reposition (Creature *thrall)
 
void EnsureGridLoaded ()
 
void ReadSaveDataMore (std::istringstream &data) override
 
void WriteSaveDataMore (std::ostringstream &data) 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

uint32 _encounterProgress
 
uint32 _barrelCount
 
uint32 _attemptsCount
 
ObjectGuid _thrallGUID
 
ObjectGuid _tarethaGUID
 
GuidSet _initalFlamesSet
 
GuidSet _finalFlamesSet
 
GuidSet _prisonersSet
 
EventMap _events
 

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 LoadSummonData (ObjectData const *data)
 
void SetSummoner (Creature *creature)
 
void AddObject (Creature *obj, bool add=true)
 
void RemoveObject (Creature *obj)
 
void AddObject (GameObject *obj, bool add=true)
 
void RemoveObject (GameObject *obj)
 
void AddObject (WorldObject *obj, uint32 type, bool add=true)
 
void RemoveObject (WorldObject *obj, uint32 type)
 
void AddDoor (GameObject *door, bool add=true)
 
void RemoveDoor (GameObject *door)
 
void AddMinion (Creature *minion, bool add=true)
 
void RemoveMinion (Creature *minion)
 
void UpdateDoorState (GameObject *door)
 
void UpdateMinionState (Creature *minion, EncounterState state)
 
bool ReadSaveDataHeaders (std::istringstream &data)
 
void ReadSaveDataBossStates (std::istringstream &data)
 
void ReadSavePersistentData (std::istringstream &data)
 
virtual void ReadSaveDataMore (std::istringstream &)
 
void WriteSaveDataHeaders (std::ostringstream &data)
 
void WriteSaveDataBossStates (std::ostringstream &data)
 
void WritePersistentData (std::ostringstream &data)
 
virtual void WriteSaveDataMore (std::ostringstream &)
 

Detailed Description

Constructor & Destructor Documentation

◆ instance_old_hillsbrad_InstanceMapScript()

instance_old_hillsbrad::instance_old_hillsbrad_InstanceMapScript::instance_old_hillsbrad_InstanceMapScript ( Map map)
inline
52: InstanceScript(map) { }
Definition: InstanceScript.h:142

Member Function Documentation

◆ CleanupInstance()

void instance_old_hillsbrad::instance_old_hillsbrad_InstanceMapScript::CleanupInstance ( )
inline
79 {
81 return;
82
85
88 else
90 }
@ DATA_THRALL_REPOSITION
Definition: old_hillsbrad.h:35
@ EVENT_INITIAL_BARRELS_FLAME
Definition: old_hillsbrad.h:86
@ EVENT_SUMMON_LIEUTENANT
Definition: old_hillsbrad.h:88
@ ENCOUNTER_PROGRESS_BARRELS
Definition: old_hillsbrad.h:76
@ EVENT_FINAL_BARRELS_FLAME
Definition: old_hillsbrad.h:87
@ ENCOUNTER_PROGRESS_NONE
Definition: old_hillsbrad.h:75
void ScheduleEvent(uint32 eventId, uint32 time, uint32 group=0, uint32 phase=0)
Definition: EventMap.cpp:56
void SetData(uint32 type, uint32 data) override
Definition: instance_old_hillsbrad.cpp:136
uint32 _encounterProgress
Definition: instance_old_hillsbrad.cpp:314
EventMap _events
Definition: instance_old_hillsbrad.cpp:324

References _encounterProgress, _events, DATA_THRALL_REPOSITION, ENCOUNTER_PROGRESS_BARRELS, ENCOUNTER_PROGRESS_NONE, EVENT_FINAL_BARRELS_FLAME, EVENT_INITIAL_BARRELS_FLAME, EVENT_SUMMON_LIEUTENANT, EventMap::ScheduleEvent(), and SetData().

Referenced by OnPlayerEnter().

◆ EnsureGridLoaded()

void instance_old_hillsbrad::instance_old_hillsbrad_InstanceMapScript::EnsureGridLoaded ( )
inline
297 {
298 for (uint8 i = 0; i < THRALL_POSITIONS_COUNT; ++i)
300 }
std::uint8_t uint8
Definition: Define.h:109
const Position thrallPositions[THRALL_POSITIONS_COUNT]
Definition: instance_old_hillsbrad.cpp:31
@ THRALL_POSITIONS_COUNT
Definition: old_hillsbrad.h:92
float GetPositionX() const
Definition: Position.h:116
float GetPositionY() const
Definition: Position.h:117
Map * instance
Definition: InstanceScript.h:148
void LoadGrid(float x, float y)
Definition: Map.cpp:495

References Position::GetPositionX(), Position::GetPositionY(), InstanceScript::instance, Map::LoadGrid(), THRALL_POSITIONS_COUNT, and thrallPositions.

Referenced by OnPlayerEnter(), and Update().

◆ GetData()

uint32 instance_old_hillsbrad::instance_old_hillsbrad_InstanceMapScript::GetData ( uint32  data) const
inlineoverridevirtual

Reimplemented from ZoneScript.

175 {
176 if (data == DATA_ESCORT_PROGRESS)
177 return _encounterProgress;
178 else if (data == DATA_ATTEMPTS_COUNT)
179 return _attemptsCount;
180 return 0;
181 }
@ DATA_ESCORT_PROGRESS
Definition: old_hillsbrad.h:29
@ DATA_ATTEMPTS_COUNT
Definition: old_hillsbrad.h:39
uint32 _attemptsCount
Definition: instance_old_hillsbrad.cpp:316

References _attemptsCount, _encounterProgress, DATA_ATTEMPTS_COUNT, and DATA_ESCORT_PROGRESS.

Referenced by Reposition().

◆ GetGuidData()

ObjectGuid instance_old_hillsbrad::instance_old_hillsbrad_InstanceMapScript::GetGuidData ( uint32  data) const
inlineoverridevirtual

Reimplemented from InstanceScript.

184 {
185 if (data == DATA_THRALL_GUID)
186 return _thrallGUID;
187 else if (data == DATA_TARETHA_GUID)
188 return _tarethaGUID;
189
190 return ObjectGuid::Empty;
191 }
@ DATA_TARETHA_GUID
Definition: old_hillsbrad.h:38
@ DATA_THRALL_GUID
Definition: old_hillsbrad.h:37
static ObjectGuid const Empty
Definition: ObjectGuid.h:120
ObjectGuid _tarethaGUID
Definition: instance_old_hillsbrad.cpp:319
ObjectGuid _thrallGUID
Definition: instance_old_hillsbrad.cpp:318

References _tarethaGUID, _thrallGUID, DATA_TARETHA_GUID, DATA_THRALL_GUID, and ObjectGuid::Empty.

◆ Initialize()

void instance_old_hillsbrad::instance_old_hillsbrad_InstanceMapScript::Initialize ( )
inlineoverridevirtual

Reimplemented from InstanceScript.

55 {
58 _barrelCount = 0;
60
61 _initalFlamesSet.clear();
62 _finalFlamesSet.clear();
63 _prisonersSet.clear();
64 _events.Reset();
65 }
#define DataHeader
Definition: blackrock_depths.h:23
void Reset()
Definition: EventMap.cpp:21
void SetHeaders(std::string const &dataHeaders)
Definition: InstanceScript.cpp:141
GuidSet _initalFlamesSet
Definition: instance_old_hillsbrad.cpp:320
GuidSet _prisonersSet
Definition: instance_old_hillsbrad.cpp:322
GuidSet _finalFlamesSet
Definition: instance_old_hillsbrad.cpp:321
uint32 _barrelCount
Definition: instance_old_hillsbrad.cpp:315

References _attemptsCount, _barrelCount, _encounterProgress, _events, _finalFlamesSet, _initalFlamesSet, _prisonersSet, DataHeader, EventMap::Reset(), and InstanceScript::SetHeaders().

◆ OnCreatureCreate()

void instance_old_hillsbrad::instance_old_hillsbrad_InstanceMapScript::OnCreatureCreate ( Creature creature)
inlineoverridevirtual

Reimplemented from InstanceScript.

93 {
94 switch (creature->GetEntry())
95 {
96 case NPC_THRALL:
97 _thrallGUID = creature->GetGUID();
99 creature->SetVisible(false);
100 else
101 Reposition(creature);
102 break;
103 case NPC_ORC_PRISONER:
104 _prisonersSet.insert(creature->GetGUID());
105 break;
106 case NPC_TARETHA:
108 creature->SetVisible(false);
109 _tarethaGUID = creature->GetGUID();
110 break;
111 }
112 }
@ ENCOUNTER_PROGRESS_FINISHED
Definition: old_hillsbrad.h:84
@ NPC_ORC_PRISONER
Definition: old_hillsbrad.h:51
@ NPC_TARETHA
Definition: old_hillsbrad.h:46
@ NPC_THRALL
Definition: zone_undercity.cpp:447
uint32 GetEntry() const
Definition: Object.h:115
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:112
void SetVisible(bool x)
Definition: Unit.cpp:14232
void Reposition(Creature *thrall)
Definition: instance_old_hillsbrad.cpp:280

References _encounterProgress, _prisonersSet, _tarethaGUID, _thrallGUID, ENCOUNTER_PROGRESS_FINISHED, Object::GetEntry(), Object::GetGUID(), NPC_ORC_PRISONER, NPC_TARETHA, NPC_THRALL, Reposition(), and Unit::SetVisible().

◆ OnGameObjectCreate()

void instance_old_hillsbrad::instance_old_hillsbrad_InstanceMapScript::OnGameObjectCreate ( GameObject gameobject)
inlineoverridevirtual

Reimplemented from InstanceScript.

115 {
116 switch (gameobject->GetEntry())
117 {
118 case GO_BARREL:
121 break;
122 case GO_PRISON_DOOR:
124 gameobject->SetGoState(GO_STATE_ACTIVE);
125 break;
126 case GO_ROARING_FLAME:
127 // Xinef: hack in DB to distinguish final / initial flames
128 if (gameobject->GetPhaseMask() & 0x2)
129 _finalFlamesSet.insert(gameobject->GetGUID());
130 else
131 _initalFlamesSet.insert(gameobject->GetGUID());
132 break;
133 }
134 }
@ ENCOUNTER_PROGRESS_THRALL_ARMORED
Definition: old_hillsbrad.h:78
@ GO_PRISON_DOOR
Definition: old_hillsbrad.h:67
@ GO_BARREL
Definition: old_hillsbrad.h:65
@ GO_ROARING_FLAME
Definition: old_hillsbrad.h:66
@ GO_FLAG_NOT_SELECTABLE
Definition: SharedDefines.h:1607
@ GO_STATE_ACTIVE
Definition: GameObjectData.h:689
void SetGoState(GOState state)
Definition: GameObject.cpp:2479
void SetGameObjectFlag(GameObjectFlags flags)
Definition: GameObject.h:218
uint32 GetPhaseMask() const
Definition: Object.h:451

References _encounterProgress, _finalFlamesSet, _initalFlamesSet, ENCOUNTER_PROGRESS_BARRELS, ENCOUNTER_PROGRESS_THRALL_ARMORED, Object::GetEntry(), Object::GetGUID(), WorldObject::GetPhaseMask(), GO_BARREL, GO_FLAG_NOT_SELECTABLE, GO_PRISON_DOOR, GO_ROARING_FLAME, GO_STATE_ACTIVE, GameObject::SetGameObjectFlag(), and GameObject::SetGoState().

◆ OnPlayerEnter()

void instance_old_hillsbrad::instance_old_hillsbrad_InstanceMapScript::OnPlayerEnter ( Player player)
inlineoverridevirtual

Reimplemented from InstanceScript.

68 {
71
73
76 }
@ WORLD_STATE_BARRELS_PLANTED
Definition: old_hillsbrad.h:72
void SendUpdateWorldState(uint32 variable, uint32 value) const
Definition: PlayerUpdates.cpp:2197
uint32 GetPlayersCountExceptGMs() const
Definition: Map.cpp:2748
void CleanupInstance()
Definition: instance_old_hillsbrad.cpp:78
void EnsureGridLoaded()
Definition: instance_old_hillsbrad.cpp:296

References _barrelCount, _encounterProgress, CleanupInstance(), ENCOUNTER_PROGRESS_BARRELS, EnsureGridLoaded(), Map::GetPlayersCountExceptGMs(), InstanceScript::instance, Player::SendUpdateWorldState(), and WORLD_STATE_BARRELS_PLANTED.

◆ ReadSaveDataMore()

void instance_old_hillsbrad::instance_old_hillsbrad_InstanceMapScript::ReadSaveDataMore ( std::istringstream &  data)
inlineoverridevirtual

Reimplemented from InstanceScript.

303 {
304 data >> _encounterProgress;
305 data >> _attemptsCount;
306 }

References _attemptsCount, and _encounterProgress.

◆ Reposition()

void instance_old_hillsbrad::instance_old_hillsbrad_InstanceMapScript::Reposition ( Creature thrall)
inline
281 {
282 switch (uint32 data = GetData(DATA_ESCORT_PROGRESS))
283 {
291 thrall->SetFacingTo(thrallPositions[data - ENCOUNTER_PROGRESS_THRALL_ARMORED].GetOrientation());
292 break;
293 }
294 }
std::uint32_t uint32
Definition: Define.h:107
@ ENCOUNTER_PROGRESS_AMBUSHES_1
Definition: old_hillsbrad.h:79
@ ENCOUNTER_PROGRESS_TARETHA_MEET
Definition: old_hillsbrad.h:82
@ ENCOUNTER_PROGRESS_SKARLOC_KILLED
Definition: old_hillsbrad.h:80
@ ENCOUNTER_PROGRESS_TARREN_MILL
Definition: old_hillsbrad.h:81
void SetHomePosition(float x, float y, float z, float o)
Definition: Creature.h:336
void SetFacingTo(float ori)
Definition: Unit.cpp:20527
virtual bool UpdatePosition(float x, float y, float z, float ang, bool teleport=false)
Definition: Unit.cpp:20025
uint32 GetData(uint32 data) const override
Definition: instance_old_hillsbrad.cpp:174

References DATA_ESCORT_PROGRESS, ENCOUNTER_PROGRESS_AMBUSHES_1, ENCOUNTER_PROGRESS_SKARLOC_KILLED, ENCOUNTER_PROGRESS_TARETHA_MEET, ENCOUNTER_PROGRESS_TARREN_MILL, ENCOUNTER_PROGRESS_THRALL_ARMORED, GetData(), Unit::SetFacingTo(), Creature::SetHomePosition(), thrallPositions, and Unit::UpdatePosition().

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

◆ SetData()

void instance_old_hillsbrad::instance_old_hillsbrad_InstanceMapScript::SetData ( uint32  type,
uint32  data 
)
inlineoverridevirtual

Reimplemented from ZoneScript.

137 {
138 switch (type)
139 {
141 if (data > 1)
142 _events.ScheduleEvent(EVENT_THRALL_REPOSITION, data == 2 ? 0 : 10000);
143 else if (Creature* thrall = instance->GetCreature(_thrallGUID))
144 Reposition(thrall);
145 return;
147 if (_encounterProgress < data)
148 {
149 _encounterProgress = data;
150 SaveToDB();
151 }
152 break;
154 {
156 return;
157
159 if (_barrelCount == 5)
160 {
164 }
165 break;
166 }
169 thrall->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
170 break;
171 }
172 }
@ DATA_THRALL_ADD_FLAG
Definition: old_hillsbrad.h:36
@ DATA_BOMBS_PLACED
Definition: old_hillsbrad.h:34
@ EVENT_THRALL_REPOSITION
Definition: old_hillsbrad.h:89
@ UNIT_NPC_FLAG_GOSSIP
Definition: UnitDefines.h:294
Definition: Creature.h:43
void SaveToDB()
Definition: InstanceScript.cpp:41
void DoUpdateWorldState(uint32 worldstateId, uint32 worldstateValue)
Definition: InstanceScript.cpp:603
Creature * GetCreature(ObjectGuid const guid)
Definition: Map.cpp:3317

References _barrelCount, _encounterProgress, _events, _thrallGUID, DATA_BOMBS_PLACED, DATA_ESCORT_PROGRESS, DATA_THRALL_ADD_FLAG, DATA_THRALL_REPOSITION, InstanceScript::DoUpdateWorldState(), ENCOUNTER_PROGRESS_NONE, EVENT_FINAL_BARRELS_FLAME, EVENT_INITIAL_BARRELS_FLAME, EVENT_SUMMON_LIEUTENANT, EVENT_THRALL_REPOSITION, Map::GetCreature(), InstanceScript::instance, Reposition(), InstanceScript::SaveToDB(), EventMap::ScheduleEvent(), UNIT_NPC_FLAG_GOSSIP, and WORLD_STATE_BARRELS_PLANTED.

Referenced by CleanupInstance(), and Update().

◆ Update()

void instance_old_hillsbrad::instance_old_hillsbrad_InstanceMapScript::Update ( uint32  diff)
inlineoverridevirtual

Reimplemented from InstanceScript.

194 {
195 _events.Update(diff);
196 switch (_events.ExecuteEvent())
197 {
199 {
200 instance->LoadGrid(instancePositions[0].GetPositionX(), instancePositions[0].GetPositionY());
201 instance->LoadGrid(instancePositions[1].GetPositionX(), instancePositions[1].GetPositionY());
202
203 for (ObjectGuid const& guid : _prisonersSet)
204 if (Creature* orc = instance->GetCreature(guid))
205 {
206 uint8 index = orc->GetDistance(instancePositions[0]) < 80.0f ? 0 : 1;
207 Position pos(instancePositions[index]);
208 orc->MovePosition(pos, frand(1.0f, 3.0f) + 15.0f * (float)rand_norm(), (float)rand_norm() * static_cast<float>(2 * M_PI));
209 orc->GetMotionMaster()->MovePoint(1, pos);
210 orc->SetStandState(UNIT_STAND_STATE_STAND);
211 }
212
213 for (ObjectGuid const& guid : _initalFlamesSet)
214 if (GameObject* gobject = instance->GetGameObject(guid))
215 {
216 gobject->SetRespawnTime(0);
217 gobject->UpdateObjectVisibility(true);
218 }
219 break;
220 }
222 {
223 instance->LoadGrid(instancePositions[0].GetPositionX(), instancePositions[0].GetPositionY());
224 instance->LoadGrid(instancePositions[1].GetPositionX(), instancePositions[1].GetPositionY());
225
227 {
228 Map::PlayerList const& players = instance->GetPlayers();
229 if (!players.IsEmpty())
230 for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
231 if (Player* player = itr->GetSource())
232 player->KilledMonsterCredit(NPC_LODGE_QUEST_TRIGGER);
233 }
234
235 for (ObjectGuid const& guid : _finalFlamesSet)
236 if (GameObject* gobject = instance->GetGameObject(guid))
237 {
238 gobject->SetRespawnTime(0);
239 gobject->UpdateObjectVisibility(true);
240 }
241
242 for (ObjectGuid const& guid : _prisonersSet)
243 if (Creature* orc = instance->GetCreature(guid))
244 if (roll_chance_i(25))
245 orc->HandleEmoteCommand(EMOTE_ONESHOT_CHEER);
246
249 break;
250 }
252 {
253 instance->LoadGrid(instancePositions[2].GetPositionX(), instancePositions[2].GetPositionY());
255 break;
256 }
258 {
260 {
261 if (!thrall->IsAlive())
262 {
265 thrall->SetVisible(false);
266 Reposition(thrall);
267 thrall->setDeathState(DeathState::Dead);
268 thrall->Respawn();
269 thrall->SetVisible(true);
270 SaveToDB();
271 }
272 else
273 thrall->AI()->Reset();
274 }
275 break;
276 }
277 }
278 }
float frand(float min, float max)
Definition: Random.cpp:57
double rand_norm()
Definition: Random.cpp:77
bool roll_chance_i(int chance)
Definition: Random.h:59
static Position const instancePositions[INSTANCE_POSITIONS_COUNT]
Definition: instance_old_hillsbrad.cpp:24
@ NPC_LIEUTENANT_DRAKE
Definition: old_hillsbrad.h:48
@ NPC_LODGE_QUEST_TRIGGER
Definition: old_hillsbrad.h:50
@ EMOTE_ONESHOT_CHEER
Definition: SharedDefines.h:1898
@ UNIT_STAND_STATE_STAND
Definition: UnitDefines.h:32
bool IsEmpty() const
Definition: LinkedList.h:97
Definition: LinkedList.h:139
uint32 ExecuteEvent()
Definition: EventMap.cpp:114
void Update(uint32 time)
Definition: EventMap.h:54
Definition: GameObject.h:120
Definition: ObjectGuid.h:118
Definition: Position.h:27
Definition: Player.h:1081
GameObject * GetGameObject(ObjectGuid const guid)
Definition: Map.cpp:3322
PlayerList const & GetPlayers() const
Definition: Map.h:484
TempSummon * SummonCreature(uint32 entry, Position const &pos, SummonPropertiesEntry const *properties=nullptr, uint32 duration=0, WorldObject *summoner=nullptr, uint32 spellId=0, uint32 vehId=0, bool visibleBySummonerOnly=false)
Definition: Object.cpp:2174
Definition: MapRefMgr.h:26
iterator begin()
Definition: MapRefMgr.h:36
iterator end()
Definition: MapRefMgr.h:37

References _attemptsCount, _encounterProgress, _events, _finalFlamesSet, _initalFlamesSet, _prisonersSet, _thrallGUID, MapRefMgr::begin(), DATA_ESCORT_PROGRESS, InstanceScript::DoUpdateWorldState(), EMOTE_ONESHOT_CHEER, ENCOUNTER_PROGRESS_BARRELS, ENCOUNTER_PROGRESS_NONE, MapRefMgr::end(), EnsureGridLoaded(), EVENT_FINAL_BARRELS_FLAME, EVENT_INITIAL_BARRELS_FLAME, EVENT_SUMMON_LIEUTENANT, EVENT_THRALL_REPOSITION, EventMap::ExecuteEvent(), frand(), Map::GetCreature(), Map::GetGameObject(), Map::GetPlayers(), InstanceScript::instance, instancePositions, LinkedListHead::IsEmpty(), Map::LoadGrid(), NPC_LIEUTENANT_DRAKE, NPC_LODGE_QUEST_TRIGGER, rand_norm(), Reposition(), roll_chance_i(), InstanceScript::SaveToDB(), SetData(), Map::SummonCreature(), UNIT_STAND_STATE_STAND, EventMap::Update(), and WORLD_STATE_BARRELS_PLANTED.

◆ WriteSaveDataMore()

void instance_old_hillsbrad::instance_old_hillsbrad_InstanceMapScript::WriteSaveDataMore ( std::ostringstream &  data)
inlineoverridevirtual

Reimplemented from InstanceScript.

309 {
310 data << _encounterProgress << ' ' << _attemptsCount;
311 }

References _attemptsCount, and _encounterProgress.

Member Data Documentation

◆ _attemptsCount

uint32 instance_old_hillsbrad::instance_old_hillsbrad_InstanceMapScript::_attemptsCount
private

◆ _barrelCount

uint32 instance_old_hillsbrad::instance_old_hillsbrad_InstanceMapScript::_barrelCount
private

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

◆ _encounterProgress

uint32 instance_old_hillsbrad::instance_old_hillsbrad_InstanceMapScript::_encounterProgress
private

◆ _events

EventMap instance_old_hillsbrad::instance_old_hillsbrad_InstanceMapScript::_events
private

◆ _finalFlamesSet

GuidSet instance_old_hillsbrad::instance_old_hillsbrad_InstanceMapScript::_finalFlamesSet
private

◆ _initalFlamesSet

GuidSet instance_old_hillsbrad::instance_old_hillsbrad_InstanceMapScript::_initalFlamesSet
private

◆ _prisonersSet

GuidSet instance_old_hillsbrad::instance_old_hillsbrad_InstanceMapScript::_prisonersSet
private

◆ _tarethaGUID

ObjectGuid instance_old_hillsbrad::instance_old_hillsbrad_InstanceMapScript::_tarethaGUID
private

Referenced by GetGuidData(), and OnCreatureCreate().

◆ _thrallGUID

ObjectGuid instance_old_hillsbrad::instance_old_hillsbrad_InstanceMapScript::_thrallGUID
private