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

Public Member Functions

 instance_shattered_halls_InstanceMapScript (Map *map)
 
void Initialize () override
 
void OnPlayerEnter (Player *player) override
 
void OnCreatureCreate (Creature *creature) override
 
void SetData (uint32 type, uint32 data) override
 
ObjectGuid GetGuidData (uint32 data) const override
 
void Update (uint32 diff) 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)
 

Protected Attributes

ObjectGuid executionerGUID
 
ObjectGuid prisonerGUID [3]
 
uint32 RescueTimer
 
TeamId TeamIdInInstance
 

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

instance_shattered_halls::instance_shattered_halls_InstanceMapScript::instance_shattered_halls_InstanceMapScript ( Map map)
inline
54: InstanceScript(map) { }
Definition: InstanceScript.h:142

Member Function Documentation

◆ GetGuidData()

ObjectGuid instance_shattered_halls::instance_shattered_halls_InstanceMapScript::GetGuidData ( uint32  data) const
inlineoverridevirtual

Reimplemented from InstanceScript.

123 {
124 switch (data)
125 {
126 case DATA_PRISONER_1:
127 case DATA_PRISONER_2:
128 case DATA_PRISONER_3:
129 return prisonerGUID[data - DATA_PRISONER_1];
130 case DATA_EXECUTIONER:
131 return executionerGUID;
132 }
133
134 return ObjectGuid::Empty;
135 }
@ DATA_PRISONER_1
Definition: shattered_halls.h:34
@ DATA_PRISONER_3
Definition: shattered_halls.h:36
@ DATA_PRISONER_2
Definition: shattered_halls.h:35
@ DATA_EXECUTIONER
Definition: shattered_halls.h:37
static ObjectGuid const Empty
Definition: ObjectGuid.h:120
ObjectGuid prisonerGUID[3]
Definition: instance_shattered_halls.cpp:180
ObjectGuid executionerGUID
Definition: instance_shattered_halls.cpp:179

References DATA_EXECUTIONER, DATA_PRISONER_1, DATA_PRISONER_2, DATA_PRISONER_3, ObjectGuid::Empty, executionerGUID, and prisonerGUID.

◆ Initialize()

void instance_shattered_halls::instance_shattered_halls_InstanceMapScript::Initialize ( )
inlineoverridevirtual

Reimplemented from InstanceScript.

57 {
61
64 }
constexpr auto IN_MILLISECONDS
Definition: Common.h:53
constexpr auto MINUTE
Definition: Common.h:47
@ ENCOUNTER_COUNT
Definition: shattered_halls.h:31
ObjectData const creatureData[]
Definition: instance_shattered_halls.cpp:25
DoorData const doorData[]
Definition: instance_shattered_halls.cpp:35
@ TEAM_NEUTRAL
Definition: SharedDefines.h:762
void SetBossNumber(uint32 number)
Definition: InstanceScript.h:285
void LoadDoorData(DoorData const *data)
Definition: InstanceScript.cpp:161
void LoadObjectData(ObjectData const *creatureData, ObjectData const *gameObjectData)
Definition: InstanceScript.cpp:173
TeamId TeamIdInInstance
Definition: instance_shattered_halls.cpp:182
uint32 RescueTimer
Definition: instance_shattered_halls.cpp:181

References creatureData, doorData, ENCOUNTER_COUNT, IN_MILLISECONDS, InstanceScript::LoadDoorData(), InstanceScript::LoadObjectData(), MINUTE, RescueTimer, InstanceScript::SetBossNumber(), TEAM_NEUTRAL, and TeamIdInInstance.

◆ OnCreatureCreate()

void instance_shattered_halls::instance_shattered_halls_InstanceMapScript::OnCreatureCreate ( Creature creature)
inlineoverridevirtual

Reimplemented from InstanceScript.

