[Rules] Backstab Damage Modifier (#3908)

* [Rules] Backstab Damage Modifier

Added NPCBackstabMod - Default 1.9 - Lower mod = higher backstab.

* Update special_attacks.cpp

corrected math to npc base_damage
This commit is contained in:
Fryguy 2024-01-08 02:58:48 -05:00 committed by GitHub
parent c731f3f560
commit 0f7f71334a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -587,6 +587,7 @@ RULE_INT(NPC, NPCToNPCAggroTimerMin, 500, "Minimum time span after which one NPC
RULE_INT(NPC, NPCToNPCAggroTimerMax, 6000, "Maximum time span after which one NPC aggro another NPC (milliseconds)")
RULE_BOOL(NPC, UseClassAsLastName, true, "Uses class archetype as LastName for NPC with none")
RULE_BOOL(NPC, NewLevelScaling, true, "Better level scaling, use old if new formulas would break your server")
RULE_REAL(NPC,NPCBackstabMod, 1.9, "Multiplier for NPC Backstab, Higher = Lower backstab amount")
RULE_INT(NPC, NPCGatePercent, 20, " Percentage at which the NPC Will attempt to gate at")
RULE_BOOL(NPC, NPCGateNearBind, false, "Will NPC attempt to gate when near bind location?")
RULE_INT(NPC, NPCGateDistanceBind, 75, "Distance from bind before NPC will attempt to gate")

View File

@ -24,6 +24,7 @@
#include "mob.h"
#include "string_ids.h"
#include "lua_parser.h"
#include "npc.h"
#include <string.h>
@ -182,7 +183,7 @@ int Mob::GetBaseSkillDamage(EQ::skills::SkillType skill, Mob *target)
}
} else if (IsNPC()) {
auto *npc = CastToNPC();
base = std::max(base, npc->GetBaseDamage());
base = round((npc->GetMaxDMG() - npc->GetMinDMG()) / RuleR(NPC, NPCBackstabMod));
// parses show relatively low BS mods from lots of NPCs, so either their BS skill is super low
// or their mod is divided again, this is probably not the right mod, but it's better
skill_bonus /= 3.0f;