|
You last visited: Today at 15:42
Advertisement
[RELEASE] Item Removal From Multiple Tables
Discussion on [RELEASE] Item Removal From Multiple Tables within the Shaiya PServer Guides & Releases forum part of the Shaiya Private Server category.
03/02/2013, 05:58
|
#1
|
elite*gold: 0
Join Date: Oct 2009
Posts: 56
Received Thanks: 501
|
[RELEASE] Item Removal From Multiple Tables
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.*
|
|
|
03/02/2013, 18:43
|
#2
|
elite*gold: 0
Join Date: Oct 2005
Posts: 184
Received Thanks: 85
|
good script but you should also remove from auction board its a common place to forget
|
|
|
03/07/2013, 12:47
|
#3
|
elite*gold: 0
Join Date: Nov 2012
Posts: 352
Received Thanks: 150
|
i have to be stupid. but i place it here anyway..
i run this and it comes up with Please provide an ItemID
or that itemuid if i placve that there.. i place the itemuid in xxxxxx
SET @ItemID = 'xxxxxx';/* Edit this to contain the ItemID of the Item you wish to remove */
still i have the item in the database charitems and so on. what do i realy do wrong?
|
|
|
03/09/2013, 23:38
|
#4
|
elite*gold: 0
Join Date: May 2010
Posts: 20
Received Thanks: 1
|
restart the server?
|
|
|
03/09/2013, 23:59
|
#5
|
elite*gold: 0
Join Date: Nov 2012
Posts: 352
Received Thanks: 150
|
yes but should still not be in the db when you look for it? in the game yes but not in the db?
|
|
|
03/10/2013, 01:51
|
#6
|
elite*gold: 0
Join Date: Oct 2009
Posts: 56
Received Thanks: 501
|
Quote:
Originally Posted by GMCronus
i have to be stupid. but i place it here anyway..
i run this and it comes up with Please provide an ItemID
or that itemuid if i placve that there.. i place the itemuid in xxxxxx
SET @ItemID = 'xxxxxx';/* Edit this to contain the ItemID of the Item you wish to remove */
still i have the item in the database charitems and so on. what do i realy do wrong?
|
When running this, use ItemID and not the ItemUID. If you want to remove a specific ItemUID then this is not the script you want. This removes a specific ItemID(like Etains "100001") from everyone. To make this work for UID's just add a "U" to all ItemID and change the int to bigint like below.
DECLARE @ItemUID bigint
SET @ItemUID = '';/* Edit this to contain the ItemUID of the Item you wish to remove */
IF(@ItemUID='')
BEGIN
PRINT 'Please provide an ItemUID';
END
ELSE IF (@ItemUID != '')
BEGIN
DELETE FROM PS_GameData.dbo.CharItems WHERE ItemUID = @ItemUID;
DELETE FROM PS_GameData.dbo.UserStoredItems WHERE ItemUID = @ItemUID;
DELETE FROM PS_GameData.dbo.GuildStoredItems WHERE ItemUID = @ItemUID;
DELETE FROM PS_GameData.dbo.MarketItems WHERE ItemUID = @ItemUID;
END
** Added to initial release post as well.
|
|
|
03/10/2013, 11:02
|
#7
|
elite*gold: 0
Join Date: Nov 2012
Posts: 352
Received Thanks: 150
|
ok let me try and explain this:
Quote:
DECLARE @ItemID int
SET @ItemID = '100200';/* Edit this to contain the ItemID of the Item you wish to remove */
IF (@ItemID != NULL)
BEGIN
DELETE FROM PS_GameData.dbo.CharItems WHERE ItemID = @ItemID;
DELETE FROM PS_GameData.dbo.UserStoredItems WHERE ItemID = @ItemID;
DELETE FROM PS_GameData.dbo.GuildStoredItems WHERE ItemID = @ItemID;
DELETE FROM PS_GameData.dbo.MarketItems WHERE ItemID = @ItemID;
END
ELSE
BEGIN
PRINT 'Please provide an ItemID';
END
|
becouse i want to remove what i call DP Crystal from the game (just a test:-)
this gives me:
Quote:
as a message when i run it..
then i run
Quote:
SELECT
UserUID
,UserID
,c.CharID
,c.CharName
,i.ItemID
,i.ItemName
,SUM(ci.Count) as 'TotalCountOfItem'
FROM [PS_GameData].[dbo].[CharItems] ci with (nolock)
inner join [PS_GameDefs].[dbo].[Items] i with (nolock)
on i.ItemID = ci.ItemID
inner join [PS_GameData].[dbo].[Chars] c with (nolock)
on c.CharID = ci.CharID
where
i.ItemName like '%DP Crystal%' -- Insert part of item name here
group by
UserUID
,UserID
,c.CharID
,c.CharName
,i.ItemID
,i.ItemName
order by
i.ItemName asc, TotalCountOfItem desc, c.UserID asc, c.CharName asc
|
that still show the item ingame in many places (inventory of players)
so what did i do wrong?
should be removed here now right? from the db i mean or am i totaly off atm?
|
|
|
 |
Similar Threads
|
Altering Item Effects via SQL tables
01/15/2015 - Rappelz - 5 Replies
hmm I wasnt sure if i should post it here or over at
p server issues and resolve
It might help some people, if they wanna mod items, like me. The goal is to reduce cool downs, prolong effects, or just add new ones, like gettin gbuffs by consuming a red potion. this is what you do if you wanna alter an already present effect:
Method 1
You search for the item name inside .. (its the "value" field)
When you find it, you search for the name_id in .. (its the "code" field from )
There you...
|
[RELEASE]LOG Tables (all)
10/18/2012 - Metin2 PServer Guides & Strategies - 2 Replies
Hi!
Tables for database Log:
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for `bootlog`
-- ----------------------------
DROP TABLE IF EXISTS `bootlog`;
CREATE TABLE `bootlog` (
|
Shaiya Noss Removal and 60 Skill Removal
04/30/2011 - Shaiya - 1 Replies
Hi,
I am on a server, and the DEV's cant seem to be able to correctly remove Noss nor 60 skills. So I figured I would come here and get some advice or help on removing it. Just place whatever here that can help me, that I could refer to the DEV's.
Thanks,
Semper
|
[Release] Cutscene Removal Fix
01/31/2010 - Mabinogi Hacks, Bots, Cheats & Exploits - 7 Replies
cutscene.rar
This file fixes the issue with Final Shot dungeon. However, due to laziness, I uploaded the entire cutscene folder. This is only for people who haven't fixed it themselves.
Do NOT thank me for this and please don't bump.
Edit: Apparently Rii made the original cutscenes folder so credits to them for that. The only difference is that this was updated to not have the Final Shot dungeon issue.
|
Item Tables.
12/24/2006 - Lin2 Exploits, Hacks, Bots, Tools & Macros - 5 Replies
Hello people! This is my first post :) I post some item Tables here and I hope someone have some benefits from them hehe.
ItemTables
Cheers! & Marry-xmas.
|
All times are GMT +1. The time now is 15:43.
|
|