comparison Player.cpp @ 1019:32ec62bbaa2c

player use item part cleanup
author Gloval
date Tue, 21 May 2013 01:21:10 +0400
parents a704435d3285
children 3413ad40cc88
comparison
equal deleted inserted replaced
1015:c8c5224164da 1019:32ec62bbaa2c
2187 uAccuracy = uAccuracyBonus = 0; 2187 uAccuracy = uAccuracyBonus = 0;
2188 uLuck = uLuckBonus = 0; 2188 uLuck = uLuckBonus = 0;
2189 uLevel = sLevelModifier = 0; 2189 uLevel = sLevelModifier = 0;
2190 sAgeModifier = 0; 2190 sAgeModifier = 0;
2191 2191
2192 memset(field_1F5, 0, 30); 2192 // memset(field_1F5, 0, 30);
2193 pure_luck_used=0;
2194 pure_speed_used=0;
2195 pure_intellect_used=0;
2196 pure_endurance_used=0;
2197 pure_willpower_used=0;
2198 pure_accuracy_used=0;
2199 pure_might_used=0;
2193 2200
2194 sResFireBase = sResFireBonus = 0; 2201 sResFireBase = sResFireBonus = 0;
2195 sResAirBase = sResAirBonus = 0; 2202 sResAirBase = sResAirBonus = 0;
2196 sResWaterBase = sResWaterBonus = 0; 2203 sResWaterBase = sResWaterBonus = 0;
2197 sResEarthBase = sResEarthBonus = 0; 2204 sResEarthBase = sResEarthBonus = 0;
3255 if ( resistance == 4 ) 3262 if ( resistance == 4 )
3256 { 3263 {
3257 v14 = v3->pEquipment.uArmor; 3264 v14 = v3->pEquipment.uArmor;
3258 if ( v14 ) 3265 if ( v14 )
3259 { 3266 {
3260 if ( !(v3->field_1F5[36 * v14 + 15] & 2) ) 3267 // if ( !(v3->field_1F5[36 * v14 + 15] & 2) )
3268 if (v3->pOwnItems[v14-1].uAttributes&2)
3261 { 3269 {
3262 v15 = GetEquippedItemSkillType(EQUIP_ARMOUR) - 10; 3270 v15 = GetEquippedItemSkillType(EQUIP_ARMOUR) - 10;
3263 if ( v15 ) 3271 if ( v15 )
3264 { 3272 {
3265 if ( v15 != 1 || (signed int)SkillToMastery(v3->pActiveSkills[11]) < 3 ) 3273 if ( v15 != 1 || (signed int)SkillToMastery(v3->pActiveSkills[11]) < 3 )
3601 if ( v5 < 1 ) 3609 if ( v5 < 1 )
3602 { 3610 {
3603 if ( v3->sHealth + v3->uEndurance + GetItemsBonus(CHARACTER_ATTRIBUTE_ENDURANCE, 0) >= 1 3611 if ( v3->sHealth + v3->uEndurance + GetItemsBonus(CHARACTER_ATTRIBUTE_ENDURANCE, 0) >= 1
3604 || (signed __int64)v3->pPlayerBuffs[PLAYER_BUFF_PRESERVATION].uExpireTime > 0 ) 3612 || (signed __int64)v3->pPlayerBuffs[PLAYER_BUFF_PRESERVATION].uExpireTime > 0 )
3605 { 3613 {
3606 SetCondition(0xDu, 0); 3614 SetCondition(Condition_Unconcious, 0);
3607 } 3615 }
3608 else 3616 else
3609 { 3617 {
3610 SetCondition(0xEu, 0); 3618 SetCondition(Condition_Dead, 0);
3611 v6 = LODWORD(pParty->uTimePlayed); 3619 v6 = LODWORD(pParty->uTimePlayed);
3612 if ( v3->sHealth > 0 ) 3620 if ( v3->sHealth > 0 )
3613 v3->sHealth = 0; 3621 v3->sHealth = 0;
3614 } 3622 }
3615 if ( v6 ) 3623 if ( v6 )
3616 { 3624 {
3617 v7 = v3->pEquipment.uArmor; 3625 v7 = v3->pEquipment.uArmor;
3618 if ( v7 ) 3626 if ( v7 )
3619 { 3627 {
3620 v8 = &v3->field_1F5[36 * v7 + 15]; 3628 // v8 = &v3->field_1F5[36 * v7 + 15];
3629 v8=(char*)&v3->pOwnItems[v7-1].uAttributes;
3621 v9 = *(int *)v8; 3630 v9 = *(int *)v8;
3622 if ( !(BYTE1(v9) & 2) ) 3631 if ( !(BYTE1(v9) & 2) )
3623 { 3632 {
3624 LOBYTE(v9) = v9 | 2; 3633 LOBYTE(v9) = v9 | 2;
3625 *(int *)v8 = v9; 3634 *(int *)v8 = v9;
6824 else 6833 else
6825 return false; 6834 return false;
6826 } 6835 }
6827 6836
6828 //----- (004680ED) -------------------------------------------------------- 6837 //----- (004680ED) --------------------------------------------------------
6829 void Player::UseItem_DrinkPotion_etc(signed int a2, int a3) 6838 void Player::UseItem_DrinkPotion_etc(signed int player_num, int a3)
6830 { 6839 {
6831 Player *v3; // esi@1 6840 Player *v3; // esi@1
6832 unsigned int v4; // ebx@4 6841 unsigned int v4; // ebx@4
6833 signed int v5; // eax@17 6842 signed int v5; // eax@17
6834 unsigned int v6; // eax@26 6843 unsigned int v6; // eax@26
6847 int v19; // eax@74 6856 int v19; // eax@74
6848 int v20; // eax@75 6857 int v20; // eax@75
6849 signed int v21; // eax@81 6858 signed int v21; // eax@81
6850 const char *v22; // eax@84 6859 const char *v22; // eax@84
6851 char *v23; // ecx@90 6860 char *v23; // ecx@90
6852 int v24; // esi@96 6861 int scroll_id; // esi@96
6853 int v25; // eax@109 6862 int v25; // eax@109
6854 int v26; // eax@113 6863 int v26; // eax@113
6855 char *v27; // edi@114 6864 int new_mana_val; // edi@114
6856 signed __int64 v28; // qax@120 6865 signed __int64 v28; // qax@120
6857 char *v29; // ecx@120 6866 char *v29; // ecx@120
6858 int v30; // edi@137 6867 __int64 v30; // edi@137
6859 int v31; // ST30_4@137 6868 int v31; // ST30_4@137
6860 int v32; // ST3C_4@137 6869 __int64 v32; // ST3C_4@137
6861 int v33; // ST40_4@137 6870 int v33; // ST40_4@137
6862 int v34; // ST34_4@137 6871 __int64 v34; // ST34_4@137
6863 int v35; // ST38_4@137 6872 int v35; // ST38_4@137
6864 unsigned __int8 v36; // al@173 6873 unsigned __int8 v36; // al@173
6865 SoundID v37; // [sp-20h] [bp-4Ch]@18 6874 SoundID v37; // [sp-20h] [bp-4Ch]@18
6866 SoundID v38; // [sp-20h] [bp-4Ch]@174 6875 SoundID v38; // [sp-20h] [bp-4Ch]@174
6867 signed int v39; // [sp-1Ch] [bp-48h]@18 6876 signed int v39; // [sp-1Ch] [bp-48h]@18
6903 int v75; // [sp+24h] [bp-8h]@73 6912 int v75; // [sp+24h] [bp-8h]@73
6904 Player *thisb; // [sp+28h] [bp-4h]@1 6913 Player *thisb; // [sp+28h] [bp-4h]@1
6905 unsigned int thisa; // [sp+28h] [bp-4h]@22 6914 unsigned int thisa; // [sp+28h] [bp-4h]@22
6906 6915
6907 thisb = this; 6916 thisb = this;
6908 v3 = &pParty->pPlayers[a2-1]; 6917 v3 = &pParty->pPlayers[player_num-1];
6909 v73 = 1; 6918 v73 = 1;
6910 if ( pParty->bTurnBasedModeOn == 1 && (pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 3) ) 6919 if ( pParty->bTurnBasedModeOn == 1 && (pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 3) )
6911 return; 6920 return;
6912 v4 = 0; 6921 v4 = 0;
6913 if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType == 13 ) 6922 if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType == EQUIP_REAGENT )
6914 { 6923 {
6915 if ( pParty->pPickedItem.uItemID != 160 ) 6924 if ( pParty->pPickedItem.uItemID != 160 )
6916 { 6925 {
6917 if ( pParty->pPickedItem.uItemID == 161 ) 6926 if ( pParty->pPickedItem.uItemID == 161 )
6918 { 6927 {
6919 v27 = (char *)&v3->sMana; 6928 new_mana_val = v3->sMana;
6920 *(int *)v27 += 2; 6929 new_mana_val += 2;
6921 LABEL_170: 6930
6922 if ( *(int *)v27 > v3->GetMaxMana() ) 6931 if ( new_mana_val > v3->GetMaxMana() )
6923 *(int *)v27 = v3->GetMaxMana(); 6932 new_mana_val = v3->GetMaxMana();
6924 } 6933 }
6925 else 6934 else
6926 { 6935 {
6927 if ( pParty->pPickedItem.uItemID != 162 ) 6936 if ( pParty->pPickedItem.uItemID != 162 )
6928 { 6937 {
6929 LABEL_167: 6938
6930 v68 = pParty->pPickedItem.GetDisplayName(); 6939 v68 = pParty->pPickedItem.GetDisplayName();
6931 v58 = pGlobalTXT_LocalizationStrings[36]; 6940 v58 = pGlobalTXT_LocalizationStrings[36];
6932 goto LABEL_90; 6941 goto LABEL_90;
6933 } 6942 }
6934 v69 = 2; 6943 v69 = 2;
6935 LABEL_111: 6944
6936 pParty->pPlayers[a2-1].Heal(v69); 6945 pParty->pPlayers[player_num-1].Heal(v69);
6937 } 6946 }
6938 LABEL_112:
6939 v3->PlaySound(SPEECH_36, 0); 6947 v3->PlaySound(SPEECH_36, 0);
6940 goto LABEL_173; 6948 goto LABEL_173;
6941 } 6949 }
6942 LABEL_172: 6950 pParty->pPlayers[player_num-1].SetCondition(Condition_Poison1, 1);
6943 pParty->pPlayers[a2-1].SetCondition(6u, 1);
6944 goto LABEL_173; 6951 goto LABEL_173;
6945 } 6952 }
6946 if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType == 14 ) 6953 if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType == EQUIP_POTION )
6947 { 6954 {
6948 switch ( pParty->pPickedItem.uItemID ) 6955 switch ( pParty->pPickedItem.uItemID )
6949 { 6956 {
6950 case 0xDEu: 6957 case 221: //Catalyst
6958 pParty->pPlayers[player_num-1].SetCondition(Condition_Poison1, 1);
6959 goto LABEL_173;
6960 case 222: //Cure Wounds
6951 v25 = pParty->pPickedItem.uEnchantmentType + 10; 6961 v25 = pParty->pPickedItem.uEnchantmentType + 10;
6952 goto LABEL_110; 6962 pParty->pPlayers[player_num-1].Heal(v25);
6953 case 0xDFu: 6963 v3->PlaySound(SPEECH_36, 0);
6964 goto LABEL_173;
6965 case 223: //Magic Potion
6954 v26 = pParty->pPickedItem.uEnchantmentType + 10; 6966 v26 = pParty->pPickedItem.uEnchantmentType + 10;
6955 goto LABEL_114; 6967 new_mana_val = v3->sMana;
6956 case 0xE0u: 6968 new_mana_val += v26;
6957 LODWORD(v3->pConditions[1]) = 0; 6969 if ( new_mana_val > v3->GetMaxMana() )
6958 HIDWORD(v3->pConditions[1]) = 0; 6970 new_mana_val = v3->GetMaxMana();
6959 goto LABEL_112; 6971 v3->PlaySound(SPEECH_36, 0);
6960 case 0xE1u: 6972 goto LABEL_173;
6961 LODWORD(v3->pConditions[11]) = 0; 6973 case 224: //Cure Weakness
6962 HIDWORD(v3->pConditions[11]) = 0; 6974 v3->pConditions[Condition_Weak] = 0i64;
6963 LODWORD(v3->pConditions[9]) = 0; 6975 v3->PlaySound(SPEECH_36, 0);
6964 HIDWORD(v3->pConditions[9]) = 0; 6976 goto LABEL_173;
6965 LODWORD(v3->pConditions[7]) = 0; 6977 case 225: //Cure Disease
6966 HIDWORD(v3->pConditions[7]) = 0; 6978 v3->pConditions[Condition_Disease3] = 0i64;
6967 goto LABEL_112; 6979 v3->pConditions[Condition_Disease2] = 0i64;
6968 case 0xE2u: 6980 v3->pConditions[Condition_Disease1] = 0i64;
6969 LODWORD(v3->pConditions[10]) = 0; 6981 v3->PlaySound(SPEECH_36, 0);
6970 HIDWORD(v3->pConditions[10]) = 0; 6982 goto LABEL_173;
6971 LODWORD(v3->pConditions[8]) = 0; 6983 case 226: //Cure Poison
6972 HIDWORD(v3->pConditions[8]) = 0; 6984 v3->pConditions[Condition_Poison3] = 0i64;
6973 LODWORD(v3->pConditions[6]) = 0; 6985 v3->pConditions[Condition_Poison2] = 0i64;
6974 HIDWORD(v3->pConditions[6]) = 0; 6986 v3->pConditions[Condition_Poison1] = 0i64;
6975 goto LABEL_112; 6987 v3->PlaySound(SPEECH_36, 0);
6976 case 0xE3u: 6988 goto LABEL_173;
6977 LODWORD(v3->pConditions[2]) = 0; 6989 case 227: //Awaken
6978 HIDWORD(v3->pConditions[2]) = 0; 6990 v3->pConditions[Condition_Sleep] = 0i64;
6979 goto LABEL_112; 6991 v3->PlaySound(SPEECH_36, 0);
6980 case 0xE4u: 6992 goto LABEL_173;
6981 if ( v3->pConditions[1] ) 6993 case 228: //Haste
6982 goto LABEL_173; 6994 if ( !v3->pConditions[Condition_Weak] )
6983 v70 = 0; 6995 {
6984 v59 = 0; 6996 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
6985 v50 = 5; 6997 v3->pPlayerBuffs[7].Apply(pParty->uTimePlayed + v28, 3, 5, 0, 0);
6986 v46 = 3; 6998 v3->PlaySound(SPEECH_36, 0);
6999 }
7000 goto LABEL_173;
7001 case 229: //Heroism
6987 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); 7002 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
6988 v29 = (char *)&v3->pPlayerBuffs[7]; 7003 v3->pPlayerBuffs[8].Apply(pParty->uTimePlayed + v28, 3, 5, 0, 0);
6989 goto LABEL_147; 7004 v3->PlaySound(SPEECH_36, 0);
6990 case 0xE5u: 7005 goto LABEL_173;
6991 v70 = 0; 7006 case 230: //Bless
6992 v59 = 0;
6993 v50 = 5;
6994 v46 = 3;
6995 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); 7007 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
6996 v29 = (char *)&v3->pPlayerBuffs[8]; 7008 v3->pPlayerBuffs[1].Apply(pParty->uTimePlayed + v28, 3, 5, 0, 0);
6997 goto LABEL_147; 7009 v3->PlaySound(SPEECH_36, 0);
6998 case 0xE6u: 7010 goto LABEL_173;
6999 v70 = 0; 7011 case 231: //Preservation
7000 v59 = 0; 7012 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
7001 v50 = 5;
7002 v46 = 3;
7003 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); 7013 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7004 v29 = (char *)&v3->pPlayerBuffs[1]; 7014 v3->pPlayerBuffs[11].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7005 goto LABEL_147; 7015 v3->PlaySound(SPEECH_36, 0);
7006 case 0xE7u: 7016 goto LABEL_173;
7007 v70 = 0; 7017 case 232: //Shield
7008 v59 = 0;
7009 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); 7018 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
7010 v46 = 0;
7011 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); 7019 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7012 v29 = (char *)&v3->pPlayerBuffs[11]; 7020 v3->pPlayerBuffs[13].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7013 goto LABEL_147; 7021 v3->PlaySound(SPEECH_36, 0);
7014 case 0xE8u: 7022 goto LABEL_173;
7015 v70 = 0; 7023 case 234: //Stoneskin
7016 v59 = 0; 7024 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7025 v3->pPlayerBuffs[14].Apply(pParty->uTimePlayed + v28, 3, 5, 0, 0);
7026 v3->PlaySound(SPEECH_36, 0);
7027 goto LABEL_173;
7028 case 235: //Water Breathing
7029 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335),
7030 v3->pPlayerBuffs[23].Apply(pParty->uTimePlayed +v28, 3, 5, 0, 0);
7031 goto LABEL_173;
7032 case 237: //Remove Fear
7033 v3->pConditions[Condition_Fear] = 0i64;
7034 v3->PlaySound(SPEECH_36, 0);
7035 goto LABEL_173;
7036 case 238: //Remove Curse
7037 v3->pConditions[Condition_Cursed] = 0i64;
7038 v3->PlaySound(SPEECH_36, 0);
7039 goto LABEL_173;
7040 case 239: //Cure Insanity
7041 v3->pConditions[Condition_Insane] = 0i64;
7042 v3->PlaySound(SPEECH_36, 0);
7043 goto LABEL_173;
7044 case 240: //Might Boost
7017 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); 7045 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
7018 v46 = 0;
7019 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); 7046 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7020 v29 = (char *)&v3->pPlayerBuffs[13]; 7047 v3->pPlayerBuffs[19].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7021 goto LABEL_147; 7048 v3->PlaySound(SPEECH_36, 0);
7022 case 0xEAu: 7049 goto LABEL_173;
7023 v70 = 0; 7050 case 241: //Intellect Boost
7024 v59 = 0; 7051 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
7025 v50 = 5;
7026 v46 = 3;
7027 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); 7052 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7028 v29 = (char *)&v3->pPlayerBuffs[14]; 7053 v3->pPlayerBuffs[17].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7029 goto LABEL_147; 7054 v3->PlaySound(SPEECH_36, 0);
7030 case 0xEBu:
7031 v3->pPlayerBuffs[23].Apply(
7032 pParty->uTimePlayed + (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335),
7033 3u,
7034 5u,
7035 0,
7036 0);
7037 goto LABEL_173; 7055 goto LABEL_173;
7038 case 0xEDu: 7056 case 242: //Personality Boost
7039 LODWORD(v3->pConditions[3]) = 0;
7040 HIDWORD(v3->pConditions[3]) = 0;
7041 goto LABEL_112;
7042 case 0xEEu:
7043 LODWORD(v3->pConditions[0]) = 0;
7044 HIDWORD(v3->pConditions[0]) = 0;
7045 goto LABEL_112;
7046 case 0xEFu:
7047 LODWORD(v3->pConditions[5]) = 0;
7048 HIDWORD(v3->pConditions[5]) = 0;
7049 goto LABEL_112;
7050 case 0xF0u:
7051 v70 = 0;
7052 v59 = 0;
7053 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); 7057 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
7054 v46 = 0;
7055 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); 7058 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7056 v29 = (char *)&v3->pPlayerBuffs[19]; 7059 v3->pPlayerBuffs[20].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7057 goto LABEL_147; 7060 v3->PlaySound(SPEECH_36, 0);
7058 case 0xF1u: 7061 goto LABEL_173;
7059 v70 = 0; 7062 case 243://Endurance Boost
7060 v59 = 0;
7061 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); 7063 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
7062 v46 = 0;
7063 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); 7064 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7064 v29 = (char *)&v3->pPlayerBuffs[17]; 7065 v3->pPlayerBuffs[16].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7065 goto LABEL_147; 7066 v3->PlaySound(SPEECH_36, 0);
7066 case 0xF2u: 7067 goto LABEL_173;
7067 v70 = 0; 7068 case 244: //Speed Boost
7068 v59 = 0;
7069 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); 7069 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
7070 v46 = 0;
7071 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); 7070 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7072 v29 = (char *)&v3->pPlayerBuffs[20]; 7071 v3->pPlayerBuffs[21].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7073 goto LABEL_147; 7072 v3->PlaySound(SPEECH_36, 0);
7074 case 0xF3u: 7073 goto LABEL_173;
7075 v70 = 0; 7074 case 245: //Accuracy Boost
7076 v59 = 0;
7077 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); 7075 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
7078 v46 = 0;
7079 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); 7076 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7080 v29 = (char *)&v3->pPlayerBuffs[16]; 7077 v3->pPlayerBuffs[15].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7081 goto LABEL_147; 7078 v3->PlaySound(SPEECH_36, 0);
7082 case 0xF4u: 7079 goto LABEL_173;
7083 v70 = 0; 7080 case 251: //Cure Paralysis
7084 v59 = 0; 7081 v3->pConditions[Condition_Paralyzed] = 0i64;
7082 v3->PlaySound(SPEECH_36, 0);
7083 goto LABEL_173;
7084 case 252://Divine Restoration
7085 v30 = v3->pConditions[Condition_Dead];
7086 v32 = v3->pConditions[Condition_Pertified];
7087 v34 = v3->pConditions[Condition_Eradicated];
7088 memset(&pParty->pPlayers[player_num-1].pConditions,0,sizeof(pConditions));
7089 v3->pConditions[Condition_Dead] = v30;
7090 v3->pConditions[Condition_Pertified] = v32;
7091 v3->pConditions[Condition_Eradicated] = v34;
7092 v3->PlaySound(SPEECH_36, 0);
7093 goto LABEL_173;
7094 case 253: //Divine Cure
7095 v25 = 5 * pParty->pPickedItem.uEnchantmentType;
7096 pParty->pPlayers[player_num-1].Heal(v25);
7097 v3->PlaySound(SPEECH_36, 0);
7098 goto LABEL_173;
7099 case 254: //Divine Power
7100 v26 = 5 * pParty->pPickedItem.uEnchantmentType;
7101 new_mana_val = v3->sMana;
7102 new_mana_val += v26;
7103 if ( new_mana_val > v3->GetMaxMana() )
7104 new_mana_val = v3->GetMaxMana();
7105 v3->PlaySound(SPEECH_36, 0);
7106 goto LABEL_173;
7107 case 255: //Luck Boost
7085 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); 7108 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
7086 v46 = 0;
7087 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); 7109 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7088 v29 = (char *)&v3->pPlayerBuffs[21]; 7110 v3->pPlayerBuffs[18].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7089 goto LABEL_147; 7111 v3->PlaySound(SPEECH_36, 0);
7090 case 0xF5u: 7112 goto LABEL_173;
7091 v70 = 0; 7113 case 256: //Fire Resistance
7092 v59 = 0;
7093 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); 7114 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
7094 v46 = 0;
7095 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); 7115 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7096 v29 = (char *)&v3->pPlayerBuffs[15]; 7116 v3->pPlayerBuffs[5].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7097 goto LABEL_147; 7117 v3->PlaySound(SPEECH_36, 0);
7098 case 0xFBu: 7118 goto LABEL_173;
7099 LODWORD(v3->pConditions[12]) = 0; 7119 case 257: //Air Resistance
7100 HIDWORD(v3->pConditions[12]) = 0;
7101 goto LABEL_112;
7102 case 0xFCu:
7103 v30 = LODWORD(v3->pConditions[14]);
7104 v31 = HIDWORD(v3->pConditions[14]);
7105 v32 = LODWORD(v3->pConditions[15]);
7106 v33 = HIDWORD(v3->pConditions[15]);
7107 v34 = LODWORD(v3->pConditions[16]);
7108 v35 = HIDWORD(v3->pConditions[16]);
7109 memset(&pParty->pPlayers[a2-1],0,0xA0u);
7110 HIDWORD(v3->pConditions[14]) = v31;
7111 LODWORD(v3->pConditions[15]) = v32;
7112 HIDWORD(v3->pConditions[15]) = v33;
7113 LODWORD(v3->pConditions[16]) = v34;
7114 LODWORD(v3->pConditions[14]) = v30;
7115 HIDWORD(v3->pConditions[16]) = v35;
7116 goto LABEL_112;
7117 case 0xFDu:
7118 v25 = 5 * pParty->pPickedItem.uEnchantmentType;
7119 LABEL_110:
7120 v69 = v25;
7121 goto LABEL_111;
7122 case 0xFEu:
7123 v26 = 5 * pParty->pPickedItem.uEnchantmentType;
7124 LABEL_114:
7125 v27 = (char *)&v3->sMana;
7126 *(int *)v27 += v26;
7127 goto LABEL_170;
7128 case 0xFFu:
7129 v70 = 0;
7130 v59 = 0;
7131 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); 7120 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
7132 v46 = 0;
7133 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); 7121 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7134 v29 = (char *)&v3->pPlayerBuffs[18]; 7122 v3->pPlayerBuffs[0].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7135 goto LABEL_147; 7123 v3->PlaySound(SPEECH_36, 0);
7136 case 0x100u: 7124 goto LABEL_173;
7137 v70 = 0; 7125 case 258: //Water Resistance
7138 v59 = 0;
7139 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); 7126 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
7140 v46 = 0;
7141 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); 7127 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7142 v29 = (char *)&v3->pPlayerBuffs[5]; 7128 v3->pPlayerBuffs[22].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7143 goto LABEL_147; 7129 v3->PlaySound(SPEECH_36, 0);
7144 case 0x101u: 7130 goto LABEL_173;
7145 v70 = 0; 7131 case 259: //Earth Resistance
7146 v59 = 0;
7147 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); 7132 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
7148 v46 = 0;
7149 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); 7133 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7150 v29 = (char *)v3->pPlayerBuffs; 7134 v3->pPlayerBuffs[3].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7151 goto LABEL_147; 7135 v3->PlaySound(SPEECH_36, 0);
7152 case 0x102u: 7136 goto LABEL_173;
7153 v70 = 0; 7137 case 260: //Mind Resistance
7154 v59 = 0;
7155 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); 7138 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
7156 v46 = 0;
7157 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); 7139 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7158 v29 = (char *)&v3->pPlayerBuffs[22]; 7140 v3->pPlayerBuffs[9].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7159 goto LABEL_147; 7141 v3->PlaySound(SPEECH_36, 0);
7160 case 0x103u: 7142 goto LABEL_173;
7161 v70 = 0; 7143 case 261: //Body Resistance
7162 v59 = 0;
7163 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); 7144 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
7164 v46 = 0;
7165 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); 7145 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7166 v29 = (char *)&v3->pPlayerBuffs[3]; 7146 v3->pPlayerBuffs[2].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
7167 goto LABEL_147; 7147 v3->PlaySound(SPEECH_36, 0);
7168 case 0x104u: 7148 goto LABEL_173;
7169 v70 = 0; 7149 case 262: //Stone to Flesh
7170 v59 = 0; 7150 v3->pConditions[Condition_Pertified] = 0i64;
7171 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType); 7151 v3->PlaySound(SPEECH_36, 0);
7172 v46 = 0; 7152 goto LABEL_173;
7173 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); 7153 case 264: //Pure Luck
7174 v29 = (char *)&v3->pPlayerBuffs[9]; 7154 if ( !v3->pure_luck_used )
7175 goto LABEL_147;
7176 case 0x105u:
7177 v70 = 0;
7178 v59 = 0;
7179 v50 = 3 * LOWORD(pParty->pPickedItem.uEnchantmentType);
7180 v46 = 0;
7181 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
7182 v29 = (char *)&v3->pPlayerBuffs[2];
7183 LABEL_147:
7184 ((SpellBuff *)v29)->Apply(pParty->uTimePlayed + v28, v46, v50, v59, v70);
7185 goto LABEL_112;
7186 case 0x106u:
7187 LODWORD(v3->pConditions[15]) = 0;
7188 HIDWORD(v3->pConditions[15]) = 0;
7189 goto LABEL_112;
7190 case 0x108u:
7191 if ( !*(int *)&v3->field_1F5[3] )
7192 { 7155 {
7193 v3->uLuck += 50; 7156 v3->uLuck += 50;
7194 *(int *)&v3->field_1F5[3] = 1; 7157 v3->pure_luck_used = 1;
7195 } 7158 }
7196 goto LABEL_112; 7159 v3->PlaySound(SPEECH_36, 0);
7197 case 0x109u: 7160 goto LABEL_173;
7198 if ( !*(int *)&v3->field_1F5[7] ) 7161 case 265: //Pure Speed
7162 if ( !v3->pure_speed_used )
7199 { 7163 {
7200 v3->uSpeed += 50; 7164 v3->uSpeed += 50;
7201 *(int *)&v3->field_1F5[7] = 1; 7165 v3->pure_speed_used = 1;
7202 } 7166 }
7203 goto LABEL_112; 7167 v3->PlaySound(SPEECH_36, 0);
7204 case 0x10Au: 7168 goto LABEL_173;
7205 if ( !*(int *)&v3->field_1F5[11] ) 7169 case 266: //Pure Intellect
7170 if ( !v3->pure_intellect_used )
7206 { 7171 {
7207 v3->uIntelligence += 50; 7172 v3->uIntelligence += 50;
7208 *(int *)&v3->field_1F5[11] = 1; 7173 v3->pure_intellect_used = 1;
7209 } 7174 }
7210 goto LABEL_112; 7175 v3->PlaySound(SPEECH_36, 0);
7211 case 0x10Bu: 7176 goto LABEL_173;
7212 if ( !*(int *)&v3->field_1F5[15] ) 7177 case 267: //Pure Endurance
7178 if ( !v3->pure_endurance_used )
7213 { 7179 {
7214 v3->uEndurance += 50; 7180 v3->uEndurance += 50;
7215 *(int *)&v3->field_1F5[15] = 1; 7181 v3->pure_endurance_used = 1;
7216 } 7182 }
7217 goto LABEL_112; 7183 v3->PlaySound(SPEECH_36, 0);
7218 case 0x10Cu: 7184 goto LABEL_173;
7219 if ( !*(int *)&v3->field_1F5[19] ) 7185 case 268: //Pure Personality
7186 if ( !v3->pure_willpower_used )
7220 { 7187 {
7221 v3->uWillpower += 50; 7188 v3->uWillpower += 50;
7222 *(int *)&v3->field_1F5[19] = 1; 7189 v3->pure_willpower_used = 1;
7223 } 7190 }
7224 goto LABEL_112; 7191 v3->PlaySound(SPEECH_36, 0);
7225 case 0x10Du: 7192 goto LABEL_173;
7226 if ( !*(int *)&v3->field_1F5[23] ) 7193 case 269: //Pure Accuracy
7194 if ( !v3->pure_accuracy_used )
7227 { 7195 {
7228 v3->uAccuracy += 50; 7196 v3->uAccuracy += 50;
7229 *(int *)&v3->field_1F5[23] = 1; 7197 v3->pure_accuracy_used = 1;
7230 } 7198 }
7231 goto LABEL_112; 7199 v3->PlaySound(SPEECH_36, 0);
7232 case 0x10Eu: 7200 goto LABEL_173;
7233 if ( !*(int *)&v3->field_1F5[27] ) 7201 case 270: //Pure Might
7202 if ( !v3->pure_might_used )
7234 { 7203 {
7235 v3->uMight += 50; 7204 v3->uMight += 50;
7236 *(int *)&v3->field_1F5[27] = 1; 7205 v3->pure_might_used = 1;
7237 } 7206 }
7238 goto LABEL_112; 7207 v3->PlaySound(SPEECH_36, 0);
7239 case 0x10Fu: 7208 goto LABEL_173;
7209 case 271: //Rejuvenation
7240 v3->sAgeModifier = 0; 7210 v3->sAgeModifier = 0;
7241 goto LABEL_112; 7211 v3->PlaySound(SPEECH_36, 0);
7242 case 0xDDu: 7212 goto LABEL_173;
7243 goto LABEL_172; 7213
7244 default: 7214 default:
7245 goto LABEL_167; 7215 v68 = pParty->pPickedItem.GetDisplayName();
7246 } 7216 v58 = pGlobalTXT_LocalizationStrings[36]; //"%s can not be used that way"
7247 goto LABEL_172; 7217 sprintfex(pTmpBuf, v58, v68);
7248 } 7218 ShowStatusBarString(pTmpBuf, 2u);
7249 if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType != 15 ) 7219 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
7250 { 7220 return;
7251 if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType != 16 ) 7221
7252 { 7222 }
7253 if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType != 17 ) 7223 pParty->pPlayers[player_num-1].SetCondition(Condition_Poison1, 1);
7254 { 7224 goto LABEL_173;
7255 if ( pParty->pPickedItem.uItemID == 616 ) 7225 }
7226
7227
7228 if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType != EQUIP_SPELL_SCROLL )
7229 {
7230 if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType != EQUIP_BOOK )
7231 {
7232 if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType != EQUIP_MESSAGE_SCROLL )
7233 {
7234 if ( pParty->pPickedItem.uItemID == 616 ) //Genie Lamp
7256 { 7235 {
7257 thisa = pParty->uCurrentMonthWeek + 1; 7236 thisa = pParty->uCurrentMonthWeek + 1;
7258 if ( pParty->uCurrentMonth >= 7 ) 7237 if ( pParty->uCurrentMonth >= 7 )
7259 v74 = 0; 7238 v74 = 0;
7260 else 7239 else
7261 v74 = aAttributeNames[pParty->uCurrentMonth]; 7240 v74 = aAttributeNames[pParty->uCurrentMonth];
7262 switch ( pParty->uCurrentMonth ) 7241 switch ( pParty->uCurrentMonth )
7263 { 7242 {
7264 case 0u: 7243 case 0:
7265 v6 = pParty->uCurrentMonthWeek + 1; 7244 v6 = pParty->uCurrentMonthWeek + 1;
7266 v3->uMight += thisa; 7245 v3->uMight += thisa;
7267 goto LABEL_33; 7246 v62 = pGlobalTXT_LocalizationStrings[121]; //"Permanent"
7268 case 1u: 7247 v53 = v74;
7248 v49 = v6;
7249 sprintf(pTmpBuf, "+%u %s %s", v49, v53, v62);
7250 break;
7251 case 1:
7269 v6 = pParty->uCurrentMonthWeek + 1; 7252 v6 = pParty->uCurrentMonthWeek + 1;
7270 v3->uIntelligence += thisa; 7253 v3->uIntelligence += thisa;
7271 goto LABEL_33;
7272 case 2u:
7273 v6 = pParty->uCurrentMonthWeek + 1;
7274 v3->uWillpower += thisa;
7275 goto LABEL_33;
7276 case 3u:
7277 v6 = pParty->uCurrentMonthWeek + 1;
7278 v3->uEndurance += thisa;
7279 goto LABEL_33;
7280 case 4u:
7281 v6 = pParty->uCurrentMonthWeek + 1;
7282 v3->uAccuracy += thisa;
7283 goto LABEL_33;
7284 case 5u:
7285 v6 = pParty->uCurrentMonthWeek + 1;
7286 v3->uSpeed += thisa;
7287 goto LABEL_33;
7288 case 6u:
7289 v6 = pParty->uCurrentMonthWeek + 1;
7290 v3->uLuck += thisa;
7291 LABEL_33:
7292 v62 = pGlobalTXT_LocalizationStrings[121]; 7254 v62 = pGlobalTXT_LocalizationStrings[121];
7293 v53 = v74; 7255 v53 = v74;
7294 v49 = v6; 7256 v49 = v6;
7295 goto LABEL_53; 7257 sprintf(pTmpBuf, "+%u %s %s", v49, v53, v62);
7296 case 7u: 7258 break;
7259 case 2:
7260 v6 = pParty->uCurrentMonthWeek + 1;
7261 v3->uWillpower += thisa;
7262 v62 = pGlobalTXT_LocalizationStrings[121];
7263 v53 = v74;
7264 v49 = v6;
7265 sprintf(pTmpBuf, "+%u %s %s", v49, v53, v62);
7266 break;
7267 case 3:
7268 v6 = pParty->uCurrentMonthWeek + 1;
7269 v3->uEndurance += thisa;
7270 v62 = pGlobalTXT_LocalizationStrings[121];
7271 v53 = v74;
7272 v49 = v6;
7273 sprintf(pTmpBuf, "+%u %s %s", v49, v53, v62);
7274 break;
7275 case 4:
7276 v6 = pParty->uCurrentMonthWeek + 1;
7277 v3->uAccuracy += thisa;
7278 v62 = pGlobalTXT_LocalizationStrings[121];
7279 v53 = v74;
7280 v49 = v6;
7281 sprintf(pTmpBuf, "+%u %s %s", v49, v53, v62);
7282 break;
7283 case 5:
7284 v6 = pParty->uCurrentMonthWeek + 1;
7285 v3->uSpeed += thisa;
7286 v62 = pGlobalTXT_LocalizationStrings[121];
7287 v53 = v74;
7288 v49 = v6;
7289 sprintf(pTmpBuf, "+%u %s %s", v49, v53, v62);
7290 break;
7291 case 6:
7292 v6 = pParty->uCurrentMonthWeek + 1;
7293 v3->uLuck += thisa;
7294 v62 = pGlobalTXT_LocalizationStrings[121];
7295 v53 = v74;
7296 v49 = v6;
7297 sprintf(pTmpBuf, "+%u %s %s", v49, v53, v62);
7298 break;
7299 case 7:
7297 party_finds_gold(1000 * thisa, 0); 7300 party_finds_gold(1000 * thisa, 0);
7298 v63 = pGlobalTXT_LocalizationStrings[97]; 7301 v63 = pGlobalTXT_LocalizationStrings[97];//"Gold"
7299 v54 = 1000 * thisa; 7302 v54 = 1000 * thisa;
7300 goto LABEL_38; 7303 sprintf(pTmpBuf, "+%u %s", v54, v63);
7301 case 8u: 7304 break;
7302 Party::GiveFood(5 * thisa); 7305 case 8:
7303 v63 = pGlobalTXT_LocalizationStrings[653]; 7306 Party::GiveFood(5 * thisa);
7307 v63 = pGlobalTXT_LocalizationStrings[653]; //"Food"
7304 v54 = 5 * thisa; 7308 v54 = 5 * thisa;
7305 goto LABEL_38; 7309 sprintf(pTmpBuf, "+%u %s", v54, v63);
7310 break;
7306 case 9u: 7311 case 9u:
7307 v63 = pGlobalTXT_LocalizationStrings[207]; 7312 v63 = pGlobalTXT_LocalizationStrings[LOCSTR_SKILL_POINTS];
7308 v3->uSkillPoints += 2 * thisa; 7313 v3->uSkillPoints += 2 * thisa;
7309 v54 = 2 * thisa; 7314 v54 = 2 * thisa;
7310 goto LABEL_38; 7315 sprintf(pTmpBuf, "+%u %s", v54, v63);
7311 case 0xAu: 7316 break;
7312 v63 = pGlobalTXT_LocalizationStrings[83]; 7317 case 10:
7318 v63 = pGlobalTXT_LocalizationStrings[LOCSTR_EXPIRIENCE];
7313 v54 = 2500 * thisa; 7319 v54 = 2500 * thisa;
7314 v7 = __CFADD__(2500 * thisa, LODWORD(v3->uExperience)); 7320 v3->uExperience += 2500 * thisa;
7315 LODWORD(v3->uExperience) += 2500 * thisa;
7316 HIDWORD(v3->uExperience) += ((unsigned __int64)(signed int)(2500 * thisa) >> 32) + v7;
7317 LABEL_38:
7318 sprintf(pTmpBuf, "+%u %s", v54, v63); 7321 sprintf(pTmpBuf, "+%u %s", v54, v63);
7319 goto LABEL_54; 7322 break;
7320 case 0xBu: 7323 case 11:
7321 v8 = rand() % 6; 7324 v8 = rand() % 6;
7322 if ( v8 ) 7325 switch (v8)
7326 {
7327 case 0:
7328 v3->sResFireBase += thisa;
7329 v13 = pGlobalTXT_LocalizationStrings[87];
7330 break;
7331 case 1:
7332 v3->sResAirBase += thisa;
7333 v13 = pGlobalTXT_LocalizationStrings[6];
7334 break;
7335 case 2:
7336 v3->sResWaterBase += thisa;
7337 v13 = pGlobalTXT_LocalizationStrings[240];
7338 break;
7339 case 3:
7340 v3->sResEarthBase += thisa;
7341 v13 = pGlobalTXT_LocalizationStrings[70];
7342 break;
7343 case 4:
7344 v3->sResMindBase += thisa;
7345 v13 = pGlobalTXT_LocalizationStrings[142];
7346 break;
7347 case 5:
7348 v3->sResBodyBase += thisa;
7349 v13 = pGlobalTXT_LocalizationStrings[29];
7350 break;
7351 }
7352 v62 = pGlobalTXT_LocalizationStrings[121];
7353 v53 = v13;
7354 v49 = thisa;
7355 sprintf(pTmpBuf, "+%u %s %s", v49, v53, v62);
7356 break;
7357
7358 }
7359 ShowStatusBarString(pTmpBuf, 2u);
7360 pMouse->RemoveHoldingItem();
7361 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, player_num - 1);
7362 v3->PlaySound(SPEECH_93, 0);
7363 pAudioPlayer->PlaySound((SoundID)(SOUND_Bell|0x2), 0, 0, -1, 0, 0, 0, 0);
7364 if ( pParty->uDaysPlayed == 6 || pParty->uDaysPlayed == 20 )
7323 { 7365 {
7324 v9 = v8 - 1; 7366 v3->SetCondition(Condition_Eradicated, 0);
7325 if ( v9 ) 7367 pAudioPlayer->PlaySound((SoundID)215, 0, 0, -1, 0, 0, 0, 0);
7368 }
7369 else if ( pParty->uDaysPlayed == 12 || pParty->uDaysPlayed == 26 )
7326 { 7370 {
7327 v10 = v9 - 1; 7371 v3->SetCondition(Condition_Dead, 0);
7328 if ( v10 ) 7372 pAudioPlayer->PlaySound((SoundID)215, 0, 0, -1, 0, 0, 0, 0);
7329 {
7330 v11 = v10 - 1;
7331 if ( v11 )
7332 {
7333 v12 = v11 - 1;
7334 if ( v12 )
7335 {
7336 if ( v12 != 1 )
7337 goto LABEL_52;
7338 v3->sResBodyBase += thisa;
7339 v13 = pGlobalTXT_LocalizationStrings[29];
7340 }
7341 else
7342 {
7343 v3->sResMindBase += thisa;
7344 v13 = pGlobalTXT_LocalizationStrings[142];
7345 }
7346 }
7347 else
7348 {
7349 v3->sResEarthBase += thisa;
7350 v13 = pGlobalTXT_LocalizationStrings[70];
7351 }
7352 }
7353 else
7354 {
7355 v3->sResWaterBase += thisa;
7356 v13 = pGlobalTXT_LocalizationStrings[240];
7357 }
7358 } 7373 }
7359 else 7374 else if ( pParty->uDaysPlayed == 4 || pParty->uDaysPlayed == 25 )
7360 { 7375 {
7361 v3->sResAirBase += thisa; 7376 v3->SetCondition(Condition_Pertified, 0);
7362 v13 = pGlobalTXT_LocalizationStrings[6]; 7377 pAudioPlayer->PlaySound((SoundID)215, 0, 0, -1, 0, 0, 0, 0);
7363 }
7364 } 7378 }
7365 else 7379 return;
7366 {
7367 v3->sResFireBase += thisa;
7368 v13 = pGlobalTXT_LocalizationStrings[87];
7369 }
7370 v74 = v13;
7371 LABEL_52:
7372 v62 = pGlobalTXT_LocalizationStrings[121];
7373 v53 = v74;
7374 v49 = thisa;
7375 LABEL_53:
7376 sprintf(pTmpBuf, "+%u %s %s", v49, v53, v62);
7377 LABEL_54:
7378 ShowStatusBarString(pTmpBuf, 2u);
7379 pMouse->RemoveHoldingItem();
7380 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, a2 - 1);
7381 v3->PlaySound(SPEECH_93, 0);
7382 pAudioPlayer->PlaySound((SoundID)(SOUND_Bell|0x2), 0, 0, -1, 0, 0, 0, 0);
7383 if ( pParty->uDaysPlayed == 6 || pParty->uDaysPlayed == 20 )
7384 {
7385 v64 = 0;
7386 v55 = 16;
7387 }
7388 else
7389 {
7390 if ( pParty->uDaysPlayed == 12 || pParty->uDaysPlayed == 26 )
7391 {
7392 v64 = 0;
7393 v55 = 14;
7394 }
7395 else
7396 {
7397 if ( pParty->uDaysPlayed != 4 && pParty->uDaysPlayed != 25 )
7398 return;
7399 v64 = 0;
7400 v55 = 15;
7401 }
7402 }
7403 v3->SetCondition(v55, v64);
7404 v61 = 0;
7405 v52 = 0;
7406 v48 = 0;
7407 v45 = 0;
7408 v43 = -1;
7409 v41 = 0;
7410 v39 = 0;
7411 v37 = (SoundID)215;
7412 v14 = pAudioPlayer;
7413 goto LABEL_63;
7414 default:
7415 goto LABEL_54;
7416 }
7417 } 7380 }
7418 if ( pParty->pPickedItem.uItemID == 630 ) 7381 if ( pParty->pPickedItem.uItemID == 630 ) //Red Apple
7419 { 7382 {
7420 Party::GiveFood(1u); 7383 Party::GiveFood(1u);
7421 pAudioPlayer->PlaySound((SoundID)(SOUND_PlayerCantCastSpell|0x2), 0, 0, -1, 0, 0, 0, 0); 7384 pAudioPlayer->PlaySound((SoundID)(SOUND_PlayerCantCastSpell|0x2), 0, 0, -1, 0, 0, 0, 0);
7422 } 7385 }
7423 else 7386 else
7424 { 7387 {
7425 if ( pParty->pPickedItem.uItemID == 632 ) 7388 if ( pParty->pPickedItem.uItemID == 632 ) //Lute
7426 { 7389 {
7427 v61 = 0; 7390 pAudioPlayer->PlaySound((SoundID)133, 0, 0, -1, 0, 0, 0, 0);
7428 v52 = 0; 7391 return;
7429 v48 = 0;
7430 v45 = 0;
7431 v43 = -1;
7432 v41 = 0;
7433 v39 = 0;
7434 v37 = (SoundID)133;
7435 goto LABEL_93;
7436 } 7392 }
7437 if ( pParty->pPickedItem.uItemID == 633 ) 7393 if ( pParty->pPickedItem.uItemID == 633 ) //Faerie Pipes
7438 { 7394 {
7439 v61 = 0; 7395 pAudioPlayer->PlaySound((SoundID)134, 0, 0, -1, 0, 0, 0, 0);
7440 v52 = 0; 7396 return;
7441 v48 = 0;
7442 v45 = 0;
7443 v43 = -1;
7444 v41 = 0;
7445 v39 = 0;
7446 v37 = (SoundID)134;
7447 goto LABEL_93;
7448 } 7397 }
7449 if ( pParty->pPickedItem.uItemID == 634 ) 7398 if ( pParty->pPickedItem.uItemID == 634 ) //Gryphonheart's Trumpet
7450 { 7399 {
7451 v61 = 0; 7400 pAudioPlayer->PlaySound((SoundID)135, 0, 0, -1, 0, 0, 0, 0);
7452 v52 = 0; 7401 return;
7453 v48 = 0;
7454 v45 = 0;
7455 v43 = -1;
7456 v41 = 0;
7457 v39 = 0;
7458 v37 = (SoundID)135;
7459 goto LABEL_93;
7460 } 7402 }
7461 if ( pParty->pPickedItem.uItemID != 646 ) 7403 if ( pParty->pPickedItem.uItemID != 646 )
7462 { 7404 {
7463 if ( pParty->pPickedItem.uItemID == 650 ) 7405 if ( pParty->pPickedItem.uItemID == 650 ) //Temple in a Bottle
7464 { 7406 {
7465 sub_44C28F_open_nwc_dungeon(); 7407 sub_44C28F_open_nwc_dungeon();
7466 return; 7408 return;
7467 } 7409 }
7468 goto LABEL_167; 7410 v68 = pParty->pPickedItem.GetDisplayName();
7411 v58 = pGlobalTXT_LocalizationStrings[36];
7412 goto LABEL_90;
7469 } 7413 }
7470 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, a2 - 1); 7414 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, player_num - 1);
7471 v5 = 8 * a2 + 392; 7415 v5 = 8 * player_num + 392;
7472 LOBYTE(v5) = PID(OBJECT_Player,a2 - 120); 7416 LOBYTE(v5) = PID(OBJECT_Player,player_num - 120);
7473 pAudioPlayer->PlaySound(SOUND_20001, v5, 0, -1, 0, 0, 0, 0); 7417 pAudioPlayer->PlaySound(SOUND_20001, v5, 0, -1, 0, 0, 0, 0);
7474 v3->AddVariable(VAR_NumSkillPoints, 2); 7418 v3->AddVariable(VAR_NumSkillPoints, 2);
7475 } 7419 }
7476 LABEL_187: 7420 LABEL_187:
7477 pMouse->RemoveHoldingItem(); 7421 pMouse->RemoveHoldingItem();
7478 return; 7422 return;
7479 } 7423 }
7480 if ( pParty->pPlayers[a2-1].CanAct() ) 7424 if ( pParty->pPlayers[player_num-1].CanAct() )
7481 { 7425 {
7482 sub_467F48(pParty->pPickedItem.uItemID); 7426 sub_467F48(pParty->pPickedItem.uItemID);
7483 v65 = 0; 7427 v65 = 0;
7484 v56 = SPEECH_37; 7428 v56 = SPEECH_37;
7485 LABEL_67: 7429 LABEL_67:
7519 v14 = pAudioPlayer; 7463 v14 = pAudioPlayer;
7520 LABEL_63: 7464 LABEL_63:
7521 pAudioPlayer->PlaySound(v37, v39, v41, v43, v45, v48, v52, v61); 7465 pAudioPlayer->PlaySound(v37, v39, v41, v43, v45, v48, v52, v61);
7522 return; 7466 return;
7523 } 7467 }
7524 if ( !pParty->pPlayers[a2-1].CanAct() ) 7468 if ( !pParty->pPlayers[player_num-1].CanAct() )
7525 { 7469 {
7526 v66 = aCharacterConditionNames[v3->GetMajorConditionIdx()]; 7470 v66 = aCharacterConditionNames[v3->GetMajorConditionIdx()];
7527 v57 = pGlobalTXT_LocalizationStrings[382]; 7471 v57 = pGlobalTXT_LocalizationStrings[382];
7528 goto LABEL_72; 7472 goto LABEL_72;
7529 } 7473 }
7539 v20 = v19 - 1; 7483 v20 = v19 - 1;
7540 if ( v20 ) 7484 if ( v20 )
7541 { 7485 {
7542 if ( v20 != 1 ) 7486 if ( v20 != 1 )
7543 { 7487 {
7544 v21 = a2; 7488 v21 = player_num;
7545 LABEL_83: 7489 LABEL_83:
7546 if ( v75 > v21 || !*v17 ) 7490 if ( v75 > v21 || !*v17 )
7547 { 7491 {
7548 v22 = pParty->pPickedItem.GetDisplayName(); 7492 v22 = pParty->pPickedItem.GetDisplayName();
7549 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[381], v22); 7493 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[381], v22);
7550 ShowStatusBarString(pTmpBuf, 2u); 7494 ShowStatusBarString(pTmpBuf, 2u);
7551 v65 = 0; 7495 v3->PlaySound((PlayerSpeech)20, 0);
7552 v56 = 20; 7496 return;
7553 goto LABEL_67;
7554 } 7497 }
7555 *v72 = 1; 7498 *v72 = 1;
7556 v3->PlaySound(SPEECH_21, 0); 7499 v3->PlaySound(SPEECH_21, 0);
7557 v73 = 0; 7500 v73 = 0;
7558 LABEL_173: 7501 LABEL_173:
7559 v36 = pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType; 7502 v36 = pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType;
7560 if ( v36 == 14 ) 7503 if ( v36 == EQUIP_POTION )
7561 { 7504 {
7562 v71 = 0; 7505 v71 = 0;
7563 v60 = 0; 7506 v60 = 0;
7564 v51 = 0; 7507 v51 = 0;
7565 v47 = 0; 7508 v47 = 0;
7568 v40 = 0; 7511 v40 = 0;
7569 v38 = (SoundID)210; 7512 v38 = (SoundID)210;
7570 } 7513 }
7571 else 7514 else
7572 { 7515 {
7573 if ( v36 != 13 ) 7516 if ( v36 != EQUIP_REAGENT )
7574 { 7517 {
7575 LABEL_178: 7518 LABEL_178:
7576 if ( pGUIWindow_CurrentMenu && pGUIWindow_CurrentMenu->eWindowType != WINDOW_null) 7519 if ( pGUIWindow_CurrentMenu && pGUIWindow_CurrentMenu->eWindowType != WINDOW_null)
7577 { 7520 {
7578 if ( !v73 ) 7521 if ( !v73 )
7579 goto LABEL_187; 7522 goto LABEL_187;
7580 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
7581 {
7582 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
7583 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
7584 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
7585 ++pMessageQueue_50CBD0->uNumMessages;
7586 }*/
7587 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); 7523 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
7588 } 7524 }
7589 if ( v73 ) 7525 if ( v73 )
7590 { 7526 {
7591 if ( pParty->bTurnBasedModeOn ) 7527 if ( pParty->bTurnBasedModeOn )
7592 { 7528 {
7593 *(&pParty->field_16140 + a2) = 100; 7529 *(&pParty->field_16140 + player_num) = 100;
7594 thisb->SetRecoveryTime(100); 7530 thisb->SetRecoveryTime(100);
7595 pTurnEngine->_40471C(); 7531 pTurnEngine->_40471C();
7596 } 7532 }
7597 else 7533 else
7598 { 7534 {
7632 v21 = v67; 7568 v21 = v67;
7633 goto LABEL_83; 7569 goto LABEL_83;
7634 } 7570 }
7635 if ( pCurrentScreen == SCREEN_CASTING ) 7571 if ( pCurrentScreen == SCREEN_CASTING )
7636 return; 7572 return;
7637 if ( !pParty->pPlayers[a2-1].CanAct() ) 7573 if ( !pParty->pPlayers[player_num-1].CanAct() )
7638 goto LABEL_89; 7574 goto LABEL_89;
7639 if ( bUnderwater == 1 ) 7575 if ( bUnderwater == 1 )
7640 { 7576 {
7641 v23 = pGlobalTXT_LocalizationStrings[652]; 7577 v23 = pGlobalTXT_LocalizationStrings[652];
7642 goto LABEL_91; 7578 goto LABEL_91;
7643 } 7579 }
7644 dword_50C9AC = 1; 7580 dword_50C9AC = 1;
7645 v24 = pParty->pPickedItem.uItemID - 299; 7581 scroll_id = pParty->pPickedItem.uItemID - 299;
7646 if ( pParty->pPickedItem.uItemID == 329 || v24 == 4 || v24 == 91 || v24 == 28 ) 7582 if ( scroll_id == 30 || scroll_id == 4 || scroll_id == 91 || scroll_id == 28 ) //Enchant Item scroll, Vampiric Weapon scroll ,Recharge Item ,Fire Aura
7647 { 7583 {
7648 pMouse->RemoveHoldingItem(); 7584 pMouse->RemoveHoldingItem();
7649 pGUIWindow_CurrentMenu->Release(); 7585 pGUIWindow_CurrentMenu->Release();
7650 pIcons_LOD->_4114F2(); 7586 pIcons_LOD->_4114F2();
7651 pCurrentScreen = SCREEN_GAME; 7587 pCurrentScreen = SCREEN_GAME;
7652 viewparams->bRedrawGameUI = 1; 7588 viewparams->bRedrawGameUI = 1;
7653 _42777D_CastSpell_UseWand_ShootArrow(v24, a2 - 1, 0x85u, 1, 0); 7589 _42777D_CastSpell_UseWand_ShootArrow(scroll_id, player_num - 1, 0x85u, 1, 0);
7654 } 7590 }
7655 else 7591 else
7656 { 7592 {
7657 _720984_unused = pParty->pPickedItem.uItemID; 7593 _720984_unused = pParty->pPickedItem.uItemID;
7658 pMouse->RemoveHoldingItem(); 7594 pMouse->RemoveHoldingItem();
7659 /*if ( dword_50C9E8 < 40 ) 7595 pMessageQueue_50C9E8->AddMessage(UIMSG_SpellScrollUse, scroll_id, player_num - 1);
7660 { 7596 if ( pCurrentScreen && pGUIWindow_CurrentMenu
7661 dword_50C9EC[3 * dword_50C9E8] = 146; 7597 && (pGUIWindow_CurrentMenu->eWindowType != WINDOW_null))
7662 dword_50C9EC[3 * dword_50C9E8 + 1] = v24; 7598 {
7663 dword_50C9EC[3 * dword_50C9E8 + 2] = a2 - 1;
7664 ++dword_50C9E8;
7665 }*/
7666 pMessageQueue_50C9E8->AddMessage(UIMSG_92, v24, a2 - 1);
7667 if ( pCurrentScreen
7668 && pGUIWindow_CurrentMenu
7669 && pGUIWindow_CurrentMenu->eWindowType != WINDOW_null)
7670 //&& (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
7671 {
7672 /*pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
7673 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
7674 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
7675 ++pMessageQueue_50CBD0->uNumMessages;*/
7676 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); 7599 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
7677 } 7600 }
7678 } 7601 }
7679 } 7602 }
7680 7603