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 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
42 : InstanceScript(map)
43 {
46 }
BossBoundaryData const boundaries
Definition: instance_forge_of_souls.cpp:24
#define DataHeader
Definition: blackrock_depths.h:23
Definition: InstanceScript.h:142
void LoadBossBoundaries(BossBoundaryData const &data)
Definition: InstanceScript.cpp:131
void SetHeaders(std::string const &dataHeaders)
Definition: InstanceScript.cpp:138

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.

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

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.

171 {
172 switch (type)
173 {
174 case DATA_BRONJAHM:
175 return NPC_BronjahmGUID;
176 }
177
178 return ObjectGuid::Empty;
179 }
@ 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
138 {
142 {
143 float angle = boss->GetAngle(leader);
144 leader->GetMotionMaster()->MovePoint(1, boss->GetPositionX() + 10.0f * cos(angle), boss->GetPositionY() + 10.0f * std::sin(angle), boss->GetPositionZ());
145 }
146
147 for (int8 i = 0; outroPositions[i].entry[teamIdInInstance] != 0; ++i)
149 summon->GetMotionMaster()->MovePath(outroPositions[i].pathId, false);
150 }
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:2163
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:55
TeamId teamIdInInstance
Definition: instance_forge_of_souls.cpp:49

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.

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

References m_auiEncounter, TEAM_NEUTRAL, and teamIdInInstance.

◆ IsEncounterInProgress()

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

Reimplemented from InstanceScript.

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

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.

84 {
86 {
87 Map::PlayerList const& players = instance->GetPlayers();
88 if (!players.IsEmpty())
89 if (Player* player = players.begin()->GetSource())
90 teamIdInInstance = player->GetTeamId();
91 }
92
93 switch (creature->GetEntry())
94 {
95 case NPC_BRONJAHM:
96 NPC_BronjahmGUID = creature->GetGUID();
97 break;
98 case NPC_DEVOURER:
99 NPC_DevourerGUID = creature->GetGUID();
100 break;
103 creature->UpdateEntry(NPC_JAINA_PART1);
104 NPC_LeaderFirstGUID = creature->GetGUID();
105
106 if (m_auiEncounter[0] == DONE && m_auiEncounter[1] == DONE)
107 creature->SetVisible(false);
108 break;
111 creature->UpdateEntry(NPC_JAINA_PART2);
112 NPC_LeaderSecondGUID = creature->GetGUID();
113 break;
114 case NPC_LORALEN:
116 creature->UpdateEntry(NPC_ELANDRA);
118 {
119 NPC_GuardFirstGUID = creature->GetGUID();
120 if (m_auiEncounter[0] == DONE && m_auiEncounter[1] == DONE)
121 creature->SetVisible(false);
122 }
123 break;
124 case NPC_KALIRA:
126 creature->UpdateEntry(NPC_KORELN);
128 {
129 NPC_GuardSecondGUID = creature->GetGUID();
130 if (m_auiEncounter[0] == DONE && m_auiEncounter[1] == DONE)
131 creature->SetVisible(false);
132 }
133 break;
134 }
135 }
@ DONE
Definition: InstanceScript.h:60
@ 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
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:538
uint32 GetEntry() const
Definition: Object.h:112
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:109
Definition: Player.h:1064
void SetVisible(bool x)
Definition: Unit.cpp:14189
PlayerList const & GetPlayers() const
Definition: Map.h:486
Definition: MapRefMgr.h:26
iterator begin()
Definition: MapRefMgr.h:36
ObjectGuid NPC_LeaderFirstGUID
Definition: instance_forge_of_souls.cpp:54
ObjectGuid NPC_GuardSecondGUID
Definition: instance_forge_of_souls.cpp:57
ObjectGuid NPC_GuardFirstGUID
Definition: instance_forge_of_souls.cpp:56

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.

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

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.

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

References m_auiEncounter.

◆ SetData()

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

Reimplemented from ZoneScript.

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

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.

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

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