You will need to obtain the character ID for the character whose item amount you want to change. You can use the following query to get the character ID from the database.
SELECT CharID FROM _OnlinePlayers WHERE CharName16 = 'character_name'
You will also need to know the target inventory slot of the item you want to modify.
Stored Procedure: _Char_MutateItemDataAt
Parameters:
@CharID INT- Target character ID@Slot TINYINT- Target slot ID@NewData INT- New item amount@ID64 BIGINT- Item ID64
Let us first test whether the command works by using the following code, which will change the amount of the item in a specific inventory slot for a specific character.
USE [vPlus] GO DECLARE @CharID INT = (SELECT CharID FROM _OnlinePlayers WHERE CharName16 = 'character_name') DECLARE @ID64 BIGINT = (SELECT ItemID FROM SRO_VT_SHARD.._Inventory WHERE CharID = @CharID AND Slot = 13) EXEC _Char_MutateItemDataAt @CharID, 13, 100, @ID64;
For real usage, use @CharID directly from your calling procedure.
EXEC _Char_MutateItemDataAt @CharID, 13, 100, @ID64;