EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Support::General Support (https://www.eqemulator.org/forums/forumdisplay.php?f=598)
-   -   Fleeing MOBs (https://www.eqemulator.org/forums/showthread.php?t=17294)

mollymillions 12-08-2004 11:15 PM

Fleeing MOBs
 
If your feeling adventurous, here's a hack to enable fleeing MOBs that uses the existing Fear spell code. The Z axis pathing isn't that great (probably very bad for dungeons).
Line numbers are approximate!


Source/zone/features.h
Line: 108
< //#define ENABLE_FEAR_PATHING 1
---
> #define ENABLE_FEAR_PATHING 1



Source/zone/mob.h
Line: 1874
< uint8 fear_state;
---
> uint8 fear_state;
> uint8 flee_state;



Source/zone/mob.h
Line: 219
< fearStateStuck
< };
---
> fearStateStuck
> };

> enum { //flee states
> fleeStateNotFleeing = 0,
> fleeStateFleeing
> };



Source/zone/mob.cpp
Line: 313
< fear_state = fearStateNotFeared;
---
> fear_state = fearStateNotFeared;
> flee_state = fleeStateNotFleeing;



Source/zone/attack.cpp
Line: 3515
< //unsigned char test[sizeof(Action_Struct)];
---
> //#ifdef ENABLE_FEAR_PATHING

> //flee if HP low
> if ((flee_state == fleeStateNotFleeing) && (GetHPRatio() <= 20))
> {
> SetFeared(other, 600 );
> flee_state = fleeStateFleeing;
> }

> //#endif

> //unsigned char test[sizeof(Action_Struct)];



MobAI.cpp
Line: 485
< if(fear_state != fearStateNotFeared) {
---
> if(fear_state != fearStateNotFeared) {

> //stop fleeing if HP recovered
> if (flee_state != fleeStateNotFleeing && GetHPRatio() > 20)
> {
> flee_state = fleeStateNotFleeing;
> fear_state = fearStateNotFeared;
> }



Isues:
-Some MOBs on the current DB have no regen therefore their HP will never recover and they will never stop fleeing.
-A high level MOB will flee from a low level PC.
-Assisted MOBs will flee.
-MOBs flee at full speed regardless of HP.
-Some MOBs should never flee.
-Z axis pathing is incorrect.


All times are GMT -4. The time now is 07:04 AM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.