PDA

View Full Version : Chaotic Potential AA Fix


trevius
08-05-2008, 11:52 PM
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:

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

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:

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.


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.

trevius
08-13-2008, 11:14 PM
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:

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:

#include "../common/ruletypes.h"

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.