Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Development

Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum)

Reply
 
Thread Tools Display Modes
  #1  
Old 07-06-2006, 05:46 PM
unicorn97211
Sarnak
 
Join Date: May 2006
Posts: 37
Default Walkspeed Fix

The current method of figuring walkspeed does not provide functionality that reflects that of live. After going through the PEQ npc_types table, every single walkspeed is half the runspeed. The following code change to the GetWalkspeed() function will ignore the database walkspeed and use runspeed to calculate it. This allows for snares to effect walkspeed in a way that functions just like live. With this fix in place I am able to Snare/FD split just like I do on live with my necro. SK's should see the same thing when Snare splitting.

Here is the Diff

Code:
--- E:\EQEmu815\zone\mob.cpp	Tue Jul 04 09:33:18 2006
+++ C:\EQEmuSP\Source\0.7.0\zone\mob.cpp	Thu Jul 06 21:39:52 2006
@@ -429,22 +429,28 @@
 {
     if (IsRooted())
         return 0.0f;
-    float aa_speed = 1.0f;
-    if (IsClient()){
-        int32 aa_item = CastToClient()->GetAA(aaInnateRunSpeed);
-        if (aa_item > 0 && aa_item < 10){
-            aa_speed += aa_item * 0.01;
+	// Everhood - Brings walking in line with live functionality
+    // Are we affected by a movement buff?
+	if (spellbonuses.movementspeed) {
+		// Is it bad like snare?
+		if(spellbonuses.movementspeed<0){
+			// Base walkspeed is always half our runspeed
+			float everhood_walkspeed = runspeed * 0.5f;
+			// This is how much our speed, walk or run, is reduced by the buff
+			float snare_offset = runspeed * ((spellbonuses.movementspeed / 100.0f)* -1.0f);
+			// This is our walkspeed with snare applied
+			float snared_speed = everhood_walkspeed - snare_offset;
+			// we can't walk backwards
+			if(snared_speed<0.0f){
+				return 0.0f;
+			}else{
+				return snared_speed;
         }
-        //partial implementation of Fleet of Foot
-        aa_item = CastToClient()->GetAA(aaFleetofFoot);
-        if (aa_item > 0 && aa_item < 10){
-            aa_speed += aa_item * 0.04;
         }
     }
-    if (spellbonuses.movementspeed || itembonuses.movementspeed)
-        aa_speed += (spellbonuses.movementspeed+itembonuses.movementspeed) / 100.0f;
-
-	return (walkspeed * aa_speed);
+	// we weren't snared so call GetRunspeed so that aa mods etc are applied
+	// and return half of it as our walkspeed
+	return GetRunspeed()*0.5f;
 }
 
 float Mob::GetRunspeed()
--- E:\EQEmu815\zone\MobAI.cpp	Tue Jul 04 09:33:18 2006
+++ C:\EQEmuSP\Source\0.7.0\zone\MobAI.cpp	Thu Jul 06 23:11:25 2006
@@ -870,8 +870,11 @@
 					}
 					
 					if(IsNPC())
+						// Everhood - Walkspeed can return 0.0f now
+						if(GetWalkspeed()!=0.0f){
 						CastToNPC()->AI_DoMovement();
 				}
+				}
 				
          } 
       } // else if (AImovement_timer->Check())
When testing this, mobs snared with Engulfing Darkness could barely walk away when I FD, mob snared with Dooming Darkness and higher were stuck until aggro'd into a run or snare wore off. This is the same behavior I see currently on live.
Reply With Quote
  #2  
Old 07-08-2006, 07:18 AM
fathernitwit
Developer
 
Join Date: Jul 2004
Posts: 773
Default

ok,

I took this concept, and redid it a bit. Basically, I changed it to use the same code to calculate run and walkspeed, but walkspeed is given an innate -50% speed penalty. This means that if you stack up another -50% penalty with buffs, the mob will be unable to walk. Once again, I would like you to test what I have done.
Reply With Quote
Reply


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 11:13 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