Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Silkroad Online > SRO Private Server > SRO PServer Guides & Releases
You last visited: Today at 15:44

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

Advertisement



[DEV] Defining New Type Of Expendables | Live Gold Obtaining Scroll

Discussion on [DEV] Defining New Type Of Expendables | Live Gold Obtaining Scroll within the SRO PServer Guides & Releases forum part of the SRO Private Server category.

Reply
 
Old   #1
 
#HB's Avatar
 
elite*gold: 100
Join Date: Sep 2017
Posts: 1,108
Received Thanks: 903
[DEV] Defining New Type Of Expendables | Live Gold Obtaining Scroll

Hey there,

Personally, I've been interested into this topic, since long time ago.

Introduction Video

Expendables, what are expendables? Expendables are the items which are expendable (like hp, mp, global, scrolls, return scrolls...etc)

My main purpose was creating/defining a new type of them, not just a basic gold scroll..

How can we achieve that... One of the easiest things is following the packet sent after using your expendable item, 0x704C | 0xB04C | AGENT_INVENTORY_ITEM_USE.

Following them is an easy thing to do, just a constant search, and some breakpoints and you'd end up there, at the function that handles item usage, 0x00510980.

The function is a part of a well-known class, CGObjPC. It has a single argument, which is the client item usage message/packet | 0x704C.

So, the function should be parsing the packet and doing instructions, so we should find out the structure of the item usage packets.

Here's a correct structure for both client/server packets:
Code:
//Success Example
[C -> S][704C]
18                                                ................ //Inventory Slot
EC 08                                             ................ //TID

[S -> C][B04C]
01                                                ................ //Result (1 = Success | 2 = Fail)
18                                                ................ //Inventory Slot
0F 27                                             ................ //Quantity
EC 08                                             ................ //TID

//Fail Example
[C -> S][704C]
19                                                ................ //Inventory Slot
ED 4E                                             ................ //TID
//(if TID == skin changer scroll's TID)
77 07 00 00                                       ................ //New skin's ObjID
22                                                ................ //New skin's scale


[S -> C][B04C]
02                                                ................ //Result (1 = Success | 2 = Fail)
92 18                                             ................ //ErrorCode
What is TID? TID is a number generated by CashItem & TypeIDs, as the other Muhab before too.

How about error code? Error code is a number which indicates if an error is occurred or not. If error code is 1, then everything is alright and your item will be consumed as an expendable, otherwise then its not ok and your item won't be consumed. Error code is also used indicate the error type and showing a proper message for it. (for example, an error code of skin changer scroll, the code with value 6290 indicates this message "UIIT_MSG_CHAR_SKIN_ERR_ARMOR")

Code:
TID = CashItem + (TypeID1 * 4) + (TypeID2 * 32) + (TypeID3 * 128) + (TypeID4 * 2048)
Usually all expendables have the same packet structure, but the expendables that have extra data like skin changer scroll, it contains the new obj id & scale.

So, now we know the packet structures, we followed the game server parse too. I guess, let's create our fancy scroll before we get deeper,

RefObjCommon:
Code:
1	41798	ITEM_MALL_GOLD_SCROLL	?????	xxx	SN_ITEM_MALL_GOLD_SCROLL	SN_ITEM_MALL_GOLD_SCROLL_TT_DESC	1	0	3	3	13	24	180000	3	0	1	1	1	255	0	1	0	0	1	0	0	0	0	0	0	0	-1	0	-1	0	-1	0	-1	0	-1	0	0	0	0	0	0	0	100	0	0	0	xxx	item\etc\drop_mall_scroll.bsr	item\etc\e090930_super_scroll.ddj	xxx	xxx	21333
RefObjItem:
Code:
21333	1	2	0	0	1	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	666	9000	-1	xxx                                                                                                                              	-1	xxx	-1	xxx	-1	xxx	-1	xxx	-1	xxx	-1	xxx	-1	xxx	-1	xxx	-1	xxx	-1	xxx	-1	xxx	-1	xxx	-1	xxx	-1	xxx	-1	xxx	-1	xxx	-1	xxx	-1	xxx	0	0	0
I followed the change skin scroll TypeID1, TypeID2, TypeID3 and changed TypeID4 to a new custom one.

If you try to use the scroll, also with a packet debugging, the scroll won't be affected if you right click on it, but if you look at your packets log, you'll find something like:
Code:
[C -> S][704C]
0D                                                ................ //Inventory Slot
ED C6                                             ................ //TID

[S -> C][B04C]
02                                                ................ //Result
02                                                ................ //ErrorCode
That's better than I expected TBH, at least the client sends the packet, but the game server refuses it due to the unrecognized TID.

