View Single Post
  #3  
Old 05-29-2003, 11:50 AM
loudent2
Sarnak
 
Join Date: Apr 2003
Posts: 95
Default

I'm not suggesting you read the database everytime.

Wouldn't it be preferable that you have some class that wraps 2 values. (lets call it CClassSkillCap) Skill cap and Per-Level skill cap. You then have a class that is wraps a vector of classes(eq classes) that each has a vector CClassSkillCap. One for each skill.

Whether you store these in the database or they're hard coded in the source they're read once on start-up. Then when you need to check for max skill you pass in race, class and level

pseudo-pseudo code:

maxskilllevel = Classvector[class].Classskillcap[skill].m_skillcap;
plvlmaxlevel = ((level+1) * (Classvector[class].Classskillcap[skill].m_plvlskillcap))

rlevel = (maxskilllevel > plvlmaxlevel) ? plvlmaxlevel : maxskilllevel;



There might have to be a couple tweaks to handle special advancements, trade skills and race based overrides but it should clean up a great deal of those class switch statements. With the list centralized it would be easier to make edits. The reason I suggested it go in the database is because it would allow world serverops to alter values for their world without re-building the source.
__________________
Ignorance is Bliss
Reply With Quote