New character with 7 days seal of wealth

Results 1 to 10 of 10
  1. #1
    Account Upgraded | Title Enabled! FlamingArm is offline
    MemberRank
    Mar 2009 Join Date
    MoldovaLocation
    216Posts

    New character with 7 days seal of wealth

    I am using MMT season II 1.0.7 files.
    How can i configure the procedure of creating a character that gives him 7 days seal effect?
    Help please.

    P.S. Does the Cashshop from S2 can sell sets(1 set in 1 CS slot?)


  2. #2
    Account Upgraded | Title Enabled! FlamingArm is offline
    MemberRank
    Mar 2009 Join Date
    MoldovaLocation
    216Posts

    Re: New character with 7 days seal of wealth

    someone?)

    - - - Updated - - -

    how to config the procedure so that every new character will have X days of seal of wealth?

    1) wz_createcharacter:

    /****** Object: Stored Procedure dbo.WZ_CreateCharacter Script Date: 28.11.2008 19:52:26 ******/

    CREATE Procedure WZ_CreateCharacter
    @accountID varchar(10), @name varchar(10), @class tinyint
    AS
    Begin

    SET NOCOUNT ON
    SET XACT_ABORT ON
    DECLARE @result tinyint

    SET @result = 0x00

    If EXISTS ( SELECT Name FROM Character WHERE Name = @name )
    begin
    SET @result = 0x01
    GOTO ProcEnd
    end

    BEGIN TRAN

    If NOT EXISTS ( SELECT Id FROM AccountCharacter WHERE Id = @accountID )
    begin
    INSERT INTO dbo.AccountCharacter(Id, GameID1, GameID2, GameID3, GameID4, GameID5, GameIDC)
    VALUES @accountID, @name, NULL, NULL, NULL, NULL, NULL)

    SET @result = @@Error
    end
    else
    begin
    Declare @g1 varchar(10), @g2 varchar(10), @g3 varchar(10), @g4 varchar(10), @g5 varchar(10)
    SELECT @g1=GameID1, @g2=GameID2, @g3=GameID3, @g4=GameID4, @g5=GameID5 FROM dbo.AccountCharacter Where Id = @accountID
    if( ( @g1 Is NULL) OR (Len(@g1) = 0))

    begin
    UPDATE AccountCharacter SET GameID1 = @name
    WHERE Id = @accountID

    SET @result = @@Error
    end
    else if( @g2 Is NULL OR Len(@g2) = 0)
    begin
    UPDATE AccountCharacter SET GameID2 = @name
    WHERE Id = @accountID

    SET @result = @@Error
    end
    else if( @g3 Is NULL OR Len(@g3) = 0)
    begin
    UPDATE AccountCharacter SET GameID3 = @name
    WHERE Id = @accountID

    SET @result = @@Error
    end
    else if( @g4 Is NULL OR Len(@g4) = 0)
    begin
    UPDATE AccountCharacter SET GameID4 = @name
    WHERE Id = @accountID

    SET @result = @@Error
    end
    else if( @g5 Is NULL OR Len(@g5) = 0)
    begin
    UPDATE AccountCharacter SET GameID5 = @name
    WHERE Id = @accountID

    SET @result = @@Error
    end
    else
    begin
    SET @result = 0x03
    GOTO TranProcEnd
    end
    end

    if( @result <> 0 )
    begin
    GOTO TranProcEnd
    end
    else
    begin
    INSERT INTO dbo.Character(AccountID, Name, cLevel, LevelUpPoint, Class, Strength, Dexterity, Vitality, Energy, Inventory,MagicList,
    Life, MaxLife, Mana, MaxMana, MapNumber, MapPosX, MapPosY, MDate, LDate, Quest, DbVersion, Leadership,money )
    SELECT @accountID As AccountID, @name As Name, Level, 0, @class As Class,
    Strength, Dexterity, Vitality, Energy, Inventory,MagicList, Life, MaxLife, Mana, MaxMana, MapNumber, MapPosX, MapPosY,
    getdate() As MDate, getdate() As LDate, Quest, DbVersion, Leadership,0
    FROM DefaultClassType WHERE Class = @class

    SET @result = @@Error
    end

    TranProcEnd:
    IF ( @result <> 0 )
    ROLLBACK TRAN
    ELSE
    COMMIT TRAN

    ProcEnd:

    SET NOCOUNT OFF
    SET XACT_ABORT OFF

    SELECT
    CASE @result
    WHEN 0x00 THEN 0x01
    WHEN 0x01 THEN 0x00
    WHEN 0x03 THEN 0x03
    ELSE 0x02
    END AS Result
    End


    GO


    2) The table for the seal effect: T_periodItem_info


  3. #3
    Account Upgraded | Title Enabled! FlamingArm is offline
    MemberRank
    Mar 2009 Join Date
    MoldovaLocation
    216Posts

    Re: New character with 7 days seal of wealth

    need to add in the create character procedure that will add in the table T_periodItem_info:
    memb_guid (acc ID)
    char (charname that is created from the procedure)
    itemcode 6700;
    optiontype 0;
    item_effect1 6;
    item_effect2 7;
    UseTime 10080; (7 days)
    ExpireDate createdate+7days;

  4. #4
    ImperiaMuCMS CEO jacubb is offline
    MemberRank
    Jul 2011 Join Date
    SlovakiaLocation
    1,507Posts

    Re: New character with 7 days seal of wealth

    Just made a simple INSERT statement.

    Code:
    INSERT INTO dbo.T_periodItem_info(memb_guid,char,itemcode,optiontype,item_effect1,item_effect2,UseTime,ExpireDate)
    VALUES(@memb_guid, @name,6700,0,6,7,10080,getdate()+7)
    Something like this, I am not sure... But first you will have to set variable @memb_guid with a SELECT statement.

  5. #5
    Account Upgraded | Title Enabled! FlamingArm is offline
    MemberRank
    Mar 2009 Join Date
    MoldovaLocation
    216Posts

    Re: New character with 7 days seal of wealth

    isnt this the memb_guid? from the code from caracter create?
    If NOT EXISTS ( SELECT Id FROM AccountCharacter WHERE Id = @accountID )

    i dont know shit in sql scripts ))
    if u can please some help

  6. #6
    ImperiaMuCMS CEO jacubb is offline
    MemberRank
    Jul 2011 Join Date
    SlovakiaLocation
    1,507Posts

    Re: New character with 7 days seal of wealth

    Memb_guid is generated in account registration.

  7. #7
    Account Upgraded | Title Enabled! FlamingArm is offline
    MemberRank
    Mar 2009 Join Date
    MoldovaLocation
    216Posts

    Re: New character with 7 days seal of wealth

    SELECT memb_guid
    from MEMB_INFO, AccountCharacter
    where memb___id = Id
    and
    (GameID1 = @name' or GameID2 = @name' or GameID3 = @name' or GameID4 = @name' or GameID5 = @name');

    something like this gives me the game_uid of acc where @name is in one of the gameid
    what to do next?)

  8. #8
    ImperiaMuCMS CEO jacubb is offline
    MemberRank
    Jul 2011 Join Date
    SlovakiaLocation
    1,507Posts

    Re: New character with 7 days seal of wealth

    Code:
    DECLARE @memb_guid int
    SELECT @memb_guid = memb_guid FROM MEMB_INFO WHERE memb___id = @accountID

  9. #9
    Account Upgraded | Title Enabled! FlamingArm is offline
    MemberRank
    Mar 2009 Join Date
    MoldovaLocation
    216Posts

    Re: New character with 7 days seal of wealth

    so the procedure will be something like this?
    Code:
    /****** Object: Stored Procedure dbo.WZ_CreateCharacter Script Date: 28.11.2008 19:52:26 ******/
    
    CREATE Procedure WZ_CreateCharacter   @accountID	varchar(10),  @name	varchar(10),  @class	tinyint
    AS
    Begin
    
    SET NOCOUNT ON
    SET	XACT_ABORT ON
    DECLARE  @result	tinyint
    
    SET  @result = 0x00	
    
    If EXISTS ( SELECT Name FROM Character WHERE Name =  @name )
    begin
    SET  @result	= 0x01	
    GOTO ProcEnd	
    end 
    
    BEGIN TRAN
    
    If NOT EXISTS ( SELECT Id FROM AccountCharacter WHERE Id =  @accountID )
    begin
    INSERT INTO dbo.AccountCharacter(Id, GameID1, GameID2, GameID3, GameID4, GameID5, GameIDC) 
    VALUES  @accountID,  @name, NULL, NULL, NULL, NULL, NULL)
    
    SET  @result = @@Error
    end 
    else
    begin
    Declare @g1 varchar(10), @g2 varchar(10), @g3 varchar(10), @g4 varchar(10), @g5 varchar(10)	
    SELECT @g1=GameID1, @g2=GameID2, @g3=GameID3, @g4=GameID4, @g5=GameID5 FROM dbo.AccountCharacter Where Id =  @accountID 
    if( ( @g1 Is NULL) OR (Len(@g1) = 0))
    
    begin
    UPDATE AccountCharacter SET GameID1 =  @name
    WHERE Id =  @accountID
    
    SET  @result = @@Error
    end 
    else	if( @g2 Is NULL OR Len(@g2) = 0)
    begin
    UPDATE AccountCharacter SET GameID2 =  @name
    WHERE Id =  @accountID
    
    SET  @result = @@Error
    end 
    else	if( @g3 Is NULL OR Len(@g3) = 0)
    begin	
    UPDATE AccountCharacter SET GameID3 =  @name
    WHERE Id =  @accountID
    
    SET  @result = @@Error
    end 
    else	if( @g4 Is NULL OR Len(@g4) = 0)
    begin
    UPDATE AccountCharacter SET GameID4 =  @name
    WHERE Id =  @accountID
    
    SET  @result = @@Error
    end 
    else	if( @g5 Is NULL OR Len(@g5) = 0)
    begin
    UPDATE AccountCharacter SET GameID5 =  @name
    WHERE Id =  @accountID
    
    SET  @result = @@Error
    end 
    else 
    begin	
    SET  @result	= 0x03	
    GOTO TranProcEnd	
    end 
    end 
    
    if(  @result <> 0 )
    begin
    GOTO TranProcEnd	
    end 
    else
    begin
    INSERT INTO dbo.Character(AccountID, Name, cLevel, LevelUpPoint, Class, Strength, Dexterity, Vitality, Energy, Inventory,MagicList, 
    Life, MaxLife, Mana, MaxMana, MapNumber, MapPosX, MapPosY, MDate, LDate, Quest, DbVersion, Leadership,money )
    SELECT  @accountID As AccountID,  @name As Name, Level, 0,  @class As Class, 
    Strength, Dexterity, Vitality, Energy, Inventory,MagicList, Life, MaxLife, Mana, MaxMana, MapNumber, MapPosX, MapPosY,
    getdate() As MDate, getdate() As LDate, Quest, DbVersion, Leadership,0
    FROM DefaultClassType WHERE Class =  @class	
    
    DECLARE @memb_guid int
    SELECT @memb_guid = memb_guid FROM MEMB_INFO WHERE memb___id =  @accountID
    INSERT INTO dbo.T_periodItem_info(memb_guid,char,itemcode,optiontype,item_effect1,item_effect2,UseTime,ExpireDate)
    VALUES(@memb_guid,  @name,6700,0,6,7,10080,getdate()+7)
    
    SET  @result = @@Error
    end 
    
    TranProcEnd:
    IF (  @result <> 0 )
    ROLLBACK TRAN
    ELSE
    COMMIT	TRAN
    
    ProcEnd:
    
    SET NOCOUNT OFF
    SET	XACT_ABORT OFF
    
    SELECT
    CASE  @result
    WHEN 0x00 THEN 0x01
    WHEN 0x01 THEN 0x00
    WHEN 0x03 THEN 0x03
    ELSE 0x02
    END AS Result 
    End
    
    
    GO

  10. #10
    ImperiaMuCMS CEO jacubb is offline
    MemberRank
    Jul 2011 Join Date
    SlovakiaLocation
    1,507Posts

    Re: New character with 7 days seal of wealth

    Yes, it should work. Test it and let me know, if it's working.



Advertisement