As this is the first mod I've posted, I'm wondering what the consensus on this code is, Good, Bad or just plain Ugly?
-I had to override GetHPRatio to get the correct mob HP calculation (line numbers are approximate):
Code:
zone/mob.h, line 445
virtual inline float GetHPRatio() { return max_hp == 0 ? 0 : ((float)cur_hp/max_hp*100); }
-->
virtual inline float GetHPRatio() { return max_hp == 0 ? 0 : ((float)cur_hp/max_hp*100); }
virtual inline float GetHPRatio(float damage) { return max_hp == 0 ? 0 : ((float)(cur_hp-damage)/max_hp*100); }
zone/attack.cpp, line 1770
if ( flee_state == fleeStateNotFleeing && !IsRooted() && GetHPRatio() <= 21){
-->
if ( flee_state == fleeStateNotFleeing && !IsRooted() && GetHPRatio(damage) < 15){
-Mobs fleeing when HP<20 sucks, changed to 15.