changeset 1654:d11b5669f089

Слияние
author Ritor1
date Wed, 18 Sep 2013 11:05:06 +0600
parents d453ed393d6e (current diff) b0a2b8525483 (diff)
children a7eebb6ee7a2 e1d1fe32c194
files
diffstat 5 files changed, 264 insertions(+), 343 deletions(-) [+]
line wrap: on
line diff
--- a/Items.cpp	Wed Sep 18 11:04:47 2013 +0600
+++ b/Items.cpp	Wed Sep 18 11:05:06 2013 +0600
@@ -2191,7 +2191,7 @@
   NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_SKILL_TRAP_DISARM, 5);
   NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_SKILL_STEALING, 5);
 
-  itemId = ITEM_ARTICACT_GOVERNONS_ARMOR;
+  itemId = ITEM_ARTIFACT_GOVERNORS_ARMOR;
   NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_STRENGTH, 10);
   NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_INTELLIGENCE, 10);
   NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_WILLPOWER, 10);
--- a/Items.h	Wed Sep 18 11:04:47 2013 +0600
+++ b/Items.h	Wed Sep 18 11:05:06 2013 +0600
@@ -103,7 +103,7 @@
   ITEM_ARTIFACT_IRON_FEATHER = 501,
   ITEM_ARTIFACT_WALLACE = 502,
   ITEM_ARTIFACT_CORSAIR = 503,
-  ITEM_ARTICACT_GOVERNONS_ARMOR = 504,//1F8
+  ITEM_ARTIFACT_GOVERNORS_ARMOR = 504,//1F8
   ITEM_ARTIFACT_YORUBA = 505,//1F9
   ITEM_ARTIFACT_SPLITTER = 506,//1FA
   ITEM_ARTIFACT_GHOULSBANE = 507,//1FA
--- a/Player.cpp	Wed Sep 18 11:04:47 2013 +0600
+++ b/Player.cpp	Wed Sep 18 11:05:06 2013 +0600
@@ -7450,34 +7450,29 @@
   return false;
 }
 //----- (0043ED6F) --------------------------------------------------------
