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

Public Member Functions

 instance_forge_of_souls_InstanceScript (Map *map)
 
void Initialize () override
 
bool IsEncounterInProgress () const override
 
void OnPlayerEnter (Player *) override
 
void OnCreatureCreate (Creature *creature) override
 
void HandleOutro ()
 
void SetData (uint32 type, uint32 data) override
 
ObjectGuid GetGuidData (uint32 type) const override
 
bool CheckAchievementCriteriaMeet (uint32 criteria_id, Player const *, Unit const *, uint32) 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)
 

Public Attributes

uint32 m_auiEncounter [MAX_ENCOUNTER]
 
TeamId teamIdInInstance
 
std::string str_data
 
ObjectGuid NPC_BronjahmGUID
 
ObjectGuid NPC_DevourerGUID
 
ObjectGuid NPC_LeaderFirstGUID
 
ObjectGuid NPC_LeaderSecondGUID
 
ObjectGuid NPC_GuardFirstGUID
 
ObjectGuid NPC_GuardSecondGUID
 
- Public Attributes inherited from InstanceScript
Mapinstance
 
TaskScheduler scheduler
 

Additional Inherited Members

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

instance_forge_of_souls::instance_forge_of_souls_InstanceScript::instance_forge_of_souls_InstanceScript ( Map map)
inline
41 : InstanceScript(map)
42 {
45 }
BossBoundaryData const boundaries
Definition: instance_forge_of_souls.cpp:23
#define DataHeader
Definition: blackrock_depths.h:23
Definition: InstanceScript.h:142
void LoadBossBoundaries(BossBoundaryData const &data)
Definition: InstanceScript.cpp:134
void SetHeaders(std::string const &dataHeaders)
Definition: InstanceScript.cpp:141

References boundaries, DataHeader, InstanceScript::LoadBossBoundaries(), and InstanceScript::SetHeaders().

Member Function Documentation

◆ CheckAchievementCriteriaMeet()

bool instance_forge_of_souls::instance_forge_of_souls_InstanceScript::CheckAchievementCriteriaMeet ( uint32  criteria_id,
Player const *  ,
Unit const *  ,
uint32   
)
inlineoverridevirtual

Reimplemented from InstanceScript.

181 {
182 switch (criteria_id)
183 {
184 case 12752: // Soul Power
186 {
187 std::list<Creature*> L;
188 uint8 count = 0;
189 c->GetCreaturesWithEntryInRange(L, 200.0f, 36535); // find all Corrupted Soul Fragment (36535)
190 for( std::list<Creature*>::const_iterator itr = L.begin(); itr != L.end(); ++itr )
191 if ((*itr)->IsAlive())
192 ++count;
193 return (count >= 4);
194 }
195 break;
196 case 12976:
198 return (bool)c->AI()->GetData(1);
199 break;
200 }
201 return false;
202 }
std::uint8_t uint8
Definition: Define.h:109
Definition: Creature.h:43
Map * instance
Definition: InstanceScript.h:148
Creature * GetCreature(ObjectGuid const guid)
Definition: Map.cpp:3317
ObjectGuid NPC_DevourerGUID
Definition: instance_forge_of_souls.cpp:51
ObjectGuid NPC_BronjahmGUID
Definition: instance_forge_of_souls.cpp:50

References Map::GetCreature(), InstanceScript::instance, NPC_BronjahmGUID, and NPC_DevourerGUID.

◆ GetGuidData()

ObjectGuid instance_forge_of_souls::instance_forge_of_souls_InstanceScript::GetGuidData ( uint32  type) const
inlineoverridevirtual

Reimplemented from InstanceScript.

170 {
171 switch (type)
172 {
173 case DATA_BRONJAHM:
174 return NPC_BronjahmGUID;
175 }
176
177 return ObjectGuid::Empty;
178 }
@ DATA_BRONJAHM
Definition: forge_of_souls.h:30
static ObjectGuid const Empty
Definition: ObjectGuid.h:120

References DATA_BRONJAHM, ObjectGuid::Empty, and NPC_BronjahmGUID.

◆ HandleOutro()

void instance_forge_of_souls::instance_forge_of_souls_InstanceScript::HandleOutro ( )
inline
137 {
141 {
142 float angle = boss->GetAngle(leader);
143 leader->GetMotionMaster()->MovePoint(1, boss->GetPositionX() + 10.0f * cos(angle), boss->GetPositionY() + 10.0f * std::sin(angle), boss->GetPositionZ());
144 }
145
146 for (int8 i = 0; outroPositions[i].entry[teamIdInInstance] != 0; ++i)
148 summon->GetMotionMaster()->MovePath(outroPositions[i].pathId, false);
149 }
std::int8_t int8
Definition: Define.h:105
@ NPC_SYLVANAS_PART2
Definition: forge_of_souls.h:41
const Position outroSpawnPoint
Definition: forge_of_souls.h:94
const outroPosition outroPositions[]
Definition: forge_of_souls.h:67
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
uint32 entry[2]
Definition: forge_of_souls.h:60
Position startPosition
Definition: forge_of_souls.h:61
ObjectGuid NPC_LeaderSecondGUID
Definition: instance_forge_of_souls.cpp:54
TeamId teamIdInInstance
Definition: instance_forge_of_souls.cpp:48

