[Official Feature] Perfect Fixed Character Name Service! iSRO Style!

Page 3 of 3 FirstFirst 123
Results 31 to 33 of 33
  1. #31
    Xeulin™ Showtek is offline
    MemberRank
    Nov 2011 Join Date
    UKLocation
    264Posts

    Re: [Official Feature] Perfect Fixed Character Name Service! iSRO Style!

    Hey guys, making this thread alive again. I have question, maybe this function can work without adding '@' before your nick?

  2. #32
    beq $v0, $0, 0x80000000 megaman963 is offline
    MemberRank
    Sep 2011 Join Date
    r3000 - MIPSLocation
    198Posts

    Re: [Official Feature] Perfect Fixed Character Name Service! iSRO Style!

    Quote Originally Posted by Showtek View Post
    Hey guys, making this thread alive again. I have question, maybe this function can work without adding '@' before your nick?
    There is an NPC that can do the same function, for a guild and for character name .. but, I think it will use the same Stored Procedure ...

    I saw it on some private servers ... I don't know which one ...

  3. #33
    Proficient Member Royalblade is offline
    MemberRank
    Jan 2013 Join Date
    167Posts

    Re: [Official Feature] Perfect Fixed Character Name Service! iSRO Style!

    sorry to wake up this long dead thread again, but since i just used this and knew that its kind of "buggy" if u use it with scrolls.. that add a @ n front of your name.. so that u can make ingame namechange scrolls etc.

    You will need to add a line to get rid of the @ of the charname...

    this is the whole procedure again.. credits to jangan ofc, i just add a line :)

    Code:
    GO
    
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    
    -----------------------------------------------------------------------------------------------------
    
    ALTER procedure [dbo].[_RenameCharNameByID]
    @CharID        int,
    @NewName    varchar(64)
    as
        if (not exists (select charid from _char where charid = @charid))
            return -1
        set xact_abort on
    begin transaction
        if (exists (select charid from _charnamelist with (updlock) where charname16 = @NewName))
        begin
            rollback transaction
            return -3
        end
        declare @old_name varchar(64)
        select @old_name = charname16 from _char where charid = @charid
        SET @old_name = (Select RIGHT(@old_name,(LEN(@old_name)-1)))
        update _char set charname16 = @NewName where charid = @charid
        if (@@error <> 0 or @@rowcount = 0)
        begin
            rollback transaction
            return -4        
        end
        insert _CharNameList values(@NewName, @charid)
        UPDATE _Char set CharName16 = @NewName where CharID = @CharID
        update _Friend set friendcharname = @NewName where friendcharid = @charid
        update _GuildMember set charname = @NewName where charid = @charid
        update _Memo set fromcharname = @NewName where fromcharname = @old_name
        update _TrainingCampMember set charname = @NewName where charid = @charid
        declare @cos_id int
        declare cos_cursor  cursor fast_forward for    
        select id
         from _charcos 
        where ownercharid = @CharID
        open cos_cursor 
        fetch next from cos_cursor  into @cos_id
        while( @@fetch_status = 0 )
        begin
            update _Items set CreaterName = @NewName 
            where ID64 in 
            (select ItemID from _InvCOS where COSID = @cos_id and ItemID > 0) 
            and CreaterName = @old_Name
            if (@@error <> 0 )
            begin
                close cos_cursor
                deallocate cos_cursor
                rollback transaction
                return -5
            end
            fetch next from cos_cursor  into @cos_id
        end
        close cos_cursor
        deallocate cos_cursor
        declare pc_inv_cursor cursor fast_forward for
        select it.Data                            
        from _Inventory as inv join _Items as it on inv.ItemID = it.ID64 
        where 
        (inv.CharID = @CharID and inv.Slot >= 13 and inv.ItemID > 0) and    
        (it.Data <> 0)  and                            
        (exists (select top 1 ID from _RefObjCommon where ID = it.RefItemID and TypeID1 = 3 and TypeID2 = 2))
        open pc_inv_cursor 
        fetch next from pc_inv_cursor  into @cos_id
        while( @@fetch_status = 0 )
        begin
            update _Items set CreaterName = @NewName 
            where ID64 in 
            (select ItemID from _InvCOS where COSID = @cos_id and ItemID > 0) 
            and CreaterName = @old_Name
            if (@@error <> 0 )
            begin
                close pc_inv_cursor
                deallocate pc_inv_cursor
                rollback transaction
                return -6
            end
            fetch next from pc_inv_cursor  into @cos_id
        end
        close pc_inv_cursor
        deallocate pc_inv_cursor
        if (CHARINDEX('@', @old_name, 0) > 0)
        begin
            select * from _Char
            where CharID = ''
        end
        
       INSERT INTO SRO_VT_ROYAL.dbo._CharnameChanges (CharID,OldCharname,NewCharname,Eventtime)
        values (@CharID,@old_name,@Newname,getdate() )
        commit transaction
    return 1



Page 3 of 3 FirstFirst 123

Advertisement