mirror of
https://github.com/mangosfour/server.git
synced 2025-12-19 22:37:05 +00:00
[11141] Add use of SpellMod for melee spells as needed, for exaplme, for some talents
Signed-off-by: Ambal <pogrebniak@gala.net>
This commit is contained in:
parent
2bb00743e5
commit
f4e8c3d679
2 changed files with 7 additions and 2 deletions
|
|
@ -5742,8 +5742,13 @@ SpellCastResult Spell::CheckRange(bool strict)
|
||||||
if (target == m_caster)
|
if (target == m_caster)
|
||||||
return SPELL_CAST_OK;
|
return SPELL_CAST_OK;
|
||||||
|
|
||||||
|
float range_mod = strict ? 0.0f : 5.0f;
|
||||||
|
float base = ATTACK_DISTANCE;
|
||||||
|
if (Player* modOwner = m_caster->GetSpellModOwner())
|
||||||
|
range_mod += modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RANGE, base, this);
|
||||||
|
|
||||||
// with additional 5 dist for non stricted case (some melee spells have delay in apply
|
// with additional 5 dist for non stricted case (some melee spells have delay in apply
|
||||||
return m_caster->CanReachWithMeleeAttack(target, strict ? 0.0f : 5.0f) ? SPELL_CAST_OK : SPELL_FAILED_OUT_OF_RANGE;
|
return m_caster->CanReachWithMeleeAttack(target, range_mod) ? SPELL_CAST_OK : SPELL_FAILED_OUT_OF_RANGE;
|
||||||
}
|
}
|
||||||
break; // let continue in generic way for no target
|
break; // let continue in generic way for no target
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "11140"
|
#define REVISION_NR "11141"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue