diff mm7_5.cpp @ 269:b34b53ee874d

skill_learn_ability_by_class_table[36][37]
author Ritor1
date Mon, 18 Feb 2013 16:02:02 +0600
parents fb890fb66cad
children 6e585f21a01e e5afd6848268
line wrap: on
line diff
--- a/mm7_5.cpp	Mon Feb 18 12:51:51 2013 +0600
+++ b/mm7_5.cpp	Mon Feb 18 16:02:02 2013 +0600
@@ -16766,74 +16766,73 @@
 //----- (00417AD4) --------------------------------------------------------
 unsigned int __fastcall sub_417AD4(unsigned int uPlayerClass, enum PLAYER_SKILL_TYPE uPlayerSkillType, signed int a3)
 {
-  enum PLAYER_SKILL_TYPE v3; // ebx@1
-  signed int v4; // edi@1
+  //enum PLAYER_SKILL_TYPE v3; // ebx@1
+  //signed int v4; // edi@1
   unsigned int v5; // ecx@1
   int v6; // edx@1
   int v7; // eax@7
   int v8; // eax@10
   unsigned __int8 v9; // sf@10
   unsigned __int8 v10; // of@10
-  int v11; // eax@11
+  //int v11; // eax@11
   int v12; // eax@14
   unsigned int yellow; // [sp+Ch] [bp-Ch]@1
   unsigned int red; // [sp+10h] [bp-8h]@1
   unsigned int white; // [sp+14h] [bp-4h]@1
 
-  v3 = uPlayerSkillType;
-  v4 = uPlayerClass;
+  //v3 = uPlayerSkillType;
+  //v4 = uPlayerClass;
   white = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
   red = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0, 0);
   yellow = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0);
   v5 = 0;
-  v6 = v4 % 4;
-  if ( !(v4 % 4) )
-  {
-    v11 = 37 * v4 + v3;
-    if ( byte_4ED970_skill_learn_ability_by_class_table[0][v11] >= a3 )
-      goto LABEL_8;
-    if ( byte_4ED970_skill_learn_ability_by_class_table[1][v11] < a3
-      && byte_4ED970_skill_learn_ability_by_class_table[2][v11] < a3 )
-    {
-      v12 = byte_4ED970_skill_learn_ability_by_class_table[3][v11];
-      v10 = __OFSUB__(v12, a3);
-      v9 = v12 - a3 < 0;
-LABEL_15:
-      v5 = red;
-      if ( v9 ^ v10 )
-        return v5;
+  //v6 = uPlayerClass % 4;
+  if ( !(uPlayerClass % 4) )
+  {
+    //v11 = 37 * uPlayerClass + uPlayerSkillType;
+    if ( byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass][uPlayerSkillType] >= a3 )
+      return white;
+    if ( byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 1][uPlayerSkillType] < a3
+      && byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 2][uPlayerSkillType] < a3 )
+    {
+      v12 = byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 3][uPlayerSkillType];
+      //v10 = __OFSUB__(v12, a3);
+      //v9 = v12 - a3 < 0;
+//LABEL_15:
+      //v5 = red;
+      if ( v12 < a3 )
+        return red;
     }
     return yellow;
   }
   if ( v6 == 1 )
   {
-    v7 = 37 * v4 + v3;
-    if ( byte_4ED970_skill_learn_ability_by_class_table[0][v7] >= a3 )
-      goto LABEL_8;
-    if ( byte_4ED970_skill_learn_ability_by_class_table[1][v7] < a3 )
-    {
-      v8 = byte_4ED970_skill_learn_ability_by_class_table[2][v7];
-      v10 = __OFSUB__(v8, a3);
-      v9 = v8 - a3 < 0;
-      goto LABEL_15;
+    //v7 = 37 * uPlayerClass + uPlayerSkillType;
+    if ( byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass][uPlayerSkillType] >= a3 )
+      return white;
+    if ( byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 1][uPlayerSkillType] < a3 )
+    {
+      v8 = byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 2][uPlayerSkillType];
+      //v10 = __OFSUB__(v8, a3);
+      //v9 = v8 - a3 < 0;
+      if ( v8 < a3)
+		  return red;
     }
     return yellow;
   }
-  if ( v6 > 1 && v6 <= 3 )
-  {
-    if ( byte_4ED970_skill_learn_ability_by_class_table[v4][v3] < a3 )
+  if ( v6 == 2 || v6 == 3 )
+  {
+    if ( byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass][uPlayerSkillType] < a3 )
       return red;
-LABEL_8:
-    v5 = white;
-  }
-  return v5;
+  }
+  return white;
 }
 
 //----- (00417BB5) --------------------------------------------------------
 const char *__fastcall CharacterUI_GetSkillDescText(unsigned int uPlayerID, enum PLAYER_SKILL_TYPE uPlayerSkillType)
 {
-  enum PLAYER_SKILL_TYPE v2; // esi@1
-  unsigned int v3; // ebx@1
+  //enum PLAYER_SKILL_TYPE v2; // esi@1
+  //unsigned int v3; // ebx@1
   int v4; // edi@1
   int v5; // eax@1
   Player *pPlayer; // ebx@7
@@ -16865,11 +16864,11 @@
   unsigned __int16 *v33; // [sp+534h] [bp-10h]@1
   int v34; // [sp+538h] [bp-Ch]@1
   unsigned __int16 *v35; // [sp+53Ch] [bp-8h]@1
-  enum PLAYER_SKILL_TYPE v36; // [sp+540h] [bp-4h]@1
-
-  v2 = uPlayerSkillType;
-  v3 = uPlayerID;
-  v36 = uPlayerSkillType;
+  //enum PLAYER_SKILL_TYPE v36; // [sp+540h] [bp-4h]@1
+
+  //v2 = uPlayerSkillType;
+  //v3 = uPlayerID;
+  //v36 = uPlayerSkillType;
   v4 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[431]);// Normal
   v34 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[433]);// Expert
   v33 = (unsigned __int16 *)pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[432]);// Master
@@ -16881,30 +16880,30 @@
     v35 = v33;
   if ( v5 > (signed int)v35 )
     v35 = (unsigned __int16 *)v5;
-  pPlayer = &pParty->pPlayers[v3];
-  v33 = &pPlayer->pActiveSkills[v2];
-  v7 = pPlayer->GetActualSkillLevel(v2);
-  v8 = LOBYTE(pPlayer->pActiveSkills[v2]);
+  pPlayer = &pParty->pPlayers[uPlayerID];
+  //v33 = &pPlayer->pActiveSkills[uPlayerSkillType];
+  v7 = pPlayer->GetActualSkillLevel(uPlayerSkillType);
+  v8 = pPlayer->pActiveSkills[uPlayerSkillType];
   a2[0] = 0;
   Source[0] = 0;
   if ( (v8 & 0x3F) == (v7 & 0x3F) )
   {
     strcpy(a2, "%s\n\n");
-    v24 = sub_417AD4(pPlayer->classType, v2, 1);
+    v24 = sub_417AD4(pPlayer->classType, uPlayerSkillType, 1);
     sprintf(Source, format_4E2DC8, v24);
     strcat(a2, Source);
     strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
-    v25 = sub_417AD4(pPlayer->classType, v36, 2);
+    v25 = sub_417AD4(pPlayer->classType, uPlayerSkillType, 2);
     sprintf(Source, format_4E2DC8, v25);
     strcat(a2, Source);
     strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
-    v26 = sub_417AD4(pPlayer->classType, v36, 3);
+    v26 = sub_417AD4(pPlayer->classType, uPlayerSkillType, 3);
     sprintf(Source, format_4E2DC8, v26);
     strcat(a2, Source);
     strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
     v27 = pPlayer->classType;
-    v28 = v36;
-    v29 = sub_417AD4(v27, v36, 4);
+    v28 = uPlayerSkillType;
+    v29 = sub_417AD4(v27, uPlayerSkillType, 4);
     sprintf(Source, format_4E2DC8, v29);
     strcat(a2, Source);
     strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
@@ -16919,20 +16918,20 @@
   else
   {
     strcpy(a2, "%s\n\n");
-    v9 = sub_417AD4(pPlayer->classType, v2, 1);
+    v9 = sub_417AD4(pPlayer->classType, uPlayerSkillType, 1);
     sprintf(Source, format_4E2DC8, v9);
     strcat(a2, Source);
     strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
-    v10 = sub_417AD4(pPlayer->classType, v36, 2);
+    v10 = sub_417AD4(pPlayer->classType, uPlayerSkillType, 2);
     sprintf(Source, format_4E2DC8, v10);
     strcat(a2, Source);
     strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
-    v11 = sub_417AD4(pPlayer->classType, v36, 3);
+    v11 = sub_417AD4(pPlayer->classType, uPlayerSkillType, 3);
     sprintf(Source, format_4E2DC8, v11);
     strcat(a2, Source);
     strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
-    v12 = v36;
-    v13 = sub_417AD4(pPlayer->classType, v36, 4);
+    v12 = uPlayerSkillType;
+    v13 = sub_417AD4(pPlayer->classType, uPlayerSkillType, 4);
     sprintf(Source, format_4E2DC8, v13);
     strcat(a2, Source);
     strcat(a2, "%s\t%03d:\t%03d%s\t000\n\n");
@@ -16944,7 +16943,7 @@
     v16 = (int)(v35 + 5);
     v15 = (PLAYER_SKILL_TYPE)((int)v15 * 4);
     v34 = (int)((char *)v35 + 3);
-    v17 = pPlayer->GetActualSkillLevel(v36);
+    v17 = pPlayer->GetActualSkillLevel(uPlayerSkillType);
     v18 = *(int *)((char *)pGrandSkillDesc + v15);
     v19 = *(int *)((char *)pMasterSkillDesc + v15);
     v20 = *(int *)((char *)pExpertSkillDesc + v15);