I have been asked several times in the past for a script like this and figured I would release it for the community. Its a really easy way to resolve a bad patch situation or various other possible situations where items appear in player possession that should not be in the game based on your desired setup. This will quickly remove an item from Guild WH, Player WH, AH, and character inventory.
Remove By ItemID:
SET NOCOUNT ON;
DECLARE
@ItemID int,
@CharItems int,
@PlayerWH int,
@GuildWH int,
@Auction int
SET @ItemID = '';/* Edit this to contain the ItemID of the Item you wish to remove */
SET @CharItems=0;
SET @PlayerWH=0;
SET @GuildWH=0;
SET @Auction=0;
IF (@ItemID='')
BEGIN
PRINT 'Please provide an ItemID';
END
ELSE IF (@ItemID != '')
BEGIN
DELETE FROM PS_GameData.dbo.CharItems WHERE ItemID = @ItemID;
SELECT @CharItems = @@ROWCOUNT
DELETE FROM PS_GameData.dbo.UserStoredItems WHERE ItemID = @ItemID;
SELECT @PlayerWH = @@ROWCOUNT
DELETE FROM PS_GameData.dbo.GuildStoredItems WHERE ItemID = @ItemID;
SELECT @GuildWH = @@ROWCOUNT
DELETE FROM PS_GameData.dbo.MarketItems WHERE ItemID = @ItemID;
SELECT @Auction = @@ROWCOUNT
/* Delete checks */
IF (@CharItems>0)
BEGIN
PRINT 'Successfully removed '+CONVERT(varchar,@CharItems)+' Item(s) from Character Inventories'
END
ELSE
BEGIN
PRINT 'No Item(s) detected in Character Inventories'
END
IF (@PlayerWH>0)
BEGIN
PRINT 'Successfully removed '+CONVERT(varchar,@PlayerWH)+' Item(s) from Warehouses'
END
ELSE
BEGIN
PRINT 'No Item(s) detected in Player Warehouses'
END
IF (@GuildWH>0)
BEGIN
PRINT 'Successfully removed '+CONVERT(varchar,@GuildWH)+' Item(s) from Guild Warehouses'
END
ELSE
BEGIN
PRINT 'No Item(s) detected in Guild Warehouses'
END
IF (@Auction>0)
BEGIN
PRINT 'Successfully removed '+CONVERT(varchar,@Auction)+' Item(s) from Auction Boards'
END
ELSE
BEGIN
PRINT 'No Item(s) detected in Auction Boards'
END
END
Remove By ItemUID:
SET NOCOUNT ON;
DECLARE
@ItemUID bigint,
@CharItems int,
@PlayerWH int,
@GuildWH int,
@Auction int
SET @ItemUID = '';/* Edit this to contain the ItemUID of the Item you wish to remove */
SET @CharItems=0;
SET @PlayerWH=0;
SET @GuildWH=0;
SET @Auction=0;
IF (@ItemUID='')
BEGIN
PRINT 'Please provide an ItemUID';
END
ELSE IF (@ItemUID != '')
BEGIN
DELETE FROM PS_GameData.dbo.CharItems WHERE ItemUID = @ItemUID;
SELECT @CharItems = @@ROWCOUNT
DELETE FROM PS_GameData.dbo.UserStoredItems WHERE ItemUID = @ItemUID;
SELECT @PlayerWH = @@ROWCOUNT
DELETE FROM PS_GameData.dbo.GuildStoredItems WHERE ItemUID = @ItemUID;
SELECT @GuildWH = @@ROWCOUNT
DELETE FROM PS_GameData.dbo.MarketItems WHERE ItemUID = @ItemUID;
SELECT @Auction = @@ROWCOUNT
/* Delete checks */
IF (@CharItems>0)
BEGIN
PRINT 'Successfully removed '+CONVERT(varchar,@CharItems)+' Item(s) from Character Inventories'
END
ELSE
BEGIN
PRINT 'No Item(s) detected in Character Inventories'
END
IF (@PlayerWH>0)
BEGIN
PRINT 'Successfully removed '+CONVERT(varchar,@PlayerWH)+' Item(s) from Warehouses'
END
ELSE
BEGIN
PRINT 'No Item(s) detected in Player Warehouses'
END
IF (@GuildWH>0)
BEGIN
PRINT 'Successfully removed '+CONVERT(varchar,@GuildWH)+' Item(s) from Guild Warehouses'
END
ELSE
BEGIN
PRINT 'No Item(s) detected in Guild Warehouses'
END
IF (@Auction>0)
BEGIN
PRINT 'Successfully removed '+CONVERT(varchar,@Auction)+' Item(s) from Auction Boards'
END
ELSE
BEGIN
PRINT 'No Item(s) detected in Auction Boards'
END
END
*
UPDATE - Added basic checks to display messages according to the effected rows.
*NOTE I looked for a similar script release and found none, should this have been released in a different form then please close this thread.*