changeset 569:f451efdb7c8b

* Party buff icons drawing (right panel) * Water Walk works & draws * Fly works & draws * Invisibility sfx works * Some player buff icons draw
author Nomad
date Tue, 05 Mar 2013 16:14:22 +0200
parents 6f7d936edc9b
children f54481c85df8 7c0763248a87
files Events.cpp Game.cpp Indoor.cpp Overlays.cpp Overlays.h Party.h Player.cpp mm7_1.cpp mm7_2.cpp mm7_3.cpp mm7_4.cpp mm7_6.cpp mm7_data.cpp mm7_data.h
diffstat 14 files changed, 304 insertions(+), 301 deletions(-) [+]
line wrap: on
line diff
--- a/Events.cpp	Tue Mar 05 04:30:20 2013 +0200
+++ b/Events.cpp	Tue Mar 05 16:14:22 2013 +0200
@@ -601,7 +601,7 @@
 						{
 						sub_4BD8B5();
 						window_SpeakInHouse->Release();
-						pParty->uFlags &= 0xFFFFFFFDu;
+						pParty->uFlags &= ~2;
 						if ( EnterHouse(HOUSE_DARK_GUILD_PIT) )
 							{
 							pAudioPlayer->StopChannels(-1, -1);
@@ -702,7 +702,7 @@
 						sub_4BD8B5();
 						pVideoPlayer->Unload();
 						window_SpeakInHouse->Release();
-						pParty->uFlags &= 0xFFFFFFFDu;
+						pParty->uFlags &= ~2;
 						activeLevelDecoration = (LevelDecoration*)1;
 						if ( EnterHouse(HOUSE_BODY_GUILD_ERATHIA) )
 							{
--- a/Game.cpp	Tue Mar 05 04:30:20 2013 +0200
+++ b/Game.cpp	Tue Mar 05 16:14:22 2013 +0200
@@ -113,8 +113,7 @@
       if (pRenderer->pRenderD3D)
       {
         pDecalBuilder->DrawBloodsplats();
-        if (pRenderer->pRenderD3D)
-          pGame->pLightmapBuilder->DrawLightmaps(2);
+        pGame->pLightmapBuilder->DrawLightmaps(2);
       }
     }
   }
@@ -164,7 +163,7 @@
   if ( !pVideoPlayer->AnyMovieLoaded() )
   {
     pStru6Instance->DrawPlayerBuffAnims();
-    pOtherOverlayList->_441964(v4);
+    pOtherOverlayList->DrawTurnBasedIcon(v4);
     GameUI_DrawTorchlightAndWizardEye();
   }
   GUI_UpdateWindows();
@@ -178,7 +177,7 @@
   pMouse->_469E1C();
   pRenderer->EndScene();
   pRenderer->Present();
-  pParty->uFlags &= 0xFFFFFFFDu;
+  pParty->uFlags &= ~2;
 }
 
 
@@ -399,7 +398,7 @@
       while ( (signed int)pPlayer < (signed int)pParty->pHirelings );
       pParty->field_764 = 0;
       pParty->uTimePlayed += 0x276000ui64;
-      LOWORD(pParty->uFlags) &= 0xFDFBu;
+      LOWORD(pParty->uFlags) &= ~0x204;
       pParty->SetGold(0);
       pOtherOverlay = pOtherOverlayList->pOverlays;
       v8 = 50;
--- a/Indoor.cpp	Tue Mar 05 04:30:20 2013 +0200
+++ b/Indoor.cpp	Tue Mar 05 16:14:22 2013 +0200
@@ -390,7 +390,7 @@
   _this.uTargetHeight = 480;
   _this.pTargetZ = pRenderer->pActiveZBuffer;
   sub_440BED(&_this);
-  pParty->uFlags &= 0xFFFFFFFDu;
+  pParty->uFlags &= ~2;
   pGame->DrawParticles();
   array_5118E8._440F07();
 }
--- a/Overlays.cpp	Tue Mar 05 04:30:20 2013 +0200
+++ b/Overlays.cpp	Tue Mar 05 16:14:22 2013 +0200
@@ -10,6 +10,7 @@
 #include "TurnEngine.h"
 #include "LOD.h"
 #include "Render.h"
+#include "GUIWindow.h"
 
 #include "mm7_data.h"
 
@@ -87,7 +88,7 @@
 }
 
 //----- (00441964) --------------------------------------------------------
-unsigned int OtherOverlayList::_441964(int a2)
+void OtherOverlayList::DrawTurnBasedIcon(int a2)
 {
   unsigned int result; // eax@1
   IconFrameTable *v3; // ecx@6
@@ -96,10 +97,9 @@
   int v6; // [sp-4h] [bp-8h]@4
   Texture *v7; // [sp-4h] [bp-8h]@14
 
-  result = pCurrentScreen;
-  if ( pCurrentScreen
-    || pParty->bTurnBasedModeOn != 1 )
-    return result;
+  if ( pCurrentScreen != SCREEN_GAME || !pParty->bTurnBasedModeOn)
+    return;
+
   if ( pTurnEngine->field_4 == 3 )
   {
     v6 = pEventTimer->uStartTime;
@@ -142,7 +142,6 @@
     if ( (signed int)result >= dword_50C998_turnbased_icon_1A )
       dword_50C998_turnbased_icon_1A = 0;
   }
-  return result;
 }
 // 4E28F8: using guessed type int pCurrentScreen;
 // 50C994: using guessed type int dword_50C994;
--- a/Overlays.h	Tue Mar 05 04:30:20 2013 +0200
+++ b/Overlays.h	Tue Mar 05 16:14:22 2013 +0200
@@ -30,7 +30,7 @@
     
   int _4418B1(int a2, int a3, int a4, int a5);
   int _4418B6(int uOverlayID, __int16 a3, int a4, int a5, __int16 a6);
-  unsigned int _441964(int a2);
+  void DrawTurnBasedIcon(int a2);
 
   OtherOverlay pOverlays[50];
   int field_3E8;
--- a/Party.h	Tue Mar 05 04:30:20 2013 +0200
+++ b/Party.h	Tue Mar 05 16:14:22 2013 +0200
@@ -16,8 +16,10 @@
 /*  355 */
 enum PARTY_FLAGS_1: __int32
 {
+  PARTY_FLAGS_1_FALLING = 0x0008,
   PARTY_FLAGS_1_ALERT_RED = 0x0010,
   PARTY_FLAGS_1_ALERT_YELLOW = 0x0020,
+  PARTY_FLAGS_1_STANDING_ON_WATER = 0x0080,
   PARTY_FLAGS_1_LANDING = 0x0100,
 };
 enum PARTY_FLAGS_2: __int32
--- a/Player.cpp	Tue Mar 05 04:30:20 2013 +0200
+++ b/Player.cpp	Tue Mar 05 16:14:22 2013 +0200
@@ -6497,13 +6497,51 @@
         spellbook.pFireSpellbook.bIsSpellAvailable[1] = true;
         spellbook.pFireSpellbook.bIsSpellAvailable[2] = true;
         spellbook.pFireSpellbook.bIsSpellAvailable[3] = true;
