Jump to content

Character bytes calculation

By Смердокрыл
in Miscellaneous

Recommended Posts

If anyone wants to do this, here's the calculation (also backwards, schlumpf didn't want to explain it) in PHP.

 


$b1 = 17367552; // PlayerBytes in Character table 
$b2 = 33554436; // PlayerBytes2 in Character table
// Set Character Features
$hc = ($b1>>24)%256; // Hairs color
$ha = ($b1>>16)%256; // Hairs
$fa = ($b1>>8)%256; // Face
$sk = $b1%256; // Skin
$fh = $b2%256; // Facial / Others
echo "Hairs : ".$ha."<br>";
echo "Hair Color : ".$hc."<br>";
echo "Face : ".$fa."<br>";
echo "Skin : ".$sk."<br>";
echo "Facial/Other : ".$fh."<br>";
$a= $hc&0xff; // Hairs color
$b= $ha&0xff; // Hairs
$c= $fa&0xff; // Face
$d= $sk&0xff; // Skin
$z =  ($a<<24) | ($b<<16) |  ($c<<8) |  ($d<<0); // PlayerBytes
echo "PlayerBytes: ".$z."<br>";
$pb2 = (256 * ($b2/256));
echo "PlayerBytes2: ".$pb2."<br>";



			
		
Link to comment
Share on other sites

