mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-18 06:00:10 -04:00
Core/Spells: Correct meaning & usage of SPELL_ATTR_EX2_NOT_RESET_AUTOSHOOT (now SPELL_ATTR_EX2_NOT_RESET_AUTO_ACTIONS) to ignore timer reset for both melee swings and ranged autoshoots, fixes issue 2639
--HG-- branch : trunk
This commit is contained in:
@@ -3491,14 +3491,14 @@ bool Unit::IsNonMeleeSpellCasted(bool withDelayed, bool skipChanneled, bool skip
|
||||
(m_currentSpells[CURRENT_GENERIC_SPELL]->getState() != SPELL_STATE_FINISHED) &&
|
||||
(withDelayed || m_currentSpells[CURRENT_GENERIC_SPELL]->getState() != SPELL_STATE_DELAYED))
|
||||
{
|
||||
if (!isAutoshoot || !(m_currentSpells[CURRENT_GENERIC_SPELL]->m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_NOT_RESET_AUTOSHOT))
|
||||
if (!isAutoshoot || !(m_currentSpells[CURRENT_GENERIC_SPELL]->m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_NOT_RESET_AUTO_ACTIONS))
|
||||
return(true);
|
||||
}
|
||||
// channeled spells may be delayed, but they are still considered casted
|
||||
else if (!skipChanneled && m_currentSpells[CURRENT_CHANNELED_SPELL] &&
|
||||
(m_currentSpells[CURRENT_CHANNELED_SPELL]->getState() != SPELL_STATE_FINISHED))
|
||||
{
|
||||
if (!isAutoshoot || !(m_currentSpells[CURRENT_CHANNELED_SPELL]->m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_NOT_RESET_AUTOSHOT))
|
||||
if (!isAutoshoot || !(m_currentSpells[CURRENT_CHANNELED_SPELL]->m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_NOT_RESET_AUTO_ACTIONS))
|
||||
return(true);
|
||||
}
|
||||
// autorepeat spells may be finished or delayed, but they are still considered casted
|
||||
|
||||
@@ -346,7 +346,7 @@ const uint32 ItemQualityColors[MAX_ITEM_QUALITY] = {
|
||||
#define SPELL_ATTR_EX2_UNK14 0x00004000 // 14
|
||||
#define SPELL_ATTR_EX2_UNK15 0x00008000 // 15 not set in 3.0.3
|
||||
#define SPELL_ATTR_EX2_TAME_BEAST 0x00010000 // 16
|
||||
#define SPELL_ATTR_EX2_NOT_RESET_AUTOSHOT 0x00020000 // 17 Hunters Shot and Stings only have this flag
|
||||
#define SPELL_ATTR_EX2_NOT_RESET_AUTO_ACTIONS 0x00020000 // 17 don't reset timers for melee autoattacks (swings) or ranged autoattacks (autoshoots)
|
||||
#define SPELL_ATTR_EX2_UNK18 0x00040000 // 18 Only Revive pet - possible req dead pet
|
||||
#define SPELL_ATTR_EX2_NOT_NEED_SHAPESHIFT 0x00080000 // 19 does not necessarly need shapeshift
|
||||
#define SPELL_ATTR_EX2_UNK20 0x00100000 // 20
|
||||
|
||||
@@ -3738,7 +3738,7 @@ void Spell::finish(bool ok)
|
||||
}
|
||||
}
|
||||
|
||||
if (IsMeleeAttackResetSpell())
|
||||
if (IsAutoActionResetSpell())
|
||||
{
|
||||
bool found = false;
|
||||
Unit::AuraEffectList const& vIgnoreReset = m_caster->GetAuraEffectsByType(SPELL_AURA_IGNORE_MELEE_RESET);
|
||||
@@ -3750,13 +3750,12 @@ void Spell::finish(bool ok)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found)
|
||||
if (!found && !(m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_NOT_RESET_AUTO_ACTIONS))
|
||||
{
|
||||
m_caster->resetAttackTimer(BASE_ATTACK);
|
||||
if (m_caster->haveOffhandWeapon())
|
||||
m_caster->resetAttackTimer(OFF_ATTACK);
|
||||
if (!(m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_NOT_RESET_AUTOSHOT))
|
||||
m_caster->resetAttackTimer(RANGED_ATTACK);
|
||||
m_caster->resetAttackTimer(RANGED_ATTACK);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -516,8 +516,7 @@ class Spell
|
||||
}
|
||||
bool IsTriggered() const {return m_IsTriggeredSpell;};
|
||||
bool IsChannelActive() const { return m_caster->GetUInt32Value(UNIT_CHANNEL_SPELL) != 0; }
|
||||
bool IsMeleeAttackResetSpell() const { return !m_IsTriggeredSpell && (m_spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_AUTOATTACK); }
|
||||
bool IsRangedAttackResetSpell() const { return !m_IsTriggeredSpell && /*IsRangedSpell() &&*/ !(m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_NOT_RESET_AUTOSHOT); }
|
||||
bool IsAutoActionResetSpell() const { return !m_IsTriggeredSpell && (m_spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_AUTOATTACK); }
|
||||
|
||||
bool IsDeletable() const { return !m_referencedFromCurrentSpell && !m_executedCurrently; }
|
||||
void SetReferencedFromCurrent(bool yes) { m_referencedFromCurrentSpell = yes; }
|
||||
|
||||
Reference in New Issue
Block a user