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

Public Member Functions

 instance_obsidian_sanctum_InstanceMapScript (Map *pMap)
 
void OnCreatureCreate (Creature *pCreature) override
 
ObjectGuid GetGuidData (uint32 uiData) const override
 
bool CheckAchievementCriteriaMeet (uint32 criteria_id, Player const *source, Unit const *, uint32) override
 
void DoAction (int32 action) 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 m_uiSartharionGUID
 
ObjectGuid m_uiTenebronGUID
 
ObjectGuid m_uiShadronGUID
 
ObjectGuid m_uiVesperonGUID
 
ObjectGuid m_uiPortalGUID
 
uint8 portalCount
 

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

instance_obsidian_sanctum::instance_obsidian_sanctum_InstanceMapScript::instance_obsidian_sanctum_InstanceMapScript ( Map pMap)
inline
42 : InstanceScript(pMap), portalCount(0)
43 {
47 }
BossBoundaryData const boundaries
Definition: instance_obsidian_sanctum.cpp:25
@ MAX_ENCOUNTERS
Definition: deadmines.h:30
#define DataHeader
Definition: blackrock_depths.h:23
Definition: InstanceScript.h:142
void SetBossNumber(uint32 number)
Definition: InstanceScript.h:285
void LoadBossBoundaries(BossBoundaryData const &data)
Definition: InstanceScript.cpp:134
void SetHeaders(std::string const &dataHeaders)
Definition: InstanceScript.cpp:141
uint8 portalCount
Definition: instance_obsidian_sanctum.cpp:189

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

Member Function Documentation

◆ CheckAchievementCriteriaMeet()

bool instance_obsidian_sanctum::instance_obsidian_sanctum_InstanceMapScript::CheckAchievementCriteriaMeet ( uint32  criteria_id,
Player const *  source,
Unit const *  ,
uint32   
)
inlineoverridevirtual

Reimplemented from InstanceScript.

86 {
87 switch (criteria_id)
88 {
89 // Gonna Go When the Volcano Blows (10 player) (2047)
90 case 7326:
91 // Gonna Go When the Volcano Blows (25 player) (2048)
92 case 7327:
93 {
94 Creature const* sartharion = instance->GetCreature(m_uiSartharionGUID);
95 return sartharion && !sartharion->AI()->GetData(source->GetGUID().GetCounter());
96 }
97 // Less Is More (10 player) (624)
98 case 7189:
99 case 7190:
100 case 7191:
101 case 522:
102 {
104 }
105 // Less Is More (25 player) (1877)
106 case 7185:
107 case 7186:
108 case 7187:
109 case 7188:
110 {
111 return instance->GetPlayersCountExceptGMs() < 21;
112 }
113 // Twilight Assist (10 player) (2049)
114 case 7328:
115 // Twilight Assist (25 player) (2052)
116 case 7331:
117 {
118 Creature const* sartharion = instance->GetCreature(m_uiSartharionGUID);
119 return sartharion && sartharion->AI()->GetData(DATA_ACHIEVEMENT_DRAGONS_COUNT) >= 1;
120 }
121 // Twilight Duo (10 player) (2050)
122 case 7329:
123 // Twilight Duo (25 player) (2053)
124 case 7332:
125 {
126 Creature const* sartharion = instance->GetCreature(m_uiSartharionGUID);
127 return sartharion && sartharion->AI()->GetData(DATA_ACHIEVEMENT_DRAGONS_COUNT) >= 2;
128 }
129 // Twilight Zone (10 player) (2051)
130 case 7330:
131 // Twilight Zone (25 player) (2054)
132 case 7333:
133 {
134 Creature const* sartharion = instance->GetCreature(m_uiSartharionGUID);
135 return sartharion && sartharion->AI()->GetData(DATA_ACHIEVEMENT_DRAGONS_COUNT) >= 3;
136 }
137 }
138
139 return false;
140 }
@ DATA_ACHIEVEMENT_DRAGONS_COUNT
Definition: obsidian_sanctum.h:37
virtual uint32 GetData(uint32) const
Definition: UnitAI.h:213
Definition: Creature.h:43
CreatureAI * AI() const
Definition: Creature.h:140
Map * instance
Definition: InstanceScript.h:148
Creature * GetCreature(ObjectGuid const guid)
Definition: Map.cpp:3317
uint32 GetPlayersCountExceptGMs() const
Definition: Map.cpp:2748
ObjectGuid m_uiSartharionGUID
Definition: instance_obsidian_sanctum.cpp:184

References Creature::AI(), DATA_ACHIEVEMENT_DRAGONS_COUNT, ObjectGuid::GetCounter(), Map::GetCreature(), UnitAI::GetData(), Object::GetGUID(), Map::GetPlayersCountExceptGMs(), InstanceScript::instance, and m_uiSartharionGUID.

◆ DoAction()

void instance_obsidian_sanctum::instance_obsidian_sanctum_InstanceMapScript::DoAction ( int32  action)
inlineoverridevirtual

Reimplemented from InstanceScript.

