From 49d10ebebb0c1f06f09550c39d991bd92193a004 Mon Sep 17 00:00:00 2001 From: Hondacrx Date: Mon, 26 Aug 2024 17:51:38 -0400 Subject: [PATCH] Core/Spells: Implemented SPELL_ATTR9_HASTE_AFFECTS_MELEE_ABILITY_CASTTIME Port From (https://github.com/TrinityCore/TrinityCore/commit/0d5a1b175fbd4ae7410a84bf60645c52abf712ee) --- Source/Framework/Constants/Spells/SpellConst.cs | 2 +- Source/Game/Entities/Object/WorldObject.cs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/Framework/Constants/Spells/SpellConst.cs b/Source/Framework/Constants/Spells/SpellConst.cs index 591cf57fe..3b7aa93f3 100644 --- a/Source/Framework/Constants/Spells/SpellConst.cs +++ b/Source/Framework/Constants/Spells/SpellConst.cs @@ -1979,7 +1979,7 @@ namespace Framework.Constants TargetMustBeGrounded = 0x400, // Target Must Be Grounded AllowWhileBanishedAuraState = 0x800, // Doesn't seem to be doing anything, banish behaves like a regular stun now - tested on patch 10.2.7 with spell 17767 (doesn't have this attribute, only SPELL_ATTR5_ALLOW_WHILE_STUNNED and was castable while banished) FaceUnitTargetUponCompletionOfJumpCharge = 0x1000, // Face unit target upon completion of jump charge - Slam = 0x2000, // 13 + HasteAffectsMeleeAbilityCasttime = 0x2000, // Haste Affects Melee Ability Casttime UsableInRatedBattlegrounds = 0x4000, // 14 Can Be Used In Rated Battlegrounds Unk15 = 0x8000, // 15 Unk16 = 0x10000, // 16 diff --git a/Source/Game/Entities/Object/WorldObject.cs b/Source/Game/Entities/Object/WorldObject.cs index 011466ddc..38ecbdcc9 100644 --- a/Source/Game/Entities/Object/WorldObject.cs +++ b/Source/Game/Entities/Object/WorldObject.cs @@ -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.