-bool _43ED6F_check_party_races(bool a1)
-{
-  bool v6; // zf@5
-
+bool IsDwarfPresentInParty(bool a1)
+{
   for (uint i = 0; i < 4; ++i)
   {
-    auto player = pParty->pPlayers + i;
-    auto race = player->GetRace();
-
-    if (race != CHARACTER_RACE_HUMAN &&
-        race != CHARACTER_RACE_ELF &&
-        race != CHARACTER_RACE_GOBLIN)
-      v6 = a1 == 1;
-    else
-      v6 = !a1;
-
-    if (v6)
+    CHARACTER_RACE race = pParty->pPlayers[i].GetRace();
+
+    if (race == CHARACTER_RACE_DWARF && a1)
+      return true;
+    else if (race != CHARACTER_RACE_DWARF && !a1)
       return true;
   }
   return false;
 }
+
+
+
 //----- (00439FCB) --------------------------------------------------------
 void __fastcall DamagePlayerFromMonster(unsigned int uObjID, int a2, Vec3_int_ *pPos, unsigned int a4)
 {
   signed int v4; // esi@1
   unsigned int v5; // ecx@1
-  Player *v6; // ebx@3
-  Actor *v7; // esi@3
+  Player *playerPtr; // ebx@3
+  Actor *actorPtr; // esi@3
   unsigned int v8; // eax@4
   char *v9; // eax@5
   signed int v10; // eax@6
@@ -7495,7 +7490,7 @@
   signed int v22; // edi@36
   int v23; // eax@38
   signed int v24; // eax@44
-  unsigned __int16 v25; // cx@47
+  AIState v25; // cx@47
   signed int v26; // eax@49
   int v27; // eax@54
   float v28; // ST18_4@58
@@ -7557,310 +7552,246 @@
   uActorID = v4;
   if ( v5 )
   {
-    if ( v5 != 1
-      || (v6 = &pParty->pPlayers[a4], v7 = &pActors[v4],
-                                     v75 = v6->sHealth,
-                                     !stru_50C198.ActorHitOrMiss(v7, v6)) )
+    playerPtr = &pParty->pPlayers[a4];
+    actorPtr = &pActors[v4];
+    v75 = playerPtr->sHealth;
+    if ( v5 != 1 || !stru_50C198.ActorHitOrMiss(actorPtr, playerPtr) )
       return;
-    v8 = v6->pEquipment.uArmor;
+    v8 = playerPtr->pEquipment.uArmor;
     if ( !v8
-      || (v9 = (char *)v6 + 36 * v8, v9[516] & 2)
-      || (v10 = pItemsTable->pItems[*((int *)v9 + 124)].uSkillType, v10 < 10)
-      || v10 > 11 )
+      || playerPtr->pInventoryItemList[v8 - 1].IsBroken()
+      || 
+      (pItemsTable->pItems[playerPtr->pInventoryItemList[v8 - 1].uItemID].uSkillType != PLAYER_SKILL_CHAIN 
+      && pItemsTable->pItems[playerPtr->pInventoryItemList[v8 - 1].uItemID].uSkillType != PLAYER_SKILL_PLATE 
+      )
+      )
     {
       v14 = rand() % 4;
-      if ( !v14 )
-      {
-        v71 = (SoundID)108;
-        goto LABEL_24;
-      }
-      v15 = v14 - 1;
-      if ( !v15 )
+      switch (v14)
       {
-        v71 = (SoundID)109;
-        goto LABEL_24;
-      }
-      v16 = v15 - 1;
-      if ( !v16 )
-      {
-        v71 = (SoundID)110;
-        goto LABEL_24;
-      }
-      if ( v16 == 1 )
-      {
-        v71 = (SoundID)44;
-        goto LABEL_24;
+        case 0 : v17 = (SoundID)108; break;
+        case 1 : v17 = (SoundID)109; break;
+        case 2 : v17 = (SoundID)110; break;
+        case 3 : v17 = (SoundID)44; break;
       }
     }
     else
     {
       v11 = rand() % 4;
-      if ( !v11 )
-      {
-        v71 = (SoundID)105;
-        goto LABEL_24;
-      }
-      v12 = v11 - 1;
-      if ( !v12 )
+      switch (v11)
       {
-        v71 = (SoundID)106;
-        goto LABEL_24;
-      }
-      v13 = v12 - 1;
-      if ( !v13 )
-      {
-        v71 = (SoundID)107;
-        goto LABEL_24;
+        case 0 : v17 = (SoundID)105; break;
+        case 1 : v17 = (SoundID)106; break;
+        case 2 : v17 = (SoundID)107; break;
+        case 3 : v17 = (SoundID)45; break;
       }
-      if ( v13 == 1 )
-      {
-        v71 = (SoundID)45;
-LABEL_24:
-        v17 = v71;
-        goto LABEL_26;
-      }
-    }
-    v17 = (SoundID)a4;
-LABEL_26:
+    }
     pAudioPlayer->PlaySound(v17, PID(OBJECT_Player,a4 + 80), 0, -1, 0, 0, 0, 0);
-    v18 = Actor::_43B3E0_CalcDamage(v7, v74);
-    v19 = HIDWORD(v7->pActorBuffs[3].uExpireTime) == 0;
-    v20 = SHIDWORD(v7->pActorBuffs[3].uExpireTime) < 0;
+    v18 = Actor::_43B3E0_CalcDamage(actorPtr, v74);
+    v19 = HIDWORD(actorPtr->pActorBuffs[3].uExpireTime) == 0;
+    v20 = SHIDWORD(actorPtr->pActorBuffs[3].uExpireTime) < 0;
     v77 = v18;
-    if ( !v20 && (!(v20 | v19) || LODWORD(v7->pActorBuffs[3].uExpireTime) > 0) )
-    {
-      v21 = v7->pActorBuffs[3].uPower;
+    if ( !v20 && (!(v20 | v19) || LODWORD(actorPtr->pActorBuffs[3].uExpireTime) > 0) )
+    {
+      v21 = actorPtr->pActorBuffs[3].uPower;
       if ( v21 )
         v77 /= (signed int)v21;
     }
-    if ( v74 )
-    {
-      if ( v74 == 1 )
-      {
-        v22 = v7->pMonsterInfo.uAttack2Type;
-      }
-      else
-      {
-        if ( v74 == 2 )
-        {
-          v23 = v7->pMonsterInfo.uSpell1ID;
-        }
-        else
-        {
-          if ( v74 != 3 )
-          {
-            if ( v74 == 4 )
-              v22 = v7->pMonsterInfo.field_3C_some_special_attack;
-            else
-              v22 = 4;
-            goto LABEL_43;
-          }
-          v23 = v7->pMonsterInfo.uSpell2ID;
-        }
+    switch (v74)
+    {
+      case 0: v22 = actorPtr->pMonsterInfo.uAttack1Type; 
+        break;
+      case 1: v22 = actorPtr->pMonsterInfo.uAttack2Type; 
+        break;
+      case 2: v23 = actorPtr->pMonsterInfo.uSpell1ID;
         v22 = LOBYTE(pSpellStats->pInfos[v23].uSchool);
-      }
-    }
-    else
-    {
-      v22 = v7->pMonsterInfo.uAttack1Type;
-    }
-LABEL_43:
+        break;
+      case 3: v23 = actorPtr->pMonsterInfo.uSpell2ID;
+        v22 = LOBYTE(pSpellStats->pInfos[v23].uSchool);
+        break;
+      case 4: v22 = actorPtr->pMonsterInfo.field_3C_some_special_attack; 
+        break;
+      default:
+      case 5: v22 = 4; //yes, the original just assigned the value 4
+        break;   
+    }
     if ( !(dword_6BE368_debug_settings_2 & 0x10) )
     {
-      v24 = v6->ReceiveDamage(v77, (DAMAGE_TYPE)v22);
-      if ( SHIDWORD(v6->pPlayerBuffs[10].uExpireTime) >= 0
-        && (SHIDWORD(v6->pPlayerBuffs[10].uExpireTime) > 0 || LODWORD(v6->pPlayerBuffs[10].uExpireTime)) )
+      v24 = playerPtr->ReceiveDamage(v77, (DAMAGE_TYPE)v22);
+      if ( SHIDWORD(playerPtr->pPlayerBuffs[10].uExpireTime) >= 0
+        && (SHIDWORD(playerPtr->pPlayerBuffs[10].uExpireTime) > 0 || LODWORD(playerPtr->pPlayerBuffs[10].uExpireTime)) )
       {
-        v25 = v7->uAIState;
-        if ( v25 != 5 )
+        v25 = actorPtr->uAIState;
+        if ( v25 != Dying && v25 != Dead)
         {
-          if ( v25 != 4 )
+          v26 = stru_50C198.CalcMagicalDamageToActor(actorPtr, v22, v24);
+          actorPtr->sCurrentHP -= v26;
+          if ( v26 )
           {
-            v26 = stru_50C198.CalcMagicalDamageToActor(v7, v22, v24);
-            v7->sCurrentHP -= v26;
-            if ( v26 )
+            if ( actorPtr->sCurrentHP >= 1 )
             {
-              if ( v7->sCurrentHP >= 1 )
-              {
-                Actor::AI_Stun(uActorID, PID(OBJECT_Player,a4), 0);
-                Actor::AggroSurroundingPeasants(uActorID, 1);
-              }
-              else
+              Actor::AI_Stun(uActorID, PID(OBJECT_Player,a4), 0);
+              Actor::AggroSurroundingPeasants(uActorID, 1);
+            }
+            else
+            {
+              if ( pMonsterStats->pInfos[actorPtr->pMonsterInfo.uID].bQuestMonster & 1 )
               {
-                if ( pMonsterStats->pInfos[v7->pMonsterInfo.uID].bQuestMonster & 1 )
+                v27 = byte_4D864C && BYTE2(pGame->uFlags) & 8 ? 10 * actorPtr->uActorRadius : actorPtr->uActorRadius;
+                if ( pRenderer->pRenderD3D )
                 {
-                  v27 = byte_4D864C && BYTE2(pGame->uFlags) & 8 ? 10 * v7->uActorRadius : v7->uActorRadius;
-                  v74 = v27;
-                  if ( pRenderer->pRenderD3D )
+                  if ( pGame->uFlags2 & GAME_FLAGS_2_DRAW_BLOODSPLATS )
                   {
-                    if ( pGame->uFlags2 & GAME_FLAGS_2_DRAW_BLOODSPLATS )
-                    {
-                      v28 = (double)v74;
-                      v74 = v7->vPosition.z;
-                      v29 = (double)v74;
-                      v74 = v7->vPosition.y;
-                      v30 = v29;
-                      v31 = (double)v74;
-                      v74 = v7->vPosition.x;
-                      v32 = v31;
-                      v33 = (double)v74;
-                      pDecalBuilder->AddBloodsplat(v33, v32, v30, 1.0, 0.0, 0.0, v28, 0, 0);
-                    }
+                    pDecalBuilder->AddBloodsplat(actorPtr->vPosition.x, actorPtr->vPosition.y, actorPtr->vPosition.z, 1.0, 0.0, 0.0, v27, 0, 0);
                   }
                 }
-                Actor::Die(uActorID);
-                Actor::ApplyFineForKillingPeasant(uActorID);
-                Actor::AggroSurroundingPeasants(uActorID, 1);
-                if ( v7->pMonsterInfo.uExp )
-                  GivePartyExp(pMonsterStats->pInfos[v7->pMonsterInfo.uID].uExp);
-                v34 = SPEECH_51;
-                if ( rand() % 100 < 20 )
-                  v34 = ((signed int)v7->pMonsterInfo.uHP >= 100) + 1;
-                v6->PlaySound((PlayerSpeech)v34, 0);
               }
+              Actor::Die(uActorID);
+              Actor::ApplyFineForKillingPeasant(uActorID);
+              Actor::AggroSurroundingPeasants(uActorID, 1);
+              if ( actorPtr->pMonsterInfo.uExp )
+                GivePartyExp(pMonsterStats->pInfos[actorPtr->pMonsterInfo.uID].uExp);
+              v34 = SPEECH_51;
+              if ( rand() % 100 < 20 )
+                v34 = ((signed int)actorPtr->pMonsterInfo.uHP >= 100) + 1;
+              playerPtr->PlaySound((PlayerSpeech)v34, 0);
             }
           }
         }
       }
       if ( !(dword_6BE368_debug_settings_2 & 0x10)
-        && v7->pMonsterInfo.uSpecialAttack
-        && rand() % 100 < v7->pMonsterInfo.uLevel * v7->pMonsterInfo.uSpecialAttackType )
-        v6->_48DCF6(v7->pMonsterInfo.uSpecialAttack, v7);
+        && actorPtr->pMonsterInfo.uSpecialAttack
+        && rand() % 100 < actorPtr->pMonsterInfo.uLevel * actorPtr->pMonsterInfo.uSpecialAttackType )
+        playerPtr->_48DCF6(actorPtr->pMonsterInfo.uSpecialAttack, actorPtr);
     }
     if ( !pParty->bTurnBasedModeOn )
     {
-      v35 = v6->GetActualEndurance();
-      v36 = (double)(20 - v6->GetParameterBonus(v35)) * flt_6BE3A4_debug_recmod1 * 2.133333333333333;
-      v6->SetRecoveryTime((signed __int64)v36);
+      v35 = playerPtr->GetActualEndurance();
+      v36 = (double)(20 - playerPtr->GetParameterBonus(v35)) * flt_6BE3A4_debug_recmod1 * 2.133333333333333;
+      playerPtr->SetRecoveryTime((signed __int64)v36);
     }
     if ( v77 )
     {
       v73 = (double)(signed int)v75;
-      if ( (double)v6->GetMaxHealth() * 0.25 < v73 )
+      if ( (double)playerPtr->GetMaxHealth() * 0.25 < v73 )
       {
-        if ( v6->sHealth > 0 )
+        if ( playerPtr->sHealth > 0 )
         {
-          if ( (double)v6->GetMaxHealth() * 0.25 >= (double)v6->sHealth )
-            v6->PlaySound(SPEECH_48, 0);
+          if ( (double)playerPtr->GetMaxHealth() * 0.25 >= (double)playerPtr->sHealth )
+            playerPtr->PlaySound(SPEECH_48, 0);
         }
       }
     }
     viewparams->bRedrawGameUI = 1;
     return;
   }
