Got a little work done tonight, nothing I wrote about above, was more looking at the endurance implementation. Some things:
The calc max endurance formula used is wrong, while trying to simplify it certainly makes it easier to read it also leads it to some pretty bad rounding errors. My warrior lost a good 800 endurance with your simplified version.
This is the new version I wrote that didn't use non standard min/max() and added in commenting so the logic is understandable
Code:
//Info taken from magelo, it's a *little* off but accurate enough.
void Client::CalcMaxEndurance()
{
//"Stats" the total of (Str + Dex + Sta + Agi)
int Stats = GetSTR()+GetSTA()+GetDEX()+GetAGI();
//"Levelbonus" your Level * .075
//Endurance = level * 15 plus
//Levelbonus times the sum of the next 4 lines (this is calculated on each line, not at the end because of rounding errors otherwise)
max_end = GetLevel() * 15;
//plus lesser of Stats and 800, divide that by 4.
max_end += int((Stats>800?800:Stats)/4)*0.075*GetLevel();
//plus bigger of (lesser of Stats and 800)-400, and 0. all of that /4
max_end += int((((Stats>800?800:Stats)-400)>0?((Stats>800?800:Stats)-400):0)/4)*(0.075*GetLevel());
//plus bigger of (lesser of Stats and 800)-400, and 0. all of that /8
max_end += int((((Stats>800?800:Stats)-400)>0?((Stats>800?800:Stats)-400):0)/8)*(0.075*GetLevel());
//plus bigger of (Stats - 800 and zero) / 8
max_end += int((Stats>800?Stats:0)/8)*(0.075*GetLevel())*2;
//plus bigger of (Stats - 800 and zero) / 16
max_end += int((Stats>800?Stats:0)/16)*(0.075*GetLevel());
//plus our endurance from items and spells.
max_end += spellbonuses.Endurance + itembonuses.Endurance;
//Maurice of Magelo fame explained that we can't simplify the statements
//because we have to round every step of the way.
}
Also something appears up with how stats are calculated for clients, I'm not sure exactly where there's a problem but well let me show you:
Sarrie 65 War naked
http://i8.photobucket.com/albums/a2/...rite/naked.jpg
Sarrie 65 War with her full gear on
http://i8.photobucket.com/albums/a2/...e/notnaked.jpg
It appears almost like itembonuses are being counted twice serverside. Ex. Sarrie had +86 wisdom fully geared and had a base of 70 shoulda been 156 serverside like clientside but was 242. 70 + (86*2) = 242. And obviously stats aren't capped correctly which is gonna mess with hp/mana/endurance calculations, among other things.
Not exactly sure what causes it though.
Also though I haven't gotten around to testing it I'm pretty sure this is the case:
In the itemfield encoding for titanium I believe
Code:
/* 083 */ I(AugSlotType[0])
/* 084 */ I(AugSlotUnk[0])
/* 085 */ I(AugSlotType[1])
/* 086 */ I(AugSlotUnk[1])
/* 087 */ I(AugSlotType[2])
/* 088 */ I(AugSlotUnk[2])
/* 089 */ I(AugSlotType[3])
/* 090 */ I(AugSlotUnk[3])
/* 091 */ I(AugSlotType[4])
/* 092 */ I(AugSlotUnk[4])
is actually backwards with the unknown spot coming before the slot, I believe that's why aug slots don't appear on items for titanium.
I'll try to look into all this a little bit more and get some more info.