changeset 1822:5f9eeb7bf8e6

Finishing Player.cpp, fixing some bugs
author Grumpy7
date Wed, 09 Oct 2013 08:06:26 +0200
parents 49a4db499c0a
children 24b70fa98474
files Player.cpp Player.h UI/UICharacter.cpp UI/UiGame.cpp mm7_2.cpp stru123.h
diffstat 6 files changed, 634 insertions(+), 608 deletions(-) [+]
line wrap: on
line diff
--- a/Player.cpp	Tue Oct 08 07:41:00 2013 +0200
+++ b/Player.cpp	Wed Oct 09 08:06:26 2013 +0200
@@ -1328,7 +1328,7 @@
   uNumFireSpikeCasts = 0;
 
   memset(field_1988, 0, 49 * sizeof(int));
-  memset(field_1A50, 0, 64 * sizeof(char));
+  memset(playerEventBits, 0, 64 * sizeof(char));
 
   field_E0 = 0;
   field_E4 = 0;
@@ -1670,6 +1670,10 @@
     {
       totalDmg *= 2;
     }
+    else if (MonsterStats::BelongsToSupertype(uTargetActorID, MONSTER_SUPERTYPE_ELF) && ( enchType == 63 || itemId == ITEM_RELIC_OLD_NICK))
+    {
+      totalDmg *= 2;
+    }
     else if (MonsterStats::BelongsToSupertype(uTargetActorID, MONSTER_SUPERTYPE_TITAN) && ( enchType == 65 ))
     {
       totalDmg *= 2;
@@ -4448,40 +4452,40 @@
               if ( !playerAffected->pConditions[Condition_Weak] )
               {
                 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
-                playerAffected->pPlayerBuffs[7].Apply(pParty->uTimePlayed + v28, 3, 5, 0, 0);
+                playerAffected->pPlayerBuffs[PLAYER_BUFF_HASTE].Apply(pParty->uTimePlayed + v28, 3, 5, 0, 0);
                 playerAffected->PlaySound(SPEECH_36, 0);
               }
               break;
           case 229: //Heroism
               v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
-              playerAffected->pPlayerBuffs[8].Apply(pParty->uTimePlayed + v28, 3, 5, 0, 0);
+              playerAffected->pPlayerBuffs[PLAYER_BUFF_HEROISM].Apply(pParty->uTimePlayed + v28, 3, 5, 0, 0);
               playerAffected->PlaySound(SPEECH_36, 0);
               break;
           case 230: //Bless
               v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
-              playerAffected->pPlayerBuffs[1].Apply(pParty->uTimePlayed + v28, 3, 5, 0, 0);
+              playerAffected->pPlayerBuffs[PLAYER_BUFF_BLESS].Apply(pParty->uTimePlayed + v28, 3, 5, 0, 0);
               playerAffected->PlaySound(SPEECH_36, 0);
               break;
           case 231: //Preservation
               v50 = 3 * pParty->pPickedItem.uEnchantmentType;
               v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
-              playerAffected->pPlayerBuffs[11].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
+              playerAffected->pPlayerBuffs[PLAYER_BUFF_PRESERVATION].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
               playerAffected->PlaySound(SPEECH_36, 0);
               break;
           case 232: //Shield
               v50 = 3 * pParty->pPickedItem.uEnchantmentType;
               v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
-              playerAffected->pPlayerBuffs[13].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
+              playerAffected->pPlayerBuffs[PLAYER_BUFF_SHIELD].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
               playerAffected->PlaySound(SPEECH_36, 0);
               break;
           case 234: //Stoneskin
               v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
-              playerAffected->pPlayerBuffs[14].Apply(pParty->uTimePlayed + v28, 3, 5, 0, 0);
+              playerAffected->pPlayerBuffs[PLAYER_BUFF_STONESKIN].Apply(pParty->uTimePlayed + v28, 3, 5, 0, 0);
               playerAffected->PlaySound(SPEECH_36, 0);
               break;
           case 235: //Water Breathing
               v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335),
-              playerAffected->pPlayerBuffs[23].Apply(pParty->uTimePlayed +v28,  3, 5, 0, 0);
+              playerAffected->pPlayerBuffs[PLAYER_BUFF_WATER_WALK].Apply(pParty->uTimePlayed +v28,  3, 5, 0, 0);
               break;
           case 237: //Remove Fear
               playerAffected->pConditions[Condition_Fear] = 0i64;
@@ -4498,37 +4502,37 @@
           case 240: //Might Boost
               v50 = 3 * pParty->pPickedItem.uEnchantmentType;
               v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
-              playerAffected->pPlayerBuffs[19].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
+              playerAffected->pPlayerBuffs[PLAYER_BUFF_STRENGTH].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
               playerAffected->PlaySound(SPEECH_36, 0);
               break;
           case 241: //Intellect Boost
               v50 = 3 * pParty->pPickedItem.uEnchantmentType;
               v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
-              playerAffected->pPlayerBuffs[17].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
+              playerAffected->pPlayerBuffs[PLAYER_BUFF_INTELLIGENCE].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
               playerAffected->PlaySound(SPEECH_36, 0);
               break;
           case 242: //Personality Boost
               v50 = 3 * pParty->pPickedItem.uEnchantmentType;
               v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
-              playerAffected->pPlayerBuffs[20].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
+              playerAffected->pPlayerBuffs[PLAYER_BUFF_WILLPOWER].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
               playerAffected->PlaySound(SPEECH_36, 0);
               break;
           case 243://Endurance Boost
               v50 = 3 * pParty->pPickedItem.uEnchantmentType;
               v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
-              playerAffected->pPlayerBuffs[16].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
+              playerAffected->pPlayerBuffs[PLAYER_BUFF_ENDURANCE].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
               playerAffected->PlaySound(SPEECH_36, 0);
               break;
           case 244: //Speed Boost
               v50 = 3 * pParty->pPickedItem.uEnchantmentType;
               v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
-              playerAffected->pPlayerBuffs[21].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
+              playerAffected->pPlayerBuffs[PLAYER_BUFF_SPEED].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
               playerAffected->PlaySound(SPEECH_36, 0);
               break;
           case 245: //Accuracy Boost
               v50 = 3 * pParty->pPickedItem.uEnchantmentType;
               v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
-              playerAffected->pPlayerBuffs[15].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
+              playerAffected->pPlayerBuffs[PLAYER_BUFF_ACCURACY].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
               playerAffected->PlaySound(SPEECH_36, 0);
               break;
           case 251: //Cure Paralysis
@@ -4561,43 +4565,43 @@
           case 255: //Luck Boost
               v50 = 3 * pParty->pPickedItem.uEnchantmentType;
               v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
-              playerAffected->pPlayerBuffs[18].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
+              playerAffected->pPlayerBuffs[PLAYER_BUFF_LUCK].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
               playerAffected->PlaySound(SPEECH_36, 0);
               break;
           case 256: //Fire Resistance
               v50 = 3 * pParty->pPickedItem.uEnchantmentType;
               v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
-              playerAffected->pPlayerBuffs[5].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
+              playerAffected->pPlayerBuffs[PLAYER_BUFF_RESIST_FIRE].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
               playerAffected->PlaySound(SPEECH_36, 0);
               break;
           case 257: //Air Resistance
               v50 = 3 * pParty->pPickedItem.uEnchantmentType;
               v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
-              playerAffected->pPlayerBuffs[0].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
+              playerAffected->pPlayerBuffs[PLAYER_BUFF_RESIST_AIR].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
               playerAffected->PlaySound(SPEECH_36, 0);
               break;
           case 258: //Water Resistance
               v50 = 3 * pParty->pPickedItem.uEnchantmentType;
               v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
-              playerAffected->pPlayerBuffs[22].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
+              playerAffected->pPlayerBuffs[PLAYER_BUFF_RESIST_WATER].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
               playerAffected->PlaySound(SPEECH_36, 0);
               break;
           case 259: //Earth Resistance
               v50 = 3 * pParty->pPickedItem.uEnchantmentType;
               v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
-              playerAffected->pPlayerBuffs[3].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
+              playerAffected->pPlayerBuffs[PLAYER_BUFF_RESIST_EARTH].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
               playerAffected->PlaySound(SPEECH_36, 0);
               break;
           case 260: //Mind Resistance
               v50 = 3 * pParty->pPickedItem.uEnchantmentType;
               v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
-              playerAffected->pPlayerBuffs[9].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
+              playerAffected->pPlayerBuffs[PLAYER_BUFF_RESIST_MIND].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
               playerAffected->PlaySound(SPEECH_36, 0);
               break;
           case 261: //Body Resistance
               v50 = 3 * pParty->pPickedItem.uEnchantmentType;
               v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335);
-              playerAffected->pPlayerBuffs[2].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
+              playerAffected->pPlayerBuffs[PLAYER_BUFF_RESIST_BODY].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0);
               playerAffected->PlaySound(SPEECH_36, 0);
               break;
           case 262: //Stone to Flesh
@@ -4995,7 +4999,7 @@
   if ( valToCompare <= 63 )
     v4 = skillValue & 0x3F;
   else
-    v4 = valToCompare & skillValue;
+    v4 = skillValue & skillValue;
   return v4 >= valToCompare;
 }
 
@@ -5310,7 +5314,7 @@
       return (actStat >= baseStat);
     case VAR_PlayerBits:
       test_bit_value = 0x80u >> ((signed __int16)pValue - 1) % 8;
-      byteWithRequestedBit = this->field_1A50[((signed __int16)pValue - 1)/8];
+      byteWithRequestedBit = this->playerEventBits[((signed __int16)pValue - 1)/8];
       return ( test_bit_value & byteWithRequestedBit ) != 0;
     case VAR_NPCs2:
       return pNPCStats->pNewNPCData[pValue].Hired();
@@ -5407,21 +5411,12 @@
 //----- (0044A5CB) --------------------------------------------------------
 void Player::SetVariable(enum VariableType var_type, signed int var_value)
 {
-  signed int currPlayerId; // ebx@1
   unsigned int v6; // esi@13
   unsigned int v7; // esi@14
   signed int v11; // eax@30
   DDM_DLV_Header *v24; // ecx@148
   ItemGen item; // [sp+Ch] [bp-28h]@52
 
-  currPlayerId = 0;
-  if ( this == pPlayers[2] )
-    currPlayerId = 1;
-  else if ( this == pPlayers[3] )
-    currPlayerId = 2;
-  else if ( this == pPlayers[4] )
-     currPlayerId  = 3;
-
 
   if ( var_type >= VAR_History_0 && var_type <= VAR_History_28)
   {
@@ -5431,7 +5426,7 @@
       if (pStorylineText->StoreLine[var_type - VAR_History_0].pText)
       {
         bFlashHistoryBook = 1;
-        PlayAwardSound(currPlayerId);
+        PlayAwardSound();
       }
     }
     return;
@@ -5439,14 +5434,17 @@
 
   if ( var_type >= VAR_MapPersistentVariable_0 && var_type <= VAR_MapPersistentVariable_99 )
   {
-    byte_5E4C15[var_type] = var_value;
+    if ( var_type >= VAR_MapPersistentVariable_0 && var_type <= VAR_MapPersistentVariable_74 )
+      stru_5E4C90_MapPersistVars.field_0[var_type - VAR_MapPersistentVariable_0] = (char)var_value;  // originally (unsigned __int8)byte_5E4C15[VarNum];
+    if ( var_type >= VAR_MapPersistentVariable_75 && var_type <= VAR_MapPersistentVariable_99 )
+      stru_5E4C90_MapPersistVars._decor_events[var_type - VAR_MapPersistentVariable_75] = (unsigned char)var_value;      //not really sure whether the number gets up to 99, but can't ignore the possibility
     return;
   }
 
   if ( var_type >= VAR_UnknownTimeEvent0 && var_type <= VAR_UnknownTimeEvent19 )
   {
     pParty->PartyTimes._s_times[var_type - VAR_UnknownTimeEvent0] = pParty->uTimePlayed;    //*(int *)&stru_AA1058[3].pSounds[8 * var_type + 44532] = LODWORD(pParty->uTimePlayed);, *(int *)&stru_AA1058[3].pSounds[8 * var_type + 44536] = HIDWORD(pParty->uTimePlayed
-    PlayAwardSound(currPlayerId);
+    PlayAwardSound();
     return;
   }
 
@@ -5454,7 +5452,7 @@
   {
     case VAR_Sex:
       this->uSex = (PLAYER_SEX)var_value;
-      PlayAwardSound_Anim(currPlayerId);
+      PlayAwardSound_Anim();
       return;
     case VAR_Class:
       this->classType = (PLAYER_CLASS_TYPE)var_value;
@@ -5465,7 +5463,7 @@
           if (this->pOwnItems[i].uItemID == ITEM_LICH_JAR_EMPTY)
           {
             this->pOwnItems[i].uItemID = ITEM_LICH_JAR_FULL;
-            this->pOwnItems[i].uHolderPlayer = currPlayerId + 1;
+            this->pOwnItems[i].uHolderPlayer = GetPlayerIndex() + 1;
           }
         }
         if ( this->sResFireBase < 20 )
@@ -5491,35 +5489,35 @@
           this->uCurrentFace = 20;
           this->uVoiceID = 20;
         }
-        ReloadPlayerPortraits(currPlayerId, this->uCurrentFace);
+        ReloadPlayerPortraits(GetPlayerIndex(), this->uCurrentFace);
       }
-      PlayAwardSound_Anim(currPlayerId);
+      PlayAwardSound_Anim();
       return;
     case VAR_CurrentHP:
       this->sHealth = var_value;
-      PlayAwardSound_Anim(currPlayerId);
+      PlayAwardSound_Anim();
       return;
     case VAR_MaxHP:
       this->sHealth = GetMaxHealth();
       return;
     case VAR_CurrentSP:
       this->sMana = var_value;
-      PlayAwardSound_Anim(currPlayerId);
+      PlayAwardSound_Anim();
       return;
     case VAR_MaxSP:
       this->sMana = GetMaxMana();
       return;
     case VAR_ACModifier:
       this->sACModifier = (unsigned __int8)var_value;
-      PlayAwardSound_Anim(currPlayerId);
+      PlayAwardSound_Anim();
       return;
     case VAR_BaseLevel:
       this->uLevel = (unsigned __int8)var_value;
-      PlayAwardSound_Anim(currPlayerId);
+      PlayAwardSound_Anim();
       return;
     case VAR_LevelModifier:
       this->sLevelModifier = (unsigned __int8)var_value;
-      PlayAwardSound_Anim(currPlayerId);
+      PlayAwardSound_Anim();
       return;
     case VAR_Age:
       this->sAgeModifier = var_value;
