Core/Spells: Implemented SPELL_ATTR6_DELAY_COMBAT_TIMER_DURING_CAST
Port From (https://github.com/TrinityCore/TrinityCore/commit/0620b829b2597777f2b5d931dfb0336f79dfd0df)
This commit is contained in:
@@ -1811,7 +1811,7 @@ namespace Framework.Constants
|
||||
NoJumpPathing = 0x10000, /*Nyi*/ // No Jump Pathing
|
||||
AllowEquipWhileCasting = 0x20000, // Allow Equip While Casting
|
||||
OriginateFromController = 0x40000, // Originate From Controller Description Client Will Prevent Casting If Not Possessed, Charmer Will Be Caster For All Intents And Purposes
|
||||
DelayCombatTimerDuringCast = 0x80000, /*Nyi*/ // Delay Combat Timer During Cast
|
||||
DelayCombatTimerDuringCast = 0x80000, // Delay Combat Timer During Cast
|
||||
AuraIconOnlyForCasterLimit10 = 0x100000, // Aura Icon Only For Caster (Limit 10) (Client Only)
|
||||
ShowMechanicAsCombatText = 0x200000, // Show Mechanic As Combat Text (Client Only)
|
||||
AbsorbCannotBeIgnore = 0x400000, /*Nyi*/ // Absorb Cannot Be Ignore
|
||||
|
||||
@@ -162,14 +162,25 @@ namespace Game.Entities
|
||||
_lastExtraAttackSpell = 0;
|
||||
}
|
||||
|
||||
uint att;
|
||||
// not implemented before 3.0.2
|
||||
if ((att = GetAttackTimer(WeaponAttackType.BaseAttack)) != 0)
|
||||
SetAttackTimer(WeaponAttackType.BaseAttack, (diff >= att ? 0 : att - diff));
|
||||
if ((att = GetAttackTimer(WeaponAttackType.RangedAttack)) != 0)
|
||||
SetAttackTimer(WeaponAttackType.RangedAttack, (diff >= att ? 0 : att - diff));
|
||||
if ((att = GetAttackTimer(WeaponAttackType.OffAttack)) != 0)
|
||||
SetAttackTimer(WeaponAttackType.OffAttack, (diff >= att ? 0 : att - diff));
|
||||
bool spellPausesCombatTimer(CurrentSpellTypes type)
|
||||
{
|
||||
return GetCurrentSpell(type) != null && GetCurrentSpell(type).GetSpellInfo().HasAttribute(SpellAttr6.DelayCombatTimerDuringCast);
|
||||
}
|
||||
|
||||
if (!spellPausesCombatTimer(CurrentSpellTypes.Generic) && !spellPausesCombatTimer(CurrentSpellTypes.Channeled))
|
||||
{
|
||||
uint base_att = GetAttackTimer(WeaponAttackType.BaseAttack);
|
||||
if (base_att != 0)
|
||||
SetAttackTimer(WeaponAttackType.BaseAttack, (diff >= base_att ? 0 : base_att - diff));
|
||||
|
||||
uint ranged_att = GetAttackTimer(WeaponAttackType.RangedAttack);
|
||||
if (ranged_att != 0)
|
||||
SetAttackTimer(WeaponAttackType.RangedAttack, (diff >= ranged_att ? 0 : ranged_att - diff));
|
||||
|
||||
uint off_att = GetAttackTimer(WeaponAttackType.OffAttack);
|
||||
if (off_att != 0)
|
||||
SetAttackTimer(WeaponAttackType.OffAttack, (diff >= off_att ? 0 : off_att - diff));
|
||||
}
|
||||
|
||||
// update abilities available only for fraction of time
|
||||
UpdateReactives(diff);
|
||||
|
||||
Reference in New Issue
Block a user