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

Public Member Functions

 instance_blackwing_lair_InstanceMapScript (Map *map)
 
void Initialize () override
 
void OnCreatureCreate (Creature *creature) override
 
void OnGameObjectCreate (GameObject *go) override
 
void OnGameObjectRemove (GameObject *go) override
 
uint32 GetData (uint32 data) const override
 
bool CheckRequiredBosses (uint32 bossId, Player const *) const override
 
bool SetBossState (uint32 type, EncounterState state) override
 
void SetData (uint32 type, uint32 data) override
 
ObjectGuid GetGuidData (uint32 type) const override
 
void OnUnitDeath (Unit *unit) override
 
void Update (uint32 diff) override
 
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)
 

Protected Attributes

ObjectGuid razorgoreGUID
 
ObjectGuid nefarianGUID
 
ObjectGuid nefarianDoorGUID
 
uint8 EggCount
 
uint32 EggEvent
 
GuidList EggList
 
GuidList guardList
 
std::array< uint32, 2 > addsCount
 
uint32 NefarianLeftTunnel
 
uint32 NefarianRightTunnel
 
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 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_blackwing_lair_InstanceMapScript()

instance_blackwing_lair::instance_blackwing_lair_InstanceMapScript::instance_blackwing_lair_InstanceMapScript ( Map map)
inline
81 : InstanceScript(map)
82 {
87 }
#define DataHeader
Definition: blackrock_depths.h:23
ObjectData const creatureData[]
Definition: instance_blackwing_lair.cpp:45
ObjectData const objectData[]
Definition: instance_blackwing_lair.cpp:54
DoorData const doorData[]
Definition: instance_blackwing_lair.cpp:33
uint32 const EncounterCount
Definition: blackrock_spire.h:23
Definition: InstanceScript.h:142
void SetBossNumber(uint32 number)
Definition: InstanceScript.h:285
void LoadDoorData(DoorData const *data)
Definition: InstanceScript.cpp:161
void SetHeaders(std::string const &dataHeaders)
Definition: InstanceScript.cpp:138
void LoadObjectData(ObjectData const *creatureData, ObjectData const *gameObjectData)
Definition: InstanceScript.cpp:173

References creatureData, DataHeader, doorData, EncounterCount, InstanceScript::LoadDoorData(), InstanceScript::LoadObjectData(), objectData, InstanceScript::SetBossNumber(), and InstanceScript::SetHeaders().

Member Function Documentation

◆ CheckRequiredBosses()

bool instance_blackwing_lair::instance_blackwing_lair_InstanceMapScript::CheckRequiredBosses ( uint32  bossId,
Player const *   
) const
inlineoverridevirtual

Reimplemented from InstanceScript.

207 {
208 switch (bossId)
209 {
212 return false;
213 break;
214 default:
215 break;
216 }
217
218 return true;
219 }
@ DONE
Definition: InstanceScript.h:60
@ DATA_VAELASTRAZ_THE_CORRUPT
Definition: blackwing_lair.h:32
@ DATA_BROODLORD_LASHLAYER
Definition: blackwing_lair.h:33
EncounterState GetBossState(uint32 id) const
Definition: InstanceScript.h:235

References DATA_BROODLORD_LASHLAYER, DATA_VAELASTRAZ_THE_CORRUPT, DONE, and InstanceScript::GetBossState().

◆ GetData()

uint32 instance_blackwing_lair::instance_blackwing_lair_InstanceMapScript::GetData ( uint32  data) const
inlineoverridevirtual

Reimplemented from ZoneScript.

190 {
191 switch (data)
192 {
194 return NefarianLeftTunnel;
196 return NefarianRightTunnel;
197 case DATA_EGG_EVENT:
198 return EggEvent;
199 default:
200 break;
201 }
202
203 return 0;
204 }
@ DATA_EGG_EVENT
Definition: blackwing_lair.h:112
@ DATA_NEFARIAN_RIGHT_TUNNEL
Definition: blackwing_lair.h:119
@ DATA_NEFARIAN_LEFT_TUNNEL
Definition: blackwing_lair.h:118
uint32 NefarianRightTunnel
Definition: instance_blackwing_lair.cpp:462
uint32 NefarianLeftTunnel
Definition: instance_blackwing_lair.cpp:461
uint32 EggEvent
Definition: instance_blackwing_lair.cpp:455

References DATA_EGG_EVENT, DATA_NEFARIAN_LEFT_TUNNEL, DATA_NEFARIAN_RIGHT_TUNNEL, EggEvent, NefarianLeftTunnel, and NefarianRightTunnel.

◆ GetGuidData()

ObjectGuid instance_blackwing_lair::instance_blackwing_lair_InstanceMapScript::GetGuidData ( uint32  type) const
inlineoverridevirtual

Reimplemented from InstanceScript.

329 {
330 switch (type)
331 {
333 return razorgoreGUID;
334 default:
335 break;
336 }
337
338 return ObjectGuid::Empty;
339 }
@ DATA_RAZORGORE_THE_UNTAMED
Definition: blackwing_lair.h:31
static ObjectGuid const Empty
Definition: ObjectGuid.h:120
ObjectGuid razorgoreGUID
Definition: instance_blackwing_lair.cpp:449

References DATA_RAZORGORE_THE_UNTAMED, ObjectGuid::Empty, and razorgoreGUID.

◆ Initialize()

void instance_blackwing_lair::instance_blackwing_lair_InstanceMapScript::Initialize ( )
inlineoverridevirtual

Reimplemented from InstanceScript.

90 {
91 // Razorgore
92 EggCount = 0;
93 EggEvent = 0;
96 addsCount.fill(0);
97 }
uint8 EggCount
Definition: instance_blackwing_lair.cpp:454
std::array< uint32, 2 > addsCount
Definition: instance_blackwing_lair.cpp:458

References addsCount, EggCount, EggEvent, NefarianLeftTunnel, and NefarianRightTunnel.

◆ OnCreatureCreate()

void instance_blackwing_lair::instance_blackwing_lair_InstanceMapScript::OnCreatureCreate ( Creature creature)
inlineoverridevirtual

Reimplemented from InstanceScript.

100 {
101 // This is required because the tempspawn at Vael overwrites his GUID.
102 if (creature->GetEntry() == NPC_VICTOR_NEFARIUS && creature->ToTempSummon())
103 {
104 return;
105 }
106
108
109 switch (creature->GetEntry())
110 {
111 case NPC_RAZORGORE:
112 razorgoreGUID = creature->GetGUID();
113 break;
115 ++addsCount[0];
117 {
118 if (CreatureAI* razorAI = razor->AI())
119 {
120 razorAI->JustSummoned(creature);
121 }
122 }
123 break;
126 ++addsCount[1];
128 {
129 if (CreatureAI* razorAI = razor->AI())
130 {
131 razorAI->JustSummoned(creature);
132 }
133 }
134 break;
136 guardList.push_back(creature->GetGUID());
137 break;
138 case NPC_NEFARIAN:
139 nefarianGUID = creature->GetGUID();
140 break;
146 case NPC_RED_DRAKONID:
148 {
149 if (CreatureAI* nefariusAI = nefarius->AI())
150 {
151 nefariusAI->JustSummoned(creature);
152 }
153 }
154 break;
155 default:
156 break;
157 }
158 }
@ DATA_LORD_VICTOR_NEFARIUS
Definition: blackwing_lair.h:41
@ NPC_RED_DRAKONID
Definition: blackwing_lair.h:79
@ NPC_VICTOR_NEFARIUS
Definition: blackwing_lair.h:67
@ NPC_BLACKWING_DRAGON
Definition: blackwing_lair.h:56
@ NPC_CHROMATIC_DRAKONID
Definition: blackwing_lair.h:82
@ NPC_BLUE_DRAKONID
Definition: blackwing_lair.h:78
@ NPC_BLACKWING_GUARDSMAN
Definition: blackwing_lair.h:53
@ NPC_BLACKWING_MAGE
Definition: blackwing_lair.h:60
@ NPC_GREEN_DRAKONID
Definition: blackwing_lair.h:80
@ NPC_BRONZE_DRAKONID
Definition: blackwing_lair.h:77
@ NPC_BLACK_DRAKONID
Definition: blackwing_lair.h:81
@ NPC_RAZORGORE
Definition: blackwing_lair.h:55
@ NPC_BLACKWING_LEGIONAIRE
Definition: blackwing_lair.h:58
@ NPC_NEFARIAN
Definition: blackwing_lair.h:68
Definition: CreatureAI.h:71
Definition: Creature.h:46
uint32 GetEntry() const
Definition: Object.h:112
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:109
TempSummon * ToTempSummon()
Definition: Unit.h:1716
void OnCreatureCreate(Creature *creature) override
Definition: InstanceScript.cpp:58
Creature * GetCreature(uint32 type)
Definition: InstanceScript.cpp:100
Map * instance
Definition: InstanceScript.h:148
Creature * GetCreature(ObjectGuid const guid)
Definition: Map.cpp:3314
GuidList guardList
Definition: instance_blackwing_lair.cpp:457
ObjectGuid nefarianGUID
Definition: instance_blackwing_lair.cpp:450

