mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 19:37:02 +00:00
[c12571] Allow spell effect 77 (ScriptEffect) and aura 226 (PeriodicDummy) to be handled by script library
This commit is contained in:
parent
c9aa7b5d3a
commit
dcc087a360
5 changed files with 22 additions and 1 deletions
|
|
@ -1997,6 +1997,11 @@ bool ScriptMgr::OnEffectDummy(Unit* pCaster, uint32 spellId, SpellEffectIndex ef
|
|||
return m_pOnEffectDummyItem != NULL && m_pOnEffectDummyItem(pCaster, spellId, effIndex, pTarget);
|
||||
}
|
||||
|
||||
bool ScriptMgr::OnEffectScriptEffect(Unit* pCaster, uint32 spellId, SpellEffectIndex effIndex, Creature* pTarget)
|
||||
{
|
||||
return m_pOnEffectScriptEffectCreature != NULL && m_pOnEffectScriptEffectCreature(pCaster, spellId, effIndex, pTarget);
|
||||
}
|
||||
|
||||
bool ScriptMgr::OnAuraDummy(Aura const* pAura, bool apply)
|
||||
{
|
||||
return m_pOnAuraDummy != NULL && m_pOnAuraDummy(pAura, apply);
|
||||
|
|
|
|||
|
|
@ -502,6 +502,7 @@ class ScriptMgr
|
|||
bool OnEffectDummy(Unit* pCaster, uint32 spellId, SpellEffectIndex effIndex, Creature* pTarget);
|
||||
bool OnEffectDummy(Unit* pCaster, uint32 spellId, SpellEffectIndex effIndex, GameObject* pTarget);
|
||||
bool OnEffectDummy(Unit* pCaster, uint32 spellId, SpellEffectIndex effIndex, Item* pTarget);
|
||||
bool OnEffectScriptEffect(Unit* pCaster, uint32 spellId, SpellEffectIndex effIndex, Creature* pTarget);
|
||||
bool OnAuraDummy(Aura const* pAura, bool apply);
|
||||
|
||||
private:
|
||||
|
|
@ -555,6 +556,7 @@ class ScriptMgr
|
|||
bool (MANGOS_IMPORT* m_pOnEffectDummyCreature)(Unit*, uint32, SpellEffectIndex, Creature*);
|
||||
bool (MANGOS_IMPORT* m_pOnEffectDummyGO)(Unit*, uint32, SpellEffectIndex, GameObject*);
|
||||
bool (MANGOS_IMPORT* m_pOnEffectDummyItem)(Unit*, uint32, SpellEffectIndex, Item*);
|
||||
bool (MANGOS_IMPORT* m_pOnEffectScriptEffectCreature)(Unit*, uint32, SpellEffectIndex, Creature*);
|
||||
bool (MANGOS_IMPORT* m_pOnAuraDummy)(Aura const*, bool);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -8468,6 +8468,12 @@ void Aura::PeriodicDummyTick()
|
|||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
if (target && target->GetTypeId() == TYPEID_UNIT)
|
||||
sScriptMgr.OnEffectDummy(caster, GetId(), GetEffIndex(), (Creature*)target);
|
||||
}
|
||||
}
|
||||
|
||||
void Aura::HandlePreventFleeing(bool apply, bool Real)
|
||||
|
|
|
|||
|
|
@ -8898,6 +8898,14 @@ void Spell::EffectScriptEffect(SpellEffectEntry const* effect)
|
|||
if (!unitTarget)
|
||||
return;
|
||||
|
||||
// Script based implementation. Must be used only for not good for implementation in core spell effects
|
||||
// So called only for not processed cases
|
||||
if (unitTarget->GetTypeId() == TYPEID_UNIT)
|
||||
{
|
||||
if (sScriptMgr.OnEffectScriptEffect(m_caster, m_spellInfo->Id, SpellEffectIndex(effect->EffectIndex), (Creature*)unitTarget))
|
||||
return;
|
||||
}
|
||||
|
||||
// Previous effect might have started script
|
||||
if (!ScriptMgr::CanSpellEffectStartDBScript(m_spellInfo, SpellEffectIndex(effect->EffectIndex)))
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "12570"
|
||||
#define REVISION_NR "12571"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue