Tổng Hợp Các Query Cho Mu Online

Dưới đây là một số Query Mu cho các Admin. Tùy từng version của MSSQL mà có thể cách thức chạy query sẽ khác.
- Với SQL2000 thì các bạn mở "Query Analyzer" và sau khi Login, sau đó chọn CSDL "MuOnline"
và copy một trong những query dưới đây và nhấn buổi tượng PLAY > để execute Query
- Với SQL2005 trở lên thì các bạn mở "SQL Server Management Studio" và sau khi Login, Nhấn "New Query" ngay trên thanh công **.sau đó chọn CSDL "MuOnline"
và copy một trong những query dưới đây và nhấn buổi tượng "! Execute" để execute Query

Và dưới đây là tổng hợp query:


1. Xem thông tin nhân vật:
Code:
use MuOnline
select * from character
where name ='ten nhan vat'
2. Tăng giảm 10 Reset và Relife cho nhân vật
Code:
//Giam
use MuOnline
update character
set Resets = Resets + 10,Clevel = 400
where name ='ten nhan vat'
// Tang
use MuOnline
update character
set Relifes = Relifes + 10
where name ='ten nhan vat'
3. Xóa toàn bộ để lại db trống (Chú ý kỹ trước khi chạy)
Code:
delete character

Delete AccountCharacter

Delete GuildMember

Delete Guild

Delete MEMB_INFO

Delete MEMB_STAT

Delete T_CGuid

Delete T_CurCharName

Delete T_FriendList

Delete T_FriendMail

Delete T_FriendMain

Delete T_MasterLevelSystem

Delete warehouse

Delete VI_CURR_INFO
4.Xóa hết chỉ chừa lại tài khoản trống (Chú ý kỹ trước khi chạy)
Code:
delete character

Delete AccountCharacter

Delete GuildMember

Delete Guild

Delete MEMB_STAT

Delete T_CGuid

Delete T_CurCharName

Delete T_FriendList

Delete T_FriendMail

Delete T_FriendMain

Delete T_MasterLevelSystem

Delete warehouse

Delete VI_CURR_INFO
5. Tăng điểm master cho nhân vật
Code:
use MuOnline
update T_MasterLevelSystem
set MASTER_LEVEL = 200,ML_EXP = 200,ML_NEXTEXP = 200,ML_POINT = 200
where CHAR_NAME = 'tên nhân vật'
5.1 Tăng điểm master cho cả Server
Code:
use MuOnline
update T_MasterLevelSystem
set MASTER_LEVEL = 200,ML_EXP = 200,ML_NEXTEXP = 200,ML_POINT = 200
6. Chỉnh số điểm cộng cho nhân vật về 0
Code:
UPDATE Character
SET LevelUpPoints=('0')
WHERE LevelUpPoints>0
7. Tự động reset
Code:
UPDATE Character
SET cLevel=('1') , experience=('0')
WHERE cLevel>349
8. Chỉnh tài khoản admin thành tài khoản thường
Code:
UPDATE Character
SET CtlCode=('0')
WHERE CtlCode='32' OR CtlCode='8'
9. Mở khóa tài khoản cho tất cả nhân vật
Code:
UPDATE Character
SET CtlCode=('0')
WHERE CtlCode=('1')
10. Chỉnh lại toàn bộ số lần reset về 0
Code:
UPDATE Character
SET Resets=('0')
WHERE Resets>0
11. Xóa thùng đồ
Code:
UPDATE warehouse
SET Items=('')
12. Xóa thùng đồ cá nhân
Code:
UPDATE Character
SET Inventory=('')
13. Sửa lỗi hiển thị gamer online trên web
Code:
UPDATE MEMB_STAT
SET Connect_Stat='0'
WHERE Connect_Stat>0
14. Sửa lỗi kẹt map
Code:
UPDATE Character
SET MapNumber=('0'), MapPosX=('125'), MapPosY=('125')
WHERE MapNumber=('5')
15. Sửa lỗi âm điểm Guild
Code:
UPDATE Guild
SET G_Score=('0')
WHERE G_Score<-1
16.Tăng điểm point cho thành viên
Code:
UPDATE Character
SET Strength='số point'
WHERE strength<18

UPDATE Character
SET Dexterity='số point'
WHERE Dexterity<16

UPDATE Character
SET Vitality='số point'
WHERE Vitality<16

