19 #ifndef TRINITY_INSTANCE_DATA_H
20 #define TRINITY_INSTANCE_DATA_H
29 #define OUT_SAVE_INST_DATA TC_LOG_DEBUG("scripts", "Saving Instance Data for Instance %s (Map %d, Instance Id %d)", instance->GetMapName(), instance->GetId(), instance->GetInstanceId())
30 #define OUT_SAVE_INST_DATA_COMPLETE TC_LOG_DEBUG("scripts", "Saving Instance Data for Instance %s (Map %d, Instance Id %d) completed.", instance->GetMapName(), instance->GetId(), instance->GetInstanceId())
31 #define OUT_LOAD_INST_DATA(a) TC_LOG_DEBUG("scripts", "Loading Instance Data for Instance %s (Map %d, Instance Id %d). Input is '%s'", instance->GetMapName(), instance->GetId(), instance->GetInstanceId(), a)
32 #define OUT_LOAD_INST_DATA_COMPLETE TC_LOG_DEBUG("scripts", "Instance Data Load for Instance %s (Map %d, Instance Id: %d) is complete.", instance->GetMapName(), instance->GetId(), instance->GetInstanceId())
33 #define OUT_LOAD_INST_DATA_FAIL TC_LOG_ERROR("scripts", "Unable to load Instance Data for Instance %s (Map %d, Instance Id: %d).", instance->GetMapName(), instance->GetId(), instance->GetInstanceId())
93 const_iterator
begin()
const {
return _data.begin(); }
94 const_iterator
end()
const {
return _data.end(); }
156 virtual void Load(
char const* data);
159 virtual std::string GetSaveData();
167 virtual bool IsEncounterInProgress()
const;
198 void DoUseDoorOrButton(
ObjectGuid guid,
uint32 withRestoreTime = 0,
bool useAlternativeState =
false);
205 void DoUpdateWorldState(
uint32 worldstateId,
uint32 worldstateValue);
208 void DoSendNotifyToInstance(
char const*
format, ...);
218 void DoRemoveAurasDueToSpellOnPlayers(
uint32 spell);
221 void DoCastSpellOnPlayers(
uint32 spell);
228 static std::string GetBossStateName(
uint8 state);
252 void UpdatePhasing();
257 void SetHeaders(std::string
const& dataHeaders);
260 void LoadDoorData(
DoorData const* data);
268 virtual void AddDoor(
GameObject* door,
bool add);
269 void AddMinion(
Creature* minion,
bool add);
271 virtual void UpdateDoorState(
GameObject* door);
279 bool ReadSaveDataHeaders(std::istringstream& data);
280 void ReadSaveDataBossStates(std::istringstream& data);
282 void WriteSaveDataHeaders(std::ostringstream& data);
283 void WriteSaveDataBossStates(std::ostringstream& data);
286 bool _SkipCheckRequiredBosses(
Player const* player =
nullptr)
const;
301 template<
class AI,
class T>
305 if (instance->GetInstanceScript())
306 if (instance->GetScriptId() ==
sObjectMgr->GetScriptId(scriptName))
312 template<
class AI,
class T>
316 if (instance->GetInstanceScript())
322 #endif // TRINITY_INSTANCE_DATA_H
Definition: InstanceScript.h:46
StorageType _data
Definition: InstanceScript.h:97
void format(BasicFormatter< Char > &f, const Char *&format_str, const T &value)
Definition: format.h:2963
CreatureBoundary boundary
Definition: InstanceScript.h:117
CreatureBoundary const * GetBossBoundary(uint32 id) const
Definition: InstanceScript.h:229
const_iterator begin() const
Definition: InstanceScript.h:93
uint32 BossId
Definition: InstanceScript.h:82
bool ServerAllowsTwoSideGroups()
Definition: InstanceScript.h:224
EncounterFrameType
Definition: InstanceScript.h:41
virtual ~InstanceScript()
Definition: InstanceScript.h:146
Definition: InstanceScript.h:100
void SetCompletedEncountersMask(uint32 newMask)
Definition: InstanceScript.h:242
EncounterCreditType
Definition: ObjectMgr.h:670
virtual void Update(uint32)
Definition: InstanceScript.h:163
Definition: InstanceScript.h:50
Definition: InstanceScript.h:69
DoorType type
Definition: InstanceScript.h:77
ObjectData const gameObjectData[]
Definition: instance_gundrak.cpp:40
Definition: InstanceScript.h:53
ObjectGuidMap _objectGuids
Definition: InstanceScript.h:297
virtual void OnGameObjectCreate(GameObject *)
Definition: ZoneScript.h:38
Definition: InstanceScript.h:48
Definition: InstanceScript.h:47
BossInfo()
Definition: InstanceScript.h:113
Definition: InstanceScript.h:68
void SetBossNumber(uint32 number)
Definition: InstanceScript.h:258
Creature * GetCreature(uint32 type)
Definition: InstanceScript.h:180
DoorType
Definition: InstanceScript.h:66
Definition: InstanceScript.h:43
Definition: InstanceScript.h:52
arena_t NULL
Definition: jemalloc_internal.h:624
ObjectInfoMap _creatureInfo
Definition: InstanceScript.h:295
virtual void OnPlayerEnter(Player *)
Definition: InstanceScript.h:190
Definition: InstanceScript.h:44
uint32 type
Definition: InstanceScript.h:108
ObjectData const creatureData[]
Definition: instance_blackrock_caverns.cpp:22
std::vector< BossBoundaryEntry > StorageType
Definition: InstanceScript.h:88
MinionInfoMap minions
Definition: InstanceScript.h:294
Definition: Creature.h:467
const_iterator end() const
Definition: InstanceScript.h:94
EncounterState
Definition: InstanceScript.h:56
#define sWorld
Definition: World.h:887
virtual void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates &)
Definition: InstanceScript.h:249
Definition: InstanceScript.h:61
GuidSet door[MAX_DOOR_TYPES]
Definition: InstanceScript.h:115
Definition: InstanceScript.h:60
#define sObjectMgr
Definition: ObjectMgr.h:1567
virtual ObjectGuid GetGuidData(uint32) const
Definition: ZoneScript.h:44
virtual void WriteSaveDataMore(std::ostringstream &)
Definition: InstanceScript.h:284
uint32 entry
Definition: InstanceScript.h:76
std::pair< DoorInfoMap::const_iterator, DoorInfoMap::const_iterator > DoorInfoMapBounds
Definition: InstanceScript.h:135
ObjectInfoMap _gameObjectInfo
Definition: InstanceScript.h:296
Definition: InstanceScript.h:51
Definition: InstanceScript.h:74
Definition: InstanceScript.h:45
Definition: ZoneScript.h:26
uint32 completedEncounters
Definition: InstanceScript.h:298
std::vector< char > headers
Definition: InstanceScript.h:291
uint32 bossId
Definition: InstanceScript.h:102
virtual void OnGameObjectRemove(GameObject *)
Definition: ZoneScript.h:39
Definition: InstanceScript.h:59
InstanceScript(Map *map)
Definition: InstanceScript.h:144
AchievementCriteriaTimedTypes
Definition: DBCEnums.h:181
std::set< AreaBoundary const * > CreatureBoundary
Definition: CreatureAI.h:67
AchievementCriteriaTypes
Definition: DBCEnums.h:196
Definition: InstanceScript.h:58
void AddObject(T *object)
Definition: ObjectAccessor.h:98
InstanceMap * ToInstanceMap()
Definition: Map.h:495
GameObject * GetGameObject(uint32 type)
Definition: InstanceScript.h:184
uint32_t uint32
Definition: Define.h:150
Definition: WorldStatePackets.h:27
uint32 bossId
Definition: InstanceScript.h:76
Map * instance
Definition: InstanceScript.h:148
Definition: InstanceScript.h:62
Definition: GameObject.h:880
StorageType::const_iterator const_iterator
Definition: InstanceScript.h:89
Definition: AreaBoundary.h:23
Definition: InstanceScript.h:105
virtual void OnCreatureRemove(Creature *)
Definition: ZoneScript.h:36
uint32 GetEncounterCount() const
Definition: InstanceScript.h:254
std::multimap< uint32, DoorInfo > DoorInfoMap
Definition: InstanceScript.h:134
virtual void ReadSaveDataMore(std::istringstream &)
Definition: InstanceScript.h:281
AreaBoundary const * Boundary
Definition: InstanceScript.h:83
std::map< uint32, MinionInfo > MinionInfoMap
Definition: InstanceScript.h:137
Definition: InstanceScript.h:80
EncounterState state
Definition: InstanceScript.h:114
Definition: InstanceScript.h:111
AI * GetInstanceAI(T *obj, char const *scriptName)
Definition: InstanceScript.h:302
Definition: InstanceScript.h:120
Creature * GetCreature(ObjectGuid const &guid)
Definition: Map.cpp:3535
DoorInfo(BossInfo *_bossInfo, DoorType _type)
Definition: InstanceScript.h:122
uint32 GetCompletedEncounterMask() const
Definition: InstanceScript.h:245
std::set< ObjectGuid > GuidSet
Definition: ObjectGuid.h:332
#define TC_GAME_API
Definition: Define.h:134
virtual void Initialize()
Definition: InstanceScript.h:153
Definition: InstanceScript.h:71
Definition: InstanceScript.h:141
Definition: InstanceScript.h:63
uint8_t uint8
Definition: Define.h:152
MinionInfo(BossInfo *_bossInfo)
Definition: InstanceScript.h:130
Definition: InstanceScript.h:128
BossBoundaryData(std::initializer_list< BossBoundaryEntry > data)
Definition: InstanceScript.h:91
Definition: InstanceScript.h:49
BossInfo * bossInfo
Definition: InstanceScript.h:124
Definition: ObjectGuid.h:189
uint32_t uint32
Definition: g3dmath.h:168
GameObject * GetGameObject(ObjectGuid const &guid)
Definition: Map.cpp:3545
EncounterState GetBossState(uint32 id) const
Definition: InstanceScript.h:227
std::map< uint32, ObjectGuid > ObjectGuidMap
Definition: InstanceScript.h:138
virtual bool CheckRequiredBosses(uint32, Player const *=nullptr) const
Definition: InstanceScript.h:236
uint32 entry
Definition: InstanceScript.h:102
Definition: InstanceScript.h:70
GuidSet minion
Definition: InstanceScript.h:116
DoorType type
Definition: InstanceScript.h:125
virtual void OnCreatureCreate(Creature *)
Definition: ZoneScript.h:35
std::vector< BossInfo > bosses
Definition: InstanceScript.h:292
uint32 entry
Definition: InstanceScript.h:107
BossInfo * bossInfo
Definition: InstanceScript.h:131
DoorInfoMap doors
Definition: InstanceScript.h:293
Definition: InstanceScript.h:86
std::map< uint32, uint32 > ObjectInfoMap
Definition: InstanceScript.h:139