changeset 955:21cc2b274220

m
author Ritor1
date Thu, 02 May 2013 11:02:48 +0600
parents 27bfe64b13b5
children e9292c58644a
files UIRest.cpp mm7_4.cpp mm7_5.cpp
diffstat 3 files changed, 218 insertions(+), 231 deletions(-) [+]
line wrap: on
line diff
--- a/UIRest.cpp	Mon Apr 29 09:18:19 2013 +0600
+++ b/UIRest.cpp	Thu May 02 11:02:48 2013 +0600
@@ -50,129 +50,71 @@
 
 //----- (0041F6C1) --------------------------------------------------------
 void __cdecl RestUI_Initialize()
-    {
-    Player *v0; // eax@10
+{
+  Player *pPlayer; // eax@10
 
-    if ( !dword_506F14 )
-        pAudioPlayer->StopChannels(-1, -1);
-    if ( pCurrentScreen )
-        {
-        pGUIWindow_CurrentMenu->Release();
-        pCurrentScreen = SCREEN_GAME;
-        viewparams->bRedrawGameUI = 1;
-        }
-    pEventTimer->Pause();
-    if ( dword_506F14 != 2 )
-        GUIWindow::Create(518u, 450u, 0, 0, (enum WindowType)90, (int)pBtn_Rest, 0);
-    _506F18_num_hours_to_sleep = 0;
-    dword_506F14 = 0;
-    uRestUI_FoodRequiredToRest = 2;
-    if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor)
-        uRestUI_FoodRequiredToRest = pOutdoor->GetNumFoodRequiredToRestInCurrentPos(
-        pParty->vPosition.x,
-        pParty->vPosition.y,
-        pParty->vPosition.z);
-    if ( PartyHasDragon() )
-        {
-        v0 = pParty->pPlayers;//[0].uClass;
-        while ( v0 <= &pParty->pPlayers[3] )
-            {
-            ++v0;
-            if ( v0 > &pParty->pPlayers[3] )
-                break;
-            }
-        if(v0->classType == PLAYER_CLASS_WARLOCK)
-            ++uRestUI_FoodRequiredToRest;
-        }
-    if ( CheckHiredNPCSpeciality(Porter) )
-        --uRestUI_FoodRequiredToRest;
-    if ( CheckHiredNPCSpeciality(QuarterMaster) )
-        uRestUI_FoodRequiredToRest -= 2;
-    if ( CheckHiredNPCSpeciality(Gypsy) )
-        --uRestUI_FoodRequiredToRest;
-    if ( uRestUI_FoodRequiredToRest < 1 )
-        uRestUI_FoodRequiredToRest = 1;
-    if ( !_strcmpi(pCurrentMapName, "d29.blv") && (unsigned __int16)_449B57_test_bit(pParty->_quest_bits, 98) )
-        uRestUI_FoodRequiredToRest = 0;
-    ++pIcons_LOD->uTexturePacksCount;
-    if ( !pIcons_LOD->uNumPrevLoadedFiles )
-        pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
-    pCurrentScreen = SCREEN_REST;
-    _507CD4_RestUI_hourglass_anim_controller = 0;
-    uTextureID_RestUI_restmain = pIcons_LOD->LoadTexture("restmain", TEXTURE_16BIT_PALETTE);
-    uTextureID_RestUI_restb1 = pIcons_LOD->LoadTexture("restb1", TEXTURE_16BIT_PALETTE);
-    uTextureID_RestUI_restb2 = pIcons_LOD->LoadTexture("restb2", TEXTURE_16BIT_PALETTE);
-    uTextureID_RestUI_restb3 = pIcons_LOD->LoadTexture("restb3", TEXTURE_16BIT_PALETTE);
-    uTextureID_RestUI_restb4 = pIcons_LOD->LoadTexture("restb4", TEXTURE_16BIT_PALETTE);
-    uTextureID_RestUI_restexit = pIcons_LOD->LoadTexture("restexit", TEXTURE_16BIT_PALETTE);
-    LoadActualSkyFrame();
-    pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640u, 480u, (enum WindowType)16, 0, 0);
-    pButton_RestUI_Exit = pGUIWindow_CurrentMenu->CreateButton(
-        280u,
-        297u,
-        154u,
-        37u,
-        1,
-        0,
-        UIMSG_ExitRest,
-        0,
-        0,
-        "",
-        (Texture *)(uTextureID_RestUI_restexit != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restexit] : 0),
-        0);
-    pButton_RestUI_Main = pGUIWindow_CurrentMenu->CreateButton(
-        24u,
-        154u,
-        225u,
-        37u,
-        1,
-        0,
-        UIMSG_Rest8Hour,
-        0,
-        0x52u,
-        "",
-        (Texture *)(uTextureID_RestUI_restb4 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restb4] : 0),
-        0);
-    pButton_RestUI_WaitUntilDawn = pGUIWindow_CurrentMenu->CreateButton(
-        61u,
-        232u,
-        154u,
-        33u,
-        1,
-        0,
-        UIMSG_AlreadyResting,
-        0,
-        0x44u,
-        "",
-        (Texture *)(uTextureID_RestUI_restb1 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restb1] : 0),
-        0);
-    pButton_RestUI_Wait1Hour = pGUIWindow_CurrentMenu->CreateButton(
-        61u,
-        264u,
-        154u,
-        33u,
-        1,
-        0,
-        UIMSG_Wait1Hour,
-        0,
-        0x48u,
-        "",
-        (Texture *)(uTextureID_RestUI_restb2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restb2] : 0),
-        0);
-    pButton_RestUI_Wait5Minutes = pGUIWindow_CurrentMenu->CreateButton(
-        61u,
-        296u,
-        154u,
-        33u,
-        1,
-        0,
-        UIMSG_Wait5Minutes,
-        0,
-        0x4Du,
-        "",
-        (Texture *)(uTextureID_RestUI_restb3 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restb3] : 0),
-        0);
+  if ( !dword_506F14 )
+    pAudioPlayer->StopChannels(-1, -1);
+  if ( pCurrentScreen )
+  {
+    pGUIWindow_CurrentMenu->Release();
+    pCurrentScreen = SCREEN_GAME;
+    viewparams->bRedrawGameUI = 1;
+  }
+  pEventTimer->Pause();
+  if ( dword_506F14 != 2 )
+    GUIWindow::Create(518, 450, 0, 0, (enum WindowType)90, (int)pBtn_Rest, 0);
+  _506F18_num_hours_to_sleep = 0;
+  dword_506F14 = 0;
+  uRestUI_FoodRequiredToRest = 2;
+  if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor)
+    uRestUI_FoodRequiredToRest = pOutdoor->GetNumFoodRequiredToRestInCurrentPos(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z);
+  if ( PartyHasDragon() )
+  {
+    pPlayer = pParty->pPlayers;//[0].uClass; this incorrect
+    while ( pPlayer <= &pParty->pPlayers[3] )
+    {
+      ++pPlayer;
+      if ( pPlayer > &pParty->pPlayers[3] )
+        break;
     }
+    if (pPlayer->classType == PLAYER_CLASS_WARLOCK)
+      ++uRestUI_FoodRequiredToRest;
+  }
+  if ( CheckHiredNPCSpeciality(Porter) )
+    --uRestUI_FoodRequiredToRest;
+  if ( CheckHiredNPCSpeciality(QuarterMaster) )
+    uRestUI_FoodRequiredToRest -= 2;
+  if ( CheckHiredNPCSpeciality(Gypsy) )
+    --uRestUI_FoodRequiredToRest;
+  if ( uRestUI_FoodRequiredToRest < 1 )
+    uRestUI_FoodRequiredToRest = 1;
+  if ( !_strcmpi(pCurrentMapName, "d29.blv") && (unsigned __int16)_449B57_test_bit(pParty->_quest_bits, 98) )
+    uRestUI_FoodRequiredToRest = 0;
+  ++pIcons_LOD->uTexturePacksCount;
+  if ( !pIcons_LOD->uNumPrevLoadedFiles )
+    pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
+  pCurrentScreen = SCREEN_REST;
+  _507CD4_RestUI_hourglass_anim_controller = 0;
+  uTextureID_RestUI_restmain = pIcons_LOD->LoadTexture("restmain", TEXTURE_16BIT_PALETTE);
+  uTextureID_RestUI_restb1 = pIcons_LOD->LoadTexture("restb1", TEXTURE_16BIT_PALETTE);
+  uTextureID_RestUI_restb2 = pIcons_LOD->LoadTexture("restb2", TEXTURE_16BIT_PALETTE);
+  uTextureID_RestUI_restb3 = pIcons_LOD->LoadTexture("restb3", TEXTURE_16BIT_PALETTE);
+  uTextureID_RestUI_restb4 = pIcons_LOD->LoadTexture("restb4", TEXTURE_16BIT_PALETTE);
+  uTextureID_RestUI_restexit = pIcons_LOD->LoadTexture("restexit", TEXTURE_16BIT_PALETTE);
+  LoadActualSkyFrame();
+  pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640u, 480u, (enum WindowType)16, 0, 0);
+  pButton_RestUI_Exit = pGUIWindow_CurrentMenu->CreateButton(280, 297, 154, 37, 1, 0, UIMSG_ExitRest, 0, 0, "",
+        (Texture *)(uTextureID_RestUI_restexit != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restexit] : 0), 0);
+  pButton_RestUI_Main = pGUIWindow_CurrentMenu->CreateButton(24, 154, 225, 37, 1, 0, UIMSG_Rest8Hour, 0, 0x52u, "",
+        (Texture *)(uTextureID_RestUI_restb4 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restb4] : 0), 0);
+  pButton_RestUI_WaitUntilDawn = pGUIWindow_CurrentMenu->CreateButton(61, 232, 154, 33, 1, 0, UIMSG_AlreadyResting, 0, 0x44u, "",
+        (Texture *)(uTextureID_RestUI_restb1 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restb1] : 0), 0);
+  pButton_RestUI_Wait1Hour = pGUIWindow_CurrentMenu->CreateButton(61, 264, 154, 33, 1, 0, UIMSG_Wait1Hour, 0, 0x48u, "",
+        (Texture *)(uTextureID_RestUI_restb2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restb2] : 0), 0);
+  pButton_RestUI_Wait5Minutes = pGUIWindow_CurrentMenu->CreateButton(61, 296, 154, 33, 1, 0, UIMSG_Wait5Minutes, 0, 0x4Du, "",
+        (Texture *)(uTextureID_RestUI_restb3 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restb3] : 0), 0);
+}
 
 //----- (0041FA01) --------------------------------------------------------
 void __cdecl RestUI_Draw()
