From 8302f7cc268556fd83e912f9f4a40573f57771ac Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Wed, 14 Nov 2018 22:59:07 -0500 Subject: [PATCH] Add a level cap to gray con flee --- common/ruletypes.h | 1 + zone/fearpath.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/common/ruletypes.h b/common/ruletypes.h index 16e85805d..ab9acecf1 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -419,6 +419,7 @@ RULE_BOOL(Combat, EnableFearPathing, true) RULE_REAL(Combat, FleeMultiplier, 2.0) // Determines how quickly a NPC will slow down while fleeing. Decrease multiplier to slow NPC down quicker. RULE_BOOL(Combat, FleeGray, true) // If true FleeGrayHPRatio will be used. RULE_INT(Combat, FleeGrayHPRatio, 50) //HP % when a Gray NPC begins to flee. +RULE_INT(Combat, FleeGrayMaxLevel, 18) // NPC's above this level won't do gray/green con flee RULE_INT(Combat, FleeHPRatio, 25) //HP % when a NPC begins to flee. RULE_BOOL(Combat, FleeIfNotAlone, false) // If false, mobs won't flee if other mobs are in combat with it. RULE_BOOL(Combat, AdjustProcPerMinute, true) diff --git a/zone/fearpath.cpp b/zone/fearpath.cpp index c73ec448e..de65f4e8a 100644 --- a/zone/fearpath.cpp +++ b/zone/fearpath.cpp @@ -62,7 +62,7 @@ void Mob::CheckFlee() { } // If no special flee_percent check for Gray or Other con rates - if(GetLevelCon(hate_top->GetLevel(), GetLevel()) == CON_GRAY && fleeratio == 0 && RuleB(Combat, FleeGray)) { + if(GetLevelCon(hate_top->GetLevel(), GetLevel()) == CON_GRAY && fleeratio == 0 && RuleB(Combat, FleeGray) && GetLevel() <= RuleI(Combat, FleeGrayMaxLevel)) { fleeratio = RuleI(Combat, FleeGrayHPRatio); } else if(fleeratio == 0) { fleeratio = RuleI(Combat, FleeHPRatio );