73 {
75 {
76 Map::PlayerList const& players = instance->GetPlayers();
77 if (!players.IsEmpty())
78 if (Player* player = players.begin()->GetSource())
79 TeamIdInInstance = player->GetTeamId();
80 }
81
82 switch (creature->GetEntry())
83 {
86 creature->AddLootMode(2);
87 executionerGUID = creature->GetGUID();
88 break;
92 prisonerGUID[0] = creature->GetGUID();
93 break;
97 prisonerGUID[1] = creature->GetGUID();
98 break;
101 creature->UpdateEntry(NPC_SCOUT_ORGARR);
102 prisonerGUID[2] = creature->GetGUID();
103 break;
104 }
106 }
@ NPC_RIFLEMAN_BROWNBEARD
Definition: shattered_halls.h:63
@ NPC_KORAG_PROUDMANE
Definition: shattered_halls.h:66
@ NPC_CAPTAIN_ALINA
Definition: shattered_halls.h:64
@ NPC_SHATTERED_EXECUTIONER
Definition: shattered_halls.h:62
@ NPC_PRIVATE_JACINT
Definition: shattered_halls.h:65
@ NPC_SCOUT_ORGARR
Definition: shattered_halls.h:68
@ NPC_CAPTAIN_BONESHATTER
Definition: shattered_halls.h:67
@ TEAM_HORDE
Definition: SharedDefines.h:761
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
void AddLootMode(uint16 lootMode)
Definition: Creature.h:244
uint32 GetEntry() const
Definition: Object.h:112
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:109
Definition: Player.h:1064
void OnCreatureCreate(Creature *creature) override
Definition: InstanceScript.cpp:58
Map * instance
Definition: InstanceScript.h:148
PlayerList const & GetPlayers() const
Definition: Map.h:486
Definition: MapRefMgr.h:26
iterator begin()
Definition: MapRefMgr.h:36

References Creature::AddLootMode(), MapRefMgr::begin(), executionerGUID, Object::GetEntry(), Object::GetGUID(), Map::GetPlayers(), Reference< TO, FROM >::GetSource(), IN_MILLISECONDS, InstanceScript::instance, LinkedListHead::IsEmpty(), MINUTE, NPC_CAPTAIN_ALINA, NPC_CAPTAIN_BONESHATTER, NPC_KORAG_PROUDMANE, NPC_PRIVATE_JACINT, NPC_RIFLEMAN_BROWNBEARD, NPC_SCOUT_ORGARR, NPC_SHATTERED_EXECUTIONER, InstanceScript::OnCreatureCreate(), prisonerGUID, RescueTimer, TEAM_HORDE, TEAM_NEUTRAL, TeamIdInInstance, and Creature::UpdateEntry().

◆ OnPlayerEnter()

void instance_shattered_halls::instance_shattered_halls_InstanceMapScript::OnPlayerEnter ( Player player)
inlineoverridevirtual

Reimplemented from InstanceScript.

67 {
69 TeamIdInInstance = player->GetTeamId();
70 }
TeamId GetTeamId(bool original=false) const
Definition: Player.h:2088

References Player::GetTeamId(), TEAM_NEUTRAL, and TeamIdInInstance.

◆ ReadSaveDataMore()

void instance_shattered_halls::instance_shattered_halls_InstanceMapScript::ReadSaveDataMore ( std::istringstream &  data)
inlineoverridevirtual

Reimplemented from InstanceScript.

169 {
170 data >> RescueTimer;
171 }

References RescueTimer.

◆ SetData()

void instance_shattered_halls::instance_shattered_halls_InstanceMapScript::SetData ( uint32  type,
uint32  data 
)
inlineoverridevirtual

Reimplemented from ZoneScript.

109 {
110 if (type == DATA_ENTERED_ROOM && data == DATA_ENTERED_ROOM && RescueTimer == 100 * MINUTE * IN_MILLISECONDS)
111 {
113 instance->LoadGrid(230, -80);
114
115 if (Creature* kargath = GetCreature(DATA_KARGATH))
117
119 }
120 }
#define sCreatureTextMgr
Definition: CreatureTextMgr.h:119
@ TEXT_RANGE_MAP
Definition: CreatureTextMgr.h:33
@ SPELL_KARGATHS_EXECUTIONER_1
Definition: shattered_halls.h:79
@ DATA_KARGATH
Definition: shattered_halls.h:29
@ DATA_ENTERED_ROOM
Definition: shattered_halls.h:33
@ CHAT_MSG_ADDON
Definition: SharedDefines.h:3151
@ LANG_ADDON
Definition: SharedDefines.h:753
@ TEAM_ALLIANCE
Definition: SharedDefines.h:760
Definition: Creature.h:46
Creature * GetCreature(uint32 type)
Definition: InstanceScript.cpp:100
void DoCastSpellOnPlayers(uint32 spell)
Definition: InstanceScript.cpp:650
void LoadGrid(float x, float y)
Definition: Map.cpp:492

