Смердокрыл Posted June 3, 2016 Share Posted June 3, 2016 Hey! Could anyone make a tool, or just a simple script, that would allow you to input any skin, face, etc. like here: And then calculate playerBytes and playerBytes2 for the "characters" sql table. The calculation itself is described here, I think, but I don't understand anything in php. or not Link to comment Share on other sites More sharing options...
Kaev Posted June 4, 2016 Share Posted June 4, 2016 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 More sharing options...
Amaroth Posted June 4, 2016 Share Posted June 4, 2016 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 More sharing options...
wungasaurus Posted June 4, 2016 Share Posted June 4, 2016 Because there is obviously more in it that that one field? Link to comment Share on other sites More sharing options...
Amaroth Posted June 4, 2016 Share Posted June 4, 2016 https://trinitycore.atlassian.net/wiki/pages/viewpage.action?pageId=2129969#characters(table)-playerBytes2 I wish I knew what. 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 More sharing options...
barncastle Posted June 4, 2016 Share Posted June 4, 2016 2 hours ago, Amaroth said: https://trinitycore.atlassian.net/wiki/pages/viewpage.action?pageId=2129969#characters(table)-playerBytes2 I wish I knew what. 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 More sharing options...
Amaroth Posted June 4, 2016 Share Posted June 4, 2016 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 More sharing options...
Смердокрыл Posted June 4, 2016 Author Share Posted June 4, 2016 5 hours ago, Amaroth said: Anyway, just let me know if what I made works for you. 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 or not Link to comment Share on other sites More sharing options...
Смердокрыл Posted June 4, 2016 Author Share Posted June 4, 2016 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 Link to comment Share on other sites More sharing options...
Amaroth Posted June 5, 2016 Share Posted June 5, 2016 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 More sharing options...
Смердокрыл Posted June 5, 2016 Author Share Posted June 5, 2016 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 Link to comment Share on other sites More sharing options...
Amaroth Posted June 5, 2016 Share Posted June 5, 2016 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 More sharing options...
Смердокрыл Posted June 5, 2016 Author Share Posted June 5, 2016 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) or not Link to comment Share on other sites More sharing options...
Amaroth Posted June 5, 2016 Share Posted June 5, 2016 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 More sharing options...
Смердокрыл Posted June 15, 2016 Author Share Posted June 15, 2016 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: And it works perfectly in WMV: Spoiler But ingame I get this: Spoiler What's wrong? or not Link to comment Share on other sites More sharing options...
Смердокрыл Posted June 16, 2016 Author Share Posted June 16, 2016 Anyone? or not Link to comment Share on other sites More sharing options...
Смердокрыл Posted June 17, 2016 Author Share Posted June 17, 2016 Nvm, fixed. Turns out I had to make the entry in CharSections.dbc to have 8 (npc skin) in the 8th column, else the game looks for separate face textures. or not Link to comment Share on other sites More sharing options...
Смердокрыл Posted June 22, 2016 Author Share Posted June 22, 2016 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: When a different char looks at him: or not Link to comment Share on other sites More sharing options...
Смердокрыл Posted August 11, 2016 Author Share Posted August 11, 2016 Anyone? or not Link to comment Share on other sites More sharing options...
Смердокрыл Posted September 18, 2016 Author Share Posted September 18, 2016 ... Anyone? or not Link to comment Share on other sites More sharing options...
Character bytes calculation
By Смердокрылin Miscellaneous
Recommended Posts