changeset 1782:421e826f4477

Player::SetVariable finishing cleanup
author Grumpy7
date Thu, 03 Oct 2013 05:56:52 +0200
parents 7b42e79eb2d0
children a3e86ec5d3ce
files Player.cpp Player.h
diffstat 2 files changed, 192 insertions(+), 191 deletions(-) [+]
line wrap: on
line diff
--- a/Player.cpp	Thu Oct 03 05:30:03 2013 +0200
+++ b/Player.cpp	Thu Oct 03 05:56:52 2013 +0200
@@ -5419,15 +5419,7 @@
   signed int currPlayerId; // ebx@1
   unsigned int v6; // esi@13
   unsigned int v7; // esi@14
-  signed int v8; // eax@17
-  ItemGen *v9; // ecx@17
-  int v10; // eax@21
   signed int v11; // eax@30
-  int v15; // ecx@86
-  int v16; // esi@106
-  char v17; // al@106
-  int v18; // eax@107
-  int v22; // eax@145
   DDM_DLV_Header *v24; // ecx@148
   ItemGen item; // [sp+Ch] [bp-28h]@52
 
@@ -5471,8 +5463,7 @@
   {
     case VAR_Sex:
       this->uSex = (PLAYER_SEX)var_value;
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim(currPlayerId);
       return;
     case VAR_Class:
       this->classType = (PLAYER_CLASS_TYPE)var_value;
@@ -5511,39 +5502,33 @@
         }
         ReloadPlayerPortraits(currPlayerId, this->uCurrentFace);
       }
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim(currPlayerId);
       return;
     case VAR_CurrentHP:
       this->sHealth = var_value;
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim(currPlayerId);
       return;
     case VAR_MaxHP:
       this->sHealth = GetMaxHealth();
       return;
     case VAR_CurrentSP:
       this->sMana = var_value;
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim(currPlayerId);
       return;
     case VAR_MaxSP:
       this->sMana = GetMaxMana();
       return;
     case VAR_ACModifier:
       this->sACModifier = (unsigned __int8)var_value;
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim(currPlayerId);
       return;
     case VAR_BaseLevel:
       this->uLevel = (unsigned __int8)var_value;
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim(currPlayerId);
       return;
     case VAR_LevelModifier:
       this->sLevelModifier = (unsigned __int8)var_value;
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim(currPlayerId);
       return;
     case VAR_Age:
       this->sAgeModifier = var_value;
@@ -5553,16 +5538,14 @@
 		this->_achieved_awards_bits[((signed __int16)var_value - 1)/ 8]) //&& dword_723E80_award_related[2 * a3] )
 	&& pAwards[var_value].pText )
       {
-        pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-        PlayAwardSound(currPlayerId);
+        PlayAwardSound_Anim(currPlayerId);
         this->PlaySound(SPEECH_96, 0);
       }
       _449B7E_toggle_bit(this->_achieved_awards_bits, var_value, 1u);
       return;
     case VAR_Experience:
       this->uExperience = var_value;
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim(currPlayerId);
       return;
     case VAR_QBits_QuestsDone:
       if ( !((unsigned __int8)(0x80u >> ((signed __int16)var_value - 1) % 8) & pParty->_quest_bits[((signed __int16)var_value - 1) >> 3])// && (&dword_722F10)[4 * a3] )
@@ -5595,8 +5578,7 @@
       return;
     case VAR_FixedFood:
       Party::SetFood(var_value);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim(currPlayerId);
       return;
     case VAR_RandomFood:
       v7 = rand() % var_value + 1;
@@ -5604,312 +5586,225 @@
       sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[501], v7);// You have %lu food
       ShowStatusBarString(pTmpBuf.data(), 2u);
       GameUI_DrawFoodAndGold();
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim(currPlayerId);
       return;
     case VAR_BaseMight:
       this->uMight = (unsigned __int8)var_value;
-      this->PlaySound(SPEECH_92, 0);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_92);
       return;
     case VAR_BaseIntellect:
       this->uIntelligence = (unsigned __int8)var_value;
