[11879] Inform AI function of original caster in some cases

Inform the AI of an original caster for JustSummoned and SpellHitTarget.
This should make scripting some hard cases easier.
Remark that _both_ caster and original caster will be informed (if they are different).

Check your scripts that they still behave as expected!
This commit is contained in:
Schmoozerd 2012-01-19 00:03:29 +01:00
parent 461be74c3a
commit 177bc78108
3 changed files with 20 additions and 2 deletions

View file

@ -1152,6 +1152,8 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
// Call scripted function for AI if this spell is casted by a creature
if (m_caster->GetTypeId() == TYPEID_UNIT && ((Creature*)m_caster)->AI())
((Creature*)m_caster)->AI()->SpellHitTarget(unit, m_spellInfo);
if (real_caster && real_caster != m_caster && real_caster->GetTypeId() == TYPEID_UNIT && ((Creature*)real_caster)->AI())
((Creature*)real_caster)->AI()->SpellHitTarget(unit, m_spellInfo);
}
void Spell::DoSpellHitOnUnit(Unit *unit, uint32 effectMask)