Core/Scripts: Added CalcCastTime spell script hook

Port From (https://github.com/TrinityCore/TrinityCore/commit/6713fa4c93f87af351f3ee65c1ff36b52ea85ddb)
This commit is contained in:
hondacrx
2022-07-29 18:06:37 -04:00
parent 14a23ac682
commit e824b43603
4 changed files with 20 additions and 15 deletions
+3 -2
View File
@@ -1887,8 +1887,9 @@ namespace Game.Entities
if (!unitCaster)
return;
if (!(spellInfo.HasAttribute(SpellAttr0.IsAbility) || spellInfo.HasAttribute(SpellAttr0.IsTradeskill) || spellInfo.HasAttribute(SpellAttr3.IgnoreCasterModifiers)) &&
((IsPlayer() && spellInfo.SpellFamilyName != 0) || IsCreature()))
if (unitCaster.IsPlayer() && unitCaster.ToPlayer().GetCommandStatus(PlayerCommandStates.Casttime))
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.UsesRangedSlot) && !spellInfo.HasAttribute(SpellAttr2.AutoRepeat))
castTime = (int)(castTime * unitCaster.m_modAttackSpeedPct[(int)WeaponAttackType.RangedAttack]);