AzeorthCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
instance_serpent_shrine::instance_serpentshrine_cavern_InstanceMapScript Struct Reference
Inheritance diagram for instance_serpent_shrine::instance_serpentshrine_cavern_InstanceMapScript:
InstanceScript ZoneScript

Public Member Functions

 instance_serpentshrine_cavern_InstanceMapScript (Map *map)
 
void Initialize () override
 
bool SetBossState (uint32 type, EncounterState state) override
 
void OnGameObjectCreate (GameObject *go) override
 
void OnGameObjectRemove (GameObject *go) override
 
void OnCreatureCreate (Creature *creature) override
 
ObjectGuid GetGuidData (uint32 identifier) const override
 
void SetData (uint32 type, uint32) override
 
uint32 GetData (uint32 type) const override
 
std::string GetSaveData () override
 
void Load (char const *str) 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)
 
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)
 
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
 
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)
 
- 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 LadyVashjGUID
 
ObjectGuid ShieldGeneratorGUID [4]
 
ObjectGuid LurkerBelowGUID
 
ObjectGuid LeotherasTheBlindGUID
 
int32 AliveKeepersCount
 

Additional Inherited Members

- Static Public Member Functions inherited from InstanceScript
static std::string GetBossStateName (uint8 state)
 
- Public Attributes inherited from InstanceScript
Mapinstance
 
- Protected Member Functions inherited from InstanceScript
void SetBossNumber (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)
 
void AddObject (GameObject *obj, bool add)
 
void AddObject (WorldObject *obj, uint32 type, bool add)
 
void AddDoor (GameObject *door, bool add)
 
void AddMinion (Creature *minion, bool add)
 
void UpdateDoorState (GameObject *door)
 
void UpdateMinionState (Creature *minion, EncounterState state)
 
std::string LoadBossState (char const *data)
 
std::string GetBossSaveData ()
 

Detailed Description

Constructor & Destructor Documentation

◆ instance_serpentshrine_cavern_InstanceMapScript()

instance_serpent_shrine::instance_serpentshrine_cavern_InstanceMapScript::instance_serpentshrine_cavern_InstanceMapScript ( Map map)
inline
39 : InstanceScript(map)
40 {
41 }
Definition: InstanceScript.h:140

Member Function Documentation

◆ GetData()

uint32 instance_serpent_shrine::instance_serpentshrine_cavern_InstanceMapScript::GetData ( uint32  type) const
inlineoverridevirtual

Reimplemented from ZoneScript.

169 {
170 if (type == DATA_ALIVE_KEEPERS)
171 return AliveKeepersCount;
172
173 return 0;
174 }
@ DATA_ALIVE_KEEPERS
Definition: serpent_shrine.h:43
int32 AliveKeepersCount
Definition: instance_serpent_shrine.cpp:224

References AliveKeepersCount, and DATA_ALIVE_KEEPERS.

◆ GetGuidData()

ObjectGuid instance_serpent_shrine::instance_serpentshrine_cavern_InstanceMapScript::GetGuidData ( uint32  identifier) const
inlineoverridevirtual

Reimplemented from InstanceScript.

128 {
129 switch (identifier)
130 {
132 return LurkerBelowGUID;
135 case NPC_LADY_VASHJ:
136 return LadyVashjGUID;
137 }
138
139 return ObjectGuid::Empty;
140 }
@ NPC_LADY_VASHJ
Definition: serpent_shrine.h:54
@ NPC_LEOTHERAS_THE_BLIND
Definition: serpent_shrine.h:52
@ NPC_THE_LURKER_BELOW
Definition: serpent_shrine.h:51
static ObjectGuid const Empty
Definition: ObjectGuid.h:122
ObjectGuid LurkerBelowGUID
Definition: instance_serpent_shrine.cpp:222
ObjectGuid LadyVashjGUID
Definition: instance_serpent_shrine.cpp:220
ObjectGuid LeotherasTheBlindGUID
Definition: instance_serpent_shrine.cpp:223

References ObjectGuid::Empty, LadyVashjGUID, LeotherasTheBlindGUID, LurkerBelowGUID, NPC_LADY_VASHJ, NPC_LEOTHERAS_THE_BLIND, and NPC_THE_LURKER_BELOW.

