changeset 2185:385040580292

CastSpell continue
author Ritor1
date Mon, 27 Jan 2014 00:13:01 +0600
parents e0863f5beee0
children 7a517c9a1d5b
files CastSpellInfo.cpp Game.cpp OSWindow.cpp Player.cpp Player.h UI/UIHouses.cpp UI/UIPopup.cpp mm7_2.cpp mm7_data.cpp mm7_data.h
diffstat 10 files changed, 470 insertions(+), 517 deletions(-) [+]
line wrap: on
line diff
--- a/CastSpellInfo.cpp	Fri Jan 24 18:01:51 2014 +0600
+++ b/CastSpellInfo.cpp	Mon Jan 27 00:13:01 2014 +0600
@@ -1546,15 +1546,13 @@
           {
             if ( pParty->pPlayers[i].pConditions[Condition_Sleep] )
             {
-              //*((int *)v222 + 4) = 0;
-              //*((int *)v222 + 5) = 0;
               pParty->pPlayers[i].pConditions[Condition_Sleep] = 0;
               pParty->pPlayers[i].PlaySound(SPEECH_103, 0);
             }
           }
           else
           {
-            if ( pParty->pPlayers[i].DiscardConditionIfLastsLongerThan(2, pParty->uTimePlayed -
+            if ( pParty->pPlayers[i].DiscardConditionIfLastsLongerThan(Condition_Sleep, pParty->uTimePlayed -
                              (signed int)(signed __int64)((double)(amount << 7) * 0.033333335)) )
               pParty->pPlayers[i].PlaySound(SPEECH_103, 0);
           }
@@ -1728,7 +1726,7 @@
         if ((skill_level == 1 || skill_level == 2 /*&& _v725->uEquipType > EQUIP_BOW*/ || skill_level == 3 || skill_level == 4) && 
             v245->uItemID <= 134 &&
             v245->uSpecEnchantmentType == 0 && v245->uEnchantmentType == 0 &&
-            v245->m_enchantmentStrength== 0 && !v245->IsBroken() )
+            v245->m_enchantmentStrength== 0 && !v245->IsBroken() ) //требования к предмету
         {
           if ( (v245->GetValue() < 450 && ( skill_level == 1 || skill_level == 2 ))
           || (v245->GetValue() < 450 && (skill_level == 3|| skill_level == 4 ) && _v725->uEquipType >= EQUIP_SINGLE_HANDED && _v725->uEquipType <= EQUIP_BOW)
@@ -1749,117 +1747,117 @@
             }
             else
             {
-            if ( (rnd < 80 && (skill_level == 3 || skill_level == 4 )) || v245->GetValue() < 450 || (v245->GetValue() < 250//Ritor1:здесь я остановился
-            && (skill_level == 3 || skill_level == 4) && _v725->uEquipType >= EQUIP_SINGLE_HANDED && _v725->uEquipType <= EQUIP_BOW))
-          {
-            v313 = _v725->uEquipType;
-            if ( _v725->uEquipType >= EQUIP_ARMOUR && _v725->uEquipType <= EQUIP_AMULET )
-            {
-              v295 = rand() % 10;// pItemsTable->field_116D8[pItemsTable->pItems[_this->uItemID].uEquipType];
-              /*v245->uEnchantmentType = 0;
-              __debugbreak(); // castspellinfo.cpp(1971): warning C4700: uninitialized local variable 'v294' used
-              for ( kk = pItemsTable->pEnchantments[0].to_item[v245->GetItemEquipType() + 1];
-                    ;
-                    kk += pItemsTable->pEnchantments[v294->uEnchantmentType].to_item[v245->GetItemEquipType() + 1] )
+              if ( (rnd < 80 && (skill_level == 3 || skill_level == 4 )) || v245->GetValue() < 450 || (v245->GetValue() < 250
+                && (skill_level == 3 || skill_level == 4) && _v725->uEquipType >= EQUIP_SINGLE_HANDED && _v725->uEquipType <= EQUIP_BOW))
               {
-                ++v245->uEnchantmentType;
-                if ( kk >= v295 )
+                v313 = _v725->uEquipType;
+                if ( _v725->uEquipType >= EQUIP_ARMOUR && _v725->uEquipType <= EQUIP_AMULET )
+                {
+                  v295 = rand() % 10;// pItemsTable->field_116D8[pItemsTable->pItems[_this->uItemID].uEquipType];
+                  /*v245->uEnchantmentType = 0;
+                  __debugbreak(); // castspellinfo.cpp(1971): warning C4700: uninitialized local variable 'v294' used
+                  for ( kk = pItemsTable->pEnchantments[0].to_item[v245->GetItemEquipType() + 1];
+                        ;
+                        kk += pItemsTable->pEnchantments[v294->uEnchantmentType].to_item[v245->GetItemEquipType() + 1] )
+                  {
+                    ++v245->uEnchantmentType;
+                    if ( kk >= v295 )
+                      break;
+                  }
+                  v255 = 10;//pItemsTable->field_116D8[17];
+                  v256 = 10;//pItemsTable->field_116D8[16];
+                  v245->m_enchantmentStrength = v256 + rand() % (v255 - v256 + 1);*/
+                  v245->uEnchantmentType = v295;
+                  v245->m_enchantmentStrength = pItemsTable->pEnchantments[v295].to_item[_v725->uEquipType - EQUIP_ARMOUR];
+                  v245->uAttributes |= 0x20u;
+                  _50C9A8_item_enchantment_timer = 256;
+                  LODWORD(v727) = 1;
                   break;
-              }
-              v255 = 10;//pItemsTable->field_116D8[17];
-              v256 = 10;//pItemsTable->field_116D8[16];
-              v245->m_enchantmentStrength = v256 + rand() % (v255 - v256 + 1);*/
-              v245->uEnchantmentType = v295;
-              v245->m_enchantmentStrength = pItemsTable->pEnchantments[v295].to_item[_v725->uEquipType - EQUIP_ARMOUR];
-              v245->uAttributes |= 0x20u;
-              _50C9A8_item_enchantment_timer = 256;
-              LODWORD(v727) = 1;
-              break;
-            }
-            else if ( skill_level == 3 || skill_level == 4)
-            {
-              v258 = 0;
-              v725 = 0.0;
-              int _v733;
-              if ( pItemsTable->pSpecialEnchantments_count > 0 )
-              {
-                v730 = (int)&v679;
-                for ( _v733 = 0; _v733 < pItemsTable->pSpecialEnchantments_count; ++_v733 )
+                }
+                else if ( skill_level == 3 || skill_level == 4)//мастер и гранд
                 {
-                  v259 = LOBYTE(pItemsTable->pSpecialEnchantments[v258 + 1].pBonusStatement);
-                  if ( !v259 || v259 == 1 )
+                  v258 = 0;
+                  v725 = 0.0;
+                  int _v733;
+                  if ( pItemsTable->pSpecialEnchantments_count > 0 )
                   {
-                    v260 = *(&pItemsTable->pSpecialEnchantments[0].to_item_apply[v245->GetItemEquipType() + 4] + v258 * 28);
-                    LODWORD(v725) += v260;
-                    if ( v260 )
+                    v730 = (int)&v679;
+                    for ( _v733 = 0; _v733 < pItemsTable->pSpecialEnchantments_count; ++_v733 )
                     {
-                      v261 = v730;
-                      v730 += 4;
-                      *(int *)v261 = _v733;
+                      v259 = LOBYTE(pItemsTable->pSpecialEnchantments[v258 + 1].pBonusStatement);
+                      if ( !v259 || v259 == 1 )
+                      {
+                        v260 = *(&pItemsTable->pSpecialEnchantments[0].to_item_apply[v245->GetItemEquipType() + 4] + v258 * 28);
+                        LODWORD(v725) += v260;
+                        if ( v260 )
+                        {
+                          v261 = v730;
+                          v730 += 4;
+                          *(int *)v261 = _v733;
+                        }
+                      }
+                      ++v258;
                     }
                   }
-                  ++v258;
+                  v262 = rand() % SLODWORD(v725);
+                  v263 = v679;
+                  v245->uSpecEnchantmentType = v679[0];
+                  v264 = pItemsTable->pSpecialEnchantments[*v263].to_item_apply[v245->GetItemEquipType() + 4];
+                  v265 = v262 + 1;
+                  if ( v264 < v265 )
+                  {
+                    for ( ii = v679; ; ii = (int *)v732 )
+                    {
+                      v267 = (int)(ii + 1);
+                      v732 = v267;
+                      v268 = *(int *)v267;
+                      *(int *)(v245 + 12) = v268;
+                      v264 += pItemsTable->pSpecialEnchantments[v268].to_item_apply[v245->GetItemEquipType() + 4];
+                      if ( v264 >= v265 )
+                        break;
+                    }
+                  }
+                  v278 = 0;
+                  v725 = 0.0;
+                  if ( pItemsTable->pSpecialEnchantments_count > 0 )
+                  {
+                    int *_v730 = v679;
+                    for ( _v733 = 0; _v733 < pItemsTable->pSpecialEnchantments_count; ++_v733 )
+                    {
+                      v279 = LOBYTE(pItemsTable->pSpecialEnchantments[v278].pBonusStatement);
+                      if ( !v279 || v279 == 1 )
+                      {
+                        v280 = *(&pItemsTable->pSpecialEnchantments[v278].to_item_apply[v245->GetItemEquipType()]);
+                        _v733 += v280;
+                        if ( v280 )
+                        {
+                          v281 = _v730;
+                          ++_v730;
+                          *v281 = _v733;
+                        }
+                      }
+                      ++v278;
+                    }
+                  }
+                  v282 = rand() % _v733;
+                  v283 = v679;
+                  v245->uSpecEnchantmentType = v679[0];
+                  v284 = pItemsTable->pSpecialEnchantments[*v283].to_item_apply[v245->GetItemEquipType() ];
+                  v285 = v282 + 1;
+                  for ( l = v679; v284 < v285; ++l )
+                  {
+                    v245->uSpecEnchantmentType = *(l+1);
+                    v284 += pItemsTable->pSpecialEnchantments[*(l+1)].to_item_apply[v245->GetItemEquipType()];
+                  }
+                  ++v245->uSpecEnchantmentType;
+                  v245->uAttributes |= 0x20u;
+                  _50C9A8_item_enchantment_timer = 256;
+                  LODWORD(v727) = 1;
+                  break;
                 }
               }
-              v262 = rand() % SLODWORD(v725);
-              v263 = v679;
-              v245->uSpecEnchantmentType = v679[0];
-              v264 = pItemsTable->pSpecialEnchantments[*v263].to_item_apply[v245->GetItemEquipType() + 4];
-              v265 = v262 + 1;
-              if ( v264 < v265 )
-              {
-                for ( ii = v679; ; ii = (int *)v732 )
-                {
-                  v267 = (int)(ii + 1);
-                  v732 = v267;
-                  v268 = *(int *)v267;
-                  *(int *)(v245 + 12) = v268;
-                  v264 += pItemsTable->pSpecialEnchantments[v268].to_item_apply[v245->GetItemEquipType() + 4];
-                  if ( v264 >= v265 )
-                    break;
-                }
-              }
-              v278 = 0;
-              v725 = 0.0;
-              if ( pItemsTable->pSpecialEnchantments_count > 0 )
-              {
-                int *_v730 = v679;
-                for ( _v733 = 0; _v733 < pItemsTable->pSpecialEnchantments_count; ++_v733 )
-                {
-                  v279 = LOBYTE(pItemsTable->pSpecialEnchantments[v278].pBonusStatement);
-                  if ( !v279 || v279 == 1 )
-                  {
-                    v280 = *(&pItemsTable->pSpecialEnchantments[v278].to_item_apply[v245->GetItemEquipType()]);
-                    _v733 += v280;
-                    if ( v280 )
-                    {
-                      v281 = _v730;
-                      ++_v730;
-                      *v281 = _v733;
-                    }
-                  }
-                  ++v278;
-                }
-              }
-              v282 = rand() % _v733;
-              v283 = v679;
-              v245->uSpecEnchantmentType = v679[0];
-              v284 = pItemsTable->pSpecialEnchantments[*v283].to_item_apply[v245->GetItemEquipType() ];
-              v285 = v282 + 1;
-              for ( l = v679; v284 < v285; ++l )
-              {
-                v245->uSpecEnchantmentType = *(l+1);
-                v284 += pItemsTable->pSpecialEnchantments[*(l+1)].to_item_apply[v245->GetItemEquipType()];
-              }
-              ++v245->uSpecEnchantmentType;
-              v245->uAttributes |= 0x20u;
-              _50C9A8_item_enchantment_timer = 256;
-              LODWORD(v727) = 1;
-              break;
             }
           }
-		  }
-          }
         }
         if ( LODWORD(v727) == 0 )
         {
@@ -1879,7 +1877,8 @@
         amount = 10 * spell_level;
         if ( pPlayer->sMana < (signed int)uRequiredMana )
           break;
-        if ( pParty->uFlags & (PARTY_FLAGS_1_ALERT_RED | PARTY_FLAGS_1_ALERT_YELLOW) && skill_level != 4 || rand() % 100 >= amount && skill_level != 4 )
+        if ( pParty->uFlags & (PARTY_FLAGS_1_ALERT_RED | PARTY_FLAGS_1_ALERT_YELLOW) && skill_level != 4 
+          || rand() % 100 >= amount && skill_level != 4 )
         {
           ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
           pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
@@ -1893,348 +1892,305 @@
       }
       case SPELL_WATER_LLOYDS_BEACON://Маяк Ллойда
       {
-        LODWORD(v733) = 604800 * spell_level;
-        if ( !_stricmp(pCurrentMapName, "d05.blv") )
+        if ( !_stricmp(pCurrentMapName, "d05.blv") ) // Arena
+        {
+          ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
+          pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
+          pCastSpell->uSpellID = 0;
+          continue;
+        }
+        if ( pPlayer->sMana >= (signed int)uRequiredMana )
+        {
+          pEventTimer->Pause();
+          pMessageQueue_50CBD0->AddMessage(UIMSG_OnCastLloydsBeacon, 0, 0);
+          lloyds_beacon_spell_level = (signed int)(604800 * spell_level);
+          _506348_current_lloyd_playerid = pCastSpell->uPlayerID;
+          ::uRequiredMana = uRequiredMana;
+          ::sRecoveryTime = sRecoveryTime;
+          lloyds_beacon_sound_id = pCastSpell->sound_id;
+          lloyds_beacon_spell_id = pCastSpell->uSpellID;
+          pCastSpell->uFlags |= 0x20u;
+        }
+        break;
+      }
+      case SPELL_EARTH_STONE_TO_FLESH:
+      {
+        switch (skill_level)
+        {
+          case 1: amount = 3600 * spell_level; break;
+          case 2: amount = 3600 * spell_level; break;
+          case 3: amount = 86400 * spell_level; break;
+          case 4: break;
+          default:
+          assert(false);
+        }
+        if ( !pPlayer->CanCastSpell(uRequiredMana) )
+          break;
+        if ( pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Pertified] )
+        {
+          if ( skill_level == 4 )//for GM
+          {
+            pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Pertified] = 0;
+            LODWORD(v727) = 1;
+            break;
+          }
+          v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335);
+          pParty->pPlayers[pCastSpell->uPlayerID_2].DiscardConditionIfLastsLongerThan(15, v663);
+        }
+        LODWORD(v727) = 1;
+        break;
+      }
+      case SPELL_EARTH_ROCK_BLAST://Взрыв камня
+      {
+        if ( !pPlayer->CanCastSpell(uRequiredMana) )
+          break;
+        pSpellSprite.stru_24.Reset();
+        pSpellSprite.spell_id = pCastSpell->uSpellID;
+        pSpellSprite.spell_level = spell_level;
+        pSpellSprite.spell_skill = skill_level;
+        pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
+        pSpellSprite.vPosition.y = pParty->vPosition.y;
+        pSpellSprite.vPosition.x = pParty->vPosition.x;
+        pSpellSprite.uAttributes = 0;
+        pSpellSprite.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
+        pSpellSprite.uSectorID = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3);
+        pSpellSprite.uSpriteFrameID = 0;
+        pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
+        pSpellSprite.spell_target_pid = a2;
+        pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
+        pSpellSprite.uFacing = LOWORD(pParty->sRotationY);
+        pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
+        if ( pParty->bTurnBasedModeOn == 1 )
+          LOBYTE(pSpellSprite.uAttributes) |= 4;
+        v659 = pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed;
+        if ( pSpellSprite.Create(pParty->sRotationY, pParty->sRotationX, v659, pCastSpell->uPlayerID + 1) != -1
+            && pParty->bTurnBasedModeOn == 1 )
+          ++pTurnEngine->pending_actions;
+        LODWORD(v727) = 1;
+        break;
+      }
+      case SPELL_EARTH_DEATH_BLOSSOM: //Цветок смерти
+      {
+        if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
         {
           ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
           pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
           pCastSpell->uSpellID = 0;
           continue;
         }
-        v319 = uRequiredMana;
-        if ( pPlayer->sMana >= (signed int)uRequiredMana )
-			{
-				pEventTimer->Pause();
-				pMessageQueue_50CBD0->AddMessage(UIMSG_OnCastLloydsBeacon, 0, 0);
-				qword_506350 = (signed int)v733;
-				_506348_current_lloyd_playerid = pCastSpell->uPlayerID;
-				::uRequiredMana = v319;
-				::sRecoveryTime = sRecoveryTime;
-				dword_50633C = pCastSpell->sound_id;
-				dword_506338 = pCastSpell->uSpellID;
-				pCastSpell->uFlags |= 0x20u;
-			}
-			break;
-		}
-		case SPELL_EARTH_STONE_TO_FLESH:
-		{
-			__debugbreak(); // missing GM ?
-			switch (skill_level)
-			{
-				case 1: amount = 3600 * spell_level; break;
-				case 2: amount = 3600 * spell_level; break;
-				case 3: amount = 86400 * spell_level; break;
-				case 4: break;
-				default:
-				assert(false);
-			}
-	//LABEL_634:
-			if ( !pPlayer->CanCastSpell(uRequiredMana) )
-				break;
-			v323 = pCastSpell->uPlayerID_2;
-			v324 = (char *)&pParty->pPlayers[v323].pConditions[Condition_Pertified];
-			if ( !pParty->pPlayers[v323].pConditions[Condition_Pertified] )
-			{
-				LODWORD(v727) = 1;
-				break;
-			}
-			if ( skill_level == 4 )
-			{
-				*(int *)v324 = 0;
-				*((int *)v324 + 1) = 0;
-				LODWORD(v727) = 1;
-				break;
-			}
-			v732 = amount << 7;
-			v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335);
-			v656 = 15;
-			v325 = &pParty->pPlayers[v323];
-			v325->DiscardConditionIfLastsLongerThan(v656, v663);
-			LODWORD(v727) = 1;
-			break;
-		}
-		case SPELL_EARTH_ROCK_BLAST:
-		{
-			if ( !pPlayer->CanCastSpell(uRequiredMana) )
-				break;
-			pSpellSprite.stru_24.Reset();
-			pSpellSprite.spell_id = pCastSpell->uSpellID;
-			pSpellSprite.spell_level = spell_level;
-			pSpellSprite.spell_skill = skill_level;
-			pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
-			pSpellSprite.vPosition.y = pParty->vPosition.y;
-			pSpellSprite.vPosition.x = pParty->vPosition.x;
-			pSpellSprite.uAttributes = 0;
-			pSpellSprite.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
-			pSpellSprite.uSectorID = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3);
-			pSpellSprite.uSpriteFrameID = 0;
-			pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
-			pSpellSprite.spell_target_pid = a2;
-			pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
-			pSpellSprite.uFacing = LOWORD(pParty->sRotationY);
-			pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
-			if ( pParty->bTurnBasedModeOn == 1 )
-				LOBYTE(pSpellSprite.uAttributes) |= 4u;
-
-			v659 = pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed;
-			if ( pSpellSprite.Create(pParty->sRotationY, pParty->sRotationX, v659, pCastSpell->uPlayerID + 1) != -1 && pParty->bTurnBasedModeOn == 1 )
-				++pTurnEngine->pending_actions;
-			LODWORD(v727) = 1;
-			break;
-		}
-		case SPELL_EARTH_DEATH_BLOSSOM:
-		{
-			if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
-			{
-				ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
-				pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
-				pCastSpell->uSpellID = 0;
-				continue;
-			}
-			if ( !pPlayer->CanCastSpell(uRequiredMana) )
-				break;
-			pSpellSprite.uType = 4090;
-			pSpellSprite.stru_24.Reset();
-			pSpellSprite.spell_id = pCastSpell->uSpellID;
-			pSpellSprite.spell_level = spell_level;
-			pSpellSprite.spell_skill = skill_level;
-			pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
-			pSpellSprite.vPosition.x = pParty->vPosition.x;
-			pSpellSprite.vPosition.y = pParty->vPosition.y;
-			pSpellSprite.uAttributes = 0;
-			pSpellSprite.uSectorID = 0;
-			pSpellSprite.uSpriteFrameID = 0;
-			pSpellSprite.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
-			pSpellSprite.field_60_distance_related_prolly_lod = 0;
-			pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
-			pSpellSprite.spell_target_pid = a2;
-			pSpellSprite.uFacing = LOWORD(pParty->sRotationY);
-			pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
-			if ( pParty->bTurnBasedModeOn == 1 )
-				pSpellSprite.uAttributes = 4;
-
-			v659 = pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed;
-			if ( pSpellSprite.Create(pParty->sRotationY, stru_5C6E00->uIntegerHalfPi / 2, v659, 0) != -1 && pParty->bTurnBasedModeOn == 1 )
-				++pTurnEngine->pending_actions;
-			LODWORD(v727) = 1;
-			break;
-		}
-		case SPELL_SPIRIT_DETECT_LIFE:
-		{
-			v328 = skill_level - 2;
-			if ( v328 )
-			{
-				v329 = v328 - 1;
-				if ( v329 && v329 != 1 )
-					v330 = 600 * spell_level;
-				else
-					v330 = 3600 * spell_level;
-			}
-			else
-			{
-				v330 = 1800 * spell_level;
-			}
-			LODWORD(v733) = v330;
-			if ( !pPlayer->CanCastSpell(uRequiredMana) )
-				break;
-			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0);
-			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1);
-			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2);
-			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3);
-
-			pParty->pPartyBuffs[PARTY_BUFF_DETECT_LIFE].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), skill_level, 0, 0, 0);
-			LODWORD(v727) = 1;
-			break;
-		}
-		case SPELL_SPIRIT_FATE:
-		{
-			switch (skill_level)
-			{
-				case 1: amount = 1 * spell_level; break;
-				case 2: amount = 2 * spell_level; break;
-				case 3: amount = 4 * spell_level; break;
-				case 4: amount = 6 * spell_level; break;
-				default:
-				assert(false);
-			}
-			LODWORD(v733) = 300;
-			if ( !pPlayer->CanCastSpell(uRequiredMana) )
-				break;
-			v342 = pCastSpell->spell_target_pid;
-			if ( v342 == 0 )
-			{
-				pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
-
-				pParty->pPlayers[pCastSpell->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_FATE].Apply(pParty->uTimePlayed + 1280, skill_level, amount, 0, 0);
-				LODWORD(v727) = 1;
-				break;
-			}
-			if (PID_TYPE(v342) == OBJECT_Actor)
-			{
-				v343 = PID_ID(v342);
-				HIDWORD(v344) = 0 + ((pParty->uTimePlayed + 1280) >> 32);
-				LODWORD(v344) = LODWORD(pParty->uTimePlayed) + 1280;
-				pActors[v343].pActorBuffs[ACTOR_BUFF_FATE].Apply(v344, skill_level, amount, 0, 0);
-				BYTE2(pActors[v343].uAttributes) |= 8u;
-				//v672 = 0;
-				v661 = &pActors[v343];
-				pGame->GetStru6()->_4A7E89_sparkles_on_actor_after_it_casts_buff(v661, 0);
-			}
-			LODWORD(v727) = 1;
-			break;
-		}
-		case SPELL_SPIRIT_REMOVE_CURSE:
-		{
-			switch (skill_level)
-			{
-				case 1: amount = 3600 * spell_level; break;
-				case 2: amount = 3600 * spell_level; break;
-				case 3: amount = 86400 * spell_level; break;
-				case 4: amount = 0; break;
-				default:
-				assert(false);
-			}
-			if ( !pPlayer->CanCastSpell(uRequiredMana) )
-				break;
-			v351 = &pParty->pPlayers[pCastSpell->uPlayerID_2];
-			if ( !v351->pConditions[Condition_Cursed] )
-			{
-				LODWORD(v727) = 1;
-				break;
-			}
-			if ( skill_level == 4 )
-			{
-				LODWORD(v351->pConditions[Condition_Cursed]) = 0;
-				HIDWORD(v351->pConditions[Condition_Cursed]) = 0;
-			}
-			else
-			{
-				v732 = amount << 7;
-				v351->DiscardConditionIfLastsLongerThan(0, (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335));
-				if ( HIDWORD(pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[0]) | LODWORD(pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[0]) )
-				{
-					LODWORD(v727) = 1;
-					break;
-				}
-			}
-			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
-			LODWORD(v727) = 1;
-			break;
-		}
-		case SPELL_SPIRIT_PRESERVATION:
-		{
-			if ( skill_level == 4 )
-				LODWORD(v733) = 900 * (spell_level + 4);
-			else
-				LODWORD(v733) = 300 * (spell_level + 12);
-			if ( !pPlayer->CanCastSpell(uRequiredMana) )
-				break;
-			if ( skill_level == 1 || skill_level == 2 )
-			{
-				pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
-				pParty->pPlayers[pCastSpell->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_PRESERVATION].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), skill_level, 0, 0, 0);
-				LODWORD(v727) = 1;
-				break;
-			}
-			a2 = 0;
-			v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335);
-			v357 = pParty->pPlayers.data();//[0].pPlayerBuffs[11];
-			do
-			{
-				pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, a2);
-				v357->pPlayerBuffs[PLAYER_BUFF_PRESERVATION].Apply(pParty->uTimePlayed + v717, skill_level, 0, 0, 0);
-				++a2;
-				++v357;// = (SpellBuff *)((char *)v357 + 6972);
-			}
-			while ( v357 <= &pParty->pPlayers[3] );
-			LODWORD(v727) = 1;
-			break;
-		}
-		case SPELL_SPIRIT_TURN_UNDEAD:
-		{
-			if ( skill_level == 1 || skill_level == 2)
-				LODWORD(v733) = 60 * (spell_level + 3);
-			else
-				LODWORD(v733) = 300 * spell_level + 180;
-			if ( !pPlayer->CanCastSpell(uRequiredMana) )
-				break;
-			int _v726 = pRenderer->_46А6АС_GetActorsInViewport(4096);
-			pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xFFFFFF, 192);
-			++pSpellSprite.uType;
-			pSpellSprite.stru_24.Reset();
-			pSpellSprite.spell_id = pCastSpell->uSpellID;
-			pSpellSprite.spell_level = spell_level;
-			pSpellSprite.spell_skill = skill_level;
-			pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
-			pSpellSprite.uAttributes = 0;
-			pSpellSprite.uSectorID = 0;
-			pSpellSprite.uSpriteFrameID = 0;
-			pSpellSprite.field_60_distance_related_prolly_lod = 0;
-			pSpellSprite.uFacing = 0;
-			pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
-			pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
-			for ( a2 = 0; a2 < (signed int)_v726; ++a2 )
-			{
-				v369 = &pActors[_50BF30_actors_in_viewport_ids[a2]];
-				if ( MonsterStats::BelongsToSupertype(v369->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) )
-				{
-					pSpellSprite.vPosition.x = v369->vPosition.x;
-					pSpellSprite.vPosition.y = v369->vPosition.y;
-					pSpellSprite.vPosition.z = v369->vPosition.z - (unsigned int)(signed __int64)((double)v369->uActorHeight * -0.8);
-
-					pSpellSprite.spell_target_pid = PID(OBJECT_Actor, _50BF30_actors_in_viewport_ids[a2]);
-					pSpellSprite.Create(0, 0, 0, 0);
-					v369->pActorBuffs[ACTOR_BUFF_AFRAID].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335),
-						skill_level, 0, 0, 0);
-				}
-			}
-			LODWORD(v727) = 1;
-			break;
-		}
-		case SPELL_SPIRIT_RAISE_DEAD:
-		{
-			if ( skill_level == 4 )
-				amount = 0;
-			else
-				amount = 86400 * spell_level;
-			if ( !pPlayer->CanCastSpell(uRequiredMana) )
-				break;
-			pOtherOverlayList->_4418B1(5080, pCastSpell->uPlayerID_2 + 100, 0, 65536);
-			v373 = pCastSpell->uPlayerID_2;
-			if ( !(HIDWORD(pParty->pPlayers[v373].pConditions[14]) | LODWORD(pParty->pPlayers[v373].pConditions[14])) )
-			{
-				LODWORD(v727) = 1;
-				break;
-			}
-			//v14 = skill_level == 4;
-			pParty->pPlayers[v373].sHealth = 1;
-			if ( skill_level == 4 )
-			{
-				v374 = pCastSpell->uPlayerID_2;
-				LODWORD(pParty->pPlayers[v374].pConditions[14]) = 0;
-				HIDWORD(pParty->pPlayers[v374].pConditions[14]) = 0;
-				v376 = pCastSpell->uPlayerID_2;
-				LODWORD(pParty->pPlayers[v376].pConditions[13]) = 0;
-				HIDWORD(pParty->pPlayers[v376].pConditions[13]) = 0;
-			}
-			else
-			{
-				*(float *)&a2 = (double)(amount << 7) * 0.033333335;
-				pParty->pPlayers[pCastSpell->uPlayerID_2].DiscardConditionIfLastsLongerThan(
-				0xEu,
-				(signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2));
-				pParty->pPlayers[pCastSpell->uPlayerID_2].DiscardConditionIfLastsLongerThan(
-				0xDu,
-				(signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2));
-			}
-			v377 = &pParty->pPlayers[pCastSpell->uPlayerID_2];
-			v377->SetCondition(1, 0);
-			LODWORD(v727) = 1;
-			break;
-		}
-		case SPELL_SPIRIT_SHARED_LIFE:
-		{
-			if ( skill_level == 4 )
+        if ( !pPlayer->CanCastSpell(uRequiredMana) )
+          break;
+        pSpellSprite.uType = 4090;
+        pSpellSprite.stru_24.Reset();
+        pSpellSprite.spell_id = pCastSpell->uSpellID;
+        pSpellSprite.spell_level = spell_level;
+        pSpellSprite.spell_skill = skill_level;
+        pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
+        pSpellSprite.vPosition.x = pParty->vPosition.x;
+        pSpellSprite.vPosition.y = pParty->vPosition.y;
+        pSpellSprite.uAttributes = 0;
+        pSpellSprite.uSectorID = 0;
+        pSpellSprite.uSpriteFrameID = 0;
+        pSpellSprite.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
+        pSpellSprite.field_60_distance_related_prolly_lod = 0;
+        pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
+        pSpellSprite.spell_target_pid = a2;
+        pSpellSprite.uFacing = LOWORD(pParty->sRotationY);
+        pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
+        if ( pParty->bTurnBasedModeOn == 1 )
+          pSpellSprite.uAttributes = 4;
+        v659 = pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed;
+        if ( pSpellSprite.Create(pParty->sRotationY, stru_5C6E00->uIntegerHalfPi / 2, v659, 0) != -1
+            && pParty->bTurnBasedModeOn == 1 )
+          ++pTurnEngine->pending_actions;
+        LODWORD(v727) = 1;
+        break;
+      }
+      case SPELL_SPIRIT_DETECT_LIFE: // Детектор жизни
+      {
+        switch (skill_level)
+        {
+          case 1: amount = 600 * spell_level; break;
+          case 2: amount = 1800 * spell_level; break;
+          case 3:
+          case 4: amount = 3600 * spell_level; break;
+          default:
+          assert(false);
+        }
+        if ( !pPlayer->CanCastSpell(uRequiredMana) )
+          break;
+        pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0);
+        pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1);
+        pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2);
+        pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3);
+        pParty->pPartyBuffs[PARTY_BUFF_DETECT_LIFE].Apply(pParty->uTimePlayed + 
+            (signed int)(signed __int64)((double)(signed int)((int)amount << 7) * 0.033333335), skill_level, 0, 0, 0);
+        LODWORD(v727) = 1;
+        break;
+      }
+      case SPELL_SPIRIT_FATE:// Судьба
+      {
+        switch (skill_level)
+        {
+          case 1: amount = spell_level; break;
+          case 2: amount = 2 * spell_level; break;
+          case 3: amount = 4 * spell_level; break;
+          case 4: amount = 6 * spell_level; break;
+          default:
+            assert(false);
+        }
+        //LODWORD(v733) = 300;
+        if ( !pPlayer->CanCastSpell(uRequiredMana) )
+          break;
+        if ( pCastSpell->spell_target_pid == 0 )
+        {
+          pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
+          pParty->pPlayers[pCastSpell->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_FATE].Apply(pParty->uTimePlayed + 1280, skill_level, amount, 0, 0);
+          LODWORD(v727) = 1;
+          break;
+        }
+        if (PID_TYPE(pCastSpell->spell_target_pid) == OBJECT_Actor)
+        {
+          mon_id = PID_ID(pCastSpell->spell_target_pid);
+          pActors[mon_id].pActorBuffs[ACTOR_BUFF_FATE].Apply(pParty->uTimePlayed + 1280, skill_level, amount, 0, 0);
+          pActors[mon_id].uAttributes |= 0x80000;
+          pGame->GetStru6()->_4A7E89_sparkles_on_actor_after_it_casts_buff(&pActors[mon_id], 0);
+        }
+        LODWORD(v727) = 1;
+        break;
+      }
+      case SPELL_SPIRIT_REMOVE_CURSE:// Снятие порчи
+      {
+        switch (skill_level)
+        {
+          case 1: amount = 3600 * spell_level; break;
+          case 2: amount = 3600 * spell_level; break;
+          case 3: amount = 86400 * spell_level; break;
+          case 4: amount = 0; break;
+          default:
+            assert(false);
+        }
+        if ( !pPlayer->CanCastSpell(uRequiredMana) )
+          break;
+        if ( !pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Cursed] )
+        {
+          LODWORD(v727) = 1;
+          break;
+        }
+        if ( skill_level == 4 )//GM
+          pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Cursed] = 0;
+        else
+        {
+          pParty->pPlayers[pCastSpell->uPlayerID_2].DiscardConditionIfLastsLongerThan(0,
+                (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335));
+          if ( pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Cursed] )
+          {
+            LODWORD(v727) = 1;
+            break;
+          }
+        }
+        pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
+        LODWORD(v727) = 1;
+        break;
+      }
+      case SPELL_SPIRIT_PRESERVATION://Сохранение
+      {
+        if ( skill_level == 4 )
+          duration = 900 * (spell_level + 4);
+        else
+          duration = 300 * (spell_level + 12);
+        if ( !pPlayer->CanCastSpell(uRequiredMana) )
+          break;
+        if ( skill_level == 1 || skill_level == 2 )
+        {
+          pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
+          pParty->pPlayers[pCastSpell->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_PRESERVATION].Apply(pParty->uTimePlayed +
+            (signed int)(signed __int64)((double)(signed int)((int)duration << 7) * 0.033333335), skill_level, 0, 0, 0);
+          LODWORD(v727) = 1;
+          break;
+        }
+        for ( uint pl_id = 0; pl_id < 4; pl_id++ )
+        {
+          pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pl_id);
+          pParty->pPlayers[pl_id].pPlayerBuffs[PLAYER_BUFF_PRESERVATION].Apply(pParty->uTimePlayed + 
+            (signed int)(signed __int64)((double)(signed int)((int)duration << 7) * 0.033333335), skill_level, 0, 0, 0);
+        }
+        LODWORD(v727) = 1;
+        break;
+      }
+      case SPELL_SPIRIT_TURN_UNDEAD://Бег мертвецов
+      {
+        if ( skill_level == 1 || skill_level == 2)
+          duration = 60 * (spell_level + 3);
+        else
+          duration = 300 * spell_level + 180;
+        if ( !pPlayer->CanCastSpell(uRequiredMana) )
+          break;
+        int mon_num = pRenderer->_46А6АС_GetActorsInViewport(4096);
+        pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xFFFFFF, 192);
+        ++pSpellSprite.uType;
+        pSpellSprite.stru_24.Reset();
+        pSpellSprite.spell_id = pCastSpell->uSpellID;
+        pSpellSprite.spell_level = spell_level;
+        pSpellSprite.spell_skill = skill_level;
+        pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
+        pSpellSprite.uAttributes = 0;
+        pSpellSprite.uSectorID = 0;
+        pSpellSprite.uSpriteFrameID = 0;
+        pSpellSprite.field_60_distance_related_prolly_lod = 0;
+        pSpellSprite.uFacing = 0;
+        pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
+        pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
+        for ( a2 = 0; a2 < mon_num; ++a2 )
+        {
+          if ( MonsterStats::BelongsToSupertype(pActors[_50BF30_actors_in_viewport_ids[a2]].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) )
+          {
+            pSpellSprite.vPosition.x = pActors[_50BF30_actors_in_viewport_ids[a2]].vPosition.x;
+            pSpellSprite.vPosition.y = pActors[_50BF30_actors_in_viewport_ids[a2]].vPosition.y;
+            pSpellSprite.vPosition.z = pActors[_50BF30_actors_in_viewport_ids[a2]].vPosition.z - (unsigned int)(signed __int64)((double)pActors[_50BF30_actors_in_viewport_ids[a2]].uActorHeight * -0.8);
+            pSpellSprite.spell_target_pid = PID(OBJECT_Actor, _50BF30_actors_in_viewport_ids[a2]);
+            pSpellSprite.Create(0, 0, 0, 0);
+            pActors[_50BF30_actors_in_viewport_ids[a2]].pActorBuffs[ACTOR_BUFF_AFRAID].Apply(pParty->uTimePlayed + 
+                      (signed __int64)((double)(signed int)((int)duration << 7) * 0.033333335), skill_level, 0, 0, 0);
+          }
+        }
+        LODWORD(v727) = 1;
+        break;
+      }
+      case SPELL_SPIRIT_RAISE_DEAD://Оживление
+      {
+        if ( skill_level == 4 )
+          amount = 0;
+        else
+          amount = 86400 * spell_level;
+        if ( !pPlayer->CanCastSpell(uRequiredMana) )
+          break;
+        pOtherOverlayList->_4418B1(5080, pCastSpell->uPlayerID_2 + 100, 0, 65536);
+        if ( !pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Dead] )
+        {
+          LODWORD(v727) = 1;
+          break;
+        }
+        pParty->pPlayers[pCastSpell->uPlayerID_2].sHealth = 1;
+        if ( skill_level == 4 )
+        {
+          pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Dead] = 0;
+          pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Unconcious] = 0;
+        }
+        else
+        {
+          pParty->pPlayers[pCastSpell->uPlayerID_2].DiscardConditionIfLastsLongerThan(Condition_Dead,
+            (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335));
+          pParty->pPlayers[pCastSpell->uPlayerID_2].DiscardConditionIfLastsLongerThan(Condition_Unconcious,
+            (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335));
+        }
+        pParty->pPlayers[pCastSpell->uPlayerID_2].SetCondition(Condition_Weak, 0);
+        LODWORD(v727) = 1;
+        break;
+      }
+      case SPELL_SPIRIT_SHARED_LIFE://
+      {
+        if ( skill_level == 4 )
 				amount = 4 * spell_level;
 			else
 				amount = 3 * spell_level;
--- a/Game.cpp	Fri Jan 24 18:01:51 2014 +0600
+++ b/Game.cpp	Mon Jan 27 00:13:01 2014 +0600
@@ -3091,7 +3091,7 @@
           {
             pPlayer9->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * (double)sRecoveryTime * 2.133333333333333));
           }
