Core/Spells: Implemented SPELL_ATTR6_DELAY_COMBAT_TIMER_DURING_CAST

This commit is contained in:
Shauren
2022-05-07 20:09:25 +02:00
parent 50eff8c238
commit 0620b829b2
2 changed files with 15 additions and 8 deletions

View File

@@ -470,13 +470,20 @@ void Unit::Update(uint32 p_time)
_lastExtraAttackSpell = 0;
}
// not implemented before 3.0.2
if (uint32 base_att = getAttackTimer(BASE_ATTACK))
setAttackTimer(BASE_ATTACK, (p_time >= base_att ? 0 : base_att - p_time));
if (uint32 ranged_att = getAttackTimer(RANGED_ATTACK))
setAttackTimer(RANGED_ATTACK, (p_time >= ranged_att ? 0 : ranged_att - p_time));
if (uint32 off_att = getAttackTimer(OFF_ATTACK))
setAttackTimer(OFF_ATTACK, (p_time >= off_att ? 0 : off_att - p_time));
auto spellPausesCombatTimer = [&](CurrentSpellTypes type)
{
return GetCurrentSpell(type) && GetCurrentSpell(type)->GetSpellInfo()->HasAttribute(SPELL_ATTR6_DELAY_COMBAT_TIMER_DURING_CAST);
};
if (!spellPausesCombatTimer(CURRENT_GENERIC_SPELL) && !spellPausesCombatTimer(CURRENT_CHANNELED_SPELL))
{
if (uint32 base_att = getAttackTimer(BASE_ATTACK))
setAttackTimer(BASE_ATTACK, (p_time >= base_att ? 0 : base_att - p_time));
if (uint32 ranged_att = getAttackTimer(RANGED_ATTACK))
setAttackTimer(RANGED_ATTACK, (p_time >= ranged_att ? 0 : ranged_att - p_time));
if (uint32 off_att = getAttackTimer(OFF_ATTACK))
setAttackTimer(OFF_ATTACK, (p_time >= off_att ? 0 : off_att - p_time));
}
// update abilities available only for fraction of time
UpdateReactives(p_time);

View File

@@ -645,7 +645,7 @@ enum SpellAttr6 : uint32
SPELL_ATTR6_NO_JUMP_PATHING = 0x00010000, /*NYI*/ // TITLE No Jump Pathing
SPELL_ATTR6_ALLOW_EQUIP_WHILE_CASTING = 0x00020000, // TITLE Allow Equip While Casting
SPELL_ATTR6_ORIGINATE_FROM_CONTROLLER = 0x00040000, // TITLE Originate From Controller DESCRIPTION Client will prevent casting if not possessed, charmer will be caster for all intents and purposes
SPELL_ATTR6_DELAY_COMBAT_TIMER_DURING_CAST = 0x00080000, /*NYI*/ // TITLE Delay Combat Timer During Cast
SPELL_ATTR6_DELAY_COMBAT_TIMER_DURING_CAST = 0x00080000, // TITLE Delay Combat Timer During Cast
SPELL_ATTR6_AURA_ICON_ONLY_FOR_CASTER_LIMIT_10 = 0x00100000, // TITLE Aura Icon Only For Caster (Limit 10) (client only)
SPELL_ATTR6_SHOW_MECHANIC_AS_COMBAT_TEXT = 0x00200000, // TITLE Show Mechanic as Combat Text (client only)
SPELL_ATTR6_ABSORB_CANNOT_BE_IGNORE = 0x00400000, /*NYI*/ // TITLE Absorb Cannot Be Ignore