References outroPosition::entry, Map::GetCreature(), InstanceScript::instance, NPC_DevourerGUID, NPC_LeaderSecondGUID, NPC_SYLVANAS_PART2, outroPositions, outroSpawnPoint, outroPosition::startPosition, Map::SummonCreature(), and teamIdInInstance.

Referenced by SetData().

◆ Initialize()

void instance_forge_of_souls::instance_forge_of_souls_InstanceScript::Initialize ( )
inlineoverridevirtual

Reimplemented from InstanceScript.

59 {
60 memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
62 }
@ TEAM_NEUTRAL
Definition: SharedDefines.h:762
uint32 m_auiEncounter[MAX_ENCOUNTER]
Definition: instance_forge_of_souls.cpp:47

References m_auiEncounter, TEAM_NEUTRAL, and teamIdInInstance.

◆ IsEncounterInProgress()

bool instance_forge_of_souls::instance_forge_of_souls_InstanceScript::IsEncounterInProgress ( ) const
inlineoverridevirtual

Reimplemented from InstanceScript.

65 {
66 for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
67 if (m_auiEncounter[i] == IN_PROGRESS) return true;
68
69 return false;
70 }
#define MAX_ENCOUNTER
Definition: violet_hold.h:21
@ IN_PROGRESS
Definition: InstanceScript.h:58

References IN_PROGRESS, m_auiEncounter, and MAX_ENCOUNTER.

◆ OnCreatureCreate()

void instance_forge_of_souls::instance_forge_of_souls_InstanceScript::OnCreatureCreate ( Creature creature)
inlineoverridevirtual

Reimplemented from InstanceScript.

83 {
85 {
86 Map::PlayerList const& players = instance->GetPlayers();
87 if (!players.IsEmpty())
88 if (Player* player = players.begin()->GetSource())
89 teamIdInInstance = player->GetTeamId();
90 }
91
92 switch (creature->GetEntry())
93 {
94 case NPC_BRONJAHM:
95 NPC_BronjahmGUID = creature->GetGUID();
96 break;
97 case NPC_DEVOURER:
98 NPC_DevourerGUID = creature->GetGUID();
99 break;
102 creature->UpdateEntry(NPC_JAINA_PART1);
103 NPC_LeaderFirstGUID = creature->GetGUID();
104
105 if (m_auiEncounter[0] == DONE && m_auiEncounter[1] == DONE)
106 creature->SetVisible(false);
107 break;
110 creature->UpdateEntry(NPC_JAINA_PART2);
111 NPC_LeaderSecondGUID = creature->GetGUID();
112 break;
113 case NPC_LORALEN:
115 creature->UpdateEntry(NPC_ELANDRA);
117 {
118 NPC_GuardFirstGUID = creature->GetGUID();
119 if (m_auiEncounter[0] == DONE && m_auiEncounter[1] == DONE)
120 creature->SetVisible(false);
121 }
122 break;
123 case NPC_KALIRA:
125 creature->UpdateEntry(NPC_KORELN);
127 {
128 NPC_GuardSecondGUID = creature->GetGUID();
129 if (m_auiEncounter[0] == DONE && m_auiEncounter[1] == DONE)
130 creature->SetVisible(false);
131 }
132 break;
133 }
134 }
@ NPC_JAINA_PART1
Definition: forge_of_souls.h:42
@ NPC_DEVOURER
Definition: forge_of_souls.h:38
@ NPC_JAINA_PART2
Definition: forge_of_souls.h:43
@ NPC_KALIRA
Definition: forge_of_souls.h:44
@ NPC_KORELN
Definition: forge_of_souls.h:47
@ NPC_BRONJAHM
Definition: forge_of_souls.h:37
@ NPC_LORALEN
Definition: forge_of_souls.h:46
@ NPC_ELANDRA
Definition: forge_of_souls.h:45
@ NPC_SYLVANAS_PART1
Definition: forge_of_souls.h:40
@ TEAM_ALLIANCE
Definition: SharedDefines.h:760
@ DONE
Definition: InstanceScript.h:60
bool IsEmpty() const
Definition: LinkedList.h:97
FROM * GetSource() const
Definition: Reference.h:97
bool UpdateEntry(uint32 entry, const CreatureData *data=nullptr, bool changelevel=true, bool updateAI=false)
Definition: Creature.cpp:539
uint32 GetEntry() const
Definition: Object.h:115
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:112
Definition: Player.h:1081
void SetVisible(bool x)
Definition: Unit.cpp:14232
PlayerList const & GetPlayers() const
Definition: Map.h:484
Definition: MapRefMgr.h:26
iterator begin()
Definition: MapRefMgr.h:36
ObjectGuid NPC_LeaderFirstGUID
Definition: instance_forge_of_souls.cpp:53
ObjectGuid NPC_GuardSecondGUID
Definition: instance_forge_of_souls.cpp:56
ObjectGuid NPC_GuardFirstGUID
Definition: instance_forge_of_souls.cpp:55

