changeset 467:5d2667144526

m
author Ritor1
date Mon, 25 Feb 2013 11:09:55 +0600
parents 91e1ba340f39
children 8822405efad2
files GUIWindow.h mm7_2.cpp mm7_4.cpp mm7_5.cpp mm7_data.h
diffstat 5 files changed, 80 insertions(+), 87 deletions(-) [+]
line wrap: on
line diff
--- a/GUIWindow.h	Mon Feb 25 09:09:08 2013 +0600
+++ b/GUIWindow.h	Mon Feb 25 11:09:55 2013 +0600
@@ -259,7 +259,7 @@
   UIMSG_PlayerCreation_FaceNext = 0xAC,
   UIMSG_AD = 0xAD,
   UIMSG_AE = 0xAE,
-  UIMSG_AF = 0xAF,
+  UIMSG_ClickNPCTopic = 0xAF,
   UIMSG_CycleCharacters = 0xB0,
   UIMSG_B1 = 0xB1,
   UIMSG_B2 = 0xB2,
@@ -306,7 +306,7 @@
   UIMSG_16F = 0x16F,
   UIMSG_170 = 0x170,
   UIMSG_Game_Action = 0x194,
-  UIMSG_195 = 0x195,
+  UIMSG_ClickLearnSkillDialog = 0x195,
   UIMSG_OpenRestUI = 0x199,
   UIMSG_19A = 0x19A,
   UIMSG_TransitionUI_Confirm = 0x19B,
--- a/mm7_2.cpp	Mon Feb 25 09:09:08 2013 +0600
+++ b/mm7_2.cpp	Mon Feb 25 11:09:55 2013 +0600
@@ -3709,7 +3709,7 @@
 }
 
 //----- (004BCACC) --------------------------------------------------------
-void __fastcall sub_4BCACC_bounties(signed int a1)
+void __fastcall DrawLearnSkillDialog(signed int uMessageParam)
 {
   unsigned int v1; // edi@1
   //signed int v2; // ebx@1
@@ -3779,7 +3779,7 @@
     goto LABEL_13;
   if ( dword_F8B198 == 30 )
   {
-    if ( a1 == 17 )
+    if ( uMessageParam == 17 )
     {
       v4 = 0;
       v5 = 0;
@@ -3799,8 +3799,8 @@
   }
   v8 = window_SpeakInHouse;
   if ( (dword_F8B198 == 27 || dword_F8B198 == 28)
-    && (v1 = 0, *(&byte_4F09B1[32 * (unsigned __int8)*(&byte_4F0CCF[4 * (unsigned int)window_SpeakInHouse->ptr_1C] + a1)] + pParty->uDaysPlayed % 7))
-    || dword_F8B198 != 23 || a1 != 10 )
+    && (v1 = 0, *(&byte_4F09B1[32 * (unsigned __int8)*(&byte_4F0CCF[4 * (unsigned int)window_SpeakInHouse->ptr_1C] + uMessageParam)] + pParty->uDaysPlayed % 7))
+    || dword_F8B198 != 23 || uMessageParam != 10 )
   {
 LABEL_9:
     pDialogueWindow->Release();
@@ -3820,7 +3820,7 @@
     goto LABEL_10;
   }
 LABEL_11:
-  dword_F8B19C = a1;
+  dword_F8B19C = uMessageParam;
   if ( dword_F8B198 < 19 )
   {
     v9 = pIcons_LOD->LoadTexture(off_4F03B8[dword_F8B198], TEXTURE_16BIT_PALETTE);
@@ -3886,7 +3886,7 @@
         }
         if ( dword_F8B198 != 17 )
           return;
-        if ( a1 == 99 )
+        if ( uMessageParam == 99 )
         {
           v10 = (int)((char *)v8->ptr_1C - 102);
           v56 = v10;
@@ -4084,7 +4084,7 @@
           }
           goto LABEL_196;
         }
-        if ( a1 == 100 )
+        if ( uMessageParam == 100 )
         {
           pKeyActionMap->EnterText(1, 10, v8);
           goto LABEL_196;
@@ -4092,10 +4092,10 @@
       }
     }
   }
