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
  #12  
Old 04-17-2010, 06:48 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Ok, this isn't exactly a pretty function yet, but it should use the math properly at least, which is the important part for now:

Code:
int32 Client::ManaFromIntWis(int8 level, int16 totalintorwis) {
	float mana_per = 0.0;
	int totalmana = 0;
	
	// Do calculations for Mana Per INT/WIS for the first 100 INT/WIS points
	if (level < 40) { 
		mana_per = level * 0.075;
	}
	else if (level < 80) {
		mana_per = (3 + ((level - 40) * 0.15));	// ((40 * 0.075) + ((level - 40) * 0.15))
	}
	else {
		mana_per = 9;	// ((40 * 0.075) + (40 * 0.15))
	}
	
	// Calculate how much mana is added from the first 100 INT/WIS points
	if (totalintorwis > 100) {
		totalmana += mana_per * 100;
		totalintorwis -= 100;
	}
	else {
		totalmana += mana_per * totalintorwis;
		totalintorwis = 0;
	}
	
	// If there was over 100 INT/WIS, do the rest of the Mana Calculations
	if (totalintorwis) {
		// Do calculations for Mana Per INT/WIS for INT/WIS over 100 points
		if (level < 40) { 
			mana_per = level * 0.1875;
		}
		else if (level < 80) {
			mana_per = ((40 * 0.1875) + ((level - 40) * 0.375));
		}
		else {
			mana_per = 22.5;	// ((40 * 0.1875) + (40 * 0.375))
		}
		
		// Calculate how much mana is added for points over 100 INT/WIS
		if (totalintorwis > 100) {
			totalmana += mana_per * 100;
			totalintorwis -= 100;
			totalmana += ((mana_per * totalintorwis) / 2);
		}
		else {
			totalmana += mana_per * totalintorwis;
		}
	}

	return totalmana;
}
That will all be rewritten once I look at how the current HP/Mana/Endurance code is all written currently in the source. But, that should be the formula for nearly exact mana per INT or WIS point. It may add 1 extra mana point for some levels, but that is the most it should ever be off.

That formula should also be able to be used to calculate Endurance with just a few adjustments to account for Endurance gaining stats from all 4 STR/STA/AGI/DEX stats.

So, this should just leave the HP per STA formulas to figure out for the 6 types between all classes. I suspect that will be a flat rate gain just like the Mana/Endurance ones are, so it should be fairly simple to figure it out.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
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 04:44 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