• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

Auto Item Distribution

Status
Not open for further replies.
@work
Joined
Jan 26, 2008
Messages
617
Reaction score
39
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 !
 
Experienced Elementalist
Joined
Jan 6, 2011
Messages
293
Reaction score
6
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 ?
 
Goodbye
Loyal Member
Joined
Oct 6, 2009
Messages
965
Reaction score
134
Here is a hint:

In AccountServer , the Create_New_Character function address is : 00404420
 
Status
Not open for further replies.
Back
Top