-      this->PlaySound(SPEECH_92, 0);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_92);
       return;
     case VAR_BasePersonality:
       this->uWillpower = (unsigned __int8)var_value;
-      this->PlaySound(SPEECH_92, 0);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_92);
       return;
     case VAR_BaseEndurance:
       this->uEndurance = (unsigned __int8)var_value;
-      this->PlaySound(SPEECH_92, 0);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_92);
       return;
     case VAR_BaseSpeed:
       this->uSpeed = (unsigned __int8)var_value;
-      this->PlaySound(SPEECH_92, 0);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_92);
       return;
     case VAR_BaseAccuracy:
       this->uAccuracy = (unsigned __int8)var_value;
-      this->PlaySound(SPEECH_92, 0);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_92);
       return;
     case VAR_BaseLuck:
       this->uLuck = (unsigned __int8)var_value;
-      this->PlaySound(SPEECH_92, 0);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_92);
       return;
     case VAR_MightBonus:
     case VAR_ActualMight:
       this->uMightBonus = (unsigned __int8)var_value;
-      this->PlaySound(SPEECH_91, 0);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_91);
       return;
     case VAR_IntellectBonus:
     case VAR_ActualIntellect:
       this->uIntelligenceBonus = (unsigned __int8)var_value;
-      this->PlaySound(SPEECH_91, 0);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_91);
       return;
     case VAR_PersonalityBonus:
     case VAR_ActualPersonality:
       this->uWillpowerBonus = (unsigned __int8)var_value;
-      this->PlaySound(SPEECH_91, 0);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_91);
       return;
     case VAR_EnduranceBonus:
     case VAR_ActualEndurance:
       this->uEnduranceBonus = (unsigned __int8)var_value;
-      this->PlaySound(SPEECH_91, 0);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_91);
       return;
     case VAR_SpeedBonus:
     case VAR_ActualSpeed:
       this->uSpeedBonus = (unsigned __int8)var_value;
-      this->PlaySound(SPEECH_91, 0);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_91);
       return;
     case VAR_AccuracyBonus:
     case VAR_ActualAccuracy:
       this->uAccuracyBonus = (unsigned __int8)var_value;
-      this->PlaySound(SPEECH_92, 0);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_92);
       return;
     case VAR_LuckBonus:
     case VAR_ActualLuck:
       this->uLuckBonus = (unsigned __int8)var_value;
-      this->PlaySound(SPEECH_92, 0);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_92);
       return;
     case VAR_FireResistance:
       this->sResFireBase = (unsigned __int8)var_value;
-      this->PlaySound(SPEECH_92, 0);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_92);
       return;
     case VAR_AirResistance:
       this->sResAirBase = (unsigned __int8)var_value;
-      this->PlaySound(SPEECH_92, 0);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_92);
       return;
     case VAR_WaterResistance:
       this->sResWaterBase = (unsigned __int8)var_value;
-      this->PlaySound(SPEECH_92, 0);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_92);
       return;
     case VAR_EarthResistance:
       this->sResEarthBase = (unsigned __int8)var_value;
-      this->PlaySound(SPEECH_92, 0);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_92);
       return;
     case VAR_SpiritResistance:
       this->sResSpiritBase = (unsigned __int8)var_value;
-      this->PlaySound(SPEECH_92, 0);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_92);
       return;
     case VAR_MindResistance:
       this->sResMindBase = (unsigned __int8)var_value;
-      this->PlaySound(SPEECH_92, 0);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_92);
       return;
     case VAR_BodyResistance:
       this->sResBodyBase = (unsigned __int8)var_value;
-      this->PlaySound(SPEECH_92, 0);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_92);
       return;
     case VAR_LightResistance:
       this->sResLightBase = (unsigned __int8)var_value;
-      this->PlaySound(SPEECH_92, 0);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_92);
       return;
     case VAR_DarkResistance:
       this->sResDarkBase = (unsigned __int8)var_value;