After an hour of following game server's, I found the function that returns the error code and rejects our new expendable! (I am not sure if they're divided as groups by first 2 item type ids or not, but I am good bruh :v)

So, after doing a proper hook with our new item TID exception, finally everything seems to work fine!

Let's do a little last touch, we need to create settings for our fancy scroll!

So, how about customizing a new param too?

If you re-look at RefObjItem line above, I created a new custom param with ID "666", which refers to a "gold reward", and Desc1 contains the amount of gold. Had to parse GS's object data too and check if Param1 contains the gold reward param ID (666) or not.

You can do the check for the whole 20 params if you'd like too. I did it as for the first one only. Sorry, I am lazy.


Client Side: (all files below are a part of this path: Media\server_dep\silkroad\textdata\)

item_grouping.txt:
Code:
보호석	3	3	13	24	SN_ITEM_TOOLTIP_GROUPING_127
textdata_object.txt:
Code:
1	SN_ITEM_TOOLTIP_GROUPING_127	???? (??)	0	0	0	0	0	Gold Scroll	Gold Scroll	0	0	0	0	0	0
1	SN_ITEM_MALL_GOLD_SCROLL								Gold Obtain Scroll
1	SN_ITEM_MALL_GOLD_SCROLL_TT_DESC								This scroll will give you a specific amount of gold.
itemdata_%:
Code:
1	41798	ITEM_MALL_GOLD_SCROLL	?????	xxx	SN_ITEM_MALL_GOLD_SCROLL	SN_ITEM_MALL_GOLD_SCROLL_TT_DESC	1	0	3	3	13	24	180000	3	0	1	1	1	255	0	1	0	0	1	0	0	0	0	0	0	0	-1	0	-1	0	-1	0	-1	0	-1	0	0	0	0	0	0	0	100	0	0	0	xxx	item\etc\drop_mall_scroll.bsr	item\etc\e090930_super_scroll.ddj	xxx	xxx	1	2	0	0	1	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	666	9000	-1	xxx                                                                                                                              	-1	xxx	-1	xxx	-1	xxx	-1	xxx	-1	xxx	-1	xxx	-1	xxx	-1	xxx	-1	xxx	-1	xxx	-1	xxx	-1	xxx	-1	xxx	-1	xxx	-1	xxx	-1	xxx	-1	xxx	-1	xxx	0	0

An extra thing which some people may need/wonder about,
All that research above is to use a very very basic expendable item, like hp or mp... How about something like skin changer scroll, which you click on it, it opens a window to customize your new skin settings and it gets consumed.

At this situation, we'll need to do a client part too. We're basically gonna hook the place where item usage function is called, handle it well like with a new window too, customizing our new data then sending the item usage packet with the main data, slot and TID and your extra ones. (Remember that item usage packet should be encrypted!)
Also handling the packet extra data from the server side. Server side is required in both situations...

Conclusion: This maybe was one of the most interesting things I've worked on. So, hope you guys make a good use of it

Download: Attached below. You may not need the sro_client part, unless you want to add extra data to the usual item usage packet structure.

Note: Any addresses given above were found on VSRO 1.88 game server and sro_client, so they are most likely different on any other version.
Note: Structures found in the files are for VC80 libs, back when strings were 28 bytes.
Note: Always compile on Release!

Special thanks to: florian0
Attached Files
File Type: rar SRO_CLIENT.rar (857.8 KB, 559 views)
File Type: rar GameServer.rar (857.4 KB, 551 views)
#HB is offline  
Thanks
33 Users
Old 06/17/2019, 03:30   #2
 
Mc-Diesel's Avatar
 
elite*gold: 80
Join Date: May 2015
Posts: 374
Received Thanks: 118
Respect
Mc-Diesel is offline  
Old 06/17/2019, 04:49   #3
 
elite*gold: 0
Join Date: Apr 2016
Posts: 289
Received Thanks: 67
What the hell
Gj.
But can you make live update Stats Point / Level?
hoangphan7 is offline  
Old 06/17/2019, 10:25   #4
 
GMKING1050's Avatar
 
elite*gold: 0
Join Date: Dec 2016
Posts: 98
Received Thanks: 14
thx
but you have All Packets of TW Files
GMKING1050 is offline  
Old 06/17/2019, 10:33   #5
 
sonzenbi's Avatar
 
elite*gold: 0
Join Date: Feb 2017
Posts: 188
Received Thanks: 120
I really need this
Thanks very much
sonzenbi is offline  
Old 06/17/2019, 15:22   #6
 
elite*gold: 0
Join Date: Oct 2012
Posts: 145
Received Thanks: 31
amazing!
chipno0p is offline  
Old 06/18/2019, 01:09   #7
 
arg3n7s's Avatar
 
elite*gold: 0
Join Date: Apr 2011
Posts: 53
Received Thanks: 24
Great
arg3n7s is offline  
Old 06/25/2019, 06:17   #8
 
