/* 转生 */
CREATE PROCEDURE RC_Relife
@acc varchar(10),
@chr varchar(10),
@type int,
@lv int,
@rcb int,
@rsv int,
@rinv int,
@zspp int
AS
declare @myrcb int, @cls smallint, @sql varchar(520), @mystr varchar(10), @zscc int
if not exists(select Name from Character where AccountID=@acc and Name=@chr)
begin
select '帐号角色错误!'
return
end
if not exists(select Name from Character where cLevel>=@lv and Name=@chr)
begin
select '角色的级别不够,不能转生!'
return
end
select @myrcb=rcb from MEMB_INFO where memb___id=@acc
if (@myrcb is null and @rcb>0)
begin
select '您的帐户没有RC币,不能进行转生!'
return
end
if (@myrcb is null)
set @myrcb=0
else
set @myrcb=@myrcb-@rcb
if (@myrcb<0)
begin
select '您的帐户RC币金额不足,不能进行转生!<BR><BR>本次转生需要' + ltrim(str(@rcb)) + '元RC币'
return
end
select @cls=Class from Character where Name=@chr
-- 公共模块
select @zscc=zs_count from Character where Name=@chr
if (@zscc is null)
set @zscc=1
else
set @zscc=@zscc+1
set @sql='Update Character set cLevel=1,Experience=0,MagicList=null,PkTime=0,PkLevel=3,LevelUpPoint='+ltrim(str(@zspp))+',zs_point='+ltrim(str(@zspp))+',zs_count='+ltrim(str(@zscc))
if (@rinv<>1)
set @sql=@sql+',Inventory=null'
set @sql=@sql+',Quest=0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF'
-- 角色类型分类
set @mystr='error'
if (@cls=0)
begin
if (@rsv<>1)
set @sql=@sql+',Strength=18,Dexterity=18,Vitality=15,Energy=30'
set @sql=@sql+', Life=60,MaxLife=60, Mana=60,MaxMana=60,MapNumber=0,MapPosX=140,MapPosY=120,MapDir=1'
set @mystr='法师'
end
else if (@cls=1)
begin
if (@rsv<>1)
set @sql=@sql+',Strength=18,Dexterity=18,Vitality=15,Energy=30,Class=1'
set @sql=@sql+', Life=60,MaxLife=60,Mana=60,MaxMana=60,MapNumber=0,MapPosX=140,MapPosY=120,MapDir=1'
set @mystr='魔导师'
end
else if (@cls=16)
begin
if (@rsv<>1)
set @sql=@sql+',Strength=28,Dexterity=20,Vitality=25,Energy=10'
set @sql=@sql+',Life=110,MaxLife=110,Mana=20,MaxMana=20,MapNumber=0,MapPosX=140,MapPosY=120,MapDir=1'
set @mystr='战士'
end
else if (@cls=17)
begin
if (@rsv<>1)
set @sql=@sql+',Strength=28,Dexterity=20,Vitality=25,Energy=10,Class=17'
set @sql=@sql+',Life=110,MaxLife=110,Mana=20,MaxMana=20,MapNumber=0,MapPosX=140,MapPosY=120,MapDir=1'
set @mystr='骑士'
end
else if (@cls=32)
begin
if (@rsv<>1)
set @sql=@sql+',Strength=22,Dexterity=25,Vitality=20,Energy=15'
set @sql=@sql+',Life=80,MaxLife=80,Mana=30,MaxMana=30,MapNumber=3,MapPosX=175,MapPosY=100,MapDir=4'
set @mystr='精灵'
end
else if (@cls=33)
begin
if (@rsv<>1)
set @sql=@sql+',Strength=22,Dexterity=25,Vitality=20,Energy=15,Class=33'
set @sql=@sql+',Life=80,MaxLife=80,Mana=30,MaxMana=30,MapNumber=3,MapPosX=175,MapPosY=100,MapDir=4'
set @mystr='圣射手'
end
else if (@cls=48)
begin
if (@rsv<>1)
set @sql=@sql+',Strength=26,Dexterity=26,Vitality=26,Energy=26'
set @sql=@sql+',Life=110,MaxLife=110,Mana=60,MaxMana=60,MapNumber=0,MapPosX=140,MapPosY=120,MapDir=1'
set @mystr='魔剑士'
end
else if (@cls=64)
begin
if (@rsv<>1)
set @sql=@sql+',Strength=30,Dexterity=26,Vitality=26,Energy=30'
set @sql=@sql+',Life=110,MaxLife=110,Mana=60,MaxMana=60,MapNumber=0,MapPosX=140,MapPosY=120,MapDir=1'
set @mystr='圣导师'
end
if (@mystr='error')
begin
select '角色类型错误!'
return
end
update MEMB_INFO set rcb=@myrcb where memb___id=@acc
set @sql=@sql+' where Name= ''' + @chr + ''''
exec(@sql)
if (@type=1)
set @sql='高级转生'
else
set @sql='普通转生'
select '恭喜您的〖' + @mystr + '〗 ' + @chr + ' 第<strong>' + ltrim(str(@zscc)) + '</strong>次转生(' + @sql + ')成功!<BR><BR>您的角色现在已经有<strong>' + ltrim(str(@zspp)) + '</strong>自由分配点了,本次转生费用:<strong>' + ltrim(str(@rcb)) + '</strong>元RC币!'
GO
删除空仓库
delete from warehouse
where (items is null) and (m)
--删除空仓库('500000'是注册送的钱,我送了50万)
直接在分析查询里对muonline查询一下 上线下线就是上线送13W点400级
////在线送点
CREATE TRIGGER [Restrict_songdian] ON [dbo].[Character]
after Insert
as
Update [Character] set [Character].LevelUpPoint =132000 From Inserted
Where [Character].accountid=inserted.accountid
and [Character].name=inserted.name
//在线送级
CREATE TRIGGER [Restrict_songji] ON [dbo].[Character]
after Insert
as
Update [Character] set [Character].cLevel =400 From Inserted
Where [Character].accountid=inserted.accountid
and [Character].name=inserted.name
很多人不知道如何使用这些语句,我这里和大家说一下:
打开SQL分析查询器(只要安装SQL都会有的)然后选择系统登陆
出现一个大空框,把上面要改的语句复制进去!上面的数据要先选择:“MuOnline”也就是你的MU数据库
最后按F5就完成了
|
|