UPDATE Character
SET Energy='số point'
WHERE Energy<16
17. Xóa Pk
Code:
UPDATE Character
SET PkLevel = ('0'), PkTime = ('0'), PkCount = ('0')
Where PkLevel>2
18.Chỉnh tiền cho thành viên
Code:
UPDATE Character
SET Money='2000000000'
WHERE Money<-1
19.Loại bỏ số ID cá nhân
Code:
Code:
UPDATE MEMB_INFO
SET sno__numb=('')
WHERE sno__numb>1
20. Xóa thành viên không có Guild (bang hội chỉ có 1 GM)
Code:
alter table guild nocheck constraint all
alter table guildmember nocheck constraint all
delete from guild
where EXISTS (
SELECT m.G_Name,count(*) as memb from GuildMember m
where guild.g_name=m.G_name
group by m.G_Name
having count(*) <2
)
20.1. Xóa guildmember với guild không (khi bạn chỉnh sửa sai sau đó làm cho lỗi)
Code:
alter table guild nocheck constraint all
alter table guildmember nocheck constraint all
delete from guildmember
where NOT EXISTS (
SELECT * from Guild
where guild.g_name=guildmember.G_name
)
20.2. Top 10 Guild(thành viên)
Code:
SELECT top 10 g.g_name,count(all m.g_name)as thanhvien from Guild as g join Guildmember as m
on g.g_name like m.g_name
group by g.g_Name
having count(*) > 20
order by count(*) DESC
20.3. Top 5 guild tính theo số lần rs của thành viên trong G
Code:
select top 5 g.g_name,sum(c.resets) as reset from guildmember g join character c
on g.name like c.name
group by g.g_name
order by reset desc
21. Top 5 online
Code:
select top 10 c.name,resets,s.onlinehours from character c full join memb_stat s
on c.accountid=s.memb___id
where (c.accountid in ( select top 10 memb___id from memb_stat
order by onlinehours desc ))
and (c.name in ( select top 1 c.name from character c where c.accountid=s.memb___id order by resets desc))
order by onlinehours desc
22. Top reset trung bình (mỗi người chơi trong guild). Chỉnh sửa 10 đến giá trị mà bạn muốn. Đó là giá trị của các thành viên của guild
Code:
select top 5 g.g_name,sum(c.resets)/count(all g.g_name) as reset from guildmember g join character c
on g.name like c.name
group by g.g_name
having count(all g.g_name)>10
order by reset desc
23. Đổi tên tài khoản (account )
Code:
select * from accountcharacter
where id='9242085'

update accountcharacter
set id='ha1710'
where id='9242085'

select * from accountcharacter
where id='ha1710'
-----------------------
select * from character
where accountid='9242085'

update character
set accountid='ha1710'
where accountid='9242085'

select * from character
where accountid='ha1710'
----------------------
select * from memb_info
where memb___id='9242085'

update memb_info
set memb___id='ha1710'
where memb___id='9242085'

select * from memb_info
where memb___id='ha1710'
----------------------
select * from memb_stat
where memb___id='9242085'

update memb_stat
set memb___id='ha1710'
where memb___id='9242085'

select * from memb_stat
where memb___id='ha1710'
-----------------------
select * from warehouse
where accountid='9242085'

update warehouse
set accountid='ha1710'
where accountid='9242085'

select * from warehouse
where accountid='ha1710'
23. Xóa tài khoản không có nhiều kết nối từ 01/06/2010
Code:
delete from memb_info
where memb___id in (
select memb___id from memb_stat where disconnecttm<'2010-06-01')

delete from accountcharacter
where id in (
select memb___id from memb_stat where disconnecttm<'2010-06-01')

delete from character
where accountid in (
select memb___id from memb_stat where disconnecttm<'2010-06-01')

delete from warehouse
where accountid in (
select memb___id from memb_stat where disconnecttm<'2010-06-01')
23.1. xóa tài khoản mà không có connect (tài khoản trống) hoặc lâu năm không có connect
Code:
delete from memb_info
where memb___id not in (
select memb___id from memb_stat)

delete from accountcharacter
where id not in (
select memb___id from memb_stat)

delete from character
where accountid not in (
select memb___id from memb_stat)

