aboutsummaryrefslogtreecommitdiff
path: root/src/game/ZoneScript.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/ZoneScript.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/ZoneScript.h')
-rw-r--r--src/game/ZoneScript.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/game/ZoneScript.h b/src/game/ZoneScript.h
new file mode 100644
index 00000000000..2725e44c16c
--- /dev/null
+++ b/src/game/ZoneScript.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef ZONE_SCRIPT_H_
+#define ZONE_SCRIPT_H_
+
+#include "Common.h"
+
+class Creature;
+class GameObject;
+
+class TRINITY_DLL_SPEC ZoneScript
+{
+ public:
+ explicit ZoneScript() {}
+
+ virtual uint32 GetCreatureEntry(uint32 guidlow, uint32 entry) { return entry; }
+ virtual uint32 GetGameObjectEntry(uint32 guidlow, uint32 entry) { return entry; }
+
+ virtual void OnCreatureCreate(Creature *, bool add) {}
+ virtual void OnGameObjectCreate(GameObject *go, 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) {}
+};
+
+#endif \ No newline at end of file