aboutsummaryrefslogtreecommitdiff
path: root/src/game/InstanceData.h
diff options
context:
space:
mode:
authormegamage <none@none>2009-05-30 22:15:05 -0500
committermegamage <none@none>2009-05-30 22:15:05 -0500
commit8d1f4f9ea0beb503e2a3014abb95263e501ef1c5 (patch)
tree41d48951c315129dee817befa40d4dab90d3fd14 /src/game/InstanceData.h
parentb5778357d9d8c5fb10da5d99c46b48250578cb49 (diff)
*Provide another way to implement dynamic spawns. Now a creature will call its zonescript before spawn to determine the spawned entry. This can be used to implement zones such as wintergrasp with less data requirement (only need to know the entry of counterpart creatures, not require spawn points)
*Use zonescript as basic class of opvp script and dugeon script (can also be used for bg) *Store zonescript in worldobject. *Add door for sapphiron. --HG-- branch : trunk
Diffstat (limited to 'src/game/InstanceData.h')
-rw-r--r--src/game/InstanceData.h19
1 files changed, 5 insertions, 14 deletions
diff --git a/src/game/InstanceData.h b/src/game/InstanceData.h
index 133f92ecc60..f3d45cc0cf6 100644
--- a/src/game/InstanceData.h
+++ b/src/game/InstanceData.h
@@ -21,7 +21,7 @@
#ifndef TRINITY_INSTANCE_DATA_H
#define TRINITY_INSTANCE_DATA_H
-#include "Common.h"
+#include "ZoneScript.h"
//#include "GameObject.h"
//#include "Map.h"
@@ -109,7 +109,7 @@ struct MinionInfo
typedef std::multimap<uint32 /*entry*/, DoorInfo> DoorInfoMap;
typedef std::map<uint32 /*entry*/, MinionInfo> MinionInfoMap;
-class TRINITY_DLL_SPEC InstanceData
+class TRINITY_DLL_SPEC InstanceData : public ZoneScript
{
public:
@@ -129,8 +129,7 @@ class TRINITY_DLL_SPEC InstanceData
void SaveToDB();
- //Called every map update
- virtual void Update(uint32 /*diff*/) {}
+ virtual void Update(uint32 diff) {}
//Used by the map's CanEnter function.
//This is to prevent players from entering during boss encounters.
@@ -140,18 +139,10 @@ class TRINITY_DLL_SPEC InstanceData
virtual void OnPlayerEnter(Player *) {}
//Called when a gameobject is created
- virtual void OnObjectCreate(GameObject *go, bool add) { OnObjectCreate(go); }
+ void OnGameObjectCreate(GameObject *go, bool add) { OnObjectCreate(go); }
//called on creature creation
- virtual void OnCreatureCreate(Creature *, bool add);
-
- //All-purpose data storage 64 bit
- virtual uint64 GetData64(uint32 /*Data*/) { return 0; }
- virtual void SetData64(uint32 /*Data*/, uint64 /*Value*/) { }
-
- //All-purpose data storage 32 bit
- virtual uint32 GetData(uint32) { return 0; }
- virtual void SetData(uint32, uint32 data) {}
+ void OnCreatureCreate(Creature *, bool add);
//Handle open / close objects
//use HandleGameObject(NULL,boolen,GO); in OnObjectCreate in instance scripts