Hi guys , I would like to make a scroll however I do not know the procedure . I want when I press the scroll all the wearable items go to the inventory. Would someone help me with this issue.
Slot 0 to 13
WHILE @I <= 12
BEGIN
DECLARE @ItemToMove BIGINT = (SELECT ItemID FROM SRO_VT_SHARD.._Inventory WHERE CharID = @CharID AND Slot = @I)
DECLARE @NewSlot BIGINT = (SELECT TOP 1 Slot FROM _Inventory WHERE CharID = @CharID AND (ItemID = 0 OR ItemID IS NULL) AND Slot >= 13)
IF @NewSlot IS NOT NULL AND @ItemToMove IS NOT NULL
BEGIN
UPDATE SRO_VT_SHARD.._Inventory SET ItemID = 0 WHERE CharID = @CharID AND Slot = @I
UPDATE SRO_VT_SHARD.._Inventory SET ItemID = @ItemToMove WHERE CharID = @CharID AND Slot = @NewSlot
END