This is a read only copy without any forum functionality of the old Modcraft forum.
If there is anything that you would like to have removed, message me on Discord via Kaev#5208.
Big thanks to Alastor for making this copy!

Menu

Author Topic: [SOLVED] [QUESTION]  To add a class to an existing race  (Read 1526 times)

Alice

  • Registred Member
  • Race Changer
  • *****
  • Posts: 28
    • View Profile
[SOLVED] [QUESTION]  To add a class to an existing race
« 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.
« Last Edit: February 07, 2015, 08:41:11 am by Admin »

Rangorn

  • Contributors
  • Model Change Addict
  • *****
  • Posts: 291
    • View Profile
Re: [QUESTION]  To add a class to an existing race
« Reply #1 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...
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Amaroth

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 1219
    • View Profile
    • Amaroth's Tools
Re: [QUESTION]  To add a class to an existing race
« Reply #2 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?
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
English YT tutorial channel. Check it out if you preffer videos over walls of text.:
https://www.youtube.com/AmarothEng

Want to support me for my releases and/or tutorials? You can send donation via Paypal to:
jantoms@seznam.cz

Alice

  • Registred Member
  • Race Changer
  • *****
  • Posts: 28
    • View Profile
Re: [QUESTION]  To add a class to an existing race
« Reply #3 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?
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Amaroth

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 1219
    • View Profile
    • Amaroth's Tools
Re: [QUESTION]  To add a class to an existing race
« Reply #4 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.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
English YT tutorial channel. Check it out if you preffer videos over walls of text.:
https://www.youtube.com/AmarothEng

Want to support me for my releases and/or tutorials? You can send donation via Paypal to:
jantoms@seznam.cz

Alice

  • Registred Member
  • Race Changer
  • *****
  • Posts: 28
    • View Profile
Re: [QUESTION]  To add a class to an existing race
« Reply #5 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.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »