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

Public Member Functions

 instance_shadowfang_keep_InstanceMapScript (Map *map)
 
void Initialize () override
 
void OnCreatureCreate (Creature *creature) override
 
void OnGameObjectCreate (GameObject *gameobject) override
 
void SetData (uint32 type, uint32 data) 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)
 

Private Attributes

uint32 _encounters [MAX_ENCOUNTERS]
 
GuidVector _crazedApothecaryGeneratorGUIDs
 
ObjectGuid _apothecaryHummel
 

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

instance_shadowfang_keep::instance_shadowfang_keep_InstanceMapScript::instance_shadowfang_keep_InstanceMapScript ( Map map)
inline
43 : InstanceScript(map)
44 {
46 }
#define DataHeader
Definition: blackrock_depths.h:23
Definition: InstanceScript.h:142
void SetHeaders(std::string const &dataHeaders)
Definition: InstanceScript.cpp:141

References DataHeader, and InstanceScript::SetHeaders().

Member Function Documentation

◆ Initialize()

void instance_shadowfang_keep::instance_shadowfang_keep_InstanceMapScript::Initialize ( )
inlineoverridevirtual

Reimplemented from InstanceScript.

49 {
50 memset(&_encounters, 0, sizeof(_encounters));
51 }
uint32 _encounters[MAX_ENCOUNTERS]
Definition: instance_shadowfang_keep.cpp:134

References _encounters.

◆ OnCreatureCreate()

void instance_shadowfang_keep::instance_shadowfang_keep_InstanceMapScript::OnCreatureCreate ( Creature creature)
inlineoverridevirtual

Reimplemented from InstanceScript.

54 {
55 switch (creature->GetEntry())
56 {
58 _crazedApothecaryGeneratorGUIDs.push_back(creature->GetGUID());
59 break;
61 _apothecaryHummel = creature->GetGUID();
62 break;
65 {
66 hummel->AI()->JustSummoned(creature);
67 }
68 break;
69 default:
70 break;
71 }
72 }
@ NPC_APOTHECARY_HUMMEL
Definition: shadowfang_keep.h:39
@ NPC_CRAZED_APOTHECARY
Definition: shadowfang_keep.h:40
@ NPC_DND_CRAZED_APOTHECARY_GENERATOR
Definition: shadowfang_keep.h:38
Definition: Creature.h:43
uint32 GetEntry() const
Definition: Object.h:115
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:112
Map * instance
Definition: InstanceScript.h:148
Creature * GetCreature(ObjectGuid const guid)
Definition: Map.cpp:3317
GuidVector _crazedApothecaryGeneratorGUIDs
Definition: instance_shadowfang_keep.cpp:135
ObjectGuid _apothecaryHummel
Definition: instance_shadowfang_keep.cpp:136

References _apothecaryHummel, _crazedApothecaryGeneratorGUIDs, Map::GetCreature(), Object::GetEntry(), Object::GetGUID(), InstanceScript::instance, NPC_APOTHECARY_HUMMEL, NPC_CRAZED_APOTHECARY, and NPC_DND_CRAZED_APOTHECARY_GENERATOR.

◆ OnGameObjectCreate()

void instance_shadowfang_keep::instance_shadowfang_keep_InstanceMapScript::OnGameObjectCreate ( GameObject gameobject)
inlineoverridevirtual

Reimplemented from InstanceScript.

