First Its Little System I Think Some People Like IT
| Gallery | |
|
|
|
How It Work
Its Working with Sell/Buy Item From Shop The Operation System Execute It
So You Need First To Collect The items you Want to put it inside this Timer on
Npc Just Use This Table To Put Items ID/CodeName So When the player Buy Any item from you inserted his ID in the Table The System Start To Save This item inside our Sec Table With Datetime So After The Limited Time Finished Te System check if DateTime < -5 Day Will Remove it
table insert all of info about item and buyer too
Notice
You Should Edit The Notice Exec To Work on Your filter Table
How To get it
PHP Code:
SELECT ID,CodeName128 FROM SRO_VT_SHARD.._RefObjCommon WHERE CodeName128 LIKE '%YOURiTEMS CODE%'
After This Step You Should Create This Table To put Result Inside IT
Code:
USE YourDatabaseName GO /****** Object: Table [dbo].[Temp_itemID] #Mohamed_Montaser Script Date: 10/14/2023 11:32:34 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[Temp_itemID]( [ID] [int] IDENTITY(1,1) NOT NULL, [ItemID] [int] NOT NULL, [CodeName] [varchar](max) NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO
Code:
USE YourDatabaseName GO /****** Object: Table [dbo].[_Temporary_items] #Mohamed_Montaser Script Date: 10/14/2023 11:31:18 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[_Temporary_items]( [ID] [int] IDENTITY(1,1) NOT NULL, [CharName] [varchar](30) NOT NULL, [CharID] [int] NOT NULL, [UserJid] [int] NOT NULL, [ID64] [int] NOT NULL, [ItemID] [int] NOT NULL, [ItemSerial] [bigint] NOT NULL, [ItemCodeName] [varchar](max) NOT NULL, [ShopCodeName] [varchar](max) NULL, [Timer] [datetime] NOT NULL, [Stats] [varchar](50) NOT NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO
Code:
---- RECORD TEMPORARY ITEMS #mohamed_montaser
IF (@Operation in (32,35))
DECLARE @TimerWeapon INT = -5 -- Time Down to remove items per days
BEGIN
IF (@ItemRefID IN (SELECT ItemID from TOOL_SYSTEM..Temp_itemID))
BEGIN
---//////
DECLARE @CharNameTemp varchar (35), @ID64Temp INT , @itemCodeNameTemp varchar (Max) ,@NPCTEMP VARCHAR (MAX), @UserTemp INT,@CharNameTempMsg Varchar (35)
SET @CharNameTemp = (SELECT CharName16 FROM SRO_VT_SHARD.._Char WHERE CharID = @CharID )
SET @ID64Temp = (SELECT ID64 FROM SRO_VT_SHARD.._Items WHERE Serial64 = @ItemSerial )
SET @itemCodeNameTemp = ( SELECT CodeName128 From SRO_VT_SHARD.._RefObjCommon where ID = @ItemRefID)
SET @NPCTEMP = (SELECT RefTabCodeName FROM SRO_VT_SHARD.._RefShopGoods WHERE RefPackageItemCodeName = 'PACKAGE_' +@itemCodeNameTemp)
SET @UserTemp = ( SELECT UserJID FROM SRO_VT_SHARD.._User WHERE CharID = @CharID )
SET @CharNameTempMsg = (SELECT CharName16 FROM SRO_VT_SHARD.._Char WHERE CharID = @CharID )
--DECLARE @MgsDetalis VARCHAR (MAX) = 'Hello Dear ['+@CharNameTemp+'] YOUR CharID Is ['+CONVERT (VARCHAR,@CharID)+'] ITEM ID64 IS ['+CONVERT (VARCHAR,@ID64Temp)+'] And Item Serial is ['+CONVERT (VARCHAR,@ItemSerial)+'] AND ItemID is ['+CONVERT (VARCHAR,@ItemRefID)+'] And Item CodeName Is ['+@itemCodeNameTemp+'] The Time is '+ CONVERT(VARCHAR, GETDATE(), 120)
--INSERT INTO ZOLA_VT_FILTER.._AutoNotice VALUES (@MgsDetalis,@CharNameTemp,0,GETDATE())
INSERT INTO TOOL_SYSTEM.._Temporary_items VALUES (@CharNameTemp,@CharID,@UserTemp,@ID64Temp,@ItemRefID,@ItemSerial,@itemCodeNameTemp,@NPCTEMP,GETDATE(),'ADDED')
END
-- Check if items need to be removed based on the timer
IF (SELECT COUNT(*) FROM TOOL_SYSTEM.._Temporary_items WHERE Timer < DATEADD(DAY, @TimerWeapon, GETDATE())) > 0
BEGIN
UPDATE inv -- remove from inventory
SET inv.ItemID = 0
FROM SRO_VT_SHARD.._Inventory AS inv
INNER JOIN SRO_VT_SHARD.._Items AS itm ON inv.ItemID = itm.ID64
INNER JOIN TOOL_SYSTEM.._Temporary_items AS temp ON itm.Serial64 = temp.ItemSerial
WHERE temp.Timer < DATEADD(DAY, @TimerWeapon, GETDATE());
UPDATE Chest ---- remove from Storage
SET Chest.ItemID = 0
FROM SRO_VT_SHARD.._Chest AS Chest
INNER JOIN SRO_VT_SHARD.._Items AS I ON Chest.ItemID = I.ID64
INNER JOIN TOOL_SYSTEM.._Temporary_items AS temp ON i.Serial64 = temp.ItemSerial
WHERE temp.Timer < DATEADD(DAY, @TimerWeapon, GETDATE());
UPDATE PET -- remove from pet
SET PET.ItemID = 0
FROM SRO_VT_SHARD.._InvCOS AS PET
INNER JOIN SRO_VT_SHARD.._Items AS I ON PET.ItemID = I.ID64
INNER JOIN TOOL_SYSTEM.._Temporary_items AS temp ON i.Serial64 = temp.ItemSerial
WHERE temp.Timer < DATEADD(DAY, @TimerWeapon, GETDATE());
UPDATE G
SET G.ItemID = 0 -- remove from storage guild
FROM SRO_VT_SHARD.._GuildChest AS G
INNER JOIN SRO_VT_SHARD.._Items AS I ON G.ItemID = I.ID64
INNER JOIN TOOL_SYSTEM.._Temporary_items AS temp ON i.Serial64 = temp.ItemSerial
WHERE temp.Timer < DATEADD(DAY, @TimerWeapon, GETDATE());
UPDATE temp
SET temp.Stats = 'DELETED'
FROM TOOL_SYSTEM.._Temporary_items AS temp
INNER JOIN SRO_VT_SHARD.._Items AS itm ON temp.ItemSerial = itm.Serial64
WHERE temp.Timer < DATEADD(DAY, @TimerWeapon, GETDATE());
END
END
Then Done! Enjoy#
Notice
1- its Simple Code You Can Handle it as You Want Like you can use Filter to handle it if had Trigger on_buy_sell
to let Player Buy from this shop one time only with HWID
2- You Can Use It As Gift Item like you Can Get Copy Of ur real items With little Damge And stats inside this shop for new player with 1 day only with table register Buyer player Then if they try to buy Again Item Will Add With date - 10 Day then it will disappear automatically this can let player buy item one time only :D
3- You Can use It Too in Pvp Servers with items FB Max Plus in game
4- You can Adjust it with alot of many ways then just enjoy and put Thanks :D
Sorry For my english Too :)