-      this->PlaySound(SPEECH_92, 0);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_92);
       return;
     case VAR_MagicResistance:
       this->sResMagicBase = (unsigned __int8)var_value;
-      this->PlaySound(SPEECH_92, 0);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_92);
       return;
     case VAR_FireResistanceBonus:
       this->sResFireBonus = (unsigned __int8)var_value;
-      this->PlaySound(SPEECH_91, 0);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_91);
       return;
     case VAR_AirResistanceBonus:
       this->sResAirBonus = (unsigned __int8)var_value;
-      this->PlaySound(SPEECH_91, 0);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_91);
       return;
     case VAR_WaterResistanceBonus:
       this->sResWaterBonus = (unsigned __int8)var_value;
-      this->PlaySound(SPEECH_91, 0);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_91);
       return;
     case VAR_EarthResistanceBonus:
       this->sResEarthBonus = (unsigned __int8)var_value;
-      this->PlaySound(SPEECH_91, 0);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_91);
       return;
     case VAR_SpiritResistanceBonus:
       this->sResSpiritBonus = (unsigned __int8)var_value;
-      this->PlaySound(SPEECH_91, 0);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_91);
       return;
     case VAR_MindResistanceBonus:
       this->sResMindBonus = (unsigned __int8)var_value;
-      this->PlaySound(SPEECH_91, 0);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_91);
       return;
     case VAR_BodyResistanceBonus:
       this->sResBodyBonus = (unsigned __int8)var_value;
-      this->PlaySound(SPEECH_91, 0);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_91);
       return;
     case VAR_LightResistanceBonus:
       this->sResLightBonus = (unsigned __int8)var_value;
-      this->PlaySound(SPEECH_91, 0);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_91);
       return;
     case VAR_DarkResistanceBonus:
       this->sResDarkBonus = (unsigned __int8)var_value;
-      this->PlaySound(SPEECH_91, 0);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_91);
       return;
     case VAR_PhysicalResistanceBonus:
       Error("Physical res. bonus not used");
       return;
     case VAR_MagicResistanceBonus:
       this->sResMagicBonus = (unsigned __int8)var_value;
-      this->PlaySound(SPEECH_91, 0);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim_Face(currPlayerId, SPEECH_91);
       return;
     case VAR_Cursed:
       this->SetCondition(Condition_Cursed, 1);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim(currPlayerId);
       return;
     case VAR_Weak:
       this->SetCondition(Condition_Weak, 1);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim(currPlayerId);
       return;
     case VAR_Asleep:
       this->SetCondition(Condition_Sleep, 1);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim(currPlayerId);
       return;
     case VAR_Afraid:
       this->SetCondition(Condition_Fear, 1);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim(currPlayerId);
       return;
     case VAR_Drunk:
       this->SetCondition(Condition_Drunk, 1);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim(currPlayerId);
       return;
     case VAR_Insane:
       this->SetCondition(Condition_Insane, 1);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim(currPlayerId);
       return;
     case VAR_PoisonedGreen:
       this->SetCondition(Condition_Poison1, 1);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim(currPlayerId);
       return;
     case VAR_DiseasedGreen:
       this->SetCondition(Condition_Disease1, 1);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim(currPlayerId);
       return;
     case VAR_PoisonedYellow:
       this->SetCondition(Condition_Poison2, 1);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim(currPlayerId);
       return;
     case VAR_DiseasedYellow:
       this->SetCondition(Condition_Disease2, 1);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim(currPlayerId);
       return;
     case VAR_PoisonedRed:
       this->SetCondition(Condition_Poison3, 1);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim(currPlayerId);
       return;
     case VAR_DiseasedRed:
       this->SetCondition(Condition_Disease3, 1);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim(currPlayerId);
       return;
     case VAR_Paralyzed:
       this->SetCondition(Condition_Paralyzed, 1);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim(currPlayerId);
       return;
     case VAR_Unconsious:
       this->SetCondition(Condition_Unconcious, 1);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim(currPlayerId);
       return;
     case VAR_Dead:
       this->SetCondition(Condition_Dead, 1);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim(currPlayerId);
       return;
     case VAR_Stoned:
       this->SetCondition(Condition_Pertified, 1);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim(currPlayerId);
       return;
     case VAR_Eradicated:
       this->SetCondition(Condition_Eradicated, 1);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim(currPlayerId);
       return;
     case VAR_MajorCondition:
       memset(this, 0, 0xA0u);
