root/trunk/src/bindings/scripts/ScriptMgr.h @ 149

Revision 149, 3.1 kB (checked in by yumileroy, 17 years ago)

[svn] *Implement new player conditions CONDITION_NO_AURA, CONDITION_ACTIVE_EVENT
* Default behaviour of pets for creatures changed to REACT_DEFENSIVE
* Disallowed sending wrapped items as COD
* Prevent loading and saving single target auras for pet in same way as already implemented for player
* Correctly limit use some flask types to zones.
* Fixed extracting common.MPQ under *nix
* Many small xleanups and fixes.
** mangos merge rev.

TEST REV so be careful of creepy crawly bugs!

Original author: KingPin?
Date: 2008-11-02 16:53:46-06:00

Line 
1/* Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
2 *
3 * Thanks to the original authors: ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
4 *
5 * This program is free software licensed under GPL version 2
6 * Please see the included DOCS/LICENSE.TXT for more information */
7
8#ifndef SCRIPTMGR_H
9#define SCRIPTMGR_H
10
11#include "Common.h"
12#include "Platform/CompilerDefs.h"
13#include "Database/DBCStructure.h"
14
15class Player;
16class Creature;
17class CreatureAI;
18class InstanceData;
19class Quest;
20class Item;
21class GameObject;
22class SpellCastTargets;
23class Map;
24class Unit;
25class WorldObject;
26
27#define MAX_SCRIPTS         1000                            //72 bytes each (approx 71kb)
28#define VISIBLE_RANGE       (166.0f)                        //MAX visible range (size of grid)
29#define DEFAULT_TEXT        "<Trinity Script Text Entry Missing!>"
30
31struct Script
32{
33    Script() :
34pGossipHello(NULL), pQuestAccept(NULL), pGossipSelect(NULL), pGossipSelectWithCode(NULL),
35pQuestSelect(NULL), pQuestComplete(NULL), pNPCDialogStatus(NULL), pGODialogStatus(NULL), pChooseReward(NULL),
36pItemHello(NULL), pGOHello(NULL), pAreaTrigger(NULL), pItemQuestAccept(NULL), pGOQuestAccept(NULL),
37pGOChooseReward(NULL),pReceiveEmote(NULL),pItemUse(NULL), GetAI(NULL), GetInstanceData(NULL)
38{}
39
40std::string Name;
41
42// Quest/gossip Methods to be scripted
43bool (*pGossipHello         )(Player*, Creature*);
44bool (*pQuestAccept         )(Player*, Creature*, Quest const* );
45bool (*pGossipSelect        )(Player*, Creature*, uint32 , uint32  );
46bool (*pGossipSelectWithCode)(Player*, Creature*, uint32 , uint32 , const char* );
47bool (*pQuestSelect         )(Player*, Creature*, Quest const* );
48bool (*pQuestComplete       )(Player*, Creature*, Quest const* );
49uint32 (*pNPCDialogStatus   )(Player*, Creature* );
50uint32 (*pGODialogStatus    )(Player *player, GameObject * _GO );
51bool (*pChooseReward        )(Player*, Creature*, Quest const*, uint32 );
52bool (*pItemHello           )(Player*, Item*, Quest const* );
53bool (*pGOHello             )(Player*, GameObject* );
54bool (*pAreaTrigger         )(Player*, AreaTriggerEntry* );
55bool (*pItemQuestAccept     )(Player*, Item *, Quest const* );
56bool (*pGOQuestAccept       )(Player*, GameObject*, Quest const* );
57bool (*pGOChooseReward      )(Player*, GameObject*_GO, Quest const*, uint32 );
58bool (*pReceiveEmote        )(Player*, Creature*, uint32 );
59bool (*pItemUse             )(Player*, Item*, SpellCastTargets const& );
60
61CreatureAI* (*GetAI)(Creature*);
62InstanceData* (*GetInstanceData)(Map*);
63};
64
65extern int nrscripts;
66extern Script *m_scripts[MAX_SCRIPTS];
67
68//Generic scripting text function
69void DoScriptText(int32 textEntry, WorldObject* pSource, Unit* target = NULL);
70
71#if COMPILER == COMPILER_GNU
72#define FUNC_PTR(name,callconvention,returntype,parameters)    typedef returntype(*name)parameters __attribute__ ((callconvention));
73#else
74#define FUNC_PTR(name, callconvention, returntype, parameters)    typedef returntype(callconvention *name)parameters;
75#endif
76
77#ifdef WIN32
78  #define TRINITY_DLL_EXPORT extern "C" __declspec(dllexport)
79#elif defined( __GNUC__ )
80#define TRINITY_DLL_EXPORT extern "C"
81#else
82#define TRINITY_DLL_EXPORT extern "C" export
83#endif
84
85#endif
Note: See TracBrowser for help on using the browser.