Character Stats

EQ2Emulator Development forum.

Moderator: Team Members

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Character Stats

Post by John Adams » Sat May 23, 2009 2:39 pm

Scatman,

I was just browsing the DB and wondering why all new characters seem to have 0 stats at all, and I think I discovered why. During the character create process, one of the calls is "InsertCharacterStats()" in WorldDatabase. However, there's a big, fat TODO in there ;)

So since you're becoming a whiz-bang coder of Emu, I thought I'd challenge you with helping me come up with a solution to this TODO.

Code: Select all

bool WorldDatabase::InsertCharacterStats(int32 character_id){
	//TODO: load defaults from another table
	Query query;
	string create_charstats = string("Insert into character_details (char_id) values(%i)");
	query.RunQuery2(Q_INSERT, create_charstats.c_str(),character_id);
	return true;
}
As you see, right now it appears to just stuff a placeholder char_id into character_details. I believe when the player dings a level to 2, proper stats are then written (but not before then?). I'm also pretty sure when you de-level to 1, like I have done many times, your stats are again set to 0 for some odd reason.

Example 1: /level 5 sets all my stats to 25. Not sure that's right in and of itself, but that's what we'll discuss.

Example 2: /level 1 (back down) sets the stats to 17 - interesting #

Example 3: /level 0 works. WTF???

Anyway, just something else to look into in our spare time - as a diversion ;) If LE is watching, and would rather us not pursue this, speak up! Not sure what your plans were for initial stats.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: Character Stats

Post by John Adams » Sat May 23, 2009 2:41 pm

Hmm, I just noticed, there may be a bug here somewhere. Zcoretri, who is a level 4 char, has 0's throughout his stats as well.

I'm also noticing that bind_zone_id is an enormous number - so apparently a struct changed somewhere.

Image
Retired
Posts: 251
Joined: Sun Oct 26, 2008 10:07 am

Re: Character Stats

Post by Image » Sat May 23, 2009 4:06 pm

what stats are reporting 0? Can you show us some screenshots? I am seeing stats update (resistance, base stats, health, power and regen) update as I level and its staying with me cross zone.

Image
Retired
Posts: 251
Joined: Sun Oct 26, 2008 10:07 am

Re: Character Stats

Post by Image » Sat May 23, 2009 4:45 pm

Ok yeah by default there is no stats set when you initially create a character, as soon as you level and the character saves you should have stats from then on. We need a default table that contains the default values for classes when they are at level 1 :)

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: Character Stats

Post by John Adams » Sat May 23, 2009 7:03 pm

Well, if the World knows what stats to apply doing a /level 1 manually, one would think it could figure it out without a reference table :)

But, I do think a starting_stats table might be a good idea, for customization or whatever.

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Re: Character Stats

Post by LethalEncounter » Mon May 25, 2009 12:22 pm

John Adams wrote:Well, if the World knows what stats to apply doing a /level 1 manually, one would think it could figure it out without a reference table :)

But, I do think a starting_stats table might be a good idea, for customization or whatever.
It really doesn't know which values to give, it just adds some bogus value to your previous value when you level. At one point I'm almost certain the character_details table contained defaults on the fields so that it would automatically start off with some values even if they weren't correct.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: Character Stats

Post by John Adams » Mon May 25, 2009 12:24 pm

Ahh, of course. I can change the character_details to put whatever we think the defaults should be.

Seeing that, I guess it's safe to assume "character stats" are just not fully implemented? I thought they were, because they seemed to track ok when you level up or put on gear. If that's not the case, we can deal with this when the time comes after a few other priorities.

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Re: Character Stats

Post by LethalEncounter » Mon May 25, 2009 12:38 pm

yah like most things they have been halfway implemented :P

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: Character Stats

Post by John Adams » Mon May 25, 2009 12:43 pm

Heh, no worries. It all works, and is amazing ;)

Does anyone know if lists like this are still viable?

Or this: http://www.eq2arcanum.com/static/StartingStats.php (still don't see anything "modern" on there heh)


Googlin' around today to see if I can find an accurate table of starting stats by race/class. Not sure if "class" has anything to do with your stats... but speak up if you got the infos!

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Re: Character Stats

Post by LethalEncounter » Mon May 25, 2009 12:46 pm

I think someone at one point made a list on the forums, but I could be thinking of something else.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: Character Stats

Post by John Adams » Mon May 25, 2009 12:51 pm

Yeah I searched here first ;) but all I saw were questions asking about starting_stats, and links pointing to the same things I just linked above. I still haven't found anything post-Fae, which is weird. Still lookin!


