comparison mm7_4.cpp @ 148:77ad59c17864

Слияние
author Ritor1
date Tue, 12 Feb 2013 09:11:19 +0600
parents c70fea5013aa a8ec7e1e18b6
children d92c78ab54fe
comparison
equal deleted inserted replaced
147:c70fea5013aa 148:77ad59c17864
975 LABEL_54: 975 LABEL_54:
976 *(int *)a4 = 0; 976 *(int *)a4 = 0;
977 return dword_720F20[v22]; 977 return dword_720F20[v22];
978 } 978 }
979 979
980
981 //not sure if right- or left-handed coordinate space assumed, so this could be normal of inverse normal
982 // for a right-handed system, that would be an inverse normal
980 //----- (0046DCC8) -------------------------------------------------------- 983 //----- (0046DCC8) --------------------------------------------------------
981 signed __int64 __fastcall _46DCC8_get_gravity_direction_outdoor(int a1, int a2, Vec3_int_ *a3) 984 void ODM_GetTerrainNormalAt(int pos_x, int pos_z, Vec3_int_ *out)
982 { 985 {
983 int v3; // ebx@1 986 auto grid_x = WorldPosToGridCellX(pos_x);
984 int v4; // ST4C_4@1 987 auto grid_z = WorldPosToGridCellZ(pos_z) - 1;
985 unsigned int v5; // ST54_4@1 988
986 unsigned int v6; // edi@1 989 auto grid_pos_x1 = GridCellToWorldPosX(grid_x);
987 unsigned int v7; // ST50_4@1 990 auto grid_pos_x2 = GridCellToWorldPosX(grid_x + 1);
988 int v8; // edi@1 991 auto grid_pos_z1 = GridCellToWorldPosZ(grid_z);
989 int v9; // esi@1 992 auto grid_pos_z2 = GridCellToWorldPosZ(grid_z + 1);
990 int v10; // ebx@1 993
991 int v11; // ecx@2 994 auto x1z1_y = pOutdoor->DoGetHeightOnTerrain(grid_x, grid_z);
992 int v12; // eax@2 995 auto x2z1_y = pOutdoor->DoGetHeightOnTerrain(grid_x + 1, grid_z);
993 int v13; // edx@2 996 auto x2z2_y = pOutdoor->DoGetHeightOnTerrain(grid_x + 1, grid_z + 1);
994 int v14; // ebx@2 997 auto x1z2_y = pOutdoor->DoGetHeightOnTerrain(grid_x, grid_z + 1);
995 double v15; // st7@4 998
996 double v16; // st6@4 999 float side1_dx, side1_dy, side1_dz,
997 double v17; // st5@4 1000 side2_dx, side2_dy, side2_dz;
998 float v18; // ST44_4@4 1001
999 float v19; // ST54_4@4 1002 auto dx = abs(pos_x - grid_pos_x1),
1000 double v20; // st4@4 1003 dz = abs(grid_pos_z1 - pos_z);
1001 double v21; // st5@4 1004 if (dz >= dx)
1002 float v22; // ST44_4@6 1005 {
1003 double v23; // st7@4 1006 side1_dy = (double)(x1z1_y - x1z2_y);
1004 double v24; // st7@6 1007 side2_dy = (double)(x2z2_y - x1z2_y);
1005 signed __int64 result; // qax@6 1008 side2_dx = (double)(grid_pos_x2 - grid_pos_x1);
1006 int v26; // [sp+14h] [bp-44h]@1 1009 side1_dx = (double)(grid_pos_x1 - grid_pos_x1);
1007 int v27; // [sp+18h] [bp-40h]@1 1010 side2_dz = (double)(grid_pos_z2 - grid_pos_z2); // bug? z2 - z2
1008 int v28; // [sp+20h] [bp-38h]@1 1011 side1_dz = (double)(grid_pos_z2 - grid_pos_z2); // z1 - z2
1009 int v29; // [sp+24h] [bp-34h]@1 1012 Log::Warning(L"%s %s %u\n", __FILE__, __FUNCTION__, __LINE__);
1010 int v30; // [sp+28h] [bp-30h]@1 1013 /* |\
1011 int v31; // [sp+2Ch] [bp-2Ch]@1 1014 side1 | \
1012 int v32; // [sp+30h] [bp-28h]@1 1015 |____\
1013 int v33; // [sp+34h] [bp-24h]@1 1016 side 2 */
1014 int v34; // [sp+38h] [bp-20h]@1
1015 int v35; // [sp+3Ch] [bp-1Ch]@1
1016 int v36; // [sp+40h] [bp-18h]@1
1017 int v37; // [sp+4Ch] [bp-Ch]@2
1018 float v38; // [sp+4Ch] [bp-Ch]@4
1019 int v39; // [sp+50h] [bp-8h]@2
1020 float v40; // [sp+50h] [bp-8h]@4
1021 int v41; // [sp+54h] [bp-4h]@2
1022
1023 v3 = a1;
1024 v4 = a2;
1025 v5 = WorldPosToGridCellX(a1);
1026 v6 = WorldPosToGridCellZ(v4) - 1;
1027 v33 = GridCellToWorldPosX(v5);
1028 v34 = GridCellToWorldPosX(v5 + 1);
1029 v35 = GridCellToWorldPosX(v5 + 1);
1030 v36 = GridCellToWorldPosX(v5);
1031 v29 = GridCellToWorldPosZ(v6);
1032 v30 = GridCellToWorldPosZ(v6);
1033 v7 = v6 + 1;
1034 v31 = GridCellToWorldPosZ(v6 + 1);
1035 v32 = GridCellToWorldPosZ(v6 + 1);
1036 v26 = pOutdoor->DoGetHeightOnTerrain(v5, v6);
1037 v27 = pOutdoor->DoGetHeightOnTerrain(v5 + 1, v6);
1038 v8 = pOutdoor->DoGetHeightOnTerrain(v5 + 1, v6 + 1);
1039 v28 = pOutdoor->DoGetHeightOnTerrain(v5, v7);
1040 v9 = v29;
1041 v10 = abs(v3 - v33);
1042 if ( abs(v29 - v4) >= v10 )
1043 {
1044 v11 = v33;
1045 v37 = v28;
1046 v39 = v36;
1047 v12 = v35;
1048 v41 = v32;
1049 v13 = v31;
1050 v14 = v8;
1051 v8 = v26;
1052 } 1017 }
1053 else 1018 else
1054 { 1019 {
1055 v11 = v35; 1020 side1_dy = (double)(x2z2_y - x2z1_y);
1056 v41 = v30; 1021 side2_dy = (double)(x1z1_y - x2z1_y);
1057 v39 = v34; 1022 side2_dx = (double)(grid_pos_x1 - grid_pos_x2);
1058 v12 = v33; 1023 side1_dx = (double)(grid_pos_x2 - grid_pos_x2);
1059 v13 = v29; 1024 side2_dz = (double)(grid_pos_z1 - grid_pos_z1);
1060 v9 = v31; 1025 side1_dz = (double)(grid_pos_z2 - grid_pos_z1);
1061 v37 = v27; 1026
1062 v14 = v26; 1027 /* side 2
1063 } 1028 _____
1064 v15 = (double)(v12 - v39); 1029 \ |
1065 v16 = (double)(v13 - v41); 1030 \ | side 1
1066 v17 = (double)(v14 - v37); 1031 \| */
1067 v18 = (double)(v11 - v39); 1032 }
1068 v19 = (double)(v9 - v41); 1033
1069 v20 = (double)(v8 - v37); 1034 float nx = side1_dy * side2_dz - side1_dz * side2_dy;
1070 v38 = v20 * v16 - v19 * v17; 1035 float ny = side1_dx * side2_dy - side1_dy * side2_dx;
1071 v40 = v18 * v17 - v20 * v15; 1036 float nz = side1_dz * side2_dx - side1_dx * side2_dz;
1072 v21 = v19 * v15 - v18 * v16; 1037
1073 v23 = sqrt(v21 * v21 + v40 * v40 + v38 * v38); 1038 float mag = sqrt(nx * nx + ny * ny + nz * nz);
1074 if ( v23 == 0.0 ) 1039 if (fabsf(mag) < 1e-6f)
1075 { 1040 {
1076 a3->y = 0; 1041 out->y = 0;
1077 a3->x = 0; 1042 out->x = 0;
1078 a3->z = 65536; 1043 out->z = 65536;
1079 } 1044 }
1080 v24 = 1.0 / v23; 1045 else
1081 a3->x = (signed __int64)(v24 * v38 * 65536.0); 1046 {
1082 a3->y = (signed __int64)(v24 * v40 * 65536.0); 1047 float invmag = 1.0 / mag;
1083 v22 = v21; 1048 out->x = invmag * nx * 65536.0;
1084 result = (signed __int64)(v24 * v22 * 65536.0); 1049 out->y = invmag * ny * 65536.0;
1085 a3->z = result; 1050 out->z = invmag * nz * 65536.0;
1086 return result; 1051 }
1087 } 1052 }
1088 // 47F44B: using guessed type int __stdcall WorldPosToGridCellX(int); 1053
1089 // 47F458: using guessed type int __stdcall WorldPosToGridCellZ(int);
1090 // 47F469: using guessed type int __stdcall GridCellToWorldPosX(int);
1091 // 47F476: using guessed type int __stdcall GridCellToWorldPosZ(int);
1092 1054
1093 //----- (0046DEF2) -------------------------------------------------------- 1055 //----- (0046DEF2) --------------------------------------------------------
1094 unsigned int __fastcall sub_46DEF2(signed int a2, unsigned int uLayingItemID) 1056 unsigned int __fastcall sub_46DEF2(signed int a2, unsigned int uLayingItemID)
1095 { 1057 {
1096 unsigned int result; // eax@1 1058 unsigned int result; // eax@1
3126 v9 = v23; 3088 v9 = v23;
3127 pRenderer->DrawTextureIndexed(pHiredNPCsIconsOffsetsX[v9], pHiredNPCsIconsOffsetsY[v9], (Texture *)(v8 != -1 ? &pIcons_LOD->pTextures[v8] : 0)); 3089 pRenderer->DrawTextureIndexed(pHiredNPCsIconsOffsetsX[v9], pHiredNPCsIconsOffsetsY[v9], (Texture *)(v8 != -1 ? &pIcons_LOD->pTextures[v8] : 0));
3128 v10 = (unsigned __int8)pTmpBuf[i]; 3090 v10 = (unsigned __int8)pTmpBuf[i];
3129 if ( pParty->pHirelings[v10].bDrawSomeAnim == 1 ) 3091 if ( pParty->pHirelings[v10].bDrawSomeAnim == 1 )
3130 { 3092 {
3131 uFrameID = pParty->pHirelings[v10].evtb; 3093 uFrameID = pParty->pHirelings[v10]._anim_current_time;
3132 v11 = pHiredNPCsIconsOffsetsX[v9]; 3094 v11 = pHiredNPCsIconsOffsetsX[v9];
3133 v12 = pHiredNPCsIconsOffsetsY[v9]; 3095 v12 = pHiredNPCsIconsOffsetsY[v9];
3134 v17 = v11; 3096 v17 = v11;
3135 v21 = 0; 3097 v21 = 0;
3136 if ( (signed int)pIconsFrameTable->uNumIcons <= 0 ) 3098 if ( (signed int)pIconsFrameTable->uNumIcons <= 0 )
3234 sub_441A4E(i); 3196 sub_441A4E(i);
3235 continue; 3197 continue;
3236 } 3198 }
3237 v7 = 0; 3199 v7 = 0;
3238 for (uint j = 0; j < pPlayerFrameTable->uNumFrames; ++j) 3200 for (uint j = 0; j < pPlayerFrameTable->uNumFrames; ++j)
3239 if (pPlayerFrameTable->pFrames[j].uSequenceID == pPlayer->uExpressionID) 3201 if (pPlayerFrameTable->pFrames[j].expression == pPlayer->expression)
3240 { 3202 {
3241 v7 = j; 3203 v7 = j;
3242 break; 3204 break;
3243 } 3205 }
3244 if ( v7 == 0 ) 3206 if ( v7 == 0 )
3245 v7 = 1; 3207 v7 = 1;
3246 if (pPlayer->uExpressionID == 21 ) 3208 if (pPlayer->expression == CHARACTER_EXPRESSION_21)
3247 pFrame = pPlayerFrameTable->GetFrameBy_y(&pPlayer->field_1AA8, &pPlayer->field_1AA4, pMiscTimer->uTimeElapsed); 3209 pFrame = pPlayerFrameTable->GetFrameBy_y(&pPlayer->field_1AA8, &pPlayer->field_1AA4, pMiscTimer->uTimeElapsed);
3248 else 3210 else
3249 pFrame = pPlayerFrameTable->GetFrameBy_x(v7, pPlayer->uExpressionTimePassed); 3211 pFrame = pPlayerFrameTable->GetFrameBy_x(v7, pPlayer->uExpressionTimePassed);
3250 if (pPlayer->field_1AA2 != pFrame->uTextureID - 1 || v22 ) 3212 if (pPlayer->field_1AA2 != pFrame->uTextureID - 1 || v22 )
3251 { 3213 {
3565 v50 = 0; 3527 v50 = 0;
3566 v47 = 0; 3528 v47 = 0;
3567 v45 = 0; 3529 v45 = 0;
3568 v48 = 0; 3530 v48 = 0;
3569 v46 = 0; 3531 v46 = 0;
3570 if ( v44 && v21->uClass == 31 ) 3532 if ( v44 && v21->classType == PLAYER_CLASS_31 )
3571 v50 = 1; 3533 v50 = 1;
3572 if ( v21->uClass == 35 ) 3534 if ( v21->classType == PLAYER_CLASS_LICH )
3573 v48 = 1; 3535 v48 = 1;
3574 v22 = (ITEM_EQUIP_TYPE)0; 3536 v22 = (ITEM_EQUIP_TYPE)0;
3575 while ( 1 ) 3537 while ( 1 )
3576 { 3538 {
3577 if ( v21->HasItemEquipped(v22) ) 3539 if ( v21->HasItemEquipped(v22) )
3966 } 3928 }
3967 goto LABEL_39; 3929 goto LABEL_39;
3968 } 3930 }
3969 v13 = pPlayers[v12]; 3931 v13 = pPlayers[v12];
3970 } 3932 }
3971 v13->PlayEmotion(37, v58); 3933 v13->PlayEmotion(CHARACTER_EXPRESSION_37, v58);
3972 LABEL_39: 3934 LABEL_39:
3973 ++v12; 3935 ++v12;
3974 if ( v12 > 4 ) 3936 if ( v12 > 4 )
3975 { 3937 {
3976 v11 = LODWORD(pParty->uTimePlayed); 3938 v11 = LODWORD(pParty->uTimePlayed);
4307 // 4EE088: using guessed type __int16 word_4EE088_sound_ids[]; 4269 // 4EE088: using guessed type __int16 word_4EE088_sound_ids[];
4308 4270
4309 4271
4310 4272
4311 //----- (00494AED) -------------------------------------------------------- 4273 //----- (00494AED) --------------------------------------------------------
4312 unsigned int PlayerFrameTable::GetFrameIdBy_field0(int uField0) 4274 unsigned int PlayerFrameTable::GetFrameIdByExpression(CHARACTER_EXPRESSION_ID expression)
4313 { 4275 {
4314 unsigned int _uNumFrames; // edx@1 4276 unsigned int _uNumFrames; // edx@1
4315 unsigned int result; // eax@1 4277 unsigned int result; // eax@1
4316 PlayerFrame *v4; // ecx@2 4278 PlayerFrame *v4; // ecx@2
4317 4279
4323 result = 0; 4285 result = 0;
4324 } 4286 }
4325 else 4287 else
4326 { 4288 {
4327 v4 = this->pFrames; 4289 v4 = this->pFrames;
4328 while ( v4->uSequenceID != uField0 ) 4290 while ( v4->expression != expression )
4329 { 4291 {
4330 ++result; 4292 ++result;
4331 ++v4; 4293 ++v4;
4332 if ( (signed int)result >= (signed int)_uNumFrames ) 4294 if ( (signed int)result >= (signed int)_uNumFrames )
4333 goto LABEL_5; 4295 goto LABEL_5;
4490 memcpy(&v24, texture_frame_table_txt_parser(&Buf, &v23), sizeof(v24)); 4452 memcpy(&v24, texture_frame_table_txt_parser(&Buf, &v23), sizeof(v24));
4491 if ( v24.field_0 && *v24.pProperties[0] != 47 ) 4453 if ( v24.field_0 && *v24.pProperties[0] != 47 )
4492 { 4454 {
4493 v8 = atoi(v24.pProperties[0]); 4455 v8 = atoi(v24.pProperties[0]);
4494 v9 = v24.pProperties[1]; 4456 v9 = v24.pProperties[1];
4495 v2->pFrames[v2->uNumFrames].uSequenceID = v8; 4457 v2->pFrames[v2->uNumFrames].expression = (CHARACTER_EXPRESSION_ID)v8;
4496 v10 = atoi(v9); 4458 v10 = atoi(v9);
4497 v11 = v24.pProperties[2]; 4459 v11 = v24.pProperties[2];
4498 v2->pFrames[v2->uNumFrames].uTextureID = v10; 4460 v2->pFrames[v2->uNumFrames].uTextureID = v10;
4499 v2->pFrames[v2->uNumFrames].uAnimTime = atoi(v11); 4461 v2->pFrames[v2->uNumFrames].uAnimTime = atoi(v11);
4500 v2->pFrames[v2->uNumFrames].uAnimLength = 0; 4462 v2->pFrames[v2->uNumFrames].uAnimLength = 0;
5310 int v13; // ecx@21 5272 int v13; // ecx@21
5311 int v14; // ecx@22 5273 int v14; // ecx@22
5312 char *v15; // ST14_4@24 5274 char *v15; // ST14_4@24
5313 size_t v16; // eax@28 5275 size_t v16; // eax@28
5314 int v17; // eax@33 5276 int v17; // eax@33
5315 enum CHARACTER_RACE uNumRace; // eax@35 5277 //enum CHARACTER_RACE uNumRace; // eax@35
5316 int v19; // eax@36 5278 int v19; // eax@36
5317 int v20; // eax@37 5279 int v20; // eax@37
5318 int uNumMight; // eax@44 5280 int uNumMight; // eax@44
5319 unsigned int v24; // eax@44 5281 unsigned int v24; // eax@44
5320 int v25; // eax@44 5282 int v25; // eax@44
5340 char *v48; // ST1C_4@46 5302 char *v48; // ST1C_4@46
5341 int v50; // eax@46 5303 int v50; // eax@46
5342 int v51; // eax@49 5304 int v51; // eax@49
5343 char *v52; // edi@52 5305 char *v52; // edi@52
5344 char v53; // al@52 5306 char v53; // al@52
5345 int uClassType; // edi@53 5307 PLAYER_CLASS_TYPE uClassType; // edi@53
5346 int v55; // ST0C_4@53 5308 int v55; // ST0C_4@53
5347 int v57; // eax@53 5309 int v57; // eax@53
5348 int v61; // ecx@55 5310 int v61; // ecx@55
5349 int v64; // ST08_4@57 5311 int v64; // ST08_4@57
5350 int v66; // ecx@57 5312 int v66; // ecx@57
5380 int uColorTeal; // [sp+158h] [bp-18h]@1 5342 int uColorTeal; // [sp+158h] [bp-18h]@1
5381 int uColorWhite; // [sp+15Ch] [bp-14h]@1 5343 int uColorWhite; // [sp+15Ch] [bp-14h]@1
5382 int uX; // [sp+160h] [bp-10h]@18 5344 int uX; // [sp+160h] [bp-10h]@18
5383 unsigned int v133; // [sp+164h] [bp-Ch]@25 5345 unsigned int v133; // [sp+164h] [bp-Ch]@25
5384 int pOrder; // [sp+168h] [bp-8h]@14 5346 int pOrder; // [sp+168h] [bp-8h]@14
5385 char *Str; // [sp+16Ch] [bp-4h]@18 5347 //char *Str; // [sp+16Ch] [bp-4h]@18
5386 Player *pPlayer; 5348 //Player *pPlayer;
5387 const char *pSkillName; 5349 const char *pSkillName;
5388 5350
5389 uColor1 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xD1, 0xBB, 0x61); 5351 uColor1 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xD1, 0xBB, 0x61);
5390 uColorTeal = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xF7, 0xF7); 5352 uColorTeal = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xF7, 0xF7);
5391 uColorGreen = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFF, 0); 5353 uColorGreen = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFF, 0);
5464 v123 = 3 * v6 + 311; 5426 v123 = 3 * v6 + 311;
5465 v129 = 493; 5427 v129 = 493;
5466 //pPlayer = pParty->pPlayers; 5428 //pPlayer = pParty->pPlayers;
5467 v119 = 6 * v6 + 169; 5429 v119 = 6 * v6 + 169;
5468 //do 5430 //do
5469 for ( pPlayer = pParty->pPlayers; (signed int)pPlayer->pName < (signed int)&pParty->pPickedItem.uNumCharges; pPlayer++) 5431
5470 { 5432 //for ( pPlayer = pParty->pPlayers; (signed int)pPlayer->pName < (signed int)&pParty->pPickedItem.uNumCharges; pPlayer++)
5471 Str = pPlayer->pName; 5433 for (int i = 0; i < 4; ++i)
5472 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pOrder + 73, 100, 0, pClassNames[(unsigned __int8)pPlayer->uClass], 0, 0, 0); 5434 {
5473 pRenderer->DrawTextureTransparent(pOrder + 77, 50, pTexture_IC_KNIGHT[pPlayer->uClass/4]); 5435 auto player = pParty->pPlayers + i;
5436
5437 //Str = pPlayer->pName;
5438 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pOrder + 73, 100, 0, pClassNames[player->classType], 0, 0, 0);
5439 pRenderer->DrawTextureTransparent(pOrder + 77, 50, pTexture_IC_KNIGHT[player->classType / 4]);
5474 v11 = pGUIWindow_CurrentMenu->field_40; 5440 v11 = pGUIWindow_CurrentMenu->field_40;
5475 if ( v11 && (v12 = pGUIWindow_CurrentMenu->ptr_1C, v12 == v124) ) 5441 if ( v11 && (v12 = pGUIWindow_CurrentMenu->ptr_1C, v12 == v124) )
5476 { 5442 {
5477 v13 = v11 - 1; 5443 v13 = v11 - 1;
5478 if ( v13 ) 5444 if ( v13 )
5481 if ( v14 ) 5447 if ( v14 )
5482 { 5448 {
5483 if ( v14 == 1 ) 5449 if ( v14 == 1 )
5484 { 5450 {
5485 pGUIWindow_CurrentMenu->field_40 = 0; 5451 pGUIWindow_CurrentMenu->field_40 = 0;
5486 pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pOrder, 124, 0, Str, 130, 0); 5452 pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pOrder, 124, 0, player->pName, 130, 0);
5487 SetCurrentMenuID(MENU_7); 5453 SetCurrentMenuID(MENU_7);
5488 } 5454 }
5489 } 5455 }
5490 else 5456 else
5491 { 5457 {
5503 v16 = strlen((const char *)pKeyActionMap->pPressedKeysBuffer); 5469 v16 = strlen((const char *)pKeyActionMap->pPressedKeysBuffer);
5504 } 5470 }
5505 while ( v133 < v16 ); 5471 while ( v133 < v16 );
5506 } 5472 }
5507 if ( v120 && v126 != v120 ) 5473 if ( v120 && v126 != v120 )
5508 strcpy(Str, (const char *)pKeyActionMap->pPressedKeysBuffer); 5474 strcpy(player->pName, (const char *)pKeyActionMap->pPressedKeysBuffer);
5509 pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pOrder, 0x7C, 0, Str, 130, 0); 5475 pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pOrder, 0x7C, 0, player->pName, 130, 0);
5510 *((short *)pPlayer->pName + 3323) = 1; // 5476 *(short *)&player->field_1988[27] = 1; //
5511 } 5477 }
5512 } 5478 }
5513 else 5479 else
5514 { 5480 {
5515 v17 = pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, 159 * (int)v12 + 18, 0x7Cu, 0, (const char *)pKeyActionMap->pPressedKeysBuffer, 120, 1); 5481 v17 = pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, 159 * (int)v12 + 18, 0x7Cu, 0, (const char *)pKeyActionMap->pPressedKeysBuffer, 120, 1);
5516 pGUIWindow_CurrentMenu->DrawFlashingInputCursor(159 * (unsigned int)pGUIWindow_CurrentMenu->ptr_1C + v17 + 20, 124, pFontCreate); 5482 pGUIWindow_CurrentMenu->DrawFlashingInputCursor(159 * (unsigned int)pGUIWindow_CurrentMenu->ptr_1C + v17 + 20, 124, pFontCreate);
5517 } 5483 }
5518 } 5484 }
5519 else 5485 else
5520 { 5486 {
5521 pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pOrder, 0x7C, 0, pPlayer->pName, 130, 0); 5487 pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pOrder, 0x7C, 0, player->pName, 130, 0);
5522 } 5488 }
5523 uNumRace = pPlayer->GetRace(); 5489 switch (player->GetRace())
5524 switch (uNumRace)
5525 { 5490 {
5526 case 0: uRaceName = pGlobalTXT_LocalizationStrings[99]; break; // "Human" 5491 case 0: uRaceName = pGlobalTXT_LocalizationStrings[99]; break; // "Human"
5527 case 1: uRaceName = pGlobalTXT_LocalizationStrings[103]; break; // "Dwarf" 5492 case 1: uRaceName = pGlobalTXT_LocalizationStrings[103]; break; // "Dwarf"
5528 case 2: uRaceName = pGlobalTXT_LocalizationStrings[106]; break; // "Goblin" 5493 case 2: uRaceName = pGlobalTXT_LocalizationStrings[106]; break; // "Goblin"
5529 case 3: uRaceName = pGlobalTXT_LocalizationStrings[101]; break; // "Elf" 5494 case 3: uRaceName = pGlobalTXT_LocalizationStrings[101]; break; // "Elf"
5530 }; 5495 };
5531 strcpy(pTmpBuf, uRaceName); 5496 strcpy(pTmpBuf, uRaceName);
5532 pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pOrder + 72, v128 + 12, 0, pTmpBuf, 130, 0); 5497 pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pOrder + 72, v128 + 12, 0, pTmpBuf, 130, 0);
5533 pTextCenter = pFontCreate->AlignText_Center(0x96, pText); 5498 pTextCenter = pFontCreate->AlignText_Center(0x96, pText);
5534 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + uX - 24, 291, uColor1, pText, 0, 0, 0); 5499 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + uX - 24, 291, uColor1, pText, 0, 0, 0);
5535 uNumMight = pPlayer->GetActualMight(); 5500 uNumMight = player->GetActualMight();
5536 sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[144], v129, uNumMight);// "Might" 5501 sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[144], v129, uNumMight);// "Might"
5537 LOWORD(v24) = pPlayer->GetStatColor(0); 5502 LOWORD(v24) = player->GetStatColor(0);
5538 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 169, v24, pTmpBuf, 0, 0, 0); 5503 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 169, v24, pTmpBuf, 0, 0, 0);
5539 v25 = pPlayer->GetActualIntelligence(); 5504 v25 = player->GetActualIntelligence();
5540 sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[116], v129, v25);// "Intellect" 5505 sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[116], v129, v25);// "Intellect"
5541 LOWORD(v26) = pPlayer->GetStatColor(1); 5506 LOWORD(v26) = player->GetStatColor(1);
5542 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, v128 + 169, v26, pTmpBuf, 0, 0, 0); 5507 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, v128 + 169, v26, pTmpBuf, 0, 0, 0);
5543 v27 = pPlayer->GetActualWillpower(); 5508 v27 = player->GetActualWillpower();
5544 sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[163], v129, v27);// "Personality" 5509 sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[163], v129, v27);// "Personality"
5545 LOWORD(v28) = pPlayer->GetStatColor(2); 5510 LOWORD(v28) = player->GetStatColor(2);
5546 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 2 * v128 + 169, v28, pTmpBuf, 0, 0, 0); 5511 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 2 * v128 + 169, v28, pTmpBuf, 0, 0, 0);
5547 v29 = pPlayer->GetActualEndurance(); 5512 v29 = player->GetActualEndurance();
5548 sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[75], v129, v29);// "Endurance" 5513 sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[75], v129, v29);// "Endurance"
5549 LOWORD(v30) = pPlayer->GetStatColor(3); 5514 LOWORD(v30) = player->GetStatColor(3);
5550 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, uY, v30, pTmpBuf, 0, 0, 0); 5515 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, uY, v30, pTmpBuf, 0, 0, 0);
5551 v31 = pPlayer->GetActualAccuracy(); 5516 v31 = player->GetActualAccuracy();
5552 sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[1], v129, v31);// "Accuracy" 5517 sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[1], v129, v31);// "Accuracy"
5553 LOWORD(v32) = pPlayer->GetStatColor(4); 5518 LOWORD(v32) = player->GetStatColor(4);
5554 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 4 * v128 + 169, v32, pTmpBuf, 0, 0, 0); 5519 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 4 * v128 + 169, v32, pTmpBuf, 0, 0, 0);
5555 v33 = pPlayer->GetActualSpeed(); 5520 v33 = player->GetActualSpeed();
5556 sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[211], v129, v33);// "Speed" 5521 sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[211], v129, v33);// "Speed"
5557 LOWORD(v34) = pPlayer->GetStatColor(5); 5522 LOWORD(v34) = player->GetStatColor(5);
5558 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, v122, v34, pTmpBuf, 0, 0, 0); 5523 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, v122, v34, pTmpBuf, 0, 0, 0);
5559 v35 = pPlayer->GetActualLuck(); 5524 v35 = player->GetActualLuck();
5560 sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[136], v129, v35);// "Luck" 5525 sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[136], v129, v35);// "Luck"
5561 LOWORD(v36) = pPlayer->GetStatColor(6u); 5526 LOWORD(v36) = player->GetStatColor(6u);
5562 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, v119, v36, pTmpBuf, 0, 0, 0); 5527 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, v119, v36, pTmpBuf, 0, 0, 0);
5563 v37 = pPlayer->GetSkillIdxByOrder(0); 5528 v37 = player->GetSkillIdxByOrder(0);
5564 pTextCenter = pFontCreate->AlignText_Center(0x96u, pSkillNames[v37]); 5529 pTextCenter = pFontCreate->AlignText_Center(0x96u, pSkillNames[v37]);
5565 sprintf(pTmpBuf, "\t%03u%s", pTextCenter, pSkillNames[v37]); 5530 sprintf(pTmpBuf, "\t%03u%s", pTextCenter, pSkillNames[v37]);
5566 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, 311, uColorWhite, pTmpBuf, 0, 0, 0); 5531 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, 311, uColorWhite, pTmpBuf, 0, 0, 0);
5567 v39 = pPlayer->GetSkillIdxByOrder(1); 5532 v39 = player->GetSkillIdxByOrder(1);
5568 pTextCenter = pFontCreate->AlignText_Center(0x96u, pSkillNames[v39]); 5533 pTextCenter = pFontCreate->AlignText_Center(0x96u, pSkillNames[v39]);
5569 sprintf(pTmpBuf, "\t%03u%s", pTextCenter, pSkillNames[v39]); 5534 sprintf(pTmpBuf, "\t%03u%s", pTextCenter, pSkillNames[v39]);
5570 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, v128 + 311, uColorWhite, pTmpBuf, 0, 0, 0); 5535 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, v128 + 311, uColorWhite, pTmpBuf, 0, 0, 0);
5571 v41 = pPlayer->GetSkillIdxByOrder(2); 5536 v41 = player->GetSkillIdxByOrder(2);
5572 pTextCenter = pFontCreate->AlignText_Center(150u, pSkillNames[v41]); 5537 pTextCenter = pFontCreate->AlignText_Center(150u, pSkillNames[v41]);
5573 sprintf(pTmpBuf, "\t%03u%s", pTextCenter, pSkillNames[v41]); 5538 sprintf(pTmpBuf, "\t%03u%s", pTextCenter, pSkillNames[v41]);
5574 v45 = uColorGreen; 5539 v45 = uColorGreen;
5575 if ( (signed int)v41 >= 37 ) 5540 if ( (signed int)v41 >= 37 )
5576 v45 = uColorTeal; 5541 v45 = uColorTeal;
5577 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, 2 * v128 + 311, v45, pTmpBuf, 0, 0, 0); 5542 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, 2 * v128 + 311, v45, pTmpBuf, 0, 0, 0);
5578 v46 = pPlayer->GetSkillIdxByOrder(3); 5543 v46 = player->GetSkillIdxByOrder(3);
5579 pTextCenter = pFontCreate->AlignText_Center(150u, pSkillNames[v46]); 5544 pTextCenter = pFontCreate->AlignText_Center(150u, pSkillNames[v46]);
5580 sprintf(pTmpBuf, "\t%03u%s", pTextCenter, pSkillNames[v46]); 5545 sprintf(pTmpBuf, "\t%03u%s", pTextCenter, pSkillNames[v46]);
5581 v50 = uColorGreen; 5546 v50 = uColorGreen;
5582 if ( (signed int)v46 >= 37 ) 5547 if ( (signed int)v46 >= 37 )
5583 v50 = uColorTeal; 5548 v50 = uColorTeal;
5586 v124 = (char *)v124 + 1; 5551 v124 = (char *)v124 + 1;
5587 pOrder += 159; 5552 pOrder += 159;
5588 v129 -= 158; 5553 v129 -= 158;
5589 uX += 158; 5554 uX += 158;
5590 } 5555 }
5556
5591 //while ( (signed int)pPlayer->pName < (signed int)&pParty->pPickedItem.uNumCharges ); 5557 //while ( (signed int)pPlayer->pName < (signed int)&pParty->pPickedItem.uNumCharges );
5592 strcpy(pText, pGlobalTXT_LocalizationStrings[41]);// "Class" 5558 strcpy(pText, pGlobalTXT_LocalizationStrings[41]);// "Class"
5593 v51 = strlen(pText) - 1; 5559 v51 = strlen(pText) - 1;
5594 pOrder = v51; 5560 pOrder = v51;
5595 if ( v51 >= 0 ) 5561 if ( v51 >= 0 )
5603 if ( v10 ) 5569 if ( v10 )
5604 break; 5570 break;
5605 v51 = pOrder; 5571 v51 = pOrder;
5606 } 5572 }
5607 } 5573 }
5608 uClassType = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].uClass; 5574 uClassType = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].classType;
5609 pTextCenter = pFontCreate->AlignText_Center(193u, pText); 5575 pTextCenter = pFontCreate->AlignText_Center(193u, pText);
5610 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 324, 395, uColor1, pText, 0, 0, 0); 5576 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 324, 395, uColor1, pText, 0, 0, 0);
5611 v57 = uColorTeal; 5577 v57 = uColorTeal;
5612 if ( uClassType ) 5578 if ( uClassType )
5613 v57 = uColorWhite; 5579 v57 = uColorWhite;
5628 if ( uClassType != PLAYER_CLASS_CLERIC ) 5594 if ( uClassType != PLAYER_CLASS_CLERIC )
5629 v71 = uColorWhite; 5595 v71 = uColorWhite;
5630 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[24]); 5596 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[24]);
5631 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 388, 417, v71, pClassNames[24], 0, 0, 0); 5597 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 388, 417, v71, pClassNames[24], 0, 0, 0);
5632 v75 = uColorTeal; 5598 v75 = uColorTeal;
5633 if ( uClassType != 28 ) 5599 if ( uClassType != PLAYER_CLASS_DRUID)
5634 v75 = uColorWhite; 5600 v75 = uColorWhite;
5635 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[28]); 5601 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[28]);
5636 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 388, uColorGreen, v75, pClassNames[28], 0, 0, 0); 5602 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 388, uColorGreen, v75, pClassNames[28], 0, 0, 0);
5637 v80 = uColorTeal; 5603 v80 = uColorTeal;
5638 if ( uClassType != PLAYER_CLASS_SORCERER ) 5604 if ( uClassType != PLAYER_CLASS_SORCERER )
5742 pCurrentScreen = 21;// 5708 pCurrentScreen = 21;//
5743 uPlayerCreationUI_ArrowAnim = 0; 5709 uPlayerCreationUI_ArrowAnim = 0;
5744 uPlayerCreationUI_SkySliderPos = 0; 5710 uPlayerCreationUI_SkySliderPos = 0;
5745 uPlayerCreationUI_SelectedCharacter = 0; 5711 uPlayerCreationUI_SelectedCharacter = 0;
5746 v0 = LOBYTE(pFontCreate->uFontHeight) - 2; 5712 v0 = LOBYTE(pFontCreate->uFontHeight) - 2;
5747 pTexture_IC_KNIGHT[0] = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("IC_KNIGHT", TEXTURE_16BIT_PALETTE)]; 5713 pTexture_IC_KNIGHT[0] = pIcons_LOD->LoadTexturePtr("IC_KNIGHT", TEXTURE_16BIT_PALETTE);
5748 pTexture_IC_KNIGHT[1] = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("IC_THIEF", TEXTURE_16BIT_PALETTE)]; 5714 pTexture_IC_KNIGHT[1] = pIcons_LOD->LoadTexturePtr("IC_THIEF", TEXTURE_16BIT_PALETTE);
5749 pTexture_IC_KNIGHT[2] = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("IC_MONK", TEXTURE_16BIT_PALETTE)]; 5715 pTexture_IC_KNIGHT[2] = pIcons_LOD->LoadTexturePtr("IC_MONK", TEXTURE_16BIT_PALETTE);
5750 pTexture_IC_KNIGHT[3] = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("IC_PALAD", TEXTURE_16BIT_PALETTE)]; 5716 pTexture_IC_KNIGHT[3] = pIcons_LOD->LoadTexturePtr("IC_PALAD", TEXTURE_16BIT_PALETTE);
5751 pTexture_IC_KNIGHT[4] = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("IC_ARCH", TEXTURE_16BIT_PALETTE)]; 5717 pTexture_IC_KNIGHT[4] = pIcons_LOD->LoadTexturePtr("IC_ARCH", TEXTURE_16BIT_PALETTE);
5752 pTexture_IC_KNIGHT[5] = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("IC_RANGER", TEXTURE_16BIT_PALETTE)]; 5718 pTexture_IC_KNIGHT[5] = pIcons_LOD->LoadTexturePtr("IC_RANGER", TEXTURE_16BIT_PALETTE);
5753 pTexture_IC_KNIGHT[6] = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("IC_CLER", TEXTURE_16BIT_PALETTE)]; 5719 pTexture_IC_KNIGHT[6] = pIcons_LOD->LoadTexturePtr("IC_CLER", TEXTURE_16BIT_PALETTE);
5754 pTexture_IC_KNIGHT[7] = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("IC_DRUID", TEXTURE_16BIT_PALETTE)]; 5720 pTexture_IC_KNIGHT[7] = pIcons_LOD->LoadTexturePtr("IC_DRUID", TEXTURE_16BIT_PALETTE);
5755 pTexture_IC_KNIGHT[8] = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("IC_SORC", TEXTURE_16BIT_PALETTE)]; 5721 pTexture_IC_KNIGHT[8] = pIcons_LOD->LoadTexturePtr("IC_SORC", TEXTURE_16BIT_PALETTE);
5756 pTexture_MAKETOP = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("MAKETOP", TEXTURE_16BIT_PALETTE)]; 5722 pTexture_MAKETOP = pIcons_LOD->LoadTexturePtr("MAKETOP", TEXTURE_16BIT_PALETTE);
5723 pTexture_MAKESKY = pIcons_LOD->LoadTexturePtr("MAKESKY", TEXTURE_16BIT_PALETTE);
5757 uX = 0; 5724 uX = 0;
5758 pTexture_MAKESKY = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("MAKESKY", TEXTURE_16BIT_PALETTE)];
5759 do // load PlayerPortraits texture 5725 do // load PlayerPortraits texture
5760 { 5726 {
5761 sprintf(pTmpBuf, "%s01", pPlayerPortraitsNames[uX]); 5727 sprintf(pTmpBuf, "%s01", pPlayerPortraitsNames[uX]);
5762 v1 = pIcons_LOD->LoadTexture(pTmpBuf, TEXTURE_16BIT_PALETTE); 5728 v1 = pIcons_LOD->LoadTexture(pTmpBuf, TEXTURE_16BIT_PALETTE);
5763 v2 = uX * 4; 5729 v2 = uX * 4;
5858 uControlParamd, 0, "", 0); 5824 uControlParamd, 0, "", 0);
5859 ++uControlParamd; 5825 ++uControlParamd;
5860 } 5826 }
5861 while ( uControlParamd < 9 ); 5827 while ( uControlParamd < 9 );
5862 pPlayerCreationUI_BtnOK = pGUIWindow_CurrentMenu->CreateButton(580, 431, 51, 39, 1, 0, 0x42, 0, 0xD, "", 5828 pPlayerCreationUI_BtnOK = pGUIWindow_CurrentMenu->CreateButton(580, 431, 51, 39, 1, 0, 0x42, 0, 0xD, "",
5863 (Texture *)(uTextureID_BUTTMAKE != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BUTTMAKE] : 0), 0); 5829 (Texture *)(uTextureID_BUTTMAKE != -1 ? &pIcons_LOD->pTextures[uTextureID_BUTTMAKE] : 0), 0);
5864 pPlayerCreationUI_BtnReset = pGUIWindow_CurrentMenu->CreateButton(527, 431, 51, 39, 1, 0, 0x43, 0, 0x43, "", 5830 pPlayerCreationUI_BtnReset = pGUIWindow_CurrentMenu->CreateButton(527, 431, 51, 39, 1, 0, 0x43, 0, 0x43, "",
5865 (Texture *)(uTextureID_BUTTMAKE2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BUTTMAKE2] : 0), 0); 5831 (Texture *)(uTextureID_BUTTMAKE2 != -1 ? &pIcons_LOD->pTextures[uTextureID_BUTTMAKE2] : 0), 0);
5866 pPlayerCreationUI_BtnMinus = pGUIWindow_CurrentMenu->CreateButton(523, 393, 20, 35, 1, 0, 0x3F, 0, 0x2D, "", pTexture_buttminu, 0); 5832 pPlayerCreationUI_BtnMinus = pGUIWindow_CurrentMenu->CreateButton(523, 393, 20, 35, 1, 0, 0x3F, 0, 0x2D, "", pTexture_buttminu, 0);
5867 pPlayerCreationUI_BtnPlus = pGUIWindow_CurrentMenu->CreateButton(613, 393, 20, 35, 1, 0, 0x3E, 1, 0x2B, "", pTexture_buttplus, 0); 5833 pPlayerCreationUI_BtnPlus = pGUIWindow_CurrentMenu->CreateButton(613, 393, 20, 35, 1, 0, 0x3E, 1, 0x2B, "", pTexture_buttplus, 0);
5868 pFontCChar = LoadFont("cchar.fnt", "FONTPAL", 0); 5834 pFontCChar = LoadFont("cchar.fnt", "FONTPAL", 0);
5869 } 5835 }
5870 // 4E28F8: using guessed type int pCurrentScreen; 5836 // 4E28F8: using guessed type int pCurrentScreen;
6021 item.Reset(); 5987 item.Reset();
6022 //v10 = (char *)&pParty->pPlayers[0].sResMagicBase; 5988 //v10 = (char *)&pParty->pPlayers[0].sResMagicBase;
6023 for ( pPlayer = &pParty->pPlayers[0]; pPlayer < &pParty->pPlayers[4]; pPlayer++) 5989 for ( pPlayer = &pParty->pPlayers[0]; pPlayer < &pParty->pPlayers[4]; pPlayer++)
6024 { 5990 {
6025 //v11 = pPlayer; 5991 //v11 = pPlayer;
6026 if ( !pPlayer->uClass ) 5992 if (pPlayer->classType == PLAYER_CLASS_KNIGHT)
6027 pPlayer->sResMagicBase = 10; 5993 pPlayer->sResMagicBase = 10;
6028 //*((short *)v10 + 400) = 0; 5994 //*((short *)v10 + 400) = 0;
6029 pPlayer->pPlayerBuffs[22].uExpireTime = 0; 5995 pPlayer->pPlayerBuffs[22].uExpireTime = 0;
6030 uSpellBookPageCount = 0; 5996 uSpellBookPageCount = 0;
6031 for ( int i = 0; i < 9; i++) 5997 for ( int i = 0; i < 9; i++)
6825 pSrc + y * 640, 8 * sizeof(__int16)); 6791 pSrc + y * 640, 8 * sizeof(__int16));
6826 memcpy(pDst + 8 + 460/*462*/ + y * Dst.lPitch / 2, 6792 memcpy(pDst + 8 + 460/*462*/ + y * Dst.lPitch / 2,
6827 pSrc + 8 + 460/*462*/ + y * 640, 174/*172*/ * sizeof(__int16)); 6793 pSrc + 8 + 460/*462*/ + y * 640, 174/*172*/ * sizeof(__int16));
6828 } 6794 }
6829 6795
6830 for (uint y = 351/*352*/; y < 480; ++y) 6796 for (uint y = 352; y < 480; ++y)
6831 memcpy(pDst + y * Dst.lPitch / 2, 6797 memcpy(pDst + y * Dst.lPitch / 2,
6832 pSrc + y * 640, 640 * sizeof(__int16)); 6798 pSrc + y * 640, 640 * sizeof(__int16));
6833 6799
6834 6800
6835 auto pSrc_x1y1 = pSrc + 640 * pViewport->uViewportY + pViewport->uViewportX; 6801 auto pSrc_x1y1 = pSrc + 640 * pViewport->uViewportY + pViewport->uViewportX;
6839 v9 = ((signed int)pViewport->uViewportX >> 1) - ((signed int)pViewport->uViewportZ >> 1); 6805 v9 = ((signed int)pViewport->uViewportX >> 1) - ((signed int)pViewport->uViewportZ >> 1);
6840 //v20 = ((signed int)pViewport->uViewportZ >> 1) - ((signed int)pViewport->uViewportX >> 1); 6806 //v20 = ((signed int)pViewport->uViewportZ >> 1) - ((signed int)pViewport->uViewportX >> 1);
6841 v22 = 4 * ((Dst.lPitch / 4) + v9); 6807 v22 = 4 * ((Dst.lPitch / 4) + v9);
6842 v21 = 4 * v9 + 1280; 6808 v21 = 4 * v9 + 1280;
6843 6809
6844 auto uNumLines = pViewport->uViewportW - pViewport->uViewportY + 1; 6810 //auto uNumLines = pViewport->uViewportW - pViewport->uViewportY + 1;
6845 //v26 = (LPVOID)(pViewport->uViewportW - pViewport->uViewportY + 1); 6811 //v26 = (LPVOID)(pViewport->uViewportW - pViewport->uViewportY + 1);
6846 v10 = (int)pSrc_x1y1; 6812 v10 = (int)pSrc_x1y1;
6847 v11 = (int)pDst_x1y1; 6813 v11 = (int)pDst_x1y1;
6848 auto uHalfWidth = v20 = (pViewport->uViewportZ - pViewport->uViewportX) / 2; 6814 auto uHalfWidth = v20 = (pViewport->uViewportZ - pViewport->uViewportX) / 2;
6849 v13 = v24; 6815 v13 = v24;
9239 v6->uTimeToRecovery = 0; 9205 v6->uTimeToRecovery = 0;
9240 memset(&v6->uTimeToRecovery, 0, 4u); 9206 memset(&v6->uTimeToRecovery, 0, 4u);
9241 ++v6; 9207 ++v6;
9242 } 9208 }
9243 while ( v6 <= &pParty->pPlayers[3] ); 9209 while ( v6 <= &pParty->pPlayers[3] );
9244 pParty->_4909F4(); 9210 pParty->UpdatePlayersAndHirelingsEmotions();
9245 } 9211 }
9246 // 507B94: using guessed type int dword_507B94; 9212 // 507B94: using guessed type int dword_507B94;
9247 9213
9248 //----- (004B1D27) -------------------------------------------------------- 9214 //----- (004B1D27) --------------------------------------------------------
9249 void __cdecl sub_4B1D27() 9215 void __cdecl sub_4B1D27()
9409 v5 = 0; 9375 v5 = 0;
9410 v12 = pParty->pPlayers;//[0].uClass; 9376 v12 = pParty->pPlayers;//[0].uClass;
9411 v9 = 0; 9377 v9 = 0;
9412 while ( 1 ) 9378 while ( 1 )
9413 { 9379 {
9414 if ( v12->uClass == 35 ) 9380 if ( v12->classType == PLAYER_CLASS_LICH )
9415 { 9381 {
9416 v10 = 0; 9382 v10 = 0;
9417 v6 = pParty->pPlayers;//[0].pInventoryItems[0].field_1A; 9383 v6 = pParty->pPlayers;//[0].pInventoryItems[0].field_1A;
9418 do 9384 do
9419 { 9385 {
9504 { 9470 {
9505 case 19: 9471 case 19:
9506 v3 = v2->bDrawSomeAnim; 9472 v3 = v2->bDrawSomeAnim;
9507 break; 9473 break;
9508 case 20: 9474 case 20:
9509 v3 = v2->evtb; 9475 v3 = v2->_anim_current_time;
9510 break; 9476 break;
9511 case 21: 9477 case 21:
9512 v3 = v2->evtc; 9478 v3 = v2->_anim_end_time;
9513 break; 9479 break;
9514 default: 9480 default:
9515 if ( a1 != 22 ) 9481 if ( a1 != 22 )
9516 goto _return; 9482 goto _return;
9517 v3 = v2->evtd; 9483 v3 = v2->evtd;
9628 v10 = v2->bDrawSomeAnim; 9594 v10 = v2->bDrawSomeAnim;
9629 if ( (signed int)v10 >= 400 && (signed int)v10 <= 416 ) 9595 if ( (signed int)v10 >= 400 && (signed int)v10 <= 416 )
9630 v2->bDrawSomeAnim = 0; 9596 v2->bDrawSomeAnim = 0;
9631 break; 9597 break;
9632 case 20: 9598 case 20:
9633 v9 = v2->evtb; 9599 v9 = v2->_anim_current_time;
9634 if ( v9 >= 400 && v9 <= 416 ) 9600 if ( v9 >= 400 && v9 <= 416 )
9635 v2->evtb = 0; 9601 v2->_anim_current_time = 0;
9636 break; 9602 break;
9637 case 21: 9603 case 21:
9638 v8 = v2->evtc; 9604 v8 = v2->_anim_end_time;
9639 if ( v8 >= 400 && v8 <= 416 ) 9605 if ( v8 >= 400 && v8 <= 416 )
9640 v2->evtc = 0; 9606 v2->_anim_end_time = 0;
9641 break; 9607 break;
9642 case 22: 9608 case 22:
9643 v7 = v2->evtd; 9609 v7 = v2->evtd;
9644 if ( v7 >= 400 && v7 <= 416 ) 9610 if ( v7 >= 400 && v7 <= 416 )
9645 v2->evtd = 0; 9611 v2->evtd = 0;
9808 else 9774 else
9809 { 9775 {
9810 dword_F8B1B4 = 2000; 9776 dword_F8B1B4 = 2000;
9811 dword_F8B1B0 = 2; 9777 dword_F8B1B0 = 2;
9812 } 9778 }
9813 v5 = v1->uClass; 9779 v5 = v1->classType;
9814 v33 = v5; 9780 v33 = v5;
9815 v6 = byte_4ED970_skill_learn_ability_by_class_table[v5][v3]; 9781 v6 = byte_4ED970_skill_learn_ability_by_class_table[v5][v3];
9816 *(int *)a1 = v1->pActiveSkills[v3]; 9782 *(int *)a1 = v1->pActiveSkills[v3];
9817 v7 = a1[0] & 0x3F; 9783 v7 = a1[0] & 0x3F;
9818 v34 = v2 + 2; 9784 v34 = v2 + 2;
10320 goto LABEL_33; 10286 goto LABEL_33;
10321 } 10287 }
10322 v20 = v19 - 1; 10288 v20 = v19 - 1;
10323 if ( !v20 ) 10289 if ( !v20 )
10324 { 10290 {
10325 v15 = (char *)pNPCTopics[v58->evtb-1].pTopic;//(&dword_721660)[8 * v58->evtb]; 10291 v15 = (char *)pNPCTopics[v58->_anim_current_time-1].pTopic;//(&dword_721660)[8 * v58->evtb];
10326 if ( !v15 ) 10292 if ( !v15 )
10327 { 10293 {
10328 v16->uControlParam = 0; 10294 v16->uControlParam = 0;
10329 v15 = ""; 10295 v15 = "";
10330 } 10296 }
10336 goto LABEL_45; 10302 goto LABEL_45;
10337 } 10303 }
10338 v21 = v20 - 1; 10304 v21 = v20 - 1;
10339 if ( !v21 ) 10305 if ( !v21 )
10340 { 10306 {
10341 v23 = v58->evtc; 10307 v23 = v58->_anim_end_time;
10342 goto LABEL_33; 10308 goto LABEL_33;
10343 } 10309 }
10344 v22 = v21 - 1; 10310 v22 = v21 - 1;
10345 if ( !v22 ) 10311 if ( !v22 )
10346 { 10312 {
11416 0, 11382 0,
11417 "", 11383 "",
11418 0); 11384 0);
11419 } 11385 }
11420 } 11386 }
11421 v7 = (void *)v17->evtb; 11387 v7 = (void *)v17->_anim_current_time;
11422 if ( v7 ) 11388 if ( v7 )
11423 { 11389 {
11424 if ( v1 < 4 ) 11390 if ( v1 < 4 )
11425 { 11391 {
11426 v8 = sub_4466C4(v7); 11392 v8 = sub_4466C4(v7);
11437 0, 11403 0,
11438 "", 11404 "",
11439 0); 11405 0);
11440 } 11406 }
11441 } 11407 }
11442 v9 = (void *)v17->evtc; 11408 v9 = (void *)v17->_anim_end_time;
11443 if ( v9 ) 11409 if ( v9 )
11444 { 11410 {
11445 if ( v1 < 4 ) 11411 if ( v1 < 4 )
11446 { 11412 {
11447 v10 = sub_4466C4(v9); 11413 v10 = sub_4466C4(v9);
11657 v7 = ptr_507BC0->ptr_1C; 11623 v7 = ptr_507BC0->ptr_1C;
11658 v68 = (unsigned __int16)word_4F0866[(signed int)v7]; 11624 v68 = (unsigned __int16)word_4F0866[(signed int)v7];
11659 v66 = 1000 * v3; 11625 v66 = 1000 * v3;
11660 if ( (signed __int64)__PAIR__(v6, LODWORD(v0->uExperience)) >= v66 ) 11626 if ( (signed __int64)__PAIR__(v6, LODWORD(v0->uExperience)) >= v66 )
11661 { 11627 {
11662 v8 = v0->uClass % 4 + 1; 11628 v8 = v0->classType % 4 + 1;
11663 if ( v8 == 4 ) 11629 if ( v8 == 4 )
11664 v8 = 3; 11630 v8 = 3;
11665 v9 = (double)(signed int)i; 11631 v9 = (double)(signed int)i;
11666 i = 0; 11632 i = 0;
11667 v69 = v8; 11633 v69 = v8;
11698 if ( (signed int)v15 >= (signed int)(v15 + v16) ) 11664 if ( (signed int)v15 >= (signed int)(v15 + v16) )
11699 goto LABEL_76; 11665 goto LABEL_76;
11700 do 11666 do
11701 { 11667 {
11702 v17 = v13->GetControl(v15)->uControlParam - 36; 11668 v17 = v13->GetControl(v15)->uControlParam - 36;
11703 if ( byte_4ED970_skill_learn_ability_by_class_table[v0->uClass][v17] && !v0->pActiveSkills[v17] ) 11669 if ( byte_4ED970_skill_learn_ability_by_class_table[v0->classType][v17] && !v0->pActiveSkills[v17] )
11704 { 11670 {
11705 v18 = pFontArrus->CalcTextHeight(pSkillNames[v17], &v65, 0, 0); 11671 v18 = pFontArrus->CalcTextHeight(pSkillNames[v17], &v65, 0, 0);
11706 i += v18; 11672 i += v18;
11707 ++v72; 11673 ++v72;
11708 } 11674 }
11726 do 11692 do
11727 { 11693 {
11728 v20 = v13->GetControl(i); 11694 v20 = v13->GetControl(i);
11729 v21 = v20; 11695 v21 = v20;
11730 v22 = v20->uControlParam - 36; 11696 v22 = v20->uControlParam - 36;
11731 if ( !byte_4ED970_skill_learn_ability_by_class_table[v0->uClass][v22] || v0->pActiveSkills[v22] ) 11697 if ( !byte_4ED970_skill_learn_ability_by_class_table[v0->classType][v22] || v0->pActiveSkills[v22] )
11732 { 11698 {
11733 v21->uW = 0; 11699 v21->uW = 0;
11734 v21->uHeight = 0; 11700 v21->uHeight = 0;
11735 v21->uY = 0; 11701 v21->uY = 0;
11736 } 11702 }
11759 } 11725 }
11760 } 11726 }
11761 else 11727 else
11762 { 11728 {
11763 LABEL_76: 11729 LABEL_76:
11764 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], v0->pName, pClassNames[v0->uClass]);// 11730 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], v0->pName, pClassNames[v0->classType]);//
11765 // "Seek knowledge elsewhere %s the %s" 11731 // "Seek knowledge elsewhere %s the %s"
11766 strcat(pTmpBuf, "\n \n"); 11732 strcat(pTmpBuf, "\n \n");
11767 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);// "I can offer you nothing further." 11733 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);// "I can offer you nothing further."
11768 v29 = v71; 11734 v29 = v71;
11769 v30 = pFontArrus->CalcTextHeight(pTmpBuf, &v65, 0, 0); 11735 v30 = pFontArrus->CalcTextHeight(pTmpBuf, &v65, 0, 0);
12169 if ( (signed int)v34 >= v35 ) 12135 if ( (signed int)v34 >= v35 )
12170 goto LABEL_140; 12136 goto LABEL_140;
12171 do 12137 do
12172 { 12138 {
12173 v36 = v31->GetControl(v34)->uControlParam - 36; 12139 v36 = v31->GetControl(v34)->uControlParam - 36;
12174 if ( byte_4ED970_skill_learn_ability_by_class_table[_this->uClass][v36] && !_this->pActiveSkills[v36] ) 12140 if ( byte_4ED970_skill_learn_ability_by_class_table[_this->classType][v36] && !_this->pActiveSkills[v36] )
12175 { 12141 {
12176 v37 = pFontArrus->CalcTextHeight(pSkillNames[v36], &v112, 0, 0); 12142 v37 = pFontArrus->CalcTextHeight(pSkillNames[v36], &v112, 0, 0);
12177 v118 += v37; 12143 v118 += v37;
12178 ++v122; 12144 ++v122;
12179 } 12145 }
12181 } 12147 }
12182 while ( (signed int)v34 < v31->pNumPresenceButton + v31->pStartingPosActiveItem ); 12148 while ( (signed int)v34 < v31->pNumPresenceButton + v31->pStartingPosActiveItem );
12183 if ( !v122 ) 12149 if ( !v122 )
12184 { 12150 {
12185 LABEL_140: 12151 LABEL_140:
12186 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], _this->pName, pClassNames[_this->uClass]);// 12152 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], _this->pName, pClassNames[_this->classType]);//
12187 // "Seek knowledge elsewhere %s the %s" 12153 // "Seek knowledge elsewhere %s the %s"
12188 strcat(pTmpBuf, "\n \n"); 12154 strcat(pTmpBuf, "\n \n");
12189 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);// "I can offer you nothing further." 12155 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);// "I can offer you nothing further."
12190 v30 = pTmpBuf; 12156 v30 = pTmpBuf;
12191 v97 = 3; 12157 v97 = 3;
12211 do 12177 do
12212 { 12178 {
12213 v39 = v31->GetControl(v118); 12179 v39 = v31->GetControl(v118);
12214 v40 = v39; 12180 v40 = v39;
12215 v41 = v39->uControlParam - 36; 12181 v41 = v39->uControlParam - 36;
12216 if ( !byte_4ED970_skill_learn_ability_by_class_table[_this->uClass][v41] || _this->pActiveSkills[v41] ) 12182 if ( !byte_4ED970_skill_learn_ability_by_class_table[_this->classType][v41] || _this->pActiveSkills[v41] )
12217 { 12183 {
12218 v40->uW = 0; 12184 v40->uW = 0;
12219 v40->uHeight = 0; 12185 v40->uHeight = 0;
12220 v40->uY = 0; 12186 v40->uY = 0;
12221 } 12187 }
12836 v4 = v2->bDrawSomeAnim; 12802 v4 = v2->bDrawSomeAnim;
12837 goto LABEL_74; 12803 goto LABEL_74;
12838 } 12804 }
12839 if ( v3 == 20 ) 12805 if ( v3 == 20 )
12840 { 12806 {
12841 v4 = v2->evtb; 12807 v4 = v2->_anim_current_time;
12842 goto LABEL_74; 12808 goto LABEL_74;
12843 } 12809 }
12844 if ( v3 == 21 ) 12810 if ( v3 == 21 )
12845 { 12811 {
12846 v4 = v2->evtc; 12812 v4 = v2->_anim_end_time;
12847 LABEL_74: 12813 LABEL_74:
12848 if ( v4 < 200 || v4 > 310 ) 12814 if ( v4 < 200 || v4 > 310 )
12849 { 12815 {
12850 if ( v4 < 400 || v4 > 410 ) 12816 if ( v4 < 400 || v4 > 410 )
12851 { 12817 {
13222 } 13188 }
13223 while ( v21 < v20->pNumPresenceButton + v20->pStartingPosActiveItem ); 13189 while ( v21 < v20->pNumPresenceButton + v20->pStartingPosActiveItem );
13224 if ( !v61 ) 13190 if ( !v61 )
13225 { 13191 {
13226 LABEL_64: 13192 LABEL_64:
13227 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], v58->pName, pClassNames[v58->uClass]); 13193 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], v58->pName, pClassNames[v58->classType]);
13228 strcat(pTmpBuf, "\n \n"); 13194 strcat(pTmpBuf, "\n \n");
13229 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]); 13195 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);
13230 v18 = pTmpBuf; 13196 v18 = pTmpBuf;
13231 v44 = 3; 13197 v44 = 3;
13232 v43 = pTmpBuf; 13198 v43 = pTmpBuf;
13414 if ( (signed int)v7 >= v8 ) 13380 if ( (signed int)v7 >= v8 )
13415 goto LABEL_78; 13381 goto LABEL_78;
13416 do 13382 do
13417 { 13383 {
13418 v9 = v4->GetControl(v62)->uControlParam - 36; 13384 v9 = v4->GetControl(v62)->uControlParam - 36;
13419 if ( byte_4ED970_skill_learn_ability_by_class_table[v1->uClass][v9] && !v1->pActiveSkills[v9] ) 13385 if ( byte_4ED970_skill_learn_ability_by_class_table[v1->classType][v9] && !v1->pActiveSkills[v9] )
13420 { 13386 {
13421 v10 = pFontArrus->CalcTextHeight(pSkillNames[v9], &v57, 0, 0); 13387 v10 = pFontArrus->CalcTextHeight(pSkillNames[v9], &v57, 0, 0);
13422 v66 = (DDM_DLV_Header *)((char *)v66 + v10); 13388 v66 = (DDM_DLV_Header *)((char *)v66 + v10);
13423 ++v65; 13389 ++v65;
13424 } 13390 }
13444 while ( 1 ) 13410 while ( 1 )
13445 { 13411 {
13446 v14 = v12->GetControl(v62); 13412 v14 = v12->GetControl(v62);
13447 v15 = v14; 13413 v15 = v14;
13448 v16 = v14->uControlParam - 36; 13414 v16 = v14->uControlParam - 36;
13449 if ( !byte_4ED970_skill_learn_ability_by_class_table[v1->uClass][v16] || v1->pActiveSkills[v16] ) 13415 if ( !byte_4ED970_skill_learn_ability_by_class_table[v1->classType][v16] || v1->pActiveSkills[v16] )
13450 { 13416 {
13451 v15->uW = 0; 13417 v15->uW = 0;
13452 v15->uHeight = 0; 13418 v15->uHeight = 0;
13453 v15->uY = 0; 13419 v15->uY = 0;
13454 } 13420 }
13478 } 13444 }
13479 } 13445 }
13480 else 13446 else
13481 { 13447 {
13482 LABEL_78: 13448 LABEL_78:
13483 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], v1->pName, pClassNames[v1->uClass]); 13449 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], v1->pName, pClassNames[v1->classType]);
13484 strcat(pTmpBuf, "\n \n"); 13450 strcat(pTmpBuf, "\n \n");
13485 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]); 13451 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);
13486 v22 = WORD2(v59); 13452 v22 = WORD2(v59);
13487 v23 = pFontArrus->CalcTextHeight(pTmpBuf, &v57, 0, 0); 13453 v23 = pFontArrus->CalcTextHeight(pTmpBuf, &v57, 0, 0);
13488 result = (int)v57.DrawTitleText(pFontArrus, 0, (174 - v23) / 2 + 138, v22, pTmpBuf, 3u); 13454 result = (int)v57.DrawTitleText(pFontArrus, 0, (174 - v23) / 2 + 138, v22, pTmpBuf, 3u);
13914 if ( v9 >= v10 ) 13880 if ( v9 >= v10 )
13915 goto LABEL_40; 13881 goto LABEL_40;
13916 do 13882 do
13917 { 13883 {
13918 v11 = v8->GetControl(v35)->uControlParam - 36; 13884 v11 = v8->GetControl(v35)->uControlParam - 36;
13919 if ( byte_4ED970_skill_learn_ability_by_class_table[v1->uClass / 3][v11] && !v1->pActiveSkills[v11] ) 13885 if ( byte_4ED970_skill_learn_ability_by_class_table[v1->classType / 3][v11] && !v1->pActiveSkills[v11] )
13920 { 13886 {
13921 v12 = pFontArrus->CalcTextHeight(pSkillNames[v11], &v28, 0, 0); 13887 v12 = pFontArrus->CalcTextHeight(pSkillNames[v11], &v28, 0, 0);
13922 v33 += v12; 13888 v33 += v12;
13923 ++v34; 13889 ++v34;
13924 } 13890 }
13927 } 13893 }
13928 while ( v35 < v8->pNumPresenceButton + v13 ); 13894 while ( v35 < v8->pNumPresenceButton + v13 );
13929 if ( !v34 ) 13895 if ( !v34 )
13930 { 13896 {
13931 LABEL_40: 13897 LABEL_40:
13932 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], v1->pName, pClassNames[v1->uClass]); 13898 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], v1->pName, pClassNames[v1->classType]);
13933 strcat(pTmpBuf, "\n \n"); 13899 strcat(pTmpBuf, "\n \n");
13934 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]); 13900 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);
13935 v22 = v31; 13901 v22 = v31;
13936 v23 = pFontArrus->CalcTextHeight(pTmpBuf, &v28, 0, 0); 13902 v23 = pFontArrus->CalcTextHeight(pTmpBuf, &v28, 0, 0);
13937 return (int)v28.DrawTitleText(pFontArrus, 0, (174 - v23) / 2 + 138, v22, pTmpBuf, 3u); 13903 return (int)v28.DrawTitleText(pFontArrus, 0, (174 - v23) / 2 + 138, v22, pTmpBuf, 3u);
13949 v33 = 2; 13915 v33 = 2;
13950 do 13916 do
13951 { 13917 {
13952 v14 = v8->GetControl(v35); 13918 v14 = v8->GetControl(v35);
13953 v15 = v14->uControlParam - 36; 13919 v15 = v14->uControlParam - 36;
13954 if ( byte_4ED970_skill_learn_ability_by_class_table[v1->uClass / 3][v15] ) 13920 if ( byte_4ED970_skill_learn_ability_by_class_table[v1->classType / 3][v15] )
13955 { 13921 {
13956 v16 = 0; 13922 v16 = 0;
13957 if ( !v1->pActiveSkills[v15] ) 13923 if ( !v1->pActiveSkills[v15] )
13958 { 13924 {
13959 v17 = pSkillNames[v15]; 13925 v17 = pSkillNames[v15];