-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstat-formula.sk
385 lines (301 loc) · 13.9 KB
/
stat-formula.sk
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
#스텟 목록
#신속 - Sft
#치명 - Ftl
#인내 - Ptn
#숙련 - Skl
#제압 - Spr
#데미지 계산식
# a = Attacker의 방어력 관통 - Victime의 방어력 관통 저항 (a > 0)
# b = Victim의 방어력 - ( Victim의 방어력 * a) (b > 0)
# c = Attacker의 공격력 - b (c > 0)
# d = Attacker의 치명타 확률 - Victime의 치명타 저항
# e = Attacker의 치명타 데미지 증가율
# c의 확률로 치명타가 발생한다면, 데미지는 c * e가 됨
#
#========================================================================================================
#모든 스텟을 새로고침 합니다.
function rpp_Refresh(p:offlineplayer):
rpp_UpdateAll({_p})
rpp_ApplyAll({_p})
#모든 스텟 요소를 적용합니다.
function rpp_ApplyAll(p:offlineplayer):
rpp_ApplyDetail({_p})
rpp_ApplyHpScale({_p})
# 세부 스텟 요소 적용
function rpp_ApplyDetail(p:offlineplayer):
rpp_ApplyHp({_p}) # 최대 체력 적용
rpp_ApplySpd({_p}) # 이동속도 적용
#=============================================================
# 모든 스텟 요소 업데이트
function rpp_UpdateAll(p:offlineplayer):
rpp_UpdatePlayerStat({_p}) # 5대 스텟 업데이트
rpp_UpdatePlayerStatPoint({_p}) # 보유중인 스텟포인트 업데이트
rpp_UpdateDetail({_p}) # 세부 스텟 요소 업데이트
#장비 스텟 업데이트
# 세부 스텟 요소만 업데이트
function rpp_UpdateDetail(p:offlineplayer):
rpp_UpdateHp({_p}) # 체력 업데이트
rpp_UpdateHpR({_p}) # 체력재생 업데이트
rpp_UpdateAtk({_p}) # 공격력 업데이트
rpp_UpdateDef({_p}) # 방어력 업데이트
rpp_UpdateSpd({_p}) # 이동속도 업데이트
rpp_UpdateCrC({_p}) # 치명타 확률 업데이트
rpp_UpdateCrD({_p}) # 치명타 데미지 업데이트
rpp_UpdateDeP({_p}) # 방어력 관통 업데이트
rpp_UpdateCrCI({_p}) # 치명타 저항 업데이트
rpp_UpdateDePI({_p}) # 방어력 관통 저항 업데이트
#=============================================================
#플레이어 데미지 업데이트
function rpp_UpdateDamage(attacker:offlineplayer, victim:entity) :: number:
set {_attacker.atk} to rpp_GetAtk({_attacker}) # 가해자 공격력
set {_attacker.crc} to rpp_GetCrC({_attacker}) # 가해자 치명타 확률
set {_attacker.crd} to rpp_GetCrD({_attacker}) # 가해자 치명타 데미지
set {_attacker.dep} to rpp_GetDeP({_attacker}) # 가해자 방어력 관통
set {_victim.def} to rpp_GetDef({_victim}) # 피해자 방어력
set {_victim.depi} to rpp_GetDePI({_victim}) # 피해자 방어력 관통 저항
set {_victim.crci} to rpp_GetCrCI({_victim}) # 피해자 치명타 저항
#방어력 관통 계산
set {_cal.dep} to {_attacker.dep} - {_victim.depi}
if {_cal.dep} < 0:
set {_cal.dep} to 0
#방어력 계산
set {_cal.def} to {_victim.def} - ({_victim.def} * {_cal.dep})
if {_cal.def} < 0:
set {_cal.def} to 0
#공격력 계산
set {_cal.atk} to {_attacker.atk} - {_cal.def}
if {_cal.atk} <= 0:
return 0
#치명타 계산
set {_cal.crc} to {_attacker.crc} - {_victim.crci}
if {_cal.crc} <= 0:
return {_cal.atk}
#치명타 발동 계산
set {_crc} to rpp_ReconverionRate({_cal.crc})
set {_r} to random integer between 1 and 10000
if {_r} > {_crc}:
return {_cal.atk}
#치명타 데미지 계산
return {_cal.atk} * {_attacker.crd}
#=============================================================
#플레이어 체력 스케일 적용
function rpp_ApplyHpScale(p:offlineplayer):
set {_scale} to rpp_GetHealthScale() # 설정된 체력 스케일 로드
set scaled health of {_p} to {_scale}
#=============================================================
#플레이어 체력 업데이트
function rpp_UpdateHp(p:offlineplayer):
set {_id} to rpp_GetID() # ID
set {_uuid} to uuid of {_p} # uuid
set {_max} to rpp_GetMaxHp() # 설정된 최대 체력 로드
set {_hp} to rpp_GetBasicHp() # 설정된 기초 체력 로드
add rpp_GetPlayerStat_Sft_Hp({_p}) to {_hp} # 신속 스텟으로 올라간 체력 로드
add rpp_GetPlayerStat_Ftl_Hp({_p}) to {_hp} # 치명 스텟으로 올라간 체력 로드
add rpp_GetPlayerStat_Ptn_Hp({_p}) to {_hp} # 인내 스텟으로 올라간 체력 로드
add rpp_GetPlayerStat_Skl_Hp({_p}) to {_hp} # 숙련 스텟으로 올라간 체력 로드
add rpp_GetPlayerStat_Spr_Hp({_p}) to {_hp} # 제압 스텟으로 올라간 체력 로드
if {_hp} > {_max}: # 업그레이드된 체력이 설정된 최대치보다 높다면 체력 제한
set {_hp} to {_max}
set {%{_id}%.Hp::%{_uuid}%} to {_hp}
#플레이어 체력 적용
function rpp_ApplyHp(p:offlineplayer):
set {_id} to rpp_GetID() # ID
set {_uuid} to uuid of {_p} # uuid
set max health of {_p} to {%{_id}%.Hp::%{_uuid}%}
#플레이어 체력 반환
function rpp_GetHp(p:offlineplayer) :: number:
set {_id} to rpp_GetID() # ID
set {_uuid} to uuid of {_p} # uuid
return {%{_id}%.Hp::%{_uuid}%}
#=============================================================
#플레이어 체력재생 업데이트
function rpp_UpdateHpR(p:offlineplayer):
set {_id} to rpp_GetID() # ID
set {_uuid} to uuid of {_p} # uuid
set {_max} to rpp_GetMaxHpR() # 설정된 최대 체력재생 로드
set {_hpr} to rpp_GetBasicHpR() # 설정된 기초 체력재생 로드
add rpp_GetPlayerStat_Sft_HpR({_p}) to {_hpr} # 신속 스텟으로 올라간 체력재생 로드
add rpp_GetPlayerStat_Ftl_HpR({_p}) to {_hpr} # 치명 스텟으로 올라간 체력재생 로드
add rpp_GetPlayerStat_Ptn_HpR({_p}) to {_hpr} # 인내 스텟으로 올라간 체력재생 로드
add rpp_GetPlayerStat_Skl_HpR({_p}) to {_hpr} # 숙련 스텟으로 올라간 체력재생 로드
add rpp_GetPlayerStat_Spr_HpR({_p}) to {_hpr} # 제압 스텟으로 올라간 체력재생 로드
if {_hpr} > {_max}: # 업그레이드된 체력재생이 설정된 최대치보다 높다면 체력재생 제한
set {_hpr} to {_max}
set {%{_id}%.HpR::%{_uuid}%} to {_hpr}
#플레이어 체력 재생 적용
function rpp_ApplyHpR(p:offlineplayer):
set {_id} to rpp_GetID() # ID
set {_uuid} to uuid of {_p} # uuid
add {%{_id}%.HpR::%{_uuid}%} to health of {_p}
#플레이어 체력재생 반환
function rpp_GetHpR(p:offlineplayer) :: number:
set {_id} to rpp_GetID() # ID
set {_uuid} to uuid of {_p} # uuid
return {%{_id}%.HpR::%{_uuid}%}
#=============================================================
#플레이어 공격력 업데이트
function rpp_UpdateAtk(p:offlineplayer):
set {_id} to rpp_GetID() # ID
set {_uuid} to uuid of {_p} # uuid
set {_max} to rpp_GetMaxAtk() # 설정된 최대 공격력 로드
set {_atk} to rpp_GetBasicAtk() # 설정된 기초 공격력 로드
add rpp_GetPlayerStat_Sft_Atk({_p}) to {_atk} # 신속 스텟으로 올라간 공격력 로드
add rpp_GetPlayerStat_Ftl_Atk({_p}) to {_atk} # 치명 스텟으로 올라간 공격력 로드
add rpp_GetPlayerStat_Ptn_Atk({_p}) to {_atk} # 인내 스텟으로 올라간 공격력 로드
add rpp_GetPlayerStat_Skl_Atk({_p}) to {_atk} # 숙련 스텟으로 올라간 공격력 로드
add rpp_GetPlayerStat_Spr_Atk({_p}) to {_atk} # 제압 스텟으로 올라간 공격력 로드
if {_atk} > {_max}: # 업그레이드된 공격력이 설정된 최대치보다 높다면 공격력 제한
set {_atk} to {_max}
set {%{_id}%.Atk::%{_uuid}%} to {_atk}
#플레이어 공격력 반환
function rpp_GetAtk(p:offlineplayer) :: number:
set {_id} to rpp_GetID() # ID
set {_uuid} to uuid of {_p} # uuid
return {%{_id}%.Atk::%{_uuid}%}
#=============================================================
#플레이어 방어력 업데이트
function rpp_UpdateDef(p:offlineplayer):
set {_id} to rpp_GetID() # ID
set {_uuid} to uuid of {_p} # uuid
set {_max} to rpp_GetMaxDef() # 설정된 최대 방어력 로드
set {_def} to rpp_GetBasicDef() # 설정된 기초 방어력 로드
add rpp_GetPlayerStat_Sft_Def({_p}) to {_def} # 신속 스텟으로 올라간 방어력 로드
add rpp_GetPlayerStat_Ftl_Def({_p}) to {_def} # 치명 스텟으로 올라간 방어력 로드
add rpp_GetPlayerStat_Ptn_Def({_p}) to {_def} # 인내 스텟으로 올라간 방어력 로드
add rpp_GetPlayerStat_Skl_Def({_p}) to {_def} # 숙련 스텟으로 올라간 방어력 로드
add rpp_GetPlayerStat_Spr_Def({_p}) to {_def} # 제압 스텟으로 올라간 방어력 로드
if {_def} > {_max}: # 업그레이드된 방어력이 설정된 최대치보다 높다면 방어력 제한
set {_def} to {_max}
set {%{_id}%.Def::%{_uuid}%} to {_def}
#플레이어 방어력 반환
function rpp_GetDef(p:offlineplayer) :: number:
set {_id} to rpp_GetID() # ID
set {_uuid} to uuid of {_p} # uuid
return {%{_id}%.Def::%{_uuid}%}
#=============================================================
#플레이어 이동속도 업데이트
function rpp_UpdateSpd(p:offlineplayer):
set {_id} to rpp_GetID() # ID
set {_uuid} to uuid of {_p} # uuid
set {_basic} to rpp_ConvertRate(rpp_GetBasicSpd()) # 기본 이속 증가 비율
set {_max} to rpp_ConvertRate(rpp_GetMaxSpd()) - {_basic} # 최대치 - 기본 이속
add rpp_GetPlayerStat_Sft_Spd({_p}) to {_spd}
add rpp_GetPlayerStat_Ftl_Spd({_p}) to {_spd}
add rpp_GetPlayerStat_Ptn_Spd({_p}) to {_spd}
add rpp_GetPlayerStat_Skl_Spd({_p}) to {_spd}
add rpp_GetPlayerStat_Spr_Spd({_p}) to {_spd}
if {_spd} > {_max}:
set {_spd} to {_max}
set {%{_id}%.Spd::%{_uuid}%} to (0.2 * {_basic}) + (0.2 * {_spd}) # 기본 이속 * 기본이속 비율 + 추가이속
#플레이어 이동속도 적용
function rpp_ApplySpd(p:offlineplayer):
set {_id} to rpp_GetID() # ID
set {_uuid} to uuid of {_p} # uuid
set walk speed of {_p} to {%{_id}%.Spd::%{_uuid}%}
set fly speed of {_p} to {%{_id}%.Spd::%{_uuid}%}
#플레이어 이동속도 반환
function rpp_GetSpd(p:offlineplayer) :: number:
set {_id} to rpp_GetID() # ID
set {_uuid} to uuid of {_p} # uuid
return {%{_id}%.Spd::%{_uuid}%}
#=============================================================
#플레이어 치명타 확률 업데이트
function rpp_UpdateCrC(p:offlineplayer):
set {_id} to rpp_GetID() # ID
set {_uuid} to uuid of {_p} # uuid
set {_crc} to rpp_ConvertRate(rpp_GetBasicCrC())
set {_max} to rpp_ConvertRate(rpp_GetMaxCrC())
add rpp_GetPlayerStat_Sft_CrC({_p}) to {_crc}
add rpp_GetPlayerStat_Ftl_CrC({_p}) to {_crc}
add rpp_GetPlayerStat_Ptn_CrC({_p}) to {_crc}
add rpp_GetPlayerStat_Skl_CrC({_p}) to {_crc}
add rpp_GetPlayerStat_Spr_CrC({_p}) to {_crc}
if {_crc} > {_max}:
set {_crc} to {_max}
set {%{_id}%.CrC::%{_uuid}%} to {_crc}
#플레이어 치명타 확률 반환
function rpp_GetCrC(p:offlineplayer) :: number:
set {_id} to rpp_GetID() # ID
set {_uuid} to uuid of {_p} # uuid
return {%{_id}%.CrC::%{_uuid}%}
#=============================================================
#플레이어 치명타 데미지 업데이트
function rpp_UpdateCrD(p:offlineplayer):
set {_id} to rpp_GetID() # ID
set {_uuid} to uuid of {_p} # uuid
set {_crd} to rpp_ConvertRate(rpp_GetBasicCrD())
set {_max} to rpp_ConvertRate(rpp_GetMaxCrD())
add rpp_GetPlayerStat_Sft_CrD({_p}) to {_crd}
add rpp_GetPlayerStat_Ftl_CrD({_p}) to {_crd}
add rpp_GetPlayerStat_Ptn_CrD({_p}) to {_crd}
add rpp_GetPlayerStat_Skl_CrD({_p}) to {_crd}
add rpp_GetPlayerStat_Spr_CrD({_p}) to {_crd}
if {_crd} > {_max}:
set {_crd} to {_max}
set {%{_id}%.CrD::%{_uuid}%} to {_crd}
#플레이어 치명타 데미지 반환
function rpp_GetCrD(p:offlineplayer) :: number:
set {_id} to rpp_GetID() # ID
set {_uuid} to uuid of {_p} # uuid
return {%{_id}%.CrD::%{_uuid}%}
#=============================================================
#플레이어 방어력 관통 업데이트
function rpp_UpdateDeP(p:offlineplayer):
set {_id} to rpp_GetID() # ID
set {_uuid} to uuid of {_p} # uuid
set {_dep} to rpp_ConvertRate(rpp_GetBasicDeP())
set {_max} to rpp_ConvertRate(rpp_GetMaxDeP())
add rpp_GetPlayerStat_Sft_DeP({_p}) to {_dep}
add rpp_GetPlayerStat_Ftl_DeP({_p}) to {_dep}
add rpp_GetPlayerStat_Ptn_DeP({_p}) to {_dep}
add rpp_GetPlayerStat_Skl_DeP({_p}) to {_dep}
add rpp_GetPlayerStat_Spr_DeP({_p}) to {_dep}
if {_dep} > {_max}:
set {_dep} to {_max}
set {%{_id}%.DeP::%{_uuid}%} to {_dep}
#플레이어 방어력 관통 반환
function rpp_GetDeP(p:offlineplayer) :: number:
set {_id} to rpp_GetID() # ID
set {_uuid} to uuid of {_p} # uuid
return {%{_id}%.DeP::%{_uuid}%}
#=============================================================
#플레이어 치명타 저항 업데이트
function rpp_UpdateCrCI(p:offlineplayer):
set {_id} to rpp_GetID() # ID
set {_uuid} to uuid of {_p} # uuid
set {_crci} to rpp_ConvertRate(rpp_GetBasicCrCI())
set {_max} to rpp_ConvertRate(rpp_GetMaxCrCI())
add rpp_GetPlayerStat_Sft_CrCI({_p}) to {_crci}
add rpp_GetPlayerStat_Ftl_CrCI({_p}) to {_crci}
add rpp_GetPlayerStat_Ptn_CrCI({_p}) to {_crci}
add rpp_GetPlayerStat_Skl_CrCI({_p}) to {_crci}
add rpp_GetPlayerStat_Spr_CrCI({_p}) to {_crci}
if {_crci} > {_max}:
set {_crci} to {_max}
set {%{_id}%.CrCI::%{_uuid}%} to {_crci}
#플레이어 치명타 저항 반환
function rpp_GetCrCI(p:offlineplayer) :: number:
set {_id} to rpp_GetID() # ID
set {_uuid} to uuid of {_p} # uuid
return {%{_id}%.CrCI::%{_uuid}%}
#=============================================================
#플레이어 방어력 관통 저항 업데이트
function rpp_UpdateDePI(p:offlineplayer):
set {_id} to rpp_GetID() # ID
set {_uuid} to uuid of {_p} # uuid
set {_depi} to rpp_ConvertRate(rpp_GetBasicDePI())
set {_max} to rpp_ConvertRate(rpp_GetMaxDePI())
add rpp_GetPlayerStat_Sft_DePI({_p}) to {_depi}
add rpp_GetPlayerStat_Ftl_DePI({_p}) to {_depi}
add rpp_GetPlayerStat_Ptn_DePI({_p}) to {_depi}
add rpp_GetPlayerStat_Skl_DePI({_p}) to {_depi}
add rpp_GetPlayerStat_Spr_DePI({_p}) to {_depi}
if {_depi} > {_max}:
set {_depi} to {_max}
set {%{_id}%.DePI::%{_uuid}%} to {_depi}
#플레이어 방어력 관통 저항 반환
function rpp_GetDePI(p:offlineplayer) :: number:
set {_id} to rpp_GetID() # ID
set {_uuid} to uuid of {_p} # uuid
return {%{_id}%.DePI::%{_uuid}%}
#=============================================================