Consider this to be just a test version. It definitely works for getting IDs from bytes, but conversion of IDs to bytes gives quite often different values than alghoritm used in core does. This doesn't mean that bytes produced by my calculator don't give the same results when being again searched for separate IDs - they do. I am just not 100% sure if this will work for client or server without any possible issues.
https://www.dropbox.com/s/cfe7ybs9ha8rbnc/PlayerBytesCalculator.exe?dl=0
src (C#):

        private void BytetoIDbutton_Click(object sender, EventArgs e)
        {
            skinColor.Value = playerBytes.Value % 256;
            faceStyle.Value = ((int)playerBytes.Value >> 8) % 256;
            hairStyle.Value = ((int)playerBytes.Value >> 16) % 256;
            hairColor.Value = ((int)playerBytes.Value >> 24) % 256;
            facialFeature.Value = playerBytes2.Value % 256;
        }

        private void IDtoByteButton_Click(object sender, EventArgs e)
        {
            playerBytes.Value = skinColor.Value + ((int)faceStyle.Value << 8) + ((int)hairStyle.Value << 16) + ((int)hairColor.Value << 24);
            playerBytes2.Value = facialFeature.Value + 33554432;
        }

EDIT: Now, seriously, for example, why the hell are all values for playerBytes2 33554432(256^3 * 2) and higher, while they all could be just = facialFeature ID. WHY?!

English YT tutorial channel. Check it out if you preffer videos over walls of text.:
https://www.youtube.com/AmarothEng

I am now completely retired from modding. I am still reading PMs and reacting to them, however, I am not keeping up to date with what is going on in the community and my ability to help you is becoming very limited - I no longer remember some things, I don't have tools installed anymore, and I don't know what is up to date nowadays.

Link to comment
Share on other sites

English YT tutorial channel. Check it out if you preffer videos over walls of text.:
https://www.youtube.com/AmarothEng

I am now completely retired from modding. I am still reading PMs and reacting to them, however, I am not keeping up to date with what is going on in the community and my ability to help you is becoming very limited - I no longer remember some things, I don't have tools installed anymore, and I don't know what is up to date nowadays.

Link to comment
Share on other sites

2 hours ago, Amaroth said:

Back in the alpha the player bytes 2 used to be the player flags (was a byte instead of int32 before beta), facial hair, bank slot amount and a padding byte. The structure was changed to store the character appearance when the beta was released.

So to me it looks like they just ignored the original use of this field and just incremented the base instead of rewriting the whole structure properly? Maybe for legacy reasons from alpha to beta then never changed it?

Link to comment
Share on other sites

Anyway, just let me know if what I made works for you.

English YT tutorial channel. Check it out if you preffer videos over walls of text.:
https://www.youtube.com/AmarothEng

I am now completely retired from modding. I am still reading PMs and reacting to them, however, I am not keeping up to date with what is going on in the community and my ability to help you is becoming very limited - I no longer remember some things, I don't have tools installed anymore, and I don't know what is up to date nowadays.

Link to comment
Share on other sites

3 minutes ago, Смердокрыл said:

It works, but when I try to set an npc skin (e.g. Wildhammer dwarf), he has a different face than if I put that skin in WMV

Oh, no, turns out it was my fucked-up CharSections.dbc. Fixed now.

So, it works perfectly, thanks! It could be a very useful tool (e.g. npc skins for *special* players, etc.), so I'd release it if I was you.

or not


 skarnnoggitlogpost.thumb.jpg.d752b4e8541

Link to comment
Share on other sites

OK, released, I don't find this particulary usefull and I am from RP server, but hey, someone might like to use this.

English YT tutorial channel. Check it out if you preffer videos over walls of text.:
https://www.youtube.com/AmarothEng

I am now completely retired from modding. I am still reading PMs and reacting to them, however, I am not keeping up to date with what is going on in the community and my ability to help you is becoming very limited - I no longer remember some things, I don't have tools installed anymore, and I don't know what is up to date nowadays.

Link to comment
Share on other sites

7 hours ago, Amaroth said:

OK, released, I don't find this particulary usefull and I am from RP server, but hey, someone might like to use this.

I am from an RP server as well. For example, I used this tool to make a dwarf have the wildhammer skin. Can also be used for mag'nar orcs, etc.

or not


 skarnnoggitlogpost.thumb.jpg.d752b4e8541

Link to comment
Share on other sites

Wait, wait, wait... Which dwarf. Player character? Is that possible? I didn't even expect this :D. Great news indeed.

English YT tutorial channel. Check it out if you preffer videos over walls of text.:
https://www.youtube.com/AmarothEng

I am now completely retired from modding. I am still reading PMs and reacting to them, however, I am not keeping up to date with what is going on in the community and my ability to help you is becoming very limited - I no longer remember some things, I don't have tools installed anymore, and I don't know what is up to date nowadays.

Link to comment
Share on other sites

18 minutes ago, Amaroth said:

Wait, wait, wait... Which dwarf. Player character? Is that possible? I didn't even expect this :D. Great news indeed.

Many races have such skins. E.g. wildhammer dwarfs, stone dwarfs, blackrock dwarfs, human and gnome Twilight Hammer cultists, mag'nar and dragonmaw orks, forest/ice trolls, and some more.

My dwarf (the outfit is included in the skin, so he's basically naked)TLhw3V-_hNg.jpg

or not


 skarnnoggitlogpost.thumb.jpg.d752b4e8541

Link to comment
Share on other sites

I know that very well. I just didn't know that its so easy to get it on player character.

English YT tutorial channel. Check it out if you preffer videos over walls of text.:
https://www.youtube.com/AmarothEng

I am now completely retired from modding. I am still reading PMs and reacting to them, however, I am not keeping up to date with what is going on in the community and my ability to help you is becoming very limited - I no longer remember some things, I don't have tools installed anymore, and I don't know what is up to date nowadays.

Link to comment
Share on other sites

  • 2 weeks later...

Hey!

I want to add the eredar skins for players to use (not select them freely, but through the same method as I used for wildhammer dwarves), so I placed the texture in Characters/Draenei/Male and added following line to CharSections.dbc:

eredarskin.thumb.JPG.47cfd1aa66cbd116b6b

And it works perfectly in WMV:

Spoiler

j17MZuWEmMs.jpg

But ingame I get this:

Spoiler

b1v3OLO3CRo.jpg

 

What's wrong?

or not


 skarnnoggitlogpost.thumb.jpg.d752b4e8541

Link to comment
Share on other sites

But I now have another problem: the skin works perfectly when I log on this char, but if I run another wow client and log on another char there (different accounts, obviously), this char appears to have default skin:

Spoiler

 

When you log on the eredar char:

WoWScrnShot_062216_192126.thumb.jpg.7845

When a different char looks at him:

WoWScrnShot_062216_192133.thumb.jpg.16f7

 

 

or not


 skarnnoggitlogpost.thumb.jpg.d752b4e8541

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...
×
×
  • Create New...