[9444] Add script call EffectAuraDummy, called at dummy aura(4) apply/remove

Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
NoFantasy 2010-02-24 17:14:44 +01:00
parent 9f3b42d8ee
commit 24f2d4658f
6 changed files with 22 additions and 2 deletions

View file

@ -23,6 +23,7 @@
#include "../../game/Player.h"
#include "../../game/Map.h"
#include "../../game/ObjectMgr.h"
#include "../../game/SpellAuras.h"
//uint8 loglevel = 0;
int nrscripts;
@ -310,6 +311,16 @@ bool EffectDummyItem(Unit *caster, uint32 spellId, SpellEffectIndex effIndex, It
return tmpscript->pEffectDummyItem(caster, spellId, effIndex, itemTarget);
}
MANGOS_DLL_EXPORT
bool EffectAuraDummy(const Aura* pAura, bool apply)
{
Script *tmpscript = m_scripts[((Creature*)pAura->GetTarget())->GetScriptId()];
if (!tmpscript || !tmpscript->pEffectAuraDummy)
return false;
return tmpscript->pEffectAuraDummy(pAura, apply);
}
void ScriptedAI::UpdateAI(const uint32)
{
//Check if we have a current target

View file

@ -31,6 +31,7 @@ class Item;
class GameObject;
class SpellCastTargets;
class Map;
class Aura;
#define MAX_SCRIPTS 1000
#define MAX_INSTANCE_SCRIPTS 1000
@ -42,7 +43,7 @@ struct Script
pQuestSelect(NULL), pQuestComplete(NULL), pNPCDialogStatus(NULL), pGODialogStatus(NULL), pChooseReward(NULL),
pItemHello(NULL), pGOHello(NULL), pAreaTrigger(NULL), pItemQuestAccept(NULL), pGOQuestAccept(NULL),
pGOChooseReward(NULL), pItemUse(NULL), pEffectDummyGameObj(NULL), pEffectDummyCreature(NULL),
pEffectDummyItem(NULL), GetAI(NULL)
pEffectDummyItem(NULL), pEffectAuraDummy(NULL), GetAI(NULL)
{}
std::string Name;
@ -67,6 +68,7 @@ struct Script
bool (*pEffectDummyGameObj )(Unit*, uint32, SpellEffectIndex, GameObject* );
bool (*pEffectDummyCreature )(Unit*, uint32, SpellEffectIndex, Creature* );
bool (*pEffectDummyItem )(Unit*, uint32, SpellEffectIndex, Item* );
bool (*pEffectAuraDummy )(const Aura*, bool);
CreatureAI* (*GetAI)(Creature *_Creature);
InstanceData* (*GetInstanceData)(Map*);