TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
InstanceScript.h File Reference
#include <set>
#include "ZoneScript.h"
#include "World.h"
#include "ObjectMgr.h"
#include "CreatureAI.h"
#include "Packets/WorldStatePackets.h"
+ Include dependency graph for InstanceScript.h:

Go to the source code of this file.

Classes

struct  DoorData
 
struct  BossBoundaryEntry
 
struct  BossBoundaryData
 
struct  MinionData
 
struct  ObjectData
 
struct  BossInfo
 
struct  DoorInfo
 
struct  MinionInfo
 
class  InstanceScript
 

Macros

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

Typedefs

typedef std::multimap< uint32,
DoorInfo
DoorInfoMap
 
typedef std::pair
< DoorInfoMap::const_iterator,
DoorInfoMap::const_iterator > 
DoorInfoMapBounds
 
typedef std::map< uint32,
MinionInfo
MinionInfoMap
 
typedef std::map< uint32,
ObjectGuid
ObjectGuidMap
 
typedef std::map< uint32, uint32ObjectInfoMap
 

Enumerations

enum  EncounterFrameType {
  ENCOUNTER_FRAME_SET_COMBAT_RES_LIMIT = 0, ENCOUNTER_FRAME_RESET_COMBAT_RES_LIMIT = 1, ENCOUNTER_FRAME_ENGAGE = 2, ENCOUNTER_FRAME_DISENGAGE = 3,
  ENCOUNTER_FRAME_UPDATE_PRIORITY = 4, ENCOUNTER_FRAME_ADD_TIMER = 5, ENCOUNTER_FRAME_ENABLE_OBJECTIVE = 6, ENCOUNTER_FRAME_UPDATE_OBJECTIVE = 7,
  ENCOUNTER_FRAME_DISABLE_OBJECTIVE = 8, ENCOUNTER_FRAME_UNK7 = 9, ENCOUNTER_FRAME_ADD_COMBAT_RES_LIMIT = 10
}
 
enum  EncounterState {
  NOT_STARTED = 0, IN_PROGRESS = 1, FAIL = 2, DONE = 3,
  SPECIAL = 4, TO_BE_DECIDED = 5
}
 
enum  DoorType { DOOR_TYPE_ROOM = 0, DOOR_TYPE_PASSAGE = 1, DOOR_TYPE_SPAWN_HOLE = 2, MAX_DOOR_TYPES }
 

Functions

template<class AI , class T >
AI * GetInstanceAI (T *obj, char const *scriptName)
 
template<class AI , class T >
AI * GetInstanceAI (T *obj)
 

Macro Definition Documentation

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

Typedef Documentation

typedef std::multimap<uint32 , DoorInfo> DoorInfoMap
typedef std::pair<DoorInfoMap::const_iterator, DoorInfoMap::const_iterator> DoorInfoMapBounds
typedef std::map<uint32 , MinionInfo> MinionInfoMap
typedef std::map<uint32 , ObjectGuid > ObjectGuidMap
typedef std::map<uint32 , uint32 > ObjectInfoMap

Enumeration Type Documentation

enum DoorType
Enumerator
DOOR_TYPE_ROOM 
DOOR_TYPE_PASSAGE 
DOOR_TYPE_SPAWN_HOLE 
MAX_DOOR_TYPES 
67 {
68  DOOR_TYPE_ROOM = 0, // Door can open if encounter is not in progress
69  DOOR_TYPE_PASSAGE = 1, // Door can open if encounter is done
70  DOOR_TYPE_SPAWN_HOLE = 2, // Door can open if encounter is in progress, typically used for spawning places
72 };
Definition: InstanceScript.h:69
Definition: InstanceScript.h:68
Definition: InstanceScript.h:71
Definition: InstanceScript.h:70
Enumerator
ENCOUNTER_FRAME_SET_COMBAT_RES_LIMIT 
ENCOUNTER_FRAME_RESET_COMBAT_RES_LIMIT 
ENCOUNTER_FRAME_ENGAGE 
ENCOUNTER_FRAME_DISENGAGE 
ENCOUNTER_FRAME_UPDATE_PRIORITY 
ENCOUNTER_FRAME_ADD_TIMER 
ENCOUNTER_FRAME_ENABLE_OBJECTIVE 
ENCOUNTER_FRAME_UPDATE_OBJECTIVE 
ENCOUNTER_FRAME_DISABLE_OBJECTIVE 
ENCOUNTER_FRAME_UNK7 
ENCOUNTER_FRAME_ADD_COMBAT_RES_LIMIT 
42 {
52  ENCOUNTER_FRAME_UNK7 = 9, // Seems to have something to do with sorting the encounter units
54 };
Definition: InstanceScript.h:46
Definition: InstanceScript.h:50
Definition: InstanceScript.h:53
Definition: InstanceScript.h:48
Definition: InstanceScript.h:47
Definition: InstanceScript.h:43
Definition: InstanceScript.h:52
Definition: InstanceScript.h:44
Definition: InstanceScript.h:51
Definition: InstanceScript.h:45
Definition: InstanceScript.h:49
Enumerator
NOT_STARTED 
IN_PROGRESS 
FAIL 
DONE 
SPECIAL 
TO_BE_DECIDED 
57 {
58  NOT_STARTED = 0,
59  IN_PROGRESS = 1,
60  FAIL = 2,
61  DONE = 3,
62  SPECIAL = 4,
63  TO_BE_DECIDED = 5
64 };
Definition: InstanceScript.h:61
Definition: InstanceScript.h:60
Definition: InstanceScript.h:59
Definition: InstanceScript.h:58
Definition: InstanceScript.h:62
Definition: InstanceScript.h:63

Function Documentation

template<class AI , class T >
AI* GetInstanceAI ( T *  obj,
char const scriptName 
)
303 {
304  if (InstanceMap* instance = obj->GetMap()->ToInstanceMap())
305  if (instance->GetInstanceScript())
306  if (instance->GetScriptId() == sObjectMgr->GetScriptId(scriptName))
307  return new AI(obj);
308 
309  return NULL;
310 }
arena_t NULL
Definition: jemalloc_internal.h:624
#define sObjectMgr
Definition: ObjectMgr.h:1567
Definition: Map.h:758
InstanceMap * ToInstanceMap()
Definition: Map.h:495

+ Here is the call graph for this function:

template<class AI , class T >
AI* GetInstanceAI ( T *  obj)
314 {
315  if (InstanceMap* instance = obj->GetMap()->ToInstanceMap())
316  if (instance->GetInstanceScript())
317  return new AI(obj);
318 
319  return NULL;
320 }
arena_t NULL
Definition: jemalloc_internal.h:624
Definition: Map.h:758
InstanceMap * ToInstanceMap()
Definition: Map.h:495

+ Here is the call graph for this function: