comparison Player.cpp @ 1032:9408f98f4929

use item cleaned
author Gloval
date Wed, 22 May 2013 00:09:14 +0400
parents 67e33708d815
children aa848c90181f
comparison
equal deleted inserted replaced
1031:f93d17337113 1032:9408f98f4929
4529 } 4529 }
4530 4530
4531 //----- (0048EA46) -------------------------------------------------------- 4531 //----- (0048EA46) --------------------------------------------------------
4532 int Player::_48EA46_calc_special_bonus_by_items(int a2) 4532 int Player::_48EA46_calc_special_bonus_by_items(int a2)
4533 { 4533 {
4534 int v3; // esi@1 4534 int inv_indx; // eax@3
4535 int v4; // edx@2 4535
4536 int v5; // eax@3 4536 for (int i=EQUIP_OFF_HAND; i<EQUIP_BOOK; ++i )
4537 char *v6; // eax@4 4537 {
4538 4538 if ( !HasItemEquipped((ITEM_EQUIP_TYPE)i) )
4539 v3 = 0; 4539 continue;
4540 while ( 1 ) 4540 inv_indx = pEquipment.pIndices[i] - 1;
4541 { 4541 if (a2==17)
4542 if ( !HasItemEquipped((ITEM_EQUIP_TYPE)v3) ) 4542 {
4543 goto LABEL_11; 4543 if ((pInventoryItems[inv_indx].uSpecEnchantmentType==17)||(pInventoryItems[inv_indx].uItemID=533)) //Elven Chainmail+Increases rate of Recovery
4544 v5 = pEquipment.pIndices[v3] - 1; 4544 return 50;
4545 if ( a2 != 17 ) 4545 }
4546 { 4546 if (a2==24)
4547 if ( a2 != 24 || this->pInventoryItems[v5].uSpecEnchantmentType != 24 ) 4547 {
4548 goto LABEL_11; 4548 if (pInventoryItems[inv_indx].uSpecEnchantmentType==24) //Increased Knockback.
4549 return 5; 4549 return 5;
4550 } 4550 }
4551 v6 = (char *)this + 36 * v5; 4551 }
4552 if ( *((int *)v6 + 133) == 533 || *((int *)v6 + 136) == 17 ) 4552 return 0;
4553 return 50;
4554 LABEL_11:
4555 ++v3;
4556 if ( (signed int)v3 >= 16 )
4557 return 0;
4558 }
4559 } 4553 }
4560 4554
4561 //----- (0048EAAE) -------------------------------------------------------- 4555 //----- (0048EAAE) --------------------------------------------------------
4562 int Player::GetItemsBonus(CHARACTER_ATTRIBUTE_TYPE attr, int a3) 4556 int Player::GetItemsBonus(CHARACTER_ATTRIBUTE_TYPE attr, int a3)
4563 { 4557 {
6834 6828
6835 //----- (004680ED) -------------------------------------------------------- 6829 //----- (004680ED) --------------------------------------------------------
6836 void Player::UseItem_DrinkPotion_etc(signed int player_num, int a3) 6830 void Player::UseItem_DrinkPotion_etc(signed int player_num, int a3)
6837 { 6831 {
6838 Player *v3; // esi@1 6832 Player *v3; // esi@1
6839 unsigned int v4; // ebx@4
6840 signed int v5; // eax@17 6833 signed int v5; // eax@17
6841 unsigned int v6; // eax@26
6842 unsigned __int8 v7; // cf@37
6843 int v8; // edx@39 6834 int v8; // edx@39
6844 int v9; // edx@40
6845 int v10; // edx@41
6846 int v11; // edx@42
6847 int v12; // edx@43
6848 char *v13; // eax@45 6835 char *v13; // eax@45
6849 AudioPlayer *v14; // ecx@62
6850 signed int v15; // edi@68 6836 signed int v15; // edi@68
6851 int v16; // edx@73 6837 int v16; // edx@73
6852 unsigned __int16 v17; // edi@73 6838 unsigned __int16 v17; // edi@73
6853 unsigned int v18; // eax@73 6839 unsigned int v18; // eax@73
6854 int v19; // eax@74
6855 int v20; // eax@75
6856 signed int v21; // eax@81
6857 const char *v22; // eax@84 6840 const char *v22; // eax@84
6858 char *v23; // ecx@90
6859 int scroll_id; // esi@96 6841 int scroll_id; // esi@96
6860 int v25; // eax@109 6842 int v25; // eax@109
6861 int v26; // eax@113 6843 int v26; // eax@113
6862 int new_mana_val; // edi@114 6844 int new_mana_val; // edi@114
6863 signed __int64 v28; // qax@120 6845 signed __int64 v28; // qax@120
6864 char *v29; // ecx@120
6865 __int64 v30; // edi@137 6846 __int64 v30; // edi@137
6866 int v31; // ST30_4@137
6867 __int64 v32; // ST3C_4@137 6847 __int64 v32; // ST3C_4@137
6868 int v33; // ST40_4@137
6869 __int64 v34; // ST34_4@137 6848 __int64 v34; // ST34_4@137
6870 int v35; // ST38_4@137
6871 unsigned __int8 v36; // al@173
6872 SoundID v37; // [sp-20h] [bp-4Ch]@18
6873 SoundID v38; // [sp-20h] [bp-4Ch]@174
6874 signed int v39; // [sp-1Ch] [bp-48h]@18
6875 signed int v40; // [sp-1Ch] [bp-48h]@174
6876 unsigned int v41; // [sp-18h] [bp-44h]@18
6877 unsigned int v42; // [sp-18h] [bp-44h]@174
6878 signed int v43; // [sp-14h] [bp-40h]@18
6879 signed int v44; // [sp-14h] [bp-40h]@174
6880 signed int v45; // [sp-10h] [bp-3Ch]@18
6881 unsigned __int16 v46; // [sp-10h] [bp-3Ch]@120
6882 signed int v47; // [sp-10h] [bp-3Ch]@174
6883 int v48; // [sp-Ch] [bp-38h]@18
6884 unsigned int v49; // [sp-Ch] [bp-38h]@33
6885 unsigned __int16 v50; // [sp-Ch] [bp-38h]@120 6849 unsigned __int16 v50; // [sp-Ch] [bp-38h]@120
6886 int v51; // [sp-Ch] [bp-38h]@174
6887 unsigned int v52; // [sp-8h] [bp-34h]@18
6888 char *v53; // [sp-8h] [bp-34h]@33
6889 int v54; // [sp-8h] [bp-34h]@34
6890 unsigned int v55; // [sp-8h] [bp-34h]@60
6891 int v56; // [sp-8h] [bp-34h]@66
6892 const char *v57; // [sp-8h] [bp-34h]@69
6893 const char *v58; // [sp-8h] [bp-34h]@89
6894 int v59; // [sp-8h] [bp-34h]@120
6895 unsigned int v60; // [sp-8h] [bp-34h]@174
6896 int v61; // [sp-4h] [bp-30h]@18
6897 char *v62; // [sp-4h] [bp-30h]@33
6898 char *v63; // [sp-4h] [bp-30h]@34
6899 int v64; // [sp-4h] [bp-30h]@60
6900 int v65; // [sp-4h] [bp-30h]@66
6901 const char *v66; // [sp-4h] [bp-30h]@69 6850 const char *v66; // [sp-4h] [bp-30h]@69
6902 signed int v67; // [sp-4h] [bp-30h]@77 6851 signed int v67; // [sp-4h] [bp-30h]@77
6903 const char *v68; // [sp-4h] [bp-30h]@89 6852 const char *v68; // [sp-4h] [bp-30h]@89
6904 int v69; // [sp-4h] [bp-30h]@110
6905 unsigned __int8 v70; // [sp-4h] [bp-30h]@120
6906 int v71; // [sp-4h] [bp-30h]@174
6907 char v72; // [sp+20h] [bp-Ch]@68 6853 char v72; // [sp+20h] [bp-Ch]@68
6908 signed int v73; // [sp+24h] [bp-8h]@1 6854 signed int v73; // [sp+24h] [bp-8h]@1
6909 char *v74; // [sp+24h] [bp-8h]@23 6855 char* v74; // [sp+24h] [bp-8h]@23
6910 int v75; // [sp+24h] [bp-8h]@73
6911 Player *thisb; // [sp+28h] [bp-4h]@1 6856 Player *thisb; // [sp+28h] [bp-4h]@1
6912 unsigned int thisa; // [sp+28h] [bp-4h]@22 6857 unsigned int thisa; // [sp+28h] [bp-4h]@22
6913 6858
6914 thisb = this; 6859 thisb = this;
6915 v3 = &pParty->pPlayers[player_num-1]; 6860 v3 = &pParty->pPlayers[player_num-1];
6916 v73 = 1; 6861 v73 = 1;
6917 if ( pParty->bTurnBasedModeOn == 1 && (pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 3) ) 6862 if ( pParty->bTurnBasedModeOn == 1 && (pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 3) )
6918 return; 6863 return;
6919 v4 = 0;
6920 if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType == EQUIP_REAGENT ) 6864 if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType == EQUIP_REAGENT )
6921 { 6865 {
6922 if ( pParty->pPickedItem.uItemID == 160 ) 6866 if ( pParty->pPickedItem.uItemID == 160 )
6923 { 6867 {
6924 pParty->pPlayers[player_num-1].SetCondition(Condition_Poison1, 1); 6868 pParty->pPlayers[player_num-1].SetCondition(Condition_Poison1, 1);
6938 6882
6939 } 6883 }
6940 else 6884 else
6941 { 6885 {
6942 v68 = pParty->pPickedItem.GetDisplayName(); 6886 v68 = pParty->pPickedItem.GetDisplayName();
6943 v58 = pGlobalTXT_LocalizationStrings[36];//"%s can not be used that way" 6887 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[36], v68);//"%s can not be used that way"
6944 sprintfex(pTmpBuf, v58, v68);
6945 ShowStatusBarString(pTmpBuf, 2); 6888 ShowStatusBarString(pTmpBuf, 2);
6946 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); 6889 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
6947 return; 6890 return;
6948 } 6891 }
6949 goto LABEL_173; 6892 pAudioPlayer->PlaySound((SoundID)211, 0, 0, -1, 0, 0, 0, 0);
6893
6894 if ( pGUIWindow_CurrentMenu && pGUIWindow_CurrentMenu->eWindowType != WINDOW_null)
6895 {
6896 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
6897 }
6898 if ( v73 )
6899 {
6900 if ( pParty->bTurnBasedModeOn )
6901 {
6902 pParty->pTurnBasedPlayerRecoveryTimes[player_num-1] = 100;
6903 thisb->SetRecoveryTime(100);
6904 pTurnEngine->_40471C();
6905 }
6906 else
6907 {
6908 thisb->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * 213.3333333333333));
6909 }
6910 }
6911 pMouse->RemoveHoldingItem();
6912 return;
6913
6950 6914
6951 } 6915 }
6952 if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType == EQUIP_POTION ) 6916 if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType == EQUIP_POTION )
6953 { 6917 {
6954 switch ( pParty->pPickedItem.uItemID ) 6918 switch ( pParty->pPickedItem.uItemID )
7006 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); 6970 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7007 v3->pPlayerBuffs[1].Apply(pParty->uTimePlayed + v28, 3, 5, 0, 0); 6971 v3->pPlayerBuffs[1].Apply(pParty->uTimePlayed + v28, 3, 5, 0, 0);
7008 v3->PlaySound(SPEECH_36, 0); 6972 v3->PlaySound(SPEECH_36, 0);
7009 break; 6973 break;
7010 case 231: //Preservation 6974 case 231: //Preservation
7011 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); 6975 v50 = 3 * pParty->pPickedItem.uEnchantmentType;
7012 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); 6976 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7013 v3->pPlayerBuffs[11].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); 6977 v3->pPlayerBuffs[11].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7014 v3->PlaySound(SPEECH_36, 0); 6978 v3->PlaySound(SPEECH_36, 0);
7015 break; 6979 break;
7016 case 232: //Shield 6980 case 232: //Shield
7017 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); 6981 v50 = 3 * pParty->pPickedItem.uEnchantmentType;
7018 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); 6982 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7019 v3->pPlayerBuffs[13].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); 6983 v3->pPlayerBuffs[13].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7020 v3->PlaySound(SPEECH_36, 0); 6984 v3->PlaySound(SPEECH_36, 0);
7021 break; 6985 break;
7022 case 234: //Stoneskin 6986 case 234: //Stoneskin
7039 case 239: //Cure Insanity 7003 case 239: //Cure Insanity
7040 v3->pConditions[Condition_Insane] = 0i64; 7004 v3->pConditions[Condition_Insane] = 0i64;
7041 v3->PlaySound(SPEECH_36, 0); 7005 v3->PlaySound(SPEECH_36, 0);
7042 break; 7006 break;
7043 case 240: //Might Boost 7007 case 240: //Might Boost
7044 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); 7008 v50 = 3 * pParty->pPickedItem.uEnchantmentType;
7045 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); 7009 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7046 v3->pPlayerBuffs[19].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); 7010 v3->pPlayerBuffs[19].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7047 v3->PlaySound(SPEECH_36, 0); 7011 v3->PlaySound(SPEECH_36, 0);
7048 break; 7012 break;
7049 case 241: //Intellect Boost 7013 case 241: //Intellect Boost
7050 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); 7014 v50 = 3 * pParty->pPickedItem.uEnchantmentType;
7051 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); 7015 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7052 v3->pPlayerBuffs[17].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); 7016 v3->pPlayerBuffs[17].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7053 v3->PlaySound(SPEECH_36, 0); 7017 v3->PlaySound(SPEECH_36, 0);
7054 break; 7018 break;
7055 case 242: //Personality Boost 7019 case 242: //Personality Boost
7056 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); 7020 v50 = 3 * pParty->pPickedItem.uEnchantmentType;
7057 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); 7021 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7058 v3->pPlayerBuffs[20].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); 7022 v3->pPlayerBuffs[20].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7059 v3->PlaySound(SPEECH_36, 0); 7023 v3->PlaySound(SPEECH_36, 0);
7060 break; 7024 break;
7061 case 243://Endurance Boost 7025 case 243://Endurance Boost
7062 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); 7026 v50 = 3 * pParty->pPickedItem.uEnchantmentType;
7063 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); 7027 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7064 v3->pPlayerBuffs[16].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); 7028 v3->pPlayerBuffs[16].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7065 v3->PlaySound(SPEECH_36, 0); 7029 v3->PlaySound(SPEECH_36, 0);
7066 break; 7030 break;
7067 case 244: //Speed Boost 7031 case 244: //Speed Boost
7068 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); 7032 v50 = 3 * pParty->pPickedItem.uEnchantmentType;
7069 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); 7033 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7070 v3->pPlayerBuffs[21].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); 7034 v3->pPlayerBuffs[21].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7071 v3->PlaySound(SPEECH_36, 0); 7035 v3->PlaySound(SPEECH_36, 0);
7072 break; 7036 break;
7073 case 245: //Accuracy Boost 7037 case 245: //Accuracy Boost
7074 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); 7038 v50 = 3 * pParty->pPickedItem.uEnchantmentType;
7075 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); 7039 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7076 v3->pPlayerBuffs[15].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); 7040 v3->pPlayerBuffs[15].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7077 v3->PlaySound(SPEECH_36, 0); 7041 v3->PlaySound(SPEECH_36, 0);
7078 break; 7042 break;
7079 case 251: //Cure Paralysis 7043 case 251: //Cure Paralysis
7102 if ( new_mana_val > v3->GetMaxMana() ) 7066 if ( new_mana_val > v3->GetMaxMana() )
7103 new_mana_val = v3->GetMaxMana(); 7067 new_mana_val = v3->GetMaxMana();
7104 v3->PlaySound(SPEECH_36, 0); 7068 v3->PlaySound(SPEECH_36, 0);
7105 break; 7069 break;
7106 case 255: //Luck Boost 7070 case 255: //Luck Boost
7107 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); 7071 v50 = 3 * pParty->pPickedItem.uEnchantmentType;
7108 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); 7072 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7109 v3->pPlayerBuffs[18].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); 7073 v3->pPlayerBuffs[18].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7110 v3->PlaySound(SPEECH_36, 0); 7074 v3->PlaySound(SPEECH_36, 0);
7111 break; 7075 break;
7112 case 256: //Fire Resistance 7076 case 256: //Fire Resistance
7113 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); 7077 v50 = 3 * pParty->pPickedItem.uEnchantmentType;
7114 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); 7078 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7115 v3->pPlayerBuffs[5].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); 7079 v3->pPlayerBuffs[5].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7116 v3->PlaySound(SPEECH_36, 0); 7080 v3->PlaySound(SPEECH_36, 0);
7117 goto LABEL_173; 7081 break;
7118 case 257: //Air Resistance 7082 case 257: //Air Resistance
7119 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); 7083 v50 = 3 * pParty->pPickedItem.uEnchantmentType;
7120 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); 7084 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7121 v3->pPlayerBuffs[0].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); 7085 v3->pPlayerBuffs[0].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7122 v3->PlaySound(SPEECH_36, 0); 7086 v3->PlaySound(SPEECH_36, 0);
7123 break; 7087 break;
7124 case 258: //Water Resistance 7088 case 258: //Water Resistance
7125 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); 7089 v50 = 3 * pParty->pPickedItem.uEnchantmentType;
7126 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); 7090 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7127 v3->pPlayerBuffs[22].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); 7091 v3->pPlayerBuffs[22].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7128 v3->PlaySound(SPEECH_36, 0); 7092 v3->PlaySound(SPEECH_36, 0);
7129 break; 7093 break;
7130 case 259: //Earth Resistance 7094 case 259: //Earth Resistance
7131 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); 7095 v50 = 3 * pParty->pPickedItem.uEnchantmentType;
7132 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); 7096 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7133 v3->pPlayerBuffs[3].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); 7097 v3->pPlayerBuffs[3].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7134 v3->PlaySound(SPEECH_36, 0); 7098 v3->PlaySound(SPEECH_36, 0);
7135 break; 7099 break;
7136 case 260: //Mind Resistance 7100 case 260: //Mind Resistance
7137 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); 7101 v50 = 3 * pParty->pPickedItem.uEnchantmentType;
7138 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); 7102 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7139 v3->pPlayerBuffs[9].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); 7103 v3->pPlayerBuffs[9].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7140 v3->PlaySound(SPEECH_36, 0); 7104 v3->PlaySound(SPEECH_36, 0);
7141 break; 7105 break;
7142 case 261: //Body Resistance 7106 case 261: //Body Resistance
7143 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); 7107 v50 = 3 * pParty->pPickedItem.uEnchantmentType;
7144 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); 7108 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7145 v3->pPlayerBuffs[2].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); 7109 v3->pPlayerBuffs[2].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7146 v3->PlaySound(SPEECH_36, 0); 7110 v3->PlaySound(SPEECH_36, 0);
7147 break; 7111 break;
7148 case 262: //Stone to Flesh 7112 case 262: //Stone to Flesh
7210 v3->PlaySound(SPEECH_36, 0); 7174 v3->PlaySound(SPEECH_36, 0);
7211 break; 7175 break;
7212 7176
7213 default: 7177 default:
7214 v68 = pParty->pPickedItem.GetDisplayName(); 7178 v68 = pParty->pPickedItem.GetDisplayName();
7215 v58 = pGlobalTXT_LocalizationStrings[36]; //"%s can not be used that way" 7179 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[36], v68);//"%s can not be used that way"
7216 sprintfex(pTmpBuf, v58, v68);
7217 ShowStatusBarString(pTmpBuf, 2u); 7180 ShowStatusBarString(pTmpBuf, 2u);
7218 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); 7181 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
7219 return; 7182 return;
7220
7221 } 7183 }
7222 // pParty->pPlayers[player_num-1].SetCondition(Condition_Poison1, 1); 7184 pAudioPlayer->PlaySound((SoundID)210, 0, 0, -1, 0, 0, 0, 0);
7223 goto LABEL_173; 7185 if ( pGUIWindow_CurrentMenu && pGUIWindow_CurrentMenu->eWindowType != WINDOW_null)
7186 {
7187 if ( !v73 )
7188 {
7189 pMouse->RemoveHoldingItem();
7190 return;
7191 }
7192 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
7193 }
7194 if ( v73 )
7195 {
7196 if ( pParty->bTurnBasedModeOn )
7197 {
7198 pParty->pTurnBasedPlayerRecoveryTimes[player_num-1] = 100;
7199 thisb->SetRecoveryTime(100);
7200 pTurnEngine->_40471C();
7201 }
7202 else
7203 {
7204 thisb->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * 213.3333333333333));
7205 }
7206 }
7207 pMouse->RemoveHoldingItem();
7208 return;
7209
7224 } 7210 }
7225 7211
7226 7212
7227 if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType == EQUIP_SPELL_SCROLL ) 7213 if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType == EQUIP_SPELL_SCROLL )
7228 { 7214 {
7231 if ( pCurrentScreen == SCREEN_CASTING ) 7217 if ( pCurrentScreen == SCREEN_CASTING )
7232 return; 7218 return;
7233 if ( !pParty->pPlayers[player_num-1].CanAct() ) 7219 if ( !pParty->pPlayers[player_num-1].CanAct() )
7234 { 7220 {
7235 7221
7236
7237 v68 = aCharacterConditionNames[v3->GetMajorConditionIdx()]; 7222 v68 = aCharacterConditionNames[v3->GetMajorConditionIdx()];
7238 v58 = pGlobalTXT_LocalizationStrings[382]; 7223 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[382], v68);
7239 sprintfex(pTmpBuf, v58, v68); 7224 ShowStatusBarString(pTmpBuf, 2u);
7240 v23 = pTmpBuf; 7225 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
7241
7242 ShowStatusBarString(v23, 2u);
7243 v4 = 0;
7244 v61 = v4;
7245 v52 = v4;
7246 v48 = v4;
7247 v45 = v4;
7248 v43 = -1;
7249 v41 = v4;
7250 v39 = v4;
7251 v37 = (SoundID)27;
7252 pAudioPlayer->PlaySound(v37, v39, v41, v43, v45, v48, v52, v61);
7253 return; 7226 return;
7254 } 7227 }
7255 if ( bUnderwater == 1 ) 7228 if ( bUnderwater == 1 )
7256 { 7229 {
7257 v23 = pGlobalTXT_LocalizationStrings[652]; //"You can not do that while you are underwater!" 7230 ShowStatusBarString(pGlobalTXT_LocalizationStrings[652], 2u);//"You can not do that while you are underwater!"
7258 ShowStatusBarString(v23, 2u); 7231 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
7259 v4 = 0;
7260 v61 = v4;
7261 v52 = v4;
7262 v48 = v4;
7263 v45 = v4;
7264 v43 = -1;
7265 v41 = v4;
7266 v39 = v4;
7267 v37 = (SoundID)27;
7268 pAudioPlayer->PlaySound(v37, v39, v41, v43, v45, v48, v52, v61);
7269 return; 7232 return;
7270 } 7233 }
7271 dword_50C9AC = 1; 7234 dword_50C9AC = 1;
7272 scroll_id = pParty->pPickedItem.uItemID - 299; 7235 scroll_id = pParty->pPickedItem.uItemID - 299;
7273 if ( scroll_id == 30 || scroll_id == 4 || scroll_id == 91 || scroll_id == 28 ) //Enchant Item scroll, Vampiric Weapon scroll ,Recharge Item ,Fire Aura 7236 if ( scroll_id == 30 || scroll_id == 4 || scroll_id == 91 || scroll_id == 28 ) //Enchant Item scroll, Vampiric Weapon scroll ,Recharge Item ,Fire Aura
7299 v15 = pParty->pPickedItem.uItemID - 400; 7262 v15 = pParty->pPickedItem.uItemID - 400;
7300 v72 = v3->spellbook.bHaveSpell[pParty->pPickedItem.uItemID-400];//(char *)&v3->pConditions[0] + pParty->pPickedItem.uItemID + 2; 7263 v72 = v3->spellbook.bHaveSpell[pParty->pPickedItem.uItemID-400];//(char *)&v3->pConditions[0] + pParty->pPickedItem.uItemID + 2;
7301 if ( v72 ) 7264 if ( v72 )
7302 { 7265 {
7303 v66 = pParty->pPickedItem.GetDisplayName(); 7266 v66 = pParty->pPickedItem.GetDisplayName();
7304 v57 = pGlobalTXT_LocalizationStrings[380];//"You already know the %s spell" 7267 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[380], v66);//"You already know the %s spell"
7305 LABEL_72:
7306 sprintf(pTmpBuf, v57, v66);
7307 ShowStatusBarString(pTmpBuf, 2u); 7268 ShowStatusBarString(pTmpBuf, 2u);
7308 LABEL_92: 7269 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
7309 v61 = v4;
7310 v52 = v4;
7311 v48 = v4;
7312 v45 = v4;
7313 v43 = -1;
7314 v41 = v4;
7315 v39 = v4;
7316 v37 = (SoundID)27;
7317 LABEL_93:
7318 v14 = pAudioPlayer;
7319 LABEL_63:
7320 pAudioPlayer->PlaySound(v37, v39, v41, v43, v45, v48, v52, v61);
7321 return; 7270 return;
7322 } 7271 }
7323 if ( !pParty->pPlayers[player_num-1].CanAct() ) 7272 if ( !pParty->pPlayers[player_num-1].CanAct() )
7324 { 7273 {
7325 v66 = aCharacterConditionNames[v3->GetMajorConditionIdx()]; 7274 v66 = aCharacterConditionNames[v3->GetMajorConditionIdx()];
7326 v57 = pGlobalTXT_LocalizationStrings[382];//"That player is %s" 7275 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[382], v66);//"That player is %s"
7327 sprintf(pTmpBuf, v57, v66);
7328 ShowStatusBarString(pTmpBuf, 2u); 7276 ShowStatusBarString(pTmpBuf, 2u);
7329 v61 = v4; 7277 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
7330 v52 = v4;
7331 v48 = v4;
7332 v45 = v4;
7333 v43 = -1;
7334 v41 = v4;
7335 v39 = v4;
7336 v37 = (SoundID)27;
7337 v14 = pAudioPlayer;
7338 pAudioPlayer->PlaySound(v37, v39, v41, v43, v45, v48, v52, v61);
7339 return; 7278 return;
7340 } 7279 }
7341 v16 = v15 % 11 + 1; 7280 v16 = v15 % 11 + 1;
7342 v17 = v3->pActiveSkills[v15 / 11 + 12]; 7281 v17 = v3->pActiveSkills[v15 / 11 + 12];
7343 v75 = v16;
7344 v18 = SkillToMastery(v17) - 1; 7282 v18 = SkillToMastery(v17) - 1;
7345 if ( v18 ) 7283 switch (v18)
7346 { 7284 {
7347 v19 = v18 - 1; 7285 case 0: v67 = 4; break;
7348 if ( v19 ) 7286 case 1: v67 = 7; break;
7287 case 2: v67 = 10; break;
7288 case 3: v67 = 11; break;
7289 default:
7290 v67 = player_num;
7291 }
7292
7293 if ( v16 > v67 || !v17 )
7294 {
7295 v22 = pParty->pPickedItem.GetDisplayName();
7296 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[381], v22); //"You don't have the skill to learn %s"
7297 ShowStatusBarString(pTmpBuf, 2u);
7298 v3->PlaySound((PlayerSpeech)20, 0);
7299 return;
7300 }
7301 // v72 = 1;
7302 v3->PlaySound(SPEECH_21, 0);
7303 v73 = 0;
7304
7305
7306 if ( pGUIWindow_CurrentMenu && pGUIWindow_CurrentMenu->eWindowType != WINDOW_null)
7307 {
7308 if ( !v73 )
7349 { 7309 {
7350 v20 = v19 - 1; 7310 pMouse->RemoveHoldingItem();
7351 if ( v20 ) 7311 return;
7352 { 7312 }
7353 if ( v20 != 1 ) 7313 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
7354 { 7314 }
7355 v21 = player_num; 7315 if ( v73 )
7356 LABEL_83: 7316 {
7357 if ( v75 > v21 || !v17 ) 7317 if ( pParty->bTurnBasedModeOn )
7358 { 7318 {
7359 v22 = pParty->pPickedItem.GetDisplayName(); 7319 pParty->pTurnBasedPlayerRecoveryTimes[player_num-1] = 100;
7360 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[381], v22); 7320 thisb->SetRecoveryTime(100);
7361 ShowStatusBarString(pTmpBuf, 2u); 7321 pTurnEngine->_40471C();
7362 v3->PlaySound((PlayerSpeech)20, 0);
7363 return;
7364 }
7365 v72 = 1;
7366 v3->PlaySound(SPEECH_21, 0);
7367 v73 = 0;
7368 LABEL_173:
7369 v36 = pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType;
7370 if ( v36 == EQUIP_POTION )
7371 {
7372 v71 = 0;
7373 v60 = 0;
7374 v51 = 0;
7375 v47 = 0;
7376 v44 = -1;
7377 v42 = 0;
7378 v40 = 0;
7379 v38 = (SoundID)210;
7380 }
7381 else
7382 {
7383 if ( v36 != EQUIP_REAGENT )
7384 {
7385 LABEL_178:
7386 if ( pGUIWindow_CurrentMenu && pGUIWindow_CurrentMenu->eWindowType != WINDOW_null)
7387 {
7388 if ( !v73 )
7389 {
7390 pMouse->RemoveHoldingItem();
7391 return;
7392 }
7393 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
7394 }
7395 if ( v73 )
7396 {
7397 if ( pParty->bTurnBasedModeOn )
7398 {
7399 *(&pParty->field_16140 + player_num) = 100;
7400 thisb->SetRecoveryTime(100);
7401 pTurnEngine->_40471C();
7402 }
7403 else
7404 {
7405 thisb->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * 213.3333333333333));
7406 }
7407 }
7408 pMouse->RemoveHoldingItem();
7409 return;
7410 }
7411 v71 = 0;
7412 v60 = 0;
7413 v51 = 0;
7414 v47 = 0;
7415 v44 = -1;
7416 v42 = 0;
7417 v40 = 0;
7418 v38 = (SoundID)211;
7419 }
7420 pAudioPlayer->PlaySound(v38, v40, v42, v44, v47, v51, v60, v71);
7421 goto LABEL_178;
7422 }
7423 v67 = 11;
7424 }
7425 else
7426 {
7427 v67 = 10;
7428 }
7429 } 7322 }
7430 else 7323 else
7431 { 7324 {
7432 v67 = 7; 7325 thisb->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * 213.3333333333333));
7433 } 7326 }
7434 } 7327 }
7435 else 7328 pMouse->RemoveHoldingItem();
7436 { 7329 return;
7437 v67 = 4; 7330
7438 }
7439 v21 = v67;
7440 goto LABEL_83;
7441 } 7331 }
7442 7332
7443 if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType == EQUIP_MESSAGE_SCROLL ) 7333 if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType == EQUIP_MESSAGE_SCROLL )
7444 7334
7445 { 7335 {
7446 if ( pParty->pPlayers[player_num-1].CanAct() ) 7336 if ( pParty->pPlayers[player_num-1].CanAct() )
7447 { 7337 {
7448 CreateMsgScrollWindow(pParty->pPickedItem.uItemID); 7338 CreateMsgScrollWindow(pParty->pPickedItem.uItemID);
7449 v65 = 0; 7339 v3->PlaySound(SPEECH_37, 0);
7450 v56 = SPEECH_37;
7451 LABEL_67:
7452 v3->PlaySound((PlayerSpeech)v56, v65);
7453 return; 7340 return;
7454 } 7341 }
7455 LABEL_89:
7456 v68 = aCharacterConditionNames[v3->GetMajorConditionIdx()]; 7342 v68 = aCharacterConditionNames[v3->GetMajorConditionIdx()];
7457 v58 = pGlobalTXT_LocalizationStrings[382]; 7343 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[382], v68);
7458 LABEL_90: 7344 ShowStatusBarString(pTmpBuf, 2u);
7459 sprintfex(pTmpBuf, v58, v68); 7345 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
7460 v23 = pTmpBuf;
7461 LABEL_91:
7462 ShowStatusBarString(v23, 2u);
7463 v4 = 0;
7464 v61 = v4;
7465 v52 = v4;
7466 v48 = v4;
7467 v45 = v4;
7468 v43 = -1;
7469 v41 = v4;
7470 v39 = v4;
7471 v37 = (SoundID)27;
7472 pAudioPlayer->PlaySound(v37, v39, v41, v43, v45, v48, v52, v61);
7473 return; 7346 return;
7474 } 7347 }
7475 else 7348 else
7476 { 7349 {
7477 if ( pParty->pPickedItem.uItemID == 616 ) //Genie Lamp 7350 if ( pParty->pPickedItem.uItemID == 616 ) //Genie Lamp
7478 { 7351 {
7479 thisa = pParty->uCurrentMonthWeek + 1; 7352 thisa = pParty->uCurrentMonthWeek + 1;
7480 if ( pParty->uCurrentMonth >= 7 ) 7353 if ( pParty->uCurrentMonth >= 7 )
7481 v74 = 0; 7354 v74 = NULL;
7482 else 7355 else
7483 v74 = aAttributeNames[pParty->uCurrentMonth]; 7356 v74 = aAttributeNames[pParty->uCurrentMonth];
7484 switch ( pParty->uCurrentMonth ) 7357 switch ( pParty->uCurrentMonth )
7485 { 7358 {
7486 case 0: 7359 case 0:
7487 v6 = pParty->uCurrentMonthWeek + 1;
7488 v3->uMight += thisa; 7360 v3->uMight += thisa;
7489 v62 = pGlobalTXT_LocalizationStrings[121]; //"Permanent" 7361 sprintf(pTmpBuf, "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent"
7490 v53 = v74;
7491 v49 = v6;
7492 sprintf(pTmpBuf, "+%u %s %s", v49, v53, v62);
7493 break; 7362 break;
7494 case 1: 7363 case 1:
7495 v6 = pParty->uCurrentMonthWeek + 1;
7496 v3->uIntelligence += thisa; 7364 v3->uIntelligence += thisa;
7497 v62 = pGlobalTXT_LocalizationStrings[121]; 7365 sprintf(pTmpBuf, "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent"
7498 v53 = v74;
7499 v49 = v6;
7500 sprintf(pTmpBuf, "+%u %s %s", v49, v53, v62);
7501 break; 7366 break;
7502 case 2: 7367 case 2:
7503 v6 = pParty->uCurrentMonthWeek + 1;
7504 v3->uWillpower += thisa; 7368 v3->uWillpower += thisa;
7505 v62 = pGlobalTXT_LocalizationStrings[121]; 7369 sprintf(pTmpBuf, "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent"
7506 v53 = v74;
7507 v49 = v6;
7508 sprintf(pTmpBuf, "+%u %s %s", v49, v53, v62);
7509 break; 7370 break;
7510 case 3: 7371 case 3:
7511 v6 = pParty->uCurrentMonthWeek + 1;
7512 v3->uEndurance += thisa; 7372 v3->uEndurance += thisa;
7513 v62 = pGlobalTXT_LocalizationStrings[121]; 7373 sprintf(pTmpBuf, "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent"
7514 v53 = v74;
7515 v49 = v6;
7516 sprintf(pTmpBuf, "+%u %s %s", v49, v53, v62);
7517 break; 7374 break;
7518 case 4: 7375 case 4:
7519 v6 = pParty->uCurrentMonthWeek + 1;
7520 v3->uAccuracy += thisa; 7376 v3->uAccuracy += thisa;
7521 v62 = pGlobalTXT_LocalizationStrings[121]; 7377 sprintf(pTmpBuf, "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent"
7522 v53 = v74;
7523 v49 = v6;
7524 sprintf(pTmpBuf, "+%u %s %s", v49, v53, v62);
7525 break; 7378 break;
7526 case 5: 7379 case 5:
7527 v6 = pParty->uCurrentMonthWeek + 1;
7528 v3->uSpeed += thisa; 7380 v3->uSpeed += thisa;
7529 v62 = pGlobalTXT_LocalizationStrings[121]; 7381 sprintf(pTmpBuf, "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent"
7530 v53 = v74;
7531 v49 = v6;
7532 sprintf(pTmpBuf, "+%u %s %s", v49, v53, v62);
7533 break; 7382 break;
7534 case 6: 7383 case 6:
7535 v6 = pParty->uCurrentMonthWeek + 1;
7536 v3->uLuck += thisa; 7384 v3->uLuck += thisa;
7537 v62 = pGlobalTXT_LocalizationStrings[121]; 7385 sprintf(pTmpBuf, "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent"
7538 v53 = v74;
7539 v49 = v6;
7540 sprintf(pTmpBuf, "+%u %s %s", v49, v53, v62);
7541 break; 7386 break;
7542 case 7: 7387 case 7:
7543 party_finds_gold(1000 * thisa, 0); 7388 party_finds_gold(1000 * thisa, 0);
7544 v63 = pGlobalTXT_LocalizationStrings[97];//"Gold" 7389 sprintf(pTmpBuf, "+%u %s", 1000 * thisa, pGlobalTXT_LocalizationStrings[97]);//"Gold"
7545 v54 = 1000 * thisa;
7546 sprintf(pTmpBuf, "+%u %s", v54, v63);
7547 break; 7390 break;
7548 case 8: 7391 case 8:
7549 Party::GiveFood(5 * thisa); 7392 Party::GiveFood(5 * thisa);
7550 v63 = pGlobalTXT_LocalizationStrings[653]; //"Food" 7393 sprintf(pTmpBuf, "+%u %s",5 * thisa , pGlobalTXT_LocalizationStrings[653]);//"Food"
7551 v54 = 5 * thisa;
7552 sprintf(pTmpBuf, "+%u %s", v54, v63);
7553 break; 7394 break;
7554 case 9u: 7395 case 9u:
7555 v63 = pGlobalTXT_LocalizationStrings[LOCSTR_SKILL_POINTS];
7556 v3->uSkillPoints += 2 * thisa; 7396 v3->uSkillPoints += 2 * thisa;
7557 v54 = 2 * thisa; 7397 sprintf(pTmpBuf, "+%u %s", 2 * thisa, pGlobalTXT_LocalizationStrings[LOCSTR_SKILL_POINTS]);
7558 sprintf(pTmpBuf, "+%u %s", v54, v63);
7559 break; 7398 break;
7560 case 10: 7399 case 10:
7561 v63 = pGlobalTXT_LocalizationStrings[LOCSTR_EXPIRIENCE];
7562 v54 = 2500 * thisa;
7563 v3->uExperience += 2500 * thisa; 7400 v3->uExperience += 2500 * thisa;
7564 sprintf(pTmpBuf, "+%u %s", v54, v63); 7401 sprintf(pTmpBuf, "+%u %s", 2500 * thisa, pGlobalTXT_LocalizationStrings[LOCSTR_EXPIRIENCE]);
7565 break; 7402 break;
7566 case 11: 7403 case 11:
7567 v8 = rand() % 6; 7404 v8 = rand() % 6;
7568 switch (v8) 7405 switch (v8)
7569 { 7406 {
7590 case 5: 7427 case 5:
7591 v3->sResBodyBase += thisa; 7428 v3->sResBodyBase += thisa;
7592 v13 = pGlobalTXT_LocalizationStrings[29]; 7429 v13 = pGlobalTXT_LocalizationStrings[29];
7593 break; 7430 break;
7594 } 7431 }
7595 v62 = pGlobalTXT_LocalizationStrings[121]; 7432 sprintf(pTmpBuf, "+%u %s %s", thisa, v13, pGlobalTXT_LocalizationStrings[121]);
7596 v53 = v13;
7597 v49 = thisa;
7598 sprintf(pTmpBuf, "+%u %s %s", v49, v53, v62);
7599 break; 7433 break;
7600 7434
7601 } 7435 }
7602 ShowStatusBarString(pTmpBuf, 2u); 7436 ShowStatusBarString(pTmpBuf, 2u);
7603 pMouse->RemoveHoldingItem(); 7437 pMouse->RemoveHoldingItem();
7604 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, player_num - 1); 7438 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, player_num - 1);
7605 v3->PlaySound(SPEECH_93, 0); 7439 v3->PlaySound(SPEECH_93, 0);
7606 pAudioPlayer->PlaySound((SoundID)(SOUND_Bell|0x2), 0, 0, -1, 0, 0, 0, 0); 7440 pAudioPlayer->PlaySound((SoundID)219, 0, 0, -1, 0, 0, 0, 0);
7607 if ( pParty->uDaysPlayed == 6 || pParty->uDaysPlayed == 20 ) 7441 if ( pParty->uDaysPlayed == 6 || pParty->uDaysPlayed == 20 )
7608 { 7442 {
7609 v3->SetCondition(Condition_Eradicated, 0); 7443 v3->SetCondition(Condition_Eradicated, 0);
7610 pAudioPlayer->PlaySound((SoundID)215, 0, 0, -1, 0, 0, 0, 0); 7444 pAudioPlayer->PlaySound((SoundID)215, 0, 0, -1, 0, 0, 0, 0);
7611 } 7445 }
7640 else if ( pParty->pPickedItem.uItemID == 634 ) //Gryphonheart's Trumpet 7474 else if ( pParty->pPickedItem.uItemID == 634 ) //Gryphonheart's Trumpet
7641 { 7475 {
7642 pAudioPlayer->PlaySound((SoundID)135, 0, 0, -1, 0, 0, 0, 0); 7476 pAudioPlayer->PlaySound((SoundID)135, 0, 0, -1, 0, 0, 0, 0);
7643 return; 7477 return;
7644 } 7478 }
7645 else if ( pParty->pPickedItem.uItemID == 646 ) 7479 else if ( pParty->pPickedItem.uItemID == 646 ) //Horseshoe
7646 { 7480 {
7647 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, player_num - 1); 7481 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, player_num - 1);
7648 v5 = 8 * player_num + 392; 7482 v5 = PID(OBJECT_Player,player_num + 49);
7649 LOBYTE(v5) = PID(OBJECT_Player,player_num - 120);
7650 pAudioPlayer->PlaySound(SOUND_20001, v5, 0, -1, 0, 0, 0, 0); 7483 pAudioPlayer->PlaySound(SOUND_20001, v5, 0, -1, 0, 0, 0, 0);
7651 v3->AddVariable(VAR_NumSkillPoints, 2); 7484 v3->AddVariable(VAR_NumSkillPoints, 2);
7652 } 7485 }
7653 else if ( pParty->pPickedItem.uItemID == 650 ) //Temple in a Bottle 7486 else if ( pParty->pPickedItem.uItemID == 650 ) //Temple in a Bottle
7654 { 7487 {
7657 } 7490 }
7658 else 7491 else
7659 { 7492 {
7660 7493
7661 v68 = pParty->pPickedItem.GetDisplayName(); 7494 v68 = pParty->pPickedItem.GetDisplayName();
7662 v58 = pGlobalTXT_LocalizationStrings[36]; 7495 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[36],v68);//"%s can not be used that way"
7663 sprintfex(pTmpBuf, v58, v68); 7496 ShowStatusBarString(pTmpBuf, 2u);
7664 v23 = pTmpBuf; 7497 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
7665 ShowStatusBarString(v23, 2u);
7666 v4 = 0;
7667 v61 = v4;
7668 v52 = v4;
7669 v48 = v4;
7670 v45 = v4;
7671 v43 = -1;
7672 v41 = v4;
7673 v39 = v4;
7674 v37 = (SoundID)27;
7675 pAudioPlayer->PlaySound(v37, v39, v41, v43, v45, v48, v52, v61);
7676 return; 7498 return;
7677 } 7499 }
7678 7500
7679 LABEL_187:
7680 pMouse->RemoveHoldingItem(); 7501 pMouse->RemoveHoldingItem();
7681 return; 7502 return;
7682 } 7503 }
7683 7504
7684 } 7505 }