友情提示:奇迹私服无保障,喜爱奇迹请支持官方奇迹MU!

游戏资料库

你当前的位置:奇迹私发网 > 技术资料 > 内容

技术资料

总结SQL语句


取消新人注册送点
CREATE TRIGGER [Restrict_IntLUP] ON [dbo].[Character]
after Insert
as
Update [Character] set [Character].LevelUpPoint=0 From Inserted
Where [Character].accountid=inserted.accountid
and [Character].name=inserted.name

新手送3333点(具体送多少修改LevelUpPoint=3333 From Inserted )
CREATE TRIGGER [Restrict_IntLUP] ON [dbo].[Character]
after Insert
as
Update [Character] set [Character].LevelUpPoint=3333 From Inserted
Where [Character].accountid=inserted.accountid
and [Character].name=inserted.name

33人战盟带旗(具体送多少修改having count(*)>32))),比如35就修改having count(*)>34)
use muonline
update extchrdata set stat=3 where name in (select G_master from guild where G_name in (select G_name from guildmember where G_name in (select g_name from guildmember group by g_name having count(*)>32)))

更改角色名

use muonline
declare @oldname nvarchar(10),@newname nvarchar(10)
--在单引号里面输入要查询的角色名,,前是老名字,后是新名字。
set @oldname = '老名字'
set @newname = '新名字'

if @newname in (select name from character where name=@newname)
print '数据库里已有相同角色名,不进行更名操作!'
else
begin
update accountcharacter set gameid1 = @newname where gameid1 = @oldname
update accountcharacter set gameid2 = @newname where gameid2 = @oldname
update accountcharacter set gameid3 = @newname where gameid3 = @oldname
update accountcharacter set gameid4 = @newname where gameid4 = @oldname
update accountcharacter set gameid5 = @newname where gameid5 = @oldname
update accountcharacter set gameidc = @newname where gameidc = @oldname

update character set name = @newname where name = @oldname
update guild set g_master = @newname where g_master = @oldname
update guildmember set name = @newname where name = @oldname
update optiondata set name = @newname where name = @oldname
end

清空有全属装备的仓库

update warehouse set Items=null where (charindex(0xbf,items)%10=8) or (charindex(0xff,items)%10=8)
or (charindex(0x7f,items)%10=8) or (charindex(0x3f,items)%10=8)

罗兰攻城
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[GCGuild]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[GCGuild]
GO

CREATE TABLE [dbo].[GCGuild] (
[IDX] [int] NOT NULL ,
[GuildName] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[GuildIdx] [int] NOT NULL ,
[GuildMZName] [varchar] (10) NOT NULL
) ON [PRIMARY]
GO

insert into gcguild (IDX,GuildName,GuildIdx,GuildMZName) VALUES (100,' ',0,' ')
insert into gcguild (IDX,GuildName,GuildIdx,GuildMZName) VALUES (101,' ',0,' ')
insert into gcguild (IDX,GuildName,GuildIdx,GuildMZName) VALUES (102,' ',0,' ')
insert into gcguild (IDX,GuildName,GuildIdx,GuildMZName) VALUES (103,' ',0,' ')
insert into gcguild (IDX,GuildName,GuildIdx,GuildMZName) VALUES (104,' ',0,' ')
insert into gcguild (IDX,GuildName,GuildIdx,GuildMZName) VALUES (200,' ',0,' ')
insert into gcguild (IDX,GuildName,GuildIdx,GuildMZName) VALUES (201,' ',0,' ')
insert into gcguild (IDX,GuildName,GuildIdx,GuildMZName) VALUES (202,' ',0,' ')
insert into gcguild (IDX,GuildName,GuildIdx,GuildMZName) VALUES (203,' ',0,' ')
insert into gcguild (IDX,GuildName,GuildIdx,GuildMZName) VALUES (204,' ',0,' ')

GO

删除空仓库
delete from warehouse
where (items is null) and (money = '500000')
--删除空仓库('500000'是注册送的钱,我送了50万)

解封

use muonline
UPDATE [MuOnline].[dbo].[Character]
SET [CtlCode]='0'
WHERE Name='名字'

新人送2转

CREATE TRIGGER [zscount] ON [dbo].[Character]
after Insert
as
Update [Character] set [Character].zs_count=2
From Inserted
Where Inserted.zs_count=0 and [Character].accountid=inserted.accountid
and [Character].name=inserted.name