+        spellbook.pFireSpellbook.bIsSpellAvailable[4] = true;
+        spellbook.pFireSpellbook.bIsSpellAvailable[5] = true;
+        spellbook.pFireSpellbook.bIsSpellAvailable[6] = true;
+        spellbook.pFireSpellbook.bIsSpellAvailable[7] = true;
+          spellbook.pAirSpellbook.bIsSpellAvailable[1] = true;
+          spellbook.pAirSpellbook.bIsSpellAvailable[2] = true;
+          spellbook.pAirSpellbook.bIsSpellAvailable[3] = true;
+          spellbook.pAirSpellbook.bIsSpellAvailable[4] = true;
+          spellbook.pAirSpellbook.bIsSpellAvailable[5] = true;
+          spellbook.pAirSpellbook.bIsSpellAvailable[6] = true;
+          spellbook.pAirSpellbook.bIsSpellAvailable[7] = true;
+          spellbook.pAirSpellbook.bIsSpellAvailable[8] = true;
+          spellbook.pAirSpellbook.bIsSpellAvailable[9] = true;
+          spellbook.pAirSpellbook.bIsSpellAvailable[10] = true;
+    pActiveSkills[PLAYER_SKILL_WATER] = 1;
+          spellbook.pWaterSpellbook.bIsSpellAvailable[0] = true;
+          spellbook.pWaterSpellbook.bIsSpellAvailable[1] = true;
+          spellbook.pWaterSpellbook.bIsSpellAvailable[2] = true;
+          spellbook.pWaterSpellbook.bIsSpellAvailable[3] = true;
+          spellbook.pWaterSpellbook.bIsSpellAvailable[4] = true;
+          spellbook.pWaterSpellbook.bIsSpellAvailable[5] = true;
         break;
       case PLAYER_SKILL_AIR:    spellbook.pAirSpellbook.bIsSpellAvailable[0] = true;    break;
       case PLAYER_SKILL_WATER:  spellbook.pWaterSpellbook.bIsSpellAvailable[0] = true;  break;
       case PLAYER_SKILL_EARTH:  spellbook.pEarthSpellbook.bIsSpellAvailable[0] = true;  break;
       case PLAYER_SKILL_SPIRIT: spellbook.pSpiritSpellbook.bIsSpellAvailable[0] = true; break;
       case PLAYER_SKILL_MIND:   spellbook.pMindSpellbook.bIsSpellAvailable[0] = true;   break;
-      case PLAYER_SKILL_BODY:   spellbook.pBodySpellbook.bIsSpellAvailable[0] = true;   break;
+      case PLAYER_SKILL_BODY:   spellbook.pBodySpellbook.bIsSpellAvailable[0] = true;
+        spellbook.pBodySpellbook.bIsSpellAvailable[1] = true;
+        spellbook.pBodySpellbook.bIsSpellAvailable[2] = true;
+        spellbook.pBodySpellbook.bIsSpellAvailable[3] = true;
+        spellbook.pBodySpellbook.bIsSpellAvailable[4] = true;
+        spellbook.pBodySpellbook.bIsSpellAvailable[5] = true;
+        spellbook.pBodySpellbook.bIsSpellAvailable[6] = true;
+        spellbook.pBodySpellbook.bIsSpellAvailable[7] = true;
+        spellbook.pBodySpellbook.bIsSpellAvailable[8] = true;
+        spellbook.pBodySpellbook.bIsSpellAvailable[9] = true;
+    pActiveSkills[PLAYER_SKILL_SPIRIT] = 1;
+        spellbook.pSpiritSpellbook.bIsSpellAvailable[1] = true;
+        spellbook.pSpiritSpellbook.bIsSpellAvailable[2] = true;
+        spellbook.pSpiritSpellbook.bIsSpellAvailable[3] = true;
+        spellbook.pSpiritSpellbook.bIsSpellAvailable[4] = true;
+        spellbook.pSpiritSpellbook.bIsSpellAvailable[5] = true;
+        spellbook.pSpiritSpellbook.bIsSpellAvailable[6] = true;
+        break;
       case PLAYER_SKILL_LIGHT:  spellbook.pLightSpellbook.bIsSpellAvailable[0] = true;  break;
       case PLAYER_SKILL_DARK:   spellbook.pDarkSpellbook.bIsSpellAvailable[0] = true;   break;
     }
--- a/mm7_1.cpp	Tue Mar 05 04:30:20 2013 +0200
+++ b/mm7_1.cpp	Tue Mar 05 16:14:22 2013 +0200
@@ -1246,29 +1246,25 @@
       CharacterUI_DrawPaperdoll(v1);
   }
 }
-// 507CC0: using guessed type int dword_507CC0;
-// 5118E0: using guessed type int bRingsShownInCharScreen;
 
 //----- (0041AD6E) --------------------------------------------------------
 void __cdecl GameUI_DrawRightPanelItems()
 {
-  if ( (signed int)((pParty->uTimePlayed - qword_507CC8) >> 32) <= 0 && (((pParty->uTimePlayed - qword_507CC8) >> 32) & 0x80000000u) != 0i64 )
-    qword_507CC8 = 0i64;
-  if ( (((pParty->uTimePlayed - qword_507CC8) >> 32) & 0x80000000u) == 0i64
-    && (!(SHIDWORD(pParty->uTimePlayed) < (LODWORD(pParty->uTimePlayed) < (unsigned int)qword_507CC8)
-                                       + HIDWORD(qword_507CC8) | (pParty->uTimePlayed - qword_507CC8) >> 32 == 0)
-     || (unsigned int)(LODWORD(pParty->uTimePlayed) - qword_507CC8) > 0x80) )
+  if (GameUI_RightPanel_BookFlashTimer > pParty->uTimePlayed)
+    GameUI_RightPanel_BookFlashTimer = 0;
+
+  if (pParty->uTimePlayed - GameUI_RightPanel_BookFlashTimer > 128)
   {
-    qword_507CC8 = pParty->uTimePlayed;
+    GameUI_RightPanel_BookFlashTimer = pParty->uTimePlayed;
     byte_50697C = byte_50697C == 0;
     if ( byte_50697C && pCurrentScreen != SCREEN_REST )
     {
       if ( bFlashQuestBook )
-        pRenderer->DrawTextureTransparent(493, 355, (Texture *)(uTextureID_ib_td1_A != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_ib_td1_A] : 0));
+        pRenderer->DrawTextureTransparent(493, 355, pIcons_LOD->GetTexture(uTextureID_ib_td1_A));
       if ( bFlashAutonotesBook )
-        pRenderer->DrawTextureTransparent(527, 353, (Texture *)(uTextureID_ib_td2_A != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_ib_td2_A] : 0));
+        pRenderer->DrawTextureTransparent(527, 353, pIcons_LOD->GetTexture(uTextureID_ib_td2_A));
       if ( bFlashHistoryBook )
-        pRenderer->DrawTextureTransparent(600, 361, (Texture *)(uTextureID_ib_td5_A != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_ib_td5_A] : 0));
+        pRenderer->DrawTextureTransparent(600, 361, pIcons_LOD->GetTexture(uTextureID_ib_td5_A));
     }
     else
     {
@@ -1281,19 +1277,15 @@
 //----- (0041AEBB) --------------------------------------------------------
 void __cdecl GameUI_DrawFoodAndGold()
 {
-  unsigned int v0; // ebx@2
-  unsigned int v1; // ebp@2
   int v2; // esi@2
 
   if ( uGameState != GAME_STATE_FINAL_WINDOW )
   {
-    v0 = uGameUIFontMain;
-    v1 = uGameUIFontShadow;
     v2 = sub_44100D() != 0 ? 381 : 322;
     sprintf(pTmpBuf, "\r087%lu", pParty->uNumFoodRations);
-    pPrimaryWindow->DrawText(pFontSmallnum, 0, v2, v0, pTmpBuf, 0, 0, v1);
+    pPrimaryWindow->DrawText(pFontSmallnum, 0, v2, uGameUIFontMain, pTmpBuf, 0, 0, uGameUIFontShadow);
     sprintf(pTmpBuf, "\r028%lu", pParty->uNumGold);
-    pPrimaryWindow->DrawText(pFontSmallnum, 0, v2, v0, pTmpBuf, 0, 0, v1);
+    pPrimaryWindow->DrawText(pFontSmallnum, 0, v2, uGameUIFontMain, pTmpBuf, 0, 0, uGameUIFontShadow);
   }
 }
 
@@ -1772,7 +1764,7 @@
                  (uTextureID_Btn_GameSettings != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_GameSettings].uTextureWidth : 24),
                  (uTextureID_Btn_GameSettings != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_GameSettings].uTextureHeight : 26),
                  1, 0, 0x6Bu, 0, 0, pGlobalTXT_LocalizationStrings[93],