@@ -5527,21 +5525,21 @@
     case VAR_Award:
       if ( !_449B57_test_bit(this->_achieved_awards_bits, var_value) && pAwards[var_value].pText )
       {
-        PlayAwardSound_Anim(currPlayerId);
+        PlayAwardSound_Anim();
         this->PlaySound(SPEECH_96, 0);
       }
       _449B7E_toggle_bit(this->_achieved_awards_bits, var_value, 1u);
       return;
     case VAR_Experience:
       this->uExperience = var_value;
-      PlayAwardSound_Anim(currPlayerId);
+      PlayAwardSound_Anim();
       return;
     case VAR_QBits_QuestsDone:
       if ( !_449B57_test_bit(pParty->_quest_bits, var_value) && pQuestTable[var_value-1] )
       {
         bFlashQuestBook = 1;
-        pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-        PlayAwardSound(currPlayerId);
+        pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, GetPlayerIndex());
+        PlayAwardSound();
         this->PlaySound(SPEECH_93, 0);
       }
       _449B7E_toggle_bit(pParty->_quest_bits, var_value, 1u);
@@ -5566,7 +5564,7 @@
       return;
     case VAR_FixedFood:
       Party::SetFood(var_value);
-      PlayAwardSound_Anim(currPlayerId);
+      PlayAwardSound_Anim();
       return;
     case VAR_RandomFood:
       v7 = rand() % var_value + 1;
@@ -5574,239 +5572,239 @@
       sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[501], v7);// You have %lu food
       ShowStatusBarString(pTmpBuf.data(), 2u);
       GameUI_DrawFoodAndGold();
-      PlayAwardSound_Anim(currPlayerId);
+      PlayAwardSound_Anim();
       return;
     case VAR_BaseMight:
       this->uMight = (unsigned __int8)var_value;
-      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_92);
+      PlayAwardSound_Anim_Face(SPEECH_92);
       return;
     case VAR_BaseIntellect:
       this->uIntelligence = (unsigned __int8)var_value;
-      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_92);
+      PlayAwardSound_Anim_Face(SPEECH_92);
       return;
     case VAR_BasePersonality:
       this->uWillpower = (unsigned __int8)var_value;
-      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_92);
+      PlayAwardSound_Anim_Face(SPEECH_92);
       return;
     case VAR_BaseEndurance:
       this->uEndurance = (unsigned __int8)var_value;
-      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_92);
+      PlayAwardSound_Anim_Face(SPEECH_92);
       return;
     case VAR_BaseSpeed:
       this->uSpeed = (unsigned __int8)var_value;
-      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_92);
+      PlayAwardSound_Anim_Face(SPEECH_92);
       return;
     case VAR_BaseAccuracy:
       this->uAccuracy = (unsigned __int8)var_value;
-      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_92);
+      PlayAwardSound_Anim_Face(SPEECH_92);
       return;
     case VAR_BaseLuck:
       this->uLuck = (unsigned __int8)var_value;
-      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_92);
+      PlayAwardSound_Anim_Face(SPEECH_92);
       return;
     case VAR_MightBonus:
     case VAR_ActualMight:
       this->uMightBonus = (unsigned __int8)var_value;
-      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_91);
+      PlayAwardSound_Anim_Face(SPEECH_91);
       return;
     case VAR_IntellectBonus:
     case VAR_ActualIntellect:
       this->uIntelligenceBonus = (unsigned __int8)var_value;
-      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_91);
+      PlayAwardSound_Anim_Face(SPEECH_91);
       return;
     case VAR_PersonalityBonus:
     case VAR_ActualPersonality:
       this->uWillpowerBonus = (unsigned __int8)var_value;
-      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_91);
+      PlayAwardSound_Anim_Face(SPEECH_91);
       return;
     case VAR_EnduranceBonus:
     case VAR_ActualEndurance:
       this->uEnduranceBonus = (unsigned __int8)var_value;
-      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_91);
+      PlayAwardSound_Anim_Face(SPEECH_91);
       return;
     case VAR_SpeedBonus:
     case VAR_ActualSpeed:
       this->uSpeedBonus = (unsigned __int8)var_value;
-      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_91);
+      PlayAwardSound_Anim_Face(SPEECH_91);
       return;
     case VAR_AccuracyBonus:
     case VAR_ActualAccuracy:
       this->uAccuracyBonus = (unsigned __int8)var_value;
-      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_92);
+      PlayAwardSound_Anim_Face(SPEECH_92);
       return;
     case VAR_LuckBonus:
     case VAR_ActualLuck:
       this->uLuckBonus = (unsigned __int8)var_value;
-      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_92);
+      PlayAwardSound_Anim_Face(SPEECH_92);
       return;
     case VAR_FireResistance:
       this->sResFireBase = (unsigned __int8)var_value;
-      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_92);
+      PlayAwardSound_Anim_Face(SPEECH_92);
       return;
     case VAR_AirResistance:
       this->sResAirBase = (unsigned __int8)var_value;
-      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_92);
+      PlayAwardSound_Anim_Face(SPEECH_92);
       return;
     case VAR_WaterResistance:
       this->sResWaterBase = (unsigned __int8)var_value;
-      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_92);
+      PlayAwardSound_Anim_Face(SPEECH_92);
       return;
     case VAR_EarthResistance:
       this->sResEarthBase = (unsigned __int8)var_value;
-      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_92);
+      PlayAwardSound_Anim_Face(SPEECH_92);
       return;
     case VAR_SpiritResistance:
       this->sResSpiritBase = (unsigned __int8)var_value;
-      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_92);
+      PlayAwardSound_Anim_Face(SPEECH_92);
       return;
     case VAR_MindResistance:
       this->sResMindBase = (unsigned __int8)var_value;
-      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_92);
+      PlayAwardSound_Anim_Face(SPEECH_92);
       return;
     case VAR_BodyResistance:
       this->sResBodyBase = (unsigned __int8)var_value;
-      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_92);
+      PlayAwardSound_Anim_Face(SPEECH_92);
       return;
     case VAR_LightResistance:
       this->sResLightBase = (unsigned __int8)var_value;
-      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_92);
+      PlayAwardSound_Anim_Face(SPEECH_92);
       return;
     case VAR_DarkResistance:
       this->sResDarkBase = (unsigned __int8)var_value;
-      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_92);
+      PlayAwardSound_Anim_Face(SPEECH_92);
       return;
     case VAR_MagicResistance:
       this->sResMagicBase = (unsigned __int8)var_value;
-      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_92);
+      PlayAwardSound_Anim_Face(SPEECH_92);
       return;
     case VAR_FireResistanceBonus:
       this->sResFireBonus = (unsigned __int8)var_value;
-      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_91);
+      PlayAwardSound_Anim_Face(SPEECH_91);
       return;
     case VAR_AirResistanceBonus:
       this->sResAirBonus = (unsigned __int8)var_value;
-      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_91);
+      PlayAwardSound_Anim_Face(SPEECH_91);
       return;
     case VAR_WaterResistanceBonus:
       this->sResWaterBonus = (unsigned __int8)var_value;
-      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_91);
+      PlayAwardSound_Anim_Face(SPEECH_91);
       return;
     case VAR_EarthResistanceBonus:
       this->sResEarthBonus = (unsigned __int8)var_value;
-      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_91);
+      PlayAwardSound_Anim_Face(SPEECH_91);
       return;
     case VAR_SpiritResistanceBonus:
       this->sResSpiritBonus = (unsigned __int8)var_value;
-      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_91);
+      PlayAwardSound_Anim_Face(SPEECH_91);
       return;
     case VAR_MindResistanceBonus:
       this->sResMindBonus = (unsigned __int8)var_value;
-      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_91);
+      PlayAwardSound_Anim_Face(SPEECH_91);
       return;
     case VAR_BodyResistanceBonus:
       this->sResBodyBonus = (unsigned __int8)var_value;
-      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_91);
+      PlayAwardSound_Anim_Face(SPEECH_91);
       return;
     case VAR_LightResistanceBonus:
       this->sResLightBonus = (unsigned __int8)var_value;
-      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_91);
+      PlayAwardSound_Anim_Face(SPEECH_91);
       return;
     case VAR_DarkResistanceBonus:
       this->sResDarkBonus = (unsigned __int8)var_value;
-      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_91);
+      PlayAwardSound_Anim_Face(SPEECH_91);
       return;
     case VAR_PhysicalResistanceBonus:
       Error("Physical res. bonus not used");
       return;
     case VAR_MagicResistanceBonus:
       this->sResMagicBonus = (unsigned __int8)var_value;
-      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_91);
+      PlayAwardSound_Anim_Face(SPEECH_91);
       return;
     case VAR_Cursed:
       this->SetCondition(Condition_Cursed, 1);
-      PlayAwardSound_Anim(currPlayerId);
+      PlayAwardSound_Anim();
       return;
     case VAR_Weak:
       this->SetCondition(Condition_Weak, 1);
-      PlayAwardSound_Anim(currPlayerId);
+      PlayAwardSound_Anim();
       return;
     case VAR_Asleep:
       this->SetCondition(Condition_Sleep, 1);
-      PlayAwardSound_Anim(currPlayerId);
+      PlayAwardSound_Anim();
       return;
     case VAR_Afraid:
       this->SetCondition(Condition_Fear, 1);
-      PlayAwardSound_Anim(currPlayerId);
+      PlayAwardSound_Anim();
       return;
     case VAR_Drunk:
       this->SetCondition(Condition_Drunk, 1);
-      PlayAwardSound_Anim(currPlayerId);
+      PlayAwardSound_Anim();
       return;
     case VAR_Insane:
       this->SetCondition(Condition_Insane, 1);
-      PlayAwardSound_Anim(currPlayerId);
+      PlayAwardSound_Anim();
       return;
     case VAR_PoisonedGreen:
       this->SetCondition(Condition_Poison1, 1);
-      PlayAwardSound_Anim(currPlayerId);
+      PlayAwardSound_Anim();
       return;
     case VAR_DiseasedGreen:
       this->SetCondition(Condition_Disease1, 1);
-      PlayAwardSound_Anim(currPlayerId);
+      PlayAwardSound_Anim();
       return;
     case VAR_PoisonedYellow:
       this->SetCondition(Condition_Poison2, 1);
-      PlayAwardSound_Anim(currPlayerId);
+      PlayAwardSound_Anim();
       return;
     case VAR_DiseasedYellow:
       this->SetCondition(Condition_Disease2, 1);
-      PlayAwardSound_Anim(currPlayerId);
+      PlayAwardSound_Anim();
       return;
     case VAR_PoisonedRed:
       this->SetCondition(Condition_Poison3, 1);
-      PlayAwardSound_Anim(currPlayerId);
+      PlayAwardSound_Anim();
       return;
     case VAR_DiseasedRed:
       this->SetCondition(Condition_Disease3, 1);
-      PlayAwardSound_Anim(currPlayerId);
+      PlayAwardSound_Anim();
       return;
     case VAR_Paralyzed:
       this->SetCondition(Condition_Paralyzed, 1);
-      PlayAwardSound_Anim(currPlayerId);
+      PlayAwardSound_Anim();
       return;
     case VAR_Unconsious:
       this->SetCondition(Condition_Unconcious, 1);
-      PlayAwardSound_Anim(currPlayerId);
+      PlayAwardSound_Anim();
       return;
     case VAR_Dead:
       this->SetCondition(Condition_Dead, 1);
-      PlayAwardSound_Anim(currPlayerId);
+      PlayAwardSound_Anim();
       return;
     case VAR_Stoned:
       this->SetCondition(Condition_Pertified, 1);
-      PlayAwardSound_Anim(currPlayerId);
+      PlayAwardSound_Anim();
       return;
     case VAR_Eradicated:
       this->SetCondition(Condition_Eradicated, 1);
-      PlayAwardSound_Anim(currPlayerId);
+      PlayAwardSound_Anim();
       return;
     case VAR_MajorCondition:
       memset(this, 0, 0xA0u);
-      PlayAwardSound_Anim(currPlayerId);
+      PlayAwardSound_Anim();
       return;
     case VAR_AutoNotes:
       if ( !_449B57_test_bit(pParty->_autonote_bits, var_value) && pAutonoteTxt[var_value-1].pText )
       {
-        pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
+        pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, GetPlayerIndex());
         this->PlaySound(SPEECH_96, 0);
         bFlashAutonotesBook = 1;
         _506568_autonote_type = pAutonoteTxt[var_value-1].eType;// dword_72371C[2 * a3];
       }
       _449B7E_toggle_bit(pParty->_autonote_bits, var_value, 1u);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound();
       return;
     case VAR_PlayerBits:
-      _449B7E_toggle_bit((unsigned char *)field_1A50, var_value, 1u);
+      _449B7E_toggle_bit((unsigned char *)playerEventBits, var_value, 1u);
       return;
     case VAR_NPCs2:
       pParty->hirelingScrollPosition = 0;
@@ -5862,174 +5860,168 @@
       pParty->uNumArenaLordWins = var_value;
       return;
     case VAR_StaffSkill:
-      SetSkillByEvent(&Player::skillStaff, var_type, currPlayerId);
+      SetSkillByEvent(&Player::skillStaff, var_value);
       return;
     case VAR_SwordSkill:
-      SetSkillByEvent(&Player::skillSword, var_type, currPlayerId);
+      SetSkillByEvent(&Player::skillSword, var_value);
       return;
     case VAR_DaggerSkill:
-      SetSkillByEvent(&Player::skillDagger, var_type, currPlayerId);
+      SetSkillByEvent(&Player::skillDagger, var_value);
       return;
     case VAR_AxeSkill:
-      SetSkillByEvent(&Player::skillAxe, var_type, currPlayerId);
+      SetSkillByEvent(&Player::skillAxe, var_value);
       return;
     case VAR_SpearSkill:
-      SetSkillByEvent(&Player::skillSpear, var_type, currPlayerId);
+      SetSkillByEvent(&Player::skillSpear, var_value);
       return;
     case VAR_BowSkill:
-      SetSkillByEvent(&Player::skillBow, var_type, currPlayerId);
+      SetSkillByEvent(&Player::skillBow, var_value);
       return;
     case VAR_MaceSkill:
-      SetSkillByEvent(&Player::skillMace, var_type, currPlayerId);
+      SetSkillByEvent(&Player::skillMace, var_value);
       return;
     case VAR_BlasterSkill:
-      SetSkillByEvent(&Player::skillBlaster, var_type, currPlayerId);
+      SetSkillByEvent(&Player::skillBlaster, var_value);
       return;
     case VAR_ShieldSkill:
