comparison mm7_5.cpp @ 289:92d443ed0cba

Слияние
author Ritor1
date Mon, 18 Feb 2013 19:16:38 +0600
parents e3b70ba42154 250e49fef6f6
children 0ea5fbd16edb
comparison
equal deleted inserted replaced
288:9a6052fecad4 289:92d443ed0cba
363 for (uint i = 0; i < pNPCStats->uNumNewNPCs; ++i) 363 for (uint i = 0; i < pNPCStats->uNumNewNPCs; ++i)
364 { 364 {
365 auto npc = pNPCStats->pNewNPCData + i; 365 auto npc = pNPCStats->pNewNPCData + i;
366 //do 366 //do
367 //{ 367 //{
368 if (npc->uFlags & 0x80 && 368 if (npc->Hired() &&
369 (!pParty->pHirelings[0].pName || strcmp(npc->pName, pParty->pHirelings[0].pName)) && 369 (!pParty->pHirelings[0].pName || strcmp(npc->pName, pParty->pHirelings[0].pName)) &&
370 (!pParty->pHirelings[1].pName || strcmp(npc->pName, pParty->pHirelings[1].pName)) ) 370 (!pParty->pHirelings[1].pName || strcmp(npc->pName, pParty->pHirelings[1].pName)) )
371 { 371 {
372 //v7 =; 372 //v7 =;
373 pTmpBuf[uAction++] = i + 2; 373 pTmpBuf[uAction++] = i + 2;
396 sub_4B2001(uMessageParam); 396 sub_4B2001(uMessageParam);
397 continue; 397 continue;
398 case UIMSG_195: 398 case UIMSG_195:
399 sub_4BCACC_bounties(uMessageParam); 399 sub_4BCACC_bounties(uMessageParam);
400 continue; 400 continue;
401 case UIMSG_88: 401 case UIMSG_SelectDialogueOption:
402 sub_4BC49B(uMessageParam); 402 OnSelectDialogueOption((DIALOGUE_TYPE)uMessageParam);
403 continue; 403 continue;
404 case UIMSG_19A: 404 case UIMSG_19A:
405 _4B4224_UpdateNPCTopics(uMessageParam); 405 _4B4224_UpdateNPCTopics(uMessageParam);
406 continue; 406 continue;
407 case UIMSG_StartNewGame: 407 case UIMSG_StartNewGame:
2727 stru_50C198.LootActor(&pActors[uMessageParam]); 2727 stru_50C198.LootActor(&pActors[uMessageParam]);
2728 else 2728 else
2729 Actor::StealFrom(uMessageParam); 2729 Actor::StealFrom(uMessageParam);
2730 } 2730 }
2731 continue; 2731 continue;
2732 case 0x17: 2732
2733 case UIMSG_Attack:
2733 if ( !uActiveCharacter ) 2734 if ( !uActiveCharacter )
2734 //goto LABEL_90; 2735 //goto LABEL_90;
2735 { 2736 {
2736 v1 = ""; 2737 v1 = "";
2737 v0 = 1; 2738 v0 = 1;
2899 pParty->pPlayers[0].pConditions[2] = pParty->uTimePlayed; 2900 pParty->pPlayers[0].pConditions[2] = pParty->uTimePlayed;
2900 v90 = pMapStats->GetMapInfo(pCurrentMapName); 2901 v90 = pMapStats->GetMapInfo(pCurrentMapName);
2901 if ( !v90 ) 2902 if ( !v90 )
2902 v90 = rand() % (signed int)pMapStats->uNumMaps + 1; 2903 v90 = rand() % (signed int)pMapStats->uNumMaps + 1;
2903 pMapInfo = &pMapStats->pInfos[v90]; 2904 pMapInfo = &pMapStats->pInfos[v90];
2904 if ( rand() % 100 + 1 <= pMapInfo->field_30 ) 2905 if ( rand() % 100 + 1 <= pMapInfo->Encounter_percent )
2905 { 2906 {
2906 v91 = rand() % 100; 2907 v91 = rand() % 100;
2907 v92 = pMapInfo->field_31; 2908 v92 = pMapInfo->EncM1percent;
2908 v93 = v91 + 1; 2909 v93 = v91 + 1;
2909 if ( v93 > v92 ) 2910 if ( v93 > v92 )
2910 pNPCData4 = (NPCData *)((v93 > v92 + pMapInfo->field_32) + 2); 2911 pNPCData4 = (NPCData *)((v93 > v92 + pMapInfo->EncM2percent) + 2);
2911 else 2912 else
2912 pNPCData4 = (NPCData *)v0; 2913 pNPCData4 = (NPCData *)v0;
2913 if ( !sub_45063B(pMapInfo, (int)pNPCData4) ) 2914 if ( !sub_45063B(pMapInfo, (int)pNPCData4) )
2914 pNPCData4 = 0; 2915 pNPCData4 = 0;
2915 if ( pNPCData4 ) 2916 if ( pNPCData4 )
3477 case UIMSG_ShowStatus_Funds: 3478 case UIMSG_ShowStatus_Funds:
3478 v174 = (char *)pParty->uNumGoldInBank; 3479 v174 = (char *)pParty->uNumGoldInBank;
3479 v158 = pParty->uNumGold + pParty->uNumGoldInBank; 3480 v158 = pParty->uNumGold + pParty->uNumGoldInBank;
3480 v146 = pGlobalTXT_LocalizationStrings[489];// "You have %d total gold, %d in the Bank"" 3481 v146 = pGlobalTXT_LocalizationStrings[489];// "You have %d total gold, %d in the Bank""
3481 //goto _sprintex_draw_status_and_continue; 3482 //goto _sprintex_draw_status_and_continue;
3482 sprintf(pTmpBuf, v146, v158, v174); 3483 sprintfex(pTmpBuf, v146, v158, v174);
3483 sub_41C0B8_set_status_string(pTmpBuf); 3484 sub_41C0B8_set_status_string(pTmpBuf);
3484 continue; 3485 continue;
3485 case UIMSG_ShowStatus_DateTime: 3486 case UIMSG_ShowStatus_DateTime:
3486 pNPCData4 = (NPCData *)pParty->uCurrentHour; 3487 pNPCData4 = (NPCData *)pParty->uCurrentHour;
3487 if ( (signed int)pParty->uCurrentHour <= 12 ) 3488 if ( (signed int)pParty->uCurrentHour <= 12 )
3503 v173 = (char *)pParty->uNumFoodRations; 3504 v173 = (char *)pParty->uNumFoodRations;
3504 v157 = pGlobalTXT_LocalizationStrings[501];// You have %lu food" 3505 v157 = pGlobalTXT_LocalizationStrings[501];// You have %lu food"
3505 goto _sprintex_2args_draw_status_and_continue; 3506 goto _sprintex_2args_draw_status_and_continue;
3506 case UIMSG_ShowStatus_Player: 3507 case UIMSG_ShowStatus_Player:
3507 pPlayer5 = pPlayers[uMessageParam]; 3508 pPlayer5 = pPlayers[uMessageParam];
3508 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[429], pPlayer5->pName, pClassNames[pPlayer5->classType]);// "%s the %s" 3509 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[429], pPlayer5->pName, pClassNames[pPlayer5->classType]);// "%s the %s"
3509 strcat(pTmpBuf, ": "); 3510 strcat(pTmpBuf, ": ");
3510 v107 = pPlayer5->GetMajorConditionIdx(); 3511 v107 = pPlayer5->GetMajorConditionIdx();
3511 strcat(pTmpBuf, aCharacterConditionNames[v107]); 3512 strcat(pTmpBuf, aCharacterConditionNames[v107]);
3512 sub_41C0B8_set_status_string(pTmpBuf); 3513 sub_41C0B8_set_status_string(pTmpBuf);
3513 v108 = 8 * uMessageParam - 8; 3514 v108 = 8 * uMessageParam - 8;
8584 void __fastcall CharacterUI_DrawPaperdollWithRingOverlay(unsigned int uPlayerID) 8585 void __fastcall CharacterUI_DrawPaperdollWithRingOverlay(unsigned int uPlayerID)
8585 { 8586 {
8586 unsigned int v1; // ebx@1 8587 unsigned int v1; // ebx@1
8587 Player *pPlayer; // edi@1 8588 Player *pPlayer; // edi@1
8588 int v3; // ecx@1 8589 int v3; // ecx@1
8589 int v4; // edi@3 8590 int *v4; // edi@3
8590 unsigned int v5; // ebx@3 8591 unsigned int v5; // ebx@3
8591 int v6; // eax@3 8592 int v6; // eax@3
8592 LODFile_IconsBitmaps *v7; // ecx@7 8593 LODFile_IconsBitmaps *v7; // ecx@7
8593 double v8; // st7@16 8594 double v8; // st7@16
8594 int v9; // edi@17 8595 int v9; // edi@17
8626 int v41; // [sp+10h] [bp-20h]@26 8627 int v41; // [sp+10h] [bp-20h]@26
8627 Texture *v42; // [sp+10h] [bp-20h]@37 8628 Texture *v42; // [sp+10h] [bp-20h]@37
8628 int v43; // [sp+10h] [bp-20h]@47 8629 int v43; // [sp+10h] [bp-20h]@47
8629 unsigned int a3; // [sp+14h] [bp-1Ch]@3 8630 unsigned int a3; // [sp+14h] [bp-1Ch]@3
8630 unsigned int a2; // [sp+18h] [bp-18h]@3 8631 unsigned int a2; // [sp+18h] [bp-18h]@3
8631 int v46; // [sp+1Ch] [bp-14h]@1 8632 unsigned int *v46; // [sp+1Ch] [bp-14h]@1
8632 Player *v47; // [sp+20h] [bp-10h]@1 8633 Player *v47; // [sp+20h] [bp-10h]@1
8633 int v48; // [sp+24h] [bp-Ch]@1 8634 int v48; // [sp+24h] [bp-Ch]@1
8634 int v49; // [sp+24h] [bp-Ch]@26 8635 int v49; // [sp+24h] [bp-Ch]@26
8635 8636
8636 v1 = uPlayerID; 8637 v1 = uPlayerID;
8641 pRenderer->DrawTextureTransparent(0x1D9u, 0, (Texture *)(uTextureID_BACKHAND != -1 ? &pIcons_LOD->pTextures[uTextureID_BACKHAND] : 0)); 8642 pRenderer->DrawTextureTransparent(0x1D9u, 0, (Texture *)(uTextureID_BACKHAND != -1 ? &pIcons_LOD->pTextures[uTextureID_BACKHAND] : 0));
8642 pRenderer->DrawTextureTransparent(0x1D4u, 0, (Texture *)(uTextureID_507B04 != -1 ? &pIcons_LOD->pTextures[uTextureID_507B04] : 0)); 8643 pRenderer->DrawTextureTransparent(0x1D4u, 0, (Texture *)(uTextureID_507B04 != -1 ? &pIcons_LOD->pTextures[uTextureID_507B04] : 0));
8643 pRenderer->DrawTextureIndexed(pCharacterScreen_DetalizBtn->uX, pCharacterScreen_DetalizBtn->uY, 8644 pRenderer->DrawTextureIndexed(pCharacterScreen_DetalizBtn->uX, pCharacterScreen_DetalizBtn->uY,
8644 (Texture *)(uTextureID_5118C8 != -1 ? &pIcons_LOD->pTextures[uTextureID_5118C8] : 0)); 8645 (Texture *)(uTextureID_5118C8 != -1 ? &pIcons_LOD->pTextures[uTextureID_5118C8] : 0));
8645 v3 = 0; 8646 v3 = 0;
8646 v46 = (int)&pPlayer->pEquipment.field_28; 8647 v46 = &pPlayer->pEquipment.field_28;
8647 v48 = 0; 8648 v48 = 0;
8648 do 8649 do
8649 { 8650 {
8650 if ( !*(int *)v46 ) 8651 if ( !*v46 )
8651 goto LABEL_24; 8652 goto LABEL_24;
8652 v39 = *(int *)v46; 8653 v39 = *v46;
8653 v4 = (int)&pPlayer->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v46 + 5]; 8654 v4 = (int *)&pPlayer->pInventoryItems[*v46-1].uItemID;
8654 a3 = pPaperdollRingsY[v3]; 8655 a3 = pPaperdollRingsY[v3];
8655 a2 = pPaperdollRingsX[v3]; 8656 a2 = pPaperdollRingsX[v3];
8656 v5 = pIcons_LOD->LoadTexture(pItemsTable->pItems[*(int *)v4].pIconName, TEXTURE_16BIT_PALETTE); 8657 v5 = pIcons_LOD->LoadTexture(pItemsTable->pItems[*v4].pIconName, TEXTURE_16BIT_PALETTE);
8657 v6 = *(int *)(v4 + 20); 8658 v6 = *(int *)(v4 + 20);
8658 if ( *(int *)(v4 + 20) & 0xF0 ) 8659 if ( *(int *)(v4 + 20) & 0xF0 )
8659 { 8660 {
8660 if ( (*(int *)(v4 + 20) & 0xF0) != 16 ) 8661 if ( (*(int *)(v4 + 20) & 0xF0) != 16 )
8661 { 8662 {
13568 dword_506544 = 0; 13569 dword_506544 = 0;
13569 v6 = pStru179.field_0[dword_506528]; 13570 v6 = pStru179.field_0[dword_506528];
13570 dword_506548 = 0; 13571 dword_506548 = 0;
13571 dword_506520 = 0; 13572 dword_506520 = 0;
13572 v7 = *pStorylineText->StoreLine[v6].pText;//*(&pStorylineText->field_0 + 3 * v6); 13573 v7 = *pStorylineText->StoreLine[v6].pText;//*(&pStorylineText->field_0 + 3 * v6);
13573 v8 = sub_495461( 13574 v8 = BuilDialogueString(
13574 pStorylineText->StoreLine[v6].pText, 13575 pStorylineText->StoreLine[v6].pText,
13575 uActiveCharacter - 1, 13576 uActiveCharacter - 1,
13576 0, 13577 0,
13577 0, 13578 0,
13578 0, 13579 0,
16042 ++v4; 16043 ++v4;
16043 } 16044 }
16044 while ( (signed int)lpsz < (signed int)pNPCStats->uNumNewNPCs );*/ 16045 while ( (signed int)lpsz < (signed int)pNPCStats->uNumNewNPCs );*/
16045 for (int i = 0; i < pNPCStats->uNumNewNPCs; ++i) 16046 for (int i = 0; i < pNPCStats->uNumNewNPCs; ++i)
16046 { 16047 {
16047 if (pNPCStats->pNewNPCData[i].uFlags & 0x80) 16048 if (pNPCStats->pNewNPCData[i].Hired())
16048 { 16049 {
16049 if (!pParty->pHirelings[0].pName || strcmp((char *)pNPCStats->pNewNPCData[i].pName, (char *)pParty->pHirelings[0].pName)) 16050 if (!pParty->pHirelings[0].pName || strcmp((char *)pNPCStats->pNewNPCData[i].pName, (char *)pParty->pHirelings[0].pName))
16050 { 16051 {
16051 if (!pParty->pHirelings[1].pName || strcmp((char *)pNPCStats->pNewNPCData[i].pName, (char *)pParty->pHirelings[1].pName)) 16052 if (!pParty->pHirelings[1].pName || strcmp((char *)pNPCStats->pNewNPCData[i].pName, (char *)pParty->pHirelings[1].pName))
16052 pTmpBuf[v1++] = i + 2; 16053 pTmpBuf[v1++] = i + 2;
16094 v9 = v6->uProfession; 16095 v9 = v6->uProfession;
16095 if ( v9 ) 16096 if ( v9 )
16096 { 16097 {
16097 v10 = v6->pName; 16098 v10 = v6->pName;
16098 v11 = pTmpBuf; 16099 v11 = pTmpBuf;
16099 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[429], v10, aNPCProfessionNames[v9]); 16100 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[429], v10, aNPCProfessionNames[v9]);
16100 } 16101 }
16101 else 16102 else
16102 { 16103 {
16103 v12 = v6->pName; 16104 v12 = v6->pName;
16104 v11 = pTmpBuf; 16105 v11 = pTmpBuf;
16106 } 16107 }
16107 v13 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); 16108 v13 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
16108 a1.DrawTitleText(pFontArrus, 0, 0xCu, v13, v11, 3u); 16109 a1.DrawTitleText(pFontArrus, 0, 0xCu, v13, v11, 3u);
16109 a1.uFrameWidth -= 24; 16110 a1.uFrameWidth -= 24;
16110 a1.uFrameZ = a1.uFrameX + a1.uFrameWidth - 1; 16111 a1.uFrameZ = a1.uFrameX + a1.uFrameWidth - 1;
16111 v14 = sub_495461((char *)lpsz, uActiveCharacter - 1, 0, 0, 0, 0); 16112 v14 = BuilDialogueString((char *)lpsz, uActiveCharacter - 1, 0, 0, 0, 0);
16112 a1.DrawText(pFontArrus, 100, 36, 0, v14, 0, 0, 0); 16113 a1.DrawText(pFontArrus, 100, 36, 0, v14, 0, 0, 0);
16113 } 16114 }
16114 } 16115 }
16115 } 16116 }
16116 } 16117 }
16514 { 16515 {
16515 pMouse->GetClickPos(&pX, &pY); 16516 pMouse->GetClickPos(&pX, &pY);
16516 y = pY; 16517 y = pY;
16517 x = pX; 16518 x = pX;
16518 } 16519 }
16519 if ( pCurrentScreen 16520 if ( pCurrentScreen != SCREEN_GAME || !dword_507B98_ctrl_pressed )
16520 || !dword_507B98_ctrl_pressed )
16521 goto LABEL_30; 16521 goto LABEL_30;
16522 v4 = GetCurrentMenuID(); 16522 v4 = GetCurrentMenuID();
16523 x = pX; 16523 x = pX;
16524 if ( (v4 & 0x80000000u) == 0 16524 if ( (v4 & 0x80000000u) == 0
16525 || (signed int)pX < (signed int)pViewport->uViewportX 16525 || (signed int)pX < (signed int)pViewport->uViewportX
16562 goto LABEL_45; 16562 goto LABEL_45;
16563 LABEL_41: 16563 LABEL_41:
16564 if ( x >= (signed int)i->uX && x <= (signed int)i->uZ && y >= (signed int)i->uY && y <= (signed int)i->uW ) 16564 if ( x >= (signed int)i->uX && x <= (signed int)i->uZ && y >= (signed int)i->uY && y <= (signed int)i->uW )
16565 { 16565 {
16566 LABEL_50: 16566 LABEL_50:
16567 i->field_2C = 1; 16567 i->field_2C_is_pushed = 1;
16568 v10 = pMessageQueue_50CBD0->uNumMessages; 16568 v10 = pMessageQueue_50CBD0->uNumMessages;
16569 if ( pMessageQueue_50CBD0->uNumMessages ) 16569 if ( pMessageQueue_50CBD0->uNumMessages )
16570 { 16570 {
16571 v10 = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; 16571 v10 = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
16572 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; 16572 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
16762 Dst.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf, 3u); 16762 Dst.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf, 3u);
16763 return Dst.DrawText(pFontSmallnum, 1, LOBYTE(pFontLucida->uFontHeight), 0, v2, 0, 0, 0); 16763 return Dst.DrawText(pFontSmallnum, 1, LOBYTE(pFontLucida->uFontHeight), 0, v2, 0, 0, 0);
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 GetSkillColor(unsigned int uPlayerClass, enum PLAYER_SKILL_TYPE uPlayerSkillType, signed int skill_level)
16768 { 16768 {
16769 enum PLAYER_SKILL_TYPE v3; // ebx@1
16770 signed int v4; // edi@1
16771 unsigned int v5; // ecx@1
16772 int v6; // edx@1
16773 int v7; // eax@7
16774 int v8; // eax@10 16769 int v8; // eax@10
16775 unsigned __int8 v9; // sf@10
16776 unsigned __int8 v10; // of@10
16777 int v11; // eax@11
16778 int v12; // eax@14 16770 int v12; // eax@14
16779 unsigned int yellow; // [sp+Ch] [bp-Ch]@1 16771 unsigned int yellow; // [sp+Ch] [bp-Ch]@1
16780 unsigned int red; // [sp+10h] [bp-8h]@1 16772 unsigned int red; // [sp+10h] [bp-8h]@1
16781 unsigned int white; // [sp+14h] [bp-4h]@1 16773 unsigned int white; // [sp+14h] [bp-4h]@1
16782 16774
16783 v3 = uPlayerSkillType;
16784 v4 = uPlayerClass;
16785 white = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); 16775 white = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
16786 red = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0, 0); 16776 red = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0, 0);
16787 yellow = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0); 16777 yellow = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0);
16788 v5 = 0; 16778 if ( !(uPlayerClass % 4) )
16789 v6 = v4 % 4; 16779 {
16790 if ( !(v4 % 4) ) 16780 if ( byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass][uPlayerSkillType] >= skill_level )
16791 { 16781 return white;
16792 v11 = 37 * v4 + v3; 16782 if ( byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 1][uPlayerSkillType] < skill_level
16793 if ( byte_4ED970_skill_learn_ability_by_class_table[0][v11] >= a3 ) 16783 && byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 2][uPlayerSkillType] < skill_level )
16794 goto LABEL_8; 16784 {
16795 if ( byte_4ED970_skill_learn_ability_by_class_table[1][v11] < a3 16785 v12 = byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 3][uPlayerSkillType];
16796 && byte_4ED970_skill_learn_ability_by_class_table[2][v11] < a3 ) 16786 if ( v12 < skill_level )
16797 { 16787 return red;
16798 v12 = byte_4ED970_skill_learn_ability_by_class_table[3][v11];
16799 v10 = __OFSUB__(v12, a3);
16800 v9 = v12 - a3 < 0;
16801 LABEL_15:
16802 v5 = red;
16803 if ( v9 ^ v10 )
16804 return v5;
16805 } 16788 }
16806 return yellow; 16789 return yellow;
16807 } 16790 }
16808 if ( v6 == 1 ) 16791 if ( (uPlayerClass % 4) == 1 )
16809 { 16792 {
16810 v7 = 37 * v4 + v3; 16793 if ( byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass][uPlayerSkillType] >= skill_level )
16811 if ( byte_4ED970_skill_learn_ability_by_class_table[0][v7] >= a3 ) 16794 return white;
16812 goto LABEL_8; 16795 if ( byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 1][uPlayerSkillType] < skill_level )
16813 if ( byte_4ED970_skill_learn_ability_by_class_table[1][v7] < a3 ) 16796 {
16814 { 16797 v8 = byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 2][uPlayerSkillType];
16815 v8 = byte_4ED970_skill_learn_ability_by_class_table[2][v7]; 16798 if ( v8 < skill_level)
16816 v10 = __OFSUB__(v8, a3); 16799 return red;
16817 v9 = v8 - a3 < 0;
16818 goto LABEL_15;
16819 } 16800 }
16820 return yellow; 16801 return yellow;
16821 } 16802 }
16822 if ( v6 > 1 && v6 <= 3 ) 16803 if ( (uPlayerClass % 4) == 2 || (uPlayerClass % 4) == 3 )
16823 { 16804 {
16824 if ( byte_4ED970_skill_learn_ability_by_class_table[v4][v3] < a3 ) 16805 if ( byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass][uPlayerSkillType] < skill_level )
16825 return red; 16806 return red;
16826 LABEL_8: 16807 }
16827 v5 = white; 16808 return white;
16828 }
16829 return v5;
16830 } 16809 }
16831 16810
16832 //----- (00417BB5) -------------------------------------------------------- 16811 //----- (00417BB5) --------------------------------------------------------
16833 const char *__fastcall CharacterUI_GetSkillDescText(unsigned int uPlayerID, enum PLAYER_SKILL_TYPE uPlayerSkillType) 16812 const char *__fastcall CharacterUI_GetSkillDescText(unsigned int uPlayerID, enum PLAYER_SKILL_TYPE uPlayerSkillType)
16834 { 16813 {
16835 enum PLAYER_SKILL_TYPE v2; // esi@1 16814 //enum PLAYER_SKILL_TYPE v2; // esi@1
16836 unsigned int v3; // ebx@1 16815 //unsigned int v3; // ebx@1
16837 int v4; // edi@1 16816 int v4; // edi@1
16838 int v5; // eax@1 16817 int v5; // eax@1
16839 Player *pPlayer; // ebx@7 16818 Player *pPlayer; // ebx@7
16840 char v7; // al@7 16819 char v7; // al@7
16841 char v8; // cl@7 16820 char v8; // cl@7
16863 char a2[1200]; // [sp+Ch] [bp-538h]@7 16842 char a2[1200]; // [sp+Ch] [bp-538h]@7
16864 char Source[120]; // [sp+4BCh] [bp-88h]@7 16843 char Source[120]; // [sp+4BCh] [bp-88h]@7
16865 unsigned __int16 *v33; // [sp+534h] [bp-10h]@1 16844 unsigned __int16 *v33; // [sp+534h] [bp-10h]@1
16866 int v34; // [sp+538h] [bp-Ch]@1 16845 int v34; // [sp+538h] [bp-Ch]@1
16867 unsigned __int16 *v35; // [sp+53Ch] [bp-8h]@1 16846 unsigned __int16 *v35; // [sp+53Ch] [bp-8h]@1
16868 enum PLAYER_SKILL_TYPE v36; // [sp+540h] [bp-4h]@1 16847 //enum PLAYER_SKILL_TYPE v36; // [sp+540h] [bp-4h]@1
16869 16848
16870 v2 = uPlayerSkillType; 16849 //v2 = uPlayerSkillType;
16871 v3 = uPlayerID; 16850 //v3 = uPlayerID;
16872 v36 = uPlayerSkillType; 16851 //v36 = uPlayerSkillType;
16873 v4 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[431]);// Normal 16852 v4 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[431]);// Normal
16874 v34 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[433]);// Expert 16853 v34 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[433]);// Expert
16875 v33 = (unsigned __int16 *)pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[432]);// Master 16854 v33 = (unsigned __int16 *)pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[432]);// Master
16876 v5 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[96]);// Grand 16855 v5 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[96]);// Grand
16877 v35 = (unsigned __int16 *)v4; 16856 v35 = (unsigned __int16 *)v4;
16879 v35 = (unsigned __int16 *)v34; 16858 v35 = (unsigned __int16 *)v34;
16880 if ( (signed int)v33 > (signed int)v35 ) 16859 if ( (signed int)v33 > (signed int)v35 )
16881 v35 = v33; 16860 v35 = v33;
16882 if ( v5 > (signed int)v35 ) 16861 if ( v5 > (signed int)v35 )
16883 v35 = (unsigned __int16 *)v5; 16862 v35 = (unsigned __int16 *)v5;
16884 pPlayer = &pParty->pPlayers[v3]; 16863 pPlayer = &pParty->pPlayers[uPlayerID];
16885 v33 = &pPlayer->pActiveSkills[v2]; 16864 //v33 = &pPlayer->pActiveSkills[uPlayerSkillType];
16886 v7 = pPlayer->GetActualSkillLevel(v2); 16865 v7 = pPlayer->GetActualSkillLevel(uPlayerSkillType);
16887 v8 = LOBYTE(pPlayer->pActiveSkills[v2]); 16866 v8 = pPlayer->pActiveSkills[uPlayerSkillType];
16888 a2[0] = 0; 16867 a2[0] = 0;
16889 Source[0] = 0; 16868 Source[0] = 0;
16890 if ( (v8 & 0x3F) == (v7 & 0x3F) ) 16869 if ( (v8 & 0x3F) == (v7 & 0x3F) )
16891 { 16870 {
16892 strcpy(a2, "%s\n\n"); 16871 strcpy(a2, "%s\n\n");
16893 v24 = sub_417AD4(pPlayer->classType, v2, 1); 16872 v24 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 1);
16894 sprintf(Source, format_4E2DC8, v24); 16873 sprintf(Source, format_4E2DC8, v24);
16895 strcat(a2, Source); 16874 strcat(a2, Source);
16896 strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); 16875 strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
16897 v25 = sub_417AD4(pPlayer->classType, v36, 2); 16876 v25 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 2);
16898 sprintf(Source, format_4E2DC8, v25); 16877 sprintf(Source, format_4E2DC8, v25);
16899 strcat(a2, Source); 16878 strcat(a2, Source);
16900 strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); 16879 strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
16901 v26 = sub_417AD4(pPlayer->classType, v36, 3); 16880 v26 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 3);
16902 sprintf(Source, format_4E2DC8, v26); 16881 sprintf(Source, format_4E2DC8, v26);
16903 strcat(a2, Source); 16882 strcat(a2, Source);
16904 strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); 16883 strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
16905 v27 = pPlayer->classType; 16884 v27 = pPlayer->classType;
16906 v28 = v36; 16885 v28 = uPlayerSkillType;
16907 v29 = sub_417AD4(v27, v36, 4); 16886 v29 = GetSkillColor(v27, uPlayerSkillType, 4);
16908 sprintf(Source, format_4E2DC8, v29); 16887 sprintf(Source, format_4E2DC8, v29);
16909 strcat(a2, Source); 16888 strcat(a2, Source);
16910 strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); 16889 strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
16911 16890
16912 v23 = static_sub_417BB5_out_string; 16891 v23 = static_sub_417BB5_out_string;
16913 sprintf( 16892 sprintf(static_sub_417BB5_out_string, a2, pSkillDesc[v28], pGlobalTXT_LocalizationStrings[431], // Normal
16914 static_sub_417BB5_out_string, 16893 (char *)v35 + 3, v35 + 5, pNormalSkillDesc[v28], pGlobalTXT_LocalizationStrings[433], // Expert
16915 a2, 16894 (char *)v35 + 3, v35 + 5, pExpertSkillDesc[v28], pGlobalTXT_LocalizationStrings[432], // Master
16916 pSkillDesc[v28], 16895 (char *)v35 + 3, v35 + 5, pMasterSkillDesc[v28], pGlobalTXT_LocalizationStrings[96], // Grand
16917 pGlobalTXT_LocalizationStrings[431], // Normal 16896 (char *)v35 + 3, v35 + 5, pGrandSkillDesc[v28]);
16918 (char *)v35 + 3,
16919 v35 + 5,
16920 pNormalSkillDesc[v28],
16921 pGlobalTXT_LocalizationStrings[433], // Expert
16922 (char *)v35 + 3,
16923 v35 + 5,
16924 pExpertSkillDesc[v28],
16925 pGlobalTXT_LocalizationStrings[432], // Master
16926 (char *)v35 + 3,
16927 v35 + 5,
16928 pMasterSkillDesc[v28],
16929 pGlobalTXT_LocalizationStrings[96], // Grand
16930 (char *)v35 + 3,
16931 v35 + 5,
16932 pGrandSkillDesc[v28]);
16933 } 16897 }
16934 else 16898 else
16935 { 16899 {
16936 strcpy(a2, "%s\n\n"); 16900 strcpy(a2, "%s\n\n");
16937 v9 = sub_417AD4(pPlayer->classType, v2, 1); 16901 v9 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 1);
16938 sprintf(Source, format_4E2DC8, v9); 16902 sprintf(Source, format_4E2DC8, v9);
16939 strcat(a2, Source); 16903 strcat(a2, Source);
16940 strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); 16904 strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
16941 v10 = sub_417AD4(pPlayer->classType, v36, 2); 16905 v10 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 2);
16942 sprintf(Source, format_4E2DC8, v10); 16906 sprintf(Source, format_4E2DC8, v10);
16943 strcat(a2, Source); 16907 strcat(a2, Source);
16944 strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); 16908 strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
16945 v11 = sub_417AD4(pPlayer->classType, v36, 3); 16909 v11 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 3);
16946 sprintf(Source, format_4E2DC8, v11); 16910 sprintf(Source, format_4E2DC8, v11);
16947 strcat(a2, Source); 16911 strcat(a2, Source);
16948 strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); 16912 strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
16949 v12 = v36; 16913 v12 = uPlayerSkillType;
16950 v13 = sub_417AD4(pPlayer->classType, v36, 4); 16914 v13 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 4);
16951 sprintf(Source, format_4E2DC8, v13); 16915 sprintf(Source, format_4E2DC8, v13);
16952 strcat(a2, Source); 16916 strcat(a2, Source);
16953 strcat(a2, "%s\t%03d:\t%03d%s\t000\n\n"); 16917 strcat(a2, "%s\t%03d:\t%03d%s\t000\n\n");
16954 v14 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); 16918 v14 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
16955 sprintf(Source, format_4E2DC8, v14); 16919 sprintf(Source, format_4E2DC8, v14);
16957 strcat(a2, "%s: +%d"); 16921 strcat(a2, "%s: +%d");
16958 v15 = v12; 16922 v15 = v12;
16959 v16 = (int)(v35 + 5); 16923 v16 = (int)(v35 + 5);
16960 v15 = (PLAYER_SKILL_TYPE)((int)v15 * 4); 16924 v15 = (PLAYER_SKILL_TYPE)((int)v15 * 4);
16961 v34 = (int)((char *)v35 + 3); 16925 v34 = (int)((char *)v35 + 3);
16962 v17 = pPlayer->GetActualSkillLevel(v36); 16926 v17 = pPlayer->GetActualSkillLevel(uPlayerSkillType);
16963 v18 = *(int *)((char *)pGrandSkillDesc + v15); 16927 v18 = *(int *)((char *)pGrandSkillDesc + v15);
16964 v19 = *(int *)((char *)pMasterSkillDesc + v15); 16928 v19 = *(int *)((char *)pMasterSkillDesc + v15);
16965 v20 = *(int *)((char *)pExpertSkillDesc + v15); 16929 v20 = *(int *)((char *)pExpertSkillDesc + v15);
16966 v21 = *(int *)((char *)pNormalSkillDesc + v15); 16930 v21 = *(int *)((char *)pNormalSkillDesc + v15);
16967 v22 = *(int *)((char *)pSkillDesc + v15); 16931 v22 = *(int *)((char *)pSkillDesc + v15);
17398 int v135; // [sp+18h] [bp-8h]@27 17362 int v135; // [sp+18h] [bp-8h]@27
17399 int v136; // [sp+18h] [bp-8h]@33 17363 int v136; // [sp+18h] [bp-8h]@33
17400 int v137; // [sp+1Ch] [bp-4h]@27 17364 int v137; // [sp+1Ch] [bp-4h]@27
17401 int v138; // [sp+1Ch] [bp-4h]@33 17365 int v138; // [sp+1Ch] [bp-4h]@33
17402 17366
17403 pPlayer = &pParty->pPlayers[uPlayerID-1];//(Player *)&stru_AA1058[3].pSounds[6972 * uPlayerID + 40552]; 17367 pPlayer = &pParty->pPlayers[uPlayerID-1];
17404 v2 = pIcons_LOD->LoadTexture("fr_stats", TEXTURE_16BIT_PALETTE); 17368 v2 = pIcons_LOD->LoadTexture("fr_stats", TEXTURE_16BIT_PALETTE);
17405 pRenderer->DrawTextureIndexed(8, 8, (Texture *)(v2 != -1 ? (int)&pIcons_LOD->pTextures[v2] : 0)); 17369 pRenderer->DrawTextureIndexed(8, 8, (Texture *)(v2 != -1 ? (int)&pIcons_LOD->pTextures[v2] : 0));
17406 v3 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); 17370 v3 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
17407 sprintf(pTmpBuf, format_4E2DC8, v3); 17371 sprintf(pTmpBuf, format_4E2DC8, v3);
17408 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[429], pPlayer->pName, pClassNames[pPlayer->classType]);//^Pi[%s] %s 17372 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[429], pPlayer->pName, pClassNames[pPlayer->classType]);//^Pi[%s] %s
17855 v0 = uActiveCharacter; 17819 v0 = uActiveCharacter;
17856 } 17820 }
17857 } 17821 }
17858 v12 = 0; 17822 v12 = 0;
17859 a5 = pGUIWindow_CurrentMenu->uNumControls; 17823 a5 = pGUIWindow_CurrentMenu->uNumControls;
17860 v18 = &pParty->pPlayers[v0-1]; //&stru_AA1058[3].pSounds[6972 * v0 + 40552]; 17824 v18 = &pParty->pPlayers[v0-1];
17861 v2 = pFontLucida; 17825 v2 = pFontLucida;
17862 v14 = pWeaponSkills; 17826 v14 = pWeaponSkills;
17863 v3 = 2 * LOBYTE(pFontLucida->uFontHeight) + 13; 17827 v3 = 2 * LOBYTE(pFontLucida->uFontHeight) + 13;
17864 do 17828 do
17865 { 17829 {