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

Reply
 
Thread Tools Display Modes
  #1  
Old 08-05-2008, 11:52 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default Chaotic Potential AA Fix

This code was submitted by Spider 661, and I am re-posting it here so it is easier to keep track of to get added to the source:

Quote:
Originally Posted by spider661 View Post
i was going though the code working on a magelo clone and i noticed my hp on the clone where not showing up right in game then i did a show stats and boom there where the stats so i started looking though them in the code and what do you know..

Chaotic Potential as not being calculated into the getmaxstat() setting..

i set this but have not tested

works in the clone though.'
client_mods.cpp
Code:
sint16 Client::GetMaxStat() const {
	int level = GetLevel();
	
	sint16 base = 0;
	
	if (level < 61) {
		base = 255;
	}
	else if (level < 71) {
		base =  255 + 5 * (level - 60);
	}
	else {
		base = 280;
	}
	
	base += GetAA(aaPlanarPower) * 5;
//////////ADDED/////////////////////////////////////
	base += GetAA(aaChaoticPotential) * 5;
////////END ADDED///////////////////////////////////
	return(base);
}
like i said have not tested it not sure if aaChaoticPotential is defined anywhere but it at lests show what im talking about.
Here is his second post that includes 1 more minor change to be added, as well as confirmation that the first change worked as intended:

Quote:
Originally Posted by spider661 View Post
noted also that the stats for anyone over lvl 71 are not right also..

according to the char sheet. without aas the max stat is 330 so that would make the new getmaxstat read like so.

Code:
sint16 Client::GetMaxStat() const {
	int level = GetLevel();
	
	sint16 base = 0;
	
	if (level < 61) {
		base = 255;
	}
	else if (level < 71) {
		base =  255 + 5 * (level - 60);
	}
	else {
/////////////ADDED///////////////////////////////////////////////
//added is for my notes its actually edited from 280 to 330
		base = 330;
////////////END ADDED///////////////////////////////////////////
	}
	
	base += GetAA(aaPlanarPower) * 5;
//////////ADDED/////////////////////////////////////
	base += GetAA(aaChaoticPotential) * 5;
////////END ADDED///////////////////////////////////
	return(base);
}
this has been tested and works
The original thread can be found here:

http://www.eqemulator.net/forums/showthread.php?t=25717

Again, I had nothing to do with writing this code. I am just quoting it here for easy reference and organization of code submissions. Spider661 gets all the credit. I am running this code change on my server and it works perfectly.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #2  
Old 08-13-2008, 11:14 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

I edited this code a little to give a little more options. This is for use with my new custom rule, ExtraLevelCap. But, the rule could easily be replaced with MaxLevel and it would work with the current rule system.

Basically, the adjustments for calculating max stats is for servers that have a level cap over level 70. This will let them keep getting 5 stats per level no matter how high they set the level cap to.

Changing the base to 330 isn't really necessary, but in most cases this setting would probably only get used by GMs that set their level to be above the level cap rule(s) on the server. Really, this could just stay 280, but it depends on what you want your GMs over max level to have as their stat caps.

The only real important thing in this submission is that the Chaotic Potential fix gets added in. There should be nothing holding this part up from making it into the source. This fix has HP calculated considerably more accurate for players with this AA. It is usually only off by 1 or 2 hps, which isn't the fault of this code. I think that is another issue all together with HP calculations. Here is the Chaotic Potential Fix that goes in the client_mods.cpp:
Code:
	base += GetAA(aaChaoticPotential) * 5;  //added by spider661 - Chaotic Potential Fix

And, here is the fully edited code from Spider661 with a little tweaking from me:

client_mods.cpp:

Code:
#include "../common/ruletypes.h"
Code:
sint16 Client::GetMaxStat() const {
	int level = GetLevel();
	int lvlcap = RuleI(Character, ExtraLevelCap) + 1; //Trevius - added to work with new rule when deciding the stat caps per level for 61+
	sint16 base = 0;
	
	if (level < 61) {
		base = 255;
	}
	else if (level < lvlcap) {  //Trevius - Previously Set to 71
		base =  255 + 5 * (level - 60);
	}
	else {

		base = 330; //spider661 - edited from 280 to 330

	}
	
	base += GetAA(aaPlanarPower) * 5;
	base += GetAA(aaChaoticPotential) * 5;  //added by spider661 - Chaotic Potential Fix
	return(base);
}
I have tried this and I am not sure why it isn't compiling properly. I get warnings about RuleI, Character and ExtraLevelCap not being defined or something. I will have to mess with it some more. It may have been because I was just doing a make again without doing a make clean first...

All I want it to do is make "lvlcap" equal whatever ExtraLevelCap is set to in the rules + 1. So, if it is set to 75 in the rules, lvlcap would equal 76.

I will try this out tonight and see how it goes.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!

Last edited by trevius; 08-27-2008 at 06:30 AM..
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:55 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3