hard coded class skill caps
I can't help but notice that skill caps by class are hard coded in the server. Doing a search will net you a couple dozen places where there's "case <class>: case <class>GM:"
Is anyone working on moving these values to a table in the database? I have some free time this weekend to do some work but don't want to start something someone is already working on. |
Pointless er i mean why? DB querys just slow stuff down and bloat the HD space required.
Code:
#include "maxskill.h" |
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. |
Bah i was typeing and talking and left out the function call.
int8 Mob::MaxSkill(int16 skillid, int16 class_, int16 level) Or if you haven't noticed it yet common/MaxSkill.cpp Code:
/* TODO: I don't feel like doing the math but i'm pretty sure I don't want to load that (zones*zones_on_server)+World times on any of my servers. I'll hook up a new share in cvs for non win32 people. Use if (MaxSkillTableMMF.Open("EQEMuMaxSkillTable", tmpMemSize)) { Like in EMuShareMem/NPCtypes.cpp line 72 if (NPCTypesMMF.Open("EQEMuNPCTypes", tmpMemSize)) { Or you might conflict with one of the others we only check the first letter after EQEMu on the unix side because i really don't think we'll ever have that many =) with the database.LoadMaxSkillTable() in world/net.cpp If you want to get ambitious include the class_skill table we use for GM trainer windows. |
Ok, am home now and actually looking through the source.
Incidentally I think storing this info as MaxSkillTable[skillid][race][eqclass][level] is a bad idea as well. Only the max skills for each class and the per level max skill. This would reduce it number of classes*number of skills*2. at 1 byte per value you end up with a pretty small chunk of memory. Anyway I'll delve a little deeper into the source. |
bah, I got lost in MMFs, MMFMutexs, Semaphores and how they relate to data. I'll leave this to those more comfortable with the source and stick with small stuff.
|
You need the race for racial skills. Sneak hide forage ect
|
Yes, but the race based bonuses could be checked seperately.
|
All times are GMT -4. The time now is 08:00 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.