-      SetSkillByEvent(&Player::skillShield, var_type, currPlayerId);
+      SetSkillByEvent(&Player::skillShield, var_value);
       return;
     case VAR_LeatherSkill:
-      SetSkillByEvent(&Player::skillLeather, var_type, currPlayerId);
+      SetSkillByEvent(&Player::skillLeather, var_value);
       return;
     case VAR_SkillChain:
-      SetSkillByEvent(&Player::skillChain, var_type, currPlayerId);
+      SetSkillByEvent(&Player::skillChain, var_value);
       return;
     case VAR_PlateSkill:
-      SetSkillByEvent(&Player::skillPlate, var_type, currPlayerId);
+      SetSkillByEvent(&Player::skillPlate, var_value);
       return;
     case VAR_FireSkill:
-      SetSkillByEvent(&Player::skillFire, var_type, currPlayerId);
+      SetSkillByEvent(&Player::skillFire, var_value);
       return;
     case VAR_AirSkill:
-      SetSkillByEvent(&Player::skillAir, var_type, currPlayerId);
+      SetSkillByEvent(&Player::skillAir, var_value);
       return;
     case VAR_WaterSkill:
-      SetSkillByEvent(&Player::skillWater, var_type, currPlayerId);
+      SetSkillByEvent(&Player::skillWater, var_value);
       return;
     case VAR_EarthSkill:
-      SetSkillByEvent(&Player::skillEarth, var_type, currPlayerId);
+      SetSkillByEvent(&Player::skillEarth, var_value);
       return;
     case VAR_SpiritSkill:
-      SetSkillByEvent(&Player::skillSpirit, var_type, currPlayerId);
+      SetSkillByEvent(&Player::skillSpirit, var_value);
       return;
     case VAR_MindSkill:
-      SetSkillByEvent(&Player::skillMind, var_type, currPlayerId);
+      SetSkillByEvent(&Player::skillMind, var_value);
       return;
     case VAR_BodySkill:
-      SetSkillByEvent(&Player::skillBody, var_type, currPlayerId);
+      SetSkillByEvent(&Player::skillBody, var_value);
       return;
     case VAR_LightSkill:
-      SetSkillByEvent(&Player::skillLight, var_type, currPlayerId);
+      SetSkillByEvent(&Player::skillLight, var_value);
       return;
     case VAR_DarkSkill:
-      SetSkillByEvent(&Player::skillDark, var_type, currPlayerId);
+      SetSkillByEvent(&Player::skillDark, var_value);
       return;
     case VAR_IdentifyItemSkill:
-      SetSkillByEvent(&Player::skillItemId, var_type, currPlayerId);
+      SetSkillByEvent(&Player::skillItemId, var_value);
       return;
     case VAR_MerchantSkill:
-      SetSkillByEvent(&Player::skillMerchant, var_type, currPlayerId);
+      SetSkillByEvent(&Player::skillMerchant, var_value);
       return;
     case VAR_RepairSkill:
-      SetSkillByEvent(&Player::skillRepair, var_type, currPlayerId);
+      SetSkillByEvent(&Player::skillRepair, var_value);
       return;
     case VAR_BodybuildingSkill:
-      SetSkillByEvent(&Player::skillBodybuilding, var_type, currPlayerId);
+      SetSkillByEvent(&Player::skillBodybuilding, var_value);
       return;
     case VAR_MeditationSkill:
-      SetSkillByEvent(&Player::skillMeditation, var_type, currPlayerId);
+      SetSkillByEvent(&Player::skillMeditation, var_value);
       return;
     case VAR_PerceptionSkill:
-      SetSkillByEvent(&Player::skillPerception, var_type, currPlayerId);
+      SetSkillByEvent(&Player::skillPerception, var_value);
       return;
     case VAR_DiplomacySkill:
-      SetSkillByEvent(&Player::skillDiplomacy, var_type, currPlayerId);
+      SetSkillByEvent(&Player::skillDiplomacy, var_value);
       return;
     case VAR_ThieverySkill:
       Error ("Thieving unsupported");
       return;
     case VAR_DisarmTrapSkill:
-      SetSkillByEvent(&Player::skillDisarmTrap, var_type, currPlayerId);
+      SetSkillByEvent(&Player::skillDisarmTrap, var_value);
       return;
     case VAR_DodgeSkill:
-      SetSkillByEvent(&Player::skillDodge, var_type, currPlayerId);
+      SetSkillByEvent(&Player::skillDodge, var_value);
       return;
     case VAR_UnarmedSkill:
-      SetSkillByEvent(&Player::skillUnarmed, var_type, currPlayerId);
+      SetSkillByEvent(&Player::skillUnarmed, var_value);
       return;
     case VAR_IdentifyMonsterSkill:
-      SetSkillByEvent(&Player::skillMonsterId, var_type, currPlayerId);
+      SetSkillByEvent(&Player::skillMonsterId, var_value);
       return;
     case VAR_ArmsmasterSkill:
-      SetSkillByEvent(&Player::skillArmsmaster, var_type, currPlayerId);
+      SetSkillByEvent(&Player::skillArmsmaster, var_value);
       return;
     case VAR_StealingSkill:
-      SetSkillByEvent(&Player::skillStealing, var_type, currPlayerId);
+      SetSkillByEvent(&Player::skillStealing, var_value);
       return;
     case VAR_AlchemySkill:
-      SetSkillByEvent(&Player::skillAlchemy, var_type, currPlayerId);
+      SetSkillByEvent(&Player::skillAlchemy, var_value);
       return;
     case VAR_LearningSkill:
-      SetSkillByEvent(&Player::skillLearning, var_type, currPlayerId);
+      SetSkillByEvent(&Player::skillLearning, var_value);
       return;
   }
 }
 
 
 //----- (new function) --------------------------------------------------------
-void Player::PlayAwardSound(int currPlayerId)
-{
-  signed int v25 = 8 * currPlayerId + 400;
-  LOBYTE(v25) = PID(OBJECT_Player,currPlayerId - 112);
+void Player::PlayAwardSound()
+{
+  int playerIndex = GetPlayerIndex();
+  signed int v25 = 8 * playerIndex + 400;
+  LOBYTE(v25) = PID(OBJECT_Player,playerIndex - 112);
   pAudioPlayer->PlaySound(SOUND_20001, v25, 0, -1, 0, 0, 0, 0);
 }
 
 //----- (new function) --------------------------------------------------------
-void Player::PlayAwardSound_Anim(int currPlayerId)
-{
-  pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-  PlayAwardSound(currPlayerId);
+void Player::PlayAwardSound_Anim()
+{
+  int playerIndex = GetPlayerIndex();
+  pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, playerIndex);
+  PlayAwardSound();
 }
 
 //----- (new function) --------------------------------------------------------
-void Player::PlayAwardSound_Anim_Face(int currPlayerId, PlayerSpeech speech)
+void Player::PlayAwardSound_Anim_Face( PlayerSpeech speech )
 {
   this->PlaySound(speech, 0);
-  PlayAwardSound_Anim(currPlayerId);
+  PlayAwardSound_Anim();
 }
 
 //----- (new function) --------------------------------------------------------
-void Player::SetSkillByEvent( unsigned __int16 Player::* skillToSet, unsigned __int16 newSkillValue, int currPlayerId )
+void Player::SetSkillByEvent( unsigned __int16 Player::* skillToSet, unsigned __int16 skillValue )
 {
   unsigned __int16 currSkillValue = this->*skillToSet;
-  if ( newSkillValue > 63 )         //the original had the condition reversed which was probably wrong
-  {
-    this->*skillToSet = newSkillValue | currSkillValue & 63;
+  if ( skillValue > 63 )         //the original had the condition reversed which was probably wrong
+  {
+    this->*skillToSet = skillValue | currSkillValue & 63;
   }
   else
   {
-    this->*skillToSet = newSkillValue | currSkillValue & 0xC0;
-  }
-  pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-  PlayAwardSound(currPlayerId);
+    this->*skillToSet = skillValue | currSkillValue & 0xC0;
+  }
+  int playerIndex = GetPlayerIndex();
+  pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, playerIndex);
+  PlayAwardSound();
 }
 
 //----- (0044AFFB) --------------------------------------------------------
 void Player::AddVariable(enum VariableType var_type, signed int val)
 {
-  signed int uPlayerIdx; // edi@1
   int v6; // eax@15
   unsigned int v7; // esi@18
   DDM_DLV_Header *v27; // eax@153
   ItemGen item; // [sp+Ch] [bp-2Ch]@45
-
-  uPlayerIdx = 0;
-  if ( this == pPlayers[2] )
-    uPlayerIdx = 1;
-  else if ( this == pPlayers[3] )
-    uPlayerIdx = 2;
-  else if ( this == pPlayers[4] )  
-    uPlayerIdx = 3;
  
   if ( var_type >= VAR_Counter1 && var_type <= VAR_Counter10)
   {
@@ -6040,16 +6032,27 @@
   if ( var_type >= VAR_UnknownTimeEvent0 && var_type <= VAR_UnknownTimeEvent19 )
   {
     pParty->PartyTimes._s_times[var_type - VAR_UnknownTimeEvent0] = pParty->uTimePlayed;
-    PlayAwardSound(uPlayerIdx);
+    PlayAwardSound();
     return;
   }
 
   if ( var_type >= VAR_MapPersistentVariable_0 && var_type <= VAR_MapPersistentVariable_99 )
   {
-    if ( (unsigned __int8)val + (unsigned __int8)byte_5E4C15[var_type] <= 255 )
-      byte_5E4C15[var_type] += val;
-    else
-      byte_5E4C15[var_type] = -1;
+
+    if ( var_type >= VAR_MapPersistentVariable_0 && var_type <= VAR_MapPersistentVariable_74 )
+    {
+      if (255 - val > stru_5E4C90_MapPersistVars.field_0[var_type - VAR_MapPersistentVariable_0])
+        stru_5E4C90_MapPersistVars.field_0[var_type - VAR_MapPersistentVariable_0] += val;
+      else
+        stru_5E4C90_MapPersistVars.field_0[var_type - VAR_MapPersistentVariable_0] = 255;
+    }
+    if ( (signed int)var_type >= VAR_MapPersistentVariable_75 && var_type <= VAR_MapPersistentVariable_99 )
+    {
+      if (255 - val > stru_5E4C90_MapPersistVars._decor_events[var_type - VAR_MapPersistentVariable_75])
+        stru_5E4C90_MapPersistVars._decor_events[var_type - VAR_MapPersistentVariable_75] += val;
+      else
+        stru_5E4C90_MapPersistVars._decor_events[var_type - VAR_MapPersistentVariable_75] = 255;
+    }
     return;
   }
 
@@ -6061,7 +6064,7 @@
       if (pStorylineText->StoreLine[var_type - VAR_History_0].pText = 0)
       {
         bFlashHistoryBook = 1;
-        PlayAwardSound(uPlayerIdx);
+        PlayAwardSound();
       }
     }
     return;
@@ -6084,19 +6087,19 @@
       sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[502], v7);// You find %lu food
       ShowStatusBarString(pTmpBuf.data(), 2u);
       GameUI_DrawFoodAndGold();
-      PlayAwardSound(uPlayerIdx);
+      PlayAwardSound();
       return;
     case VAR_Sex:
       this->uSex = (PLAYER_SEX)val;
-      PlayAwardSound_Anim97(uPlayerIdx);
+      PlayAwardSound_Anim97();
       return;
     case VAR_Class:
       this->classType = (PLAYER_CLASS_TYPE)val;
-      PlayAwardSound_Anim97(uPlayerIdx);
+      PlayAwardSound_Anim97();
       return;
     case VAR_CurrentHP:
       this->sHealth = min(this->sHealth + val, this->GetMaxHealth() );
-      PlayAwardSound_Anim97(uPlayerIdx);
+      PlayAwardSound_Anim97();
       return;
     case VAR_MaxHP:
       this->_health_related = 0;
@@ -6105,7 +6108,7 @@
       return;
     case VAR_CurrentSP:
       this->sMana = min(this->sMana + val, this->GetMaxMana() );
-      PlayAwardSound_Anim97(uPlayerIdx);
+      PlayAwardSound_Anim97();
       return;
     case VAR_MaxSP:
       this->_mana_related = 0;
@@ -6114,15 +6117,15 @@
       return;
     case VAR_ACModifier:
       this->sACModifier = min(this->sACModifier + val, 255);
-      PlayAwardSound_Anim97(uPlayerIdx);
+      PlayAwardSound_Anim97();
       return;
     case VAR_BaseLevel:
       this->uLevel = min(this->uLevel + val, 255);
-      PlayAwardSound_Anim97(uPlayerIdx);
+      PlayAwardSound_Anim97();
       return;
     case VAR_LevelModifier:
       this->sLevelModifier = min(this->sLevelModifier + val, 255);
-      PlayAwardSound_Anim97(uPlayerIdx);
+      PlayAwardSound_Anim97();
       return;
     case VAR_Age:
       this->sAgeModifier += val;
@@ -6130,19 +6133,19 @@
     case VAR_Award:
       if (_449B57_test_bit(this->_achieved_awards_bits, val) && pAwards[val].pText )
       {
-        PlayAwardSound_Anim97_Face(uPlayerIdx, SPEECH_96);
+        PlayAwardSound_Anim97_Face(SPEECH_96);
       }
       _449B7E_toggle_bit(this->_achieved_awards_bits, val, 1);
       return;
     case VAR_Experience:
       this->uExperience = min(this->uExperience + val, 4000000000i64);
-      PlayAwardSound_Anim97(uPlayerIdx);
+      PlayAwardSound_Anim97();
       return;
     case VAR_QBits_QuestsDone:
       if ( !_449B57_test_bit(pParty->_quest_bits, val) && pQuestTable[val] )
       {
         bFlashQuestBook = 1;
-        PlayAwardSound_Anim97_Face(uPlayerIdx, SPEECH_93);
+        PlayAwardSound_Anim97_Face(SPEECH_93);
       }
       _449B7E_toggle_bit(pParty->_quest_bits, val, 1);
       return;
@@ -6164,31 +6167,31 @@
       return;
     case VAR_BaseMight:
       this->uMight = min(this->uMight + val, 255);
-      PlayAwardSound_Anim97_Face(uPlayerIdx, SPEECH_92);
+      PlayAwardSound_Anim97_Face(SPEECH_92);
       return;
     case VAR_BaseIntellect:
       this->uIntelligence = min(this->uIntelligence + val, 255);
-      PlayAwardSound_Anim97_Face(uPlayerIdx, SPEECH_92);
+      PlayAwardSound_Anim97_Face(SPEECH_92);
       return;
     case VAR_BasePersonality:
       this->uWillpower = min(this->uWillpower + val, 255);