References addsCount, DATA_LORD_VICTOR_NEFARIUS, Map::GetCreature(), InstanceScript::GetCreature(), Object::GetEntry(), Object::GetGUID(), guardList, InstanceScript::instance, nefarianGUID, NPC_BLACK_DRAKONID, NPC_BLACKWING_DRAGON, NPC_BLACKWING_GUARDSMAN, NPC_BLACKWING_LEGIONAIRE, NPC_BLACKWING_MAGE, NPC_BLUE_DRAKONID, NPC_BRONZE_DRAKONID, NPC_CHROMATIC_DRAKONID, NPC_GREEN_DRAKONID, NPC_NEFARIAN, NPC_RAZORGORE, NPC_RED_DRAKONID, NPC_VICTOR_NEFARIUS, InstanceScript::OnCreatureCreate(), razorgoreGUID, and Unit::ToTempSummon().

◆ OnGameObjectCreate()

void instance_blackwing_lair::instance_blackwing_lair_InstanceMapScript::OnGameObjectCreate ( GameObject go)
inlineoverridevirtual

Reimplemented from InstanceScript.

161 {
163
164 switch (go->GetEntry())
165 {
168 {
169 go->SetPhaseMask(2, true);
170 }
171 else
172 {
173 EggList.push_back(go->GetGUID());
174 }
175 break;
176 default:
177 break;
178 }
179 }
@ GO_BLACK_DRAGON_EGG
Definition: blackwing_lair.h:88
@ DATA_FIREMAW
Definition: blackwing_lair.h:34
void SetPhaseMask(uint32 newPhaseMask, bool update) override
Definition: GameObject.cpp:2596
void OnGameObjectCreate(GameObject *go) override
Definition: InstanceScript.cpp:70
GuidList EggList
Definition: instance_blackwing_lair.cpp:456

References DATA_FIREMAW, DONE, EggList, InstanceScript::GetBossState(), Object::GetEntry(), Object::GetGUID(), GO_BLACK_DRAGON_EGG, InstanceScript::OnGameObjectCreate(), and GameObject::SetPhaseMask().

◆ OnGameObjectRemove()

void instance_blackwing_lair::instance_blackwing_lair_InstanceMapScript::OnGameObjectRemove ( GameObject go)
inlineoverridevirtual

Reimplemented from InstanceScript.

182 {
184
185 if (go->GetEntry() == GO_BLACK_DRAGON_EGG)
186 EggList.remove(go->GetGUID());
187 }
void OnGameObjectRemove(GameObject *go) override
Definition: InstanceScript.cpp:77

References EggList, Object::GetEntry(), Object::GetGUID(), GO_BLACK_DRAGON_EGG, and InstanceScript::OnGameObjectRemove().

◆ OnUnitDeath()

void instance_blackwing_lair::instance_blackwing_lair_InstanceMapScript::OnUnitDeath ( Unit unit)
inlineoverridevirtual

Reimplemented from ZoneScript.

