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

Revision 44, 3.3 kB (checked in by yumileroy, 17 years ago)

[svn] * Merge Temp dev SVN with Assembla.
* Changes include:

  • Implementation of w12x's Outdoor PvP and Game Event Systems.
  • Temporary removal of IRC Chat Bot (until infinite loop when disabled is fixed).
  • All mangos -> trinity (to convert your mangos_string table, please run mangos_string_to_trinity_string.sql).
  • Improved Config cleanup.
  • And many more changes.

Original author: Seline
Date: 2008-10-14 11:57:03-05: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// Localized Text function
69const char* GetEventAILocalizedText(uint32 entry);
70
71//EventAI text function
72const char* GetEventAIText(uint32 entry);                   // TODO: Locales
73
74//Generic scripting text function
75void DoScriptText(int32 textEntry, WorldObject* pSource, Unit* target = NULL);
76
77#if COMPILER == COMPILER_GNU
78#define FUNC_PTR(name,callconvention,returntype,parameters)    typedef returntype(*name)parameters __attribute__ ((callconvention));
79#else
80#define FUNC_PTR(name, callconvention, returntype, parameters)    typedef returntype(callconvention *name)parameters;
81#endif
82
83#ifdef WIN32
84  #define TRINITY_DLL_EXPORT extern "C" __declspec(dllexport)
85#elif defined( __GNUC__ )
86  #define TRINITY_DLL_EXPORT extern "C"
87#else
88  #define TRINITY_DLL_EXPORT extern "C" export
89#endif
90
91#endif
Note: See TracBrowser for help on using the browser.