elite*gold: 0
Join Date: Aug 2017
Posts: 121
Received Thanks: 9
I want packet have wimdow save title name for $ or helping anything thanks!!
modyuasty3 is offline  
Old 02/07/2020, 15:13   #9
 
#HB's Avatar
 
elite*gold: 100
Join Date: Sep 2017
Posts: 1,108
Received Thanks: 903
Been a while, but I actually finally needed to use my project in a live actual server.

So, apparently my code wasn't efficient enough which was causing game server to crash randomly on using scrolls. I have re-written game server project code in a better way, it works pretty well right now.

-Edited source in main post.
#HB is offline  
Thanks
2 Users
Old 02/07/2020, 15:45   #10
Trade Restricted

 
elite*gold: LOCKED
Join Date: Feb 2020
Posts: 586
Received Thanks: 174
So clever of you, Thanks for sharing
JoleChow* is offline  
Old 02/07/2020, 18:37   #11
 
elmagico321's Avatar
 
elite*gold: 0
Join Date: Oct 2013
Posts: 663
Received Thanks: 209
Respect for that kinda of work
Well done mate
elmagico321 is offline  
Old 02/07/2020, 22:52   #12


 
Dracula Untold's Avatar
 
elite*gold: 0
Join Date: Feb 2014
Posts: 1,861
Received Thanks: 517
nice nice
Dracula Untold is offline  
Old 02/12/2020, 06:49   #13




 
VORTEX*'s Avatar
 
elite*gold: 1014
Join Date: Apr 2015
Posts: 1,028
Received Thanks: 1,243
@#HB where's the monthly release ?
VORTEX* is offline  
Old 02/15/2020, 06:37   #14




 
VORTEX*'s Avatar
 
elite*gold: 1014
Join Date: Apr 2015
Posts: 1,028
Received Thanks: 1,243
it would be so pretty , thanks for your attention
VORTEX* is offline  
Old 03/02/2020, 00:55   #15
 
gigola123's Avatar
 
elite*gold: 0
Join Date: Jun 2007
Posts: 722
Received Thanks: 390
Hello everyone,

For some people who want to add some other type of scroll, you can use those offsets:
SkillPoint (0x004E4C60)(this, amount, notify)
PHP Code:
void CGObjPC::UpdateSkillPoints(long long amountint notify)
{
    
reinterpret_cast<void(__thiscall*)(CGObjPC*, long longint)>(0x004E4C60)(thisamountnotify);

You can do the same with :
AddExpPoints
PHP Code:
AddExpPoints (0x004E5250)(CGObjPC*, longlongintlong long)
(
thisamountExpamountSpa1a2
In this part amountSp != of Skill point, it's the Skill point Experience
gigola123 is offline  
Thanks
4 Users
Reply


Similar Threads Similar Threads
Need help defining the price of my Huntsman|Night
02/22/2015 - Counter-Strike Trading - 1 Replies
Hello there, I'm pretty new to the knife trading scene and don't really know how much my knife is worth.. It's a Huntsman Night FT which looks way better than the average field tested ones! Imgur can I advertise it as a minimal wear looking? and how many keys do you think can I get for it? I hope someone can help me :)
[HELP]Defining x,y,z positions for portals + Decrypting files with Zero Signals
08/18/2012 - Shaiya Private Server - 1 Replies
Well i've been trying for a while now to define the positions of the 71-74 portals but nothing has worked. When i open a *.svmap with Shaiya Studio it goes blank and when i try to decrypt it with Zero Signal's tool it gives me the following error "This operation expects a parameter in order to complete, see help and documentation for details". :( When i move to them with the commands they exist but when i try using the portals from outside them they simply don't function. If anyone has an...
Defining structure memory with variable size arrays
07/08/2012 - CO2 Programming - 9 Replies
So I had finished the data library (library that's used mostly just for IO with files, not processing/drawing anything) and then when I thought there must be a way to convert a block of memory to a byte array so a quick google turned up Pointers and using However when using the Marshal services to create a byte array or create from a byte array I read you have to use the following for strings/arrays: Obviously you can only use hard coded values for this, but this presents a problem for...
The Expendables
08/10/2010 - Movies & Series - 4 Replies
http://fc07.deviantart.net/fs71/f/2010/093/c/8/The _Expendables_Logo_by_1zomg_a_peanut1.png http://www.expendables-derfilm.de/img/theexpendab les_plakat.jpg The Expendables (IMDB) Dieser Film wird einfach nur spitze ACTION PUR



All times are GMT +1. The time now is 15:46.


Powered by vBulletin®
Copyright ©2000 - 2025, 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 ©2025 elitepvpers All Rights Reserved.