-                 (Texture *)(uTextureID_Btn_GameSettings != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings] : 0), 0);
+                 (Texture *)(uTextureID_Btn_GameSettings != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_GameSettings] : 0), 0);
   pBtn_NPCLeft = pPrimaryWindow->CreateButton(0x1D5u, 0xB2u,
                  (uTextureID_Btn_NPCLeft != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft].uTextureWidth : 24),
                  (uTextureID_Btn_NPCLeft != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft].uTextureHeight : 26),
@@ -1783,7 +1775,7 @@
                  (uTextureID_Btn_NPCRight != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCRight].uTextureHeight : 26),
                  1, 0, 0xBCu, 1u, 0, "",
                  (Texture *)(uTextureID_Btn_NPCRight != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_NPCRight] : 0), 0);
-  Load_isn_spells_21_27();
+  LoadPartyBuffIcons();
 }
 
 
@@ -5292,7 +5284,7 @@
   {
     if ( pParty->bTurnBasedModeOn == 1 && pTurnEngine->field_4 == 3 )
     {
-      pParty->uFlags |= 8u;
+      pParty->uFlags |= PARTY_FLAGS_1_FALLING;
       return;
     }
     if ( uActiveCharacter
@@ -5357,14 +5349,17 @@
         pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-c", 2);
         pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-c", 2);
         pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-c", 2);
-        pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_50796C], "isg-01-c", 2);
-        pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_507968], "isg-02-c", 2);
-        pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_507964], "isg-03-c", 2);
-        pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_507960], "isg-04-c", 2);
+
+        pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Bless], "isg-01-c", 2);
+        pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Preservation], "isg-02-c", 2);
+        pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Hammerhands], "isg-03-c", 2);
+        pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_PainReflection], "isg-04-c", 2);
+
         pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeC");
-        pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID);
+        pIconsFrameTable->InitializeAnimation(pUIAnim_WizardEye->uIconID);
         pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchC");
-        pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID);
+        pIconsFrameTable->InitializeAnimation(pUIAnum_Torchlight->uIconID);
+
         pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uExitCancelTextureId], "ib-bcu-c", 2);
         pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50795C], "evtnpc-c", 2);
         pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507958], "fr_inven-c", 2);
@@ -5402,10 +5397,10 @@
         uTextureID_Btn_QuickReference = pIcons_LOD->LoadTexture("ib-m3d-c", TEXTURE_16BIT_PALETTE);
         uTextureID_Btn_GameSettings = pIcons_LOD->LoadTexture("ib-m4d-c", TEXTURE_16BIT_PALETTE);
         uExitCancelTextureId = pIcons_LOD->LoadTexture("ib-bcu-c", TEXTURE_16BIT_PALETTE);
-        dword_50796C = pIcons_LOD->LoadTexture("isg-01-c", TEXTURE_16BIT_PALETTE);
-        dword_507968 = pIcons_LOD->LoadTexture("isg-02-c", TEXTURE_16BIT_PALETTE);
-        dword_507964 = pIcons_LOD->LoadTexture("isg-03-c", TEXTURE_16BIT_PALETTE);
-        dword_507960 = pIcons_LOD->LoadTexture("isg-04-c", TEXTURE_16BIT_PALETTE);
+        uTextureID_PlayerBuff_Bless = pIcons_LOD->LoadTexture("isg-01-c", TEXTURE_16BIT_PALETTE);
+        uTextureID_PlayerBuff_Preservation = pIcons_LOD->LoadTexture("isg-02-c", TEXTURE_16BIT_PALETTE);
+        uTextureID_PlayerBuff_Hammerhands = pIcons_LOD->LoadTexture("isg-03-c", TEXTURE_16BIT_PALETTE);
+        uTextureID_PlayerBuff_PainReflection = pIcons_LOD->LoadTexture("isg-04-c", TEXTURE_16BIT_PALETTE);
         uTextureID_50795C = pIcons_LOD->LoadTexture("evtnpc-c", TEXTURE_16BIT_PALETTE);
         uTextureID_507958 = pIcons_LOD->LoadTexture("fr_inven", TEXTURE_16BIT_PALETTE);
         pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeC");
@@ -5442,10 +5437,10 @@
         pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-a", 2);
         pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-a", 2);
         pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-a", 2);
-        pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_50796C], "isg-01-a", 2);
-        pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_507968], "isg-02-a", 2);
-        pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_507964], "isg-03-a", 2);
-        pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_507960], "isg-04-a", 2);
+        pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Bless], "isg-01-a", 2);
+        pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Preservation], "isg-02-a", 2);
+        pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Hammerhands], "isg-03-a", 2);
+        pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_PainReflection], "isg-04-a", 2);
         pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeA");
         pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID);
         pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchA");
@@ -5487,10 +5482,10 @@
         uTextureID_Btn_ZoomIn = pIcons_LOD->LoadTexture("ib-autout-a", TEXTURE_16BIT_PALETTE);
         uTextureID_Btn_ZoomOut = pIcons_LOD->LoadTexture("ib-autin-a", TEXTURE_16BIT_PALETTE);
         uExitCancelTextureId = pIcons_LOD->LoadTexture("ib-bcu-a", TEXTURE_16BIT_PALETTE);
-        dword_50796C = pIcons_LOD->LoadTexture("isg-01-a", TEXTURE_16BIT_PALETTE);
-        dword_507968 = pIcons_LOD->LoadTexture("isg-02-a", TEXTURE_16BIT_PALETTE);
-        dword_507964 = pIcons_LOD->LoadTexture("isg-03-a", TEXTURE_16BIT_PALETTE);
-        dword_507960 = pIcons_LOD->LoadTexture("isg-04-a", TEXTURE_16BIT_PALETTE);
+        uTextureID_PlayerBuff_Bless = pIcons_LOD->LoadTexture("isg-01-a", TEXTURE_16BIT_PALETTE);
+        uTextureID_PlayerBuff_Preservation = pIcons_LOD->LoadTexture("isg-02-a", TEXTURE_16BIT_PALETTE);
+        uTextureID_PlayerBuff_Hammerhands = pIcons_LOD->LoadTexture("isg-03-a", TEXTURE_16BIT_PALETTE);
+        uTextureID_PlayerBuff_PainReflection = pIcons_LOD->LoadTexture("isg-04-a", TEXTURE_16BIT_PALETTE);
         uTextureID_50795C = pIcons_LOD->LoadTexture("evtnpc", TEXTURE_16BIT_PALETTE);
         uTextureID_507958 = pIcons_LOD->LoadTexture("fr_inven", TEXTURE_16BIT_PALETTE);
         pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeA");
@@ -5538,10 +5533,10 @@
       pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-b", 2);
       pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-b", 2);
       pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-b", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_50796C], "isg-01-b", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_507968], "isg-02-b", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_507964], "isg-03-b", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_507960], "isg-04-b", 2);
+      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Bless], "isg-01-b", 2);
+      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Preservation], "isg-02-b", 2);
+      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Hammerhands], "isg-03-b", 2);
+      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_PainReflection], "isg-04-b", 2);
       pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeB");
       pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID);
       pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchB");
--- a/mm7_2.cpp	Tue Mar 05 04:30:20 2013 +0200
+++ b/mm7_2.cpp	Tue Mar 05 16:14:22 2013 +0200
@@ -15868,7 +15868,7 @@
   {
     strcpy(pOutdoor->pLevelFilename, pCurrentMapName);
     v0 = pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.y, (char *)&pOut, 32);