-      PlayAwardSound_Anim97_Face(uPlayerIdx, SPEECH_92);
+      PlayAwardSound_Anim97_Face(SPEECH_92);
       return;
     case VAR_BaseEndurance:
       this->uEndurance = min(this->uEndurance + val, 255);
-      PlayAwardSound_Anim97_Face(uPlayerIdx, SPEECH_92);
+      PlayAwardSound_Anim97_Face(SPEECH_92);
       return;
     case VAR_BaseSpeed:
       this->uSpeed = min(this->uSpeed + val, 255);
-      PlayAwardSound_Anim97_Face(uPlayerIdx, SPEECH_92);
+      PlayAwardSound_Anim97_Face(SPEECH_92);
       return;
     case VAR_BaseAccuracy:
       this->uAccuracy = min(this->uAccuracy + val, 255);
-      PlayAwardSound_Anim97_Face(uPlayerIdx, SPEECH_92);
+      PlayAwardSound_Anim97_Face(SPEECH_92);
       return;
     case VAR_BaseLuck:
       this->uLuck = min(this->uLuck + val, 255);
-      PlayAwardSound_Anim97_Face(uPlayerIdx, SPEECH_92);
+      PlayAwardSound_Anim97_Face(SPEECH_92);
       return;
     case VAR_FixedFood:
       Party::GiveFood(val);
@@ -6196,194 +6199,194 @@
       ShowStatusBarString(pTmpBuf.data(), 2u);
       if ( pParty->uNumFoodRations > 0xFFFF )
         Party::SetFood(0xFFFFu);
-      PlayAwardSound(uPlayerIdx);
+      PlayAwardSound();
       return;
     case VAR_MightBonus:
     case VAR_ActualMight:
       this->uMightBonus = min(this->uMightBonus + val, 255);
-      PlayAwardSound_Anim97_Face(uPlayerIdx, SPEECH_91);
+      PlayAwardSound_Anim97_Face(SPEECH_91);
       return;
     case VAR_IntellectBonus:
     case VAR_ActualIntellect:
       this->uIntelligenceBonus = min(this->uIntelligenceBonus + val, 255);
-      PlayAwardSound_Anim97_Face(uPlayerIdx, SPEECH_91);
+      PlayAwardSound_Anim97_Face(SPEECH_91);
       return;
     case VAR_PersonalityBonus:
     case VAR_ActualPersonality:
       this->uWillpowerBonus = min(this->uWillpowerBonus + val, 255);
-      PlayAwardSound_Anim97_Face(uPlayerIdx, SPEECH_91);
+      PlayAwardSound_Anim97_Face(SPEECH_91);
       return;
     case VAR_EnduranceBonus:
     case VAR_ActualEndurance:
       this->uEnduranceBonus = min(this->uEnduranceBonus + val, 255);
-      PlayAwardSound_Anim97_Face(uPlayerIdx, SPEECH_91);
+      PlayAwardSound_Anim97_Face(SPEECH_91);
       return;
     case VAR_SpeedBonus:
     case VAR_ActualSpeed:
       this->uSpeedBonus = min(this->uSpeedBonus + val, 255);
-      PlayAwardSound_Anim97_Face(uPlayerIdx, SPEECH_91);
+      PlayAwardSound_Anim97_Face(SPEECH_91);
       return;
     case VAR_AccuracyBonus:
     case VAR_ActualAccuracy:
       this->uAccuracyBonus = min(this->uAccuracyBonus + val, 255);
-      PlayAwardSound_Anim97_Face(uPlayerIdx, SPEECH_91);
+      PlayAwardSound_Anim97_Face(SPEECH_91);
       return;
     case VAR_LuckBonus:
     case VAR_ActualLuck:
       this->uLuckBonus = min(this->uLuckBonus + val, 255);
-      PlayAwardSound_Anim97_Face(uPlayerIdx, SPEECH_91);
+      PlayAwardSound_Anim97_Face(SPEECH_91);
       return;
     case VAR_FireResistance:
       this->sResFireBase = min(this->sResFireBase + val, 255);
-      PlayAwardSound_Anim97_Face(uPlayerIdx, SPEECH_92);
+      PlayAwardSound_Anim97_Face(SPEECH_92);
       return;
     case VAR_AirResistance:
       this->sResAirBase = min(this->sResAirBase + val, 255);
-      PlayAwardSound_Anim97_Face(uPlayerIdx, SPEECH_92);
+      PlayAwardSound_Anim97_Face(SPEECH_92);
       return;
     case VAR_WaterResistance:
       this->sResWaterBase = min(this->sResWaterBase + val, 255);
-      PlayAwardSound_Anim97_Face(uPlayerIdx, SPEECH_92);
+      PlayAwardSound_Anim97_Face(SPEECH_92);
       return;
     case VAR_EarthResistance:
       this->sResEarthBase = min(this->sResEarthBase + val, 255);
-      PlayAwardSound_Anim97_Face(uPlayerIdx, SPEECH_92);
+      PlayAwardSound_Anim97_Face(SPEECH_92);
       return;
     case VAR_SpiritResistance:
       this->sResSpiritBase = min(this->sResSpiritBase + val, 255);
-      PlayAwardSound_Anim97_Face(uPlayerIdx, SPEECH_92);
+      PlayAwardSound_Anim97_Face(SPEECH_92);
       return;
     case VAR_MindResistance:
       this->sResMindBase = min(this->sResMindBase + val, 255);
-      PlayAwardSound_Anim97_Face(uPlayerIdx, SPEECH_92);
+      PlayAwardSound_Anim97_Face(SPEECH_92);
       return;
     case VAR_BodyResistance:
       this->sResBodyBase = min(this->sResBodyBase + val, 255);
-      PlayAwardSound_Anim97_Face(uPlayerIdx, SPEECH_92);
+      PlayAwardSound_Anim97_Face(SPEECH_92);
       return;
     case VAR_LightResistance:
       this->sResLightBase = min(this->sResLightBase + val, 255);
-      PlayAwardSound_Anim97_Face(uPlayerIdx, SPEECH_92);
+      PlayAwardSound_Anim97_Face(SPEECH_92);
       return;
     case VAR_DarkResistance:
       this->sResDarkBase = min(this->sResDarkBase + val, 255);
-      PlayAwardSound_Anim97_Face(uPlayerIdx, SPEECH_92);
+      PlayAwardSound_Anim97_Face(SPEECH_92);
       return;
     case VAR_MagicResistance:
       this->sResMagicBase = min(this->sResMagicBase + val, 255);
-      PlayAwardSound_Anim97_Face(uPlayerIdx, SPEECH_92);
+      PlayAwardSound_Anim97_Face(SPEECH_92);
       return;
     case VAR_FireResistanceBonus:
       this->sResFireBonus = min(this->sResFireBonus + val, 255);
-      PlayAwardSound_Anim97_Face(uPlayerIdx, SPEECH_91);
+      PlayAwardSound_Anim97_Face(SPEECH_91);
       return;
     case VAR_AirResistanceBonus:
       this->sResAirBonus = min(this->sResAirBonus + val, 255);
-      PlayAwardSound_Anim97_Face(uPlayerIdx, SPEECH_91);
+      PlayAwardSound_Anim97_Face(SPEECH_91);
       return;
     case VAR_WaterResistanceBonus:
       this->sResWaterBonus = min(this->sResWaterBonus + val, 255);
-      PlayAwardSound_Anim97_Face(uPlayerIdx, SPEECH_91);
+      PlayAwardSound_Anim97_Face(SPEECH_91);
       return;
     case VAR_EarthResistanceBonus:
       this->sResEarthBonus = min(this->sResEarthBonus + val, 255);
-      PlayAwardSound_Anim97_Face(uPlayerIdx, SPEECH_91);
+      PlayAwardSound_Anim97_Face(SPEECH_91);
       return;
     case VAR_SpiritResistanceBonus:
       this->sResSpiritBonus = min(this->sResSpiritBonus + val, 255);
-      PlayAwardSound_Anim97_Face(uPlayerIdx, SPEECH_91);
+      PlayAwardSound_Anim97_Face(SPEECH_91);
       return;
     case VAR_MindResistanceBonus:
       this->sResMindBonus = min(this->sResMindBonus + val, 255);
-      PlayAwardSound_Anim97_Face(uPlayerIdx, SPEECH_91);
+      PlayAwardSound_Anim97_Face(SPEECH_91);
       return;
     case VAR_BodyResistanceBonus:
       this->sResBodyBonus = min(this->sResBodyBonus + val, 255);
-      PlayAwardSound_Anim97_Face(uPlayerIdx, SPEECH_91);
+      PlayAwardSound_Anim97_Face(SPEECH_91);
       return;
     case VAR_LightResistanceBonus:
       this->sResLightBonus = min(this->sResLightBonus + val, 255);
-      PlayAwardSound_Anim97_Face(uPlayerIdx, SPEECH_91);
+      PlayAwardSound_Anim97_Face(SPEECH_91);
       return;
     case VAR_DarkResistanceBonus:
       this->sResDarkBonus = min(this->sResDarkBonus + val, 255);
-      PlayAwardSound_Anim97_Face(uPlayerIdx, SPEECH_91);
+      PlayAwardSound_Anim97_Face(SPEECH_91);
       return;
     case VAR_MagicResistanceBonus:
       this->sResMagicBonus = min(this->sResMagicBonus + val, 255);
-      PlayAwardSound_Anim97_Face(uPlayerIdx, SPEECH_91);
+      PlayAwardSound_Anim97_Face(SPEECH_91);
       return;
     case VAR_Cursed:
       this->SetCondition(Condition_Cursed, 1);
-      PlayAwardSound_Anim97(uPlayerIdx);
+      PlayAwardSound_Anim97();
       return;
     case VAR_Weak:
       this->SetCondition(Condition_Weak, 1);
-      PlayAwardSound_Anim97(uPlayerIdx);
+      PlayAwardSound_Anim97();
       return;
     case VAR_Asleep:
       this->SetCondition(Condition_Sleep, 1);
-      PlayAwardSound_Anim97(uPlayerIdx);
+      PlayAwardSound_Anim97();
       return;
     case VAR_Afraid:
       this->SetCondition(Condition_Fear, 1);
-      PlayAwardSound_Anim97(uPlayerIdx);
+      PlayAwardSound_Anim97();
       return;
     case VAR_Drunk:
       this->SetCondition(Condition_Drunk, 1);
-      PlayAwardSound_Anim97(uPlayerIdx);
+      PlayAwardSound_Anim97();
       return;
     case VAR_Insane:
       this->SetCondition(Condition_Insane, 1);
-      PlayAwardSound_Anim97(uPlayerIdx);
+      PlayAwardSound_Anim97();
       return;
     case VAR_PoisonedGreen:
       this->SetCondition(Condition_Poison1, 1);
-      PlayAwardSound_Anim97(uPlayerIdx);
+      PlayAwardSound_Anim97();
       return;
     case VAR_DiseasedGreen:
       this->SetCondition(Condition_Disease1, 1);
-      PlayAwardSound_Anim97(uPlayerIdx);
+      PlayAwardSound_Anim97();
       return;
     case VAR_PoisonedYellow:
       this->SetCondition(Condition_Poison2, 1);
-      PlayAwardSound_Anim97(uPlayerIdx);
+      PlayAwardSound_Anim97();
       return;
     case VAR_DiseasedYellow:
       this->SetCondition(Condition_Disease2, 1);
-      PlayAwardSound_Anim97(uPlayerIdx);
+      PlayAwardSound_Anim97();
       return;
     case VAR_PoisonedRed:
       this->SetCondition(Condition_Poison3, 1);
-      PlayAwardSound_Anim97(uPlayerIdx);
+      PlayAwardSound_Anim97();
       return;
     case VAR_DiseasedRed:
       this->SetCondition(Condition_Disease3, 1);
-      PlayAwardSound_Anim97(uPlayerIdx);
+      PlayAwardSound_Anim97();
       return;
     case VAR_Paralyzed:
       this->SetCondition(Condition_Paralyzed, 1);
-      PlayAwardSound_Anim97(uPlayerIdx);
+      PlayAwardSound_Anim97();
       return;
     case VAR_Unconsious:
       this->SetCondition(Condition_Unconcious, 1);
-      PlayAwardSound_Anim97(uPlayerIdx);
+      PlayAwardSound_Anim97();
       return;
     case VAR_Dead:
       this->SetCondition(Condition_Dead, 1);
-      PlayAwardSound_Anim97(uPlayerIdx);
+      PlayAwardSound_Anim97();
       return;
     case VAR_Stoned:
       this->SetCondition(Condition_Pertified, 1);
-      PlayAwardSound_Anim97(uPlayerIdx);
+      PlayAwardSound_Anim97();
       return;
     case VAR_Eradicated:
       this->SetCondition(Condition_Eradicated, 1);
-      PlayAwardSound_Anim97(uPlayerIdx);
+      PlayAwardSound_Anim97();
       return;
     case VAR_MajorCondition :
       memset(this, 0, 0xA0u);
-      PlayAwardSound_Anim97(uPlayerIdx);
+      PlayAwardSound_Anim97();
       return;
     case VAR_AutoNotes:
         if ( !_449B57_test_bit(pParty->_autonote_bits, val) && pAutonoteTxt[val].pText )
@@ -6391,13 +6394,13 @@
           this->PlaySound(SPEECH_96, 0);
           bFlashAutonotesBook = 1;
           _506568_autonote_type = pAutonoteTxt[val].eType;
-          pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx);
+          pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, GetPlayerIndex());
         }
         _449B7E_toggle_bit(pParty->_autonote_bits, val, 1);
-        PlayAwardSound(uPlayerIdx);
+        PlayAwardSound();
         return;
     case VAR_PlayerBits:
-      _449B7E_toggle_bit((unsigned char *)this->field_1A50, val, 1u);
+      _449B7E_toggle_bit((unsigned char *)this->playerEventBits, val, 1u);
       return;
     case VAR_NPCs2:
       pParty->hirelingScrollPosition = 0;
@@ -6441,115 +6444,115 @@
       pParty->uNumArenaLordWins += val;
       return;
     case VAR_StaffSkill:
-      AddSkillByEvent(&Player::skillStaff, val, uPlayerIdx);
+      AddSkillByEvent(&Player::skillStaff, val);
       return;
     case VAR_SwordSkill:
-      AddSkillByEvent(&Player::skillSword, val, uPlayerIdx);
+      AddSkillByEvent(&Player::skillSword, val);
       return;
     case VAR_DaggerSkill:
-      AddSkillByEvent(&Player::skillDagger, val, uPlayerIdx);
+      AddSkillByEvent(&Player::skillDagger, val);
       return;
     case VAR_AxeSkill:
-      AddSkillByEvent(&Player::skillAxe, val, uPlayerIdx);
+      AddSkillByEvent(&Player::skillAxe, val);
       return;
     case VAR_SpearSkill:
-      AddSkillByEvent(&Player::skillSpear, val, uPlayerIdx);
+      AddSkillByEvent(&Player::skillSpear, val);
       return;
     case VAR_BowSkill:
-      AddSkillByEvent(&Player::skillBow, val, uPlayerIdx);
+      AddSkillByEvent(&Player::skillBow, val);
       return;
     case VAR_MaceSkill:
-      AddSkillByEvent(&Player::skillMace, val, uPlayerIdx);
+      AddSkillByEvent(&Player::skillMace, val);
       return;
     case VAR_BlasterSkill:
-      AddSkillByEvent(&Player::skillBlaster, val, uPlayerIdx);
+      AddSkillByEvent(&Player::skillBlaster, val);
       return;
     case VAR_ShieldSkill:
-      AddSkillByEvent(&Player::skillShield, val, uPlayerIdx);
+      AddSkillByEvent(&Player::skillShield, val);
       return;
     case VAR_LeatherSkill:
-      AddSkillByEvent(&Player::skillLeather, val, uPlayerIdx);
+      AddSkillByEvent(&Player::skillLeather, val);
       return;
     case VAR_SkillChain:
-      AddSkillByEvent(&Player::skillChain, val, uPlayerIdx);
+      AddSkillByEvent(&Player::skillChain, val);
       return;
     case VAR_PlateSkill:
-      AddSkillByEvent(&Player::skillPlate, val, uPlayerIdx);
+      AddSkillByEvent(&Player::skillPlate, val);
       return;
     case VAR_FireSkill:
-      AddSkillByEvent(&Player::skillFire, val, uPlayerIdx);
+      AddSkillByEvent(&Player::skillFire, val);
       return;
     case VAR_AirSkill:
-      AddSkillByEvent(&Player::skillAir, val, uPlayerIdx);
+      AddSkillByEvent(&Player::skillAir, val);
       return;
     case VAR_WaterSkill:
-      AddSkillByEvent(&Player::skillWater, val, uPlayerIdx);
+      AddSkillByEvent(&Player::skillWater, val);
       return;
     case VAR_EarthSkill:
-      AddSkillByEvent(&Player::skillEarth, val, uPlayerIdx);
+      AddSkillByEvent(&Player::skillEarth, val);
       return;
     case VAR_SpiritSkill:
-      AddSkillByEvent(&Player::skillSpirit, val, uPlayerIdx);
+      AddSkillByEvent(&Player::skillSpirit, val);
       return;
     case VAR_MindSkill:
-      AddSkillByEvent(&Player::skillMind, val, uPlayerIdx);
+      AddSkillByEvent(&Player::skillMind, val);
       return;
     case VAR_BodySkill:
-      AddSkillByEvent(&Player::skillBody, val, uPlayerIdx);
+      AddSkillByEvent(&Player::skillBody, val);
       return;
     case VAR_LightSkill:
-      AddSkillByEvent(&Player::skillLight, val, uPlayerIdx);
+      AddSkillByEvent(&Player::skillLight, val);
       return;
     case VAR_DarkSkill:
-      AddSkillByEvent(&Player::skillDark, val, uPlayerIdx);
+      AddSkillByEvent(&Player::skillDark, val);
       return;
     case VAR_IdentifyItemSkill:
-      AddSkillByEvent(&Player::skillItemId, val, uPlayerIdx);
+      AddSkillByEvent(&Player::skillItemId, val);
       return;
     case VAR_MerchantSkill:
-      AddSkillByEvent(&Player::skillMerchant, val, uPlayerIdx);
+      AddSkillByEvent(&Player::skillMerchant, val);
       return;
     case VAR_RepairSkill:
-      AddSkillByEvent(&Player::skillRepair, val, uPlayerIdx);
+      AddSkillByEvent(&Player::skillRepair, val);
       return;
     case VAR_BodybuildingSkill:
-      AddSkillByEvent(&Player::skillBodybuilding, val, uPlayerIdx);
+      AddSkillByEvent(&Player::skillBodybuilding, val);
       return;
     case VAR_MeditationSkill:
-      AddSkillByEvent(&Player::skillMeditation, val, uPlayerIdx);
+      AddSkillByEvent(&Player::skillMeditation, val);
       return;
     case VAR_PerceptionSkill:
-      AddSkillByEvent(&Player::skillPerception, val, uPlayerIdx);
+      AddSkillByEvent(&Player::skillPerception, val);
       return;
     case VAR_DiplomacySkill:
-      AddSkillByEvent(&Player::skillDiplomacy, val, uPlayerIdx);
+      AddSkillByEvent(&Player::skillDiplomacy, val);
       return;
     case VAR_ThieverySkill:
       Error ("Thieving unsupported");
       return;
     case VAR_DisarmTrapSkill:
-      AddSkillByEvent(&Player::skillDisarmTrap, val, uPlayerIdx);
+      AddSkillByEvent(&Player::skillDisarmTrap, val);
       return;
     case VAR_DodgeSkill:
-      AddSkillByEvent(&Player::skillDodge, val, uPlayerIdx);
+      AddSkillByEvent(&Player::skillDodge, val);
       return;
     case VAR_UnarmedSkill:
-      AddSkillByEvent(&Player::skillUnarmed, val, uPlayerIdx);
+      AddSkillByEvent(&Player::skillUnarmed, val);
       return;
     case VAR_IdentifyMonsterSkill:
-      AddSkillByEvent(&Player::skillMonsterId, val, uPlayerIdx);
+      AddSkillByEvent(&Player::skillMonsterId, val);
       return;
     case VAR_ArmsmasterSkill:
-      AddSkillByEvent(&Player::skillArmsmaster, val, uPlayerIdx);
+      AddSkillByEvent(&Player::skillArmsmaster, val);
       return;
     case VAR_StealingSkill:
-      AddSkillByEvent(&Player::skillStealing, val, uPlayerIdx);
+      AddSkillByEvent(&Player::skillStealing, val);
       return;
     case VAR_AlchemySkill:
-      AddSkillByEvent(&Player::skillAlchemy, val, uPlayerIdx);
+      AddSkillByEvent(&Player::skillAlchemy, val);
       return;
     case VAR_LearningSkill:
-      AddSkillByEvent(&Player::skillLearning, val, uPlayerIdx);
+      AddSkillByEvent(&Player::skillLearning, val);
       return;
     default:
       return;
@@ -6557,21 +6560,22 @@
 }
 
 //----- (new function) --------------------------------------------------------
-void Player::PlayAwardSound_Anim97(int currPlayerId)
-{
-  pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, currPlayerId);
-  PlayAwardSound(currPlayerId);
+void Player::PlayAwardSound_Anim97()
+{
+  int playerIndex = GetPlayerIndex();
+  pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, playerIndex);
+  PlayAwardSound();
 }
 
 //----- (new function) --------------------------------------------------------
-void Player::PlayAwardSound_Anim97_Face(int currPlayerId, PlayerSpeech speech)
+void Player::PlayAwardSound_Anim97_Face( PlayerSpeech speech )
 {
   this->PlaySound(speech, 0);
-  PlayAwardSound_Anim97(currPlayerId);
+  PlayAwardSound_Anim97();
 }
 
 //----- (new function) --------------------------------------------------------
