changeset 605:a8dec6a3fc9e

SubtractVariables little fix
author Ritor1
date Thu, 07 Mar 2013 14:45:43 +0600
parents 8724a4b3ca45
children 975a231bb4ec
files Events.cpp Player.cpp
diffstat 2 files changed, 269 insertions(+), 96 deletions(-) [+]
line wrap: on
line diff
--- a/Events.cpp	Thu Mar 07 09:15:15 2013 +0600
+++ b/Events.cpp	Thu Mar 07 14:45:43 2013 +0600
@@ -945,7 +945,7 @@
 				else 	if ( player_choose == 5 )//all
 				{
 					v130 = 0;
-					for(int i = 0; i < 4; ++i)
+					for(int i = 0; i < 5; ++i)
 					{
 						if ( pPlayers[i]->SubtractVariable((enum VariableType)EVT_WORD(_evt->v5), pValue) )
 							break;
--- a/Player.cpp	Thu Mar 07 09:15:15 2013 +0600
+++ b/Player.cpp	Thu Mar 07 14:45:43 2013 +0600
@@ -9345,24 +9345,7 @@
   int v25; // [sp-4h] [bp-10h]@45
 
   v3 = 0;
-  v4 = 0;
-  if ( this == pPlayers[2] )
-  {
-    v4 = 1;
-    goto LABEL_8;
-  }
-  if ( this == pPlayers[3] )
-  {
-    v24 = 2;
-  }
-  else
-  {
-    if ( this != pPlayers[4] )
-      goto LABEL_8;
-    v24 = 3;
-  }
-  v4 = v24;
-LABEL_8:
+  v4 = uActiveCharacter - 1;
   result = false;
   if ( (signed int)VarNum > 222 )
   {
@@ -9402,14 +9385,12 @@
               }
               break;
             case 241:
-              v18 = pValue;
-              v19 = 0;
               if ( (signed int)pNPCStats->uNumNewNPCs > 0 )
               {
                 v20 = (char *)&pNPCStats->pNewNPCData[0].uFlags;
-                do
+                for ( v19 = 0; v19 < (signed int)pNPCStats->uNumNewNPCs; ++v19 )
                 {
-                  if ( *((void **)v20 + 4) == (void *)v18 )
+                  if ( *((void **)v20 + 4) == (void *)pValue )
                   {
                     v21 = *(int *)v20;
                     if ( (char)*(int *)v20 < 0 )
@@ -9418,14 +9399,12 @@
                       *(int *)v20 = v21;
                     }
                   }
-                  ++v19;
                   v20 += 76;
                 }
-                while ( v19 < (signed int)pNPCStats->uNumNewNPCs );
               }
-              if ( pParty->pHirelings[0].uProfession == v18 )
+              if ( pParty->pHirelings[0].uProfession == pValue )
                 memset(pParty->pHirelings, 0, 0x4Cu);
-              if ( pParty->pHirelings[1].uProfession == v18 )
+              if ( pParty->pHirelings[1].uProfession == pValue )
                 memset(&pParty->pHirelings[1], 0, 0x4Cu);
               pParty->field_709 = 0;
               sub_44A56A();
@@ -9455,7 +9434,7 @@
 			  {
 				result = (bool)pValue;
                 pParty->uNumGoldInBank -= (unsigned int)pValue;
-			  }
+              }
               else
 LABEL_88:
                 dword_5B65C4 = 1;
@@ -9464,7 +9443,6 @@
           return result;
         }
         v11 = this->field_1A50;
-LABEL_112:
         v22 = (signed __int16)pValue;
       }
       _449B7E_toggle_bit((unsigned char *)v11, v22, 0);
@@ -9514,7 +9492,7 @@
             v6 = pParty->uNumGold;
           Party::TakeGold(v6);
           sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[503], v6);
-          ShowStatusBarString(pTmpBuf, 2u);
+          ShowStatusBarString(pTmpBuf, 2);
           GameUI_DrawFoodAndGold();
           return result;
         case VAR_RandomFood:
@@ -9525,41 +9503,67 @@
           sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[504], v7);
           ShowStatusBarString(pTmpBuf, 2u);
           GameUI_DrawFoodAndGold();
