Skip to content

Commit

Permalink
Implemente SPELL_ATTR_EX_CANT_TARGET_SELF
Browse files Browse the repository at this point in the history
This will fix all the spells with aoe targets that need to exclude the caster

(based on cmangos/mangos-wotlk@00ff759)

Signed-off-by: Xfurry <xfurry@scriptdev2.com>
  • Loading branch information
xfurry committed Nov 13, 2015
1 parent 8d554f4 commit d87db88
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/game/SharedDefines.h
Expand Up @@ -314,7 +314,7 @@ enum SpellAttributesEx
SPELL_ATTR_EX_UNAFFECTED_BY_SCHOOL_IMMUNE = 0x00010000,// 16 unaffected by school immunity
SPELL_ATTR_EX_UNK17 = 0x00020000,// 17 for auras SPELL_AURA_TRACK_CREATURES, SPELL_AURA_TRACK_RESOURCES and SPELL_AURA_TRACK_STEALTHED select non-stacking tracking spells
SPELL_ATTR_EX_UNK18 = 0x00040000,// 18
SPELL_ATTR_EX_UNK19 = 0x00080000,// 19
SPELL_ATTR_EX_CANT_TARGET_SELF = 0x00080000,// 19 spells with area effect or friendly targets that exclude the caster
SPELL_ATTR_EX_REQ_TARGET_COMBO_POINTS = 0x00100000,// 20 Req combo points on target
SPELL_ATTR_EX_UNK21 = 0x00200000,// 21
SPELL_ATTR_EX_REQ_COMBO_POINTS = 0x00400000,// 22 Use combo points
Expand Down
11 changes: 4 additions & 7 deletions src/game/Spell.cpp
Expand Up @@ -2024,9 +2024,6 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
}
}
}

// exclude caster
targetUnitMap.remove(m_caster);
break;
}
case TARGET_AREAEFFECT_CUSTOM:
Expand Down Expand Up @@ -2271,10 +2268,6 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
case TARGET_ALL_FRIENDLY_UNITS_AROUND_CASTER:
switch (m_spellInfo->Id)
{
case 56153: // Guardian Aura - Ahn'Kahet
FillAreaTargets(targetUnitMap, radius, PUSH_SELF_CENTER, SPELL_TARGETS_FRIENDLY);
targetUnitMap.remove(m_caster);
break;
case 64844: // Divine Hymn
// target amount stored in parent spell dummy effect but hard to access
FillRaidOrPartyHealthPriorityTargets(targetUnitMap, m_caster, m_caster, radius, 3, true, false, true);
Expand Down Expand Up @@ -2985,6 +2978,10 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
break;
}

// remove caster from the list if required by attribute
if (targetMode != TARGET_SELF && targetMode != TARGET_SELF2 && m_spellInfo->HasAttribute(SPELL_ATTR_EX_CANT_TARGET_SELF))
targetUnitMap.remove(m_caster);

if (unMaxTargets && targetUnitMap.size() > unMaxTargets)
{
// make sure one unit is always removed per iteration
Expand Down

0 comments on commit d87db88

Please sign in to comment.