342 {
343 switch (unit->GetEntry())
344 {
346 --addsCount[0];
347 if (EggEvent != DONE && _events.GetTimeUntilEvent(EVENT_RAZOR_SPAWN) == Milliseconds::max())
348 {
350 }
351 break;
354 --addsCount[1];
355 if (EggEvent != DONE && _events.GetTimeUntilEvent(EVENT_RAZOR_SPAWN) == Milliseconds::max())
356 {
358 }
359 break;
360 default:
361 break;
362 }
363 }
@ EVENT_RAZOR_SPAWN
Definition: blackwing_lair.h:103
void ScheduleEvent(uint32 eventId, uint32 time, uint32 group=0, uint32 phase=0)
Definition: EventMap.cpp:56
Milliseconds GetTimeUntilEvent(uint32 eventId) const
Definition: EventMap.cpp:258
EventMap _events
Definition: instance_blackwing_lair.cpp:465

References _events, addsCount, DONE, EggEvent, EVENT_RAZOR_SPAWN, Object::GetEntry(), EventMap::GetTimeUntilEvent(), NPC_BLACKWING_DRAGON, NPC_BLACKWING_LEGIONAIRE, NPC_BLACKWING_MAGE, and EventMap::ScheduleEvent().

◆ ReadSaveDataMore()

void instance_blackwing_lair::instance_blackwing_lair_InstanceMapScript::ReadSaveDataMore ( std::istringstream &  data)
inlineoverridevirtual

Reimplemented from InstanceScript.

438 {
439 data >> NefarianLeftTunnel;
440 data >> NefarianRightTunnel;
441 }

References NefarianLeftTunnel, and NefarianRightTunnel.

◆ SetBossState()

bool instance_blackwing_lair::instance_blackwing_lair_InstanceMapScript::SetBossState ( uint32  type,
EncounterState  state 
)
inlineoverridevirtual
Todo:
: after dynamic spawns

Reimplemented from InstanceScript.

222 {
223 if (!InstanceScript::SetBossState(type, state))
224 return false;
225
226 switch (type)
227 {
229 if (state == DONE)
230 {
231 for (ObjectGuid const& guid : EggList)
232 {
233 // Eggs should be destroyed instead
235 if (GameObject* egg = instance->GetGameObject(guid))
236 {
237 egg->SetPhaseMask(2, true);
238 }
239 }
240 }
241 break;
242 case DATA_NEFARIAN:
243 switch (state)
244 {
245 case FAIL:
247 [[fallthrough]];
248 case NOT_STARTED:
249 if (Creature* nefarian = instance->GetCreature(nefarianGUID))
250 {
251 nefarian->DespawnOrUnsummon();
252 }
253 break;
254 default:
255 break;
256 }
257 break;
258 }
259 return true;
260 }
@ FAIL
Definition: InstanceScript.h:59
@ NOT_STARTED
Definition: InstanceScript.h:57
@ EVENT_RESPAWN_NEFARIUS
Definition: blackwing_lair.h:105
@ DATA_NEFARIAN
Definition: blackwing_lair.h:38
Definition: GameObject.h:121
Definition: ObjectGuid.h:118
virtual bool SetBossState(uint32 id, EncounterState state)
Definition: InstanceScript.cpp:351
GameObject * GetGameObject(ObjectGuid const guid)
Definition: Map.cpp:3319

References _events, DATA_NEFARIAN, DATA_RAZORGORE_THE_UNTAMED, DONE, EggList, EVENT_RESPAWN_NEFARIUS, FAIL, Map::GetCreature(), Map::GetGameObject(), InstanceScript::instance, nefarianGUID, NOT_STARTED, EventMap::ScheduleEvent(), and InstanceScript::SetBossState().

◆ SetData()

void instance_blackwing_lair::instance_blackwing_lair_InstanceMapScript::SetData ( uint32  type,
uint32  data 
)
inlineoverridevirtual

Reimplemented from ZoneScript.

