Pets/NPCs don't use bane damage

Adds rule NPC:UseBaneDamage (defaults to false)
This commit is contained in:
Michael Cook (mackal) 2018-04-08 18:26:25 -04:00
parent e594b7eac6
commit 3081f7b24f
2 changed files with 11 additions and 7 deletions

View File

@ -514,6 +514,7 @@ RULE_INT(NPC, MajorNPCCorpseDecayTimeMS, 1500000) //level>=55
RULE_INT(NPC, CorpseUnlockTimer, 150000) RULE_INT(NPC, CorpseUnlockTimer, 150000)
RULE_INT(NPC, EmptyNPCCorpseDecayTimeMS, 0) 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, SayPauseTimeInSec, 5)
RULE_INT(NPC, OOCRegen, 0) RULE_INT(NPC, OOCRegen, 0)
RULE_BOOL(NPC, BuffFriends, false) RULE_BOOL(NPC, BuffFriends, false)

View File

@ -2000,6 +2000,7 @@ 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 //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; int eleBane = 0;
if (weapon) { if (weapon) {
if (RuleB(NPC, UseBaneDamage)) {
if (weapon->BaneDmgBody == other->GetBodyType()) { if (weapon->BaneDmgBody == other->GetBodyType()) {
eleBane += weapon->BaneDmgAmt; eleBane += weapon->BaneDmgAmt;
} }
@ -2007,7 +2008,9 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool
if (weapon->BaneDmgRace == other->GetRace()) { if (weapon->BaneDmgRace == other->GetRace()) {
eleBane += weapon->BaneDmgRaceAmt; eleBane += weapon->BaneDmgRaceAmt;
} }
}
// I don't think NPCs use this either ....
if (weapon->ElemDmgAmt) { if (weapon->ElemDmgAmt) {
eleBane += (weapon->ElemDmgAmt * other->ResistSpell(weapon->ElemDmgType, 0, this) / 100); eleBane += (weapon->ElemDmgAmt * other->ResistSpell(weapon->ElemDmgType, 0, this) / 100);
} }