From 2bb7bba724271c14263de6fac7dd07b7a5867f74 Mon Sep 17 00:00:00 2001 From: catapultam-habeo <97849758+catapultam-habeo@users.noreply.github.com> Date: Sat, 12 Aug 2023 20:19:22 -0500 Subject: [PATCH] [Rules] Add a rule to adjust the randomization range for Wizard\Caster Merc innate critical ratio. (#3543) * initial commit * oops. * that wasn't supposed to be committed. * Update effects.cpp --------- Co-authored-by: Alex King <89047260+Kinglykrab@users.noreply.github.com> --- common/ruletypes.h | 2 ++ zone/effects.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/common/ruletypes.h b/common/ruletypes.h index bb6264359..c92e4c4dc 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -450,6 +450,8 @@ RULE_BOOL(Spells, TargetsTargetRequiresCombatRange, true, "Disable to remove com RULE_BOOL(Spells, NPCBuffLevelRestrictions, false, "Impose BuffLevelRestrictions on NPCs if true") RULE_INT(Spells, ResurrectionEffectBlock, 2, "0 = allow overwrites/rule disabled. If set to 1 = Block all buffs that would overwrite Resurrection Effects. If set to 2 = Will not overwrite Resurrection Effects, instead moves new buff to an empty slot if available. Default is 2.") RULE_BOOL(Spells, WaterMatchRequiredForLoS, true, "Enable/Disable the requirement of both the attacker/victim being both in or out of water for spells LoS to pass.") +RULE_INT(Spells, WizardCritMinimumRandomRatio, 20, "The minimum value for the random range which Wizards and Caster DPS Mercs innately have for spell crit ratio. Set to 20 for vanilla values.") +RULE_INT(Spells, WizardCritMaximumRandomRatio, 70, "The maximum value for the random range which Wizards and Caster DPS Mercs innately have for spell crit ratio. Set to 70 for vanilla values.") RULE_CATEGORY_END() RULE_CATEGORY(Combat) diff --git a/zone/effects.cpp b/zone/effects.cpp index 0570251f2..c7d3ff34a 100644 --- a/zone/effects.cpp +++ b/zone/effects.cpp @@ -95,7 +95,7 @@ int64 Mob::GetActSpellDamage(uint16 spell_id, int64 value, Mob* target) { else if ((IsOfClientBot() && GetClass() == WIZARD) || (IsMerc() && GetClass() == CASTERDPS)) { if ((GetLevel() >= RuleI(Spells, WizCritLevel)) && zone->random.Roll(RuleI(Spells, WizCritChance))){ //Wizard innate critical chance is calculated seperately from spell effect and is not a set ratio. (20-70 is parse confirmed) - ratio += zone->random.Int(20,70); + ratio += zone->random.Int(RuleI(Spells, WizardCritMinimumRandomRatio), RuleI(Spells, WizardCritMaximumRandomRatio)); Critical = true; } }