comparison Player.cpp @ 1601:5ac59bcb68e9

started extracting enchantment effects to a helper class
author Grumpy7
date Thu, 12 Sep 2013 09:53:41 +0200
parents bb2378f58767
children 4b79ff62df3a
comparison
equal deleted inserted replaced
1600:0016b08ab621 1601:5ac59bcb68e9
154 10, // PLAYER_SKILL_LEATHER 154 10, // PLAYER_SKILL_LEATHER
155 20, // PLAYER_SKILL_CHAIN 155 20, // PLAYER_SKILL_CHAIN
156 30 // PLAYER_SKILL_PLATE 156 30 // PLAYER_SKILL_PLATE
157 }; 157 };
158 158
159 159 #include <map>
160 #include <list>
161
162 typedef struct CEnchantment
163 {
164 CEnchantment(int bonus, unsigned __int16 Player::* skillPtr = NULL):
165 statBonus(bonus),
166 statPtr(skillPtr)
167 {
168 }
169 int statBonus;
170 unsigned __int16 Player::* statPtr;
171 } CEnchantment;
172
173 #define NEWBONUSINTOSPECIALLIST(x,y) AddToMap(specialBonusMap, enchId, x, y);
174 #define NEWBONUSINTOSPECIALLIST2(x,y,z) AddToMap(specialBonusMap, enchId, x, y, z);
175
176 #define NEWBONUSINTOREGULARLIST(x) AddToMap(regularBonusMap, enchId, x);
177
178 #define NEWBONUSINTOARTIFACTLIST(x,y) AddToMap(artifactBonusMap, enchId, x, y);
179 #define NEWBONUSINTOARTIFACTLIST2(x,y,z) AddToMap(artifactBonusMap, enchId, x, y, z);
180
181 std::map<int, std::map<CHARACTER_ATTRIBUTE_TYPE, CEnchantment*>* > regularBonusMap;
182 std::map<int, std::map<CHARACTER_ATTRIBUTE_TYPE, CEnchantment*>* > specialBonusMap;
183 std::map<int, std::map<CHARACTER_ATTRIBUTE_TYPE, CEnchantment*>* > artifactBonusMap;
184 //-------------------------------------------------------------------------
185
186 void AddToMap(std::map<int, std::map<CHARACTER_ATTRIBUTE_TYPE, CEnchantment*>* > &maptoadd,
187 int enchId,
188 CHARACTER_ATTRIBUTE_TYPE attrId,
189 int bonusValue = 0,
190 unsigned __int16 Player::* skillPtr = NULL)
191 {
192 auto key = maptoadd.find(enchId);
193 std::map<CHARACTER_ATTRIBUTE_TYPE, CEnchantment*>* currMap;
194 if (key == maptoadd.end())
195 {
196 currMap = new std::map<CHARACTER_ATTRIBUTE_TYPE, CEnchantment*>;
197 maptoadd[enchId] = currMap;
198 }
199 else
200 {
201 currMap = key->second;
202 }
203 Assert(currMap->find(attrId) == currMap->end(), "Attribute %d already present for enchantment %d", attrId, enchId);
204 (*currMap)[attrId] = new CEnchantment(bonusValue, skillPtr);
205 }
206 //-------------------------------------------------------------------------
207
208 void PopulateSpecialBonusMap()
209 {
210 int enchId = 1;// of Protection, +10 to all Resistances
211 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_RESIST_FIRE, 10);
212 NEWBONUSINTOSPECIALLIST( CHARACTER_ATTRIBUTE_RESIST_AIR, 10);
213 NEWBONUSINTOSPECIALLIST( CHARACTER_ATTRIBUTE_RESIST_WATER, 10);
214 NEWBONUSINTOSPECIALLIST( CHARACTER_ATTRIBUTE_RESIST_EARTH, 10);
215 NEWBONUSINTOSPECIALLIST( CHARACTER_ATTRIBUTE_RESIST_MIND, 10);
216 NEWBONUSINTOSPECIALLIST( CHARACTER_ATTRIBUTE_RESIST_BODY, 10);
217
218 enchId = 2;//of The Gods, +10 to all Seven Statistics
219 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_STRENGTH, 10);
220 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_INTELLIGENCE, 10);
221 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_WILLPOWER, 10);
222 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_ENDURANCE, 10);
223 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_ACCURACY, 10);
224 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_SPEED, 10);
225 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_LUCK, 10);
226
227 enchId = 26;//of Air Magic
228 NEWBONUSINTOSPECIALLIST2(CHARACTER_ATTRIBUTE_SKILL_AIR,0, &Player::skillAir);
229
230 enchId = 27;//of Body Magic
231 NEWBONUSINTOSPECIALLIST2(CHARACTER_ATTRIBUTE_SKILL_BODY,0, &Player::skillBody);
232
233 enchId = 28;//of Dark Magic
234 NEWBONUSINTOSPECIALLIST2(CHARACTER_ATTRIBUTE_SKILL_DARK,0, &Player::skillDark);
235
236 enchId = 29;//of Earth Magic
237 NEWBONUSINTOSPECIALLIST2(CHARACTER_ATTRIBUTE_SKILL_EARTH,0, &Player::skillEarth);
238
239 enchId = 30;//of Fire Magic
240 NEWBONUSINTOSPECIALLIST2(CHARACTER_ATTRIBUTE_SKILL_FIRE,0, &Player::skillFire);
241
242 enchId = 31;//of Light Magic
243 NEWBONUSINTOSPECIALLIST2(CHARACTER_ATTRIBUTE_SKILL_LIGHT,0, &Player::skillLight);
244
245 enchId = 32;//of Mind Magic
246 NEWBONUSINTOSPECIALLIST2(CHARACTER_ATTRIBUTE_SKILL_MIND,0, &Player::skillMind);
247
248 enchId = 33;//of Spirit Magic
249 NEWBONUSINTOSPECIALLIST2(CHARACTER_ATTRIBUTE_SKILL_SPIRIT,0, &Player::skillSpirit);
250
251 enchId = 34;//of Water Magic
252 NEWBONUSINTOSPECIALLIST2(CHARACTER_ATTRIBUTE_SKILL_WATER,0, &Player::skillWater);
253
254 enchId = 42;//of Doom
255 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_STRENGTH, 1);
256 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_INTELLIGENCE, 1);
257 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_WILLPOWER, 1);
258 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_ENDURANCE, 1);
259 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_ACCURACY, 1);
260 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_SPEED, 1);
261 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_LUCK, 1);
262 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_HEALTH, 1);
263 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_MANA, 1);
264 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_AC_BONUS, 1);
265 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_RESIST_FIRE, 1);
266 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_RESIST_AIR, 1);
267 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_RESIST_WATER, 1);
268 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_RESIST_EARTH, 1);
269 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_RESIST_MIND, 1);
270 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_RESIST_BODY, 1);
271
272 enchId = 43;//of Earth
273 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_ENDURANCE, 10);
274 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_AC_BONUS, 10);
275 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_HEALTH, 10);
276
277 enchId = 44;//of Life
278 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_HEALTH, 10);
279
280 enchId = 45;//Rogues
281 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_SPEED, 5);
282 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_ACCURACY, 5);
283
284 enchId = 46;//of The Dragon
285 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_STRENGTH, 25);
286
287 enchId = 47;//of The Eclipse
288 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_MANA, 10);
289
290 enchId = 48;//of The Golem
291 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_ENDURANCE, 15);
292 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_AC_BONUS, 5);
293
294 enchId = 49;//of The Moon
295 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_INTELLIGENCE, 10);
296 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_LUCK, 10);
297
298 enchId = 50;//of The Phoenix
299 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_RESIST_FIRE, 30);
300
301 enchId = 51;//of The Sky
302 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_MANA, 10);
303 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_SPEED, 10);
304 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_INTELLIGENCE, 10);
305
306 enchId = 52;//of The Stars
307 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_ENDURANCE, 10);
308 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_ACCURACY, 10);
309
310 enchId = 53;//of The Sun
311 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_STRENGTH, 10);
312 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_WILLPOWER, 10);
313
314 enchId = 54;//of The Troll
315 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_ENDURANCE, 15);
316
317 enchId = 55;//of The Unicorn
318 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_LUCK, 15);
319
320 enchId = 56;//Warriors
321 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_STRENGTH, 5);
322 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_ENDURANCE, 5);
323
324 enchId = 57;//Wizards
325 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_INTELLIGENCE, 5);
326 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_WILLPOWER, 5);
327
328 enchId = 60;//Monks'
329 NEWBONUSINTOSPECIALLIST2(CHARACTER_ATTRIBUTE_SKILL_DODGE, 3, &Player::skillDodge);
330 NEWBONUSINTOSPECIALLIST2(CHARACTER_ATTRIBUTE_SKILL_UNARMED, 3, &Player::skillUnarmed);
331
332 enchId = 61;//Thieves'
333 NEWBONUSINTOSPECIALLIST2(CHARACTER_ATTRIBUTE_SKILL_TRAP_DISARM, 3, &Player::skillStealing);
334 NEWBONUSINTOSPECIALLIST2(CHARACTER_ATTRIBUTE_SKILL_STEALING, 3, &Player::skillDisarmTrap);
335
336 enchId = 62;//of Identifying
337 NEWBONUSINTOSPECIALLIST2(CHARACTER_ATTRIBUTE_SKILL_ITEM_ID, 3, &Player::skillItemId);
338 NEWBONUSINTOSPECIALLIST2(CHARACTER_ATTRIBUTE_SKILL_MONSTER_ID, 3, &Player::skillMonsterId);
339
340 enchId = 67;//Assassins'
341 NEWBONUSINTOSPECIALLIST2(CHARACTER_ATTRIBUTE_SKILL_TRAP_DISARM, 2, &Player::skillDisarmTrap);
342
343 enchId = 68;//Barbarians'
344 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_AC_BONUS, 5);
345
346 enchId = 69;//of the Storm
347 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_RESIST_AIR, 20);
348
349 enchId = 70;//of the Ocean
350 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_RESIST_WATER, 10);
351 NEWBONUSINTOSPECIALLIST2(CHARACTER_ATTRIBUTE_SKILL_ALCHEMY, 2, &Player::skillAlchemy);
352 }
353 //-------------------------------------------------------------------------
354
355 void PopulateRegularBonusMap()
356 {
357 int enchId = 1;//of Might
358 NEWBONUSINTOREGULARLIST(CHARACTER_ATTRIBUTE_STRENGTH);
359
360 enchId = 2;//of Thought
361 NEWBONUSINTOREGULARLIST(CHARACTER_ATTRIBUTE_INTELLIGENCE);
362
363 enchId = 3;//of Charm
364 NEWBONUSINTOREGULARLIST(CHARACTER_ATTRIBUTE_WILLPOWER);
365
366 enchId = 4;//of Vigor
367 NEWBONUSINTOREGULARLIST(CHARACTER_ATTRIBUTE_ENDURANCE);
368
369 enchId = 5;//of Precision
370 NEWBONUSINTOREGULARLIST(CHARACTER_ATTRIBUTE_ACCURACY);
371
372 enchId = 6;//of Speed
373 NEWBONUSINTOREGULARLIST(CHARACTER_ATTRIBUTE_SPEED);
374
375 enchId = 7;//of Luck
376 NEWBONUSINTOREGULARLIST(CHARACTER_ATTRIBUTE_LUCK);
377
378 enchId = 8;//of Health
379 NEWBONUSINTOREGULARLIST(CHARACTER_ATTRIBUTE_HEALTH);
380
381 enchId = 9;//of Magic
382 NEWBONUSINTOREGULARLIST(CHARACTER_ATTRIBUTE_MANA);
383
384 enchId = 10;//of Defense
385 NEWBONUSINTOREGULARLIST(CHARACTER_ATTRIBUTE_AC_BONUS);
386
387 enchId = 11;//of Fire Resistance
388 NEWBONUSINTOREGULARLIST(CHARACTER_ATTRIBUTE_RESIST_FIRE);
389
390 enchId = 12;//of Air Resistance
391 NEWBONUSINTOREGULARLIST(CHARACTER_ATTRIBUTE_RESIST_AIR);
392
393 enchId = 13;//of Water Resistance
394 NEWBONUSINTOREGULARLIST(CHARACTER_ATTRIBUTE_RESIST_WATER);
395
396 enchId = 14;//of Earth Resistance
397 NEWBONUSINTOREGULARLIST(CHARACTER_ATTRIBUTE_RESIST_EARTH);
398
399 enchId = 15;//of Mind Resistance
400 NEWBONUSINTOREGULARLIST(CHARACTER_ATTRIBUTE_RESIST_MIND);
401
402 enchId = 16;//of Body Resistance
403 NEWBONUSINTOREGULARLIST(CHARACTER_ATTRIBUTE_RESIST_BODY);
404
405 enchId = 17;//of Alchemy
406 NEWBONUSINTOREGULARLIST(CHARACTER_ATTRIBUTE_SKILL_ALCHEMY);
407
408 enchId = 18;//of Stealing
409 NEWBONUSINTOREGULARLIST(CHARACTER_ATTRIBUTE_SKILL_STEALING);
410
411 enchId = 19;//of Disarming
412 NEWBONUSINTOREGULARLIST(CHARACTER_ATTRIBUTE_SKILL_TRAP_DISARM);
413
414 enchId = 20;//of Items
415 NEWBONUSINTOREGULARLIST(CHARACTER_ATTRIBUTE_SKILL_ITEM_ID);
416
417 enchId = 21;//of Monsters
418 NEWBONUSINTOREGULARLIST(CHARACTER_ATTRIBUTE_SKILL_MONSTER_ID);
419
420 enchId = 22;//of Arms
421 NEWBONUSINTOREGULARLIST(CHARACTER_ATTRIBUTE_SKILL_ARMSMASTER);
422
423 enchId = 23;//of Dodging
424 NEWBONUSINTOREGULARLIST(CHARACTER_ATTRIBUTE_SKILL_DODGE);
425
426 enchId = 24;//of the Fist
427 NEWBONUSINTOREGULARLIST(CHARACTER_ATTRIBUTE_SKILL_UNARMED);
428 }
429
430 //-------------------------------------------------------------------------
431 void PopulateArtifactBonusMap()
432 {
433 int enchId = 1;//of Might
434 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_STRENGTH, 5);
435 }
436 //-------------------------------------------------------------------------
437
438 void Player::GetItemBonusSpecialEnchantment(int enchantmentId, CHARACTER_ATTRIBUTE_TYPE attrToGet, int* additiveBonus, int* halfSkillBonus)
439 {
440 auto bonusList = specialBonusMap.find(enchantmentId);
441 if (bonusList == specialBonusMap.end())
442 {
443 return;
444 }
445 std::map<CHARACTER_ATTRIBUTE_TYPE, CEnchantment*>* currList = bonusList->second;
446 if (currList->find(attrToGet) != currList->end())
447 {
448 CEnchantment* currBonus = (*currList)[attrToGet];
449 if (currBonus->statPtr != NULL)
450 {
451 if (currBonus->statBonus == 0)
452 {
453 *halfSkillBonus = this->*currBonus->statPtr / 2;
454 }
455 else
456 {
457 if (*additiveBonus < currBonus->statBonus)
458 {
459 *additiveBonus = currBonus->statBonus;
460 }
461 }
462 }
463 else
464 {
465 *additiveBonus += currBonus->statBonus;
466 }
467 }
468 }
469
470 //-------------------------------------------------------------------------
471 bool IsRegularEnchanmentForAttribute(int enchantmentId, CHARACTER_ATTRIBUTE_TYPE attrToGet)
472 {
473 auto bonusList = specialBonusMap.find(enchantmentId);
474 if (bonusList == specialBonusMap.end())
475 {
476 return false;
477 }
478 std::map<CHARACTER_ATTRIBUTE_TYPE, CEnchantment*>* currList = bonusList->second;
479 return (currList->find(attrToGet) != currList->end());
480 }
160 481
161 //----- (00490913) -------------------------------------------------------- 482 //----- (00490913) --------------------------------------------------------
162 int PlayerCreation_GetUnspentAttributePointCount() 483 int PlayerCreation_GetUnspentAttributePointCount()
163 { 484 {
164 signed int v0; // edi@1 485 signed int v0; // edi@1
1238 } 1559 }
1239 1560
1240 //----- (0048C6AF) -------------------------------------------------------- 1561 //----- (0048C6AF) --------------------------------------------------------
1241 Player::Player() 1562 Player::Player()
1242 { 1563 {
1564 if (specialBonusMap.empty())
1565 {
1566 PopulateSpecialBonusMap();
1567 }
1568
1243 memset(&pEquipment, 0, sizeof(PlayerEquipment)); 1569 memset(&pEquipment, 0, sizeof(PlayerEquipment));
1244 memset(pInventoryMatrix, 0, 126 * sizeof(int)); 1570 memset(pInventoryMatrix, 0, 126 * sizeof(int));
1245 for (uint i = 0; i < 126; ++i) 1571 for (uint i = 0; i < 126; ++i)
1246 pInventoryItemList[i].Reset(); 1572 pInventoryItemList[i].Reset();
1247 for (uint i = 0; i < 12; ++i) 1573 for (uint i = 0; i < 12; ++i)
3270 v5 += pItemsTable->pItems[v33].uDamageDice + pItemsTable->pItems[v33].uDamageMod; 3596 v5 += pItemsTable->pItems[v33].uDamageDice + pItemsTable->pItems[v33].uDamageMod;
3271 } 3597 }
3272 } 3598 }
3273 v63 = (int)((char *)this + 36 * v31); 3599 v63 = (int)((char *)this + 36 * v31);
3274 attra = (ItemGen *)(v63 + 532); 3600 attra = (ItemGen *)(v63 + 532);
3275 if ( pItemsTable->IsMaterialNonCommon((ItemGen *)(v63 + 532)) == 1 3601 if ( pItemsTable->IsMaterialNonCommon((ItemGen *)(attra)) == 1
3276 && !pItemsTable->IsMaterialSpecial(attra) ) 3602 && !pItemsTable->IsMaterialSpecial(attra) )
3277 { 3603 {
3278 v34 = attra->uItemID; 3604 v34 = attra->uItemID;
3279 switch ( attra->uItemID ) 3605 switch ( attra->uItemID )
3280 { 3606 {
3281 case ITEM_ARTIFACT_PUCK: 3607 case ITEM_ARTIFACT_PUCK:
3282 v35 = attr == 5; 3608 if ( attr == 5 )
3283 if ( v35 )
3284 v5 += 50; 3609 v5 += 50;
3285 goto LABEL_361; 3610 goto LABEL_361;
3286 case ITEM_ARTIFACT_IRON_FEATHER: 3611 case ITEM_ARTIFACT_IRON_FEATHER:
3287 v36 = attr == 0; 3612 if ( attr == 0 )
3288 if ( v36 )
3289 v5 += 40; 3613 v5 += 40;
3290 goto LABEL_361; 3614 goto LABEL_361;
3291 case ITEM_ARTIFACT_WALLACE: 3615 case ITEM_ARTIFACT_WALLACE:
3292 if ( attr == 21 ) 3616 if ( attr == 21 )
3293 v61 += 10; 3617 v61 += 10;
3294 v36 = attr == 2; 3618 if ( attr == 2 )
3295 if ( v36 )
3296 v5 += 40; 3619 v5 += 40;
3297 goto LABEL_361; 3620 goto LABEL_361;
3298 case ITEM_ARTIFACT_CORSAIR: 3621 case ITEM_ARTIFACT_CORSAIR:
3299 if ( attr == 17 ) 3622 if ( attr == 17 )
3300 v61 += 5; 3623 v61 += 5;
3301 if ( attr == 18 ) 3624 if ( attr == 18 )
3302 v61 += 5; 3625 v61 += 5;
3303 v36 = attr == 6; 3626 if ( attr == 6 )
3304 if ( v36 )
3305 v5 += 40; 3627 v5 += 40;
3306 goto LABEL_361; 3628 goto LABEL_361;
3307 case ITEM_ARTICACT_GOVERNONS_ARMOR: 3629 case ITEM_ARTICACT_GOVERNONS_ARMOR:
3308 if (attr <= 6) 3630 if (attr <= 6)
3309 {
3310 v5 += 10; 3631 v5 += 10;
3311 goto LABEL_361; 3632 goto LABEL_361;
3312 }
3313 case ITEM_ARTIFACT_YORUBA: 3633 case ITEM_ARTIFACT_YORUBA:
3314 v40 = attr == 3; 3634 if ( attr == 3 )
3315 if ( v40 )
3316 v5 += 25; 3635 v5 += 25;
3317 goto LABEL_361; 3636 goto LABEL_361;
3318 case ITEM_ARTIFACT_SPLITTER: 3637 case ITEM_ARTIFACT_SPLITTER:
3319 v35 = attr == 10; 3638 if ( attr == 10 )
3320 if ( v35 )
3321 v5 += 50; 3639 v5 += 50;
3322 goto LABEL_361; 3640 goto LABEL_361;
3323 case ITEM_ARTEFACT_ULLYSES: 3641 case ITEM_ARTEFACT_ULLYSES:
3324 v35 = attr == 4; 3642 if ( attr == 4 )
3325 if ( v35 )
3326 v5 += 50; 3643 v5 += 50;
3327 goto LABEL_361; 3644 goto LABEL_361;
3328 case ITEM_ARTEFACT_HANDS_OF_THE_MASTER: 3645 case ITEM_ARTEFACT_HANDS_OF_THE_MASTER:
3329 if ( attr == 23 ) 3646 if ( attr == 23 )
3330 v61 += 10; 3647 v61 += 10;
3332 v61 += 10; 3649 v61 += 10;
3333 goto LABEL_361; 3650 goto LABEL_361;
3334 case ITEM_ARTIFACT_LEAGUE_BOOTS: 3651 case ITEM_ARTIFACT_LEAGUE_BOOTS:
3335 if ( attr == 36 ) 3652 if ( attr == 36 )
3336 { 3653 {
3337 LOBYTE(v34) = LOBYTE(this->pActiveSkills[14]); 3654 v34 = this->pActiveSkills[PLAYER_SKILL_WATER];
3338 v62 = ((unsigned int)v34 >> 1) & 0x1F; 3655 v62 = (v32 / 2) & 0x1F;
3339 } 3656 }
3340 v36 = attr == 5; 3657 if ( attr == 5 )
3341 if ( v36 )
3342 v5 += 40; 3658 v5 += 40;
3343 goto LABEL_361; 3659 goto LABEL_361;
3344 case ITEM_ARTIFACT_RULERS_RING: 3660 case ITEM_ARTIFACT_RULERS_RING:
3345 if ( attr == 39 ) 3661 if ( attr == 39 )
3346 { 3662 {
3347 LOBYTE(v34) = LOBYTE(this->pActiveSkills[17]); 3663 v34 = this->pActiveSkills[PLAYER_SKILL_MIND];
3348 v34 = ((unsigned int)v34 >> 1) & 0x1F; 3664 v62 = (v34 / 2 ) & 0x1F;
3349 v62 = v34;
3350 } 3665 }
3351 if ( attr == 42 ) 3666 if ( attr == 42 )
3352 { 3667 {
3353 LOBYTE(v34) = LOBYTE(this->pActiveSkills[20]); 3668 v34 = this->pActiveSkills[PLAYER_SKILL_DARK];
3354 v62 = ((unsigned int)v34 >> 1) & 0x1F; 3669 v62 = (v34 / 2 ) & 0x1F;
3355 } 3670 }
3356 goto LABEL_361; 3671 goto LABEL_361;
3357 case ITEM_RELIC_MASH: 3672 case ITEM_RELIC_MASH:
3358 if ( !attr ) 3673 if ( attr == 0 )
3359 v5 += 150; 3674 v5 += 150;
3360 if ( attr == 1 ) 3675 if ( attr == 1 )
3361 v5 -= 40; 3676 v5 -= 40;
3362 if ( attr == 2 ) 3677 if ( attr == 2 )
3363 v5 -= 40; 3678 v5 -= 40;
3364 v41 = attr == 5; 3679 if ( attr == 5 )
3365 if ( v41 )
3366 v5 -= 40; 3680 v5 -= 40;
3367 goto LABEL_361; 3681 goto LABEL_361;
3368 case ITEM_RELIC_ETHRICS_STAFF: 3682 case ITEM_RELIC_ETHRICS_STAFF:
3369 if ( attr == 42 ) 3683 if ( attr == 42 )
3370 { 3684 {
3371 LOBYTE(v34) = LOBYTE(this->pActiveSkills[20]); 3685 v34 = this->pActiveSkills[PLAYER_SKILL_DARK];
3372 v62 = ((unsigned int)v34 >> 1) & 0x1F; 3686 v62 = (v34 / 2 ) & 0x1F;
3373 } 3687 }
3374 if ( attr == 43 ) 3688 if ( attr == 43 )
3375 v61 += 15; 3689 v61 += 15;
3376 goto LABEL_361; 3690 goto LABEL_361;
3377 case ITEM_RELIC_HARECS_LEATHER: 3691 case ITEM_RELIC_HARECS_LEATHER:
3384 if ( attr == 11 || attr == 10 || attr == 12 || attr == 13 || attr == 33 || attr == 14 ) 3698 if ( attr == 11 || attr == 10 || attr == 12 || attr == 13 || attr == 33 || attr == 14 )
3385 { 3699 {
3386 v5 -= 10; 3700 v5 -= 10;
3387 goto LABEL_361; 3701 goto LABEL_361;
3388 } 3702 }
3389 v42 = attr == 15; 3703 if ( attr == 15 )
3390 if ( v42 )
3391 v5 -= 10; 3704 v5 -= 10;
3392 goto LABEL_361; 3705 goto LABEL_361;
3393 case ITEM_RELIC_OLD_NICK: 3706 case ITEM_RELIC_OLD_NICK:
3394 if ( attr == 18 ) 3707 if ( attr == 18 )
3395 v61 += 5; 3708 v61 += 5;
3396 goto LABEL_361; 3709 goto LABEL_361;
3397 case ITEM_RELIC_AMUCK: 3710 case ITEM_RELIC_AMUCK:
3398 if ( !attr ) 3711 if ( attr == 0)
3399 v5 += 100; 3712 v5 += 100;
3400 if ( attr == 3 ) 3713 if ( attr == 3 )
3401 v5 += 100; 3714 v5 += 100;
3402 v43 = attr == 9; 3715 if ( attr == 9 )
3403 if ( v43 )
3404 v5 -= 15; 3716 v5 -= 15;
3405 goto LABEL_361; 3717 goto LABEL_361;
3406 case ITEM_RELIC_GLORY_SHIELD: 3718 case ITEM_RELIC_GLORY_SHIELD:
3407 if ( attr == 45 ) 3719 if ( attr == 45 )
3408 v61 += 5; 3720 v61 += 5;
3409 if ( attr == 15 ) 3721 if ( attr == 15 )
3410 v5 -= 10; 3722 v5 -= 10;
3411 v42 = attr == 14; 3723 if ( attr == 14 )
3412 if ( v42 )
3413 v5 -= 10; 3724 v5 -= 10;
3414 goto LABEL_361; 3725 goto LABEL_361;
3415 case ITEM_RELIC_KELEBRIM: 3726 case ITEM_RELIC_KELEBRIM:
3416 v35 = attr == 3; 3727 if ( attr == 3 )
3417 if ( v35 )
3418 v5 += 50; 3728 v5 += 50;
3419 goto LABEL_361; 3729 goto LABEL_361;
3420 case ITEM_RELIC_TALEDONS_HELM: 3730 case ITEM_RELIC_TALEDONS_HELM:
3421 if ( attr == 2 ) 3731 if ( attr == 2 )
3422 v5 += 15; 3732 v5 += 15;
3423 if ( !attr ) 3733 if ( !attr )
3424 v5 += 15; 3734 v5 += 15;
3425 v41 = attr == 6; 3735 if ( attr == 6 )
3426 if ( v41 )
3427 v5 -= 40; 3736 v5 -= 40;
3428 goto LABEL_361; 3737 goto LABEL_361;
3429 case ITEM_RELIC_SCHOLARS_CAP: 3738 case ITEM_RELIC_SCHOLARS_CAP:
3430 if ( attr == 46 ) 3739 if ( attr == 46 )
3431 v61 += 15; 3740 v61 += 15;
3432 v44 = attr == 3; 3741 if ( attr == 3 )
3433 if ( v44 )
3434 v5 -= 50; 3742 v5 -= 50;
3435 goto LABEL_361; 3743 goto LABEL_361;
3436 case ITEM_RELIC_PHYNAXIAN_CROWN: 3744 case ITEM_RELIC_PHYNAXIAN_CROWN:
3437 if ( attr == 34 ) 3745 if ( attr == 34 )
3438 { 3746 {
3439 LOBYTE(v34) = LOBYTE(this->pActiveSkills[12]); 3747 v34 = this->pActiveSkills[PLAYER_SKILL_FIRE];
3440 v62 = ((unsigned int)v34 >> 1) & 0x1F; 3748 v62 = (v34 / 2 ) & 0x1F;
3441 } 3749 }
3442 if ( attr == 12 ) 3750 if ( attr == 12 )
3443 v5 += 50; 3751 v5 += 50;
3444 if ( attr == 2 ) 3752 if ( attr == 2 )
3445 v5 += 30; 3753 v5 += 30;
3446 v45 = attr == 9; 3754 if ( attr == 9 )
3447 if ( v45 )
3448 v5 -= 20; 3755 v5 -= 20;
3449 goto LABEL_361; 3756 goto LABEL_361;
3450 case ITEM_RILIC_TITANS_BELT: 3757 case ITEM_RILIC_TITANS_BELT:
3451 if ( !attr ) 3758 if ( !attr )
3452 v5 += 75; 3759 v5 += 75;
3453 v41 = attr == 5; 3760 if ( attr == 5 )
3454 if ( v41 )
3455 v5 -= 40; 3761 v5 -= 40;
3456 goto LABEL_361; 3762 goto LABEL_361;
3457 case ITEM_RELIC_TWILIGHT: 3763 case ITEM_RELIC_TWILIGHT:
3458 if ( attr == CHARACTER_ATTRIBUTE_SPEED ) 3764 if ( attr == CHARACTER_ATTRIBUTE_SPEED )
3459 v5 += 50; 3765 v5 += 50;
3462 if ( attr == CHARACTER_ATTRIBUTE_RESIST_AIR || attr == CHARACTER_ATTRIBUTE_RESIST_FIRE || attr == CHARACTER_ATTRIBUTE_RESIST_WATER || attr == CHARACTER_ATTRIBUTE_RESIST_EARTH || attr == CHARACTER_ATTRIBUTE_RESIST_SPIRIT || attr == CHARACTER_ATTRIBUTE_RESIST_MIND ) 3768 if ( attr == CHARACTER_ATTRIBUTE_RESIST_AIR || attr == CHARACTER_ATTRIBUTE_RESIST_FIRE || attr == CHARACTER_ATTRIBUTE_RESIST_WATER || attr == CHARACTER_ATTRIBUTE_RESIST_EARTH || attr == CHARACTER_ATTRIBUTE_RESIST_SPIRIT || attr == CHARACTER_ATTRIBUTE_RESIST_MIND )
3463 { 3769 {
3464 v5 -= 15; 3770 v5 -= 15;
3465 goto LABEL_361; 3771 goto LABEL_361;
3466 } 3772 }
3467 v43 = attr == 15; 3773 if ( attr == 15 )
3468 if ( v43 )
3469 v5 -= 15; 3774 v5 -= 15;
3470 goto LABEL_361; 3775 goto LABEL_361;
3471 case ITEM_RELIC_ANIA_SELVING: 3776 case ITEM_RELIC_ANIA_SELVING:
3472 if ( attr == CHARACTER_ATTRIBUTE_ACCURACY ) 3777 if ( attr == CHARACTER_ATTRIBUTE_ACCURACY )
3473 v5 += 150; 3778 v5 += 150;
3477 v5 -= 25; 3782 v5 -= 25;
3478 goto LABEL_361; 3783 goto LABEL_361;
3479 case ITEM_RELIC_JUSTICE: 3784 case ITEM_RELIC_JUSTICE:
3480 if ( attr == 39 ) 3785 if ( attr == 39 )
3481 { 3786 {
3482 LOBYTE(v34) = LOBYTE(this->pActiveSkills[17]); 3787 v34 = this->pActiveSkills[PLAYER_SKILL_MIND];
3483 v34 = ((unsigned int)v34 >> 1) & 0x1F; 3788 v62 = (v34 / 2 ) & 0x1F;
3484 v62 = v34;
3485 } 3789 }
3486 if ( attr == 40 ) 3790 if ( attr == 40 )
3487 { 3791 {
3488 LOBYTE(v34) = LOBYTE(this->pActiveSkills[18]); 3792 v34 = this->pActiveSkills[PLAYER_SKILL_BODY];
3489 v62 = ((unsigned int)v34 >> 1) & 0x1F; 3793 v62 = (v34 / 2 ) & 0x1F;
3490 } 3794 }
3491 v41 = attr == 5; 3795 if ( attr == 5 )
3492 if ( v41 )
3493 v5 -= 40; 3796 v5 -= 40;
3494 goto LABEL_361; 3797 goto LABEL_361;
3495 case ITEM_RELIC_MEKORIGS_HAMMER: 3798 case ITEM_RELIC_MEKORIGS_HAMMER:
3496 if ( attr == 38 ) 3799 if ( attr == 38 )
3497 { 3800 {
3498 LOBYTE(v34) = LOBYTE(this->pActiveSkills[16]); 3801 v34 = this->pActiveSkills[PLAYER_SKILL_SPIRIT];
3499 v62 = ((unsigned int)v34 >> 1) & 0x1F; 3802 v62 = ( v34 / 2 ) & 0x1F;
3500 } 3803 }
3501 if ( !attr ) 3804 if ( attr == 0 )
3502 v5 += 75; 3805 v5 += 75;
3503 v44 = attr == 11; 3806 if ( attr == 11 )
3504 if ( v44 )
3505 v5 -= 50; 3807 v5 -= 50;
3506 goto LABEL_361; 3808 goto LABEL_361;
3507 case ITEM_ARTIFACT_HERMES_SANDALS: 3809 case ITEM_ARTIFACT_HERMES_SANDALS:
3508 if ( attr == 5 ) 3810 if ( attr == 5 )
3509 v5 += 100; 3811 v5 += 100;
3510 if ( attr == 4 ) 3812 if ( attr == 4 )
3511 v5 += 50; 3813 v5 += 50;
3512 v35 = attr == 11; 3814 if ( attr == 11 )
3513 if ( v35 )
3514 v5 += 50; 3815 v5 += 50;
3515 goto LABEL_361; 3816 goto LABEL_361;
3516 case ITEM_ARTIFACT_CLOAK_OF_THE_SHEEP: 3817 case ITEM_ARTIFACT_CLOAK_OF_THE_SHEEP:
3517 if ( attr == 1 ) 3818 if ( attr == 1 )
3518 v5 -= 20; 3819 v5 -= 20;
3519 v45 = attr == 2; 3820 if ( attr == 2 )
3520 if ( v45 )
3521 v5 -= 20; 3821 v5 -= 20;
3522 goto LABEL_361; 3822 goto LABEL_361;
3523 case ITEM_ARTIFACT_MINDS_EYE: 3823 case ITEM_ARTIFACT_MINDS_EYE:
3524 if ( attr == 1 ) 3824 if ( attr == 1 )
3525 v5 += 15; 3825 v5 += 15;
3526 v46 = attr == 2; 3826 if ( attr == 2 )
3527 if ( v46 )
3528 v5 += 15; 3827 v5 += 15;
3529 goto LABEL_361; 3828 goto LABEL_361;
3530 case ITEM_ELVEN_CHAINMAIL: 3829 case ITEM_ELVEN_CHAINMAIL:
3531 if ( attr == 5 ) 3830 if ( attr == 5 )
3532 v5 += 15; 3831 v5 += 15;
3533 v46 = attr == 4; 3832 if ( attr == 4 )
3534 if ( v46 )
3535 v5 += 15; 3833 v5 += 15;
3536 goto LABEL_361; 3834 goto LABEL_361;
3537 case ITEM_FORGE_GAUNTLETS: 3835 case ITEM_FORGE_GAUNTLETS:
3538 if ( attr == 10 ) 3836 if ( attr == 10 )
3539 v5 += 30; 3837 v5 += 30;
3540 if ( !attr ) 3838 if ( attr == 0 )
3541 v5 += 15; 3839 v5 += 15;
3542 v46 = attr == 3; 3840 if ( attr == 3 )
3543 if ( v46 )
3544 v5 += 15; 3841 v5 += 15;
3545 goto LABEL_361; 3842 goto LABEL_361;
3546 case ITEM_ARTIFACT_HEROS_BELT: 3843 case ITEM_ARTIFACT_HEROS_BELT:
3547 if ( attr == 21 ) 3844 if ( attr == 21 )
3548 v61 += 5; 3845 v61 += 5;
3549 if ( !attr ) 3846 if ( attr == 0 )
3550 v5 += 15; 3847 v5 += 15;
3551 if (attr >= 10 && attr <= 15) 3848 if (attr >= 10 && attr <= 15)
3552 {
3553 v5 += 10; 3849 v5 += 10;
3554 }
3555 goto LABEL_361; 3850 goto LABEL_361;
3556 case ITEM_ARTIFACT_LADYS_ESCORT: 3851 case ITEM_ARTIFACT_LADYS_ESCORT:
3557 if (attr >= 10 && attr <= 15) 3852 if (attr >= 10 && attr <= 15)
3558 {
3559 v5 += 10; 3853 v5 += 10;
3560 goto LABEL_361; 3854 goto LABEL_361;
3561 }
3562 default: 3855 default:
3563 goto LABEL_361; 3856 goto LABEL_361;
3564 } 3857 }
3565 goto LABEL_361; 3858 goto LABEL_361;
3566 } 3859 }
3576 { 3869 {
3577 if ( attr <= CHARACTER_ATTRIBUTE_SKILL_UNARMED && v5 < this->pOwnItems[v65].m_enchantmentStrength ) 3870 if ( attr <= CHARACTER_ATTRIBUTE_SKILL_UNARMED && v5 < this->pOwnItems[v65].m_enchantmentStrength )
3578 v5 = this->pOwnItems[v65].m_enchantmentStrength; 3871 v5 = this->pOwnItems[v65].m_enchantmentStrength;
3579 } 3872 }
3580 } 3873 }
3581 goto LABEL_361;
3582 }
3583 v34 = this->pOwnItems[v65].uSpecEnchantmentType;
3584 if ( v34 > 48 )
3585 {
3586 switch ( v34 )
3587 {
3588 case 54:
3589 v46 = attr == 3;
3590 if ( v46 )
3591 v5 += 15;
3592 goto LABEL_361;
3593 case 49:
3594 if ( attr == 6 )
3595 {
3596 v5 += 10;
3597 goto LABEL_361;
3598 }
3599 v50 = attr == 1;
3600 if (v50)
3601 v5 += 10;
3602 goto LABEL_361;
3603 case 51:
3604 if ( attr != 5 && attr != 1 )
3605 {
3606 v50 = attr == 8;
3607 if (v50)
3608 v5 += 10;
3609 goto LABEL_361;
3610 }
3611 v5 += 10;
3612 goto LABEL_361;
3613 case 52:
3614 if ( attr == 3 )
3615 {
3616 v5 += 10;
3617 goto LABEL_361;
3618 }
3619 v50 = attr == 4;
3620 if (v50)
3621 v5 += 10;
3622 goto LABEL_361;
3623 case 53:
3624 if ( !attr )
3625 {
3626 v5 += 10;
3627 goto LABEL_361;
3628 }
3629 v50 = attr == 2;
3630 if (v50)
3631 v5 += 10;
3632 goto LABEL_361;
3633 case 55:
3634 v46 = attr == 6;
3635 if ( v46 )
3636 v5 += 15;
3637 goto LABEL_361;
3638 case 56:
3639 if ( !attr )
3640 {
3641 v5 += 5;
3642 goto LABEL_361;
3643 }
3644 v53 = attr == 3;
3645 if ( v53 )
3646 v5 += 5;
3647 goto LABEL_361;
3648 case 57:
3649 if ( attr == 1 )
3650 {
3651 v5 += 5;
3652 goto LABEL_361;
3653 }
3654 v53 = attr == 2;
3655 if ( v53 )
3656 v5 += 5;
3657 goto LABEL_361;
3658 case 50:
3659 if ( attr == 10 )
3660 v5 += 30;
3661 goto LABEL_361;
3662 case 60:
3663 if ( attr != 23 )
3664 {
3665 v54 = attr == 22;
3666 if ( !v54 )
3667 goto LABEL_361;
3668 if ( v5 >= 3 )
3669 goto LABEL_361;
3670 v60 = 3;
3671 v5 = v60;
3672 break;
3673 }
3674 if ( v5 >= 3 )
3675 goto LABEL_361;
3676 v5 = 3;
3677 v54 = attr == 22;
3678 if ( !v54 )
3679 goto LABEL_361;
3680 if ( v5 >= 3 )
3681 goto LABEL_361;
3682 v60 = 3;
3683 v5 = v60;
3684 break;
3685 case 61:
3686 if ( attr != 17 )
3687 {
3688 v54 = attr == 18;
3689 if ( !v54 )
3690 goto LABEL_361;
3691 if ( v5 >= 3 )
3692 goto LABEL_361;
3693 v60 = 3;
3694 v5 = v60;
3695 break;
3696 }
3697 if ( v5 >= 3 )
3698 goto LABEL_361;
3699 v5 = 3;
3700 v54 = attr == 18;
3701 if ( !v54 )
3702 goto LABEL_361;
3703 if ( v5 >= 3 )
3704 goto LABEL_361;
3705 v60 = 3;
3706 v5 = v60;
3707 break;
3708 case 62:
3709 if ( attr != 19 )
3710 {
3711 v54 = attr == 20;
3712 if ( !v54 )
3713 goto LABEL_361;
3714 if ( v5 >= 3 )
3715 goto LABEL_361;
3716 v60 = 3;
3717 v5 = v60;
3718 break;
3719 }
3720 if ( v5 >= 3 )
3721 goto LABEL_361;
3722 v5 = 3;
3723 v54 = attr == 20;
3724 if ( !v54 )
3725 goto LABEL_361;
3726 if ( v5 >= 3 )
3727 goto LABEL_361;
3728 v60 = 3;
3729 v5 = v60;
3730 break;
3731 case 67:
3732 v55 = attr == 18;
3733 if ( v55 && v5 < 2 )
3734 {
3735 v60 = 2;
3736 v5 = v60;
3737 }
3738 break;
3739 case 68:
3740 v53 = attr == 9;
3741 if ( v53 )
3742 v5 += 5;
3743 goto LABEL_361;
3744 case 69:
3745 if ( attr == 11 )
3746 v5 += 20;
3747 break;
3748 case 70:
3749 if ( attr == 12 )
3750 v5 += 10;
3751 v55 = attr == 16;
3752 if ( v55 && v5 < 2 )
3753 {
3754 v60 = 2;
3755 v5 = v60;
3756 }
3757 break;
3758 default:
3759 goto LABEL_361;
3760 }
3761 goto LABEL_361;
3762 }
3763 if ( v34 == 48 )
3764 {
3765 if ( attr == 9 )
3766 v5 += 5;
3767 v46 = attr == 3;
3768 if ( v46 )
3769 v5 += 15;
3770 goto LABEL_361;
3771 }
3772 if ( v34 > 32 )
3773 {
3774 if ( v34 > 44 )
3775 {
3776 v51 = v34 - 45;
3777 if ( !v51 )
3778 {
3779 if ( attr == 5 )
3780 v5 += 5;
3781 goto LABEL_361;
3782 v53 = attr == 4;
3783 if ( v53 )
3784 v5 += 5;
3785 goto LABEL_361;
3786 }
3787 v52 = v51 - 1;
3788 if ( !v52 )
3789 {
3790 v40 = attr == 0;
3791 if ( v40 )
3792 v5 += 25;
3793 goto LABEL_361;
3794 }
3795 if ( v52 == 1 )
3796 {
3797 v50 = attr == 8;
3798 if (v50)
3799 v5 += 10;
3800 goto LABEL_361;
3801 }
3802 }
3803 else
3804 {
3805 if ( v34 == 44 )
3806 {
3807 v50 = attr == 7;
3808 if (v50)
3809 v5 += 10;
3810 goto LABEL_361;
3811 }
3812 v34 -= 33;
3813 if ( !v34 )
3814 {
3815 if ( attr != 38 )
3816 goto LABEL_361;
3817 LOBYTE(v34) = LOBYTE(this->pActiveSkills[16]);
3818 v62 = ((unsigned int)v34 >> 1) & 0x1F;
3819 goto LABEL_361;
3820 }
3821 --v34;
3822 if ( !v34 )
3823 {
3824 if ( attr != 36 )
3825 goto LABEL_361;
3826 LOBYTE(v34) = LOBYTE(this->pActiveSkills[14]);
3827 v62 = ((unsigned int)v34 >> 1) & 0x1F;
3828 goto LABEL_361;
3829 }
3830 v49 = v34 - 8;
3831 if ( !v49 )
3832 {
3833 if ( (signed int)attr >= 0 && (signed int)attr <= 15 )
3834 ++v5;
3835 goto LABEL_361;
3836 }
3837 if ( v49 == 1 )
3838 {
3839 if ( attr != 3 && attr != 7 )
3840 {
3841 v50 = attr == 9;
3842 if ( !v50 )
3843 goto LABEL_361;
3844 }
3845 v5 += 10;
3846 goto LABEL_361;
3847 }
3848 }
3849 } 3874 }
3850 else 3875 else
3851 { 3876 {
3852 if ( v34 == 32 ) 3877 v34 = this->pOwnItems[v65].uSpecEnchantmentType;
3853 { 3878 GetItemBonusSpecialEnchantment(v34, attr, &v5, &v61);
3854 if ( attr != 39 ) 3879 }
3855 goto LABEL_361; 3880
3856 LOBYTE(v34) = LOBYTE(this->pActiveSkills[17]);
3857 v62 = ((unsigned int)v34 >> 1) & 0x1F;
3858 goto LABEL_361;
3859 }
3860 if ( v34 > 28 )
3861 {
3862 v34 -= 29;
3863 if ( v34 )
3864 {
3865 --v34;
3866 if ( v34 )
3867 {
3868 --v34;
3869 if ( v34 || attr != 41 )
3870 goto LABEL_361;
3871 LOBYTE(v34) = LOBYTE(this->pActiveSkills[19]);
3872 }
3873 else
3874 {
3875 if ( attr != 34 )
3876 goto LABEL_361;
3877 LOBYTE(v34) = LOBYTE(this->pActiveSkills[12]);
3878 }
3879 }
3880 else
3881 {
3882 if ( attr != 37 )
3883 goto LABEL_361;
3884 LOBYTE(v34) = LOBYTE(this->pActiveSkills[15]);
3885 }
3886 v62 = ((unsigned int)v34 >> 1) & 0x1F;
3887 goto LABEL_361;
3888 }
3889 if ( v34 == 28 )
3890 {
3891 if ( attr == 42 )
3892 {
3893 LOBYTE(v34) = LOBYTE(this->pActiveSkills[20]);
3894 v62 = ((unsigned int)v34 >> 1) & 0x1F;
3895 goto LABEL_361;
3896 }
3897 }
3898 else
3899 {
3900 v47 = v34 - 1;
3901 if ( v47 )
3902 {
3903 v48 = v47 - 1;
3904 if ( v48 )
3905 {
3906 v34 = v48 - 24;
3907 if ( v34 )
3908 {
3909 --v34;
3910 if ( v34 || attr != 40 )
3911 goto LABEL_361;
3912 LOBYTE(v34) = LOBYTE(this->pActiveSkills[18]);
3913 }
3914 else
3915 {
3916 if ( attr != 35 )
3917 goto LABEL_361;
3918 LOBYTE(v34) = LOBYTE(this->pActiveSkills[13]);
3919 }
3920 v62 = ((unsigned int)v34 >> 1) & 0x1F;
3921 goto LABEL_361;
3922 }
3923 if (attr >= 0 && attr <= 6)
3924 {
3925 v5 += 10;
3926 goto LABEL_361;
3927 }
3928 }
3929 else
3930 {
3931 if (attr >= 10 && attr <= 15)
3932 {
3933 v5 += 10;
3934 goto LABEL_361;
3935 }
3936 }
3937 }
3938 }
3939 LABEL_361: 3881 LABEL_361:
3940 ++v65; 3882 ++v65;
3941 if ( (signed int)v65 >= 16 ) 3883 if ( (signed int)v65 >= 16 )
3942 return v5 + v62 + v61; 3884 return v5 + v62 + v61;
3943 } 3885 }