[Spells] Implemented SPA 390 SE_FcTimerLockout (#1496)

* Implemented SPA 390 SE_FcTimerLockout

Implemented

SPA 390 SE_FcTimerLockout

This focus limited effect sets any spell that meets the criteria of the of the focus limits to be a on recast timer.
Base value: recast duration in milliseconds.

Note: This focus can only be applied from spells (not item or AA)
Note: Although reinforced by the server, to appear visually correct both server side and client side spell values need to match (ie. need to matching spells_new values).

Example spell: Suppression of Fire ID 16973.
Sets any fire spell in the clients spell bar to a 2 second recast when the client is affect by the spell.

* Formatting

* Use range based for

Co-authored-by: Akkadius <akkadius1@gmail.com>
This commit is contained in:
KayenEQ
2021-08-16 00:17:04 -04:00
committed by GitHub
parent d40d21121a
commit bde5d6931c
4 changed files with 41 additions and 3 deletions
+35
View File
@@ -2559,6 +2559,35 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
break;
}
case SE_FcTimerLockout: {
if (IsClient()) {
for (unsigned int mem_spell : CastToClient()->m_pp.mem_spells) {
if (IsValidSpell(mem_spell)) {
int32 new_recast_timer = CalcFocusEffect(
focusFcTimerLockout,
spell_id,
mem_spell
);
if (new_recast_timer) {
bool apply_recast_timer = true;
if (IsCasting() && casting_spell_id == mem_spell) {
apply_recast_timer = false;
}
if (apply_recast_timer) {
new_recast_timer = new_recast_timer / 1000;
CastToClient()->GetPTimers().Start(
pTimerSpellStart + mem_spell,
static_cast<uint32>(new_recast_timer)
);
}
}
}
}
SetMana(GetMana());
}
break;
}
case SE_HealGroupFromMana: {
if(!caster)
break;
@@ -5753,6 +5782,12 @@ int32 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo
}
break;
case SE_FcTimerLockout:
if (type == focusFcTimerLockout) {
value = focus_spell.base[i];
}
break;
case SE_Fc_Cast_Spell_On_Land:
if (type == focusFcCastSpellOnLand) {
if (zone->random.Roll(focus_spell.base[i])) {