float Mob::GetFearSpeed() { if(flee_mode) { //we know ratio < FLEE_HP_RATIO float speed = GetRunspeed(); float ratio = GetHPRatio(); // mob's movement will halt with a decent snare at HP specified by rule. if (ratio <= RuleI(Combat, FleeSnareHPRatio) && GetSnaredAmount() > 40) { return 0.0001f; } if (ratio < FLEE_HP_MINSPEED) ratio = FLEE_HP_MINSPEED; speed = speed * 0.5 * ratio / 100; return(speed); } return(GetRunspeed()); }
float Mob::GetFearSpeed() { if(flee_mode) { //we know ratio < FLEE_HP_RATIO float speed = GetBaseRunspeed(); float ratio = GetHPRatio(); float multiplier = RuleR(Combat, FleeMultiplier); if(GetSnaredAmount() > 40) multiplier = multiplier / 6.0f; speed = speed * ratio * multiplier / 100; //NPC will eventually stop. Snares speeds this up. if(speed < 0.09) speed = 0.0001f; return(speed); } return(GetRunspeed()); }