comparison 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
comparison
equal deleted inserted replaced
264:fb890fb66cad 269:b34b53ee874d
16764 } 16764 }
16765 16765
16766 //----- (00417AD4) -------------------------------------------------------- 16766 //----- (00417AD4) --------------------------------------------------------
16767 unsigned int __fastcall sub_417AD4(unsigned int uPlayerClass, enum PLAYER_SKILL_TYPE uPlayerSkillType, signed int a3) 16767 unsigned int __fastcall sub_417AD4(unsigned int uPlayerClass, enum PLAYER_SKILL_TYPE uPlayerSkillType, signed int a3)
16768 { 16768 {
16769 enum PLAYER_SKILL_TYPE v3; // ebx@1 16769 //enum PLAYER_SKILL_TYPE v3; // ebx@1
16770 signed int v4; // edi@1 16770 //signed int v4; // edi@1
16771 unsigned int v5; // ecx@1 16771 unsigned int v5; // ecx@1
16772 int v6; // edx@1 16772 int v6; // edx@1
16773 int v7; // eax@7 16773 int v7; // eax@7
16774 int v8; // eax@10 16774 int v8; // eax@10
16775 unsigned __int8 v9; // sf@10 16775 unsigned __int8 v9; // sf@10
16776 unsigned __int8 v10; // of@10 16776 unsigned __int8 v10; // of@10
16777 int v11; // eax@11 16777 //int v11; // eax@11
16778 int v12; // eax@14 16778 int v12; // eax@14
16779 unsigned int yellow; // [sp+Ch] [bp-Ch]@1 16779 unsigned int yellow; // [sp+Ch] [bp-Ch]@1
16780 unsigned int red; // [sp+10h] [bp-8h]@1 16780 unsigned int red; // [sp+10h] [bp-8h]@1
16781 unsigned int white; // [sp+14h] [bp-4h]@1 16781 unsigned int white; // [sp+14h] [bp-4h]@1
16782 16782
16783 v3 = uPlayerSkillType; 16783 //v3 = uPlayerSkillType;
16784 v4 = uPlayerClass; 16784 //v4 = uPlayerClass;
16785 white = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); 16785 white = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
16786 red = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0, 0); 16786 red = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0, 0);
16787 yellow = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0); 16787 yellow = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0);
16788 v5 = 0; 16788 v5 = 0;
16789 v6 = v4 % 4; 16789 //v6 = uPlayerClass % 4;
16790 if ( !(v4 % 4) ) 16790 if ( !(uPlayerClass % 4) )
16791 { 16791 {
16792 v11 = 37 * v4 + v3; 16792 //v11 = 37 * uPlayerClass + uPlayerSkillType;
16793 if ( byte_4ED970_skill_learn_ability_by_class_table[0][v11] >= a3 ) 16793 if ( byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass][uPlayerSkillType] >= a3 )
16794 goto LABEL_8; 16794 return white;
16795 if ( byte_4ED970_skill_learn_ability_by_class_table[1][v11] < a3 16795 if ( byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 1][uPlayerSkillType] < a3
16796 && byte_4ED970_skill_learn_ability_by_class_table[2][v11] < a3 ) 16796 && byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 2][uPlayerSkillType] < a3 )
16797 { 16797 {
16798 v12 = byte_4ED970_skill_learn_ability_by_class_table[3][v11]; 16798 v12 = byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 3][uPlayerSkillType];
16799 v10 = __OFSUB__(v12, a3); 16799 //v10 = __OFSUB__(v12, a3);
16800 v9 = v12 - a3 < 0; 16800 //v9 = v12 - a3 < 0;
16801 LABEL_15: 16801 //LABEL_15:
16802 v5 = red; 16802 //v5 = red;
16803 if ( v9 ^ v10 ) 16803 if ( v12 < a3 )
16804 return v5; 16804 return red;
16805 } 16805 }
16806 return yellow; 16806 return yellow;
16807 } 16807 }
16808 if ( v6 == 1 ) 16808 if ( v6 == 1 )
16809 { 16809 {
16810 v7 = 37 * v4 + v3; 16810 //v7 = 37 * uPlayerClass + uPlayerSkillType;
16811 if ( byte_4ED970_skill_learn_ability_by_class_table[0][v7] >= a3 ) 16811 if ( byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass][uPlayerSkillType] >= a3 )
16812 goto LABEL_8; 16812 return white;
16813 if ( byte_4ED970_skill_learn_ability_by_class_table[1][v7] < a3 ) 16813 if ( byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 1][uPlayerSkillType] < a3 )
16814 { 16814 {
16815 v8 = byte_4ED970_skill_learn_ability_by_class_table[2][v7]; 16815 v8 = byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 2][uPlayerSkillType];
16816 v10 = __OFSUB__(v8, a3); 16816 //v10 = __OFSUB__(v8, a3);
16817 v9 = v8 - a3 < 0; 16817 //v9 = v8 - a3 < 0;
16818 goto LABEL_15; 16818 if ( v8 < a3)
16819 return red;
16819 } 16820 }
16820 return yellow; 16821 return yellow;
16821 } 16822 }
16822 if ( v6 > 1 && v6 <= 3 ) 16823 if ( v6 == 2 || v6 == 3 )
16823 { 16824 {
16824 if ( byte_4ED970_skill_learn_ability_by_class_table[v4][v3] < a3 ) 16825 if ( byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass][uPlayerSkillType] < a3 )
16825 return red; 16826 return red;
16826 LABEL_8: 16827 }
16827 v5 = white; 16828 return white;
16828 }
16829 return v5;
16830 } 16829 }
16831 16830
16832 //----- (00417BB5) -------------------------------------------------------- 16831 //----- (00417BB5) --------------------------------------------------------
16833 const char *__fastcall CharacterUI_GetSkillDescText(unsigned int uPlayerID, enum PLAYER_SKILL_TYPE uPlayerSkillType) 16832 const char *__fastcall CharacterUI_GetSkillDescText(unsigned int uPlayerID, enum PLAYER_SKILL_TYPE uPlayerSkillType)
16834 { 16833 {
16835 enum PLAYER_SKILL_TYPE v2; // esi@1 16834 //enum PLAYER_SKILL_TYPE v2; // esi@1
16836 unsigned int v3; // ebx@1 16835 //unsigned int v3; // ebx@1
16837 int v4; // edi@1 16836 int v4; // edi@1
16838 int v5; // eax@1 16837 int v5; // eax@1
16839 Player *pPlayer; // ebx@7 16838 Player *pPlayer; // ebx@7
16840 char v7; // al@7 16839 char v7; // al@7
16841 char v8; // cl@7 16840 char v8; // cl@7
16863 char a2[1200]; // [sp+Ch] [bp-538h]@7 16862 char a2[1200]; // [sp+Ch] [bp-538h]@7
16864 char Source[120]; // [sp+4BCh] [bp-88h]@7 16863 char Source[120]; // [sp+4BCh] [bp-88h]@7
16865 unsigned __int16 *v33; // [sp+534h] [bp-10h]@1 16864 unsigned __int16 *v33; // [sp+534h] [bp-10h]@1
16866 int v34; // [sp+538h] [bp-Ch]@1 16865 int v34; // [sp+538h] [bp-Ch]@1
16867 unsigned __int16 *v35; // [sp+53Ch] [bp-8h]@1 16866 unsigned __int16 *v35; // [sp+53Ch] [bp-8h]@1
16868 enum PLAYER_SKILL_TYPE v36; // [sp+540h] [bp-4h]@1 16867 //enum PLAYER_SKILL_TYPE v36; // [sp+540h] [bp-4h]@1
16869 16868
16870 v2 = uPlayerSkillType; 16869 //v2 = uPlayerSkillType;
16871 v3 = uPlayerID; 16870 //v3 = uPlayerID;
16872 v36 = uPlayerSkillType; 16871 //v36 = uPlayerSkillType;
16873 v4 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[431]);// Normal 16872 v4 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[431]);// Normal
16874 v34 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[433]);// Expert 16873 v34 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[433]);// Expert
16875 v33 = (unsigned __int16 *)pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[432]);// Master 16874 v33 = (unsigned __int16 *)pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[432]);// Master
16876 v5 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[96]);// Grand 16875 v5 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[96]);// Grand
16877 v35 = (unsigned __int16 *)v4; 16876 v35 = (unsigned __int16 *)v4;
16879 v35 = (unsigned __int16 *)v34; 16878 v35 = (unsigned __int16 *)v34;
16880 if ( (signed int)v33 > (signed int)v35 ) 16879 if ( (signed int)v33 > (signed int)v35 )
16881 v35 = v33; 16880 v35 = v33;
16882 if ( v5 > (signed int)v35 ) 16881 if ( v5 > (signed int)v35 )
16883 v35 = (unsigned __int16 *)v5; 16882 v35 = (unsigned __int16 *)v5;
16884 pPlayer = &pParty->pPlayers[v3]; 16883 pPlayer = &pParty->pPlayers[uPlayerID];
16885 v33 = &pPlayer->pActiveSkills[v2]; 16884 //v33 = &pPlayer->pActiveSkills[uPlayerSkillType];
16886 v7 = pPlayer->GetActualSkillLevel(v2); 16885 v7 = pPlayer->GetActualSkillLevel(uPlayerSkillType);
16887 v8 = LOBYTE(pPlayer->pActiveSkills[v2]); 16886 v8 = pPlayer->pActiveSkills[uPlayerSkillType];
16888 a2[0] = 0; 16887 a2[0] = 0;
16889 Source[0] = 0; 16888 Source[0] = 0;
16890 if ( (v8 & 0x3F) == (v7 & 0x3F) ) 16889 if ( (v8 & 0x3F) == (v7 & 0x3F) )
16891 { 16890 {
16892 strcpy(a2, "%s\n\n"); 16891 strcpy(a2, "%s\n\n");
16893 v24 = sub_417AD4(pPlayer->classType, v2, 1); 16892 v24 = sub_417AD4(pPlayer->classType, uPlayerSkillType, 1);
16894 sprintf(Source, format_4E2DC8, v24); 16893 sprintf(Source, format_4E2DC8, v24);
16895 strcat(a2, Source); 16894 strcat(a2, Source);
16896 strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); 16895 strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
16897 v25 = sub_417AD4(pPlayer->classType, v36, 2); 16896 v25 = sub_417AD4(pPlayer->classType, uPlayerSkillType, 2);
16898 sprintf(Source, format_4E2DC8, v25); 16897 sprintf(Source, format_4E2DC8, v25);
16899 strcat(a2, Source); 16898 strcat(a2, Source);
16900 strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); 16899 strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
16901 v26 = sub_417AD4(pPlayer->classType, v36, 3); 16900 v26 = sub_417AD4(pPlayer->classType, uPlayerSkillType, 3);
16902 sprintf(Source, format_4E2DC8, v26); 16901 sprintf(Source, format_4E2DC8, v26);
16903 strcat(a2, Source); 16902 strcat(a2, Source);
16904 strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); 16903 strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
16905 v27 = pPlayer->classType; 16904 v27 = pPlayer->classType;
16906 v28 = v36; 16905 v28 = uPlayerSkillType;
16907 v29 = sub_417AD4(v27, v36, 4); 16906 v29 = sub_417AD4(v27, uPlayerSkillType, 4);
16908 sprintf(Source, format_4E2DC8, v29); 16907 sprintf(Source, format_4E2DC8, v29);
16909 strcat(a2, Source); 16908 strcat(a2, Source);
16910 strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); 16909 strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
16911 16910
16912 v23 = static_sub_417BB5_out_string; 16911 v23 = static_sub_417BB5_out_string;
16917 (char *)v35 + 3, v35 + 5, pGrandSkillDesc[v28]); 16916 (char *)v35 + 3, v35 + 5, pGrandSkillDesc[v28]);
16918 } 16917 }
16919 else 16918 else
16920 { 16919 {
16921 strcpy(a2, "%s\n\n"); 16920 strcpy(a2, "%s\n\n");
16922 v9 = sub_417AD4(pPlayer->classType, v2, 1); 16921 v9 = sub_417AD4(pPlayer->classType, uPlayerSkillType, 1);
16923 sprintf(Source, format_4E2DC8, v9); 16922 sprintf(Source, format_4E2DC8, v9);
16924 strcat(a2, Source); 16923 strcat(a2, Source);
16925 strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); 16924 strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
16926 v10 = sub_417AD4(pPlayer->classType, v36, 2); 16925 v10 = sub_417AD4(pPlayer->classType, uPlayerSkillType, 2);
16927 sprintf(Source, format_4E2DC8, v10); 16926 sprintf(Source, format_4E2DC8, v10);
16928 strcat(a2, Source); 16927 strcat(a2, Source);
16929 strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); 16928 strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
16930 v11 = sub_417AD4(pPlayer->classType, v36, 3); 16929 v11 = sub_417AD4(pPlayer->classType, uPlayerSkillType, 3);
16931 sprintf(Source, format_4E2DC8, v11); 16930 sprintf(Source, format_4E2DC8, v11);
16932 strcat(a2, Source); 16931 strcat(a2, Source);
16933 strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); 16932 strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
16934 v12 = v36; 16933 v12 = uPlayerSkillType;
16935 v13 = sub_417AD4(pPlayer->classType, v36, 4); 16934 v13 = sub_417AD4(pPlayer->classType, uPlayerSkillType, 4);
16936 sprintf(Source, format_4E2DC8, v13); 16935 sprintf(Source, format_4E2DC8, v13);
16937 strcat(a2, Source); 16936 strcat(a2, Source);
16938 strcat(a2, "%s\t%03d:\t%03d%s\t000\n\n"); 16937 strcat(a2, "%s\t%03d:\t%03d%s\t000\n\n");
16939 v14 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); 16938 v14 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
16940 sprintf(Source, format_4E2DC8, v14); 16939 sprintf(Source, format_4E2DC8, v14);
16942 strcat(a2, "%s: +%d"); 16941 strcat(a2, "%s: +%d");
16943 v15 = v12; 16942 v15 = v12;
16944 v16 = (int)(v35 + 5); 16943 v16 = (int)(v35 + 5);
16945 v15 = (PLAYER_SKILL_TYPE)((int)v15 * 4); 16944 v15 = (PLAYER_SKILL_TYPE)((int)v15 * 4);
16946 v34 = (int)((char *)v35 + 3); 16945 v34 = (int)((char *)v35 + 3);
16947 v17 = pPlayer->GetActualSkillLevel(v36); 16946 v17 = pPlayer->GetActualSkillLevel(uPlayerSkillType);
16948 v18 = *(int *)((char *)pGrandSkillDesc + v15); 16947 v18 = *(int *)((char *)pGrandSkillDesc + v15);
16949 v19 = *(int *)((char *)pMasterSkillDesc + v15); 16948 v19 = *(int *)((char *)pMasterSkillDesc + v15);
16950 v20 = *(int *)((char *)pExpertSkillDesc + v15); 16949 v20 = *(int *)((char *)pExpertSkillDesc + v15);
16951 v21 = *(int *)((char *)pNormalSkillDesc + v15); 16950 v21 = *(int *)((char *)pNormalSkillDesc + v15);
16952 v22 = *(int *)((char *)pSkillDesc + v15); 16951 v22 = *(int *)((char *)pSkillDesc + v15);