aboutsummaryrefslogtreecommitdiff
path: root/src/game/InstanceData.h
diff options
context:
space:
mode:
authormegamage <none@none>2009-05-16 14:49:30 -0500
committermegamage <none@none>2009-05-16 14:49:30 -0500
commit819326f2863aa6ce0d4ada9e21ae9134eb4ea06a (patch)
tree682545ca1d3bde25145b19ba093732e08f39d317 /src/game/InstanceData.h
parentbb6e0dba89e01b59854750b2b84624dc8653295e (diff)
*Update some instance script functions.
--HG-- branch : trunk
Diffstat (limited to 'src/game/InstanceData.h')
-rw-r--r--src/game/InstanceData.h35
1 files changed, 27 insertions, 8 deletions
diff --git a/src/game/InstanceData.h b/src/game/InstanceData.h
index 91f589384a0..9f7d4521fd1 100644
--- a/src/game/InstanceData.h
+++ b/src/game/InstanceData.h
@@ -31,6 +31,9 @@ class Player;
class GameObject;
class Creature;
+typedef std::set<GameObject*> DoorSet;
+typedef std::set<Creature*> MinionSet;
+
enum EncounterState
{
NOT_STARTED = 0,
@@ -41,8 +44,6 @@ enum EncounterState
TO_BE_DECIDED = 5,
};
-typedef std::set<GameObject*> DoorSet;
-
enum DoorType
{
DOOR_TYPE_ROOM = 0,
@@ -50,11 +51,23 @@ enum DoorType
MAX_DOOR_TYPES,
};
+struct DoorData
+{
+ uint32 entry, bossId;
+ DoorType type;
+};
+
+struct MinionData
+{
+ uint32 entry, bossId;
+};
+
struct BossInfo
{
BossInfo() : state(TO_BE_DECIDED) {}
EncounterState state;
DoorSet door[MAX_DOOR_TYPES];
+ MinionSet minion;
};
struct DoorInfo
@@ -65,14 +78,15 @@ struct DoorInfo
DoorType type;
};
-typedef std::multimap<uint32 /*entry*/, DoorInfo> DoorInfoMap;
-
-struct DoorData
+struct MinionInfo
{
- uint32 entry, bossId;
- DoorType type;
+ explicit MinionInfo(BossInfo *_bossInfo) : bossInfo(_bossInfo) {}
+ BossInfo *bossInfo;
};
+typedef std::multimap<uint32 /*entry*/, DoorInfo> DoorInfoMap;
+typedef std::map<uint32 /*entry*/, MinionInfo> MinionInfoMap;
+
class TRINITY_DLL_SPEC InstanceData
{
public:
@@ -124,17 +138,22 @@ class TRINITY_DLL_SPEC InstanceData
virtual void SetBossState(uint32 id, EncounterState state);
protected:
+ void SetBossNumber(uint32 number) { bosses.resize(number); }
void LoadDoorData(const DoorData *data);
+ void LoadMinionData(const MinionData *data);
- void SetBossNumber(uint32 number) { bosses.resize(number); }
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(const char * data);
std::string GetBossSaveData();
private:
std::vector<BossInfo> bosses;
DoorInfoMap doors;
+ MinionInfoMap minions;
virtual void OnObjectCreate(GameObject *) {}
virtual void OnCreatureCreate(Creature *, uint32 entry) {}