-    if ( !bUnderwater && (pParty->uFlags & 0x8C || BYTE1(pParty->uFlags) & 2 || pParty->bFlying) || !v0 )
+    if ( !bUnderwater && (pParty->uFlags & (PARTY_FLAGS_1_STANDING_ON_WATER | PARTY_FLAGS_1_FALLING | 0x04) || pParty->uFlags & 0x0200 || pParty->bFlying) || !v0 )
     {
       if ( pParty->vPosition.x < -22528 )
         pParty->vPosition.x = -22528;
--- a/mm7_3.cpp	Tue Mar 05 04:30:20 2013 +0200
+++ b/mm7_3.cpp	Tue Mar 05 16:14:22 2013 +0200
@@ -1702,9 +1702,9 @@
 LABEL_20:
   if ( v6 - party_z > 512 && !bFeatherFall && party_z <= v80 + 1 )
   {
-    if ( BYTE1(pParty->uFlags) & 1 )
-    {
-      BYTE1(pParty->uFlags) &= 0xFEu;
+    if (pParty->uFlags & PARTY_FLAGS_1_LANDING)
+    {
+      pParty->uFlags &= ~PARTY_FLAGS_1_LANDING;
     }
     else for (uint i = 0; i < 4; ++i)
     {                                      // receive falling damage
@@ -1927,7 +1927,7 @@
       v89 -= pEventTimer->uTimeElapsed * GetGravityStrength();
       goto LABEL_92;
     }
-    if ( BYTE1(pParty->uFlags) & 1 )
+    if (pParty->uFlags & PARTY_FLAGS_1_LANDING)
       goto LABEL_92;
     v89 = 0;
   }
@@ -2181,16 +2181,16 @@
     }
   }
   if ( !bJumping || bFeatherFall )
-    pParty->uFlags &= 0xFFFFFFF7u;
-  else
-    pParty->uFlags |= 8u;
-  BYTE1(pParty->uFlags) &= 0xFDu;
+    pParty->uFlags &= ~PARTY_FLAGS_1_FALLING;
+  else
+    pParty->uFlags |= PARTY_FLAGS_1_FALLING;
+  pParty->uFlags &= ~0x200;
   pParty->vPosition.x = new_party_x;
   pParty->vPosition.z = new_party_z;
   pParty->vPosition.y = new_party_y;
   pParty->uFallSpeed = v89;
   if ( !bJumping && BYTE3(pIndoor->pFaces[uFaceID].uAttributes) & 0x40 )
-    BYTE1(pParty->uFlags) |= 2u;
+    pParty->uFlags |= 0x200;
   if (uFaceEvent)
     EventProcessor(uFaceEvent, 0, 1);
 }
@@ -2370,7 +2370,7 @@
   }
 //  bFeatherFall = 1;
 //LABEL_9:
-  LOBYTE(pParty->uFlags) &= 0x7Fu;
+  pParty->uFlags &= ~PARTY_FLAGS_1_STANDING_ON_WATER;
   if (pParty->WaterWalkActive())
   {
     //LOBYTE(pParty->uFlags) &= 0x7Fu;
@@ -2476,7 +2476,7 @@
         pParty->bFlying = false;
         if (bUnderwater ||
             pParty->pPartyBuffs[PARTY_BUFF_FLY].uFlags & 1 ||
-            pParty->pPlayers[pParty->pPartyBuffs[PARTY_BUFF_FLY].uCaster - 1].sMana <= 0 )
+            pParty->pPlayers[pParty->pPartyBuffs[PARTY_BUFF_FLY].uCaster - 1].sMana > 0 )
           {
             if ( pParty->vPosition.z < 4000 || bJumping )
             {
@@ -2497,7 +2497,7 @@
                 pParty->field_6E0 = 0;
                 pParty->field_6E4 = 0;
                 pPartyActionQueue->uNumActions = 0;
-                BYTE1(pParty->uFlags) |= 1u;
+                pParty->uFlags |= PARTY_FLAGS_1_LANDING;
                 pParty->vPosition.z = v109 - pParty->uPartyHeight - 31;
                 pParty->field_6F0 = v123;
                 pParty->bFlying = 0;
@@ -2517,7 +2517,7 @@
           pParty->bFlying = 0;
           if ( bUnderwater
             || pParty->pPartyBuffs[7].uFlags & 1
-            || pParty->pPlayers[pParty->pPartyBuffs[7].uCaster-1].sMana <= 0 )//*(int *)&pParty->pArtifactsFound[6972 * pParty->pPartyBuffs[7].uCaster + 10] > 0 )
+            || pParty->pPlayers[pParty->pPartyBuffs[7].uCaster - 1].sMana > 0 )//*(int *)&pParty->pArtifactsFound[6972 * pParty->pPartyBuffs[7].uCaster + 10] > 0 )
           {
             v123 -= 30;
             v113 -= 30;
@@ -3147,9 +3147,9 @@
     }
   }
   if ( !bJumping || v101 )
-    pParty->uFlags &= 0xFFFFFFF7u;
-  else
-    pParty->uFlags |= 8u;
+    pParty->uFlags &= ~PARTY_FLAGS_1_FALLING;
+  else
+    pParty->uFlags |= PARTY_FLAGS_1_FALLING;
   v126 = WorldPosToGridCellX(pParty->vPosition.x);
   v65 = WorldPosToGridCellZ(pParty->vPosition.y) - 1;
   v114 = WorldPosToGridCellX(v116);
@@ -3192,9 +3192,9 @@
         pParty->vPosition.z = v105;
         if ( pParty->uFallStartY - v70 > 512 && !bFeatherFall && v70 <= v105 && !bUnderwater )
         {
-          if ( pParty->uFlags & 0x100 )
-          {
-            BYTE1(pParty->uFlags) &= 0xFEu;
+          if ( pParty->uFlags & PARTY_FLAGS_1_LANDING )
+          {
+            pParty->uFlags &= ~PARTY_FLAGS_1_LANDING;
           }
           else
           {
@@ -3225,7 +3225,7 @@
           pParty->field_6F0 = v109 - pParty->uPartyHeight - 1;
         }
       }
-      LOWORD(pParty->uFlags) &= 0xFDFBu;
+      pParty->uFlags &= ~0x204;
     }
     return;
   }