-          goto LABEL_17;
-        default:
+          pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4);
+          v8 = 8 * v4 + 400;
+          LOBYTE(v8) = (8 * v4 - 112) | 4;
+          pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0);
           return result;
         case VAR_CurrentHP:
           ReceiveDamage((signed int)pValue, 4);
-          goto LABEL_17;
+          pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4);
+          v8 = 8 * v4 + 400;
+          LOBYTE(v8) = (8 * v4 - 112) | 4;
+          pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0);
+          return result;
         case VAR_CurrentSP:
           v9 = (char *)&this->sMana;
           v10 = this->sMana - (signed int)pValue < 0;
           *(int *)v9 -= (int)pValue;
           if ( v10 )
             *(int *)v9 = 0;
-          goto LABEL_17;
+          pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4);
+          v8 = 8 * v4 + 400;
+          LOBYTE(v8) = (8 * v4 - 112) | 4;
+          pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0);
+          return result;
         case VAR_ACModifier:
           this->sACModifier -= (unsigned __int8)pValue;
-          goto LABEL_17;
+          pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4);
+          v8 = 8 * v4 + 400;
+          LOBYTE(v8) = (8 * v4 - 112) | 4;
+          pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0);
+          return result;
         case VAR_BaseLevel:
           this->uLevel -= (unsigned __int8)pValue;
-          goto LABEL_17;
+          pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4);
+          v8 = 8 * v4 + 400;
+          LOBYTE(v8) = (8 * v4 - 112) | 4;
+          pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0);
+          return result;
         case VAR_LevelModifier:
           this->sLevelModifier -= (unsigned __int8)pValue;
-          goto LABEL_17;
+          pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4);
+          v8 = 8 * v4 + 400;
+          LOBYTE(v8) = (8 * v4 - 112) | 4;
+          pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0);
+          return result;
         case VAR_Age:
           this->sAgeModifier -= (signed __int16)pValue;
           return result;
         case VAR_Award:
-          v11 = this->_guilds_member_bits;
-          goto LABEL_112;
+          _449B7E_toggle_bit((unsigned char *)this->_guilds_member_bits, (signed __int16)pValue, 0);
+          return result;
         case VAR_Experience:
           v12 = (char *)&this->uExperience;
           v13 = (signed int)pValue;
           v14 = *(int *)v12 < (unsigned int)pValue;
           *(int *)v12 -= (int)pValue;
           *((int *)v12 + 1) -= v14 + HIDWORD(v13);
-          goto LABEL_17;
+          pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4);
+          v8 = 8 * v4 + 400;
+          LOBYTE(v8) = (8 * v4 - 112) | 4;
+          pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0);
+          return result;
         case VAR_QBits_QuestsDone:
           _449B7E_toggle_bit(pParty->_quest_bits, (__int16)pValue, 0);
           pPlayers[v4 + 1]->PlaySound(SPEECH_96, 0);
@@ -9575,123 +9579,291 @@
         case VAR_MightBonus:
         case VAR_ActualMight:
           this->uMightBonus -= (unsigned __int16)pValue;
-          goto LABEL_72;
+          pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0);
+          pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4);
+          v8 = 8 * v4 + 400;
+          LOBYTE(v8) = (8 * v4 - 112) | 4;
+          pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0);
+          return result;
         case VAR_IntellectBonus:
         case VAR_ActualIntellect:
           this->uIntelligenceBonus -= (unsigned __int16)pValue;
-          goto LABEL_72;
+          pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0);
+          pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4);
+          v8 = 8 * v4 + 400;
+          LOBYTE(v8) = (8 * v4 - 112) | 4;
+          pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0);
+          return result;
         case VAR_PersonalityBonus:
         case VAR_ActualPersonality:
           this->uWillpowerBonus -= (unsigned __int16)pValue;
-          goto LABEL_72;
+          pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0);
+          pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4);
+          v8 = 8 * v4 + 400;
+          LOBYTE(v8) = (8 * v4 - 112) | 4;
+          pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0);
+          return result;
         case VAR_EnduranceBonus:
         case VAR_ActualEndurance:
           this->uEnduranceBonus -= (unsigned __int16)pValue;
