Core/Spells: Implemented SPELL_ATTR9_HASTE_AFFECTS_MELEE_ABILITY_CASTTIME

Port From (https://github.com/TrinityCore/TrinityCore/commit/0d5a1b175fbd4ae7410a84bf60645c52abf712ee)
This commit is contained in:
Hondacrx
2024-08-26 17:51:38 -04:00
parent 254d04d37e
commit 49d10ebebb
2 changed files with 3 additions and 1 deletions
@@ -2041,6 +2041,8 @@ namespace Game.Entities
castTime = 0;
else if (!(spellInfo.HasAttribute(SpellAttr0.IsAbility) || spellInfo.HasAttribute(SpellAttr0.IsTradeskill) || spellInfo.HasAttribute(SpellAttr3.IgnoreCasterModifiers)) && ((IsPlayer() && spellInfo.SpellFamilyName != 0) || IsCreature()))
castTime = unitCaster.CanInstantCast() ? 0 : (int)(castTime * unitCaster.m_unitData.ModCastingSpeed);
else if (spellInfo.HasAttribute(SpellAttr0.IsAbility) && spellInfo.HasAttribute(SpellAttr9.HasteAffectsMeleeAbilityCasttime))
castTime = (int)(castTime * unitCaster.m_modAttackSpeedPct[(int)WeaponAttackType.BaseAttack]);
else if (spellInfo.HasAttribute(SpellAttr0.UsesRangedSlot) && !spellInfo.HasAttribute(SpellAttr2.AutoRepeat))
castTime = (int)(castTime * unitCaster.m_modAttackSpeedPct[(int)WeaponAttackType.RangedAttack]);
else if (Global.SpellMgr.IsPartOfSkillLine(SkillType.Cooking, spellInfo.Id) && unitCaster.HasAura(67556)) // cooking with Chef Hat.