From cde5cb763d9ff64df3486457476af40561e4aa2e Mon Sep 17 00:00:00 2001 From: GriffonHeart Date: Wed, 31 Dec 2008 15:04:47 +0300 Subject: [PATCH] [6994] Fixing "create all" items crafting and possible other spells unexpected colldowns. Note: auto-shoot still have problems with spell casting. Signed-off-by: VladimirMangos --- src/game/Spell.cpp | 12 +++++------- src/game/SpellMgr.h | 6 ++++++ src/shared/revision_nr.h | 2 +- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index a778ecc9e..35788bbd8 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -341,11 +341,8 @@ Spell::Spell( Unit* Caster, SpellEntry const *info, bool triggered, uint64 origi m_glyphIndex = 0; m_triggeredByAuraSpell = NULL; - //Auto Shot & Shoot - if( m_spellInfo->AttributesEx2 == 0x000020 && !triggered ) - m_autoRepeat = true; - else - m_autoRepeat = false; + //Auto Shot & Shoot (wand) + m_autoRepeat = IsAutoRepeatRangedSpell(m_spellInfo); m_runesState = 0; m_powerCost = 0; // setup to correct value in Spell::prepare, don't must be used before. @@ -724,7 +721,8 @@ void Spell::prepareDataForTriggerSystem() m_procAttacker = PROC_FLAG_SUCCESSFUL_POSITIVE_SPELL; m_procVictim = PROC_FLAG_TAKEN_POSITIVE_SPELL; } - else if (m_spellInfo->Id != SPELL_ID_AUTOSHOT) // Wands + // Wands + else if (IsAutoRepeatRangedSpell(m_spellInfo) && m_spellInfo->Id != SPELL_ID_AUTOSHOT) { m_procAttacker = PROC_FLAG_SUCCESSFUL_RANGED_SPELL_HIT; m_procVictim = PROC_FLAG_TAKEN_RANGED_SPELL_HIT; @@ -2441,7 +2439,7 @@ void Spell::SendSpellCooldown() // shoot spells used equipped item cooldown values already assigned in GetAttackTime(RANGED_ATTACK) // prevent 0 cooldowns set by another way - if (rec <= 0 && catrec <= 0 && (cat == 76 || m_spellInfo->Id != SPELL_ID_AUTOSHOT)) + if (rec <= 0 && catrec <= 0 && (cat == 76 || IsAutoRepeatRangedSpell(m_spellInfo) && m_spellInfo->Id != SPELL_ID_AUTOSHOT)) rec = _player->GetAttackTime(RANGED_ATTACK); // Now we have cooldown data (if found any), time to apply mods diff --git a/src/game/SpellMgr.h b/src/game/SpellMgr.h index 24b277510..fa8f1e06c 100644 --- a/src/game/SpellMgr.h +++ b/src/game/SpellMgr.h @@ -414,6 +414,12 @@ inline bool isSpellBreakStealth(SpellEntry const* spellInfo) return !(spellInfo->AttributesEx & SPELL_ATTR_EX_NOT_BREAK_STEALTH); } +inline bool IsAutoRepeatRangedSpell(SpellEntry const* spellInfo) +{ + return (spellInfo->Attributes & SPELL_ATTR_RANGED) && (spellInfo->AttributesEx2 == 0x000020 /*autorepeat*/); +} + + uint8 GetErrorAtShapeshiftedCast (SpellEntry const *spellInfo, uint32 form); inline bool IsChanneledSpell(SpellEntry const* spellInfo) diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 3ed542f52..712de8185 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "6993" + #define REVISION_NR "6994" #endif // __REVISION_NR_H__ -- 2.11.4.GIT