Core/Spells: fixed duration clamping for haste based periodic auras and added support for rolling any tick over

* roll over remaining time until next tick over into a refreshed periodic aura's duration
* this behavior is now being used for stackable spells, all HoTs and DoTs
* fixed adding extra ticks when at certain tick thresholds
* corrected implementation of SPELL_ATTR8_HASTE_AFFECTS_DURATION
* implemented SPELL_ATTR8_MELEE_HASTE_AFFECTS_PERIODIC
This commit is contained in:
Ovahlord committed 2022-10-01 13:47:14 +02:00
1 parent b6f0650303
commit b6f8a68d61
10 files changed
+72 -97

No files matched your search

@@ -2552,29 +2552,6 @@ void WorldObject::ModSpellCastTime(SpellInfo const* spellInfo, int32& castTime,
castTime = 500;
}
void WorldObject::ModSpellDurationTime(SpellInfo const* spellInfo, int32& duration, Spell* spell)
{
if (!spellInfo || duration < 0)
return;
if (spellInfo->IsChanneled() && !spellInfo->HasAttribute(SPELL_ATTR5_SPELL_HASTE_AFFECTS_PERIODIC))
return;
// called from caster
if (Player* modOwner = GetSpellModOwner())
modOwner->ApplySpellMod(spellInfo->Id, SpellModOp::ChangeCastTime, duration, spell);
Unit const* unitCaster = ToUnit();
if (!unitCaster)
return;
if (!(spellInfo->HasAttribute(SPELL_ATTR0_IS_ABILITY) || spellInfo->HasAttribute(SPELL_ATTR0_IS_TRADESKILL) || spellInfo->HasAttribute(SPELL_ATTR3_IGNORE_CASTER_MODIFIERS)) &&
((GetTypeId() == TYPEID_PLAYER && spellInfo->SpellFamilyName) || GetTypeId() == TYPEID_UNIT))
duration = int32(float(duration) * GetFloatValue(UNIT_MOD_CAST_SPEED));
else if (spellInfo->HasAttribute(SPELL_ATTR0_USES_RANGED_SLOT) && !spellInfo->HasAttribute(SPELL_ATTR2_AUTO_REPEAT))
duration = int32(float(duration) * unitCaster->m_modAttackSpeedPct[RANGED_ATTACK]);
}
float WorldObject::MeleeSpellMissChance(Unit const* /*victim*/, WeaponAttackType /*attType*/, SpellInfo const* /*spellInfo*/) const
{
return 0.0f;