-  if ( a1 > 95 )
+  if ( uMessageParam > 95 )
   {
 LABEL_196:
-    switch ( a1 )
+    switch ( uMessageParam )
     {
       case 96:
         pDialogueWindow->eWindowType = WINDOW_MainMenu;
@@ -4127,25 +4127,25 @@
     }
     return;
   }
-  if ( a1 != 95 && a1 != 2 )
-  {
-    if ( a1 == 3 )
+  if ( uMessageParam != 95 && uMessageParam != 2 )
+  {
+    if ( uMessageParam == 3 )
     {
       dword_F8B19C = 3;
     }
     else
     {
-      if ( a1 == 4 )
+      if ( uMessageParam == 4 )
       {
         dword_F8B19C = 4;
       }
       else
       {
-        if ( a1 != 5 )
-        {
-          if ( a1 > 35 )
-          {
-            if ( a1 <= 72 )
+        if ( uMessageParam != 5 )
+        {
+          if ( uMessageParam > 35 )
+          {
+            if ( uMessageParam <= 72 )
             {
               v35 = pPlayers[uActiveCharacter];
               //v36 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)v8->ptr_1C] * 500.0);
@@ -4164,7 +4164,7 @@
               if (false)
               //if ( *(&byte_4ED94C[37 * v35->uClass] + v55) )
               {
-                v38 = (int)(&v35->uIntelligence + a1);
+                v38 = (int)(&v35->uIntelligence + uMessageParam);
                 if ( !*(short *)v38 )
                 {
                   if ( pParty->uNumGold < v37 )
@@ -4188,7 +4188,7 @@
             }
             else
             {
-              if ( a1 == 94 )
+              if ( uMessageParam == 94 )
               {
                 pDialogueWindow->eWindowType = WINDOW_MainMenu;
                 UI_CreateEndConversationButton();
@@ -4224,7 +4224,7 @@
   v43 = 0;
   //v44 = p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C];
   v44 = p2DEvents[(unsigned int)v8->ptr_1C - 1].uType;
-  if ( a1 == 2 )
+  if ( uMessageParam == 2 )
   {
     if ( _4F063C_smthn_by_2da_uType[v44] )
     {
--- a/mm7_4.cpp	Mon Feb 25 09:09:08 2013 +0600
+++ b/mm7_4.cpp	Mon Feb 25 11:09:55 2013 +0600
@@ -9382,32 +9382,30 @@
   NPCData *pCurrentNPCInfo; // ebp@1
   int pEventNumber; // ecx@8
   Player *v4; // esi@20
-  int v5; // eax@28
-  int v6; // eax@31
-  int v7; // eax@34
-  int v8; // eax@37
-  int v9; // eax@40
-  unsigned int v10; // eax@43
-  unsigned int v11; // eax@48
+  //int v5; // eax@28
+  //int v6; // eax@31
+  //int v7; // eax@34
+  //int v8; // eax@37
+  //int v9; // eax@40
+  //unsigned int v10; // eax@43
   char *v12; // eax@53
   char *v13; // eax@56
   char *v14; // eax@57
   char *v15; // eax@58
-  unsigned int v16; // ebp@62
+  //unsigned int v16; // ebp@62
   char *v17; // ecx@63
   char *v18; // eax@65
   const char *v19; // ecx@68
   //unsigned int v20; // eax@69
-  unsigned int v21; // ecx@70
+  signed int pPrice; // ecx@70
   char *v22; // [sp-Ch] [bp-18h]@73
-  int v23; // [sp-8h] [bp-14h]@49
+  //int v23; // [sp-8h] [bp-14h]@49
   char *v24; // [sp-8h] [bp-14h]@73
-  int v25; // [sp-4h] [bp-10h]@49
-
-  //v1 = a1;
+  //int v25; // [sp-4h] [bp-10h]@49
+
   uDialogueType = uMessageParam + 1;
   pCurrentNPCInfo = HouseNPCData[(unsigned int)((char *)pDialogueNPCCount + -(dword_591080 != 0) - 1)];
-  if ( uMessageParam <= 23 )
+  if ( uMessageParam <= 24 )
   {
   switch ( uMessageParam )
   {
@@ -9436,8 +9434,17 @@
       pEventNumber = pCurrentNPCInfo->evt_F;
       break;
     default:
-        goto _return;
-  }
+      goto _return;
+  }
+  /*switch ( pEventNumber )
+  {
+    case 139:
+      sub_4B1ECE();
+      goto _return;
+    case 311:
+      sub_4BBA85_bounties();
+    goto _return;
+  }*/
   if ( pEventNumber < 200 || pEventNumber > 310 )
     {
       if ( pEventNumber < 400 || pEventNumber > 410 )
@@ -9477,7 +9484,7 @@
   {
     if ( uMessageParam == 77 )
     {
-      v16 = pCurrentNPCInfo->uProfession;
+      //v16 = pCurrentNPCInfo->uProfession;
       if (dialogue_show_profession_details)
         v17 = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession - 1].pJoinText;
       else
@@ -9540,37 +9547,34 @@
           switch ( dword_F8B1D8 )
           {
             case 19:
-              v10 = pCurrentNPCInfo->evt_A;
-              if ( (signed int)v10 >= 400 && (signed int)v10 <= 416 )
+              pEventNumber = pCurrentNPCInfo->evt_A;
+              if ( pEventNumber >= 400 && pEventNumber <= 416 )
                 pCurrentNPCInfo->evt_A = 0;
               break;
             case 20:
-              v9 = pCurrentNPCInfo->evt_B;
-              if ( v9 >= 400 && v9 <= 416 )
+              pEventNumber = pCurrentNPCInfo->evt_B;
+              if ( pEventNumber >= 400 && pEventNumber <= 416 )
                 pCurrentNPCInfo->evt_B = 0;
               break;
             case 21:
-              v8 = pCurrentNPCInfo->evt_C;
-              if ( v8 >= 400 && v8 <= 416 )
+              pEventNumber = pCurrentNPCInfo->evt_C;
+              if ( pEventNumber >= 400 && pEventNumber <= 416 )
                 pCurrentNPCInfo->evt_C = 0;
               break;
             case 22:
-              v7 = pCurrentNPCInfo->evt_D;
-              if ( v7 >= 400 && v7 <= 416 )
+              pEventNumber = pCurrentNPCInfo->evt_D;
+              if ( pEventNumber >= 400 && pEventNumber <= 416 )
                 pCurrentNPCInfo->evt_D = 0;
               break;
             case 23:
-              v6 = pCurrentNPCInfo->evt_E;
-              if ( v6 >= 400 && v6 <= 416 )
+              pEventNumber = pCurrentNPCInfo->evt_E;
+              if ( pEventNumber >= 400 && pEventNumber <= 416 )
                 pCurrentNPCInfo->evt_E = 0;
               break;
             case 24:
-              v5 = pCurrentNPCInfo->evt_F;
-              if ( v5 >= 400 )
-              {
-                if ( v5 <= 416 )
-                  pCurrentNPCInfo->evt_F = 0;
-              }
+              pEventNumber = pCurrentNPCInfo->evt_F;
+              if ( pEventNumber >= 400 && pEventNumber <= 416)
+                pCurrentNPCInfo->evt_F = 0;
               break;
           }
           pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
@@ -9581,13 +9585,10 @@
             *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
             ++pMessageQueue_50CBD0->uNumMessages;
           }*/
-          v11 = uActiveCharacter;
+          //v11 = uActiveCharacter;
           if ( uActiveCharacter )
           {
-            v25 = 0;
-            v23 = SPEECH_86;
-LABEL_50:
-            pPlayers[v11]->PlaySound((PlayerSpeech)v23, v25);
+            pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)SPEECH_86, 0);
             goto _return;
           }
         }
@@ -9597,28 +9598,25 @@
   }
   if ( pParty->pHirelings[0].pName && pParty->pHirelings[1].pName )
   {
-    v19 = pGlobalTXT_LocalizationStrings[533];  // ""I cannot join you, you're party is full""
-LABEL_77:
-    ShowStatusBarString(v19, 2u);
+    ShowStatusBarString(pGlobalTXT_LocalizationStrings[533], 2);// ""I cannot join you, you're party is full""
     goto _return;
   }
-  //v20 = v2->uProfession;
   if ( pCurrentNPCInfo->uProfession != 51 )
   {
-    v21 = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession - 1].uHirePrice;
-    if ( pParty->uNumGold < v21 )
-    {
-      ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
+    pPrice = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession - 1].uHirePrice;
+    if ( pParty->uNumGold < pPrice )
+    {
+      ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2);
       dialogue_show_profession_details = false;
       uDialogueType = 13;
       ptr_F8B1E8 = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession - 1].pJoinText;
       ptr_F8B1E8 = BuilDialogueString((char *)ptr_F8B1E8, uActiveCharacter - 1, 0, 0, 0, 0);
       if ( uActiveCharacter )
         pPlayers[uActiveCharacter]->PlaySound(SPEECH_NotEnoughGold, 0);
-      v19 = pGlobalTXT_LocalizationStrings[155];
-      goto LABEL_77;
-    }
-    Party::TakeGold(v21);
+      ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2);
+      goto _return;
+    }
+    Party::TakeGold(pPrice);
   }
   //LOBYTE(v2->uFlags) |= 0x80u;
   pCurrentNPCInfo->uFlags = 128;
@@ -9650,13 +9648,8 @@
     *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
     ++pMessageQueue_50CBD0->uNumMessages;
   }*/
-  v11 = uActiveCharacter;
   if ( uActiveCharacter )
-  {
-    v25 = 0;
-    v23 = 61;
-    goto LABEL_50;
-  }
+    pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)61, 0);
 _return:
   pVideoPlayer->_4BF5B2();//HouseVideo
 }
@@ -11045,7 +11038,7 @@
 //----- (004B3EF0) --------------------------------------------------------
 void __fastcall DrawJoinGuildWindow(int pEventNumber)
 {
-  uDialogueType = 81;
+  uDialogueType = 81;//enum JoinGuildDialog
   ptr_F8B1E8 = (char *)pNPCTopics[pEventNumber + 99].pText;
   ContractSelectText(pEventNumber);
   pDialogueWindow->Release();
--- a/mm7_5.cpp	Mon Feb 25 09:09:08 2013 +0600
+++ b/mm7_5.cpp	Mon Feb 25 11:09:55 2013 +0600
@@ -393,11 +393,11 @@
         case UIMSG_51:
           sub_4BDB56_buy_skill____();
           continue;
-        case UIMSG_AF://Click topic
-          ClickNPCTopic(uMessageParam);//CheckNPCTopic
-          continue;
-        case UIMSG_195:
-          sub_4BCACC_bounties(uMessageParam);
+        case UIMSG_ClickNPCTopic:
+          ClickNPCTopic(uMessageParam);
+          continue;
+        case UIMSG_ClickLearnSkillDialog:
+          DrawLearnSkillDialog(uMessageParam);
           continue;
         case UIMSG_SelectDialogueOption:
           OnSelectDialogueOption((DIALOGUE_TYPE)uMessageParam);
--- a/mm7_data.h	Mon Feb 25 09:09:08 2013 +0600
+++ b/mm7_data.h	Mon Feb 25 11:09:55 2013 +0600
@@ -1005,7 +1005,7 @@
 extern __int16 word_4F0576[]; // weak
 extern __int16 word_4F0578[]; // weak
 extern __int16 word_4F05AE[]; // weak
-extern char _4F063C_smthn_by_2da_uType[3]; // weak
+extern char _4F063C_smthn_by_2da_uType[31]; // weak
 extern __int16 word_4F063E[290];
 extern __int16 word_4F06D8[22];
 extern __int16 word_4F0704[40];
@@ -2342,7 +2342,7 @@
 void __cdecl ArenaFight();
 struct Texture *__cdecl sub_4BC8D5();
 struct GUIButton *__cdecl UI_CreateEndConversationButton();
-void __fastcall sub_4BCACC_bounties(signed int a1);
+void __fastcall DrawLearnSkillDialog(signed int uMessageParam);
 signed int __cdecl sub_4BD8B5();
 bool __fastcall sub_4BDAAF(ItemGen *a1, int _2da_idx);
 void __cdecl sub_4BDB56_buy_skill____();