mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 10:37:03 +00:00
[10570] Store spell entry of triggering spell on triggered, original patch provided by insider42
This commit is contained in:
parent
ead698e881
commit
a67b6a1da5
5 changed files with 44 additions and 27 deletions
|
|
@ -319,7 +319,7 @@ void SpellCastTargets::write( ByteBuffer& data ) const
|
|||
data << m_strTarget;
|
||||
}
|
||||
|
||||
Spell::Spell( Unit* caster, SpellEntry const *info, bool triggered, ObjectGuid originalCasterGUID, Spell** triggeringContainer )
|
||||
Spell::Spell( Unit* caster, SpellEntry const *info, bool triggered, ObjectGuid originalCasterGUID, Spell** triggeringContainer, SpellEntry const* triggeredBy )
|
||||
{
|
||||
MANGOS_ASSERT( caster != NULL && info != NULL );
|
||||
MANGOS_ASSERT( info == sSpellStore.LookupEntry( info->Id ) && "`info` must be pointer to sSpellStore element");
|
||||
|
|
@ -334,6 +334,7 @@ Spell::Spell( Unit* caster, SpellEntry const *info, bool triggered, ObjectGuid o
|
|||
else
|
||||
m_spellInfo = info;
|
||||
|
||||
m_triggeredBySpellInfo = triggeredBy;
|
||||
m_caster = caster;
|
||||
m_selfContainer = NULL;
|
||||
m_triggeringContainer = triggeringContainer;
|
||||
|
|
|
|||
|
|
@ -342,7 +342,7 @@ class Spell
|
|||
void EffectSpecCount(SpellEffectIndex eff_idx);
|
||||
void EffectActivateSpec(SpellEffectIndex eff_idx);
|
||||
|
||||
Spell( Unit* caster, SpellEntry const *info, bool triggered, ObjectGuid originalCasterGUID = ObjectGuid(), Spell** triggeringContainer = NULL );
|
||||
Spell( Unit* caster, SpellEntry const *info, bool triggered, ObjectGuid originalCasterGUID = ObjectGuid(), Spell** triggeringContainer = NULL, SpellEntry const* triggeredBy = NULL);
|
||||
~Spell();
|
||||
|
||||
void prepare(SpellCastTargets const* targets, Aura* triggeredByAura = NULL);
|
||||
|
|
@ -422,6 +422,7 @@ class Spell
|
|||
//void HandleAddAura(Unit* Target);
|
||||
|
||||
SpellEntry const* m_spellInfo;
|
||||
SpellEntry const* m_triggeredBySpellInfo;
|
||||
int32 m_currentBasePoints[MAX_EFFECT_INDEX]; // cache SpellEntry::CalculateSimpleValue and use for set custom base points
|
||||
Item* m_CastItem;
|
||||
uint8 m_cast_count;
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
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)
|
||||
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)
|
||||
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);
|
||||
|
|
|
|||
|
|
@ -1428,12 +1428,12 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
|
|||
void SendEnergizeSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage,Powers powertype);
|
||||
void EnergizeBySpell(Unit *pVictim, uint32 SpellID, uint32 Damage, Powers powertype);
|
||||
uint32 SpellNonMeleeDamageLog(Unit *pVictim, uint32 spellID, uint32 damage);
|
||||
void CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item *castItem = NULL, Aura* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid());
|
||||
void CastSpell(Unit* Victim,SpellEntry const *spellInfo, bool triggered, Item *castItem= NULL, Aura* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid());
|
||||
void CastCustomSpell(Unit* Victim, uint32 spellId, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem= NULL, Aura* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid());
|
||||
void CastCustomSpell(Unit* Victim,SpellEntry const *spellInfo, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem= NULL, Aura* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid());
|
||||
void CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item *castItem = NULL, Aura* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid());
|
||||
void CastSpell(float x, float y, float z, SpellEntry const *spellInfo, bool triggered, Item *castItem = NULL, Aura* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid());
|
||||
void CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item *castItem = NULL, Aura* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid(), SpellEntry const* triggeredBy = NULL);
|
||||
void CastSpell(Unit* Victim,SpellEntry const *spellInfo, bool triggered, Item *castItem= NULL, Aura* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid(), SpellEntry const* triggeredBy = NULL);
|
||||
void CastCustomSpell(Unit* Victim, uint32 spellId, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem= NULL, Aura* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid(), SpellEntry const* triggeredBy = NULL);
|
||||
void CastCustomSpell(Unit* Victim,SpellEntry const *spellInfo, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem= NULL, Aura* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid(), SpellEntry const* triggeredBy = NULL);
|
||||
void CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item *castItem = NULL, Aura* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid(), SpellEntry const* triggeredBy = NULL);
|
||||
void CastSpell(float x, float y, float z, SpellEntry const *spellInfo, bool triggered, Item *castItem = NULL, Aura* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid(), SpellEntry const* triggeredBy = NULL);
|
||||
|
||||
bool IsDamageToThreatSpell(SpellEntry const * spellInfo) const;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "10569"
|
||||
#define REVISION_NR "10570"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue