[9285] Fixed unexpected double time for apply damage for spell 1464 and ranks.

* Implement way ignore some redundent data for triggered spells base at cast cost exist.
  Reason: some triggered spells inherited data from main spells
  just for porper client show spell attributes, we not need this data.
* Use check for ignore inherited cast time.
This commit is contained in:
VladimirMangos 2010-02-02 19:49:27 +03:00
parent 66c8c75914
commit 8ff7010750
4 changed files with 18 additions and 7 deletions

View file

@ -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<TargetInfo>::const_iterator itr = m_UniqueTargetInfo.begin(); itr != m_UniqueTargetInfo.end(); ++itr)

View file

@ -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();

View file

@ -62,6 +62,10 @@ 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
@ -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;

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "9284"
#define REVISION_NR "9285"
#endif // __REVISION_NR_H__