comparison Player.cpp @ 1021:67e33708d815

player use item continue cleanup
author Gloval
date Tue, 21 May 2013 08:53:43 +0400
parents 3413ad40cc88
children 9408f98f4929 3a5c8df8381d b725a9cdec0c
comparison
equal deleted inserted replaced
1020:3413ad40cc88 1021:67e33708d815
5414 v9 = this->GetEquippedItemEquipType(EQUIP_MAIN_HAND); 5414 v9 = this->GetEquippedItemEquipType(EQUIP_MAIN_HAND);
5415 if ( v9 >= 0 ) 5415 if ( v9 >= 0 )
5416 { 5416 {
5417 if ( v9 <= 2 ) 5417 if ( v9 <= 2 )
5418 { 5418 {
5419 v5 = pItemsTable->pItems[this->pInventoryItems[this->pEquipment.uMainHand].uItemID].uDamageDice + pItemsTable->pItems[this->pInventoryItems[this->pEquipment.uMainHand].uItemID].uDamageMod; 5419 v5 = pItemsTable->pItems[this->pInventoryItems[this->pEquipment.uMainHand].uItemID].uDamageDice +
5420 pItemsTable->pItems[this->pInventoryItems[this->pEquipment.uMainHand].uItemID].uDamageMod;
5420 if ( !v6->pEquipment.uShield ) 5421 if ( !v6->pEquipment.uShield )
5421 { 5422 {
5422 if ( pItemsTable->pItems[this->pInventoryItems[this->pEquipment.uMainHand].uItemID].uSkillType == 4 ) 5423 if ( pItemsTable->pItems[this->pInventoryItems[this->pEquipment.uMainHand].uItemID].uSkillType == 4 )
5423 ++v5; 5424 ++v5;
5424 } 5425 }
6314 uSpeed = StatTable[v1][5].uBaseValue; 6315 uSpeed = StatTable[v1][5].uBaseValue;
6315 uLuck = StatTable[v1][6].uBaseValue; 6316 uLuck = StatTable[v1][6].uBaseValue;
6316 } 6317 }
6317 6318
6318 //----- (004901FC) -------------------------------------------------------- 6319 //----- (004901FC) --------------------------------------------------------
6319 int Player::SetSexByVoice() 6320 void Player::SetSexByVoice()
6320 { 6321 {
6321 __int64 v1; // qax@1 6322 switch ( this->uVoiceID)
6322
6323 v1 = this->uVoiceID;
6324 switch ( (int)v1 )
6325 { 6323 {
6326 case 0: 6324 case 0:
6327 case 1: 6325 case 1:
6328 case 2: 6326 case 2:
6329 case 3: 6327 case 3:
6333 case 0xD: 6331 case 0xD:
6334 case 0x10: 6332 case 0x10:
6335 case 0x11: 6333 case 0x11:
6336 case 0x14: 6334 case 0x14:
6337 case 0x17: 6335 case 0x17:
6338 BYTE4(v1) = 0; 6336 this->uSex = SEX_MALE;
6339 break; 6337 break;
6340 case 4: 6338 case 4:
6341 case 5: 6339 case 5:
6342 case 6: 6340 case 6:
6343 case 7: 6341 case 7:
6347 case 0xF: 6345 case 0xF:
6348 case 0x12: 6346 case 0x12:
6349 case 0x13: 6347 case 0x13:
6350 case 0x15: 6348 case 0x15:
6351 case 0x18: 6349 case 0x18:
6352 BYTE4(v1) = 1; 6350 this->uSex = SEX_FEMALE;
6353 break; 6351 break;
6354 default: 6352 default:
6355 break; 6353 break;
6356 } 6354 }
6357 this->uSex = (PLAYER_SEX)BYTE4(v1); 6355
6358 return v1;
6359 } 6356 }
6360 6357
6361 //----- (0049024A) -------------------------------------------------------- 6358 //----- (0049024A) --------------------------------------------------------
6362 void Player::Reset(PLAYER_CLASS_TYPE cls) 6359 void Player::Reset(PLAYER_CLASS_TYPE cls)
6363 { 6360 {
6835 return false; 6832 return false;
6836 } 6833 }
6837 6834
6838 //----- (004680ED) -------------------------------------------------------- 6835 //----- (004680ED) --------------------------------------------------------
6839 void Player::UseItem_DrinkPotion_etc(signed int player_num, int a3) 6836 void Player::UseItem_DrinkPotion_etc(signed int player_num, int a3)
6840 { 6837 {
6841 Player *v3; // esi@1 6838 Player *v3; // esi@1
6842 unsigned int v4; // ebx@4 6839 unsigned int v4; // ebx@4
6843 signed int v5; // eax@17 6840 signed int v5; // eax@17
6844 unsigned int v6; // eax@26 6841 unsigned int v6; // eax@26
6845 unsigned __int8 v7; // cf@37 6842 unsigned __int8 v7; // cf@37
6846 int v8; // edx@39 6843 int v8; // edx@39
6847 int v9; // edx@40 6844 int v9; // edx@40
6848 int v10; // edx@41 6845 int v10; // edx@41
6849 int v11; // edx@42 6846 int v11; // edx@42
6850 int v12; // edx@43 6847 int v12; // edx@43
6851 char *v13; // eax@45 6848 char *v13; // eax@45
6852 AudioPlayer *v14; // ecx@62 6849 AudioPlayer *v14; // ecx@62
6853 signed int v15; // edi@68 6850 signed int v15; // edi@68
6854 int v16; // edx@73 6851 int v16; // edx@73
6855 unsigned __int16 *v17; // edi@73 6852 unsigned __int16 v17; // edi@73
6856 unsigned int v18; // eax@73 6853 unsigned int v18; // eax@73
6857 int v19; // eax@74 6854 int v19; // eax@74
6858 int v20; // eax@75 6855 int v20; // eax@75
6859 signed int v21; // eax@81 6856 signed int v21; // eax@81
6860 const char *v22; // eax@84 6857 const char *v22; // eax@84
6861 char *v23; // ecx@90 6858 char *v23; // ecx@90
6862 int scroll_id; // esi@96 6859 int scroll_id; // esi@96
6863 int v25; // eax@109 6860 int v25; // eax@109
6864 int v26; // eax@113 6861 int v26; // eax@113
6865 int new_mana_val; // edi@114 6862 int new_mana_val; // edi@114
6866 signed __int64 v28; // qax@120 6863 signed __int64 v28; // qax@120
6867 char *v29; // ecx@120 6864 char *v29; // ecx@120
6868 __int64 v30; // edi@137 6865 __int64 v30; // edi@137
6869 int v31; // ST30_4@137 6866 int v31; // ST30_4@137
6870 __int64 v32; // ST3C_4@137 6867 __int64 v32; // ST3C_4@137
6871 int v33; // ST40_4@137 6868 int v33; // ST40_4@137
6872 __int64 v34; // ST34_4@137 6869 __int64 v34; // ST34_4@137
6873 int v35; // ST38_4@137 6870 int v35; // ST38_4@137
6874 unsigned __int8 v36; // al@173 6871 unsigned __int8 v36; // al@173
6875 SoundID v37; // [sp-20h] [bp-4Ch]@18 6872 SoundID v37; // [sp-20h] [bp-4Ch]@18
6876 SoundID v38; // [sp-20h] [bp-4Ch]@174 6873 SoundID v38; // [sp-20h] [bp-4Ch]@174
6877 signed int v39; // [sp-1Ch] [bp-48h]@18 6874 signed int v39; // [sp-1Ch] [bp-48h]@18
6878 signed int v40; // [sp-1Ch] [bp-48h]@174 6875 signed int v40; // [sp-1Ch] [bp-48h]@174
6879 unsigned int v41; // [sp-18h] [bp-44h]@18 6876 unsigned int v41; // [sp-18h] [bp-44h]@18
6880 unsigned int v42; // [sp-18h] [bp-44h]@174 6877 unsigned int v42; // [sp-18h] [bp-44h]@174
6881 signed int v43; // [sp-14h] [bp-40h]@18 6878 signed int v43; // [sp-14h] [bp-40h]@18
6882 signed int v44; // [sp-14h] [bp-40h]@174 6879 signed int v44; // [sp-14h] [bp-40h]@174
6883 signed int v45; // [sp-10h] [bp-3Ch]@18 6880 signed int v45; // [sp-10h] [bp-3Ch]@18
6884 unsigned __int16 v46; // [sp-10h] [bp-3Ch]@120 6881 unsigned __int16 v46; // [sp-10h] [bp-3Ch]@120
6885 signed int v47; // [sp-10h] [bp-3Ch]@174 6882 signed int v47; // [sp-10h] [bp-3Ch]@174
6886 int v48; // [sp-Ch] [bp-38h]@18 6883 int v48; // [sp-Ch] [bp-38h]@18
6887 unsigned int v49; // [sp-Ch] [bp-38h]@33 6884 unsigned int v49; // [sp-Ch] [bp-38h]@33
6888 unsigned __int16 v50; // [sp-Ch] [bp-38h]@120 6885 unsigned __int16 v50; // [sp-Ch] [bp-38h]@120
6889 int v51; // [sp-Ch] [bp-38h]@174 6886 int v51; // [sp-Ch] [bp-38h]@174
6890 unsigned int v52; // [sp-8h] [bp-34h]@18 6887 unsigned int v52; // [sp-8h] [bp-34h]@18
6891 char *v53; // [sp-8h] [bp-34h]@33 6888 char *v53; // [sp-8h] [bp-34h]@33
6892 int v54; // [sp-8h] [bp-34h]@34 6889 int v54; // [sp-8h] [bp-34h]@34
6893 unsigned int v55; // [sp-8h] [bp-34h]@60 6890 unsigned int v55; // [sp-8h] [bp-34h]@60
6894 int v56; // [sp-8h] [bp-34h]@66 6891 int v56; // [sp-8h] [bp-34h]@66
6895 const char *v57; // [sp-8h] [bp-34h]@69 6892 const char *v57; // [sp-8h] [bp-34h]@69
6896 const char *v58; // [sp-8h] [bp-34h]@89 6893 const char *v58; // [sp-8h] [bp-34h]@89
6897 int v59; // [sp-8h] [bp-34h]@120 6894 int v59; // [sp-8h] [bp-34h]@120
6898 unsigned int v60; // [sp-8h] [bp-34h]@174 6895 unsigned int v60; // [sp-8h] [bp-34h]@174
6899 int v61; // [sp-4h] [bp-30h]@18 6896 int v61; // [sp-4h] [bp-30h]@18
6900 char *v62; // [sp-4h] [bp-30h]@33 6897 char *v62; // [sp-4h] [bp-30h]@33
6901 char *v63; // [sp-4h] [bp-30h]@34 6898 char *v63; // [sp-4h] [bp-30h]@34
6902 int v64; // [sp-4h] [bp-30h]@60 6899 int v64; // [sp-4h] [bp-30h]@60
6903 int v65; // [sp-4h] [bp-30h]@66 6900 int v65; // [sp-4h] [bp-30h]@66
6904 const char *v66; // [sp-4h] [bp-30h]@69 6901 const char *v66; // [sp-4h] [bp-30h]@69
6905 signed int v67; // [sp-4h] [bp-30h]@77 6902 signed int v67; // [sp-4h] [bp-30h]@77
6906 const char *v68; // [sp-4h] [bp-30h]@89 6903 const char *v68; // [sp-4h] [bp-30h]@89
6907 int v69; // [sp-4h] [bp-30h]@110 6904 int v69; // [sp-4h] [bp-30h]@110
6908 unsigned __int8 v70; // [sp-4h] [bp-30h]@120 6905 unsigned __int8 v70; // [sp-4h] [bp-30h]@120
6909 int v71; // [sp-4h] [bp-30h]@174 6906 int v71; // [sp-4h] [bp-30h]@174
6910 char *v72; // [sp+20h] [bp-Ch]@68 6907 char v72; // [sp+20h] [bp-Ch]@68
6911 signed int v73; // [sp+24h] [bp-8h]@1 6908 signed int v73; // [sp+24h] [bp-8h]@1
6912 char *v74; // [sp+24h] [bp-8h]@23 6909 char *v74; // [sp+24h] [bp-8h]@23
6913 int v75; // [sp+24h] [bp-8h]@73 6910 int v75; // [sp+24h] [bp-8h]@73
6914 Player *thisb; // [sp+28h] [bp-4h]@1 6911 Player *thisb; // [sp+28h] [bp-4h]@1
6915 unsigned int thisa; // [sp+28h] [bp-4h]@22 6912 unsigned int thisa; // [sp+28h] [bp-4h]@22
6916 6913
6917 thisb = this; 6914 thisb = this;
6918 v3 = &pParty->pPlayers[player_num-1]; 6915 v3 = &pParty->pPlayers[player_num-1];
6919 v73 = 1; 6916 v73 = 1;
6920 if ( pParty->bTurnBasedModeOn == 1 && (pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 3) ) 6917 if ( pParty->bTurnBasedModeOn == 1 && (pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 3) )
6921 return; 6918 return;
6922 v4 = 0; 6919 v4 = 0;
6923 if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType == EQUIP_REAGENT ) 6920 if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType == EQUIP_REAGENT )
6924 {
6925 if ( pParty->pPickedItem.uItemID != 160 )
6926 {
6927 if ( pParty->pPickedItem.uItemID == 161 )
6928 {
6929 new_mana_val = v3->sMana;
6930 new_mana_val += 2;
6931
6932 if ( new_mana_val > v3->GetMaxMana() )
6933 new_mana_val = v3->GetMaxMana();
6934 }
6935 else
6936 {
6937 if ( pParty->pPickedItem.uItemID != 162 )
6938 { 6921 {
6939 6922 if ( pParty->pPickedItem.uItemID == 160 )
6940 v68 = pParty->pPickedItem.GetDisplayName(); 6923 {
6941 v58 = pGlobalTXT_LocalizationStrings[36]; 6924 pParty->pPlayers[player_num-1].SetCondition(Condition_Poison1, 1);
6942 goto LABEL_90; 6925 }
6943 } 6926 else if ( pParty->pPickedItem.uItemID == 161 )
6944 v69 = 2;
6945
6946 pParty->pPlayers[player_num-1].Heal(v69);
6947 }
6948 v3->PlaySound(SPEECH_36, 0);
6949 goto LABEL_173;
6950 }
6951 pParty->pPlayers[player_num-1].SetCondition(Condition_Poison1, 1);
6952 goto LABEL_173;
6953 }
6954 if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType == EQUIP_POTION )
6955 {
6956 switch ( pParty->pPickedItem.uItemID )
6957 {
6958 case 221: //Catalyst
6959 pParty->pPlayers[player_num-1].SetCondition(Condition_Poison1, 1);
6960 goto LABEL_173;
6961 case 222: //Cure Wounds
6962 v25 = pParty->pPickedItem.uEnchantmentType + 10;
6963 pParty->pPlayers[player_num-1].Heal(v25);
6964 v3->PlaySound(SPEECH_36, 0);
6965 goto LABEL_173;
6966 case 223: //Magic Potion
6967 v26 = pParty->pPickedItem.uEnchantmentType + 10;
6968 new_mana_val = v3->sMana;
6969 new_mana_val += v26;
6970 if ( new_mana_val > v3->GetMaxMana() )
6971 new_mana_val = v3->GetMaxMana();
6972 v3->PlaySound(SPEECH_36, 0);
6973 goto LABEL_173;
6974 case 224: //Cure Weakness
6975 v3->pConditions[Condition_Weak] = 0i64;
6976 v3->PlaySound(SPEECH_36, 0);
6977 goto LABEL_173;
6978 case 225: //Cure Disease
6979 v3->pConditions[Condition_Disease3] = 0i64;
6980 v3->pConditions[Condition_Disease2] = 0i64;
6981 v3->pConditions[Condition_Disease1] = 0i64;
6982 v3->PlaySound(SPEECH_36, 0);
6983 goto LABEL_173;
6984 case 226: //Cure Poison
6985 v3->pConditions[Condition_Poison3] = 0i64;
6986 v3->pConditions[Condition_Poison2] = 0i64;
6987 v3->pConditions[Condition_Poison1] = 0i64;
6988 v3->PlaySound(SPEECH_36, 0);
6989 goto LABEL_173;
6990 case 227: //Awaken
6991 v3->pConditions[Condition_Sleep] = 0i64;
6992 v3->PlaySound(SPEECH_36, 0);
6993 goto LABEL_173;
6994 case 228: //Haste
6995 if ( !v3->pConditions[Condition_Weak] )
6996 { 6927 {
6997 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); 6928 new_mana_val = v3->sMana;
6998 v3->pPlayerBuffs[7].Apply(pParty->uTimePlayed + v28, 3, 5, 0, 0); 6929 new_mana_val += 2;
6930 if ( new_mana_val > v3->GetMaxMana() )
6931 new_mana_val = v3->GetMaxMana();
6999 v3->PlaySound(SPEECH_36, 0); 6932 v3->PlaySound(SPEECH_36, 0);
7000 } 6933 }
6934 else if ( pParty->pPickedItem.uItemID == 162 )
6935 {
6936 pParty->pPlayers[player_num-1].Heal(2);
6937 v3->PlaySound(SPEECH_36, 0);
6938
6939 }
6940 else
6941 {
6942 v68 = pParty->pPickedItem.GetDisplayName();
6943 v58 = pGlobalTXT_LocalizationStrings[36];//"%s can not be used that way"
6944 sprintfex(pTmpBuf, v58, v68);
6945 ShowStatusBarString(pTmpBuf, 2);
6946 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
6947 return;
6948 }
7001 goto LABEL_173; 6949 goto LABEL_173;
7002 case 229: //Heroism 6950
7003 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); 6951 }
7004 v3->pPlayerBuffs[8].Apply(pParty->uTimePlayed + v28, 3, 5, 0, 0); 6952 if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType == EQUIP_POTION )
7005 v3->PlaySound(SPEECH_36, 0); 6953 {
6954 switch ( pParty->pPickedItem.uItemID )
6955 {
6956 case 221: //Catalyst
6957 pParty->pPlayers[player_num-1].SetCondition(Condition_Poison1, 1);
6958 break;
6959 case 222: //Cure Wounds
6960 v25 = pParty->pPickedItem.uEnchantmentType + 10;
6961 pParty->pPlayers[player_num-1].Heal(v25);
6962 v3->PlaySound(SPEECH_36, 0);
6963 break;
6964 case 223: //Magic Potion
6965 v26 = pParty->pPickedItem.uEnchantmentType + 10;
6966 new_mana_val = v3->sMana;
6967 new_mana_val += v26;
6968 if ( new_mana_val > v3->GetMaxMana() )
6969 new_mana_val = v3->GetMaxMana();
6970 v3->PlaySound(SPEECH_36, 0);
6971 break;
6972 case 224: //Cure Weakness
6973 v3->pConditions[Condition_Weak] = 0i64;
6974 v3->PlaySound(SPEECH_36, 0);
6975 break;
6976 case 225: //Cure Disease
6977 v3->pConditions[Condition_Disease3] = 0i64;
6978 v3->pConditions[Condition_Disease2] = 0i64;
6979 v3->pConditions[Condition_Disease1] = 0i64;
6980 v3->PlaySound(SPEECH_36, 0);
6981 break;
6982 case 226: //Cure Poison
6983 v3->pConditions[Condition_Poison3] = 0i64;
6984 v3->pConditions[Condition_Poison2] = 0i64;
6985 v3->pConditions[Condition_Poison1] = 0i64;
6986 v3->PlaySound(SPEECH_36, 0);
6987 break;
6988 case 227: //Awaken
6989 v3->pConditions[Condition_Sleep] = 0i64;
6990 v3->PlaySound(SPEECH_36, 0);
6991 break;
6992 case 228: //Haste
6993 if ( !v3->pConditions[Condition_Weak] )
6994 {
6995 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
6996 v3->pPlayerBuffs[7].Apply(pParty->uTimePlayed + v28, 3, 5, 0, 0);
6997 v3->PlaySound(SPEECH_36, 0);
6998 }
6999 break;
7000 case 229: //Heroism
7001 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7002 v3->pPlayerBuffs[8].Apply(pParty->uTimePlayed + v28, 3, 5, 0, 0);
7003 v3->PlaySound(SPEECH_36, 0);
7004 break;
7005 case 230: //Bless
7006 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7007 v3->pPlayerBuffs[1].Apply(pParty->uTimePlayed + v28, 3, 5, 0, 0);
7008 v3->PlaySound(SPEECH_36, 0);
7009 break;
7010 case 231: //Preservation
7011 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
7012 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7013 v3->pPlayerBuffs[11].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7014 v3->PlaySound(SPEECH_36, 0);
7015 break;
7016 case 232: //Shield
7017 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
7018 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7019 v3->pPlayerBuffs[13].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7020 v3->PlaySound(SPEECH_36, 0);
7021 break;
7022 case 234: //Stoneskin
7023 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7024 v3->pPlayerBuffs[14].Apply(pParty->uTimePlayed + v28, 3, 5, 0, 0);
7025 v3->PlaySound(SPEECH_36, 0);
7026 break;
7027 case 235: //Water Breathing
7028 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335),
7029 v3->pPlayerBuffs[23].Apply(pParty->uTimePlayed +v28, 3, 5, 0, 0);
7030 break;
7031 case 237: //Remove Fear
7032 v3->pConditions[Condition_Fear] = 0i64;
7033 v3->PlaySound(SPEECH_36, 0);
7034 break;
7035 case 238: //Remove Curse
7036 v3->pConditions[Condition_Cursed] = 0i64;
7037 v3->PlaySound(SPEECH_36, 0);
7038 break;
7039 case 239: //Cure Insanity
7040 v3->pConditions[Condition_Insane] = 0i64;
7041 v3->PlaySound(SPEECH_36, 0);
7042 break;
7043 case 240: //Might Boost
7044 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
7045 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7046 v3->pPlayerBuffs[19].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7047 v3->PlaySound(SPEECH_36, 0);
7048 break;
7049 case 241: //Intellect Boost
7050 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
7051 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7052 v3->pPlayerBuffs[17].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7053 v3->PlaySound(SPEECH_36, 0);
7054 break;
7055 case 242: //Personality Boost
7056 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
7057 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7058 v3->pPlayerBuffs[20].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7059 v3->PlaySound(SPEECH_36, 0);
7060 break;
7061 case 243://Endurance Boost
7062 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
7063 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7064 v3->pPlayerBuffs[16].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7065 v3->PlaySound(SPEECH_36, 0);
7066 break;
7067 case 244: //Speed Boost
7068 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
7069 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7070 v3->pPlayerBuffs[21].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7071 v3->PlaySound(SPEECH_36, 0);
7072 break;
7073 case 245: //Accuracy Boost
7074 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
7075 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7076 v3->pPlayerBuffs[15].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7077 v3->PlaySound(SPEECH_36, 0);
7078 break;
7079 case 251: //Cure Paralysis
7080 v3->pConditions[Condition_Paralyzed] = 0i64;
7081 v3->PlaySound(SPEECH_36, 0);
7082 break;
7083 case 252://Divine Restoration
7084 v30 = v3->pConditions[Condition_Dead];
7085 v32 = v3->pConditions[Condition_Pertified];
7086 v34 = v3->pConditions[Condition_Eradicated];
7087 memset(&pParty->pPlayers[player_num-1].pConditions,0,sizeof(pConditions));
7088 v3->pConditions[Condition_Dead] = v30;
7089 v3->pConditions[Condition_Pertified] = v32;
7090 v3->pConditions[Condition_Eradicated] = v34;
7091 v3->PlaySound(SPEECH_36, 0);
7092 break;
7093 case 253: //Divine Cure
7094 v25 = 5 * pParty->pPickedItem.uEnchantmentType;
7095 pParty->pPlayers[player_num-1].Heal(v25);
7096 v3->PlaySound(SPEECH_36, 0);
7097 break;
7098 case 254: //Divine Power
7099 v26 = 5 * pParty->pPickedItem.uEnchantmentType;
7100 new_mana_val = v3->sMana;
7101 new_mana_val += v26;
7102 if ( new_mana_val > v3->GetMaxMana() )
7103 new_mana_val = v3->GetMaxMana();
7104 v3->PlaySound(SPEECH_36, 0);
7105 break;
7106 case 255: //Luck Boost
7107 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
7108 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7109 v3->pPlayerBuffs[18].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7110 v3->PlaySound(SPEECH_36, 0);
7111 break;
7112 case 256: //Fire Resistance
7113 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
7114 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7115 v3->pPlayerBuffs[5].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7116 v3->PlaySound(SPEECH_36, 0);
7117 goto LABEL_173;
7118 case 257: //Air Resistance
7119 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
7120 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7121 v3->pPlayerBuffs[0].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7122 v3->PlaySound(SPEECH_36, 0);
7123 break;
7124 case 258: //Water Resistance
7125 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
7126 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7127 v3->pPlayerBuffs[22].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7128 v3->PlaySound(SPEECH_36, 0);
7129 break;
7130 case 259: //Earth Resistance
7131 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
7132 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7133 v3->pPlayerBuffs[3].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7134 v3->PlaySound(SPEECH_36, 0);
7135 break;
7136 case 260: //Mind Resistance
7137 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
7138 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7139 v3->pPlayerBuffs[9].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7140 v3->PlaySound(SPEECH_36, 0);
7141 break;
7142 case 261: //Body Resistance
7143 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
7144 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7145 v3->pPlayerBuffs[2].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7146 v3->PlaySound(SPEECH_36, 0);
7147 break;
7148 case 262: //Stone to Flesh
7149 v3->pConditions[Condition_Pertified] = 0i64;
7150 v3->PlaySound(SPEECH_36, 0);
7151 break;
7152 case 264: //Pure Luck
7153 if ( !v3->pure_luck_used )
7154 {
7155 v3->uLuck += 50;
7156 v3->pure_luck_used = 1;
7157 }
7158 v3->PlaySound(SPEECH_36, 0);
7159 break;
7160 case 265: //Pure Speed
7161 if ( !v3->pure_speed_used )
7162 {
7163 v3->uSpeed += 50;
7164 v3->pure_speed_used = 1;
7165 }
7166 v3->PlaySound(SPEECH_36, 0);
7167 break;
7168 case 266: //Pure Intellect
7169 if ( !v3->pure_intellect_used )
7170 {
7171 v3->uIntelligence += 50;
7172 v3->pure_intellect_used = 1;
7173 }
7174 v3->PlaySound(SPEECH_36, 0);
7175 break;
7176 case 267: //Pure Endurance
7177 if ( !v3->pure_endurance_used )
7178 {
7179 v3->uEndurance += 50;
7180 v3->pure_endurance_used = 1;
7181 }
7182 v3->PlaySound(SPEECH_36, 0);
7183 break;
7184 case 268: //Pure Personality
7185 if ( !v3->pure_willpower_used )
7186 {
7187 v3->uWillpower += 50;
7188 v3->pure_willpower_used = 1;
7189 }
7190 v3->PlaySound(SPEECH_36, 0);
7191 break;
7192 case 269: //Pure Accuracy
7193 if ( !v3->pure_accuracy_used )
7194 {
7195 v3->uAccuracy += 50;
7196 v3->pure_accuracy_used = 1;
7197 }
7198 v3->PlaySound(SPEECH_36, 0);
7199 break;
7200 case 270: //Pure Might
7201 if ( !v3->pure_might_used )
7202 {
7203 v3->uMight += 50;
7204 v3->pure_might_used = 1;
7205 }
7206 v3->PlaySound(SPEECH_36, 0);
7207 break;
7208 case 271: //Rejuvenation
7209 v3->sAgeModifier = 0;
7210 v3->PlaySound(SPEECH_36, 0);
7211 break;
7212
7213 default:
7214 v68 = pParty->pPickedItem.GetDisplayName();
7215 v58 = pGlobalTXT_LocalizationStrings[36]; //"%s can not be used that way"
7216 sprintfex(pTmpBuf, v58, v68);
7217 ShowStatusBarString(pTmpBuf, 2u);
7218 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
7219 return;
7220
7221 }
7222 // pParty->pPlayers[player_num-1].SetCondition(Condition_Poison1, 1);
7006 goto LABEL_173; 7223 goto LABEL_173;
7007 case 230: //Bless 7224 }
7008 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); 7225
7009 v3->pPlayerBuffs[1].Apply(pParty->uTimePlayed + v28, 3, 5, 0, 0); 7226
7010 v3->PlaySound(SPEECH_36, 0); 7227 if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType == EQUIP_SPELL_SCROLL )
7011 goto LABEL_173;
7012 case 231: //Preservation
7013 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
7014 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7015 v3->pPlayerBuffs[11].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7016 v3->PlaySound(SPEECH_36, 0);
7017 goto LABEL_173;
7018 case 232: //Shield
7019 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
7020 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7021 v3->pPlayerBuffs[13].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7022 v3->PlaySound(SPEECH_36, 0);
7023 goto LABEL_173;
7024 case 234: //Stoneskin
7025 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7026 v3->pPlayerBuffs[14].Apply(pParty->uTimePlayed + v28, 3, 5, 0, 0);
7027 v3->PlaySound(SPEECH_36, 0);
7028 goto LABEL_173;
7029 case 235: //Water Breathing
7030 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335),
7031 v3->pPlayerBuffs[23].Apply(pParty->uTimePlayed +v28, 3, 5, 0, 0);
7032 goto LABEL_173;
7033 case 237: //Remove Fear
7034 v3->pConditions[Condition_Fear] = 0i64;
7035 v3->PlaySound(SPEECH_36, 0);
7036 goto LABEL_173;
7037 case 238: //Remove Curse
7038 v3->pConditions[Condition_Cursed] = 0i64;
7039 v3->PlaySound(SPEECH_36, 0);
7040 goto LABEL_173;
7041 case 239: //Cure Insanity
7042 v3->pConditions[Condition_Insane] = 0i64;
7043 v3->PlaySound(SPEECH_36, 0);
7044 goto LABEL_173;
7045 case 240: //Might Boost
7046 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
7047 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7048 v3->pPlayerBuffs[19].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7049 v3->PlaySound(SPEECH_36, 0);
7050 goto LABEL_173;
7051 case 241: //Intellect Boost
7052 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
7053 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7054 v3->pPlayerBuffs[17].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7055 v3->PlaySound(SPEECH_36, 0);
7056 goto LABEL_173;
7057 case 242: //Personality Boost
7058 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
7059 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7060 v3->pPlayerBuffs[20].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7061 v3->PlaySound(SPEECH_36, 0);
7062 goto LABEL_173;
7063 case 243://Endurance Boost
7064 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
7065 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7066 v3->pPlayerBuffs[16].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7067 v3->PlaySound(SPEECH_36, 0);
7068 goto LABEL_173;
7069 case 244: //Speed Boost
7070 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
7071 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7072 v3->pPlayerBuffs[21].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7073 v3->PlaySound(SPEECH_36, 0);
7074 goto LABEL_173;
7075 case 245: //Accuracy Boost
7076 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
7077 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7078 v3->pPlayerBuffs[15].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7079 v3->PlaySound(SPEECH_36, 0);
7080 goto LABEL_173;
7081 case 251: //Cure Paralysis
7082 v3->pConditions[Condition_Paralyzed] = 0i64;
7083 v3->PlaySound(SPEECH_36, 0);
7084 goto LABEL_173;
7085 case 252://Divine Restoration
7086 v30 = v3->pConditions[Condition_Dead];
7087 v32 = v3->pConditions[Condition_Pertified];
7088 v34 = v3->pConditions[Condition_Eradicated];
7089 memset(&pParty->pPlayers[player_num-1].pConditions,0,sizeof(pConditions));
7090 v3->pConditions[Condition_Dead] = v30;
7091 v3->pConditions[Condition_Pertified] = v32;
7092 v3->pConditions[Condition_Eradicated] = v34;
7093 v3->PlaySound(SPEECH_36, 0);
7094 goto LABEL_173;
7095 case 253: //Divine Cure
7096 v25 = 5 * pParty->pPickedItem.uEnchantmentType;
7097 pParty->pPlayers[player_num-1].Heal(v25);
7098 v3->PlaySound(SPEECH_36, 0);
7099 goto LABEL_173;
7100 case 254: //Divine Power
7101 v26 = 5 * pParty->pPickedItem.uEnchantmentType;
7102 new_mana_val = v3->sMana;
7103 new_mana_val += v26;
7104 if ( new_mana_val > v3->GetMaxMana() )
7105 new_mana_val = v3->GetMaxMana();
7106 v3->PlaySound(SPEECH_36, 0);
7107 goto LABEL_173;
7108 case 255: //Luck Boost
7109 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
7110 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7111 v3->pPlayerBuffs[18].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7112 v3->PlaySound(SPEECH_36, 0);
7113 goto LABEL_173;
7114 case 256: //Fire Resistance
7115 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
7116 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7117 v3->pPlayerBuffs[5].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7118 v3->PlaySound(SPEECH_36, 0);
7119 goto LABEL_173;
7120 case 257: //Air Resistance
7121 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
7122 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7123 v3->pPlayerBuffs[0].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7124 v3->PlaySound(SPEECH_36, 0);
7125 goto LABEL_173;
7126 case 258: //Water Resistance
7127 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
7128 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7129 v3->pPlayerBuffs[22].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7130 v3->PlaySound(SPEECH_36, 0);
7131 goto LABEL_173;
7132 case 259: //Earth Resistance
7133 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
7134 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7135 v3->pPlayerBuffs[3].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7136 v3->PlaySound(SPEECH_36, 0);
7137 goto LABEL_173;
7138 case 260: //Mind Resistance
7139 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
7140 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7141 v3->pPlayerBuffs[9].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7142 v3->PlaySound(SPEECH_36, 0);
7143 goto LABEL_173;
7144 case 261: //Body Resistance
7145 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
7146 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7147 v3->pPlayerBuffs[2].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7148 v3->PlaySound(SPEECH_36, 0);
7149 goto LABEL_173;
7150 case 262: //Stone to Flesh
7151 v3->pConditions[Condition_Pertified] = 0i64;
7152 v3->PlaySound(SPEECH_36, 0);
7153 goto LABEL_173;
7154 case 264: //Pure Luck
7155 if ( !v3->pure_luck_used )
7156 { 7228 {
7157 v3->uLuck += 50; 7229
7158 v3->pure_luck_used = 1; 7230
7231 if ( pCurrentScreen == SCREEN_CASTING )
7232 return;
7233 if ( !pParty->pPlayers[player_num-1].CanAct() )
7234 {
7235
7236
7237 v68 = aCharacterConditionNames[v3->GetMajorConditionIdx()];
7238 v58 = pGlobalTXT_LocalizationStrings[382];
7239 sprintfex(pTmpBuf, v58, v68);
7240 v23 = pTmpBuf;
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;
7254 }
7255 if ( bUnderwater == 1 )
7256 {
7257 v23 = pGlobalTXT_LocalizationStrings[652]; //"You can not do that while you are underwater!"
7258 ShowStatusBarString(v23, 2u);
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;
7270 }
7271 dword_50C9AC = 1;
7272 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
7274 {
7275 pMouse->RemoveHoldingItem();
7276 pGUIWindow_CurrentMenu->Release();
7277 pIcons_LOD->_4114F2();
7278 pCurrentScreen = SCREEN_GAME;
7279 viewparams->bRedrawGameUI = 1;
7280 _42777D_CastSpell_UseWand_ShootArrow(scroll_id, player_num - 1, 0x85u, 1, 0);
7281 }
7282 else
7283 {
7284 _720984_unused = pParty->pPickedItem.uItemID;
7285 pMouse->RemoveHoldingItem();
7286 pMessageQueue_50C9E8->AddMessage(UIMSG_SpellScrollUse, scroll_id, player_num - 1);
7287 if ( pCurrentScreen && pGUIWindow_CurrentMenu
7288 && (pGUIWindow_CurrentMenu->eWindowType != WINDOW_null))
7289 {
7290 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
7291 }
7292 }
7293 return;
7159 } 7294 }
7160 v3->PlaySound(SPEECH_36, 0); 7295
7161 goto LABEL_173; 7296 if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType == EQUIP_BOOK )
7162 case 265: //Pure Speed 7297
7163 if ( !v3->pure_speed_used ) 7298 {
7299 v15 = pParty->pPickedItem.uItemID - 400;
7300 v72 = v3->spellbook.bHaveSpell[pParty->pPickedItem.uItemID-400];//(char *)&v3->pConditions[0] + pParty->pPickedItem.uItemID + 2;
7301 if ( v72 )
7302 {
7303 v66 = pParty->pPickedItem.GetDisplayName();
7304 v57 = pGlobalTXT_LocalizationStrings[380];//"You already know the %s spell"
7305 LABEL_72:
7306 sprintf(pTmpBuf, v57, v66);
7307 ShowStatusBarString(pTmpBuf, 2u);
7308 LABEL_92:
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;
7322 }
7323 if ( !pParty->pPlayers[player_num-1].CanAct() )
7324 {
7325 v66 = aCharacterConditionNames[v3->GetMajorConditionIdx()];
7326 v57 = pGlobalTXT_LocalizationStrings[382];//"That player is %s"
7327 sprintf(pTmpBuf, v57, v66);
7328 ShowStatusBarString(pTmpBuf, 2u);
7329 v61 = v4;
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;
7340 }
7341 v16 = v15 % 11 + 1;
7342 v17 = v3->pActiveSkills[v15 / 11 + 12];
7343 v75 = v16;
7344 v18 = SkillToMastery(v17) - 1;
7345 if ( v18 )
7346 {
7347 v19 = v18 - 1;
7348 if ( v19 )
7349 {
7350 v20 = v19 - 1;
7351 if ( v20 )
7352 {
7353 if ( v20 != 1 )
7354 {
7355 v21 = player_num;
7356 LABEL_83:
7357 if ( v75 > v21 || !v17 )
7358 {
7359 v22 = pParty->pPickedItem.GetDisplayName();
7360 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[381], v22);
7361 ShowStatusBarString(pTmpBuf, 2u);
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 }
7430 else
7431 {
7432 v67 = 7;
7433 }
7434 }
7435 else
7436 {
7437 v67 = 4;
7438 }
7439 v21 = v67;
7440 goto LABEL_83;
7441 }
7442
7443 if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType == EQUIP_MESSAGE_SCROLL )
7444
7164 { 7445 {
7165 v3->uSpeed += 50; 7446 if ( pParty->pPlayers[player_num-1].CanAct() )
7166 v3->pure_speed_used = 1; 7447 {
7448 CreateMsgScrollWindow(pParty->pPickedItem.uItemID);
7449 v65 = 0;
7450 v56 = SPEECH_37;
7451 LABEL_67:
7452 v3->PlaySound((PlayerSpeech)v56, v65);
7453 return;
7454 }
7455 LABEL_89:
7456 v68 = aCharacterConditionNames[v3->GetMajorConditionIdx()];
7457 v58 = pGlobalTXT_LocalizationStrings[382];
7458 LABEL_90:
7459 sprintfex(pTmpBuf, v58, v68);
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;
7167 } 7474 }
7168 v3->PlaySound(SPEECH_36, 0); 7475 else
7169 goto LABEL_173;
7170 case 266: //Pure Intellect
7171 if ( !v3->pure_intellect_used )
7172 { 7476 {
7173 v3->uIntelligence += 50;
7174 v3->pure_intellect_used = 1;
7175 }
7176 v3->PlaySound(SPEECH_36, 0);
7177 goto LABEL_173;
7178 case 267: //Pure Endurance
7179 if ( !v3->pure_endurance_used )
7180 {
7181 v3->uEndurance += 50;
7182 v3->pure_endurance_used = 1;
7183 }
7184 v3->PlaySound(SPEECH_36, 0);
7185 goto LABEL_173;
7186 case 268: //Pure Personality
7187 if ( !v3->pure_willpower_used )
7188 {
7189 v3->uWillpower += 50;
7190 v3->pure_willpower_used = 1;
7191 }
7192 v3->PlaySound(SPEECH_36, 0);
7193 goto LABEL_173;
7194 case 269: //Pure Accuracy
7195 if ( !v3->pure_accuracy_used )
7196 {
7197 v3->uAccuracy += 50;
7198 v3->pure_accuracy_used = 1;
7199 }
7200 v3->PlaySound(SPEECH_36, 0);
7201 goto LABEL_173;
7202 case 270: //Pure Might
7203 if ( !v3->pure_might_used )
7204 {
7205 v3->uMight += 50;
7206 v3->pure_might_used = 1;
7207 }
7208 v3->PlaySound(SPEECH_36, 0);
7209 goto LABEL_173;
7210 case 271: //Rejuvenation
7211 v3->sAgeModifier = 0;
7212 v3->PlaySound(SPEECH_36, 0);
7213 goto LABEL_173;
7214
7215 default:
7216 v68 = pParty->pPickedItem.GetDisplayName();
7217 v58 = pGlobalTXT_LocalizationStrings[36]; //"%s can not be used that way"
7218 sprintfex(pTmpBuf, v58, v68);
7219 ShowStatusBarString(pTmpBuf, 2u);
7220 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
7221 return;
7222
7223 }
7224 pParty->pPlayers[player_num-1].SetCondition(Condition_Poison1, 1);
7225 goto LABEL_173;
7226 }
7227
7228
7229 if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType != EQUIP_SPELL_SCROLL )
7230 {
7231 if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType != EQUIP_BOOK )
7232 {
7233 if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType != EQUIP_MESSAGE_SCROLL )
7234 {
7235 if ( pParty->pPickedItem.uItemID == 616 ) //Genie Lamp 7477 if ( pParty->pPickedItem.uItemID == 616 ) //Genie Lamp
7236 { 7478 {
7237 thisa = pParty->uCurrentMonthWeek + 1; 7479 thisa = pParty->uCurrentMonthWeek + 1;
7238 if ( pParty->uCurrentMonth >= 7 ) 7480 if ( pParty->uCurrentMonth >= 7 )
7239 v74 = 0; 7481 v74 = 0;
7240 else 7482 else
7241 v74 = aAttributeNames[pParty->uCurrentMonth]; 7483 v74 = aAttributeNames[pParty->uCurrentMonth];
7242 switch ( pParty->uCurrentMonth ) 7484 switch ( pParty->uCurrentMonth )
7243 { 7485 {
7244 case 0: 7486 case 0:
7245 v6 = pParty->uCurrentMonthWeek + 1; 7487 v6 = pParty->uCurrentMonthWeek + 1;
7246 v3->uMight += thisa; 7488 v3->uMight += thisa;
7247 v62 = pGlobalTXT_LocalizationStrings[121]; //"Permanent" 7489 v62 = pGlobalTXT_LocalizationStrings[121]; //"Permanent"
7248 v53 = v74; 7490 v53 = v74;
7249 v49 = v6; 7491 v49 = v6;
7250 sprintf(pTmpBuf, "+%u %s %s", v49, v53, v62); 7492 sprintf(pTmpBuf, "+%u %s %s", v49, v53, v62);
7251 break; 7493 break;
7252 case 1: 7494 case 1:
7253 v6 = pParty->uCurrentMonthWeek + 1; 7495 v6 = pParty->uCurrentMonthWeek + 1;
7254 v3->uIntelligence += thisa; 7496 v3->uIntelligence += thisa;
7255 v62 = pGlobalTXT_LocalizationStrings[121]; 7497 v62 = pGlobalTXT_LocalizationStrings[121];
7256 v53 = v74; 7498 v53 = v74;
7257 v49 = v6; 7499 v49 = v6;
7258 sprintf(pTmpBuf, "+%u %s %s", v49, v53, v62); 7500 sprintf(pTmpBuf, "+%u %s %s", v49, v53, v62);
7259 break; 7501 break;
7260 case 2: 7502 case 2:
7261 v6 = pParty->uCurrentMonthWeek + 1; 7503 v6 = pParty->uCurrentMonthWeek + 1;
7262 v3->uWillpower += thisa; 7504 v3->uWillpower += thisa;
7263 v62 = pGlobalTXT_LocalizationStrings[121]; 7505 v62 = pGlobalTXT_LocalizationStrings[121];
7264 v53 = v74; 7506 v53 = v74;
7265 v49 = v6; 7507 v49 = v6;
7266 sprintf(pTmpBuf, "+%u %s %s", v49, v53, v62); 7508 sprintf(pTmpBuf, "+%u %s %s", v49, v53, v62);
7267 break; 7509 break;
7268 case 3: 7510 case 3:
7269 v6 = pParty->uCurrentMonthWeek + 1; 7511 v6 = pParty->uCurrentMonthWeek + 1;
7270 v3->uEndurance += thisa; 7512 v3->uEndurance += thisa;
7271 v62 = pGlobalTXT_LocalizationStrings[121]; 7513 v62 = pGlobalTXT_LocalizationStrings[121];
7272 v53 = v74; 7514 v53 = v74;
7273 v49 = v6; 7515 v49 = v6;
7274 sprintf(pTmpBuf, "+%u %s %s", v49, v53, v62); 7516 sprintf(pTmpBuf, "+%u %s %s", v49, v53, v62);
7275 break; 7517 break;
7276 case 4: 7518 case 4:
7277 v6 = pParty->uCurrentMonthWeek + 1; 7519 v6 = pParty->uCurrentMonthWeek + 1;
7278 v3->uAccuracy += thisa; 7520 v3->uAccuracy += thisa;
7279 v62 = pGlobalTXT_LocalizationStrings[121]; 7521 v62 = pGlobalTXT_LocalizationStrings[121];
7280 v53 = v74; 7522 v53 = v74;
7281 v49 = v6; 7523 v49 = v6;
7282 sprintf(pTmpBuf, "+%u %s %s", v49, v53, v62); 7524 sprintf(pTmpBuf, "+%u %s %s", v49, v53, v62);
7283 break; 7525 break;
7284 case 5: 7526 case 5:
7285 v6 = pParty->uCurrentMonthWeek + 1; 7527 v6 = pParty->uCurrentMonthWeek + 1;
7286 v3->uSpeed += thisa; 7528 v3->uSpeed += thisa;
7287 v62 = pGlobalTXT_LocalizationStrings[121]; 7529 v62 = pGlobalTXT_LocalizationStrings[121];
7288 v53 = v74; 7530 v53 = v74;
7289 v49 = v6; 7531 v49 = v6;
7290 sprintf(pTmpBuf, "+%u %s %s", v49, v53, v62); 7532 sprintf(pTmpBuf, "+%u %s %s", v49, v53, v62);
7291 break; 7533 break;
7292 case 6: 7534 case 6:
7293 v6 = pParty->uCurrentMonthWeek + 1; 7535 v6 = pParty->uCurrentMonthWeek + 1;
7294 v3->uLuck += thisa; 7536 v3->uLuck += thisa;
7295 v62 = pGlobalTXT_LocalizationStrings[121]; 7537 v62 = pGlobalTXT_LocalizationStrings[121];
7296 v53 = v74; 7538 v53 = v74;
7297 v49 = v6; 7539 v49 = v6;
7298 sprintf(pTmpBuf, "+%u %s %s", v49, v53, v62); 7540 sprintf(pTmpBuf, "+%u %s %s", v49, v53, v62);
7299 break; 7541 break;
7300 case 7: 7542 case 7:
7301 party_finds_gold(1000 * thisa, 0); 7543 party_finds_gold(1000 * thisa, 0);
7302 v63 = pGlobalTXT_LocalizationStrings[97];//"Gold" 7544 v63 = pGlobalTXT_LocalizationStrings[97];//"Gold"
7303 v54 = 1000 * thisa; 7545 v54 = 1000 * thisa;
7304 sprintf(pTmpBuf, "+%u %s", v54, v63); 7546 sprintf(pTmpBuf, "+%u %s", v54, v63);
7305 break; 7547 break;
7306 case 8: 7548 case 8:
7307 Party::GiveFood(5 * thisa); 7549 Party::GiveFood(5 * thisa);
7308 v63 = pGlobalTXT_LocalizationStrings[653]; //"Food" 7550 v63 = pGlobalTXT_LocalizationStrings[653]; //"Food"
7309 v54 = 5 * thisa; 7551 v54 = 5 * thisa;
7310 sprintf(pTmpBuf, "+%u %s", v54, v63); 7552 sprintf(pTmpBuf, "+%u %s", v54, v63);
7311 break; 7553 break;
7312 case 9u: 7554 case 9u:
7313 v63 = pGlobalTXT_LocalizationStrings[LOCSTR_SKILL_POINTS]; 7555 v63 = pGlobalTXT_LocalizationStrings[LOCSTR_SKILL_POINTS];
7314 v3->uSkillPoints += 2 * thisa; 7556 v3->uSkillPoints += 2 * thisa;
7315 v54 = 2 * thisa; 7557 v54 = 2 * thisa;
7316 sprintf(pTmpBuf, "+%u %s", v54, v63); 7558 sprintf(pTmpBuf, "+%u %s", v54, v63);
7317 break; 7559 break;
7318 case 10: 7560 case 10:
7319 v63 = pGlobalTXT_LocalizationStrings[LOCSTR_EXPIRIENCE]; 7561 v63 = pGlobalTXT_LocalizationStrings[LOCSTR_EXPIRIENCE];
7320 v54 = 2500 * thisa; 7562 v54 = 2500 * thisa;
7321 v3->uExperience += 2500 * thisa; 7563 v3->uExperience += 2500 * thisa;
7322 sprintf(pTmpBuf, "+%u %s", v54, v63); 7564 sprintf(pTmpBuf, "+%u %s", v54, v63);
7323 break; 7565 break;
7324 case 11: 7566 case 11:
7325 v8 = rand() % 6; 7567 v8 = rand() % 6;
7326 switch (v8) 7568 switch (v8)
7327 { 7569 {
7328 case 0: 7570 case 0:
7329 v3->sResFireBase += thisa; 7571 v3->sResFireBase += thisa;
7330 v13 = pGlobalTXT_LocalizationStrings[87]; 7572 v13 = pGlobalTXT_LocalizationStrings[87];
7331 break;
7332 case 1:
7333 v3->sResAirBase += thisa;
7334 v13 = pGlobalTXT_LocalizationStrings[6];
7335 break;
7336 case 2:
7337 v3->sResWaterBase += thisa;
7338 v13 = pGlobalTXT_LocalizationStrings[240];
7339 break;
7340 case 3:
7341 v3->sResEarthBase += thisa;
7342 v13 = pGlobalTXT_LocalizationStrings[70];
7343 break; 7573 break;
7344 case 4: 7574 case 1:
7345 v3->sResMindBase += thisa; 7575 v3->sResAirBase += thisa;
7346 v13 = pGlobalTXT_LocalizationStrings[142]; 7576 v13 = pGlobalTXT_LocalizationStrings[6];
7347 break; 7577 break;
7348 case 5: 7578 case 2:
7349 v3->sResBodyBase += thisa; 7579 v3->sResWaterBase += thisa;
7350 v13 = pGlobalTXT_LocalizationStrings[29]; 7580 v13 = pGlobalTXT_LocalizationStrings[240];
7351 break; 7581 break;
7352 } 7582 case 3:
7353 v62 = pGlobalTXT_LocalizationStrings[121]; 7583 v3->sResEarthBase += thisa;
7354 v53 = v13; 7584 v13 = pGlobalTXT_LocalizationStrings[70];
7355 v49 = thisa; 7585 break;
7356 sprintf(pTmpBuf, "+%u %s %s", v49, v53, v62); 7586 case 4:
7357 break; 7587 v3->sResMindBase += thisa;
7358 7588 v13 = pGlobalTXT_LocalizationStrings[142];
7359 } 7589 break;
7360 ShowStatusBarString(pTmpBuf, 2u); 7590 case 5:
7361 pMouse->RemoveHoldingItem(); 7591 v3->sResBodyBase += thisa;
7362 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, player_num - 1); 7592 v13 = pGlobalTXT_LocalizationStrings[29];
7363 v3->PlaySound(SPEECH_93, 0); 7593 break;
7364 pAudioPlayer->PlaySound((SoundID)(SOUND_Bell|0x2), 0, 0, -1, 0, 0, 0, 0); 7594 }
7365 if ( pParty->uDaysPlayed == 6 || pParty->uDaysPlayed == 20 ) 7595 v62 = pGlobalTXT_LocalizationStrings[121];
7366 { 7596 v53 = v13;
7367 v3->SetCondition(Condition_Eradicated, 0); 7597 v49 = thisa;
7368 pAudioPlayer->PlaySound((SoundID)215, 0, 0, -1, 0, 0, 0, 0); 7598 sprintf(pTmpBuf, "+%u %s %s", v49, v53, v62);
7369 } 7599 break;
7370 else if ( pParty->uDaysPlayed == 12 || pParty->uDaysPlayed == 26 ) 7600
7601 }
7602 ShowStatusBarString(pTmpBuf, 2u);
7603 pMouse->RemoveHoldingItem();
7604 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, player_num - 1);
7605 v3->PlaySound(SPEECH_93, 0);
7606 pAudioPlayer->PlaySound((SoundID)(SOUND_Bell|0x2), 0, 0, -1, 0, 0, 0, 0);
7607 if ( pParty->uDaysPlayed == 6 || pParty->uDaysPlayed == 20 )
7371 { 7608 {
7372 v3->SetCondition(Condition_Dead, 0); 7609 v3->SetCondition(Condition_Eradicated, 0);
7373 pAudioPlayer->PlaySound((SoundID)215, 0, 0, -1, 0, 0, 0, 0); 7610 pAudioPlayer->PlaySound((SoundID)215, 0, 0, -1, 0, 0, 0, 0);
7374 } 7611 }
7375 else if ( pParty->uDaysPlayed == 4 || pParty->uDaysPlayed == 25 ) 7612 else if ( pParty->uDaysPlayed == 12 || pParty->uDaysPlayed == 26 )
7376 { 7613 {
7377 v3->SetCondition(Condition_Pertified, 0); 7614 v3->SetCondition(Condition_Dead, 0);
7378 pAudioPlayer->PlaySound((SoundID)215, 0, 0, -1, 0, 0, 0, 0); 7615 pAudioPlayer->PlaySound((SoundID)215, 0, 0, -1, 0, 0, 0, 0);
7379 } 7616 }
7617 else if ( pParty->uDaysPlayed == 4 || pParty->uDaysPlayed == 25 )
7618 {
7619 v3->SetCondition(Condition_Pertified, 0);
7620 pAudioPlayer->PlaySound((SoundID)215, 0, 0, -1, 0, 0, 0, 0);
7621 }
7380 return; 7622 return;
7381 } 7623 }
7382 if ( pParty->pPickedItem.uItemID == 630 ) //Red Apple 7624 else if ( pParty->pPickedItem.uItemID == 630 ) //Red Apple
7383 { 7625 {
7384 Party::GiveFood(1u); 7626 Party::GiveFood(1u);
7385 pAudioPlayer->PlaySound((SoundID)(SOUND_PlayerCantCastSpell|0x2), 0, 0, -1, 0, 0, 0, 0); 7627 pAudioPlayer->PlaySound((SoundID)(SOUND_PlayerCantCastSpell|0x2), 0, 0, -1, 0, 0, 0, 0);
7386 } 7628
7629 }
7630 else if ( pParty->pPickedItem.uItemID == 632 ) //Lute
7631 {
7632 pAudioPlayer->PlaySound((SoundID)133, 0, 0, -1, 0, 0, 0, 0);
7633 return;
7634 }
7635 else if ( pParty->pPickedItem.uItemID == 633 ) //Faerie Pipes
7636 {
7637 pAudioPlayer->PlaySound((SoundID)134, 0, 0, -1, 0, 0, 0, 0);
7638 return;
7639 }
7640 else if ( pParty->pPickedItem.uItemID == 634 ) //Gryphonheart's Trumpet
7641 {
7642 pAudioPlayer->PlaySound((SoundID)135, 0, 0, -1, 0, 0, 0, 0);
7643 return;
7644 }
7645 else if ( pParty->pPickedItem.uItemID == 646 )
7646 {
7647 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, player_num - 1);
7648 v5 = 8 * player_num + 392;
7649 LOBYTE(v5) = PID(OBJECT_Player,player_num - 120);
7650 pAudioPlayer->PlaySound(SOUND_20001, v5, 0, -1, 0, 0, 0, 0);
7651 v3->AddVariable(VAR_NumSkillPoints, 2);
7652 }
7653 else if ( pParty->pPickedItem.uItemID == 650 ) //Temple in a Bottle
7654 {
7655 sub_44C28F_open_nwc_dungeon();
7656 return;
7657 }
7387 else 7658 else
7388 { 7659 {
7389 if ( pParty->pPickedItem.uItemID == 632 ) //Lute 7660
7390 { 7661 v68 = pParty->pPickedItem.GetDisplayName();
7391 pAudioPlayer->PlaySound((SoundID)133, 0, 0, -1, 0, 0, 0, 0); 7662 v58 = pGlobalTXT_LocalizationStrings[36];
7392 return; 7663 sprintfex(pTmpBuf, v58, v68);
7393 } 7664 v23 = pTmpBuf;
7394 if ( pParty->pPickedItem.uItemID == 633 ) //Faerie Pipes 7665 ShowStatusBarString(v23, 2u);
7395 { 7666 v4 = 0;
7396 pAudioPlayer->PlaySound((SoundID)134, 0, 0, -1, 0, 0, 0, 0); 7667 v61 = v4;
7397 return; 7668 v52 = v4;
7398 } 7669 v48 = v4;
7399 if ( pParty->pPickedItem.uItemID == 634 ) //Gryphonheart's Trumpet 7670 v45 = v4;
7400 { 7671 v43 = -1;
7401 pAudioPlayer->PlaySound((SoundID)135, 0, 0, -1, 0, 0, 0, 0); 7672 v41 = v4;
7402 return; 7673 v39 = v4;
7403 } 7674 v37 = (SoundID)27;
7404 if ( pParty->pPickedItem.uItemID != 646 ) 7675 pAudioPlayer->PlaySound(v37, v39, v41, v43, v45, v48, v52, v61);
7405 { 7676 return;
7406 if ( pParty->pPickedItem.uItemID == 650 ) //Temple in a Bottle 7677 }
7407 { 7678
7408 sub_44C28F_open_nwc_dungeon();
7409 return;
7410 }
7411 v68 = pParty->pPickedItem.GetDisplayName();
7412 v58 = pGlobalTXT_LocalizationStrings[36];
7413 goto LABEL_90;
7414 }
7415 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, player_num - 1);
7416 v5 = 8 * player_num + 392;
7417 LOBYTE(v5) = PID(OBJECT_Player,player_num - 120);
7418 pAudioPlayer->PlaySound(SOUND_20001, v5, 0, -1, 0, 0, 0, 0);
7419 v3->AddVariable(VAR_NumSkillPoints, 2);
7420 }
7421 LABEL_187: 7679 LABEL_187:
7422 pMouse->RemoveHoldingItem(); 7680 pMouse->RemoveHoldingItem();
7423 return; 7681 return;
7424 }
7425 if ( pParty->pPlayers[player_num-1].CanAct() )
7426 {
7427 sub_467F48(pParty->pPickedItem.uItemID);
7428 v65 = 0;
7429 v56 = SPEECH_37;
7430 LABEL_67:
7431 v3->PlaySound((PlayerSpeech)v56, v65);
7432 return;
7433 }
7434 LABEL_89:
7435 v68 = aCharacterConditionNames[v3->GetMajorConditionIdx()];
7436 v58 = pGlobalTXT_LocalizationStrings[382];
7437 LABEL_90:
7438 sprintfex(pTmpBuf, v58, v68);
7439 v23 = pTmpBuf;
7440 LABEL_91:
7441 ShowStatusBarString(v23, 2u);
7442 v4 = 0;
7443 goto LABEL_92;
7444 }
7445 v15 = pParty->pPickedItem.uItemID - 400;
7446 v72 = (char *)&v3->spellbook.pFireSpellbook+pParty->pPickedItem.uItemID-400;//(char *)&v3->pConditions[0] + pParty->pPickedItem.uItemID + 2;
7447 if ( *v72 )
7448 {
7449 v66 = pParty->pPickedItem.GetDisplayName();
7450 v57 = pGlobalTXT_LocalizationStrings[380];
7451 LABEL_72:
7452 sprintf(pTmpBuf, v57, v66);
7453 ShowStatusBarString(pTmpBuf, 2u);
7454 LABEL_92:
7455 v61 = v4;
7456 v52 = v4;
7457 v48 = v4;
7458 v45 = v4;
7459 v43 = -1;
7460 v41 = v4;
7461 v39 = v4;
7462 v37 = (SoundID)27;
7463 LABEL_93:
7464 v14 = pAudioPlayer;
7465 LABEL_63:
7466 pAudioPlayer->PlaySound(v37, v39, v41, v43, v45, v48, v52, v61);
7467 return;
7468 }
7469 if ( !pParty->pPlayers[player_num-1].CanAct() )
7470 {
7471 v66 = aCharacterConditionNames[v3->GetMajorConditionIdx()];
7472 v57 = pGlobalTXT_LocalizationStrings[382];
7473 goto LABEL_72;
7474 }
7475 v16 = v15 % 11 + 1;
7476 v17 = &v3->pActiveSkills[v15 / 11 + 12];
7477 v75 = v16;
7478 v18 = SkillToMastery(*v17) - 1;
7479 if ( v18 )
7480 {
7481 v19 = v18 - 1;
7482 if ( v19 )
7483 {
7484 v20 = v19 - 1;
7485 if ( v20 )
7486 {
7487 if ( v20 != 1 )
7488 {
7489 v21 = player_num;
7490 LABEL_83:
7491 if ( v75 > v21 || !*v17 )
7492 {
7493 v22 = pParty->pPickedItem.GetDisplayName();
7494 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[381], v22);
7495 ShowStatusBarString(pTmpBuf, 2u);
7496 v3->PlaySound((PlayerSpeech)20, 0);
7497 return;
7498 }
7499 *v72 = 1;
7500 v3->PlaySound(SPEECH_21, 0);
7501 v73 = 0;
7502 LABEL_173:
7503 v36 = pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType;
7504 if ( v36 == EQUIP_POTION )
7505 {
7506 v71 = 0;
7507 v60 = 0;
7508 v51 = 0;
7509 v47 = 0;
7510 v44 = -1;
7511 v42 = 0;
7512 v40 = 0;
7513 v38 = (SoundID)210;
7514 }
7515 else
7516 {
7517 if ( v36 != EQUIP_REAGENT )
7518 {
7519 LABEL_178:
7520 if ( pGUIWindow_CurrentMenu && pGUIWindow_CurrentMenu->eWindowType != WINDOW_null)
7521 {
7522 if ( !v73 )
7523 goto LABEL_187;
7524 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
7525 }
7526 if ( v73 )
7527 {
7528 if ( pParty->bTurnBasedModeOn )
7529 {
7530 *(&pParty->field_16140 + player_num) = 100;
7531 thisb->SetRecoveryTime(100);
7532 pTurnEngine->_40471C();
7533 }
7534 else
7535 {
7536 thisb->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * 213.3333333333333));
7537 }
7538 }
7539 goto LABEL_187;
7540 }
7541 v71 = 0;
7542 v60 = 0;
7543 v51 = 0;
7544 v47 = 0;
7545 v44 = -1;
7546 v42 = 0;
7547 v40 = 0;
7548 v38 = (SoundID)211;
7549 }
7550 pAudioPlayer->PlaySound(v38, v40, v42, v44, v47, v51, v60, v71);
7551 goto LABEL_178;
7552 }
7553 v67 = 11;
7554 } 7682 }
7555 else 7683
7556 { 7684 }
7557 v67 = 10;
7558 }
7559 }
7560 else
7561 {
7562 v67 = 7;
7563 }
7564 }
7565 else
7566 {
7567 v67 = 4;
7568 }
7569 v21 = v67;
7570 goto LABEL_83;
7571 }
7572 if ( pCurrentScreen == SCREEN_CASTING )
7573 return;
7574 if ( !pParty->pPlayers[player_num-1].CanAct() )
7575 goto LABEL_89;
7576 if ( bUnderwater == 1 )
7577 {
7578 v23 = pGlobalTXT_LocalizationStrings[652];
7579 goto LABEL_91;
7580 }
7581 dword_50C9AC = 1;
7582 scroll_id = pParty->pPickedItem.uItemID - 299;
7583 if ( scroll_id == 30 || scroll_id == 4 || scroll_id == 91 || scroll_id == 28 ) //Enchant Item scroll, Vampiric Weapon scroll ,Recharge Item ,Fire Aura
7584 {
7585 pMouse->RemoveHoldingItem();
7586 pGUIWindow_CurrentMenu->Release();
7587 pIcons_LOD->_4114F2();
7588 pCurrentScreen = SCREEN_GAME;
7589 viewparams->bRedrawGameUI = 1;
7590 _42777D_CastSpell_UseWand_ShootArrow(scroll_id, player_num - 1, 0x85u, 1, 0);
7591 }
7592 else
7593 {
7594 _720984_unused = pParty->pPickedItem.uItemID;
7595 pMouse->RemoveHoldingItem();
7596 pMessageQueue_50C9E8->AddMessage(UIMSG_SpellScrollUse, scroll_id, player_num - 1);
7597 if ( pCurrentScreen && pGUIWindow_CurrentMenu
7598 && (pGUIWindow_CurrentMenu->eWindowType != WINDOW_null))
7599 {
7600 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
7601 }
7602 }
7603 }
7604 7685
7605 7686
7606 7687
7607 //----- (00449BB4) -------------------------------------------------------- 7688 //----- (00449BB4) --------------------------------------------------------
7608 bool Player::CompareVariable( enum VariableType VarNum, signed int pValue ) 7689 bool Player::CompareVariable( enum VariableType VarNum, signed int pValue )