mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 10:37:02 +00:00
[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:
parent
66c8c75914
commit
8ff7010750
4 changed files with 18 additions and 7 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue