EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Server Code Submissions (https://www.eqemulator.org/forums/forumdisplay.php?f=669)
-   -   COMMITTED: Pet Behavior (https://www.eqemulator.org/forums/showthread.php?t=30945)

joligario 04-01-2010 01:26 PM

COMMITTED: Pet Behavior
 
Small change to make pet behavior more realistic.

Code:

Index: MobAI.cpp
===================================================================
--- MobAI.cpp        (revision 1333)
+++ MobAI.cpp        (working copy)
@@ -1381,16 +1381,15 @@
                                                //        printf("Pet start pos: (%f, %f, %f)\n", GetX(), GetY(), GetZ());
                                               
                                                float dist = DistNoRoot(*owner);
-                                                if (dist >= 100)
+                                                if (dist >= 400)
                                                {
                                                        float speed = GetWalkspeed();
-                                                        if (dist >= 225)
+                                                        if (dist >= 5625)
                                                                speed = GetRunspeed();
                                                        CalculateNewPosition2(owner->GetX(), owner->GetY(), owner->GetZ(), speed);
                                                }
                                                else
                                                {
-                                                        SetHeading(owner->GetHeading());
                                                        if(moved)
                                                        {
                                                                moved=false;

1. Pets will stand 20 feet from owner instead of 10.
2. Pets will walk between 20 and 75 feet.
3. Pets will run after 75 feet.
4. Pets will stay facing direction of movement. This will lead up to a future fix where the pet will face nearest spawn within range as on live.


All times are GMT -4. The time now is 02:22 PM.

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