Trigger to prevent dupe

phillips41 said:
this doesnt work on 99B+ and chaos goblin dupe method.

Hi, I have tested in 99b+ and this trigger (the first one) works. When the char terminates the dupe process, the vault is locked, and (in my case) the account was blocked. My players when discover they have been caught imediatelly sell the item in inventory and come to me to tell me they lost the pw from warehouse :D

Poor kids !!!

With the vault locked they can't do nothing with the duped item. And now the account is blocked and I dont unblock this type of player.

But, the trigger this surely works !
 
Last edited:
nice man, this trigger is good to smal servers, were there isen't much players, wen there are a lot of players, it will cause the lag that john_d said.
 
Help me plz

Corect my mistake plzz
i use Query analyzer and here is script
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[trg_CheckSameID]') and OBJECTPROPERTY(id, N'IsTrigger') = 1)
drop trigger [dbo].[trg_CheckSameID]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[AllItemsLog]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[AllItemsLog]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[CopyLog]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[CopyLog]
GO

CREATE TABLE [dbo].[AllItemsLog] (
[items_id] [int] IDENTITY (1, 1) NOT NULL ,
[items_type] [binary] (1) NOT NULL ,
[items_serial] [binary] (4) NOT NULL ,
[items_acid] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[CopyLog] (
[copy_id] [int] IDENTITY (1, 1) NOT NULL ,
[copy_acid] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[copy_whdata] [binary] (1200) NOT NULL ,
[copy_date] [datetime] NOT NULL
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[AllItemsLog] ADD
CONSTRAINT [DF_CT_ITEM_item] DEFAULT (0) FOR [items_type],
CONSTRAINT [DF_CT_ITEM_itemid] DEFAULT (0) FOR [items_serial],
CONSTRAINT [DF_CT_ITEM_itemrole] DEFAULT (0) FOR [items_acid]
GO

CREATE INDEX [IX_CT_ITEM] ON [dbo].[AllItemsLog]([items_type], [items_serial]) ON [PRIMARY]
GO

ALTER TABLE [dbo].[CopyLog] ADD
CONSTRAINT [DF_CopyLog_copy_date] DEFAULT (getdate()) FOR [copy_date]
GO

SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO


--????


CREATE TRIGGER [dbo].[trg_CheckSameID] ON [dbo].[character]
FOR UPDATE
AS
BEGIN
IF UPDATE(inventory)
BEGIN
SET NOCOUNT ON
DECLARE
@wh_acid varchar(10),
@wh_data binary(1200),
@wh_type binary(1),
@wh_serial binary(4),
@cr_user varchar(10),
@cr_acid varchar(10),
@cr_data binary(760),
@cr_type binary(1),
@cr_serial binary(4),
@al_acid varchar(10),
@j int,
@k int,
@find bit
SELECT @cr_acid=i.accountid,
@cr_data=i.inventory
FROM inserted i
SET @j=0
SET @find=0
WHILE @j<76 AND @cr_data IS NOT NULL
BEGIN
SET @cr_type=SUBSTRING(@cr_data,@j*10+1,1)
SET @cr_serial=SUBSTRING(@cr_data,@j*10+4,4)
IF @cr_type<>0xFF AND @cr_serial<>0x00000000
BEGIN
SELECT @al_acid=items_acid FROM allitemslog WHERE items_type=@cr_type AND items_serial=@cr_serial
--??????????
IF @al_acid IS NULL
INSERT INTO allitemslog (items_type,items_serial,items_acid) VALUES (@cr_type,@cr_serial,@cr_acid)
ELSE
BEGIN
UPDATE allitemslog SET items_acid=@cr_acid WHERE items_type=@cr_type AND items_serial=@cr_serial
--???????????????ID??
SELECT @wh_data=items FROM warehouse WHERE accountid=@al_acid
SET @k=0
WHILE @k<120 AND @wh_data IS NOT NULL
BEGIN
SET @wh_type=SUBSTRING(@wh_data,@k*10+1,1)
SET @wh_serial=SUBSTRING(@wh_data,@k*10+4,4)
IF @wh_type=@cr_type AND @wh_serial=@cr_serial
SET @find=1
SET @k=@k+1
END
END
END
SET @j=@j+1
END
and here is mistake
Server: Msg 170, Level 15, State 1, Procedure trg_CheckSameID, Line 59
Line 59: Incorrect syntax near 'END'.
so whats wrong help me plzz !
 
nkerz said:
dissel: update warehouse set pw = '' where AccountID = 'account_here'

thanks nkerz

-- this is wer u can add more punishment like ban or lock characters
UPDATE warehouse SET pw=5555 WHERE accountid=@al_acid

when i put 5555 in vault code the password is incorrect. and il check in the database warehouse to check the password its 5555 also. what is the error ?


and when i use the script?
the dataserv 1 error
SQLSTATE:2400, diagnosis:[Microsoft]ODBC SQL Server Driver]invalid cursor staGeQuevedCompletaionStatus failed with error 64


pls help!!!
 
Last edited:
john_d said:
also a bug is found.. it doesnt really stop duping..

it bans the people who buy dupe items.. hehehe.. wat about the real dupers.
What if they can only use the chaos goblin dupe method in a non-trade server? When they log out to go into the trade server, will their dupe be caught? Just trying to think around the problem... legit players getting blocked is NOT an option :eh:
 
go to query analizer and paste the code there for the muonline database, then press paly butonn, and its done.
 
this is a script, not a job.. so it will always be runing..
 
This script work fine if you have 2 duped items in your werehouse!!!The problem is if you have 1 dupet in werehouse and you give the second one in another player you have 2 items 1 in werehouse and 1 in another persone and script no check it!!!Is it posible to make this script to delete duped items from inventory and werehouse.This will be great and will stop any duper i think!!!Sorry for may bad english
I try to change this lines:
UPDATE inventory SET items=null WHERE accountid=@al_acid
but this not work for me!!!I think that this is the Main problem!!!
 
Back