[11113] Fixed spell effects with target pair (18, need_dest_target_set)

Like spells expected always caster object (unit/gameobject coordinates set as dest point).
This commit is contained in:
VladimirMangos 2011-02-07 03:45:31 +03:00
parent abbd2f09be
commit 8069cf09d2
2 changed files with 17 additions and 2 deletions

View file

@ -509,6 +509,22 @@ void Spell::FillTargetMap()
case TARGET_EFFECT_SELECT:
SetTargetMap(SpellEffectIndex(i), m_spellInfo->EffectImplicitTargetA[i], tmpUnitMap);
break;
// dest point setup required
case TARGET_AREAEFFECT_INSTANT:
case TARGET_AREAEFFECT_CUSTOM:
case TARGET_ALL_ENEMY_IN_AREA:
case TARGET_ALL_ENEMY_IN_AREA_INSTANT:
case TARGET_ALL_ENEMY_IN_AREA_CHANNELED:
case TARGET_ALL_FRIENDLY_UNITS_IN_AREA:
case TARGET_AREAEFFECT_GO_AROUND_DEST:
case TARGET_RANDOM_NEARBY_DEST:
// triggered spells get dest point from default target set, ignore it
if (!(m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION) || m_IsTriggeredSpell)
if (WorldObject* castObject = GetAffectiveCasterObject())
m_targets.setDestination(castObject->GetPositionX(), castObject->GetPositionY(), castObject->GetPositionZ());
SetTargetMap(SpellEffectIndex(i), m_spellInfo->EffectImplicitTargetB[i], tmpUnitMap);
break;
// target pre-selection required
case TARGET_INNKEEPER_COORDINATES:
case TARGET_TABLE_X_Y_Z_COORDINATES:
case TARGET_CASTER_COORDINATES:
@ -524,7 +540,6 @@ void Spell::FillTargetMap()
case TARGET_POINT_AT_NW:
case TARGET_POINT_AT_SE:
case TARGET_POINT_AT_SW:
case TARGET_RANDOM_NEARBY_DEST:
// need some target for processing
SetTargetMap(SpellEffectIndex(i), m_spellInfo->EffectImplicitTargetA[i], tmpUnitMap);
SetTargetMap(SpellEffectIndex(i), m_spellInfo->EffectImplicitTargetB[i], tmpUnitMap);

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "11112"
#define REVISION_NR "11113"
#endif // __REVISION_NR_H__