diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 94aa46efe..4ffdcffd1 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -5277,7 +5277,7 @@ SpellCastResult Spell::CheckRange(bool strict) int32 Spell::CalculatePowerCost() { // item cast not used power - if(m_CastItem) + if (m_CastItem) return 0; // Spell drain all exist power on cast (Only paladin lay of Hands) @@ -6042,6 +6042,12 @@ bool Spell::IsNeedSendToClient() const m_spellInfo->speed > 0.0f || !m_triggeredByAuraSpell && !m_IsTriggeredSpell; } + +bool Spell::IsTriggeredSpellWithRedundentData() const +{ + return m_IsTriggeredSpell && (m_spellInfo->manaCost || m_spellInfo->ManaCostPercentage); +} + bool Spell::HaveTargetsForEffect( uint8 effect ) const { for(std::list::const_iterator itr = m_UniqueTargetInfo.begin(); itr != m_UniqueTargetInfo.end(); ++itr) diff --git a/src/game/Spell.h b/src/game/Spell.h index dc214dc4c..088034e9a 100644 --- a/src/game/Spell.h +++ b/src/game/Spell.h @@ -431,7 +431,8 @@ class Spell void SetDelayStart(uint64 m_time) { m_delayStart = m_time; } uint64 GetDelayMoment() const { return m_delayMoment; } - bool IsNeedSendToClient() const; + bool IsNeedSendToClient() const; // use for hide spell cast for client in case when cast not have client side affect (animation or log entries) + bool IsTriggeredSpellWithRedundentData() const; // use for ignore some spell data for triggered spells like cast time, some triggered spells have redundent copy data from main spell for client use purpose CurrentSpellTypes GetCurrentContainer(); diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index 5a67dd90f..3b89c4398 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -62,20 +62,24 @@ int32 GetSpellMaxDuration(SpellEntry const *spellInfo) uint32 GetSpellCastTime(SpellEntry const* spellInfo, Spell const* spell) { + // some triggered spells have data only usable for client + if (spell && spell->IsTriggeredSpellWithRedundentData()) + return 0; + SpellCastTimesEntry const *spellCastTimeEntry = sSpellCastTimesStore.LookupEntry(spellInfo->CastingTimeIndex); // not all spells have cast time index and this is all is pasiive abilities - if(!spellCastTimeEntry) + if (!spellCastTimeEntry) return 0; int32 castTime = spellCastTimeEntry->CastTime; if (spell) { - if(Player* modOwner = spell->GetCaster()->GetSpellModOwner()) + if (Player* modOwner = spell->GetCaster()->GetSpellModOwner()) modOwner->ApplySpellMod(spellInfo->Id, SPELLMOD_CASTING_TIME, castTime, spell); - if( !(spellInfo->Attributes & (SPELL_ATTR_UNK4|SPELL_ATTR_TRADESPELL)) ) + if (!(spellInfo->Attributes & (SPELL_ATTR_UNK4|SPELL_ATTR_TRADESPELL))) castTime = int32(castTime * spell->GetCaster()->GetFloatValue(UNIT_MOD_CAST_SPEED)); else { @@ -84,7 +88,7 @@ uint32 GetSpellCastTime(SpellEntry const* spellInfo, Spell const* spell) } } - if (spellInfo->Attributes & SPELL_ATTR_RANGED && (!spell || !(spell->IsAutoRepeat()))) + if (spellInfo->Attributes & SPELL_ATTR_RANGED && (!spell || !spell->IsAutoRepeat())) castTime += 500; return (castTime > 0) ? uint32(castTime) : 0; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 4198a0b51..8e568433c 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 "9284" + #define REVISION_NR "9285" #endif // __REVISION_NR_H__