[10570] Store spell entry of triggering spell on triggered, original patch provided by insider42

This commit is contained in:
Laise 2010-10-01 13:16:48 +02:00
parent ead698e881
commit a67b6a1da5
5 changed files with 44 additions and 27 deletions

View file

@ -1080,7 +1080,7 @@ void Unit::CastStop(uint32 except_spellid)
InterruptSpell(CurrentSpellTypes(i),false);
}
void Unit::CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item *castItem, Aura* triggeredByAura, ObjectGuid originalCaster)
void Unit::CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item *castItem, Aura* triggeredByAura, ObjectGuid originalCaster, SpellEntry const* triggeredBy)
{
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId);
@ -1093,10 +1093,10 @@ void Unit::CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item *castIte
return;
}
CastSpell(Victim, spellInfo, triggered, castItem, triggeredByAura, originalCaster);
CastSpell(Victim, spellInfo, triggered, castItem, triggeredByAura, originalCaster, triggeredBy);
}
void Unit::CastSpell(Unit* Victim, SpellEntry const *spellInfo, bool triggered, Item *castItem, Aura* triggeredByAura, ObjectGuid originalCaster)
void Unit::CastSpell(Unit* Victim, SpellEntry const *spellInfo, bool triggered, Item *castItem, Aura* triggeredByAura, ObjectGuid originalCaster, SpellEntry const* triggeredBy)
{
if(!spellInfo)
{
@ -1110,10 +1110,15 @@ void Unit::CastSpell(Unit* Victim, SpellEntry const *spellInfo, bool triggered,
if (castItem)
DEBUG_FILTER_LOG(LOG_FILTER_SPELL_CAST, "WORLD: cast Item spellId - %i", spellInfo->Id);
if(originalCaster.IsEmpty() && triggeredByAura)
originalCaster = triggeredByAura->GetCasterGUID();
if (triggeredByAura)
{
if(originalCaster.IsEmpty())
originalCaster = triggeredByAura->GetCasterGUID();
Spell *spell = new Spell(this, spellInfo, triggered, originalCaster);
triggeredBy = triggeredByAura->GetSpellProto();
}
Spell *spell = new Spell(this, spellInfo, triggered, originalCaster, NULL, triggeredBy);
SpellCastTargets targets;
targets.setUnitTarget( Victim );
@ -1121,7 +1126,7 @@ void Unit::CastSpell(Unit* Victim, SpellEntry const *spellInfo, bool triggered,
spell->prepare(&targets, triggeredByAura);
}
void Unit::CastCustomSpell(Unit* Victim,uint32 spellId, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem, Aura* triggeredByAura, ObjectGuid originalCaster)
void Unit::CastCustomSpell(Unit* Victim,uint32 spellId, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem, Aura* triggeredByAura, ObjectGuid originalCaster, SpellEntry const* triggeredBy)
{
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId);
@ -1134,10 +1139,10 @@ void Unit::CastCustomSpell(Unit* Victim,uint32 spellId, int32 const* bp0, int32
return;
}
CastCustomSpell(Victim, spellInfo, bp0, bp1, bp2, triggered, castItem, triggeredByAura, originalCaster);
CastCustomSpell(Victim, spellInfo, bp0, bp1, bp2, triggered, castItem, triggeredByAura, originalCaster, triggeredBy);
}
void Unit::CastCustomSpell(Unit* Victim, SpellEntry const *spellInfo, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem, Aura* triggeredByAura, ObjectGuid originalCaster)
void Unit::CastCustomSpell(Unit* Victim, SpellEntry const *spellInfo, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem, Aura* triggeredByAura, ObjectGuid originalCaster, SpellEntry const* triggeredBy)
{
if(!spellInfo)
{
@ -1151,10 +1156,15 @@ void Unit::CastCustomSpell(Unit* Victim, SpellEntry const *spellInfo, int32 cons
if (castItem)
DEBUG_FILTER_LOG(LOG_FILTER_SPELL_CAST, "WORLD: cast Item spellId - %i", spellInfo->Id);
if(originalCaster.IsEmpty() && triggeredByAura)
originalCaster = triggeredByAura->GetCasterGUID();
if (triggeredByAura)
{
if(originalCaster.IsEmpty())
originalCaster = triggeredByAura->GetCasterGUID();
Spell *spell = new Spell(this, spellInfo, triggered, originalCaster);
triggeredBy = triggeredByAura->GetSpellProto();
}
Spell *spell = new Spell(this, spellInfo, triggered, originalCaster, NULL, triggeredBy);
if(bp0)
spell->m_currentBasePoints[EFFECT_INDEX_0] = *bp0;
@ -1172,7 +1182,7 @@ void Unit::CastCustomSpell(Unit* Victim, SpellEntry const *spellInfo, int32 cons
}
// used for scripting
void Unit::CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item *castItem, Aura* triggeredByAura, ObjectGuid originalCaster)
void Unit::CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item *castItem, Aura* triggeredByAura, ObjectGuid originalCaster, SpellEntry const* triggeredBy)
{
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId);
@ -1185,11 +1195,11 @@ void Unit::CastSpell(float x, float y, float z, uint32 spellId, bool triggered,
return;
}
CastSpell(x, y, z, spellInfo, triggered, castItem, triggeredByAura, originalCaster);
CastSpell(x, y, z, spellInfo, triggered, castItem, triggeredByAura, originalCaster, triggeredBy);
}
// used for scripting
void Unit::CastSpell(float x, float y, float z, SpellEntry const *spellInfo, bool triggered, Item *castItem, Aura* triggeredByAura, ObjectGuid originalCaster)
void Unit::CastSpell(float x, float y, float z, SpellEntry const *spellInfo, bool triggered, Item *castItem, Aura* triggeredByAura, ObjectGuid originalCaster, SpellEntry const* triggeredBy)
{
if(!spellInfo)
{
@ -1203,10 +1213,15 @@ void Unit::CastSpell(float x, float y, float z, SpellEntry const *spellInfo, boo
if (castItem)
DEBUG_FILTER_LOG(LOG_FILTER_SPELL_CAST, "WORLD: cast Item spellId - %i", spellInfo->Id);
if(originalCaster.IsEmpty() && triggeredByAura)
originalCaster = triggeredByAura->GetCasterGUID();
if (triggeredByAura)
{
if(originalCaster.IsEmpty())
originalCaster = triggeredByAura->GetCasterGUID();
Spell *spell = new Spell(this, spellInfo, triggered, originalCaster);
triggeredBy = triggeredByAura->GetSpellProto();
}
Spell *spell = new Spell(this, spellInfo, triggered, originalCaster, NULL, triggeredBy);
SpellCastTargets targets;
targets.setDestination(x, y, z);