|
You last visited: Today at 08:56
Advertisement
[RELEASE] White Stats Decoder (SQL ONLY)
Discussion on [RELEASE] White Stats Decoder (SQL ONLY) within the SRO PServer Guides & Releases forum part of the SRO Private Server category.
06/06/2021, 21:05
|
#1
|
elite*gold: 56
Join Date: Oct 2013
Posts: 1,165
Received Thanks: 774
|
[RELEASE] White Stats Decoder (SQL ONLY)
Hello Community,
I`ve decided to release my SQL based white stats decoder.
This task has been completed multiple times via php and / or c# but never via SQL (at lease not that I am aware of)
I personally don't have any use cases however maybe you guys have an Idea what this could be used for.
Code:
SET NOCOUNT ON;
DECLARE @Variance BIGINT = 34359738367
, @Type VARCHAR(16) = 'WEAPON'
, @Counter INT = 0;
DECLARE @tmpTable TABLE (ID INT IDENTITY(1, 1), Value INT);
DECLARE @resultTable TABLE (ID INT IDENTITY(1, 1), Description VARCHAR(128), Value INT);
WHILE @Variance > 0
BEGIN
INSERT @tmpTable (Value)
VALUES ((@Variance & 0x1F) * 100 / 31);
SET @Counter = 5;
WHILE @Counter <> 0
BEGIN
SET @Variance = (@Variance - (@Variance & 1)) / 2;
SET @Counter -= 1;
END;
END;
IF @Type = 'WEAPON'
BEGIN
IF (SELECT COUNT(*)FROM @tmpTable) <> 7
BEGIN
PRINT ('INVALID TYPE!');
RETURN;
END;
INSERT @resultTable (Description, Value)
VALUES ('Physitcal Damage', (SELECT Value FROM @tmpTable WHERE ID = 5))
, ('Magical Damage', (SELECT Value FROM @tmpTable WHERE ID = 6))
, ('Durability', (SELECT Value FROM @tmpTable WHERE ID = 1))
, ('Hit Ratio', (SELECT Value FROM @tmpTable WHERE ID = 4))
, ('Critical', (SELECT Value FROM @tmpTable WHERE ID = 7))
, ('Physitcal Reinforce', (SELECT Value FROM @tmpTable WHERE ID = 2))
, ('Magical Reinforce', (SELECT Value FROM @tmpTable WHERE ID = 3));
END;
ELSE IF @Type = 'SHIELD'
BEGIN
IF (SELECT COUNT(*)FROM @tmpTable) <> 6
BEGIN
PRINT ('INVALID TYPE!');
RETURN;
END;
INSERT @resultTable (Description, Value)
VALUES ('Physitcal Defensive', (SELECT Value FROM @tmpTable WHERE ID = 5))
, ('Magical Defensive', (SELECT Value FROM @tmpTable WHERE ID = 6))
, ('Durability', (SELECT Value FROM @tmpTable WHERE ID = 1))
, ('Block Ratio', (SELECT Value FROM @tmpTable WHERE ID = 4))
, ('Physitcal Reinforce', (SELECT Value FROM @tmpTable WHERE ID = 2))
, ('Magical Reinforce', (SELECT Value FROM @tmpTable WHERE ID = 3));
END;
ELSE IF @Type = 'EQUIPMENT'
BEGIN
IF (SELECT COUNT(*)FROM @tmpTable) <> 6
BEGIN
PRINT ('INVALID TYPE!');
RETURN;
END;
INSERT @resultTable (Description, Value)
VALUES ('Physitcal Defensive', (SELECT Value FROM @tmpTable WHERE ID = 4))
, ('Magical Defensive', (SELECT Value FROM @tmpTable WHERE ID = 5))
, ('Durability', (SELECT Value FROM @tmpTable WHERE ID = 1))
, ('Parry Ratio', (SELECT Value FROM @tmpTable WHERE ID = 6))
, ('Physitcal Reinforce', (SELECT Value FROM @tmpTable WHERE ID = 2))
, ('Magical Reinforce', (SELECT Value FROM @tmpTable WHERE ID = 3));
END;
ELSE IF @Type = 'ACCESSORY'
BEGIN
IF (SELECT COUNT(*)FROM @tmpTable) <> 2
BEGIN
PRINT ('INVALID TYPE!');
RETURN;
END;
INSERT @resultTable (Description, Value)
VALUES ('Physitcal Absorption', (SELECT Value FROM @tmpTable WHERE ID = 1))
, ('Magical Absorption', (SELECT Value FROM @tmpTable WHERE ID = 2));
END;
SELECT Description
, Value
FROM @resultTable
ORDER BY ID;
-Syloxx
|
|
|
06/08/2021, 17:38
|
#2
|
elite*gold: 0
Join Date: Apr 2012
Posts: 458
Received Thanks: 297
|
Since no explanation at all was given, I will add it.
Variance is pretty simple, it's an int64 with 7 flags (occupies upto 35 bits), each flag is 5 bit and represents a value from 0 to 31, 0 being 0% and 31 being 100%
This order is for Little-endian.
first 5 bits: Durability (wep, prot, shield) | Phy. Abs. (acc)
second 5 bits: Phy. Reinforcement (eu str wep, ch wep, prot, shield) | Mag. Abs. (acc)
third 5 bits: Mag. Reinforcement (eu int wep, ch wep, prot, shield)
forth 5 bits: Hit Ratio (wep) | Parry Ratio (prot)
fifth 5 bits: Phy. Power (eu str wep, ch wep) | Phy. Def. (prot, shield)
sixth 5 bits: Mag. Power (eu int wep, ch wep) | Mag. Def. (prot, shield)
seventh 5 bits: Critical (eu str wep, ch wep) | Block Ratio (shield)
If you want to set all values to a specific %, take this value 1108378657 and multiply it for any number between 0 and 31.
0 -> 0%
7 -> 22%
13 -> 41%
19 -> 61%
25 -> 80%
31 -> 100%
If you want to set a specific value, then or-it with the flag mask. Example, let's say you want to set 41% stats but for whatever reason you want 61% parry/hit rate. This is the formula (pseudo-code):
(1108378657 * 13) | (19 << (5 * 4))
1108378657 is every flag set to 1 (binary 00001-00001-00001-00001-00001-00001-00001)
* 13 makes everything 41% (binary 01101-01101-01101-01101-01101-01101-01101)
19 is the 61% stat (binary 11101)
5 is the bits length
* 4 is the position for hit rate, which is the 4th 5 bits.
5 * 4 = 20 so it will be rotated 20 bits to the left.
19 << 20 = binary 00000-00000-10011-00000-00000-00000-00000
(1108378657 * 13) | (19 << 20)
01101-01101-01101-01101-01101-01101-01101
00000-00000-10011-00000-00000-00000-00000 OR
--------------------------------------------------------------
01101-01101-11101-01101-01101-01101-01101
And there you have, I hope this explanation serves to people to know how it works.
|
|
|
07/13/2021, 13:05
|
#3
|
elite*gold: 0
Join Date: Jul 2020
Posts: 163
Received Thanks: 15
|
Thank you Syloxx you great 
can you please help us with blue too
|
|
|
07/17/2021, 07:02
|
#4
|
elite*gold: 0
Join Date: Apr 2021
Posts: 3
Received Thanks: 0
|
Can someone tell me what rates White Stats got on official servers ?
How high is the percentage to hit 22% 44% 61% 80% and 100% couldnt find any info on the web.
|
|
|
07/18/2021, 01:01
|
#5
|
elite*gold: 56
Join Date: Oct 2013
Posts: 1,165
Received Thanks: 774
|
Quote:
Originally Posted by kotsh23
Thank you Syloxx you great 
can you please help us with blue too 
|
Value = MagParam / 4294967296 (example 7 STR will return 7)
Magic ID = MagParam % 2147483647 (ID from _RefMagicOpt)
|
|
|
07/24/2021, 11:36
|
#6
|
elite*gold: 0
Join Date: Jul 2020
Posts: 163
Received Thanks: 15
|
Hello Syloxx
i tried
Quote:
DECLARE @MagParam BIGINT = 7301444403647
SELECT FLOOR(@MagParam / 4294967296) as BlueValue , @MagParam % 2147483647 as MagicID
|
but its return magicID not found in my database
|
|
|
07/24/2021, 14:16
|
#7
|
elite*gold: 133
Join Date: Nov 2013
Posts: 454
Received Thanks: 455
|
Thanks @Syloxx I'll mix it with this:
|
|
|
 |
Similar Threads
|
[Release] White stats calculator program ( Can be used with PHP ).
06/25/2016 - SRO PServer Guides & Releases - 16 Replies
Hello,
This is my first release on elitepvpers, I hope you will like it.
So today I'm going to release a small program, made by me.
This program calculates white stats of any item you give it,
take a look on the PHP code and you will understand how simple is to use that.
Most of you use PHP 32 BIT, in PHP 32 BIT you don't have the abilities to do what the program does, PHP 32 BIT can't get high numbers into int variables, so you have to use this program for make it works perfectly.
I...
|
Vb6 Conquer Packet Decoder
12/11/2007 - CO2 Exploits, Hacks & Tools - 42 Replies
This Counts As A Tool Right?
Anyway, Yeah, Heres The Exe, Source Being Posted Shortly.
I hope this helps somone who needs a way to decrypt packets :)
Please Report Any Errors/Mistakes And I'll Be Happy To Correct Them
|
[INT] Config decoder
09/27/2007 - Kal Online - 23 Replies
Copyright by BakaBug =O grad eben fertiggestellt.
Downloadlink: BakaBugs Blog
|
111, 121, 211, 212, 41xL, 41x encoder/decoder
08/04/2007 - Lin2 Exploits, Hacks, Bots, Tools & Macros - 19 Replies
http://dstuff.l2wh.com/
da gibts echt einiges was nützlich is :)
|
All times are GMT +1. The time now is 08:57.
|
|