Modcraft - The community dedicated to quality WoW modding!

Wrath of the Lich King Modding => Serverside Modding => Topic started by: Alice on February 04, 2015, 02:03:01 pm

Title: [SOLVED] [QUESTION]  To add a class to an existing race
Post by: Alice on February 04, 2015, 02:03:01 pm
Hi everybody.  I was trying to add a class to an existing race. I been reading some tutorials, but for some reason they don´t work.
As far as i know, to add a class, you need to execute a query in Sqlyog. I'll give you an example about what i did to add class hunter to humans:

INSERT INTO `player_levelstats` VALUES ('1', '3', '1', '62', '135', '19', '18', '21');
INSERT INTO `player_levelstats` VALUES ('1', '3', '2', '62', '135', '19', '18', '21');
INSERT INTO `player_levelstats` VALUES ('1', '3', '3', '62', '135', '19', '18', '21');
INSERT INTO `player_levelstats` VALUES ('1', '3', '4', '62', '135', '19', '18', '21');
INSERT INTO `player_levelstats` VALUES ('1', '3', '5', '62', '135', '19', '18', '21');
INSERT INTO `player_levelstats` VALUES ('1', '3', '6', '62', '135', '19', '18', '21');
INSERT INTO `player_levelstats` VALUES ('1', '3', '7', '62', '135', '19', '18', '21');
INSERT INTO `player_levelstats` VALUES ('1', '3', '8', '62', '135', '19', '18', '21');
INSERT INTO `player_levelstats` VALUES ('1', '3', '9', '62', '135', '19', '18', '21');

etc... you have to do this until you get all the levels.

The thing is that when i execute the query i get always some error like this:

1 queries executed, 0 success, 1 errors, 0 warnings

Query: INSERT INTO `player_levelstats` VALUES ('1', '3', '1', '62', '135', '19', '18', '21')

Error Code: 1062
Duplicate entry '1-3-1' for key 'PRIMARY'

And then, when i try to run worldserver, crash at "Loading Player Create Level Stats Data..."  .Which have sense according to the first error.

i also put the proper information in playercreateinfo, i edited CharBaseInfo.dbc and CharStartOutfit.dbc, and i did a patch with those files (the patch works fine)

So, what i'm missing?

Thanks in advance.

PD: I'm using Trinitycore.
Title: Re: [QUESTION]  To add a class to an existing race
Post by: Rangorn on February 04, 2015, 02:30:11 pm
Quote from: "Alice"
Query: INSERT INTO `player_levelstats` VALUES ('1', '3', '1', '62', '135', '19', '18', '21')

Error Code: 1062
Duplicate entry '1-3-1' for key 'PRIMARY'


I think you have two records with the same value  (1-3-1)
They are primary, so you can't do that,

Check your table, order by ASC and check if something is wrong, like doublons etc...
Title: Re: [QUESTION]  To add a class to an existing race
Post by: Amaroth on February 04, 2015, 05:30:28 pm
Queries you copied here are creating human hunter stats for levels 1-9. Error you get says that data for human hunter lvl 1 already does exist. There is nothing to speak about - you already have that class stats there. Btw, adding stats for levels over 1 is just worthless if you want to have them the same as on lvl 1. Whenever serve can't find stats for certain combination of race, class and level, it tryes to use values from the same character of lower lever. That can't be used for lvl 1 - meaning you always need to have lvl 1 base stats, but all higher levels will use level 1 if no other stats are specified.

Error you are getting can mean (nearly for sure) only that you have created another combination of class and race thatn you have inserted into DB. Are you sure you created (only) human hunter and noone else?
Title: Re: [QUESTION]  To add a class to an existing race
Post by: Alice on February 05, 2015, 09:31:03 am
Now that both mention it, I remember having run two equal queries by mistake. Probably that. Thank you both for the help.
My question is now: how to fix that?
Title: Re: [QUESTION]  To add a class to an existing race
Post by: Amaroth on February 05, 2015, 11:42:01 pm
I am nearly sure that you should be able to find in DBErrors.log which combination of class and race has no stat data. If you can't, the best thing which comes to my mind is checking if all combination of races and classes in ChrBaseInfo.dbc do have level 1 stat data in player_levelstats table.You may have deleted/overwritten some blizzlike row by accident.
Title: Re: [QUESTION]  To add a class to an existing race
Post by: Alice on February 07, 2015, 08:40:33 am
I just started all over again, and now try to not do that mistake again. Anyway, i'll check the things you both say. Thanks very much  guys.