From 8c226054e7f1d6d6d0a30b6303c7080829bf4872 Mon Sep 17 00:00:00 2001 From: catapultam-habeo <97849758+catapultam-habeo@users.noreply.github.com> Date: Mon, 4 Mar 2024 17:41:25 -0600 Subject: [PATCH] [Feature] Adds rules to control level requirements for Double Backstab, Assassinate, and Double Bowshot (#29) (#4159) Co-authored-by: mute --- common/ruletypes.h | 3 +++ zone/attack.cpp | 2 +- zone/special_attacks.cpp | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/common/ruletypes.h b/common/ruletypes.h index 68eb5cd35..042c9bec4 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -527,6 +527,7 @@ RULE_REAL(Combat, BaseProcChance, 0.035, "Base chance for procs") RULE_REAL(Combat, ProcDexDivideBy, 11000, "Divisor for the probability of a proc increased by dexterity") RULE_INT(Combat, MinRangedAttackDist, 25, "Minimum Distance to use Ranged Attacks") RULE_BOOL(Combat, ArcheryBonusRequiresStationary, true, "does the 2x archery bonus chance require a stationary npc") +RULE_INT(Combat, ArcheryBonusLevelRequirement, 51, "Level requirement when the 2x archery bonus will be enabled. The default is 51.") RULE_REAL(Combat, ArcheryNPCMultiplier, 1.0, "Value is multiplied by the regular dmg to get the archery dmg") RULE_BOOL(Combat, AssistNoTargetSelf, true, "When assisting a target that does not have a target: true = target self, false = leave target as was before assist (false = live like)") RULE_INT(Combat, MaxRampageTargets, 3, "Maximum number of people hit with rampage") @@ -575,10 +576,12 @@ RULE_BOOL(Combat, NPCsUseFrontalStunImmunityClasses, false, "Enable or disable N RULE_INT(Combat, FrontalStunImmunityRaces, 512, "Bitmask for Races than have frontal stun immunity, Ogre (512) only by default.") RULE_BOOL(Combat, NPCsUseFrontalStunImmunityRaces, true, "Enable or disable NPCs using frontal stun immunity Races from Combat:FrontalStunImmunityRaces, true by default.") RULE_BOOL(Combat, AssassinateOnlyHumanoids, true, "Enable or disable Assassinate only being allowed on Humanoids, true by default.") +RULE_INT(Combat, AssassinateLevelRequirement, 60, "Level requirement to enable assassinate attempts on backstabs. The default is 60.") RULE_BOOL(Combat, HeadshotOnlyHumanoids, true, "Enable or disable Headshot only being allowed on Humanoids, true by default.") RULE_BOOL(Combat, EnableWarriorShielding, true, "Enable or disable Warrior Shielding Ability (/shield), true by default.") RULE_BOOL(Combat, BackstabIgnoresElemental, false, "Enable or disable Elemental weapon damage affecting backstab damage, false by default.") RULE_BOOL(Combat, BackstabIgnoresBane, false, "Enable or disable Bane weapon damage affecting backstab damage, false by default.") +RULE_INT(Combat, DoubleBackstabLevelRequirement, 55, "Level requirement to enable double backstab attempts. The default is 55.") RULE_BOOL(Combat, SummonMeleeRange, true, "Enable or disable summoning of a player when already in melee range of the summoner.") RULE_BOOL(Combat, WaterMatchRequiredForAutoFireLoS, true, "Enable/Disable the requirement of both the attacker/victim being both in or out of water for AutoFire LoS to pass.") RULE_INT(Combat, ExtraAllowedKickClassesBitmask, 0, "Bitmask for allowing extra classes beyond Warrior, Ranger, Beastlord, and Berserker to kick, No Extra Classes (0) by default") diff --git a/zone/attack.cpp b/zone/attack.cpp index dcb39ab77..e4a72de78 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -6209,7 +6209,7 @@ void Mob::CommonOutgoingHitSuccess(Mob* defender, DamageHitInfo &hit, ExtraAttac if (headshot > 0) { hit.damage_done = headshot; } - else if (GetClass() == Class::Ranger && GetLevel() > 50) { // no double dmg on headshot + else if (GetClass() == Class::Ranger && GetLevel() >= RuleI(Combat, ArcheryBonusLevelRequirement)) { // no double dmg on headshot if ((defender->IsNPC() && !defender->IsMoving() && !defender->IsRooted()) || !RuleB(Combat, ArcheryBonusRequiresStationary)) { hit.damage_done *= 2; MessageString(Chat::MeleeCrit, BOW_DOUBLE_DAMAGE); diff --git a/zone/special_attacks.cpp b/zone/special_attacks.cpp index 4a39dc313..e8618d5a2 100644 --- a/zone/special_attacks.cpp +++ b/zone/special_attacks.cpp @@ -707,7 +707,7 @@ void Mob::TryBackstab(Mob *other, int ReuseTime) { CastToClient()->Message(Chat::White,"Your fierce attack is executed with such grace, your target did not see it coming!"); RogueBackstab(other,false,ReuseTime); - if (level > 54) { + if (level >= RuleI(Combat, DoubleBackstabLevelRequirement)) { // TODO: 55-59 doesn't appear to match just checking double attack, 60+ does though if(IsClient() && CastToClient()->CheckDoubleAttack()) { @@ -2402,7 +2402,7 @@ int Mob::TryAssassinate(Mob *defender, EQ::skills::SkillType skillInUse) if ( defender && !defender->IsClient() && - GetLevel() >= 60 && + GetLevel() >= RuleI(Combat, AssassinateLevelRequirement) && (skillInUse == EQ::skills::SkillBackstab || skillInUse == EQ::skills::SkillThrowing) && (defender->GetBodyType() == BT_Humanoid || !RuleB(Combat, AssassinateOnlyHumanoids)) && !defender->GetSpecialAbility(IMMUNE_ASSASSINATE)