Modcraft - The community dedicated to quality WoW modding!
Wrath of the Lich King Modding => Serverside Modding => Topic started by: Смердокрыл on November 28, 2015, 06:37:13 pm
-
Hey!
How can I calculate the needed value of playerBytes in order to change a character in navicat, and not in the client?
-
[deleted]
-
Hey.
This is how i do in PHP :
$b = $row['playerBytes']; // PlayerBytes in Character table
$b2 = $row['playerBytes2']; // PlayerBytes in Character table
// Set Character Features
$ha = ($b>>16)%256; // Hairs
$hc = ($b>>24)%256; // Hairs color
$fa = ($b>>8)%256; // Face
$sk = $b%256; // Skin
$fh = $b2%256; // Facial / Others
Ehm... You overestimate me.
-
Basically, my knowledge of PHP is not even enough for Hello world. Could you explain the mathematical way of calculating it?
Also, if its possible to do this via vb.net, I'll be happy to know
-
in most programming languages and elsewhere (C, C++, java, lua, SQL, ... whatever else) you would use almost exact same code.
I myself wouldnt bother with the maths. instead just look up what %, << and >> operators do. % is modulo (3%2 = 1) and the rest are bit shifting operators.
Everything else is just a bunch of variables.
-
http://phptester.net/ (http://phptester.net/" onclick="window.open(this.href);return false;)
It returns
NOTICE Undefined variable: row on line number 2
NOTICE Undefined variable: row on line number 3
-
[deleted]
-
It just crashes and says This application is free so please don't break it !
Another website (http://sandbox.onlinephpfunctions.com/) says
Parse error: syntax error, unexpected '<' in <>>[...][...] on line 1
Also, is there a backward code? To get the bytes from needed character settings?
-
Try it without the php tags:
$b = 17367552; // PlayerBytes in Character table
$b2 = 33554436; // PlayerBytes2 in Character table
// Set Character Features
$ha = ($b>>16)%256; // Hairs
$hc = ($b>>24)%256; // Hairs color
$fa = ($b>>8)%256; // Face
$sk = $b%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>";
-
Thanks, Kaev, it works! What about a backward conversion?
-
$a= ($z>>24)&0xff;
$b= ($z>>16)&0xff;
$c= ($z>>8)&0xff;
$d= ($z>>0)&0xff;
$z = ($a<<24) | ($b<<16) | ($c<<8) | ($d<<0);
-
$a= ($z>>24)&0xff;
$b= ($z>>16)&0xff;
$c= ($z>>8)&0xff;
$d= ($z>>0)&0xff;
$z = ($a<<24) | ($b<<16) | ($c<<8) | ($d<<0);
Which of these are what? I mean skin color, facial features, etc.
-
Please map the four numbers to the four names yourself. It really isn't hard.
-
Please map the four numbers to the four names yourself. It really isn't hard.
It isnt, but there should be five numbers. Hair, Hair colour, Skin colour, Face and Facial features
-
There is also b and b2.