Modcraft - The community dedicated to quality WoW modding!

Wrath of the Lich King Modding => Serverside Modding => Topic started by: Rimewynd on March 13, 2012, 12:37:11 am

Title: Altering the player_levelstats beyond 255 [SOLVED]
Post by: Rimewynd on March 13, 2012, 12:37:11 am

EDIT: This issue has been solved, and I've since made a tutorial about how to enable this. Please check here for a step-by-step on how I did it:

viewtopic.php?f=61&t=3939 (http://modcraft.io/viewtopic.php?f=61&t=3939" onclick="window.open(this.href);return false;)



ORIGINAL MESSAGE:

Alright, so, I've run into an interesting problem, and I'm hoping someone here might have an idea as to what's causing it. I'm still searching for answers myself, so on the off chance I find anything I'll self-reply and let everyone know.

First. Basic information:

Using Trinity Core.
Custome worldserver.conf, no core mods.
Using Trinity's basic DBs with a few minor edits and mods (just added things to them, mostly GOs),

For the project I'm working on, stats are being rebalanced to different levels across different races and classes.

The upshot of this is that I needed to alter the 'player_levelstats' Database.

These are the stats I was attempting to enter:

Field 0 - Field Type: tinyint(3) - Race: Night Elf (Race 4)
Field 1 - Field Type: tinyint(3) - Class: Priest (Class 5)
Field 2 - Field Type: tinyint(3) - Level: All levels (1-80)
Field 3 - Field Type: tinyint(3) - Strength: 984
Field 4 - Field Type: tinyint(3) - Agility: 1148
Field 5 - Field Type: tinyint(3) - Stamina: 613
Field 6 - Field Type: tinyint(3) - Intellect: 767
Field 7 - Field Type: tinyint(3) - Spirit: 1488

The first speedbump I ran into was that the data-type for fields 3-7 was tinyint(3) . (I noticed this when I logged in and all stats were 255)  So, I ended up changing the fields to smallint(5) types. When next I logged in to my Nelf Priest  I found that my stats looked like this:

Field 3 - Field Type: smallint(5) - Strength: 216
Field 4 - Field Type: smallint(5) - Agility: 124
Field 5 - Field Type: smallint(5) - Stamina: 101
Field 6 - Field Type: smallint(5) - Intellect: 255
Field 7 - Field Type: smallint(5) - Spirit: 208

After poking around in the DBs some, I noticed that all other primary stats in all other DBs were stored as smallint(6). Ah-ha!, I thought, I've found the problem! ...Of course, I hadn't, and after making the change this happened:

Field 3 - Field Type: smallint(6) - Strength: 216
Field 4 - Field Type: smallint(6) - Agility: 124
Field 5 - Field Type: smallint(6) - Stamina: 101
Field 6 - Field Type: smallint(6) - Intellect: 255
Field 7 - Field Type: smallint(6) - Spirit: 208

The stats remained exactly the same. So, I'm wondering if anyone on here even knows why, or perhaps has an inclining of where these numbers are processed through so that that can be altered. If anyone needs any additional information I'll try to supply it. I halfway suspect it's something tiny and simple that I'm overlooking. I'm good for that.  :roll:

Thanks to anyone who answers!
-Rimewynd
Title: Re: Altering the player_levelstats beyond 255 (Help Request
Post by: Rimewynd on March 15, 2012, 12:26:19 am
Okay, so. What it looks like thus far is that it's actually a section in player.cpp. What this section does is (for efficiency, I've not doubt) look for an uint8 in those fields. I haven't entirely worked out how it's calling each field, so my investiagation's continuing. Should I figure this out, I'll post the original and new code I changed.
Title: Re: Altering the player_levelstats beyond 255 (Help Request
Post by: schlumpf on April 15, 2012, 01:35:15 pm
The level is a uint8_t in the client as well. This makes it impossible to extend.
Title: Re: Altering the player_levelstats beyond 255 (Help Request
Post by: Eatos on April 17, 2012, 02:19:07 am
Ok, i see why you are having these problems, first do you know values of each storage.

tinyint = 0..255
smallint  = -32767..32767
numbers in brackets represent how much numbers will be visible in column
in your case you will need
smallint(4)

After that you will need to search where in trinity this table is defined so to edit its column structure, and recompile core and it should work.
Title: Re: Altering the player_levelstats beyond 255 (Help Request
Post by: Rimewynd on April 17, 2012, 05:45:46 am
Thank you both for your comments and thank you Eatos for pointing me on the right track!

It's been a while since I've been around and I've actually since figured it out entirely.  :lol:

To answer, in reverse order:

RE: Eatos

 Eatos, I did know about the storage thing, though I thank you for checking!  ;)

If I'm understanding you correctly, you're talking about the DB side of things, which wasn't the problem ultimately. If not, and you're referring to the core, then under Trinity the change in the core has to go from uint8 to uint16.

RE schlumpf:

I've found that it actually doesn't seem to connect through the client at any point. It might appear in the client but as far as I can tell all the operations seem to be running from Core to DB and then back to Core.

To anyone who's reading:

I've officially found my solution and it works thus far, so the issue could be considered solved. If anyone out there is interested in this I'd be happy to create a short little how-to on the steps I went through to do this.

I might not be around very much for the next couple weeks, but I'll check back as soon as I'm able and post up the solution I came up with for anyone that wants it.

Cheers!
Title: Re: Altering the player_levelstats beyond 255 [SOLVED]
Post by: marx on May 03, 2012, 08:48:53 pm
it would be very helpful if you post little guide...thanks
Title: Re: Altering the player_levelstats beyond 255 [SOLVED]
Post by: liush000 on August 09, 2014, 03:39:17 pm
Please "create a short little how-to on the steps", thank you.
Title: Re: Altering the player_levelstats beyond 255 [SOLVED]
Post by: Rimewynd on September 17, 2014, 08:57:00 pm
Hey liush000.

I actually did a while back. I just (in a fit of stupidity) only PM'd the first person who asked.

The tutorial is here. Probably should go and edit the first post.

viewtopic.php?f=61&t=3939 (http://modcraft.io/viewtopic.php?f=61&t=3939" onclick="window.open(this.href);return false;)

Cheers, and good luck.