@@ -3260,15 +3260,17 @@
 LABEL_313:
     if ( bWaterWalk )
     {
-      LOBYTE(pParty->uFlags) &= 0x7Fu;
-      v79 = 20 * pParty->pPartyBuffs[18].uOverlayID + 6180178;
-      *(short *)&stru_5E4C90._decor_events[20 * pParty->pPartyBuffs[18].uOverlayID + 119] |= 1u;
+      pParty->uFlags &= ~PARTY_FLAGS_1_STANDING_ON_WATER;
+      //v79 = 20 * pParty->pPartyBuffs[18].uOverlayID + 6180178;
+      //*(short *)&stru_5E4C90._decor_events[20 * pParty->pPartyBuffs[18].uOverlayID + 119] |= 1u;
+      v79 = (int)&stru_5E4C90._decor_events[20 * pParty->pPartyBuffs[18].uOverlayID + 119];
+      *(short *)v79 |= 1u;
       if ( !v122 || !v69 )
       {
         if ( !v76 )
         {
           v80 = *(short *)v79;
-          LOBYTE(pParty->uFlags) |= 0x80u;
+          pParty->uFlags |= PARTY_FLAGS_1_STANDING_ON_WATER;
           *(short *)v79 = v80 & 0xFFFE;
         }
       }
@@ -3312,9 +3314,9 @@
       pParty->vPosition.z = v105;
       if ( pParty->uFallStartY - v81 > 512 && !bFeatherFall && v81 <= v105 && !bUnderwater )
       {
-        if ( pParty->uFlags & 0x100 )
-        {
-          BYTE1(pParty->uFlags) &= 0xFEu;
+        if ( pParty->uFlags & PARTY_FLAGS_1_LANDING )
+        {
+          pParty->uFlags &= ~PARTY_FLAGS_1_LANDING;
         }
         else
         {
@@ -11653,25 +11655,16 @@
 //----- (0044100D) --------------------------------------------------------
 bool __cdecl sub_44100D()
 {
-  return pCurrentScreen == SCREEN_NPC_DIALOGUE
-      || pCurrentScreen == SCREEN_CHARACTERS
-      || pCurrentScreen > SCREEN_LOADGAME
-      && (pCurrentScreen <= SCREEN_E
-       || pCurrentScreen > SCREEN_VIDEO
-       && (pCurrentScreen <= SCREEN_INPUT_BLV
-        || pCurrentScreen == SCREEN_CASTING));
+  return pCurrentScreen == SCREEN_NPC_DIALOGUE || pCurrentScreen == SCREEN_CHARACTERS ||
+         pCurrentScreen > SCREEN_LOADGAME && pCurrentScreen <= SCREEN_E ||
+         pCurrentScreen > SCREEN_VIDEO && pCurrentScreen <= SCREEN_INPUT_BLV || pCurrentScreen == SCREEN_CASTING;
 }
 // 4E28F8: using guessed type int pCurrentScreen;
 
 //----- (00441498) --------------------------------------------------------
 void __cdecl GameUI_DrawTorchlightAndWizardEye()
 {
-  unsigned int v0; // eax@15
-  IconFrame *v1; // eax@15
-  unsigned int v2; // eax@19
-  IconFrame *v3; // eax@19
-
-  if ( !pCurrentScreen
+  if (pCurrentScreen == SCREEN_GAME
     || pCurrentScreen == SCREEN_MENU
     || pCurrentScreen == SCREEN_OPTIONS
     || pCurrentScreen == SCREEN_REST
@@ -11683,25 +11676,15 @@
     || pCurrentScreen == SCREEN_BOOKS
     || pCurrentScreen == SCREEN_BRANCHLESS_NPC_DIALOG )
   {
-    if ( SHIDWORD(pParty->pPartyBuffs[16].uExpireTime) >= 0
-      && (SHIDWORD(pParty->pPartyBuffs[16].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[16].uExpireTime)) )
-    {
-      v0 = pEventTimer->Time();
-      v1 = pIconsFrameTable->GetFrame((signed __int16)pUIAnum_Torchlight->uIconID, v0);
-      pRenderer->DrawTextureTransparent(
-        pUIAnum_Torchlight->x,
-        pUIAnum_Torchlight->y,
-        &pIcons_LOD->pTextures[v1->uTextureID]);
-    }
-    if ( SHIDWORD(pParty->pPartyBuffs[19].uExpireTime) >= 0
-      && (SHIDWORD(pParty->pPartyBuffs[19].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[19].uExpireTime)) )
-    {
-      v2 = pEventTimer->Time();
-      v3 = pIconsFrameTable->GetFrame((signed __int16)pUIAnim_WizardEye->uIconID, v2);
-      pRenderer->DrawTextureTransparent(
-        pUIAnim_WizardEye->x,
-        pUIAnim_WizardEye->y,
-        &pIcons_LOD->pTextures[v3->uTextureID]);
+    if (pParty->TorchlightActive())
+    {
+      auto icon = pIconsFrameTable->GetFrame((signed __int16)pUIAnum_Torchlight->uIconID, pEventTimer->Time());
+      pRenderer->DrawTextureTransparent(pUIAnum_Torchlight->x, pUIAnum_Torchlight->y, pIcons_LOD->GetTexture(icon->uTextureID));
+    }
+    if (pParty->WizardEyeActive())
+    {
+      auto icon = pIconsFrameTable->GetFrame((signed __int16)pUIAnim_WizardEye->uIconID, pEventTimer->Time());
+      pRenderer->DrawTextureTransparent(pUIAnim_WizardEye->x, pUIAnim_WizardEye->y, pIcons_LOD->GetTexture(icon->uTextureID));
     }
   }
 }
@@ -11719,81 +11702,71 @@
 
 
 //----- (004415C5) --------------------------------------------------------
-void __cdecl Load_isn_spells_21_27()
-{
-  signed int v0; // esi@1
-  char pContainer[120]; // [sp+8h] [bp-20h]@2
-
-  v0 = 0;
-  do
-  {
-    sprintf(pContainer, "isn-%02d", v0 + 1);
-    pTextureIDs_isns[v0++] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
-  }
-  while ( v0 < 14 );
-  uIconIdx_Spell21 = pIconsFrameTable->FindIcon("spell21");
-  uIconIdx_Spell27 = pIconsFrameTable->FindIcon("spell27");
+void LoadPartyBuffIcons()
+{
+  for (uint i = 0; i < 14; ++i)
+  {
+    char filename[200];
+    sprintf(filename, "isn-%02d", i + 1);
+    pTextureIDs_PartyBuffIcons[i] = pIcons_LOD->LoadTexture(filename, TEXTURE_16BIT_PALETTE);
+  }
+
+  uIconIdx_FlySpell = pIconsFrameTable->FindIcon("spell21");
+  uIconIdx_WaterWalk = pIconsFrameTable->FindIcon("spell27");
 }
 
 //----- (0044162D) --------------------------------------------------------
 void __cdecl GameUI_DrawPartySpells()
 {
   unsigned int v0; // ebp@1
-  signed int v1; // edi@1
-  int v2; // eax@2
-  int v3; // ecx@5
-  __int16 *v4; // ebx@25
-  Player *v5; // edi@26
-  unsigned int v6; // [sp-4h] [bp-1Ch]@11
+  //signed int v1; // edi@1
+  //int v2; // eax@2
+  //int v3; // ecx@5
+  //__int16 *v4; // ebx@25
+  //Player *v5; // edi@26
+  //unsigned int v6; // [sp-4h] [bp-1Ch]@11
   Texture *v7; // [sp-4h] [bp-1Ch]@12
-  unsigned int v8; // [sp-4h] [bp-1Ch]@20
+  //unsigned int v8; // [sp-4h] [bp-1Ch]@20
   Texture *v9; // [sp-4h] [bp-1Ch]@21
-  Player **v10; // [sp+10h] [bp-8h]@25
+  //Player **v10; // [sp+10h] [bp-8h]@25
 
   v0 = (signed __int64)((double)GetTickCount() * 0.050000001);
-  v1 = 0;
-  do
-  {
-    v2 = (unsigned __int8)byte_4E5DD8[v1];
-    if ( SHIDWORD(pParty->pPartyBuffs[v2].uExpireTime) >= 0
-      && (SHIDWORD(pParty->pPartyBuffs[v2].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[v2].uExpireTime) > 0) )
-    {
-      v3 = pTextureIDs_isns[v1];
-      pRenderer->_4A65CC(
-        pPartySpellbuffsUI_XYs[v1][0],
-        pPartySpellbuffsUI_XYs[v1][1],
-        (Texture *)(v3 != -1 ? &pIcons_LOD->pTextures[v3] : 0),
-        (Texture *)(v3 != -1 ? &pIcons_LOD->pTextures[v3] : 0),
-        v0 + 20 * pPartySpellbuffsUI_smthns[v1],
-        0,
-        63);
-    }
-    ++v1;
-  }
-  while ( v1 < 14 );
-  if ( !pCurrentScreen
-    || pCurrentScreen == SCREEN_NPC_DIALOGUE )
-  {
-    if ( (signed __int64)pParty->pPartyBuffs[7].uExpireTime > 0 )
+  //v1 = 0;
+  for (uint i = 0; i < 14; ++i)
+  {
+    //v2 =  byte_4E5DD8[v1];
+    if (pParty->pPartyBuffs[byte_4E5DD8[i]].uExpireTime)
+    {
+      auto tex = pIcons_LOD->GetTexture(pTextureIDs_PartyBuffIcons[i]);
+      //v3 = pTextureIDs_PartyBuffIcons[i];
+      if (tex)
+        pRenderer->_4A65CC(pPartySpellbuffsUI_XYs[i][0],
+                           pPartySpellbuffsUI_XYs[i][1], tex, tex,
+                           v0 + 20 * pPartySpellbuffsUI_smthns[i], 0, 63);
+    }
+    //++v1;
+  }
+  //while ( v1 < 14 );
+
+  if (pCurrentScreen == SCREEN_GAME || pCurrentScreen == SCREEN_NPC_DIALOGUE)
+  {
+    if (pParty->FlyActive())
     {
       if ( pParty->bFlying )
-        v6 = v0;
-      else
-        v6 = 0;
-      v7 = &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(uIconIdx_Spell21, v6)->uTextureID];
+        v7 = &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(uIconIdx_FlySpell, v0)->uTextureID];
+      else
+        v7 = &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(uIconIdx_FlySpell, 0)->uTextureID];
       if ( pRenderer->pRenderD3D )
         pRenderer->DrawTextureIndexed(8u, 8u, v7);
       else
         pRenderer->DrawTextureTransparent(8u, 8u, v7);
     }
-    if ( SHIDWORD(pParty->pPartyBuffs[18].uExpireTime) >= 0
-      && (SHIDWORD(pParty->pPartyBuffs[18].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[18].uExpireTime)) )
-    {
-      if ( pParty->uFlags & 0x80 )
-        v8 = v0;
-      else
-        v8 = 0;
-      v9 = &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(uIconIdx_Spell27, v8)->uTextureID];
+    if (pParty->WaterWalkActive())
+    {
+      if ( pParty->uFlags & PARTY_FLAGS_1_STANDING_ON_WATER)
+        v9 = &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(uIconIdx_WaterWalk, v0)->uTextureID];
+      else
+        v9 = &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(uIconIdx_WaterWalk, 0)->uTextureID];
       if ( pRenderer->pRenderD3D )
         pRenderer->DrawTextureIndexed(396u, 8u, v9);
       else
@@ -11801,37 +11774,19 @@
     }
   }
 
-  uint _it = 0;
-  v10 = &pPlayers[1];
-  v4 = pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing;
-  do
-  {
-    v5 = *v10;
-    if ( (signed __int64)(*v10)->pPlayerBuffs[6].uExpireTime > 0 )
-      pRenderer->DrawTextureIndexed(
-        *v4 + 72,
-        0x1ABu,
-        (Texture *)(dword_507964 != -1 ? &pIcons_LOD->pTextures[dword_507964] : 0));
-    if ( (signed __int64)v5->pPlayerBuffs[1].uExpireTime > 0 )
-      pRenderer->DrawTextureIndexed(
-        *v4 + 72,
-        0x189u,
-        (Texture *)(dword_50796C != -1 ? &pIcons_LOD->pTextures[dword_50796C] : 0));
-    if ( (signed __int64)v5->pPlayerBuffs[11].uExpireTime > 0 )
-      pRenderer->DrawTextureIndexed(
-        *v4 + 72,
-        0x19Au,
-        (Texture *)(dword_507968 != -1 ? &pIcons_LOD->pTextures[dword_507968] : 0));
-    if ( (signed __int64)v5->pPlayerBuffs[10].uExpireTime > 0 )
-      pRenderer->DrawTextureIndexed(
-        *v4 + 72,
-        0x1BCu,
-        (Texture *)(dword_507960 != -1 ? &pIcons_LOD->pTextures[dword_507960] : 0));
-    ++v10;
-    ++v4;
-  }
-  //while ( (signed int)v4 < (signed int)pBaseHealthByClass );
-  while (++_it != 4);
+  for (uint i = 0; i < 4; ++i)
+  {
+    auto player = pParty->pPlayers + i;
+
+    if (player->pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].uExpireTime)
+      pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 427, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Hammerhands));
+    if (player->pPlayerBuffs[PLAYER_BUFF_BLESS].uExpireTime)
+      pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 393, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Bless));
+    if (player->pPlayerBuffs[PLAYER_BUFF_PRESERVATION].uExpireTime)
+      pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 410, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Preservation));
+    if (player->pPlayerBuffs[PLAYER_BUFF_PAIN_REFLECTION].uExpireTime)
+      pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 444, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_PainReflection));
+  }
 }
 
 //----- (00441A4E) --------------------------------------------------------
@@ -15522,8 +15477,8 @@
   signed int v29; // edx@66
   char *v30; // ecx@67
   unsigned __int16 v31; // ax@70
-  Player *v32; // eax@80
-  unsigned __int16 v33; // si@85
+  //Player *v32; // eax@80
+  //unsigned __int16 v33; // si@85
   int v34; // eax@96
   int v35; // eax@97
   unsigned __int64 v36; // qax@99
@@ -15535,7 +15490,7 @@
   int v42; // esi@111
   int v43; // ebx@111
   int v44; // eax@117
-  unsigned __int16 v45; // si@137
+  //unsigned __int16 v45; // si@137
   unsigned __int16 v46; // [sp-8h] [bp-BCh]@99
   int v47; // [sp-4h] [bp-B8h]@35
   unsigned __int16 v48; // [sp-4h] [bp-B8h]@99
@@ -15551,8 +15506,8 @@
   //SpriteObject a1; // [sp+38h] [bp-7Ch]@12
   int v59; // [sp+A8h] [bp-Ch]@1
   int v60; // [sp+ACh] [bp-8h]@1
-  int spellnum_; // [sp+B0h] [bp-4h]@1
-  signed int levela; // [sp+BCh] [bp+8h]@80
+  //int spellnum_; // [sp+B0h] [bp-4h]@1
+  //signed int levela; // [sp+BCh] [bp+8h]@80
   int a6_4; // [sp+C8h] [bp+14h]@117
   float a7a; // [sp+CCh] [bp+18h]@6
   signed int a7b; // [sp+CCh] [bp+18h]@12
@@ -15565,7 +15520,7 @@
 
   v9 = 0;
   v59 = rank + 1;