-          goto LABEL_72;
+          pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0);
+          pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4);
+          v8 = 8 * v4 + 400;
+          LOBYTE(v8) = (8 * v4 - 112) | 4;
+          pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0);
+          return result;
         case VAR_SpeedBonus:
         case VAR_ActualSpeed:
           this->uSpeedBonus -= (unsigned __int16)pValue;
-          goto LABEL_72;
+          pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0);
+          pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4);
+          v8 = 8 * v4 + 400;
+          LOBYTE(v8) = (8 * v4 - 112) | 4;
+          pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0);
+          return result;
         case VAR_AccuracyBonus:
         case VAR_ActualAccuracy:
           this->uAccuracyBonus -= (unsigned __int16)pValue;
-          goto LABEL_72;
+          pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0);
+          pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4);
+          v8 = 8 * v4 + 400;
+          LOBYTE(v8) = (8 * v4 - 112) | 4;
+          pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0);
+          return result;
         case VAR_LuckBonus:
         case VAR_ActualLuck:
           this->uLuckBonus -= (unsigned __int16)pValue;
-          goto LABEL_72;
+          pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0);
+          pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4);
+          v8 = 8 * v4 + 400;
+          LOBYTE(v8) = (8 * v4 - 112) | 4;
+          pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0);
+          return result;
         case VAR_BaseMight:
           this->uMight -= (unsigned __int16)pValue;
-          goto LABEL_45;
+          pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0);
+          pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4);
+          v8 = 8 * v4 + 400;
+          LOBYTE(v8) = (8 * v4 - 112) | 4;
+          pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0);
+          return result;
         case VAR_BaseIntellect:
           this->uIntelligence -= (unsigned __int16)pValue;
-          goto LABEL_45;
+          pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0);
+          pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4);
+          v8 = 8 * v4 + 400;
+          LOBYTE(v8) = (8 * v4 - 112) | 4;
+          pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0);
+          return result;
         case VAR_BasePersonality:
           this->uWillpower -= (unsigned __int16)pValue;
-          goto LABEL_45;
+          pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0);
+          pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4);
+          v8 = 8 * v4 + 400;
+          LOBYTE(v8) = (8 * v4 - 112) | 4;
+          pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0);
+          return result;
         case VAR_BaseEndurance:
           this->uEndurance -= (unsigned __int16)pValue;
-          goto LABEL_45;
+          pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0);
+          pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4);
+          v8 = 8 * v4 + 400;
+          LOBYTE(v8) = (8 * v4 - 112) | 4;
+          pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0);
+          return result;
         case VAR_BaseSpeed:
           this->uSpeed -= (unsigned __int16)pValue;
-          goto LABEL_45;
+          pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0);
+          pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4);
+          v8 = 8 * v4 + 400;
+          LOBYTE(v8) = (8 * v4 - 112) | 4;
+          pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0);
+          return result;
         case VAR_BaseAccuracy:
           this->uAccuracy -= (unsigned __int16)pValue;
-          goto LABEL_45;
+          pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0);
+          pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4);
+          v8 = 8 * v4 + 400;
+          LOBYTE(v8) = (8 * v4 - 112) | 4;
+          pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0);
+          return result;
         case VAR_BaseLuck:
           this->uLuck -= (unsigned __int16)pValue;
-          goto LABEL_45;
+          pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0);
+          pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4);
+          v8 = 8 * v4 + 400;
+          LOBYTE(v8) = (8 * v4 - 112) | 4;
+          pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0);
+          return result;
         case VAR_FireResistance:
           this->sResFireBase -= (signed __int16)pValue;
-          goto LABEL_45;
+          pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0);
+          pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4);
+          v8 = 8 * v4 + 400;
+          LOBYTE(v8) = (8 * v4 - 112) | 4;
+          pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0);
+          return result;
         case VAR_AirResistance:
           this->sResAirBase -= (signed __int16)pValue;
-          goto LABEL_45;
+          pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0);
+          pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4);
+          v8 = 8 * v4 + 400;
+          LOBYTE(v8) = (8 * v4 - 112) | 4;
+          pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0);
+          return result;
         case VAR_WaterResistance:
           this->sResWaterBase -= (signed __int16)pValue;
