diff mm7_5.cpp @ 1000:53109a1455fc

m
author Ritor1
date Tue, 14 May 2013 17:59:31 +0600
parents dcdfbb6eede9
children eac5af72b614 c45d51b3f4f4 54f74d2c894f 5520fdca7a74
line wrap: on
line diff
--- a/mm7_5.cpp	Tue May 14 17:38:14 2013 +0600
+++ b/mm7_5.cpp	Tue May 14 17:59:31 2013 +0600
@@ -82,7 +82,7 @@
   unsigned int v33; // eax@277
   unsigned __int8 v34; // al@279
   unsigned __int8 v35; // al@280
-  GUIWindow *pWindow3; // ecx@332
+  //GUIWindow *pWindow3; // ecx@332
   int v37; // eax@341
   int v38; // eax@358
   SHORT v39; // ax@365
@@ -97,7 +97,7 @@
   char v48; // zf@405
   BLVFace *pBLVFace; // ecx@410
   ODMFace *pODMFace; // ecx@412
-  CastSpellInfo *v51; // ecx@415
+  CastSpellInfo *pSpellInfo; // ecx@415
   void *v52; // eax@424
   __int16 v53; // ax@431
   int v54; // eax@432
@@ -155,12 +155,6 @@
   Player *pPlayer5; // ST78_4@758
   unsigned int v107; // eax@758
   unsigned int v108; // eax@758
-  char *v109; // ST64_4@759
-  Player *v110; // ST78_4@759
-  int v111; // ST60_4@759
-  int v112; // ST5C_4@759
-  char *v113; // ST58_4@759
-  signed int v114; // eax@759
   unsigned int v115; // eax@764
   int v116; // eax@776
   POINT *pPoint3; // eax@777
@@ -1492,7 +1486,6 @@
                   pIcons_LOD->_4355F7();
                   continue;
                 }
-LABEL_319:
                 CharacterUI_ReleaseButtons();
                 sub_419379();
                 pIcons_LOD->_4114F2();
@@ -1525,7 +1518,6 @@
               pIcons_LOD->_4355F7();
               continue;
             }
-            pWindow3 = pGUIWindow_Settings;
             if ( !pGUIWindow_Settings )//Draw Menu
             {
               dword_6BE138 = -1;
@@ -1571,7 +1563,7 @@
               stru_506E40._40E55E("gamma.pcx", 0);
               continue;
             }
-            pWindow3->Release();
+            pGUIWindow_Settings->Release();
             pGUIWindow_Settings = 0;
             pMouse->SetCursorBitmap("MICON1");
             GameUI_Footer_TimeLeft = 0;
@@ -1811,13 +1803,12 @@
             v47 = pActors[v46].uAIState == Dead;
             if ( !v47 )
               continue;
-            v51 = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C;
-            LOBYTE(v51->field_8) &= 0xBFu;
-            v51->uPlayerID_2 = uMessageParam;
-            v51->spell_target_pid = v44;
-            pParty->pPlayers[v51->uPlayerID].SetRecoveryTime(300);
-            pWindow3 = pGUIWindow_Settings;
-            pWindow3->Release();
+            pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C;
+            LOBYTE(pSpellInfo->field_8) &= 0xBFu;
+            pSpellInfo->uPlayerID_2 = uMessageParam;
+            pSpellInfo->spell_target_pid = v44;
+            pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300);
+            pGUIWindow_Settings->Release();
             pGUIWindow_Settings = 0;
             pMouse->SetCursorBitmap("MICON1");
             GameUI_Footer_TimeLeft = 0;
@@ -1830,13 +1821,12 @@
             v47 = (pObjectList->pObjects[pSpriteObjects[v46].uObjectDescID].uFlags & 0x10) == 0;
             if ( !v47 )
               continue;
