[10299] Add new script call ProcessEventId

Let script library know when some event is about to start. Event id's may be found in several sources, such as spells, GO's and transport/taxi paths.
Database scripts may be prevented by returning true from script side whenever needed. If false, DB script will run like normal.
New database table event_id_scripts will need a ScriptName for the event id, in same way as for example areatrigger_scripts.

Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
NoFantasy 2010-07-31 17:51:49 +02:00
parent 28d1ac66c3
commit 2ad9cd34b2
16 changed files with 180 additions and 11 deletions

View file

@ -476,6 +476,7 @@ class ObjectMgr
typedef UNORDERED_MAP<uint32, AreaTrigger> AreaTriggerMap;
typedef UNORDERED_MAP<uint32, uint32> AreaTriggerScriptMap;
typedef UNORDERED_MAP<uint32, uint32> EventIdScriptMap;
typedef UNORDERED_MAP<uint32, RepRewardRate > RepRewardRateMap;
typedef UNORDERED_MAP<uint32, ReputationOnKillEntry> RepOnKillMap;
@ -611,6 +612,7 @@ class ObjectMgr
AreaTrigger const* GetMapEntranceTrigger(uint32 Map) const;
uint32 GetAreaTriggerScriptId(uint32 trigger_id);
uint32 GetEventIdScriptId(uint32 eventId);
RepRewardRate const* GetRepRewardRate(uint32 factionId) const
{
@ -712,6 +714,7 @@ class ObjectMgr
void LoadAreaTriggerTeleports();
void LoadQuestAreaTriggers();
void LoadAreaTriggerScripts();
void LoadEventIdScripts();
void LoadTavernAreaTriggers();
void LoadGameObjectForQuests();
@ -1047,7 +1050,9 @@ class ObjectMgr
GameObjectForQuestSet mGameObjectForQuestSet;
GossipTextMap mGossipText;
AreaTriggerMap mAreaTriggers;
AreaTriggerScriptMap mAreaTriggerScripts;
AreaTriggerScriptMap mAreaTriggerScripts;
EventIdScriptMap mEventIdScripts;
RepRewardRateMap m_RepRewardRateMap;
RepOnKillMap mRepOnKill;
@ -1140,6 +1145,7 @@ class ObjectMgr
// scripting access functions
MANGOS_DLL_SPEC bool LoadMangosStrings(DatabaseType& db, char const* table,int32 start_value = MAX_CREATURE_AI_TEXT_STRING_ID, int32 end_value = std::numeric_limits<int32>::min());
MANGOS_DLL_SPEC uint32 GetAreaTriggerScriptId(uint32 trigger_id);
MANGOS_DLL_SPEC uint32 GetEventIdScriptId(uint32 event_id);
MANGOS_DLL_SPEC uint32 GetScriptId(const char *name);
MANGOS_DLL_SPEC ObjectMgr::ScriptNameMap& GetScriptNames();
MANGOS_DLL_SPEC CreatureInfo const* GetCreatureTemplateStore(uint32 entry);