--- a/mm7_4.cpp	Mon Apr 29 09:18:19 2013 +0600
+++ b/mm7_4.cpp	Thu May 02 11:02:48 2013 +0600
@@ -6843,14 +6843,14 @@
 //----- (004B254D) --------------------------------------------------------
 char *__thiscall _4B254D_SkillMasteryTeacher(int _this)
 {
-  Player *v1; // esi@1
+  //Player *v1; // esi@1
   int v2; // edx@1
   int v3; // ecx@1
   int v4; // edi@1
-  int v5; // eax@7
+  int pClassType; // eax@7
   int v6; // eax@7
   int v7; // ebx@7
-  int v8; // ebx@8
+  //int v8; // ebx@8
   signed int v9; // esi@8
   int v10; // eax@8
   char *v11; // ecx@8
@@ -6858,27 +6858,26 @@
   char *v13; // edx@9
   signed int v14; // edi@10
   unsigned int v16; // eax@29
-  int v17; // eax@36
+  //int v17; // eax@36
   char v18; // cl@46
   __int16 v19; // dx@56
   int v20; // eax@60
-  char *v21; // [sp-Ch] [bp-38h]@82
-  const char *v22; // [sp-8h] [bp-34h]@21
-  unsigned int v23; // [sp-8h] [bp-34h]@38
-  char *v24; // [sp-8h] [bp-34h]@82
+  //char *v21; // [sp-Ch] [bp-38h]@82
+  //const char *v22; // [sp-8h] [bp-34h]@21
+  //unsigned int v23; // [sp-8h] [bp-34h]@38
+  //char *v24; // [sp-8h] [bp-34h]@82
   char *v25; // [sp-4h] [bp-30h]@14
-  int v26; // [sp-4h] [bp-30h]@38
-  int v27; // [sp-4h] [bp-30h]@82
+  //int v26; // [sp-4h] [bp-30h]@38
+  //int v27; // [sp-4h] [bp-30h]@82
   char v28[4]; // [sp+Ch] [bp-20h]@9
   int v29; // [sp+10h] [bp-1Ch]@13
   int v30; // [sp+14h] [bp-18h]@15
   int v31; // [sp+18h] [bp-14h]@16
   unsigned __int16 a1[2]; // [sp+1Ch] [bp-10h]@7
-  int v33; // [sp+20h] [bp-Ch]@7
+  //int v33; // [sp+20h] [bp-Ch]@7
   int v34; // [sp+24h] [bp-8h]@7
   char *v35; // [sp+28h] [bp-4h]@1
 
-  v1 = pPlayers[uActiveCharacter];
   contract_approved = 0;
   v2 = (_this - 200) % 3;
   v3 = (_this - 200) / 3;
@@ -6906,18 +6905,18 @@
     gold_transaction_amount = 2000;
     dword_F8B1B0 = 2;
   }