-            v51 = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C;
-            LOBYTE(v51->field_8) &= 0xBFu;
-            v51->uPlayerID_2 = uMessageParam;
-            v51->spell_target_pid = v44;
-            pParty->pPlayers[v51->uPlayerID].SetRecoveryTime(300);
-            pWindow3 = pGUIWindow_Settings;
-            pWindow3->Release();
+            pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C;
+            LOBYTE(pSpellInfo->field_8) &= 0xBFu;
+            pSpellInfo->uPlayerID_2 = uMessageParam;
+            pSpellInfo->spell_target_pid = v44;
+            pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300);
+            pGUIWindow_Settings->Release();
             pGUIWindow_Settings = 0;
             pMouse->SetCursorBitmap("MICON1");
             GameUI_Footer_TimeLeft = 0;
@@ -1858,13 +1848,12 @@
               if ( !(pODMFace->uAttributes & 0x02000000) || !pODMFace->sCogTriggeredID )
                 continue;
               v44 = uNumSeconds;
-              v51 = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C;
-              *((char *)v51 + 8) &= 0xBFu;
-              v51->uPlayerID_2 = uMessageParam;
-              v51->spell_target_pid = v44;
-              pParty->pPlayers[v51->uPlayerID].SetRecoveryTime(300);
-              pWindow3 = pGUIWindow_Settings;
-              pWindow3->Release();
+              pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C;
+              LOBYTE(pSpellInfo->field_8) &= 0xBFu;
+              pSpellInfo->uPlayerID_2 = uMessageParam;
+              pSpellInfo->spell_target_pid = v44;
+              pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300);
+              pGUIWindow_Settings->Release();
               pGUIWindow_Settings = 0;
               pMouse->SetCursorBitmap("MICON1");
               GameUI_Footer_TimeLeft = 0;
@@ -1879,23 +1868,21 @@
           }
           if ( v48 )
             continue;
-          v51 = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C;
-          LOBYTE(v51->field_8) &= 0xBFu;
-          v51->uPlayerID_2 = uMessageParam;
-          v51->spell_target_pid = v44;
-          pParty->pPlayers[v51->uPlayerID].SetRecoveryTime(300);
-          pWindow3 = pGUIWindow_Settings;
-          pWindow3->Release();
+          pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C;
+          LOBYTE(pSpellInfo->field_8) &= 0xBFu;
+          pSpellInfo->uPlayerID_2 = uMessageParam;
+          pSpellInfo->spell_target_pid = v44;
+          pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300);
+          pGUIWindow_Settings->Release();
           pGUIWindow_Settings = 0;
           pMouse->SetCursorBitmap("MICON1");
           GameUI_Footer_TimeLeft = 0;
           unk_50C9A0 = 0;
           back_to_game();
           continue;
-        case UIMSG_CastSpell_8F:
-			__debugbreak();
-        case UIMSG_CastSpell_SPIRIT_Preservation://and blessing, treatment paralysis, hand hammers(individual upgrade)
-        case UIMSG_CastSpell_SPIRIT_Fate:
+        case UIMSG_CastSpell_Character_Big_Improvement://Preservation and blessing, treatment paralysis, hand hammers(individual upgrade)
+        case UIMSG_CastSpell_Character_Small_Improvement://Fate, cure
+        case UIMSG_HiredNPC_CastSpell:
           if ( pMessageQueue_50CBD0->uNumMessages )
             pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
           if ( unk_50C9A0 )
@@ -1907,21 +1894,21 @@
           {
             if ( pGUIWindow_Settings )
             {
-              v51 = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C;
+              pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C;
               switch ( uMessage )
               {
-                case UIMSG_CastSpell_SPIRIT_Preservation:
-                  LOBYTE(v51->field_8) &= 0xFDu;
+                case UIMSG_CastSpell_Character_Big_Improvement:
+                  LOBYTE(pSpellInfo->field_8) &= 0xFDu;
                   break;
-                case UIMSG_CastSpell_SPIRIT_Fate:
-                  HIBYTE(v51->field_8) &= 0xFEu;
+                case UIMSG_CastSpell_Character_Small_Improvement:
+                  HIBYTE(pSpellInfo->field_8) &= 0xFEu;
                   break;
-                case UIMSG_CastSpell_8F:
-                  HIBYTE(v51->field_8) &= 0xFDu;
+                case UIMSG_HiredNPC_CastSpell:
+                  HIBYTE(pSpellInfo->field_8) &= 0xFDu;
                   break;
               }
-              v51->uPlayerID_2 = uMessageParam;
-              pParty->pPlayers[v51->uPlayerID].SetRecoveryTime(300);
+              pSpellInfo->uPlayerID_2 = uMessageParam;
+              pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300);
               pGUIWindow_Settings->Release();
               pGUIWindow_Settings = 0;
               pEventTimer->Resume();
@@ -2405,9 +2392,8 @@
           }
           _42777D_CastSpell_UseWand_ShootArrow(pPlayer2->uQuickSpell, uActiveCharacter - 1, 0, 0, uActiveCharacter);
           continue;
-        case UIMSG_CastSpell_GreatShot://???
-			__debugbreak();
-        case UIMSG_CastSpell_SmallShot://FireBlow, Lightning, Ice Lightning, Swarm, 
+        case UIMSG_CastSpell_Monster_Improvement:
+        case UIMSG_CastSpell_Shoot_Monster://FireBlow, Lightning, Ice Lightning, Swarm, 
           if ( pRenderer->pRenderD3D )
           {
             v81 = pGame->pVisInstance->get_picked_object_zbuf_val();
@@ -2426,23 +2412,22 @@
             v1 = "";
             continue;
           }
-          v51 = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C;
-          if ( uMessage == UIMSG_CastSpell_SmallShot )
-          {
-            LOBYTE(v51->field_8) &= 0xF7;
+          pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C;
+          if ( uMessage == UIMSG_CastSpell_Shoot_Monster )
+          {
+            LOBYTE(pSpellInfo->field_8) &= 0xF7;
           }
           else
           {
-            if ( uMessage == UIMSG_CastSpell_GreatShot )
-              HIBYTE(v51->field_8) &= 0xFEu;
+            if ( uMessage == UIMSG_CastSpell_Monster_Improvement )
+              HIBYTE(pSpellInfo->field_8) &= 0xFEu;
             else
-              HIBYTE(v51->field_8) &= 0xFDu;
-          }
-          v51->uPlayerID_2 = uMessageParam;
-          v51->spell_target_pid = v44;
-          pParty->pPlayers[v51->uPlayerID].SetRecoveryTime(300);
-          pWindow3 = pGUIWindow_Settings;
-          pWindow3->Release();
+              HIBYTE(pSpellInfo->field_8) &= 0xFDu;
+          }
+          pSpellInfo->uPlayerID_2 = uMessageParam;
+          pSpellInfo->spell_target_pid = v44;
+          pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300);
+          pGUIWindow_Settings->Release();
           pGUIWindow_Settings = 0;
           pMouse->SetCursorBitmap("MICON1");
           GameUI_Footer_TimeLeft = 0;
@@ -2811,13 +2796,14 @@
                   pCurrentScreen = SCREEN_GAME;
                   pIcons_LOD->_4114F2();
                   v103 = quick_spell_at_page + 11 * player->lastOpenedSpellbookPage;