-  v37 = &pSpriteObjects[uActorID];
-  v38 = PID_TYPE(v37->spell_caster_pid);
-  v39 = PID_ID(v37->spell_caster_pid);
-  v40 = PID_TYPE(v37->spell_caster_pid);
-  uActorID = PID_ID(v37->spell_caster_pid);
-  v41 = v40 - 2;
-  if ( !v41 )
-    goto LABEL_80;
-  v42 = v41 - 1;
-  if ( !v42 )
-  {
-    v44 = &pActors[v39];
-    if ( a4 == -1 )
-      a4 = stru_50C198.which_player_would_attack(v44);
-    v45 = &pParty->pPlayers[a4];
-    v77 = Actor::_43B3E0_CalcDamage(v44, v74);
-    v46 = v37->uType;
-    if ( v37->uType == 545 )
-    {
-      LOBYTE(v51) = v45->GetActualSkillLevel(PLAYER_SKILL_UNARMED);
-      v52 = v51;
-      if ( (signed int)SkillToMastery(v51) >= 4 && rand() % 100 < (v52 & 0x3F) )
+  else
+  {
+    v37 = &pSpriteObjects[uActorID];
+    v38 = PID_TYPE(v37->spell_caster_pid);
+    v39 = PID_ID(v37->spell_caster_pid);
+    v40 = PID_TYPE(v37->spell_caster_pid);
+    uActorID = PID_ID(v37->spell_caster_pid);
+    v41 = v40 - 2;
+    if ( !v41 )
+      goto LABEL_80;
+    v42 = v41 - 1;
+    if ( !v42 )
+    {
+      v44 = &pActors[v39];
+      if ( a4 == -1 )
+        a4 = stru_50C198.which_player_would_attack(v44);
+      v45 = &pParty->pPlayers[a4];
+      v77 = Actor::_43B3E0_CalcDamage(v44, v74);
+      v46 = v37->uType;
+      if ( v37->uType == 545 )
       {
-		  sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[637], v45->pName);
-        ShowStatusBarString(pTmpBuf.data(), 2u);
-        v45->PlaySound(SPEECH_6, 0);
-        return;
+        LOBYTE(v51) = v45->GetActualSkillLevel(PLAYER_SKILL_UNARMED);
+        v52 = v51;
+        if ( (signed int)SkillToMastery(v51) >= 4 && rand() % 100 < (v52 & 0x3F) )
+        {
+		    sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[637], v45->pName);
+          ShowStatusBarString(pTmpBuf.data(), 2u);
+          v45->PlaySound(SPEECH_6, 0);
+          return;
+        }
       }
-    }
-    else
-    {
-      if ( v46 != 555
-        && v46 != 510
-        && v46 != 500
-        && v46 != 515
-        && v46 != 505
-        && v46 != 530
-        && v46 != 525
-        && v46 != 520
-        && v46 != 535
-        && v46 != 540 )
-        goto LABEL_115;
-    }
-    if ( !stru_50C198.ActorHitOrMiss(v44, v45) )
-      return;
-    if ( (signed __int64)v45->pPlayerBuffs[13].uExpireTime > 0 )
-      v77 >>= 1;
-    if ( v45->HasEnchantedItemEquipped(36) )
-      v77 >>= 1;
-    if ( v45->HasEnchantedItemEquipped(69) )
-      v77 >>= 1;
-    if ( v45->HasItemEquipped(EQUIP_ARMOUR)
-		&& *(_DWORD *)&v45->pInventoryItemList[v45->pEquipment.uArmor-1] == 504 )
-      v77 >>= 1;
-    v75 = 0;
-	v47 = (int)&v45->pEquipment;
-    do
-    {
-      if ( v45->HasItemEquipped((ITEM_EQUIP_TYPE)v75) )
+      else
       {
-        v48 = *(int *)&v45[36 * *(int *)v47 + 496];
-        if ( v48 == 520 )
-          v77 >>= 1;
-        if ( v48 == 531 )
-          v77 >>= 1;
-        if ( v45->GetEquippedItemEquipType((ITEM_EQUIP_TYPE)v75) == EQUIP_SHIELD && SkillToMastery(v45->pActiveSkills[PLAYER_SKILL_SHIELD]) == 4 )
+        if ( v46 != 555
+          && v46 != 510
+          && v46 != 500
+          && v46 != 515
+          && v46 != 505
+          && v46 != 530
+          && v46 != 525
+          && v46 != 520
+          && v46 != 535
+          && v46 != 540 )
+          goto LABEL_115;
+      }
+      if ( !stru_50C198.ActorHitOrMiss(v44, v45) )
+        return;
+      if ( (signed __int64)v45->pPlayerBuffs[13].uExpireTime > 0 )
+        v77 >>= 1;
+      if ( v45->HasEnchantedItemEquipped(36) )
+        v77 >>= 1;
+      if ( v45->HasEnchantedItemEquipped(69) )
+        v77 >>= 1;
+      if ( v45->HasItemEquipped(EQUIP_ARMOUR)
+		  && v45->pInventoryItemList[v45->pEquipment.uArmor-1].uItemID == ITEM_ARTIFACT_GOVERNORS_ARMOR )
+        v77 >>= 1;
+      if ( v45->HasItemEquipped(EQUIP_MAIN_HAND))
+      {
+        v48 = v45->pInventoryItemList[v45->pEquipment.uMainHand - 1].uItemID;
+        if ( v48 == ITEM_RELIC_KELEBRIM || v48 == ITEM_ARTIFACT_ELFBANE || (v45->GetEquippedItemEquipType(EQUIP_MAIN_HAND) == EQUIP_SHIELD && SkillToMastery(v45->pActiveSkills[PLAYER_SKILL_SHIELD]) == 4))
           v77 >>= 1;
       }
-      ++v75;
-      v47 += 4;
-    }
-    while ( (signed int)v75 <= 1 );
-LABEL_115:
-    if ( (signed __int64)v44->pActorBuffs[3].uExpireTime > 0 )
-    {
-      v49 = v44->pActorBuffs[3].uPower;
-      if ( v49 )
-        v77 /= (signed int)v49;
-    }
-    if ( !v74 )
-    {
-      v50 = v44->pMonsterInfo.uAttack1Type;
-      goto LABEL_133;
-    }
-    if ( v74 == 1 )
-    {
-      v50 = v44->pMonsterInfo.uAttack2Type;
-      goto LABEL_133;
-    }
-    if ( v74 == 2 )
-    {
-      v53 = v44->pMonsterInfo.uSpell1ID;
-    }
-    else
-    {
-      if ( v74 != 3 )
+      if ( v45->HasItemEquipped(EQUIP_OFF_HAND))
+      {
+        v48 = v45->pInventoryItemList[v45->pEquipment.uShield - 1].uItemID;
+        if ( v48 == ITEM_RELIC_KELEBRIM || v48 == ITEM_ARTIFACT_ELFBANE || (v45->GetEquippedItemEquipType(EQUIP_OFF_HAND) == EQUIP_SHIELD && SkillToMastery(v45->pActiveSkills[PLAYER_SKILL_SHIELD]) == 4))
+          v77 >>= 1;
+      }
+  LABEL_115:
+      if ( (signed __int64)v44->pActorBuffs[3].uExpireTime > 0 )
+      {
+        v49 = v44->pActorBuffs[3].uPower;
+        if ( v49 )
+          v77 /= (signed int)v49;
+      }
+      if ( !v74 )
+      {
+        v50 = v44->pMonsterInfo.uAttack1Type;
+        goto LABEL_133;
+      }
+      if ( v74 == 1 )
       {
-        if ( v74 == 4 )
-          v50 = v44->pMonsterInfo.field_3C_some_special_attack;
-        else
-          v50 = 4;
-LABEL_133:
-        if ( !(dword_6BE368_debug_settings_2 & 0x10) )
+        v50 = v44->pMonsterInfo.uAttack2Type;
+        goto LABEL_133;
+      }
+      if ( v74 == 2 )
+      {
+        v53 = v44->pMonsterInfo.uSpell1ID;
+      }
+      else
+      {
+        if ( v74 != 3 )
         {
-          v54 = v45->ReceiveDamage(v77, (DAMAGE_TYPE)v50);
-          if ( SHIDWORD(v45->pPlayerBuffs[10].uExpireTime) >= 0 )
+          if ( v74 == 4 )
+            v50 = v44->pMonsterInfo.field_3C_some_special_attack;
+          else
+            v50 = 4;
+  LABEL_133:
+          if ( !(dword_6BE368_debug_settings_2 & 0x10) )
           {
-            if ( SHIDWORD(v45->pPlayerBuffs[10].uExpireTime) > 0 || LODWORD(v45->pPlayerBuffs[10].uExpireTime) )
+            v54 = v45->ReceiveDamage(v77, (DAMAGE_TYPE)v50);
+            if ( SHIDWORD(v45->pPlayerBuffs[10].uExpireTime) >= 0 )
             {
-              v55 = v44->uAIState;
-              if ( v55 != 5 )
+              if ( SHIDWORD(v45->pPlayerBuffs[10].uExpireTime) > 0 || LODWORD(v45->pPlayerBuffs[10].uExpireTime) )
               {
-                if ( v55 != 4 )
+                v55 = v44->uAIState;
+                if ( v55 != Dying && v55 != Dead)
                 {
                   v56 = stru_50C198.CalcMagicalDamageToActor(v44, v50, v54);
                   v44->sCurrentHP -= v56;
@@ -7876,21 +7807,11 @@
                       if ( pMonsterStats->pInfos[v44->pMonsterInfo.uID].bQuestMonster & 1 )
                       {
                         v57 = byte_4D864C && BYTE2(pGame->uFlags) & 8 ? 10 * v44->uActorRadius : v44->uActorRadius;
-                        v75 = v57;
                         if ( pRenderer->pRenderD3D )
                         {
                           if ( pGame->uFlags2 & GAME_FLAGS_2_DRAW_BLOODSPLATS )
                           {
-                            v58 = (double)(signed int)v75;
-                            v75 = v44->vPosition.z;
-                            v59 = (double)(signed int)v75;
-                            v75 = v44->vPosition.y;
-                            v60 = v59;
-                            v61 = (double)(signed int)v75;
-                            v75 = v44->vPosition.x;
-                            v62 = v61;
-                            v63 = (double)(signed int)v75;
-                            pDecalBuilder->AddBloodsplat(v63, v62, v60, 1.0, 0.0, 0.0, v58, 0, 0);
+                            pDecalBuilder->AddBloodsplat(v44->vPosition.x, v44->vPosition.y, v44->vPosition.z, 1.0, 0.0, 0.0, v57, 0, 0);
                           }
                         }
                       }
@@ -7909,71 +7830,71 @@
               }
             }
           }
+          if ( !v74
+            && !(dword_6BE368_debug_settings_2 & 0x10)
+            && v44->pMonsterInfo.uSpecialAttack
+            && rand() % 100 < v44->pMonsterInfo.uLevel * v44->pMonsterInfo.uSpecialAttackType )
+            v45->_48DCF6(v44->pMonsterInfo.uSpecialAttack, v44);
+          if ( !pParty->bTurnBasedModeOn )
+          {
+            v65 = v45->GetActualEndurance();
+            v66 = (double)(20 - v45->GetParameterBonus(v65))
+                * flt_6BE3A4_debug_recmod1
+                * 2.133333333333333;
+            v45->SetRecoveryTime((signed __int64)v66);
+          }
+          return;
         }
-        if ( !v74
-          && !(dword_6BE368_debug_settings_2 & 0x10)
-          && v44->pMonsterInfo.uSpecialAttack
-          && rand() % 100 < v44->pMonsterInfo.uLevel * v44->pMonsterInfo.uSpecialAttackType )
-          v45->_48DCF6(v44->pMonsterInfo.uSpecialAttack, v44);
-        if ( !pParty->bTurnBasedModeOn )
-        {
-          v65 = v45->GetActualEndurance();
-          v66 = (double)(20 - v45->GetParameterBonus(v65))
-              * flt_6BE3A4_debug_recmod1
-              * 2.133333333333333;
-          v45->SetRecoveryTime((signed __int64)v66);
-        }
-        return;
+        v53 = v44->pMonsterInfo.uSpell2ID;
       }
-      v53 = v44->pMonsterInfo.uSpell2ID;
-    }
-    v50 = LOBYTE(pSpellStats->pInfos[v53].uSchool);
-    goto LABEL_133;
-  }
-  if ( v42 != 1 )
-    return;
-LABEL_80:
-  if ( a4 != -1 )
-  {
-    v43 = &pParty->pPlayers[a4];
-LABEL_168:
-    a4b = v43;
-    if ( v38 != OBJECT_Player || v37->spell_id != SPELL_BOW_ARROW)
-    {
-      v70 = v43->GetMaxHealth();
-      v68 = _43AFE3_calc_spell_damage(v37->spell_id, v37->spell_level, v37->spell_skill, v70);
-      v69 = LOBYTE(pSpellStats->pInfos[v37->spell_id].uSchool);
-    }
-    else
-    {
-      v68 = pParty->pPlayers[uActorID].CalculateRangedDamageTo(0);
-      v69 = 0;
-    }
-    a4b->ReceiveDamage(v68, (DAMAGE_TYPE)v69);
-    if ( v38 == OBJECT_Player && !qword_A750D8 )
-    {
-      qword_A750D8 = 256i64;
-      PlayerSpeechID = SPEECH_44;
-      uSpeakingCharacter = uActorID + 1;
-    }
-    return;
-  }
-  v74 = 0;
-  a4a = 1;
-  do
-  {
-    if ( pPlayers[a4a]->CanAct() )
-    {
-      v67 = v74++;
-      *(&v72 + v67) = a4a;
-    }
-    ++a4a;
-  }
-  while ( a4a <= 4 );
-  if ( v74 )
-  {
-    v43 = &pParty->pPlayers[*(&v72+rand()%v74)-1];//&stru_AA1058[3].pSounds[6972 * *(&v72 + rand() % v74) + 40552];
-    goto LABEL_168;
+      v50 = LOBYTE(pSpellStats->pInfos[v53].uSchool);
+      goto LABEL_133;
+    }
+    if ( v42 != 1 )
+      return;
+  LABEL_80:
+    if ( a4 != -1 )
+    {
+      v43 = &pParty->pPlayers[a4];
+  LABEL_168:
+      a4b = v43;
+      if ( v38 != OBJECT_Player || v37->spell_id != SPELL_BOW_ARROW)
+      {
+        v70 = v43->GetMaxHealth();
+        v68 = _43AFE3_calc_spell_damage(v37->spell_id, v37->spell_level, v37->spell_skill, v70);
+        v69 = LOBYTE(pSpellStats->pInfos[v37->spell_id].uSchool);
+      }
+      else
+      {
+        v68 = pParty->pPlayers[uActorID].CalculateRangedDamageTo(0);
+        v69 = 0;
+      }
+      a4b->ReceiveDamage(v68, (DAMAGE_TYPE)v69);
+      if ( v38 == OBJECT_Player && !qword_A750D8 )
+      {
+        qword_A750D8 = 256i64;
+        PlayerSpeechID = SPEECH_44;
+        uSpeakingCharacter = uActorID + 1;
+      }
+      return;
+    }
+    v74 = 0;
+    a4a = 1;
+    do
+    {
+      if ( pPlayers[a4a]->CanAct() )
+      {
+        v67 = v74++;
+        *(&v72 + v67) = a4a;
+      }
+      ++a4a;
+    }
+    while ( a4a <= 4 );
+    if ( v74 )
+    {
+      v43 = &pParty->pPlayers[*(&v72+rand()%v74)-1];//&stru_AA1058[3].pSounds[6972 * *(&v72 + rand() % v74) + 40552];
+      goto LABEL_168;
+    }
   }
 }
 //----- (00421EA6) --------------------------------------------------------
