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)

Reply
 
Thread Tools Display Modes
  #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
  #2  
Old 02-09-2007, 07:14 PM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

You're indeed right, that should result in that always being 0. Had noticed rec. levels not working quite right a while back but never looked at it. Might even be able to do it without the casts.
Reply With Quote
  #3  
Old 02-09-2007, 07:47 PM
slowglass
Fire Beetle
 
Join Date: Nov 2006
Posts: 15
Default

Think you are right casts are not needed.
There is a second change that is needed which popergates the recomended level.
I have written the code, just need to test it compiles before I post it
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 07:51 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