Edit: perhaps this will do? http://eq2vault.ign.com/View.php?view=races.List

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: Character Stats

Post by John Adams » Mon May 25, 2009 12:55 pm

Hmm, along with just "starting stats", I wonder if it should be considered more like, starting_details? Would be it beneficial to make this more than just str, agi, sta, int, and wis? Like, the starting resists, starting coin, other stuff? That may stray from Live a bit - but could offer some customization for race/class combos (thinkin of Zexis here ;))

User avatar
Zcoretri
Team Member
Posts: 1642
Joined: Fri Jul 27, 2007 12:55 pm
Location: SoCal

Re: Character Stats

Post by Zcoretri » Mon May 25, 2009 12:58 pm

[quote="John Adams"]Heh, no worries. It all works, and is amazing ;)


Or this: http://www.eq2arcanum.com/static/StartingStats.php (still don't see anything "modern" on there heh)

Don't think you are going to find anything more modern, as they still use these values I think. That link above seems the best so far, only thing is it's missing the Sarnak and Arasai

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: Character Stats

Post by John Adams » Mon May 25, 2009 1:05 pm

The IGN one seems to have all the races, so I'll play with that one first til someone else tells me it's wrong ;)

Meanwhile, how's this for a `starting_details` table structure?

Code: Select all

CREATE TABLE `starting_details` (
                    `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
                    `race_id` TINYINT(3) UNSIGNED NOT NULL DEFAULT '255',
                    `class_id` TINYINT(3) UNSIGNED NOT NULL DEFAULT '255',
                    `max_hp` INT(10) UNSIGNED NOT NULL DEFAULT '40',
                    `max_power` INT(10) UNSIGNED NOT NULL DEFAULT '45',
                    `max_concentration` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
                    `strength` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '20',
                    `agility` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '20',
                    `stamina` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 2'0',
                    `intelligence` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 2'0',
                    `wisdom` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '20',
                    `heat` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
                    `cold` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
                    `magic` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
                    `mental` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
                    `divine` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
                    `disease` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
                    `poison` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
                    `coin_copper` INT(10) UNSIGNED NOT NULL DEFAULT '0',
                    `coin_silver` INT(10) UNSIGNED NOT NULL DEFAULT '0',
                    `coin_gold` INT(10) UNSIGNED NOT NULL DEFAULT '0',
                    `coin_plat` INT(10) UNSIGNED NOT NULL DEFAULT '0',
                    `status_points` INT(10) UNSIGNED NOT NULL DEFAULT '0',
                    PRIMARY KEY  (`id`),
                    UNIQUE KEY `RaceClassIDX` (`race_id`,`class_id`)
                  ) ENGINE=INNODB

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Re: Character Stats

Post by LethalEncounter » Mon May 25, 2009 1:25 pm

John Adams wrote:The IGN one seems to have all the races, so I'll play with that one first til someone else tells me it's wrong ;)

Meanwhile, how's this for a `starting_details` table structure?

Code: Select all

CREATE TABLE `starting_details` (
                    `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
                    `race_id` TINYINT(3) UNSIGNED NOT NULL DEFAULT '255',
                    `class_id` TINYINT(3) UNSIGNED NOT NULL DEFAULT '255',
                    `max_hp` INT(10) UNSIGNED NOT NULL DEFAULT '40',
                    `max_power` INT(10) UNSIGNED NOT NULL DEFAULT '45',
                    `max_concentration` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
                    `strength` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
                    `agility` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
                    `stamina` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
                    `intelligence` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
                    `wisdom` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
                    `heat` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
                    `cold` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
                    `magic` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
                    `mental` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
                    `divine` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
                    `disease` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
                    `poison` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
                    `coin_copper` INT(10) UNSIGNED NOT NULL DEFAULT '0',
                    `coin_silver` INT(10) UNSIGNED NOT NULL DEFAULT '0',
                    `coin_gold` INT(10) UNSIGNED NOT NULL DEFAULT '0',
                    `coin_plat` INT(10) UNSIGNED NOT NULL DEFAULT '0',
                    `status_points` INT(10) UNSIGNED NOT NULL DEFAULT '0',
                    PRIMARY KEY  (`id`),
                    UNIQUE KEY `RaceClassIDX` (`race_id`,`class_id`)
                  ) ENGINE=INNODB
I would make the defaults something other than 0 so that when someone is populating it they can use a default set if they only want to change one value. Other than that it looks good.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests