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-26-2005, 04:00 PM
mollymillions's Avatar
mollymillions
Hill Giant
 
Join Date: May 2003
Posts: 176
Default MaxSkill Calculations

A lot of our max skill calculations are incomplete and getting them right means adding a lot of ugly code to the MaxSkill class. Would it be possible to use a class_skillcap list and a block of generic code to get the max skills?

I am guessing that checking the value from a list, several times, is too expensive.

Heres some pseudo code of how I thought it could work:
Code:

Code:
/* 
class_skillcap table example:

ClassID, SkillID, Index, Level, SkillCap
(MonkID), (BindWoundID), 1, 1, 200
(MonkID), (BindWoundID), 2, 50, 210
(PaladinID),(BindWoundID), 1, 10, 200
(PaladinID),(BindWoundID), 2, 50, 210

*/

public int GetMaxSkill(class, skill, level)
{
  int caplevel = -1;
  int index = 1;


  //Get the base level 
  baselevel = GetCapLevel(class, skill, index);
  if (level < baselevel || baselevel = -1)
	return 0; // cant use skill

 
  caplevel = baselevel;

 
  while (level >= caplevel ) {
	index++;
	 caplevel = GetCapLevel(class, skill, index);

	if (caplevel = -1)
	 break; 
  }

  if (caplevel = -1)
	return 0; // cant use skill
  else { 

	// workout the max skill and compare it to the skill cap
	int maxskill = (((level - baselevel) * 5)+5);
	int skillcap = GetCap(class, skill, caplevel); 

	if (maxskill > skillcap)
	 return = skillcap;
	else
	 return = maxskill; 
	} 
  }

private int GetCapLevel(class, skill, index)
{
  //return the skill cap level for this class, race and index 
  //return -1 if the item doesn't exist
}

private int GetCap(class, skill, level)
{
  //return the skill cap for this class, race and skill cap level
}



The class_skillcap table would have about 500 records. (There would also have to be a race_skillcap list for the race specific skills).

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 05:36 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