-void Player::AddSkillByEvent( unsigned __int16 Player::* skillToSet, unsigned __int16 addSkillValue, int currPlayerId )
+void Player::AddSkillByEvent( unsigned __int16 Player::* skillToSet, unsigned __int16 addSkillValue )
 {
   if ( addSkillValue > 63 )
   {
@@ -6581,31 +6585,28 @@
   {
     this->*skillToSet = min(this->*skillToSet + addSkillValue, 60) | this->*skillToSet & 0xC0;
   }
-  PlayAwardSound_Anim97(currPlayerId);
+  PlayAwardSound_Anim97();
   return;
 }
 
 //----- (0044B9C4) --------------------------------------------------------
 void Player::SubtractVariable( enum VariableType VarNum, signed int pValue )
 {
-  signed int playerId; // esi@1
   DDM_DLV_Header *locationHeader; // eax@90
   int randGold;
   int randFood;
   int npcIndex;
 
-  playerId = 0;
-  if ( this == pPlayers[2] )
-    playerId = 1;
-  else if ( this == pPlayers[3] )
-    playerId = 2;
-  else if ( this == pPlayers[4] )  
-    playerId = 3;
-
   if ( VarNum >= VAR_MapPersistentVariable_0 && VarNum <= VAR_MapPersistentVariable_99 )
   {
-
-    byte_5E4C15[VarNum] -= (char)pValue;
+    if ( VarNum >= VAR_MapPersistentVariable_0 && VarNum <= VAR_MapPersistentVariable_74 )
+    {
+      stru_5E4C90_MapPersistVars.field_0[VarNum - VAR_MapPersistentVariable_0] -= pValue;
+    }
+    if ( (signed int)VarNum >= VAR_MapPersistentVariable_75 && VarNum <= VAR_MapPersistentVariable_99 )
+    {
+      stru_5E4C90_MapPersistVars._decor_events[VarNum - VAR_MapPersistentVariable_75] -= pValue;
+    }
     return;
   }
 
@@ -6613,23 +6614,23 @@
   {
     case VAR_CurrentHP:
       ReceiveDamage((signed int)pValue, DMGT_PHISYCAL);
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_CurrentSP:
       this->sMana = max(this->sMana - pValue, 0);
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_ACModifier:
       this->sACModifier -= (unsigned __int8)pValue;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_BaseLevel:
       this->uLevel -= (unsigned __int8)pValue;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_LevelModifier:
       this->sLevelModifier -= (unsigned __int8)pValue;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_Age:
       this->sAgeModifier -= (signed __int16)pValue;
@@ -6639,7 +6640,7 @@
       return;
     case VAR_Experience:
       this->uExperience -= pValue;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_QBits_QuestsDone:
       _449B7E_toggle_bit(pParty->_quest_bits, (__int16)pValue, 0);
@@ -6679,7 +6680,7 @@
       return;
     case VAR_FixedFood:
       Party::TakeFood((unsigned int)pValue);
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_RandomFood:
       randFood = rand() % (signed int)pValue + 1;
@@ -6689,362 +6690,365 @@
       sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[504], randFood);
       ShowStatusBarString(pTmpBuf.data(), 2u);
       GameUI_DrawFoodAndGold();
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_MightBonus:
     case VAR_ActualMight:
       this->uMightBonus -= (unsigned __int16)pValue;
-      this->PlayAwardSound_Anim98_Face(playerId, SPEECH_91);
+      this->PlayAwardSound_Anim98_Face(SPEECH_91);
       return;
     case VAR_IntellectBonus:
     case VAR_ActualIntellect:
       this->uIntelligenceBonus -= (unsigned __int16)pValue;
-      this->PlayAwardSound_Anim98_Face(playerId, SPEECH_91);
+      this->PlayAwardSound_Anim98_Face(SPEECH_91);
       return;
     case VAR_PersonalityBonus:
     case VAR_ActualPersonality:
       this->uWillpowerBonus -= (unsigned __int16)pValue;
-      this->PlayAwardSound_Anim98_Face(playerId, SPEECH_91);
+      this->PlayAwardSound_Anim98_Face(SPEECH_91);
       return;
     case VAR_EnduranceBonus:
     case VAR_ActualEndurance:
       this->uEnduranceBonus -= (unsigned __int16)pValue;
-      this->PlayAwardSound_Anim98_Face(playerId, SPEECH_91);
+      this->PlayAwardSound_Anim98_Face(SPEECH_91);
       return;
     case VAR_SpeedBonus:
     case VAR_ActualSpeed:
       this->uSpeedBonus -= (unsigned __int16)pValue;
-      this->PlayAwardSound_Anim98_Face(playerId, SPEECH_91);
+      this->PlayAwardSound_Anim98_Face(SPEECH_91);
       return;
     case VAR_AccuracyBonus:
     case VAR_ActualAccuracy:
       this->uAccuracyBonus -= (unsigned __int16)pValue;
-      this->PlayAwardSound_Anim98_Face(playerId, SPEECH_91);
+      this->PlayAwardSound_Anim98_Face(SPEECH_91);
       return;
     case VAR_LuckBonus:
     case VAR_ActualLuck:
       this->uLuckBonus -= (unsigned __int16)pValue;
-      this->PlayAwardSound_Anim98_Face(playerId, SPEECH_91);
+      this->PlayAwardSound_Anim98_Face(SPEECH_91);
       return;
     case VAR_BaseMight:
       this->uMight -= (unsigned __int16)pValue;
-      this->PlayAwardSound_Anim98_Face(playerId, SPEECH_92);
+      this->PlayAwardSound_Anim98_Face(SPEECH_92);
       return;
     case VAR_BaseIntellect:
       this->uIntelligence -= (unsigned __int16)pValue;
-      this->PlayAwardSound_Anim98_Face(playerId, SPEECH_92);
+      this->PlayAwardSound_Anim98_Face(SPEECH_92);
       return;
     case VAR_BasePersonality:
       this->uWillpower -= (unsigned __int16)pValue;
-      this->PlayAwardSound_Anim98_Face(playerId, SPEECH_92);
+      this->PlayAwardSound_Anim98_Face(SPEECH_92);
       return;
     case VAR_BaseEndurance:
       this->uEndurance -= (unsigned __int16)pValue;
-      this->PlayAwardSound_Anim98_Face(playerId, SPEECH_92);
+      this->PlayAwardSound_Anim98_Face(SPEECH_92);
       return;
     case VAR_BaseSpeed:
       this->uSpeed -= (unsigned __int16)pValue;
-      this->PlayAwardSound_Anim98_Face(playerId, SPEECH_92);
+      this->PlayAwardSound_Anim98_Face(SPEECH_92);
       return;
     case VAR_BaseAccuracy:
       this->uAccuracy -= (unsigned __int16)pValue;
-      this->PlayAwardSound_Anim98_Face(playerId, SPEECH_92);
+      this->PlayAwardSound_Anim98_Face(SPEECH_92);
       return;
     case VAR_BaseLuck:
       this->uLuck -= (unsigned __int16)pValue;
-      this->PlayAwardSound_Anim98_Face(playerId, SPEECH_92);
+      this->PlayAwardSound_Anim98_Face(SPEECH_92);
       return;
     case VAR_FireResistance:
       this->sResFireBase -= (signed __int16)pValue;
-      this->PlayAwardSound_Anim98_Face(playerId, SPEECH_92);
+      this->PlayAwardSound_Anim98_Face(SPEECH_92);
       return;
     case VAR_AirResistance:
       this->sResAirBase -= (signed __int16)pValue;
-      this->PlayAwardSound_Anim98_Face(playerId, SPEECH_92);
+      this->PlayAwardSound_Anim98_Face(SPEECH_92);
       return;
     case VAR_WaterResistance:
       this->sResWaterBase -= (signed __int16)pValue;
-      this->PlayAwardSound_Anim98_Face(playerId, SPEECH_92);
+      this->PlayAwardSound_Anim98_Face(SPEECH_92);
       return;
     case VAR_EarthResistance:
       this->sResEarthBase -= (signed __int16)pValue;
-      this->PlayAwardSound_Anim98_Face(playerId, SPEECH_92);
+      this->PlayAwardSound_Anim98_Face(SPEECH_92);
       return;
     case VAR_SpiritResistance:
       this->sResSpiritBase -= (signed __int16)pValue;
-      this->PlayAwardSound_Anim98_Face(playerId, SPEECH_92);
+      this->PlayAwardSound_Anim98_Face(SPEECH_92);
       return;
     case VAR_MindResistance:
       this->sResMindBase -= (signed __int16)pValue;
-      this->PlayAwardSound_Anim98_Face(playerId, SPEECH_92);
+      this->PlayAwardSound_Anim98_Face(SPEECH_92);
       return;
     case VAR_BodyResistance:
       this->sResBodyBase -= (signed __int16)pValue;
-      this->PlayAwardSound_Anim98_Face(playerId, SPEECH_92);
+      this->PlayAwardSound_Anim98_Face(SPEECH_92);
       return;
     case VAR_LightResistance:
       this->sResLightBase -= (signed __int16)pValue;
-      this->PlayAwardSound_Anim98_Face(playerId, SPEECH_92);
+      this->PlayAwardSound_Anim98_Face(SPEECH_92);
       return;
     case VAR_DarkResistance:
       this->sResDarkBase -= (signed __int16)pValue;
-      this->PlayAwardSound_Anim98_Face(playerId, SPEECH_92);
+      this->PlayAwardSound_Anim98_Face(SPEECH_92);
       return;
     case VAR_MagicResistance:
       this->sResMagicBase -= (signed __int16)pValue;
-      this->PlayAwardSound_Anim98_Face(playerId, SPEECH_92);
+      this->PlayAwardSound_Anim98_Face(SPEECH_92);
       return;
     case VAR_FireResistanceBonus:
       this->sResFireBonus -= (signed __int16)pValue;
-      this->PlayAwardSound_Anim98_Face(playerId, SPEECH_92);
+      this->PlayAwardSound_Anim98_Face(SPEECH_92);
       return;
     case VAR_AirResistanceBonus:
       this->sResAirBonus -= (signed __int16)pValue;
-      this->PlayAwardSound_Anim98_Face(playerId, SPEECH_92);
+      this->PlayAwardSound_Anim98_Face(SPEECH_92);
       return;
     case VAR_WaterResistanceBonus:
       this->sResWaterBonus -= (signed __int16)pValue;
-      this->PlayAwardSound_Anim98_Face(playerId, SPEECH_91);
+      this->PlayAwardSound_Anim98_Face(SPEECH_91);
       return;
     case VAR_EarthResistanceBonus:
       this->sResEarthBonus -= (signed __int16)pValue;
-      this->PlayAwardSound_Anim98_Face(playerId, SPEECH_91);
+      this->PlayAwardSound_Anim98_Face(SPEECH_91);
       return;
     case VAR_SpiritResistanceBonus:
       this->sResSpiritBonus -= (signed __int16)pValue;
-      this->PlayAwardSound_Anim98_Face(playerId, SPEECH_91);
+      this->PlayAwardSound_Anim98_Face(SPEECH_91);
       return;
     case VAR_MindResistanceBonus:
       this->sResMindBonus -= (signed __int16)pValue;
-      this->PlayAwardSound_Anim98_Face(playerId, SPEECH_91);
+      this->PlayAwardSound_Anim98_Face(SPEECH_91);
       return;
     case VAR_BodyResistanceBonus:
       this->sResBodyBonus -= (signed __int16)pValue;
-      this->PlayAwardSound_Anim98_Face(playerId, SPEECH_91);
+      this->PlayAwardSound_Anim98_Face(SPEECH_91);
       return;
     case VAR_LightResistanceBonus:
       this->sResLightBonus -= (signed __int16)pValue;
-      this->PlayAwardSound_Anim98_Face(playerId, SPEECH_91);
+      this->PlayAwardSound_Anim98_Face(SPEECH_91);
       return;
     case VAR_DarkResistanceBonus:
       this->sResDarkBonus -= (signed __int16)pValue;
-      this->PlayAwardSound_Anim98_Face(playerId, SPEECH_91);
+      this->PlayAwardSound_Anim98_Face(SPEECH_91);
       return;
     case VAR_MagicResistanceBonus:
       this->sResMagicBonus -= (signed __int16)pValue;
-      this->PlayAwardSound_Anim98_Face(playerId, SPEECH_91);
+      this->PlayAwardSound_Anim98_Face(SPEECH_91);
       return;
     case VAR_StaffSkill:
       this->skillStaff -= (unsigned __int8)pValue;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_SwordSkill:
       this->skillSword -= (unsigned __int8)pValue;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_DaggerSkill:
       this->skillDagger -= (unsigned __int8)pValue;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_AxeSkill:
       this->skillAxe -= (unsigned __int8)pValue;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_SpearSkill:
       this->skillSpear -= (unsigned __int8)pValue;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_BowSkill:
       this->skillBow -= (unsigned __int8)pValue;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_MaceSkill:
       this->skillMace -= (unsigned __int8)pValue;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_BlasterSkill:
       this->skillBlaster -= (unsigned __int8)pValue;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_ShieldSkill:
       this->skillShield -= (unsigned __int8)pValue;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_LeatherSkill:
       this->skillLearning -= (unsigned __int8)pValue;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_SkillChain:
       this->skillChain -= (unsigned __int8)pValue;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_PlateSkill:
       this->skillPlate -= (unsigned __int8)pValue;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_FireSkill:
       this->skillFire -= (unsigned __int8)pValue;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_AirSkill:
       this->skillAir -= (unsigned __int8)pValue;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_WaterSkill:
       this->skillWater -= (unsigned __int8)pValue;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_EarthSkill:
       this->skillEarth -= (unsigned __int8)pValue;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_SpiritSkill:
       this->skillSpirit -= (unsigned __int8)pValue;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_MindSkill:
       this->skillMind -= (unsigned __int8)pValue;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_BodySkill:
       this->skillBody -= (unsigned __int8)pValue;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_LightSkill:
       this->skillLight -= (unsigned __int8)pValue;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_DarkSkill:
       this->skillDark -= (unsigned __int8)pValue;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_IdentifyItemSkill:
       this->skillItemId -= (unsigned __int8)pValue;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_MerchantSkill:
       this->skillMerchant -= (unsigned __int8)pValue;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_RepairSkill:
       this->skillRepair -= (unsigned __int8)pValue;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_BodybuildingSkill:
       this->skillBodybuilding -= (unsigned __int8)pValue;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_MeditationSkill:
       this->skillMeditation -= (unsigned __int8)pValue;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_PerceptionSkill:
       this->skillPerception -= (unsigned __int8)pValue;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_DiplomacySkill:
       this->skillDiplomacy -= (unsigned __int8)pValue;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
+      return;
+    case VAR_ThieverySkill:
+      Error ("Thieving unsupported");
       return;
     case VAR_DisarmTrapSkill:
       this->skillDisarmTrap -= (unsigned __int8)pValue;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_DodgeSkill:
       this->skillDodge -= (unsigned __int8)pValue;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_UnarmedSkill:
       this->skillUnarmed -= (unsigned __int8)pValue;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_IdentifyMonsterSkill:
       this->skillMonsterId -= (unsigned __int8)pValue;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_ArmsmasterSkill:
       this->skillArmsmaster -= (unsigned __int8)pValue;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_StealingSkill:
       this->skillStealing -= (unsigned __int8)pValue;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_AlchemySkill:
       this->skillAlchemy -= (unsigned __int8)pValue;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_LearningSkill:
       this->skillLearning -= (unsigned __int8)pValue;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_Cursed:
       this->pConditions[Condition_Cursed] = 0;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_Weak:
       this->pConditions[Condition_Weak] = 0;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_Asleep:
       this->pConditions[Condition_Sleep] = 0;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_Afraid:
       this->pConditions[Condition_Fear] = 0;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_Drunk:
       this->pConditions[Condition_Drunk] = 0;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_Insane:
       this->pConditions[Condition_Insane] = 0;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_PoisonedGreen:
       this->pConditions[Condition_Poison1] = 0;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_DiseasedGreen:
       this->pConditions[Condition_Disease1] = 0;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_PoisonedYellow:
       this->pConditions[Condition_Poison2] = 0;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_DiseasedYellow:
       this->pConditions[Condition_Disease2] = 0;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_PoisonedRed:
       this->pConditions[Condition_Poison3] = 0;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_DiseasedRed:
       this->pConditions[Condition_Disease3] = 0;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_Paralyzed:
       this->pConditions[Condition_Paralyzed] = 0;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_Unconsious:
       this->pConditions[Condition_Unconcious] = 0;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_Dead:
       this->pConditions[Condition_Dead] = 0;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_Stoned:
       this->pConditions[Condition_Pertified] = 0;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_Eradicated:
       this->pConditions[Condition_Eradicated] = 0;
-      PlayAwardSound_Anim98(playerId);
+      PlayAwardSound_Anim98();
       return;
     case VAR_AutoNotes:
       _449B7E_toggle_bit(pParty->_autonote_bits, pValue - 1, 0);
@@ -7135,52 +7139,53 @@
 // 5B65CC: using guessed type int dword_5B65CC;
 
 //----- (new function) --------------------------------------------------------
-void Player::PlayAwardSound_Anim98(int currPlayerId)
-{
-  pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, currPlayerId);
-  PlayAwardSound(currPlayerId);
+void Player::PlayAwardSound_Anim98()
+{
+  int playerIndex = GetPlayerIndex();
+  pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, playerIndex);
+  PlayAwardSound();
 }
 
 //----- (new function) --------------------------------------------------------
-void Player::PlayAwardSound_Anim98_Face(int currPlayerId, PlayerSpeech speech)
+void Player::PlayAwardSound_Anim98_Face( PlayerSpeech speech )
 {
   this->PlaySound(speech, 0);
-  PlayAwardSound_Anim98(currPlayerId);
+  PlayAwardSound_Anim98();
 }
 
 //----- (00467E7F) --------------------------------------------------------
 void Player::EquipBody(ITEM_EQUIP_TYPE uEquipType)
 {
-  int v2; // ebx@1
-  Player *v3; // eax@1
-  int v4; // edx@1
-  int v7; // eax@3
+  int itemAnchor; // ebx@1
+  Player *currChar; // eax@1
+  int itemInvLocation; // edx@1
+  int freeSlot; // eax@3
   ItemGen tempPickedItem; // [sp+Ch] [bp-30h]@1
-  unsigned int *v11; // [sp+38h] [bp-4h]@1
+  unsigned int *equipAnchor; // [sp+38h] [bp-4h]@1
 
   tempPickedItem.Reset();
-  v2 = pEquipTypeToBodyAnchor[uEquipType];
-  v3 = pPlayers[uActiveCharacter];
-  v11 = &v3->pEquipment.pIndices[v2];
-  v4 = *v11;
-  if ( v4 )
+  itemAnchor = pEquipTypeToBodyAnchor[uEquipType];
+  currChar = pPlayers[uActiveCharacter];
+  equipAnchor = &currChar->pEquipment.pIndices[itemAnchor];
+  itemInvLocation = currChar->pEquipment.pIndices[itemAnchor];
+  if ( itemInvLocation )
   {
     memcpy(&tempPickedItem, &pParty->pPickedItem, sizeof(tempPickedItem));
-    v3->pInventoryItemList[v4 - 1].uBodyAnchor = 0;
+    currChar->pInventoryItemList[itemInvLocation - 1].uBodyAnchor = 0;
     pParty->pPickedItem.Reset();
-    pParty->SetHoldingItem(&v3->pInventoryItemList[v4 - 1]);
-    tempPickedItem.uBodyAnchor = v2 + 1;
-    memcpy(&v3->pInventoryItemList[v4 - 1], &tempPickedItem, sizeof(ItemGen));
-    *v11 = v4;
+    pParty->SetHoldingItem(&currChar->pInventoryItemList[itemInvLocation - 1]);
+    tempPickedItem.uBodyAnchor = itemAnchor + 1;
+    memcpy(&currChar->pInventoryItemList[itemInvLocation - 1], &tempPickedItem, sizeof(ItemGen));
+    *equipAnchor = itemInvLocation;
   }
   else
   {
-    v7 = v3->FindFreeInventoryListSlot();
-    if (v7 >= 0)
+    freeSlot = currChar->FindFreeInventoryListSlot();
+    if (freeSlot >= 0)
     {
-      pParty->pPickedItem.uBodyAnchor = v2 + 1;
-      memcpy(&v3->pInventoryItemList[v7], &pParty->pPickedItem, sizeof(ItemGen));
-      *v11 = v7 + 1;
+      pParty->pPickedItem.uBodyAnchor = itemAnchor + 1;
+      memcpy(&currChar->pInventoryItemList[freeSlot], &pParty->pPickedItem, sizeof(ItemGen));
+      *equipAnchor = freeSlot + 1;
       pMouse->RemoveHoldingItem();
     }
   }
@@ -7216,9 +7221,9 @@
 }
 
 //----- (0043EE15) --------------------------------------------------------
-bool Player::HasItem( unsigned int uItemID, char a3 )
-{
-  if ( !a3 || pParty->pPickedItem.uItemID != uItemID )
+bool Player::HasItem( unsigned int uItemID, bool checkHeldItem )
+{
+  if ( !checkHeldItem || pParty->pPickedItem.uItemID != uItemID )
   {
     for ( uint i = 0; i < 126; ++i )
     {
@@ -7236,8 +7241,12 @@
           return true;
       }
     }
-  }
-  return false;
+    return false;
+  }
+  else
+  {
+    return true;
+  }
 }
 //----- (0043EDB9) --------------------------------------------------------
 bool ShouldLoadTexturesForRaceAndGender(unsigned int _this)
