[9098] More correct targets selection for target pairs with TARGET_SELF2

* Many spell effects that have A target mode SELF2 expected applied to enemy
  target selected by targetmode B so we need skip SELF2 target mode.
* remove SEFL2 from explicit positive target modes.
This commit is contained in:
VladimirMangos 2010-01-01 21:09:10 +03:00
parent f9ec746123
commit c09ee423ba
3 changed files with 39 additions and 25 deletions

View file

@ -511,6 +511,27 @@ void Spell::FillTargetMap()
break;
}
break;
case TARGET_SELF:
switch(m_spellInfo->EffectImplicitTargetB[i])
{
case 0:
case TARGET_EFFECT_SELECT:
SetTargetMap(i, m_spellInfo->EffectImplicitTargetA[i], tmpUnitMap);
break;
case TARGET_AREAEFFECT_INSTANT: // use B case that not dependent from from A in fact
if((m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION) == 0)
m_targets.setDestination(m_caster->GetPositionX(), m_caster->GetPositionY(), m_caster->GetPositionZ());
SetTargetMap(i, m_spellInfo->EffectImplicitTargetB[i], tmpUnitMap);
break;
case TARGET_BEHIND_VICTIM: // use B case that not dependent from from A in fact
SetTargetMap(i, m_spellInfo->EffectImplicitTargetB[i], tmpUnitMap);
break;
default:
SetTargetMap(i, m_spellInfo->EffectImplicitTargetA[i], tmpUnitMap);
SetTargetMap(i, m_spellInfo->EffectImplicitTargetB[i], tmpUnitMap);
break;
}
break;
case TARGET_EFFECT_SELECT:
switch(m_spellInfo->EffectImplicitTargetB[i])
{
@ -542,27 +563,6 @@ void Spell::FillTargetMap()
break;
}
break;
case TARGET_SELF:
switch(m_spellInfo->EffectImplicitTargetB[i])
{
case 0:
case TARGET_EFFECT_SELECT:
SetTargetMap(i, m_spellInfo->EffectImplicitTargetA[i], tmpUnitMap);
break;
case TARGET_AREAEFFECT_INSTANT: // use B case that not dependent from from A in fact
if((m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION) == 0)
m_targets.setDestination(m_caster->GetPositionX(), m_caster->GetPositionY(), m_caster->GetPositionZ());
SetTargetMap(i, m_spellInfo->EffectImplicitTargetB[i], tmpUnitMap);
break;
case TARGET_BEHIND_VICTIM: // use B case that not dependent from from A in fact
SetTargetMap(i, m_spellInfo->EffectImplicitTargetB[i], tmpUnitMap);
break;
default:
SetTargetMap(i, m_spellInfo->EffectImplicitTargetA[i], tmpUnitMap);
SetTargetMap(i, m_spellInfo->EffectImplicitTargetB[i], tmpUnitMap);
break;
}
break;
case TARGET_CASTER_COORDINATES:
switch(m_spellInfo->EffectImplicitTargetB[i])
{
@ -609,6 +609,19 @@ void Spell::FillTargetMap()
break;
}
break;
case TARGET_SELF2:
switch(m_spellInfo->EffectImplicitTargetB[i])
{
case 0:
case TARGET_EFFECT_SELECT:
SetTargetMap(i, m_spellInfo->EffectImplicitTargetA[i], tmpUnitMap);
break;
// most A/B target pairs is slef->negative and not expect adding caster to target list
default:
SetTargetMap(i, m_spellInfo->EffectImplicitTargetB[i], tmpUnitMap);
break;
}
break;
default:
switch(m_spellInfo->EffectImplicitTargetB[i])
{