-Script Anti-Dupe 97d.99i-

Results 1 to 11 of 11
  1. #1
    The Supreme King Masteru is online now
    MemberRank
    Jun 2012 Join Date
    1,159Posts

    -Script Anti-Dupe 97d.99i-

    -What ay need to fix this script-

    use MuOnline

    if exists(select * from dbo.sysobjects where type='p' and name='WZ_GetItemSerial')
    drop procedure WZ_GetItemSerial
    go

    CREATE procedure WZ_GetItemSerial
    as
    BEGIN
    DECLARE @ItemSerial int
    set nocount on
    begin transaction

    update GameServerInfo set @ItemSerial = ItemCount = ItemCount+1

    if ( @@error <> 0 )
    begin
    rollback transaction
    select -1
    end
    else
    begin
    commit transaction
    select @ItemSerial
    end
    END
    GO

    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

    -This Script Works-

    ---------------------------------------
    ---------------------------------------

    -Second Script No works-

    use MuOnline

    if exists(select * from dbo.sysobjects where type='p' and name='WZ_GetItemSerial')
    drop procedure WZ_GetItemSerial
    go

    CREATE procedure WZ_GetItemSerial
    as
    BEGIN
    DECLARE @ItemSerial int
    set nocount on
    begin transaction
    update GameServerInfo set @ItemSerial = ItemCount = (case when ItemCount < 0x7effffff then ItemCount+1
    else 1
    end )
    if(@@error <> 0)
    begin
    rollback transaction
    select-1
    end
    else
    begin
    commit transaction
    select @ItemSerial
    end
    END
    GO

    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 ('\') 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

    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
    IF @Find=1
    BEGIN
    INSERT INTO copylog (copy_whdata,copy_acid,copy_date) VALUES (@wh_data,@al_acid,getdate())
    UPDATE warehouse SET pw=9273,items=null WHERE accountid=@al_acid
    UPDATE Character SET CtlCode=1 WHERE accountid=@al_acid
    END
    SET NOCOUNT OFF
    END
    END
    GO
    SET QUOTED_IDENTIFIER OFF
    GO
    SET ANSI_NULLS ON
    GO
    DECLARE @al_acid char(50)
    set @al_acid = 'ASUS'
    UPDATE Character SET CtlCode=1 WHERE accountid=@al_acid
    go
    select * from AllItemsLog
    select * from CopyLog

    -[I have this problem ]-

    Screen 1

    [IMG][/IMG]

    Screen 2

    [IMG][/IMG]
    Last edited by Masteru; 05-06-14 at 11:31 AM.


  2. #2
    Alpha Member 2009x2014 is offline
    MemberRank
    Dec 2009 Join Date
    2,765Posts

    Re: -Script Anti-Dupe 97d.99i-

    Learn sql basics.

  3. #3
    The Supreme King Masteru is online now
    MemberRank
    Jun 2012 Join Date
    1,159Posts

    Re: -Script Anti-Dupe 97d.99i-

    Quote Originally Posted by 4FUNer View Post
    Learn sql basics.
    -if you do not want to help better stop posting-

  4. #4
    The Supreme King Masteru is online now
    MemberRank
    Jun 2012 Join Date
    1,159Posts

    Re: -Script Anti-Dupe 97d.99i-

    -lol none come on-

  5. #5

    Re: -Script Anti-Dupe 97d.99i-

    Who said it doesnt works? it says that the rows are affected = worked.

  6. #6
    The Supreme King Masteru is online now
    MemberRank
    Jun 2012 Join Date
    1,159Posts

    Re: -Script Anti-Dupe 97d.99i-

    Quote Originally Posted by K a r L i View Post
    Who said it doesnt works? it says that the rows are affected = worked.
    man like this [The command(s) completed successfully.]

    when put second script ay have this message

    (0 row(s) affected)


    (0 row(s) affected)


    (0 row(s) affected)

    what ay need to fixed to works for 97d.99i ay have sql 2000

    and how's the script anti dupe works,automatically delete any dupe ?

  7. #7
    The Supreme King Masteru is online now
    MemberRank
    Jun 2012 Join Date
    1,159Posts

    Re: -Script Anti-Dupe 97d.99i-

    -what ay need to fixed to works for 97d.99i ay have sql 2000-

    when put second script ay have this message

    (0 row(s) affected)


    (0 row(s) affected)


    (0 row(s) affected)

  8. #8

  9. #9
    The Supreme King Masteru is online now
    MemberRank
    Jun 2012 Join Date
    1,159Posts

    Re: -Script Anti-Dupe 97d.99i-

    -tanks for help but this 2 link have problem-

    -first link-

    http://forum.ragezone.com/f197/anti-...on-1-a-348714/

    Q: Does it support 97 or 99B+?
    A: NO
    Q: What muserver does it support?
    A: Any muserver based on 99.88 or higher, meaning Season 1, Season 2, Season 3

    -second link-

    http://forum.ragezone.com/f197/sql-q...i-dupe-756514/

    -ay have this problem-

    Server: Msg 170, Level 15, State 1, Line 1
    Line 1: Incorrect syntax near 'GO'.
    Server: Msg 111, Level 15, State 1, Line 1
    'CREATE PROCEDURE' must be the first statement in a query batch.
    Server: Msg 170, Level 15, State 1, Line 1
    Line 1: Incorrect syntax near 'GO'.
    Server: Msg 170, Level 15, State 1, Line 1
    Line 1: Incorrect syntax near 'GO'.
    Server: Msg 170, Level 15, State 1, Line 1
    Line 1: Incorrect syntax near 'GO'.
    Server: Msg 170, Level 15, State 1, Line 1
    Line 1: Incorrect syntax near 'GO'.
    Server: Msg 156, Level 15, State 1, Line 1
    Incorrect syntax near the keyword 'CREATE'.
    Server: Msg 156, Level 15, State 1, Line 1
    Incorrect syntax near the keyword 'ALTER'.
    Server: Msg 170, Level 15, State 1, Line 1
    Line 1: Incorrect syntax near 'GO'.
    Server: Msg 170, Level 15, State 1, Line 1
    Line 1: Incorrect syntax near 'GO'.
    Server: Msg 170, Level 15, State 1, Line 1
    Line 1: Incorrect syntax near 'GO'.
    Server: Msg 170, Level 15, State 1, Line 1
    Line 1: Incorrect syntax near 'GO'.
    Server: Msg 170, Level 15, State 1, Line 1
    Line 1: Incorrect syntax near 'GO'.
    Server: Msg 111, Level 15, State 1, Line 1
    'CREATE TRIGGER' must be the first statement in a query batch.
    Server: Msg 140, Level 15, State 1, Line 1
    Can only use IF UPDATE within a CREATE TRIGGER statement.
    Server: Msg 170, Level 15, State 1, Line 1
    Line 1: Incorrect syntax near 'bit'.

  10. #10

    Re: -Script Anti-Dupe 97d.99i-

    Ok brother i cannot help you anymore , change your Databases MuOnline.bak and retry your old codes.

    peace

  11. #11
    The Supreme King Masteru is online now
    MemberRank
    Jun 2012 Join Date
    1,159Posts

    Re: -Script Anti-Dupe 97d.99i-

    Quote Originally Posted by K a r L i View Post
    Ok brother i cannot help you anymore , change your Databases MuOnline.bak and retry your old codes.

    peace
    tanks for help



Advertisement