|
|
 |
 |
 |
 |
|
 |
 |
|
 |
 |
|
 |
|
Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum) |
 |
|
 |

02-27-2005, 11:36 AM
|
Developer
|
|
Join Date: Jul 2004
Posts: 773
|
|
this is perfectly reasonable to do, if you wanna code it up. The biggest reason it hasnt been done is that nobody wants to populate the database table.
I see these fields in the table:
classID
skillID
formula (integer which you switch on for various calculation formulas)
min_level (the level at which this cap starts to apply)
cap (the cap at this level)
some formula types, which apply until the formula's result exceeds the cap:
0. untrainable
1. untrained (at this level it cannot be trained, but will be avaliable later)
2. just use cap
3. (level * 5) + 5
4. ((level - min_level) * 5) + 5
... I believe theres some others in there ...
I dont see the point of your index field really, just store them sorted by level, and run throught the list until the level of the next entry is higher than your current level, or the list ends.
Actually, you could pull these from the database and apply them as you load them to calculate the level cap at each level and then just store that in a big array in shared memory:
uint8 skill_caps[MAX_CLASS][MAX_SKILL][LEVEL_CAP]...
for level 70, thats 78kb of data... which is nothing in shared memory...
dont really use a 3d array though, use:
uint8 skill_caps[MAX_CLASS * MAX_SKILL * LEVEL_CAP]
and index it with:
getskillcap(class, skill, level) \
skill_caps[class * (MAX_SKILL + LEVEL_CAP) + skill * LEVEL_CAP + level)
This is a very shared-memory friendly system, and is what I recommend.
I dont know if it would be worth your time to put all the race-based caps into the database, its prolly easier to just make a quick switch statement for them, and intelligently combine the results with the results of the class stuff.
However you do it, these caps should all be loaded into memory at zone start time, if not shared memory.
There would need to be at least 1200 entries in this table for each class/skill combination, maybe reducable by making the default 'untrainable', but there will be a lot of extra entries for 50+ and 60+ levels, so it'll end up being a few thousand... not that it matters.
|
 |
|
 |

02-28-2005, 04:12 AM
|
 |
Hill Giant
|
|
Join Date: May 2003
Posts: 176
|
|
OK, i will get all the data together for starters.
|

03-03-2005, 02:29 AM
|
 |
Hill Giant
|
|
Join Date: May 2003
Posts: 176
|
|
http://members.dodo.net.au/~mollymillions/Skills.xls
*Edit* -Added code to create table. It's going to take quite a while to locate all the 65+ caps.
Last edited by mollymillions; 03-05-2005 at 05:59 AM..
|

03-03-2005, 05:08 AM
|
Developer
|
|
Join Date: Jul 2004
Posts: 773
|
|
gunna be a lot of work still to turn that into a db table like we need, but its a good start.
|
 |
|
 |

03-03-2005, 06:24 AM
|
Dragon
|
|
Join Date: Feb 2002
Posts: 583
|
|
Here you go, mostly accurate up to PoP table, also table of racial skills.
http://www.wintersroar.com/files/caps.zip
Function for it here:
Code:
int8 Database::GetSkillCap(int8 skillid, int8 in_class, int16 in_level)
{
int8 skill_level = 0, skill_formula = 0;
int16 base_cap = 0, skill_cap = 0, skill_cap2 = 0, skill_cap3 = 0;
char errbuf[MYSQL_ERRMSG_SIZE];
char *query = 0;
int32 affected_rows = 0;
MYSQL_RES *result;
MYSQL_ROW row;
//Fetch the data from DB.
if (RunQuery(query, MakeAnyLenString(&query, "SELECT level, formula, pre50cap, post50cap, post60cap from skillcaps where skill = %i && class = %i", skillid, in_class), errbuf, &result, &affected_rows))
{
if (affected_rows != 0)
{
row = mysql_fetch_row(result);
skill_level = atoi(row[0]);
skill_formula = atoi(row[1]);
skill_cap = atoi(row[2]);
if (atoi(row[3]) > skill_cap)
skill_cap2 = (atoi(row[3])-skill_cap)/10; //Split the post-50 skill cap into difference between pre-50 cap and post-50 cap / 10 to determine amount of points per level.
skill_cap3 = atoi(row[4]);
}
delete[] query;
mysql_free_result(result);
}
if (skill_cap == 0) //Can't train this skill at all.
return 255; //Untrainable
if (in_level < skill_level)
return 254; //Untrained
//Determine pre-51 level-based cap
if (skill_formula > 0)
base_cap = in_level*skill_formula+skill_formula;
if (base_cap > skill_cap || skill_formula == 0)
base_cap = skill_cap;
//If post 50, add post 50 cap to base cap.
if (in_level > 50 && skill_cap2 > 0)
base_cap += skill_cap2*(in_level-50);
//No cap should ever go above its post50cap
if (skill_cap3 > 0 && base_cap > skill_cap3)
base_cap = skill_cap3;
//Base cap is now the max value at the person's level, return it!
return base_cap;
}
Just assign pp.skills to 254/255 selected from this when a character is created, and 0 to anything that isn't 254 or 255 (asides from the 5 in a melee skill).
Last edited by Wiz; 03-03-2005 at 02:29 PM..
|
 |
|
 |

03-03-2005, 01:09 PM
|
Developer
|
|
Join Date: Jul 2004
Posts: 773
|
|
hey wiz,
I had the code for this, and I looked it over, but I didnt like the way it deals with the higher level skill caps. But since im not the one programming it right now, I guess I cant really voice what I dont like, eh?
|

03-03-2005, 09:16 PM
|
Dragon
|
|
Join Date: Feb 2002
Posts: 583
|
|
Quote:
Originally Posted by fathernitwit
hey wiz,
I had the code for this, and I looked it over, but I didnt like the way it deals with the higher level skill caps. But since im not the one programming it right now, I guess I cant really voice what I dont like, eh?
|
It pretty much deals with them as live does. What's the issue with it exactly?
|
Thread Tools |
|
Display Modes |
Hybrid Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 04:39 PM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |