[Spells] Update SPA 339 SE_TriggerOnCast (#1478)

* Recoded SE_TriggerOnCast Focus effect

Recoded SE_TriggerOnCast focus effect to be consistent with how all other focuses are checked. No longer an arbitrary limit as to number of a focus effects of this type you can have.

* new command: resetdisc_timer

usage: #resetdisc_timer [all | timer_id]

* syntax fixes

syntax improvements

* minor fix

changed numhits check

* Update spell_effects.cpp

* added better support for spell procs that don't require target.

* syntax

* Formatting and syntax tweaks

Co-authored-by: Akkadius <akkadius1@gmail.com>
This commit is contained in:
KayenEQ
2021-08-01 14:26:44 -04:00
committed by GitHub
parent 93b0264a8b
commit f01cf74fa6
9 changed files with 174 additions and 111 deletions
+1 -39
View File
@@ -1065,19 +1065,6 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon)
}
break;
case SE_TriggerOnCast:
for (int i = 0; i < MAX_SPELL_TRIGGER; i++) {
if (newbon->SpellTriggers[i] == rank.id)
break;
if (!newbon->SpellTriggers[i]) {
// Save the 'rank.id' of each triggerable effect to an array
newbon->SpellTriggers[i] = rank.id;
break;
}
}
break;
case SE_CriticalHitChance: {
// Bad data or unsupported new skill
@@ -2538,19 +2525,6 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
break;
}
case SE_TriggerOnCast:
{
for(int e = 0; e < MAX_SPELL_TRIGGER; e++)
{
if(!new_bonus->SpellTriggers[e])
{
new_bonus->SpellTriggers[e] = spell_id;
break;
}
}
break;
}
case SE_SpellCritChance:
new_bonus->CriticalSpellChance += effect_value;
break;
@@ -3816,8 +3790,7 @@ uint8 Mob::IsFocusEffect(uint16 spell_id,int effect_index, bool AA,uint32 aa_eff
case SE_ReduceReuseTimer:
return focusReduceRecastTime;
case SE_TriggerOnCast:
//return focusTriggerOnCast;
return 0; //This is calculated as an actual bonus
return focusTriggerOnCast;
case SE_FcSpellVulnerability:
return focusSpellVulnerability;
case SE_Fc_Spell_Damage_Pct_IncomingPC:
@@ -4433,17 +4406,6 @@ void Mob::NegateSpellsBonuses(uint16 spell_id)
break;
}
case SE_TriggerOnCast:
{
for(int e = 0; e < MAX_SPELL_TRIGGER; e++)
{
spellbonuses.SpellTriggers[e] = effect_value;
aabonuses.SpellTriggers[e] = effect_value;
itembonuses.SpellTriggers[e] = effect_value;
}
break;
}
case SE_SpellCritChance:
spellbonuses.CriticalSpellChance = effect_value;
aabonuses.CriticalSpellChance = effect_value;