75 {
76 switch (gameobject->GetEntry())
77 {
80 HandleGameObject(ObjectGuid::Empty, true, gameobject);
81 break;
84 HandleGameObject(ObjectGuid::Empty, true, gameobject);
85 break;
86 case GO_ARUGAL_DOOR:
88 HandleGameObject(ObjectGuid::Empty, true, gameobject);
89 break;
90 default:
91 break;
92 }
93 }
@ GO_COURTYARD_DOOR
Definition: shadowfang_keep.h:45
@ GO_SORCERER_DOOR
Definition: shadowfang_keep.h:46
@ GO_ARUGAL_DOOR
Definition: shadowfang_keep.h:47
@ TYPE_COURTYARD
Definition: shadowfang_keep.h:28
@ TYPE_FENRUS_THE_DEVOURER
Definition: shadowfang_keep.h:29
@ TYPE_WOLF_MASTER_NANDOS
Definition: shadowfang_keep.h:30
@ DONE
Definition: InstanceScript.h:60
static ObjectGuid const Empty
Definition: ObjectGuid.h:120
void HandleGameObject(ObjectGuid guid, bool open, GameObject *go=nullptr)
Definition: InstanceScript.cpp:113

References _encounters, DONE, ObjectGuid::Empty, Object::GetEntry(), GO_ARUGAL_DOOR, GO_COURTYARD_DOOR, GO_SORCERER_DOOR, InstanceScript::HandleGameObject(), TYPE_COURTYARD, TYPE_FENRUS_THE_DEVOURER, and TYPE_WOLF_MASTER_NANDOS.

◆ ReadSaveDataMore()

void instance_shadowfang_keep::instance_shadowfang_keep_InstanceMapScript::ReadSaveDataMore ( std::istringstream &  data)
inlineoverridevirtual

Reimplemented from InstanceScript.

122 {
123 data >> _encounters[0];
124 data >> _encounters[1];
125 data >> _encounters[2];
126 }

References _encounters.

◆ SetData()

void instance_shadowfang_keep::instance_shadowfang_keep_InstanceMapScript::SetData ( uint32  type,
uint32  data 
)
inlineoverridevirtual

Reimplemented from ZoneScript.

96 {
97 switch (type)
98 {
99 case TYPE_COURTYARD:
102 _encounters[type] = data;
103 break;
106 {
107 if (Creature* generator = instance->GetCreature(guid))
108 {
109 generator->CastSpell(nullptr, SPELL_SUMMON_VALENTINE_ADD);
110 }
111 }
112 break;
113 default:
114 break;
115 }
116
117 if (data == DONE)
118 SaveToDB();
119 }
@ SPELL_SUMMON_VALENTINE_ADD
Definition: instance_shadowfang_keep.cpp:28
@ DATA_SPAWN_VALENTINE_ADDS
Definition: shadowfang_keep.h:33
Definition: ObjectGuid.h:118
void SaveToDB()
Definition: InstanceScript.cpp:41

References _crazedApothecaryGeneratorGUIDs, _encounters, DATA_SPAWN_VALENTINE_ADDS, DONE, Map::GetCreature(), InstanceScript::instance, InstanceScript::SaveToDB(), SPELL_SUMMON_VALENTINE_ADD, TYPE_COURTYARD, TYPE_FENRUS_THE_DEVOURER, and TYPE_WOLF_MASTER_NANDOS.

◆ WriteSaveDataMore()

void instance_shadowfang_keep::instance_shadowfang_keep_InstanceMapScript::WriteSaveDataMore ( std::ostringstream &  data)
inlineoverridevirtual

Reimplemented from InstanceScript.

129 {
130 data << _encounters[0] << ' ' << _encounters[1] << ' ' << _encounters[2];
131 }

References _encounters.

Member Data Documentation

◆ _apothecaryHummel

ObjectGuid instance_shadowfang_keep::instance_shadowfang_keep_InstanceMapScript::_apothecaryHummel
private

Referenced by OnCreatureCreate().

◆ _crazedApothecaryGeneratorGUIDs

GuidVector instance_shadowfang_keep::instance_shadowfang_keep_InstanceMapScript::_crazedApothecaryGeneratorGUIDs
private

Referenced by OnCreatureCreate(), and SetData().

◆ _encounters

uint32 instance_shadowfang_keep::instance_shadowfang_keep_InstanceMapScript::_encounters[MAX_ENCOUNTERS]
private