数据库里改存储过程:USPNewCreateChar如下:
CREATE proc USPNewCreateChar @charindex int,@charid varchar(14),@userindex int,@kind tinyint,@edu tinyint,@jungsama tinyint,
@colorhair tinyint,@colorUpper tinyint,@colorLower tinyint,@cellx smallint,@cellz smallint
as
set nocount on
declare @flag smallint
declare @Count smallint
if @charid = \'\'
begin
set @flag = 150
select @flag
return
end
if exists (select charid from charinfo_base where charid = @charid)
begin
set @flag=3
select @flag
return
end
else
begin
select @Count = count(charid) from Charinfo_base where userindex = @userindex
if @Count >= 3
begin
set @flag = 7
select @flag
return
end
declare @NickName varchar(14)
declare @Job smallint
declare @Level tinyint
declare @CharExp int
declare @CharFame int
declare @guilty int
declare @adminchar tinyint
declare @InbornPoint smallint
declare @Strength smallint
declare @Osung smallint
declare @WonyYang smallint
declare @speed smallint
declare @Magic smallint
declare @Hp int
declare @HpMax int
declare @Negong smallint
declare @NegongMax smallint
declare @fatigue smallint
declare @fatigueMax smallint
declare @zonenum tinyint
--declare @cellx smallint
--declare @cellz smallint
-- ?:?:? ?? ? ??
set @NickName =\'\'
set @Job = 0
set @Level = 1
set @CharExp = 0
set @CharFame = 1
set @guilty = 0
set @adminchar =0
set @InbornPoint =2000 (在这里加你要分新人的先天点,比如我加2000点)
set @Negong = 59
set @NegongMax = 59
-- ?:?:? ???? ?? ???
if @jungsama = 1
begin
set @Strength = 12
set @Osung = 8
set @WonyYang = 8
set @speed = 12
set @Magic = 15
set @Hp = 38
set @HpMax = 38
set @fatigue =21
set @fatigueMax =21
set @zonenum = 1
end
else if @jungsama = 2
begin
set @Strength = 10
set @Osung = 15
set @WonyYang = 10
set @speed = 10
set @Magic = 10
set @Hp = 48
set @HpMax = 48
set @fatigue = 34
set @fatigueMax = 34
set @zonenum = 2
end
else if @jungsama = 3
begin
set @Strength = 10
set @Osung = 12
set @WonyYang = 15
set @speed = 10
set @Magic = 8
set @Hp = 70
set @HpMax = 70
set @fatigue = 39
set @fatigueMax = 39
set @zonenum = 3
end
else
begin
set @flag=100
select @flag
return
end
begin tran
insert charinfo_base
values (@charid,@userindex,@kind,@edu,@jungsama,@nickname,@job,@level,@charexp,@charfame,@strength,@osung,@wonyyang,@speed,@magic,
@inbornpoint,@hp,@hpmax,@negong,@negongmax,@fatigue,@fatiguemax,@colorhair,@colorupper,@colorlower,@guilty,@zonenum,@cellx,@cellz,@adminchar)
if @@rowcount <> 1
begin
rollback tran
set @flag = 100
select @flag
return
end
insert charinfo_time
values(@charid,@userindex,0,0,0,getdate(),getdate(),getdate())
if @@rowcount <> 1
begin
rollback tran
set @flag = 100
select @flag
return
end
insert charinfo_skill (charid)
values (@charid)
if @@rowcount <> 1
begin
rollback tran
set @flag = 100
select @flag
return
end
insert charinfo_option (charid)
values (@charid)
if @@rowcount <> 1
begin
(责任编辑:admin) |