--- a/UI/UICharacter.cpp	Wed Sep 18 11:04:47 2013 +0600
+++ b/UI/UICharacter.cpp	Wed Sep 18 11:05:06 2013 +0600
@@ -942,7 +942,7 @@
       item = &pPlayers[uPlayerID]->pInventoryItemList[pPlayers[uPlayerID]->pEquipment.uArmor - 1];
       switch ( item->uItemID )
       {
-        case ITEM_ARTICACT_GOVERNONS_ARMOR:
+        case ITEM_ARTIFACT_GOVERNORS_ARMOR:
           index = 15;
           break;
         case ITEM_ARTIFACT_YORUBA:
@@ -1140,7 +1140,7 @@
       item = &pPlayers[uPlayerID]->pInventoryItemList[pPlayers[uPlayerID]->pEquipment.uArmor - 1];
       switch ( item->uItemID )
       {
-        case ITEM_ARTICACT_GOVERNONS_ARMOR:
+        case ITEM_ARTIFACT_GOVERNORS_ARMOR:
           index = 15;
           break;
         case ITEM_ARTIFACT_YORUBA:
@@ -1766,7 +1766,7 @@
   {
     auto player = pParty->pPlayers + i;
 
-    if (player->HasItem(ITEM_ARTICACT_GOVERNONS_ARMOR, 1))    byte_5111F6[0] = 1;
+    if (player->HasItem(ITEM_ARTIFACT_GOVERNORS_ARMOR, 1))    byte_5111F6[0] = 1;
     if (player->HasItem(ITEM_ARTIFACT_YORUBA, 1))             byte_5111F6[1] = 1;
     if (player->HasItem(ITEM_RELIC_HARECS_LEATHER, 1))        byte_5111F6[2] = 1;
     if (player->HasItem(ITEM_ARTIFACT_LEAGUE_BOOTS, 1))       byte_5111F6[3] = 1;
@@ -1809,7 +1809,7 @@
     paperdoll_helm_texture[i][14] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
     GetItemTextureFilename(pContainer, 544, i + 1, 0);
     paperdoll_helm_texture[i][15] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
-    if ( _43ED6F_check_party_races(true) )
+    if ( IsDwarfPresentInParty(true) )          //the phynaxian helm uses a slightly different graphic for dwarves
       papredoll_dbrds[11] = pIcons_LOD->LoadTexture("item092v3", TEXTURE_16BIT_PALETTE);
   }
   //v43 = 0;
--- a/mm7_data.h	Wed Sep 18 11:04:47 2013 +0600
+++ b/mm7_data.h	Wed Sep 18 11:05:06 2013 +0600
@@ -1137,7 +1137,7 @@
 void sub_43B1B0(signed int a1, unsigned int a2, struct Vec3_int_ *pVelocity, signed int a4);
 void CharacterUI_LoadPaperdollTextures();
 int __fastcall GetItemTextureFilename(char *pOut, signed int item_id, int index, int shoulder);
-bool _43ED6F_check_party_races(bool b);
+bool IsDwarfPresentInParty(bool b);
 bool  ShouldLoadTexturesForRaceAndGender(unsigned int _this);
 void WetsuitOn(unsigned int uPlayerID); // idb
 void WetsuitOff(unsigned int uPlayerID);