-  spellnum_ = spellnum;
+  //spellnum_ = spellnum;
   v60 = 0;
   if ( tox || toy || toz )
   {
@@ -15608,12 +15563,12 @@
   SpriteObject a1; // [sp+38h] [bp-7Ch]@12
   //SpriteObject::SpriteObject(&a1);
 
-  a1.uType = stru_4E3ACC[spellnum_].field_0;
-  if ( spellnum_ > 58 )
-  {
-    if ( spellnum_ == 69 )
+  a1.uType = stru_4E3ACC[spellnum].field_0;
+  if ( spellnum > 58 )
+  {
+    if ( spellnum == 69 )
       goto LABEL_117;
-    if ( spellnum_ != 83 )
+    if ( spellnum != 83 )
       return;
     v40 = v15 - 2;
     if ( v40 )
@@ -15651,9 +15606,9 @@
     v37->Apply(v36, v46, v48, v50, v52);
     goto LABEL_139;
   }
-  if ( spellnum_ != 58 )
-  {
-    switch ( spellnum_ )
+  if ( spellnum != 58 )
+  {
+    switch ( spellnum )
     {
       case 2:
       case 6:
@@ -15665,7 +15620,7 @@
       case 41:
         a1.stru_24.Reset();
         v16 = 0;
-        a1.field_48 = spellnum_;
+        a1.field_48 = spellnum;
         a1.field_4C = level;
         a1.field_50 = v15;
         if ( (signed int)pObjectList->uNumObjects <= 0 )
@@ -15703,7 +15658,7 @@
           a8b = a7c / (v60 - 1);
           a1.stru_24.Reset();
           v21 = 0;
-          a1.field_48 = spellnum_;
+          a1.field_48 = spellnum;
           a1.field_4C = level;
           a1.field_50 = v15;
           if ( (signed int)pObjectList->uNumObjects <= 0 )
@@ -15746,7 +15701,7 @@
         }
         a1.stru_24.Reset();
         v16 = 0;
-        a1.field_48 = spellnum_;
+        a1.field_48 = spellnum;
         a1.field_4C = level;
         a1.field_50 = v15;
         if ( (signed int)pObjectList->uNumObjects <= 0 )
@@ -15799,7 +15754,7 @@
         a8c = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (v60 - 1);
         a1.stru_24.Reset();
         v25 = 0;
-        a1.field_48 = spellnum_;
+        a1.field_48 = spellnum;
         a1.field_4C = level;
         a1.field_50 = v15;
         if ( (signed int)pObjectList->uNumObjects <= 0 )
@@ -15843,14 +15798,15 @@
           return;
         a1.stru_24.Reset();
         v29 = 0;
-        a1.field_48 = spellnum_;
+        a1.field_48 = spellnum;
         a1.field_4C = level;
         a1.field_50 = v15;
         if ( (signed int)pObjectList->uNumObjects <= 0 )
           goto LABEL_70;
         v30 = (char *)&pObjectList->pObjects->uObjectID;
         break;
-      case 5:
+
+      case SPELL_FIRE_HASTE:
         if ( v15 > 0 )
         {
           if ( v15 <= 2 )
@@ -15870,28 +15826,25 @@
             }
           }
         }
-        levela = 1;
-        v32 = pParty->pPlayers;//[0].pConditions[1];
-        do
-        {
-		  if ( v32->pConditions[1] )
-            levela = 0;
-          ++v32;
-        }
-		while ( v32 <= &pParty->pPlayers[3] );
-        if ( !levela )
-          return;
-        pParty->pPartyBuffs[8].Apply(
-          pParty->uTimePlayed + (signed int)(signed __int64)((double)(v9 << 7) * 0.033333335),
+        //levela = 1;
+        //v32 = pParty->pPlayers;//[0].pConditions[1];
+        //do
+        for (uint i = 0; i < 4; ++i)
+          if (pParty->pPlayers[i].pConditions[Player::Condition_Weak])
+            return;
+		//while ( v32 <= &pParty->pPlayers[3] );
+        //if ( !levela )
+        //  return;
+        pParty->pPartyBuffs[PARTY_BUFF_HASTE].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(v9 * 128) * 0.033333335),
           v15,
           0,
           0,
           0);
-        v33 = spellnum_;
-        pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 0);
-        pGame->pStru6Instance->SetPlayerBuffAnim(v33, 1u);
-        pGame->pStru6Instance->SetPlayerBuffAnim(v33, 2u);
-        pGame->pStru6Instance->SetPlayerBuffAnim(v33, 3u);
+        //v33 = spellnum_;
+        pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 0);
+        pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 1);
+        pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 2);
+        pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 3);
         goto LABEL_138;
       case 17:
       case 38:
@@ -15909,7 +15862,7 @@
             v9 = 3600 * (level + 1);
             break;
         }
-        switch ( spellnum_ )
+        switch ( spellnum )
         {
           case 17:
             v60 = 0;
@@ -15926,10 +15879,10 @@
             v60 = v34;
             break;
         }
-        pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 0);
-        pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 1u);
-        pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 2u);
-        pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 3u);
+        pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 0);
+        pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 1);
+        pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 2);
+        pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 3);
         v52 = 0;
         v50 = 0;
         v48 = v60;
@@ -15942,10 +15895,10 @@
           v38 = 60 * level;
         else
           v38 = 600 * level;
-        pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 0);
-        pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 1u);
-        pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 2u);
-        pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 3u);
+        pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 0);
+        pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 1);
+        pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 2);
+        pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 3);
         v52 = 0;
         v50 = 0;
         v48 = level;
@@ -16017,7 +15970,7 @@
     goto LABEL_124;
   }
 LABEL_125:
-  switch ( spellnum_ )
+  switch ( spellnum )
   {
     case 3:
       level = 6;
@@ -16038,22 +15991,22 @@
       level = 1;
       break;
   }
-  v45 = spellnum_;
-  pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 0);
-  pGame->pStru6Instance->SetPlayerBuffAnim(v45, 1u);
-  pGame->pStru6Instance->SetPlayerBuffAnim(v45, 2u);
-  pGame->pStru6Instance->SetPlayerBuffAnim(v45, 3u);
+  //v45 = spellnum_;
+  pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 0);
+  pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 1);
+  pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 2);
+  pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 3);
   pParty->pPartyBuffs[level].Apply(
     pParty->uTimePlayed + (signed int)(signed __int64)((double)a6_4 * 4.2666669),
     v15,
     v60,
     0,
     0);
-  levela = 1;
+  //levela = 1;
 LABEL_138:
-  if ( levela )
+  //if ( levela )
 LABEL_139:
-    pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[spellnum_], 0, 0, fromx, fromy, 0, 0, 0);
+    pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[spellnum], 0, 0, fromx, fromy, 0, 0, 0);
 }
 // 4EE088: using guessed type __int16 word_4EE088_sound_ids[];
 
