Mercurial > mm7
comparison mm7_6.cpp @ 224:9917d3b4925e
items init refactored
author | Gloval |
---|---|
date | Sun, 17 Feb 2013 14:46:05 +0400 |
parents | 1bd823f52e3a |
children | c879446b4a22 |
comparison
equal
deleted
inserted
replaced
223:1bd823f52e3a | 224:9917d3b4925e |
---|---|
5263 if ( uRequiredMana == v1 ) | 5263 if ( uRequiredMana == v1 ) |
5264 { | 5264 { |
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() % 10;//pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType]; |
5269 *(int *)(v245 + 4) = 0; | 5269 *(int *)(v245 + 4) = 0; |
5270 for ( j = pItemsTable->pEnchantments[0].to_item[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)].to_item[pItemsTable->pItems[*(int *)v245].uEquipType | 5273 j += pItemsTable->pEnchantments[*(int *)(v245 + 4)].to_item[pItemsTable->pItems[*(int *)v245].uEquipType |
5276 ++*(int *)(v245 + 4); | 5276 ++*(int *)(v245 + 4); |
5277 if ( j >= v314 ) | 5277 if ( j >= v314 ) |
5278 break; | 5278 break; |
5279 } | 5279 } |
5280 v254 = rand(); | 5280 v254 = rand(); |
5281 v255 = pItemsTable->field_116D8[17]; | 5281 v255 = 10;//pItemsTable->field_116D8[17]; |
5282 v256 = pItemsTable->field_116D8[16]; | 5282 v256 = 10;//pItemsTable->field_116D8[16]; |
5283 LABEL_611: | 5283 LABEL_611: |
5284 *(int *)(v245 + 8) = v256 + v254 % (v255 - v256 + 1); | 5284 *(int *)(v245 + 8) = v256 + v254 % (v255 - v256 + 1); |
5285 LABEL_612: | 5285 LABEL_612: |
5286 _this->uItemID |= 0x20u; | 5286 _this->uItemID |= 0x20u; |
5287 goto LABEL_1055; | 5287 goto LABEL_1055; |
5350 if ( v274 == 0 | v274 == 1 | v274 == 2 | v274 == 3 | v274 == 4 | v274 == 5 | v274 == 6 | v274 == 7 | v274 == 8 | v274 == 9 | v274 == 10 | v274 == 11 ) | 5350 if ( v274 == 0 | v274 == 1 | v274 == 2 | v274 == 3 | v274 == 4 | v274 == 5 | v274 == 6 | v274 == 7 | v274 == 8 | v274 == 9 | v274 == 10 | v274 == 11 ) |
5351 { | 5351 { |
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() % 10;//pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType]; |
5356 *(int *)(v245 + 4) = 0; | 5356 *(int *)(v245 + 4) = 0; |
5357 for ( k = pItemsTable->pEnchantments[0].to_item[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)].to_item[pItemsTable->pItems[*(int *)v245].uEquipType | 5359 k += pItemsTable->pEnchantments[*(int *)(v245 + 4)].to_item[pItemsTable->pItems[*(int *)v245].uEquipType |
5360 + 1] ) | 5360 + 1] ) |
5362 ++*(int *)(v245 + 4); | 5362 ++*(int *)(v245 + 4); |
5363 if ( k >= v275 ) | 5363 if ( k >= v275 ) |
5364 break; | 5364 break; |
5365 } | 5365 } |
5366 v254 = rand(); | 5366 v254 = rand(); |
5367 v255 = pItemsTable->field_116D8[19]; | 5367 v255 = 10;//pItemsTable->field_116D8[19]; |
5368 v256 = pItemsTable->field_116D8[18]; | 5368 v256 = 10;//pItemsTable->field_116D8[18]; |
5369 goto LABEL_611; | 5369 goto LABEL_611; |
5370 } | 5370 } |
5371 v277 = pItemsTable->pSpecialEnchantments_count; | 5371 v277 = pItemsTable->pSpecialEnchantments_count; |
5372 v278 = 0; | 5372 v278 = 0; |
5373 v725 = 0.0; | 5373 v725 = 0.0; |
5448 if ( v251 == 0 | v251 == 1 | v251 == 2 | v251 == 3 | v251 == 4 | v251 == 5 | v251 == 6 | v251 == 7 | v251 == 8 | v251 == 9 | v251 == 10 | v251 == 11 ) | 5448 if ( v251 == 0 | v251 == 1 | v251 == 2 | v251 == 3 | v251 == 4 | v251 == 5 | v251 == 6 | v251 == 7 | v251 == 8 | v251 == 9 | v251 == 10 | v251 == 11 ) |
5449 { | 5449 { |
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() % 10;//pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType]; |
5454 *(int *)(v245 + 4) = 0; | 5454 *(int *)(v245 + 4) = 0; |
5455 for ( m = pItemsTable->pEnchantments[0].to_item[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)].to_item[pItemsTable->pItems[*(int *)v245].uEquipType | 5457 m += pItemsTable->pEnchantments[*(int *)(v245 + 4)].to_item[pItemsTable->pItems[*(int *)v245].uEquipType |
5458 + 1] ) | 5458 + 1] ) |
5460 ++*(int *)(v245 + 4); | 5460 ++*(int *)(v245 + 4); |
5461 if ( m >= v252 ) | 5461 if ( m >= v252 ) |
5462 break; | 5462 break; |
5463 } | 5463 } |
5464 v254 = rand(); | 5464 v254 = rand(); |
5465 v255 = pItemsTable->field_116D8[21]; | 5465 v255 = 10;// pItemsTable->field_116D8[21]; |
5466 v256 = pItemsTable->field_116D8[20]; | 5466 v256 = 10;//pItemsTable->field_116D8[20]; |
5467 goto LABEL_611; | 5467 goto LABEL_611; |
5468 } | 5468 } |
5469 v257 = pItemsTable->pSpecialEnchantments_count; | 5469 v257 = pItemsTable->pSpecialEnchantments_count; |
5470 v258 = 0; | 5470 v258 = 0; |
5471 v725 = 0.0; | 5471 v725 = 0.0; |
5600 } | 5600 } |
5601 else | 5601 else |
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 % 10;// pItemsTable->field_116D8[pItemsTable->pItems[_this->uItemID].uEquipType]; |
5606 _this->_bonus_type = 0; | 5606 _this->_bonus_type = 0; |
5607 for ( kk = pItemsTable->pEnchantments[0].to_item[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].to_item[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; |
5615 } | 5615 } |
5616 v294->_bonus_strength = pItemsTable->field_116D8[18] | 5616 v294->_bonus_strength = 10//pItemsTable->field_116D8[18] |
5617 + rand() % (pItemsTable->field_116D8[19] - pItemsTable->field_116D8[18] + 1); | 5617 + rand() % 10;//(pItemsTable->field_116D8[19] - pItemsTable->field_116D8[18] + 1); |
5618 } | 5618 } |
5619 v294->uAttributes |= 0x20u; | 5619 v294->uAttributes |= 0x20u; |
5620 goto LABEL_1055; | 5620 goto LABEL_1055; |
5621 case 31: | 5621 case 31: |
5622 amount = 10 * v2; | 5622 amount = 10 * v2; |