From 428cccfa50f232bf62ce12cd06d8b33d7c8c13f2 Mon Sep 17 00:00:00 2001 From: mmcgarvey Date: Thu, 31 Oct 2024 08:13:16 -0400 Subject: [PATCH] [Feature] Focus Skill Attack Spells (#4528) * Add Rule Spells:AllowFocusOnSkillDamageSpells * Currently, focus mods defaults to 0 when processing spell effect 193. * The default value for this rule is false. * When false, the rule will retain the current default behavior. * When true, the aforementioned focus effects will allow focus effects (185, 459, and 482) to modify spell effect 193. * Removed undesirable whitespace * Update spell_effects.cpp --------- Co-authored-by: Alex King <89047260+Kinglykrab@users.noreply.github.com> --- common/ruletypes.h | 1 + zone/spell_effects.cpp | 20 +++++++++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/common/ruletypes.h b/common/ruletypes.h index a42832527..ad63226bd 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -518,6 +518,7 @@ RULE_BOOL(Spells, SnareOverridesSpeedBonuses, false, "Enabling will allow snares RULE_INT(Spells, TargetedAOEMaxTargets, 4, "Max number of targets a Targeted AOE spell can cast on. Set to 0 for no limit.") RULE_INT(Spells, PointBlankAOEMaxTargets, 0, "Max number of targets a Point-Blank AOE spell can cast on. Set to 0 for no limit.") RULE_INT(Spells, DefaultAOEMaxTargets, 0, "Max number of targets that an AOE spell which does not meet other descriptions can cast on. Set to 0 for no limit.") +RULE_BOOL(Spells, AllowFocusOnSkillDamageSpells, false, "Allow focus effects 185, 459, and 482 to enhance SkillAttack spell effect 193") RULE_CATEGORY_END() RULE_CATEGORY(Combat) diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index 93721f8c9..7940a7c8e 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -2416,16 +2416,18 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove break; } + int16 focus = RuleB(Spells, AllowFocusOnSkillDamageSpells) ? caster->GetMeleeDamageMod_SE(spells[spell_id].skill) : 0; + switch(spells[spell_id].skill) { - case EQ::skills::SkillThrowing: - caster->DoThrowingAttackDmg(this, nullptr, nullptr, spells[spell_id].base_value[i],spells[spell_id].limit_value[i], 0, ReuseTime, 0, 0, 4.0f, true); - break; - case EQ::skills::SkillArchery: - caster->DoArcheryAttackDmg(this, nullptr, nullptr, spells[spell_id].base_value[i],spells[spell_id].limit_value[i], 0, ReuseTime, 0, 0, nullptr, 0, 4.0f, true); - break; - default: - caster->DoMeleeSkillAttackDmg(this, spells[spell_id].base_value[i], spells[spell_id].skill, spells[spell_id].limit_value[i], 0, false, ReuseTime); - break; + case EQ::skills::SkillThrowing: + caster->DoThrowingAttackDmg(this, nullptr, nullptr, spells[spell_id].base_value[i],spells[spell_id].limit_value[i], focus, ReuseTime, 0, 0, 4.0f, true); + break; + case EQ::skills::SkillArchery: + caster->DoArcheryAttackDmg(this, nullptr, nullptr, spells[spell_id].base_value[i],spells[spell_id].limit_value[i], focus, ReuseTime, 0, 0, nullptr, 0, 4.0f, true); + break; + default: + caster->DoMeleeSkillAttackDmg(this, spells[spell_id].base_value[i], spells[spell_id].skill, spells[spell_id].limit_value[i], focus, false, ReuseTime); + break; } break; }