1 | /* |
---|
2 | * Copyright (C) 2008 Trinity <http://www.trinitycore.org/> |
---|
3 | * |
---|
4 | * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/> |
---|
5 | * |
---|
6 | * This program is free software; you can redistribute it and/or modify |
---|
7 | * it under the terms of the GNU General Public License as published by |
---|
8 | * the Free Software Foundation; either version 2 of the License, or |
---|
9 | * (at your option) any later version. |
---|
10 | * |
---|
11 | * This program is distributed in the hope that it will be useful, |
---|
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
14 | * GNU General Public License for more details. |
---|
15 | * |
---|
16 | * You should have received a copy of the GNU General Public License |
---|
17 | * along with this program; if not, write to the Free Software |
---|
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
19 | */ |
---|
20 | |
---|
21 | #ifndef __SCRIPT_CALLS_H |
---|
22 | #define __SCRIPT_CALLS_H |
---|
23 | |
---|
24 | #include "Common.h" |
---|
25 | #include "ObjectMgr.h" |
---|
26 | |
---|
27 | class Creature; |
---|
28 | class CreatureAI; |
---|
29 | class GameObject; |
---|
30 | class Item; |
---|
31 | class Player; |
---|
32 | class Quest; |
---|
33 | class SpellCastTargets; |
---|
34 | class Map; |
---|
35 | class InstanceData; |
---|
36 | |
---|
37 | bool LoadScriptingModule(char const* libName = ""); |
---|
38 | void UnloadScriptingModule(); |
---|
39 | |
---|
40 | typedef void(TRINITY_IMPORT * scriptCallScriptsInit) (); |
---|
41 | typedef void(TRINITY_IMPORT * scriptCallScriptsFree) (); |
---|
42 | |
---|
43 | typedef bool(TRINITY_IMPORT * scriptCallGossipHello) (Player *player, Creature *_Creature ); |
---|
44 | typedef bool(TRINITY_IMPORT * scriptCallQuestAccept) (Player *player, Creature *_Creature, Quest const *); |
---|
45 | typedef bool(TRINITY_IMPORT * scriptCallGossipSelect)(Player *player, Creature *_Creature, uint32 sender, uint32 action); |
---|
46 | typedef bool(TRINITY_IMPORT * scriptCallGossipSelectWithCode)( Player *player, Creature *_Creature, uint32 sender, uint32 action, const char* sCode ); |
---|
47 | typedef bool(TRINITY_IMPORT * scriptCallQuestSelect)( Player *player, Creature *_Creature, Quest const* ); |
---|
48 | typedef bool(TRINITY_IMPORT * scriptCallQuestComplete)(Player *player, Creature *_Creature, Quest const*); |
---|
49 | typedef uint32(TRINITY_IMPORT * scriptCallNPCDialogStatus)( Player *player, Creature *_Creature); |
---|
50 | typedef uint32(TRINITY_IMPORT * scriptCallGODialogStatus)( Player *player, GameObject * _GO); |
---|
51 | typedef bool(TRINITY_IMPORT * scriptCallChooseReward)( Player *player, Creature *_Creature, Quest const*, uint32 opt ); |
---|
52 | typedef bool(TRINITY_IMPORT * scriptCallItemHello)( Player *player, Item *, Quest const*); |
---|
53 | typedef bool(TRINITY_IMPORT * scriptCallGOHello)( Player *player, GameObject * ); |
---|
54 | typedef bool(TRINITY_IMPORT * scriptCallAreaTrigger)( Player *player, AreaTriggerEntry const* ); |
---|
55 | typedef bool(TRINITY_IMPORT * scriptCallItemQuestAccept)(Player *player, Item *, Quest const*); |
---|
56 | typedef bool(TRINITY_IMPORT * scriptCallGOQuestAccept)(Player *player, GameObject *, Quest const*); |
---|
57 | typedef bool(TRINITY_IMPORT * scriptCallGOChooseReward)(Player *player, GameObject *, Quest const*, uint32 opt ); |
---|
58 | typedef bool(TRINITY_IMPORT * scriptCallReceiveEmote) ( Player *player, Creature *_Creature, uint32 emote ); |
---|
59 | typedef bool(TRINITY_IMPORT * scriptCallItemUse) (Player *player, Item *_Item, SpellCastTargets const& targets); |
---|
60 | typedef CreatureAI* (TRINITY_IMPORT * scriptCallGetAI) ( Creature *_Creature ); |
---|
61 | typedef InstanceData* (TRINITY_IMPORT * scriptCallCreateInstanceData) (Map *map); |
---|
62 | |
---|
63 | typedef struct |
---|
64 | { |
---|
65 | scriptCallScriptsInit ScriptsInit; |
---|
66 | scriptCallScriptsFree ScriptsFree; |
---|
67 | |
---|
68 | scriptCallGossipHello GossipHello; |
---|
69 | scriptCallGOChooseReward GOChooseReward; |
---|
70 | scriptCallQuestAccept QuestAccept; |
---|
71 | scriptCallGossipSelect GossipSelect; |
---|
72 | scriptCallGossipSelectWithCode GossipSelectWithCode; |
---|
73 | scriptCallQuestSelect QuestSelect; |
---|
74 | scriptCallQuestComplete QuestComplete; |
---|
75 | scriptCallNPCDialogStatus NPCDialogStatus; |
---|
76 | scriptCallGODialogStatus GODialogStatus; |
---|
77 | scriptCallChooseReward ChooseReward; |
---|
78 | scriptCallItemHello ItemHello; |
---|
79 | scriptCallGOHello GOHello; |
---|
80 | scriptCallAreaTrigger scriptAreaTrigger; |
---|
81 | scriptCallItemQuestAccept ItemQuestAccept; |
---|
82 | scriptCallGOQuestAccept GOQuestAccept; |
---|
83 | scriptCallReceiveEmote ReceiveEmote; |
---|
84 | scriptCallItemUse ItemUse; |
---|
85 | scriptCallGetAI GetAI; |
---|
86 | scriptCallCreateInstanceData CreateInstanceData; |
---|
87 | |
---|
88 | TRINITY_LIBRARY_HANDLE hScriptsLib; |
---|
89 | }_ScriptSet,*ScriptsSet; |
---|
90 | |
---|
91 | extern ScriptsSet Script; |
---|
92 | #endif |
---|