263 {
264 if (type == DATA_EGG_EVENT)
265 {
266 switch (data)
267 {
268 case DONE:
269 EggEvent = data;
270 break;
271 case FAIL:
273 break;
274 case IN_PROGRESS:
276 EggEvent = data;
277 EggCount = 0;
278 addsCount.fill(0);
279 break;
280 case NOT_STARTED:
282 EggEvent = data;
283 EggCount = 0;
284 addsCount.fill(0);
285
286 for (ObjectGuid const& guid : EggList)
287 {
288 DoRespawnGameObject(guid, 0);
289 }
290
292
293 for (ObjectGuid const& guid : guardList)
294 {
295 DoRespawnCreature(guid);
296 }
297
298 break;
299 case SPECIAL:
300 if (EggEvent == NOT_STARTED)
302 if (++EggCount >= EggList.size())
303 {
305 {
307 razor->RemoveAurasDueToSpell(19832); // MindControl
309 }
312 }
313 break;
314 }
315 }
316
317 if (type == DATA_NEFARIAN_LEFT_TUNNEL)
318 {
319 NefarianLeftTunnel = data;
320 }
321
322 if (type == DATA_NEFARIAN_RIGHT_TUNNEL)
323 {
324 NefarianRightTunnel = data;
325 }
326 }
@ IN_PROGRESS
Definition: InstanceScript.h:58
@ SPECIAL
Definition: InstanceScript.h:61
@ EVENT_RAZOR_PHASE_TWO
Definition: blackwing_lair.h:104
@ DATA_GRETHOK
Definition: blackwing_lair.h:42
void CancelEvent(uint32 eventId)
Definition: EventMap.cpp:190
void DoRemoveAurasDueToSpellOnPlayers(uint32 spell)
Definition: InstanceScript.cpp:639
void DoRespawnCreature(ObjectGuid guid, bool force=false)
Definition: InstanceScript.cpp:561
void DoRespawnGameObject(ObjectGuid guid, uint32 timeToDespawn=MINUTE)
Definition: InstanceScript.cpp:535
void SetData(uint32 type, uint32 data) override
Definition: instance_blackwing_lair.cpp:262

References _events, addsCount, EventMap::CancelEvent(), DATA_EGG_EVENT, DATA_GRETHOK, DATA_NEFARIAN_LEFT_TUNNEL, DATA_NEFARIAN_RIGHT_TUNNEL, DONE, InstanceScript::DoRemoveAurasDueToSpellOnPlayers(), InstanceScript::DoRespawnCreature(), InstanceScript::DoRespawnGameObject(), EggCount, EggEvent, EggList, EVENT_RAZOR_PHASE_TWO, EVENT_RAZOR_SPAWN, FAIL, Map::GetCreature(), guardList, IN_PROGRESS, InstanceScript::instance, NefarianLeftTunnel, NefarianRightTunnel, NOT_STARTED, razorgoreGUID, EventMap::ScheduleEvent(), SetData(), and SPECIAL.

Referenced by SetData().

◆ Update()

void instance_blackwing_lair::instance_blackwing_lair_InstanceMapScript::Update ( uint32  diff)
inlineoverridevirtual

Reimplemented from InstanceScript.