减少SQL日志的方法

backup log MuOnline with NO_LOG
backup log MuOnline with TRUNCATE_ONLY
DBCC SHRINKDATABASE(MuOnline)
--将上面的语句多次执行,直到日志文件缩小。

删除申请帐号后从未上过线

delete from memb_info where memb___id in (select memb___id from memb_stat)

删除没有100级人物的帐号

delete from memb_info where memb___id not in (select DISTINCT accountid from character where clevel>=100)
delete from warehouse where accountid not in (select DISTINCT accountid from character where clevel>=100)
delete from character where accountid not in (select memb___id from memb_info)

注册帐号送戒指

CREATE TRIGGER [1] ON [dbo].[Character]
after Insert
as
Update [Character] set [Character].Inventory=0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB408FFFFFFFEED8000FBB410FFFFFFFEEC80007CFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF From Inserted
Where [Character].accountid=inserted.accountid
and [Character].name=inserted.name

淡淡网络内部防复制SQL代码(支持最新996X)
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO

CREATE TRIGGER [dbo].[clear_copyitems] ON [dbo].[warehouse]
FOR UPDATE
AS
BEGIN

IF UPDATE(items)
BEGIN
DECLARE @al_acid varchar(10)
DECLARE @al_name varchar(10)

DECLARE @whItems AS binary(1200)
DECLARE @bdItems AS binary(760)

DECLARE @bItem AS binary(1)
DECLARE @wItem AS binary(1)

DECLARE @bItemId AS binary(4)
DECLARE @WItemId AS binary(4)

DECLARE @i AS int
DECLARE @ii AS int

DECLARE @find AS int

SET @find=0

SELECT @al_acid=inserted.accountid,@whItems=inserted.items FROM inserted

SELECT @al_name=GameIDC FROM AccountCharacter WHERE id=@al_acid
SELECT @bdItems=inventory FROM character WHERE accountid=@al_acid AND name=@al_name

SET @i=0
WHILE @i<120
BEGIN
SET @wItem=SUBSTRING(@whItems,@i*10+1,1)
SET @wItemId=SUBSTRING(@whItems,@i*10+4,4)

IF @wItem<>0xFF AND @wItemId<>0x00000000 AND @wItem IS NOT NULL AND @wItemId IS NOT NULL
BEGIN
SET @ii=0
WHILE @ii<76
BEGIN
SET @bItem=SUBSTRING(@bdItems,@ii*10+1,1)
SET @bItemId=SUBSTRING(@bdItems,@ii*10+4,4)
IF @bItem<>0xFF AND @bItemId<>0x00000000
BEGIN
IF @bItem=@wItem AND @bItemId=@wItemId
BEGIN
SET @whitems=SUBSTRING(@whitems,1,@i*10)+0xFFFFFFFFFFFFFFFFFFFF+SUBSTRING(@whitems,(1+@i)*10+1,(76-1-@i)*10)
SET @find=1
SET @ii=76
END
SET @ii=@ii+1
END
END

SET @i=@i+1
END
END
IF @find=1
BEGIN
UPDATE warehouse SET items=@whitems WHERE accountid=@al_acid
END

END
END
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO

sql 清除库
如果你运行建议备份后否自后果自负
use MuOnline
DELETE FROM [dbo].[Character]
DELETE FROM [dbo].[vCharacterPreview]
DELETE FROM [dbo].[AccountCharacter]
DELETE FROM [dbo].[Guild]
DELETE FROM [dbo].[GuildMember]
DELETE FROM [dbo].[MANG_INFO]
DELETE FROM [dbo].[MEMB_DETA]
DELETE FROM [dbo].[MEMB_INFO]
DELETE FROM [dbo].[MUMNG_AUTH_SKILL]
DELETE FROM [dbo].[MUMNG_MANG_INFO]
DELETE FROM [dbo].[MUMNG_SKILL_INFO]
DELETE FROM [dbo].[OptionData]
DELETE FROM [dbo].[UseLog]
DELETE FROM [dbo].[VI_CURR_INFO]
DELETE FROM [dbo].[warehouse]

本文标签:

如需转载,请注明本文链接:http://www.598mu.com/jishu/201304033789.html



上一篇:卓越控制参数易语言源码

下一篇:用FTP Serv-U轻松搭建奇迹私服FTP服务器