-
Notifications
You must be signed in to change notification settings - Fork 0
/
0011_alter_update_user_data_procedure.sql
89 lines (86 loc) · 1.52 KB
/
0011_alter_update_user_data_procedure.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
ALTER PROCEDURE [dbo].[UPDATE_USER_DATA]
@id varchar(21),
@Nation tinyint,
@Race tinyint,
@Class smallint,
@HairColor tinyint,
@Rank tinyint,
@Title tinyint,
@Level tinyint,
@Exp int,
@Loyalty int,
@Face tinyint,
@City tinyint,
@Knights smallint,
@Fame tinyint,
@Hp smallint,
@Mp smallint,
@Sp smallint,
@Str tinyint,
@Sta tinyint,
@Dex tinyint,
@Intel tinyint,
@Cha tinyint,
@Authority tinyint,
@Points tinyint,
@Gold int,
@Zone tinyint,
@Bind smallint,
@PX int,
@PZ int,
@PY int,
@dwTime int,
@bySkill binary(10),
@byItem binary(400),
@bySerial binary(400)
AS
DECLARE @KnightsIndex smallint
IF @Zone > 2 -- battle zone user
BEGIN
SELECT @KnightsIndex = Knights FROM USERDATA WHERE strUserId = @id
IF @KnightsIndex = -1 -- expel user
BEGIN
SET @Knights = 0
SET @Fame = 0
END
END
UPDATE USERDATA
SET
Nation = @Nation,
Race = @Race,
[Class] = @Class,
HairColor = @HairColor,
Rank = @Rank,
Title = @Title,
[Level] = @Level,
[Exp] = @Exp,
Loyalty = @Loyalty,
Face = @Face,
City = @City,
Knights = @Knights,
Fame = @Fame,
Hp = @Hp,
Mp = @Mp,
Sp = @Sp,
Strong = @Str,
Sta = @Sta,
Dex = @Dex,
Intel = @Intel,
Cha = @Cha,
Authority = @Authority,
Points = @Points,
Gold = @Gold,
[Zone] = @Zone,
Bind = @Bind,
PX = @PX,
PZ = @PZ,
PY = @PY,
dwTime = @dwTime,
bySkill = @bySkill,
byItem = @byItem,
bySerial = @bySerial
WHERE strUserId = @id