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 11:32

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

Advertisement



[UNTESTED] Auto Move Items from Pet to Storage

Discussion on [UNTESTED] Auto Move Items from Pet to Storage within the SRO PServer Guides & Releases forum part of the SRO Private Server category.

Reply
 
Old   #1
 
Royalblade*'s Avatar
 
elite*gold: 85
Join Date: Feb 2014
Posts: 1,055
Received Thanks: 1,643
[UNTESTED] Auto Move Items from Pet to Storage

Long time since I've released something.

Have fun, this is entirely untested, just wrote it down from scratch more or less in pastebin.

btw update the tables etc for your own usage. This is a basic demonstration on how to do it quickly without much hassle.

Code:
CREATE PROCEDURE _RoyalReducePetPages
@CharID INT = 0,
@MaxSlots INT = 0,
@Charname VARCHAR(32) = ''
AS
 
 
IF @Charname = '' AND @CharID = 0
    BEGIN
        PRINT 'Set a charname OR a charid at least...'
        RETURN;
    END
 
IF @CharID = 0
    SELECT  @CharID = CharID
    FROM    SRO_VT_SHARD_INIT.dbo._Char
    WHERE   CharName16 = @Charname;
   
IF  @Charname IS NULL OR @Charname = ''
    SELECT  @Charname = CharID
    FROM    SRO_VT_SHARD_INIT.dbo._Char
    WHERE   CharID = @CharID;
   
 
DECLARE @Table TABLE
    (
    ID INT IDENTITY(1,1),
    Charname VARCHAR(32),
    Codename VARCHAR(128)
    )
 
INSERT  INTO @Table (Charname, Codename)
SELECT  @Charname, q.CodeName128
FROM    (
        SELECT  *
        FROM    SRO_VT_SHARD_INIT.dbo._invcos back
        join    SRO_VT_SHARD_INIT.dbo._Items IT ON back.ItemID=it.ID64
        join    SRO_VT_SHARD_INIT.dbo._RefObjCommon R ON IT.RefItemID=r.ID
        WHERE   ID64!=0
        AND     back.Slot > @MaxSlots
        )
        AS q
        join    SRO_VT_SHARD_INIT.dbo._Items IT1 ON q.COSID = IT1.Data
        join    SRO_VT_SHARD_INIT.dbo._Inventory I ON IT1.ID64=I.ItemID
        WHERE   i.CharID = @CharID
       
 
DECLARE @MaxIndex INT = 0,
        @Flag INT = 0,
        @Codename VARCHAR(128) = '';
 
SELECT  @MaxIndex = MAX(ID)
FROM    @Table
 
WHILE   @Flag <= @MaxIndex
        BEGIN
       
        SELECT  @Codename = Codename, @Charname = Charname
        FROM    @Table
        WHERE   ID = @Flag
       
        IF      @Codename IS NOT NULL AND @Charname IS NOT NULL
            EXEC    _TransferItem @Codename, @Charname;
       
        SET @Flag += 1;
        END



CREATE Procedure [dbo].[_TransferItem]
@Codename varchar(128),
@Charname varchar(32)
AS

Declare @CharID INT = (Select CharID from SRO_VT_SHARD_INIT.dbo._Char Where CharName16=@Charname)
Declare @JID INT = (SELECT UserJID FROM SRO_VT_SHARD_INIT.dbo._User Where CharID=@CharID),
		@itemID INT;
		
		

			
IF @Codename in -- Check if item exists.
				(Select q.CodeName128 from (
				Select * from SRO_VT_SHARD_INIT.dbo._invcos back
				join SRO_VT_SHARD_INIT.dbo._Items IT on back.ItemID=it.ID64
				join SRO_VT_SHARD_INIT.dbo._RefObjCommon R on IT.RefItemID=r.ID
				where ID64!=0
				)
				as q
				join SRO_VT_SHARD_INIT.dbo._Items IT1 ON q.COSID = IT1.Data
				join SRO_VT_SHARD_INIT.dbo._Inventory I ON IT1.ID64=I.ItemID
				where i.CharID=@CharID)

IF @CharID IN (Select CharID from SRO_VT_ROYAl.dbo._Logins) OR (@JID IS NULL) OR (@Codename IS NULL)
	BEGIN
		RETURN
	END -- Check if Char is Online or JID is null dont do shit.
	
	BEGIN
	
	SET @itemID = (Select TOP 1 q.ItemID from ( -- take first item with that codename
				Select * from SRO_VT_SHARD_INIT.dbo._invcos back
				join SRO_VT_SHARD_INIT.dbo._Items IT on back.ItemID=it.ID64
				join SRO_VT_SHARD_INIT.dbo._RefObjCommon R on IT.RefItemID=r.ID
				where ID64!=0
				)
				as q
				join SRO_VT_SHARD_INIT.dbo._Items IT1 ON q.COSID = IT1.Data
				join SRO_VT_SHARD_INIT.dbo._Inventory I ON IT1.ID64=I.ItemID
				where i.CharID=@CharID AND q.CodeName128 = @Codename)
	
		Declare @FreeSlot INT = (Select TOP 1 Slot FROM SRO_VT_SHARD_INIT.dbo._Chest 
								Where UserJID= @JID AND ItemID = 0							
								ORder by Slot ASC)
		IF @FreeSlot IS NULL OR @itemID IS NULL
		BEGIN
			Return
		END
		
		BEGIN TRANSACTION
		Update SRO_VT_SHARD_INIT.dbo._invcos 
		Set ItemID=0
		Where ItemID=@ItemID
			IF (@@ROWCOUNT=0 OR @@ERROR<>0)
				BEGIN
				ROLLBACK TRANSACTION
				RETURN
				END
		
		UPdate SRO_VT_SHARD_INIT.dbo._Chest
		SET ItemID=@itemID
		WHERE Slot=@FreeSlot AND UserJID = @JID
			IF (@@ROWCOUNT=0 OR @@ERROR<>0)
				BEGIN
				ROLLBACK TRANSACTION
				RETURN
				END
				
				
		COMMIT TRANSACTION
	END
