I store the endurance in the Player Profile in this so you should zone with the endurance you had in your PP from the last known save. The problem is that right now endurance isn't tracked at all by the server so you can't save what you can't track.
I looked at the code this morn after I had finished writing it last night and noticed a few oversights on my part. I send two manachange packets per tic and this could be combined with the one that's sent for mana. Would need to be reconfigured to work if you don't have any mana, perhaps in a similar way by tracking the last changed endurance as well. Right now the way I did it is horribly inefficient.
Another was my CalcMaxEnd(), the code I used allocated a lot of pointless variables, and I also got it from someone else and while I can't really change the wording of the formula and while I take no credit for the function I didn't think it right to keep the entire function exactly the same as it was.
Code:
void Client::CalcMaxEnd()
{
int Stats = GetSTR()+GetSTA()+GetDEX()+GetAGI();
max_end = ( int( min( Stats, 800 ) / 4 ) * 0.075 * GetLevel() );
max_end += int( max( ( min( Stats, 800 ) - 400 ), 0 ) / 4 ) * ( 0.075 * GetLevel() );
max_end += int( max( ( min( Stats, 800 ) - 400 ), 0 ) / 8 ) * ( 0.075 * GetLevel() );
max_end += int( max( Stats - 800, 0 ) / 8 ) * ( 0.075 * GetLevel() ) * 2;
max_end += int( max( Stats - 800, 0 ) / 16 ) * ( 0.075 * GetLevel() );
max_end += GetLevel()*15 + spellbonuses.Endurance + itembonuses.Endurance;
}