-          goto LABEL_45;
+          pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0);
+          pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4);
+          v8 = 8 * v4 + 400;
+          LOBYTE(v8) = (8 * v4 - 112) | 4;
+          pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0);
+          return result;
         case VAR_EarthResistance:
           this->sResEarthBase -= (signed __int16)pValue;
-          goto LABEL_45;
+          pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0);
+          pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4);
+          v8 = 8 * v4 + 400;
+          LOBYTE(v8) = (8 * v4 - 112) | 4;
+          pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0);
+          return result;
         case VAR_SpiritResistance:
           this->sResSpiritBase -= (signed __int16)pValue;
-          goto LABEL_45;
+          pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0);
+          pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4);
+          v8 = 8 * v4 + 400;
+          LOBYTE(v8) = (8 * v4 - 112) | 4;
+          pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0);
+          return result;
         case VAR_MindResistance:
           this->sResMindBase -= (signed __int16)pValue;
-          goto LABEL_45;
+          pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0);
+          pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4);
+          v8 = 8 * v4 + 400;
+          LOBYTE(v8) = (8 * v4 - 112) | 4;
+          pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0);
+          return result;
         case VAR_BodyResistance:
           this->sResBodyBase -= (signed __int16)pValue;
-          goto LABEL_45;
+          pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0);
+          pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4);
+          v8 = 8 * v4 + 400;
+          LOBYTE(v8) = (8 * v4 - 112) | 4;
+          pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0);
+          return result;
         case VAR_LightResistance:
           this->sResLightBase -= (signed __int16)pValue;
-          goto LABEL_45;
+          pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0);
+          pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4);
+          v8 = 8 * v4 + 400;
+          LOBYTE(v8) = (8 * v4 - 112) | 4;
+          pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0);
+          return result;
         case VAR_DarkResistance:
           this->sResDarkBase -= (signed __int16)pValue;
-          goto LABEL_45;
+          pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0);
+          pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4);
+          v8 = 8 * v4 + 400;
+          LOBYTE(v8) = (8 * v4 - 112) | 4;
+          pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0);
+          return result;
         case VAR_MagicResistance:
           this->sResMagicBase -= (signed __int16)pValue;
-          goto LABEL_45;
+          pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0);
+          pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4);
+          v8 = 8 * v4 + 400;
+          LOBYTE(v8) = (8 * v4 - 112) | 4;
+          pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0);
+          return result;
         case VAR_FireResistanceBonus:
           this->sResFireBonus -= (signed __int16)pValue;
-          goto LABEL_45;
+          pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0);
+          pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4);
+          v8 = 8 * v4 + 400;
+          LOBYTE(v8) = (8 * v4 - 112) | 4;
+          pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0);
+          return result;
         case VAR_AirResistanceBonus:
           this->sResAirBonus -= (signed __int16)pValue;
-LABEL_45:
-          v25 = 0;
-          v23 = 92;
-          goto LABEL_73;
+          pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0);
+          pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4);
+          v8 = 8 * v4 + 400;
+          LOBYTE(v8) = (8 * v4 - 112) | 4;
+          pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0);
+          return result;
         case VAR_WaterResistanceBonus:
           this->sResWaterBonus -= (signed __int16)pValue;
-          goto LABEL_72;
+          pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0);
+          pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4);
+          v8 = 8 * v4 + 400;
+          LOBYTE(v8) = (8 * v4 - 112) | 4;
+          pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0);
+          return result;
         case VAR_EarthResistanceBonus:
           this->sResEarthBonus -= (signed __int16)pValue;
-          goto LABEL_72;
+          pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0);
+          pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4);
+          v8 = 8 * v4 + 400;
+          LOBYTE(v8) = (8 * v4 - 112) | 4;
+          pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0);
+          return result;
         case VAR_SpiritResistanceBonus:
           this->sResSpiritBonus -= (signed __int16)pValue;
-          goto LABEL_72;
+          pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0);
+          pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4);
+          v8 = 8 * v4 + 400;
+          LOBYTE(v8) = (8 * v4 - 112) | 4;
+          pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0);
+          return result;
         case VAR_MindResistanceBonus:
           this->sResMindBonus -= (signed __int16)pValue;