-                  if ( dword_50C9E8 < 40 )
+                  /*if ( dword_50C9E8 < 40 )
                   {
                     dword_50C9EC[3 * dword_50C9E8] = UIMSG_CastSpellFromBook;
                     dword_50C9EC[3 * dword_50C9E8 + 1] = v103;
                     dword_50C9EC[3 * dword_50C9E8 + 2] = uActiveCharacter - 1;
                     ++dword_50C9E8;
-                  }
+                  }*/
+                  pMessageQueue_50CBD0->AddMessage(UIMSG_CastSpellFromBook, v103, uActiveCharacter - 1);
                 }
                 else
                 {
@@ -3016,7 +3002,7 @@
           GUIWindow::Create(pCharacterScreen_AwardsBtn->uX, pCharacterScreen_AwardsBtn->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pCharacterScreen_AwardsBtn, 0);
           FillAwardsData();
           continue;
-        case UIMSG_AutonotesBook://не только Автозаметки (в процессе)
+        case UIMSG_ClickBooksBtn:
           switch ( uMessageParam )
           {
             case 11://Page UP
@@ -3027,12 +3013,12 @@
               BtnDown_flag = 1;
               pButton = pBtn_Book_1;
               break;
-            case 0:
+            case 0://Zoom plus
               pButton = pBtn_Book_1;
               BtnDown_flag = 1;
               break;
-            case 1:
-              pButton = pBtn_Book_2;//увеличить в MapsBook
+            case 1://Zoom minus
+              pButton = pBtn_Book_2;
               BtnUp_flag = 1;
               break;
             case 2://Potions
@@ -3116,13 +3102,9 @@
           pMouse->uPointingObjectID = PID(OBJECT_Player,v108);
           continue;
         case UIMSG_ShowStatus_ManaHP:
-          v109 = pGlobalTXT_LocalizationStrings[212];// "Spell Points"
-          v110 = pPlayers[uMessageParam];
-          v111 = v110->GetMaxMana();
-          v112 = v110->sMana;
-          v113 = pGlobalTXT_LocalizationStrings[108];// "Hit Points"
-          v114 = v110->GetMaxHealth();
-          sprintf(pTmpBuf, "%d / %d %s    %d / %d %s", v110->sHealth, v114, v113, v112, v111, v109);
+          sprintf(pTmpBuf, "%d / %d %s    %d / %d %s", pPlayers[uMessageParam]->sHealth, pPlayers[uMessageParam]->GetMaxHealth(), 
+                  pGlobalTXT_LocalizationStrings[108], pPlayers[uMessageParam]->sMana, pPlayers[uMessageParam]->GetMaxMana(), 
+                  pGlobalTXT_LocalizationStrings[212]);
           GameUI_SetFooterString(pTmpBuf);
           continue;
         case UIMSG_CHEST_ClickItem:
@@ -3146,7 +3128,6 @@
           }
           v115 = pMessageQueue_50CBD0->uNumMessages;
           if ( !pMessageQueue_50CBD0->uNumMessages )
-            //goto LABEL_768;
           {
             pMessageQueue_50CBD0->AddMessage(UIMSG_MouseLeftClickInScreen, 0, 0);
             /*if ( (signed int)v115 < 40 )
@@ -3220,7 +3201,7 @@
           if ( pCurrentScreen )
             continue;
           pParty->uFlags |= 2u;
-          GUIWindow::Create(0x207u, 0x88u, 0, 0, WINDOW_PressedButton2, (int)pBtn_ZoomOut, 0);
+          GUIWindow::Create(519, 136, 0, 0, WINDOW_PressedButton2, (int)pBtn_ZoomOut, 0);
           uNumSeconds = 131072;
           v118 = 2 * viewparams->uMinimapZoom;
           ++viewparams->field_28;
@@ -3250,7 +3231,7 @@
           if ( pCurrentScreen )
             continue;
           pParty->uFlags |= 2u;
-          GUIWindow::Create(0x23Eu, 0x88u, 0, 0, WINDOW_PressedButton2, (int)pBtn_ZoomIn, 0);
+          GUIWindow::Create(574, 136, 0, 0, WINDOW_PressedButton2, (int)pBtn_ZoomIn, 0);
           uNumSeconds = 32768;
           v118 = (unsigned __int64)((signed __int64)(signed int)viewparams->uMinimapZoom << 15) >> 16;
           --viewparams->field_28;