-  v5 = v1->classType;
-  v33 = v5;
-  v6 = byte_4ED970_skill_learn_ability_by_class_table[v5][v3];
-  *(int *)a1 = v1->pActiveSkills[v3];
+  pClassType = pPlayers[uActiveCharacter]->classType;
+  //v33 = pClassType;
+  v6 = byte_4ED970_skill_learn_ability_by_class_table[pClassType][v3];
+  *(int *)a1 = pPlayers[uActiveCharacter]->pActiveSkills[v3];
   v7 = a1[0] & 0x3F;
   v34 = v2 + 2;
   if ( v6 < v2 + 2 )
   {
-    v8 = v33;
+    //v8 = v33;
     v9 = 0;
-    v10 = v33 - v33 % 4;
-    v11 = &byte_4ED970_skill_learn_ability_by_class_table[v33 - v33 % 4][v3];
+    v10 = pClassType - pClassType % 4;
+    v11 = &byte_4ED970_skill_learn_ability_by_class_table[pClassType - pClassType % 4][v3];
     do
     {
       v12 = (unsigned __int8)*v11;
@@ -6942,11 +6941,11 @@
     }
     else
     {
-      if ( v30 == v14 )
+      if ( v30 == v14 )//crash
       {
         if ( v31 == v14 )
         {
-          sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[634], pClassNames[v10 + 2], pClassNames[v10 + 3]);
+          sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[634], pClassNames[v10 + 2], pClassNames[v10 + 3]);//Вы должны достичь звания %s или %s для обучения этому уровню навыка.
           return pTmpBuf;
         }
         v25 = pClassNames[v10 + 2];
@@ -6955,19 +6954,16 @@
       {
         if ( v31 != v14 )
         {
-          v25 = pClassNames[v8];
-          v22 = pGlobalTXT_LocalizationStrings[632];
-          goto LABEL_23;
+          sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[632], pClassNames[pClassType]);//Этот уровень навыка не может быть постигнут классом %s.
+          return pTmpBuf;
         }
         v25 = pClassNames[v10 + 3];
       }
     }
-    v22 = pGlobalTXT_LocalizationStrings[633];
-LABEL_23:
-    sprintf(pTmpBuf, v22, v25);
+    sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[633], v25);//Вы должны достичь звания %s для обучения этому уровню навыка.
     return pTmpBuf;
   }
-  if ( !v1->CanAct() )
+  if ( !pPlayers[uActiveCharacter]->CanAct() )
     return (char *)pNPCTopics[122].pText;
   if ( !v7 )
     return (char *)pNPCTopics[131].pText;
@@ -6980,11 +6976,8 @@
     {
       if ( (signed int)v16 >= 2 && v7 >= 7 )
       {
-        v17 = dword_F8B1AC_award_bit_number;
         switch ( dword_F8B1AC_award_bit_number )
         {
-          default:
-            goto LABEL_41;
           case 12:
           case 13:
           case 14:
@@ -6996,26 +6989,40 @@
             goto LABEL_42;
           case 19:
             v19 = 114;
-            goto LABEL_57;
+            if ( !(unsigned __int16)_449B57_test_bit(pParty->_quest_bits, v19) )
+              return v35;
+            if ( !gold_transaction_amount )
+              goto LABEL_79;
+            goto LABEL_42;
           case 20:
             v19 = 110;
-LABEL_57:
             if ( !(unsigned __int16)_449B57_test_bit(pParty->_quest_bits, v19) )
               return v35;
-            goto LABEL_40;
+            if ( !gold_transaction_amount )
+              goto LABEL_79;
+            goto LABEL_42;
           case 22:
-            v20 = v1->GetBaseWillpower();
-            goto LABEL_61;
+            v20 = pPlayers[uActiveCharacter]->GetBaseWillpower();
+            if ( v20 < 50 )
+              return v35;
+            if ( !gold_transaction_amount )
+              goto LABEL_79;
+            goto LABEL_42;
           case 24:
             gold_transaction_amount = 2500;
-            v20 = v1->GetBaseEndurance();
-            goto LABEL_61;
-          case 36:
-            v20 = v1->GetBaseIntelligence();
-LABEL_61:
+            v20 = pPlayers[uActiveCharacter]->GetBaseEndurance();
             if ( v20 < 50 )
               return v35;
-            goto LABEL_40;
+            if ( !gold_transaction_amount )
+              goto LABEL_79;
+            goto LABEL_42;
+          case 36:
+            v20 = pPlayers[uActiveCharacter]->GetBaseIntelligence();
+            if ( v20 < 50 )
+              return v35;
+            if ( !gold_transaction_amount )
+              goto LABEL_79;
+            goto LABEL_42;
           case 21:
           case 23:
           case 25:
@@ -7033,50 +7040,75 @@
             gold_transaction_amount = 3000;
             goto LABEL_42;
           case 7:
-            goto LABEL_67;
+            gold_transaction_amount = 0;
+            if ( !gold_transaction_amount )
+              goto LABEL_79;
+            goto LABEL_42;
+          default:
+            if ( !gold_transaction_amount )
+              goto LABEL_79;
+            goto LABEL_42;
         }
-        goto LABEL_67;
+        gold_transaction_amount = 0;
+        if ( !gold_transaction_amount )
+          goto LABEL_79;
+        goto LABEL_42;
       }
     }
     else
     {
       if ( v34 != 4 )
       {
-LABEL_40:
-        v17 = dword_F8B1AC_award_bit_number;
-        goto LABEL_41;
+        if ( !gold_transaction_amount )
+          goto LABEL_79;
+        goto LABEL_42;
       }
       if ( (signed int)v16 >= 3 && v7 >= 10 )
       {
-        v17 = dword_F8B1AC_award_bit_number;
         switch ( dword_F8B1AC_award_bit_number )
         {
           case 19:
-            if ( v1->_49327B(0x22u, 1) == 1 )
-              goto LABEL_40;
-            v26 = 1;
-            v23 = 26;
-            goto LABEL_39;
-          default:
-            goto LABEL_41;
+            if ( pPlayers[uActiveCharacter]->_49327B(0x22u, 1) == 1 )
+            {
+              if ( !gold_transaction_amount )
+                goto LABEL_79;
+              goto LABEL_42;
+            }
+            if ( pPlayers[uActiveCharacter]->_49327B(26, 1) == 1 )
+            {
+              if ( !gold_transaction_amount )
+                goto LABEL_79;
+              goto LABEL_42;
+            }
+            return v35;
           case 20:
-            if ( v1->_49327B(0x23u, 1) == 1 )
-              goto LABEL_40;
-            v26 = 1;
-            v23 = 27;
-LABEL_39:
-            if ( v1->_49327B(v23, v26) == 1 )
-              goto LABEL_40;
+            if ( pPlayers[uActiveCharacter]->_49327B(0x23u, 1) == 1 )
+            {
+              if ( !gold_transaction_amount )
+                goto LABEL_79;
+              goto LABEL_42;
+            }
+            if ( pPlayers[uActiveCharacter]->_49327B(27, 1) == 1 )
+            {
+              if ( !gold_transaction_amount )
+                goto LABEL_79;
+              goto LABEL_42;
+            }
             return v35;
           case 30:
-            v18 = LOBYTE(v1->pActiveSkills[31]);
-            goto LABEL_47;
-          case 31:
-            v18 = LOBYTE(v1->pActiveSkills[30]);
-LABEL_47:
+            v18 = LOBYTE(pPlayers[uActiveCharacter]->pActiveSkills[31]);
             if ( (v18 & 0x3Fu) < 0xA )
               return v35;
-            goto LABEL_41;
+            if ( !gold_transaction_amount )
+              goto LABEL_79;
+            goto LABEL_42;
+          case 31:
+            v18 = LOBYTE(pPlayers[uActiveCharacter]->pActiveSkills[30]);
+            if ( (v18 & 0x3Fu) < 0xA )
+              return v35;
+            if ( !gold_transaction_amount )
+              goto LABEL_79;
+            goto LABEL_42;
           case 21:
           case 23:
           case 24:
@@ -7096,46 +7128,66 @@
             goto LABEL_42;
           case 7:
             break;
+          default:
+            if ( !gold_transaction_amount )
+              goto LABEL_79;
+            goto LABEL_42;
         }
-LABEL_67:
         gold_transaction_amount = 0;
-        goto LABEL_41;
+        if ( !gold_transaction_amount )
+          goto LABEL_79;
+        goto LABEL_42;
       }
     }
     return v35;
   }
   if ( v7 < 4 )
     return v35;
