mirror of
https://github.com/mangosfour/server.git
synced 2025-12-18 01:37:01 +00:00
[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:
parent
461be74c3a
commit
177bc78108
3 changed files with 20 additions and 2 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue