Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Server Code Submissions

Reply
 
Thread Tools Display Modes
  #1  
Old 07-25-2009, 09:26 PM
AndMetal
Developer
 
Join Date: Mar 2007
Location: Ohio
Posts: 648
Default

Just an update, I've been working on this some more, and I think I've got it figured out. Basically, every time we double our weight, our AGI is cut in half. That also means that when we triple our weight, that puts us at 0. Here's the rough equation:

Code:
//linear equation: y = m * x + b
//m = (-(val + mod)) / (GetSTR() * 2)
//x = (weight / 10) - GetSTR()
//b = val + mod
sint16 str = GetSTR();
sint16 total_agi = val + mod;
AGI = ((-total_agi) / (str * 2)) * ((weight / 10) - str) + total_agi;
__________________
GM-Impossible of 'A work in progress'
A non-legit PEQ DB server
How to create your own non-legit server

My Contributions to the Wiki

Last edited by AndMetal; 07-26-2009 at 05:36 AM..
Reply With Quote
  #2  
Old 07-25-2009, 10:17 PM
AndMetal
Developer
 
Join Date: Mar 2007
Location: Ohio
Posts: 648
Default

Just finished testing this out. Here's a diff of the changes:

Code:
Index: Y:/svn/trunk/EQEmuServer/zone/client_mods.cpp
===================================================================
--- Y:/svn/trunk/EQEmuServer/zone/client_mods.cpp	(revision 780)
+++ Y:/svn/trunk/EQEmuServer/zone/client_mods.cpp	(working copy)
@@ -979,19 +979,22 @@
 
 sint16 Client::CalcAGI() {
 	sint16 val = m_pp.AGI + itembonuses.AGI + spellbonuses.AGI;
-	
 	sint16 mod = aabonuses.AGI;
-	
-	sint16 str = GetSTR()*10;
-	if(weight > str) {
-		//ratio is wrong (close), but better than nothing
-		val -= (weight-str) * 100 / 1500;	//WR said /1875
-	}
-	
+
 	if(val>255 && GetLevel() <= 60)
 		val = 255;
-	AGI = val + mod;
+
+	sint16 str = GetSTR();
 	
+	//Encumbered penalty
+	if(weight > (str * 10)) {
+		//AGI is halved when we double our weight, zeroed (defaults to 1) when we triple it. this includes AGI from AAs
+		float total_agi = float(val + mod);
+		float str_float = float(str);
+		AGI = (sint16)(((-total_agi) / (str_float * 2)) * (((float)weight / 10) - str_float) + total_agi);	//casting to an int assumes this will be floor'd. without using floats & casting to sint16, the calculation doesn't work right
+	} else
+		AGI = val + mod;
+
 	if(AGI < 1)
 		AGI = 1;
I'm real out of date to SVN, so it may be a little while before I can get this committed, but if someone else wants to update it for me, feel free.
__________________
GM-Impossible of 'A work in progress'
A non-legit PEQ DB server
How to create your own non-legit server

My Contributions to the Wiki
Reply With Quote
  #3  
Old 07-25-2009, 10:28 PM
Congdar
Developer
 
Join Date: Jul 2007
Location: my own little world
Posts: 751
Default

I was wondering about your testing... your initial post mentioned you used a monk. Since monks have an innate weight penalty at anything more than 20 at level 65(PoP timeframe) i'm wondering if you took that into consideration or not. Maybe it would be better tested with a warrior?
__________________
The Realm
Reply With Quote
  #4  
Old 07-26-2009, 02:21 AM
AndMetal
Developer
 
Join Date: Mar 2007
Location: Ohio
Posts: 648
Default

Quote:
Originally Posted by Congdar View Post
I was wondering about your testing... your initial post mentioned you used a monk. Since monks have an innate weight penalty at anything more than 20 at level 65(PoP timeframe) i'm wondering if you took that into consideration or not. Maybe it would be better tested with a warrior?
Monks have an AC penalty based on their weight, but it shouldn't affect the actual Agility.

Just to make sure, I created an Ogre Warrior (level 1) with 150 base STR & 75 base AGI and the server is matching up with the client.
__________________
GM-Impossible of 'A work in progress'
A non-legit PEQ DB server
How to create your own non-legit server

My Contributions to the Wiki
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 05:16 PM.


 

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