mirror of
https://github.com/mangosfour/server.git
synced 2025-12-21 10:37:06 +00:00
[10636] Implement server side check combo points req. for spell cast.
Thanks to nos4r2zod for problem research.
This commit is contained in:
parent
7a26fdd45d
commit
691412d05c
7 changed files with 35 additions and 29 deletions
|
|
@ -4297,14 +4297,21 @@ SpellCastResult Spell::CheckCast(bool strict)
|
|||
return SPELL_FAILED_CASTER_AURASTATE;
|
||||
}
|
||||
|
||||
// cancel autorepeat spells if cast start when moving
|
||||
// (not wand currently autorepeat cast delayed to moving stop anyway in spell update code)
|
||||
if( m_caster->GetTypeId() == TYPEID_PLAYER && ((Player*)m_caster)->isMoving() )
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
// skip stuck spell to allow use it in falling case and apply spell limitations at movement
|
||||
if( (!((Player*)m_caster)->m_movementInfo.HasMovementFlag(MOVEFLAG_FALLINGFAR) || m_spellInfo->Effect[EFFECT_INDEX_0] != SPELL_EFFECT_STUCK) &&
|
||||
(IsAutoRepeat() || (m_spellInfo->AuraInterruptFlags & AURA_INTERRUPT_FLAG_NOT_SEATED) != 0) )
|
||||
return SPELL_FAILED_MOVING;
|
||||
// cancel autorepeat spells if cast start when moving
|
||||
// (not wand currently autorepeat cast delayed to moving stop anyway in spell update code)
|
||||
if (((Player*)m_caster)->isMoving() )
|
||||
{
|
||||
// skip stuck spell to allow use it in falling case and apply spell limitations at movement
|
||||
if ((!((Player*)m_caster)->m_movementInfo.HasMovementFlag(MOVEFLAG_FALLINGFAR) || m_spellInfo->Effect[EFFECT_INDEX_0] != SPELL_EFFECT_STUCK) &&
|
||||
(IsAutoRepeat() || (m_spellInfo->AuraInterruptFlags & AURA_INTERRUPT_FLAG_NOT_SEATED) != 0))
|
||||
return SPELL_FAILED_MOVING;
|
||||
}
|
||||
|
||||
if (!m_IsTriggeredSpell && NeedsComboPoints(m_spellInfo) &&
|
||||
(!m_targets.getUnitTarget() || m_targets.getUnitTarget()->GetObjectGuid() != ((Player*)m_caster)->GetComboTargetGuid()))
|
||||
return SPELL_FAILED_NO_COMBO_POINTS;
|
||||
}
|
||||
|
||||
if(Unit *target = m_targets.getUnitTarget())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue