Mercurial > mm7
changeset 574:f90753ebabe3
Merge
author | Nomad |
---|---|
date | Wed, 06 Mar 2013 06:41:36 +0200 |
parents | 7c0763248a87 (current diff) cdf3afa8db74 (diff) |
children | 88dd54e6e44a 96f48cfdd657 |
files | mm7_2.cpp mm7_5.cpp mm7_6.cpp |
diffstat | 10 files changed, 310 insertions(+), 220 deletions(-) [+] |
line wrap: on
line diff
--- a/Indoor.cpp Wed Mar 06 06:41:05 2013 +0200 +++ b/Indoor.cpp Wed Mar 06 06:41:36 2013 +0200 @@ -4667,8 +4667,8 @@ if (uItemID) { if (uItemID != 220 && pItemsTable->pItems[uItemID].uEquipType == EQUIP_POTION && - !p->stru_24.uEncantmentType) - p->stru_24.uEncantmentType = rand() % 15 + 5; + !p->stru_24.uEnchantmentType) + p->stru_24.uEnchantmentType = rand() % 15 + 5; pItemsTable->SetSpecialBonus(&p->stru_24); } }
--- a/Items.cpp Wed Mar 06 06:41:05 2013 +0200 +++ b/Items.cpp Wed Mar 06 06:41:36 2013 +0200 @@ -255,7 +255,7 @@ this->uNumCharges = 0; this->uSpecEnchantmentType = 0; this->_bonus_strength = 0; - this->uEncantmentType = 0; + this->uEnchantmentType = 0; this->uItemID = 0; this->uBodyAnchor = 0; this->uExpireTime = 0i64; @@ -268,7 +268,7 @@ { if ( uTimePlayed > (signed __int64)this->uExpireTime ) { - this->uEncantmentType = 0; + this->uEnchantmentType = 0; this->uSpecEnchantmentType = 0; this->uAttributes = this->uAttributes&(~ITEM_TEMP_BONUS); } @@ -381,7 +381,7 @@ } else { - if (!decode_step) + if (decode_step) break_loop = true; } ++decode_step; @@ -485,7 +485,7 @@ } else { - if (!decode_step) + if (decode_step) break_loop = true; } ++decode_step; @@ -497,7 +497,7 @@ memset(&pSpecialEnchantmentsSumm, 0, 96); for(i=0;i<12;++i) { - for (j=0;j<pSpecialEnchantments_count;++j) + for (j=0;j<=pSpecialEnchantments_count;++j) pSpecialEnchantmentsSumm[i]+=pSpecialEnchantments[j].to_item_apply[i]; } @@ -838,7 +838,7 @@ } else { - if (!decode_step) + if (decode_step) break_loop = true; } ++decode_step; @@ -905,7 +905,7 @@ } else { - if (!decode_step) + if (decode_step) break_loop = true; } ++decode_step; @@ -1044,7 +1044,7 @@ } else { - if (!decode_step) + if (decode_step) break_loop = true; } ++decode_step; @@ -1096,7 +1096,7 @@ } else { - if (!decode_step) + if (decode_step) break_loop = true; } ++decode_step; @@ -1199,7 +1199,7 @@ } else { - if (!decode_step) + if (decode_step) break_loop = true; } ++decode_step; @@ -1236,7 +1236,7 @@ } else { - if (!decode_step) + if (decode_step) break_loop = true; } ++decode_step; @@ -1251,7 +1251,7 @@ { if ( pItems[pItem->uItemID].uMaterial == MATERIAL_SPECIAL ) { - pItem->uEncantmentType = pItems[pItem->uItemID]._bonus_type; + pItem->uEnchantmentType = pItems[pItem->uItemID]._bonus_type; pItem->uSpecEnchantmentType = pItems[pItem->uItemID]._additional_value; pItem->_bonus_strength = pItems[pItem->uItemID]._bonus_strength; } @@ -1441,7 +1441,7 @@ uBaseValue = pItemsTable->pItems[this->uItemID].uValue; if ( this->uAttributes & ITEM_TEMP_BONUS || pItemsTable->IsMaterialNonCommon(this) ) return uBaseValue; - if (uEncantmentType ) + if (uEnchantmentType ) return uBaseValue + 100 * _bonus_strength;; if (uSpecEnchantmentType ) { @@ -1494,10 +1494,10 @@ } if ( !pItemsTable->IsMaterialNonCommon(this) ) { - if ( uEncantmentType ) + if ( uEnchantmentType ) { strcat(item__getname_buffer, " "); - nameModificator = pItemsTable->pEnchantments[uEncantmentType-1].pOfName; + nameModificator = pItemsTable->pEnchantments[uEnchantmentType-1].pOfName; } else { @@ -1693,10 +1693,10 @@ if (pItems[out_item->uItemID].uEquipType == EQUIP_POTION && out_item->uItemID != ITEM_POTION_BOTTLE ) {// if it potion set potion spec - out_item->uEncantmentType = 0; + out_item->uEnchantmentType = 0; for (int i=0; i<2; ++i) - out_item->uEncantmentType += rand() % 4 + 1; - out_item->uEncantmentType = out_item->uEncantmentType * treasure_level; + out_item->uEnchantmentType += rand() % 4 + 1; + out_item->uEnchantmentType = out_item->uEnchantmentType * treasure_level; } } else @@ -1733,12 +1733,12 @@ out_item->uItemID = 1; if (pItems[out_item->uItemID].uEquipType == EQUIP_POTION && out_item->uItemID != ITEM_POTION_BOTTLE ) {// if it potion set potion spec - out_item->uEncantmentType = 0; + out_item->uEnchantmentType = 0; for (int i=0; i<2; ++i) - out_item->uEncantmentType += rand() % 4 + 1; - out_item->uEncantmentType = out_item->uEncantmentType * treasure_level; + out_item->uEnchantmentType += rand() % 4 + 1; + out_item->uEnchantmentType = out_item->uEnchantmentType * treasure_level; } - out_item->uEncantmentType = out_item->uEncantmentType * treasure_level; + out_item->uEnchantmentType = out_item->uEnchantmentType * treasure_level; } if ( out_item->uItemID == ITEM_SPELLBOOK_LIGHT_DIVINE_INTERVENTION @@ -1752,7 +1752,7 @@ if ( pItems[out_item->uItemID].uEquipType != EQUIP_POTION ) { out_item->uSpecEnchantmentType = 0; - out_item->uEncantmentType = 0; + out_item->uEnchantmentType = 0; } //try get special enhansment switch (pItems[out_item->uItemID].uEquipType) @@ -1773,39 +1773,39 @@ case EQUIP_GAUNTLETS : case EQUIP_BOOTS : case EQUIP_RING : - v22 = uBonusChanceStandart[v6]; + if ( !uBonusChanceStandart[v6] ) return; - v24 = v22; special_chance = rand() % 100; - if ( !uBonusChanceSpecial[v6] && !(special_chance < uBonusChanceStandart[v6])) - return; if ( special_chance < uBonusChanceStandart[v6]) { - v26 = rand() % v5->uBonusChanceWpSpecial[v5->pItems[out_item->uItemID].uEquipType + 3]; - v27 = out_item->uItemID; - out_item->uEncantmentType = 0; - for ( i = pEnchantments[0].to_item[pItems[v27].uEquipType + 1]; - i < v26; - i += pEnchantments[out_item->uEncantmentType].to_item[pItems[v29].uEquipType + 1] ) + v26 = rand() %pEnchantmentsSumm[pItems[out_item->uItemID].uEquipType-3]; + out_item->uEnchantmentType = 0; + v27=pEnchantments[out_item->uEnchantmentType].to_item[pItems[out_item->uItemID].uEquipType-3]; + if (v26>v27 ) + { + do { - v29 = out_item->uItemID; - ++out_item->uEncantmentType; - } - ++out_item->uEncantmentType; - v30 = bonus_ranges[v6].minR; - v32 = out_item->uEncantmentType - 1; - v33 = rand() % (bonus_ranges[v6].maxR - v30 + 1) + v30; - out_item->_bonus_strength = v33; - if ( v32 == 21 || v32 == 22 || v32 == 23 ) - out_item->_bonus_strength = v33 >> 1; + ++out_item->uEnchantmentType; + v27+=pEnchantments[out_item->uEnchantmentType].to_item[pItems[out_item->uItemID].uEquipType-3]; + } while (v26>v27); + } + ++out_item->uEnchantmentType; + + v33 = rand() % (bonus_ranges[v6].maxR - bonus_ranges[v6].minR + 1); + out_item->_bonus_strength = v33 + bonus_ranges[v6].minR; + v32 = out_item->uEnchantmentType - 1; + if ( v32 == 21 || v32 == 22 || v32 == 23 ) //Armsmaster skill, Dodge skill, Unarmed skill + out_item->_bonus_strength = out_item->_bonus_strength/2; if ( out_item->_bonus_strength <= 0 ) out_item->_bonus_strength = 1; return; } + if ( !uBonusChanceSpecial[v6]) + return; v34 = uBonusChanceStandart[v6] + uBonusChanceSpecial[v6]; - if ( special_chance<v34 ) + if ( special_chance>v34 ) return; break; case EQUIP_WAND:
--- a/Items.h Wed Mar 06 06:41:05 2013 +0200 +++ b/Items.h Wed Mar 06 06:41:36 2013 +0200 @@ -140,7 +140,7 @@ int uItemID; - int uEncantmentType; + int uEnchantmentType; int _bonus_strength; int uSpecEnchantmentType; // 25: +5 levels int uNumCharges;
--- a/NPC.cpp Wed Mar 06 06:41:05 2013 +0200 +++ b/NPC.cpp Wed Mar 06 06:41:36 2013 +0200 @@ -484,7 +484,7 @@ } else { - if (!decode_step) + if (decode_step) break_loop = true; } ++decode_step;
--- a/Player.cpp Wed Mar 06 06:41:05 2013 +0200 +++ b/Player.cpp Wed Mar 06 06:41:36 2013 +0200 @@ -3575,7 +3575,7 @@ if ( pItemsTable->pItems[v17].uEquipType == 14 ) { if ( v16 != 220 ) - v27.uEncantmentType = 2 * rand() % 4 + 2; + v27.uEnchantmentType = 2 * rand() % 4 + 2; } } else @@ -7006,10 +7006,10 @@ switch ( pParty->pPickedItem.uItemID ) { case 0xDEu: - v25 = pParty->pPickedItem.uEncantmentType + 10; + v25 = pParty->pPickedItem.uEnchantmentType + 10; goto LABEL_110; case 0xDFu: - v26 = pParty->pPickedItem.uEncantmentType + 10; + v26 = pParty->pPickedItem.uEnchantmentType + 10; goto LABEL_114; case 0xE0u: LODWORD(v3->pConditions[1]) = 0; @@ -7042,7 +7042,7 @@ v59 = 0; v50 = 5; v46 = 3; - v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335); + v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); v29 = (char *)&v3->pPlayerBuffs[7]; goto LABEL_147; case 0xE5u: @@ -7050,7 +7050,7 @@ v59 = 0; v50 = 5; v46 = 3; - v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335); + v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); v29 = (char *)&v3->pPlayerBuffs[8]; goto LABEL_147; case 0xE6u: @@ -7058,23 +7058,23 @@ v59 = 0; v50 = 5; v46 = 3; - v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335); + v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); v29 = (char *)&v3->pPlayerBuffs[1]; goto LABEL_147; case 0xE7u: v70 = 0; v59 = 0; - v50 = 3 * LOWORD(pParty->pPickedItem.uEncantmentType); + v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); v46 = 0; - v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335); + v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); v29 = (char *)&v3->pPlayerBuffs[11]; goto LABEL_147; case 0xE8u: v70 = 0; v59 = 0; - v50 = 3 * LOWORD(pParty->pPickedItem.uEncantmentType); + v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); v46 = 0; - v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335); + v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); v29 = (char *)&v3->pPlayerBuffs[13]; goto LABEL_147; case 0xEAu: @@ -7082,12 +7082,12 @@ v59 = 0; v50 = 5; v46 = 3; - v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335); + v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); v29 = (char *)&v3->pPlayerBuffs[14]; goto LABEL_147; case 0xEBu: v3->pPlayerBuffs[23].Apply( - pParty->uTimePlayed + (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335), + pParty->uTimePlayed + (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335), 3u, 5u, 0, @@ -7108,49 +7108,49 @@ case 0xF0u: v70 = 0; v59 = 0; - v50 = 3 * LOWORD(pParty->pPickedItem.uEncantmentType); + v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); v46 = 0; - v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335); + v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); v29 = (char *)&v3->pPlayerBuffs[19]; goto LABEL_147; case 0xF1u: v70 = 0; v59 = 0; - v50 = 3 * LOWORD(pParty->pPickedItem.uEncantmentType); + v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); v46 = 0; - v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335); + v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); v29 = (char *)&v3->pPlayerBuffs[17]; goto LABEL_147; case 0xF2u: v70 = 0; v59 = 0; - v50 = 3 * LOWORD(pParty->pPickedItem.uEncantmentType); + v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); v46 = 0; - v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335); + v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); v29 = (char *)&v3->pPlayerBuffs[20]; goto LABEL_147; case 0xF3u: v70 = 0; v59 = 0; - v50 = 3 * LOWORD(pParty->pPickedItem.uEncantmentType); + v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); v46 = 0; - v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335); + v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); v29 = (char *)&v3->pPlayerBuffs[16]; goto LABEL_147; case 0xF4u: v70 = 0; v59 = 0; - v50 = 3 * LOWORD(pParty->pPickedItem.uEncantmentType); + v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); v46 = 0; - v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335); + v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); v29 = (char *)&v3->pPlayerBuffs[21]; goto LABEL_147; case 0xF5u: v70 = 0; v59 = 0; - v50 = 3 * LOWORD(pParty->pPickedItem.uEncantmentType); + v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); v46 = 0; - v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335); + v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); v29 = (char *)&v3->pPlayerBuffs[15]; goto LABEL_147; case 0xFBu: @@ -7173,12 +7173,12 @@ HIDWORD(v3->pConditions[16]) = v35; goto LABEL_112; case 0xFDu: - v25 = 5 * pParty->pPickedItem.uEncantmentType; + v25 = 5 * pParty->pPickedItem.uEnchantmentType; LABEL_110: v69 = v25; goto LABEL_111; case 0xFEu: - v26 = 5 * pParty->pPickedItem.uEncantmentType; + v26 = 5 * pParty->pPickedItem.uEnchantmentType; LABEL_114: v27 = (char *)&v3->sMana; *(int *)v27 += v26; @@ -7186,57 +7186,57 @@ case 0xFFu: v70 = 0; v59 = 0; - v50 = 3 * LOWORD(pParty->pPickedItem.uEncantmentType); + v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); v46 = 0; - v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335); + v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); v29 = (char *)&v3->pPlayerBuffs[18]; goto LABEL_147; case 0x100u: v70 = 0; v59 = 0; - v50 = 3 * LOWORD(pParty->pPickedItem.uEncantmentType); + v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); v46 = 0; - v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335); + v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); v29 = (char *)&v3->pPlayerBuffs[5]; goto LABEL_147; case 0x101u: v70 = 0; v59 = 0; - v50 = 3 * LOWORD(pParty->pPickedItem.uEncantmentType); + v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); v46 = 0; - v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335); + v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); v29 = (char *)v3->pPlayerBuffs; goto LABEL_147; case 0x102u: v70 = 0; v59 = 0; - v50 = 3 * LOWORD(pParty->pPickedItem.uEncantmentType); + v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); v46 = 0; - v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335); + v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); v29 = (char *)&v3->pPlayerBuffs[22]; goto LABEL_147; case 0x103u: v70 = 0; v59 = 0; - v50 = 3 * LOWORD(pParty->pPickedItem.uEncantmentType); + v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); v46 = 0; - v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335); + v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); v29 = (char *)&v3->pPlayerBuffs[3]; goto LABEL_147; case 0x104u: v70 = 0; v59 = 0; - v50 = 3 * LOWORD(pParty->pPickedItem.uEncantmentType); + v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); v46 = 0; - v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335); + v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); v29 = (char *)&v3->pPlayerBuffs[9]; goto LABEL_147; case 0x105u: v70 = 0; v59 = 0; - v50 = 3 * LOWORD(pParty->pPickedItem.uEncantmentType); + v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); v46 = 0; - v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEncantmentType) * 0.033333335); + v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); v29 = (char *)&v3->pPlayerBuffs[2]; LABEL_147: ((SpellBuff *)v29)->Apply(pParty->uTimePlayed + v28, v46, v50, v59, v70);
--- a/StorylineTextTable.h Wed Mar 06 06:41:05 2013 +0200 +++ b/StorylineTextTable.h Wed Mar 06 06:41:36 2013 +0200 @@ -17,7 +17,8 @@ struct StorylineText { void Initialize(); - StorylineRecord StoreLine[30]; + StorylineRecord StoreLine[29]; + int field_15C; //int field_0; // int field_4[87]; };
--- a/mm7_1.cpp Wed Mar 06 06:41:05 2013 +0200 +++ b/mm7_1.cpp Wed Mar 06 06:41:36 2013 +0200 @@ -2479,24 +2479,23 @@ if (item_desc->uDamageDice) //"Armor" sprintfex(out_text + 100, "%s: +%d", pGlobalTXT_LocalizationStrings[11], item_desc->uDamageDice + item_desc->uDamageMod); break; - case EQUIP_POTION: - if ( inspect_item->uEncantmentType ) - sprintf(out_text + 200, "%s: %d",pGlobalTXT_LocalizationStrings[449] , inspect_item->uEncantmentType); //"Power" - break; - case EQUIP_REAGENT: - sprintf(out_text + 200, "%s: %d", pGlobalTXT_LocalizationStrings[449], pItemsTable->pItems[inspect_item->uItemID].uDamageDice); //"Power" - break; + } if ( v77 ) goto LABEL_65; - //v23 = item_desc->uEquipType; - - - if ( inspect_item->uEncantmentType ) + if (item_desc->uEquipType==EQUIP_POTION) + { + if ( inspect_item->uEnchantmentType ) + sprintf(out_text + 200, "%s: %d",pGlobalTXT_LocalizationStrings[449] , inspect_item->uEnchantmentType); //"Power" + } + else if (item_desc->uEquipType== EQUIP_REAGENT) + {sprintf(out_text + 200, "%s: %d", pGlobalTXT_LocalizationStrings[449], pItemsTable->pItems[inspect_item->uItemID].uDamageDice); //"Power" + } + else if ( inspect_item->uEnchantmentType ) { sprintf(out_text + 200, "%s: %s +%d", pGlobalTXT_LocalizationStrings[210], - pItemsTable->pEnchantments[inspect_item->uEncantmentType-1].pBonusStat, inspect_item->_bonus_strength); //"Special" + pItemsTable->pEnchantments[inspect_item->uEnchantmentType-1].pBonusStat, inspect_item->_bonus_strength); //"Special" } else if ( inspect_item->uSpecEnchantmentType ) { @@ -2537,7 +2536,7 @@ wHintWindow.uFrameHeight = v73->uTextureHeight + v81 + 54; if ( (signed int)Str > (signed int)wHintWindow.uFrameHeight ) wHintWindow.uFrameHeight = (unsigned int)Str; - if ( inspect_item->uAttributes & 8 && (inspect_item->uSpecEnchantmentType || inspect_item->uEncantmentType) ) + if ( inspect_item->uAttributes & 8 && (inspect_item->uSpecEnchantmentType || inspect_item->uEnchantmentType) ) wHintWindow.uFrameHeight += LOBYTE(pFontComic->uFontHeight); v85 = 0; if ( pFontArrus->uFontHeight ) @@ -2605,7 +2604,7 @@ } else { - if ( (inspect_item->uAttributes & 8) && (inspect_item->uSpecEnchantmentType || inspect_item->uEncantmentType) ) + if ( (inspect_item->uAttributes & 8) && (inspect_item->uSpecEnchantmentType || inspect_item->uEnchantmentType) ) { sub_493F79(&v67, inspect_item->uExpireTime - pParty->uTimePlayed); strcpy(pTmpBuf, "Duration:");
--- a/mm7_2.cpp Wed Mar 06 06:41:05 2013 +0200 +++ b/mm7_2.cpp Wed Mar 06 06:41:36 2013 +0200 @@ -13400,7 +13400,7 @@ assert(sizeof(stru176) == 0x20); assert(sizeof(SavegameHeader) == 0x64); assert(sizeof(SavegameList) == 0x3138); - assert(sizeof(StorylineText) == 0x168); + assert(sizeof(StorylineText) == 0x160); assert(sizeof(FactionTable) == 0x1EF1); assert(sizeof(Decal) == 0xC20); assert(sizeof(DecalBuilder) == 0x30C038); @@ -14656,16 +14656,13 @@ { if ( v2 ) { -LABEL_7: LOBYTE(v5) = v0->GetActualSkillLevel(PLAYER_SKILL_SPEAR); if ( (signed int)SkillToMastery(v5) < 3 ) { -LABEL_8: v0->PlaySound(SPEECH_39, 0); return; } v3 = pParty->pPickedItem.uItemID; - goto LABEL_16; } } else @@ -14673,11 +14670,21 @@ if ( (v4 == 8 || v4 == 1 || v4 == 2) && v1 && pItemsTable->pItems[*(int *)&v0->pInventoryItems[v1-1]].uSkillType == 4 ) - goto LABEL_7; - } -LABEL_16: + { + LOBYTE(v5) = v0->GetActualSkillLevel(PLAYER_SKILL_SPEAR); + if ( (signed int)SkillToMastery(v5) < 3 ) + { + v0->PlaySound(SPEECH_39, 0); + return; + } + } + } if ( !v0->CanEquip_RaceAndAlignmentCheck(v3) ) - goto LABEL_8; + { + + v0->PlaySound(SPEECH_39, 0); + return; + } if ( pParty->pPickedItem.uItemID == 604 ) { sub_467E7F_EquipBody(3u); @@ -14696,16 +14703,39 @@ case 9u: case 0xBu: if ( !v0->HasSkill(v4) ) - goto LABEL_8; + { + v0->PlaySound(SPEECH_39, 0); + return; + } if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) && (v6 != 3 || bUnderwater) ) - goto LABEL_95; + { + v46 = 0; + v45 = 0; + v44 = 0; + v43 = 0; + v42 = -1; + v41 = 0; + v40 = 0; + pAudioPlayer->PlaySound(SOUND_27, v40, v41, v42, v43, v44, v45, v46); + return; + } sub_467E7F_EquipBody(v6); if ( pParty->pPickedItem.uItemID == 604 ) WetsuitOff(uActiveCharacter); return; case 0xAu: if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) ) - goto LABEL_95; + { + v46 = 0; + v45 = 0; + v44 = 0; + v43 = 0; + v42 = -1; + v41 = 0; + v40 = 0; + pAudioPlayer->PlaySound(SOUND_27, v40, v41, v42, v43, v44, v45, v46); + return; + } v52 = 10; v7 = (int)&v0->pEquipment.field_28; while ( 1 ) @@ -14714,19 +14744,20 @@ { v8 = v0->FindFreeInventorySlot(); if ( (v8 & 0x80000000u) == 0 ) + { + v9 = v52; + pParty->pPickedItem.uBodyAnchor = v52 + 1; + memcpy(&v0->pInventoryItems[v8], &pParty->pPickedItem, sizeof(v0->pInventoryItems[v8])); + *(&v0->pEquipment.uOffHand + v9) = v8 + 1; + pMouse->RemoveHoldingItem(); break; + } } ++v52; v7 += 4; if ( (signed int)v52 > 15 ) - goto LABEL_33; - } - v9 = v52; - pParty->pPickedItem.uBodyAnchor = v52 + 1; - memcpy(&v0->pInventoryItems[v8], &pParty->pPickedItem, sizeof(v0->pInventoryItems[v8])); - *(&v0->pEquipment.uOffHand + v9) = v8 + 1; - pMouse->RemoveHoldingItem(); -LABEL_33: + break; + } if ( v52 == 16 ) { v52 = v0->pEquipment.field_3C - 1; @@ -14743,9 +14774,22 @@ return; case 4u: if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) ) - goto LABEL_95; + { + v46 = 0; + v45 = 0; + v44 = 0; + v43 = 0; + v42 = -1; + v41 = 0; + v40 = 0; + pAudioPlayer->PlaySound(SOUND_27, v40, v41, v42, v43, v44, v45, v46); + return; + } if ( !v0->HasSkill(v4) ) - goto LABEL_8; + { + v0->PlaySound(SPEECH_39, 0); + return; + } if ( v54 ) { --v54; @@ -14773,7 +14817,8 @@ v17 = v52 + 1; memcpy(&v0->pInventoryItems[v52], &pParty->pPickedItem, sizeof(v0->pInventoryItems[v52])); v0->pEquipment.uOffHand = v17; - goto LABEL_45; + pMouse->RemoveHoldingItem(); + return; } memcpy(&_this, &pParty->pPickedItem, sizeof(_this)); v15 = (int)((char *)v0 + 36 * (v53 - 1)); @@ -14792,9 +14837,22 @@ if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) && pParty->pPickedItem.uItemID != 64 && pParty->pPickedItem.uItemID != 65 ) - goto LABEL_95; + { + v46 = 0; + v45 = 0; + v44 = 0; + v43 = 0; + v42 = -1; + v41 = 0; + v40 = 0; + pAudioPlayer->PlaySound(SOUND_27, v40, v41, v42, v43, v44, v45, v46); + return; + } if ( !v0->HasSkill(v4) ) - goto LABEL_8; + { + v0->PlaySound(SPEECH_39, 0); + return; + } v50 = 0; if ( v4 == 2 && (unsigned __int16)(v0->pActiveSkills[2] & 0xFFC0) || v4 == 1 && (signed int)SkillToMastery(v0->pActiveSkills[1]) >= 3 ) @@ -14830,9 +14888,12 @@ if ( !v14 ) return; v22 = _this.uItemID; -LABEL_73: v50 = v22; - goto LABEL_74; + if ( v50 ) + stru_A750F8[uActiveCharacter - 1]._494836( + *((int *)&pSpellDatas[66].uNormalLevelRecovery + v50), + uActiveCharacter - 1 + 9); + break; } v23 = v0->FindFreeInventorySlot(); if ( (v23 & 0x80000000u) != 0 ) @@ -14841,12 +14902,16 @@ v50 = (unsigned int)&v0->pInventoryItems[v23]; memcpy(&v0->pInventoryItems[v23], &pParty->pPickedItem, sizeof(v0->pInventoryItems[v23])); v0->pEquipment.uOffHand = v23 + 1; -LABEL_71: pMouse->RemoveHoldingItem(); if ( v52 != 12 ) return; v22 = *(int *)v50; - goto LABEL_73; + v50 = v22; + if ( v50 ) + stru_A750F8[uActiveCharacter - 1]._494836( + *((int *)&pSpellDatas[66].uNormalLevelRecovery + v50), + uActiveCharacter - 1 + 9); + break; } } } @@ -14859,7 +14924,16 @@ v50 = (unsigned int)&v0->pInventoryItems[v26]; memcpy(&v0->pInventoryItems[v26], &pParty->pPickedItem, sizeof(v0->pInventoryItems[v26])); v0->pEquipment.uMainHand = v26 + 1; - goto LABEL_71; + pMouse->RemoveHoldingItem(); + if ( v52 != 12 ) + return; + v22 = *(int *)v50; + v50 = v22; + if ( v50 ) + stru_A750F8[uActiveCharacter - 1]._494836( + *((int *)&pSpellDatas[66].uNormalLevelRecovery + v50), + uActiveCharacter - 1 + 9); + break; } --v53; memcpy(&_this, &pParty->pPickedItem, sizeof(_this)); @@ -14876,7 +14950,6 @@ v50 = _this.uItemID; if ( v51 ) v0->pEquipment.uOffHand = 0; -LABEL_74: if ( v50 ) stru_A750F8[uActiveCharacter - 1]._494836( *((int *)&pSpellDatas[66].uNormalLevelRecovery + v50), @@ -14884,9 +14957,22 @@ break; case 1u: if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) ) - goto LABEL_95; + { + v46 = 0; + v45 = 0; + v44 = 0; + v43 = 0; + v42 = -1; + v41 = 0; + v40 = 0; + pAudioPlayer->PlaySound(SOUND_27, v40, v41, v42, v43, v44, v45, v46); + return; + } if ( !v0->HasSkill(v4) ) - goto LABEL_8; + { + v0->PlaySound(SPEECH_39, 0); + return; + } if ( v53 ) { if ( v54 ) @@ -14898,7 +14984,8 @@ v42 = -1; v41 = 0; v40 = 0; - goto LABEL_96; + pAudioPlayer->PlaySound(SOUND_27, v40, v41, v42, v43, v44, v45, v46); + return; } --v53; memcpy(&_this, &pParty->pPickedItem, sizeof(_this)); @@ -14935,7 +15022,6 @@ v31 = v52 + 1; memcpy(&v0->pInventoryItems[v52], &pParty->pPickedItem, sizeof(v0->pInventoryItems[v52])); v0->pEquipment.uMainHand = v31; -LABEL_45: pMouse->RemoveHoldingItem(); } } @@ -14972,7 +15058,6 @@ { if ( bUnderwater ) { -LABEL_95: v46 = 0; v45 = 0; v44 = 0; @@ -14980,7 +15065,6 @@ v42 = -1; v41 = 0; v40 = 0; -LABEL_96: pAudioPlayer->PlaySound(SOUND_27, v40, v41, v42, v43, v44, v45, v46); return; } @@ -15105,71 +15189,75 @@ } v22 = 0; v1 = (int *)((signed int)(viewparams->uScreenZ + viewparams->uScreenX) >> 1); - if ( (signed int)viewparams->uScreenY >= (signed int)viewparams->uScreenW ) - goto LABEL_21; - v2 = (char *)v1 - 50; - v1 = (int *)((char *)v1 + 50); - v3 = 640 * viewparams->uScreenY; - v17 = v2; - v20 = v1; - v18 = ((viewparams->uScreenW - viewparams->uScreenY - 1) >> 1) + 1; - do - { - if ( (signed int)v2 >= (signed int)v20 ) - goto LABEL_20; - v1 = &pRenderer->pActiveZBuffer[(int)&v2[v3]]; - v21 = &pRenderer->pActiveZBuffer[(int)&v2[v3]]; - v4 = v22; - v5 = (((char *)v20 - v2 - 1) >> 1) + 1; - do - { - v6 = 0; - v7 = *v1 & 0xFFFF; - v19 = 0; - if ( v4 > 0 ) - { - do - { - if ( dword_7207F0[v6] == v7 ) - break; - ++v6; - v19 = v6; - } - while ( v6 < v22 ); - } - if ( (v7 & 7) == OBJECT_Decoration) - { - v16 = (unsigned int)v7 >> 3; - if ( (signed int)(((unsigned int)*v21 >> 16) - - pDecorationList->pDecorations[pLevelDecorations[(unsigned int)v7 >> 3].uDecorationDescID].uRadius) > 512 ) - goto LABEL_18; - } - else - { - if ( (unsigned int)*v21 > 0x2000000 ) - goto LABEL_18; - } - if ( v19 == v22 && v4 < 100 ) - { - ++v22; - ++v4; - v8 = *v21; - dword_7207EC[v4] = v7; - dword_72065C[v4] = v8; - } -LABEL_18: - v1 = v21 + 2; - --v5; - v21 += 2; - } - while ( v5 ); - v2 = v17; -LABEL_20: - v3 += 1280; - --v18; - } - while ( v18 ); -LABEL_21: + if ( (signed int)viewparams->uScreenY < (signed int)viewparams->uScreenW ) + { + v2 = (char *)v1 - 50; + v1 = (int *)((char *)v1 + 50); + v3 = 640 * viewparams->uScreenY; + v17 = v2; + v20 = v1; + v18 = ((viewparams->uScreenW - viewparams->uScreenY - 1) >> 1) + 1; + do + { + if ( (signed int)v2 < (signed int)v20 ) + { + v1 = &pRenderer->pActiveZBuffer[(int)&v2[v3]]; + v21 = &pRenderer->pActiveZBuffer[(int)&v2[v3]]; + v4 = v22; + v5 = (((char *)v20 - v2 - 1) >> 1) + 1; + do + { + v6 = 0; + v7 = *v1 & 0xFFFF; + v19 = 0; + if ( v4 > 0 ) + { + do + { + if ( dword_7207F0[v6] == v7 ) + break; + ++v6; + v19 = v6; + } + while ( v6 < v22 ); + } + if ( (v7 & 7) == OBJECT_Decoration) + { + v16 = (unsigned int)v7 >> 3; + if ( (signed int)(((unsigned int)*v21 >> 16) + - pDecorationList->pDecorations[pLevelDecorations[(unsigned int)v7 >> 3].uDecorationDescID].uRadius) <= 512 ) + if ( v19 == v22 && v4 < 100 ) + { + ++v22; + ++v4; + v8 = *v21; + dword_7207EC[v4] = v7; + dword_72065C[v4] = v8; + } + } + else if ( (unsigned int)*v21 <= 0x2000000 ) + { + if ( v19 == v22 && v4 < 100 ) + { + ++v22; + ++v4; + v8 = *v21; + dword_7207EC[v4] = v7; + dword_72065C[v4] = v8; + } + } + v1 = v21 + 2; + --v5; + v21 += 2; + } + while ( v5 ); + v2 = v17; + } + v3 += 1280; + --v18; + } + while ( v18 ); + } if ( v22 > 0 ) { v9 = dword_720660; @@ -15344,7 +15432,6 @@ || (v7 = &pOutdoor->pBModels[a1 >> 9].pFaces[(a1 >> 3) & 0x3F], BYTE2(v7->uAttributes) & 0x10) || (v6 = v7->sCogTriggeredID) == 0 ) return 1; -LABEL_13: EventProcessor((signed __int16)v6, v2, 1); return 0; } @@ -15358,7 +15445,10 @@ if ( v5 & 0x100000 || (v6 = pIndoor->pFaceExtras[v4->uFaceExtraID].uEventID) == 0 ) return 1; if ( pCurrentScreen != SCREEN_BRANCHLESS_NPC_DIALOG ) - goto LABEL_13; + { + EventProcessor((signed __int16)v6, v2, 1); + return 0; + } break; } return 0;
--- a/mm7_5.cpp Wed Mar 06 06:41:05 2013 +0200 +++ b/mm7_5.cpp Wed Mar 06 06:41:36 2013 +0200 @@ -15430,7 +15430,7 @@ v27 = &v0->pInventoryItems[pOut.z]; v28 = v27->uItemID; v51 = pItemsTable->pItems[v27->uItemID].uEquipType; - v29 = (ItemGen *)(1800 * pParty->pPickedItem.uEncantmentType); + v29 = (ItemGen *)(1800 * pParty->pPickedItem.uEnchantmentType); if ( pParty->pPickedItem.uItemID != 233 ) { if ( pParty->pPickedItem.uItemID == 236 ) @@ -15452,7 +15452,7 @@ if ( (signed int)v27->uItemID >= 64 && (signed int)v33 <= 65 || (pOut.y = v27->uAttributes, pOut.y & 2) || v27->uSpecEnchantmentType - || v27->uEncantmentType + || v27->uEnchantmentType || v51 && v51 != 1 && v51 != 2 || (signed int)v33 >= 500 ) goto LABEL_92; @@ -15468,7 +15468,7 @@ && (signed int)v30 <= 65 || (pOut.y = v27->uAttributes, pOut.y & 2) || v27->uSpecEnchantmentType - || v27->uEncantmentType + || v27->uEnchantmentType || v51 && v51 != 1 && v51 != 2 || (signed int)v30 >= 500 ) goto LABEL_92; @@ -15486,7 +15486,7 @@ dword_50C9A8 = 256; goto LABEL_92; } - v36 = (70.0 - (double)pParty->pPickedItem.uEncantmentType) * 0.01; + v36 = (70.0 - (double)pParty->pPickedItem.uEnchantmentType) * 0.01; if ( v36 < 0.0 ) v36 = 0.0; if ( v51 != 12 ) @@ -15635,8 +15635,8 @@ *(int *)&v0->field_1F5[36 * v19 + 15] = 1; v20 = v47 + 50 * v15; v0->pInventoryItems[pOut.z].uItemID = v51; - v0->pInventoryItems[pOut.z].uEncantmentType = (pParty->pPickedItem.uEncantmentType - + v0->pInventoryItems[pOut.z].uEncantmentType) + v0->pInventoryItems[pOut.z].uEnchantmentType = (pParty->pPickedItem.uEnchantmentType + + v0->pInventoryItems[pOut.z].uEnchantmentType) / 2; v0->SetVariable(VAR_AutoNotes, *(short *)&pItemsTable->potion_note[2 * v20 ]);//field_10168 + 388 LABEL_74: @@ -15653,7 +15653,7 @@ if ( *(int *)(a2.y + 532) == 221 ) *(int *)(a2.y + 532) = pParty->pPickedItem.uItemID; else - *(int *)(a2.y + 536) = pParty->pPickedItem.uEncantmentType; + *(int *)(a2.y + 536) = pParty->pPickedItem.uEnchantmentType; v21 = v0->AddItem(0xFFFFFFFFu, 0xDCu); if ( v21 ) *(int *)&v0->field_1F5[36 * v21 + 15] = 1;
--- a/mm7_6.cpp Wed Mar 06 06:41:05 2013 +0200 +++ b/mm7_6.cpp Wed Mar 06 06:41:36 2013 +0200 @@ -1431,7 +1431,7 @@ v4 = Dst.uItemID; } if ( pItemsTable->pItems[v5].uEquipType == 14 && v4 != 220 ) - Dst.uEncantmentType = 2 * rand() % 4 + 2; + Dst.uEnchantmentType = 2 * rand() % 4 + 2; pItemsTable->SetSpecialBonus(&Dst); if ( !pParty->AddItem(&Dst) ) pParty->SetHoldingItem(&Dst); @@ -3980,7 +3980,7 @@ { if (!v730c->uSpecEnchantmentType) { - if (!v730c->uEncantmentType) + if (!v730c->uEnchantmentType) { v68 = BYTE4(v726->pConditions[3]); if ( !v68 || v68 == 1 || v68 == 2 ) @@ -5307,7 +5307,7 @@ if ( v731 != 4 || (v245 = (int)&v726->pInventoryItems[a2], v246 = *(int *)v245, *(int *)v245 > 134) || v726->pInventoryItems[a2].uSpecEnchantmentType != 0 - || v726->pInventoryItems[a2].uEncantmentType != 0 + || v726->pInventoryItems[a2].uEnchantmentType != 0 || v726->pInventoryItems[a2]._bonus_strength != 0 || (_this = (ItemGen *)((char *)&v726->pInventoryItems[a2] + 20), v726->pInventoryItems[a2].Broken()) ) goto LABEL_616; @@ -5412,7 +5412,7 @@ LODWORD(v725) = (int)(char *)&pItemsTable + 48 * v290 + 4; if ( v290 > 134 || _this->uSpecEnchantmentType != 0 - || _this->uEncantmentType != 0 + || _this->uEnchantmentType != 0 || _this->_bonus_strength != 0 || (v291 = pItemsTable->pItems[v290].uEquipType) == 0 || v291 == 1 @@ -5487,13 +5487,13 @@ v293 = rand(); v294 = _this; v295 = v293 % 10;// pItemsTable->field_116D8[pItemsTable->pItems[_this->uItemID].uEquipType]; - _this->uEncantmentType = 0; + _this->uEnchantmentType = 0; for ( kk = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[v294->uItemID].uEquipType + 1]; ; - kk += pItemsTable->pEnchantments[v294->uEncantmentType].to_item[pItemsTable->pItems[v294->uItemID].uEquipType + kk += pItemsTable->pEnchantments[v294->uEnchantmentType].to_item[pItemsTable->pItems[v294->uItemID].uEquipType + 1] ) { - ++v294->uEncantmentType; + ++v294->uEnchantmentType; if ( kk >= v295 ) break; }