-  v17 = dword_F8B1AC_award_bit_number;
   if ( dword_F8B1AC_award_bit_number > 27 )
   {
     if ( dword_F8B1AC_award_bit_number != 29
       && dword_F8B1AC_award_bit_number != 32
       && (dword_F8B1AC_award_bit_number <= 33 || dword_F8B1AC_award_bit_number > 35) )
     {
-LABEL_41:
       if ( !gold_transaction_amount )
         goto LABEL_79;
       goto LABEL_42;
     }
-LABEL_87:
     gold_transaction_amount = 500;
-    goto LABEL_41;
+    if ( !gold_transaction_amount )
+      goto LABEL_79;
+    goto LABEL_42;
   }
   if ( dword_F8B1AC_award_bit_number >= 23 )
-    goto LABEL_87;
+  {
+    gold_transaction_amount = 500;
+    if ( !gold_transaction_amount )
+      goto LABEL_79;
+    goto LABEL_42;
+  }
   if ( dword_F8B1AC_award_bit_number == 7 )
   {
     gold_transaction_amount = 0;
     goto LABEL_79;
   }
   if ( dword_F8B1AC_award_bit_number <= 7 )
-    goto LABEL_41;
+  {
+    if ( !gold_transaction_amount )
+      goto LABEL_79;
+    goto LABEL_42;
+  }
   if ( dword_F8B1AC_award_bit_number > 18 )
   {
     if ( dword_F8B1AC_award_bit_number != 21 )
-      goto LABEL_41;
-    goto LABEL_87;
+    {
+      if ( !gold_transaction_amount )
+        goto LABEL_79;
+      goto LABEL_42;
+    }
+    gold_transaction_amount = 500;
+    if ( !gold_transaction_amount )
+      goto LABEL_79;
+    goto LABEL_42;
   }
   gold_transaction_amount = 1000;
 LABEL_42:
@@ -7145,26 +7197,19 @@
   contract_approved = 1;
   if ( v34 == 2 )
   {
-    v27 = gold_transaction_amount;
-    v24 = pSkillNames[v17];
-    v21 = pGlobalTXT_LocalizationStrings[433];
-    goto LABEL_90;
+    sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[534],//Получить степень ^Pr[%s] в навыке ^Pr[%s] за ^I[%lu] золот^L[ой;ых;ых]
+              pGlobalTXT_LocalizationStrings[433], pSkillNames[dword_F8B1AC_award_bit_number], gold_transaction_amount);//Эксперт
+    return pTmpBuf2;
   }
   if ( v34 == 3 )
   {
-    v27 = gold_transaction_amount;
-    v24 = pSkillNames[v17];
-    v21 = pGlobalTXT_LocalizationStrings[432];
-    goto LABEL_90;
+    sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[534],
+              pGlobalTXT_LocalizationStrings[432], pSkillNames[dword_F8B1AC_award_bit_number], gold_transaction_amount);//Мастер
+    return pTmpBuf2;
   }
   if ( v34 == 4 )
-  {
-    v27 = gold_transaction_amount;
-    v24 = pSkillNames[v17];
-    v21 = pGlobalTXT_LocalizationStrings[225];
-LABEL_90:
-    sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[534], v21, v24, v27);
-  }
+    sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[534],
+              pGlobalTXT_LocalizationStrings[225], pSkillNames[dword_F8B1AC_award_bit_number], gold_transaction_amount);//Великий Магистр
   return pTmpBuf2;
 }
 
