changeset 956:e9292c58644a

Слияние
author Ritor1
date Thu, 02 May 2013 11:03:26 +0600
parents 21cc2b274220 (diff) a92a34f9aef5 (current diff)
children 1a47a988c0b8
files UIHouses.cpp UIRest.cpp mm7_4.cpp mm7_5.cpp stru272.h stru277.h stru279.h stru287.h stru351.h
diffstat 1 files changed, 138 insertions(+), 93 deletions(-) [+]
line wrap: on
line diff
--- a/mm7_4.cpp	Thu May 02 01:03:38 2013 +0600
+++ b/mm7_4.cpp	Thu May 02 11:03:26 2013 +0600
@@ -6840,14 +6840,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
@@ -6855,27 +6855,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;
@@ -6903,18 +6902,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;
@@ -6939,11 +6938,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];
@@ -6952,19 +6951,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;
@@ -6977,11 +6973,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:
@@ -6993,26 +6986,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:
@@ -7030,50 +7037,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:
@@ -7093,46 +7125,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:
@@ -7142,26 +7194,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;
 }