[7454] Support scripting for dummy spell effects.

Note: scripting calls specially added in end of function for allow calling only
      if internal implementaion absent for dummy effect.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
Lightguard 2009-03-14 00:12:10 +03:00 committed by VladimirMangos
parent bc57ab7c58
commit f280c96770
6 changed files with 56 additions and 4 deletions

View file

@ -1116,7 +1116,7 @@ void Spell::EffectDummy(uint32 i)
return;
unitTarget->CastSpell(unitTarget, 58419, true);
break;
return;
}
case 58420: // Portal to Stormwind
{
@ -1124,7 +1124,7 @@ void Spell::EffectDummy(uint32 i)
return;
unitTarget->CastSpell(unitTarget, 58421, true);
break;
return;
}
}
@ -1747,6 +1747,15 @@ void Spell::EffectDummy(uint32 i)
m_caster->AddPetAura(petSpell);
return;
}
// Script based implementation. Must be used only for not good for implementation in core spell effects
// So called only for not proccessed cases
if(gameObjTarget)
Script->EffectDummyGameObj(m_caster, m_spellInfo->Id, i, gameObjTarget);
else if(unitTarget && unitTarget->GetTypeId()==TYPEID_UNIT)
Script->EffectDummyCreature(m_caster, m_spellInfo->Id, i, (Creature*)unitTarget);
else if(itemTarget)
Script->EffectDummyItem(m_caster, m_spellInfo->Id, i, itemTarget);
}
void Spell::EffectTriggerSpellWithValue(uint32 i)