Mercurial > mm7
comparison mm7_6.cpp @ 222:8113753ed2ae
more item init fixing
author | Gloval |
---|---|
date | Sun, 17 Feb 2013 11:29:10 +0400 |
parents | 9b77686e2239 |
children | 1bd823f52e3a |
comparison
equal
deleted
inserted
replaced
193:821fd955c379 | 222:8113753ed2ae |
---|---|
5265 v313 = *(char *)(LODWORD(v725) + 28); | 5265 v313 = *(char *)(LODWORD(v725) + 28); |
5266 if ( v313 == 3 | v313 == 4 | v313 == 5 | v313 == 6 | v313 == 7 | v313 == 8 | v313 == 9 | v313 == 10 | v313 == 11 ) | 5266 if ( v313 == 3 | v313 == 4 | v313 == 5 | v313 == 6 | v313 == 7 | v313 == 8 | v313 == 9 | v313 == 10 | v313 == 11 ) |
5267 { | 5267 { |
5268 v314 = rand() % pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType]; | 5268 v314 = rand() % pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType]; |
5269 *(int *)(v245 + 4) = 0; | 5269 *(int *)(v245 + 4) = 0; |
5270 for ( j = pItemsTable->pEnchantments[0].field_8[pItemsTable->pItems[*(int *)v245].uEquipType | 5270 for ( j = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[*(int *)v245].uEquipType |
5271 + 1]; | 5271 + 1]; |
5272 ; | 5272 ; |
5273 j += pItemsTable->pEnchantments[*(int *)(v245 + 4)].field_8[pItemsTable->pItems[*(int *)v245].uEquipType | 5273 j += pItemsTable->pEnchantments[*(int *)(v245 + 4)].to_item[pItemsTable->pItems[*(int *)v245].uEquipType |
5274 + 1] ) | 5274 + 1] ) |
5275 { | 5275 { |
5276 ++*(int *)(v245 + 4); | 5276 ++*(int *)(v245 + 4); |
5277 if ( j >= v314 ) | 5277 if ( j >= v314 ) |
5278 break; | 5278 break; |
5352 if ( rand() % 100 < 80 | 5352 if ( rand() % 100 < 80 |
5353 && !(*(char *)(LODWORD(v273) + 28) == 0 | *(char *)(LODWORD(v273) + 28) == 1 | *(char *)(LODWORD(v273) + 28) == 2) ) | 5353 && !(*(char *)(LODWORD(v273) + 28) == 0 | *(char *)(LODWORD(v273) + 28) == 1 | *(char *)(LODWORD(v273) + 28) == 2) ) |
5354 { | 5354 { |
5355 v275 = rand() % pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType]; | 5355 v275 = rand() % pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType]; |
5356 *(int *)(v245 + 4) = 0; | 5356 *(int *)(v245 + 4) = 0; |
5357 for ( k = pItemsTable->pEnchantments[0].field_8[pItemsTable->pItems[*(int *)v245].uEquipType + 1]; | 5357 for ( k = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[*(int *)v245].uEquipType + 1]; |
5358 ; | 5358 ; |
5359 k += pItemsTable->pEnchantments[*(int *)(v245 + 4)].field_8[pItemsTable->pItems[*(int *)v245].uEquipType | 5359 k += pItemsTable->pEnchantments[*(int *)(v245 + 4)].to_item[pItemsTable->pItems[*(int *)v245].uEquipType |
5360 + 1] ) | 5360 + 1] ) |
5361 { | 5361 { |
5362 ++*(int *)(v245 + 4); | 5362 ++*(int *)(v245 + 4); |
5363 if ( k >= v275 ) | 5363 if ( k >= v275 ) |
5364 break; | 5364 break; |
5366 v254 = rand(); | 5366 v254 = rand(); |
5367 v255 = pItemsTable->field_116D8[19]; | 5367 v255 = pItemsTable->field_116D8[19]; |
5368 v256 = pItemsTable->field_116D8[18]; | 5368 v256 = pItemsTable->field_116D8[18]; |
5369 goto LABEL_611; | 5369 goto LABEL_611; |
5370 } | 5370 } |
5371 v277 = pItemsTable->field_11798; | 5371 v277 = pItemsTable->pSpecialEnchantments_count; |
5372 v278 = 0; | 5372 v278 = 0; |
5373 v725 = 0.0; | 5373 v725 = 0.0; |
5374 HIDWORD(v733) = 0; | 5374 HIDWORD(v733) = 0; |
5375 if ( pItemsTable->field_11798 > 0 ) | 5375 if ( pItemsTable->pSpecialEnchantments_count > 0 ) |
5376 { | 5376 { |
5377 v730 = (int)&v679; | 5377 v730 = (int)&v679; |
5378 do | 5378 do |
5379 { | 5379 { |
5380 v279 = LOBYTE(pItemsTable->pSpecialEnchantments[v278 + 1].pName); | 5380 v279 = LOBYTE(pItemsTable->pSpecialEnchantments[v278 + 1].pBonusStatement); |
5381 if ( !v279 || v279 == 1 ) | 5381 if ( !v279 || v279 == 1 ) |
5382 { | 5382 { |
5383 v280 = *(&pItemsTable->pSpecialEnchantments[0].field_8[pItemsTable->pItems[*(int *)v245].uEquipType | 5383 v280 = *(&pItemsTable->pSpecialEnchantments[0].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType |
5384 + 4] | 5384 + 4] |
5385 + v278 * 28); | 5385 + v278 * 28); |
5386 LODWORD(v725) += v280; | 5386 LODWORD(v725) += v280; |
5387 if ( v280 ) | 5387 if ( v280 ) |
5388 { | 5388 { |
5397 while ( SHIDWORD(v733) < v277 ); | 5397 while ( SHIDWORD(v733) < v277 ); |
5398 } | 5398 } |
5399 v282 = rand() % SLODWORD(v725); | 5399 v282 = rand() % SLODWORD(v725); |
5400 v283 = v679; | 5400 v283 = v679; |
5401 *(int *)(v245 + 12) = v679; | 5401 *(int *)(v245 + 12) = v679; |
5402 v284 = pItemsTable->pSpecialEnchantments[v283].field_8[pItemsTable->pItems[*(int *)v245].uEquipType + 4]; | 5402 v284 = pItemsTable->pSpecialEnchantments[v283].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType + 4]; |
5403 v285 = v282 + 1; | 5403 v285 = v282 + 1; |
5404 if ( v284 < v285 ) | 5404 if ( v284 < v285 ) |
5405 { | 5405 { |
5406 for ( l = &v679; ; l = (int *)v732 ) | 5406 for ( l = &v679; ; l = (int *)v732 ) |
5407 { | 5407 { |
5408 v287 = (int)(l + 1); | 5408 v287 = (int)(l + 1); |
5409 v732 = v287; | 5409 v732 = v287; |
5410 v288 = *(int *)v287; | 5410 v288 = *(int *)v287; |
5411 *(int *)(v245 + 12) = v288; | 5411 *(int *)(v245 + 12) = v288; |
5412 v284 += pItemsTable->pSpecialEnchantments[v288].field_8[pItemsTable->pItems[*(int *)v245].uEquipType | 5412 v284 += pItemsTable->pSpecialEnchantments[v288].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType |
5413 + 4]; | 5413 + 4]; |
5414 if ( v284 >= v285 ) | 5414 if ( v284 >= v285 ) |
5415 break; | 5415 break; |
5416 } | 5416 } |
5417 } | 5417 } |
5450 if ( rand() % 100 < 80 | 5450 if ( rand() % 100 < 80 |
5451 && !(*(char *)(LODWORD(v250) + 28) == 0 | *(char *)(LODWORD(v250) + 28) == 1 | *(char *)(LODWORD(v250) + 28) == 2) ) | 5451 && !(*(char *)(LODWORD(v250) + 28) == 0 | *(char *)(LODWORD(v250) + 28) == 1 | *(char *)(LODWORD(v250) + 28) == 2) ) |
5452 { | 5452 { |
5453 v252 = rand() % pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType]; | 5453 v252 = rand() % pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType]; |
5454 *(int *)(v245 + 4) = 0; | 5454 *(int *)(v245 + 4) = 0; |
5455 for ( m = pItemsTable->pEnchantments[0].field_8[pItemsTable->pItems[*(int *)v245].uEquipType + 1]; | 5455 for ( m = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[*(int *)v245].uEquipType + 1]; |
5456 ; | 5456 ; |
5457 m += pItemsTable->pEnchantments[*(int *)(v245 + 4)].field_8[pItemsTable->pItems[*(int *)v245].uEquipType | 5457 m += pItemsTable->pEnchantments[*(int *)(v245 + 4)].to_item[pItemsTable->pItems[*(int *)v245].uEquipType |
5458 + 1] ) | 5458 + 1] ) |
5459 { | 5459 { |
5460 ++*(int *)(v245 + 4); | 5460 ++*(int *)(v245 + 4); |
5461 if ( m >= v252 ) | 5461 if ( m >= v252 ) |
5462 break; | 5462 break; |
5464 v254 = rand(); | 5464 v254 = rand(); |
5465 v255 = pItemsTable->field_116D8[21]; | 5465 v255 = pItemsTable->field_116D8[21]; |
5466 v256 = pItemsTable->field_116D8[20]; | 5466 v256 = pItemsTable->field_116D8[20]; |
5467 goto LABEL_611; | 5467 goto LABEL_611; |
5468 } | 5468 } |
5469 v257 = pItemsTable->field_11798; | 5469 v257 = pItemsTable->pSpecialEnchantments_count; |
5470 v258 = 0; | 5470 v258 = 0; |
5471 v725 = 0.0; | 5471 v725 = 0.0; |
5472 HIDWORD(v733) = 0; | 5472 HIDWORD(v733) = 0; |
5473 if ( pItemsTable->field_11798 > 0 ) | 5473 if ( pItemsTable->pSpecialEnchantments_count > 0 ) |
5474 { | 5474 { |
5475 v730 = (int)&v679; | 5475 v730 = (int)&v679; |
5476 do | 5476 do |
5477 { | 5477 { |
5478 v259 = LOBYTE(pItemsTable->pSpecialEnchantments[v258 + 1].pName); | 5478 v259 = LOBYTE(pItemsTable->pSpecialEnchantments[v258 + 1].pBonusStatement); |
5479 if ( !v259 || v259 == 1 ) | 5479 if ( !v259 || v259 == 1 ) |
5480 { | 5480 { |
5481 v260 = *(&pItemsTable->pSpecialEnchantments[0].field_8[pItemsTable->pItems[*(int *)v245].uEquipType | 5481 v260 = *(&pItemsTable->pSpecialEnchantments[0].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType |
5482 + 4] | 5482 + 4] |
5483 + v258 * 28); | 5483 + v258 * 28); |
5484 LODWORD(v725) += v260; | 5484 LODWORD(v725) += v260; |
5485 if ( v260 ) | 5485 if ( v260 ) |
5486 { | 5486 { |
5495 while ( SHIDWORD(v733) < v257 ); | 5495 while ( SHIDWORD(v733) < v257 ); |
5496 } | 5496 } |
5497 v262 = rand() % SLODWORD(v725); | 5497 v262 = rand() % SLODWORD(v725); |
5498 v263 = v679; | 5498 v263 = v679; |
5499 *(int *)(v245 + 12) = v679; | 5499 *(int *)(v245 + 12) = v679; |
5500 v264 = pItemsTable->pSpecialEnchantments[v263].field_8[pItemsTable->pItems[*(int *)v245].uEquipType + 4]; | 5500 v264 = pItemsTable->pSpecialEnchantments[v263].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType + 4]; |
5501 v265 = v262 + 1; | 5501 v265 = v262 + 1; |
5502 if ( v264 < v265 ) | 5502 if ( v264 < v265 ) |
5503 { | 5503 { |
5504 for ( ii = &v679; ; ii = (int *)v732 ) | 5504 for ( ii = &v679; ; ii = (int *)v732 ) |
5505 { | 5505 { |
5506 v267 = (int)(ii + 1); | 5506 v267 = (int)(ii + 1); |
5507 v732 = v267; | 5507 v732 = v267; |
5508 v268 = *(int *)v267; | 5508 v268 = *(int *)v267; |
5509 *(int *)(v245 + 12) = v268; | 5509 *(int *)(v245 + 12) = v268; |
5510 v264 += pItemsTable->pSpecialEnchantments[v268].field_8[pItemsTable->pItems[*(int *)v245].uEquipType | 5510 v264 += pItemsTable->pSpecialEnchantments[v268].to_item_apply[pItemsTable->pItems[*(int *)v245].uEquipType |
5511 + 4]; | 5511 + 4]; |
5512 if ( v264 >= v265 ) | 5512 if ( v264 >= v265 ) |
5513 break; | 5513 break; |
5514 } | 5514 } |
5515 } | 5515 } |
5548 v1 = 0; | 5548 v1 = 0; |
5549 goto LABEL_199; | 5549 goto LABEL_199; |
5550 } | 5550 } |
5551 if ( rand() % 100 >= 80 ) | 5551 if ( rand() % 100 >= 80 ) |
5552 { | 5552 { |
5553 v297 = pItemsTable->field_11798; | 5553 v297 = pItemsTable->pSpecialEnchantments_count; |
5554 v294 = _this; | 5554 v294 = _this; |
5555 v298 = 0; | 5555 v298 = 0; |
5556 v725 = 0.0; | 5556 v725 = 0.0; |
5557 HIDWORD(v733) = 0; | 5557 HIDWORD(v733) = 0; |
5558 if ( pItemsTable->field_11798 > 0 ) | 5558 if ( pItemsTable->pSpecialEnchantments_count > 0 ) |
5559 { | 5559 { |
5560 v730 = (int)&v679; | 5560 v730 = (int)&v679; |
5561 do | 5561 do |
5562 { | 5562 { |
5563 v299 = LOBYTE(pItemsTable->pSpecialEnchantments[v298 + 1].pName); | 5563 v299 = LOBYTE(pItemsTable->pSpecialEnchantments[v298 + 1].pBonusStatement); |
5564 if ( !v299 || v299 == 1 ) | 5564 if ( !v299 || v299 == 1 ) |
5565 { | 5565 { |
5566 v300 = *(&pItemsTable->pSpecialEnchantments[0].field_8[pItemsTable->pItems[v294->uItemID].uEquipType + 4] | 5566 v300 = *(&pItemsTable->pSpecialEnchantments[0].to_item_apply[pItemsTable->pItems[v294->uItemID].uEquipType + 4] |
5567 + v298 * 28); | 5567 + v298 * 28); |
5568 LODWORD(v725) += v300; | 5568 LODWORD(v725) += v300; |
5569 if ( v300 ) | 5569 if ( v300 ) |
5570 { | 5570 { |
5571 v301 = v730; | 5571 v301 = v730; |
5579 while ( SHIDWORD(v733) < v297 ); | 5579 while ( SHIDWORD(v733) < v297 ); |
5580 } | 5580 } |
5581 v302 = rand() % SLODWORD(v725); | 5581 v302 = rand() % SLODWORD(v725); |
5582 v303 = v679; | 5582 v303 = v679; |
5583 v294->uAdditionalValue = v679; | 5583 v294->uAdditionalValue = v679; |
5584 v304 = pItemsTable->pSpecialEnchantments[v303].field_8[pItemsTable->pItems[v294->uItemID].uEquipType + 4]; | 5584 v304 = pItemsTable->pSpecialEnchantments[v303].to_item_apply[pItemsTable->pItems[v294->uItemID].uEquipType + 4]; |
5585 v305 = v302 + 1; | 5585 v305 = v302 + 1; |
5586 if ( v304 < v305 ) | 5586 if ( v304 < v305 ) |
5587 { | 5587 { |
5588 for ( jj = &v679; ; jj = (int *)v732 ) | 5588 for ( jj = &v679; ; jj = (int *)v732 ) |
5589 { | 5589 { |
5590 v307 = (int)(jj + 1); | 5590 v307 = (int)(jj + 1); |
5591 v732 = v307; | 5591 v732 = v307; |
5592 v308 = *(int *)v307; | 5592 v308 = *(int *)v307; |
5593 v294->uAdditionalValue = v308; | 5593 v294->uAdditionalValue = v308; |
5594 v304 += pItemsTable->pSpecialEnchantments[v308].field_8[pItemsTable->pItems[v294->uItemID].uEquipType + 4]; | 5594 v304 += pItemsTable->pSpecialEnchantments[v308].to_item_apply[pItemsTable->pItems[v294->uItemID].uEquipType + 4]; |
5595 if ( v304 >= v305 ) | 5595 if ( v304 >= v305 ) |
5596 break; | 5596 break; |
5597 } | 5597 } |
5598 } | 5598 } |
5599 ++v294->uAdditionalValue; | 5599 ++v294->uAdditionalValue; |
5602 { | 5602 { |
5603 v293 = rand(); | 5603 v293 = rand(); |
5604 v294 = _this; | 5604 v294 = _this; |
5605 v295 = v293 % pItemsTable->field_116D8[pItemsTable->pItems[_this->uItemID].uEquipType]; | 5605 v295 = v293 % pItemsTable->field_116D8[pItemsTable->pItems[_this->uItemID].uEquipType]; |
5606 _this->_bonus_type = 0; | 5606 _this->_bonus_type = 0; |
5607 for ( kk = pItemsTable->pEnchantments[0].field_8[pItemsTable->pItems[v294->uItemID].uEquipType + 1]; | 5607 for ( kk = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[v294->uItemID].uEquipType + 1]; |
5608 ; | 5608 ; |
5609 kk += pItemsTable->pEnchantments[v294->_bonus_type].field_8[pItemsTable->pItems[v294->uItemID].uEquipType | 5609 kk += pItemsTable->pEnchantments[v294->_bonus_type].to_item[pItemsTable->pItems[v294->uItemID].uEquipType |
5610 + 1] ) | 5610 + 1] ) |
5611 { | 5611 { |
5612 ++v294->_bonus_type; | 5612 ++v294->_bonus_type; |
5613 if ( kk >= v295 ) | 5613 if ( kk >= v295 ) |
5614 break; | 5614 break; |
8573 a1a.field_58 = 0; | 8573 a1a.field_58 = 0; |
8574 a1a.field_5C = 0; | 8574 a1a.field_5C = 0; |
8575 if ( !(a1a.uAttributes & 0x10) ) | 8575 if ( !(a1a.uAttributes & 0x10) ) |
8576 { | 8576 { |
8577 v13 = 0; | 8577 v13 = 0; |
8578 if ( (signed int)pItemsTable->pItems[0].uItemID > 0 ) | 8578 if ( (signed int)pItemsTable->uAllItemsCount > 0 ) |
8579 { | 8579 { |
8580 v14 = (char *)&pItemsTable->pItems[0].uSpriteID; | 8580 v14 = (char *)&pItemsTable->pItems[0].uSpriteID; |
8581 while ( *(short *)v14 != v9 ) | 8581 while ( *(short *)v14 != v9 ) |
8582 { | 8582 { |
8583 ++v13; | 8583 ++v13; |
8584 v14 += 48; | 8584 v14 += 48; |
8585 if ( (signed int)v13 >= (signed int)pItemsTable->pItems[0].uItemID ) | 8585 if ( (signed int)v13 >= (signed int)pItemsTable->uAllItemsCount ) |
8586 goto LABEL_16; | 8586 goto LABEL_16; |
8587 } | 8587 } |
8588 a1a.stru_24.uItemID = v13; | 8588 a1a.stru_24.uItemID = v13; |
8589 } | 8589 } |
8590 } | 8590 } |