Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Silkroad Online > SRO Coding Corner
You last visited: Today at 13:55

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



calculating item % (white stats)

Discussion on calculating item % (white stats) within the SRO Coding Corner forum part of the Silkroad Online category.

Reply
 
Old 08/08/2012, 17:16   #16
 
elite*gold: 60
Join Date: Jan 2010
Posts: 48
Received Thanks: 253
Quote:
Originally Posted by IceAmStiel View Post
Lolz thanks Stratti, I could finally convert the Variance values of the database properly xD
No problem I just figured that out while I was developing my emulator long time ago ^^
Stratti is offline  
Old 08/08/2012, 17:20   #17
 
IceAmStiel's Avatar
 
elite*gold: 0
Join Date: Jul 2011
Posts: 1,058
Received Thanks: 1,118
Quote:
Originally Posted by Stratti View Post
No problem I just figured that out while I was developing my emulator long time ago ^^
Oh well, apparently I just picked a working one by chance, the others aren't exactly %5=0 long, I'll keep on trying to get the "missing" bits then, but the hint was already helping me

It might be not related to this section but either I am totally retarded or there's something weird going on (I tend to the first one).

Code:
DECLARE @val bigint = 450278816;
WHILE ( @val > 0 )
	BEGIN
		PRINT CONVERT(varchar(max),((@val%32)*100)/31)+'%'+CHAR(13)
		SET @val = @val/32
	END
Outputs it almost everytime correctly, BESIDES sometimes in a wrong order of the percentages OR on an EU 2Hands weapon 7 pseud-white stats.
I tried only accessories, misc gear pieces and a light staff out though ^^
IceAmStiel is offline  
Old 08/08/2012, 21:03   #18
 
elite*gold: 60
Join Date: Jan 2010
Posts: 48
Received Thanks: 253
Quote:
Originally Posted by IceAmStiel View Post
Oh well, apparently I just picked a working one by chance, the others aren't exactly %5=0 long, I'll keep on trying to get the "missing" bits then, but the hint was already helping me

It might be not related to this section but either I am totally retarded or there's something weird going on (I tend to the first one).

Code:
DECLARE @val bigint = 450278816;
WHILE ( @val > 0 )
	BEGIN
		PRINT CONVERT(varchar(max),((@val%32)*100)/31)+'%'+CHAR(13)
		SET @val = @val/32
	END
Outputs it almost everytime correctly, BESIDES sometimes in a wrong order of the percentages OR on an EU 2Hands weapon 7 pseud-white stats.
I tried only accessories, misc gear pieces and a light staff out though ^^
The wrong order of the percentages is because the stats are not packed in the same order as they are displayed. If you take a look into SMC then you'll find the correct order of the stats:

Knowing the right order I made a very simple C# application to display the percentages correctly.

NOTE: This application identifies the type of the item by the amount of white stats (7 stats = weapon, 2 = stats accessory, ...) . This is actually a bad choice because equip & shield items both have 6 stats, you should rather identify it by its TypeIds. I was too lazy for that, so my application will display shield stats in the wrong order

Stratti is offline  
Thanks
3 Users
Old 08/08/2012, 21:27   #19
 
elite*gold: 0
Join Date: Nov 2007
Posts: 959
Received Thanks: 602
I feel like it's my time to share something useful about the TypeID stuff..
so this is a little help for determining the item types by their TypeID:
Quote:
TypeID1 --> 3 items group
TypeID2 --> 1 equipable items.


TypeID3 --> 1-3 chinese armor

TypeID3 --> 4 shields

TypeID3 --> 5 chinese jewellery

TypeID3 --> 6 weapons

TypeID3 --> 9-11 european armor

TypeID3 --> 12 european jewellery
have fun with it.
vorosmihaly is offline  
Thanks
3 Users
Old 08/21/2012, 22:26   #20
 
elite*gold: 0
Join Date: Jun 2007
Posts: 79
Received Thanks: 19
What packet will give the data ?


0xB151 OR 0xB150 ?


NVM: My Analyzer failed xD
cyberninjah is offline  
Old 08/22/2012, 10:16   #21
 
lesderid's Avatar
 
elite*gold: 0
Join Date: Dec 2007
Posts: 2,400
Received Thanks: 1,517
Quote:
Originally Posted by Stratti View Post
(...)

Code:
//"<<" means left shift

stats = 0

stats = stats << 5 //This line is actually unnecessary because 0 << 5 is 0
stats = stats + magAbsorp
stats = stats << 5
stats = stats + phyAbsorp

//The result will be 1023, send this value to the client and you'll have a accessory 
//with 100% white stats, no matter if it is a ring, earring or necklace
(...)
I for some reason feel that OR would be 'better' here than ADD (on stats + __Absorp). You're already working with bits.

