-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathAttributeManager.cpp
396 lines (363 loc) · 21.5 KB
/
AttributeManager.cpp
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
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
#include "AttributeManager.h"
#include "GameNetwork.h"
#include "NtlAvatar.h"
#include <ppl.h>
AttributeManager::AttributeManager()
{
}
AttributeManager::~AttributeManager()
{
}
/*
By Luiz45
He will load Attributes and compress then into a readable field to send a packet
*/
void AttributeManager::LoadAttribute(sAVATAR_ATTRIBUTE* pAttribute)
{
//Load All Attributes One time only - Luiz IN ORDER --Kalisto
pAvatarMaintAttribute.dwBaseMaxLP = pAttribute->dwBaseMaxLP;
pAvatarMaintAttribute.dwLastMaxLP = pAttribute->dwLastMaxLP;
pAvatarMaintAttribute.wBaseMaxEP = pAttribute->wBaseMaxEP;
pAvatarMaintAttribute.wLastMaxEP = pAttribute->wLastMaxEP;
pAvatarMaintAttribute.wBaseMaxRP = pAttribute->wBaseMaxRP;
pAvatarMaintAttribute.wLastMaxRP = pAttribute->wLastMaxRP;
pAvatarMaintAttribute.wBaseStr = pAttribute->wBaseStr;
pAvatarMaintAttribute.wLastStr = pAttribute->wLastStr;
pAvatarMaintAttribute.wBaseCon = pAttribute->wBaseCon;
pAvatarMaintAttribute.wLastCon = pAttribute->wLastCon;
pAvatarMaintAttribute.wBaseFoc = pAttribute->wBaseFoc;
pAvatarMaintAttribute.wLastFoc = pAttribute->wLastFoc;
pAvatarMaintAttribute.wBaseDex = pAttribute->wBaseDex;
pAvatarMaintAttribute.wLastDex = pAttribute->wLastDex;
pAvatarMaintAttribute.wBaseSol = pAttribute->wBaseSol;
pAvatarMaintAttribute.wLastSol = pAttribute->wLastSol;
pAvatarMaintAttribute.wBaseEng = pAttribute->wBaseEng;
pAvatarMaintAttribute.wLastEng = pAttribute->wLastEng;
pAvatarMaintAttribute.wLastRpRegen = pAttribute->wLastRpRegen;
pAvatarMaintAttribute.wLastRpDimimutionRate = pAttribute->wLastRpDimimutionRate;
pAvatarMaintAttribute.wBasePhysicalOffence = pAttribute->wBasePhysicalOffence;
pAvatarMaintAttribute.wLastPhysicalOffence = pAttribute->wLastPhysicalOffence;
pAvatarMaintAttribute.wBasePhysicalDefence = pAttribute->wBasePhysicalDefence;
pAvatarMaintAttribute.wLastPhysicalDefence = pAttribute->wLastPhysicalDefence;
pAvatarMaintAttribute.wBaseEnergyOffence = pAttribute->wBaseEnergyOffence;
pAvatarMaintAttribute.wLastEnergyOffence = pAttribute->wLastEnergyOffence;
pAvatarMaintAttribute.wBaseEnergyDefence = pAttribute->wBaseEnergyDefence;
pAvatarMaintAttribute.wLastEnergyDefence = pAttribute->wLastEnergyDefence;
pAvatarMaintAttribute.wBaseAttackRate = pAttribute->wBaseAttackRate;
pAvatarMaintAttribute.wLastAttackRate = pAttribute->wLastAttackRate;
pAvatarMaintAttribute.wBaseDodgeRate = pAttribute->wBaseDodgeRate;
pAvatarMaintAttribute.wLastDodgeRate = pAttribute->wLastDodgeRate;
pAvatarMaintAttribute.wBaseBlockRate = pAttribute->wBaseBlockRate;
pAvatarMaintAttribute.wLastBlockRate = pAttribute->wLastBlockRate;
pAvatarMaintAttribute.wBaseCurseSuccessRate = pAttribute->wBaseCurseSuccessRate;
pAvatarMaintAttribute.wLastCurseSuccessRate = pAttribute->wLastCurseSuccessRate;
pAvatarMaintAttribute.wBaseCurseToleranceRate = pAttribute->wBaseCurseToleranceRate;
pAvatarMaintAttribute.wLastCurseToleranceRate = pAttribute->wLastCurseToleranceRate;
pAvatarMaintAttribute.wBasePhysicalCriticalRate = pAttribute->wBasePhysicalCriticalRate;
pAvatarMaintAttribute.wLastPhysicalCriticalRate = pAttribute->wLastPhysicalCriticalRate;
pAvatarMaintAttribute.wBaseEnergyCriticalRate = pAttribute->wBaseEnergyCriticalRate;
pAvatarMaintAttribute.wLastEnergyCriticalRate = pAttribute->wLastEnergyCriticalRate;
pAvatarMaintAttribute.wBaseAttackSpeedRate = pAttribute->wBaseAttackSpeedRate;
pAvatarMaintAttribute.wLastAttackSpeedRate = pAttribute->wLastAttackSpeedRate;
pAvatarMaintAttribute.fBaseAttackRange = pAttribute->fBaseAttackRange;
pAvatarMaintAttribute.fLastAttackRange = pAttribute->fLastAttackRange;
pAvatarMaintAttribute.fLastRunSpeed = pAttribute->fLastRunSpeed;
pAvatarMaintAttribute.fCastingTimeChangePercent = pAttribute->fCastingTimeChangePercent;
pAvatarMaintAttribute.fCoolTimeChangePercent = pAttribute->fCoolTimeChangePercent;
pAvatarMaintAttribute.fKeepTimeChangePercent = pAttribute->fKeepTimeChangePercent;
pAvatarMaintAttribute.fDotValueChangePercent = pAttribute->fDotValueChangePercent;
pAvatarMaintAttribute.fDotTimeChangeAbsolute = pAttribute->fDotTimeChangeAbsolute;
pAvatarMaintAttribute.fRequiredEpChangePercent = pAttribute->fRequiredEpChangePercent;
pAvatarMaintAttribute.fHonestOffence = pAttribute->fHonestOffence;
pAvatarMaintAttribute.fHonestDefence = pAttribute->fHonestDefence;
pAvatarMaintAttribute.fStrangeOffence = pAttribute->fStrangeOffence;
pAvatarMaintAttribute.fStrangeDefence = pAttribute->fStrangeDefence;
pAvatarMaintAttribute.fWildOffence = pAttribute->fWildOffence;
pAvatarMaintAttribute.fWildDefence = pAttribute->fWildDefence;
pAvatarMaintAttribute.fEleganceOffence = pAttribute->fEleganceOffence;
pAvatarMaintAttribute.fEleganceDefence = pAttribute->fEleganceDefence;
pAvatarMaintAttribute.fFunnyOffence = pAttribute->fFunnyOffence;
pAvatarMaintAttribute.fFunnyDefence = pAttribute->fFunnyDefence;
}
void AttributeManager::CompressAttributes()
{
//Bases
void* byBaseCon = &pAvatarMaintAttribute.wBaseCon;
void* byBaseStr = &pAvatarMaintAttribute.wBaseStr;
void* byBaseSol = &pAvatarMaintAttribute.wBaseSol;
void* byBaseFoc = &pAvatarMaintAttribute.wBaseFoc;
void* byBaseEng = &pAvatarMaintAttribute.wBaseEng;
void* byBaseDex = &pAvatarMaintAttribute.wBaseDex;
void* wBaseAttackRate = &pAvatarMaintAttribute.wBaseAttackRate;
void* wBaseAttackSpeedRate = &pAvatarMaintAttribute.wBaseAttackSpeedRate;
void* wBaseBlockRate = &pAvatarMaintAttribute.wBaseBlockRate;
void* wBaseCurseSuccessRate = &pAvatarMaintAttribute.wBaseCurseSuccessRate;
void* wBaseCurseToleranceRate = &pAvatarMaintAttribute.wBaseCurseToleranceRate;
void* wBaseDodgeRate = &pAvatarMaintAttribute.wBaseDodgeRate;
void* wBaseEnergyCriticalRate = &pAvatarMaintAttribute.wBaseEnergyCriticalRate;
void* wBaseEnergyDefence = &pAvatarMaintAttribute.wBaseEnergyDefence;
void* wBaseEnergyOffence = &pAvatarMaintAttribute.wBaseEnergyOffence;
void* wBasePhysicalCriticalRate = &pAvatarMaintAttribute.wBasePhysicalCriticalRate;
void* wBasePhysicalOffence = &pAvatarMaintAttribute.wBasePhysicalOffence;
void* wBasePhysicalDefence = &pAvatarMaintAttribute.wBasePhysicalDefence;
void* wBaseEpBattleRegen = &pAvatarMaintAttribute.wBaseEpBattleRegen;
void* wBaseEpRegen = &pAvatarMaintAttribute.wBaseEpRegen;
void* wBaseEpSitdownRegen = &pAvatarMaintAttribute.wBaseEpSitdownRegen;
void* wBaseLpBattleRegen = &pAvatarMaintAttribute.wBaseLpBattleRegen;
void* wBaseLpRegen = &pAvatarMaintAttribute.wBaseLpRegen;
void* wBaseLpSitdownRegen = &pAvatarMaintAttribute.wBaseLpSitdownRegen;
void* wBaseRpRegen = &pAvatarMaintAttribute.wBaseRpRegen;
void* wBaseMaxEP = &pAvatarMaintAttribute.wBaseMaxEP;
void* wBaseMaxLP = &pAvatarMaintAttribute.dwBaseMaxLP;
void* wBaseMaxRP = &pAvatarMaintAttribute.wBaseMaxRP;
//Lasts
void* byLastCon = &pAvatarMaintAttribute.wLastCon;
void* byLastStr = &pAvatarMaintAttribute.wLastStr;
void* byLastSol = &pAvatarMaintAttribute.wLastSol;
void* byLastFoc = &pAvatarMaintAttribute.wLastFoc;
void* byLastEng = &pAvatarMaintAttribute.wLastEng;
void* byLastDex = &pAvatarMaintAttribute.wLastDex;
void* wLastAttackRate = &pAvatarMaintAttribute.wLastAttackRate;
void* wLastAttackSpeedRate = &pAvatarMaintAttribute.wLastAttackSpeedRate;
void* wLastBlockRate = &pAvatarMaintAttribute.wLastBlockRate;
void* wLastCurseSuccessRate = &pAvatarMaintAttribute.wLastCurseSuccessRate;
void* wLastCurseToleranceRate = &pAvatarMaintAttribute.wLastCurseToleranceRate;
void* wLastDodgeRate = &pAvatarMaintAttribute.wLastDodgeRate;
void* wLastEnergyCriticalRate = &pAvatarMaintAttribute.wLastEnergyCriticalRate;
void* wLastEnergyOffence = &pAvatarMaintAttribute.wLastEnergyOffence;
void* wLastEnergyDefence = &pAvatarMaintAttribute.wLastEnergyDefence;
void* wLastPhysicalCriticalRate = &pAvatarMaintAttribute.wLastPhysicalCriticalRate;
void* wLastPhysicalOffence = &pAvatarMaintAttribute.wLastPhysicalOffence;
void* wLastPhysicalDefence = &pAvatarMaintAttribute.wLastPhysicalDefence;
void* wLastEpBattleRegen = &pAvatarMaintAttribute.wLastEpBattleRegen;
void* wLastEpRegen = &pAvatarMaintAttribute.wLastEpRegen;
void* wLastEpSitdownRegen = &pAvatarMaintAttribute.wLastEpSitdownRegen;
void* wLastLpBattleRegen = &pAvatarMaintAttribute.wLastLpBattleRegen;
void* wLastLpRegen = &pAvatarMaintAttribute.wLastLpRegen;
void* wLastLpSitdownRegen = &pAvatarMaintAttribute.wLastLpSitdownRegen;
void* wLastRpRegen = &pAvatarMaintAttribute.wLastRpRegen;
void* wLastRpDimimutionRate = &pAvatarMaintAttribute.wLastRpDimimutionRate;
void* wLastMaxEP = &pAvatarMaintAttribute.wLastMaxEP;
void* wLastMaxLP = &pAvatarMaintAttribute.dwLastMaxLP;
void* wLastMaxRP = &pAvatarMaintAttribute.wLastMaxRP;
void* wGuardRate = &pAvatarMaintAttribute.wGuardRate;
void* wParalyzeToleranceRate = &pAvatarMaintAttribute.wParalyzeToleranceRate;
void* wTerrorToleranceRate = &pAvatarMaintAttribute.wTerrorToleranceRate;
void* wConfuseToleranceRate = &pAvatarMaintAttribute.wConfuseToleranceRate;
void* wStoneToleranceRate = &pAvatarMaintAttribute.wStoneToleranceRate;
void* wCandyToleranceRate = &pAvatarMaintAttribute.wCandyToleranceRate;
//Others
void* fBaseAttackRange = &pAvatarMaintAttribute.fBaseAttackRange;
void* fBleedingKeepTimeDown = &pAvatarMaintAttribute.fBleedingKeepTimeDown;
void* fCandyKeepTimeDown = &pAvatarMaintAttribute.fCandyKeepTimeDown;
void* fCastingTimeChangePercent = &pAvatarMaintAttribute.fCastingTimeChangePercent;
void* fConfuseKeepTimeDown = &pAvatarMaintAttribute.fConfuseKeepTimeDown;
void* fCoolTimeChangePercent = &pAvatarMaintAttribute.fCoolTimeChangePercent;
void* fCriticalBlockSuccessRate = &pAvatarMaintAttribute.fCriticalBlockSuccessRate;
void* fCurseBlockModeSuccessRate = &pAvatarMaintAttribute.fCurseBlockModeSuccessRate;
void* fDotTimeChangeAbsolute = &pAvatarMaintAttribute.fDotTimeChangeAbsolute;
void* fDotValueChangePercent = &pAvatarMaintAttribute.fDotValueChangePercent;
void* fEleganceDefence = &pAvatarMaintAttribute.fEleganceDefence;
void* fEleganceOffence = &pAvatarMaintAttribute.fEleganceOffence;
void* fEnergyCriticalDamageBonusRate = &pAvatarMaintAttribute.fEnergyCriticalDamageBonusRate;
void* fFunnyDefence = &pAvatarMaintAttribute.fFunnyDefence;
void* fFunnyOffence = &pAvatarMaintAttribute.fFunnyOffence;
void* fHonestDefence = &pAvatarMaintAttribute.fHonestDefence;
void* fHonestOffence = &pAvatarMaintAttribute.fHonestOffence;
void* fHtbBlockModeSuccessRate = &pAvatarMaintAttribute.fHtbBlockModeSuccessRate;
void* fItemUpgradeBonusRate = &pAvatarMaintAttribute.fItemUpgradeBonusRate;
void* fItemUpgradeBreakBonusRate = &pAvatarMaintAttribute.fItemUpgradeBreakBonusRate;
void* fKeepTimeChangePercent = &pAvatarMaintAttribute.fKeepTimeChangePercent;
void* fKnockdownBlockModeSuccessRate = &pAvatarMaintAttribute.fKnockdownBlockModeSuccessRate;
void* fLastAttackRange = &pAvatarMaintAttribute.fLastAttackRange;
void* fLastRunSpeed = &pAvatarMaintAttribute.fLastRunSpeed;
void* fParalyzeKeepTimeDown = &pAvatarMaintAttribute.fParalyzeKeepTimeDown;
void* fPhysicalCriticalDamageBonusRate = &pAvatarMaintAttribute.fPhysicalCriticalDamageBonusRate;
void* fPoisonKeepTimeDown = &pAvatarMaintAttribute.fPoisonKeepTimeDown;
void* fRequiredEpChangePercent = &pAvatarMaintAttribute.fRequiredEpChangePercent;
void* fSitDownEpRegenBonusRate = &pAvatarMaintAttribute.fSitDownEpRegenBonusRate;
void* fSitDownLpRegenBonusRate = &pAvatarMaintAttribute.fSitDownLpRegenBonusRate;
void* fSkillDamageBlockModeSuccessRate = &pAvatarMaintAttribute.fSkillDamageBlockModeSuccessRate;
void* fStomachacheKeepTimeDown = &pAvatarMaintAttribute.fStomachacheKeepTimeDown;
void* fStoneKeepTimeDown = &pAvatarMaintAttribute.fStoneKeepTimeDown;
void* fStrangeDefence = &pAvatarMaintAttribute.fStrangeDefence;
void* fStrangeOffence = &pAvatarMaintAttribute.fStrangeOffence;
void* fTerrorKeepTimeDown = &pAvatarMaintAttribute.fTerrorKeepTimeDown;
void* fWildDefence = &pAvatarMaintAttribute.fWildDefence;
void* fWildOffence = &pAvatarMaintAttribute.fWildOffence;
//New Attribs
pAvatarAttributeLink.pbyBaseCon = (BYTE*)byBaseCon;
pAvatarAttributeLink.pbyBaseStr = (BYTE*)byBaseStr;
pAvatarAttributeLink.pbyBaseSol = (BYTE*)byBaseSol;
pAvatarAttributeLink.pbyBaseFoc = (BYTE*)byBaseFoc;
pAvatarAttributeLink.pbyBaseEng = (BYTE*)byBaseEng;
pAvatarAttributeLink.pbyBaseDex = (BYTE*)byBaseDex;
pAvatarAttributeLink.pbyLastCon = (BYTE*)byLastCon;
pAvatarAttributeLink.pbyLastStr = (BYTE*)byLastStr;
pAvatarAttributeLink.pbyLastSol = (BYTE*)byLastSol;
pAvatarAttributeLink.pbyLastFoc = (BYTE*)byLastFoc;
pAvatarAttributeLink.pbyLastEng = (BYTE*)byLastEng;
pAvatarAttributeLink.pbyLastDex = (BYTE*)byLastDex;
pAvatarAttributeLink.pwBaseAttackRate = (WORD*)wBaseAttackRate;
pAvatarAttributeLink.pwBaseAttackSpeedRate = (WORD*)wBaseAttackSpeedRate;
pAvatarAttributeLink.pwBaseBlockRate = (WORD*)wBaseBlockRate;
pAvatarAttributeLink.pwBaseCurseSuccessRate = (WORD*)wBaseCurseSuccessRate;
pAvatarAttributeLink.pwBaseCurseToleranceRate = (WORD*)wBaseCurseToleranceRate;
pAvatarAttributeLink.pwBaseDodgeRate = (WORD*)wBaseDodgeRate;
pAvatarAttributeLink.pwBaseEnergyCriticalRate = (WORD*)wBaseEnergyCriticalRate;
pAvatarAttributeLink.pwBaseEnergyOffence = (WORD*)wBaseEnergyOffence;
pAvatarAttributeLink.pwBaseEnergyDefence = (WORD*)wBaseEnergyDefence;
pAvatarAttributeLink.pwBasePhysicalCriticalRate = (WORD*)wBasePhysicalCriticalRate;
pAvatarAttributeLink.pwBasePhysicalOffence = (WORD*)wBasePhysicalOffence;
pAvatarAttributeLink.pwBasePhysicalDefence = (WORD*)wBasePhysicalDefence;
pAvatarAttributeLink.pwBaseEpBattleRegen = (WORD*)wBaseEpBattleRegen;
pAvatarAttributeLink.pwBaseEpRegen = (WORD*)wBaseEpRegen;
pAvatarAttributeLink.pwBaseEpSitdownRegen = (WORD*)wBaseEpSitdownRegen;
pAvatarAttributeLink.pwBaseLpBattleRegen = (WORD*)wBaseLpBattleRegen;
pAvatarAttributeLink.pwBaseLpRegen = (WORD*)wBaseLpRegen;
pAvatarAttributeLink.pwBaseLpSitdownRegen = (WORD*)wBaseLpSitdownRegen;
pAvatarAttributeLink.pwBaseRpRegen = (WORD*)wBaseRpRegen;
pAvatarAttributeLink.pwBaseMaxEP = (WORD*)wBaseMaxEP;
pAvatarAttributeLink.pwBaseMaxLP = (WORD*)wBaseMaxLP;
pAvatarAttributeLink.pwBaseMaxRP = (WORD*)wBaseMaxRP;
pAvatarAttributeLink.pwBaseEpSitdownRegen = (WORD*)wBaseEpSitdownRegen;
pAvatarAttributeLink.pwLastAttackRate = (WORD*)wLastAttackRate;
pAvatarAttributeLink.pwLastAttackSpeedRate = (WORD*)wLastAttackSpeedRate;
pAvatarAttributeLink.pwLastBlockRate = (WORD*)wLastBlockRate;
pAvatarAttributeLink.pwLastCurseSuccessRate = (WORD*)wLastCurseSuccessRate;
pAvatarAttributeLink.pwLastCurseToleranceRate = (WORD*)wLastCurseToleranceRate;
pAvatarAttributeLink.pwLastDodgeRate = (WORD*)wLastDodgeRate;
pAvatarAttributeLink.pwLastEnergyCriticalRate = (WORD*)wLastEnergyCriticalRate;
pAvatarAttributeLink.pwLastEnergyOffence = (WORD*)wLastEnergyOffence;
pAvatarAttributeLink.pwLastEnergyDefence = (WORD*)wLastEnergyDefence;
pAvatarAttributeLink.pwLastPhysicalCriticalRate = (WORD*)wLastPhysicalCriticalRate;
pAvatarAttributeLink.pwLastPhysicalOffence = (WORD*)wLastPhysicalOffence;
pAvatarAttributeLink.pwLastPhysicalDefence = (WORD*)wLastPhysicalDefence;
pAvatarAttributeLink.pwLastEpBattleRegen = (WORD*)wLastEpBattleRegen;
pAvatarAttributeLink.pwLastEpRegen = (WORD*)wLastEpRegen;
pAvatarAttributeLink.pwLastEpSitdownRegen = (WORD*)wLastEpSitdownRegen;
pAvatarAttributeLink.pwLastLpBattleRegen = (WORD*)wLastLpBattleRegen;
pAvatarAttributeLink.pwLastLpRegen = (WORD*)wLastLpRegen;
pAvatarAttributeLink.pwLastLpSitdownRegen = (WORD*)wLastLpSitdownRegen;
pAvatarAttributeLink.pwLastRpRegen = (WORD*)wLastRpRegen;
pAvatarAttributeLink.pwLastRpDimimutionRate = (WORD*)wLastRpDimimutionRate;
pAvatarAttributeLink.pwLastMaxEP = (WORD*)wLastMaxEP;
pAvatarAttributeLink.pwLastMaxLP = (WORD*)wLastMaxLP;
pAvatarAttributeLink.pwLastMaxRP = (WORD*)wLastMaxRP;
pAvatarAttributeLink.pwGuardRate = (WORD*)wGuardRate;
pAvatarAttributeLink.pwParalyzeToleranceRate = (WORD*)wParalyzeToleranceRate;
pAvatarAttributeLink.pwTerrorToleranceRate = (WORD*)wTerrorToleranceRate;
pAvatarAttributeLink.pwConfuseToleranceRate = (WORD*)wConfuseToleranceRate;
pAvatarAttributeLink.pwCandyToleranceRate = (WORD*)wCandyToleranceRate;
pAvatarAttributeLink.pwStoneToleranceRate = (WORD*)wStoneToleranceRate;
pAvatarAttributeLink.pfBaseAttackRange = (float*)fBaseAttackRange;
pAvatarAttributeLink.pfBleedingKeepTimeDown = (float*)fBleedingKeepTimeDown;
pAvatarAttributeLink.pfCandyKeepTimeDown = (float*)fCandyKeepTimeDown;
pAvatarAttributeLink.pfCastingTimeChangePercent = (float*)fCastingTimeChangePercent;
pAvatarAttributeLink.pfConfuseKeepTimeDown = (float*)fConfuseKeepTimeDown;
pAvatarAttributeLink.pfCoolTimeChangePercent = (float*)fCoolTimeChangePercent;
pAvatarAttributeLink.pfCriticalBlockSuccessRate = (float*)fCriticalBlockSuccessRate;
pAvatarAttributeLink.pfCurseBlockModeSuccessRate = (float*)fCurseBlockModeSuccessRate;
pAvatarAttributeLink.pfDotTimeChangeAbsolute = (float*)fDotTimeChangeAbsolute;
pAvatarAttributeLink.pfDotValueChangePercent = (float*)fDotValueChangePercent;
pAvatarAttributeLink.pfEleganceOffence = (float*)fEleganceOffence;
pAvatarAttributeLink.pfEleganceDefence = (float*)fEleganceDefence;
pAvatarAttributeLink.pfEnergyCriticalDamageBonusRate = (float*)fEnergyCriticalDamageBonusRate;
pAvatarAttributeLink.pfFunnyOffence = (float*)fFunnyOffence;
pAvatarAttributeLink.pfFunnyDefence = (float*)fFunnyDefence;
pAvatarAttributeLink.pfHonestOffence = (float*)fHonestOffence;
pAvatarAttributeLink.pfHonestDefence = (float*)fHonestDefence;
pAvatarAttributeLink.pfHtbBlockModeSuccessRate = (float*)fHtbBlockModeSuccessRate;
pAvatarAttributeLink.pfItemUpgradeBonusRate = (float*)fItemUpgradeBonusRate;
pAvatarAttributeLink.pfItemUpgradeBreakBonusRate = (float*)fItemUpgradeBreakBonusRate;
pAvatarAttributeLink.pfKeepTimeChangePercent = (float*)fKeepTimeChangePercent;
pAvatarAttributeLink.pfKnockdownBlockModeSuccessRate = (float*)fKnockdownBlockModeSuccessRate;
pAvatarAttributeLink.pfLastAttackRange = (float*)fLastAttackRange;
pAvatarAttributeLink.pfLastRunSpeed = (float*)fLastRunSpeed;
pAvatarAttributeLink.pfParalyzeKeepTimeDown = (float*)fParalyzeKeepTimeDown;
pAvatarAttributeLink.pfPhysicalCriticalDamageBonusRate = (float*)fPhysicalCriticalDamageBonusRate;
pAvatarAttributeLink.pfPoisonKeepTimeDown = (float*)fPoisonKeepTimeDown;
pAvatarAttributeLink.pfRequiredEpChangePercent = (float*)fRequiredEpChangePercent;
pAvatarAttributeLink.pfSitDownEpRegenBonusRate = (float*)fSitDownEpRegenBonusRate;
pAvatarAttributeLink.pfSitDownLpRegenBonusRate = (float*)fSitDownLpRegenBonusRate;
pAvatarAttributeLink.pfSkillDamageBlockModeSuccessRate = (float*)fSkillDamageBlockModeSuccessRate;
pAvatarAttributeLink.pfStomachacheKeepTimeDown = (float*)fStomachacheKeepTimeDown;
pAvatarAttributeLink.pfStoneKeepTimeDown = (float*)fStoneKeepTimeDown;
pAvatarAttributeLink.pfStrangeDefence = (float*)fStrangeDefence;
pAvatarAttributeLink.pfStrangeOffence = (float*)fStrangeOffence;
pAvatarAttributeLink.pfTerrorKeepTimeDown = (float*)fTerrorKeepTimeDown;
pAvatarAttributeLink.pfWildDefence = (float*)fWildDefence;
pAvatarAttributeLink.pfWildOffence = (float*)fWildOffence;
}
//By Luiz45 Calculate Attributes
void AttributeManager::CalculateAttributes()
{
}
//By Luiz45 Send Avatar
sGU_AVATAR_ATTRIBUTE_UPDATE AttributeManager::PrepareUpdatePacket(HOBJECT playerSerialID)
{
CompressAttributes();
sGU_AVATAR_ATTRIBUTE_UPDATE pUpdateAttribute;
memset(&pUpdateAttribute, 0, sizeof(pUpdateAttribute));
CNtlBitFlagManager flagMgr;
if (false == flagMgr.Create(&pAvatarMaintAttribute, ATTRIBUTE_TO_UPDATE_COUNT))
{
Logger::Log("FlagManager for Attribute failed", this);
}
for (BYTE byIndex = ATTRIBUTE_TO_UPDATE_FIRST; byIndex <= ATTRIBUTE_TO_UPDATE_LAST; byIndex++)
{
flagMgr.Set(byIndex);
}
DWORD buffer[2048];
DWORD datasize;
if (CNtlAvatar::GetInstance()->SaveAvatarAttribute(&flagMgr, &pAvatarAttributeLink, &buffer, &datasize) == false){
Logger::Log("Save Avatar was failed", this);
return pUpdateAttribute;
}
memcpy(pUpdateAttribute.abyFlexibleField, &buffer, sizeof(sAVATAR_ATTRIBUTE));
pUpdateAttribute.byAttributeTotalCount = ATTRIBUTE_TO_UPDATE_COUNT;
pUpdateAttribute.wOpCode = GU_AVATAR_ATTRIBUTE_UPDATE;
pUpdateAttribute.hHandle = playerSerialID;
return pUpdateAttribute;
}
//By luiz45 - Update Attribute with Equiped Items
void AttributeManager::UpdateWithEquipment(sITEM_TBLDAT* itemTBL, bool bRemove, BYTE byGrade)
{
if (itemTBL->wPhysical_Offence < 65535 && itemTBL->wPhysical_Offence > 0)
{
if (bRemove)
pAvatarMaintAttribute.wLastPhysicalOffence -= Dbo_GetFinalOffence(itemTBL->wPhysical_Offence, byGrade);
else
pAvatarMaintAttribute.wLastPhysicalOffence += Dbo_GetFinalOffence(itemTBL->wPhysical_Offence, byGrade);
}
if (itemTBL->wPhysical_Defence < 65535 && itemTBL->wPhysical_Defence > 0)
{
if (bRemove)
pAvatarMaintAttribute.wLastPhysicalDefence -= Dbo_GetFinalDefence(itemTBL->wPhysical_Defence, byGrade);
else
pAvatarMaintAttribute.wLastPhysicalDefence += Dbo_GetFinalDefence(itemTBL->wPhysical_Defence, byGrade);
}
if (itemTBL->wEnergy_Offence < 65535 && itemTBL->wEnergy_Offence > 0)
{
if (bRemove)
pAvatarMaintAttribute.wLastEnergyOffence -= Dbo_GetFinalOffence(itemTBL->wEnergy_Offence, byGrade);
else
pAvatarMaintAttribute.wLastEnergyOffence += Dbo_GetFinalOffence(itemTBL->wEnergy_Offence, byGrade);
}
if (itemTBL->wEnergy_Defence < 65535 && itemTBL->wEnergy_Defence > 0)
{
if (bRemove)
pAvatarMaintAttribute.wLastEnergyDefence -= Dbo_GetFinalDefence(itemTBL->wEnergy_Defence, byGrade);
else
pAvatarMaintAttribute.wLastEnergyDefence += Dbo_GetFinalDefence(itemTBL->wEnergy_Defence, byGrade);
}
if (itemTBL->fAttack_Range_Bonus < 65535 && itemTBL->fAttack_Range_Bonus > 0)
{
pAvatarMaintAttribute.fLastAttackRange += itemTBL->fAttack_Range_Bonus;
}
}
//By Luiz45 - Just return the Avatar attribute uncrompressed()
sAVATAR_ATTRIBUTE AttributeManager::GetAvatarAttribute()
{
return this->pAvatarMaintAttribute;
}