References MapRefMgr::begin(), DONE, Object::GetEntry(), Object::GetGUID(), Map::GetPlayers(), Reference< TO, FROM >::GetSource(), InstanceScript::instance, LinkedListHead::IsEmpty(), m_auiEncounter, NPC_BRONJAHM, NPC_BronjahmGUID, NPC_DEVOURER, NPC_DevourerGUID, NPC_ELANDRA, NPC_GuardFirstGUID, NPC_GuardSecondGUID, NPC_JAINA_PART1, NPC_JAINA_PART2, NPC_KALIRA, NPC_KORELN, NPC_LeaderFirstGUID, NPC_LeaderSecondGUID, NPC_LORALEN, NPC_SYLVANAS_PART1, NPC_SYLVANAS_PART2, Unit::SetVisible(), TEAM_ALLIANCE, TEAM_NEUTRAL, teamIdInInstance, and Creature::UpdateEntry().

◆ OnPlayerEnter()

void instance_forge_of_souls::instance_forge_of_souls_InstanceScript::OnPlayerEnter ( Player )
inlineoverridevirtual

Reimplemented from InstanceScript.

73 {
74 // this will happen only after crash and loading the instance from db
76 {
77 Position pos = {5658.15f, 2502.564f, 708.83f, 0.885207f};
79 }
80 }
Definition: Position.h:27

References DONE, Map::GetCreature(), InstanceScript::instance, m_auiEncounter, NPC_LeaderSecondGUID, NPC_SYLVANAS_PART2, and Map::SummonCreature().

◆ ReadSaveDataMore()

void instance_forge_of_souls::instance_forge_of_souls_InstanceScript::ReadSaveDataMore ( std::istringstream &  data)
inlineoverridevirtual

Reimplemented from InstanceScript.

205 {
206 data >> m_auiEncounter[0];
207 data >> m_auiEncounter[1];
208 }

References m_auiEncounter.

◆ SetData()

void instance_forge_of_souls::instance_forge_of_souls_InstanceScript::SetData ( uint32  type,
uint32  data 
)
inlineoverridevirtual

Reimplemented from ZoneScript.

152 {
153 switch (type)
154 {
155 case DATA_BRONJAHM:
156 m_auiEncounter[type] = data;
157 break;
158 case DATA_DEVOURER:
159 m_auiEncounter[type] = data;
160 if (m_auiEncounter[0] == DONE && m_auiEncounter[1] == DONE)
161 HandleOutro();
162 break;
163 }
164
165 if (data == DONE)
166 SaveToDB();
167 }
@ DATA_DEVOURER
Definition: forge_of_souls.h:31
void SaveToDB()
Definition: InstanceScript.cpp:41
void HandleOutro()
Definition: instance_forge_of_souls.cpp:136

References DATA_BRONJAHM, DATA_DEVOURER, DONE, HandleOutro(), m_auiEncounter, and InstanceScript::SaveToDB().

◆ WriteSaveDataMore()

void instance_forge_of_souls::instance_forge_of_souls_InstanceScript::WriteSaveDataMore ( std::ostringstream &  data)
inlineoverridevirtual

Reimplemented from InstanceScript.

211 {
212 data << m_auiEncounter[0] << ' ' << m_auiEncounter[1];
213 }

References m_auiEncounter.

Member Data Documentation

◆ m_auiEncounter

uint32 instance_forge_of_souls::instance_forge_of_souls_InstanceScript::m_auiEncounter[MAX_ENCOUNTER]

◆ NPC_BronjahmGUID

ObjectGuid instance_forge_of_souls::instance_forge_of_souls_InstanceScript::NPC_BronjahmGUID

◆ NPC_DevourerGUID

ObjectGuid instance_forge_of_souls::instance_forge_of_souls_InstanceScript::NPC_DevourerGUID

◆ NPC_GuardFirstGUID

ObjectGuid instance_forge_of_souls::instance_forge_of_souls_InstanceScript::NPC_GuardFirstGUID

Referenced by OnCreatureCreate().

◆ NPC_GuardSecondGUID

ObjectGuid instance_forge_of_souls::instance_forge_of_souls_InstanceScript::NPC_GuardSecondGUID

Referenced by OnCreatureCreate().

◆ NPC_LeaderFirstGUID

ObjectGuid instance_forge_of_souls::instance_forge_of_souls_InstanceScript::NPC_LeaderFirstGUID

Referenced by OnCreatureCreate().

◆ NPC_LeaderSecondGUID

ObjectGuid instance_forge_of_souls::instance_forge_of_souls_InstanceScript::NPC_LeaderSecondGUID

◆ str_data

std::string instance_forge_of_souls::instance_forge_of_souls_InstanceScript::str_data

◆ teamIdInInstance

TeamId instance_forge_of_souls::instance_forge_of_souls_InstanceScript::teamIdInInstance