143 {
144 switch (action)
145 {
147 {
148 if (!m_uiPortalGUID)
149 {
151 {
152 if (GameObject* portal = sartharion->SummonGameObject(GO_TWILIGHT_PORTAL, 3247.29f, 529.804f, 58.9595f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0))
153 {
154 sartharion->RemoveGameObject(portal, false);
155 m_uiPortalGUID = portal->GetGUID();
156 }
157 }
158
159 portalCount = 0;
160 }
161
162 ++portalCount;
163 break;
164 }
166 {
167 --portalCount;
168 if (!portalCount)
169 {
171 {
172 go->Delete();
173 }
174
177 }
178 break;
179 }
180 }
181 }
@ ACTION_ADD_PORTAL
Definition: obsidian_sanctum.h:60
@ ACTION_CLEAR_PORTAL
Definition: obsidian_sanctum.h:59
@ GO_TWILIGHT_PORTAL
Definition: obsidian_sanctum.h:48
@ SPELL_TWILIGHT_SHIFT
Definition: obsidian_sanctum.h:52
Definition: GameObject.h:120
GameObject * SummonGameObject(uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime, bool checkTransport=true, GOSummonType summonType=GO_SUMMON_TIMED_OR_CORPSE_DESPAWN)
Definition: Object.cpp:2380
void Clear()
Definition: ObjectGuid.h:138
void DoRemoveAurasDueToSpellOnPlayers(uint32 spell)
Definition: InstanceScript.cpp:665
GameObject * GetGameObject(ObjectGuid const guid)
Definition: Map.cpp:3322
ObjectGuid m_uiPortalGUID
Definition: instance_obsidian_sanctum.cpp:188

References ACTION_ADD_PORTAL, ACTION_CLEAR_PORTAL, ObjectGuid::Clear(), InstanceScript::DoRemoveAurasDueToSpellOnPlayers(), Map::GetCreature(), Map::GetGameObject(), GO_TWILIGHT_PORTAL, InstanceScript::instance, m_uiPortalGUID, m_uiSartharionGUID, portalCount, SPELL_TWILIGHT_SHIFT, and WorldObject::SummonGameObject().

◆ GetGuidData()

ObjectGuid instance_obsidian_sanctum::instance_obsidian_sanctum_InstanceMapScript::GetGuidData ( uint32  uiData) const
inlineoverridevirtual

Reimplemented from InstanceScript.

69 {
70 switch (uiData)
71 {
72 case DATA_SARTHARION:
73 return m_uiSartharionGUID;
74 case DATA_TENEBRON:
75 return m_uiTenebronGUID;
76 case DATA_SHADRON:
77 return m_uiShadronGUID;
78 case DATA_VESPERON:
79 return m_uiVesperonGUID;
80 }
81
82 return ObjectGuid::Empty;
83 }
@ DATA_VESPERON
Definition: obsidian_sanctum.h:32
@ DATA_TENEBRON
Definition: obsidian_sanctum.h:31
@ DATA_SARTHARION
Definition: obsidian_sanctum.h:30
@ DATA_SHADRON
Definition: obsidian_sanctum.h:33
static ObjectGuid const Empty
Definition: ObjectGuid.h:120
ObjectGuid m_uiShadronGUID
Definition: instance_obsidian_sanctum.cpp:186
ObjectGuid m_uiVesperonGUID
Definition: instance_obsidian_sanctum.cpp:187
ObjectGuid m_uiTenebronGUID
Definition: instance_obsidian_sanctum.cpp:185

References DATA_SARTHARION, DATA_SHADRON, DATA_TENEBRON, DATA_VESPERON, ObjectGuid::Empty, m_uiSartharionGUID, m_uiShadronGUID, m_uiTenebronGUID, and m_uiVesperonGUID.

◆ OnCreatureCreate()

void instance_obsidian_sanctum::instance_obsidian_sanctum_InstanceMapScript::OnCreatureCreate ( Creature pCreature)
inlineoverridevirtual

Reimplemented from InstanceScript.

50 {
51 switch (pCreature->GetEntry())
52 {
53 case NPC_SARTHARION:
54 m_uiSartharionGUID = pCreature->GetGUID();
55 break;
56 case NPC_TENEBRON:
57 m_uiTenebronGUID = pCreature->GetGUID();
58 break;
59 case NPC_SHADRON:
60 m_uiShadronGUID = pCreature->GetGUID();
61 break;
62 case NPC_VESPERON:
63 m_uiVesperonGUID = pCreature->GetGUID();
64 break;
65 }
66 }
@ NPC_VESPERON
Definition: obsidian_sanctum.h:44
@ NPC_SHADRON
Definition: obsidian_sanctum.h:43
@ NPC_TENEBRON
Definition: obsidian_sanctum.h:42
@ NPC_SARTHARION
Definition: ScriptedCreature.cpp:567
uint32 GetEntry() const
Definition: Object.h:115
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:112

References Object::GetEntry(), Object::GetGUID(), m_uiSartharionGUID, m_uiShadronGUID, m_uiTenebronGUID, m_uiVesperonGUID, NPC_SARTHARION, NPC_SHADRON, NPC_TENEBRON, and NPC_VESPERON.

Member Data Documentation

◆ m_uiPortalGUID

ObjectGuid instance_obsidian_sanctum::instance_obsidian_sanctum_InstanceMapScript::m_uiPortalGUID
private

Referenced by DoAction().

◆ m_uiSartharionGUID

ObjectGuid instance_obsidian_sanctum::instance_obsidian_sanctum_InstanceMapScript::m_uiSartharionGUID
private

◆ m_uiShadronGUID

ObjectGuid instance_obsidian_sanctum::instance_obsidian_sanctum_InstanceMapScript::m_uiShadronGUID
private

Referenced by GetGuidData(), and OnCreatureCreate().

◆ m_uiTenebronGUID

ObjectGuid instance_obsidian_sanctum::instance_obsidian_sanctum_InstanceMapScript::m_uiTenebronGUID
private

Referenced by GetGuidData(), and OnCreatureCreate().

◆ m_uiVesperonGUID

ObjectGuid instance_obsidian_sanctum::instance_obsidian_sanctum_InstanceMapScript::m_uiVesperonGUID
private

Referenced by GetGuidData(), and OnCreatureCreate().

◆ portalCount

uint8 instance_obsidian_sanctum::instance_obsidian_sanctum_InstanceMapScript::portalCount
private

Referenced by DoAction().