mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 01:11:29 +00:00
[Rules] Add Backstab Rules (#2666)
* [Rules] Add backstab rules Add rules to disable elemental and bane damage on backstab. * Update special_attacks.cpp Co-authored-by: Alex King <89047260+Kinglykrab@users.noreply.github.com>
This commit is contained in:
parent
e811cb1e85
commit
d5aecb228a
@ -495,6 +495,8 @@ RULE_BOOL(Combat, NPCsUseFrontalStunImmunityRaces, true, "Enable or disable NPCs
|
||||
RULE_BOOL(Combat, AssassinateOnlyHumanoids, true, "Enable or disable Assassinate only being allowed on Humanoids, true by default.")
|
||||
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_CATEGORY_END()
|
||||
|
||||
RULE_CATEGORY(NPC)
|
||||
|
||||
@ -112,13 +112,18 @@ int Mob::GetBaseSkillDamage(EQ::skills::SkillType skill, Mob *target)
|
||||
auto *inst = CastToClient()->GetInv().GetItem(EQ::invslot::slotPrimary);
|
||||
if (inst && inst->GetItem() && inst->GetItem()->ItemType == EQ::item::ItemType1HPiercing) {
|
||||
base = inst->GetItemBackstabDamage(true);
|
||||
if (!inst->GetItemBackstabDamage())
|
||||
if (!inst->GetItemBackstabDamage()) {
|
||||
base += inst->GetItemWeaponDamage(true);
|
||||
}
|
||||
|
||||
if (target) {
|
||||
if (inst->GetItemElementalFlag(true) && inst->GetItemElementalDamage(true))
|
||||
if (inst->GetItemElementalFlag(true) && inst->GetItemElementalDamage(true) && !RuleB(Combat, BackstabIgnoresElemental)) {
|
||||
base += target->ResistElementalWeaponDmg(inst);
|
||||
if (inst->GetItemBaneDamageBody(true) || inst->GetItemBaneDamageRace(true))
|
||||
}
|
||||
|
||||
if ((inst->GetItemBaneDamageBody(true) || inst->GetItemBaneDamageRace(true)) && !RuleB(Combat, BackstabIgnoresBane)) {
|
||||
base += target->CheckBaneDamage(inst);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (IsNPC()) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user