Mercurial > mm7
changeset 1021:67e33708d815
player use item continue cleanup
author | Gloval |
---|---|
date | Tue, 21 May 2013 08:53:43 +0400 |
parents | 3413ad40cc88 |
children | 83be083ab25e |
files | Player.cpp Player.h mm7_2.cpp mm7_data.h |
diffstat | 4 files changed, 839 insertions(+), 753 deletions(-) [+] |
line wrap: on
line diff
--- a/Player.cpp Tue May 21 07:24:49 2013 +0400 +++ b/Player.cpp Tue May 21 08:53:43 2013 +0400 @@ -5416,7 +5416,8 @@ { if ( v9 <= 2 ) { - v5 = pItemsTable->pItems[this->pInventoryItems[this->pEquipment.uMainHand].uItemID].uDamageDice + pItemsTable->pItems[this->pInventoryItems[this->pEquipment.uMainHand].uItemID].uDamageMod; + v5 = pItemsTable->pItems[this->pInventoryItems[this->pEquipment.uMainHand].uItemID].uDamageDice + + pItemsTable->pItems[this->pInventoryItems[this->pEquipment.uMainHand].uItemID].uDamageMod; if ( !v6->pEquipment.uShield ) { if ( pItemsTable->pItems[this->pInventoryItems[this->pEquipment.uMainHand].uItemID].uSkillType == 4 ) @@ -6316,12 +6317,9 @@ } //----- (004901FC) -------------------------------------------------------- -int Player::SetSexByVoice() -{ - __int64 v1; // qax@1 - - v1 = this->uVoiceID; - switch ( (int)v1 ) +void Player::SetSexByVoice() + { + switch ( this->uVoiceID) { case 0: case 1: @@ -6335,7 +6333,7 @@ case 0x11: case 0x14: case 0x17: - BYTE4(v1) = 0; + this->uSex = SEX_MALE; break; case 4: case 5: @@ -6349,13 +6347,12 @@ case 0x13: case 0x15: case 0x18: - BYTE4(v1) = 1; + this->uSex = SEX_FEMALE; break; default: break; } - this->uSex = (PLAYER_SEX)BYTE4(v1); - return v1; + } //----- (0049024A) -------------------------------------------------------- @@ -6837,770 +6834,854 @@ //----- (004680ED) -------------------------------------------------------- void Player::UseItem_DrinkPotion_etc(signed int player_num, int a3) -{ - Player *v3; // esi@1 - unsigned int v4; // ebx@4 - signed int v5; // eax@17 - unsigned int v6; // eax@26 - unsigned __int8 v7; // cf@37 - int v8; // edx@39 - int v9; // edx@40 - int v10; // edx@41 - int v11; // edx@42 - int v12; // edx@43 - char *v13; // eax@45 - AudioPlayer *v14; // ecx@62 - signed int v15; // edi@68 - int v16; // edx@73 - unsigned __int16 *v17; // edi@73 - unsigned int v18; // eax@73 - int v19; // eax@74 - int v20; // eax@75 - signed int v21; // eax@81 - const char *v22; // eax@84 - char *v23; // ecx@90 - int scroll_id; // esi@96 - int v25; // eax@109 - int v26; // eax@113 - int new_mana_val; // edi@114 - signed __int64 v28; // qax@120 - char *v29; // ecx@120 - __int64 v30; // edi@137 - int v31; // ST30_4@137 - __int64 v32; // ST3C_4@137 - int v33; // ST40_4@137 - __int64 v34; // ST34_4@137 - int v35; // ST38_4@137 - unsigned __int8 v36; // al@173 - SoundID v37; // [sp-20h] [bp-4Ch]@18 - SoundID v38; // [sp-20h] [bp-4Ch]@174 - signed int v39; // [sp-1Ch] [bp-48h]@18 - signed int v40; // [sp-1Ch] [bp-48h]@174 - unsigned int v41; // [sp-18h] [bp-44h]@18 - unsigned int v42; // [sp-18h] [bp-44h]@174 - signed int v43; // [sp-14h] [bp-40h]@18 - signed int v44; // [sp-14h] [bp-40h]@174 - signed int v45; // [sp-10h] [bp-3Ch]@18 - unsigned __int16 v46; // [sp-10h] [bp-3Ch]@120 - signed int v47; // [sp-10h] [bp-3Ch]@174 - int v48; // [sp-Ch] [bp-38h]@18 - unsigned int v49; // [sp-Ch] [bp-38h]@33 - unsigned __int16 v50; // [sp-Ch] [bp-38h]@120 - int v51; // [sp-Ch] [bp-38h]@174 - unsigned int v52; // [sp-8h] [bp-34h]@18 - char *v53; // [sp-8h] [bp-34h]@33 - int v54; // [sp-8h] [bp-34h]@34 - unsigned int v55; // [sp-8h] [bp-34h]@60 - int v56; // [sp-8h] [bp-34h]@66 - const char *v57; // [sp-8h] [bp-34h]@69 - const char *v58; // [sp-8h] [bp-34h]@89 - int v59; // [sp-8h] [bp-34h]@120 - unsigned int v60; // [sp-8h] [bp-34h]@174 - int v61; // [sp-4h] [bp-30h]@18 - char *v62; // [sp-4h] [bp-30h]@33 - char *v63; // [sp-4h] [bp-30h]@34 - int v64; // [sp-4h] [bp-30h]@60 - int v65; // [sp-4h] [bp-30h]@66 - const char *v66; // [sp-4h] [bp-30h]@69 - signed int v67; // [sp-4h] [bp-30h]@77 - const char *v68; // [sp-4h] [bp-30h]@89 - int v69; // [sp-4h] [bp-30h]@110 - unsigned __int8 v70; // [sp-4h] [bp-30h]@120 - int v71; // [sp-4h] [bp-30h]@174 - char *v72; // [sp+20h] [bp-Ch]@68 - signed int v73; // [sp+24h] [bp-8h]@1 - char *v74; // [sp+24h] [bp-8h]@23 - int v75; // [sp+24h] [bp-8h]@73 - Player *thisb; // [sp+28h] [bp-4h]@1 - unsigned int thisa; // [sp+28h] [bp-4h]@22 - - thisb = this; - v3 = &pParty->pPlayers[player_num-1]; - v73 = 1; - if ( pParty->bTurnBasedModeOn == 1 && (pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 3) ) - return; - v4 = 0; - if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType == EQUIP_REAGENT ) - { - if ( pParty->pPickedItem.uItemID != 160 ) - { - if ( pParty->pPickedItem.uItemID == 161 ) - { - new_mana_val = v3->sMana; - new_mana_val += 2; - - if ( new_mana_val > v3->GetMaxMana() ) - new_mana_val = v3->GetMaxMana(); - } - else - { - if ( pParty->pPickedItem.uItemID != 162 ) + { + Player *v3; // esi@1 + unsigned int v4; // ebx@4 + signed int v5; // eax@17 + unsigned int v6; // eax@26 + unsigned __int8 v7; // cf@37 + int v8; // edx@39 + int v9; // edx@40 + int v10; // edx@41 + int v11; // edx@42 + int v12; // edx@43 + char *v13; // eax@45 + AudioPlayer *v14; // ecx@62 + signed int v15; // edi@68 + int v16; // edx@73 + unsigned __int16 v17; // edi@73 + unsigned int v18; // eax@73 + int v19; // eax@74 + int v20; // eax@75 + signed int v21; // eax@81 + const char *v22; // eax@84 + char *v23; // ecx@90 + int scroll_id; // esi@96 + int v25; // eax@109 + int v26; // eax@113 + int new_mana_val; // edi@114 + signed __int64 v28; // qax@120 + char *v29; // ecx@120 + __int64 v30; // edi@137 + int v31; // ST30_4@137 + __int64 v32; // ST3C_4@137 + int v33; // ST40_4@137 + __int64 v34; // ST34_4@137 + int v35; // ST38_4@137 + unsigned __int8 v36; // al@173 + SoundID v37; // [sp-20h] [bp-4Ch]@18 + SoundID v38; // [sp-20h] [bp-4Ch]@174 + signed int v39; // [sp-1Ch] [bp-48h]@18 + signed int v40; // [sp-1Ch] [bp-48h]@174 + unsigned int v41; // [sp-18h] [bp-44h]@18 + unsigned int v42; // [sp-18h] [bp-44h]@174 + signed int v43; // [sp-14h] [bp-40h]@18 + signed int v44; // [sp-14h] [bp-40h]@174 + signed int v45; // [sp-10h] [bp-3Ch]@18 + unsigned __int16 v46; // [sp-10h] [bp-3Ch]@120 + signed int v47; // [sp-10h] [bp-3Ch]@174 + int v48; // [sp-Ch] [bp-38h]@18 + unsigned int v49; // [sp-Ch] [bp-38h]@33 + unsigned __int16 v50; // [sp-Ch] [bp-38h]@120 + int v51; // [sp-Ch] [bp-38h]@174 + unsigned int v52; // [sp-8h] [bp-34h]@18 + char *v53; // [sp-8h] [bp-34h]@33 + int v54; // [sp-8h] [bp-34h]@34 + unsigned int v55; // [sp-8h] [bp-34h]@60 + int v56; // [sp-8h] [bp-34h]@66 + const char *v57; // [sp-8h] [bp-34h]@69 + const char *v58; // [sp-8h] [bp-34h]@89 + int v59; // [sp-8h] [bp-34h]@120 + unsigned int v60; // [sp-8h] [bp-34h]@174 + int v61; // [sp-4h] [bp-30h]@18 + char *v62; // [sp-4h] [bp-30h]@33 + char *v63; // [sp-4h] [bp-30h]@34 + int v64; // [sp-4h] [bp-30h]@60 + int v65; // [sp-4h] [bp-30h]@66 + const char *v66; // [sp-4h] [bp-30h]@69 + signed int v67; // [sp-4h] [bp-30h]@77 + const char *v68; // [sp-4h] [bp-30h]@89 + int v69; // [sp-4h] [bp-30h]@110 + unsigned __int8 v70; // [sp-4h] [bp-30h]@120 + int v71; // [sp-4h] [bp-30h]@174 + char v72; // [sp+20h] [bp-Ch]@68 + signed int v73; // [sp+24h] [bp-8h]@1 + char *v74; // [sp+24h] [bp-8h]@23 + int v75; // [sp+24h] [bp-8h]@73 + Player *thisb; // [sp+28h] [bp-4h]@1 + unsigned int thisa; // [sp+28h] [bp-4h]@22 + + thisb = this; + v3 = &pParty->pPlayers[player_num-1]; + v73 = 1; + if ( pParty->bTurnBasedModeOn == 1 && (pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 3) ) + return; + v4 = 0; + if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType == EQUIP_REAGENT ) { - - v68 = pParty->pPickedItem.GetDisplayName(); - v58 = pGlobalTXT_LocalizationStrings[36]; - goto LABEL_90; - } - v69 = 2; - - pParty->pPlayers[player_num-1].Heal(v69); - } - v3->PlaySound(SPEECH_36, 0); - goto LABEL_173; - } - pParty->pPlayers[player_num-1].SetCondition(Condition_Poison1, 1); - goto LABEL_173; - } - if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType == EQUIP_POTION ) - { - switch ( pParty->pPickedItem.uItemID ) - { - case 221: //Catalyst - pParty->pPlayers[player_num-1].SetCondition(Condition_Poison1, 1); - goto LABEL_173; - case 222: //Cure Wounds - v25 = pParty->pPickedItem.uEnchantmentType + 10; - pParty->pPlayers[player_num-1].Heal(v25); - v3->PlaySound(SPEECH_36, 0); - goto LABEL_173; - case 223: //Magic Potion - v26 = pParty->pPickedItem.uEnchantmentType + 10; - new_mana_val = v3->sMana; - new_mana_val += v26; - if ( new_mana_val > v3->GetMaxMana() ) - new_mana_val = v3->GetMaxMana(); - v3->PlaySound(SPEECH_36, 0); - goto LABEL_173; - case 224: //Cure Weakness - v3->pConditions[Condition_Weak] = 0i64; - v3->PlaySound(SPEECH_36, 0); - goto LABEL_173; - case 225: //Cure Disease - v3->pConditions[Condition_Disease3] = 0i64; - v3->pConditions[Condition_Disease2] = 0i64; - v3->pConditions[Condition_Disease1] = 0i64; - v3->PlaySound(SPEECH_36, 0); - goto LABEL_173; - case 226: //Cure Poison - v3->pConditions[Condition_Poison3] = 0i64; - v3->pConditions[Condition_Poison2] = 0i64; - v3->pConditions[Condition_Poison1] = 0i64; - v3->PlaySound(SPEECH_36, 0); - goto LABEL_173; - case 227: //Awaken - v3->pConditions[Condition_Sleep] = 0i64; - v3->PlaySound(SPEECH_36, 0); - goto LABEL_173; - case 228: //Haste - if ( !v3->pConditions[Condition_Weak] ) + if ( pParty->pPickedItem.uItemID == 160 ) + { + pParty->pPlayers[player_num-1].SetCondition(Condition_Poison1, 1); + } + else if ( pParty->pPickedItem.uItemID == 161 ) { - v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); - v3->pPlayerBuffs[7].Apply(pParty->uTimePlayed + v28, 3, 5, 0, 0); + new_mana_val = v3->sMana; + new_mana_val += 2; + if ( new_mana_val > v3->GetMaxMana() ) + new_mana_val = v3->GetMaxMana(); + v3->PlaySound(SPEECH_36, 0); + } + else if ( pParty->pPickedItem.uItemID == 162 ) + { + pParty->pPlayers[player_num-1].Heal(2); v3->PlaySound(SPEECH_36, 0); + + } + else + { + v68 = pParty->pPickedItem.GetDisplayName(); + v58 = pGlobalTXT_LocalizationStrings[36];//"%s can not be used that way" + sprintfex(pTmpBuf, v58, v68); + ShowStatusBarString(pTmpBuf, 2); + pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); + return; } goto LABEL_173; - case 229: //Heroism - v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); - v3->pPlayerBuffs[8].Apply(pParty->uTimePlayed + v28, 3, 5, 0, 0); - v3->PlaySound(SPEECH_36, 0); - goto LABEL_173; - case 230: //Bless - v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); - v3->pPlayerBuffs[1].Apply(pParty->uTimePlayed + v28, 3, 5, 0, 0); - v3->PlaySound(SPEECH_36, 0); - goto LABEL_173; - case 231: //Preservation - v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); - v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); - v3->pPlayerBuffs[11].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); - v3->PlaySound(SPEECH_36, 0); - goto LABEL_173; - case 232: //Shield - v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); - v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); - v3->pPlayerBuffs[13].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); - v3->PlaySound(SPEECH_36, 0); - goto LABEL_173; - case 234: //Stoneskin - v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); - v3->pPlayerBuffs[14].Apply(pParty->uTimePlayed + v28, 3, 5, 0, 0); - v3->PlaySound(SPEECH_36, 0); - goto LABEL_173; - case 235: //Water Breathing - v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335), - v3->pPlayerBuffs[23].Apply(pParty->uTimePlayed +v28, 3, 5, 0, 0); - goto LABEL_173; - case 237: //Remove Fear - v3->pConditions[Condition_Fear] = 0i64; - v3->PlaySound(SPEECH_36, 0); - goto LABEL_173; - case 238: //Remove Curse - v3->pConditions[Condition_Cursed] = 0i64; - v3->PlaySound(SPEECH_36, 0); - goto LABEL_173; - case 239: //Cure Insanity - v3->pConditions[Condition_Insane] = 0i64; - v3->PlaySound(SPEECH_36, 0); - goto LABEL_173; - case 240: //Might Boost - v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); - v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); - v3->pPlayerBuffs[19].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); - v3->PlaySound(SPEECH_36, 0); - goto LABEL_173; - case 241: //Intellect Boost - v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); - v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); - v3->pPlayerBuffs[17].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); - v3->PlaySound(SPEECH_36, 0); - goto LABEL_173; - case 242: //Personality Boost - v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); - v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); - v3->pPlayerBuffs[20].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); - v3->PlaySound(SPEECH_36, 0); - goto LABEL_173; - case 243://Endurance Boost - v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); - v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); - v3->pPlayerBuffs[16].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); - v3->PlaySound(SPEECH_36, 0); - goto LABEL_173; - case 244: //Speed Boost - v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); - v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); - v3->pPlayerBuffs[21].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); - v3->PlaySound(SPEECH_36, 0); - goto LABEL_173; - case 245: //Accuracy Boost - v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); - v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); - v3->pPlayerBuffs[15].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); - v3->PlaySound(SPEECH_36, 0); - goto LABEL_173; - case 251: //Cure Paralysis - v3->pConditions[Condition_Paralyzed] = 0i64; - v3->PlaySound(SPEECH_36, 0); - goto LABEL_173; - case 252://Divine Restoration - v30 = v3->pConditions[Condition_Dead]; - v32 = v3->pConditions[Condition_Pertified]; - v34 = v3->pConditions[Condition_Eradicated]; - memset(&pParty->pPlayers[player_num-1].pConditions,0,sizeof(pConditions)); - v3->pConditions[Condition_Dead] = v30; - v3->pConditions[Condition_Pertified] = v32; - v3->pConditions[Condition_Eradicated] = v34; - v3->PlaySound(SPEECH_36, 0); - goto LABEL_173; - case 253: //Divine Cure - v25 = 5 * pParty->pPickedItem.uEnchantmentType; - pParty->pPlayers[player_num-1].Heal(v25); - v3->PlaySound(SPEECH_36, 0); - goto LABEL_173; - case 254: //Divine Power - v26 = 5 * pParty->pPickedItem.uEnchantmentType; - new_mana_val = v3->sMana; - new_mana_val += v26; - if ( new_mana_val > v3->GetMaxMana() ) - new_mana_val = v3->GetMaxMana(); - v3->PlaySound(SPEECH_36, 0); - goto LABEL_173; - case 255: //Luck Boost - v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); - v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); - v3->pPlayerBuffs[18].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); - v3->PlaySound(SPEECH_36, 0); - goto LABEL_173; - case 256: //Fire Resistance - v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); - v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); - v3->pPlayerBuffs[5].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); - v3->PlaySound(SPEECH_36, 0); - goto LABEL_173; - case 257: //Air Resistance - v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); - v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); - v3->pPlayerBuffs[0].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); - v3->PlaySound(SPEECH_36, 0); - goto LABEL_173; - case 258: //Water Resistance - v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); - v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); - v3->pPlayerBuffs[22].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); - v3->PlaySound(SPEECH_36, 0); - goto LABEL_173; - case 259: //Earth Resistance - v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); - v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); - v3->pPlayerBuffs[3].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); - v3->PlaySound(SPEECH_36, 0); - goto LABEL_173; - case 260: //Mind Resistance - v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); - v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); - v3->pPlayerBuffs[9].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); - v3->PlaySound(SPEECH_36, 0); - goto LABEL_173; - case 261: //Body Resistance - v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); - v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); - v3->pPlayerBuffs[2].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); - v3->PlaySound(SPEECH_36, 0); - goto LABEL_173; - case 262: //Stone to Flesh - v3->pConditions[Condition_Pertified] = 0i64; - v3->PlaySound(SPEECH_36, 0); - goto LABEL_173; - case 264: //Pure Luck - if ( !v3->pure_luck_used ) + + } + if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType == EQUIP_POTION ) { - v3->uLuck += 50; - v3->pure_luck_used = 1; - } - v3->PlaySound(SPEECH_36, 0); - goto LABEL_173; - case 265: //Pure Speed - if ( !v3->pure_speed_used ) - { - v3->uSpeed += 50; - v3->pure_speed_used = 1; - } - v3->PlaySound(SPEECH_36, 0); - goto LABEL_173; - case 266: //Pure Intellect - if ( !v3->pure_intellect_used ) - { - v3->uIntelligence += 50; - v3->pure_intellect_used = 1; - } - v3->PlaySound(SPEECH_36, 0); - goto LABEL_173; - case 267: //Pure Endurance - if ( !v3->pure_endurance_used ) - { - v3->uEndurance += 50; - v3->pure_endurance_used = 1; - } - v3->PlaySound(SPEECH_36, 0); - goto LABEL_173; - case 268: //Pure Personality - if ( !v3->pure_willpower_used ) - { - v3->uWillpower += 50; - v3->pure_willpower_used = 1; - } - v3->PlaySound(SPEECH_36, 0); - goto LABEL_173; - case 269: //Pure Accuracy - if ( !v3->pure_accuracy_used ) - { - v3->uAccuracy += 50; - v3->pure_accuracy_used = 1; - } - v3->PlaySound(SPEECH_36, 0); - goto LABEL_173; - case 270: //Pure Might - if ( !v3->pure_might_used ) - { - v3->uMight += 50; - v3->pure_might_used = 1; - } - v3->PlaySound(SPEECH_36, 0); + switch ( pParty->pPickedItem.uItemID ) + { + case 221: //Catalyst + pParty->pPlayers[player_num-1].SetCondition(Condition_Poison1, 1); + break; + case 222: //Cure Wounds + v25 = pParty->pPickedItem.uEnchantmentType + 10; + pParty->pPlayers[player_num-1].Heal(v25); + v3->PlaySound(SPEECH_36, 0); + break; + case 223: //Magic Potion + v26 = pParty->pPickedItem.uEnchantmentType + 10; + new_mana_val = v3->sMana; + new_mana_val += v26; + if ( new_mana_val > v3->GetMaxMana() ) + new_mana_val = v3->GetMaxMana(); + v3->PlaySound(SPEECH_36, 0); + break; + case 224: //Cure Weakness + v3->pConditions[Condition_Weak] = 0i64; + v3->PlaySound(SPEECH_36, 0); + break; + case 225: //Cure Disease + v3->pConditions[Condition_Disease3] = 0i64; + v3->pConditions[Condition_Disease2] = 0i64; + v3->pConditions[Condition_Disease1] = 0i64; + v3->PlaySound(SPEECH_36, 0); + break; + case 226: //Cure Poison + v3->pConditions[Condition_Poison3] = 0i64; + v3->pConditions[Condition_Poison2] = 0i64; + v3->pConditions[Condition_Poison1] = 0i64; + v3->PlaySound(SPEECH_36, 0); + break; + case 227: //Awaken + v3->pConditions[Condition_Sleep] = 0i64; + v3->PlaySound(SPEECH_36, 0); + break; + case 228: //Haste + if ( !v3->pConditions[Condition_Weak] ) + { + v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); + v3->pPlayerBuffs[7].Apply(pParty->uTimePlayed + v28, 3, 5, 0, 0); + v3->PlaySound(SPEECH_36, 0); + } + break; + case 229: //Heroism + v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); + v3->pPlayerBuffs[8].Apply(pParty->uTimePlayed + v28, 3, 5, 0, 0); + v3->PlaySound(SPEECH_36, 0); + break; + case 230: //Bless + v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); + v3->pPlayerBuffs[1].Apply(pParty->uTimePlayed + v28, 3, 5, 0, 0); + v3->PlaySound(SPEECH_36, 0); + break; + case 231: //Preservation + v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); + v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); + v3->pPlayerBuffs[11].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); + v3->PlaySound(SPEECH_36, 0); + break; + case 232: //Shield + v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); + v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); + v3->pPlayerBuffs[13].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); + v3->PlaySound(SPEECH_36, 0); + break; + case 234: //Stoneskin + v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); + v3->pPlayerBuffs[14].Apply(pParty->uTimePlayed + v28, 3, 5, 0, 0); + v3->PlaySound(SPEECH_36, 0); + break; + case 235: //Water Breathing + v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335), + v3->pPlayerBuffs[23].Apply(pParty->uTimePlayed +v28, 3, 5, 0, 0); + break; + case 237: //Remove Fear + v3->pConditions[Condition_Fear] = 0i64; + v3->PlaySound(SPEECH_36, 0); + break; + case 238: //Remove Curse + v3->pConditions[Condition_Cursed] = 0i64; + v3->PlaySound(SPEECH_36, 0); + break; + case 239: //Cure Insanity + v3->pConditions[Condition_Insane] = 0i64; + v3->PlaySound(SPEECH_36, 0); + break; + case 240: //Might Boost + v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); + v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); + v3->pPlayerBuffs[19].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); + v3->PlaySound(SPEECH_36, 0); + break; + case 241: //Intellect Boost + v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); + v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); + v3->pPlayerBuffs[17].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); + v3->PlaySound(SPEECH_36, 0); + break; + case 242: //Personality Boost + v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); + v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); + v3->pPlayerBuffs[20].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); + v3->PlaySound(SPEECH_36, 0); + break; + case 243://Endurance Boost + v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); + v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); + v3->pPlayerBuffs[16].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); + v3->PlaySound(SPEECH_36, 0); + break; + case 244: //Speed Boost + v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); + v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); + v3->pPlayerBuffs[21].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); + v3->PlaySound(SPEECH_36, 0); + break; + case 245: //Accuracy Boost + v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); + v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); + v3->pPlayerBuffs[15].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); + v3->PlaySound(SPEECH_36, 0); + break; + case 251: //Cure Paralysis + v3->pConditions[Condition_Paralyzed] = 0i64; + v3->PlaySound(SPEECH_36, 0); + break; + case 252://Divine Restoration + v30 = v3->pConditions[Condition_Dead]; + v32 = v3->pConditions[Condition_Pertified]; + v34 = v3->pConditions[Condition_Eradicated]; + memset(&pParty->pPlayers[player_num-1].pConditions,0,sizeof(pConditions)); + v3->pConditions[Condition_Dead] = v30; + v3->pConditions[Condition_Pertified] = v32; + v3->pConditions[Condition_Eradicated] = v34; + v3->PlaySound(SPEECH_36, 0); + break; + case 253: //Divine Cure + v25 = 5 * pParty->pPickedItem.uEnchantmentType; + pParty->pPlayers[player_num-1].Heal(v25); + v3->PlaySound(SPEECH_36, 0); + break; + case 254: //Divine Power + v26 = 5 * pParty->pPickedItem.uEnchantmentType; + new_mana_val = v3->sMana; + new_mana_val += v26; + if ( new_mana_val > v3->GetMaxMana() ) + new_mana_val = v3->GetMaxMana(); + v3->PlaySound(SPEECH_36, 0); + break; + case 255: //Luck Boost + v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); + v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); + v3->pPlayerBuffs[18].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); + v3->PlaySound(SPEECH_36, 0); + break; + case 256: //Fire Resistance + v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); + v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); + v3->pPlayerBuffs[5].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); + v3->PlaySound(SPEECH_36, 0); + goto LABEL_173; + case 257: //Air Resistance + v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); + v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); + v3->pPlayerBuffs[0].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); + v3->PlaySound(SPEECH_36, 0); + break; + case 258: //Water Resistance + v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); + v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); + v3->pPlayerBuffs[22].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); + v3->PlaySound(SPEECH_36, 0); + break; + case 259: //Earth Resistance + v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); + v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); + v3->pPlayerBuffs[3].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); + v3->PlaySound(SPEECH_36, 0); + break; + case 260: //Mind Resistance + v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); + v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); + v3->pPlayerBuffs[9].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); + v3->PlaySound(SPEECH_36, 0); + break; + case 261: //Body Resistance + v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); + v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); + v3->pPlayerBuffs[2].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); + v3->PlaySound(SPEECH_36, 0); + break; + case 262: //Stone to Flesh + v3->pConditions[Condition_Pertified] = 0i64; + v3->PlaySound(SPEECH_36, 0); + break; + case 264: //Pure Luck + if ( !v3->pure_luck_used ) + { + v3->uLuck += 50; + v3->pure_luck_used = 1; + } + v3->PlaySound(SPEECH_36, 0); + break; + case 265: //Pure Speed + if ( !v3->pure_speed_used ) + { + v3->uSpeed += 50; + v3->pure_speed_used = 1; + } + v3->PlaySound(SPEECH_36, 0); + break; + case 266: //Pure Intellect + if ( !v3->pure_intellect_used ) + { + v3->uIntelligence += 50; + v3->pure_intellect_used = 1; + } + v3->PlaySound(SPEECH_36, 0); + break; + case 267: //Pure Endurance + if ( !v3->pure_endurance_used ) + { + v3->uEndurance += 50; + v3->pure_endurance_used = 1; + } + v3->PlaySound(SPEECH_36, 0); + break; + case 268: //Pure Personality + if ( !v3->pure_willpower_used ) + { + v3->uWillpower += 50; + v3->pure_willpower_used = 1; + } + v3->PlaySound(SPEECH_36, 0); + break; + case 269: //Pure Accuracy + if ( !v3->pure_accuracy_used ) + { + v3->uAccuracy += 50; + v3->pure_accuracy_used = 1; + } + v3->PlaySound(SPEECH_36, 0); + break; + case 270: //Pure Might + if ( !v3->pure_might_used ) + { + v3->uMight += 50; + v3->pure_might_used = 1; + } + v3->PlaySound(SPEECH_36, 0); + break; + case 271: //Rejuvenation + v3->sAgeModifier = 0; + v3->PlaySound(SPEECH_36, 0); + break; + + default: + v68 = pParty->pPickedItem.GetDisplayName(); + v58 = pGlobalTXT_LocalizationStrings[36]; //"%s can not be used that way" + sprintfex(pTmpBuf, v58, v68); + ShowStatusBarString(pTmpBuf, 2u); + pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); + return; + + } + // pParty->pPlayers[player_num-1].SetCondition(Condition_Poison1, 1); goto LABEL_173; - case 271: //Rejuvenation - v3->sAgeModifier = 0; - v3->PlaySound(SPEECH_36, 0); - goto LABEL_173; - - default: - v68 = pParty->pPickedItem.GetDisplayName(); - v58 = pGlobalTXT_LocalizationStrings[36]; //"%s can not be used that way" - sprintfex(pTmpBuf, v58, v68); - ShowStatusBarString(pTmpBuf, 2u); - pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); - return; - - } - pParty->pPlayers[player_num-1].SetCondition(Condition_Poison1, 1); - goto LABEL_173; - } - - - if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType != EQUIP_SPELL_SCROLL ) - { - if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType != EQUIP_BOOK ) - { - if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType != EQUIP_MESSAGE_SCROLL ) - { + } + + + if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType == EQUIP_SPELL_SCROLL ) + { + + + if ( pCurrentScreen == SCREEN_CASTING ) + return; + if ( !pParty->pPlayers[player_num-1].CanAct() ) + { + + + v68 = aCharacterConditionNames[v3->GetMajorConditionIdx()]; + v58 = pGlobalTXT_LocalizationStrings[382]; + sprintfex(pTmpBuf, v58, v68); + v23 = pTmpBuf; + + ShowStatusBarString(v23, 2u); + v4 = 0; + v61 = v4; + v52 = v4; + v48 = v4; + v45 = v4; + v43 = -1; + v41 = v4; + v39 = v4; + v37 = (SoundID)27; + pAudioPlayer->PlaySound(v37, v39, v41, v43, v45, v48, v52, v61); + return; + } + if ( bUnderwater == 1 ) + { + v23 = pGlobalTXT_LocalizationStrings[652]; //"You can not do that while you are underwater!" + ShowStatusBarString(v23, 2u); + v4 = 0; + v61 = v4; + v52 = v4; + v48 = v4; + v45 = v4; + v43 = -1; + v41 = v4; + v39 = v4; + v37 = (SoundID)27; + pAudioPlayer->PlaySound(v37, v39, v41, v43, v45, v48, v52, v61); + return; + } + dword_50C9AC = 1; + scroll_id = pParty->pPickedItem.uItemID - 299; + if ( scroll_id == 30 || scroll_id == 4 || scroll_id == 91 || scroll_id == 28 ) //Enchant Item scroll, Vampiric Weapon scroll ,Recharge Item ,Fire Aura + { + pMouse->RemoveHoldingItem(); + pGUIWindow_CurrentMenu->Release(); + pIcons_LOD->_4114F2(); + pCurrentScreen = SCREEN_GAME; + viewparams->bRedrawGameUI = 1; + _42777D_CastSpell_UseWand_ShootArrow(scroll_id, player_num - 1, 0x85u, 1, 0); + } + else + { + _720984_unused = pParty->pPickedItem.uItemID; + pMouse->RemoveHoldingItem(); + pMessageQueue_50C9E8->AddMessage(UIMSG_SpellScrollUse, scroll_id, player_num - 1); + if ( pCurrentScreen && pGUIWindow_CurrentMenu + && (pGUIWindow_CurrentMenu->eWindowType != WINDOW_null)) + { + pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); + } + } + return; + } + + if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType == EQUIP_BOOK ) + + { + v15 = pParty->pPickedItem.uItemID - 400; + v72 = v3->spellbook.bHaveSpell[pParty->pPickedItem.uItemID-400];//(char *)&v3->pConditions[0] + pParty->pPickedItem.uItemID + 2; + if ( v72 ) + { + v66 = pParty->pPickedItem.GetDisplayName(); + v57 = pGlobalTXT_LocalizationStrings[380];//"You already know the %s spell" +LABEL_72: + sprintf(pTmpBuf, v57, v66); + ShowStatusBarString(pTmpBuf, 2u); +LABEL_92: + v61 = v4; + v52 = v4; + v48 = v4; + v45 = v4; + v43 = -1; + v41 = v4; + v39 = v4; + v37 = (SoundID)27; +LABEL_93: + v14 = pAudioPlayer; +LABEL_63: + pAudioPlayer->PlaySound(v37, v39, v41, v43, v45, v48, v52, v61); + return; + } + if ( !pParty->pPlayers[player_num-1].CanAct() ) + { + v66 = aCharacterConditionNames[v3->GetMajorConditionIdx()]; + v57 = pGlobalTXT_LocalizationStrings[382];//"That player is %s" + sprintf(pTmpBuf, v57, v66); + ShowStatusBarString(pTmpBuf, 2u); + v61 = v4; + v52 = v4; + v48 = v4; + v45 = v4; + v43 = -1; + v41 = v4; + v39 = v4; + v37 = (SoundID)27; + v14 = pAudioPlayer; + pAudioPlayer->PlaySound(v37, v39, v41, v43, v45, v48, v52, v61); + return; + } + v16 = v15 % 11 + 1; + v17 = v3->pActiveSkills[v15 / 11 + 12]; + v75 = v16; + v18 = SkillToMastery(v17) - 1; + if ( v18 ) + { + v19 = v18 - 1; + if ( v19 ) + { + v20 = v19 - 1; + if ( v20 ) + { + if ( v20 != 1 ) + { + v21 = player_num; +LABEL_83: + if ( v75 > v21 || !v17 ) + { + v22 = pParty->pPickedItem.GetDisplayName(); + sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[381], v22); + ShowStatusBarString(pTmpBuf, 2u); + v3->PlaySound((PlayerSpeech)20, 0); + return; + } + v72 = 1; + v3->PlaySound(SPEECH_21, 0); + v73 = 0; +LABEL_173: + v36 = pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType; + if ( v36 == EQUIP_POTION ) + { + v71 = 0; + v60 = 0; + v51 = 0; + v47 = 0; + v44 = -1; + v42 = 0; + v40 = 0; + v38 = (SoundID)210; + } + else + { + if ( v36 != EQUIP_REAGENT ) + { +LABEL_178: + if ( pGUIWindow_CurrentMenu && pGUIWindow_CurrentMenu->eWindowType != WINDOW_null) + { + if ( !v73 ) + { + pMouse->RemoveHoldingItem(); + return; + } + pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); + } + if ( v73 ) + { + if ( pParty->bTurnBasedModeOn ) + { + *(&pParty->field_16140 + player_num) = 100; + thisb->SetRecoveryTime(100); + pTurnEngine->_40471C(); + } + else + { + thisb->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * 213.3333333333333)); + } + } + pMouse->RemoveHoldingItem(); + return; + } + v71 = 0; + v60 = 0; + v51 = 0; + v47 = 0; + v44 = -1; + v42 = 0; + v40 = 0; + v38 = (SoundID)211; + } + pAudioPlayer->PlaySound(v38, v40, v42, v44, v47, v51, v60, v71); + goto LABEL_178; + } + v67 = 11; + } + else + { + v67 = 10; + } + } + else + { + v67 = 7; + } + } + else + { + v67 = 4; + } + v21 = v67; + goto LABEL_83; + } + + if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType == EQUIP_MESSAGE_SCROLL ) + + { + if ( pParty->pPlayers[player_num-1].CanAct() ) + { + CreateMsgScrollWindow(pParty->pPickedItem.uItemID); + v65 = 0; + v56 = SPEECH_37; +LABEL_67: + v3->PlaySound((PlayerSpeech)v56, v65); + return; + } +LABEL_89: + v68 = aCharacterConditionNames[v3->GetMajorConditionIdx()]; + v58 = pGlobalTXT_LocalizationStrings[382]; +LABEL_90: + sprintfex(pTmpBuf, v58, v68); + v23 = pTmpBuf; +LABEL_91: + ShowStatusBarString(v23, 2u); + v4 = 0; + v61 = v4; + v52 = v4; + v48 = v4; + v45 = v4; + v43 = -1; + v41 = v4; + v39 = v4; + v37 = (SoundID)27; + pAudioPlayer->PlaySound(v37, v39, v41, v43, v45, v48, v52, v61); + return; + } + else + { if ( pParty->pPickedItem.uItemID == 616 ) //Genie Lamp - { - thisa = pParty->uCurrentMonthWeek + 1; - if ( pParty->uCurrentMonth >= 7 ) - v74 = 0; - else - v74 = aAttributeNames[pParty->uCurrentMonth]; - switch ( pParty->uCurrentMonth ) - { + { + thisa = pParty->uCurrentMonthWeek + 1; + if ( pParty->uCurrentMonth >= 7 ) + v74 = 0; + else + v74 = aAttributeNames[pParty->uCurrentMonth]; + switch ( pParty->uCurrentMonth ) + { case 0: - v6 = pParty->uCurrentMonthWeek + 1; - v3->uMight += thisa; - v62 = pGlobalTXT_LocalizationStrings[121]; //"Permanent" - v53 = v74; - v49 = v6; - sprintf(pTmpBuf, "+%u %s %s", v49, v53, v62); - break; + v6 = pParty->uCurrentMonthWeek + 1; + v3->uMight += thisa; + v62 = pGlobalTXT_LocalizationStrings[121]; //"Permanent" + v53 = v74; + v49 = v6; + sprintf(pTmpBuf, "+%u %s %s", v49, v53, v62); + break; case 1: - v6 = pParty->uCurrentMonthWeek + 1; - v3->uIntelligence += thisa; - v62 = pGlobalTXT_LocalizationStrings[121]; - v53 = v74; - v49 = v6; - sprintf(pTmpBuf, "+%u %s %s", v49, v53, v62); - break; + v6 = pParty->uCurrentMonthWeek + 1; + v3->uIntelligence += thisa; + v62 = pGlobalTXT_LocalizationStrings[121]; + v53 = v74; + v49 = v6; + sprintf(pTmpBuf, "+%u %s %s", v49, v53, v62); + break; case 2: - v6 = pParty->uCurrentMonthWeek + 1; - v3->uWillpower += thisa; - v62 = pGlobalTXT_LocalizationStrings[121]; - v53 = v74; - v49 = v6; - sprintf(pTmpBuf, "+%u %s %s", v49, v53, v62); - break; + v6 = pParty->uCurrentMonthWeek + 1; + v3->uWillpower += thisa; + v62 = pGlobalTXT_LocalizationStrings[121]; + v53 = v74; + v49 = v6; + sprintf(pTmpBuf, "+%u %s %s", v49, v53, v62); + break; case 3: - v6 = pParty->uCurrentMonthWeek + 1; - v3->uEndurance += thisa; - v62 = pGlobalTXT_LocalizationStrings[121]; - v53 = v74; - v49 = v6; - sprintf(pTmpBuf, "+%u %s %s", v49, v53, v62); - break; + v6 = pParty->uCurrentMonthWeek + 1; + v3->uEndurance += thisa; + v62 = pGlobalTXT_LocalizationStrings[121]; + v53 = v74; + v49 = v6; + sprintf(pTmpBuf, "+%u %s %s", v49, v53, v62); + break; case 4: - v6 = pParty->uCurrentMonthWeek + 1; - v3->uAccuracy += thisa; - v62 = pGlobalTXT_LocalizationStrings[121]; - v53 = v74; - v49 = v6; - sprintf(pTmpBuf, "+%u %s %s", v49, v53, v62); - break; + v6 = pParty->uCurrentMonthWeek + 1; + v3->uAccuracy += thisa; + v62 = pGlobalTXT_LocalizationStrings[121]; + v53 = v74; + v49 = v6; + sprintf(pTmpBuf, "+%u %s %s", v49, v53, v62); + break; case 5: - v6 = pParty->uCurrentMonthWeek + 1; - v3->uSpeed += thisa; - v62 = pGlobalTXT_LocalizationStrings[121]; - v53 = v74; - v49 = v6; - sprintf(pTmpBuf, "+%u %s %s", v49, v53, v62); - break; + v6 = pParty->uCurrentMonthWeek + 1; + v3->uSpeed += thisa; + v62 = pGlobalTXT_LocalizationStrings[121]; + v53 = v74; + v49 = v6; + sprintf(pTmpBuf, "+%u %s %s", v49, v53, v62); + break; case 6: - v6 = pParty->uCurrentMonthWeek + 1; - v3->uLuck += thisa; - v62 = pGlobalTXT_LocalizationStrings[121]; - v53 = v74; - v49 = v6; - sprintf(pTmpBuf, "+%u %s %s", v49, v53, v62); - break; + v6 = pParty->uCurrentMonthWeek + 1; + v3->uLuck += thisa; + v62 = pGlobalTXT_LocalizationStrings[121]; + v53 = v74; + v49 = v6; + sprintf(pTmpBuf, "+%u %s %s", v49, v53, v62); + break; case 7: - party_finds_gold(1000 * thisa, 0); - v63 = pGlobalTXT_LocalizationStrings[97];//"Gold" - v54 = 1000 * thisa; - sprintf(pTmpBuf, "+%u %s", v54, v63); - break; + party_finds_gold(1000 * thisa, 0); + v63 = pGlobalTXT_LocalizationStrings[97];//"Gold" + v54 = 1000 * thisa; + sprintf(pTmpBuf, "+%u %s", v54, v63); + break; case 8: - Party::GiveFood(5 * thisa); - v63 = pGlobalTXT_LocalizationStrings[653]; //"Food" - v54 = 5 * thisa; - sprintf(pTmpBuf, "+%u %s", v54, v63); - break; + Party::GiveFood(5 * thisa); + v63 = pGlobalTXT_LocalizationStrings[653]; //"Food" + v54 = 5 * thisa; + sprintf(pTmpBuf, "+%u %s", v54, v63); + break; case 9u: - v63 = pGlobalTXT_LocalizationStrings[LOCSTR_SKILL_POINTS]; - v3->uSkillPoints += 2 * thisa; - v54 = 2 * thisa; - sprintf(pTmpBuf, "+%u %s", v54, v63); - break; + v63 = pGlobalTXT_LocalizationStrings[LOCSTR_SKILL_POINTS]; + v3->uSkillPoints += 2 * thisa; + v54 = 2 * thisa; + sprintf(pTmpBuf, "+%u %s", v54, v63); + break; case 10: - v63 = pGlobalTXT_LocalizationStrings[LOCSTR_EXPIRIENCE]; - v54 = 2500 * thisa; - v3->uExperience += 2500 * thisa; - sprintf(pTmpBuf, "+%u %s", v54, v63); - break; + v63 = pGlobalTXT_LocalizationStrings[LOCSTR_EXPIRIENCE]; + v54 = 2500 * thisa; + v3->uExperience += 2500 * thisa; + sprintf(pTmpBuf, "+%u %s", v54, v63); + break; case 11: - v8 = rand() % 6; - switch (v8) - { - case 0: - v3->sResFireBase += thisa; - v13 = pGlobalTXT_LocalizationStrings[87]; - break; - case 1: - v3->sResAirBase += thisa; - v13 = pGlobalTXT_LocalizationStrings[6]; - break; - case 2: - v3->sResWaterBase += thisa; - v13 = pGlobalTXT_LocalizationStrings[240]; - break; - case 3: - v3->sResEarthBase += thisa; - v13 = pGlobalTXT_LocalizationStrings[70]; + v8 = rand() % 6; + switch (v8) + { + case 0: + v3->sResFireBase += thisa; + v13 = pGlobalTXT_LocalizationStrings[87]; + break; + case 1: + v3->sResAirBase += thisa; + v13 = pGlobalTXT_LocalizationStrings[6]; + break; + case 2: + v3->sResWaterBase += thisa; + v13 = pGlobalTXT_LocalizationStrings[240]; + break; + case 3: + v3->sResEarthBase += thisa; + v13 = pGlobalTXT_LocalizationStrings[70]; + break; + case 4: + v3->sResMindBase += thisa; + v13 = pGlobalTXT_LocalizationStrings[142]; + break; + case 5: + v3->sResBodyBase += thisa; + v13 = pGlobalTXT_LocalizationStrings[29]; break; - case 4: - v3->sResMindBase += thisa; - v13 = pGlobalTXT_LocalizationStrings[142]; - break; - case 5: - v3->sResBodyBase += thisa; - v13 = pGlobalTXT_LocalizationStrings[29]; - break; - } - v62 = pGlobalTXT_LocalizationStrings[121]; - v53 = v13; - v49 = thisa; - sprintf(pTmpBuf, "+%u %s %s", v49, v53, v62); - break; - - } - ShowStatusBarString(pTmpBuf, 2u); - pMouse->RemoveHoldingItem(); - pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, player_num - 1); - v3->PlaySound(SPEECH_93, 0); - pAudioPlayer->PlaySound((SoundID)(SOUND_Bell|0x2), 0, 0, -1, 0, 0, 0, 0); - if ( pParty->uDaysPlayed == 6 || pParty->uDaysPlayed == 20 ) - { - v3->SetCondition(Condition_Eradicated, 0); - pAudioPlayer->PlaySound((SoundID)215, 0, 0, -1, 0, 0, 0, 0); - } - else if ( pParty->uDaysPlayed == 12 || pParty->uDaysPlayed == 26 ) + } + v62 = pGlobalTXT_LocalizationStrings[121]; + v53 = v13; + v49 = thisa; + sprintf(pTmpBuf, "+%u %s %s", v49, v53, v62); + break; + + } + ShowStatusBarString(pTmpBuf, 2u); + pMouse->RemoveHoldingItem(); + pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, player_num - 1); + v3->PlaySound(SPEECH_93, 0); + pAudioPlayer->PlaySound((SoundID)(SOUND_Bell|0x2), 0, 0, -1, 0, 0, 0, 0); + if ( pParty->uDaysPlayed == 6 || pParty->uDaysPlayed == 20 ) { - v3->SetCondition(Condition_Dead, 0); - pAudioPlayer->PlaySound((SoundID)215, 0, 0, -1, 0, 0, 0, 0); + v3->SetCondition(Condition_Eradicated, 0); + pAudioPlayer->PlaySound((SoundID)215, 0, 0, -1, 0, 0, 0, 0); } - else if ( pParty->uDaysPlayed == 4 || pParty->uDaysPlayed == 25 ) - { - v3->SetCondition(Condition_Pertified, 0); - pAudioPlayer->PlaySound((SoundID)215, 0, 0, -1, 0, 0, 0, 0); - } + else if ( pParty->uDaysPlayed == 12 || pParty->uDaysPlayed == 26 ) + { + v3->SetCondition(Condition_Dead, 0); + pAudioPlayer->PlaySound((SoundID)215, 0, 0, -1, 0, 0, 0, 0); + } + else if ( pParty->uDaysPlayed == 4 || pParty->uDaysPlayed == 25 ) + { + v3->SetCondition(Condition_Pertified, 0); + pAudioPlayer->PlaySound((SoundID)215, 0, 0, -1, 0, 0, 0, 0); + } return; - } - if ( pParty->pPickedItem.uItemID == 630 ) //Red Apple - { - Party::GiveFood(1u); - pAudioPlayer->PlaySound((SoundID)(SOUND_PlayerCantCastSpell|0x2), 0, 0, -1, 0, 0, 0, 0); - } + } + else if ( pParty->pPickedItem.uItemID == 630 ) //Red Apple + { + Party::GiveFood(1u); + pAudioPlayer->PlaySound((SoundID)(SOUND_PlayerCantCastSpell|0x2), 0, 0, -1, 0, 0, 0, 0); + + } + else if ( pParty->pPickedItem.uItemID == 632 ) //Lute + { + pAudioPlayer->PlaySound((SoundID)133, 0, 0, -1, 0, 0, 0, 0); + return; + } + else if ( pParty->pPickedItem.uItemID == 633 ) //Faerie Pipes + { + pAudioPlayer->PlaySound((SoundID)134, 0, 0, -1, 0, 0, 0, 0); + return; + } + else if ( pParty->pPickedItem.uItemID == 634 ) //Gryphonheart's Trumpet + { + pAudioPlayer->PlaySound((SoundID)135, 0, 0, -1, 0, 0, 0, 0); + return; + } + else if ( pParty->pPickedItem.uItemID == 646 ) + { + pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, player_num - 1); + v5 = 8 * player_num + 392; + LOBYTE(v5) = PID(OBJECT_Player,player_num - 120); + pAudioPlayer->PlaySound(SOUND_20001, v5, 0, -1, 0, 0, 0, 0); + v3->AddVariable(VAR_NumSkillPoints, 2); + } + else if ( pParty->pPickedItem.uItemID == 650 ) //Temple in a Bottle + { + sub_44C28F_open_nwc_dungeon(); + return; + } else - { - if ( pParty->pPickedItem.uItemID == 632 ) //Lute - { - pAudioPlayer->PlaySound((SoundID)133, 0, 0, -1, 0, 0, 0, 0); - return; - } - if ( pParty->pPickedItem.uItemID == 633 ) //Faerie Pipes - { - pAudioPlayer->PlaySound((SoundID)134, 0, 0, -1, 0, 0, 0, 0); - return; - } - if ( pParty->pPickedItem.uItemID == 634 ) //Gryphonheart's Trumpet - { - pAudioPlayer->PlaySound((SoundID)135, 0, 0, -1, 0, 0, 0, 0); - return; - } - if ( pParty->pPickedItem.uItemID != 646 ) - { - if ( pParty->pPickedItem.uItemID == 650 ) //Temple in a Bottle - { - sub_44C28F_open_nwc_dungeon(); - return; - } - v68 = pParty->pPickedItem.GetDisplayName(); - v58 = pGlobalTXT_LocalizationStrings[36]; - goto LABEL_90; - } - pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, player_num - 1); - v5 = 8 * player_num + 392; - LOBYTE(v5) = PID(OBJECT_Player,player_num - 120); - pAudioPlayer->PlaySound(SOUND_20001, v5, 0, -1, 0, 0, 0, 0); - v3->AddVariable(VAR_NumSkillPoints, 2); - } + { + + v68 = pParty->pPickedItem.GetDisplayName(); + v58 = pGlobalTXT_LocalizationStrings[36]; + sprintfex(pTmpBuf, v58, v68); + v23 = pTmpBuf; + ShowStatusBarString(v23, 2u); + v4 = 0; + v61 = v4; + v52 = v4; + v48 = v4; + v45 = v4; + v43 = -1; + v41 = v4; + v39 = v4; + v37 = (SoundID)27; + pAudioPlayer->PlaySound(v37, v39, v41, v43, v45, v48, v52, v61); + return; + } + LABEL_187: pMouse->RemoveHoldingItem(); return; - } - if ( pParty->pPlayers[player_num-1].CanAct() ) - { - sub_467F48(pParty->pPickedItem.uItemID); - v65 = 0; - v56 = SPEECH_37; -LABEL_67: - v3->PlaySound((PlayerSpeech)v56, v65); - return; - } -LABEL_89: - v68 = aCharacterConditionNames[v3->GetMajorConditionIdx()]; - v58 = pGlobalTXT_LocalizationStrings[382]; -LABEL_90: - sprintfex(pTmpBuf, v58, v68); - v23 = pTmpBuf; -LABEL_91: - ShowStatusBarString(v23, 2u); - v4 = 0; - goto LABEL_92; - } - v15 = pParty->pPickedItem.uItemID - 400; - v72 = (char *)&v3->spellbook.pFireSpellbook+pParty->pPickedItem.uItemID-400;//(char *)&v3->pConditions[0] + pParty->pPickedItem.uItemID + 2; - if ( *v72 ) - { - v66 = pParty->pPickedItem.GetDisplayName(); - v57 = pGlobalTXT_LocalizationStrings[380]; -LABEL_72: - sprintf(pTmpBuf, v57, v66); - ShowStatusBarString(pTmpBuf, 2u); -LABEL_92: - v61 = v4; - v52 = v4; - v48 = v4; - v45 = v4; - v43 = -1; - v41 = v4; - v39 = v4; - v37 = (SoundID)27; -LABEL_93: - v14 = pAudioPlayer; -LABEL_63: - pAudioPlayer->PlaySound(v37, v39, v41, v43, v45, v48, v52, v61); - return; - } - if ( !pParty->pPlayers[player_num-1].CanAct() ) - { - v66 = aCharacterConditionNames[v3->GetMajorConditionIdx()]; - v57 = pGlobalTXT_LocalizationStrings[382]; - goto LABEL_72; - } - v16 = v15 % 11 + 1; - v17 = &v3->pActiveSkills[v15 / 11 + 12]; - v75 = v16; - v18 = SkillToMastery(*v17) - 1; - if ( v18 ) - { - v19 = v18 - 1; - if ( v19 ) - { - v20 = v19 - 1; - if ( v20 ) - { - if ( v20 != 1 ) - { - v21 = player_num; -LABEL_83: - if ( v75 > v21 || !*v17 ) - { - v22 = pParty->pPickedItem.GetDisplayName(); - sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[381], v22); - ShowStatusBarString(pTmpBuf, 2u); - v3->PlaySound((PlayerSpeech)20, 0); - return; - } - *v72 = 1; - v3->PlaySound(SPEECH_21, 0); - v73 = 0; -LABEL_173: - v36 = pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType; - if ( v36 == EQUIP_POTION ) - { - v71 = 0; - v60 = 0; - v51 = 0; - v47 = 0; - v44 = -1; - v42 = 0; - v40 = 0; - v38 = (SoundID)210; - } - else - { - if ( v36 != EQUIP_REAGENT ) - { -LABEL_178: - if ( pGUIWindow_CurrentMenu && pGUIWindow_CurrentMenu->eWindowType != WINDOW_null) - { - if ( !v73 ) - goto LABEL_187; - pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); - } - if ( v73 ) - { - if ( pParty->bTurnBasedModeOn ) - { - *(&pParty->field_16140 + player_num) = 100; - thisb->SetRecoveryTime(100); - pTurnEngine->_40471C(); - } - else - { - thisb->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * 213.3333333333333)); - } - } - goto LABEL_187; - } - v71 = 0; - v60 = 0; - v51 = 0; - v47 = 0; - v44 = -1; - v42 = 0; - v40 = 0; - v38 = (SoundID)211; - } - pAudioPlayer->PlaySound(v38, v40, v42, v44, v47, v51, v60, v71); - goto LABEL_178; - } - v67 = 11; } - else - { - v67 = 10; - } - } - else - { - v67 = 7; - } - } - else - { - v67 = 4; - } - v21 = v67; - goto LABEL_83; - } - if ( pCurrentScreen == SCREEN_CASTING ) - return; - if ( !pParty->pPlayers[player_num-1].CanAct() ) - goto LABEL_89; - if ( bUnderwater == 1 ) - { - v23 = pGlobalTXT_LocalizationStrings[652]; - goto LABEL_91; - } - dword_50C9AC = 1; - scroll_id = pParty->pPickedItem.uItemID - 299; - if ( scroll_id == 30 || scroll_id == 4 || scroll_id == 91 || scroll_id == 28 ) //Enchant Item scroll, Vampiric Weapon scroll ,Recharge Item ,Fire Aura - { - pMouse->RemoveHoldingItem(); - pGUIWindow_CurrentMenu->Release(); - pIcons_LOD->_4114F2(); - pCurrentScreen = SCREEN_GAME; - viewparams->bRedrawGameUI = 1; - _42777D_CastSpell_UseWand_ShootArrow(scroll_id, player_num - 1, 0x85u, 1, 0); - } - else - { - _720984_unused = pParty->pPickedItem.uItemID; - pMouse->RemoveHoldingItem(); - pMessageQueue_50C9E8->AddMessage(UIMSG_SpellScrollUse, scroll_id, player_num - 1); - if ( pCurrentScreen && pGUIWindow_CurrentMenu - && (pGUIWindow_CurrentMenu->eWindowType != WINDOW_null)) - { - pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); - } - } -} + + }
--- a/Player.h Tue May 21 07:24:49 2013 +0400 +++ b/Player.h Tue May 21 08:53:43 2013 +0400 @@ -319,6 +319,11 @@ PlayerSpellbookChapter pChapters[9]; char _pad_1; }; + struct + { + char bHaveSpell[99]; + char _pad_1; + }; }; }; #pragma pack(pop)
--- a/mm7_2.cpp Tue May 21 07:24:49 2013 +0400 +++ b/mm7_2.cpp Tue May 21 08:53:43 2013 +0400 @@ -9934,14 +9934,14 @@ } //----- (00467F48) -------------------------------------------------------- -void __fastcall sub_467F48(signed int a1) -{ +void CreateMsgScrollWindow( signed int mscroll_id ) + { signed int v1; // esi@1 - v1 = a1; - if ( !pGUIWindow_ScrollWindow && a1 >= 700 ) - { - if ( a1 <= 782 ) + v1 = mscroll_id; + if ( !pGUIWindow_ScrollWindow && mscroll_id >= 700 ) + { + if ( mscroll_id <= 782 ) { uTextureID_720980 = pIcons_LOD->LoadTexture("leather", TEXTURE_16BIT_PALETTE); pGUIWindow_ScrollWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_Scroll, v1 - 700, 0);
--- a/mm7_data.h Tue May 21 07:24:49 2013 +0400 +++ b/mm7_data.h Tue May 21 08:53:43 2013 +0400 @@ -1801,7 +1801,7 @@ std::string *__fastcall _4678E2_make_error_string(std::string *a1, int line, std::string file); int __thiscall sub_467D5D(int _this); void __thiscall sub_467E7F_EquipBody(unsigned int uEquipType); // idb -void __fastcall sub_467F48(signed int a1); +void CreateMsgScrollWindow(signed int mscroll_id); void __cdecl free_book_subwindow(); void CreateScrollWindow(); void __cdecl OnPaperdollLeftClick();