Changeset 139 for trunk/src/game/SpellAuras.cpp
- Timestamp:
- 11/19/08 13:39:41 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/SpellAuras.cpp
r123 r139 472 472 } 473 473 474 SingleEnemyTargetAura::SingleEnemyTargetAura(SpellEntry const* spellproto, uint32 eff, int32 *currentBasePoints, Unit *target,475 Unit *caster, Item* castItem) : Aura(spellproto, eff, currentBasePoints, target, caster, castItem)476 {477 if (caster)478 m_casters_target_guid = caster->GetTypeId()==TYPEID_PLAYER ? ((Player*)caster)->GetSelection() : caster->GetUInt64Value(UNIT_FIELD_TARGET);479 else480 m_casters_target_guid = 0;481 }482 483 SingleEnemyTargetAura::~SingleEnemyTargetAura()484 {485 }486 487 Unit* SingleEnemyTargetAura::GetTriggerTarget() const488 {489 return ObjectAccessor::GetUnit(*m_target, m_casters_target_guid);490 }491 492 474 Aura* CreateAura(SpellEntry const* spellproto, uint32 eff, int32 *currentBasePoints, Unit *target, Unit *caster, Item* castItem) 493 475 { 494 476 if (IsAreaAuraEffect(spellproto->Effect[eff])) 495 477 return new AreaAura(spellproto, eff, currentBasePoints, target, caster, castItem); 496 497 uint32 triggeredSpellId = spellproto->EffectTriggerSpell[eff];498 499 SpellEntry const* triggredSpellInfo = sSpellStore.LookupEntry(triggeredSpellId);500 if (triggredSpellInfo)501 for (int i = 0; i < 3; ++i)502 if (triggredSpellInfo->EffectImplicitTargetA[i] == TARGET_SINGLE_ENEMY)503 return new SingleEnemyTargetAura(spellproto, eff, currentBasePoints, target, caster, castItem);504 478 505 479 return new Aura(spellproto, eff, currentBasePoints, target, caster, castItem); … … 1908 1882 } 1909 1883 // All ok cast by default case 1910 Spell *spell = new Spell( caster, triggredSpellInfo, true, originalCasterGUID );1884 Spell *spell = new Spell(m_target, triggredSpellInfo, true, originalCasterGUID ); 1911 1885 1912 1886 SpellCastTargets targets;