--- a/mm7_5.cpp	Mon Apr 29 09:18:19 2013 +0600
+++ b/mm7_5.cpp	Thu May 02 11:02:48 2013 +0600
@@ -4544,7 +4544,7 @@
   //bool uPlayerID; // eax@3
   //Player *pPlayer; // edi@4
   Actor *pMonster; // esi@7
-  SpriteObject *v9; // ebx@12
+  //SpriteObject *v9; // ebx@12
   int v10; // eax@12
   int v11; // ebx@12
   unsigned int v12; // ecx@12
@@ -4595,7 +4595,7 @@
   PlayerEquipment *v57; // [sp+48h] [bp-24h]@10
   //int v58; // [sp+4Ch] [bp-20h]@10
   int v59; // [sp+50h] [bp-1Ch]@1
-  unsigned int uActorID_Monster_; // [sp+54h] [bp-18h]@1
+  //unsigned int uActorID_Monster_; // [sp+54h] [bp-18h]@1
   int v61; // [sp+58h] [bp-14h]@1
   bool v62; // [sp+5Ch] [bp-10h]@1
   int uDamageAmount; // [sp+60h] [bp-Ch]@1
@@ -4604,7 +4604,7 @@
 
   //v3 = a1;
   v4 = 0;
-  uActorID_Monster_ = uActorID_Monster;
+  //uActorID_Monster_ = uActorID_Monster;
   //v54 = a1;
   uDamageAmount = 0;
   a4 = 0;