delete from warehouse
where accountid not in (
select memb___id from memb_stat)
24. Character không có trong tài khoản
Code:
select accountid,character.name from character where accountid in (
select accountid from character
where name not in (select gameid1 from accountcharacter where id=accountid )
and name not in (select gameid2 from accountcharacter where id=accountid )
and name not in (select gameid3 from accountcharacter where id=accountid )
and name not in (select gameid4 from accountcharacter where id=accountid )
and name not in (select gameid5 from accountcharacter where id=accountid )
)
25. Back up server
Code:
BACKUP LOG muonline WITH NO_LOG

USE [Muonline]
GO
--shrinking
DBCC SHRINKDATABASE(N'Muonline')

Declare @dateBackup Varchar(100)
Set @dateBackup = 'c:\muonline_' +
Convert(varchar, datepart( year , Getdate() )) + '-'+
Convert( varchar , datepart( month , Getdate() ) ) + '-'+
Convert( varchar, datepart( day , Getdate() ) ) + '.bak'
--saving backup with name and date.
BACKUP DATABASE [Muonline] TO DISK = @dateBackup WITH NOFORMAT, NOINIT, NAME = N'Muonline-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
GO
26. xóa guild, thành viên guild mà bị sai
Code:
alter table guild nocheck constraint all
alter table guildmember nocheck constraint all
delete from guild
where g_master not in ( select name from character )
delete from guildmember
where name not in ( select name from character )
delete from guildmember
where G_Name not in ( select G_name from guild )
27.Tạo tài khoản
Code:
--Tao account
use MuOnline
insert into MEMB_INFO (memb___id,memb__pwd,mail_addr,sno__numb,ctl1_code ,bloc_code,memb_name)
VALUES('abc123','matkhau','abc123@yahoo.com',12345 6789123456789,0,0,'proab')
28.Kích 1 tài khoản bi treo
Code:
-- Kick 1 tai khoan bi treo acc - hoac 1 tai khoan dang Online
use MuOnline
update MEMB_STAT
set ConnectStat = 0
where memb___id = 'adminpro'
29. Up điểm Master cho nhân vật ở Server SCF có tên ...
Code:
UPDATE Character
SET SCFMasterLevel = 200, SCFMasterPoints = 200
where name='Tên Nhân Vật'
30. Tặng điểm master cho tất cả nhân vật ở Server SCF
Code:
UPDATE Character
SET SCFMasterLevel = 200, SCFMasterPoints = 200
31. DK có combo ko phải làm nv khi lên 220
Code:
UPDATE Character set Quest=0xAAFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
WHERE NAME ='tên nv' and class ='18'
32.DW có Nova ko phải làm nv khi lên 220
Code:
UPDATE Character set Quest=0xEAFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
WHERE NAME ='tên nv' and class ='2'
@: nếu là SCF thì thay chữ Quest = SCFCustomQuest
33. Block 1 nhân vật nào đó
Code:
UPDATE Character
SET CtlCode=('1')
WHERE NAME ='tên nv'
34. Skill cuồng nộ sum
Code:
use MuOnline
update DefaultClassType
set MagicList= 0xDA0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000 FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF 0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF00 00FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000 FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF 0000FF00
where class='80'
35. Tìm Đồ Full Trong Server
Code:
select * from warehouse
where (charindex (0xbf, items) %16=8)
or (charindex (0xff, items) %16=8)
or (charindex (0x7f, items) %16=8)
or (charindex (0x3f, items) %16=8)
or (charindex (0x9f, items) %16=8)
or (charindex (0x8f, items) %16=8)
or (charindex (0x9e, items) %16=8)
or (charindex (0x9d, items) %16=8)
or (charindex (0xbd, items) %16=8)
or (charindex (0xbc, items) %16=8)
or (charindex (0xba, items) %16=8)
or (charindex (0xbb, items) %16=8)
or (charindex (0xb7, items) %16=8)
or (charindex (0xaf, items) %16=8)
select * from extwarehouse
where (charindex (0xbf, items) %16=8)
or (charindex (0xff, items) %16=8)
or (charindex (0x7f, items) %16=8)
or (charindex (0x3f, items) %16=8)
or (charindex (0x9f, items) %16=8)
or (charindex (0x8f, items) %16=8)
or (charindex (0x9e, items) %16=8)
or (charindex (0x9d, items) %16=8)
or (charindex (0xbd, items) %16=8)
or (charindex (0xbc, items) %16=8)
or (charindex (0xba, items) %16=8)
or (charindex (0xbb, items) %16=8)
or (charindex (0xb7, items) %16=8)
or (charindex (0xaf, items) %16=8)
select * from character
where (charindex (0xbf, inventory) %16=8)
or (charindex (0xff, inventory) %16=8)
or (charindex (0x7f, inventory) %16=8)
or (charindex (0x3f, inventory) %16=8)
or (charindex (0x9f, inventory) %16=8)
or (charindex (0x8f, inventory) %16=8)
or (charindex (0x9e, inventory) %16=8)
or (charindex (0x9d, inventory) %16=8)
or (charindex (0xbd, inventory) %16=8)
or (charindex (0xbc, inventory) %16=8)
or (charindex (0xba, inventory) %16=8)
or (charindex (0xbb, inventory) %16=8)
or (charindex (0xb7, inventory) %16=8)
or (charindex (0xaf, inventory) %16=8)
36.Xóa item trên người và thùng đồ cá nhân của nhân vật nào đó
Code:
UPDATE Character SET Inventory=0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF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FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFF WHERE Name='ADMIN'
37. Tiền và Point và Số Reset mặc định khi tạo nhân vật mới:
Code:
-- Start # Bonus for New Chars --