◆ GetSaveData()

std::string instance_serpent_shrine::instance_serpentshrine_cavern_InstanceMapScript::GetSaveData ( )
inlineoverridevirtual

Reimplemented from InstanceScript.

177 {
179
180 std::ostringstream saveStream;
181 saveStream << "S C " << GetBossSaveData();
182
184 return saveStream.str();
185 }
#define OUT_SAVE_INST_DATA_COMPLETE
Definition: InstanceScript.h:28
#define OUT_SAVE_INST_DATA
Definition: InstanceScript.h:27
std::string GetBossSaveData()
Definition: InstanceScript.cpp:357

References InstanceScript::GetBossSaveData(), OUT_SAVE_INST_DATA, and OUT_SAVE_INST_DATA_COMPLETE.

◆ Initialize()

void instance_serpent_shrine::instance_serpentshrine_cavern_InstanceMapScript::Initialize ( )
inlineoverridevirtual

Reimplemented from InstanceScript.

44 {
47
49 }
@ MAX_ENCOUNTERS
Definition: deadmines.h:29
DoorData const doorData[]
Definition: instance_serpent_shrine.cpp:24
void SetBossNumber(uint32 number)
Definition: InstanceScript.h:258
void LoadDoorData(DoorData const *data)
Definition: InstanceScript.cpp:148

References AliveKeepersCount, doorData, InstanceScript::LoadDoorData(), MAX_ENCOUNTERS, and InstanceScript::SetBossNumber().

◆ Load()

void instance_serpent_shrine::instance_serpentshrine_cavern_InstanceMapScript::Load ( char const *  str)
inlineoverridevirtual

Reimplemented from InstanceScript.

188 {
189 if (!str)
190 {
192 return;
193 }
194
196
197 char dataHead1, dataHead2;
198
199 std::istringstream loadStream(str);
200 loadStream >> dataHead1 >> dataHead2;
201
202 if (dataHead1 == 'S' && dataHead2 == 'C')
203 {
204 for (uint8 i = 0; i < MAX_ENCOUNTERS; ++i)
205 {
206 uint32 tmpState;
207 loadStream >> tmpState;
208 if (tmpState == IN_PROGRESS || tmpState > SPECIAL)
209 tmpState = NOT_STARTED;
210 SetBossState(i, EncounterState(tmpState));
211 }
212 }
213 else
215
217 }
std::uint8_t uint8
Definition: Define.h:110
std::uint32_t uint32
Definition: Define.h:108
#define OUT_LOAD_INST_DATA_FAIL
Definition: InstanceScript.h:31
EncounterState
Definition: InstanceScript.h:55
@ IN_PROGRESS
Definition: InstanceScript.h:57
@ SPECIAL
Definition: InstanceScript.h:60
@ NOT_STARTED
Definition: InstanceScript.h:56
#define OUT_LOAD_INST_DATA_COMPLETE
Definition: InstanceScript.h:30
#define OUT_LOAD_INST_DATA(a)
Definition: InstanceScript.h:29
bool SetBossState(uint32 type, EncounterState state) override
Definition: instance_serpent_shrine.cpp:51

References IN_PROGRESS, MAX_ENCOUNTERS, NOT_STARTED, OUT_LOAD_INST_DATA, OUT_LOAD_INST_DATA_COMPLETE, OUT_LOAD_INST_DATA_FAIL, SetBossState(), and SPECIAL.

◆ OnCreatureCreate()

void instance_serpent_shrine::instance_serpentshrine_cavern_InstanceMapScript::OnCreatureCreate ( Creature creature)
inlineoverridevirtual

Reimplemented from InstanceScript.