Royalblade* is offline  
Thanks
4 Users
Old 11/16/2017, 22:44   #2
 
elite*gold: 0
Join Date: Jan 2017
Posts: 14
Received Thanks: 1
where is SRO_VT_ROYAl.dbo._Logins ?
JokeR5420 is offline  
Old 11/18/2017, 13:20   #3
 
elite*gold: 0
Join Date: Apr 2016
Posts: 286
Received Thanks: 67
Is this server side only?
Request teleport / relog ?
hoangphan7 is offline  
Old 11/18/2017, 13:38   #4

 
AceSpace's Avatar
 
elite*gold: 71
Join Date: Mar 2011
Posts: 1,594
Received Thanks: 1,099
Quote:
Originally Posted by JokeR5420 View Post
where is SRO_VT_ROYAl.dbo._Logins ?
The table:
Code:
USE SRO_VT_LOG
CREATE TABLE _Logins (
       CharID INT,
       LoggedAt DATETIME
);
Add this in _AddLogChar

Code:
IF @EventID = 4
  INSERT INTO _Logins VALUES (@CharID, GETDATE())

IF @EventID = 6
  DELETE FROM _Logins WHERE CharID = @CharID
Make sure to change the procedure, this should do the work.
AceSpace is offline  
Old 11/19/2017, 18:24   #5
 
elite*gold: 0
Join Date: Nov 2017
Posts: 1
Received Thanks: 7
So its tested but not tested? :s
TotallyNotGoofie. is offline  
Old 11/20/2017, 00:21   #6
 
Royalblade*'s Avatar
 
elite*gold: 85
Join Date: Feb 2014
Posts: 1,055
Received Thanks: 1,643
It SHOULD work but I havent tested it... Useful to some people smtms.
Royalblade* is offline  
Reply


Similar Threads Similar Threads
[B] DE Flyff cs items(wings, pet,set) [S] EN Flyff Cs pet + Items
02/11/2015 - Flyff Trading - 6 Replies
Hey Community, da ich seit neustem nurnoch EN Flyff zocken will ich meine Items von DE Flyff gegen EN Flyff Items tauschen. Was ich habe: Screenshot by Lightshot Screenshot by Lightshot Screenshot by Lightshot Was ich suche: - CS Pet (muss)
metin2 dupe hack [untested]
12/17/2007 - Metin2 - 27 Replies
i found a site for a metin2 dupe hack that sends false info to the servers . but i can not read the site as it is in polish and need someone to help me read this and help me test it. metinhack
[Help] Pet Storage
05/05/2007 - Silkroad Online - 1 Replies
Hey my pet expired a couple of days ago. But I had my SOS blade on it. Is it possible to excess its storage without renewing it? Or am I screwed? Edit: I'm screwed. ~CLOSED~
Skeleton Axe[untested]
06/09/2004 - General Gaming Discussion - 7 Replies
Soho also habs gehört und wie mir scheint stimmt es auch habs jedoch nciht genau nachgeprüft oder so, aber die Axt von den Skeleten welche halt mit Axt kämpfen soll / Ist Buggy. das heißt ihr isses egal was für ne Armor der Gegner anhat. Ziemlich praktisch würd ich sagen wenn die reinhaut wie 0 AR :D. weiß halt nur nicht genau obs stimmt :axe:
Invis durchschießbare Walls [55i, Rest untested]
05/16/2004 - General Gaming Discussion - 0 Replies
Jeder kennt sicher den ein oder anderen PK / Fun - Shard, wo es so einige echt fette Monster gibt. Oder gar Dungeonbosse. Mit diesem kleinen Trick und ein paar wackeren Bogenschützen könnt ihr sie umnieten ohne 1 HP zu verlieren (sofern sie nicht Archerimmun sicher oder teleporten). Man nehme sich ein paar Tiere, ein paar Invis Tränke und baue sich eine Reihe von Tieren in der Nähe des Gegners auf. Gibt man nun den Tieren jeder einen Invis Trank, sind die Viecher zwar Invis, aber die Monster...



All times are GMT +2. The time now is 11:32.


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