[Help] check if scroll used packet

06/08/2018 14:50 memoxl#1
hello guys,
i searching for a way to check if a specific scroll was used to do an action, i was trying to do it through 0x704c packet but it couldnt help since it only retrieve slot and itemtype

so is there any specific packet i can use to do an action based on this specific scroll been used ?

Thanks in advance
06/09/2018 13:58 InPanic Kev#2
so where is the problem if u know the slot ?
USE SRO_VT_SHARD

DECLARE @[Only registered and activated users can see links. Click Here To Register...]D int , @[Only registered and activated users can see links. Click Here To Register...] smallint

SET @[Only registered and activated users can see links. Click Here To Register...] = 13
SET @[Only registered and activated users can see links. Click Here To Register...]D = (select CharID from _Char where CharName16 = '<GET CHARNAME FROM FILTER>')

SELECT RefItemID FROM _Inventory as inv
join _Items as i on i.ID64 = inv.ItemID
where Slot = @[Only registered and activated users can see links. Click Here To Register...] and CharID = @[Only registered and activated users can see links. Click Here To Register...]D
06/11/2018 16:30 memoxl#3
Quote:
Originally Posted by InPanic Kev View Post
so where is the problem if u know the slot ?
USE SRO_VT_SHARD

DECLARE @[Only registered and activated users can see links. Click Here To Register...]D int , @[Only registered and activated users can see links. Click Here To Register...] smallint

SET @[Only registered and activated users can see links. Click Here To Register...] = 13
SET @[Only registered and activated users can see links. Click Here To Register...]D = (select CharID from _Char where CharName16 = '<GET CHARNAME FROM FILTER>')

SELECT RefItemID FROM _Inventory as inv
join _Items as i on i.ID64 = inv.ItemID
where Slot = @[Only registered and activated users can see links. Click Here To Register...] and CharID = @[Only registered and activated users can see links. Click Here To Register...]D
Thank you bro for your reply, but iam talking about the packet used to do an action based on the scroll used, not about the slot of the scroll in inventory
06/12/2018 04:58 #HB#4
Well, you can do any action using that very easily if I really got it!

Code:
byte slot = _pck.ReadUInt8();
int ReadItemID = 0;
SqlDataReader reader1 = new SqlCommand("Select top 1 RefItemID from [SRO_VT_SHARD].[dbo].[_Items] where ID64 in (select top 1 ItemID from [SRO_VT_SHARD].[dbo].[_Inventory] where Slot = '" + slot + "' and CharID in (select CharID from [SRO_VT_SHARD].[dbo].[_Char] where CharName16 = '" + this.charname + "'))", sqlCon.con).ExecuteReader();

if (reader1.Read())
{
   ReadItemID = Convert.ToInt32(reader1["RefItemID"]);
}

if (ReadItemID != 0)
{
   // conditions here now!
}
06/12/2018 08:52 InPanic Kev#5
Quote:
Originally Posted by memoxl View Post
Thank you bro for your reply, but iam talking about the packet used to do an action based on the scroll used, not about the slot of the scroll in inventory
You can use the slot to find out which item was used to perform an action afterwards.

But better use the S -> C opcode : 0xB04C

Maybe you can tell us what you are planning, then we can help you more easily.
06/13/2018 11:16 memoxl#6
Quote:
Originally Posted by #HB View Post
Well, you can do any action using that very easily if I really got it!

Code:
byte slot = _pck.ReadUInt8();
int ReadItemID = 0;
SqlDataReader reader1 = new SqlCommand("Select top 1 RefItemID from [SRO_VT_SHARD].[dbo].[_Items] where ID64 in (select top 1 ItemID from [SRO_VT_SHARD].[dbo].[_Inventory] where Slot = '" + slot + "' and CharID in (select CharID from [SRO_VT_SHARD].[dbo].[_Char] where CharName16 = '" + this.charname + "'))", sqlCon.con).ExecuteReader();

if (reader1.Read())
{
   ReadItemID = Convert.ToInt32(reader1["RefItemID"]);
}

if (ReadItemID != 0)
{
   // conditions here now!
}
Thank you so much bro for your help:handsdown: , but i think this will return always the refitemid of slot 13 ... what if the scroll is in any other slot ? what if there is more than 1 scroll in the inventory

Quote:
Originally Posted by InPanic Kev View Post
You can use the slot to find out which item was used to perform an action afterwards.

But better use the S -> C opcode : 0xB04C

Maybe you can tell us what you are planning, then we can help you more easily.
i was planning to create a scroll and wanted to put some obstacles to prevent the scroll from running if those obstacle were true
so i wanted to define if the scroll used was scroll i have created not other one
06/17/2018 13:46 #HB#7
Quote:
Originally Posted by memoxl View Post
but i think this will return always the refitemid of slot 13 ... what if the scroll is in any other slot ? what if there is more than 1 scroll in the inventory
You look beginner...

The slot will return its slot. If it was in the first slot it will return 13, because packet's Int8 is 13. Every packet has properties, writings and readings.. you can write a variable in a packet, you can read it!

Most of packets are already written in sro_client and the sro_client just sends it to the server with information, so what we're doing now is reading the packets information and using it in our own!

So, if you read what I've written above, you'll understand that (CLIENT_PLAYER_HANDLE) packet is sent every time you use an item, and it's always sent with Int8 (its slot), so you can always read the Int8 which refers to the slot of the used item.