@@ -4626,7 +4626,7 @@
 
   assert(PID_ID(abs(a1)) < 4);
   auto player = &pParty->pPlayers[PID_ID(a1)];
-  pMonster = &pActors[uActorID_Monster_];
+  pMonster = &pActors[uActorID_Monster];
   //uPlayerID = pMonster->IsAlive();
   if (pMonster->IsNotAlive())
     return;
@@ -4675,10 +4675,10 @@
         break;
       }
     }
-    v50 = pMonster->pMonsterInfo.uID;
+    //v50 = pMonster->pMonsterInfo.uID;
     a2 = 4;
     //v27 = player->CalculateMeleeDamageTo(0, 0, v50);
-    uDamageAmount = player->CalculateMeleeDamageTo(0, 0, v50);
+    uDamageAmount = player->CalculateMeleeDamageTo(0, 0, pMonster->pMonsterInfo.uID);
     //if ( !v57 )
       goto LABEL_67;
     //goto LABEL_69;
@@ -4689,12 +4689,12 @@
   v61 = v4->field_60_distance_related_prolly_lod;
   if ( !v19 )
   {
-    v9 = (SpriteObject *)uDamageAmount;
-    v50 = pParty->vPosition.x - *(int *)(uDamageAmount + 4);
+    //v9 = v4;
+	v50 = pParty->vPosition.x - v4->vPosition.x;
     //v55 = abs(v50);
-    pMonsterName = (char *)(pParty->vPosition.y - v9->vPosition.y);
+    pMonsterName = (char *)(pParty->vPosition.y - v4->vPosition.y);
     //v51 = (unsigned __int64 *)abs((int)pMonsterName);
-    pPlayerName = (char *)(pParty->vPosition.z - v9->vPosition.z);
+    pPlayerName = (char *)(pParty->vPosition.z - v4->vPosition.z);
     v52 = abs((int)pPlayerName);
     v61 = abs(v50);
     v10 = abs(v50);
@@ -4729,7 +4729,7 @@
     {
       v61 = 1;
     }
-    v4 = (SpriteObject *)uDamageAmount;
+    //v4 = (SpriteObject *)uDamageAmount;
   }
 
   v15 = v4->spell_id;
@@ -4882,8 +4882,8 @@
   }
   if ( pMonster->sCurrentHP > 0 )
   {
-    Actor::Stun(uActorID_Monster_, a1, 0);
-    Actor::AggroSurroundingPeasants(uActorID_Monster_, 1);
+    Actor::Stun(uActorID_Monster, a1, 0);
+    Actor::AggroSurroundingPeasants(uActorID_Monster, 1);
     if ( bShowDamage )
     {
       v50 = uDamageAmount;
@@ -4927,9 +4927,9 @@
         }
       }
     }
-    Actor::Die(uActorID_Monster_);
-    Actor::ApplyFineForKillingPeasant(uActorID_Monster_);
-    Actor::AggroSurroundingPeasants(uActorID_Monster_, 1);
+    Actor::Die(uActorID_Monster);
+    Actor::ApplyFineForKillingPeasant(uActorID_Monster);
+    Actor::AggroSurroundingPeasants(uActorID_Monster, 1);
     if ( pMonster->pMonsterInfo.uExp )
       GivePartyExp(pMonsterStats->pInfos[pMonster->pMonsterInfo.uID].uExp);
     v40 = SPEECH_51;
@@ -5002,7 +5002,7 @@
     pMonster->vVelocity.y = 50 * LOWORD(pVelocity->y);
     pMonster->vVelocity.z = 50 * LOWORD(pVelocity->z);
   }
-  Actor::AddBloodsplatOnDamageOverlay(uActorID_Monster_, 1, v61);
+  Actor::AddBloodsplatOnDamageOverlay(uActorID_Monster, 1, v61);
 }
 // 4D864C: using guessed type char byte_4D864C;