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

Public Member Functions

 instance_wailing_caverns_InstanceMapScript (Map *map)
 
void Initialize () override
 
void OnCreatureCreate (Creature *creature) override
 
void SetData (uint32 type, uint32 data) override
 
uint32 GetData (uint32 type) const override
 
std::string GetSaveData () override
 
void Load (const char *in) 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

uint32 _encounters [MAX_ENCOUNTERS]
 
ObjectGuid DiscipleOfNaralexGUID
 
ObjectGuid SerpentisGUID
 

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

instance_wailing_caverns::instance_wailing_caverns_InstanceMapScript::instance_wailing_caverns_InstanceMapScript ( Map map)
inline
34: InstanceScript(map) { }
Definition: InstanceScript.h:140

Member Function Documentation

◆ GetData()

uint32 instance_wailing_caverns::instance_wailing_caverns_InstanceMapScript::GetData ( uint32  type) const
inlineoverridevirtual

Reimplemented from ZoneScript.

82 {
83 switch (type)
84 {
89 return _encounters[type];
90 }
91 return 0;
92 }
@ TYPE_LADY_ANACONDRA
Definition: wailing_caverns.h:27
@ TYPE_LORD_SERPENTIS
Definition: wailing_caverns.h:28
@ TYPE_LORD_COBRAHN
Definition: wailing_caverns.h:25
@ TYPE_LORD_PYTHAS
Definition: wailing_caverns.h:26
uint32 _encounters[MAX_ENCOUNTERS]
Definition: instance_wailing_caverns.cpp:121

References _encounters, TYPE_LADY_ANACONDRA, TYPE_LORD_COBRAHN, TYPE_LORD_PYTHAS, and TYPE_LORD_SERPENTIS.

◆ GetSaveData()

std::string instance_wailing_caverns::instance_wailing_caverns_InstanceMapScript::GetSaveData ( )
inlineoverridevirtual

Reimplemented from InstanceScript.

95 {
96 std::ostringstream saveStream;
97 saveStream << "W C " << _encounters[0] << ' ' << _encounters[1] << ' ' << _encounters[2] << ' ' << _encounters[3] << ' ' << _encounters[4];
98 return saveStream.str();
99 }

References _encounters.

◆ Initialize()

void instance_wailing_caverns::instance_wailing_caverns_InstanceMapScript::Initialize ( )
inlineoverridevirtual

Reimplemented from InstanceScript.

37 {
38 memset(&_encounters, 0, sizeof(_encounters));
39 }

References _encounters.

◆ Load()

void instance_wailing_caverns::instance_wailing_caverns_InstanceMapScript::Load ( const char *  in)
inlineoverridevirtual

Reimplemented from InstanceScript.

102 {
103 if (!in)
104 return;
105
106 char dataHead1, dataHead2;
107 std::istringstream loadStream(in);
108 loadStream >> dataHead1 >> dataHead2;
109 if (dataHead1 == 'W' && dataHead2 == 'C')
110 {
111 for (uint8 i = 0; i < MAX_ENCOUNTERS; ++i)
112 {
113 loadStream >> _encounters[i];
114 if (_encounters[i] == IN_PROGRESS)
116 }
117 }
118 }
std::uint8_t uint8
Definition: Define.h:110
@ IN_PROGRESS
Definition: InstanceScript.h:57
@ NOT_STARTED
Definition: InstanceScript.h:56
@ MAX_ENCOUNTERS
Definition: deadmines.h:29

References _encounters, IN_PROGRESS, MAX_ENCOUNTERS, and NOT_STARTED.

◆ OnCreatureCreate()

void instance_wailing_caverns::instance_wailing_caverns_InstanceMapScript::OnCreatureCreate ( Creature creature)
inlineoverridevirtual

Reimplemented from InstanceScript.

42 {
43 if (creature->GetEntry() == NPC_DISCIPLE_OF_NARALEX)
44 DiscipleOfNaralexGUID = creature->GetGUID();
45 else if (creature->GetEntry() == NPC_LORD_SERPENTIS)
46 SerpentisGUID = creature->GetGUID();
47 }
@ NPC_DISCIPLE_OF_NARALEX
Definition: wailing_caverns.h:32
@ NPC_LORD_SERPENTIS
Definition: wailing_caverns.h:33
uint32 GetEntry() const
Definition: Object.h:109
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:106
ObjectGuid SerpentisGUID
Definition: instance_wailing_caverns.cpp:123
ObjectGuid DiscipleOfNaralexGUID
Definition: instance_wailing_caverns.cpp:122

References DiscipleOfNaralexGUID, Object::GetEntry(), Object::GetGUID(), NPC_DISCIPLE_OF_NARALEX, NPC_LORD_SERPENTIS, and SerpentisGUID.

◆ SetData()

void instance_wailing_caverns::instance_wailing_caverns_InstanceMapScript::SetData ( uint32  type,
uint32  data 
)
inlineoverridevirtual

Reimplemented from ZoneScript.

50 {
51 switch (type)
52 {
57 case TYPE_MUTANUS:
58 _encounters[type] = data;
59 break;
60 }
61
62 if (data == DONE)
63 SaveToDB();
64
66 {
67 instance->LoadGrid(-120.163f, -24.624f);
68 if (Creature* serpentis = instance->GetCreature(SerpentisGUID))
69 serpentis->AI()->Talk(SAY_SERPENTIS);
70 }
71
74 {
75 instance->LoadGrid(-134.97f, 125.402f);
77 disciple->AI()->Talk(SAY_DISCIPLE);
78 }
79 }
@ DONE
Definition: InstanceScript.h:59
@ SAY_DISCIPLE
Definition: wailing_caverns.h:35
@ TYPE_MUTANUS
Definition: wailing_caverns.h:29
@ SAY_SERPENTIS
Definition: wailing_caverns.h:36
Definition: Creature.h:46
Map * instance
Definition: InstanceScript.h:146
void SaveToDB()
Definition: InstanceScript.cpp:40
void LoadGrid(float x, float y)
Definition: Map.cpp:494
Creature * GetCreature(ObjectGuid const guid)
Definition: Map.cpp:3290

References _encounters, DiscipleOfNaralexGUID, DONE, Map::GetCreature(), InstanceScript::instance, Map::LoadGrid(), InstanceScript::SaveToDB(), SAY_DISCIPLE, SAY_SERPENTIS, SerpentisGUID, TYPE_LADY_ANACONDRA, TYPE_LORD_COBRAHN, TYPE_LORD_PYTHAS, TYPE_LORD_SERPENTIS, and TYPE_MUTANUS.

Member Data Documentation

◆ _encounters

uint32 instance_wailing_caverns::instance_wailing_caverns_InstanceMapScript::_encounters[MAX_ENCOUNTERS]
private

◆ DiscipleOfNaralexGUID

ObjectGuid instance_wailing_caverns::instance_wailing_caverns_InstanceMapScript::DiscipleOfNaralexGUID
private

Referenced by OnCreatureCreate(), and SetData().

◆ SerpentisGUID

ObjectGuid instance_wailing_caverns::instance_wailing_caverns_InstanceMapScript::SerpentisGUID
private

Referenced by OnCreatureCreate(), and SetData().