Flee Patch to stop mobs fleeing if other mobs are also in combat against the player
Here is a patch to implement changes to flee such that mobs won't flee if the player at the top of their hatelist
has other mobs on their hatelist which are not green cons, feared/fleeing or mezzed and are within aggro range of the player. http://www.rama.demon.co.uk/smartflee.patch The main change is a new method added to the HateList class: Code:
int32 HateList::GetHatedCount(Mob *hater, bool CountGreens, bool CountFearedOrMezzed, bool RangeCheck) The final change is to call HateList::GetHatedCount from CheckFlee Oh, and I added a rule: Code:
RULE_BOOL ( Combat, FleeIfNotAlone, false) // If false, mobs won't flee if other mobs are in combat with it. if there are other mobs in combat. |
I just caught this one, I'll give it a run, thanks!
|
Nice! The fleeing code is really getting cleaned up and tuned nicely! Thanks for another nice update, Derision! I will give this a shot as well when I get back from vacation.
|
I was just looking at this code again, and I obviously never tested this patch with FleeIfNotAlone
set to true (i.e. the new code disabled). If FleeIfNotAlone==true, then the mobs won't flee at all. After applying the patch in my original post. change the rule check in fearpath.cpp from: Code:
if(!RuleB(Combat, FleeIfNotAlone) && hate_top->hate_list.GetHatedCount(hate_top, false, false, true)<=1) Code:
if(RuleB(Combat, FleeIfNotAlone) || (!RuleB(Combat, FleeIfNotAlone) && hate_top->hate_list.GetHatedCount(hate_top, false, false, true)<=1)) |
This will be in version 1113.
|
Was looking thru the 1118 code in fearpath.cpp and this is how it is now.
Code:
if( RuleB(Combat, FleeIfNotAlone) Probably has the same effect no matter which number. |
<=1 and <2 are equivalent (as the return value being checked is an integer). I don't know why it was changed.
|
All times are GMT -4. The time now is 02:12 AM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.