From 95b91afbab455d917a2800d8936e1f29e4d9604d Mon Sep 17 00:00:00 2001 From: Neo2003 Date: Sat, 11 Oct 2008 14:16:25 -0500 Subject: [svn] * svn:eol-style native set on all files that need it --HG-- branch : trunk --- src/bindings/scripts/ScriptMgr.h | 176 +++++++++++++++++++-------------------- 1 file changed, 88 insertions(+), 88 deletions(-) (limited to 'src/bindings/scripts/ScriptMgr.h') diff --git a/src/bindings/scripts/ScriptMgr.h b/src/bindings/scripts/ScriptMgr.h index 8ff1ee3cfdd..5709a9e496b 100644 --- a/src/bindings/scripts/ScriptMgr.h +++ b/src/bindings/scripts/ScriptMgr.h @@ -1,88 +1,88 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef SCRIPTMGR_H -#define SCRIPTMGR_H - -#include "Common.h" -#include "Platform/CompilerDefs.h" -#include "Database/DBCStructure.h" - -class Player; -class Creature; -class CreatureAI; -class InstanceData; -class Quest; -class Item; -class GameObject; -class SpellCastTargets; -class Map; -class Unit; -class WorldObject; - -#define MAX_SCRIPTS 1000 //72 bytes each (approx 71kb) -#define VISIBLE_RANGE (166.0f) //MAX visible range (size of grid) -#define DEFAULT_TEXT "" - -struct Script -{ - Script() : -pGossipHello(NULL), pQuestAccept(NULL), pGossipSelect(NULL), pGossipSelectWithCode(NULL), -pQuestSelect(NULL), pQuestComplete(NULL), pNPCDialogStatus(NULL), pGODialogStatus(NULL), pChooseReward(NULL), -pItemHello(NULL), pGOHello(NULL), pAreaTrigger(NULL), pItemQuestAccept(NULL), pGOQuestAccept(NULL), -pGOChooseReward(NULL),pReceiveEmote(NULL),pItemUse(NULL), GetAI(NULL), GetInstanceData(NULL) -{} - -std::string Name; - -// Quest/gossip Methods to be scripted -bool (*pGossipHello )(Player*, Creature*); -bool (*pQuestAccept )(Player*, Creature*, Quest const* ); -bool (*pGossipSelect )(Player*, Creature*, uint32 , uint32 ); -bool (*pGossipSelectWithCode)(Player*, Creature*, uint32 , uint32 , const char* ); -bool (*pQuestSelect )(Player*, Creature*, Quest const* ); -bool (*pQuestComplete )(Player*, Creature*, Quest const* ); -uint32 (*pNPCDialogStatus )(Player*, Creature* ); -uint32 (*pGODialogStatus )(Player *player, GameObject * _GO ); -bool (*pChooseReward )(Player*, Creature*, Quest const*, uint32 ); -bool (*pItemHello )(Player*, Item*, Quest const* ); -bool (*pGOHello )(Player*, GameObject* ); -bool (*pAreaTrigger )(Player*, AreaTriggerEntry* ); -bool (*pItemQuestAccept )(Player*, Item *, Quest const* ); -bool (*pGOQuestAccept )(Player*, GameObject*, Quest const* ); -bool (*pGOChooseReward )(Player*, GameObject*_GO, Quest const*, uint32 ); -bool (*pReceiveEmote )(Player*, Creature*, uint32 ); -bool (*pItemUse )(Player*, Item*, SpellCastTargets const& ); - -CreatureAI* (*GetAI)(Creature*); -InstanceData* (*GetInstanceData)(Map*); -}; - -extern int nrscripts; -extern Script *m_scripts[MAX_SCRIPTS]; - -// Localized Text function -const char* GetEventAILocalizedText(uint32 entry); - -//EventAI text function -const char* GetEventAIText(uint32 entry); // TODO: Locales - -//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 MANGOS_DLL_EXPORT extern "C" __declspec(dllexport) -#elif defined( __GNUC__ ) - #define MANGOS_DLL_EXPORT extern "C" -#else - #define MANGOS_DLL_EXPORT extern "C" export -#endif - -#endif +/* Copyright (C) 2006 - 2008 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef SCRIPTMGR_H +#define SCRIPTMGR_H + +#include "Common.h" +#include "Platform/CompilerDefs.h" +#include "Database/DBCStructure.h" + +class Player; +class Creature; +class CreatureAI; +class InstanceData; +class Quest; +class Item; +class GameObject; +class SpellCastTargets; +class Map; +class Unit; +class WorldObject; + +#define MAX_SCRIPTS 1000 //72 bytes each (approx 71kb) +#define VISIBLE_RANGE (166.0f) //MAX visible range (size of grid) +#define DEFAULT_TEXT "" + +struct Script +{ + Script() : +pGossipHello(NULL), pQuestAccept(NULL), pGossipSelect(NULL), pGossipSelectWithCode(NULL), +pQuestSelect(NULL), pQuestComplete(NULL), pNPCDialogStatus(NULL), pGODialogStatus(NULL), pChooseReward(NULL), +pItemHello(NULL), pGOHello(NULL), pAreaTrigger(NULL), pItemQuestAccept(NULL), pGOQuestAccept(NULL), +pGOChooseReward(NULL),pReceiveEmote(NULL),pItemUse(NULL), GetAI(NULL), GetInstanceData(NULL) +{} + +std::string Name; + +// Quest/gossip Methods to be scripted +bool (*pGossipHello )(Player*, Creature*); +bool (*pQuestAccept )(Player*, Creature*, Quest const* ); +bool (*pGossipSelect )(Player*, Creature*, uint32 , uint32 ); +bool (*pGossipSelectWithCode)(Player*, Creature*, uint32 , uint32 , const char* ); +bool (*pQuestSelect )(Player*, Creature*, Quest const* ); +bool (*pQuestComplete )(Player*, Creature*, Quest const* ); +uint32 (*pNPCDialogStatus )(Player*, Creature* ); +uint32 (*pGODialogStatus )(Player *player, GameObject * _GO ); +bool (*pChooseReward )(Player*, Creature*, Quest const*, uint32 ); +bool (*pItemHello )(Player*, Item*, Quest const* ); +bool (*pGOHello )(Player*, GameObject* ); +bool (*pAreaTrigger )(Player*, AreaTriggerEntry* ); +bool (*pItemQuestAccept )(Player*, Item *, Quest const* ); +bool (*pGOQuestAccept )(Player*, GameObject*, Quest const* ); +bool (*pGOChooseReward )(Player*, GameObject*_GO, Quest const*, uint32 ); +bool (*pReceiveEmote )(Player*, Creature*, uint32 ); +bool (*pItemUse )(Player*, Item*, SpellCastTargets const& ); + +CreatureAI* (*GetAI)(Creature*); +InstanceData* (*GetInstanceData)(Map*); +}; + +extern int nrscripts; +extern Script *m_scripts[MAX_SCRIPTS]; + +// Localized Text function +const char* GetEventAILocalizedText(uint32 entry); + +//EventAI text function +const char* GetEventAIText(uint32 entry); // TODO: Locales + +//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 MANGOS_DLL_EXPORT extern "C" __declspec(dllexport) +#elif defined( __GNUC__ ) + #define MANGOS_DLL_EXPORT extern "C" +#else + #define MANGOS_DLL_EXPORT extern "C" export +#endif + +#endif -- cgit v1.2.3