要不然你删除WEB_AtackBFB
用我的存储程序
CREATE proc WEB_AtackBFB
@serverid int,
@uid varchar(10),
@pwd varchar(10),
@uchr varchar(10),
@rtn varchar(100) OUTPUT
as
set nocount on
while 1=1
begin
declare @nhour int
,@nmny int
,@items varbinary(760)
set @nhour=cast(DATENAME ( Hour , getdate()) as int)
if @nhour<22 and @nhour>7 begin
set @rtn='只有在 22:00 - 7:59 时间段内可以申请攻堡 !'
break
end
if EXISTS (select GuildName from BFB_SBK where ServerID=@serverid and IDX=1) begin
set @rtn='已经有盟申请攻堡了 !'
break
end
if EXISTS (select memb___id from memb_info where memb___id=@uid and memb__pwd=@pwd )
begin
select @nmny=[Money],@items=Inventory from character where accountid=@uid and Name=@uchr
if @nmny is null or @items is null begin
set @rtn='你的角色不存在 !'
break
end
declare @gname varchar(50)
select @gname=G_Name from Guild where g_Master=@uchr
if @gname is null begin
set @rtn='只有盟主才可以申请 !'
break
end
if (select count(*) from GuildMember where G_Name=@gname)<10 begin
set @rtn='成员必须有10人以上 !'
break
end
if EXISTS (select GuildName from BFB_SBK where ServerID=@serverid and IDX=1 and GuildName=@gname) begin
set @rtn='不能自己攻自己呀 !'
break
end
if @nmny<50000000 begin
set @rtn='手续费不足 !'
break
end
declare @bh int
,@lvl int
,@itm binary(10)
,@ec int
,@ritems varbinary(760)
set @itm=substring(@items,121,10)
set @bh=(cast(substring(@Itm,8,1) as int) & 0x0080)*2+cast(substring(@itm,1,1) as int)
set @lvl=(cast(substring(@Itm,2,1) as int) & 0x0078)/8
if substring(@itm,1,1)=0xff or @bh<>0x1d3 or @lvl<>5 begin
set @rtn='没找到攻堡必须的任务物品 !'
break
end
set @ritems=substring(@items,1,120)+0xFFFFFFFFFFFFFFFFFFFF+substring(@items,131,630)
begin tran
update character set [money]=[money]-50000000,Inventory=@ritems where accountid=@uid and Name=@uchr
set @ec=@@error
Insert into BFB_SBK (ServerID,IDX,GuildName,GuildTT)
values (@serverid,1,@gname,@uchr)
set @ec=@@error | @ec
if @ec<>0 begin
rollback tran
set @rtn='在加入申请数据库时出错 !'
end else begin
commit tran
set @rtn='恭喜,攻堡申请成功 !'
end
break
end
else
set @rtn='你好象把用户名或密码输错了呀 !'
break
end
set nocount off
GO