diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index 08c9f8be6..452d95686 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -838,6 +838,7 @@ enum Targets TARGET_AREAEFFECT_PARTY_AND_CLASS = 61, TARGET_DUELVSPLAYER_COORDINATES = 63, TARGET_BEHIND_VICTIM = 65, // uses in teleport behind spells + TARGET_DYNAMIC_OBJECT_COORDINATES = 76, TARGET_SINGLE_ENEMY = 77, TARGET_SELF2 = 87, TARGET_NONCOMBAT_PET = 90, diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index ab5e1fc80..6cc1620f0 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -1988,6 +1988,12 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list &TagUnitMap) m_targets.setDestination(_target_x, _target_y, _target_z); } }break; + case TARGET_DYNAMIC_OBJECT_COORDINATES: + { + // if parent spell create dynamic object extract area from it + if(DynamicObject* dynObj = m_caster->GetDynObject(m_triggeredByAuraSpell ? m_triggeredByAuraSpell->Id : m_spellInfo->Id)) + m_targets.setDestination(dynObj->GetPositionX(), dynObj->GetPositionY(), dynObj->GetPositionZ()); + }break; default: break; } diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 04f1a4b2f..efc1ff2eb 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -1325,8 +1325,6 @@ void Aura::TriggerSpell() // generic casting code with custom spells and target/caster customs uint32 trigger_spell_id = GetSpellProto()->EffectTriggerSpell[m_effIndex]; - uint64 originalCasterGUID = GetCasterGUID(); - SpellEntry const *triggeredSpellInfo = sSpellStore.LookupEntry(trigger_spell_id); SpellEntry const *auraSpellInfo = GetSpellProto(); uint32 auraId = auraSpellInfo->Id; @@ -1980,28 +1978,18 @@ void Aura::TriggerSpell() return; caster = target; - originalCasterGUID = 0; break; } // Mana Tide case 16191: { - caster->CastCustomSpell(target, trigger_spell_id, &m_modifier.m_amount, NULL, NULL, true, NULL, this, originalCasterGUID); + caster->CastCustomSpell(target, trigger_spell_id, &m_modifier.m_amount, NULL, NULL, true, NULL, this); return; } } } // All ok cast by default case - Spell *spell = new Spell(caster, triggeredSpellInfo, true, originalCasterGUID ); - - SpellCastTargets targets; - targets.setUnitTarget( target ); - - // if spell create dynamic object extract area from it - if(DynamicObject* dynObj = caster->GetDynObject(GetId())) - targets.setDestination(dynObj->GetPositionX(),dynObj->GetPositionY(),dynObj->GetPositionZ()); - - spell->prepare(&targets, this); + caster->CastSpell(target, triggeredSpellInfo, true, 0, this); } void Aura::TriggerSpellWithValue() @@ -2015,7 +2003,6 @@ void Aura::TriggerSpellWithValue() // generic casting code with custom spells and target/caster customs uint32 trigger_spell_id = GetSpellProto()->EffectTriggerSpell[m_effIndex]; int32 basepoints0 = this->GetModifier()->m_amount; - uint64 originalCasterGUID = GetCasterGUID(); caster->CastCustomSpell(target, trigger_spell_id, &basepoints0, 0, 0, true, 0, this); } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 02209c3ad..e51884981 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "7139" + #define REVISION_NR "7140" #endif // __REVISION_NR_H__