Mercurial > mm7
changeset 580:bcae3e06cadb
Слияние
author | Ritor1 |
---|---|
date | Wed, 06 Mar 2013 09:28:27 +0600 |
parents | a295c9f956d1 (current diff) cdf3afa8db74 (diff) |
children | 2d4204de7a8c |
files | mm7_3.cpp |
diffstat | 19 files changed, 614 insertions(+), 521 deletions(-) [+] |
line wrap: on
line diff
--- a/Events.cpp Wed Mar 06 09:28:09 2013 +0600 +++ b/Events.cpp Wed Mar 06 09:28:27 2013 +0600 @@ -601,7 +601,7 @@ { sub_4BD8B5(); window_SpeakInHouse->Release(); - pParty->uFlags &= 0xFFFFFFFDu; + pParty->uFlags &= ~2; if ( EnterHouse(HOUSE_DARK_GUILD_PIT) ) { pAudioPlayer->StopChannels(-1, -1); @@ -702,7 +702,7 @@ sub_4BD8B5(); pVideoPlayer->Unload(); window_SpeakInHouse->Release(); - pParty->uFlags &= 0xFFFFFFFDu; + pParty->uFlags &= ~2; activeLevelDecoration = (LevelDecoration*)1; if ( EnterHouse(HOUSE_BODY_GUILD_ERATHIA) ) {
--- a/Game.cpp Wed Mar 06 09:28:09 2013 +0600 +++ b/Game.cpp Wed Mar 06 09:28:27 2013 +0600 @@ -113,8 +113,7 @@ if (pRenderer->pRenderD3D) { pDecalBuilder->DrawBloodsplats(); - if (pRenderer->pRenderD3D) - pGame->pLightmapBuilder->DrawLightmaps(2); + pGame->pLightmapBuilder->DrawLightmaps(2); } } } @@ -164,7 +163,7 @@ if ( !pVideoPlayer->AnyMovieLoaded() ) { pStru6Instance->DrawPlayerBuffAnims(); - pOtherOverlayList->_441964(v4); + pOtherOverlayList->DrawTurnBasedIcon(v4); GameUI_DrawTorchlightAndWizardEye(); } GUI_UpdateWindows(); @@ -178,7 +177,7 @@ pMouse->_469E1C(); pRenderer->EndScene(); pRenderer->Present(); - pParty->uFlags &= 0xFFFFFFFDu; + pParty->uFlags &= ~2; } @@ -399,7 +398,7 @@ while ( (signed int)pPlayer < (signed int)pParty->pHirelings ); pParty->field_764 = 0; pParty->uTimePlayed += 0x276000ui64; - LOWORD(pParty->uFlags) &= 0xFDFBu; + LOWORD(pParty->uFlags) &= ~0x204; pParty->SetGold(0); pOtherOverlay = pOtherOverlayList->pOverlays; v8 = 50;
--- a/Indoor.cpp Wed Mar 06 09:28:09 2013 +0600 +++ b/Indoor.cpp Wed Mar 06 09:28:27 2013 +0600 @@ -390,7 +390,7 @@ _this.uTargetHeight = 480; _this.pTargetZ = pRenderer->pActiveZBuffer; sub_440BED(&_this); - pParty->uFlags &= 0xFFFFFFFDu; + pParty->uFlags &= ~2; pGame->DrawParticles(); array_5118E8._440F07(); } @@ -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 09:28:09 2013 +0600 +++ b/Items.cpp Wed Mar 06 09:28:27 2013 +0600 @@ -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 09:28:09 2013 +0600 +++ b/Items.h Wed Mar 06 09:28:27 2013 +0600 @@ -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 09:28:09 2013 +0600 +++ b/NPC.cpp Wed Mar 06 09:28:27 2013 +0600 @@ -484,7 +484,7 @@ } else { - if (!decode_step) + if (decode_step) break_loop = true; } ++decode_step;
--- a/Overlays.cpp Wed Mar 06 09:28:09 2013 +0600 +++ b/Overlays.cpp Wed Mar 06 09:28:27 2013 +0600 @@ -10,6 +10,7 @@ #include "TurnEngine.h" #include "LOD.h" #include "Render.h" +#include "GUIWindow.h" #include "mm7_data.h" @@ -87,7 +88,7 @@ } //----- (00441964) -------------------------------------------------------- -unsigned int OtherOverlayList::_441964(int a2) +void OtherOverlayList::DrawTurnBasedIcon(int a2) { unsigned int result; // eax@1 IconFrameTable *v3; // ecx@6 @@ -96,10 +97,9 @@ int v6; // [sp-4h] [bp-8h]@4 Texture *v7; // [sp-4h] [bp-8h]@14 - result = pCurrentScreen; - if ( pCurrentScreen - || pParty->bTurnBasedModeOn != 1 ) - return result; + if ( pCurrentScreen != SCREEN_GAME || !pParty->bTurnBasedModeOn) + return; + if ( pTurnEngine->field_4 == 3 ) { v6 = pEventTimer->uStartTime; @@ -142,7 +142,6 @@ if ( (signed int)result >= dword_50C998_turnbased_icon_1A ) dword_50C998_turnbased_icon_1A = 0; } - return result; } // 4E28F8: using guessed type int pCurrentScreen; // 50C994: using guessed type int dword_50C994;
--- a/Overlays.h Wed Mar 06 09:28:09 2013 +0600 +++ b/Overlays.h Wed Mar 06 09:28:27 2013 +0600 @@ -30,7 +30,7 @@ int _4418B1(int a2, int a3, int a4, int a5); int _4418B6(int uOverlayID, __int16 a3, int a4, int a5, __int16 a6); - unsigned int _441964(int a2); + void DrawTurnBasedIcon(int a2); OtherOverlay pOverlays[50]; int field_3E8;
--- a/Party.h Wed Mar 06 09:28:09 2013 +0600 +++ b/Party.h Wed Mar 06 09:28:27 2013 +0600 @@ -16,8 +16,10 @@ /* 355 */ enum PARTY_FLAGS_1: __int32 { + PARTY_FLAGS_1_FALLING = 0x0008, PARTY_FLAGS_1_ALERT_RED = 0x0010, PARTY_FLAGS_1_ALERT_YELLOW = 0x0020, + PARTY_FLAGS_1_STANDING_ON_WATER = 0x0080, PARTY_FLAGS_1_LANDING = 0x0100, }; enum PARTY_FLAGS_2: __int32
--- a/Player.cpp Wed Mar 06 09:28:09 2013 +0600 +++ b/Player.cpp Wed Mar 06 09:28:27 2013 +0600 @@ -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 @@ -6497,13 +6497,51 @@ spellbook.pFireSpellbook.bIsSpellAvailable[1] = true; spellbook.pFireSpellbook.bIsSpellAvailable[2] = true; spellbook.pFireSpellbook.bIsSpellAvailable[3] = true; + spellbook.pFireSpellbook.bIsSpellAvailable[4] = true; + spellbook.pFireSpellbook.bIsSpellAvailable[5] = true; + spellbook.pFireSpellbook.bIsSpellAvailable[6] = true; + spellbook.pFireSpellbook.bIsSpellAvailable[7] = true; + spellbook.pAirSpellbook.bIsSpellAvailable[1] = true; + spellbook.pAirSpellbook.bIsSpellAvailable[2] = true; + spellbook.pAirSpellbook.bIsSpellAvailable[3] = true; + spellbook.pAirSpellbook.bIsSpellAvailable[4] = true; + spellbook.pAirSpellbook.bIsSpellAvailable[5] = true; + spellbook.pAirSpellbook.bIsSpellAvailable[6] = true; + spellbook.pAirSpellbook.bIsSpellAvailable[7] = true; + spellbook.pAirSpellbook.bIsSpellAvailable[8] = true; + spellbook.pAirSpellbook.bIsSpellAvailable[9] = true; + spellbook.pAirSpellbook.bIsSpellAvailable[10] = true; + pActiveSkills[PLAYER_SKILL_WATER] = 1; + spellbook.pWaterSpellbook.bIsSpellAvailable[0] = true; + spellbook.pWaterSpellbook.bIsSpellAvailable[1] = true; + spellbook.pWaterSpellbook.bIsSpellAvailable[2] = true; + spellbook.pWaterSpellbook.bIsSpellAvailable[3] = true; + spellbook.pWaterSpellbook.bIsSpellAvailable[4] = true; + spellbook.pWaterSpellbook.bIsSpellAvailable[5] = true; break; case PLAYER_SKILL_AIR: spellbook.pAirSpellbook.bIsSpellAvailable[0] = true; break; case PLAYER_SKILL_WATER: spellbook.pWaterSpellbook.bIsSpellAvailable[0] = true; break; case PLAYER_SKILL_EARTH: spellbook.pEarthSpellbook.bIsSpellAvailable[0] = true; break; case PLAYER_SKILL_SPIRIT: spellbook.pSpiritSpellbook.bIsSpellAvailable[0] = true; break; case PLAYER_SKILL_MIND: spellbook.pMindSpellbook.bIsSpellAvailable[0] = true; break; - case PLAYER_SKILL_BODY: spellbook.pBodySpellbook.bIsSpellAvailable[0] = true; break; + case PLAYER_SKILL_BODY: spellbook.pBodySpellbook.bIsSpellAvailable[0] = true; + spellbook.pBodySpellbook.bIsSpellAvailable[1] = true; + spellbook.pBodySpellbook.bIsSpellAvailable[2] = true; + spellbook.pBodySpellbook.bIsSpellAvailable[3] = true; + spellbook.pBodySpellbook.bIsSpellAvailable[4] = true; + spellbook.pBodySpellbook.bIsSpellAvailable[5] = true; + spellbook.pBodySpellbook.bIsSpellAvailable[6] = true; + spellbook.pBodySpellbook.bIsSpellAvailable[7] = true; + spellbook.pBodySpellbook.bIsSpellAvailable[8] = true; + spellbook.pBodySpellbook.bIsSpellAvailable[9] = true; + pActiveSkills[PLAYER_SKILL_SPIRIT] = 1; + spellbook.pSpiritSpellbook.bIsSpellAvailable[1] = true; + spellbook.pSpiritSpellbook.bIsSpellAvailable[2] = true; + spellbook.pSpiritSpellbook.bIsSpellAvailable[3] = true; + spellbook.pSpiritSpellbook.bIsSpellAvailable[4] = true; + spellbook.pSpiritSpellbook.bIsSpellAvailable[5] = true; + spellbook.pSpiritSpellbook.bIsSpellAvailable[6] = true; + break; case PLAYER_SKILL_LIGHT: spellbook.pLightSpellbook.bIsSpellAvailable[0] = true; break; case PLAYER_SKILL_DARK: spellbook.pDarkSpellbook.bIsSpellAvailable[0] = true; break; } @@ -6968,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; @@ -7004,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: @@ -7012,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: @@ -7020,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: @@ -7044,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, @@ -7070,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: @@ -7135,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; @@ -7148,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 09:28:09 2013 +0600 +++ b/StorylineTextTable.h Wed Mar 06 09:28:27 2013 +0600 @@ -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 09:28:09 2013 +0600 +++ b/mm7_1.cpp Wed Mar 06 09:28:27 2013 +0600 @@ -1246,29 +1246,25 @@ CharacterUI_DrawPaperdoll(v1); } } -// 507CC0: using guessed type int dword_507CC0; -// 5118E0: using guessed type int bRingsShownInCharScreen; //----- (0041AD6E) -------------------------------------------------------- void __cdecl GameUI_DrawRightPanelItems() { - if ( (signed int)((pParty->uTimePlayed - qword_507CC8) >> 32) <= 0 && (((pParty->uTimePlayed - qword_507CC8) >> 32) & 0x80000000u) != 0i64 ) - qword_507CC8 = 0i64; - if ( (((pParty->uTimePlayed - qword_507CC8) >> 32) & 0x80000000u) == 0i64 - && (!(SHIDWORD(pParty->uTimePlayed) < (LODWORD(pParty->uTimePlayed) < (unsigned int)qword_507CC8) - + HIDWORD(qword_507CC8) | (pParty->uTimePlayed - qword_507CC8) >> 32 == 0) - || (unsigned int)(LODWORD(pParty->uTimePlayed) - qword_507CC8) > 0x80) ) + if (GameUI_RightPanel_BookFlashTimer > pParty->uTimePlayed) + GameUI_RightPanel_BookFlashTimer = 0; + + if (pParty->uTimePlayed - GameUI_RightPanel_BookFlashTimer > 128) { - qword_507CC8 = pParty->uTimePlayed; + GameUI_RightPanel_BookFlashTimer = pParty->uTimePlayed; byte_50697C = byte_50697C == 0; if ( byte_50697C && pCurrentScreen != SCREEN_REST ) { if ( bFlashQuestBook ) - pRenderer->DrawTextureTransparent(493, 355, (Texture *)(uTextureID_ib_td1_A != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_ib_td1_A] : 0)); + pRenderer->DrawTextureTransparent(493, 355, pIcons_LOD->GetTexture(uTextureID_ib_td1_A)); if ( bFlashAutonotesBook ) - pRenderer->DrawTextureTransparent(527, 353, (Texture *)(uTextureID_ib_td2_A != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_ib_td2_A] : 0)); + pRenderer->DrawTextureTransparent(527, 353, pIcons_LOD->GetTexture(uTextureID_ib_td2_A)); if ( bFlashHistoryBook ) - pRenderer->DrawTextureTransparent(600, 361, (Texture *)(uTextureID_ib_td5_A != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_ib_td5_A] : 0)); + pRenderer->DrawTextureTransparent(600, 361, pIcons_LOD->GetTexture(uTextureID_ib_td5_A)); } else { @@ -1281,19 +1277,15 @@ //----- (0041AEBB) -------------------------------------------------------- void __cdecl GameUI_DrawFoodAndGold() { - unsigned int v0; // ebx@2 - unsigned int v1; // ebp@2 int v2; // esi@2 if ( uGameState != GAME_STATE_FINAL_WINDOW ) { - v0 = uGameUIFontMain; - v1 = uGameUIFontShadow; v2 = sub_44100D() != 0 ? 381 : 322; sprintf(pTmpBuf, "\r087%lu", pParty->uNumFoodRations); - pPrimaryWindow->DrawText(pFontSmallnum, 0, v2, v0, pTmpBuf, 0, 0, v1); + pPrimaryWindow->DrawText(pFontSmallnum, 0, v2, uGameUIFontMain, pTmpBuf, 0, 0, uGameUIFontShadow); sprintf(pTmpBuf, "\r028%lu", pParty->uNumGold); - pPrimaryWindow->DrawText(pFontSmallnum, 0, v2, v0, pTmpBuf, 0, 0, v1); + pPrimaryWindow->DrawText(pFontSmallnum, 0, v2, uGameUIFontMain, pTmpBuf, 0, 0, uGameUIFontShadow); } } @@ -1772,7 +1764,7 @@ (uTextureID_Btn_GameSettings != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_GameSettings].uTextureWidth : 24), (uTextureID_Btn_GameSettings != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_GameSettings].uTextureHeight : 26), 1, 0, 0x6Bu, 0, 0, pGlobalTXT_LocalizationStrings[93], - (Texture *)(uTextureID_Btn_GameSettings != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings] : 0), 0); + (Texture *)(uTextureID_Btn_GameSettings != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_GameSettings] : 0), 0); pBtn_NPCLeft = pPrimaryWindow->CreateButton(0x1D5u, 0xB2u, (uTextureID_Btn_NPCLeft != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft].uTextureWidth : 24), (uTextureID_Btn_NPCLeft != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft].uTextureHeight : 26), @@ -1783,7 +1775,7 @@ (uTextureID_Btn_NPCRight != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCRight].uTextureHeight : 26), 1, 0, 0xBCu, 1u, 0, "", (Texture *)(uTextureID_Btn_NPCRight != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_NPCRight] : 0), 0); - Load_isn_spells_21_27(); + LoadPartyBuffIcons(); } @@ -2487,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 ) { @@ -2545,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 ) @@ -2613,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:"); @@ -5292,7 +5283,7 @@ { if ( pParty->bTurnBasedModeOn == 1 && pTurnEngine->field_4 == 3 ) { - pParty->uFlags |= 8u; + pParty->uFlags |= PARTY_FLAGS_1_FALLING; return; } if ( uActiveCharacter @@ -5357,14 +5348,17 @@ pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-c", 2); pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-c", 2); pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-c", 2); - pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_50796C], "isg-01-c", 2); - pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_507968], "isg-02-c", 2); - pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_507964], "isg-03-c", 2); - pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_507960], "isg-04-c", 2); + + pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Bless], "isg-01-c", 2); + pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Preservation], "isg-02-c", 2); + pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Hammerhands], "isg-03-c", 2); + pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_PainReflection], "isg-04-c", 2); + pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeC"); - pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); + pIconsFrameTable->InitializeAnimation(pUIAnim_WizardEye->uIconID); pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchC"); - pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID); + pIconsFrameTable->InitializeAnimation(pUIAnum_Torchlight->uIconID); + pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uExitCancelTextureId], "ib-bcu-c", 2); pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50795C], "evtnpc-c", 2); pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507958], "fr_inven-c", 2); @@ -5402,10 +5396,10 @@ uTextureID_Btn_QuickReference = pIcons_LOD->LoadTexture("ib-m3d-c", TEXTURE_16BIT_PALETTE); uTextureID_Btn_GameSettings = pIcons_LOD->LoadTexture("ib-m4d-c", TEXTURE_16BIT_PALETTE); uExitCancelTextureId = pIcons_LOD->LoadTexture("ib-bcu-c", TEXTURE_16BIT_PALETTE); - dword_50796C = pIcons_LOD->LoadTexture("isg-01-c", TEXTURE_16BIT_PALETTE); - dword_507968 = pIcons_LOD->LoadTexture("isg-02-c", TEXTURE_16BIT_PALETTE); - dword_507964 = pIcons_LOD->LoadTexture("isg-03-c", TEXTURE_16BIT_PALETTE); - dword_507960 = pIcons_LOD->LoadTexture("isg-04-c", TEXTURE_16BIT_PALETTE); + uTextureID_PlayerBuff_Bless = pIcons_LOD->LoadTexture("isg-01-c", TEXTURE_16BIT_PALETTE); + uTextureID_PlayerBuff_Preservation = pIcons_LOD->LoadTexture("isg-02-c", TEXTURE_16BIT_PALETTE); + uTextureID_PlayerBuff_Hammerhands = pIcons_LOD->LoadTexture("isg-03-c", TEXTURE_16BIT_PALETTE); + uTextureID_PlayerBuff_PainReflection = pIcons_LOD->LoadTexture("isg-04-c", TEXTURE_16BIT_PALETTE); uTextureID_50795C = pIcons_LOD->LoadTexture("evtnpc-c", TEXTURE_16BIT_PALETTE); uTextureID_507958 = pIcons_LOD->LoadTexture("fr_inven", TEXTURE_16BIT_PALETTE); pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeC"); @@ -5442,10 +5436,10 @@ pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-a", 2); pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-a", 2); pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-a", 2); - pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_50796C], "isg-01-a", 2); - pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_507968], "isg-02-a", 2); - pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_507964], "isg-03-a", 2); - pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_507960], "isg-04-a", 2); + pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Bless], "isg-01-a", 2); + pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Preservation], "isg-02-a", 2); + pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Hammerhands], "isg-03-a", 2); + pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_PainReflection], "isg-04-a", 2); pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeA"); pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchA"); @@ -5487,10 +5481,10 @@ uTextureID_Btn_ZoomIn = pIcons_LOD->LoadTexture("ib-autout-a", TEXTURE_16BIT_PALETTE); uTextureID_Btn_ZoomOut = pIcons_LOD->LoadTexture("ib-autin-a", TEXTURE_16BIT_PALETTE); uExitCancelTextureId = pIcons_LOD->LoadTexture("ib-bcu-a", TEXTURE_16BIT_PALETTE); - dword_50796C = pIcons_LOD->LoadTexture("isg-01-a", TEXTURE_16BIT_PALETTE); - dword_507968 = pIcons_LOD->LoadTexture("isg-02-a", TEXTURE_16BIT_PALETTE); - dword_507964 = pIcons_LOD->LoadTexture("isg-03-a", TEXTURE_16BIT_PALETTE); - dword_507960 = pIcons_LOD->LoadTexture("isg-04-a", TEXTURE_16BIT_PALETTE); + uTextureID_PlayerBuff_Bless = pIcons_LOD->LoadTexture("isg-01-a", TEXTURE_16BIT_PALETTE); + uTextureID_PlayerBuff_Preservation = pIcons_LOD->LoadTexture("isg-02-a", TEXTURE_16BIT_PALETTE); + uTextureID_PlayerBuff_Hammerhands = pIcons_LOD->LoadTexture("isg-03-a", TEXTURE_16BIT_PALETTE); + uTextureID_PlayerBuff_PainReflection = pIcons_LOD->LoadTexture("isg-04-a", TEXTURE_16BIT_PALETTE); uTextureID_50795C = pIcons_LOD->LoadTexture("evtnpc", TEXTURE_16BIT_PALETTE); uTextureID_507958 = pIcons_LOD->LoadTexture("fr_inven", TEXTURE_16BIT_PALETTE); pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeA"); @@ -5538,10 +5532,10 @@ pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-b", 2); pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-b", 2); pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-b", 2); - pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_50796C], "isg-01-b", 2); - pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_507968], "isg-02-b", 2); - pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_507964], "isg-03-b", 2); - pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_507960], "isg-04-b", 2); + pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Bless], "isg-01-b", 2); + pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Preservation], "isg-02-b", 2); + pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Hammerhands], "isg-03-b", 2); + pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_PainReflection], "isg-04-b", 2); pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeB"); pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchB");
--- a/mm7_2.cpp Wed Mar 06 09:28:09 2013 +0600 +++ b/mm7_2.cpp Wed Mar 06 09:28:27 2013 +0600 @@ -13404,7 +13404,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); @@ -14660,16 +14660,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 @@ -14677,11 +14674,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); @@ -14700,16 +14707,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 ) @@ -14718,19 +14748,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; @@ -14747,9 +14778,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; @@ -14777,7 +14821,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)); @@ -14796,9 +14841,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 ) @@ -14834,9 +14892,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 ) @@ -14845,12 +14906,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; } } } @@ -14863,7 +14928,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)); @@ -14880,7 +14954,6 @@ v50 = _this.uItemID; if ( v51 ) v0->pEquipment.uOffHand = 0; -LABEL_74: if ( v50 ) stru_A750F8[uActiveCharacter - 1]._494836( *((int *)&pSpellDatas[66].uNormalLevelRecovery + v50), @@ -14888,9 +14961,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 ) @@ -14902,7 +14988,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)); @@ -14939,7 +15026,6 @@ v31 = v52 + 1; memcpy(&v0->pInventoryItems[v52], &pParty->pPickedItem, sizeof(v0->pInventoryItems[v52])); v0->pEquipment.uMainHand = v31; -LABEL_45: pMouse->RemoveHoldingItem(); } } @@ -14976,7 +15062,6 @@ { if ( bUnderwater ) { -LABEL_95: v46 = 0; v45 = 0; v44 = 0; @@ -14984,7 +15069,6 @@ v42 = -1; v41 = 0; v40 = 0; -LABEL_96: pAudioPlayer->PlaySound(SOUND_27, v40, v41, v42, v43, v44, v45, v46); return; } @@ -15109,71 +15193,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; @@ -15348,7 +15436,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; } @@ -15362,7 +15449,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; @@ -15868,7 +15958,7 @@ { strcpy(pOutdoor->pLevelFilename, pCurrentMapName); v0 = pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.y, (char *)&pOut, 32); - if ( !bUnderwater && (pParty->uFlags & 0x8C || BYTE1(pParty->uFlags) & 2 || pParty->bFlying) || !v0 ) + if ( !bUnderwater && (pParty->uFlags & (PARTY_FLAGS_1_STANDING_ON_WATER | PARTY_FLAGS_1_FALLING | 0x04) || pParty->uFlags & 0x0200 || pParty->bFlying) || !v0 ) { if ( pParty->vPosition.x < -22528 ) pParty->vPosition.x = -22528;
--- a/mm7_3.cpp Wed Mar 06 09:28:09 2013 +0600 +++ b/mm7_3.cpp Wed Mar 06 09:28:27 2013 +0600 @@ -1702,9 +1702,9 @@ LABEL_20: if ( v6 - party_z > 512 && !bFeatherFall && party_z <= v80 + 1 ) { - if ( BYTE1(pParty->uFlags) & 1 ) - { - BYTE1(pParty->uFlags) &= 0xFEu; + if (pParty->uFlags & PARTY_FLAGS_1_LANDING) + { + pParty->uFlags &= ~PARTY_FLAGS_1_LANDING; } else for (uint i = 0; i < 4; ++i) { // receive falling damage @@ -1927,7 +1927,7 @@ v89 -= pEventTimer->uTimeElapsed * GetGravityStrength(); goto LABEL_92; } - if ( BYTE1(pParty->uFlags) & 1 ) + if (pParty->uFlags & PARTY_FLAGS_1_LANDING) goto LABEL_92; v89 = 0; } @@ -2181,16 +2181,16 @@ } } if ( !bJumping || bFeatherFall ) - pParty->uFlags &= 0xFFFFFFF7u; - else - pParty->uFlags |= 8u; - BYTE1(pParty->uFlags) &= 0xFDu; + pParty->uFlags &= ~PARTY_FLAGS_1_FALLING; + else + pParty->uFlags |= PARTY_FLAGS_1_FALLING; + pParty->uFlags &= ~0x200; pParty->vPosition.x = new_party_x; pParty->vPosition.z = new_party_z; pParty->vPosition.y = new_party_y; pParty->uFallSpeed = v89; if ( !bJumping && BYTE3(pIndoor->pFaces[uFaceID].uAttributes) & 0x40 ) - BYTE1(pParty->uFlags) |= 2u; + pParty->uFlags |= 0x200; if (uFaceEvent) EventProcessor(uFaceEvent, 0, 1); } @@ -2370,7 +2370,7 @@ } // bFeatherFall = 1; //LABEL_9: - LOBYTE(pParty->uFlags) &= 0x7Fu; + pParty->uFlags &= ~PARTY_FLAGS_1_STANDING_ON_WATER; if (pParty->WaterWalkActive()) { //LOBYTE(pParty->uFlags) &= 0x7Fu; @@ -2476,7 +2476,7 @@ pParty->bFlying = false; if (bUnderwater || pParty->pPartyBuffs[PARTY_BUFF_FLY].uFlags & 1 || - pParty->pPlayers[pParty->pPartyBuffs[PARTY_BUFF_FLY].uCaster - 1].sMana <= 0 ) + pParty->pPlayers[pParty->pPartyBuffs[PARTY_BUFF_FLY].uCaster - 1].sMana > 0 ) { if ( pParty->vPosition.z < 4000 || bJumping ) { @@ -2497,7 +2497,7 @@ pParty->field_6E0 = 0; pParty->field_6E4 = 0; pPartyActionQueue->uNumActions = 0; - BYTE1(pParty->uFlags) |= 1u; + pParty->uFlags |= PARTY_FLAGS_1_LANDING; pParty->vPosition.z = v109 - pParty->uPartyHeight - 31; pParty->field_6F0 = v123; pParty->bFlying = 0; @@ -2517,7 +2517,7 @@ pParty->bFlying = 0; if ( bUnderwater || pParty->pPartyBuffs[7].uFlags & 1 - || pParty->pPlayers[pParty->pPartyBuffs[7].uCaster-1].sMana <= 0 )//*(int *)&pParty->pArtifactsFound[6972 * pParty->pPartyBuffs[7].uCaster + 10] > 0 ) + || pParty->pPlayers[pParty->pPartyBuffs[7].uCaster - 1].sMana > 0 )//*(int *)&pParty->pArtifactsFound[6972 * pParty->pPartyBuffs[7].uCaster + 10] > 0 ) { v123 -= 30; v113 -= 30; @@ -3147,9 +3147,9 @@ } } if ( !bJumping || v101 ) - pParty->uFlags &= 0xFFFFFFF7u; - else - pParty->uFlags |= 8u; + pParty->uFlags &= ~PARTY_FLAGS_1_FALLING; + else + pParty->uFlags |= PARTY_FLAGS_1_FALLING; v126 = WorldPosToGridCellX(pParty->vPosition.x); v65 = WorldPosToGridCellZ(pParty->vPosition.y) - 1; v114 = WorldPosToGridCellX(v116); @@ -3192,9 +3192,9 @@ pParty->vPosition.z = v105; if ( pParty->uFallStartY - v70 > 512 && !bFeatherFall && v70 <= v105 && !bUnderwater ) { - if ( pParty->uFlags & 0x100 ) - { - BYTE1(pParty->uFlags) &= 0xFEu; + if ( pParty->uFlags & PARTY_FLAGS_1_LANDING ) + { + pParty->uFlags &= ~PARTY_FLAGS_1_LANDING; } else { @@ -3225,7 +3225,7 @@ pParty->field_6F0 = v109 - pParty->uPartyHeight - 1; } } - LOWORD(pParty->uFlags) &= 0xFDFBu; + pParty->uFlags &= ~0x204; } return; } @@ -3260,15 +3260,17 @@ LABEL_313: if ( bWaterWalk ) { - LOBYTE(pParty->uFlags) &= 0x7Fu; - v79 = 20 * pParty->pPartyBuffs[18].uOverlayID + 6180178; - *(short *)&stru_5E4C90._decor_events[20 * pParty->pPartyBuffs[18].uOverlayID + 119] |= 1u; + pParty->uFlags &= ~PARTY_FLAGS_1_STANDING_ON_WATER; + //v79 = 20 * pParty->pPartyBuffs[18].uOverlayID + 6180178; + //*(short *)&stru_5E4C90._decor_events[20 * pParty->pPartyBuffs[18].uOverlayID + 119] |= 1u; + v79 = (int)&stru_5E4C90._decor_events[20 * pParty->pPartyBuffs[18].uOverlayID + 119]; + *(short *)v79 |= 1u; if ( !v122 || !v69 ) { if ( !v76 ) { v80 = *(short *)v79; - LOBYTE(pParty->uFlags) |= 0x80u; + pParty->uFlags |= PARTY_FLAGS_1_STANDING_ON_WATER; *(short *)v79 = v80 & 0xFFFE; } } @@ -3312,9 +3314,9 @@ pParty->vPosition.z = v105; if ( pParty->uFallStartY - v81 > 512 && !bFeatherFall && v81 <= v105 && !bUnderwater ) { - if ( pParty->uFlags & 0x100 ) - { - BYTE1(pParty->uFlags) &= 0xFEu; + if ( pParty->uFlags & PARTY_FLAGS_1_LANDING ) + { + pParty->uFlags &= ~PARTY_FLAGS_1_LANDING; } else { @@ -11663,25 +11665,16 @@ //----- (0044100D) -------------------------------------------------------- bool __cdecl sub_44100D() { - return pCurrentScreen == SCREEN_NPC_DIALOGUE - || pCurrentScreen == SCREEN_CHARACTERS - || pCurrentScreen > SCREEN_LOADGAME - && (pCurrentScreen <= SCREEN_E - || pCurrentScreen > SCREEN_VIDEO - && (pCurrentScreen <= SCREEN_INPUT_BLV - || pCurrentScreen == SCREEN_CASTING)); + return pCurrentScreen == SCREEN_NPC_DIALOGUE || pCurrentScreen == SCREEN_CHARACTERS || + pCurrentScreen > SCREEN_LOADGAME && pCurrentScreen <= SCREEN_E || + pCurrentScreen > SCREEN_VIDEO && pCurrentScreen <= SCREEN_INPUT_BLV || pCurrentScreen == SCREEN_CASTING; } // 4E28F8: using guessed type int pCurrentScreen; //----- (00441498) -------------------------------------------------------- void __cdecl GameUI_DrawTorchlightAndWizardEye() { - unsigned int v0; // eax@15 - IconFrame *v1; // eax@15 - unsigned int v2; // eax@19 - IconFrame *v3; // eax@19 - - if ( !pCurrentScreen + if (pCurrentScreen == SCREEN_GAME || pCurrentScreen == SCREEN_MENU || pCurrentScreen == SCREEN_OPTIONS || pCurrentScreen == SCREEN_REST @@ -11693,25 +11686,15 @@ || pCurrentScreen == SCREEN_BOOKS || pCurrentScreen == SCREEN_BRANCHLESS_NPC_DIALOG ) { - if ( SHIDWORD(pParty->pPartyBuffs[16].uExpireTime) >= 0 - && (SHIDWORD(pParty->pPartyBuffs[16].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[16].uExpireTime)) ) - { - v0 = pEventTimer->Time(); - v1 = pIconsFrameTable->GetFrame((signed __int16)pUIAnum_Torchlight->uIconID, v0); - pRenderer->DrawTextureTransparent( - pUIAnum_Torchlight->x, - pUIAnum_Torchlight->y, - &pIcons_LOD->pTextures[v1->uTextureID]); - } - if ( SHIDWORD(pParty->pPartyBuffs[19].uExpireTime) >= 0 - && (SHIDWORD(pParty->pPartyBuffs[19].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[19].uExpireTime)) ) - { - v2 = pEventTimer->Time(); - v3 = pIconsFrameTable->GetFrame((signed __int16)pUIAnim_WizardEye->uIconID, v2); - pRenderer->DrawTextureTransparent( - pUIAnim_WizardEye->x, - pUIAnim_WizardEye->y, - &pIcons_LOD->pTextures[v3->uTextureID]); + if (pParty->TorchlightActive()) + { + auto icon = pIconsFrameTable->GetFrame((signed __int16)pUIAnum_Torchlight->uIconID, pEventTimer->Time()); + pRenderer->DrawTextureTransparent(pUIAnum_Torchlight->x, pUIAnum_Torchlight->y, pIcons_LOD->GetTexture(icon->uTextureID)); + } + if (pParty->WizardEyeActive()) + { + auto icon = pIconsFrameTable->GetFrame((signed __int16)pUIAnim_WizardEye->uIconID, pEventTimer->Time()); + pRenderer->DrawTextureTransparent(pUIAnim_WizardEye->x, pUIAnim_WizardEye->y, pIcons_LOD->GetTexture(icon->uTextureID)); } } } @@ -11729,81 +11712,71 @@ //----- (004415C5) -------------------------------------------------------- -void __cdecl Load_isn_spells_21_27() -{ - signed int v0; // esi@1 - char pContainer[120]; // [sp+8h] [bp-20h]@2 - - v0 = 0; - do - { - sprintf(pContainer, "isn-%02d", v0 + 1); - pTextureIDs_isns[v0++] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - } - while ( v0 < 14 ); - uIconIdx_Spell21 = pIconsFrameTable->FindIcon("spell21"); - uIconIdx_Spell27 = pIconsFrameTable->FindIcon("spell27"); +void LoadPartyBuffIcons() +{ + for (uint i = 0; i < 14; ++i) + { + char filename[200]; + sprintf(filename, "isn-%02d", i + 1); + pTextureIDs_PartyBuffIcons[i] = pIcons_LOD->LoadTexture(filename, TEXTURE_16BIT_PALETTE); + } + + uIconIdx_FlySpell = pIconsFrameTable->FindIcon("spell21"); + uIconIdx_WaterWalk = pIconsFrameTable->FindIcon("spell27"); } //----- (0044162D) -------------------------------------------------------- void __cdecl GameUI_DrawPartySpells() { unsigned int v0; // ebp@1 - signed int v1; // edi@1 - int v2; // eax@2 - int v3; // ecx@5 - __int16 *v4; // ebx@25 - Player *v5; // edi@26 - unsigned int v6; // [sp-4h] [bp-1Ch]@11 + //signed int v1; // edi@1 + //int v2; // eax@2 + //int v3; // ecx@5 + //__int16 *v4; // ebx@25 + //Player *v5; // edi@26 + //unsigned int v6; // [sp-4h] [bp-1Ch]@11 Texture *v7; // [sp-4h] [bp-1Ch]@12 - unsigned int v8; // [sp-4h] [bp-1Ch]@20 + //unsigned int v8; // [sp-4h] [bp-1Ch]@20 Texture *v9; // [sp-4h] [bp-1Ch]@21 - Player **v10; // [sp+10h] [bp-8h]@25 + //Player **v10; // [sp+10h] [bp-8h]@25 v0 = (signed __int64)((double)GetTickCount() * 0.050000001); - v1 = 0; - do - { - v2 = (unsigned __int8)byte_4E5DD8[v1]; - if ( SHIDWORD(pParty->pPartyBuffs[v2].uExpireTime) >= 0 - && (SHIDWORD(pParty->pPartyBuffs[v2].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[v2].uExpireTime) > 0) ) - { - v3 = pTextureIDs_isns[v1]; - pRenderer->_4A65CC( - pPartySpellbuffsUI_XYs[v1][0], - pPartySpellbuffsUI_XYs[v1][1], - (Texture *)(v3 != -1 ? &pIcons_LOD->pTextures[v3] : 0), - (Texture *)(v3 != -1 ? &pIcons_LOD->pTextures[v3] : 0), - v0 + 20 * pPartySpellbuffsUI_smthns[v1], - 0, - 63); - } - ++v1; - } - while ( v1 < 14 ); - if ( !pCurrentScreen - || pCurrentScreen == SCREEN_NPC_DIALOGUE ) - { - if ( (signed __int64)pParty->pPartyBuffs[7].uExpireTime > 0 ) + //v1 = 0; + for (uint i = 0; i < 14; ++i) + { + //v2 = byte_4E5DD8[v1]; + if (pParty->pPartyBuffs[byte_4E5DD8[i]].uExpireTime) + { + auto tex = pIcons_LOD->GetTexture(pTextureIDs_PartyBuffIcons[i]); + //v3 = pTextureIDs_PartyBuffIcons[i]; + if (tex) + pRenderer->_4A65CC(pPartySpellbuffsUI_XYs[i][0], + pPartySpellbuffsUI_XYs[i][1], tex, tex, + v0 + 20 * pPartySpellbuffsUI_smthns[i], 0, 63); + } + //++v1; + } + //while ( v1 < 14 ); + + if (pCurrentScreen == SCREEN_GAME || pCurrentScreen == SCREEN_NPC_DIALOGUE) + { + if (pParty->FlyActive()) { if ( pParty->bFlying ) - v6 = v0; - else - v6 = 0; - v7 = &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(uIconIdx_Spell21, v6)->uTextureID]; + v7 = &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(uIconIdx_FlySpell, v0)->uTextureID]; + else + v7 = &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(uIconIdx_FlySpell, 0)->uTextureID]; if ( pRenderer->pRenderD3D ) pRenderer->DrawTextureIndexed(8u, 8u, v7); else pRenderer->DrawTextureTransparent(8u, 8u, v7); } - if ( SHIDWORD(pParty->pPartyBuffs[18].uExpireTime) >= 0 - && (SHIDWORD(pParty->pPartyBuffs[18].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[18].uExpireTime)) ) - { - if ( pParty->uFlags & 0x80 ) - v8 = v0; - else - v8 = 0; - v9 = &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(uIconIdx_Spell27, v8)->uTextureID]; + if (pParty->WaterWalkActive()) + { + if ( pParty->uFlags & PARTY_FLAGS_1_STANDING_ON_WATER) + v9 = &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(uIconIdx_WaterWalk, v0)->uTextureID]; + else + v9 = &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(uIconIdx_WaterWalk, 0)->uTextureID]; if ( pRenderer->pRenderD3D ) pRenderer->DrawTextureIndexed(396u, 8u, v9); else @@ -11811,37 +11784,19 @@ } } - uint _it = 0; - v10 = &pPlayers[1]; - v4 = pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing; - do - { - v5 = *v10; - if ( (signed __int64)(*v10)->pPlayerBuffs[6].uExpireTime > 0 ) - pRenderer->DrawTextureIndexed( - *v4 + 72, - 0x1ABu, - (Texture *)(dword_507964 != -1 ? &pIcons_LOD->pTextures[dword_507964] : 0)); - if ( (signed __int64)v5->pPlayerBuffs[1].uExpireTime > 0 ) - pRenderer->DrawTextureIndexed( - *v4 + 72, - 0x189u, - (Texture *)(dword_50796C != -1 ? &pIcons_LOD->pTextures[dword_50796C] : 0)); - if ( (signed __int64)v5->pPlayerBuffs[11].uExpireTime > 0 ) - pRenderer->DrawTextureIndexed( - *v4 + 72, - 0x19Au, - (Texture *)(dword_507968 != -1 ? &pIcons_LOD->pTextures[dword_507968] : 0)); - if ( (signed __int64)v5->pPlayerBuffs[10].uExpireTime > 0 ) - pRenderer->DrawTextureIndexed( - *v4 + 72, - 0x1BCu, - (Texture *)(dword_507960 != -1 ? &pIcons_LOD->pTextures[dword_507960] : 0)); - ++v10; - ++v4; - } - //while ( (signed int)v4 < (signed int)pBaseHealthByClass ); - while (++_it != 4); + for (uint i = 0; i < 4; ++i) + { + auto player = pParty->pPlayers + i; + + if (player->pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].uExpireTime) + pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 427, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Hammerhands)); + if (player->pPlayerBuffs[PLAYER_BUFF_BLESS].uExpireTime) + pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 393, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Bless)); + if (player->pPlayerBuffs[PLAYER_BUFF_PRESERVATION].uExpireTime) + pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 410, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Preservation)); + if (player->pPlayerBuffs[PLAYER_BUFF_PAIN_REFLECTION].uExpireTime) + pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 444, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_PainReflection)); + } } //----- (00441A4E) -------------------------------------------------------- @@ -15532,8 +15487,8 @@ signed int v29; // edx@66 char *v30; // ecx@67 unsigned __int16 v31; // ax@70 - Player *v32; // eax@80 - unsigned __int16 v33; // si@85 + //Player *v32; // eax@80 + //unsigned __int16 v33; // si@85 int v34; // eax@96 int v35; // eax@97 unsigned __int64 v36; // qax@99 @@ -15545,7 +15500,7 @@ int v42; // esi@111 int v43; // ebx@111 int v44; // eax@117 - unsigned __int16 v45; // si@137 + //unsigned __int16 v45; // si@137 unsigned __int16 v46; // [sp-8h] [bp-BCh]@99 int v47; // [sp-4h] [bp-B8h]@35 unsigned __int16 v48; // [sp-4h] [bp-B8h]@99 @@ -15561,8 +15516,8 @@ //SpriteObject a1; // [sp+38h] [bp-7Ch]@12 int v59; // [sp+A8h] [bp-Ch]@1 int v60; // [sp+ACh] [bp-8h]@1 - int spellnum_; // [sp+B0h] [bp-4h]@1 - signed int levela; // [sp+BCh] [bp+8h]@80 + //int spellnum_; // [sp+B0h] [bp-4h]@1 + //signed int levela; // [sp+BCh] [bp+8h]@80 int a6_4; // [sp+C8h] [bp+14h]@117 float a7a; // [sp+CCh] [bp+18h]@6 signed int a7b; // [sp+CCh] [bp+18h]@12 @@ -15575,7 +15530,7 @@ v9 = 0; v59 = rank + 1; - spellnum_ = spellnum; + //spellnum_ = spellnum; v60 = 0; if ( tox || toy || toz ) { @@ -15618,12 +15573,12 @@ SpriteObject a1; // [sp+38h] [bp-7Ch]@12 //SpriteObject::SpriteObject(&a1); - a1.uType = stru_4E3ACC[spellnum_].field_0; - if ( spellnum_ > 58 ) - { - if ( spellnum_ == 69 ) + a1.uType = stru_4E3ACC[spellnum].field_0; + if ( spellnum > 58 ) + { + if ( spellnum == 69 ) goto LABEL_117; - if ( spellnum_ != 83 ) + if ( spellnum != 83 ) return; v40 = v15 - 2; if ( v40 ) @@ -15661,9 +15616,9 @@ v37->Apply(v36, v46, v48, v50, v52); goto LABEL_139; } - if ( spellnum_ != 58 ) - { - switch ( spellnum_ ) + if ( spellnum != 58 ) + { + switch ( spellnum ) { case 2: case 6: @@ -15675,7 +15630,7 @@ case 41: a1.stru_24.Reset(); v16 = 0; - a1.field_48 = spellnum_; + a1.field_48 = spellnum; a1.field_4C = level; a1.field_50 = v15; if ( (signed int)pObjectList->uNumObjects <= 0 ) @@ -15713,7 +15668,7 @@ a8b = a7c / (v60 - 1); a1.stru_24.Reset(); v21 = 0; - a1.field_48 = spellnum_; + a1.field_48 = spellnum; a1.field_4C = level; a1.field_50 = v15; if ( (signed int)pObjectList->uNumObjects <= 0 ) @@ -15756,7 +15711,7 @@ } a1.stru_24.Reset(); v16 = 0; - a1.field_48 = spellnum_; + a1.field_48 = spellnum; a1.field_4C = level; a1.field_50 = v15; if ( (signed int)pObjectList->uNumObjects <= 0 ) @@ -15809,7 +15764,7 @@ a8c = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (v60 - 1); a1.stru_24.Reset(); v25 = 0; - a1.field_48 = spellnum_; + a1.field_48 = spellnum; a1.field_4C = level; a1.field_50 = v15; if ( (signed int)pObjectList->uNumObjects <= 0 ) @@ -15853,14 +15808,15 @@ return; a1.stru_24.Reset(); v29 = 0; - a1.field_48 = spellnum_; + a1.field_48 = spellnum; a1.field_4C = level; a1.field_50 = v15; if ( (signed int)pObjectList->uNumObjects <= 0 ) goto LABEL_70; v30 = (char *)&pObjectList->pObjects->uObjectID; break; - case 5: + + case SPELL_FIRE_HASTE: if ( v15 > 0 ) { if ( v15 <= 2 ) @@ -15880,28 +15836,25 @@ } } } - levela = 1; - v32 = pParty->pPlayers;//[0].pConditions[1]; - do - { - if ( v32->pConditions[1] ) - levela = 0; - ++v32; - } - while ( v32 <= &pParty->pPlayers[3] ); - if ( !levela ) - return; - pParty->pPartyBuffs[8].Apply( - pParty->uTimePlayed + (signed int)(signed __int64)((double)(v9 << 7) * 0.033333335), + //levela = 1; + //v32 = pParty->pPlayers;//[0].pConditions[1]; + //do + for (uint i = 0; i < 4; ++i) + if (pParty->pPlayers[i].pConditions[Player::Condition_Weak]) + return; + //while ( v32 <= &pParty->pPlayers[3] ); + //if ( !levela ) + // return; + pParty->pPartyBuffs[PARTY_BUFF_HASTE].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(v9 * 128) * 0.033333335), v15, 0, 0, 0); - v33 = spellnum_; - pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 0); - pGame->pStru6Instance->SetPlayerBuffAnim(v33, 1u); - pGame->pStru6Instance->SetPlayerBuffAnim(v33, 2u); - pGame->pStru6Instance->SetPlayerBuffAnim(v33, 3u); + //v33 = spellnum_; + pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 0); + pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 1); + pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 2); + pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 3); goto LABEL_138; case 17: case 38: @@ -15919,7 +15872,7 @@ v9 = 3600 * (level + 1); break; } - switch ( spellnum_ ) + switch ( spellnum ) { case 17: v60 = 0; @@ -15936,10 +15889,10 @@ v60 = v34; break; } - pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 0); - pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 1u); - pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 2u); - pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 3u); + pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 0); + pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 1); + pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 2); + pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 3); v52 = 0; v50 = 0; v48 = v60; @@ -15952,10 +15905,10 @@ v38 = 60 * level; else v38 = 600 * level; - pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 0); - pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 1u); - pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 2u); - pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 3u); + pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 0); + pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 1); + pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 2); + pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 3); v52 = 0; v50 = 0; v48 = level; @@ -16027,7 +15980,7 @@ goto LABEL_124; } LABEL_125: - switch ( spellnum_ ) + switch ( spellnum ) { case 3: level = 6; @@ -16048,22 +16001,22 @@ level = 1; break; } - v45 = spellnum_; - pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 0); - pGame->pStru6Instance->SetPlayerBuffAnim(v45, 1u); - pGame->pStru6Instance->SetPlayerBuffAnim(v45, 2u); - pGame->pStru6Instance->SetPlayerBuffAnim(v45, 3u); + //v45 = spellnum_; + pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 0); + pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 1); + pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 2); + pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 3); pParty->pPartyBuffs[level].Apply( pParty->uTimePlayed + (signed int)(signed __int64)((double)a6_4 * 4.2666669), v15, v60, 0, 0); - levela = 1; + //levela = 1; LABEL_138: - if ( levela ) + //if ( levela ) LABEL_139: - pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[spellnum_], 0, 0, fromx, fromy, 0, 0, 0); + pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[spellnum], 0, 0, fromx, fromy, 0, 0, 0); } // 4EE088: using guessed type __int16 word_4EE088_sound_ids[];
--- a/mm7_4.cpp Wed Mar 06 09:28:09 2013 +0600 +++ b/mm7_4.cpp Wed Mar 06 09:28:27 2013 +0600 @@ -3424,11 +3424,11 @@ { if ( pParty->bFlying ) { - if ( !(pParty->pPartyBuffs[7].uFlags & 1) ) - { - v5 = v4 * pParty->pPartyBuffs[7].uPower; - __debugbreak(); - v6 = (int *)&pParty->pPlayers[pParty->pPartyBuffs[7].uCaster].pConditions[0];//&stru_AA1058[4].pSounds[6972 * pParty->pPartyBuffs[7].uCaster + 2000]; + if ( !(pParty->pPartyBuffs[PARTY_BUFF_FLY].uFlags & 1) ) + { // colliding with something in the air - fall down + v5 = v4 * pParty->pPartyBuffs[PARTY_BUFF_FLY].uPower; + //__debugbreak(); + v6 = (int *)&pParty->pPlayers[pParty->pPartyBuffs[PARTY_BUFF_FLY].uCaster].pConditions[0];//&stru_AA1058[4].pSounds[6972 * pParty->pPartyBuffs[7].uCaster + 2000]; v7 = *v6 < v5; *v6 -= v5; if ( v7 ) @@ -3441,25 +3441,27 @@ } } } + if (pParty->WaterWalkActive()) { - if (pParty->uFlags & 0x80 ) - { - if ( !(pParty->pPartyBuffs[18].uFlags & 1) ) - { - __debugbreak(); - v8 = (int *)&pParty->pPlayers[pParty->pPartyBuffs[18].uCaster].pConditions[0];//&stru_AA1058[4].pSounds[6972 * pParty->pPartyBuffs[18].uCaster + 2000]; + if (pParty->uFlags & PARTY_FLAGS_1_STANDING_ON_WATER ) + { + if ( !(pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uFlags & 1) ) + { // taking on water + //__debugbreak(); + v8 = (int *)&pParty->pPlayers[pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uCaster].pConditions[0];//&stru_AA1058[4].pSounds[6972 * pParty->pPartyBuffs[18].uCaster + 2000]; v7 = *v8 < v4; *v8 -= v4; if ( v7 ) { *v8 = 0; - LOBYTE(pParty->uFlags) &= 0x7Fu; + pParty->uFlags &= ~PARTY_FLAGS_1_STANDING_ON_WATER; v51 = 1; } } } } + if (pParty->ImmolationActive()) { //SpriteObject::SpriteObject(&a1);
--- a/mm7_5.cpp Wed Mar 06 09:28:09 2013 +0600 +++ b/mm7_5.cpp Wed Mar 06 09:28:27 2013 +0600 @@ -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 09:28:09 2013 +0600 +++ b/mm7_6.cpp Wed Mar 06 09:28:27 2013 +0600 @@ -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 ) @@ -4702,9 +4702,9 @@ } goto LABEL_1056; case 16: - if ( pParty->uFlags & 8 ) - { - v190 = pGlobalTXT_LocalizationStrings[493]; + if ( pParty->uFlags & PARTY_FLAGS_1_FALLING) + { + v190 = pGlobalTXT_LocalizationStrings[493]; // Can't cast Jump while airborne! goto LABEL_462; } if ( !pPlayer->CanCastSpell(uRequiredMana) ) @@ -4768,7 +4768,7 @@ case 21: if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) { - v190 = pGlobalTXT_LocalizationStrings[494]; + v190 = pGlobalTXT_LocalizationStrings[494]; // Can not cast Fly indoors! LABEL_462: ShowStatusBarString(v190, 2u); pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); @@ -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; }
--- a/mm7_data.cpp Wed Mar 06 09:28:09 2013 +0600 +++ b/mm7_data.cpp Wed Mar 06 09:28:27 2013 +0600 @@ -3,6 +3,7 @@ #include "NPC.h" #include "Actor.h" #include "GUIWindow.h" +#include "Party.h" @@ -945,9 +946,23 @@ char aItem3_3dvD[13]; // weak char aItem64v1[9]; // weak char aEffpar01[777]; // idb -int pPartySpellbuffsUI_XYs[14][2]; -char byte_4E5DD8[777]; // weak -unsigned __int8 pPartySpellbuffsUI_smthns[14]; + +int pPartySpellbuffsUI_XYs[14][2] = +{ + {477, 247}, {497, 247}, {522, 247}, {542, 247}, {564, 247}, {581, 247}, {614, 247}, + {477, 279}, {497, 279}, {522, 279}, {542, 279}, {564, 279}, {589, 279}, {612, 279} +}; +unsigned char byte_4E5DD8[14] = +{ + PARTY_BUFF_FEATHER_FALL, PARTY_BUFF_RESIST_FIRE, PARTY_BUFF_RESIST_AIR, PARTY_BUFF_RESIST_WATER, PARTY_BUFF_RESIST_MIND, PARTY_BUFF_RESIST_EARTH, PARTY_BUFF_RESIST_BODY, + PARTY_BUFF_HEROISM, PARTY_BUFF_HASTE, PARTY_BUFF_SHIELD, PARTY_BUFF_STONE_SKIN, PARTY_BUFF_PROTECTION_FROM_MAGIC, PARTY_BUFF_IMMOLATION, PARTY_BUFF_DAY_OF_GODS +}; +unsigned __int8 pPartySpellbuffsUI_smthns[14] = +{ + 14, 1, 10, 4, 7, 2, 9, + 3, 6, 15, 8, 3, 12, 0 +}; + char aSpell27[777]; // idb char aSpell21[777]; // idb char aIsn02d[777]; // idb @@ -1861,10 +1876,10 @@ char bFlashHistoryBook; // weak char bFlashAutonotesBook; // weak char bFlashQuestBook; // weak -int dword_507960; // weak -int dword_507964; // weak -int dword_507968; // weak -int dword_50796C; // weak +int uTextureID_PlayerBuff_PainReflection; // weak +int uTextureID_PlayerBuff_Hammerhands; // weak +int uTextureID_PlayerBuff_Preservation; // weak +int uTextureID_PlayerBuff_Bless; // weak int uTextureID_Btn_QuickReference; // weak int dword_5079B4; // weak int dword_5079C8; // weak @@ -1888,7 +1903,7 @@ int dword_507C0C; // weak int dword_507CBC; // weak int dword_507CC0; // weak -__int64 qword_507CC8; // weak +__int64 GameUI_RightPanel_BookFlashTimer; // weak int _507CD4_RestUI_hourglass_anim_controller; // weak int dword_507CD8; // weak int dword_50B570[777]; // weak @@ -1978,9 +1993,9 @@ unsigned __int16 pOdmMinimap[117][137]; unsigned int uNumBlueFacesInBLVMinimap; unsigned __int16 pBlueFacesInBLVMinimapIDs[50]; -int pTextureIDs_isns[14]; -unsigned int uIconIdx_Spell21; -unsigned int uIconIdx_Spell27; +int pTextureIDs_PartyBuffIcons[14]; +unsigned int uIconIdx_FlySpell; +unsigned int uIconIdx_WaterWalk; int dword_576E28; // weak int dword_576E2C; // weak __int64 _5773B8_event_timer; // weak
--- a/mm7_data.h Wed Mar 06 09:28:09 2013 +0600 +++ b/mm7_data.h Wed Mar 06 09:28:27 2013 +0600 @@ -668,7 +668,7 @@ extern char aItem64v1[9]; // weak extern char aEffpar01[]; // idb extern int pPartySpellbuffsUI_XYs[14][2]; -extern char byte_4E5DD8[]; // weak +extern unsigned char byte_4E5DD8[]; // weak extern unsigned __int8 pPartySpellbuffsUI_smthns[14]; extern char aSpell27[]; // idb extern char aSpell21[]; // idb @@ -1191,10 +1191,10 @@ extern char bFlashHistoryBook; // weak extern char bFlashAutonotesBook; // weak extern char bFlashQuestBook; // weak -extern int dword_507960; // weak -extern int dword_507964; // weak -extern int dword_507968; // weak -extern int dword_50796C; // weak +extern int uTextureID_PlayerBuff_PainReflection; // weak +extern int uTextureID_PlayerBuff_Hammerhands; // weak +extern int uTextureID_PlayerBuff_Preservation; // weak +extern int uTextureID_PlayerBuff_Bless; // weak extern int uTextureID_Btn_QuickReference; // weak extern int dword_5079B4; // weak extern int dword_5079C8; // weak @@ -1218,7 +1218,7 @@ extern int dword_507C0C; // weak extern int dword_507CBC; // weak extern int dword_507CC0; // weak -extern __int64 qword_507CC8; // weak +extern __int64 GameUI_RightPanel_BookFlashTimer; // weak extern int _507CD4_RestUI_hourglass_anim_controller; // weak extern int dword_507CD8; // weak extern int dword_50B570[]; // weak @@ -1308,9 +1308,9 @@ extern unsigned __int16 pOdmMinimap[117][137]; extern unsigned int uNumBlueFacesInBLVMinimap; extern unsigned __int16 pBlueFacesInBLVMinimapIDs[50]; -extern int pTextureIDs_isns[14]; -extern unsigned int uIconIdx_Spell21; -extern unsigned int uIconIdx_Spell27; +extern int pTextureIDs_PartyBuffIcons[14]; +extern unsigned int uIconIdx_FlySpell; +extern unsigned int uIconIdx_WaterWalk; extern int dword_576E28; // weak extern int dword_576E2C; // weak extern __int64 _5773B8_event_timer; // weak @@ -1995,7 +1995,7 @@ bool sub_44100D(); void GameUI_DrawTorchlightAndWizardEye(); void GameUI_DrawCharacterSelectionFrame(); -void Load_isn_spells_21_27(); +void LoadPartyBuffIcons(); void GameUI_DrawPartySpells(); __int16 __fastcall sub_441A4E(int a1); void GameUI_DrawMinimap(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW, unsigned int uZoom, unsigned int bRedrawOdmMinimap);