Permalink
Browse files

[3018] Implement NpcSpellClick script hook. Requires CMaNGOS 12674+

  • Loading branch information...
1 parent b75eeb1 commit 1ff9aea8211448ea6593e7d3bc25f0b567577bdd @xfurry xfurry committed Jun 23, 2014
Showing with 16 additions and 3 deletions.
  1. +11 −0 ScriptMgr.cpp
  2. +2 −1 ScriptMgr.h
  3. +1 −1 sd2_revision_nr.h
  4. +1 −1 sql/scriptdev2_script_full.sql
  5. +1 −0 sql/updates/r3018_scriptdev2.sql
View
@@ -447,6 +447,17 @@ bool AreaTrigger(Player* pPlayer, AreaTriggerEntry const* atEntry)
}
MANGOS_DLL_EXPORT
+bool NpcSpellClick(Player* pPlayer, Creature* pClickedCreature, uint32 uiSpellId)
+{
+ Script* pTempScript = m_scripts[pClickedCreature->GetScriptId()];
+
+ if (!pTempScript || !pTempScript->pNpcSpellClick)
+ return false;
+
+ return pTempScript->pNpcSpellClick(pPlayer, pClickedCreature, uiSpellId);
+}
+
+MANGOS_DLL_EXPORT
bool ProcessEvent(uint32 uiEventId, Object* pSource, Object* pTarget, bool bIsStart)
{
Script* pTempScript = m_scripts[GetEventIdScriptId(uiEventId)];
View
@@ -67,7 +67,7 @@ struct Script
pDialogStatusNPC(NULL), pDialogStatusGO(NULL),
pQuestAcceptNPC(NULL), pQuestAcceptGO(NULL), pQuestAcceptItem(NULL),
pQuestRewardedNPC(NULL), pQuestRewardedGO(NULL),
- pGOUse(NULL), pItemUse(NULL), pAreaTrigger(NULL), pProcessEventId(NULL),
+ pGOUse(NULL), pItemUse(NULL), pAreaTrigger(NULL), pNpcSpellClick(NULL), pProcessEventId(NULL),
pEffectDummyNPC(NULL), pEffectDummyGO(NULL), pEffectDummyItem(NULL), pEffectScriptEffectNPC(NULL),
pEffectAuraDummy(NULL), GetAI(NULL), GetInstanceData(NULL)
{}
@@ -90,6 +90,7 @@ struct Script
bool (*pGOUse)(Player*, GameObject*);
bool (*pItemUse)(Player*, Item*, SpellCastTargets const&);
bool (*pAreaTrigger)(Player*, AreaTriggerEntry const*);
+ bool (*pNpcSpellClick)(Player*, Creature*, uint32);
bool (*pProcessEventId)(uint32, Object*, Object*, bool);
bool (*pEffectDummyNPC)(Unit*, uint32, SpellEffectIndex, Creature*, ObjectGuid);
bool (*pEffectDummyGO)(Unit*, uint32, SpellEffectIndex, GameObject*, ObjectGuid);
View
@@ -1,4 +1,4 @@
#ifndef __SD2_REVISION_NR_H__
#define __SD2_REVISION_NR_H__
- #define SD2_REVISION_NR "3017"
+ #define SD2_REVISION_NR "3018"
#endif // __SD2_REVISION_NR_H__
@@ -3,7 +3,7 @@
--
DELETE FROM sd2_db_version;
-INSERT INTO sd2_db_version (version) VALUES ('ScriptDev2 (for CMaNGOS 12661+) ');
+INSERT INTO sd2_db_version (version) VALUES ('ScriptDev2 (for CMaNGOS 12674+) ');
--
-- Below contains data for table `script_texts` mainly used in C++ parts.
@@ -0,0 +1 @@
+UPDATE sd2_db_version SET version='ScriptDev2 (for CMaNGOS 12674+) ';

0 comments on commit 1ff9aea

Please sign in to comment.