366 {
367 if (_events.Empty())
368 return;
369
370 _events.Update(diff);
371
372 while (uint32 eventId = _events.ExecuteEvent())
373 {
374 switch (eventId)
375 {
377 if (EggEvent == IN_PROGRESS)
378 {
379 bool spawnMoreAdds = true;
380 for (uint8 i = urand(2, 5); i > 0; --i)
381 {
382 uint32 mobEntry = Entry[urand(0, 2)];
383 uint32 dragonkinsCount = addsCount[0];
384 uint32 orcsCount = addsCount[1];
385
386 // If more than 12 dragonkins...
387 if (dragonkinsCount >= 12)
388 {
389 //... and more than 40 orcs - stop spawning more adds.
390 if (orcsCount >= 40)
391 {
392 spawnMoreAdds = false;
393 break;
394 }
395 //... - stop spawning them.
396 else if (mobEntry == NPC_BLACKWING_DRAGON)
397 {
398 continue;
399 }
400 }
401 // If more than 40 orcs - stop spawning them.
402 else if (orcsCount >= 40 && mobEntry != NPC_BLACKWING_DRAGON)
403 {
404 continue;
405 }
406
407 if (Creature* summon = instance->SummonCreature(mobEntry, SummonPosition[urand(0, 7)]))
408 {
409 summon->AI()->DoZoneInCombat();
410 }
411 }
412
413 if (spawnMoreAdds)
414 {
416 }
417 }
418 break;
422 razor->AI()->DoAction(ACTION_PHASE_TWO);
423 break;
426 {
427 nefarius->SetPhaseMask(1, true);
428 nefarius->setActive(true);
429 nefarius->Respawn();
430 nefarius->GetMotionMaster()->MoveTargetedHome();
431 }
432 break;
433 }
434 }
435 }
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
Position const SummonPosition[8]
Definition: instance_blackwing_lair.cpp:60
uint32 const Entry[3]
Definition: instance_blackwing_lair.cpp:72
@ ACTION_PHASE_TWO
Definition: blackwing_lair.h:111
uint32 ExecuteEvent()
Definition: EventMap.cpp:114
void Update(uint32 time)
Definition: EventMap.h:54
bool Empty() const
Definition: EventMap.h:96
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 _events, ACTION_PHASE_TWO, addsCount, EventMap::CancelEvent(), DATA_LORD_VICTOR_NEFARIUS, EggEvent, EventMap::Empty(), Entry, EVENT_RAZOR_PHASE_TWO, EVENT_RAZOR_SPAWN, EVENT_RESPAWN_NEFARIUS, EventMap::ExecuteEvent(), Map::GetCreature(), InstanceScript::GetCreature(), IN_PROGRESS, InstanceScript::instance, NPC_BLACKWING_DRAGON, razorgoreGUID, EventMap::ScheduleEvent(), Map::SummonCreature(), SummonPosition, EventMap::Update(), and urand().

◆ WriteSaveDataMore()

void instance_blackwing_lair::instance_blackwing_lair_InstanceMapScript::WriteSaveDataMore ( std::ostringstream &  data)
inlineoverridevirtual

Reimplemented from InstanceScript.

444 {
445 data << NefarianLeftTunnel << ' ' << NefarianRightTunnel;
446 }

References NefarianLeftTunnel, and NefarianRightTunnel.

Member Data Documentation

◆ _events

EventMap instance_blackwing_lair::instance_blackwing_lair_InstanceMapScript::_events
protected

◆ addsCount

std::array<uint32, 2> instance_blackwing_lair::instance_blackwing_lair_InstanceMapScript::addsCount
protected

◆ EggCount

uint8 instance_blackwing_lair::instance_blackwing_lair_InstanceMapScript::EggCount
protected

Referenced by Initialize(), and SetData().

◆ EggEvent

uint32 instance_blackwing_lair::instance_blackwing_lair_InstanceMapScript::EggEvent
protected

◆ EggList

GuidList instance_blackwing_lair::instance_blackwing_lair_InstanceMapScript::EggList
protected

◆ guardList

GuidList instance_blackwing_lair::instance_blackwing_lair_InstanceMapScript::guardList
protected

Referenced by OnCreatureCreate(), and SetData().

◆ nefarianDoorGUID

ObjectGuid instance_blackwing_lair::instance_blackwing_lair_InstanceMapScript::nefarianDoorGUID
protected

◆ nefarianGUID

ObjectGuid instance_blackwing_lair::instance_blackwing_lair_InstanceMapScript::nefarianGUID
protected

Referenced by OnCreatureCreate(), and SetBossState().

◆ NefarianLeftTunnel

uint32 instance_blackwing_lair::instance_blackwing_lair_InstanceMapScript::NefarianLeftTunnel
protected

◆ NefarianRightTunnel

uint32 instance_blackwing_lair::instance_blackwing_lair_InstanceMapScript::NefarianRightTunnel
protected

◆ razorgoreGUID

ObjectGuid instance_blackwing_lair::instance_blackwing_lair_InstanceMapScript::razorgoreGUID
protected