USE MuOnline
IF EXISTS (SELECT name FROM sysobjects
WHERE name = 'MUC_BONUS' AND type = 'TR')
DROP TRIGGER MUC_BONUS
GO

CREATE TRIGGER MUC_BONUS ON Dbo.Character FOR INSERT
AS
BEGIN

DECLARE
@RESETS INT,
@POINT INT,
@ZEN INT,
@LVL INT,
@STR INT,
@AGI INT,
@ENE INT,
@VIT INT,
@Char varchar(10)
SELECT @Char = Name FROM INSERTED

SET @RESETS = 0 -- INSERT NUMBER OF RESETS
SET @LVL = 1 -- INSERT NUMBER OF LEVEL
SET @POINT = 0 -- INSERT NUMBER OF POINT
SET @ZEN = 5000000 -- INSERT NUMBER OF ZEN
SET @AGI = 100 -- INSERT NUMBER OF DEXTERITY
SET @STR = 200 -- INSERT NUMBER OF STRENGTH
SET @VIT = 50 -- INSERT NUMBER OF VITALITY
SET @ENE = 150 -- INSERT NUMBER OF ENERGY


UPDATE Dbo.Character
SET Resets = @RESETS, cLevel = @LVL,LevelUpPoint = @POINT, Money = @ZEN, Strength = @STR, Dexterity = @AGI, Vitality = @VIT, Energy = @ENE
-- SET Resets = @RESETS, cLevel = @LVL, Money = @ZEN
-- SET cLevel = @LVL, LevelUpPoint = @POINT, Money = @ZEN
WHERE Name = @Char
END

-- NewChar.sql -- TRONG.WIN
38. Reset Data *
Code:
USE [MuOnline]
--[Ranking] [MuOnline] [MU2003_EVENT_DATA]
GO

if exists (select * from INFORMATION_SCHEMA.TABLES where table_name ='Character') Delete Character
DBCC CHECKIDENT ("Character", RESEED, 1);

if exists (select * from INFORMATION_SCHEMA.TABLES where table_name ='AccountCharacter') Delete AccountCharacter
DBCC CHECKIDENT ("AccountCharacter", RESEED, 1);

if exists (select * from INFORMATION_SCHEMA.TABLES where table_name ='GuildMember') Delete GuildMember

if exists (select * from INFORMATION_SCHEMA.TABLES where table_name ='Guild') Delete Guild
DBCC CHECKIDENT ("Guild", RESEED, 1);

if exists (select * from INFORMATION_SCHEMA.TABLES where table_name ='MEMB_INFO') Delete MEMB_INFO
DBCC CHECKIDENT ("MEMB_INFO", RESEED, 1);

if exists (select * from INFORMATION_SCHEMA.TABLES where table_name ='MEMB_STAT') Delete MEMB_STAT

if exists (select * from INFORMATION_SCHEMA.TABLES where table_name ='T_CGuid') Delete T_CGuid
DBCC CHECKIDENT ("T_CGuid", RESEED, 1);

if exists (select * from INFORMATION_SCHEMA.TABLES where table_name ='nbb_plmarket') Delete nbb_plmarket
DBCC CHECKIDENT ("nbb_plmarket", RESEED, 1);

if exists (select * from INFORMATION_SCHEMA.TABLES where table_name ='T_CurCharName') Delete T_CurCharName

