USE [PS_GameData]
GO
/****** Object: StoredProcedure [dbo].[usp_Save_Char_Info_E] Script Date: 07/18/2014 15:10:40 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER Proc [dbo].[usp_Save_Char_Info_E]
@CharID int,
@Level int, @
[Only registered and activated users can see links. Click Here To Register...]Point smallint, @
[Only registered and activated users can see links. Click Here To Register...] smallint, @
[Only registered and activated users can see links. Click Here To Register...] smallint,
@Dex smallint,
@Rec smallint,
@Int smallint, @
[Only registered and activated users can see links. Click Here To Register...] smallint,
@Luc smallint,
@Hp smallint,
@Mp smallint,
@Sp smallint,
@Map smallint,
@Dir smallint,
@Exp int,
@Money int,
@Posx varchar(50),
@Posy varchar(50),
@Posz varchar(50),
@Hg int,
@Vg int,
@Cg int,
@Og int,
@Ig int,
@K1 int = null,
@K2 int = null,
@K3 int = null,
@K4 int = null,
@KillLevel tinyint,
@DeadLevel tinyint
AS
SET NOCOUNT ON
DECLARE @ServerID int,
@Grow int, @
[Only registered and activated users can see links. Click Here To Register...]p bigint,
@PosxR real,
@PosyR real,
@PoszR real
SET @ServerID = 1
IF (ISNumeric(@Posx) = 1 and ISNumeric(@Posy) = 1 and ISNumeric(@Posz) = 1)
BEGIN
SET @PosxR = CAST(@Posx as real)
SET @PosyR = CAST(@Posy as real)
SET @PoszR = CAST(@Posz as real)
END
ELSE
BEGIN
SET @Map = 42
SET @PosxR = 66.5
SET @PosYR = 2.0
SET @PosZR = 52.6
END
UPDATE Chars WITH(XLOCK)
SET [Level] = @Level, StatPoint = @
[Only registered and activated users can see links. Click Here To Register...]Point, SkillPoint = @
[Only registered and activated users can see links. Click Here To Register...],
[Str] = @
[Only registered and activated users can see links. Click Here To Register...], dex = @Dex, Rec = @Rec, [int] = @Int, Wis = @
[Only registered and activated users can see links. Click Here To Register...], Luc = @Luc,
HP = @Hp, Mp = @Mp, Sp = @Sp,
Map = @Map, dir = @Dir, [exp] = @Exp, [money] = @Money,
PosX = @Posx, PosY = @PosY, PosZ = @PosZ, hg = @Hg, vg = @Vg, cg = @Cg, og = @Og, ig = @Ig,
KillLevel=@KillLevel, DeadLevel=@DeadLevel,LeaveDate=GETDATE(),
K1 = CASE WHEN @K1 IS NOT NULL THEN @K1 ELSE K1 END,
K2 = CASE WHEN @K2 IS NOT NULL THEN @K2 ELSE K2 END,
K3 = CASE WHEN @K3 IS NOT NULL THEN @K3 ELSE K3 END,
K4 = CASE WHEN @K4 IS NOT NULL THEN @K4 ELSE K4 END
WHERE CharID = @CharID
IF(@@ERROR = 0 AND @@ROWCOUNT = 1)
BEGIN
RETURN 1
END
ELSE
BEGIN
RETURN -1
END
SET NOCOUNT OFF