aboutsummaryrefslogtreecommitdiff
path: root/src/bindings/scripts/ScriptMgr.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/bindings/scripts/ScriptMgr.h')
-rw-r--r--src/bindings/scripts/ScriptMgr.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/bindings/scripts/ScriptMgr.h b/src/bindings/scripts/ScriptMgr.h
index 7e9ac9b89f2..9456a0da661 100644
--- a/src/bindings/scripts/ScriptMgr.h
+++ b/src/bindings/scripts/ScriptMgr.h
@@ -4,11 +4,14 @@
*
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
+
#ifndef SC_SCRIPTMGR_H
#define SC_SCRIPTMGR_H
+
#include "Common.h"
#include "Platform/CompilerDefs.h"
#include "DBCStructure.h"
+
class Player;
class Creature;
class CreatureAI;
@@ -21,9 +24,11 @@ class Map;
class Unit;
class WorldObject;
struct ItemPrototype;
+
#define MAX_SCRIPTS 5000 //72 bytes each (approx 351kb)
#define VISIBLE_RANGE (166.0f) //MAX visible range (size of grid)
#define DEFAULT_TEXT "<Trinity Script Text Entry Missing!>"
+
struct Script
{
Script() :
@@ -34,7 +39,9 @@ struct Script
pEffectDummyCreature(NULL), pEffectDummyGameObj(NULL), pEffectDummyItem(NULL),
GetAI(NULL), GetInstanceData(NULL)
{}
+
std::string Name;
+
//Methods to be scripted
void (*pOnLogin )(Player*);
void (*pOnLogout )(Player*);
@@ -72,17 +79,22 @@ struct Script
bool (*pEffectDummyCreature )(Unit*, uint32, uint32, Creature* );
bool (*pEffectDummyGameObj )(Unit*, uint32, uint32, GameObject* );
bool (*pEffectDummyItem )(Unit*, uint32, uint32, Item* );
+
CreatureAI* (*GetAI)(Creature*);
InstanceData* (*GetInstanceData)(Map*);
+
void RegisterSelf();
};
+
//Generic scripting text function
void DoScriptText(int32 textEntry, WorldObject* pSource, Unit* target = NULL);
+
#if COMPILER == COMPILER_GNU
#define FUNC_PTR(name,callconvention,returntype,parameters) typedef returntype(*name)parameters __attribute__ ((callconvention));
#else
#define FUNC_PTR(name, callconvention, returntype, parameters) typedef returntype(callconvention *name)parameters;
#endif
+
#ifdef WIN32
#define TRINITY_DLL_EXPORT extern "C" __declspec(dllexport)
#elif defined( __GNUC__ )
@@ -90,5 +102,6 @@ void DoScriptText(int32 textEntry, WorldObject* pSource, Unit* target = NULL);
#else
#define TRINITY_DLL_EXPORT extern "C" export
#endif
+
#endif