@@ -7369,7 +7378,7 @@
     if ( !(dword_6BE368_debug_settings_2 & 0x10) )
     {
       dmgToReceive = playerPtr->ReceiveDamage(dmgToReceive, (DAMAGE_TYPE)damageType);
-      if ( playerPtr->pPlayerBuffs[10].uExpireTime > 0 )
+      if ( playerPtr->pPlayerBuffs[PLAYER_BUFF_PAIN_REFLECTION].uExpireTime > 0 )
       {
         int actorState = actorPtr->uAIState;
         if ( actorState != Dying && actorState != Dead)
@@ -7438,15 +7447,18 @@
       }
       else
       {
-        element = 0;
+        int activePlayerCounter = 0;
         for (int i = 1; i <= 4; i++)
         {
-          v72[element] = i;
-          element++;
+          if (pPlayers[i]->CanAct())
+          {
+            v72[activePlayerCounter] = i;
+            activePlayerCounter++;
+          }
         }
-        if ( element )
+        if ( activePlayerCounter )
         {
-          playerPtr = &pParty->pPlayers[v72[rand() % element]];//&stru_AA1058[3].pSounds[6972 * *(&v72 + rand() % v74) + 40552];
+          playerPtr = &pParty->pPlayers[v72[rand() % activePlayerCounter]];//&stru_AA1058[3].pSounds[6972 * *(&v72 + rand() % v74) + 40552];
         }
       }
       int v68;
@@ -7503,7 +7515,7 @@
       {
         if ( !stru_50C198.ActorHitOrMiss(actorPtr, playerPtr) )
           return;
-        if ( playerPtr->pPlayerBuffs[13].uExpireTime > 0 )
+        if ( playerPtr->pPlayerBuffs[PLAYER_BUFF_SHIELD].uExpireTime > 0 )
           dmgToReceive >>= 1;
         if ( playerPtr->HasEnchantedItemEquipped(36) )
           dmgToReceive >>= 1;
@@ -7558,7 +7570,7 @@
       if ( !(dword_6BE368_debug_settings_2 & 0x10) )
       {
         int reflectedDmg = playerPtr->ReceiveDamage(dmgToReceive, (DAMAGE_TYPE)damageType);
-        if ( playerPtr->pPlayerBuffs[10].uExpireTime > 0 )
+        if ( playerPtr->pPlayerBuffs[PLAYER_BUFF_PAIN_REFLECTION].uExpireTime > 0 )
         {
           unsigned __int16 actorState = actorPtr->uAIState;
           if ( actorState != Dying && actorState != Dead)
@@ -7619,106 +7631,99 @@
 //----- (00421EA6) --------------------------------------------------------
 void Player::OnInventoryLeftClick()
 {
-  signed int v2; // ecx@2
-  int v3; // eax@2
+  signed int inventoryXCoord; // ecx@2
+  int inventoryYCoord; // eax@2
   int invMatrixIndex; // eax@2
-  unsigned int v6; // eax@7
+  unsigned int enchantedItemPos; // eax@7
   unsigned int pickedItemId; // esi@12
   unsigned int invItemIndex; // eax@12
-  unsigned int v9; // eax@16
-  unsigned int v10; // eax@18
+  unsigned int itemPos; // eax@18
   ItemGen tmpItem; // [sp+Ch] [bp-3Ch]@1
-  POINT a2; // [sp+30h] [bp-18h]@4
   unsigned int pY; // [sp+3Ch] [bp-Ch]@2
   unsigned int pX; // [sp+40h] [bp-8h]@2
 
   if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 103 )
   {
     pMouse->GetClickPos(&pX, &pY);
-    v3 = Player::INVETORYSLOTSWIDTH * ((pY - 17) / 32);
-    v2 = (pX - 14) / 32;
-    invMatrixIndex = v2 + v3;
-    if ( v2 + v3 >= 0 )
+    inventoryYCoord = (pY - 17) / 32;
+    inventoryXCoord = (pX - 14) / 32;
+    invMatrixIndex = inventoryXCoord + (INVETORYSLOTSWIDTH * inventoryYCoord);
+    if ( inventoryYCoord >= 0 && inventoryYCoord < INVETORYSLOTSHEIGHT && inventoryXCoord >= 0 && inventoryXCoord < INVETORYSLOTSWIDTH)
     {
-      if ( invMatrixIndex <= 126 && pMouse->GetCursorPos(&a2)->x < 462
-            && pMouse->GetCursorPos(&a2)->x >= 14 )
+      if ( _50C9A0_IsEnchantingInProgress )
       {
-        if ( _50C9A0_IsEnchantingInProgress )
+        enchantedItemPos = this->GetItemIDAtInventoryIndex(&invMatrixIndex);
+        if ( enchantedItemPos )
         {
-          v6 = this->GetItemIDAtInventoryIndex(&invMatrixIndex);
-          if ( v6 )
-          {
-            *((char *)pGUIWindow_Settings->ptr_1C + 8) &= 0x7Fu;
-            *((short *)pGUIWindow_Settings->ptr_1C + 2) = uActiveCharacter - 1;
-            *((int *)pGUIWindow_Settings->ptr_1C + 3) = v6 - 1;
-            *((short *)pGUIWindow_Settings->ptr_1C + 3) = invMatrixIndex;
-            ptr_50C9A4_ItemToEnchant = &this->pInventoryItemList[v6-1];
-            _50C9A0_IsEnchantingInProgress = 0;
-            if ( pMessageQueue_50CBD0->uNumMessages )
-              pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
-            pMouse->SetCursorBitmap("MICON1");
-            _50C9D0_AfterEnchClickEventId = 113;
-            _50C9D4_AfterEnchClickEventSecondParam = 0;
-            _50C9D8_AfterEnchClickEventTimeout = 256;
-          }
+          *((char *)pGUIWindow_Settings->ptr_1C + 8) &= 0x7Fu;
+          *((short *)pGUIWindow_Settings->ptr_1C + 2) = uActiveCharacter - 1;
+          *((int *)pGUIWindow_Settings->ptr_1C + 3) = enchantedItemPos - 1;
+          *((short *)pGUIWindow_Settings->ptr_1C + 3) = invMatrixIndex;
+          ptr_50C9A4_ItemToEnchant = &this->pInventoryItemList[enchantedItemPos-1];
+          _50C9A0_IsEnchantingInProgress = 0;
+          if ( pMessageQueue_50CBD0->uNumMessages )
+            pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
+          pMouse->SetCursorBitmap("MICON1");
+          _50C9D0_AfterEnchClickEventId = 113;
+          _50C9D4_AfterEnchClickEventSecondParam = 0;
+          _50C9D8_AfterEnchClickEventTimeout = 256;
+        }
+        return;
+      }
+      if ( ptr_50C9A4_ItemToEnchant )
+        return;
+      pickedItemId = pParty->pPickedItem.uItemID;
+      invItemIndex = this->GetItemIDAtInventoryIndex(&invMatrixIndex);
+      if (!pickedItemId)
+      {
+        if ( !invItemIndex )
+          return;
+        else
+        {
+          memcpy(&pParty->pPickedItem, &this->pInventoryItemList[invItemIndex-1], sizeof(pParty->pPickedItem));
+          this->RemoveItemAtInventoryIndex(invMatrixIndex);
+          pickedItemId = pParty->pPickedItem.uItemID;
+          pMouse->SetCursorBitmap(pItemsTable->pItems[pickedItemId].pIconName);
           return;
         }
-        if ( ptr_50C9A4_ItemToEnchant )
-          return;
-        pickedItemId = pParty->pPickedItem.uItemID;
-        invItemIndex = this->GetItemIDAtInventoryIndex(&invMatrixIndex);
-        if (!pickedItemId)
+      }
+      else
+      {
+        if ( invItemIndex )
         {
-          if ( !invItemIndex )
-            return;
-          else
+          ItemGen* invItemPtr = &this->pInventoryItemList[invItemIndex-1];
+          memcpy(&tmpItem, invItemPtr, sizeof(tmpItem));
+          this->RemoveItemAtInventoryIndex(invMatrixIndex);
+          int emptyIndex = this->AddItem2(invMatrixIndex, &pParty->pPickedItem);
+          if ( !emptyIndex )
           {
-            memcpy(&pParty->pPickedItem, &this->pInventoryItemList[invItemIndex-1], sizeof(pParty->pPickedItem));
-            this->RemoveItemAtInventoryIndex(invMatrixIndex);
-            v9 = pParty->pPickedItem.uItemID;
-            pMouse->SetCursorBitmap(pItemsTable->pItems[v9].pIconName);
-            return;
+            emptyIndex = this->AddItem2(-1, &pParty->pPickedItem);
+            if ( !emptyIndex )
+            {
+              this->PutItemArInventoryIndex(tmpItem.uItemID, invItemIndex - 1, invMatrixIndex);
+              memcpy(invItemPtr, &tmpItem, sizeof(ItemGen));
+              return;
+            }
           }
+          memcpy(&pParty->pPickedItem, &tmpItem, sizeof(ItemGen));
+          pMouse->SetCursorBitmap(pParty->pPickedItem.GetIconName());
+          return;
         }
         else
         {
-          if ( invItemIndex )
+          itemPos = this->AddItem(invMatrixIndex, pickedItemId);
+          if ( itemPos )
           {
-            ItemGen* invItemPtr = &this->pInventoryItemList[invItemIndex-1];
-            memcpy(&tmpItem, invItemPtr, sizeof(tmpItem));
-            this->RemoveItemAtInventoryIndex(invMatrixIndex);
-            int emptyIndex = this->AddItem2(invMatrixIndex, &pParty->pPickedItem);
-            if ( !emptyIndex )
-            {
-              emptyIndex = this->AddItem2(-1, &pParty->pPickedItem);
-              if ( !emptyIndex )
-              {
-                this->PutItemArInventoryIndex(tmpItem.uItemID, invItemIndex - 1, invMatrixIndex);
-                memcpy(invItemPtr, &tmpItem, sizeof(ItemGen));
-                return;
-              }
-            }
-            v9 = tmpItem.uItemID;
-            memcpy(&pParty->pPickedItem, &tmpItem, sizeof(ItemGen));
-            pMouse->SetCursorBitmap(pParty->pPickedItem.GetIconName());
+            memcpy(&this->pInventoryItemList[itemPos-1], &pParty->pPickedItem, sizeof(ItemGen));
+            pMouse->RemoveHoldingItem();
             return;
           }
-          else
+          itemPos = this->AddItem(-1, pickedItemId);
+          if ( itemPos )
           {
-            v10 = this->AddItem(invMatrixIndex, pickedItemId);
-            if ( v10 )
-            {
-              memcpy(&this->pInventoryItemList[v10-1], &pParty->pPickedItem, sizeof(ItemGen));
-              pMouse->RemoveHoldingItem();
-              return;
-            }
-            v10 = this->AddItem(-1, pickedItemId);
-            if ( v10 )
-            {
-              memcpy(&this->pInventoryItemList[v10-1], &pParty->pPickedItem, sizeof(ItemGen));
-              pMouse->RemoveHoldingItem();
-              return;
-            }
+            memcpy(&this->pInventoryItemList[itemPos-1], &pParty->pPickedItem, sizeof(ItemGen));
+            pMouse->RemoveHoldingItem();
+            return;
           }
         }
       }
@@ -7958,4 +7963,18 @@
     return nullptr;
   }
   return &this->pInventoryItemList[this->pEquipment.*itemPos - 1];
+}
+
+int Player::GetPlayerIndex()
+{
+  int uPlayerIdx = 0;
+  if ( this == pPlayers[1] )
+    uPlayerIdx = 0;
+  else if( this == pPlayers[2] )
+    uPlayerIdx = 1;
+  else if ( this == pPlayers[3] )
+    uPlayerIdx = 2;
+  else if ( this == pPlayers[4] )  
+    uPlayerIdx = 3;
+  Error("Unexpected player pointer");
 }
\ No newline at end of file
--- a/Player.h	Tue Oct 08 07:41:00 2013 +0200
+++ b/Player.h	Wed Oct 09 08:06:26 2013 +0200
@@ -12,7 +12,7 @@
   PLAYER_BUFF_RESIST_BODY      = 2,
   PLAYER_BUFF_RESIST_EARTH     = 3,
   PLAYER_BUFF_FATE             = 4,
-  PLAYER_BUFF_RESIST_FIRE      = 3,
+  PLAYER_BUFF_RESIST_FIRE      = 5,
   PLAYER_BUFF_HAMMERHANDS      = 6,
   PLAYER_BUFF_HASTE            = 7,
   PLAYER_BUFF_HEROISM          = 8,
@@ -20,7 +20,7 @@
   PLAYER_BUFF_PAIN_REFLECTION = 10,
   PLAYER_BUFF_PRESERVATION    = 11,
   PLAYER_BUFF_REGENERATION    = 12,
-  PLAYER_BUFF_13              = 13,
+  PLAYER_BUFF_SHIELD          = 13,
   PLAYER_BUFF_STONESKIN       = 14,
   PLAYER_BUFF_ACCURACY        = 15,
   PLAYER_BUFF_ENDURANCE       = 16,
@@ -29,7 +29,8 @@
   PLAYER_BUFF_STRENGTH        = 19,
   PLAYER_BUFF_WILLPOWER       = 20,
   PLAYER_BUFF_SPEED           = 21,
-  PLAYER_BUFF_RESIST_WATER    = 22
+  PLAYER_BUFF_RESIST_WATER    = 22,
+  PLAYER_BUFF_WATER_WALK      = 23
 };
 
 
@@ -592,24 +593,24 @@
   void SalesProcess(unsigned int inventory_idnx, int item_index, int _2devent_idx);//0x4BE2DD
   bool Recover(signed int a2);
   bool CanCastSpell(unsigned int uRequiredMana);
-  void PlayAwardSound(int currPlayerId);
+  void PlayAwardSound();
   void EquipBody(ITEM_EQUIP_TYPE uEquipType);
   bool HasUnderwaterSuitEquipped();
-  bool HasItem(unsigned int uItemID, char a3);
+  bool HasItem(unsigned int uItemID, bool checkHeldItem);
   void OnInventoryLeftClick();
 
   unsigned int GetMultiplierForSkillLevel(unsigned int skillValue, int mult1, int mult2, int mult3, int mult4);
   int CalculateMeleeDmgToEnemyWithWeapon( ItemGen * weapon, unsigned int uTargetActorID , bool addOneDice);
   bool WearsItemAnyWhere(int item_id);
   float GetArmorRecoveryMultiplierFromSkillLevel( unsigned char armour_skill_type, float param2, float param3, float param4, float param5 );
-  void SetSkillByEvent(unsigned __int16 Player::* skillToSet, unsigned __int16 skillValue, int currPlayerId);
-  void AddSkillByEvent( unsigned __int16 Player::* skillToSet, unsigned __int16 addSkillValue, int currPlayerId );
-  void PlayAwardSound_Anim(int currPlayerId);
-  void PlayAwardSound_Anim_Face(int currPlayerId, PlayerSpeech speech);
-  void PlayAwardSound_Anim97(int currPlayerId);
-  void PlayAwardSound_Anim97_Face(int currPlayerId, PlayerSpeech speech);
-	void PlayAwardSound_Anim98(int currPlayerId);
-	void PlayAwardSound_Anim98_Face(int currPlayerId, PlayerSpeech speech);
+  void SetSkillByEvent(unsigned __int16 Player::* skillToSet, unsigned __int16 skillValue);
+  void AddSkillByEvent( unsigned __int16 Player::* skillToSet, unsigned __int16 addSkillValue);
+  void PlayAwardSound_Anim();
+  void PlayAwardSound_Anim_Face(PlayerSpeech speech);
+  void PlayAwardSound_Anim97();
+  void PlayAwardSound_Anim97_Face(PlayerSpeech speech);
+  void PlayAwardSound_Anim98();
+  void PlayAwardSound_Anim98_Face(PlayerSpeech speech);
 
   bool IsWeak();
   bool IsDead();
@@ -667,6 +668,8 @@
   ItemGen* GetNthRingItem(int ringNum);
   ItemGen* GetNthEquippedIndexItem(int index);
   ItemGen* GetItem(unsigned int PlayerEquipment::* itemPos);
+  int GetPlayerIndex();
+
   __int64 pConditions[20];
   unsigned __int64 uExperience;
   char pName[16];
@@ -808,7 +811,7 @@
   char field_1A4D;
   char lastOpenedSpellbookPage;
   unsigned __int8 uQuickSpell;
-  char field_1A50[64];
+  char playerEventBits[64];
   char _some_attack_bonus;
   char field_1A91;
   char _melee_dmg_bonus;
--- a/UI/UICharacter.cpp	Tue Oct 08 07:41:00 2013 +0200
+++ b/UI/UICharacter.cpp	Wed Oct 09 08:06:26 2013 +0200
@@ -1137,9 +1137,11 @@
                      pPaperdoll_BodyY + pPaperdoll_SecondLeftHand[pBodyComplection][1], pIcons_LOD->GetTexture(papredoll_dlaus[uPlayerID - 1]));
       }
       //--------------------------------(Shoulder/Плечи)---------------------------------------------
-      item = player->GetArmorItem();
-      switch ( item->uItemID )
+      if (player->GetItem(&PlayerEquipment::uArmor))
       {
+        item = player->GetArmorItem();
+        switch ( item->uItemID )
+        {
         case ITEM_ARTIFACT_GOVERNORS_ARMOR:
           index = 15;
           break;
@@ -1155,107 +1157,108 @@
         default:
           index = item->uItemID - 66;
           break;
-      }
-      if ( index >= 0 && index < 17 )
-      {
-        if ( player->GetItem(&PlayerEquipment::uMainHand)
-          && (player->GetMainHandItem()->GetItemEquipType() == EQUIP_MAIN_HAND
-          ||  player->GetMainHandItem()->GetPlayerSkillType() == PLAYER_SKILL_SPEAR
-          && !player->GetItem(&PlayerEquipment::uShield) ))//без щита
+        }
+        if ( index >= 0 && index < 17 )
         {
-          v94 = paperdoll_armor_texture[pBodyComplection][index][2];
-          if ( paperdoll_armor_texture[pBodyComplection][index][2] == pIcons_LOD->FindTextureByName("pending") )
-          {
-            v94 = paperdoll_armor_texture[pBodyComplection][index][1];
-            item_X = pPaperdoll_BodyX + paperdoll_shoulder_coord[pBodyComplection][index][0];
-            item_Y = pPaperdoll_BodyY + paperdoll_shoulder_coord[pBodyComplection][index][1];
-          }
-          else
+          if ( player->GetItem(&PlayerEquipment::uMainHand)
+            && (player->GetMainHandItem()->GetItemEquipType() == EQUIP_MAIN_HAND
+            ||  player->GetMainHandItem()->GetPlayerSkillType() == PLAYER_SKILL_SPEAR
+            && !player->GetItem(&PlayerEquipment::uShield) ))//без щита
           {
-            item_X = pPaperdoll_BodyX + paperdoll_shoulder_second_coord[pBodyComplection][index][0];
-            item_Y = pPaperdoll_BodyY + paperdoll_shoulder_second_coord[pBodyComplection][index][1];
-          }
-          if ( v94 != pIcons_LOD->FindTextureByName("pending") )
-          {
-            if ( !(item->uAttributes & 0xF0) )
+            v94 = paperdoll_armor_texture[pBodyComplection][index][2];
+            if ( paperdoll_armor_texture[pBodyComplection][index][2] == pIcons_LOD->FindTextureByName("pending") )
             {
-              if ( item->uAttributes & 2 )
-                pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(v94));
-              else
-              {
-                if ( item->uAttributes & 1 )
-                  pRenderer->DrawTextureTransparent(item_X, item_Y, pIcons_LOD->GetTexture(v94));
-                else
-                  pRenderer->DrawTransparentGreenShade(item_X, item_Y, pIcons_LOD->GetTexture(v94));
-              }
+              v94 = paperdoll_armor_texture[pBodyComplection][index][1];
+              item_X = pPaperdoll_BodyX + paperdoll_shoulder_coord[pBodyComplection][index][0];
+              item_Y = pPaperdoll_BodyY + paperdoll_shoulder_coord[pBodyComplection][index][1];
             }
             else
             {
-              if ( paperdoll_armor_texture[pBodyComplection][index][2] != pIcons_LOD->FindTextureByName("pending") )
+              item_X = pPaperdoll_BodyX + paperdoll_shoulder_second_coord[pBodyComplection][index][0];
+              item_Y = pPaperdoll_BodyY + paperdoll_shoulder_second_coord[pBodyComplection][index][1];
+            }
+            if ( v94 != pIcons_LOD->FindTextureByName("pending") )
+            {
+              if ( !(item->uAttributes & 0xF0) )
               {
-                if ( item->uAttributes & 0xF0 )
+                if ( item->uAttributes & 2 )
+                  pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(v94));
+                else
+                {
+                  if ( item->uAttributes & 1 )
+                    pRenderer->DrawTextureTransparent(item_X, item_Y, pIcons_LOD->GetTexture(v94));
+                  else
+                    pRenderer->DrawTransparentGreenShade(item_X, item_Y, pIcons_LOD->GetTexture(v94));
+                }
+              }
+              else
+              {
+                if ( paperdoll_armor_texture[pBodyComplection][index][2] != pIcons_LOD->FindTextureByName("pending") )
                 {
-                  if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_RED )
-                    container = "sptext01";
-                  if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_BLUE )
-                    container = "sp28a";
-                  if ( ( item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_GREEN )
-                    container = "sp30a";
-                  if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_PURPLE )
-                    container = "sp91a";
-                  _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed;
-                  if ( _50C9A8_item_enchantment_timer <= 0 )
+                  if ( item->uAttributes & 0xF0 )
                   {
-                    _50C9A8_item_enchantment_timer = 0;
-                    item->uAttributes &= 0xFFFFFF0Fu;
-                    ptr_50C9A4_ItemToEnchant = 0;
+                    if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_RED )
+                      container = "sptext01";
+                    if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_BLUE )
+                      container = "sp28a";
+                    if ( ( item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_GREEN )
+                      container = "sp30a";
+                    if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_PURPLE )
+                      container = "sp91a";
+                    _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed;
+                    if ( _50C9A8_item_enchantment_timer <= 0 )
+                    {
+                      _50C9A8_item_enchantment_timer = 0;
+                      item->uAttributes &= 0xFFFFFF0Fu;
+                      ptr_50C9A4_ItemToEnchant = 0;
+                    }
+                    pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(v94), pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE),
+                      GetTickCount() * 0.1, 0, 255);
                   }