(I'm talking about readability, not performance. Performance should be (about) equal.)
lesderid is offline  
Thanks
2 Users
Old 08/22/2012, 11:46   #22
 
elite*gold: 0
Join Date: Jun 2007
Posts: 79
Received Thanks: 19
Maybe its not related to this topic more i think it is

I try parse the packet with the stats more i dont know if my parsing job is right anyone can check it for me ? because my values are not equal to the values in game

Code:
[byte] unknown(?? i think its the typeID)
[byte] unknown(??)
[byte] isFailed
[byte] item slot in inventory
[dword] 0 unknown(??)
[dword] itemID
[byte] plus value
[qword] item stats 
[dword] durability
[byte] blues count

Loop
{
[dword] blue ID
[dword] value
}
cyberninjah is offline  
Old 08/22/2012, 13:45   #23
 
elite*gold: 0
Join Date: Feb 2008
Posts: 73
Received Thanks: 18
Quote:
Originally Posted by cyberninjah View Post
Maybe its not related to this topic more i think it is

I try parse the packet with the stats more i dont know if my parsing job is right anyone can check it for me ? because my values are not equal to the values in game

Code:
[byte] unknown(?? i think its the typeID)
[byte] unknown(??)
[byte] isFailed
[byte] item slot in inventory
[dword] 0 unknown(??)
[dword] itemID
[byte] plus value
[qword] item stats 
[dword] durability
[byte] blues count

Loop
{
[dword] blue ID
[dword] value
}
ye thats right, also when isfailed == 0x00
then 1 byte comes wihch will tell if its destroyed or failed.
if its destoryed == 0x01 then the packet ends

also after the blues parse the special item skills (like socket stones) will come

maybe if you post the whole packet and how you would parse it, then i can probably tell you why the values are not equal to the game
pergian is offline  
Old 08/22/2012, 23:54   #24
 
elite*gold: 0
Join Date: Jun 2007
Posts: 79
Received Thanks: 19
Code:
[S -> C][B151]
01                                                ................
02                                                ................
01                                                ................
0D                                                ................
00 00 00 00                                       ................
E3 98 00 00                                       ................
0A                                                ................
00 00 70 C0 04 00 00 00                           ..p.............
96 00 00 00                                       ................
05                                                ................
A3 01 00 00 C8 00 00 00                           ................
A5 01 00 00 64 00 00 00                           ....d...........
A4 01 00 00 3C 00 00 00                           ....<...........
A2 01 00 00 08 00 00 00                           ................
A1 01 00 00 08 00 00 00                           ................
01                                                ................
00                                                ................
02                                                ................
01                                                ................
00                                                ................
7D A3 00 00 04 00 00 00                           }...............
is the full packet more i just got it on the parry stat only it whas 2% more my Tool said it whas 3%

Edit: thats not the packet where i got the parry i lost that one this just one i collected to give you the full packet
cyberninjah is offline  
Old 08/24/2012, 08:28   #25
 
elite*gold: 0
Join Date: Feb 2008
Posts: 73
Received Thanks: 18
Quote:
Originally Posted by cyberninjah View Post
Code:
[S -> C][B151]
01                                                ................
02                                                ................
01                                                ................
0D                                                ................
00 00 00 00                                       ................
E3 98 00 00                                       ................
0A                                                ................
00 00 70 C0 04 00 00 00                           ..p.............
96 00 00 00                                       ................
05                                                ................
A3 01 00 00 C8 00 00 00                           ................
A5 01 00 00 64 00 00 00                           ....d...........
A4 01 00 00 3C 00 00 00                           ....<...........
A2 01 00 00 08 00 00 00                           ................
A1 01 00 00 08 00 00 00                           ................
01                                                ................
00                                                ................
02                                                ................
01                                                ................
00                                                ................
7D A3 00 00 04 00 00 00                           }...............
is the full packet more i just got it on the parry stat only it whas 2% more my Tool said it whas 3%

Edit: thats not the packet where i got the parry i lost that one this just one i collected to give you the full packet
ye this parse looks fine although is this isro ?
since that itemID is an immo stone in isro.

and about the stats i am guessing its a weapon since it has 7 stats

Code:
04 C0 70 00 00  = 10011 00000 00111 00000 00000 00000 00000

so its :
0 * (100/31) = 0% dura
0 * (100/31) = 0% phy rein
0 * (100/31) = 0% mag rein
0 * (100/31) = 0% hit ratio
7 * (100/31) = 22.6% phy dmg
0 * (100/31) = 0% mag dmg
19 * (100/31) = 61.3% crit
are this the right % you are looking for?
pergian is offline  
Thanks
2 Users
Old 08/24/2012, 09:12   #26
 