97 {
98 switch (creature->GetEntry())
99 {
102 if (creature->GetPositionX() > -110.0f && creature->GetPositionX() < 155.0f && creature->GetPositionY() > -610.0f && creature->GetPositionY() < -280.0f)
103 AliveKeepersCount += creature->IsAlive() ? 0 : -1; // SmartAI calls JUST_RESPAWNED in AIInit...
104 break;
106 LurkerBelowGUID = creature->GetGUID();
107 break;
109 LeotherasTheBlindGUID = creature->GetGUID();
110 break;
112 creature->GetMotionMaster()->MoveRandom(50.0f);
113 break;
114 case NPC_LADY_VASHJ:
115 LadyVashjGUID = creature->GetGUID();
116 break;
122 vashj->AI()->JustSummoned(creature);
123 break;
124 }
125 }
@ NPC_CYCLONE_KARATHRESS
Definition: serpent_shrine.h:53
@ NPC_ENCHANTED_ELEMENTAL
Definition: serpent_shrine.h:59
@ NPC_TAINTED_ELEMENTAL
Definition: serpent_shrine.h:62
@ NPC_COILFANG_PRIESTESS
Definition: serpent_shrine.h:57
@ NPC_COILFANG_ELITE
Definition: serpent_shrine.h:60
@ NPC_COILFANG_SHATTERER
Definition: serpent_shrine.h:56
@ NPC_COILFANG_STRIDER
Definition: serpent_shrine.h:61
Definition: Creature.h:46
uint32 GetEntry() const
Definition: Object.h:109
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:106
float GetPositionX() const
Definition: Position.h:117
float GetPositionY() const
Definition: Position.h:118
MotionMaster * GetMotionMaster()
Definition: Unit.h:2530
bool IsAlive() const
Definition: Unit.h:2024
Map * instance
Definition: InstanceScript.h:146
Creature * GetCreature(ObjectGuid const guid)
Definition: Map.cpp:3290
void MoveRandom(float wanderDistance=0.0f)
Definition: MotionMaster.cpp:238

References AliveKeepersCount, Map::GetCreature(), Object::GetEntry(), Object::GetGUID(), Unit::GetMotionMaster(), Position::GetPositionX(), Position::GetPositionY(), InstanceScript::instance, Unit::IsAlive(), LadyVashjGUID, LeotherasTheBlindGUID, LurkerBelowGUID, MotionMaster::MoveRandom(), NPC_COILFANG_ELITE, NPC_COILFANG_PRIESTESS, NPC_COILFANG_SHATTERER, NPC_COILFANG_STRIDER, NPC_CYCLONE_KARATHRESS, NPC_ENCHANTED_ELEMENTAL, NPC_LADY_VASHJ, NPC_LEOTHERAS_THE_BLIND, NPC_TAINTED_ELEMENTAL, and NPC_THE_LURKER_BELOW.

◆ OnGameObjectCreate()

void instance_serpent_shrine::instance_serpentshrine_cavern_InstanceMapScript::OnGameObjectCreate ( GameObject go)
inlineoverridevirtual

Reimplemented from InstanceScript.

65 {
66 switch (go->GetEntry())
67 {
72 AddDoor(go, true);
73 break;
79 break;
80 }
81 }
@ GO_SHIELD_GENERATOR2
Definition: serpent_shrine.h:71
@ GO_COILFANG_BRIDGE3
Definition: serpent_shrine.h:68
@ GO_SHIELD_GENERATOR1
Definition: serpent_shrine.h:70
@ GO_LADY_VASHJ_BRIDGE_CONSOLE
Definition: serpent_shrine.h:65
@ GO_SHIELD_GENERATOR3
Definition: serpent_shrine.h:72
@ GO_SHIELD_GENERATOR4
Definition: serpent_shrine.h:73
@ GO_COILFANG_BRIDGE1
Definition: serpent_shrine.h:66
@ GO_COILFANG_BRIDGE2
Definition: serpent_shrine.h:67
void AddDoor(GameObject *door, bool add)
Definition: InstanceScript.cpp:271
ObjectGuid ShieldGeneratorGUID[4]
Definition: instance_serpent_shrine.cpp:221

References InstanceScript::AddDoor(), Object::GetEntry(), Object::GetGUID(), GO_COILFANG_BRIDGE1, GO_COILFANG_BRIDGE2, GO_COILFANG_BRIDGE3, GO_LADY_VASHJ_BRIDGE_CONSOLE, GO_SHIELD_GENERATOR1, GO_SHIELD_GENERATOR2, GO_SHIELD_GENERATOR3, GO_SHIELD_GENERATOR4, and ShieldGeneratorGUID.