-          pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[dword_506338], 0, 0, -1, 0, dword_50633C, 0, 0);
+          pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[lloyds_beacon_spell_id], 0, 0, -1, 0, lloyds_beacon_sound_id, 0, 0);
           if ( bRecallingBeacon )
           {
             if ( _stricmp(pCurrentMapName, (const char *)&pGames_LOD->pSubIndices[pPlayer9->pInstalledBeacons[uMessageParam].SaveFileID]) )
@@ -3128,7 +3128,7 @@
             sprintf(a1, "data\\lloyd%d%d.pcx", _506348_current_lloyd_playerid + 1, uMessageParam + 1);
             pRenderer->SaveScreenshot(a1, 92, 68);
             LoadThumbnailLloydTexture(uMessageParam, _506348_current_lloyd_playerid + 1);
-            pPlayer9->pInstalledBeacons[uMessageParam].uBeaconTime = pParty->uTimePlayed + (signed __int64)((double)(qword_506350 << 7) * 0.033333335);
+            pPlayer9->pInstalledBeacons[uMessageParam].uBeaconTime = pParty->uTimePlayed + (signed __int64)((double)(lloyds_beacon_spell_level << 7) * 0.033333335);
             pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_X = pParty->vPosition.x;
             pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Y = pParty->vPosition.y;
             pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Z = pParty->vPosition.z;
@@ -3612,10 +3612,10 @@
           }
           else
           {
-            pParty->pPlayers[3].pConditions[2] = pParty->uTimePlayed;
-            pParty->pPlayers[2].pConditions[2] = pParty->uTimePlayed;
-            pParty->pPlayers[1].pConditions[2] = pParty->uTimePlayed;
-            pParty->pPlayers[0].pConditions[2] = pParty->uTimePlayed;
+            pParty->pPlayers[3].pConditions[Condition_Sleep] = pParty->uTimePlayed;
+            pParty->pPlayers[2].pConditions[Condition_Sleep] = pParty->uTimePlayed;
+            pParty->pPlayers[1].pConditions[Condition_Sleep] = pParty->uTimePlayed;
+            pParty->pPlayers[0].pConditions[Condition_Sleep] = pParty->uTimePlayed;
             v90 = pMapStats->GetMapInfo(pCurrentMapName);
             if ( !v90 )
               v90 = rand() % (signed int)pMapStats->uNumMaps + 1;
@@ -3634,8 +3634,7 @@
               if ( pNPCData4 )
               {
                 pPlayerNum = rand() % 4;
-                LODWORD(pParty->pPlayers[pPlayerNum].pConditions[2]) = 0;
-                HIDWORD(pParty->pPlayers[pPlayerNum].pConditions[2]) = 0;
+                pParty->pPlayers[pPlayerNum].pConditions[Condition_Sleep] = 0;
                 v95 = rand();
                 Rest(v95 % 6 + 60);
                 _506F18_num_minutes_to_sleep = 0;
--- a/OSWindow.cpp	Fri Jan 24 18:01:51 2014 +0600
+++ b/OSWindow.cpp	Mon Jan 27 00:13:01 2014 +0600
@@ -710,24 +710,24 @@
         pParty->pPlayers[i].uSkillPoints = 50;
     break;
         
-    case 40029:  pPlayers[uActiveCharacter]->SetPertified(true);  break;
-    case 40030:  pPlayers[uActiveCharacter]->SetWeak(true);       break;
-    case 40031:  pPlayers[uActiveCharacter]->SetPoison3(true);    break;
-    case 40032:  pPlayers[uActiveCharacter]->SetPoison2(true);    break;
-    case 40033:  pPlayers[uActiveCharacter]->SetPoison1(true);    break;
-    case 40034:  pPlayers[uActiveCharacter]->SetDisease3(true);   break;
-    case 40035:  pPlayers[uActiveCharacter]->SetDisease2(true);   break;
-    case 40036:  pPlayers[uActiveCharacter]->SetDisease1(true);   break;
-    case 40037:  pPlayers[uActiveCharacter]->SetCursed(true);     break;
-    case 40038:  pPlayers[uActiveCharacter]->SetInsane(true);     break;
-    case 40039:  pPlayers[uActiveCharacter]->SetDrunk(true);      break;
-    case 40040:  pPlayers[uActiveCharacter]->SetUnconcious(true); break;
-    case 40041:  pPlayers[uActiveCharacter]->SetDead(true);       break;
-    case 40042:  pPlayers[uActiveCharacter]->SetEradicated(true); break;
-    case 40043:  pPlayers[uActiveCharacter]->SetAsleep(true);     break;
-    case 40044:  pPlayers[uActiveCharacter]->SetAfraid(true);     break;
-    case 40045:  pPlayers[uActiveCharacter]->SetParalyzed(true);  break;
-    case 40073:  pPlayers[uActiveCharacter]->SetZombie(true);     break;
+    case 40029:  pPlayers[uActiveCharacter]->SetPertified(pParty->uTimePlayed);  break;
+    case 40030:  pPlayers[uActiveCharacter]->SetWeak(pParty->uTimePlayed);       break;
+    case 40031:  pPlayers[uActiveCharacter]->SetPoison3(pParty->uTimePlayed);    break;
+    case 40032:  pPlayers[uActiveCharacter]->SetPoison2(pParty->uTimePlayed);    break;
+    case 40033:  pPlayers[uActiveCharacter]->SetPoison1(pParty->uTimePlayed);    break;
+    case 40034:  pPlayers[uActiveCharacter]->SetDisease3(pParty->uTimePlayed);   break;
+    case 40035:  pPlayers[uActiveCharacter]->SetDisease2(pParty->uTimePlayed);   break;
+    case 40036:  pPlayers[uActiveCharacter]->SetDisease1(pParty->uTimePlayed);   break;
+    case 40037:  pPlayers[uActiveCharacter]->SetCursed(pParty->uTimePlayed);     break;
+    case 40038:  pPlayers[uActiveCharacter]->SetInsane(pParty->uTimePlayed);     break;
+    case 40039:  pPlayers[uActiveCharacter]->SetDrunk(pParty->uTimePlayed);      break;
+    case 40040:  pPlayers[uActiveCharacter]->SetUnconcious(pParty->uTimePlayed); break;
+    case 40041:  pPlayers[uActiveCharacter]->SetDead(pParty->uTimePlayed);       break;
+    case 40042:  pPlayers[uActiveCharacter]->SetEradicated(pParty->uTimePlayed); break;
+    case 40043:  pPlayers[uActiveCharacter]->SetAsleep(pParty->uTimePlayed);     break;
+    case 40044:  pPlayers[uActiveCharacter]->SetAfraid(pParty->uTimePlayed);     break;
+    case 40045:  pPlayers[uActiveCharacter]->SetParalyzed(pParty->uTimePlayed);  break;
+    case 40073:  pPlayers[uActiveCharacter]->SetZombie(pParty->uTimePlayed);     break;
 
     case 40062:
       pParty->alignment = PartyAlignment_Good;
--- a/Player.cpp	Fri Jan 24 18:01:51 2014 +0600
+++ b/Player.cpp	Mon Jan 27 00:13:01 2014 +0600
@@ -7718,92 +7718,92 @@
   return pConditions[Condition_Drunk] != 0;
 }
 
-void Player::SetCursed( bool state )
+void Player::SetCursed( unsigned long long state )
 {
   pConditions[Condition_Cursed] = state;
 }
 
-void Player::SetWeak( bool state )
+void Player::SetWeak( unsigned long long state )
 {
   pConditions[Condition_Weak] = state;
 }
 
-void Player::SetAsleep( bool state )
+void Player::SetAsleep( unsigned long long state )
 {
   pConditions[Condition_Sleep] = state;
 }
 
-void Player::SetAfraid( bool state )
+void Player::SetAfraid( unsigned long long state )
 {
   pConditions[Condition_Fear] = state;
 }
 
-void Player::SetDrunk( bool state )
+void Player::SetDrunk( unsigned long long state )
 {
   pConditions[Condition_Drunk] = state;
 }
 
-void Player::SetInsane( bool state )
+void Player::SetInsane( unsigned long long state )
 {
   pConditions[Condition_Insane] = state;
 }
 
-void Player::SetPoison1( bool state )
+void Player::SetPoison1( unsigned long long state )
 {
   pConditions[Condition_Poison1] = state;
 }
 
-void Player::SetDisease1( bool state )
+void Player::SetDisease1( unsigned long long state )
 {
   pConditions[Condition_Disease1] = state;
 }
 
-void Player::SetPoison2( bool state )
+void Player::SetPoison2( unsigned long long state )
 {
   pConditions[Condition_Poison2] = state;
 }
 
-void Player::SetDisease2( bool state )
+void Player::SetDisease2( unsigned long long state )
 {
   pConditions[Condition_Disease2] = state;
 }
 
-void Player::SetPoison3( bool state )
+void Player::SetPoison3( unsigned long long state )
 {
   pConditions[Condition_Poison3] = state;
 }
 
-void Player::SetDisease3( bool state )
+void Player::SetDisease3( unsigned long long state )
 {
   pConditions[Condition_Disease3] = state;
 }
 
-void Player::SetParalyzed( bool state )
+void Player::SetParalyzed( unsigned long long state )
 {
   pConditions[Condition_Paralyzed] = state;
 }
 
-void Player::SetUnconcious( bool state )
+void Player::SetUnconcious( unsigned long long state )
 {
   pConditions[Condition_Unconcious] = state;
 }
 
-void Player::SetDead( bool state )
+void Player::SetDead( unsigned long long state )
 {
   pConditions[Condition_Dead] = state;
 }
 
-void Player::SetPertified( bool state )
+void Player::SetPertified( unsigned long long state )
 {
   pConditions[Condition_Pertified] = state;
 }
 
-void Player::SetEradicated( bool state )
+void Player::SetEradicated( unsigned long long state )
 {
   pConditions[Condition_Eradicated] = state;
 }
 
-void Player::SetZombie( bool state )
+void Player::SetZombie( unsigned long long state )
 {
   pConditions[Condition_Zombie] = state;
 }
--- a/Player.h	Fri Jan 24 18:01:51 2014 +0600
+++ b/Player.h	Mon Jan 27 00:13:01 2014 +0600
@@ -626,24 +626,24 @@
   bool IsParalyzed();
   bool IsDrunk();
 
-  void SetCursed(bool state);
-  void SetWeak(bool state);
-  void SetAsleep(bool state);
-  void SetAfraid(bool state);
-  void SetDrunk(bool state);
-  void SetInsane(bool state);
-  void SetPoison1(bool state);
-  void SetDisease1(bool state);
-  void SetPoison2(bool state);
-  void SetDisease2(bool state);
-  void SetPoison3(bool state);
-  void SetDisease3(bool state);
-  void SetParalyzed(bool state);
-  void SetUnconcious(bool state);
-  void SetDead(bool state);
-  void SetPertified(bool state);
-  void SetEradicated(bool state);
-  void SetZombie(bool state);
+  void SetCursed(unsigned long long state);
+  void SetWeak(unsigned long long state);
+  void SetAsleep(unsigned long long state);
+  void SetAfraid(unsigned long long state);
+  void SetDrunk(unsigned long long state);
+  void SetInsane(unsigned long long state);
+  void SetPoison1(unsigned long long state);
+  void SetDisease1(unsigned long long state);
+  void SetPoison2(unsigned long long state);
+  void SetDisease2(unsigned long long state);
+  void SetPoison3(unsigned long long state);
+  void SetDisease3(unsigned long long state);
+  void SetParalyzed(unsigned long long state);
+  void SetUnconcious(unsigned long long state);
+  void SetDead(unsigned long long state);
+  void SetPertified(unsigned long long state);
+  void SetEradicated(unsigned long long state);
+  void SetZombie(unsigned long long state);
 
   void SetCondWeakWithBlockCheck (int blockable);
   void SetCondInsaneWithBlockCheck (int blockable);
--- a/UI/UIHouses.cpp	Fri Jan 24 18:01:51 2014 +0600
+++ b/UI/UIHouses.cpp	Mon Jan 27 00:13:01 2014 +0600
@@ -2283,7 +2283,7 @@
     pPlayers[uActiveCharacter]->sMana = pPlayers[uActiveCharacter]->GetMaxMana();
     if ( (signed int)window_SpeakInHouse->ptr_1C != 78 && ((signed int)window_SpeakInHouse->ptr_1C <= 80 || (signed int)window_SpeakInHouse->ptr_1C > 82) )
     {
-      if ( (unsigned int)pPlayers[uActiveCharacter]->pConditions[Condition_Zombie] | v35 )
+      if ( (unsigned int)pPlayers[uActiveCharacter]->pConditions[Condition_Zombie] | v35 )// если состояние зомби
       {
         pPlayers[uActiveCharacter]->uCurrentFace = pPlayers[uActiveCharacter]->uPrevFace;
         pPlayers[uActiveCharacter]->uVoiceID = pPlayers[uActiveCharacter]->uPrevVoiceID;
@@ -2296,9 +2296,7 @@
       return;
     }
     if ( (unsigned int)pPlayers[uActiveCharacter]->pConditions[Condition_Zombie] | v35 )
-    {
       LODWORD(pPlayers[uActiveCharacter]->pConditions[Condition_Zombie]) = v35;
-    }
     else
     {
       if ( !pPlayers[uActiveCharacter]->pConditions[Condition_Eradicated]
@@ -2312,15 +2310,15 @@
       }
       pPlayers[uActiveCharacter]->uPrevFace = pPlayers[uActiveCharacter]->uCurrentFace;
       pPlayers[uActiveCharacter]->uPrevVoiceID = pPlayers[uActiveCharacter]->uVoiceID;
-      pPlayers[uActiveCharacter]->SetCondition(0x11u, 1);
+      pPlayers[uActiveCharacter]->SetCondition(Condition_Zombie, 1);
       pPlayers[uActiveCharacter]->uVoiceID = (pPlayers[uActiveCharacter]->GetSexByVoice() != 0) + 23;
       pPlayers[uActiveCharacter]->uCurrentFace = (pPlayers[uActiveCharacter]->GetSexByVoice() != 0) + 23;
       ReloadPlayerPortraits(uActiveCharacter - 1, (pPlayers[uActiveCharacter]->GetSexByVoice() != 0) + 23);
-      LODWORD(pPlayers[uActiveCharacter]->pConditions[Condition_Zombie]) = LODWORD(pParty->uTimePlayed);
+      pPlayers[uActiveCharacter]->pConditions[Condition_Zombie] = pParty->uTimePlayed;
       //v39 = (GUIWindow *)HIDWORD(pParty->uTimePlayed);
     }
     //HIDWORD(pPlayers[uActiveCharacter]->pConditions[Condition_Zombie]) = (int)v39;
-    pPlayers[uActiveCharacter]->pConditions[Condition_Zombie] =pParty->uTimePlayed;
+    pPlayers[uActiveCharacter]->pConditions[Condition_Zombie] = pParty->uTimePlayed;
     pAudioPlayer->PlaySound((SoundID)(SOUND_GoldReceived|0x2), -1, 0, -1, 0, 0, 0, 0);
     pPlayers[uActiveCharacter]->PlaySound(SPEECH_82, 0);
     pOtherOverlayList->_4418B1(20, uActiveCharacter + 99, 0, 65536);
--- a/UI/UIPopup.cpp	Fri Jan 24 18:01:51 2014 +0600
+++ b/UI/UIPopup.cpp	Mon Jan 27 00:13:01 2014 +0600
@@ -1934,7 +1934,7 @@
     if ( damage_level == 4 )
     {
       pPlayers[uActiveCharacter]->RemoveItemAtInventoryIndex(pOut_y);
-      pPlayers[uActiveCharacter]->SetCondition(0x10u, 0);
+      pPlayers[uActiveCharacter]->SetCondition(Condition_Eradicated, 0);
       pPlayers[uActiveCharacter]->ItemsEnchant(0);
       pAudioPlayer->PlaySound(SOUND_8, 0, 0, -1, 0, 0, 0, 0);
 
--- a/mm7_2.cpp	Fri Jan 24 18:01:51 2014 +0600
+++ b/mm7_2.cpp	Mon Jan 27 00:13:01 2014 +0600
@@ -5204,7 +5204,7 @@
         else
           v78 = (signed __int16)pSpriteObjects[uLayingItemID].uSoundID + 4;
         v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id - 1] + 1;
-        pAudioPlayer->PlaySound((SoundID)v125, pSpriteObjects[uLayingItemID].vPosition.x, v66, -1, v66, v78, v66, v66);
+        pAudioPlayer->PlaySound((SoundID)v125, pSpriteObjects[uLayingItemID].vPosition.x, 0, -1, 0, v78, 0, 0);
         return 0;
       }
       if ( pSpriteObjects[uLayingItemID].uType == 4090 )
--- a/mm7_data.cpp	Fri Jan 24 18:01:51 2014 +0600
+++ b/mm7_data.cpp	Mon Jan 27 00:13:01 2014 +0600
@@ -770,12 +770,12 @@
 std::array<unsigned int, 480> pSRZBufferLineOffsets;
 int areWeLoadingTexture; // weak
 std::array<char, 777> books_num_items_per_page; // weak
-int dword_506338; // weak
-int dword_50633C; // idb
+int lloyds_beacon_spell_id; // dword_506338
+int lloyds_beacon_sound_id; // dword_50633C
 signed int sRecoveryTime; // idb
 unsigned int uRequiredMana; // idb
 int _506348_current_lloyd_playerid; // weak
-__int64 qword_506350; // weak
+__int64 lloyds_beacon_spell_level; // qword_506350
 char byte_506360; // weak
 int dword_506364; // weak
 unsigned int uExitCancelTextureId;
--- a/mm7_data.h	Fri Jan 24 18:01:51 2014 +0600
+++ b/mm7_data.h	Mon Jan 27 00:13:01 2014 +0600
@@ -392,12 +392,12 @@
 extern std::array<unsigned int, 480> pSRZBufferLineOffsets;
 extern int areWeLoadingTexture; // weak
 extern std::array<char, 777> books_num_items_per_page; // weak
-extern int dword_506338; // weak
-extern int dword_50633C; // idb
+extern int lloyds_beacon_spell_id; // dword_506338
+extern int lloyds_beacon_sound_id; // dword_50633C
 extern signed int sRecoveryTime; // idb
 extern unsigned int uRequiredMana; // idb
 extern int _506348_current_lloyd_playerid; // weak
-extern __int64 qword_506350; // weak
+extern __int64 lloyds_beacon_spell_level; // qword_506350
 extern char byte_506360; // weak
 extern int dword_506364; // weak
 //extern Texture *dword_50640C[]; // weak