elite*gold: 0
Join Date: Jun 2007
Posts: 79
Received Thanks: 19
Its not for Isro Just a private server bases on vSRO files.

easier to make a clientless bot there because no hackshield haha

hmm yea that are the right values i have no problems with dura phy and stuff only parry and hitratio are wrong sometimes.
cyberninjah is offline  
Old 08/24/2012, 11:17   #27
 
elite*gold: 0
Join Date: Feb 2008
Posts: 73
Received Thanks: 18
Quote:
Originally Posted by cyberninjah View Post
Its not for Isro Just a private server bases on vSRO files.

easier to make a clientless bot there because no hackshield haha

hmm yea that are the right values i have no problems with dura phy and stuff only parry and hitratio are wrong sometimes.
yes i noticed that too. i think its since joymax made that strange change like
22%>19% of hit ratio, no idea why.
pergian is offline  
Old 08/24/2012, 15:08   #28
 
elite*gold: 0
Join Date: Jun 2007
Posts: 79
Received Thanks: 19
At least the most starts are the right values so i can finally finish my alchemy bot

Thanks for the help =)

The only thing i need right now is to know how i can redirect sro client with C# i found the loader in C# coded for RU sro more i dont understand how he did that redirect stuff
cyberninjah is offline  
Old 09/13/2012, 19:33   #29
 
elite*gold: 0
Join Date: Apr 2009
Posts: 120
Received Thanks: 17
Code:
[S -> C][B151]
01                                                ................
02                                                ................
01                                                ................
0D                                                ................
00 00 00 00                                       ................
61 00 00 00                                       a...............
00                                                ................
12 9C 16 C8 05 00 00 00                           ................
80 00 00 00                                       ................
01                                                ................
46 00 00 00 05 00 00 00                           F...............
01                                                ................
00                                                ................
02                                                ................
00                                                ................
Code:
12 [phy reinforce]
9C [mag reinforce]
16 [attack rate]
C8
05
00
00
00
when i try to calculate the stats % (e.g. the phy reinforce)
[phy rein] 18 * 100 / 31 = 58% which is not correct

so what am I doing wrong ?
supermando is offline  
Old 09/13/2012, 21:04   #30
 
elite*gold: 60
Join Date: Jan 2010
Posts: 48
Received Thanks: 253
Quote:
Originally Posted by supermando View Post
Code:
[S -> C][B151]
01                                                ................
02                                                ................
01                                                ................
0D                                                ................
00 00 00 00                                       ................
61 00 00 00                                       a...............
00                                                ................
12 9C 16 C8 05 00 00 00                           ................
80 00 00 00                                       ................
01                                                ................
46 00 00 00 05 00 00 00                           F...............
01                                                ................
00                                                ................
02                                                ................
00                                                ................
Code:
12 [phy reinforce]
9C [mag reinforce]
16 [attack rate]
C8
05
00
00
00
when i try to calculate the stats % (e.g. the phy reinforce)
[phy rein] 18 * 100 / 31 = 58% which is not correct

so what am I doing wrong ?
Read my post again?
There are 5 bits foreach stat, not 1 byte.
Stratti is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
[Help]Editing Item Stats
12/21/2011 - Cabal Online - 2 Replies
Someone know how to make something like this?: Thor's Screenshots - Xfire Thor's Screenshots - Xfire If you know please share...dont matter if it works on private server or official server!
Changing item stats
01/06/2011 - CO2 Private Server - 3 Replies
Hi all, I got Kimo's source version 5095. I want to change my item stats, I first thought that if i go into the database search for the item and then change it attack,defense etc etc it will change it in game to. So i went to cq_item and then searched for shield changed added some more defense and then saved after that I restarted the server so i want to look for the changes and i see that there are no changes. So my question is what am i doing wrong?
char stats, and item stats
01/27/2010 - Lineage 2 - 6 Replies
hi all today.. on a private server. i made a verry strange exp..... some clannies called me to come to HS to help for pvp as i came there i seen mass pvp arround 30 ppl all hitted 1 person ................ a S dagger items drago set and AS i watched it.... he needed for everyone just 1 or 2 hits beamed arround like hell..
1 to +12 item stats any one?
11/29/2007 - Conquer Online 2 - 3 Replies
:confused: 1 to +12 item stats any one?
Unequip item but still keep its stats
09/28/2006 - World of Warcraft - 7 Replies
1) Get the spider's kiss dagger. 2) Get 2 other weapons. 3) Equip the skd in your main hand. 4) Put one weapon in your off hand. 5) The thrid weapon in your inventory. 6) Switch the main weapon with your off hand (skd should be in your off hand now) 7) Switch your skd with your inventory weapon. Cool You should have the bonus of your skd even though its in your inventory.



All times are GMT +1. The time now is 13:56.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.