References CHAT_MSG_ADDON, DATA_ENTERED_ROOM, DATA_KARGATH, InstanceScript::DoCastSpellOnPlayers(), InstanceScript::GetCreature(), IN_MILLISECONDS, InstanceScript::instance, LANG_ADDON, Map::LoadGrid(), MINUTE, RescueTimer, sCreatureTextMgr, SPELL_KARGATHS_EXECUTIONER_1, TEAM_ALLIANCE, TeamIdInInstance, and TEXT_RANGE_MAP.

◆ Update()

void instance_shattered_halls::instance_shattered_halls_InstanceMapScript::Update ( uint32  diff)
inlineoverridevirtual

Reimplemented from InstanceScript.

138 {
140 {
141 RescueTimer -= std::min(RescueTimer, diff);
142
143 if ((RescueTimer / IN_MILLISECONDS) == 25 * MINUTE)
144 {
147 if (Creature* prisoner = instance->GetCreature(prisonerGUID[0]))
148 Unit::Kill(prisoner, prisoner);
149 if (Creature* executioner = instance->GetCreature(executionerGUID))
150 executioner->RemoveLootMode(2);
151 }
152 else if ((RescueTimer / IN_MILLISECONDS) == 15 * MINUTE)
153 {
156 if (Creature* prisoner = instance->GetCreature(prisonerGUID[1]))
157 Unit::Kill(prisoner, prisoner);
158 }
159 else if ((RescueTimer / IN_MILLISECONDS) == 0)
160 {
162 if (Creature* prisoner = instance->GetCreature(prisonerGUID[2]))
163 Unit::Kill(prisoner, prisoner);
164 }
165 }
166 }
@ SPELL_KARGATHS_EXECUTIONER_2
Definition: shattered_halls.h:80
@ SPELL_KARGATHS_EXECUTIONER_3
Definition: shattered_halls.h:81
static void Kill(Unit *killer, Unit *victim, bool durabilityLoss=true, WeaponAttackType attackType=BASE_ATTACK, SpellInfo const *spellProto=nullptr, Spell const *spell=nullptr)
Definition: Unit.cpp:17658
void DoRemoveAurasDueToSpellOnPlayers(uint32 spell)
Definition: InstanceScript.cpp:639
Creature * GetCreature(ObjectGuid const guid)
Definition: Map.cpp:3314

References InstanceScript::DoCastSpellOnPlayers(), InstanceScript::DoRemoveAurasDueToSpellOnPlayers(), executionerGUID, Map::GetCreature(), IN_MILLISECONDS, InstanceScript::instance, Unit::Kill(), MINUTE, prisonerGUID, RescueTimer, SPELL_KARGATHS_EXECUTIONER_1, SPELL_KARGATHS_EXECUTIONER_2, and SPELL_KARGATHS_EXECUTIONER_3.

◆ WriteSaveDataMore()

void instance_shattered_halls::instance_shattered_halls_InstanceMapScript::WriteSaveDataMore ( std::ostringstream &  data)
inlineoverridevirtual

Reimplemented from InstanceScript.

174 {
175 data << RescueTimer;
176 }

References RescueTimer.

Member Data Documentation

◆ executionerGUID

ObjectGuid instance_shattered_halls::instance_shattered_halls_InstanceMapScript::executionerGUID
protected

◆ prisonerGUID

ObjectGuid instance_shattered_halls::instance_shattered_halls_InstanceMapScript::prisonerGUID[3]
protected

◆ RescueTimer

uint32 instance_shattered_halls::instance_shattered_halls_InstanceMapScript::RescueTimer
protected

◆ TeamIdInInstance

TeamId instance_shattered_halls::instance_shattered_halls_InstanceMapScript::TeamIdInInstance
protected