-                  pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(v94), pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE),
-                                GetTickCount() * 0.1, 0, 255);
                 }
               }
             }
           }
-        }
-        else//без ничего или с щитом
-        {
-          //v94 = paperdoll_armor_texture[pBodyComplection][index][1];
-          if ( paperdoll_armor_texture[pBodyComplection][index][1] != pIcons_LOD->FindTextureByName("pending") )
+          else//без ничего или с щитом
           {
-            item_X = pPaperdoll_BodyX + paperdoll_shoulder_coord[pBodyComplection][index][0];
-            item_Y = pPaperdoll_BodyY + paperdoll_shoulder_coord[pBodyComplection][index][1];
-            if ( !(item->uAttributes & 0xF0) )
+            //v94 = paperdoll_armor_texture[pBodyComplection][index][1];
+            if ( paperdoll_armor_texture[pBodyComplection][index][1] != pIcons_LOD->FindTextureByName("pending") )
             {
-              if ( item->uAttributes & 2 )
-                pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_armor_texture[pBodyComplection][index][1]));
+              item_X = pPaperdoll_BodyX + paperdoll_shoulder_coord[pBodyComplection][index][0];
+              item_Y = pPaperdoll_BodyY + paperdoll_shoulder_coord[pBodyComplection][index][1];
+              if ( !(item->uAttributes & 0xF0) )
+              {
+                if ( item->uAttributes & 2 )
+                  pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_armor_texture[pBodyComplection][index][1]));
+                else
+                {
+                  if ( item->uAttributes & 1 )
+                    pRenderer->DrawTextureTransparent(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_armor_texture[pBodyComplection][index][1]));
+                  else
+                    pRenderer->DrawTransparentGreenShade(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_armor_texture[pBodyComplection][index][1]));
+                }
+              }
               else
               {
-                if ( item->uAttributes & 1 )
-                  pRenderer->DrawTextureTransparent(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_armor_texture[pBodyComplection][index][1]));
-                else
-                  pRenderer->DrawTransparentGreenShade(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_armor_texture[pBodyComplection][index][1]));
+                if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_RED )
+                  container = "sptext01";
+                if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_BLUE )
+                  container = "sp28a";
+                if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_GREEN )
+                  container = "sp30a";
+                if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_PURPLE )
+                  container = "sp91a";
+                _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed;
+                if ( _50C9A8_item_enchantment_timer <= 0 )
+                {
+                  _50C9A8_item_enchantment_timer = 0;
+                  item->uAttributes &= 0xFFFFFF0Fu;
+                  ptr_50C9A4_ItemToEnchant = 0;
+                }
+                pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_armor_texture[pBodyComplection][index][1]),
+                  pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), GetTickCount() * 0.1, 0, 255);
               }
             }
-            else
-            {
-              if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_RED )
-                container = "sptext01";
-              if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_BLUE )
-                container = "sp28a";
-              if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_GREEN )
-                container = "sp30a";
-              if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_PURPLE )
-                container = "sp91a";
-              _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed;
-              if ( _50C9A8_item_enchantment_timer <= 0 )
-              {
-                _50C9A8_item_enchantment_timer = 0;
-                item->uAttributes &= 0xFFFFFF0Fu;
-                ptr_50C9A4_ItemToEnchant = 0;
-              }
-              pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_armor_texture[pBodyComplection][index][1]),
-                    pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), GetTickCount() * 0.1, 0, 255);
-            }
           }
         }
       }
--- a/UI/UiGame.cpp	Tue Oct 08 07:41:00 2013 +0200
+++ b/UI/UiGame.cpp	Wed Oct 09 08:06:26 2013 +0200
@@ -1720,7 +1720,7 @@
       else
         pRenderer->DrawTextureTransparent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 1, 388, pPortrait);
       if ( pPlayer->pPlayerBuffs[PLAYER_BUFF_BLESS].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_HASTE].uExpireTime
-         | pPlayer->pPlayerBuffs[PLAYER_BUFF_HEROISM].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_13].uExpireTime
+         | pPlayer->pPlayerBuffs[PLAYER_BUFF_HEROISM].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_SHIELD].uExpireTime
          | pPlayer->pPlayerBuffs[PLAYER_BUFF_STONESKIN].uExpireTime )
         sub_441A4E(i);
       continue;
@@ -1733,7 +1733,7 @@
       else
         pRenderer->DrawTextureTransparent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 1, 388, pPortrait);
       if ( pPlayer->pPlayerBuffs[PLAYER_BUFF_BLESS].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_HASTE].uExpireTime
-         | pPlayer->pPlayerBuffs[PLAYER_BUFF_HEROISM].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_13].uExpireTime
+         | pPlayer->pPlayerBuffs[PLAYER_BUFF_HEROISM].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_SHIELD].uExpireTime
          | pPlayer->pPlayerBuffs[PLAYER_BUFF_STONESKIN].uExpireTime )
         sub_441A4E(i);
       continue;
@@ -1760,7 +1760,7 @@
       else
         pRenderer->DrawTextureTransparent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 1, 388, pPortrait);
       if ( pPlayer->pPlayerBuffs[PLAYER_BUFF_BLESS].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_HASTE].uExpireTime
-         | pPlayer->pPlayerBuffs[PLAYER_BUFF_HEROISM].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_13].uExpireTime
+         | pPlayer->pPlayerBuffs[PLAYER_BUFF_HEROISM].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_SHIELD].uExpireTime
          | pPlayer->pPlayerBuffs[PLAYER_BUFF_STONESKIN].uExpireTime )
         sub_441A4E(i);
       continue;
--- a/mm7_2.cpp	Tue Oct 08 07:41:00 2013 +0200
+++ b/mm7_2.cpp	Wed Oct 09 08:06:26 2013 +0200
@@ -1740,7 +1740,7 @@
 //----- (00450AAA) --------------------------------------------------------
 void RespawnGlobalDecorations()
 {
-  memset(stru_5E4C90_MapPersistVars._decor_events, 0, 125);
+  memset(stru_5E4C90_MapPersistVars._decor_events.data(), 0, 125);
 
   uint decorEventIdx = 0;
   for (uint i = 0; i < uNumLevelDecorations; ++i)
--- a/stru123.h	Tue Oct 08 07:41:00 2013 +0200
+++ b/stru123.h	Wed Oct 09 08:06:26 2013 +0200
@@ -1,12 +1,13 @@
 #pragma once
+#include <array>
 
 
 /*   62 */
 #pragma pack(push, 1)
 struct stru123
 {
-  char field_0[75];
-  unsigned char _decor_events[125];
+  std::array<unsigned char, 75> field_0;
+  std::array<unsigned char, 125> _decor_events;
 };
 #pragma pack(pop)
 extern stru123 stru_5E4C90_MapPersistVars;
\ No newline at end of file