Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Development

Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum)

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 02-08-2007, 01:40 AM
slowglass
Fire Beetle
 
Join Date: Nov 2006
Posts: 15
Default CalcRecommendedLevelBonus

This function is used to calculate the stats of an item when the recomended level is greater then the character level.

Code:
int Client::CalcRecommendedLevelBonus(int8 level, uint8 reclevel, int basestat)
{
	if( (reclevel > 0) && (level < reclevel) )
	{
		float statmod = (level / reclevel) * basestat;
	
		if( statmod < 0 )
		{
			statmod *= -1;
			statmod += 0.5;
			return (((int)statmod) * -1);
		}
		else
		{
			statmod += 0.5;
			return (int)statmod;
		}
	}

	return 0;
}
In the above code
Code:
float statmod = (level / reclevel) * basestat; will always return 0.
The fix should be (please bear with me as I cannot compile or test the server yet. I need to set up the entire enviroment) ...

Code:
float statmod = (((float)level) / reclevel) * basestat;

There is a secondary issue (I beleive) that the server computes the stats on an item by item basis, while the client creates amalgamated items of the item and all its augs and then calculates the stats.


Chris
Reply With Quote
 


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 12:02 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