if exists (select * from INFORMATION_SCHEMA.TABLES where table_name ='T_FriendList') Delete T_FriendList

if exists (select * from INFORMATION_SCHEMA.TABLES where table_name ='T_FriendMail') Delete T_FriendMail

if exists (select * from INFORMATION_SCHEMA.TABLES where table_name ='T_FriendMain') Delete T_FriendMain

if exists (select * from INFORMATION_SCHEMA.TABLES where table_name ='T_MasterLevelSystem') Delete T_MasterLevelSystem

if exists (select * from INFORMATION_SCHEMA.TABLES where table_name ='warehouse') Delete warehouse

if exists (select * from INFORMATION_SCHEMA.TABLES where table_name ='VI_CURR_INFO') Delete VI_CURR_INFO

if exists (select * from INFORMATION_SCHEMA.TABLES where table_name ='EVENT_INFO_BC_5TH') Delete EVENT_INFO_BC_5TH

if exists (select * from INFORMATION_SCHEMA.TABLES where table_name ='GiftLog') Delete GiftLog

if exists (select * from INFORMATION_SCHEMA.TABLES where table_name ='item_vpoint_changed') Delete item_vpoint_changed

if exists (select * from INFORMATION_SCHEMA.TABLES where table_name ='Log_TienTe') Delete Log_TienTe

if exists (select * from INFORMATION_SCHEMA.TABLES where table_name ='nbb_quest_daily') Delete nbb_quest_daily

if exists (select * from INFORMATION_SCHEMA.TABLES where table_name ='nbb_timeonline_date') Delete nbb_timeonline_date

if exists (select * from INFORMATION_SCHEMA.TABLES where table_name ='nbb_use_money') Delete nbb_use_money

if exists (select * from INFORMATION_SCHEMA.TABLES where table_name ='nbb_toppoint') Delete nbb_toppoint

if exists (select * from INFORMATION_SCHEMA.TABLES where table_name ='nbb_pl_daily') Delete nbb_pl_daily

if exists (select * from INFORMATION_SCHEMA.TABLES where table_name ='OfficialHelper') Delete OfficialHelper

if exists (select * from INFORMATION_SCHEMA.TABLES where table_name ='SCFS5Quest') Delete SCFS5Quest

if exists (select * from INFORMATION_SCHEMA.TABLES where table_name ='TopResetScore') Delete TopResetScore

if exists (select * from INFORMATION_SCHEMA.TABLES where table_name ='TopReset') Delete TopReset

if exists (select * from INFORMATION_SCHEMA.TABLES where table_name ='T_MU2003_EVENT') Delete T_MU2003_EVENT

if exists (select * from INFORMATION_SCHEMA.TABLES where table_name ='T_ENTER_CHECK_BC') Delete T_ENTER_CHECK_BC

if exists (select * from INFORMATION_SCHEMA.TABLES where table_name ='SMS') Delete SMS

if exists (select * from INFORMATION_SCHEMA.TABLES where table_name ='OptionData') Delete OptionData



USE [MU2003_EVENT_DATA]
GO
if exists (select * from INFORMATION_SCHEMA.TABLES where table_name ='T_MU2003_EVENT') Delete T_MU2003_EVENT

if exists (select * from INFORMATION_SCHEMA.TABLES where table_name ='T_RegCount_Check') Delete T_RegCount_Check


USE [Ranking]
GO
if exists (select * from INFORMATION_SCHEMA.TABLES where table_name ='EVENT_INFO') Delete EVENT_INFO

if exists (select * from INFORMATION_SCHEMA.TABLES where table_name ='EVENT_INFO_BC_5TH') Delete EVENT_INFO_BC_5TH

if exists (select * from INFORMATION_SCHEMA.TABLES where table_name ='T_ENTER_CHECK_BC') Delete T_ENTER_CHECK_BC
Trích dẫn Gửi bởi Trong  [Bạn cần đăng nhập để xem link ! Chưa có tài khoản? Hãy ] 
SET @BonusMoney = 50000000
Cái này chính là số tiền sẽ tặng cho nhân vật đầu tiên nhé.

Code:
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go


ALTER Procedure [dbo].[WZ_CreateCharacter] 

    @AccountID        varchar(10),
    @Name            varchar(10),
    @Class            tinyint

