mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +00:00
[7442] Implement TARGET_DIRECTLY_FORWARD spell target mode.
It used in many cannon/rocket ike spells.
This commit is contained in:
parent
903b810353
commit
498ab2df07
3 changed files with 25 additions and 3 deletions
|
|
@ -838,10 +838,11 @@ enum Targets
|
|||
TARGET_SINGLE_FRIEND_2 = 57,
|
||||
TARGET_AREAEFFECT_PARTY_AND_CLASS = 61,
|
||||
TARGET_DUELVSPLAYER_COORDINATES = 63,
|
||||
TARGET_BEHIND_VICTIM = 65, // uses in teleport behind spells
|
||||
TARGET_BEHIND_VICTIM = 65, // uses in teleport behind spells, caster/target dependent from spell effect
|
||||
TARGET_DYNAMIC_OBJECT_COORDINATES = 76,
|
||||
TARGET_SINGLE_ENEMY = 77,
|
||||
TARGET_SELF2 = 87,
|
||||
TARGET_DIRECTLY_FORWARD = 89,
|
||||
TARGET_NONCOMBAT_PET = 90,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -448,6 +448,9 @@ void Spell::FillTargetMap()
|
|||
default:
|
||||
switch(m_spellInfo->EffectImplicitTargetB[i])
|
||||
{
|
||||
case 0:
|
||||
SetTargetMap(i,m_spellInfo->EffectImplicitTargetA[i],tmpUnitMap);
|
||||
break;
|
||||
case TARGET_SCRIPT_COORDINATES: // B case filled in canCast but we need fill unit list base at A case
|
||||
SetTargetMap(i,m_spellInfo->EffectImplicitTargetA[i],tmpUnitMap);
|
||||
break;
|
||||
|
|
@ -2065,7 +2068,25 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
|
|||
// if parent spell create dynamic object extract area from it
|
||||
if(DynamicObject* dynObj = m_caster->GetDynObject(m_triggeredByAuraSpell ? m_triggeredByAuraSpell->Id : m_spellInfo->Id))
|
||||
m_targets.setDestination(dynObj->GetPositionX(), dynObj->GetPositionY(), dynObj->GetPositionZ());
|
||||
}break;
|
||||
break;
|
||||
}
|
||||
case TARGET_DIRECTLY_FORWARD:
|
||||
{
|
||||
if (!(m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION))
|
||||
{
|
||||
SpellRangeEntry const* rEntry = sSpellRangeStore.LookupEntry(m_spellInfo->rangeIndex);
|
||||
float minRange = GetSpellMinRange(rEntry);
|
||||
float maxRange = GetSpellMaxRange(rEntry);
|
||||
float dist = minRange+ rand_norm()*(maxRange-minRange);
|
||||
|
||||
float _target_x, _target_y, _target_z;
|
||||
m_caster->GetClosePoint(_target_x, _target_y, _target_z, m_caster->GetObjectSize(), dist);
|
||||
m_targets.setDestination(_target_x, _target_y, _target_z);
|
||||
}
|
||||
|
||||
TagUnitMap.push_back(m_caster);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "7441"
|
||||
#define REVISION_NR "7442"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue