Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::General Support

Support::General Support Post all topics here having to do with errors while trying to connect to an EQEMu server but not about the setup/running of the Server itself.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 06-10-2008, 05:04 AM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

I'm at work, so can't test this, but the issue appears to be the logic in
fearpath.cpp Mob::GetFearSpeed().

There is a hardcoded constant in the source, FLEE_HP_MINSPEED, which is set to 10.
The purpose of this is to put a lower limit on the mob's flee speed, i.e. once the
Mobs HP gets down to 10%, it won't slow down any further.

Assuming an unsnared mob with a default runspeed of 1.25 and rule FleeHPRatio
set to 25, FearSpeed will return a flee speed of 0.25 at 25% health.

Because of the logic, as the mobs HP decreases from 25% down to 10%, it will actually
move faster, with a speed of 1.25 when it's HP is exactly 10%.
Below 10% it will run at 0.25 (again, assuming unsnared).

The following drop-in replacement will give you a linear speed decrease, starting at 0.25
at 25% health, down to 0.10 at 10% and below.

Code:
float Mob::GetFearSpeed() {
    if(flee_mode) {
        //we know ratio < FLEE_HP_RATIO
        float speed = GetRunspeed();
        float ratio = GetHPRatio();

        if(ratio < FLEE_HP_MINSPEED) 
                ratio = FLEE_HP_MINSPEED;

        speed = speed * 0.8 * ratio / 100;
 
        return(speed);
    }
    return(GetRunspeed());
}
If you want them to move faster or slower in relation to HP%, fiddle with the speed = speed * 0.8 * ratio / 100; statement.

As I said, I can't test it in-game right now, but it works as I described 'in simulation'.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 06:59 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3