AS
BEGIN

    SET NOCOUNT ON
    SET    XACT_ABORT ON
    DECLARE        @Result        tinyint
    DECLARE @iGUID int
    DECLARE @BonusMoney int
    SET @Result = 0x00    
    SELECT @iGUID = memb_guid FROM MEMB_INFO WHERE memb___id = @AccountID

    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 @BonusMoney = 50000000
                    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, 150, @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, @BonusMoney As Money
            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
Giống như mới khởi tạo được 2 ring 40,80, thì bây giờ các bạn đc add sẵn code item vào thẳng nhân vật, khỏi làm code tân thủ phiền phức, tại nhiều đứa gamer lười biếng và cũng hơi...tồ :">
Dịch và hướng dẫn tiếng Việt: godhoang17
Credits:
ScriptKid
JoniverPH

Trước khi tiến hành, cần những gì:
_Backup DB, mất công lại sai gì nữa.
_Dùng MuMaker or bất cứ phần mềm hỗ trợ lấy code Item.


_Cách lấy Code Item trong MuMaker:
1/ bật mumaker và vào chế độ Items
2/ chọn đại 1 item bất kì, tùy option bạn muốn
3/ nhìn theo góc phải mu maker, có 1 chuỗi ký tự, đó là chuỗi 32 ký tự Serial Item
4/ theo các hướng dẫn sử dụng dưới.


*Đã test trên SQL 2000
Ví dụ: kiếm nhật và các item mũ,áo,... full dòng + 13
Code:
04EFFF000000007F0000000000000000 <-- SERIAL OF sword of assasin (Serial kiếm nhật)
056FFF000000007F0070000000000000 helm
056FFF000000007F0080000000000000 armor
056FFF000000007F0090000000000000 pants
056FFF000000007F00A0000000000000 gloves
056FFF000000007F00B0000000000000 boots
866FFF000000007F00C0000000000000 wings
* nên chép đoạn code từ mumaker ra notepad cho dễ nhìn dễ lưu.
* Luôn nhớ thứ tự bắt buộc sắp xếp Item: VK tay phải, VK tay trái, mũ, áo, quần, tay, chân, cánh, thú hỗ trợ, dây chuyền, nhẫn phải, nhẫn trái.
Làm sai là ra kris hết đấy )
Và đây là đoạn code khi nhập vào query )


Code:
Use [MuOnline]
UPDATE DefaultClassType
SET Inventory = 0x04EFFF000000007F000000000000000004EFFF000000007F0000000000000000056FFF000000007F0070000000000000056FFF000000007F0080000000000000056FFF000000007F0090000000000000056FFF000000007F00A0000000000000056FFF000000007F00B0000000000000866FFF000000007F00C0000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF14081E000000000000D000000000000014101E000000000000D0000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF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FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
WHERE Class = '16'
_Để ý màu đỏ và màu xanh dương trong query này nhé ! màu đỏ là code item kiếm nhật, màu xanh dưới cùng là code class (16 là code DK 1 - chiến binh thì phải)
*Giả sử bạn muốn xóa item nào trên người, ví dụ xóa cây kiếm nhật bên tay phải (do bạn không thích ). Thì chèn 1 đoạn FFF như sau vào và được:


Code:
UPDATE DefaultClassType
SET Inventory = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF04EFFF000000007F0000000000000000056FFF000000007F0070000000000000056FFF000000007F0080000000000000056FFF000000007F0090000000000000056FFF000000007F00A0000000000000056FFF000000007F00B0000000000000866FFF000000007F00C0000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF14081E000000000000D000000000000014101E000000000000D0000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF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FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
WHERE Class = '16'
Như dzậy là tay phải vũ khí đã biến mất

Với những người add sai, hoặc muốn trở về ban đầu (kô có nghĩa là mặc định đc 2 ring) thì dùng query sau:
_C1: backup lại db (100%)
_C2: thay lại với code này (90%)

Code:
UPDATE DefaultClassType
SET Inventory = 0x
WHERE Class = '16'
Rùi đó, bác nào thắc mắc trong topic này mình giúp đc thì giúp, không thì truy cập  [Bạn cần đăng nhập để xem link ! Chưa có tài khoản? Hãy ]  để hỏi ngọn ngành cũng được

ClassID (class 1 mỗi nhóm)
DK = 16
ELF = 32
WIZ = 0
MG = 48
DL = 64
SUM = 80
RF = 96





Các bạn có query muốn chia sẻ có thể post comment dưới đây