Small cleanup in boss Ouro script.
[scriptdev2-git.git] / ScriptMgr.h
blobf1884dcc7646efdfcc53fa218d12f1f5af564cc4
1 /* Copyright (C) 2006 - 2010 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
2 * This program is free software licensed under GPL version 2
3 * Please see the included DOCS/LICENSE.TXT for more information */
5 #ifndef SC_SCRIPTMGR_H
6 #define SC_SCRIPTMGR_H
8 #include "Common.h"
9 #include "DBCStructure.h"
11 class Player;
12 class Creature;
13 class CreatureAI;
14 class InstanceData;
15 class Quest;
16 class Item;
17 class GameObject;
18 class SpellCastTargets;
19 class Map;
20 class Unit;
21 class WorldObject;
22 class Aura;
24 #define MAX_SCRIPTS 5000 //72 bytes each (approx 351kb)
25 #define VISIBLE_RANGE (166.0f) //MAX visible range (size of grid)
26 #define DEFAULT_TEXT "<ScriptDev2 Text Entry Missing!>"
28 struct Script
30 Script() :
31 pGossipHello(NULL), pGOGossipHello(NULL), pGossipSelect(NULL), pGOGossipSelect(NULL),
32 pGossipSelectWithCode(NULL), pGOGossipSelectWithCode(NULL),
33 pQuestSelect(NULL), pQuestComplete(NULL), pNPCDialogStatus(NULL), pGODialogStatus(NULL),
34 pChooseReward(NULL), pItemHello(NULL), pGOHello(NULL), pAreaTrigger(NULL), pItemQuestAccept(NULL),
35 pQuestAccept(NULL), pGOQuestAccept(NULL), pGOChooseReward(NULL), pItemUse(NULL),
36 pEffectDummyCreature(NULL), pEffectDummyGameObj(NULL), pEffectDummyItem(NULL), pEffectAuraDummy(NULL),
37 GetAI(NULL), GetInstanceData(NULL)
40 std::string Name;
42 //Methods to be scripted
43 bool (*pGossipHello )(Player*, Creature*);
44 bool (*pGOGossipHello )(Player*, GameObject*);
45 bool (*pQuestAccept )(Player*, Creature*, const Quest*);
46 bool (*pGossipSelect )(Player*, Creature*, uint32, uint32);
47 bool (*pGOGossipSelect )(Player*, GameObject*, uint32, uint32);
48 bool (*pGossipSelectWithCode )(Player*, Creature*, uint32, uint32, const char*);
49 bool (*pGOGossipSelectWithCode )(Player*, GameObject*, uint32, uint32, const char*);
50 bool (*pQuestSelect )(Player*, Creature*, const Quest*);
51 bool (*pQuestComplete )(Player*, Creature*, const Quest*);
52 uint32 (*pNPCDialogStatus )(Player*, Creature*);
53 uint32 (*pGODialogStatus )(Player*, GameObject*);
54 bool (*pChooseReward )(Player*, Creature*, const Quest*, uint32);
55 bool (*pItemHello )(Player*, Item*, const Quest*);
56 bool (*pGOHello )(Player*, GameObject*);
57 bool (*pAreaTrigger )(Player*, AreaTriggerEntry*);
58 bool (*pItemQuestAccept )(Player*, Item*, const Quest*);
59 bool (*pGOQuestAccept )(Player*, GameObject*, const Quest*);
60 bool (*pGOChooseReward )(Player*, GameObject*, const Quest*, uint32);
61 bool (*pItemUse )(Player*, Item*, SpellCastTargets const&);
62 bool (*pEffectDummyCreature )(Unit*, uint32, SpellEffectIndex, Creature*);
63 bool (*pEffectDummyGameObj )(Unit*, uint32, SpellEffectIndex, GameObject*);
64 bool (*pEffectDummyItem )(Unit*, uint32, SpellEffectIndex, Item*);
65 bool (*pEffectAuraDummy )(const Aura*, bool);
67 CreatureAI* (*GetAI)(Creature*);
68 InstanceData* (*GetInstanceData)(Map*);
70 void RegisterSelf();
73 //Generic scripting text function
74 void DoScriptText(int32 textEntry, WorldObject* pSource, Unit* target = NULL);
76 #if COMPILER == COMPILER_GNU
77 #define FUNC_PTR(name,callconvention,returntype,parameters) typedef returntype(*name)parameters __attribute__ ((callconvention));
78 #else
79 #define FUNC_PTR(name, callconvention, returntype, parameters) typedef returntype(callconvention *name)parameters;
80 #endif
82 #endif