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 */
9 #include "DBCStructure.h"
18 class SpellCastTargets
;
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!>"
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
)
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
*);
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));
79 #define FUNC_PTR(name, callconvention, returntype, parameters) typedef returntype(callconvention *name)parameters;