◆ OnGameObjectRemove()

void instance_serpent_shrine::instance_serpentshrine_cavern_InstanceMapScript::OnGameObjectRemove ( GameObject go)
inlineoverridevirtual

◆ SetBossState()

bool instance_serpent_shrine::instance_serpentshrine_cavern_InstanceMapScript::SetBossState ( uint32  type,
EncounterState  state 
)
inlineoverridevirtual

Reimplemented from InstanceScript.

52 {
53 if (!InstanceScript::SetBossState(type, state))
54 return false;
55
56 if (type == DATA_LADY_VASHJ)
57 for (uint8 i = 0; i < 4; ++i)
59 gobject->SetGameObjectFlag(GO_FLAG_NOT_SELECTABLE);
60
61 return true;
62 }
@ DATA_LADY_VASHJ
Definition: serpent_shrine.h:38
@ GO_FLAG_NOT_SELECTABLE
Definition: SharedDefines.h:1579
Definition: GameObject.h:813
virtual bool SetBossState(uint32 id, EncounterState state)
Definition: InstanceScript.cpp:305
GameObject * GetGameObject(ObjectGuid const guid)
Definition: Map.cpp:3295

References DATA_LADY_VASHJ, Map::GetGameObject(), GO_FLAG_NOT_SELECTABLE, InstanceScript::instance, InstanceScript::SetBossState(), and ShieldGeneratorGUID.

Referenced by Load(), and SetData().

◆ SetData()

void instance_serpent_shrine::instance_serpentshrine_cavern_InstanceMapScript::SetData ( uint32  type,
uint32   
)
inlineoverridevirtual

Reimplemented from ZoneScript.

143 {
144 switch (type)
145 {
148 break;
151 break;
155 break;
158 for (uint8 i = 0; i < 4; ++i)
160 {
161 gobject->RemoveGameObjectFlag(GO_FLAG_NOT_SELECTABLE);
162 vashj->SummonTrigger(gobject->GetPositionX(), gobject->GetPositionY(), gobject->GetPositionZ(), 0.0f, 0);
163 }
164 break;
165 }
166 }
@ DONE
Definition: InstanceScript.h:59
@ DATA_PLATFORM_KEEPER_RESPAWNED
Definition: serpent_shrine.h:41
@ DATA_PLATFORM_KEEPER_DIED
Definition: serpent_shrine.h:42
@ DATA_ACTIVATE_SHIELD
Definition: serpent_shrine.h:45
@ DATA_BRIDGE_EMERGED
Definition: serpent_shrine.h:37
@ DATA_BRIDGE_ACTIVATED
Definition: serpent_shrine.h:44

References AliveKeepersCount, DATA_ACTIVATE_SHIELD, DATA_BRIDGE_ACTIVATED, DATA_BRIDGE_EMERGED, DATA_PLATFORM_KEEPER_DIED, DATA_PLATFORM_KEEPER_RESPAWNED, DONE, Map::GetCreature(), Map::GetGameObject(), GO_FLAG_NOT_SELECTABLE, InstanceScript::instance, LadyVashjGUID, NOT_STARTED, SetBossState(), and ShieldGeneratorGUID.

Member Data Documentation

◆ AliveKeepersCount

int32 instance_serpent_shrine::instance_serpentshrine_cavern_InstanceMapScript::AliveKeepersCount
private

◆ LadyVashjGUID

ObjectGuid instance_serpent_shrine::instance_serpentshrine_cavern_InstanceMapScript::LadyVashjGUID
private

◆ LeotherasTheBlindGUID

ObjectGuid instance_serpent_shrine::instance_serpentshrine_cavern_InstanceMapScript::LeotherasTheBlindGUID
private

Referenced by GetGuidData(), and OnCreatureCreate().

◆ LurkerBelowGUID

ObjectGuid instance_serpent_shrine::instance_serpentshrine_cavern_InstanceMapScript::LurkerBelowGUID
private

Referenced by GetGuidData(), and OnCreatureCreate().

◆ ShieldGeneratorGUID

ObjectGuid instance_serpent_shrine::instance_serpentshrine_cavern_InstanceMapScript::ShieldGeneratorGUID[4]
private