--- a/mm7_4.cpp	Tue Mar 05 04:30:20 2013 +0200
+++ b/mm7_4.cpp	Tue Mar 05 16:14:22 2013 +0200
@@ -3424,11 +3424,11 @@
     {
       if ( pParty->bFlying )
       {
-        if ( !(pParty->pPartyBuffs[7].uFlags & 1) )
-        {
-          v5 = v4 * pParty->pPartyBuffs[7].uPower;
-          __debugbreak();
-		  v6 = (int *)&pParty->pPlayers[pParty->pPartyBuffs[7].uCaster].pConditions[0];//&stru_AA1058[4].pSounds[6972 * pParty->pPartyBuffs[7].uCaster + 2000];
+        if ( !(pParty->pPartyBuffs[PARTY_BUFF_FLY].uFlags & 1) )
+        { // colliding with something in the air - fall down
+          v5 = v4 * pParty->pPartyBuffs[PARTY_BUFF_FLY].uPower;
+          //__debugbreak();
+		  v6 = (int *)&pParty->pPlayers[pParty->pPartyBuffs[PARTY_BUFF_FLY].uCaster].pConditions[0];//&stru_AA1058[4].pSounds[6972 * pParty->pPartyBuffs[7].uCaster + 2000];
           v7 = *v6 < v5;
           *v6 -= v5;
           if ( v7 )
@@ -3441,25 +3441,27 @@
         }
       }
     }
+
     if (pParty->WaterWalkActive())
     {
-      if (pParty->uFlags & 0x80 )
-      {
-        if ( !(pParty->pPartyBuffs[18].uFlags & 1) )
-        {
-          __debugbreak();
-          v8 = (int *)&pParty->pPlayers[pParty->pPartyBuffs[18].uCaster].pConditions[0];//&stru_AA1058[4].pSounds[6972 * pParty->pPartyBuffs[18].uCaster + 2000];
+      if (pParty->uFlags & PARTY_FLAGS_1_STANDING_ON_WATER )
+      {
+        if ( !(pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uFlags & 1) )
+        { // taking on water
+          //__debugbreak();
+          v8 = (int *)&pParty->pPlayers[pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uCaster].pConditions[0];//&stru_AA1058[4].pSounds[6972 * pParty->pPartyBuffs[18].uCaster + 2000];
           v7 = *v8 < v4;
           *v8 -= v4;
           if ( v7 )
           {
             *v8 = 0;
-            LOBYTE(pParty->uFlags) &= 0x7Fu;
+            pParty->uFlags &= ~PARTY_FLAGS_1_STANDING_ON_WATER;
             v51 = 1;
           }
         }
       }
     }
+
     if (pParty->ImmolationActive())
     {
       //SpriteObject::SpriteObject(&a1);
--- a/mm7_6.cpp	Tue Mar 05 04:30:20 2013 +0200
+++ b/mm7_6.cpp	Tue Mar 05 16:14:22 2013 +0200
@@ -4702,9 +4702,9 @@
         }
         goto LABEL_1056;
       case 16:
-        if ( pParty->uFlags & 8 )
-        {
-          v190 = pGlobalTXT_LocalizationStrings[493];
+        if ( pParty->uFlags & PARTY_FLAGS_1_FALLING)
+        {
+          v190 = pGlobalTXT_LocalizationStrings[493]; // Can't cast Jump while airborne!
           goto LABEL_462;
         }
         if ( !pPlayer->CanCastSpell(uRequiredMana) )
@@ -4768,7 +4768,7 @@
       case 21:
         if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
         {
-          v190 = pGlobalTXT_LocalizationStrings[494];
+          v190 = pGlobalTXT_LocalizationStrings[494]; // Can not cast Fly indoors!
 LABEL_462:
           ShowStatusBarString(v190, 2u);
           pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
--- a/mm7_data.cpp	Tue Mar 05 04:30:20 2013 +0200
+++ b/mm7_data.cpp	Tue Mar 05 16:14:22 2013 +0200
@@ -3,6 +3,7 @@
 #include "NPC.h"
 #include "Actor.h"
 #include "GUIWindow.h"
+#include "Party.h"
 
 
 
@@ -945,9 +946,23 @@
 char aItem3_3dvD[13]; // weak
 char aItem64v1[9]; // weak
 char aEffpar01[777]; // idb
-int pPartySpellbuffsUI_XYs[14][2];
-char byte_4E5DD8[777]; // weak
-unsigned __int8 pPartySpellbuffsUI_smthns[14];
+
+int pPartySpellbuffsUI_XYs[14][2] =
+{
+  {477, 247}, {497, 247}, {522, 247}, {542, 247}, {564, 247}, {581, 247}, {614, 247},
+  {477, 279}, {497, 279}, {522, 279}, {542, 279}, {564, 279}, {589, 279}, {612, 279}
+};
+unsigned char byte_4E5DD8[14] =
+{
+  PARTY_BUFF_FEATHER_FALL, PARTY_BUFF_RESIST_FIRE, PARTY_BUFF_RESIST_AIR, PARTY_BUFF_RESIST_WATER, PARTY_BUFF_RESIST_MIND,           PARTY_BUFF_RESIST_EARTH, PARTY_BUFF_RESIST_BODY,
+  PARTY_BUFF_HEROISM,      PARTY_BUFF_HASTE,       PARTY_BUFF_SHIELD,     PARTY_BUFF_STONE_SKIN,   PARTY_BUFF_PROTECTION_FROM_MAGIC, PARTY_BUFF_IMMOLATION,   PARTY_BUFF_DAY_OF_GODS
+};
+unsigned __int8 pPartySpellbuffsUI_smthns[14] =
+{
+  14, 1, 10, 4, 7,  2, 9,
+   3, 6, 15, 8, 3, 12, 0
+};
+
 char aSpell27[777]; // idb
 char aSpell21[777]; // idb
 char aIsn02d[777]; // idb
@@ -1861,10 +1876,10 @@
 char bFlashHistoryBook; // weak
 char bFlashAutonotesBook; // weak
 char bFlashQuestBook; // weak
-int dword_507960; // weak
-int dword_507964; // weak
-int dword_507968; // weak
-int dword_50796C; // weak
+int uTextureID_PlayerBuff_PainReflection; // weak
+int uTextureID_PlayerBuff_Hammerhands; // weak
+int uTextureID_PlayerBuff_Preservation; // weak
+int uTextureID_PlayerBuff_Bless; // weak
 int uTextureID_Btn_QuickReference; // weak
 int dword_5079B4; // weak
 int dword_5079C8; // weak
@@ -1888,7 +1903,7 @@
 int dword_507C0C; // weak
 int dword_507CBC; // weak
 int dword_507CC0; // weak
-__int64 qword_507CC8; // weak
+__int64 GameUI_RightPanel_BookFlashTimer; // weak
 int _507CD4_RestUI_hourglass_anim_controller; // weak
 int dword_507CD8; // weak
 int dword_50B570[777]; // weak
@@ -1978,9 +1993,9 @@
 unsigned __int16 pOdmMinimap[117][137];
 unsigned int uNumBlueFacesInBLVMinimap;
 unsigned __int16 pBlueFacesInBLVMinimapIDs[50];
-int pTextureIDs_isns[14];
-unsigned int uIconIdx_Spell21;
-unsigned int uIconIdx_Spell27;
+int pTextureIDs_PartyBuffIcons[14];
+unsigned int uIconIdx_FlySpell;
+unsigned int uIconIdx_WaterWalk;
 int dword_576E28; // weak
 int dword_576E2C; // weak
 __int64 _5773B8_event_timer; // weak
--- a/mm7_data.h	Tue Mar 05 04:30:20 2013 +0200
+++ b/mm7_data.h	Tue Mar 05 16:14:22 2013 +0200
@@ -668,7 +668,7 @@
 extern char aItem64v1[9]; // weak
 extern char aEffpar01[]; // idb
 extern int pPartySpellbuffsUI_XYs[14][2];
-extern char byte_4E5DD8[]; // weak
+extern unsigned char byte_4E5DD8[]; // weak
 extern unsigned __int8 pPartySpellbuffsUI_smthns[14];
 extern char aSpell27[]; // idb
 extern char aSpell21[]; // idb
@@ -1191,10 +1191,10 @@
 extern char bFlashHistoryBook; // weak
 extern char bFlashAutonotesBook; // weak
 extern char bFlashQuestBook; // weak
-extern int dword_507960; // weak
-extern int dword_507964; // weak
-extern int dword_507968; // weak
-extern int dword_50796C; // weak
+extern int uTextureID_PlayerBuff_PainReflection; // weak
+extern int uTextureID_PlayerBuff_Hammerhands; // weak
+extern int uTextureID_PlayerBuff_Preservation; // weak
+extern int uTextureID_PlayerBuff_Bless; // weak
 extern int uTextureID_Btn_QuickReference; // weak
 extern int dword_5079B4; // weak
 extern int dword_5079C8; // weak
@@ -1218,7 +1218,7 @@
 extern int dword_507C0C; // weak
 extern int dword_507CBC; // weak
 extern int dword_507CC0; // weak
-extern __int64 qword_507CC8; // weak
+extern __int64 GameUI_RightPanel_BookFlashTimer; // weak
 extern int _507CD4_RestUI_hourglass_anim_controller; // weak
 extern int dword_507CD8; // weak
 extern int dword_50B570[]; // weak
@@ -1308,9 +1308,9 @@
 extern unsigned __int16 pOdmMinimap[117][137];
 extern unsigned int uNumBlueFacesInBLVMinimap;
 extern unsigned __int16 pBlueFacesInBLVMinimapIDs[50];
-extern int pTextureIDs_isns[14];
-extern unsigned int uIconIdx_Spell21;
-extern unsigned int uIconIdx_Spell27;
+extern int pTextureIDs_PartyBuffIcons[14];
+extern unsigned int uIconIdx_FlySpell;
+extern unsigned int uIconIdx_WaterWalk;
 extern int dword_576E28; // weak
 extern int dword_576E2C; // weak
 extern __int64 _5773B8_event_timer; // weak
@@ -1995,7 +1995,7 @@
 bool sub_44100D();
 void GameUI_DrawTorchlightAndWizardEye();
 void GameUI_DrawCharacterSelectionFrame();
-void Load_isn_spells_21_27();
+void LoadPartyBuffIcons();
 void GameUI_DrawPartySpells();
 __int16 __fastcall sub_441A4E(int a1);
 void GameUI_DrawMinimap(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW, unsigned int uZoom, unsigned int bRedrawOdmMinimap);