Auto Item Distribution

Results 1 to 8 of 8
  1. #1
    @work onyourrisk is offline
    MemberRank
    Jan 2008 Join Date
    IndiaLocation
    706Posts

    ! Auto Item Distribution

    Hello guys,

    Was taking a look at the Auto Item tool designed by cvr in earlier days,

    It seems that tool loops through all the char and look for any new entry and then it logs it in and update it.

    Well It may cause some latency in character creation and it may become hectic when there are more characters.

    I was passing through the possibilities of SQL Triggers and found out that it will be easier to write a trigger to the insert of a new row to the charac0 table.

    Here is a sql trigger which worked for me and I was able to get the stuff and skills and what ever i want to have when a new character is created.

    Code:
    CREATE TRIGGER newCharCreated ON [dbo].[charac0] 
    FOR INSERT
    AS
        declare @m_body0 varchar(4000);
        declare @m_body1 varchar(4000);
        declare @m_body2 varchar(4000);
        declare @m_body3 varchar(4000);
        declare @char_type varchar(255);
        declare @charName varchar(255);
    
        select @char_type=i.c_sheaderb from inserted i;
        select @charName=i.c_id from inserted i;
        set @m_body0='';
        set @m_body1='';
        set @m_body2='';
        set @m_body3='';
    
        if (@char_type='0')
            update charac0 set m_body = @m_body0 where c_id = @charName;
            
        if (@char_type='1')
            update charac0 set m_body = @m_body1 where c_id = @charName;
            
        if (@char_type='2')
            update charac0 set m_body = @m_body2 where c_id = @charName;
            
        if (@char_type='3')
            update charac0 set m_body = @m_body3 where c_id = @charName;
    
        PRINT 'New Character Creation fired.'
    GO
    m_body0, m_body1, m_body2, m_body3 are the respective m_body field you want to update.

    This is just a more efficient way to get the stuffs on character creation.

    I hope it will be helpful !


  2. #2
    Iron like a Lion in Zion! vLife is online now
    Super ModRank
    Apr 2009 Join Date
    The BahamasLocation
    3,785Posts

    Re: Auto Item Distribution

    Moved to releases.

  3. #3
    Account Upgraded | Title Enabled! holy003 is offline
    MemberRank
    Jan 2011 Join Date
    Mumbai, MaharasLocation
    306Posts

    Re: Auto Item Distribution

    Nice work..
    Can anyone tell which file contains the data that a new char should get g1 set.. Is it possible to edit it ? And give some other set ?

  4. #4
    Goodbye chrissdegrece is offline
    MemberRank
    Oct 2009 Join Date
    GreeceLocation
    1,015Posts

    Re: Auto Item Distribution

    Here is a hint:

    In AccountServer , the Create_New_Character function address is : 00404420

  5. #5
    Programmer cyberinferno is offline
    MemberRank
    Jun 2009 Join Date
    127.0.0.1Location
    707Posts

    Re: Auto Item Distribution

    Good one :)

  6. #6
    Account Upgraded | Title Enabled! holy003 is offline
    MemberRank
    Jan 2011 Join Date
    Mumbai, MaharasLocation
    306Posts

    note Re: Auto Item Distribution

    Quote Originally Posted by chrissdegrece View Post
    Here is a hint:

    In AccountServer , the Create_New_Character function address is : 00404420
    But how to give set with eles on it ?

  7. #7
    Goodbye chrissdegrece is offline
    MemberRank
    Oct 2009 Join Date
    GreeceLocation
    1,015Posts

    Re: Auto Item Distribution

    If you manage to do that in AS, then teach me too.

  8. #8
    Ŋ cvrdheeraj is offline
    MemberRank
    Jul 2006 Join Date
    IndiaLocation
    1,210Posts

    Re: Auto Item Distribution

    Why did you use the PRINT command? Who is going to see the output? Save some CPU cycles



Advertisement