-      pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-      PlayAwardSound(currPlayerId);
+      PlayAwardSound_Anim(currPlayerId);
       return;
     case VAR_AutoNotes:
       if ( !((unsigned __int8)(0x80u >> ((signed __int16)var_value - 1) % 8) & pParty->_autonote_bits[((signed __int16)var_value - 1) >> 3]) //&& (&dword_723718_autonote_related)[8 * a3] )
@@ -5979,29 +5874,118 @@
     case VAR_ArenaWinsLord:
       pParty->uNumArenaLordWins = var_value;
       return;
-  }
-
-  if (var_type >= VAR_StaffSkill && var_type <= VAR_LearningSkill)
-  {
-    HIWORD(v15) = 0;
-
-    v16 = (int)((char *)&this->pConditions[16] + 2 * var_type);
-    v17 = *(char *)v16;
-    if ( var_value <= 63 )
-    {
-      LOWORD(v15) = (unsigned __int8)var_value;
-      v18 = v15 | v17 & 63;
-    }
-    else
-    {
-      LOWORD(v18) = (unsigned __int8)(var_value | v17 & 0xC0);
-    }
-    *(short *)v16 = v18;
-    pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId);
-    PlayAwardSound(currPlayerId);
-    return;
-  }
-  
+    case VAR_StaffSkill:
+      SetSkillByEvent(&Player::skillStaff, var_type, currPlayerId);
+      return;
+    case VAR_SwordSkill:
+      SetSkillByEvent(&Player::skillSword, var_type, currPlayerId);
+      return;
+    case VAR_DaggerSkill:
+      SetSkillByEvent(&Player::skillDagger, var_type, currPlayerId);
+      return;
+    case VAR_AxeSkill:
+      SetSkillByEvent(&Player::skillAxe, var_type, currPlayerId);
+      return;
+    case VAR_SpearSkill:
+      SetSkillByEvent(&Player::skillSpear, var_type, currPlayerId);
+      return;
+    case VAR_BowSkill:
+      SetSkillByEvent(&Player::skillBow, var_type, currPlayerId);
+      return;
+    case VAR_MaceSkill:
+      SetSkillByEvent(&Player::skillMace, var_type, currPlayerId);
+      return;
+    case VAR_BlasterSkill:
+      SetSkillByEvent(&Player::skillBlaster, var_type, currPlayerId);
+      return;
+    case VAR_ShieldSkill:
+      SetSkillByEvent(&Player::skillShield, var_type, currPlayerId);
+      return;
+    case VAR_LeatherSkill:
+      SetSkillByEvent(&Player::skillLeather, var_type, currPlayerId);
+      return;
+    case VAR_SkillChain:
+      SetSkillByEvent(&Player::skillChain, var_type, currPlayerId);
+      return;
+    case VAR_PlateSkill:
+      SetSkillByEvent(&Player::skillPlate, var_type, currPlayerId);
+      return;
+    case VAR_FireSkill:
+      SetSkillByEvent(&Player::skillFire, var_type, currPlayerId);
+      return;
+    case VAR_AirSkill:
+      SetSkillByEvent(&Player::skillAir, var_type, currPlayerId);
+      return;
+    case VAR_WaterSkill:
+      SetSkillByEvent(&Player::skillWater, var_type, currPlayerId);
+      return;
+    case VAR_EarthSkill:
+      SetSkillByEvent(&Player::skillEarth, var_type, currPlayerId);
+      return;
+    case VAR_SpiritSkill:
+      SetSkillByEvent(&Player::skillSpirit, var_type, currPlayerId);
+      return;
+    case VAR_MindSkill:
+      SetSkillByEvent(&Player::skillMind, var_type, currPlayerId);
+      return;
+    case VAR_BodySkill:
+      SetSkillByEvent(&Player::skillBody, var_type, currPlayerId);
+      return;
+    case VAR_LightSkill:
+      SetSkillByEvent(&Player::skillLight, var_type, currPlayerId);
+      return;
+    case VAR_DarkSkill:
+      SetSkillByEvent(&Player::skillDark, var_type, currPlayerId);
+      return;
+    case VAR_IdentifyItemSkill:
+      SetSkillByEvent(&Player::skillItemId, var_type, currPlayerId);
+      return;
+    case VAR_MerchantSkill:
+      SetSkillByEvent(&Player::skillMerchant, var_type, currPlayerId);
+      return;
+    case VAR_RepairSkill:
+      SetSkillByEvent(&Player::skillRepair, var_type, currPlayerId);
+      return;
+    case VAR_BodybuildingSkill:
+      SetSkillByEvent(&Player::skillBodybuilding, var_type, currPlayerId);
+      return;
+    case VAR_MeditationSkill:
+      SetSkillByEvent(&Player::skillMeditation, var_type, currPlayerId);
+      return;
+    case VAR_PerceptionSkill:
+      SetSkillByEvent(&Player::skillPerception, var_type, currPlayerId);
+      return;
+    case VAR_DiplomacySkill:
+      SetSkillByEvent(&Player::skillDiplomacy, var_type, currPlayerId);
+      return;
+    case VAR_ThieverySkill:
+      Error ("Thieving unsupported");
+      return;
+    case VAR_DisarmTrapSkill:
+      SetSkillByEvent(&Player::skillDisarmTrap, var_type, currPlayerId);
+      return;
+    case VAR_DodgeSkill:
+      SetSkillByEvent(&Player::skillDodge, var_type, currPlayerId);
+      return;
+    case VAR_UnarmedSkill:
+      SetSkillByEvent(&Player::skillUnarmed, var_type, currPlayerId);
+      return;
+    case VAR_IdentifyMonsterSkill:
+      SetSkillByEvent(&Player::skillMonsterId, var_type, currPlayerId);
+      return;
+    case VAR_ArmsmasterSkill:
+      SetSkillByEvent(&Player::skillArmsmaster, var_type, currPlayerId);
+      return;
+    case VAR_StealingSkill:
+      SetSkillByEvent(&Player::skillStealing, var_type, currPlayerId);
+      return;
+    case VAR_AlchemySkill:
+      SetSkillByEvent(&Player::skillAlchemy, var_type, currPlayerId);
+      return;
+    case VAR_LearningSkill:
+      SetSkillByEvent(&Player::skillLearning, var_type, currPlayerId);
+      return;
+  }
 }
 
 
@@ -6013,6 +5997,21 @@
   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);
+}
+
+//----- (new function) --------------------------------------------------------
+void Player::PlayAwardSound_Anim_Face(int currPlayerId, PlayerSpeech speech)
+{
+  this->PlaySound(speech, 0);
+  PlayAwardSound_Anim(currPlayerId);
+}
+
+//----- (new function) --------------------------------------------------------
 void Player::SetSkillByEvent( unsigned __int16 Player::* skillToSet, unsigned __int16 newSkillValue, int currPlayerId )
 {
   unsigned __int16 currSkillValue = this->*skillToSet;
--- a/Player.h	Thu Oct 03 05:30:03 2013 +0200
+++ b/Player.h	Thu Oct 03 05:56:52 2013 +0200
@@ -603,6 +603,8 @@
   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 PlayAwardSound_Anim_Face(int currPlayerId, PlayerSpeech speech);
+  void PlayAwardSound_Anim(int currPlayerId);
 
   bool IsWeak();
   bool IsDead();