-          goto LABEL_72;
+          pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0);
+          pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4);
+          v8 = 8 * v4 + 400;
+          LOBYTE(v8) = (8 * v4 - 112) | 4;
+          pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0);
+          return result;
         case VAR_BodyResistanceBonus:
           this->sResBodyBonus -= (signed __int16)pValue;
-          goto LABEL_72;
+          pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0);
+          pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4);
+          v8 = 8 * v4 + 400;
+          LOBYTE(v8) = (8 * v4 - 112) | 4;
+          pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0);
+          return result;
         case VAR_LightResistanceBonus:
           this->sResLightBonus -= (signed __int16)pValue;
-          goto LABEL_72;
+          pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0);
+          pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4);
+          v8 = 8 * v4 + 400;
+          LOBYTE(v8) = (8 * v4 - 112) | 4;
+          pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0);
+          return result;
         case VAR_DarkResistanceBonus:
           this->sResDarkBonus -= (signed __int16)pValue;
-          goto LABEL_72;
+          pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0);
+          pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4);
+          v8 = 8 * v4 + 400;
+          LOBYTE(v8) = (8 * v4 - 112) | 4;
+          pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0);
+          return result;
         case VAR_MagicResistanceBonus:
           this->sResMagicBonus -= (signed __int16)pValue;
-LABEL_72:
           v25 = 0;
           v23 = SPEECH_91;
-LABEL_73:
           pPlayers[v4 + 1]->PlaySound((PlayerSpeech)v23, v25);
-          goto LABEL_17;
+          pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4);
+          v8 = 8 * v4 + 400;
+          LOBYTE(v8) = (8 * v4 - 112) | 4;
+          pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0);
+          return result;
         case VAR_FixedFood:
           Party::TakeFood((unsigned int)pValue);
-          goto LABEL_17;
+          pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4);
+          v8 = 8 * v4 + 400;
+          LOBYTE(v8) = (8 * v4 - 112) | 4;
+          pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0);
+          return result;
         case VAR_StaffSkill:
         case VAR_SwordSkill:
         case VAR_DaggerSkill:
@@ -9723,7 +9895,11 @@
         case VAR_DisarmTrapSkill:
         case VAR_LearningSkill:
           *((short *)&this->pConditions[16] + VarNum) -= (unsigned __int8)pValue;
-          goto LABEL_17;
+          pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4);
+          v8 = 8 * v4 + 400;
+          LOBYTE(v8) = (8 * v4 - 112) | 4;
+          pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0);
+          return result;
         case VAR_Cursed:
         case VAR_Weak:
         case VAR_Asleep:
@@ -9743,31 +9919,28 @@
         case VAR_Eradicated:
           *((int *)this + 2 * VarNum - 210) = 0;
           *((int *)this + 2 * result - 209) = 0;
-LABEL_17:
           pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4);
           v8 = 8 * v4 + 400;
           LOBYTE(v8) = (8 * v4 - 112) | 4;
           pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0);
           return result;
-      }
-      //do
-	  for (v3 = 1; v3 < 126; v3++)
-      {
-		  if ( *(&this->pInventoryItems[pInventoryIndices[v3] - 1].uItemID) == pValue )//pValue = ItemID, pInventoryItems[3] = 222
+        default:
+          return result;
+      }
+      for (v3 = 1; v3 < 126; v3++)
+      {
+        if ( *(&this->pInventoryItems[pInventoryIndices[v3] - 1].uItemID) == pValue )
         {
-          RemoveItemAtInventoryIndex(v3);// &this->pInventoryIndices[puSlot], pInventoryIndices[1] = 4
+          RemoveItemAtInventoryIndex(v3);
           return true;
         }
-        //++v3;
-        //v15 ++;
-      }
-      //while ( (signed int)v3 < 126 );
+      }
       if ( pParty->pPickedItem.uItemID == pValue )
       {
-         pMouse->RemoveHoldingItem();
-		 return true;
-	  }
-	  return false;
+        pMouse->RemoveHoldingItem();
+        return true;
+      }
+      return false;
     }
   }
 }