From 3081f7b24fff7310bf427d72b29cfd3d625c71da Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Sun, 8 Apr 2018 18:26:25 -0400 Subject: [PATCH] Pets/NPCs don't use bane damage Adds rule NPC:UseBaneDamage (defaults to false) --- common/ruletypes.h | 3 ++- zone/attack.cpp | 15 +++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/common/ruletypes.h b/common/ruletypes.h index 6484a8586..f9c3b3c99 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -513,7 +513,8 @@ RULE_INT(NPC, MinorNPCCorpseDecayTimeMS, 450000) //level<55 RULE_INT(NPC, MajorNPCCorpseDecayTimeMS, 1500000) //level>=55 RULE_INT(NPC, CorpseUnlockTimer, 150000) RULE_INT(NPC, EmptyNPCCorpseDecayTimeMS, 0) -RULE_BOOL (NPC, UseItemBonusesForNonPets, true) +RULE_BOOL(NPC, UseItemBonusesForNonPets, true) +RULE_BOOL(NPC, UseBaneDamage, false) RULE_INT(NPC, SayPauseTimeInSec, 5) RULE_INT(NPC, OOCRegen, 0) RULE_BOOL(NPC, BuffFriends, false) diff --git a/zone/attack.cpp b/zone/attack.cpp index 26121134e..817a8e359 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -2000,14 +2000,17 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool //if NPCs can't inheriently hit the target we don't add bane/magic dmg which isn't exactly the same as PCs int eleBane = 0; if (weapon) { - if (weapon->BaneDmgBody == other->GetBodyType()) { - eleBane += weapon->BaneDmgAmt; - } - - if (weapon->BaneDmgRace == other->GetRace()) { - eleBane += weapon->BaneDmgRaceAmt; + if (RuleB(NPC, UseBaneDamage)) { + if (weapon->BaneDmgBody == other->GetBodyType()) { + eleBane += weapon->BaneDmgAmt; + } + + if (weapon->BaneDmgRace == other->GetRace()) { + eleBane += weapon->BaneDmgRaceAmt; + } } + // I don't think NPCs use this either .... if (weapon->ElemDmgAmt) { eleBane += (weapon->ElemDmgAmt * other->ResistSpell(weapon->ElemDmgType, 0, this) / 100); }