mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[9833] Allow TARGET_AREAEFFECT_CUSTOM to target invisible/not targetable npc if script target for them exists
This commit is contained in:
parent
92ab082fc6
commit
8a4b520979
3 changed files with 15 additions and 4 deletions
|
|
@ -1716,14 +1716,14 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::list<Unit*> tempTargetUnitMap;
|
UnitList tempTargetUnitMap;
|
||||||
SpellScriptTargetBounds bounds = sSpellMgr.GetSpellScriptTargetBounds(m_spellInfo->Id);
|
SpellScriptTargetBounds bounds = sSpellMgr.GetSpellScriptTargetBounds(m_spellInfo->Id);
|
||||||
// fill real target list if no spell script target defined
|
// fill real target list if no spell script target defined
|
||||||
FillAreaTargets(bounds.first != bounds.second ? tempTargetUnitMap : targetUnitMap, m_targets.m_destX, m_targets.m_destY, radius, PUSH_DEST_CENTER, SPELL_TARGETS_ALL);
|
FillAreaTargets(bounds.first != bounds.second ? tempTargetUnitMap : targetUnitMap, m_targets.m_destX, m_targets.m_destY, radius, PUSH_DEST_CENTER, SPELL_TARGETS_ALL);
|
||||||
|
|
||||||
if (!tempTargetUnitMap.empty())
|
if (!tempTargetUnitMap.empty())
|
||||||
{
|
{
|
||||||
for (std::list<Unit*>::const_iterator iter = tempTargetUnitMap.begin(); iter != tempTargetUnitMap.end(); ++iter)
|
for (UnitList::const_iterator iter = tempTargetUnitMap.begin(); iter != tempTargetUnitMap.end(); ++iter)
|
||||||
{
|
{
|
||||||
if ((*iter)->GetTypeId() != TYPEID_UNIT)
|
if ((*iter)->GetTypeId() != TYPEID_UNIT)
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -1742,6 +1742,17 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// remove not targetable units if spell has no script targets
|
||||||
|
for (UnitList::const_iterator itr = targetUnitMap.begin(); itr != targetUnitMap.end(); )
|
||||||
|
{
|
||||||
|
if (!(*itr)->isTargetableForAttack(m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_CAST_ON_DEAD))
|
||||||
|
targetUnitMap.erase(itr++);
|
||||||
|
else
|
||||||
|
++itr;
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TARGET_ALL_ENEMY_IN_AREA_INSTANT:
|
case TARGET_ALL_ENEMY_IN_AREA_INSTANT:
|
||||||
|
|
|
||||||
|
|
@ -709,7 +709,7 @@ namespace MaNGOS
|
||||||
{
|
{
|
||||||
// there are still more spells which can be casted on dead, but
|
// there are still more spells which can be casted on dead, but
|
||||||
// they are no AOE and don't have such a nice SPELL_ATTR flag
|
// they are no AOE and don't have such a nice SPELL_ATTR flag
|
||||||
if ( !itr->getSource()->isTargetableForAttack(i_spell.m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_CAST_ON_DEAD)
|
if ( (i_TargetType != SPELL_TARGETS_ALL && !itr->getSource()->isTargetableForAttack(i_spell.m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_CAST_ON_DEAD))
|
||||||
// mostly phase check
|
// mostly phase check
|
||||||
|| !itr->getSource()->IsInMap(i_originalCaster))
|
|| !itr->getSource()->IsInMap(i_originalCaster))
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "9832"
|
#define REVISION_NR "9833"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue