From 0b8e6ee15a1137d25aaa3071dc5a1410e49faec4 Mon Sep 17 00:00:00 2001 From: Anubisss Date: Sat, 23 May 2009 20:48:32 +0200 Subject: *Some changes in bindings/interface. *Fix the bug that You build it without Trinity Script the emu try to load the libtrinityscript lib instead of libtrinityinterface. --HG-- branch : trunk --- src/bindings/interface/ScriptMgr.h | 54 ++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 28 deletions(-) (limited to 'src/bindings/interface/ScriptMgr.h') diff --git a/src/bindings/interface/ScriptMgr.h b/src/bindings/interface/ScriptMgr.h index 8c6c91ec362..f0a856ccc35 100644 --- a/src/bindings/interface/ScriptMgr.h +++ b/src/bindings/interface/ScriptMgr.h @@ -35,12 +35,11 @@ class SpellCastTargets; class Map; #define MAX_SCRIPTS 1000 -#define MAX_INSTANCE_SCRIPTS 1000 struct Script { Script() : - pGossipHello(NULL), pQuestAccept(NULL), pGossipSelect(NULL), pGossipSelectWithCode(NULL), + pGossipHello(NULL), pQuestAccept(NULL), pGossipSelect(NULL), pGossipSelectWithCode(NULL), pGOSelect(NULL), pGOSelectWithCode(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) @@ -49,26 +48,30 @@ struct Script std::string Name; // -- Quest/gossip Methods to be scripted -- - bool (*pGossipHello )(Player *player, Creature *_Creature); - bool (*pQuestAccept )(Player *player, Creature *_Creature, Quest const*_Quest ); - bool (*pGossipSelect )(Player *player, Creature *_Creature, uint32 sender, uint32 action ); - bool (*pGossipSelectWithCode)(Player *player, Creature *_Creature, uint32 sender, uint32 action, const char* sCode ); - bool (*pQuestSelect )(Player *player, Creature *_Creature, Quest const*_Quest ); - bool (*pQuestComplete )(Player *player, Creature *_Creature, Quest const*_Quest ); - uint32 (*pNPCDialogStatus )(Player *player, Creature *_Creature ); - uint32 (*pGODialogStatus )(Player *player, GameObject * _GO ); - bool (*pChooseReward )(Player *player, Creature *_Creature, Quest const*_Quest, uint32 opt ); - bool (*pItemHello )(Player *player, Item *_Item, Quest const*_Quest ); - bool (*pGOHello )(Player *player, GameObject *_GO ); - bool (*pAreaTrigger )(Player *player, AreaTriggerEntry* at); - bool (*pItemQuestAccept )(Player *player, Item *_Item, Quest const*_Quest ); - bool (*pGOQuestAccept )(Player *player, GameObject *_GO, Quest const*_Quest ); - bool (*pGOChooseReward )(Player *player, GameObject *_GO, Quest const*_Quest, uint32 opt ); - bool (*pReceiveEmote )(Player *player, Creature *_Creature, uint32 emote ); - bool (*pItemUse )(Player *player, Item* _Item, SpellCastTargets const& targets); - - CreatureAI* (*GetAI)(Creature *_Creature); - // ----------------------------------------- + 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 (*pGOSelect )(Player*, GameObject*, uint32, uint32); + bool (*pGOSelectWithCode )(Player*, GameObject*, uint32, uint32, const char*); + bool (*pQuestSelect )(Player*, Creature*, Quest const*); + bool (*pQuestComplete )(Player*, Creature*, Quest const*); + uint32 (*pNPCDialogStatus )(Player*, Creature*); + uint32 (*pGODialogStatus )(Player*, GameObject*); + 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*, Quest const*, uint32); + bool (*pReceiveEmote )(Player*, Creature*, uint32); + bool (*pItemUse )(Player*, Item*, SpellCastTargets const&); + + CreatureAI* (*GetAI)(Creature*); + InstanceData* (*GetInstanceData)(Map*); + + void RegisterSelf(); }; @@ -81,11 +84,6 @@ class InstanceDataScript InstanceData* (*GetInstanceData)(Map *_Map); }; -extern int nrscripts; -extern Script *m_scripts[MAX_SCRIPTS]; -extern InstanceDataScript *m_instance_scripts[MAX_INSTANCE_SCRIPTS]; -extern int num_inst_scripts; - #define VISIBLE_RANGE (50.0f) struct TRINITY_DLL_DECL ScriptedAI : public CreatureAI @@ -152,7 +150,7 @@ struct TRINITY_DLL_DECL ScriptedAI : public CreatureAI void DoSay(char const* text, uint32 language) { - m_creature->Say(text,language,0); + m_creature->MonsterSay(text,language,0); } void DoGoHome(); -- cgit v1.2.3