comparison mm7_5.cpp @ 706:d6236f6a9882

Rough function rearranging to new files
author Gloval
date Tue, 19 Mar 2013 21:53:21 +0400
parents a9c1fb7483c2
children af08fc9e29c8 70c5a87a1307
comparison
equal deleted inserted replaced
705:e39702f35283 706:d6236f6a9882
57 57
58 58
59 59
60 60
61 61
62 static char static_sub_417BB5_out_string[1200]; // static to a file, not sub actually 62
63 63
64 64
65 65
66 //----- (004304E7) -------------------------------------------------------- 66 //----- (004304E7) --------------------------------------------------------
67 void __cdecl GameUI_MsgProc() 67 void __cdecl GameUI_MsgProc()
6220 } 6220 }
6221 } 6221 }
6222 } 6222 }
6223 } 6223 }
6224 6224
6225 //----- (0043BCA7) --------------------------------------------------------
6226 void CharacterUI_LoadPaperdollTextures()
6227 {
6228 int v0; // edi@7
6229 enum CHARACTER_RACE pRace; // ebx@7
6230 signed int pSex; // eax@7
6231 int v3; // ebx@10
6232 Player *pPlayer; // edi@12
6233 unsigned __int8 v5; // cl@12
6234 int v6; // edi@16
6235 unsigned int v7; // eax@16
6236 Player *pPlayer2; // ebx@16
6237 char *v9; // ebx@16
6238 char v10; // al@16
6239 signed int v11; // edi@21
6240 Player *pPlayer3; // ebx@23
6241 //Player *pPlayer4; // edi@29
6242 //int v14; // ebp@29
6243 //stru331 *v15; // edi@65
6244 //signed int v16; // ebx@66
6245 //unsigned int v17; // eax@67
6246 //unsigned int *v18; // ecx@67
6247 //unsigned int *v19; // ebx@68
6248 //int v20; // edi@73
6249 int v21; // ebp@73
6250 unsigned int v22; // eax@76
6251 int v23; // ecx@76
6252 unsigned int v24; // eax@78
6253 int v25; // ecx@78
6254 int v26; // ebx@79
6255 unsigned int v27; // eax@80
6256 int v28; // ecx@80
6257 //int result; // eax@83
6258 int v30; // [sp+10h] [bp-28h]@5
6259 //signed int v31; // [sp+10h] [bp-28h]@68
6260 signed int v32; // [sp+10h] [bp-28h]@75
6261 signed int v33; // [sp+10h] [bp-28h]@77
6262 int v34; // [sp+10h] [bp-28h]@79
6263 //char *v35; // [sp+14h] [bp-24h]@65
6264 int v36; // [sp+14h] [bp-24h]@75
6265 int v37; // [sp+14h] [bp-24h]@77
6266 signed int v38; // [sp+14h] [bp-24h]@79
6267 //unsigned int *v39; // [sp+18h] [bp-20h]@66
6268 int *v40; // [sp+18h] [bp-20h]@73
6269 //unsigned int *v41; // [sp+1Ch] [bp-1Ch]@73
6270 int v42; // [sp+20h] [bp-18h]@6
6271 int v43; // [sp+20h] [bp-18h]@73
6272 char pContainer[128]; // [sp+24h] [bp-14h]@12
6273
6274 uTextureID_MAGNIF_B = pIcons_LOD->LoadTexture("MAGNIF-B", TEXTURE_16BIT_PALETTE);
6275 //if ( !pParty->uAlignment || pParty->uAlignment == 1 || pParty->uAlignment == 2 )
6276 uTextureID_BACKDOLL = pIcons_LOD->LoadTexture("BACKDOLL", TEXTURE_16BIT_PALETTE);
6277 uTextureID_507B04 = uTextureID_right_panel;
6278 v30 = 0;
6279 uTextureID_BACKHAND = pIcons_LOD->LoadTexture("BACKHAND", TEXTURE_16BIT_PALETTE);
6280 uTextureID_5118C8 = uExitCancelTextureId;
6281 do
6282 {
6283 v42 = v30 + 1;
6284 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(v30 + 1) )
6285 {
6286 v0 = v30;
6287 pRace = pPlayers[v30 + 1]->GetRace();
6288 pSex = pPlayers[v30 + 1]->GetSexByVoice();
6289 if ( pRace && pRace != 1 && pRace != 2 )//race == 3
6290 v3 = (pSex != 0) + 3;
6291 else
6292 v3 = (pSex != 0) + 1;
6293 wsprintfA(pContainer, "pc23v%dBod", v3);
6294 papredoll_dbods[v0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);//Body texture
6295 wsprintfA(pContainer, "pc23v%dlad", v3);
6296 papredoll_dlads[v0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);// Left Hand
6297 wsprintfA(pContainer, "pc23v%dlau", v3);
6298 papredoll_dlaus[v0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);// Left Hand2
6299 wsprintfA(pContainer, "pc23v%drh", v3);
6300 papredoll_drhs[v0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);// Right Hand
6301 wsprintfA(pContainer, "pc23v%dlh", v3);
6302 papredoll_dlhs[v0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);// Left Fist
6303 wsprintfA(pContainer, "pc23v%dlhu", v3);
6304 papredoll_dlhus[v0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); // Left Fist 2
6305 pPlayer = pPlayers[v0 + 1];
6306 v5 = pPlayer->uFace;
6307 if ( v5 == 12 || v5 == 13 )
6308 papredoll_dbrds[(char)v5] = 0;
6309 papredoll_flying_feet[pPlayer->uFace] = 0;
6310 IsPlayerWearingWatersuit[v30 + 1] = 1;
6311 }
6312 else
6313 {
6314 v6 = v30;
6315 papredoll_dbods[v30] = pIcons_LOD->LoadTexture(dbod_texnames_by_face[pPlayers[v30 + 1]->uFace], TEXTURE_16BIT_PALETTE);
6316 papredoll_dlads[v30] = pIcons_LOD->LoadTexture(dlad_texnames_by_face[pPlayers[v30 + 1]->uFace], TEXTURE_16BIT_PALETTE);
6317 papredoll_dlaus[v30] = pIcons_LOD->LoadTexture(dlau_texnames_by_face[pPlayers[v30 + 1]->uFace], TEXTURE_16BIT_PALETTE);
6318 papredoll_drhs[v30] = pIcons_LOD->LoadTexture(drh_texnames_by_face[pPlayers[v30 + 1]->uFace], TEXTURE_16BIT_PALETTE);
6319 papredoll_dlhs[v30] = pIcons_LOD->LoadTexture(dlh_texnames_by_face[pPlayers[v30 + 1]->uFace], TEXTURE_16BIT_PALETTE);
6320 v7 = pIcons_LOD->LoadTexture(dlhu_texnames_by_face[pPlayers[v30 + 1]->uFace], TEXTURE_16BIT_PALETTE);
6321 pPlayer2 = pPlayers[v30 + 1];
6322 papredoll_dlhus[v30] = v7;
6323 v9 = (char *)&pPlayer2->uFace;
6324 v10 = *v9;
6325 if ( *v9 == 12 || v10 == 13 )
6326 {
6327 wsprintfA(pContainer, "pc%02dbrd", v10 + 1);
6328 v9 = (char *)&pPlayers[v6 + 1]->uFace;
6329 papredoll_dbrds[*v9] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6330 }
6331 wsprintfA(pContainer, "item281pc%02d", *v9 + 1);
6332 papredoll_flying_feet[pPlayers[v6 + 1]->uFace] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6333 IsPlayerWearingWatersuit[v30 + 1] = 0;
6334 }
6335 ++v30;
6336 }
6337 while ( v42 < 4 );
6338 uTextureID_ar_up_up = pIcons_LOD->LoadTexture("ar_up_up", TEXTURE_16BIT_PALETTE);
6339 uTextureID_ar_up_dn = pIcons_LOD->LoadTexture("ar_up_dn", TEXTURE_16BIT_PALETTE);
6340 uTextureID_ar_dn_up = pIcons_LOD->LoadTexture("ar_dn_up", TEXTURE_16BIT_PALETTE);
6341 uTextureID_ar_dn_dn = pIcons_LOD->LoadTexture("ar_dn_dn", TEXTURE_16BIT_PALETTE);
6342 papredoll_dbrds[9] = pIcons_LOD->LoadTexture("ib-cd1-d", TEXTURE_16BIT_PALETTE);
6343 papredoll_dbrds[7] = pIcons_LOD->LoadTexture("ib-cd2-d", TEXTURE_16BIT_PALETTE);
6344 papredoll_dbrds[5] = pIcons_LOD->LoadTexture("ib-cd3-d", TEXTURE_16BIT_PALETTE);
6345 papredoll_dbrds[3] = pIcons_LOD->LoadTexture("ib-cd4-d", TEXTURE_16BIT_PALETTE);
6346 papredoll_dbrds[1] = pIcons_LOD->LoadTexture("ib-cd5-d", TEXTURE_16BIT_PALETTE);
6347 v11 = 0;
6348 do
6349 {
6350 byte_5111C0[v11] = 0;
6351 if ( pParty->pPickedItem.uItemID != v11 + 66 )
6352 {
6353 pPlayer3 = pParty->pPlayers;
6354 while ( !sub_43EE15_player_has_item(v11 + 66, pPlayer3, 0) )
6355 {
6356 ++pPlayer3;
6357 if ( (signed int)pPlayer3 >= (signed int)pParty->pHirelings )
6358 goto LABEL_28;
6359 }
6360 }
6361 byte_5111C0[v11] = 1;
6362 LABEL_28:
6363 ++v11;
6364 }
6365 while ( v11 < 54 );
6366
6367 memset(byte_5111F6, 0, 16);
6368 for (uint i = 0; i < 4; ++i)
6369 {
6370 auto player = pParty->pPlayers + i;
6371
6372 if (sub_43EE15_player_has_item(ITEM_ARTICACT_GOVERNONS_ARMOR, player, 1)) byte_5111F6[0] = 1;
6373 if (sub_43EE15_player_has_item(ITEM_ARTIFACT_YORUBA, player, 1)) byte_5111F6[1] = 1;
6374 if (sub_43EE15_player_has_item(ITEM_RELIC_HARECS_LEATHER, player, 1)) byte_5111F6[2] = 1;
6375 if (sub_43EE15_player_has_item(ITEM_ARTIFACT_LEAGUE_BOOTS, player, 1)) byte_5111F6[3] = 1;
6376 if (sub_43EE15_player_has_item(ITEM_RELIC_TALEDONS_HELM, player, 1)) byte_5111F6[4] = 1;
6377 if (sub_43EE15_player_has_item(ITEM_RELIC_SCHOLARS_CAP, player, 1)) byte_5111F6[5] = 1;
6378 if (sub_43EE15_player_has_item(ITEM_RELIC_PHYNAXIAN_CROWN, player, 1)) byte_5111F6[6] = 1;
6379 if (sub_43EE15_player_has_item(ITEM_ARTIFACT_MINDS_EYE, player, 1)) byte_5111F6[7] = 1;
6380 if (sub_43EE15_player_has_item(ITEM_RARE_SHADOWS_MASK, player, 1)) byte_5111F6[8] = 1;
6381 if (sub_43EE15_player_has_item(ITEM_RILIC_TITANS_BELT, player, 1)) byte_5111F6[9] = 1;
6382 if (sub_43EE15_player_has_item(ITEM_ARTIFAT_HEROS_BELT, player, 1)) byte_5111F6[10] = 1;
6383 if (sub_43EE15_player_has_item(ITEM_RELIC_TWILIGHT, player, 1)) byte_5111F6[11] = 1;
6384 if (sub_43EE15_player_has_item(ITEM_ARTIFACT_CLOAK_OF_THE_SHEEP, player, 1)) byte_5111F6[12] = 1;
6385 if (sub_43EE15_player_has_item(ITEM_RARE_SUN_CLOAK, player, 1)) byte_5111F6[13] = 1;
6386 if (sub_43EE15_player_has_item(ITEM_RARE_MOON_CLOAK, player, 1)) byte_5111F6[14] = 1;
6387 if (sub_43EE15_player_has_item(ITEM_RARE_VAMPIRES_CAPE, player, 1)) byte_5111F6[15] = 1;
6388 if (sub_43EE15_player_has_item(ITEM_ELVEN_CHAINMAIL, player, 1)) byte_5111F6[16] = 1;
6389 }
6390
6391 //v14 = 1;
6392 //v15 = &stru_511698.field_2C;
6393 //v35 = (char *)&stru_511718.field_18;
6394 for (uint i = 0; i < 2; ++i)
6395 {
6396 //v16 = 0;
6397 //v39 = (unsigned int *)(v35 - 24);
6398 for (uint j = 0; j < 5; ++j)
6399 {
6400 _43C91D_FormItemTextureFilename(pContainer, j + 100, i + 1, 0);
6401 //v17 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6402 //++v16;
6403 //v18 = v39;
6404 //++v39;
6405 //*v18 = v17;
6406 stru_511718[i].texids[j] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6407 }
6408 //while ( v16 < 5 );
6409
6410 //*(int *)v35 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6411 _43C91D_FormItemTextureFilename(pContainer, 535, i + 1, 0);
6412 stru_511718[i].texid2 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6413
6414 //v31 = 0;
6415 //v19 = (unsigned int *)((char *)v15 - 44);
6416 for (uint j = 0; j < 11; ++j)
6417 {
6418 _43C91D_FormItemTextureFilename(pContainer, j + 89, i + 1, 0);
6419 //*v19 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6420 //++v19;
6421 stru_511698[i].texids[j] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6422 }
6423 //while ( v31 < 11 );
6424
6425 _43C91D_FormItemTextureFilename(pContainer, 521, i + 1, 0);
6426 stru_511698[i].texid1 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6427 _43C91D_FormItemTextureFilename(pContainer, 522, i + 1, 0);
6428 stru_511698[i].texid2 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6429 _43C91D_FormItemTextureFilename(pContainer, 523, i + 1, 0);
6430 stru_511698[i].texid3 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6431 _43C91D_FormItemTextureFilename(pContainer, 532, i + 1, 0);
6432 stru_511698[i].texid4 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6433 _43C91D_FormItemTextureFilename(pContainer, 544, i + 1, 0);
6434 stru_511698[i].texid5 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6435 if ( _43ED6F_check_party_races(true) )
6436 papredoll_dbrds[11] = pIcons_LOD->LoadTexture("item092v3", TEXTURE_16BIT_PALETTE);
6437 //v35 += 28;
6438 //++v14;
6439 //++v15;
6440 }
6441 //while ( v14 - 1 < 2 );
6442
6443 v43 = 0;
6444 //v20 = 1;
6445 v40 = &dword_511638[0][5];
6446 v21 = (int)paperdoll_array_511290[0][13];
6447 //v41 = (unsigned int *)&stru_511718.texid1;
6448 for (uint i = 0; i < 4; ++i)
6449 {
6450 if ( sub_43EDB9_get_some_race_sex_relation_2(i) )
6451 {
6452 _43C91D_FormItemTextureFilename(pContainer, 524, i + 1, 0);
6453 v32 = 66;
6454 stru_511718[i].texid1 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6455 v36 = v21 - 152;
6456 do
6457 {
6458 _43C91D_FormItemTextureFilename(pContainer, v32, i + 1, 0);
6459 *(int *)(v36 - 4) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6460 _43C91D_FormItemTextureFilename(pContainer, v32, i + 1, 1);
6461 *(int *)v36 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6462 _43C91D_FormItemTextureFilename(pContainer, v32, i + 1, 2);
6463 v22 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6464 v23 = v36;
6465 v36 += 12;
6466 ++v32;
6467 *(int *)(v23 + 4) = v22;
6468 }
6469 while ( v32 - 66 < 13 );
6470 _43C91D_FormItemTextureFilename(pContainer, 516, i + 1, 0);
6471 *(int *)v21 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6472 _43C91D_FormItemTextureFilename(pContainer, 516, i + 1, 1);
6473 *(int *)(v21 + 4) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6474 _43C91D_FormItemTextureFilename(pContainer, 516, i + 1, 2);
6475 *(int *)(v21 + 8) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6476 _43C91D_FormItemTextureFilename(pContainer, 505, i + 1, 0);
6477 *(int *)(v21 + 12) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6478 _43C91D_FormItemTextureFilename(pContainer, 505, i + 1, 1);
6479 *(int *)(v21 + 16) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6480 _43C91D_FormItemTextureFilename(pContainer, 505, i + 1, 2);
6481 *(int *)(v21 + 20) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6482 _43C91D_FormItemTextureFilename(pContainer, 504, i + 1, 0);
6483 *(int *)(v21 + 24) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6484 _43C91D_FormItemTextureFilename(pContainer, 504, i + 1, 1);
6485 *(int *)(v21 + 28) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6486 _43C91D_FormItemTextureFilename(pContainer, 504, i + 1, 2);
6487 *(int *)(v21 + 32) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6488 _43C91D_FormItemTextureFilename(pContainer, 533, i + 1, 0);
6489 *(int *)(v21 + 36) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6490 _43C91D_FormItemTextureFilename(pContainer, 533, i + 1, 1);
6491 *(int *)(v21 + 40) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6492 _43C91D_FormItemTextureFilename(pContainer, 533, i + 1, 2);
6493 *(int *)(v21 + 44) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6494 v33 = 0;
6495 v37 = (int)(v40 - 5);
6496 do
6497 {
6498 _43C91D_FormItemTextureFilename(pContainer, v33 + 115, i + 1, 0);
6499 v24 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6500 ++v33;
6501 v25 = v37;
6502 v37 += 4;
6503 *(int *)v25 = v24;
6504 }
6505 while ( v33 < 5 );
6506 _43C91D_FormItemTextureFilename(pContainer, 512, i + 1, 0);
6507 v26 = v43;
6508 v38 = 105;
6509 v34 = v43;
6510 *v40 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6511 do
6512 {
6513 _43C91D_FormItemTextureFilename(pContainer, v38, i + 1, 0);
6514 *(int *)((char *)paperdoll_array_511828 + v34) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6515 _43C91D_FormItemTextureFilename(pContainer, v38, i + 1, 1);
6516 v27 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6517 v28 = v34;
6518 v34 += 4;
6519 ++v38;
6520 *(int *)((char *)dword_511788 + v28) = v27;
6521 }
6522 while ( v38 - 105 < 5 );
6523 _43C91D_FormItemTextureFilename(pContainer, 525, i + 1, 0);
6524 *(int *)((char *)&paperdoll_array_511828[0][5] + v43) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6525 _43C91D_FormItemTextureFilename(pContainer, 530, i + 1, 0);
6526 *(int *)((char *)&paperdoll_array_511828[0][6] + v43) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6527 _43C91D_FormItemTextureFilename(pContainer, 547, i + 1, 0);
6528 *(int *)((char *)&paperdoll_array_511828[0][7] + v43) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6529 _43C91D_FormItemTextureFilename(pContainer, 548, i + 1, 0);
6530 *(int *)((char *)&paperdoll_array_511828[0][8] + v43) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6531 _43C91D_FormItemTextureFilename(pContainer, 550, i + 1, 0);
6532 *(int *)((char *)&paperdoll_array_511828[0][9] + v43) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6533 _43C91D_FormItemTextureFilename(pContainer, 525, i + 1, 1);
6534 *(int *)((char *)&dword_51179C + v43) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6535 _43C91D_FormItemTextureFilename(pContainer, 530, i + 1, 1);
6536 *(int *)((char *)&dword_5117A0 + v43) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6537 _43C91D_FormItemTextureFilename(pContainer, 547, i + 1, 1);
6538 *(int *)((char *)&dword_5117A4 + v43) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6539 _43C91D_FormItemTextureFilename(pContainer, 548, i + 1, 1);
6540 *(int *)((char *)&dword_5117A8 + v43) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6541 _43C91D_FormItemTextureFilename(pContainer, 550, i + 1, 1);
6542 *(int *)((char *)&dword_5117AC + v43) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6543 }
6544 else
6545 {
6546 v26 = v43;
6547 }
6548 //v41 += 7;
6549 v40 += 6;
6550 v21 += 204;
6551 //++v20;
6552 //result = v20 - 1;
6553 v43 = v26 + 40;
6554 }
6555 //while ( v20 - 1 < 4 );
6556 //return result;
6557 }
6558
6559 6225
6560 6226
6561 //----- (0043C91D) -------------------------------------------------------- 6227 //----- (0043C91D) --------------------------------------------------------
6562 int __fastcall _43C91D_FormItemTextureFilename(char *a1, signed int a2, int a3, int a4) 6228 int __fastcall _43C91D_FormItemTextureFilename(char *a1, signed int a2, int a3, int a4)
6563 { 6229 {
6759 return result; 6425 return result;
6760 } 6426 }
6761 return result; 6427 return result;
6762 } 6428 }
6763 6429
6764 //----- (0043CC7C) -------------------------------------------------------- 6430
6765 void __fastcall CharacterUI_DrawPaperdoll(unsigned int uPlayerID)
6766 {
6767 //Player **ppPlayer; // esi@1
6768 Player *pPlayer; // ebx@1
6769 //enum CHARACTER_RACE pRace; // edi@1
6770 signed int pSex; // eax@1
6771 //int v5; // edi@4
6772 unsigned int v6; // ecx@9
6773 int v7; // ecx@10
6774 unsigned int v8; // eax@14
6775 int v9; // eax@15
6776 int v10; // edx@15
6777 int v11; // ecx@15
6778 int v12; // eax@15
6779 unsigned int v13; // edi@15
6780 unsigned int v14; // ebx@18
6781 int v15; // ecx@18
6782 Texture *v16; // ebp@27
6783 double v17; // st7@29
6784 int v18; // edi@30
6785 char *v19; // eax@30
6786 Texture *v20; // edi@31
6787 unsigned int v21; // eax@37
6788 int v22; // edi@38
6789 int v23; // eax@38
6790 int v24; // ebx@38
6791 int v25; // eax@38
6792 LODFile_IconsBitmaps *v26; // ecx@42
6793 Texture *v27; // edi@51
6794 double v28; // st7@51
6795 char v29; // zf@54
6796 char *v30; // eax@54
6797 unsigned int v31; // eax@59
6798 int v32; // edx@60
6799 int v33; // eax@65
6800 int v34; // eax@74
6801 int v35; // ebx@74
6802 unsigned int v36; // ecx@74
6803 int v37; // eax@74
6804 LODFile_IconsBitmaps *v38; // ecx@78
6805 Texture *v39; // edi@85
6806 double v40; // st7@87
6807 int v41; // edi@88
6808 Texture *v42; // edi@89
6809 unsigned int v43; // eax@93
6810 int v44; // edx@94
6811 int v45; // eax@98
6812 int v46; // eax@106
6813 int v47; // ecx@106
6814 int v48; // ebx@106
6815 int v49; // eax@106
6816 LODFile_IconsBitmaps *v50; // ecx@110
6817 Texture *v51; // edi@117
6818 double v52; // st7@119
6819 int v53; // edi@120
6820 Texture *v54; // edi@121
6821 char *v55; // eax@122
6822 unsigned int v56; // eax@127
6823 int v57; // edi@128
6824 int v58; // ecx@128
6825 int v59; // ebx@129
6826 int v60; // ecx@132
6827 int v61; // eax@134
6828 int v62; // ecx@136
6829 Texture *v63; // edi@145
6830 double v64; // st7@147
6831 int v65; // edi@148
6832 char *v66; // eax@148
6833 Texture *v67; // edi@149
6834 //Player *v68; // ebx@155
6835 unsigned int v69; // edx@155
6836 int v70; // edx@156
6837 unsigned int v71; // eax@160
6838 int v72; // edi@161
6839 int v73; // edx@163
6840 int v74; // ecx@168
6841 unsigned int v75; // ebx@170
6842 int v76; // ecx@172
6843 Texture *v77; // edi@181
6844 double v78; // st7@183
6845 int v79; // edi@184
6846 char *v80; // eax@184
6847 Texture *v81; // edi@185
6848 unsigned int v82; // eax@192
6849 int v83; // eax@193
6850 int v84; // eax@197
6851 int v85; // eax@197
6852 int v86; // ecx@197
6853 int v87; // eax@197
6854 int v88; // eax@198
6855 int v89; // eax@199
6856 int v90; // edi@201
6857 int v91; // edi@213
6858 int v92; // ebx@213
6859 int v93; // edi@214
6860 int v94; // ebx@214
6861 int v95; // eax@214
6862 char *v96; // edi@226
6863 double v97; // st7@228
6864 int v98; // edi@229
6865 char *v99; // eax@229
6866 Render *v100; // ecx@229
6867 Texture *v101; // edi@230
6868 int v102; // edi@236
6869 int v103; // eax@237
6870 int v104; // ecx@237
6871 int v105; // edx@237
6872 int v106; // edx@238
6873 int v107; // edx@239
6874 int v108; // edx@240
6875 int v109; // edi@250
6876 char *v110; // edx@250
6877 unsigned int v111; // eax@259
6878 int v112; // eax@260
6879 int v113; // eax@260
6880 int v114; // eax@265
6881 int v115; // eax@274
6882 int v116; // ebx@274
6883 unsigned int v117; // edi@274
6884 double v118; // st7@286
6885 int v119; // edi@287
6886 char *v120; // eax@287
6887 Texture *v121; // edi@288
6888 unsigned int v122; // edi@295
6889 int v123; // ebx@297
6890 int v124; // edi@298
6891 int v125; // ecx@303
6892 int v126; // eax@312
6893 unsigned int v127; // ebx@314
6894 int v128; // ecx@316
6895 Texture *v129; // edi@325
6896 double v130; // st7@327
6897 int v131; // edi@328
6898 char *v132; // eax@328
6899 Texture *v133; // edi@329
6900 unsigned int v134; // eax@335
6901 int v135; // eax@336
6902 int v136; // edx@336
6903 int v137; // eax@336
6904 unsigned int v138; // ebx@339
6905 int v139; // ecx@339
6906 Texture *v140; // edi@348
6907 double v141; // st7@350
6908 int v142; // edi@351
6909 char *v143; // eax@351
6910 Texture *v144; // edi@352
6911 unsigned int v145; // eax@358
6912 int v146; // eax@359
6913 int v147; // ecx@359
6914 int v148; // eax@359
6915 int v149; // edx@359
6916 int v150; // ebx@362
6917 int v151; // ecx@363
6918 int v152; // ecx@364
6919 unsigned int v153; // eax@370
6920 unsigned int v154; // edi@370
6921 int v155; // eax@370
6922 LODFile_IconsBitmaps *v156; // ecx@374
6923 Texture *v157; // ebp@381
6924 double v158; // st7@383
6925 Texture *v159; // edi@385
6926 char *v160; // eax@386
6927 unsigned int v161; // eax@393
6928 int v162; // eax@394
6929 unsigned int v163; // [sp-Ch] [bp-58h]@230
6930 unsigned int v164; // [sp-Ch] [bp-58h]@233
6931 signed int v165; // [sp-Ch] [bp-58h]@235
6932 char *v166; // [sp-8h] [bp-54h]@16
6933 const char *v167; // [sp-8h] [bp-54h]@23
6934 const char *v168; // [sp-8h] [bp-54h]@43
6935 const char *v169; // [sp-8h] [bp-54h]@79
6936 const char *v170; // [sp-8h] [bp-54h]@111
6937 const char *v171; // [sp-8h] [bp-54h]@141
6938 const char *v172; // [sp-8h] [bp-54h]@177
6939 const char *v173; // [sp-8h] [bp-54h]@222
6940 int v174; // [sp-8h] [bp-54h]@228
6941 unsigned int v175; // [sp-8h] [bp-54h]@230
6942 unsigned int v176; // [sp-8h] [bp-54h]@233
6943 signed int v177; // [sp-8h] [bp-54h]@235
6944 const char *v178; // [sp-8h] [bp-54h]@242
6945 const char *v179; // [sp-8h] [bp-54h]@280
6946 const char *v180; // [sp-8h] [bp-54h]@321
6947 char *v181; // [sp-8h] [bp-54h]@337
6948 const char *v182; // [sp-8h] [bp-54h]@344
6949 const char *v183; // [sp-8h] [bp-54h]@375
6950 signed int v184; // [sp-4h] [bp-50h]@66
6951 signed int v185; // [sp-4h] [bp-50h]@99
6952 signed int v186; // [sp-4h] [bp-50h]@202
6953 int v187; // [sp-4h] [bp-50h]@228
6954 Texture *v188; // [sp-4h] [bp-50h]@230
6955 Texture *v189; // [sp-4h] [bp-50h]@233
6956 Texture *v190; // [sp-4h] [bp-50h]@235
6957 signed int v191; // [sp-4h] [bp-50h]@266
6958 signed int v192; // [sp-4h] [bp-50h]@304
6959 unsigned int a3; // [sp+10h] [bp-3Ch]@7
6960 int a3a; // [sp+10h] [bp-3Ch]@15
6961 int a3b; // [sp+10h] [bp-3Ch]@38
6962 unsigned int a3c; // [sp+10h] [bp-3Ch]@74
6963 unsigned int a3d; // [sp+10h] [bp-3Ch]@106
6964 int a3e; // [sp+10h] [bp-3Ch]@129
6965 int a3f; // [sp+10h] [bp-3Ch]@168
6966 unsigned int a3g; // [sp+10h] [bp-3Ch]@216
6967 unsigned int a3h; // [sp+10h] [bp-3Ch]@274
6968 int a3i; // [sp+10h] [bp-3Ch]@312
6969 int a3j; // [sp+10h] [bp-3Ch]@336
6970 int a3k; // [sp+10h] [bp-3Ch]@362
6971 signed int a2; // [sp+14h] [bp-38h]@7
6972 unsigned int a2a; // [sp+14h] [bp-38h]@15
6973 Texture *a2b; // [sp+14h] [bp-38h]@49
6974 int a2c; // [sp+14h] [bp-38h]@74
6975 int a2d; // [sp+14h] [bp-38h]@106
6976 int a2e; // [sp+14h] [bp-38h]@129
6977 int a2f; // [sp+14h] [bp-38h]@168
6978 int a2g; // [sp+14h] [bp-38h]@214
6979 int a2h; // [sp+14h] [bp-38h]@274
6980 Texture *a2i; // [sp+14h] [bp-38h]@284
6981 int a2j; // [sp+14h] [bp-38h]@312
6982 int a2k; // [sp+14h] [bp-38h]@336
6983 //Player *v217; // [sp+18h] [bp-34h]@1
6984 int v218; // [sp+1Ch] [bp-30h]@15
6985 int v219; // [sp+1Ch] [bp-30h]@60
6986 int v220; // [sp+1Ch] [bp-30h]@94
6987 int v221; // [sp+1Ch] [bp-30h]@128
6988 int v222; // [sp+1Ch] [bp-30h]@161
6989 int v223; // [sp+1Ch] [bp-30h]@213
6990 char v224; // [sp+1Ch] [bp-30h]@237
6991 int v225; // [sp+1Ch] [bp-30h]@260
6992 int v226; // [sp+1Ch] [bp-30h]@298
6993 int v227; // [sp+1Ch] [bp-30h]@336
6994 int v228; // [sp+1Ch] [bp-30h]@359
6995 int v229; // [sp+20h] [bp-2Ch]@15
6996 int v230; // [sp+20h] [bp-2Ch]@38
6997 int v231; // [sp+20h] [bp-2Ch]@60
6998 int v232; // [sp+20h] [bp-2Ch]@94
6999 int v233; // [sp+20h] [bp-2Ch]@128
7000 int v234; // [sp+20h] [bp-2Ch]@161
7001 int v235; // [sp+20h] [bp-2Ch]@197
7002 int v236; // [sp+20h] [bp-2Ch]@260
7003 int v237; // [sp+20h] [bp-2Ch]@298
7004 int v238; // [sp+20h] [bp-2Ch]@336
7005 int pBodyComplection; // [sp+24h] [bp-28h]@6
7006 int v240; // [sp+28h] [bp-24h]@7
7007 unsigned int v241; // [sp+2Ch] [bp-20h]@38
7008 int v242; // [sp+2Ch] [bp-20h]@197
7009 unsigned int v243; // [sp+2Ch] [bp-20h]@370
7010 int v244; // [sp+34h] [bp-18h]@6
7011 signed int v245; // [sp+34h] [bp-18h]@361
7012 unsigned int uPlayerID_; // [sp+38h] [bp-14h]@1
7013 int uPlayerID_a; // [sp+38h] [bp-14h]@9
7014 signed int IsDwarf; // [sp+40h] [bp-Ch]@4
7015 int v249; // [sp+40h] [bp-Ch]@358
7016 //signed int v250; // [sp+44h] [bp-8h]@1
7017
7018 pPlayer = pPlayers[uPlayerID];
7019 uPlayerID_ = uPlayerID;
7020 pIcons_LOD->LoadTexture("sptext01", TEXTURE_16BIT_PALETTE);
7021 pSex = pPlayer->GetSexByVoice();
7022 if ( pPlayer->GetRace() && pPlayer->GetRace() != 1 && pPlayer->GetRace() != 2 )
7023 {
7024 IsDwarf = 1;
7025 pBodyComplection = (pSex != 0) + 2;
7026 }
7027 else
7028 {
7029 IsDwarf = 0;
7030 pBodyComplection = pSex != 0;
7031 }
7032 v244 = pPlayer->uFace;
7033 pRenderer->ResetClip();
7034 pRenderer->DrawTextureIndexed(0x1D3u, 0, (Texture *)(uTextureID_BACKDOLL != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BACKDOLL] : 0));//Ïîäëîæêà
7035 if ( !IsPlayerWearingWatersuit[uPlayerID_] )
7036 {
7037 v21 = pPlayer->pEquipment.uBow; //ñíà÷àëà ðèñóåòñÿ ëóê
7038 if ( !v21 )
7039 goto LABEL_59;
7040 v230 = pPlayer->pEquipment.uBow;
7041 v22 = (int)&pPlayer->pInventoryItems[v21-1];
7042 v23 = *(int *)v22;
7043 v24 = pPaperdoll_BodyX + paperdoll_Weapon[pBodyComplection][2][0] - pItemsTable->pItems[v23].uEquipX;
7044 a3b = pPaperdoll_BodyY + paperdoll_Weapon[pBodyComplection][2][1] - pItemsTable->pItems[v23].uEquipY;
7045 v241 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v23].pIconName, TEXTURE_16BIT_PALETTE);
7046 v25 = *(int *)(v22 + 20);
7047 if ( !(*(int *)(v22 + 20) & 0xF0) )
7048 {
7049 if ( v25 & 2 )
7050 {
7051 v27 = (Texture *)(v241 != -1 ? (int)&pIcons_LOD->pTextures[v241] : 0);
7052 pRenderer->DrawTransparentRedShade(v24, a3b, v27);
7053 }
7054 else
7055 {
7056 v29 = (v25 & 1) == 0;
7057 v30 = (char *)&pIcons_LOD->pTextures[v241];
7058 if ( v29 )
7059 {
7060 v27 = (Texture *)(v241 != -1 ? (int)v30 : 0);
7061 pRenderer->DrawTransparentGreenShade(v24, a3b, (Texture *)(v241 != -1 ? (int)v30 : 0));
7062 }
7063 else
7064 {
7065 v27 = (Texture *)(v241 != -1 ? (int)v30 : 0);
7066 pRenderer->DrawTextureTransparent(v24, a3b, (Texture *)(v241 != -1 ? (int)v30 : 0));
7067 }
7068 }
7069 LABEL_57:
7070 if ( !bRingsShownInCharScreen )
7071 pRenderer->_4A612A(v24, a3b, v27, v230);
7072 LABEL_59:
7073 v31 = pPlayer->pEquipment.uCloak;// ïîòîì ïëàù
7074 if ( !v31 )
7075 goto LABEL_93;
7076 v231 = pPlayer->pEquipment.uCloak;
7077 v32 = (int)&pPlayer->pInventoryItems[v31-1];
7078 v219 = v32;
7079 if ( *(int *)v32 != 525 )
7080 {
7081 switch ( *(int *)v32 )
7082 {
7083 case 0x212:
7084 v184 = 6;
7085 break;
7086 case 0x223:
7087 v184 = 7;
7088 break;
7089 case 0x224:
7090 v184 = 8;
7091 break;
7092 default:
7093 if ( *(int *)v32 != 550 )
7094 {
7095 v33 = *(int *)v32 - 105;
7096 LABEL_72:
7097 if ( v33 < 0 || v33 >= 10 )
7098 goto LABEL_93;
7099 LABEL_74:
7100 v34 = v33 + 10 * pBodyComplection;
7101 v35 = paperdoll_array_511828[0][v34];//Texture_Cloak
7102 a2c = pPaperdoll_BodyX + paperdoll_Cloak[0][v34][0];
7103 v36 = pPaperdoll_BodyY + paperdoll_Cloak[0][v34][1];
7104 v37 = *(int *)(v32 + 20);
7105 a3c = v36;
7106 if ( !(v37 & 0xF0) )
7107 {
7108 v41 = v35 + 1;
7109 if ( v37 & 2 )
7110 {
7111 v42 = (Texture *)(v41 != 0 ? (int)&pIcons_LOD->pTextures[v35] : 0);
7112 pRenderer->DrawTransparentRedShade(a2c, v36, v42);
7113 }
7114 else
7115 {
7116 v42 = (Texture *)(v41 != 0 ? (int)&pIcons_LOD->pTextures[v35] : 0);
7117 pRenderer->DrawTextureTransparent(a2c, v36, v42);
7118 }
7119 if ( !bRingsShownInCharScreen )
7120 pRenderer->_4A612A(a2c, a3c, v42, v231);
7121 LABEL_93:
7122 v240 = 4 * uPlayerID_ - 4;
7123 pRenderer->DrawTextureTransparent(pPaperdoll_BodyX, pPaperdoll_BodyY,
7124 (Texture *)(*(unsigned int *)((char *)papredoll_dbods + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dbods + v240)] : 0));
7125 v43 = pPlayer->pEquipment.uBody;// ïîòîì òåëî
7126 if ( !v43 )
7127 goto LABEL_127;
7128 v232 = pPlayer->pEquipment.uBody;
7129 v44 = (int)&pPlayer->pInventoryItems[v43-1];
7130 v220 = v44;
7131 if ( *(int *)v44 != 504 )
7132 {
7133 if ( *(int *)v44 == 505 )
7134 {
7135 v185 = 14;
7136 }
7137 else
7138 {
7139 if ( *(int *)v44 == 516 )
7140 {
7141 v185 = 13;
7142 }
7143 else
7144 {
7145 if ( *(int *)v44 != 533 )
7146 {
7147 v45 = *(int *)v44 - 66;
7148 LABEL_104:
7149 if ( v45 < 0 || v45 >= 17 )
7150 goto LABEL_127;
7151 LABEL_106:
7152 v46 = 17 * pBodyComplection + v45;
7153 a2d = pPaperdoll_BodyX + paperdoll_Armor[0][v46][0];
7154 v47 = pPaperdoll_BodyY + paperdoll_Armor[0][v46][1];
7155 v48 = paperdoll_array_511290[0][v46][0];//Texture_Armor
7156 v49 = *(int *)(v44 + 20);
7157 a3d = v47;
7158 if ( !(v49 & 0xF0) )
7159 {
7160 v53 = v48 + 1;
7161 if ( v49 & 2 )
7162 {
7163 v54 = (Texture *)(v53 != 0 ? (int)&pIcons_LOD->pTextures[v48] : 0);
7164 pRenderer->DrawTransparentRedShade(a2d, v47, v54);
7165 }
7166 else
7167 {
7168 v29 = (v49 & 1) == 0;
7169 v55 = (char *)&pIcons_LOD->pTextures[v48];
7170 if ( v29 )
7171 {
7172 v54 = (Texture *)(v53 != 0 ? (int)v55 : 0);
7173 pRenderer->DrawTransparentGreenShade(a2d, v47, v54);
7174 }
7175 else
7176 {
7177 v54 = (Texture *)(v53 != 0 ? (int)v55 : 0);
7178 pRenderer->DrawTextureTransparent(a2d, v47, v54);
7179 }
7180 }
7181 if ( !bRingsShownInCharScreen )
7182 pRenderer->_4A612A(a2d, a3d, v54, v232);
7183 LABEL_127:
7184 v56 = pPlayer->pEquipment.field_20;
7185 if ( !v56 )
7186 goto LABEL_155;
7187 v233 = pPlayer->pEquipment.field_20;
7188 v57 = (int)&pPlayer->pInventoryItems[v56-1];
7189 v221 = v57;
7190 v58 = *(int *)v57;
7191 if ( *(int *)v57 == 529 )
7192 {
7193 a3e = pPaperdoll_BodyY + paperdoll_Boot[pBodyComplection][5][1];
7194 a2e = pPaperdoll_BodyX + paperdoll_Boot[pBodyComplection][5][0];
7195 v59 = papredoll_flying_feet[v244];
7196 }
7197 else
7198 {
7199 if ( v58 == 512 )
7200 {
7201 a3e = pPaperdoll_BodyY + paperdoll_Boot[pBodyComplection][6][1];
7202 a2e = pPaperdoll_BodyX + paperdoll_Boot[pBodyComplection][6][0];
7203 v59 = dword_511638[pBodyComplection][5];
7204 }
7205 else
7206 {
7207 v60 = v58 - 115;
7208 if ( v60 < 0 || v60 >= 5 )
7209 {
7210 a2e = 0;
7211 a3e = 0;
7212 v59 = dword_511638[pBodyComplection][0];
7213 }
7214 else
7215 {
7216 v61 = v60 + 7 * pBodyComplection;
7217 a3e = pPaperdoll_BodyY + paperdoll_Boot[0][v61][1];
7218 a2e = pPaperdoll_BodyX + paperdoll_Boot[0][v61][0];
7219 v59 = dword_511638[0][v60 + 6 * pBodyComplection];
7220 }
7221 }
7222 }
7223 v62 = *(int *)(v57 + 20);
7224 if ( !(*(int *)(v57 + 20) & 0xF0) )
7225 {
7226 v65 = v59 + 1;
7227 v66 = (char *)&pIcons_LOD->pTextures[v59];
7228 if ( v62 & 2 )
7229 {
7230 v67 = (Texture *)(v65 != 0 ? (int)v66 : 0);
7231 pRenderer->DrawTransparentRedShade(a2e, a3e, v67);
7232 }
7233 else
7234 {
7235 if ( v62 & 1 )
7236 {
7237 v67 = (Texture *)(v65 != 0 ? (int)v66 : 0);
7238 pRenderer->DrawTextureTransparent(a2e, a3e, v67);
7239 }
7240 else
7241 {
7242 v67 = (Texture *)(v65 != 0 ? (int)v66 : 0);
7243 pRenderer->DrawTransparentGreenShade(a2e, a3e, v67);
7244 }
7245 }
7246 if ( !bRingsShownInCharScreen )
7247 pRenderer->_4A612A(a2e, a3e, v67, v233);
7248 LABEL_155:
7249 v69 = pPlayer->pEquipment.uMainHand;
7250 uPlayerID_a = 2 * pBodyComplection;
7251 if ( !v69 || (v70 = *(int *)&pPlayer->pInventoryItems[v69-1], pItemsTable->pItems[v70].uEquipType != 1)
7252 && (pItemsTable->pItems[v70].uSkillType != 4 || pPlayer->pEquipment.uOffHand) )
7253 pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_LeftHand[pBodyComplection][0],
7254 pPaperdoll_BodyY + pPaperdoll_LeftHand[pBodyComplection][1],
7255 (Texture *)(*(unsigned int *)((char *)papredoll_dlads + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dlads + v240)] : 0));
7256 v71 = pPlayer->pEquipment.uBelt;
7257 if ( v71 )
7258 {
7259 v234 = pPlayer->pEquipment.uBelt;
7260 v72 = (int)&pPlayer->pInventoryItems[v71-1];
7261 v222 = v72;
7262 if ( *(int *)v72 == 524 )
7263 {
7264 v73 = 5;
7265 }
7266 else
7267 {
7268 if ( *(int *)v72 == 535 )
7269 {
7270 v73 = 6;
7271 goto LABEL_168;
7272 }
7273 v73 = *(int *)v72 - 100;
7274 }
7275 if ( v73 >= 0 && v73 < 7 )
7276 {
7277 LABEL_168:
7278 v74 = 7 * pBodyComplection + v73;
7279 a2f = pPaperdoll_BodyX + paperdoll_Belt[0][v74][0];
7280 a3f = pPaperdoll_BodyY + paperdoll_Belt[0][v74][1];
7281 if ( IsDwarf != 1 || v73 == 5 )
7282 v75 = stru_511718[pBodyComplection].texids[v73];
7283 else
7284 v75 = stru_511718[pBodyComplection - 2].texids[v73];
7285 v76 = *(int *)&pPlayer->field_1F5[36 * v71 + 15];
7286 if ( !(*(int *)&pPlayer->field_1F5[36 * v71 + 15] & 0xF0) )
7287 {
7288 v79 = v75 + 1;
7289 v80 = (char *)&pIcons_LOD->pTextures[v75];
7290 if ( v76 & 2 )
7291 {
7292 v81 = (Texture *)(v79 != 0 ? (int)v80 : 0);
7293 pRenderer->DrawTransparentRedShade(a2f, a3f, v81);
7294 }
7295 else
7296 {
7297 if ( v76 & 1 )
7298 {
7299 v81 = (Texture *)(v79 != 0 ? (int)v80 : 0);
7300 pRenderer->DrawTextureTransparent(a2f, a3f, v81);
7301 }
7302 else
7303 {
7304 v81 = (Texture *)(v79 != 0 ? (int)v80 : 0);
7305 pRenderer->DrawTransparentGreenShade(a2f, a3f, v81);
7306 }
7307 }
7308 if ( !bRingsShownInCharScreen )
7309 pRenderer->_4A612A(a2f, a3f, v81, v234);
7310 goto LABEL_192;
7311 }
7312 if ( (*(int *)&pPlayer->field_1F5[36 * v71 + 15] & 0xF0) != 16 )
7313 {
7314 if ( (*(int *)&pPlayer->field_1F5[36 * v71 + 15] & 0xF0) == 32 )
7315 {
7316 v172 = "sp28a";
7317 v77 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v172, TEXTURE_16BIT_PALETTE)];
7318 dword_50C9A8 -= pEventTimer->uTimeElapsed;
7319 if ( dword_50C9A8 <= 0 )
7320 {
7321 dword_50C9A8 = 0;
7322 *(char *)(v222 + 20) &= 0xFu;
7323 ptr_50C9A4 = 0;
7324 }
7325 v78 = (double)GetTickCount() * 0.1;
7326 pRenderer->_4A63E6(a2f, a3f, (Texture *)(v75 != -1 ? (int)&pIcons_LOD->pTextures[v75] : 0), v77, (signed __int64)v78, 0, 255);
7327 goto LABEL_192;
7328 }
7329 if ( (*(int *)&pPlayer->field_1F5[36 * v71 + 15] & 0xF0) == 64 )
7330 {
7331 v172 = "sp30a";
7332 v77 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v172, TEXTURE_16BIT_PALETTE)];
7333 dword_50C9A8 -= pEventTimer->uTimeElapsed;
7334 if ( dword_50C9A8 <= 0 )
7335 {
7336 dword_50C9A8 = 0;
7337 *(char *)(v222 + 20) &= 0xFu;
7338 ptr_50C9A4 = 0;
7339 }
7340 v78 = (double)GetTickCount() * 0.1;
7341 pRenderer->_4A63E6(a2f, a3f, (Texture *)(v75 != -1 ? (int)&pIcons_LOD->pTextures[v75] : 0), v77, (signed __int64)v78, 0, 255);
7342 goto LABEL_192;
7343 }
7344 if ( (*(int *)&pPlayer->field_1F5[36 * v71 + 15] & 0xF0) == 128 )
7345 {
7346 v172 = "sp91a";
7347 v77 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v172, TEXTURE_16BIT_PALETTE)];
7348 dword_50C9A8 -= pEventTimer->uTimeElapsed;
7349 if ( dword_50C9A8 <= 0 )
7350 {
7351 dword_50C9A8 = 0;
7352 *(char *)(v222 + 20) &= 0xFu;
7353 ptr_50C9A4 = 0;
7354 }
7355 v78 = (double)GetTickCount() * 0.1;
7356 pRenderer->_4A63E6(a2f, a3f, (Texture *)(v75 != -1 ? (int)&pIcons_LOD->pTextures[v75] : 0), v77, (signed __int64)v78, 0, 255);
7357 goto LABEL_192;
7358 }
7359 }
7360 v172 = "sptext01";
7361 v77 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v172, TEXTURE_16BIT_PALETTE)];
7362 dword_50C9A8 -= pEventTimer->uTimeElapsed;
7363 if ( dword_50C9A8 <= 0 )
7364 {
7365 dword_50C9A8 = 0;
7366 *(char *)(v222 + 20) &= 0xFu;
7367 ptr_50C9A4 = 0;
7368 }
7369 v78 = (double)GetTickCount() * 0.1;
7370 pRenderer->_4A63E6(a2f, a3f, (Texture *)(v75 != -1 ? (int)&pIcons_LOD->pTextures[v75] : 0), v77, (signed __int64)v78, 0, 255);
7371 goto LABEL_192;
7372 }
7373 }
7374 LABEL_192:
7375 v82 = pPlayer->pEquipment.uMainHand;
7376 if ( v82 )
7377 {
7378 v83 = *(int *)&pPlayer->pInventoryItems[v82-1];
7379 if ( pItemsTable->pItems[v83].uEquipType == 1
7380 || pItemsTable->pItems[v83].uSkillType == 4 && !pPlayer->pEquipment.uOffHand )
7381 pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_SecondLeftHand[0][uPlayerID_a],
7382 pPaperdoll_BodyY + pPaperdoll_SecondLeftHand[0][uPlayerID_a + 1],
7383 (Texture *)(*(unsigned int *)((char *)papredoll_dlaus + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dlaus + v240)] : 0));
7384 }
7385 v84 = pPlayer->pEquipment.uBody;
7386 v235 = v84;
7387 v85 = (int)((char *)pPlayer + 36 * v84);
7388 v242 = v85;
7389 v86 = *(int *)(v85 + 496);
7390 v87 = *(int *)(v85 + 496) - 504;
7391 if ( v87 )
7392 {
7393 v88 = v87 - 1;
7394 if ( v88 )
7395 {
7396 v89 = v88 - 11;
7397 if ( v89 )
7398 {
7399 if ( v89 != 17 )
7400 {
7401 v90 = v86 - 66;
7402 LABEL_207:
7403 if ( v90 < 0 || v90 > 17 )
7404 {
7405 LABEL_259:
7406 v111 = pPlayer->pEquipment.uCloak;
7407 if ( !v111 )
7408 goto LABEL_293;
7409 v236 = pPlayer->pEquipment.uCloak;
7410 v112 = (int)&pPlayer->pInventoryItems[v111-1];
7411 v225 = v112;
7412 v113 = *(int *)v112;
7413 if ( v113 != 525 )
7414 {
7415 switch ( v113 )
7416 {
7417 case 530:
7418 v191 = 6;
7419 break;
7420 case 547:
7421 v191 = 7;
7422 break;
7423 case 548:
7424 v191 = 8;
7425 break;
7426 default:
7427 if ( v113 != 550 )
7428 {
7429 v114 = v113 - 105;
7430 LABEL_272:
7431 if ( v114 < 0 || v114 >= 10 )
7432 goto LABEL_293;
7433 LABEL_274:
7434 v115 = v114 + 10 * pBodyComplection;
7435 v116 = dword_511788[v115];
7436 v115 *= 8;
7437 v117 = pPaperdoll_BodyX + *(int *)((char *)&dword_4E56B0 + v115);
7438 a2h = pPaperdoll_BodyX + *(int *)((char *)&dword_4E56B0 + v115);
7439 a3h = pPaperdoll_BodyY + *(int *)((char *)&dword_4E56B4 + v115);
7440 if ( v116 == pIcons_LOD->FindTextureByName("pending") )
7441 {
7442 LABEL_292:
7443 LABEL_293:
7444 if ( v244 == 12 || v244 == 13 )
7445 {
7446 v122 = papredoll_dbrds[v244];
7447 if ( v122 != pIcons_LOD->FindTextureByName("Pending") )
7448 pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_Beards[2 * v244 - 24],
7449 pPaperdoll_BodyY + pPaperdoll_Beards[2 * v244 - 23],
7450 (Texture *)(v122 != -1 ? (int)&pIcons_LOD->pTextures[v122] : 0));
7451 }
7452 v123 = pPlayer->pEquipment.uHelm;
7453 if ( !v123 )
7454 goto LABEL_335;
7455 v237 = v123;
7456 v124 = (int)&pPlayer->pInventoryItems[v123-1];
7457 v226 = v124;
7458 if ( *(int *)v124 != 521 )
7459 {
7460 switch ( *(int *)v124 )
7461 {
7462 case 0x20A:
7463 v192 = 12;
7464 break;
7465 case 0x20B:
7466 v192 = 13;
7467 break;
7468 case 0x214:
7469 v192 = 14;
7470 break;
7471 default:
7472 if ( *(int *)v124 != 544 )
7473 {
7474 v125 = *(int *)v124 - 89;
7475 if ( v125 < 0 || v125 >= 16 )
7476 goto LABEL_335;
7477 goto LABEL_312;
7478 }
7479 v192 = 15;
7480 break;
7481 }
7482 v125 = v192;
7483 LABEL_312:
7484 v126 = 2 * (v125 + 16 * pBodyComplection);
7485 a2j = pPaperdoll_BodyX + dword_4E58D0[v126];
7486 a3i = pPaperdoll_BodyY + dword_4E58D4[v126];
7487 if ( IsDwarf != 1 || *(int *)v124 != 92 )
7488 v127 = stru_511698[0].texids[v125 + 16 * pSex];
7489 else
7490 v127 = papredoll_dbrds[11];
7491 v128 = *(int *)(v124 + 20);
7492 if ( *(int *)(v124 + 20) & 0xF0 )
7493 {
7494 if ( (*(int *)(v124 + 20) & 0xF0) != 16 )
7495 {
7496 if ( (*(int *)(v124 + 20) & 0xF0) == 32 )
7497 {
7498 v180 = "sp28a";
7499 v129 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v180, TEXTURE_16BIT_PALETTE)];
7500 dword_50C9A8 -= pEventTimer->uTimeElapsed;
7501 if ( dword_50C9A8 <= 0 )
7502 {
7503 dword_50C9A8 = 0;
7504 *(char *)(v226 + 20) &= 0xFu;
7505 ptr_50C9A4 = 0;
7506 }
7507 v130 = (double)GetTickCount() * 0.1;
7508 pRenderer->_4A63E6(a2j, a3i, (Texture *)(v127 != -1 ? (int)&pIcons_LOD->pTextures[v127] : 0),
7509 v129, (signed __int64)v130, 0, 255);
7510 goto LABEL_335;
7511 }
7512 if ( (*(int *)(v124 + 20) & 0xF0) == 64 )
7513 {
7514 v180 = "sp30a";
7515 v129 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v180, TEXTURE_16BIT_PALETTE)];
7516 dword_50C9A8 -= pEventTimer->uTimeElapsed;
7517 if ( dword_50C9A8 <= 0 )
7518 {
7519 dword_50C9A8 = 0;
7520 *(char *)(v226 + 20) &= 0xFu;
7521 ptr_50C9A4 = 0;
7522 }
7523 v130 = (double)GetTickCount() * 0.1;
7524 pRenderer->_4A63E6(a2j, a3i, (Texture *)(v127 != -1 ? (int)&pIcons_LOD->pTextures[v127] : 0),
7525 v129, (signed __int64)v130, 0, 255);
7526 goto LABEL_335;
7527 }
7528 if ( (*(int *)(v124 + 20) & 0xF0) == 128 )
7529 {
7530 v180 = "sp91a";
7531 v129 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v180, TEXTURE_16BIT_PALETTE)];
7532 dword_50C9A8 -= pEventTimer->uTimeElapsed;
7533 if ( dword_50C9A8 <= 0 )
7534 {
7535 dword_50C9A8 = 0;
7536 *(char *)(v226 + 20) &= 0xFu;
7537 ptr_50C9A4 = 0;
7538 }
7539 v130 = (double)GetTickCount() * 0.1;
7540 pRenderer->_4A63E6(a2j, a3i, (Texture *)(v127 != -1 ? (int)&pIcons_LOD->pTextures[v127] : 0),
7541 v129, (signed __int64)v130, 0, 255);
7542 goto LABEL_335;
7543 }
7544 }
7545 v180 = "sptext01";
7546 v129 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v180, TEXTURE_16BIT_PALETTE)];
7547 dword_50C9A8 -= pEventTimer->uTimeElapsed;
7548 if ( dword_50C9A8 <= 0 )
7549 {
7550 dword_50C9A8 = 0;
7551 *(char *)(v226 + 20) &= 0xFu;
7552 ptr_50C9A4 = 0;
7553 }
7554 v130 = (double)GetTickCount() * 0.1;
7555 pRenderer->_4A63E6(a2j, a3i, (Texture *)(v127 != -1 ? (int)&pIcons_LOD->pTextures[v127] : 0),
7556 v129, (signed __int64)v130, 0, 255);
7557 goto LABEL_335;
7558 }
7559 v131 = v127 + 1;
7560 v132 = (char *)&pIcons_LOD->pTextures[v127];
7561 if ( v128 & 2 )
7562 {
7563 v133 = (Texture *)(v131 != 0 ? (int)v132 : 0);
7564 pRenderer->DrawTransparentRedShade(a2j, a3i, v133);
7565 }
7566 else
7567 {
7568 if ( v128 & 1 )
7569 {
7570 v133 = (Texture *)(v131 != 0 ? (int)v132 : 0);
7571 pRenderer->DrawTextureTransparent(a2j, a3i, v133);
7572 }
7573 else
7574 {
7575 v133 = (Texture *)(v131 != 0 ? (int)v132 : 0);
7576 pRenderer->DrawTransparentGreenShade(a2j, a3i, v133);
7577 }
7578 }
7579 if ( !bRingsShownInCharScreen )
7580 pRenderer->_4A612A(a2j, a3i, v133, v237);
7581 LABEL_335:
7582 v134 = pPlayer->pEquipment.uMainHand;
7583 if ( !v134 )
7584 goto LABEL_358;
7585 v238 = pPlayer->pEquipment.uMainHand;
7586 v135 = (int)&pPlayer->pInventoryItems[v134-1];
7587 v227 = v135;
7588 v136 = *(int *)v135;
7589 v137 = *(int *)v135;
7590 a2k = pPaperdoll_BodyX + paperdoll_Weapon[pBodyComplection][1][0] - pItemsTable->pItems[v137].uEquipX;
7591 a3j = pPaperdoll_BodyY + paperdoll_Weapon[pBodyComplection][1][1] - pItemsTable->pItems[v137].uEquipY;
7592 if ( v136 == 64 )
7593 v181 = "item64v1";
7594 else
7595 v181 = pItemsTable->pItems[v137].pIconName;
7596 v138 = pIcons_LOD->LoadTexture(v181, TEXTURE_16BIT_PALETTE);
7597 v139 = *(int *)(v227 + 20);
7598 if ( !(*(int *)(v227 + 20) & 0xF0) )
7599 {
7600 v142 = v138 + 1;
7601 v143 = (char *)&pIcons_LOD->pTextures[v138];
7602 if ( v139 & 2 )
7603 {
7604 v144 = (Texture *)(v142 != 0 ? (int)v143 : 0);
7605 pRenderer->DrawTransparentRedShade(a2k, a3j, v144);
7606 }
7607 else
7608 {
7609 if ( v139 & 1 )
7610 {
7611 v144 = (Texture *)(v142 != 0 ? (int)v143 : 0);
7612 pRenderer->DrawTextureTransparent(a2k, a3j, v144);
7613 }
7614 else
7615 {
7616 v144 = (Texture *)(v142 != 0 ? (int)v143 : 0);
7617 pRenderer->DrawTransparentGreenShade(a2k, a3j, v144);
7618 }
7619 }
7620 if ( !bRingsShownInCharScreen )
7621 pRenderer->_4A612A(a2k, a3j, v144, v238);
7622 LABEL_358:
7623 v145 = pPlayer->pEquipment.uOffHand;
7624 v249 = pPlayer->pEquipment.uOffHand;
7625 if ( !v145 )
7626 goto LABEL_393;
7627 v146 = (int)&pPlayer->pInventoryItems[v145-1];
7628 v228 = v146;
7629 v147 = *(int *)v146;
7630 v148 = *(int *)v146;
7631 v149 = pItemsTable->pItems[v148].uSkillType;
7632 if ( v149 != 2 && v149 != 1 )
7633 {
7634 v245 = 0;
7635 v150 = pPaperdoll_BodyX + paperdoll_Weapon[pBodyComplection][0][0] - pItemsTable->pItems[v148].uEquipX;
7636 a3k = pPaperdoll_BodyY + paperdoll_Weapon[pBodyComplection][0][1] - pItemsTable->pItems[v148].uEquipY;
7637 goto LABEL_370;
7638 }
7639 v151 = v147 - 400;
7640 v245 = 1;
7641 if ( v151 )
7642 {
7643 v152 = v151 - 3;
7644 if ( v152 )
7645 {
7646 if ( v152 != 12 )
7647 {
7648 v150 = pPaperdoll_BodyX + paperdoll_Weapon[pBodyComplection][0][0] - pItemsTable->pItems[v148].uEquipX;
7649 a3k = pPaperdoll_BodyY + paperdoll_Weapon[pBodyComplection][0][1] - pItemsTable->pItems[v148].uEquipY;
7650 goto LABEL_370;
7651 }
7652 v150 = 595;
7653 a3k = 33;
7654 LABEL_370:
7655 v153 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v148].pIconName, TEXTURE_16BIT_PALETTE);
7656 v154 = v153;
7657 v243 = v153;
7658 v155 = *(int *)(v228 + 20);
7659 if ( !(*(int *)(v228 + 20) & 0xF0) )
7660 {
7661 if ( v155 & 2 )
7662 {
7663 v159 = (Texture *)(v243 != -1 ? (int)&pIcons_LOD->pTextures[v243] : 0);
7664 pRenderer->DrawTransparentRedShade(v150, a3k, v159);
7665 }
7666 else
7667 {
7668 v29 = (v155 & 1) == 0;
7669 v160 = (char *)&pIcons_LOD->pTextures[v243];
7670 if ( v29 )
7671 {
7672 v159 = (Texture *)(v243 != -1 ? (int)v160 : 0);
7673 pRenderer->DrawTransparentGreenShade(v150, a3k, (Texture *)(v243 != -1 ? (int)v160 : 0));
7674 }
7675 else
7676 {
7677 v159 = (Texture *)(v243 != -1 ? (int)v160 : 0);
7678 pRenderer->DrawTextureTransparent(v150, a3k, (Texture *)(v243 != -1 ? (int)v160 : 0));
7679 }
7680 }
7681 if ( !bRingsShownInCharScreen )
7682 pRenderer->_4A612A(v150, a3k, v159, v249);
7683 if ( v245 )
7684 pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdollLeftEmptyHand[uPlayerID_a],
7685 pPaperdoll_BodyY + pPaperdollLeftEmptyHand[uPlayerID_a + 1],
7686 (Texture *)(*(unsigned int *)((char *)papredoll_dlhs
7687 + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dlhs + v240)] : 0));
7688 goto LABEL_393;
7689 }
7690 if ( (*(int *)(v228 + 20) & 0xF0) != 16 )
7691 {
7692 if ( (*(int *)(v228 + 20) & 0xF0) == 32 )
7693 {
7694 v183 = "sp28a";
7695 }
7696 else
7697 {
7698 if ( (*(int *)(v228 + 20) & 0xF0) != 64 )
7699 {
7700 v156 = pIcons_LOD;
7701 if ( (*(int *)(v228 + 20) & 0xF0) == 128 )
7702 {
7703 v183 = "sp91a";
7704 v157 = &pIcons_LOD->pTextures[v156->LoadTexture(v183, TEXTURE_16BIT_PALETTE)];
7705 dword_50C9A8 -= pEventTimer->uTimeElapsed;
7706 if ( dword_50C9A8 <= 0 )
7707 {
7708 dword_50C9A8 = 0;
7709 *(char *)(v228 + 20) &= 0xFu;
7710 ptr_50C9A4 = 0;
7711 }
7712 v158 = (double)GetTickCount() * 0.1;
7713 pRenderer->_4A63E6(v150, a3k, (Texture *)(v154 != -1 ? (int)&pIcons_LOD->pTextures[v154] : 0),
7714 v157, (signed __int64)v158, 0, 255);
7715 if ( v245 )
7716 pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdollLeftEmptyHand[uPlayerID_a],
7717 pPaperdoll_BodyY + pPaperdollLeftEmptyHand[uPlayerID_a + 1],
7718 (Texture *)(*(unsigned int *)((char *)papredoll_dlhs
7719 + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dlhs + v240)] : 0));
7720 goto LABEL_393;
7721 }
7722 v183 = "sptext01";
7723 v157 = &pIcons_LOD->pTextures[v156->LoadTexture(v183, TEXTURE_16BIT_PALETTE)];
7724 dword_50C9A8 -= pEventTimer->uTimeElapsed;
7725 if ( dword_50C9A8 <= 0 )
7726 {
7727 dword_50C9A8 = 0;
7728 *(char *)(v228 + 20) &= 0xFu;
7729 ptr_50C9A4 = 0;
7730 }
7731 v158 = (double)GetTickCount() * 0.1;
7732 pRenderer->_4A63E6(v150, a3k, (Texture *)(v154 != -1 ? (int)&pIcons_LOD->pTextures[v154] : 0),
7733 v157, (signed __int64)v158, 0, 255);
7734 if ( v245 )
7735 pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdollLeftEmptyHand[uPlayerID_a],
7736 pPaperdoll_BodyY + pPaperdollLeftEmptyHand[uPlayerID_a + 1],
7737 (Texture *)(*(unsigned int *)((char *)papredoll_dlhs
7738 + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dlhs + v240)] : 0));
7739 goto LABEL_393;
7740 }
7741 v183 = "sp30a";
7742 }
7743 v156 = pIcons_LOD;
7744 v157 = &pIcons_LOD->pTextures[v156->LoadTexture(v183, TEXTURE_16BIT_PALETTE)];
7745 dword_50C9A8 -= pEventTimer->uTimeElapsed;
7746 if ( dword_50C9A8 <= 0 )
7747 {
7748 dword_50C9A8 = 0;
7749 *(char *)(v228 + 20) &= 0xFu;
7750 ptr_50C9A4 = 0;
7751 }
7752 v158 = (double)GetTickCount() * 0.1;
7753 pRenderer->_4A63E6(v150, a3k, (Texture *)(v154 != -1 ? (int)&pIcons_LOD->pTextures[v154] : 0),
7754 v157, (signed __int64)v158, 0, 255);
7755 if ( v245 )
7756 pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdollLeftEmptyHand[uPlayerID_a],
7757 pPaperdoll_BodyY + pPaperdollLeftEmptyHand[uPlayerID_a + 1],
7758 (Texture *)(*(unsigned int *)((char *)papredoll_dlhs
7759 + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dlhs + v240)] : 0));
7760 goto LABEL_393;
7761 }
7762 v156 = pIcons_LOD;
7763 v183 = "sptext01";
7764 v157 = &pIcons_LOD->pTextures[v156->LoadTexture(v183, TEXTURE_16BIT_PALETTE)];
7765 dword_50C9A8 -= pEventTimer->uTimeElapsed;
7766 if ( dword_50C9A8 <= 0 )
7767 {
7768 dword_50C9A8 = 0;
7769 *(char *)(v228 + 20) &= 0xFu;
7770 ptr_50C9A4 = 0;
7771 }
7772 v158 = (double)GetTickCount() * 0.1;
7773 pRenderer->_4A63E6(v150, a3k, (Texture *)(v154 != -1 ? (int)&pIcons_LOD->pTextures[v154] : 0),
7774 v157, (signed __int64)v158, 0, 255);
7775 if ( v245 )
7776 pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdollLeftEmptyHand[uPlayerID_a],
7777 pPaperdoll_BodyY + pPaperdollLeftEmptyHand[uPlayerID_a + 1],
7778 (Texture *)(*(unsigned int *)((char *)papredoll_dlhs
7779 + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dlhs + v240)] : 0));
7780 goto LABEL_393;
7781 }
7782 a3k = 28;
7783 }
7784 else
7785 {
7786 a3k = 86;
7787 }
7788 v150 = 596;
7789 goto LABEL_370;
7790 }
7791 if ( (*(int *)(v227 + 20) & 0xF0) != 16 )
7792 {
7793 if ( (*(int *)(v227 + 20) & 0xF0) == 32 )
7794 {
7795 v182 = "sp28a";
7796 v140 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v182, TEXTURE_16BIT_PALETTE)];
7797 dword_50C9A8 -= pEventTimer->uTimeElapsed;
7798 if ( dword_50C9A8 <= 0 )
7799 {
7800 dword_50C9A8 = 0;
7801 *(char *)(v227 + 20) &= 0xFu;
7802 ptr_50C9A4 = 0;
7803 }
7804 v141 = (double)GetTickCount() * 0.1;
7805 pRenderer->_4A63E6(a2k, a3j, (Texture *)(v138 != -1 ? (int)&pIcons_LOD->pTextures[v138] : 0),
7806 v140, (signed __int64)v141, 0, 255);
7807 goto LABEL_358;
7808 }
7809 if ( (*(int *)(v227 + 20) & 0xF0) == 64 )
7810 {
7811 v182 = "sp30a";
7812 v140 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v182, TEXTURE_16BIT_PALETTE)];
7813 dword_50C9A8 -= pEventTimer->uTimeElapsed;
7814 if ( dword_50C9A8 <= 0 )
7815 {
7816 dword_50C9A8 = 0;
7817 *(char *)(v227 + 20) &= 0xFu;
7818 ptr_50C9A4 = 0;
7819 }
7820 v141 = (double)GetTickCount() * 0.1;
7821 pRenderer->_4A63E6(a2k, a3j, (Texture *)(v138 != -1 ? (int)&pIcons_LOD->pTextures[v138] : 0),
7822 v140, (signed __int64)v141, 0, 255);
7823 goto LABEL_358;
7824 }
7825 if ( (*(int *)(v227 + 20) & 0xF0) == 128 )
7826 {
7827 v182 = "sp91a";
7828 v140 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v182, TEXTURE_16BIT_PALETTE)];
7829 dword_50C9A8 -= pEventTimer->uTimeElapsed;
7830 if ( dword_50C9A8 <= 0 )
7831 {
7832 dword_50C9A8 = 0;
7833 *(char *)(v227 + 20) &= 0xFu;
7834 ptr_50C9A4 = 0;
7835 }
7836 v141 = (double)GetTickCount() * 0.1;
7837 pRenderer->_4A63E6(a2k, a3j, (Texture *)(v138 != -1 ? (int)&pIcons_LOD->pTextures[v138] : 0),
7838 v140, (signed __int64)v141, 0, 255);
7839 goto LABEL_358;
7840 }
7841 }
7842 v182 = "sptext01";
7843 v140 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v182, TEXTURE_16BIT_PALETTE)];
7844 dword_50C9A8 -= pEventTimer->uTimeElapsed;
7845 if ( dword_50C9A8 <= 0 )
7846 {
7847 dword_50C9A8 = 0;
7848 *(char *)(v227 + 20) &= 0xFu;
7849 ptr_50C9A4 = 0;
7850 }
7851 v141 = (double)GetTickCount() * 0.1;
7852 pRenderer->_4A63E6(a2k, a3j, (Texture *)(v138 != -1 ? (int)&pIcons_LOD->pTextures[v138] : 0),
7853 v140, (signed __int64)v141, 0, 255);
7854 goto LABEL_358;
7855 }
7856 v125 = 11;
7857 if ( v125 < 0 || v125 >= 16 )
7858 goto LABEL_335;
7859 goto LABEL_312;
7860 }
7861 if ( !(*(int *)(v225 + 20) & 0xF0) )
7862 {
7863 v119 = v116 + 1;
7864 v120 = (char *)&pIcons_LOD->pTextures[v116];
7865 if ( *(int *)(v225 + 20) & 2 )
7866 {
7867 v121 = (Texture *)(v119 != 0 ? (int)v120 : 0);
7868 pRenderer->DrawTransparentRedShade(a2h, a3h, v121);
7869 }
7870 else
7871 {
7872 v121 = (Texture *)(v119 != 0 ? (int)v120 : 0);
7873 pRenderer->DrawTextureTransparent(a2h, a3h, v121);
7874 }
7875 if ( !bRingsShownInCharScreen )
7876 pRenderer->_4A612A(a2h, a3h, v121, v236);
7877 goto LABEL_292;
7878 }
7879 if ( (*(int *)(v225 + 20) & 0xF0) != 16 )
7880 {
7881 if ( (*(int *)(v225 + 20) & 0xF0) == 32 )
7882 {
7883 v179 = "sp28a";
7884 a2i = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v179, TEXTURE_16BIT_PALETTE)];
7885 dword_50C9A8 -= pEventTimer->uTimeElapsed;
7886 if ( dword_50C9A8 <= 0 )
7887 {
7888 dword_50C9A8 = 0;
7889 *(char *)(v225 + 20) &= 0xFu;
7890 ptr_50C9A4 = 0;
7891 }
7892 v118 = (double)GetTickCount() * 0.1;
7893 pRenderer->_4A63E6(v117, a3h, (Texture *)(v116 != -1 ? (int)&pIcons_LOD->pTextures[v116] : 0),
7894 a2i, (signed __int64)v118, 0, 255);
7895 goto LABEL_292;
7896 }
7897 if ( (*(int *)(v225 + 20) & 0xF0) == 64 )
7898 {
7899 v179 = "sp30a";
7900 a2i = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v179, TEXTURE_16BIT_PALETTE)];
7901 dword_50C9A8 -= pEventTimer->uTimeElapsed;
7902 if ( dword_50C9A8 <= 0 )
7903 {
7904 dword_50C9A8 = 0;
7905 *(char *)(v225 + 20) &= 0xFu;
7906 ptr_50C9A4 = 0;
7907 }
7908 v118 = (double)GetTickCount() * 0.1;
7909 pRenderer->_4A63E6(v117, a3h, (Texture *)(v116 != -1 ? (int)&pIcons_LOD->pTextures[v116] : 0),
7910 a2i, (signed __int64)v118, 0, 255);
7911 goto LABEL_292;
7912 }
7913 if ( (*(int *)(v225 + 20) & 0xF0) == 128 )
7914 {
7915 v179 = "sp91a";
7916 a2i = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v179, TEXTURE_16BIT_PALETTE)];
7917 dword_50C9A8 -= pEventTimer->uTimeElapsed;
7918 if ( dword_50C9A8 <= 0 )
7919 {
7920 dword_50C9A8 = 0;
7921 *(char *)(v225 + 20) &= 0xFu;
7922 ptr_50C9A4 = 0;
7923 }
7924 v118 = (double)GetTickCount() * 0.1;
7925 pRenderer->_4A63E6(v117, a3h, (Texture *)(v116 != -1 ? (int)&pIcons_LOD->pTextures[v116] : 0),
7926 a2i, (signed __int64)v118, 0, 255);
7927 goto LABEL_292;
7928 }
7929 }
7930 v179 = "sptext01";
7931 a2i = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v179, TEXTURE_16BIT_PALETTE)];
7932 dword_50C9A8 -= pEventTimer->uTimeElapsed;
7933 if ( dword_50C9A8 <= 0 )
7934 {
7935 dword_50C9A8 = 0;
7936 *(char *)(v225 + 20) &= 0xFu;
7937 ptr_50C9A4 = 0;
7938 }
7939 v118 = (double)GetTickCount() * 0.1;
7940 pRenderer->_4A63E6(v117, a3h, (Texture *)(v116 != -1 ? (int)&pIcons_LOD->pTextures[v116] : 0),
7941 a2i, (signed __int64)v118, 0, 255);
7942 goto LABEL_292;
7943 }
7944 v191 = 9;
7945 break;
7946 }
7947 v114 = v191;
7948 goto LABEL_274;
7949 }
7950 v114 = 5;
7951 goto LABEL_272;
7952 }
7953 LABEL_209:
7954 if ( pPlayer->pEquipment.uMainHand
7955 && (pPlayer->GetEquippedItemEquipType(1u) == 1
7956 || pPlayer->GetEquippedItemSkillType(EQUIP_TWO_HANDED) == 4
7957 && !pPlayer->pEquipment.uOffHand) )
7958 {
7959 v91 = 17 * pBodyComplection + v90;
7960 v92 = v91;
7961 v223 = paperdoll_array_511290[0][v91][2];
7962 if ( v223 == pIcons_LOD->FindTextureByName("pending") )
7963 {
7964 v93 = 2 * v91;
7965 v94 = paperdoll_array_511290[0][v92][1];
7966 a2g = pPaperdoll_BodyX + paperdoll_shoulder[0][0][v93];
7967 v95 = paperdoll_shoulder[0][0][v93 + 1];
7968 }
7969 else
7970 {
7971 v94 = v223;
7972 a2g = pPaperdoll_BodyX + dword_4E5270[2 * v91];
7973 v95 = dword_4E5270[2 * v91 + 1];
7974 }
7975 a3g = pPaperdoll_BodyY + v95;
7976 if ( v94 == pIcons_LOD->FindTextureByName("pending") )
7977 goto LABEL_259;
7978 if ( *(int *)(v242 + 516) & 0xF0 )
7979 {
7980 if ( (*(int *)(v242 + 516) & 0xF0) != 16 )
7981 {
7982 if ( (*(int *)(v242 + 516) & 0xF0) == 32 )
7983 {
7984 v173 = "sp28a";
7985 v96 = (char *)&pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v173, TEXTURE_16BIT_PALETTE)];
7986 dword_50C9A8 -= pEventTimer->uTimeElapsed;
7987 if ( dword_50C9A8 <= 0 )
7988 {
7989 dword_50C9A8 = 0;
7990 *(char *)(v242 + 516) &= 0xFu;
7991 ptr_50C9A4 = 0;
7992 }
7993 v187 = 255;
7994 v174 = 0;
7995 v97 = (double)GetTickCount();
7996 pRenderer->_4A63E6(a2g, a3g, (Texture *)(v94 != -1 ? (int)&pIcons_LOD->pTextures[v94] : 0),
7997 (Texture *)v96, (signed __int64)(v97 * 0.1), v174, v187);
7998 goto LABEL_259;
7999 }
8000 if ( (*(int *)(v242 + 516) & 0xF0) == 64 )
8001 {
8002 v173 = "sp30a";
8003 v96 = (char *)&pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v173, TEXTURE_16BIT_PALETTE)];
8004 dword_50C9A8 -= pEventTimer->uTimeElapsed;
8005 if ( dword_50C9A8 <= 0 )
8006 {
8007 dword_50C9A8 = 0;
8008 *(char *)(v242 + 516) &= 0xFu;
8009 ptr_50C9A4 = 0;
8010 }
8011 v187 = 255;
8012 v174 = 0;
8013 v97 = (double)GetTickCount();
8014 pRenderer->_4A63E6(a2g, a3g, (Texture *)(v94 != -1 ? (int)&pIcons_LOD->pTextures[v94] : 0),
8015 (Texture *)v96, (signed __int64)(v97 * 0.1), v174, v187);
8016 goto LABEL_259;
8017 }
8018 if ( (*(int *)(v242 + 516) & 0xF0) == 128 )
8019 {
8020 v173 = "sp91a";
8021 v96 = (char *)&pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v173, TEXTURE_16BIT_PALETTE)];
8022 dword_50C9A8 -= pEventTimer->uTimeElapsed;
8023 if ( dword_50C9A8 <= 0 )
8024 {
8025 dword_50C9A8 = 0;
8026 *(char *)(v242 + 516) &= 0xFu;
8027 ptr_50C9A4 = 0;
8028 }
8029 v187 = 255;
8030 v174 = 0;
8031 v97 = (double)GetTickCount();
8032 pRenderer->_4A63E6(a2g, a3g, (Texture *)(v94 != -1 ? (int)&pIcons_LOD->pTextures[v94] : 0),
8033 (Texture *)v96, (signed __int64)(v97 * 0.1), v174, v187);
8034 goto LABEL_259;
8035 }
8036 }
8037 v173 = "sptext01";
8038 v96 = (char *)&pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v173, TEXTURE_16BIT_PALETTE)];
8039 dword_50C9A8 -= pEventTimer->uTimeElapsed;
8040 if ( dword_50C9A8 <= 0 )
8041 {
8042 dword_50C9A8 = 0;
8043 *(char *)(v242 + 516) &= 0xFu;
8044 ptr_50C9A4 = 0;
8045 }
8046 v187 = 255;
8047 v174 = 0;
8048 v97 = (double)GetTickCount();
8049 pRenderer->_4A63E6(a2g, a3g, (Texture *)(v94 != -1 ? (int)&pIcons_LOD->pTextures[v94] : 0),
8050 (Texture *)v96, (signed __int64)(v97 * 0.1), v174, v187);
8051 goto LABEL_259;
8052 }
8053 v98 = v94 + 1;
8054 v99 = (char *)&pIcons_LOD->pTextures[v94];
8055 v100 = pRenderer;
8056 if ( *(int *)(v242 + 516) & 2 )
8057 {
8058 v101 = (Texture *)(v98 != 0 ? (int)v99 : 0);
8059 v188 = v101;
8060 v175 = a3g;
8061 v163 = a2g;
8062 v100->DrawTransparentRedShade(v163, v175, v188);
8063 if ( !bRingsShownInCharScreen )
8064 pRenderer->_4A612A(a2g, a3g, v101, v235);
8065 goto LABEL_259;
8066 }
8067 if ( *(char *)(v242 + 516) & 1 )
8068 {
8069 v101 = (Texture *)(v98 != 0 ? (int)v99 : 0);
8070 v189 = v101;
8071 v176 = a3g;
8072 v164 = a2g;
8073 pRenderer->DrawTextureTransparent(v164, v176, v189);
8074 if ( !bRingsShownInCharScreen )
8075 pRenderer->_4A612A(a2g, a3g, v101, v235);
8076 goto LABEL_259;
8077 }
8078 v101 = (Texture *)(v98 != 0 ? (int)v99 : 0);
8079 v190 = v101;
8080 v177 = a3g;
8081 v165 = a2g;
8082 pRenderer->DrawTransparentGreenShade(v165, v177, v190);
8083 if ( !bRingsShownInCharScreen )
8084 pRenderer->_4A612A(a2g, a3g, v101, v235);
8085 goto LABEL_259;
8086 }
8087 v102 = 17 * pBodyComplection + v90;
8088 v94 = paperdoll_array_511290[0][v102][1];
8089 if ( v94 == pIcons_LOD->FindTextureByName("pending") )
8090 goto LABEL_259;
8091 v103 = pPaperdoll_BodyX + paperdoll_shoulder[0][v102][0];
8092 v104 = pPaperdoll_BodyY + paperdoll_shoulder[0][v102][1];
8093 v224 = *(int *)(v242 + 516);
8094 v105 = *(int *)(v242 + 516) & 0xF0;
8095 a2g = pPaperdoll_BodyX + paperdoll_shoulder[0][v102][0];
8096 a3g = pPaperdoll_BodyY + paperdoll_shoulder[0][v102][1];
8097 if ( !v105 )
8098 {
8099 v109 = v94 + 1;
8100 v110 = (char *)&pIcons_LOD->pTextures[v94];
8101 if ( v224 & 2 )
8102 {
8103 v101 = (Texture *)(v109 != 0 ? (int)v110 : 0);
8104 v188 = v101;
8105 v175 = v104;
8106 v163 = v103;
8107 v100 = pRenderer;
8108 v100->DrawTransparentRedShade(v163, v175, v188);
8109 if ( !bRingsShownInCharScreen )
8110 pRenderer->_4A612A(a2g, a3g, v101, v235);
8111 goto LABEL_259;
8112 }
8113 if ( v224 & 1 )
8114 {
8115 v101 = (Texture *)(v109 != 0 ? (int)v110 : 0);
8116 v189 = v101;
8117 v176 = v104;
8118 v164 = v103;
8119 v100 = pRenderer;
8120 pRenderer->DrawTextureTransparent(v164, v176, v189);
8121 if ( !bRingsShownInCharScreen )
8122 pRenderer->_4A612A(a2g, a3g, v101, v235);
8123 goto LABEL_259;
8124 }
8125 v101 = (Texture *)(v109 != 0 ? (int)v110 : 0);
8126 v190 = v101;
8127 v177 = v104;
8128 v165 = v103;
8129 v100 = pRenderer;
8130 pRenderer->DrawTransparentGreenShade(v165, v177, v190);
8131 if ( !bRingsShownInCharScreen )
8132 pRenderer->_4A612A(a2g, a3g, v101, v235);
8133 goto LABEL_259;
8134 }
8135 v106 = v105 - 16;
8136 if ( v106 )
8137 {
8138 v107 = v106 - 16;
8139 if ( !v107 )
8140 {
8141 v178 = "sp28a";
8142 v96 = (char *)&pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v178, TEXTURE_16BIT_PALETTE)];
8143 dword_50C9A8 -= pEventTimer->uTimeElapsed;
8144 if ( dword_50C9A8 <= 0 )
8145 {
8146 dword_50C9A8 = 0;
8147 *(char *)(v242 + 516) &= 0xFu;
8148 ptr_50C9A4 = 0;
8149 }
8150 v187 = 255;
8151 v174 = 0;
8152 v97 = (double)GetTickCount();
8153 pRenderer->_4A63E6(a2g, a3g, (Texture *)(v94 != -1 ? (int)&pIcons_LOD->pTextures[v94] : 0),
8154 (Texture *)v96, (signed __int64)(v97 * 0.1), v174, v187);
8155 goto LABEL_259;
8156 }
8157 v108 = v107 - 32;
8158 if ( !v108 )
8159 {
8160 v178 = "sp30a";
8161 v96 = (char *)&pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v178, TEXTURE_16BIT_PALETTE)];
8162 dword_50C9A8 -= pEventTimer->uTimeElapsed;
8163 if ( dword_50C9A8 <= 0 )
8164 {
8165 dword_50C9A8 = 0;
8166 *(char *)(v242 + 516) &= 0xFu;
8167 ptr_50C9A4 = 0;
8168 }
8169 v187 = 255;
8170 v174 = 0;
8171 v97 = (double)GetTickCount();
8172 pRenderer->_4A63E6(a2g, a3g, (Texture *)(v94 != -1 ? (int)&pIcons_LOD->pTextures[v94] : 0),
8173 (Texture *)v96, (signed __int64)(v97 * 0.1), v174, v187);
8174 goto LABEL_259;
8175 }
8176 if ( v108 == 64 )
8177 {
8178 v178 = "sp91a";
8179 v96 = (char *)&pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v178, TEXTURE_16BIT_PALETTE)];
8180 dword_50C9A8 -= pEventTimer->uTimeElapsed;
8181 if ( dword_50C9A8 <= 0 )
8182 {
8183 dword_50C9A8 = 0;
8184 *(char *)(v242 + 516) &= 0xFu;
8185 ptr_50C9A4 = 0;
8186 }
8187 v187 = 255;
8188 v174 = 0;
8189 v97 = (double)GetTickCount();
8190 pRenderer->_4A63E6(a2g, a3g, (Texture *)(v94 != -1 ? (int)&pIcons_LOD->pTextures[v94] : 0),
8191 (Texture *)v96, (signed __int64)(v97 * 0.1), v174, v187);
8192 goto LABEL_259;
8193 }
8194 }
8195 v178 = "sptext01";
8196 v96 = (char *)&pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v178, TEXTURE_16BIT_PALETTE)];
8197 dword_50C9A8 -= pEventTimer->uTimeElapsed;
8198 if ( dword_50C9A8 <= 0 )
8199 {
8200 dword_50C9A8 = 0;
8201 *(char *)(v242 + 516) &= 0xFu;
8202 ptr_50C9A4 = 0;
8203 }
8204 v187 = 255;
8205 v174 = 0;
8206 v97 = (double)GetTickCount();
8207 pRenderer->_4A63E6(a2g, a3g, (Texture *)(v94 != -1 ? (int)&pIcons_LOD->pTextures[v94] : 0),
8208 (Texture *)v96, (signed __int64)(v97 * 0.1), v174, v187);
8209 goto LABEL_259;
8210 }
8211 v186 = 16;
8212 }
8213 else
8214 {
8215 v186 = 13;
8216 }
8217 }
8218 else
8219 {
8220 v186 = 14;
8221 }
8222 v90 = v186;
8223 goto LABEL_209;
8224 }
8225 v90 = 15;
8226 goto LABEL_207;
8227 }
8228 if ( (*(int *)(v57 + 20) & 0xF0) != 16 )
8229 {
8230 if ( (*(int *)(v57 + 20) & 0xF0) == 32 )
8231 {
8232 v171 = "sp28a";
8233 v63 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v171, TEXTURE_16BIT_PALETTE)];
8234 dword_50C9A8 -= pEventTimer->uTimeElapsed;
8235 if ( dword_50C9A8 <= 0 )
8236 {
8237 dword_50C9A8 = 0;
8238 *(char *)(v221 + 20) &= 0xFu;
8239 ptr_50C9A4 = 0;
8240 }
8241 v64 = (double)GetTickCount() * 0.1;
8242 pRenderer->_4A63E6(a2e, a3e, (Texture *)(v59 != -1 ? (int)&pIcons_LOD->pTextures[v59] : 0), v63,
8243 (signed __int64)v64, 0, 255);
8244 goto LABEL_155;
8245 }
8246 if ( (*(int *)(v57 + 20) & 0xF0) == 64 )
8247 {
8248 v171 = "sp30a";
8249 v63 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v171, TEXTURE_16BIT_PALETTE)];
8250 dword_50C9A8 -= pEventTimer->uTimeElapsed;
8251 if ( dword_50C9A8 <= 0 )
8252 {
8253 dword_50C9A8 = 0;
8254 *(char *)(v221 + 20) &= 0xFu;
8255 ptr_50C9A4 = 0;
8256 }
8257 v64 = (double)GetTickCount() * 0.1;
8258 pRenderer->_4A63E6(a2e, a3e, (Texture *)(v59 != -1 ? (int)&pIcons_LOD->pTextures[v59] : 0), v63,
8259 (signed __int64)v64, 0, 255);
8260 goto LABEL_155;
8261 }
8262 if ( (*(int *)(v57 + 20) & 0xF0) == 128 )
8263 {
8264 v171 = "sp91a";
8265 v63 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v171, TEXTURE_16BIT_PALETTE)];
8266 dword_50C9A8 -= pEventTimer->uTimeElapsed;
8267 if ( dword_50C9A8 <= 0 )
8268 {
8269 dword_50C9A8 = 0;
8270 *(char *)(v221 + 20) &= 0xFu;
8271 ptr_50C9A4 = 0;
8272 }
8273 v64 = (double)GetTickCount() * 0.1;
8274 pRenderer->_4A63E6(a2e, a3e, (Texture *)(v59 != -1 ? (int)&pIcons_LOD->pTextures[v59] : 0), v63,
8275 (signed __int64)v64, 0, 255);
8276 goto LABEL_155;
8277 }
8278 }
8279 v171 = "sptext01";
8280 v63 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v171, TEXTURE_16BIT_PALETTE)];
8281 dword_50C9A8 -= pEventTimer->uTimeElapsed;
8282 if ( dword_50C9A8 <= 0 )
8283 {
8284 dword_50C9A8 = 0;
8285 *(char *)(v221 + 20) &= 0xFu;
8286 ptr_50C9A4 = 0;
8287 }
8288 v64 = (double)GetTickCount() * 0.1;
8289 pRenderer->_4A63E6(a2e, a3e, (Texture *)(v59 != -1 ? (int)&pIcons_LOD->pTextures[v59] : 0), v63,
8290 (signed __int64)v64, 0, 255);
8291 goto LABEL_155;
8292 }
8293 if ( (*(int *)(v44 + 20) & 0xF0) != 16 )
8294 {
8295 if ( (*(int *)(v44 + 20) & 0xF0) == 32 )
8296 {
8297 v170 = "sp28a";
8298 }
8299 else
8300 {
8301 if ( (*(int *)(v44 + 20) & 0xF0) != 64 )
8302 {
8303 v50 = pIcons_LOD;
8304 if ( (*(int *)(v44 + 20) & 0xF0) == 128 )
8305 {
8306 v170 = "sp91a";
8307 v51 = &pIcons_LOD->pTextures[v50->LoadTexture(v170, TEXTURE_16BIT_PALETTE)];
8308 dword_50C9A8 -= pEventTimer->uTimeElapsed;
8309 if ( dword_50C9A8 <= 0 )
8310 {
8311 dword_50C9A8 = 0;
8312 *(char *)(v220 + 20) &= 0xFu;
8313 ptr_50C9A4 = 0;
8314 }
8315 v52 = (double)GetTickCount() * 0.1;
8316 pRenderer->_4A63E6(a2d, a3d, (Texture *)(v48 != -1 ? (int)&pIcons_LOD->pTextures[v48] : 0),
8317 v51, (signed __int64)v52, 0, 255);
8318 goto LABEL_127;
8319 }
8320 v170 = "sptext01";
8321 v51 = &pIcons_LOD->pTextures[v50->LoadTexture(v170, TEXTURE_16BIT_PALETTE)];
8322 dword_50C9A8 -= pEventTimer->uTimeElapsed;
8323 if ( dword_50C9A8 <= 0 )
8324 {
8325 dword_50C9A8 = 0;
8326 *(char *)(v220 + 20) &= 0xFu;
8327 ptr_50C9A4 = 0;
8328 }
8329 v52 = (double)GetTickCount() * 0.1;
8330 pRenderer->_4A63E6(a2d, a3d, (Texture *)(v48 != -1 ? (int)&pIcons_LOD->pTextures[v48] : 0),
8331 v51, (signed __int64)v52, 0, 255);
8332 goto LABEL_127;
8333 }
8334 v170 = "sp30a";
8335 }
8336 v50 = pIcons_LOD;
8337 v51 = &pIcons_LOD->pTextures[v50->LoadTexture(v170, TEXTURE_16BIT_PALETTE)];
8338 dword_50C9A8 -= pEventTimer->uTimeElapsed;
8339 if ( dword_50C9A8 <= 0 )
8340 {
8341 dword_50C9A8 = 0;
8342 *(char *)(v220 + 20) &= 0xFu;
8343 ptr_50C9A4 = 0;
8344 }
8345 v52 = (double)GetTickCount() * 0.1;
8346 pRenderer->_4A63E6(a2d, a3d, (Texture *)(v48 != -1 ? (int)&pIcons_LOD->pTextures[v48] : 0),
8347 v51, (signed __int64)v52, 0, 255);
8348 goto LABEL_127;
8349 }
8350 v50 = pIcons_LOD;
8351 v170 = "sptext01";
8352 v51 = &pIcons_LOD->pTextures[v50->LoadTexture(v170, TEXTURE_16BIT_PALETTE)];
8353 dword_50C9A8 -= pEventTimer->uTimeElapsed;
8354 if ( dword_50C9A8 <= 0 )
8355 {
8356 dword_50C9A8 = 0;
8357 *(char *)(v220 + 20) &= 0xFu;
8358 ptr_50C9A4 = 0;
8359 }
8360 v52 = (double)GetTickCount() * 0.1;
8361 pRenderer->_4A63E6(a2d, a3d, (Texture *)(v48 != -1 ? (int)&pIcons_LOD->pTextures[v48] : 0),
8362 v51, (signed __int64)v52, 0, 255);
8363 goto LABEL_127;
8364 }
8365 v185 = 16;
8366 }
8367 }
8368 v45 = v185;
8369 goto LABEL_106;
8370 }
8371 v45 = 15;
8372 goto LABEL_104;
8373 }
8374 if ( (*(int *)(v32 + 20) & 0xF0) != 16 )
8375 {
8376 if ( (*(int *)(v32 + 20) & 0xF0) == 32 )
8377 {
8378 v169 = "sp28a";
8379 }
8380 else
8381 {
8382 if ( (*(int *)(v32 + 20) & 0xF0) != 64 )
8383 {
8384 v38 = pIcons_LOD;
8385 if ( (*(int *)(v32 + 20) & 0xF0) == 128 )
8386 {
8387 v169 = "sp91a";
8388 v39 = &pIcons_LOD->pTextures[v38->LoadTexture(v169, TEXTURE_16BIT_PALETTE)];
8389 dword_50C9A8 -= pEventTimer->uTimeElapsed;
8390 if ( dword_50C9A8 <= 0 )
8391 {
8392 dword_50C9A8 = 0;
8393 *(char *)(v219 + 20) &= 0xFu;
8394 ptr_50C9A4 = 0;
8395 }
8396 v40 = (double)GetTickCount() * 0.1;
8397 pRenderer->_4A63E6(a2c, a3c, (Texture *)(v35 != -1 ? (int)&pIcons_LOD->pTextures[v35] : 0), v39,
8398 (signed __int64)v40, 0, 255);
8399 goto LABEL_93;
8400 }
8401 v169 = "sptext01";
8402 v39 = &pIcons_LOD->pTextures[v38->LoadTexture(v169, TEXTURE_16BIT_PALETTE)];
8403 dword_50C9A8 -= pEventTimer->uTimeElapsed;
8404 if ( dword_50C9A8 <= 0 )
8405 {
8406 dword_50C9A8 = 0;
8407 *(char *)(v219 + 20) &= 0xFu;
8408 ptr_50C9A4 = 0;
8409 }
8410 v40 = (double)GetTickCount() * 0.1;
8411 pRenderer->_4A63E6(a2c, a3c, (Texture *)(v35 != -1 ? (int)&pIcons_LOD->pTextures[v35] : 0), v39,
8412 (signed __int64)v40, 0, 255);
8413 goto LABEL_93;
8414 }
8415 v169 = "sp30a";
8416 }
8417 v38 = pIcons_LOD;
8418 v39 = &pIcons_LOD->pTextures[v38->LoadTexture(v169, TEXTURE_16BIT_PALETTE)];
8419 dword_50C9A8 -= pEventTimer->uTimeElapsed;
8420 if ( dword_50C9A8 <= 0 )
8421 {
8422 dword_50C9A8 = 0;
8423 *(char *)(v219 + 20) &= 0xFu;
8424 ptr_50C9A4 = 0;
8425 }
8426 v40 = (double)GetTickCount() * 0.1;
8427 pRenderer->_4A63E6(a2c, a3c, (Texture *)(v35 != -1 ? (int)&pIcons_LOD->pTextures[v35] : 0), v39,
8428 (signed __int64)v40, 0, 255);
8429 goto LABEL_93;
8430 }
8431 v38 = pIcons_LOD;
8432 v169 = "sptext01";
8433 v39 = &pIcons_LOD->pTextures[v38->LoadTexture(v169, TEXTURE_16BIT_PALETTE)];
8434 dword_50C9A8 -= pEventTimer->uTimeElapsed;
8435 if ( dword_50C9A8 <= 0 )
8436 {
8437 dword_50C9A8 = 0;
8438 *(char *)(v219 + 20) &= 0xFu;
8439 ptr_50C9A4 = 0;
8440 }
8441 v40 = (double)GetTickCount() * 0.1;
8442 pRenderer->_4A63E6(a2c, a3c, (Texture *)(v35 != -1 ? (int)&pIcons_LOD->pTextures[v35] : 0), v39,
8443 (signed __int64)v40, 0, 255);
8444 goto LABEL_93;
8445 }
8446 v184 = 9;
8447 break;
8448 }
8449 v33 = v184;
8450 goto LABEL_74;
8451 }
8452 v33 = 5;
8453 goto LABEL_72;
8454 }
8455 if ( (*(int *)(v22 + 20) & 0xF0) != 16 )
8456 {
8457 if ( (*(int *)(v22 + 20) & 0xF0) == 32 )
8458 {
8459 v168 = "sp28a";
8460 }
8461 else
8462 {
8463 if ( (*(int *)(v22 + 20) & 0xF0) != 64 )
8464 {
8465 v26 = pIcons_LOD;
8466 if ( (*(int *)(v22 + 20) & 0xF0) == 128 )
8467 {
8468 v168 = "sp91a";
8469 a2b = &pIcons_LOD->pTextures[v26->LoadTexture(v168, TEXTURE_16BIT_PALETTE)];
8470 dword_50C9A8 -= pEventTimer->uTimeElapsed;
8471 if ( dword_50C9A8 <= 0 )
8472 {
8473 dword_50C9A8 = 0;
8474 *(char *)(v22 + 20) &= 0xFu;
8475 ptr_50C9A4 = 0;
8476 }
8477 v27 = (Texture *)(v241 != -1 ? (int)&pIcons_LOD->pTextures[v241] : 0);
8478 v28 = (double)GetTickCount() * 0.1;
8479 pRenderer->_4A63E6(v24, a3b, v27, a2b, (signed __int64)v28, 0, 255);
8480 goto LABEL_57;
8481 }
8482 v168 = "sptext01";
8483 a2b = &pIcons_LOD->pTextures[v26->LoadTexture(v168, TEXTURE_16BIT_PALETTE)];
8484 dword_50C9A8 -= pEventTimer->uTimeElapsed;
8485 if ( dword_50C9A8 <= 0 )
8486 {
8487 dword_50C9A8 = 0;
8488 *(char *)(v22 + 20) &= 0xFu;
8489 ptr_50C9A4 = 0;
8490 }
8491 v27 = (Texture *)(v241 != -1 ? (int)&pIcons_LOD->pTextures[v241] : 0);
8492 v28 = (double)GetTickCount() * 0.1;
8493 pRenderer->_4A63E6(v24, a3b, v27, a2b, (signed __int64)v28, 0, 255);
8494 goto LABEL_57;
8495 }
8496 v168 = "sp30a";
8497 }
8498 v26 = pIcons_LOD;
8499 a2b = &pIcons_LOD->pTextures[v26->LoadTexture(v168, TEXTURE_16BIT_PALETTE)];
8500 dword_50C9A8 -= pEventTimer->uTimeElapsed;
8501 if ( dword_50C9A8 <= 0 )
8502 {
8503 dword_50C9A8 = 0;
8504 *(char *)(v22 + 20) &= 0xFu;
8505 ptr_50C9A4 = 0;
8506 }
8507 v27 = (Texture *)(v241 != -1 ? (int)&pIcons_LOD->pTextures[v241] : 0);
8508 v28 = (double)GetTickCount() * 0.1;
8509 pRenderer->_4A63E6(v24, a3b, v27, a2b, (signed __int64)v28, 0, 255);
8510 goto LABEL_57;
8511 }
8512 v26 = pIcons_LOD;
8513 v168 = "sptext01";
8514 a2b = &pIcons_LOD->pTextures[v26->LoadTexture(v168, TEXTURE_16BIT_PALETTE)];
8515 dword_50C9A8 -= pEventTimer->uTimeElapsed;
8516 if ( dword_50C9A8 <= 0 )
8517 {
8518 dword_50C9A8 = 0;
8519 *(char *)(v22 + 20) &= 0xFu;
8520 ptr_50C9A4 = 0;
8521 }
8522 v27 = (Texture *)(v241 != -1 ? (int)&pIcons_LOD->pTextures[v241] : 0);
8523 v28 = (double)GetTickCount() * 0.1;
8524 pRenderer->_4A63E6(v24, a3b, v27, a2b, (signed __int64)v28, 0, 255);
8525 goto LABEL_57;;
8526 }
8527 a3 = pPaperdoll_BodyY;
8528 a2 = pPaperdoll_BodyX;
8529 v240 = 4 * uPlayerID_ - 4;
8530 pRenderer->DrawTextureTransparent(pPaperdoll_BodyX, pPaperdoll_BodyY,
8531 (Texture *)(*(unsigned int *)((char *)papredoll_dbods + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dbods + v240)] : 0));
8532 if ( !bRingsShownInCharScreen )
8533 pRenderer->_4A612A(a2, a3,
8534 (Texture *)(*(unsigned int *)((char *)papredoll_dbods + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dbods + v240)] : 0),
8535 pPlayer->pEquipment.uBody);
8536 uPlayerID_a = 2 * pBodyComplection;
8537 v6 = pPlayer->pEquipment.uMainHand;
8538 if ( !v6
8539 || (v7 = *(int *)&pPlayer->pInventoryItems[v6-1], pItemsTable->pItems[v7].uEquipType != 1)
8540 && (pItemsTable->pItems[v7].uSkillType != 4 || pPlayer->pEquipment.uOffHand) )
8541 pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_LeftHand[pBodyComplection][0], pPaperdoll_BodyY + pPaperdoll_LeftHand[pBodyComplection][1],
8542 (Texture *)(*(unsigned int *)((char *)papredoll_dlads + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dlads + v240)] : 0));
8543 v8 = pPlayer->pEquipment.uMainHand;
8544 if ( v8 )
8545 {
8546 v229 = pPlayer->pEquipment.uMainHand;
8547 v9 = (int)&pPlayer->pInventoryItems[v8-1];
8548 // v10 = pBodyComplection << 7;
8549 v218 = v9;
8550 v11 = *(int *)v9;
8551 v12 = *(int *)v9;
8552 v13 = pPaperdoll_BodyX + paperdoll_Weapon[pBodyComplection][1][0] - pItemsTable->pItems[v12].uEquipX;
8553 a2a = v13;
8554 a3a = pPaperdoll_BodyY + paperdoll_Weapon[pBodyComplection][1][1] - pItemsTable->pItems[v12].uEquipY;
8555 if ( v11 == 64 )
8556 v166 = "item64v1";
8557 else
8558 v166 = pItemsTable->pItems[v12].pIconName;
8559 v14 = pIcons_LOD->LoadTexture(v166, TEXTURE_16BIT_PALETTE);
8560 v15 = *(int *)(v218 + 20);
8561 if ( *(int *)(v218 + 20) & 0xF0 )
8562 {
8563 if ( (*(int *)(v218 + 20) & 0xF0) != 16 )
8564 {
8565 if ( (*(int *)(v218 + 20) & 0xF0) == 32 )
8566 {
8567 v167 = "sp28a";
8568 //v16 = (Texture *)(72 * pIcons_LOD->LoadTexture(v167, TEXTURE_16BIT_PALETTE) + 7145548);
8569 v16 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v167, TEXTURE_16BIT_PALETTE)];
8570 dword_50C9A8 -= pEventTimer->uTimeElapsed;
8571 if ( dword_50C9A8 <= 0 )
8572 {
8573 dword_50C9A8 = 0;
8574 *(char *)(v218 + 20) &= 0xFu;
8575 ptr_50C9A4 = 0;
8576 }
8577 v17 = (double)GetTickCount() * 0.1;
8578 pRenderer->_4A63E6(v13, a3a, (Texture *)(v14 != -1 ? (int)&pIcons_LOD->pTextures[v14] : 0), v16, (signed __int64)v17, 0, 255);
8579 goto LABEL_393;;
8580 }
8581 if ( (*(int *)(v218 + 20) & 0xF0) == 64 )
8582 {
8583 v167 = "sp30a";
8584 //v16 = (Texture *)(72 * pIcons_LOD->LoadTexture(v167, TEXTURE_16BIT_PALETTE) + 7145548);
8585 v16 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v167, TEXTURE_16BIT_PALETTE)];
8586 dword_50C9A8 -= pEventTimer->uTimeElapsed;
8587 if ( dword_50C9A8 <= 0 )
8588 {
8589 dword_50C9A8 = 0;
8590 *(char *)(v218 + 20) &= 0xFu;
8591 ptr_50C9A4 = 0;
8592 }
8593 v17 = (double)GetTickCount() * 0.1;
8594 pRenderer->_4A63E6(v13, a3a, (Texture *)(v14 != -1 ? (int)&pIcons_LOD->pTextures[v14] : 0), v16, (signed __int64)v17, 0, 255);
8595 goto LABEL_393;
8596 }
8597 if ( (*(int *)(v218 + 20) & 0xF0) == 128 )
8598 {
8599 v167 = "sp91a";
8600 //v16 = (Texture *)(72 * pIcons_LOD->LoadTexture(v167, TEXTURE_16BIT_PALETTE) + 7145548);
8601 v16 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v167, TEXTURE_16BIT_PALETTE)];
8602 dword_50C9A8 -= pEventTimer->uTimeElapsed;
8603 if ( dword_50C9A8 <= 0 )
8604 {
8605 dword_50C9A8 = 0;
8606 *(char *)(v218 + 20) &= 0xFu;
8607 ptr_50C9A4 = 0;
8608 }
8609 v17 = (double)GetTickCount() * 0.1;
8610 pRenderer->_4A63E6(v13, a3a, (Texture *)(v14 != -1 ? (int)&pIcons_LOD->pTextures[v14] : 0), v16, (signed __int64)v17, 0, 255);
8611 goto LABEL_393;
8612 }
8613 }
8614 v167 = "sptext01";
8615 //v16 = (Texture *)(72 * pIcons_LOD->LoadTexture(v167, TEXTURE_16BIT_PALETTE) + 7145548);
8616 v16 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v167, TEXTURE_16BIT_PALETTE)];
8617 dword_50C9A8 -= pEventTimer->uTimeElapsed;
8618 if ( dword_50C9A8 <= 0 )
8619 {
8620 dword_50C9A8 = 0;
8621 *(char *)(v218 + 20) &= 0xFu;
8622 ptr_50C9A4 = 0;
8623 }
8624 v17 = (double)GetTickCount() * 0.1;
8625 pRenderer->_4A63E6(v13, a3a, (Texture *)(v14 != -1 ? (int)&pIcons_LOD->pTextures[v14] : 0), v16, (signed __int64)v17, 0, 255);
8626 goto LABEL_393;
8627 }
8628 v18 = v14 + 1;
8629 v19 = (char *)&pIcons_LOD->pTextures[v14];
8630 if ( v15 & 2 )
8631 {
8632 v20 = (Texture *)(v18 != 0 ? (int)v19 : 0);
8633 pRenderer->DrawTransparentRedShade(a2a, a3a, v20);
8634 }
8635 else
8636 {
8637 if ( v15 & 1 )
8638 {
8639 v20 = (Texture *)(v18 != 0 ? (int)v19 : 0);
8640 pRenderer->DrawTextureTransparent(a2a, a3a, v20);
8641 }
8642 else
8643 {
8644 v20 = (Texture *)(v18 != 0 ? (int)v19 : 0);
8645 pRenderer->DrawTransparentGreenShade(a2a, a3a, v20);
8646 }
8647 }
8648 if ( !bRingsShownInCharScreen )
8649 pRenderer->_4A612A(a2a, a3a, v20, v229);
8650 }
8651 LABEL_393:
8652 pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_RightHand[uPlayerID_a],
8653 pPaperdoll_BodyY + pPaperdoll_RightHand[uPlayerID_a + 1],
8654 (Texture *)(*(unsigned int *)((char *)papredoll_drhs + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_drhs + v240)] : 0));
8655 v161 = pPlayer->pEquipment.uMainHand;
8656 if ( v161 )
8657 {
8658 v162 = *(int *)&pPlayer->pInventoryItems[v161-1];
8659 if ( pItemsTable->pItems[v162].uEquipType == 1 || pItemsTable->pItems[v162].uSkillType == 4 && !pPlayer->pEquipment.uOffHand )
8660 pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_SecondLeftHand[0][uPlayerID_a],
8661 pPaperdoll_BodyY + pPaperdoll_SecondLeftHand[0][uPlayerID_a + 1],
8662 (Texture *)(*(unsigned int *)((char *)papredoll_dlhus + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dlhus + v240)] : 0));
8663 }
8664 if ( !bRingsShownInCharScreen )
8665 pRenderer->DrawTextureTransparent(0x25Bu, 0x12Bu,
8666 (Texture *)(uTextureID_MAGNIF_B != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_MAGNIF_B] : 0));
8667 pRenderer->DrawTextureTransparent(0x1D4u, 0,
8668 (Texture *)(uTextureID_507B04 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507B04] : 0));
8669 }
8670
8671
8672 //----- (0043E825) --------------------------------------------------------
8673 void __fastcall CharacterUI_DrawPaperdollWithRingOverlay(unsigned int uPlayerID)
8674 {
8675 unsigned int v1; // ebx@1
8676 Player *pPlayer; // edi@1
8677 int v3; // ecx@1
8678 int *v4; // edi@3
8679 unsigned int v5; // ebx@3
8680 int v6; // eax@3
8681 LODFile_IconsBitmaps *v7; // ecx@7
8682 double v8; // st7@16
8683 int v9; // edi@17
8684 Texture *v10; // edi@18
8685 unsigned __int8 v11; // zf@19
8686 Texture *v12; // eax@19
8687 char v13; // sf@24
8688 unsigned __int8 v14; // of@24
8689 unsigned int v15; // eax@25
8690 unsigned int v16; // ebx@26
8691 int v17; // eax@26
8692 LODFile_IconsBitmaps *v18; // ecx@30
8693 double v19; // st7@39
8694 int v20; // edi@40
8695 int v21; // eax@41
8696 signed int v22; // ebx@41
8697 Texture *v23; // edi@41
8698 int v24; // eax@42
8699 char *v25; // eax@42
8700 unsigned int v26; // eax@46
8701 int v27; // edi@47
8702 unsigned int v28; // ebx@47
8703 int v29; // eax@47
8704 LODFile_IconsBitmaps *v30; // ecx@51
8705 Texture *v31; // esi@58
8706 double v32; // st7@60
8707 int v33; // esi@61
8708 int v34; // esi@62
8709 Texture *v35; // eax@63
8710 const char *v36; // [sp-8h] [bp-38h]@8
8711 const char *v37; // [sp-8h] [bp-38h]@31
8712 const char *v38; // [sp-8h] [bp-38h]@52
8713 int v39; // [sp+10h] [bp-20h]@3
8714 Texture *v40; // [sp+10h] [bp-20h]@14
8715 int v41; // [sp+10h] [bp-20h]@26
8716 Texture *v42; // [sp+10h] [bp-20h]@37
8717 int v43; // [sp+10h] [bp-20h]@47
8718 unsigned int a3; // [sp+14h] [bp-1Ch]@3
8719 unsigned int a2; // [sp+18h] [bp-18h]@3
8720 unsigned int *v46; // [sp+1Ch] [bp-14h]@1
8721 Player *v47; // [sp+20h] [bp-10h]@1
8722 int v48; // [sp+24h] [bp-Ch]@1
8723 int v49; // [sp+24h] [bp-Ch]@26
8724
8725 v1 = uPlayerID;
8726 pPlayer = pPlayers[uPlayerID];
8727 v47 = pPlayers[uPlayerID];
8728 pIcons_LOD->LoadTexture("sptext01", TEXTURE_16BIT_PALETTE);
8729 CharacterUI_DrawPaperdoll(v1);
8730 pRenderer->DrawTextureTransparent(0x1D9u, 0, (Texture *)(uTextureID_BACKHAND != -1 ? &pIcons_LOD->pTextures[uTextureID_BACKHAND] : 0));
8731 pRenderer->DrawTextureTransparent(0x1D4u, 0, (Texture *)(uTextureID_507B04 != -1 ? &pIcons_LOD->pTextures[uTextureID_507B04] : 0));
8732 pRenderer->DrawTextureIndexed(pCharacterScreen_DetalizBtn->uX, pCharacterScreen_DetalizBtn->uY,
8733 (Texture *)(uTextureID_5118C8 != -1 ? &pIcons_LOD->pTextures[uTextureID_5118C8] : 0));
8734 v3 = 0;
8735 v46 = &pPlayer->pEquipment.field_28;
8736 v48 = 0;
8737 do
8738 {
8739 if ( !*v46 )
8740 goto LABEL_24;
8741 v39 = *v46;
8742 v4 = (int *)&pPlayer->pInventoryItems[*v46-1].uItemID;
8743 a3 = pPaperdollRingsY[v3];
8744 a2 = pPaperdollRingsX[v3];
8745 v5 = pIcons_LOD->LoadTexture(pItemsTable->pItems[*v4].pIconName, TEXTURE_16BIT_PALETTE);
8746 v6 = *(int *)(v4 + 20);
8747 if ( *(int *)(v4 + 20) & 0xF0 )
8748 {
8749 if ( (*(int *)(v4 + 20) & 0xF0) != 16 )
8750 {
8751 if ( (*(int *)(v4 + 20) & 0xF0) == 32 )
8752 {
8753 v36 = "sp28a";
8754 }
8755 else
8756 {
8757 if ( (*(int *)(v4 + 20) & 0xF0) != 64 )
8758 {
8759 v7 = pIcons_LOD;
8760 if ( (*(int *)(v4 + 20) & 0xF0) == 128 )
8761 {
8762 v36 = "sp91a";
8763 LABEL_14:
8764 v40 = &pIcons_LOD->pTextures[v7->LoadTexture(v36, TEXTURE_16BIT_PALETTE)];
8765 dword_50C9A8 -= pEventTimer->uTimeElapsed;
8766 if ( dword_50C9A8 <= 0 )
8767 {
8768 dword_50C9A8 = 0;
8769 *(char *)(v4 + 20) &= 0xFu;
8770 ptr_50C9A4 = 0;
8771 }
8772 v8 = (double)GetTickCount() * 0.1;
8773 pRenderer->_4A63E6(a2, a3, (Texture *)(v5 != -1 ? (int)&pIcons_LOD->pTextures[v5] : 0),
8774 v40, (signed __int64)v8, 0, 255);
8775 goto LABEL_23;
8776 }
8777 LABEL_13:
8778 v36 = "sptext01";
8779 goto LABEL_14;
8780 }
8781 v36 = "sp30a";
8782 }
8783 v7 = pIcons_LOD;
8784 goto LABEL_14;
8785 }
8786 v7 = pIcons_LOD;
8787 goto LABEL_13;
8788 }
8789 v9 = v5 + 1;
8790 if ( v6 & 2 )
8791 {
8792 v10 = (Texture *)(v9 != 0 ? (int)&pIcons_LOD->pTextures[v5] : 0);
8793 pRenderer->DrawTransparentRedShade(a2, a3, v10);
8794 }
8795 else
8796 {
8797 v11 = (v6 & 1) == 0;
8798 v12 = &pIcons_LOD->pTextures[v5];
8799 if ( v11 )
8800 {
8801 v10 = (Texture *)(v9 != 0 ? (int)v12 : 0);
8802 pRenderer->DrawTransparentGreenShade(a2, a3, v10);
8803 }
8804 else
8805 {
8806 v10 = (Texture *)(v9 != 0 ? (int)v12 : 0);
8807 pRenderer->DrawTextureTransparent(a2, a3, v10);
8808 }
8809 }
8810 pRenderer->_4A601E(a2, a3, v10, v39);
8811 LABEL_23:
8812 pPlayer = v47;
8813 LABEL_24:
8814 v46 += 4;
8815 v3 = v48 + 4;
8816 v14 = __OFSUB__(v48 + 4, 20);
8817 v11 = v48 == 16;
8818 v13 = v48 - 16 < 0;
8819 v48 += 4;
8820 }
8821 while ( (unsigned __int8)(v13 ^ v14) | v11 );
8822 v15 = pPlayer->pEquipment.field_24;
8823 if ( !v15 )
8824 goto LABEL_46;
8825 v41 = pPlayer->pEquipment.field_24;
8826 v49 = (int)&pPlayer->pInventoryItems[v15-1];
8827 v16 = pIcons_LOD->LoadTexture(pItemsTable->pItems[*(int *)v49].pIconName, TEXTURE_16BIT_PALETTE);
8828 v17 = *(int *)(v49 + 20);
8829 if ( !(*(int *)(v49 + 20) & 0xF0) )
8830 {
8831 v20 = v16 + 1;
8832 if ( v17 & 2 )
8833 {
8834 v21 = 9 * v16;
8835 v22 = 493;
8836 v23 = (Texture *)(v20 != 0 ? (int)&pIcons_LOD->pTextures[8 * v21 / 0x48u] : 0);
8837 pRenderer->DrawTransparentRedShade(0x1EDu, 0x5Bu, v23);
8838 }
8839 else
8840 {
8841 v11 = (v17 & 1) == 0;
8842 v24 = 9 * v16;
8843 v22 = 493;
8844 v25 = (char *)&pIcons_LOD->pTextures[8 * v24 / 0x48u];
8845 if ( v11 )
8846 {
8847 v23 = (Texture *)(v20 != 0 ? (int)v25 : 0);
8848 pRenderer->DrawTransparentGreenShade(493, 91, v23);
8849 }
8850 else
8851 {
8852 v23 = (Texture *)(v20 != 0 ? (int)v25 : 0);
8853 pRenderer->DrawTextureTransparent(0x1EDu, 0x5Bu, v23);
8854 }
8855 }
8856 pRenderer->_4A601E(v22, 91, v23, v41);
8857 pPlayer = v47;
8858 goto LABEL_46;
8859 }
8860 if ( (*(int *)(v49 + 20) & 0xF0) == 16 )
8861 {
8862 v18 = pIcons_LOD;
8863 goto LABEL_36;
8864 }
8865 if ( (*(int *)(v49 + 20) & 0xF0) == 32 )
8866 {
8867 v37 = "sp28a";
8868 goto LABEL_34;
8869 }
8870 if ( (*(int *)(v49 + 20) & 0xF0) == 64 )
8871 {
8872 v37 = "sp30a";
8873 LABEL_34:
8874 v18 = pIcons_LOD;
8875 goto LABEL_37;
8876 }
8877 v18 = pIcons_LOD;
8878 if ( (*(int *)(v49 + 20) & 0xF0) == 128 )
8879 {
8880 v37 = "sp91a";
8881 goto LABEL_37;
8882 }
8883 LABEL_36:
8884 v37 = "sptext01";
8885 LABEL_37:
8886 v42 = &pIcons_LOD->pTextures[v18->LoadTexture(v37, TEXTURE_16BIT_PALETTE)];
8887 dword_50C9A8 -= pEventTimer->uTimeElapsed;
8888 if ( dword_50C9A8 <= 0 )
8889 {
8890 dword_50C9A8 = 0;
8891 *(char *)(v49 + 20) &= 0xFu;
8892 ptr_50C9A4 = 0;
8893 }
8894 v19 = (double)GetTickCount() * 0.1;
8895 pRenderer->_4A63E6(
8896 0x1EDu,
8897 0x5Bu,
8898 (Texture *)(v16 != -1 ? (int)&pIcons_LOD->pTextures[v16] : 0),
8899 v42,
8900 (signed __int64)v19,
8901 0,
8902 255);
8903 LABEL_46:
8904 v26 = pPlayer->pEquipment.field_1C;
8905 if ( !v26 )
8906 return;
8907 v43 = pPlayer->pEquipment.field_1C;
8908 v27 = (int)&pPlayer->pInventoryItems[v26-1];
8909 v28 = pIcons_LOD->LoadTexture(pItemsTable->pItems[*(int *)v27].pIconName, TEXTURE_16BIT_PALETTE);
8910 v29 = *(int *)(v27 + 20);
8911 if ( !(*(int *)(v27 + 20) & 0xF0) )
8912 {
8913 v33 = v28 + 1;
8914 if ( v29 & 2 )
8915 {
8916 v34 = v33 != 0 ? (int)&pIcons_LOD->pTextures[v28] : 0;
8917 pRenderer->DrawTransparentRedShade(0x24Au, 0x58u, (Texture *)v34);
8918 }
8919 else
8920 {
8921 v11 = (v29 & 1) == 0;
8922 v35 = &pIcons_LOD->pTextures[v28];
8923 if ( v11 )
8924 {
8925 v34 = v33 != 0 ? (int)v35 : 0;
8926 pRenderer->DrawTransparentGreenShade(586, 88, (Texture *)v34);
8927 }
8928 else
8929 {
8930 v34 = v33 != 0 ? (int)v35 : 0;
8931 pRenderer->DrawTextureTransparent(0x24Au, 0x58u, (Texture *)v34);
8932 }
8933 }
8934 pRenderer->_4A601E(586, 88, (Texture *)v34, v43);
8935 return;
8936 }
8937 if ( (*(int *)(v27 + 20) & 0xF0) == 16 )
8938 {
8939 v30 = pIcons_LOD;
8940 goto LABEL_57;
8941 }
8942 if ( (*(int *)(v27 + 20) & 0xF0) == 32 )
8943 {
8944 v38 = "sp28a";
8945 goto LABEL_55;
8946 }
8947 if ( (*(int *)(v27 + 20) & 0xF0) == 64 )
8948 {
8949 v38 = "sp30a";
8950 LABEL_55:
8951 v30 = pIcons_LOD;
8952 goto LABEL_58;
8953 }
8954 v30 = pIcons_LOD;
8955 if ( (*(int *)(v27 + 20) & 0xF0) == 128 )
8956 {
8957 v38 = "sp91a";
8958 goto LABEL_58;
8959 }
8960 LABEL_57:
8961 v38 = "sptext01";
8962 LABEL_58:
8963 v31 = &pIcons_LOD->pTextures[v30->LoadTexture(v38, TEXTURE_16BIT_PALETTE)];
8964 dword_50C9A8 -= pEventTimer->uTimeElapsed;
8965 if ( dword_50C9A8 <= 0 )
8966 {
8967 dword_50C9A8 = 0;
8968 *(char *)(v27 + 20) &= 0xFu;
8969 ptr_50C9A4 = 0;
8970 }
8971 v32 = (double)GetTickCount() * 0.1;
8972 pRenderer->_4A63E6(0x24Au, 0x58u, (Texture *)(v28 != -1 ? (int)&pIcons_LOD->pTextures[v28] : 0),
8973 v31, (signed __int64)v32, 0, 255);
8974 }
8975 6431
8976 //----- (0043ED6F) -------------------------------------------------------- 6432 //----- (0043ED6F) --------------------------------------------------------
8977 bool _43ED6F_check_party_races(bool a1) 6433 bool _43ED6F_check_party_races(bool a1)
8978 { 6434 {
8979 bool v6; // zf@5 6435 bool v6; // zf@5
12815 aMoonPhaseNames[2] = pGlobalTXT_LocalizationStrings[102]; 10271 aMoonPhaseNames[2] = pGlobalTXT_LocalizationStrings[102];
12816 aMoonPhaseNames[3] = pGlobalTXT_LocalizationStrings[169]; 10272 aMoonPhaseNames[3] = pGlobalTXT_LocalizationStrings[169];
12817 aMoonPhaseNames[4] = pGlobalTXT_LocalizationStrings[92]; 10273 aMoonPhaseNames[4] = pGlobalTXT_LocalizationStrings[92];
12818 } 10274 }
12819 10275
12820 //----- (00410B28) --------------------------------------------------------
12821 void __thiscall DrawSpellDescriptionPopup(int spell_index)
12822 {
12823 Player *v1; // edi@1
12824 SpellInfo *v2; // esi@1
12825 unsigned int v3; // eax@2
12826 int v4; // eax@4
12827 LONG v5; // ecx@4
12828 int v6; // eax@10
12829 char *v7; // ST44_4@12
12830 unsigned __int16 v8; // ax@12
12831 GUIWindow a1; // [sp+Ch] [bp-68h]@4
12832 int v10; // [sp+60h] [bp-14h]@1
12833 POINT a2; // [sp+64h] [bp-10h]@1
12834 int v12; // [sp+6Ch] [bp-8h]@4
12835 int v13; // [sp+70h] [bp-4h]@4
12836
12837 v1 = pPlayers[uActiveCharacter];
12838 v10 = spell_index;
12839 v2 = &pSpellStats->pInfos[spell_index + 11 * v1->lastOpenedSpellbookPage + 1];
12840 if ( pMouse->GetCursorPos(&a2)->y <= 250 )
12841 v3 = pMouse->GetCursorPos(&a2)->y + 30;
12842 else
12843 v3 = 30;
12844 a1.uFrameY = v3;
12845 a1.uFrameWidth = 328;
12846 a1.uFrameHeight = 68;
12847 a1.uFrameX = 90;
12848 a1.uFrameZ = 417;
12849 a1.uFrameW = v3 + 67;
12850 a1.Hint = 0;
12851 a2.y = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_NORMAL]);
12852 v13 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_MASTER]);
12853 v12 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_EXPERT]);
12854 v4 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_GRAND]);
12855 v5 = a2.y;
12856 if ( v13 > a2.y )
12857 v5 = v13;
12858 if ( v12 > v5 )
12859 v5 = v12;
12860 if ( v4 > v5 )
12861 v5 = v4;
12862 sprintf( pTmpBuf2,
12863 "%s\n\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s",
12864 v2->pDescription,
12865 pGlobalTXT_LocalizationStrings[LOCSTR_NORMAL],
12866 v5 + 3, v5 + 10,
12867 v2->pBasicSkillDesc,
12868 pGlobalTXT_LocalizationStrings[LOCSTR_EXPERT],
12869 v5 + 3, v5 + 10,
12870 v2->pExpertSkillDesc,
12871 pGlobalTXT_LocalizationStrings[LOCSTR_MASTER],
12872 v5 + 3, v5 + 10,
12873 v2->pMasterSkillDesc,
12874 pGlobalTXT_LocalizationStrings[LOCSTR_GRAND],
12875 v5 + 3, v5 + 10,
12876 v2->pGrandmasterSkillDesc);
12877 v6 = pFontSmallnum->CalcTextHeight(pTmpBuf2, &a1, 0, 0);
12878 a1.uFrameHeight += v6;
12879 if ( (signed int)a1.uFrameHeight < 150 )
12880 a1.uFrameHeight = 150;
12881 a1.uFrameWidth = 460;
12882 a1.DrawMessageBox(0);
12883 a1.uFrameWidth -= 12;
12884 a1.uFrameHeight -= 12;
12885 v7 = v2->pName;
12886 a1.uFrameZ = a1.uFrameX + a1.uFrameWidth - 1;
12887 a1.uFrameW = a1.uFrameHeight + a1.uFrameY - 1;
12888 v8 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
12889 a1.DrawTitleText(pFontArrus, 0x78u, 0xCu, v8, v7, 3u);
12890 a1.DrawText(pFontSmallnum, 120, 44, 0, pTmpBuf2, 0, 0, 0);
12891 a1.uFrameWidth = 108;
12892 a1.uFrameZ = a1.uFrameX + 107;
12893 a1.DrawTitleText(pFontComic, 0xCu, 0x4Bu, 0, pSkillNames[v1->lastOpenedSpellbookPage + 12], 3u);
12894 sprintf( pTmpBuf, "%s\n%d", pGlobalTXT_LocalizationStrings[LOCSTR_SP_COST],
12895 pSpellDatas[spell_index + 11 * v1->lastOpenedSpellbookPage + 1].mana_per_skill[v1->pActiveSkills[v1->lastOpenedSpellbookPage + PLAYER_SKILL_FIRE]]);
12896 // *(&[0].field_12 //temp_fix field_14
12897 // + ((unsigned int)LOBYTE(v1->pActiveSkills[v1->lastOpenedSpellbookPage + 12]) >> 6)
12898 // + 10 * (int)((char *)v10 + 11 * v1->lastOpenedSpellbookPage)));
12899 a1.DrawTitleText(pFontComic, 0xCu, a1.uFrameHeight - LOBYTE(pFontComic->uFontHeight) - 16, 0, pTmpBuf, 3u);
12900 dword_507B00_spell_info_to_draw_in_popup = 0;
12901 }
12902 // 507B00: using guessed type int dword_507B00_spell_info_to_draw_in_popup;
12903 10276
12904 //----- (00410D99) -------------------------------------------------------- 10277 //----- (00410D99) --------------------------------------------------------
12905 signed int __fastcall sub_410D99_get_map_index(int a1) 10278 signed int __fastcall sub_410D99_get_map_index(int a1)
12906 { 10279 {
12907 int v1; // edi@1 10280 int v1; // edi@1
13219 pRenderer->DrawTextureIndexed(word_4E1D3A[v3], pTownPortalBook_xs[v3 + 5], *(&pTex_tab_an_6b__zoom_on + v3)); 10592 pRenderer->DrawTextureIndexed(word_4E1D3A[v3], pTownPortalBook_xs[v3 + 5], *(&pTex_tab_an_6b__zoom_on + v3));
13220 return v6.DrawTitleText(pBook2Font, 0, 22u, 0, pGlobalTXT_LocalizationStrings[10], 3u); 10593 return v6.DrawTitleText(pBook2Font, 0, 22u, 0, pGlobalTXT_LocalizationStrings[10], 3u);
13221 } 10594 }
13222 // 4E1D3A: using guessed type __int16 word_4E1D3A[]; 10595 // 4E1D3A: using guessed type __int16 word_4E1D3A[];
13223 10596
13224 //----- (00411300) --------------------------------------------------------
13225 void LoadSpellbook(unsigned int spell_school)
13226 {
13227 //unsigned int v1; // esi@1
13228 Player *pPlayer; // ecx@1
13229 char v3; // al@1
13230 //int v4; // edi@5
13231 //Texture *result; // eax@6
13232 //unsigned char *v6; // edi@7
13233 //unsigned int v7; // eax@7
13234 //unsigned __int8 v8; // sf@8
13235 //unsigned __int8 v9; // of@8
13236 char pContainer[20]; // [sp+Ch] [bp-1Ch]@7
13237 //Texture *v11; // [sp+20h] [bp-8h]@5
13238 //int v12; // [sp+24h] [bp-4h]@5
13239
13240 byte_506550 = 0;
13241 //v1 = uID;
13242 pPlayer = pPlayers[uActiveCharacter];
13243 v3 = pPlayer->uQuickSpell;
13244 if ( v3 && (unsigned __int8)v3 / 11 == spell_school )
13245 quick_spell_at_page = (unsigned __int8)v3 - 11 * spell_school;
13246 else
13247 quick_spell_at_page = 0;
13248
13249 for (uint i = 1; i < 12; ++i)
13250 {
13251 if (pPlayer->spellbook.pChapters[spell_school].bIsSpellAvailable[i - 1])
13252 {
13253 sprintf(pContainer, "SB%sS%02d", spellbook_texture_filename_suffices[spell_school], pSpellbookSpellIndices[spell_school][i]);
13254 dword_506408[i] = pIcons_LOD->LoadTexturePtr(pContainer, TEXTURE_16BIT_PALETTE);
13255
13256 sprintf(pContainer, "SB%sC%02d", spellbook_texture_filename_suffices[spell_school], pSpellbookSpellIndices[spell_school][i]);
13257 dword_5063D8[i] = pIcons_LOD->LoadTexturePtr(pContainer, TEXTURE_16BIT_PALETTE);
13258 }
13259 }
13260 }
13261
13262 //----- (0041140B) --------------------------------------------------------
13263 GUIWindow *__cdecl sub_41140B()
13264 {
13265 signed int v0; // esi@1
13266 GUIButton *v1; // eax@3
13267 GUIButton *v2; // esi@4
13268 GUIWindow *result; // eax@5
13269
13270 v0 = 0;
13271 do
13272 {
13273 dword_5063D8[11+v0]->Release();
13274 dword_506408[11+v0]->Release();
13275 --v0;
13276 }
13277 while ( v0 >= -11 );
13278 pIcons_LOD->_40F9C5();
13279 v1 = pGUIWindow_CurrentMenu->pControlsHead;
13280 if ( v1 )
13281 {
13282 do
13283 {
13284 v2 = v1->pNext;
13285 pAllocator->FreeChunk(v1);
13286 v1 = v2;
13287 }
13288 while ( v2 );
13289 }
13290 pGUIWindow_CurrentMenu->pControlsHead = 0;
13291 pGUIWindow_CurrentMenu->pControlsTail = 0;
13292 result = pGUIWindow_CurrentMenu;
13293 pGUIWindow_CurrentMenu->uNumControls = 0;
13294 return result;
13295 }
13296
13297 //----- (00411473) --------------------------------------------------------
13298 void __cdecl sub_411473()
13299 {
13300 pTexture_pagemask->Release();
13301 pTexture_506448->Release();
13302 pTexture_50643C->Release();
13303 for (uint i = 0; i < 8; ++i)
13304 {
13305 pSpellBookPagesTextr[i]->Release();
13306 pTextures_tabs[i][0]->Release();
13307 pTextures_tabs[i][1]->Release();
13308 }
13309 pAudioPlayer->PlaySound((SoundID)231, 0, 0, -1, 0, 0, 0, 0);
13310 pIcons_LOD->_4114F2();
13311 }
13312
13313
13314 //----- (00411597) --------------------------------------------------------
13315 void __cdecl OnCloseSpellook()
13316 {
13317 pAllocator->FreeChunk(pSpellFont);
13318 pSpellFont = 0;
13319 pAllocator->FreeChunk(pBookFont);
13320 pBookFont = 0;
13321 pAllocator->FreeChunk(pBook2Font);
13322 pBook2Font = 0;
13323 pAllocator->FreeChunk(pAutonoteFont);
13324 pAutonoteFont = 0;
13325 pTexture_mapbordr->Release();
13326 pAudioPlayer->PlaySound((SoundID)231, 0, 0, -1, 0, 0, 0, 0);
13327 pIcons_LOD->_4114F2();
13328 dword_506364 = 0;
13329 }
13330 // 506364: using guessed type int dword_506364;
13331
13332
13333
13334
13335
13336
13337
13338 //----- (00412AF9) --------------------------------------------------------
13339 void sub_412AF9()
13340 {
13341 int v0; // ecx@1
13342
13343 v0 = 0;
13344 if ( uActiveCharacter )
13345 v0 = pParty->pPlayers[uActiveCharacter-1].lastOpenedSpellbookPage;//*((char *)&pParty->pPartyBuffs[5].uExpireTime + 6972 * uActiveCharacter + 2);
13346 pRenderer->DrawTextureIndexed(8u, 8u, pSpellBookPagesTextr[v0]);
13347 pRenderer->DrawTextureIndexed(0x1DCu, 0x1C2u, pTexture_50643C);
13348 pRenderer->DrawTextureIndexed(0x231u, 0x1C2u, pTexture_506448);
13349 }
13350
13351 //----- (00412B58) --------------------------------------------------------
13352 void __cdecl DrawSpellBookContent()
13353 {
13354 Player *v0; // ebx@1
13355 int v1; // ebp@1
13356 unsigned int v2; // eax@1
13357 Texture *v3; // edi@1
13358 int v4; // esi@1
13359 Texture *v5; // eax@3
13360 Texture *v6; // edx@5
13361 int v7; // eax@8
13362 int v8; // eax@11
13363 POINT *v9; // esi@13
13364 int v10; // eax@13
13365 Texture *v11; // edx@14
13366 int v12; // eax@15
13367 signed int v13; // ecx@18
13368 unsigned int v14; // esi@18
13369 unsigned int v15; // edi@18
13370 Texture *pPageTexture; // eax@21
13371 unsigned int v17; // [sp-Ch] [bp-2Ch]@8
13372 unsigned int v18; // [sp-Ch] [bp-2Ch]@15
13373 unsigned int v19; // [sp-8h] [bp-28h]@8
13374 unsigned int v20; // [sp-8h] [bp-28h]@15
13375 Texture *v21; // [sp-4h] [bp-24h]@15
13376 signed int v22; // [sp-4h] [bp-24h]@22
13377 Texture *v23; // [sp+10h] [bp-10h]@5
13378 POINT a2; // [sp+18h] [bp-8h]@13
13379 POINT v24;
13380 int v25;
13381
13382 sub_412AF9();
13383 v0 = pPlayers[uActiveCharacter];
13384 v1 = 11 * v0->lastOpenedSpellbookPage;
13385 v2 = pIcons_LOD->FindTextureByName("Pending");
13386 v3 = (Texture *)(v2 != -1 ? (int)&pIcons_LOD->pTextures[v2] : 0);
13387 pRenderer->ClearZBuffer(0, 479);
13388 v4 = 1;
13389 if ( __OFSUB__(v1, v1 + 11) ^ 1 )
13390 {
13391 do
13392 {
13393 if ( *(&v0->_guilds_member_bits[v1 + 63] + v4) )
13394 {
13395 v5 = (Texture *)dword_506408[v4];
13396 if ( v5 != v3 )
13397 {
13398 if ( quick_spell_at_page == v4 )
13399 {
13400 v6 = dword_5063D8[v4];
13401 v23 = dword_5063D8[v4];
13402 }
13403 else
13404 {
13405 v23 = dword_506408[v4];
13406 v6 = v5;
13407 }
13408 if ( v6->pLevelOfDetail0 )
13409 {
13410 v7 = v0->lastOpenedSpellbookPage;
13411 // v7 = (12 * v0->lastOpenedSpellbookPage + pSpellbookSpellIndices[v0->lastOpenedSpellbookPage][v4]);
13412 v19 = pViewport->uViewportTL_Y + pIconPos[v7][pSpellbookSpellIndices[v7][v4]].Ypos;
13413 v17 = pViewport->uViewportTL_X + pIconPos[v7][pSpellbookSpellIndices[v7][v4]].Xpos;
13414 if ( BYTE1(v6->pBits) & 2 )
13415 pRenderer->DrawTextureTransparent(v17, v19, v6);
13416 else
13417 pRenderer->DrawTextureIndexed(v17, v19, v6);
13418 pRenderer->_4A612A(pIconPos[v7][pSpellbookSpellIndices[v7][v4]].Xpos,
13419 pIconPos[v7][pSpellbookSpellIndices[v7][v4]].Ypos, v23, v4);
13420 }
13421 }
13422 }
13423 ++v4;
13424 }
13425 while ( v4 + v1 - 1 < v1 + 11 );
13426 }
13427 v9 = pMouse->GetCursorPos(&a2);
13428 v10 = pRenderer->pActiveZBuffer[v9->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v24)->y]] & 0xFFFF;
13429 if ( v10 )
13430 {
13431 v11 = dword_5063D8[v10];
13432 if ( v11->pLevelOfDetail0 )
13433 {
13434 v21 = dword_5063D8[v10];
13435 v12 = v0->lastOpenedSpellbookPage;
13436 // v12 = (12 * v0->lastOpenedSpellbookPage + pSpellbookSpellIndices[v0->lastOpenedSpellbookPage][v10]);
13437 v20 = pViewport->uViewportTL_Y + pIconPos[v12][pSpellbookSpellIndices[v12][v10]].Ypos;
13438 v18 = pViewport->uViewportTL_X + pIconPos[v12][pSpellbookSpellIndices[v12][v10]].Xpos;
13439 if ( BYTE1(v11->pBits) & 2 )
13440 pRenderer->DrawTextureTransparent(v18, v20, v21);
13441 else
13442 pRenderer->DrawTextureIndexed(v18, v20, v21);
13443 }
13444 }
13445 v13 = 0;
13446 a2.x = (LONG)&v0->pActiveSkills[12];
13447 v14 = (unsigned int)&v0->pActiveSkills[12];
13448 v15 = (unsigned int)&v0->pActiveSkills[12];
13449 v25 = 0;
13450 do
13451 {
13452 if ( *(short *)a2.x )
13453 {
13454 if ( v0->lastOpenedSpellbookPage == v13 )
13455 {
13456 pPageTexture = pTextures_tabs[v13][1];
13457 switch ( v13 )
13458 {
13459 case 0:
13460 v14 = 406;
13461 v22 = 9;
13462 goto LABEL_27;
13463 case 1:
13464 v14 = 406;
13465 goto LABEL_38;
13466 case 2:
13467 v14 = 406;
13468 v22 = 84;
13469 goto LABEL_27;
13470 case 3:
13471 v14 = 406;
13472 goto LABEL_26;
13473 case 4:
13474 v14 = 407;
13475 goto LABEL_29;
13476 case 5:
13477 v15 = 196;
13478 goto LABEL_34;
13479 case 6:
13480 v15 = 234;
13481 goto LABEL_34;
13482 case 7:
13483 v15 = 272;
13484 goto LABEL_34;
13485 case 8:
13486 v15 = 309;
13487 LABEL_34:
13488 v14 = 405;
13489 break;
13490 default:
13491 break;
13492 }
13493 }
13494 else
13495 {
13496 pPageTexture = pTextures_tabs[v13][0];
13497 switch ( v13 )
13498 {
13499 case 0:
13500 v14 = 415;
13501 v22 = 10;
13502 goto LABEL_27;
13503 case 1:
13504 v14 = 415;
13505 LABEL_38:
13506 v22 = 46;
13507 goto LABEL_27;
13508 case 2:
13509 v14 = 415;
13510 v22 = 83;
13511 goto LABEL_27;
13512 case 3:
13513 v14 = 415;
13514 LABEL_26:
13515 v22 = 121;
13516 LABEL_27:
13517 v15 = v22;
13518 break;
13519 case 4:
13520 v14 = 415;
13521 LABEL_29:
13522 v15 = 158;
13523 break;
13524 case 5:
13525 v15 = 196;
13526 goto LABEL_46;
13527 case 6:
13528 v15 = 234;
13529 goto LABEL_46;
13530 case 7:
13531 v15 = 271;
13532 goto LABEL_46;
13533 case 8:
13534 v15 = 307;
13535 LABEL_46:
13536 v14 = 416;
13537 break;
13538 default:
13539 break;
13540 }
13541 }
13542 pRenderer->DrawTextureTransparent(v14, v15, pPageTexture);
13543 v13 = v25;
13544 }
13545 a2.x += 2;
13546 ++v13;
13547 v25 = v13;
13548 }
13549 while ( v13 < 9 );
13550 }
13551 // 506408: using guessed type int dword_506408[];
13552 // 50654C: using guessed type int dword_50654C;
13553
13554 //----- (00412E85) --------------------------------------------------------
13555 char __cdecl DrawBook_History()
13556 {
13557 unsigned int v0; // eax@3
13558 unsigned int v1; // eax@7
13559 int v2; // eax@10
13560 const char *v3; // eax@10
13561 signed int v4; // ecx@12
13562 int v5; // ecx@14
13563 int v6; // eax@21
13564 int v7; // esi@21
13565 char *v8; // eax@21
13566 int v9; // eax@22
13567 unsigned int v11; // [sp-8h] [bp-64h]@3
13568 unsigned int v12; // [sp-8h] [bp-64h]@7
13569 Texture *v13; // [sp-4h] [bp-60h]@3
13570 Texture *v14; // [sp-4h] [bp-60h]@7
13571 GUIWindow a1; // [sp+8h] [bp-54h]@10
13572
13573 pRenderer->DrawTextureIndexed(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pSpellBookPagesTextr_11);
13574 if ( dword_506548 || !dword_506528 )
13575 {
13576 v13 = pTex_tab_an_6a__zoom_off;
13577 v11 = pViewport->uViewportTL_Y + 2;
13578 v0 = pViewport->uViewportTL_X + 407;
13579 }
13580 else
13581 {
13582 v13 = pTex_tab_an_6b__zoom_on;
13583 v11 = pViewport->uViewportTL_Y + 1;
13584 v0 = pViewport->uViewportTL_X + 398;
13585 }
13586 pRenderer->DrawTextureTransparent(v0, v11, v13);
13587 if ( dword_506544 || dword_506528 + awards_count >= awards_count2 )
13588 {
13589 v14 = pTex_tab_an_7a__zoot_off;
13590 v12 = pViewport->uViewportTL_Y + 38;
13591 v1 = pViewport->uViewportTL_X + 407;
13592 }
13593 else
13594 {
13595 v14 = pTex_tab_an_7b__zoot_on;
13596 v12 = pViewport->uViewportTL_Y + 38;
13597 v1 = pViewport->uViewportTL_X + 398;
13598 }
13599 pRenderer->DrawTextureTransparent(v1, v12, v14);
13600 if ( !byte_5C6D50[dword_506528] )
13601 {
13602 v2 = achievedAwardsIndex[dword_506528];
13603 a1.uFrameWidth = 460;
13604 a1.uFrameX = 8;
13605 a1.uFrameY = 8;
13606 a1.uFrameHeight = 344;
13607 v3 = (const char *)pStorylineText->StoreLine[v2].pPageTitle;//field_4[];
13608 a1.uFrameZ = 467;
13609 a1.uFrameW = 351;
13610 if ( v3 )
13611 a1.DrawTitleText(pBook2Font, 0, 0x16u, 0, v3, 3u);
13612 }
13613 a1.uFrameX = 48;
13614 a1.uFrameY = 70;
13615 a1.uFrameWidth = 360;
13616 a1.uFrameHeight = 264;
13617 v4 = LOBYTE(pAutonoteFont->uFontHeight) - 3;
13618 a1.uFrameZ = 407;
13619 a1.uFrameHeight = v4 * 264 / v4;
13620 a1.uFrameW = a1.uFrameHeight + 69;
13621 if ( dword_506544 && dword_506528 + awards_count < awards_count2 )
13622 {
13623 pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0);
13624 v5 = dword_50651C++;
13625 dword_506528 += awards_count;
13626 byte_506130[v5] = awards_count;
13627 }
13628 if ( dword_506548 && dword_50651C )
13629 {
13630 pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0);
13631 --dword_50651C;
13632 dword_506528 -= (unsigned __int8)byte_506130[dword_50651C];
13633 }
13634 if ( !awards_count || dword_506528 < 1 )
13635 {
13636 dword_506528 = 0;
13637 dword_50651C = 0;
13638 }
13639 dword_506544 = 0;
13640 v6 = achievedAwardsIndex[dword_506528];
13641 dword_506548 = 0;
13642 awards_count = 0;
13643 //v7 = *pStorylineText->StoreLine[v6].pText;//*(&pStorylineText->field_0 + 3 * v6);
13644 v7 = (int)pStorylineText->StoreLine[v6].pText;//*(&pStorylineText->field_0 + 3 * v6);
13645 v8 = BuilDialogueString(
13646 pStorylineText->StoreLine[v6].pText,
13647 uActiveCharacter - 1,
13648 0,
13649 0,
13650 0,
13651 (__int64 *)&pParty->field_3C._s_times[ v6 + 21]);
13652 if ( v7 )
13653 {
13654 v9 = pAutonoteFont->_44C6C2(v8, &a1, 1u, (unsigned __int8)byte_5C6D50[dword_506528]);
13655 LOBYTE(v8) = a1.DrawText(pAutonoteFont, 1, 0, 0, (const char *)v9, 0, a1.uFrameY + a1.uFrameHeight, 0);
13656 ++awards_count;
13657 }
13658 return (char)v8;
13659 }
13660
13661
13662 //----- (00413126) --------------------------------------------------------
13663 void __cdecl DrawBook_Quests()
13664 {
13665 unsigned int v0; // eax@3
13666 unsigned int v1; // eax@7
13667 int v2; // ecx@11
13668 int v3; // ebx@16
13669 int v4; // eax@19
13670 const char *v5; // edi@19
13671 int v6; // eax@19
13672 unsigned int v7; // edi@19
13673 unsigned int v8; // [sp-8h] [bp-68h]@3
13674 unsigned int v9; // [sp-8h] [bp-68h]@7
13675 Texture *v10; // [sp-4h] [bp-64h]@3
13676 Texture *v11; // [sp-4h] [bp-64h]@7
13677 GUIWindow a1; // [sp+Ch] [bp-54h]@9
13678
13679 pRenderer->DrawTextureIndexed(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pTexture_CurrentBook);
13680 if ( dword_506548 || !dword_506528 )
13681 {
13682 v10 = pTex_tab_an_6a__zoom_off;
13683 v8 = pViewport->uViewportTL_Y + 2;
13684 v0 = pViewport->uViewportTL_X + 407;
13685 }
13686 else
13687 {
13688 v10 = pTex_tab_an_6b__zoom_on;
13689 v8 = pViewport->uViewportTL_Y + 1;
13690 v0 = pViewport->uViewportTL_X + 398;
13691 }
13692 pRenderer->DrawTextureTransparent(v0, v8, v10);
13693 if ( dword_506544 || dword_506528 + awards_count >= awards_count2 )
13694 {
13695 v11 = pTex_tab_an_7a__zoot_off;
13696 v9 = pViewport->uViewportTL_Y + 38;
13697 v1 = pViewport->uViewportTL_X + 407;
13698 }
13699 else
13700 {
13701 v11 = pTex_tab_an_7b__zoot_on;
13702 v9 = pViewport->uViewportTL_Y + 38;
13703 v1 = pViewport->uViewportTL_X + 398;
13704 }
13705 pRenderer->DrawTextureTransparent(v1, v9, v11);
13706 a1.uFrameWidth = 460;
13707 a1.uFrameHeight = 344;
13708 a1.uFrameX = 8;
13709 a1.uFrameY = 8;
13710 a1.uFrameZ = 467;
13711 a1.uFrameW = 351;
13712 a1.DrawTitleText(pBook2Font, 0, 0x16u, 0, pGlobalTXT_LocalizationStrings[174], 3u);
13713 a1.uFrameX = 48;
13714 a1.uFrameY = 70;
13715 a1.uFrameWidth = 360;
13716 a1.uFrameHeight = 264;
13717 a1.uFrameZ = 407;
13718 a1.uFrameW = 333;
13719 if ( dword_506544 && dword_506528 + awards_count < awards_count2 )
13720 {
13721 pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0);
13722 v2 = dword_50651C++;
13723 dword_506528 += awards_count;
13724 byte_506130[v2] = awards_count;
13725 }
13726 if ( dword_506548 && dword_50651C )
13727 {
13728 pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0);
13729 --dword_50651C;
13730 dword_506528 -= (unsigned __int8)byte_506130[dword_50651C];
13731 }
13732 if ( !awards_count || (v3 = dword_506528, dword_506528 < 1) )
13733 {
13734 v3 = 0;
13735 dword_50651C = 0;
13736 dword_506528 = 0;
13737 }
13738 dword_506544 = 0;
13739 dword_506548 = 0;
13740 awards_count = 0;
13741 while ( v3 < awards_count2 )
13742 {
13743 v4 = achievedAwardsIndex[v3];
13744 ++awards_count;
13745 v5 = pQuestTable[v4-1];//(&dword_722F10)[4 * v4];
13746 a1.DrawText(pAutonoteFont, 1, 0, 0, pQuestTable[v4-1], 0, 0, 0);//(&dword_722F10)[4 * v4], 0, 0, 0);
13747 v6 = pAutonoteFont->CalcTextHeight(v5, &a1, 1, 0);
13748 v7 = a1.uFrameY + v6;
13749 if ( (signed int)(a1.uFrameY + v6) > (signed int)a1.uFrameHeight )
13750 break;
13751 pRenderer->DrawTextureTransparent(100, v7 + 12, pSpellBookPagesTextr_10);
13752 ++v3;
13753 a1.uFrameY = v7 + 24;
13754 }
13755 }
13756
13757
13758 //----- (0041338E) --------------------------------------------------------
13759 void __cdecl DrawBook_Autonotes()
13760 {
13761 unsigned int v0; // eax@3
13762 unsigned int v1; // eax@7
13763 signed int v2; // ebp@11
13764 unsigned int v3; // eax@18
13765 unsigned int v4; // eax@24
13766 unsigned int v5; // eax@30
13767 unsigned int v6; // eax@36
13768 unsigned int v7; // eax@42
13769 signed int v8; // ebp@47
13770 int v9; // eax@52
13771 int v10; // eax@56
13772 int v11; // edx@57
13773 int v12; // ebp@64
13774 int v13; // eax@65
13775 const char *v14; // edi@65
13776 int v15; // eax@65
13777 unsigned int v16; // edi@65
13778 unsigned int v17; // [sp-8h] [bp-70h]@3
13779 unsigned int v18; // [sp-8h] [bp-70h]@7
13780 unsigned int v19; // [sp-8h] [bp-70h]@18
13781 unsigned int v20; // [sp-8h] [bp-70h]@24
13782 unsigned int v21; // [sp-8h] [bp-70h]@30
13783 unsigned int v22; // [sp-8h] [bp-70h]@36
13784 unsigned int v23; // [sp-8h] [bp-70h]@42
13785 Texture *v24; // [sp-4h] [bp-6Ch]@3
13786 Texture *v25; // [sp-4h] [bp-6Ch]@7
13787 Texture *v26; // [sp-4h] [bp-6Ch]@18
13788 Texture *v27; // [sp-4h] [bp-6Ch]@24
13789 Texture *v28; // [sp-4h] [bp-6Ch]@30
13790 Texture *v29; // [sp-4h] [bp-6Ch]@36
13791 Texture *v30; // [sp-4h] [bp-6Ch]@42
13792 signed __int16 v31; // [sp+10h] [bp-58h]@1
13793 char *v32; // [sp+10h] [bp-58h]@49
13794 GUIWindow a1; // [sp+14h] [bp-54h]@46
13795
13796 v31 = 0;
13797 pRenderer->DrawTextureIndexed(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pTexture_AutonotesBook);
13798 if ( dword_506548 || !dword_506528 )
13799 {
13800 v24 = pTex_tab_an_6a__zoom_off;
13801 v17 = pViewport->uViewportTL_Y + 2;
13802 v0 = pViewport->uViewportTL_X + 407;
13803 }
13804 else
13805 {
13806 v24 = pTex_tab_an_6b__zoom_on;
13807 v17 = pViewport->uViewportTL_Y + 1;
13808 v0 = pViewport->uViewportTL_X + 398;
13809 }
13810 pRenderer->DrawTextureTransparent(v0, v17, v24);
13811 if ( dword_506544 || dword_506528 + awards_count >= awards_count2 )
13812 {
13813 v25 = pTex_tab_an_7a__zoot_off;
13814 v18 = pViewport->uViewportTL_Y + 38;
13815 v1 = pViewport->uViewportTL_X + 407;
13816 }
13817 else
13818 {
13819 v25 = pTex_tab_an_7b__zoot_on;
13820 v18 = pViewport->uViewportTL_Y + 38;
13821 v1 = pViewport->uViewportTL_X + 398;
13822 }
13823 pRenderer->DrawTextureTransparent(v1, v18, v25);
13824 if ( !dword_506540 )
13825 {
13826 if ( dword_506568 )
13827 {
13828 pRenderer->DrawTextureTransparent(
13829 pViewport->uViewportTL_X + 408,
13830 pViewport->uViewportTL_Y + 113,
13831 pTexture_506390);
13832 v2 = 1;
13833 goto LABEL_16;
13834 }
13835 goto LABEL_14;
13836 }
13837 if ( !dword_506568 )
13838 {
13839 LABEL_14:
13840 v2 = 1;
13841 goto LABEL_15;
13842 }
13843 v2 = 1;
13844 v31 = 1;
13845 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
13846 LABEL_15:
13847 dword_506568 = 0;
13848 pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 113, pTexture_506394);
13849 LABEL_16:
13850 if ( dword_50653C )
13851 {
13852 if ( dword_506568 != v2 )
13853 {
13854 v31 = v2;
13855 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
13856 }
13857 }
13858 else
13859 {
13860 if ( dword_506568 != v2 )
13861 {
13862 v26 = pTexture_506388;
13863 v19 = pViewport->uViewportTL_Y + 150;
13864 v3 = pViewport->uViewportTL_X + 408;
13865 goto LABEL_22;
13866 }
13867 }
13868 v26 = pTexture_50638C;
13869 dword_506568 = v2;
13870 v19 = pViewport->uViewportTL_Y + 150;
13871 v3 = pViewport->uViewportTL_X + 399;
13872 LABEL_22:
13873 pRenderer->DrawTextureTransparent(v3, v19, v26);
13874 if ( dword_506538 )
13875 {
13876 if ( dword_506568 != 2 )
13877 {
13878 v31 = v2;
13879 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
13880 }
13881 }
13882 else
13883 {
13884 if ( dword_506568 != 2 )
13885 {
13886 v27 = pTexture_506380;
13887 v20 = pViewport->uViewportTL_Y + 188;
13888 v4 = pViewport->uViewportTL_X + 408;
13889 goto LABEL_28;
13890 }
13891 }
13892 v27 = pTexture_506384;
13893 dword_506568 = 2;
13894 v20 = pViewport->uViewportTL_Y + 188;
13895 v4 = pViewport->uViewportTL_X + 397;
13896 LABEL_28:
13897 pRenderer->DrawTextureTransparent(v4, v20, v27);
13898 if ( dword_506534 )
13899 {
13900 if ( dword_506568 != 3 )
13901 {
13902 v31 = v2;
13903 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
13904 }
13905 }
13906 else
13907 {
13908 if ( dword_506568 != 3 )
13909 {
13910 v28 = pTexture_506378;
13911 v21 = pViewport->uViewportTL_Y + 226;
13912 v5 = pViewport->uViewportTL_X + 408;
13913 goto LABEL_34;
13914 }
13915 }
13916 v28 = pTexture_50637C;
13917 dword_506568 = 3;
13918 v21 = pViewport->uViewportTL_Y + 226;
13919 v5 = pViewport->uViewportTL_X + 397;
13920 LABEL_34:
13921 pRenderer->DrawTextureTransparent(v5, v21, v28);
13922 if ( dword_506530 )
13923 {
13924 if ( dword_506568 != 4 )
13925 {
13926 v31 = v2;
13927 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
13928 }
13929 }
13930 else
13931 {
13932 if ( dword_506568 != 4 )
13933 {
13934 v29 = pTexture_506370;
13935 v22 = pViewport->uViewportTL_Y + 263;
13936 v6 = pViewport->uViewportTL_X + 408;
13937 goto LABEL_40;
13938 }
13939 }
13940 v29 = pTexture_506374;
13941 dword_506568 = 4;
13942 v22 = pViewport->uViewportTL_Y + 264;
13943 v6 = pViewport->uViewportTL_X + 397;
13944 LABEL_40:
13945 pRenderer->DrawTextureTransparent(v6, v22, v29);
13946 if ( dword_50652C )
13947 {
13948 if ( dword_506568 != 5 )
13949 {
13950 v31 = v2;
13951 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
13952 }
13953 }
13954 else
13955 {
13956 if ( dword_506568 != 5 )
13957 {
13958 v30 = pTexture_506368;
13959 v23 = pViewport->uViewportTL_Y + 302;
13960 v7 = pViewport->uViewportTL_X + 408;
13961 goto LABEL_46;
13962 }
13963 }
13964 v30 = pTexture_50636C;
13965 dword_506568 = 5;
13966 v23 = pViewport->uViewportTL_Y + 302;
13967 v7 = pViewport->uViewportTL_X + 397;
13968 LABEL_46:
13969 pRenderer->DrawTextureTransparent(v7, v23, v30);
13970 a1.uFrameWidth = 460;
13971 a1.uFrameHeight = 344;
13972 a1.uFrameX = 8;
13973 a1.uFrameY = 8;
13974 a1.uFrameZ = 467;
13975 a1.uFrameW = 467;
13976 a1.DrawTitleText(pBook2Font, 0, 0x16u, 0, pGlobalTXT_LocalizationStrings[154], 3u);
13977 a1.uFrameX = 48;
13978 a1.uFrameY = 70;
13979 a1.uFrameWidth = 360;
13980 a1.uFrameHeight = 264;
13981 a1.uFrameZ = 407;
13982 a1.uFrameW = 333;
13983 if ( v31 )
13984 {
13985 awards_count2 = 0;
13986 dword_506528 = 0;
13987 dword_50651C = 0;
13988 awards_count = 0;
13989 v8 = 0;
13990 do
13991 {
13992 //if ( dword_72371C[2 * v8] == dword_506568 )
13993 if ( pAutonoteTxt[v8-1].eType == dword_506568 )
13994 {
13995 //v32 = (&dword_723718_autonote_related)[8 * (signed __int16)v8];
13996 v32 = (char *)pAutonoteTxt[v8-1].pText;
13997 if ( (short)v8 )
13998 {
13999 if ( (unsigned __int16)_449B57_test_bit(pParty->_autonote_bits, v8) && v32 )
14000 {
14001 v9 = awards_count++;
14002 achievedAwardsIndex[v9] = (signed __int16)v8;
14003 }
14004 }
14005 }
14006 ++v8;
14007 }
14008 while ( v8 < 196 );
14009 awards_count2 = awards_count;
14010 }
14011 else
14012 {
14013 if ( dword_506544 )
14014 {
14015 v10 = awards_count + dword_506528;
14016 if ( awards_count + dword_506528 < awards_count2 )
14017 {
14018 v11 = dword_50651C++;
14019 byte_506130[v11] = awards_count;
14020 dword_506528 = v10;
14021 pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0);
14022 }
14023 }
14024 if ( dword_506548 && dword_50651C )
14025 {
14026 --dword_50651C;
14027 dword_506528 -= (unsigned __int8)byte_506130[dword_50651C];
14028 pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0);
14029 }
14030 if ( !awards_count || dword_506528 < 1 )
14031 {
14032 dword_506528 = 0;
14033 dword_50651C = 0;
14034 }
14035 }
14036 v12 = dword_506528;
14037 dword_50652C = 0;
14038 dword_506544 = 0;
14039 dword_506548 = 0;
14040 awards_count = 0;
14041 dword_506530 = 0;
14042 dword_506534 = 0;
14043 dword_506538 = 0;
14044 dword_50653C = 0;
14045 dword_506540 = 0;
14046 while ( v12 < awards_count2 )
14047 {
14048 v13 = achievedAwardsIndex[v12];
14049 ++awards_count;
14050 //v14 = (&dword_723718_autonote_related)[8 * v13];
14051 v14 = pAutonoteTxt[v13-1].pText;
14052 //a1.DrawText(pAutonoteFont, 1, 0, 0, (&dword_723718_autonote_related)[8 * v13], 0, 0, 0);
14053 a1.DrawText(pAutonoteFont, 1, 0, 0, pAutonoteTxt[v13-1].pText, 0, 0, 0);
14054 v15 = pAutonoteFont->CalcTextHeight(v14, &a1, 1, 0);
14055 v16 = a1.uFrameY + v15;
14056 if ( (signed int)(a1.uFrameY + v15) > (signed int)a1.uFrameHeight )
14057 break;
14058 pRenderer->DrawTextureTransparent(0x64u, v16 + 12, pSpellBookPagesTextr_10);
14059 ++v12;
14060 a1.uFrameY = v16 + 24;
14061 }
14062 }
14063
14064
14065 //----- (00413980) --------------------------------------------------------
14066 void DrawBook_Maps()
14067 {
14068
14069 int v6; // eax@31
14070 unsigned int map_id; // eax@35
14071 Texture *buttnTxtr; // [sp-4h] [bp-DCh]@3
14072 char party_coord[120]; // [sp+Ch] [bp-CCh]@37
14073 GUIWindow map_window; // [sp+84h] [bp-54h]@35
14074 unsigned int textrX, textrY;
14075
14076 pRenderer->DrawTextureIndexed(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pSpellBookPagesTextr_12);
14077 if ( dword_506548 || viewparams->field_2C / 128 >= 12 )
14078 {
14079 buttnTxtr = pTex_tab_an_6a__zoom_off;
14080 textrY = pViewport->uViewportTL_Y + 2;
14081 textrX = pViewport->uViewportTL_X + 408;
14082 }
14083 else
14084 {
14085 buttnTxtr = pTex_tab_an_6b__zoom_on;
14086 textrY = pViewport->uViewportTL_Y + 1;
14087 textrX = pViewport->uViewportTL_X + 398;
14088 }
14089 pRenderer->DrawTextureTransparent(textrX, textrY, buttnTxtr);
14090 if ( dword_506544 || viewparams->field_2C / 128 <= 3 )
14091 {
14092 buttnTxtr = pTex_tab_an_7a__zoot_off;
14093 textrY = pViewport->uViewportTL_Y + 38;
14094 textrX = pViewport->uViewportTL_X + 408;
14095 }
14096 else
14097 {
14098 buttnTxtr = pTex_tab_an_7b__zoot_on;
14099 textrY = pViewport->uViewportTL_Y + 38;
14100 textrX = pViewport->uViewportTL_X + 398;
14101 }
14102 pRenderer->DrawTextureTransparent(textrX, textrY, buttnTxtr);
14103 if ( dword_506540 )
14104 {
14105 buttnTxtr = pTexture_506390;
14106 textrY = pViewport->uViewportTL_Y + 113;
14107 textrX = pViewport->uViewportTL_X + 408;
14108 }
14109 else
14110 {
14111 buttnTxtr = pTexture_506394;
14112 textrY = pViewport->uViewportTL_Y + 113;
14113 textrX = pViewport->uViewportTL_X + 398;
14114 }
14115 pRenderer->DrawTextureTransparent(textrX, textrY, buttnTxtr);
14116 if ( dword_50653C )
14117 {
14118 buttnTxtr = pTexture_506388;
14119 textrY = pViewport->uViewportTL_X + 150;
14120 textrX = pViewport->uViewportTL_Y + 408;
14121 }
14122 else
14123 {
14124 buttnTxtr = pTexture_50638C;
14125 textrY = pViewport->uViewportTL_X + 150;
14126 textrX = pViewport->uViewportTL_Y + 399;
14127 }
14128 pRenderer->DrawTextureTransparent(textrX, textrY, buttnTxtr);
14129 if ( dword_506538 )
14130 {
14131 buttnTxtr = pTexture_506380;
14132 textrY = pViewport->uViewportTL_Y + 188;
14133 textrX = pViewport->uViewportTL_X + 408;
14134 }
14135 else
14136 {
14137 buttnTxtr = pTexture_506384;
14138 textrY = pViewport->uViewportTL_Y + 188;
14139 textrX = pViewport->uViewportTL_X + 397;
14140 }
14141 pRenderer->DrawTextureTransparent(textrX, textrY, buttnTxtr);
14142 if ( dword_506534 )
14143 {
14144 buttnTxtr = pTexture_506378;
14145 textrY = pViewport->uViewportTL_Y + 226;
14146 textrX = pViewport->uViewportTL_X + 408;
14147 }
14148 else
14149 {
14150 buttnTxtr = pTexture_50637C;
14151 textrY = pViewport->uViewportTL_Y + 226;
14152 textrX = pViewport->uViewportTL_X + 397;
14153 }
14154 pRenderer->DrawTextureTransparent(textrX, textrY, buttnTxtr);
14155 if ( dword_506544 )
14156 viewparams->CenterOnParty2();
14157 if ( dword_506548 )
14158 viewparams->CenterOnParty();
14159 if ( dword_506540 )
14160 viewparams->_443219();
14161 if ( dword_50653C )
14162 viewparams->_443231();
14163 if ( dword_506538 )
14164 viewparams->_44323D();
14165 if ( dword_506534 )
14166 viewparams->_443225();
14167
14168 if ( dword_506548 | dword_506544 | dword_506540 | dword_50653C | dword_506538 | dword_506534 )
14169 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
14170 dword_506548 = 0;
14171 dword_506544 = 0;
14172 dword_506534 = 0;
14173 dword_506538 = 0;
14174 dword_50653C = 0;
14175 dword_506540 = 0;
14176 DrawBook_Map_sub(97, 49, 361, 313, 0);
14177 pRenderer->DrawTextureTransparent(75, 22, pTexture_mapbordr);
14178 map_window.uFrameWidth = 460;
14179 map_window.uFrameHeight = 344;
14180 map_window.uFrameX = 8;
14181 map_window.uFrameY = 8;
14182 map_window.uFrameZ = 467;
14183 map_window.uFrameW = 467;
14184 map_id = pMapStats->GetMapInfo(pCurrentMapName);
14185 if ( map_id )
14186 map_window.DrawTitleText(pBook2Font, -14, 12, 0, pMapStats->pInfos[map_id].pName, 3);
14187 map_window.uFrameX = 0;
14188 sprintf(party_coord, pGlobalTXT_LocalizationStrings[659], pParty->vPosition.x, pParty->vPosition.y); //"x: %d y: %d"
14189 map_window.DrawTitleText(pFontComic, 0, 320, 0, party_coord, 0);
14190 }
14191
14192
14193 //----- (00413CC6) --------------------------------------------------------
14194 void __thiscall SellectDrawBook(unsigned int uBook)
14195 {
14196 enum WindowType pWindowType; // esi@1
14197
14198 pWindowType = (enum WindowType)uBook;
14199 pRenderer->DrawTextureIndexed(471u, 445u, (Texture *)(uExitCancelTextureId != -1 ? (int)&pIcons_LOD->pTextures[uExitCancelTextureId] : 0));
14200 switch ( pWindowType )
14201 {
14202 case WINDOW_Lloyd: // 177
14203 DrawLloydBeaconsScreen();
14204 break;
14205 case WINDOW_TownPortal: //195
14206 DrawTownPortalScreen();
14207 break;
14208 case WINDOW_QuestBook: //200
14209 DrawBook_Quests();
14210 break;
14211 case WINDOW_AutonotesBook: //201
14212 DrawBook_Autonotes();
14213 break;
14214 case WINDOW_MapsBook://202
14215 DrawBook_Maps();
14216 break;
14217 case WINDOW_CalendarBook://203
14218 DrawBook_Calendar();
14219 break;
14220 case WINDOW_HistoryBook://224
14221 DrawBook_History();
14222 break;
14223 }
14224 }
14225 10597
14226 //----- (00413D3C) -------------------------------------------------------- 10598 //----- (00413D3C) --------------------------------------------------------
14227 char *__cdecl GetDayPart() 10599 char *__cdecl GetDayPart()
14228 { 10600 {
14229 if ( pParty->uCurrentHour > 4 ) 10601 if ( pParty->uCurrentHour > 4 )
14440 pCurrentScreen = dword_506F0C[0]; 10812 pCurrentScreen = dword_506F0C[0];
14441 pEventTimer->Resume(); 10813 pEventTimer->Resume();
14442 } 10814 }
14443 // 4E28F8: using guessed type int pCurrentScreen; 10815 // 4E28F8: using guessed type int pCurrentScreen;
14444 10816
14445 //----- (004142D3) -------------------------------------------------------- 10817
14446 char __cdecl GameMenuUI_DrawKeyBindings() 10818
14447 {
14448 unsigned int v0; // ebp@1
14449 int v1; // ecx@2
14450 unsigned int v2; // eax@6
14451 GUIWindow *v3; // edx@6
14452 signed int v4; // ecx@7
14453 signed int v5; // eax@8
14454 const char *v6; // ST0C_4@16
14455 unsigned int v7; // eax@16
14456 const char *v8; // ST0C_4@16
14457 unsigned int v9; // eax@16
14458 const char *v10; // ST0C_4@16
14459 unsigned int v11; // eax@16
14460 const char *v12; // ST0C_4@16
14461 unsigned int v13; // eax@16
14462 const char *v14; // ST0C_4@16
14463 unsigned int v15; // eax@16
14464 const char *v16; // ST0C_4@16
14465 unsigned int v17; // eax@16
14466 const char *v18; // ST0C_4@16
14467 unsigned int v19; // eax@16
14468 const char *v20; // ST0C_4@16
14469 unsigned int v21; // eax@16
14470 signed int v22; // ebp@16
14471 const char *v23; // ST0C_4@16
14472 unsigned int v24; // eax@16
14473 const char *v25; // ST0C_4@16
14474 unsigned int v26; // eax@16
14475 const char *v27; // ST0C_4@16
14476 unsigned int v28; // eax@16
14477 const char *v29; // ST0C_4@16
14478 unsigned int v30; // eax@16
14479 const char *v31; // ST0C_4@16
14480 unsigned int v32; // eax@16
14481 const char *v33; // ST0C_4@17
14482 unsigned int v34; // eax@17
14483 const char *v35; // ST0C_4@17
14484 unsigned int v36; // eax@17
14485 const char *v37; // ST0C_4@17
14486 unsigned int v38; // eax@17
14487 const char *v39; // ST0C_4@17
14488 unsigned int v40; // eax@17
14489 const char *v41; // ST0C_4@17
14490 unsigned int v42; // eax@17
14491 const char *v43; // ST0C_4@17
14492 unsigned int v44; // eax@17
14493 const char *v45; // ST0C_4@17
14494 unsigned int v46; // eax@17
14495 const char *v47; // ST0C_4@17
14496 unsigned int v48; // eax@17
14497 const char *v49; // ST0C_4@17
14498 unsigned int v50; // eax@17
14499 const char *v51; // ST0C_4@17
14500 unsigned int v52; // eax@17
14501 const char *v53; // ST0C_4@17
14502 unsigned int v54; // eax@17
14503 const char *v55; // ST0C_4@17
14504 unsigned int v56; // eax@17
14505 const char *v57; // ST0C_4@17
14506 unsigned int v58; // eax@17
14507 unsigned int v59; // eax@18
14508 int v61; // [sp-14h] [bp-28h]@16
14509 const char *v62; // [sp-10h] [bp-24h]@16
14510 int v63; // [sp-Ch] [bp-20h]@16
14511 int v64; // [sp-8h] [bp-1Ch]@16
14512 unsigned int v65; // [sp-4h] [bp-18h]@16
14513 unsigned int a5; // [sp+10h] [bp-4h]@1
14514
14515 v0 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
14516 a5 = v0;
14517 if ( byte_4E28FC )
14518 {
14519 v1 = dword_507C0C + 15;
14520 dword_507C0C = v1;
14521 if ( v1 == 255 )
14522 byte_4E28FC = 0;
14523 }
14524 else
14525 {
14526 v1 = dword_507C0C - 15;
14527 dword_507C0C = v1;
14528 if ( v1 == 15 )
14529 byte_4E28FC = 1;
14530 }
14531 v2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v1, 0, 0);
14532 v3 = pGUIWindow_CurrentMenu;
14533 dword_507C08 = v2;
14534 if ( pGUIWindow_CurrentMenu->field_40 == 2 )
14535 {
14536 pPrevVirtualCidesMapping[dword_506E68] = pKeyActionMap->pPressedKeysBuffer[0];
14537 memset(&KeyButtonFlagChangesArray, 0, sizeof(KeyButtonFlagChangesArray));
14538 v4 = 0;
14539 do
14540 {
14541 v5 = 0;
14542 do
14543 {
14544 if ( v4 != v5 && pPrevVirtualCidesMapping[v4] == pPrevVirtualCidesMapping[v5] )
14545 {
14546 KeyButtonFlagChangesArray[v4] = 1;
14547 KeyButtonFlagChangesArray[v5] = 1;
14548 }
14549 ++v5;
14550 }
14551 while ( v5 < 28 );
14552 ++v4;
14553 }
14554 while ( v4 < 28 );
14555 dword_506E68 = -1;
14556 v3->field_40 = 0;
14557 }
14558 pRenderer->DrawTextureIndexed(8, 8, (Texture *)(uTextureID_Optkb[0] != -1 ? &pIcons_LOD->pTextures[uTextureID_Optkb[0]] : 0));
14559 if ( KeyboardPageNum == 1 )
14560 {
14561 pRenderer->DrawTextureIndexed(0x13, 0x12E, (Texture *)(uTextureID_Optkb[3] != -1 ? &pIcons_LOD->pTextures[uTextureID_Optkb[3]] : 0));
14562 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 142, v0, ascii_4E2D5C, 0, 0, 0);
14563 v6 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[0]);
14564 v7 = sub_414D24(0);
14565 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 142, v7, v6, 0, 0, 0);
14566 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 163, v0, ascii_4E2D50, 0, 0, 0);
14567 v8 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[1]);
14568 v9 = sub_414D24(1);
14569 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 163, v9, v8, 0, 0, 0);
14570 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 184, v0, ascii_4E2D48, 0, 0, 0);
14571 v10 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[2]);
14572 v11 = sub_414D24(2);
14573 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 184, v11, v10, 0, 0, 0);
14574 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 205, v0, ascii_4E2D40, 0, 0, 0);
14575 v12 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[3]);
14576 v13 = sub_414D24(3);
14577 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 205, v13, v12, 0, 0, 0);
14578 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 226, v0, ascii_4E2D38, 0, 0, 0);
14579 v14 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[4]);
14580 v15 = sub_414D24(4);
14581 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 226, v15, v14, 0, 0, 0);
14582 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 247, v0, ascii_4E2D30, 0, 0, 0);
14583 v16 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[5]);
14584 v17 = sub_414D24(5);
14585 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 247, v17, v16, 0, 0, 0);
14586 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 268, v0, ascii_4E2D28, 0, 0, 0);
14587 v18 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[6]);
14588 v19 = sub_414D24(6);
14589 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 268, v19, v18, 0, 0, 0);
14590 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 142, v0, ascii_4E2D1C, 0, 0, 0);
14591 v20 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[7]);
14592 v21 = sub_414D24(7);
14593 v22 = 350;
14594 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 142, v21, v20, 0, 0, 0);
14595 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 163, a5, ascii_4E2D14, 0, 0, 0);
14596 v23 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[8]);
14597 v24 = sub_414D24(8);
14598 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 163, v24, v23, 0, 0, 0);
14599 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 184, a5, ascii_4E2D0C, 0, 0, 0);
14600 v25 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[9]);
14601 v26 = sub_414D24(9);
14602 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 184, v26, v25, 0, 0, 0);
14603 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 205, a5, ascii_4E2D04, 0, 0, 0);
14604 v27 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[10]);
14605 v28 = sub_414D24(10);
14606 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 205, v28, v27, 0, 0, 0);
14607 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 226, a5, ascii_4E2CFC, 0, 0, 0);
14608 v29 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[11]);
14609 v30 = sub_414D24(11);
14610 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 226, v30, v29, 0, 0, 0);
14611 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 247, a5, ascii_4E2CF0, 0, 0, 0);
14612 v31 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[12]);
14613 v32 = sub_414D24(12);
14614 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 247, v32, v31, 0, 0, 0);
14615 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 268, a5, ascii_4E2CE8, 0, 0, 0);
14616 v65 = 0;
14617 v64 = 0;
14618 v63 = 0;
14619 v62 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[13]);
14620 v61 = 13;
14621 }
14622 else
14623 {
14624 pRenderer->DrawTextureIndexed(0x7F, 0x12E, (Texture *)(uTextureID_Optkb[4] != -1 ? &pIcons_LOD->pTextures[uTextureID_Optkb[4]] : 0));
14625 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 142, v0, ascii_4E2CDC, 0, 0, 0);
14626 v33 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[14]);
14627 v34 = sub_414D24(14);
14628 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 142, v34, v33, 0, 0, 0);
14629 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 163, v0, ascii_4E2CD4, 0, 0, 0);
14630 v35 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[15]);
14631 v36 = sub_414D24(15);
14632 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 163, v36, v35, 0, 0, 0);
14633 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 184, v0, ascii_4E2CC8, 0, 0, 0);
14634 v37 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[16]);
14635 v38 = sub_414D24(16);
14636 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 184, v38, v37, 0, 0, 0);
14637 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 205, v0, ascii_4E2CBC, 0, 0, 0);
14638 v39 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[17]);
14639 v40 = sub_414D24(17);
14640 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 205, v40, v39, 0, 0, 0);
14641 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 226, v0, ascii_4E2CB0, 0, 0, 0);
14642 v41 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[18]);
14643 v42 = sub_414D24(18);
14644 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 226, v42, v41, 0, 0, 0);
14645 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 247, v0, ascii_4E2CA4, 0, 0, 0);
14646 v43 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[19]);
14647 v44 = sub_414D24(19);
14648 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 247, v44, v43, 0, 0, 0);
14649 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 268, v0, ascii_4E2C9C, 0, 0, 0);
14650 v45 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[20]);
14651 v46 = sub_414D24(20);
14652 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 268, v46, v45, 0, 0, 0);
14653 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 142, v0, ascii_4E2C90, 0, 0, 0);
14654 v47 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[21]);
14655 v48 = sub_414D24(21);
14656 v22 = 350;
14657 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 142, v48, v47, 0, 0, 0);
14658 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 163, a5, ascii_4E2C84, 0, 0, 0);
14659 v49 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[22]);
14660 v50 = sub_414D24(22);
14661 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 163, v50, v49, 0, 0, 0);
14662 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 184, a5, ascii_4E2C7C, 0, 0, 0);
14663 v51 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[23]);
14664 v52 = sub_414D24(23);
14665 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 184, v52, v51, 0, 0, 0);
14666 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 205, a5, ascii_4E2C70, 0, 0, 0);
14667 v53 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[24]);
14668 v54 = sub_414D24(24);
14669 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 205, v54, v53, 0, 0, 0);
14670 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 226, a5, ascii_4E2C68, 0, 0, 0);
14671 v55 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[25]);
14672 v56 = sub_414D24(25);
14673 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 226, v56, v55, 0, 0, 0);
14674 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 247, a5, ascii_4E2C5C, 0, 0, 0);
14675 v57 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[26]);
14676 v58 = sub_414D24(26);
14677 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 247, v58, v57, 0, 0, 0);
14678 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 268, a5, ascii_4E2C54, 0, 0, 0);
14679 v65 = 0;
14680 v64 = 0;
14681 v63 = 0;
14682 v62 = pKeyActionMap->GetVKeyDisplayName(pWindowList_at_506F50_minus1_indexing[0]);
14683 v61 = 27;
14684 }
14685 v59 = sub_414D24(v61);
14686 return pGUIWindow_CurrentMenu->DrawText(pFontLucida, v22, 268, v59, v62, v63, v64, v65);
14687 }
14688
14689
14690 //----- (00414D24) --------------------------------------------------------
14691 unsigned int __thiscall sub_414D24(int _this)
14692 {
14693 int v1; // esi@1
14694 unsigned int v2; // edi@1
14695 unsigned int v3; // ebx@1
14696 unsigned int result; // eax@1
14697
14698 v1 = _this;
14699 v2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
14700 v3 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFu, 0, 0);
14701 result = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
14702 if ( dword_506E68 == v1 )
14703 {
14704 if ( GetTickCount() % 0x3E8 <= 0x1F4 )
14705 result = v3;
14706 else
14707 result = v2;
14708 }
14709 else
14710 {
14711 if ( KeyButtonFlagChangesArray[v1] )
14712 result = dword_507C08;
14713 }
14714 return result;
14715 }
14716 // 506E68: using guessed type int dword_506E68;
14717 // 506E6C: using guessed type __int16 word_506E6C[18];
14718 // 507C08: using guessed type int dword_507C08;
14719
14720 //----- (00414D9A) --------------------------------------------------------
14721 void __cdecl GameMenuUI_DrawVideoOptions()
14722 {
14723 const char *v0; // ST0C_4@3
14724 unsigned __int16 v1; // ax@3
14725 int v2; // eax@10
14726 GUIWindow v3; // [sp+8h] [bp-54h]@3
14727
14728 pRenderer->DrawTextureIndexed(
14729 8u,
14730 8u,
14731 (Texture *)(uTextureID_507C10 != -1 ? &pIcons_LOD->pTextures[uTextureID_507C10] : 0));
14732 if ( !pRenderer->bWindowMode && GammaController::IsGammaSupported() )
14733 {
14734 pRenderer->DrawTextureIndexed(
14735 17 * uGammaPos + 42,
14736 162u,
14737 (Texture *)(pTextureIDs_GammaPositions[uGammaPos] != -1 ? &pIcons_LOD->pTextures[pTextureIDs_GammaPositions[uGammaPos]] : 0));
14738 pRenderer->DrawTextureRGB(0x112u, 0xA9u, &stru_506E40);
14739 v3.uFrameX = 22;
14740 v0 = pGlobalTXT_LocalizationStrings[226];
14741 v3.uFrameY = 190;
14742 v3.uFrameWidth = 211;
14743 v3.uFrameHeight = 79;
14744 v3.uFrameZ = 232;
14745 v3.uFrameW = 268;
14746 v1 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
14747 v3.DrawTitleText(pFontSmallnum, 0, 0, v1, v0, 3u);
14748 }
14749 if ( !pRenderer->pRenderD3D )
14750 {
14751 pRenderer->DrawTextureIndexed(
14752 0x14u,
14753 0x119u,
14754 (Texture *)(uTextureID_507C50 != -1 ? &pIcons_LOD->pTextures[uTextureID_507C50] : 0));
14755 pRenderer->DrawTextureIndexed(
14756 0x14u,
14757 0x12Fu,
14758 (Texture *)(uTextureID_507C54 != -1 ? &pIcons_LOD->pTextures[uTextureID_507C54] : 0));
14759 v2 = uTextureID_507C58;
14760 goto LABEL_12;
14761 }
14762 if ( pGame->uFlags2 & GAME_FLAGS_2_DRAW_BLOODSPLATS )
14763 pRenderer->DrawTextureIndexed(
14764 0x14u,
14765 0x119u,
14766 (Texture *)(uTextureID_507C14 != -1 ? &pIcons_LOD->pTextures[uTextureID_507C14] : 0));
14767 if ( pRenderer->bUseColoredLights )
14768 pRenderer->DrawTextureIndexed(
14769 0x14u,
14770 0x12Fu,
14771 (Texture *)(uTextureID_507C18 != -1 ? &pIcons_LOD->pTextures[uTextureID_507C18] : 0));
14772 if ( pRenderer->bTinting )
14773 {
14774 v2 = uTextureID_507C1C;
14775 LABEL_12:
14776 pRenderer->DrawTextureIndexed(0x14u, 0x145u, (Texture *)(v2 != -1 ? &pIcons_LOD->pTextures[v2] : 0));
14777 }
14778 }
14779
14780
14781
14782 //----- (00414F82) --------------------------------------------------------
14783 void __cdecl DrawGameOptions()
14784 {
14785 signed int v0; // eax@1
14786
14787 pRenderer->DrawTextureIndexed(8, 8, (Texture *)(uTextureID_Options != -1 ? &pIcons_LOD->pTextures[uTextureID_Options] : 0));
14788 pRenderer->DrawTextureIndexed(8, 132, (Texture *)(uTextureID_ControlBG[0] != -1 ? &pIcons_LOD->pTextures[uTextureID_ControlBG[0]] : 0));
14789 v0 = 0;
14790 if ( uTurnSpeed == 128 )
14791 {
14792 v0 = 2;
14793 }
14794 else
14795 {
14796 if ( uTurnSpeed == 64 )
14797 v0 = 1;
14798 }
14799 pRenderer->DrawTextureIndexed(BtnTurnCoord[v0], 270, (Texture *)(uTextureID_ControlBG[v0 + 1] != -1 ? &pIcons_LOD->pTextures[uTextureID_ControlBG[v0 + 1]] : 0));
14800 if ( bWalkSound )
14801 pRenderer->DrawTextureIndexed(20, 303, (Texture *)(uTextureID_ControlBG[21] != -1 ? &pIcons_LOD->pTextures[uTextureID_ControlBG[21]] : 0));
14802 if ( bShowDamage )
14803 pRenderer->DrawTextureIndexed(128, 303, (Texture *)(uTextureID_ControlBG[22] != -1 ? &pIcons_LOD->pTextures[uTextureID_ControlBG[22]] : 0));
14804 if ( bFlipOnExit )
14805 pRenderer->DrawTextureIndexed(128, 325, (Texture *)(uTextureID_ControlBG[9] != -1 ? &pIcons_LOD->pTextures[uTextureID_ControlBG[9]] : 0));
14806 if ( bAlwaysRun )
14807 pRenderer->DrawTextureIndexed(20, 325, (Texture *)(uTextureID_ControlBG[20] != -1 ? &pIcons_LOD->pTextures[uTextureID_ControlBG[20]] : 0));
14808 pRenderer->DrawTextureIndexed(17 * (char)uSoundVolumeMultiplier + 265, 162,
14809 (Texture *)(uTextureID_ControlBG[(char)uSoundVolumeMultiplier + 10] != -1 ? &pIcons_LOD->pTextures[uTextureID_ControlBG[(char)uSoundVolumeMultiplier + 10]] : 0));
14810 pRenderer->DrawTextureIndexed(17 * (char)uMusicVolimeMultiplier + 265, 216,
14811 (Texture *)(uTextureID_ControlBG[(char)uMusicVolimeMultiplier + 10] != -1 ? &pIcons_LOD->pTextures[uTextureID_ControlBG[(char)uMusicVolimeMultiplier + 10]] : 0));
14812 pRenderer->DrawTextureIndexed(17 * (char)uVoicesVolumeMultiplier + 265, 270,
14813 (Texture *)(uTextureID_ControlBG[(char)uVoicesVolumeMultiplier + 10] != -1 ? &pIcons_LOD->pTextures[uTextureID_ControlBG[(char)uVoicesVolumeMultiplier + 10]] : 0));
14814 }
14815
14816
14817 //----- (004151D9) --------------------------------------------------------
14818 void __fastcall DrawPopupWindow(unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight)
14819 {
14820 unsigned int v4; // ebx@1
14821 Texture *v5; // edi@1
14822 signed int uTileWidth; // ecx@1
14823 int v7; // eax@5
14824 int v8; // ecx@10
14825 unsigned int v9; // ebx@14
14826 int v10; // [sp+10h] [bp-28h]@5
14827 signed int uTileHeight; // [sp+18h] [bp-20h]@1
14828 int v12; // [sp+1Ch] [bp-1Ch]@7
14829 int v13; // [sp+20h] [bp-18h]@1
14830 int a5; // [sp+24h] [bp-14h]@5
14831 unsigned int a5a; // [sp+24h] [bp-14h]@11
14832 unsigned int a4; // [sp+28h] [bp-10h]@1
14833 int uNumXTiles; // [sp+2Ch] [bp-Ch]@3
14834 unsigned int uNumXTilesa; // [sp+2Ch] [bp-Ch]@6
14835 unsigned int uNumXTilesb; // [sp+2Ch] [bp-Ch]@11
14836 unsigned int a2a; // [sp+30h] [bp-8h]@1
14837 unsigned int v21; // [sp+34h] [bp-4h]@5
14838 unsigned int v22; // [sp+34h] [bp-4h]@11
14839
14840 v4 = uY;
14841 a2a = uX;
14842 a4 = uX + uWidth;
14843 pRenderer->Clip(uX, v4, uX + uWidth, v4 + uHeight);
14844 v5 = (Texture *)(uTextureID_Parchment != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Parchment] : 0);
14845 uTileWidth = (uTextureID_Parchment != -1 ? pIcons_LOD->pTextures[uTextureID_Parchment].uTextureWidth : 24);
14846 v13 = (uTextureID_Parchment != -1 ? pIcons_LOD->pTextures[uTextureID_Parchment].uTextureWidth : 24);
14847 uTileHeight = (uTextureID_Parchment != -1 ? pIcons_LOD->pTextures[uTextureID_Parchment].uTextureHeight : 26);
14848 if ( (uTextureID_Parchment != -1 ? pIcons_LOD->pTextures[uTextureID_Parchment].uTextureWidth : 24)
14849 && (uTextureID_Parchment != -1 ? pIcons_LOD->pTextures[uTextureID_Parchment].uTextureHeight : 26) )
14850 {
14851 uNumXTiles = (signed int)uWidth / uTileWidth;
14852 if ( (signed int)uWidth % uTileWidth )
14853 ++uNumXTiles;
14854 a5 = 0;
14855 v21 = v4;
14856 v7 = uNumXTiles + 1;
14857 v10 = uNumXTiles + 1;
14858 do
14859 {
14860 uNumXTilesa = a2a - v13;
14861 if ( v7 > 0 )
14862 {
14863 v12 = v7;
14864 do
14865 {
14866 uNumXTilesa += v13;
14867 pRenderer->DrawTextureIndexed(uNumXTilesa, v21, v5);
14868 --v12;
14869 }
14870 while ( v12 );
14871 v7 = v10;
14872 }
14873 v21 += uTileHeight;
14874 v8 = a5++;
14875 }
14876 while ( v8 < (signed int)uHeight / uTileHeight );
14877 a5a = v4 + uHeight - 32;
14878 pRenderer->DrawTextureTransparent(
14879 a2a,
14880 v4,
14881 (Texture *)(uTextureID_5076AC != -1 ? &pIcons_LOD->pTextures[uTextureID_5076AC] : 0));
14882 pRenderer->DrawTextureTransparent(
14883 a2a,
14884 a5a,
14885 (Texture *)(uTextureID_5076B4 != -1 ? &pIcons_LOD->pTextures[uTextureID_5076B4] : 0));
14886 pRenderer->DrawTextureTransparent(
14887 a4 - 32,
14888 v4,
14889 (Texture *)(uTextureID_5076A8 != -1 ? &pIcons_LOD->pTextures[uTextureID_5076A8] : 0));
14890 pRenderer->DrawTextureTransparent(
14891 a4 - 32,
14892 a5a,
14893 (Texture *)(uTextureID_5076B0 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_5076B0] : 0));
14894 uNumXTilesb = a2a + 32;
14895 v22 = v4 + uHeight - 10;
14896 if ( (signed int)uWidth > 64 )
14897 {
14898 pRenderer->Clip(a2a + 32, v4, a4 - 32, v4 + uHeight);
14899 pRenderer->DrawTextureTransparent(
14900 uNumXTilesb,
14901 v4,
14902 (Texture *)(uTextureID_507698 != -1 ? &pIcons_LOD->pTextures[uTextureID_507698] : 0));
14903 pRenderer->DrawTextureTransparent(
14904 uNumXTilesb,
14905 v22,
14906 (Texture *)(uTextureID_5076A4 != -1 ? &pIcons_LOD->pTextures[uTextureID_5076A4] : 0));
14907 if ( (signed int)uWidth > 512 )
14908 {
14909 pRenderer->DrawTextureTransparent(
14910 a2a + 544,
14911 v4,
14912 (Texture *)(uTextureID_507698 != -1 ? &pIcons_LOD->pTextures[uTextureID_507698] : 0));
14913 pRenderer->DrawTextureTransparent(
14914 a2a + 544,
14915 v22,
14916 (Texture *)(uTextureID_5076A4 != -1 ? &pIcons_LOD->pTextures[uTextureID_5076A4] : 0));
14917 }
14918 }
14919 v9 = v4 + 32;
14920 if ( (signed int)uHeight > 64 )
14921 {
14922 pRenderer->Clip(a2a, v9, a4, a5a);
14923 pRenderer->DrawTextureTransparent(
14924 a2a,
14925 v9,
14926 (Texture *)(uTextureID_5076A0 != -1 ? &pIcons_LOD->pTextures[uTextureID_5076A0] : 0));
14927 pRenderer->DrawTextureTransparent(
14928 a4 - 10,
14929 v9,
14930 (Texture *)(uTextureID_50769C != -1 ? &pIcons_LOD->pTextures[uTextureID_50769C] : 0));
14931 }
14932 pRenderer->ResetClip();
14933 }
14934 }
14935 10819
14936 10820
14937 //----- (00415485) -------------------------------------------------------- 10821 //----- (00415485) --------------------------------------------------------
14938 void DrawCopyrightWindow() 10822 void DrawCopyrightWindow()
14939 { 10823 {
15834 } 11718 }
15835 } 11719 }
15836 } 11720 }
15837 11721
15838 11722
15839 //----- (00416D62) -------------------------------------------------------- 11723
15840 void sub_416D62_ShowPopupWindow_MonsterRecord_ItemInfo_etcsub_416D62(Vec2_int_ *_this)
15841 {
15842 signed int pPlayerNum; // eax@12
15843 char *v2; // eax@32
15844 void *v3; // ecx@52
15845 unsigned int v4; // eax@59
15846 int v5; // esi@62
15847 signed int v6; // esi@64
15848 signed int v7; // esi@69
15849 ItemGen *v8; // ecx@70
15850 unsigned int v9; // eax@72
15851 unsigned int v10; // eax@76
15852 char v11; // zf@83
15853 GUIButton *pButton; // esi@84
15854 unsigned int v13; // ecx@85
15855 char *pStr; // edi@85
15856 signed int pControlID; // eax@92
15857 int v16; // eax@95
15858 int v17; // eax@96
15859 enum PLAYER_SKILL_TYPE v18; // eax@98
15860 char *pStr2; // eax@99
15861 unsigned int v20; // eax@108
15862 unsigned int pSkillId; // eax@109
15863 const char *pSkillInfo; // eax@111
15864 //char *v23; // ebx@112
15865 char *pHint; // edx@113
15866 unsigned int pColor; // eax@113
15867 GUIWindow pWindow; // [sp+4h] [bp-74h]@32
15868 double v27; // [sp+58h] [bp-20h]@33
15869 struct tagPOINT Point; // [sp+60h] [bp-18h]@6
15870 char *v29; // [sp+68h] [bp-10h]@33
15871 float v30; // [sp+6Ch] [bp-Ch]@33
15872 unsigned int pX; // [sp+70h] [bp-8h]@3
15873 unsigned int pY; // [sp+74h] [bp-4h]@3
15874
15875 if ( pCurrentScreen == SCREEN_VIDEO )
15876 return;
15877 if ( _this )
15878 {
15879 pX = _this->x;
15880 pY = _this->y;
15881 }
15882 else
15883 {
15884 pMouse->GetClickPos(&pX, &pY);
15885 }
15886 if ( pRenderer->bWindowMode )
15887 {
15888 GetCursorPos(&Point);
15889 ScreenToClient(hWnd, &Point);
15890 if ( Point.x < 1 || Point.y < 1 || Point.x > 638 || Point.y > 478 )
15891 {
15892 back_to_game();
15893 return;
15894 }
15895 }
15896
15897 if ( pParty->pPickedItem.uItemID )//íàæàòèå íà ïîðòðåò ïåðñà ïðàâîé êíîïêîé ìûøè ñ ðàñòâîðîì
15898 {
15899 //v1 = 0;
15900 //do
15901 for ( pPlayerNum = 0; pPlayerNum < 4; ++pPlayerNum)
15902 {
15903 if ( (signed int)pX > RightClickPortraitXmin[pPlayerNum] && (signed int)pX < RightClickPortraitXmax[pPlayerNum]
15904 && (signed int)pY > 375 && (signed int)pY < 466 )
15905 {
15906 pPlayers[uActiveCharacter]->UseItem_DrinkPotion_etc(pPlayerNum + 1, 1);
15907 return;
15908 }
15909 //++v1;
15910 }
15911 //while ( v1 < 4 );
15912 }
15913
15914 pEventTimer->Pause();
15915
15916 switch(pCurrentScreen)
15917 {
15918 case SCREEN_CASTING:
15919 {
15920 identify_item();
15921 break;
15922 }
15923
15924 case SCREEN_CHEST:
15925 {
15926 if ( !pPlayers[uActiveCharacter]->CanAct() )
15927 {
15928 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[427],//%s íå â ñîñòîÿíèè %s
15929 pPlayers[uActiveCharacter]->pName, pGlobalTXT_LocalizationStrings[541]);//Îïîçíàòü ïðåäìåòû
15930 pWindow.Hint = pTmpBuf;
15931 pWindow.uFrameWidth = 384;
15932 pWindow.uFrameHeight = 180;
15933 pWindow.uFrameY = 40;
15934 if ( (signed int)pX <= 320 )
15935 v10 = pX + 30;
15936 else
15937 v10 = pX - 414;
15938 pWindow.uFrameX = v10;
15939 pWindow.DrawMessageBox(0);
15940 }
15941 else
15942 {
15943 v9 = pX + pSRZBufferLineOffsets[pY];
15944 if ( pRenderer->pActiveZBuffer[v9] & 0xFFFF )
15945 {
15946
15947 // __debugbreak(); // invalid indexing will result in invalid object ptr
15948 // v8 = (ItemGen *)(&pOtherOverlayList->pOverlays[49].field_4 + 2662 * (unsigned int)pChestWindow->ptr_1C + 18* *((short *)&pChests[0].igChestItems[139].uExpireTime
15949 // + (pRenderer->pActiveZBuffer[v9] & 0xFFFF) + 2662 * (unsigned int)pChestWindow->ptr_1C + 3));
15950 v10=pChests[pChestWindow->par1C].pInventoryIndices[(pRenderer->pActiveZBuffer[v9] & 0xFFFF)-1];
15951 v8 =&pChests[pChestWindow->par1C].igChestItems[v10-1];
15952 GameUI_DrawItemInfo(v8);
15953 }
15954 }
15955 break;
15956 }
15957 case SCREEN_GAME:
15958 {
15959 if (GetCurrentMenuID() > 0)
15960 break;
15961
15962 if ( (signed int)pY > (signed int)pViewport->uViewportBR_Y )
15963 {
15964 pWindow.ptr_1C = (void *)((signed int)pX / 118);
15965 if ( (signed int)pX / 118 < 4 )
15966 {
15967 pWindow.Hint = 0;
15968 pWindow.uFrameWidth = 400;
15969 pWindow.uFrameHeight = 200;
15970 pWindow.uFrameX = 38;
15971 pWindow.uFrameY = 60;
15972 pAudioPlayer->StopChannels(-1, -1);
15973 pWindow.DrawQuickCharRecord();
15974 }
15975 }
15976 else if ( (signed int)pX > (signed int)pViewport->uViewportBR_X )
15977 {
15978 if ( (signed int)pY >= 130 )
15979 {
15980 if ( (signed int)pX >= 476 && (signed int)pX <= 636 && (signed int)pY >= 240 && (signed int)pY <= 300 )
15981 {
15982 pWindow.Hint = 0;
15983 pWindow.uFrameWidth = 400;
15984 pWindow.uFrameHeight = 200;
15985 pWindow.uFrameX = 38;
15986 pWindow.uFrameY = 60;
15987 pAudioPlayer->StopChannels(-1, -1);
15988 pWindow._41D73D_draw_buff_tooltip();
15989 }
15990 else if ( (signed int)pX < 485 || (signed int)pX > 548 || (signed int)pY < 156 || (signed int)pY > 229 )
15991 {
15992 if (!( (signed int)pX < 566 || (signed int)pX > 629 || (signed int)pY < 156 || (signed int)pY > 229 ))
15993 {
15994 pAudioPlayer->StopChannels(-1, -1);
15995 v3 = (void *)1;
15996 }
15997 }
15998 else
15999 {
16000 pAudioPlayer->StopChannels(-1, -1);
16001 v3 = 0;
16002 sub_416B01(v3);
16003 }
16004 }
16005 else
16006 {
16007 pWindow.Hint = _4443D5_GetMinimapRightClickText();
16008 pWindow.uFrameWidth = 256;
16009 pWindow.uFrameX = 130;
16010 pWindow.uFrameY = 140;
16011 pWindow.uFrameHeight = 64;
16012 pAudioPlayer->StopChannels(-1, -1);
16013 pWindow.DrawMessageBox(0);
16014 }
16015 }
16016 else
16017 {
16018 pWindow.Hint = 0;
16019 pWindow.uFrameWidth = 320;
16020 pWindow.uFrameHeight = 320;
16021 v4 = pX - 350;
16022 if ( (signed int)pX <= 320 )
16023 v4 = pX + 30;
16024 pWindow.uFrameX = v4;
16025 pWindow.uFrameY = 40;
16026 if ( pRenderer->pRenderD3D )
16027 LOWORD(v5) = pGame->pVisInstance->get_picked_object_zbuf_val();
16028 else
16029 v5 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]];
16030 v6 = (unsigned __int16)v5;
16031 if ( (v6 & 7) != OBJECT_Item)
16032 {
16033 if ( (v6 & 7) == OBJECT_Actor)
16034 {
16035 if ( pRenderer->uNumSceneBegins )
16036 {
16037 pWindow.DrawMessageBox(1);
16038 MonsterPopup_Draw(v6 >> 3, &pWindow);
16039 }
16040 else
16041 {
16042 pRenderer->BeginScene();
16043 pWindow.DrawMessageBox(1);
16044 MonsterPopup_Draw(v6 >> 3, &pWindow);
16045 pRenderer->EndScene();
16046 }
16047 }
16048 }
16049 else
16050 {
16051 v7 = v6 >> 3;
16052 if ( ! (pObjectList->pObjects[pSpriteObjects[v7].uObjectDescID].uFlags & 0x10 ) )
16053 {
16054 v8 = &pSpriteObjects[v7].stru_24;
16055 GameUI_DrawItemInfo(v8);
16056 }
16057 }
16058 }
16059 break;
16060 }
16061 case SCREEN_BOOKS:
16062 {
16063 if ( !dword_506364
16064 || (signed int)pX < (signed int)pViewport->uViewportTL_X
16065 || (signed int)pX > (signed int)pViewport->uViewportBR_X
16066 || (signed int)pY < (signed int)pViewport->uViewportTL_Y
16067 || (signed int)pY > (signed int)pViewport->uViewportBR_Y
16068 || (v2 = (char *)sub_444564(), (pWindow.Hint = v2) == 0) )
16069 break;
16070 v30 = (double)(pFontArrus->GetLineWidth(v2) + 32);
16071 v27 = v30 + 6.7553994e15;
16072 v29 = (char *)LODWORD(v27);
16073 pWindow.uFrameWidth = LODWORD(v27);
16074 pWindow.uFrameX = pX + 5;
16075 pWindow.uFrameY = pY + 5;
16076 pWindow.uFrameHeight = 64;
16077 pAudioPlayer->StopChannels(-1, -1);
16078 pWindow.DrawMessageBox(0);
16079 break;
16080 }
16081 case SCREEN_CHARACTERS:
16082 case SCREEN_E:
16083 case SCREEN_F:
16084 {
16085 if ( (signed int)pX > 467 && pCurrentScreen != SCREEN_E )
16086 {
16087 identify_item();
16088 }
16089 else if ( (signed int)pY >= 345 )
16090 break;
16091 else if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 100 )//2DEvent - CharacerScreenStats
16092 {
16093 CharacterUI_StatsTab_ShowHint();
16094 }
16095 else if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 101 )//2DEvent - CharacerScreenSkills
16096 {
16097 CharacterUI_SkillsTab_ShowHint();
16098 }
16099 else
16100 {
16101 v11 = pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 103;//2DEvent - CharacerScreenInventory
16102 if ( v11 )
16103 identify_item();
16104 }
16105 break;
16106 }
16107 case SCREEN_SPELL_BOOK:
16108 {
16109 if ( dword_507B00_spell_info_to_draw_in_popup )
16110 DrawSpellDescriptionPopup(dword_507B00_spell_info_to_draw_in_popup - 1);
16111 break;
16112 }
16113 case SCREEN_HOUSE:
16114 {
16115 if ( (signed int)pY < 345 && (signed int)pX < 469 )
16116 sub_4B1A2D();//identify item in inventory
16117 break;
16118 }
16119
16120 case SCREEN_PARTY_CREATION:
16121 {
16122 pWindow.Hint = 0;
16123 pStr = 0;
16124 for ( pButton = pGUIWindow_CurrentMenu->pControlsHead; pButton; pButton = pButton->pNext)
16125 {
16126 if ( pButton->uButtonType == 1 && pButton->uButtonType != 3 && (signed int)pX > (signed int)pButton->uX && (signed int)pX < (signed int)pButton->uZ
16127 && (signed int)pY > (signed int)pButton->uY && (signed int)pY < (signed int)pButton->uW )
16128 {
16129 pControlID = pButton->uControlID;
16130 switch ( pControlID )
16131 {
16132 case 0: //stats info
16133 pWindow.Hint = pAttributeDescriptions[(signed int)pButton->uControlParam % 7];
16134 pStr = aAttributeNames[(signed int)pButton->uControlParam % 7];
16135 break;
16136 case 62: //Plus button info
16137 pStr = pGlobalTXT_LocalizationStrings[670];//Äîáàâèòü
16138 pWindow.Hint = pGlobalTXT_LocalizationStrings[671];//"Äîáàâëÿåò î÷êî ê âûäåëåííîìó íàâûêó, çàáèðàÿ åãî èç íàêîïèòåëÿ î÷êîâ"
16139 break;
16140 case 63: //Minus button info
16141 pStr = pGlobalTXT_LocalizationStrings[668];//Âû÷åñòü
16142 pWindow.Hint = pGlobalTXT_LocalizationStrings[669];//"Âû÷èòàåò î÷êî èç âûäåëåííîãî íàâûêà, âîçâðàùàÿ åãî â íàêîïèòåëü î÷êîâ"
16143 break;
16144 case 64: //Available skill button info
16145 v18 = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(pButton->uControlParam + 4);
16146 pStr = pSkillNames[v18];
16147 pWindow.Hint = pSkillDesc[v18];
16148 break;
16149 case 65: //Available Class Info
16150 pWindow.Hint = pClassDescriptions[pButton->uControlParam];
16151 pStr = pClassNames[pButton->uControlParam];
16152 break;
16153 case 66: //OK Info
16154 pWindow.Hint = pGlobalTXT_LocalizationStrings[664];//Ùåëêíèòå çäåñü äëÿ óòâåðæäåíèÿ ñîñòàâà îòðÿäà è ïðîäîëæåíèÿ èãðû.
16155 pStr = pGlobalTXT_LocalizationStrings[665];//Êíîïêà ÎÊ
16156 break;
16157 case 67: //Clear info
16158 pWindow.Hint = pGlobalTXT_LocalizationStrings[666];//Ñáðàñûâàåò âñå ïàðàìåòðû è íàâûêè îòðÿäà.
16159 pStr = pGlobalTXT_LocalizationStrings[667];//Êíîïêà Î÷èñòèòü
16160 break;
16161 case 118: // Character info
16162 pStr = pParty->pPlayers[pButton->uControlParam].pName;
16163 pWindow.Hint = pClassDescriptions[pParty->pPlayers[pButton->uControlParam].classType];
16164 break;
16165 }
16166 if ( pControlID > 68 && pControlID <= 75 ) //Sellected skills info
16167 {
16168 pSkillId = pParty->pPlayers[pButton->uControlParam].GetSkillIdxByOrder(pControlID - 72);
16169 pY = 0;
16170 if ( (signed int)pSkillId < 37 )
16171 {
16172 pSkillInfo = CharacterUI_GetSkillDescText(pButton->uControlParam, (enum PLAYER_SKILL_TYPE)pSkillId);
16173 strcpy(pTmpBuf2, pSkillInfo);
16174 pWindow.Hint = pTmpBuf2;
16175 pStr = pSkillNames[pSkillId];
16176 }
16177 }
16178 }
16179 }
16180 if ( pWindow.Hint )
16181 {
16182 pHint = pWindow.Hint;
16183 pWindow.Hint = 0;
16184 pWindow.uFrameWidth = 384;
16185 pWindow.uFrameHeight = 256;
16186 pWindow.uFrameX = 128;
16187 pWindow.uFrameY = 40;
16188 pWindow.uFrameHeight = pFontSmallnum->CalcTextHeight(pHint, &pWindow, 24, 0) + 2 * LOBYTE(pFontLucida->uFontHeight) + 24;
16189 pWindow.uFrameZ = pWindow.uFrameX + pWindow.uFrameWidth - 1;
16190 pWindow.uFrameW = pWindow.uFrameY + pWindow.uFrameHeight - 1;
16191 pWindow.DrawMessageBox(0);
16192 pWindow.uFrameX += 12;
16193 pWindow.uFrameWidth -= 24;
16194 pWindow.uFrameY += 12;
16195 pWindow.uFrameHeight -= 12;
16196 pWindow.uFrameZ = pWindow.uFrameX + pWindow.uFrameWidth - 1;
16197 pWindow.uFrameW = pWindow.uFrameY + pWindow.uFrameHeight - 1;
16198 pColor = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFF, 0xFF, 0x9B);
16199 sprintf(pTmpBuf, format_4E2D80, pColor, pStr);//"\f%05d%s\f00000\n"
16200 pWindow.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf, 3);
16201 pWindow.DrawText(pFontSmallnum, 1, pFontLucida->uFontHeight, 0, pHint, 0, 0, 0);
16202 }
16203 break;
16204 }
16205 default:
16206 {
16207 break;
16208 }
16209 }
16210 dword_507BF0_is_there_popup_onscreen = 1;
16211 viewparams->bRedrawGameUI = 1;
16212 }
16213 11724
16214 //----- (004175C0) -------------------------------------------------------- 11725 //----- (004175C0) --------------------------------------------------------
16215 void UI_OnMouseLeftClick(int *pXY) 11726 void UI_OnMouseLeftClick(int *pXY)
16216 { 11727 {
16217 int *pXY_; // esi@1 11728 int *pXY_; // esi@1
16540 if ( byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass][uPlayerSkillType] < skill_level ) 12051 if ( byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass][uPlayerSkillType] < skill_level )
16541 return red; 12052 return red;
16542 } 12053 }
16543 return white; 12054 return white;
16544 } 12055 }
16545
16546 //----- (00417BB5) --------------------------------------------------------
16547 const char *__fastcall CharacterUI_GetSkillDescText(unsigned int uPlayerID, enum PLAYER_SKILL_TYPE uPlayerSkillType)
16548 {
16549 //enum PLAYER_SKILL_TYPE v2; // esi@1
16550 //unsigned int v3; // ebx@1
16551 int v4; // edi@1
16552 int v5; // eax@1
16553 Player *pPlayer; // ebx@7
16554 char v7; // al@7
16555 char v8; // cl@7
16556 unsigned int v9; // eax@8
16557 unsigned int v10; // eax@8
16558 unsigned int v11; // eax@8
16559 enum PLAYER_SKILL_TYPE v12; // edi@8
16560 unsigned int v13; // eax@8
16561 unsigned int v14; // eax@8
16562 enum PLAYER_SKILL_TYPE v15; // esi@8
16563 int v16; // edi@8
16564 char v17; // al@8
16565 int v18; // ST5C_4@8
16566 int v19; // ST4C_4@8
16567 int v20; // ST3C_4@8
16568 int v21; // ST2C_4@8
16569 int v22; // ST1C_4@8
16570 char *v23; // esi@8
16571 unsigned int v24; // eax@9
16572 unsigned int v25; // eax@9
16573 unsigned int v26; // eax@9
16574 unsigned int v27; // ecx@9
16575 enum PLAYER_SKILL_TYPE v28; // ebx@9
16576 unsigned int v29; // eax@9
16577 char a2[1200]; // [sp+Ch] [bp-538h]@7
16578 char Source[120]; // [sp+4BCh] [bp-88h]@7
16579 unsigned __int16 *v33; // [sp+534h] [bp-10h]@1
16580 int v34; // [sp+538h] [bp-Ch]@1
16581 unsigned __int16 *v35; // [sp+53Ch] [bp-8h]@1
16582 //enum PLAYER_SKILL_TYPE v36; // [sp+540h] [bp-4h]@1
16583
16584 //v2 = uPlayerSkillType;
16585 //v3 = uPlayerID;
16586 //v36 = uPlayerSkillType;
16587 v4 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[431]);// Normal
16588 v34 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[433]);// Expert
16589 v33 = (unsigned __int16 *)pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[432]);// Master
16590 v5 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[96]);// Grand
16591 v35 = (unsigned __int16 *)v4;
16592 if ( v34 > v4 )
16593 v35 = (unsigned __int16 *)v34;
16594 if ( (signed int)v33 > (signed int)v35 )
16595 v35 = v33;
16596 if ( v5 > (signed int)v35 )
16597 v35 = (unsigned __int16 *)v5;
16598 pPlayer = &pParty->pPlayers[uPlayerID];
16599 //v33 = &pPlayer->pActiveSkills[uPlayerSkillType];
16600 v7 = pPlayer->GetActualSkillLevel(uPlayerSkillType);
16601 v8 = pPlayer->pActiveSkills[uPlayerSkillType];
16602 a2[0] = 0;
16603 Source[0] = 0;
16604 if ( (v8 & 0x3F) == (v7 & 0x3F) )
16605 {
16606 strcpy(a2, "%s\n\n");
16607 v24 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 1);
16608 sprintf(Source, "\f%05d", v24);
16609 strcat(a2, Source);
16610 strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
16611 v25 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 2);
16612 sprintf(Source, "\f%05d", v25);
16613 strcat(a2, Source);
16614 strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
16615 v26 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 3);
16616 sprintf(Source, "\f%05d", v26);
16617 strcat(a2, Source);
16618 strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
16619 v27 = pPlayer->classType;
16620 v28 = uPlayerSkillType;
16621 v29 = GetSkillColor(v27, uPlayerSkillType, 4);
16622 sprintf(Source, "\f%05d", v29);
16623 strcat(a2, Source);
16624 strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
16625
16626 v23 = static_sub_417BB5_out_string;
16627 sprintf(static_sub_417BB5_out_string, a2, pSkillDesc[v28], pGlobalTXT_LocalizationStrings[431], // Normal
16628 (char *)v35 + 3, v35 + 5, pNormalSkillDesc[v28], pGlobalTXT_LocalizationStrings[433], // Expert
16629 (char *)v35 + 3, v35 + 5, pExpertSkillDesc[v28], pGlobalTXT_LocalizationStrings[432], // Master
16630 (char *)v35 + 3, v35 + 5, pMasterSkillDesc[v28], pGlobalTXT_LocalizationStrings[96], // Grand
16631 (char *)v35 + 3, v35 + 5, pGrandSkillDesc[v28]);
16632 }
16633 else
16634 {
16635 strcpy(a2, "%s\n\n");
16636 v9 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 1);
16637 sprintf(Source, "\f%05d", v9);
16638 strcat(a2, Source);
16639 strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
16640 v10 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 2);
16641 sprintf(Source, "\f%05d", v10);
16642 strcat(a2, Source);
16643 strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
16644 v11 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 3);
16645 sprintf(Source, "\f%05d", v11);
16646 strcat(a2, Source);
16647 strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
16648 v12 = uPlayerSkillType;
16649 v13 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 4);
16650 sprintf(Source, "\f%05d", v13);
16651 strcat(a2, Source);
16652 strcat(a2, "%s\t%03d:\t%03d%s\t000\n\n");
16653 v14 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
16654 sprintf(Source, "\f%05d", v14);
16655 strcat(a2, Source);
16656 strcat(a2, "%s: +%d");
16657 v15 = v12;
16658 v16 = (int)(v35 + 5);
16659 v15 = (PLAYER_SKILL_TYPE)((int)v15 * 4);
16660 v34 = (int)((char *)v35 + 3);
16661 v17 = pPlayer->GetActualSkillLevel(uPlayerSkillType);
16662 v18 = *(int *)((char *)pGrandSkillDesc + v15);
16663 v19 = *(int *)((char *)pMasterSkillDesc + v15);
16664 v20 = *(int *)((char *)pExpertSkillDesc + v15);
16665 v21 = *(int *)((char *)pNormalSkillDesc + v15);
16666 v22 = *(int *)((char *)pSkillDesc + v15);
16667 v23 = static_sub_417BB5_out_string;
16668 sprintf(
16669 static_sub_417BB5_out_string,
16670 a2,
16671 v22,
16672 pGlobalTXT_LocalizationStrings[431],
16673 v34,
16674 v16,
16675 v21,
16676 pGlobalTXT_LocalizationStrings[433],
16677 v34,
16678 v16,
16679 v20,
16680 pGlobalTXT_LocalizationStrings[432],
16681 v34,
16682 v16,
16683 v19,
16684 pGlobalTXT_LocalizationStrings[96],
16685 v34,
16686 v16,
16687 v18,
16688 pGlobalTXT_LocalizationStrings[623],
16689 (v17 & 0x3F) - (*(char *)v33 & 0x3F));
16690 }
16691 return v23;
16692 }
16693
16694 //----- (00417FE5) --------------------------------------------------------
16695 char __cdecl CharacterUI_SkillsTab_ShowHint()
16696 {
16697 unsigned int v0; // ecx@1
16698 unsigned int v1; // eax@1
16699 GUIButton *i; // esi@6
16700 const char *v3; // eax@12
16701 unsigned int pX; // [sp+4h] [bp-8h]@1
16702 unsigned int pY; // [sp+8h] [bp-4h]@1
16703
16704 pMouse->GetClickPos(&pX, &pY);
16705 v0 = pX;
16706 v1 = pY;
16707 if ( (signed int)pX < 24 || (signed int)pX > 455 || (signed int)pY < 18 || (signed int)pY > 36 )
16708 {
16709 for ( i = pGUIWindow_CurrentMenu->pControlsHead; i; i = i->pNext )
16710 {
16711 if ( i->uControlID == 121
16712 && (signed int)v0 >= (signed int)i->uX
16713 && (signed int)v0 <= (signed int)i->uZ
16714 && (signed int)v1 >= (signed int)i->uY
16715 && (signed int)v1 <= (signed int)i->uW )
16716 {
16717 v3 = CharacterUI_GetSkillDescText(uActiveCharacter - 1, (enum PLAYER_SKILL_TYPE)i->uControlParam);
16718 sub_4179BC_draw_tooltip(pSkillNames[i->uControlParam], v3);
16719 v1 = pY;
16720 v0 = pX;
16721 }
16722 }
16723 }
16724 else
16725 {
16726 LOBYTE(v1) = sub_4179BC_draw_tooltip(pGlobalTXT_LocalizationStrings[207], pSkillPointsAttributeDescription);
16727 }
16728 return v1;
16729 }
16730
16731 //----- (00418083) --------------------------------------------------------
16732 char __cdecl CharacterUI_StatsTab_ShowHint()
16733 {
16734 LONG _x; // esi@1
16735 Player *_y; // eax@1
16736 int v2; // edi@1
16737 __int16 *v3; // ecx@1
16738 LONG v4; // edx@2
16739 signed int v5; // edx@4
16740 char *v6; // ecx@9
16741 char *v7; // ebx@9
16742 unsigned int v8; // ebx@15
16743 unsigned __int64 v9; // kr00_8@15
16744 char *v10; // ST2C_4@15
16745 signed int v11; // eax@15
16746 char *v12; // ecx@17
16747 char *v13; // eax@20
16748 Player *v14; // esi@28
16749 int v15; // ebx@28
16750 int v16; // eax@33
16751 POINT a2; // [sp+Ch] [bp-24h]@1
16752 __int64 v19; // [sp+14h] [bp-1Ch]@15
16753 char *v20; // [sp+1Ch] [bp-14h]@13
16754 Player *v21; // [sp+20h] [bp-10h]@13
16755 unsigned int v22; // [sp+24h] [bp-Ch]@15
16756 int *v23; // [sp+28h] [bp-8h]@13
16757 const char *v24; // [sp+2Ch] [bp-4h]@10
16758
16759 _x = pMouse->GetCursorPos(&a2)->x;
16760 _y = (Player *)pMouse->GetCursorPos(&a2)->y;
16761 v2 = 0;
16762 v3 = &array_4E2940[0].field_2;
16763 while ( 1 )
16764 {
16765 v4 = *(v3 - 1);
16766 if ( _x >= v4 )
16767 {
16768 if ( _x <= v4 + v3[1] )
16769 {
16770 v5 = *v3;
16771 if ( (signed int)_y >= v5 )
16772 {
16773 if ( (signed int)_y <= v5 + v3[2] )
16774 break;
16775 }
16776 }
16777 }
16778 v3 += 4;
16779 ++v2;
16780 if ( (signed int)v3 >= (signed int)&off_4E2A12 )
16781 return (char)_y;
16782 }
16783 switch ( v2 )
16784 {
16785 case 0:
16786 case 1:
16787 case 2:
16788 case 3:
16789 case 4:
16790 case 5:
16791 case 6:
16792 LOBYTE(_y) = 4 * v2;
16793 v6 = aAttributeNames[v2];
16794 v7 = pAttributeDescriptions[v2];
16795 goto LABEL_46;
16796 case 7:
16797 LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[108]);
16798 v7 = pHealthPointsAttributeDescription;
16799 v24 = pGlobalTXT_LocalizationStrings[108];
16800 goto LABEL_47;
16801 case 8:
16802 LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[212]);
16803 v7 = pSpellPointsAttributeDescription;
16804 v24 = pGlobalTXT_LocalizationStrings[212];
16805 goto LABEL_47;
16806 case 9:
16807 LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[12]);
16808 v7 = pArmourClassAttributeDescription;
16809 v24 = pGlobalTXT_LocalizationStrings[12];
16810 goto LABEL_47;
16811 case 10:
16812 v24 = pGlobalTXT_LocalizationStrings[47];
16813 strcpy(pTmpBuf2, pPlayerConditionAttributeDescription);
16814 v7 = pTmpBuf2;
16815 v20 = pTmpBuf2;
16816 strcat(pTmpBuf2, "\n");
16817
16818 extern unsigned int pConditionImportancyTable[18];
16819 v23 = (int *)pConditionImportancyTable;
16820 _y = pPlayers[uActiveCharacter];
16821 v21 = pPlayers[uActiveCharacter];
16822 do
16823 {
16824 if ( _y->pConditions[*v23] )
16825 {
16826 strcat(pTmpBuf2, " \n");
16827 v8 = *v23;
16828 v9 = pParty->uTimePlayed - v21->pConditions[*v23];
16829 a2.x = LODWORD(pParty->uTimePlayed) - LODWORD(v21->pConditions[*v23]);
16830 a2.y = HIDWORD(v9);
16831 v19 = (signed __int64)((double)*(signed __int64 *)&a2 * 0.234375) / 60 / 60;
16832 v22 = (unsigned int)v19 / 0x18;
16833 v10 = aCharacterConditionNames[v8];
16834 v19 %= 24i64;
16835 v11 = GetConditionDrawColor(v8);
16836 sprintf(pTmpBuf, &byte_4E2DE8, v11, v10);
16837 strcat(pTmpBuf2, pTmpBuf);
16838 if ( v19 && v19 <= 1 )
16839 v12 = pGlobalTXT_LocalizationStrings[109];
16840 else
16841 v12 = pGlobalTXT_LocalizationStrings[110];
16842 if ( !v22 || (v13 = pGlobalTXT_LocalizationStrings[56], v22 > 1) )
16843 v13 = pGlobalTXT_LocalizationStrings[57];
16844 sprintf(pTmpBuf, "%lu %s, %lu %s", v22, v13, v19, v12);
16845 strcat(pTmpBuf2, pTmpBuf);
16846 v7 = v20;
16847 _y = v21;
16848 }
16849 ++v23;
16850 }
16851 while ( (signed int)v23 < (signed int)&unk_4EDF40 );
16852 goto LABEL_47;
16853 case 11:
16854 LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[172]);
16855 v7 = pFastSpellAttributeDescription;
16856 v24 = pGlobalTXT_LocalizationStrings[172];
16857 goto LABEL_47;
16858 case 12:
16859 LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[5]);
16860 v7 = pPlayerAgeAttributeDescription;
16861 v24 = pGlobalTXT_LocalizationStrings[5];
16862 goto LABEL_47;
16863 case 13:
16864 LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[131]);
16865 v7 = pPlayerLevelAttributeDescription;
16866 v24 = pGlobalTXT_LocalizationStrings[131];
16867 goto LABEL_47;
16868 case 14:
16869 v14 = pPlayers[uActiveCharacter];
16870 v24 = pGlobalTXT_LocalizationStrings[83];
16871 v15 = v14->uLevel;
16872 do
16873 {
16874 if ( (signed __int64)v14->uExperience < (unsigned int)sub_4B46F8(v15) )
16875 break;
16876 ++v15;
16877 }
16878 while ( v15 <= 10000 );
16879 pTmpBuf[0] = 0;
16880 pTmpBuf2[0] = 0;
16881 if ( v15 > v14->uLevel )
16882 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[147], v15);
16883 v16 = sub_4B46F8(v15) - LODWORD(v14->uExperience);
16884 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[538], v16, v15 + 1);
16885 strcat(pTmpBuf, "\n");
16886 strcat(pTmpBuf, pTmpBuf2);
16887 LOBYTE(_y) = sprintf(pTmpBuf2, "%s\n \n%s", pPlayerExperienceAttributeDescription, pTmpBuf);
16888 v7 = pTmpBuf2;
16889 goto LABEL_47;
16890 case 15:
16891 LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[587]);
16892 v7 = pAttackBonusAttributeDescription;
16893 v24 = pGlobalTXT_LocalizationStrings[587];
16894 goto LABEL_47;
16895 case 16:
16896 LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[588]);
16897 v7 = pAttackDamageAttributeDescription;
16898 v24 = pGlobalTXT_LocalizationStrings[588];
16899 goto LABEL_47;
16900 case 17:
16901 LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[589]);
16902 v7 = pMissleBonusAttributeDescription;
16903 v24 = pGlobalTXT_LocalizationStrings[589];
16904 goto LABEL_47;
16905 case 18:
16906 LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[590]);
16907 v7 = pMissleDamageAttributeDescription;
16908 v24 = pGlobalTXT_LocalizationStrings[590];
16909 goto LABEL_47;
16910 case 19:
16911 LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[87]);
16912 v7 = pFireResistanceAttributeDescription;
16913 v24 = pGlobalTXT_LocalizationStrings[87];
16914 goto LABEL_47;
16915 case 20:
16916 LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[6]);
16917 v7 = pAirResistanceAttributeDescription;
16918 v24 = pGlobalTXT_LocalizationStrings[6];
16919 goto LABEL_47;
16920 case 21:
16921 LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[240]);
16922 v7 = pWaterResistanceAttributeDescription;
16923 v24 = pGlobalTXT_LocalizationStrings[240];
16924 goto LABEL_47;
16925 case 22:
16926 LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[70]);
16927 v7 = pEarthResistanceAttributeDescription;
16928 v24 = pGlobalTXT_LocalizationStrings[70];
16929 goto LABEL_47;
16930 case 23:
16931 LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[142]);
16932 v7 = pMindResistanceAttributeDescription;
16933 v24 = pGlobalTXT_LocalizationStrings[142];
16934 goto LABEL_47;
16935 case 24:
16936 LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[29]);
16937 v7 = pBodyResistanceAttributeDescription;
16938 v24 = pGlobalTXT_LocalizationStrings[29];
16939 goto LABEL_47;
16940 case 25:
16941 LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[207]);
16942 v7 = pSkillPointsAttributeDescription;
16943 v24 = pGlobalTXT_LocalizationStrings[207];
16944 goto LABEL_47;
16945 case 26:
16946 _y = (Player *)(4 * pPlayers[uActiveCharacter]->classType);
16947 v6 = *(char **)((char *)_y->pConditions + (int)pClassNames);
16948 v7 = *(char **)((char *)_y->pConditions + (int)pClassDescriptions);
16949 LABEL_46:
16950 v24 = v6;
16951 LABEL_47:
16952 if ( v24 && v7 )
16953 LOBYTE(_y) = sub_4179BC_draw_tooltip(v24, v7);
16954 break;
16955 default:
16956 return (char)_y;
16957 }
16958 return (char)_y;
16959 }
16960
16961 //----- (00418511) --------------------------------------------------------
16962 char __fastcall CharacterUI_StatsTab_Draw(unsigned int uPlayerID)
16963 {
16964 Player *pPlayer; // edi@1
16965 unsigned int v2; // eax@1
16966 unsigned int v3; // eax@1
16967 unsigned int v4; // eax@2
16968 int v5; // ST20_4@4
16969 int v6; // ST1C_4@4
16970 int v7; // ebp@4
16971 int v8; // eax@4
16972 unsigned int v9; // eax@4
16973 int v10; // ST34_4@4
16974 int v11; // ST20_4@4
16975 int v12; // ST1C_4@4
16976 int v13; // ebp@4
16977 int v14; // eax@4
16978 unsigned int v15; // eax@4
16979 int v16; // ST34_4@4
16980 int v17; // ST20_4@4
16981 int v18; // ST1C_4@4
16982 int v19; // ebp@4
16983 int v20; // eax@4
16984 unsigned int v21; // eax@4
16985 int v22; // ST34_4@4
16986 int v23; // ST20_4@4
16987 int v24; // ST1C_4@4
16988 int v25; // ebp@4
16989 int v26; // eax@4
16990 unsigned int v27; // eax@4
16991 int v28; // ST34_4@4
16992 int v29; // ST20_4@4
16993 int v30; // ST1C_4@4
16994 int v31; // ebp@4
16995 int v32; // eax@4
16996 unsigned int v33; // eax@4
16997 int v34; // ST34_4@4
16998 int v35; // ST20_4@4
16999 int v36; // ST1C_4@4
17000 int v37; // ebp@4
17001 int v38; // eax@4
17002 unsigned int v39; // eax@4
17003 int v40; // ST34_4@4
17004 int v41; // ST20_4@4
17005 int v42; // ST1C_4@4
17006 int v43; // ebp@4
17007 int v44; // eax@4
17008 unsigned int v45; // eax@4
17009 int v46; // ebp@4
17010 signed int v47; // ST20_4@6
17011 int v48; // ST1C_4@6
17012 signed int v49; // eax@6
17013 unsigned int v50; // eax@6
17014 int v51; // ST20_4@8
17015 int v52; // ST1C_4@8
17016 int v53; // eax@8
17017 unsigned int v54; // eax@8
17018 int v55; // ST34_4@8
17019 int v56; // ST20_4@8
17020 int v57; // ST1C_4@8
17021 int v58; // ebp@8
17022 int v59; // eax@8
17023 unsigned int v60; // eax@8
17024 unsigned int v61; // ebp@8
17025 unsigned int v62; // eax@8
17026 char *v63; // ST20_4@8
17027 signed int v64; // eax@8
17028 unsigned int v65; // ebp@8
17029 unsigned __int8 v66; // al@8
17030 char *v67; // eax@9
17031 unsigned int v68; // ST20_4@11
17032 unsigned int v69; // ST1C_4@11
17033 signed int v70; // ebp@11
17034 signed int v71; // eax@11
17035 unsigned int v72; // eax@11
17036 int v73; // ST20_4@13
17037 int v74; // ST1C_4@13
17038 int v75; // ebp@13
17039 int v76; // eax@13
17040 unsigned int v77; // eax@13
17041 char *v78; // ecx@14
17042 int v79; // ST20_4@16
17043 char *v80; // ST40_4@16
17044 unsigned int v81; // eax@16
17045 int v82; // ST34_4@16
17046 int v83; // eax@16
17047 int v84; // ST34_4@16
17048 char *v85; // eax@16
17049 int v86; // ST34_4@16
17050 int v87; // eax@16
17051 int v88; // ST34_4@16
17052 char *v89; // eax@16
17053 int v90; // eax@16
17054 int v91; // ST20_4@19
17055 unsigned int v92; // eax@19
17056 int v93; // eax@19
17057 int v94; // ST20_4@22
17058 unsigned int v95; // eax@22
17059 int v96; // eax@22
17060 int v97; // ST20_4@25
17061 unsigned int v98; // eax@25
17062 int v99; // eax@25
17063 int v100; // ST20_4@27
17064 unsigned int v101; // eax@27
17065 int v102; // eax@27
17066 int v103; // ST20_4@30
17067 unsigned int v104; // eax@30
17068 char *v105; // ST20_4@32
17069 unsigned int v106; // eax@32
17070 int v107; // eax@33
17071 int v108; // ST20_4@36
17072 unsigned int v109; // eax@36
17073 char *v110; // ST20_4@38
17074 unsigned int v111; // eax@38
17075 int uY; // [sp+10h] [bp-10h]@6
17076 int uYa; // [sp+10h] [bp-10h]@11
17077 int uYb; // [sp+10h] [bp-10h]@13
17078 int uYc; // [sp+10h] [bp-10h]@16
17079 int uYd; // [sp+10h] [bp-10h]@19
17080 int uYe; // [sp+10h] [bp-10h]@22
17081 int uYf; // [sp+10h] [bp-10h]@25
17082 int uYg; // [sp+10h] [bp-10h]@27
17083 int uYh; // [sp+10h] [bp-10h]@33
17084 const char *a2; // [sp+14h] [bp-Ch]@4
17085 const char *a2a; // [sp+14h] [bp-Ch]@6
17086 const char *a2b; // [sp+14h] [bp-Ch]@11
17087 const char *a2c; // [sp+14h] [bp-Ch]@16
17088 const char *a2d; // [sp+14h] [bp-Ch]@19
17089 const char *a2e; // [sp+14h] [bp-Ch]@22
17090 const char *a2f; // [sp+14h] [bp-Ch]@25
17091 const char *a2g; // [sp+14h] [bp-Ch]@27
17092 const char *a2h; // [sp+14h] [bp-Ch]@33
17093 int v131; // [sp+18h] [bp-8h]@16
17094 int v132; // [sp+18h] [bp-8h]@19
17095 int v133; // [sp+18h] [bp-8h]@22
17096 int v134; // [sp+18h] [bp-8h]@25
17097 int v135; // [sp+18h] [bp-8h]@27
17098 int v136; // [sp+18h] [bp-8h]@33
17099 int v137; // [sp+1Ch] [bp-4h]@27
17100 int v138; // [sp+1Ch] [bp-4h]@33
17101
17102 pPlayer = &pParty->pPlayers[uPlayerID-1];
17103 v2 = pIcons_LOD->LoadTexture("fr_stats", TEXTURE_16BIT_PALETTE);
17104 pRenderer->DrawTextureIndexed(8, 8, (Texture *)(v2 != -1 ? (int)&pIcons_LOD->pTextures[v2] : 0));
17105 v3 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
17106 sprintf(pTmpBuf, "\f%05d", v3);
17107 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[429], pPlayer->pName, pClassNames[pPlayer->classType]);//^Pi[%s] %s
17108 strcat(pTmpBuf, pTmpBuf2);
17109 if ( pPlayer->uSkillPoints )
17110 v4 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, 0);
17111 else
17112 v4 = 0xFFFFu;
17113 sprintf(pTmpBuf2, "\f00000\r180%s: \f%05d%d\f00000\n\n\n", pGlobalTXT_LocalizationStrings[207], v4, pPlayer->uSkillPoints);//Skill points
17114 strcat(pTmpBuf, pTmpBuf2);
17115 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, 18, 0, pTmpBuf, 0, 0, 0);
17116 v5 = pPlayer->GetBaseStrength();
17117 v6 = pPlayer->GetActualMight();
17118 v7 = pPlayer->GetBaseStrength();
17119 v8 = pPlayer->GetActualMight();
17120 v9 = UI_GetHealthManaStringColor(v8, v7);
17121 sprintf(pTmpBuf, "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[144], v9, v6, v5);//Might
17122 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, 53, 0, pTmpBuf, 0, 0, 0);
17123 v10 = LOBYTE(pFontArrus->uFontHeight) + 51;
17124 v11 = pPlayer->GetBaseIntelligence();
17125 v12 = pPlayer->GetActualIntelligence();
17126 v13 = pPlayer->GetBaseIntelligence();
17127 v14 = pPlayer->GetActualIntelligence();
17128 v15 = UI_GetHealthManaStringColor(v14, v13);
17129 sprintf(pTmpBuf, "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[116], v15, v12, v11);//Intellect
17130 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf, 0, 0, 0);
17131 v16 = LOBYTE(pFontArrus->uFontHeight) + v10 - 2;
17132 v17 = pPlayer->GetBaseWillpower();
17133 v18 = pPlayer->GetActualWillpower();
17134 v19 = pPlayer->GetBaseWillpower();
17135 v20 = pPlayer->GetActualWillpower();
17136 v21 = UI_GetHealthManaStringColor(v20, v19);
17137 sprintf(pTmpBuf, "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[163], v21, v18, v17);//
17138 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v16, 0, pTmpBuf, 0, 0, 0);
17139 v22 = LOBYTE(pFontArrus->uFontHeight) + v16 - 2;
17140 v23 = pPlayer->GetBaseEndurance();
17141 v24 = pPlayer->GetActualEndurance();
17142 v25 = pPlayer->GetBaseEndurance();
17143 v26 = pPlayer->GetActualEndurance();
17144 v27 = UI_GetHealthManaStringColor(v26, v25);
17145 sprintf(pTmpBuf, "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[75], v27, v24, v23);//
17146 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v22, 0, pTmpBuf, 0, 0, 0);
17147 v28 = LOBYTE(pFontArrus->uFontHeight) + v22 - 2;
17148 v29 = pPlayer->GetBaseAccuracy();
17149 v30 = pPlayer->GetActualAccuracy();
17150 v31 = pPlayer->GetBaseAccuracy();
17151 v32 = pPlayer->GetActualAccuracy();
17152 v33 = UI_GetHealthManaStringColor(v32, v31);
17153 sprintf(pTmpBuf, "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[1], v33, v30, v29);
17154 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v28, 0, pTmpBuf, 0, 0, 0);
17155 v34 = LOBYTE(pFontArrus->uFontHeight) + v28 - 2;
17156 v35 = pPlayer->GetBaseSpeed();
17157 v36 = pPlayer->GetActualSpeed();
17158 v37 = pPlayer->GetBaseSpeed();
17159 v38 = pPlayer->GetActualSpeed();
17160 v39 = UI_GetHealthManaStringColor(v38, v37);
17161 sprintf(pTmpBuf, "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[211], v39, v36, v35);
17162 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v34, 0, pTmpBuf, 0, 0, 0);
17163 v40 = LOBYTE(pFontArrus->uFontHeight) + v34 - 2;
17164 v41 = pPlayer->GetBaseLuck();
17165 v42 = pPlayer->GetActualLuck();
17166 v43 = pPlayer->GetBaseLuck();
17167 v44 = pPlayer->GetActualLuck();
17168 v45 = UI_GetHealthManaStringColor(v44, v43);
17169 sprintf(pTmpBuf, "%s\f%05u\r424%d\f00000 /\t185%d\n\n", pGlobalTXT_LocalizationStrings[136], v45, v42, v41);
17170 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v40, 0, pTmpBuf, 0, 0, 0);
17171 a2 = "%s\f%05u\r424%d\f00000 /\t185%d\n";
17172 v46 = v40 + 2 * LOBYTE(pFontArrus->uFontHeight) + 5;
17173 if ( pPlayer->GetMaxHealth() >= 1000 )
17174 a2 = "%s\f%05u\r388%d\f00000 / %d\n";
17175 v47 = pPlayer->GetMaxHealth();
17176 v48 = pPlayer->sHealth;
17177 v49 = pPlayer->GetMaxHealth();
17178 v50 = UI_GetHealthManaStringColor(pPlayer->sHealth, v49);
17179 sprintf(pTmpBuf, a2, pGlobalTXT_LocalizationStrings[108], v50, v48, v47);
17180 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v46, 0, pTmpBuf, 0, 0, 0);
17181 a2a = "%s\f%05u\r424%d\f00000 /\t185%d\n";
17182 uY = LOBYTE(pFontArrus->uFontHeight) + v46 - 2;
17183 if ( pPlayer->GetMaxMana() >= 1000 )
17184 a2a = "%s\f%05u\r388%d\f00000 / %d\n";
17185 v51 = pPlayer->GetMaxMana();
17186 v52 = pPlayer->sMana;
17187 v53 = pPlayer->GetMaxMana();
17188 v54 = UI_GetHealthManaStringColor(pPlayer->sMana, v53);
17189 sprintf(pTmpBuf, a2a, pGlobalTXT_LocalizationStrings[212], v54, v52, v51);
17190 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, uY, 0, pTmpBuf, 0, 0, 0);
17191 v55 = LOBYTE(pFontArrus->uFontHeight) + uY - 2;
17192 v56 = pPlayer->GetBaseAC();
17193 v57 = pPlayer->GetActualAC();
17194 v58 = pPlayer->GetBaseAC();
17195 v59 = pPlayer->GetActualAC();
17196 v60 = UI_GetHealthManaStringColor(v59, v58);
17197 sprintf(pTmpBuf, "%s\f%05u\r424%d\f00000 /\t185%d\n\n", pGlobalTXT_LocalizationStrings[12], v60, v57, v56);
17198 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v55, 0, pTmpBuf, 0, 0, 0);
17199 v61 = v55 + 2 * LOBYTE(pFontArrus->uFontHeight) - 2;
17200 v62 = pPlayer->GetMajorConditionIdx();
17201 v63 = aCharacterConditionNames[v62];
17202 v64 = GetConditionDrawColor(v62);
17203 sprintf(pTmpBuf, "%s: \f%05d%s\n", pGlobalTXT_LocalizationStrings[47], v64, v63);
17204 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x1Au, v61, 0, pTmpBuf, 226, 0);
17205 v65 = LOBYTE(pFontArrus->uFontHeight) + v61 - 1;
17206 v66 = pPlayer->uQuickSpell;
17207 if ( v66 )
17208 v67 = pSpellStats->pInfos[v66].pShortName;
17209 else
17210 v67 = pGlobalTXT_LocalizationStrings[153];
17211 sprintf(pTmpBuf, "%s: %s", pGlobalTXT_LocalizationStrings[172], v67);
17212 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x1Au, v65, 0, pTmpBuf, 226, 0);
17213 v68 = pPlayer->GetBaseAge();
17214 v69 = pPlayer->GetActualAge();
17215 v70 = pPlayer->GetBaseAge();
17216 v71 = pPlayer->GetActualAge();
17217 v72 = UI_GetHealthManaStringColor(v71, v70);
17218 sprintf(pTmpBuf, "%s\f%05u\t100%d\f00000 / %d\n", pGlobalTXT_LocalizationStrings[5], v72, v69, v68);
17219 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, 50, 0, pTmpBuf, 0, 0, 0);
17220 a2b = "%s\f%05u\t100%d\f00000 / %d\n";
17221 uYa = LOBYTE(pFontArrus->uFontHeight) + 48;
17222 if ( pPlayer->GetBaseLevel() > 99 )
17223 a2b = format_4E2E68;
17224 v73 = pPlayer->GetBaseLevel();
17225 v74 = pPlayer->GetActualLevel();
17226 v75 = pPlayer->GetBaseLevel();
17227 v76 = pPlayer->GetActualLevel();
17228 v77 = UI_GetHealthManaStringColor(v76, v75);
17229 sprintf(pTmpBuf, a2b, pGlobalTXT_LocalizationStrings[131], v77, v74, v73);
17230 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, uYa, 0, pTmpBuf, 0, 0, 0);
17231 uYb = uYa + LOBYTE(pFontArrus->uFontHeight) - 2;
17232 if ( (signed __int64)pPlayer->uExperience <= 9999999 )
17233 v78 = pGlobalTXT_LocalizationStrings[83];
17234 else
17235 v78 = pGlobalTXT_LocalizationStrings[17];
17236 v79 = LODWORD(pPlayer->uExperience);
17237 v80 = v78;
17238 v81 = pPlayer->GetExperienceDisplayColor();
17239 sprintf(pTmpBuf, "%s\r180\f%05d%lu\f00000\n\n", v80, v81, v79);
17240 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, uYb, 0, pTmpBuf, 0, 0, 0);
17241 v82 = uYb + 2 * LOBYTE(pFontArrus->uFontHeight);
17242 v83 = pPlayer->GetActualAttack(0);
17243 sprintf(pTmpBuf, "%s\t100%+d\n", pGlobalTXT_LocalizationStrings[18], v83);
17244 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v82, 0, pTmpBuf, 0, 0, 0);
17245 v84 = v82 + LOBYTE(pFontArrus->uFontHeight) - 2;
17246 v85 = pPlayer->GetMeleeDamageString();
17247 sprintf(pTmpBuf, "%s\t100 %s\n", pGlobalTXT_LocalizationStrings[53], v85);
17248 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v84, 0, pTmpBuf, 0, 0, 0);
17249 v86 = v84 + LOBYTE(pFontArrus->uFontHeight) - 2;
17250 v87 = pPlayer->GetRangedAttack();
17251 sprintf(pTmpBuf, "%s\t100%+d\n", pGlobalTXT_LocalizationStrings[203], v87);
17252 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v86, 0, pTmpBuf, 0, 0, 0);
17253 v88 = v86 + LOBYTE(pFontArrus->uFontHeight) - 2;
17254 v89 = pPlayer->GetRangedDamageString();
17255 sprintf(pTmpBuf, "%s\t100 %s\n\n", pGlobalTXT_LocalizationStrings[53], v89);
17256 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v88, 0, pTmpBuf, 0, 0, 0);
17257 a2c = format_4E2E10;
17258 uYc = v88 + 2 * LOBYTE(pFontArrus->uFontHeight) - 4;
17259 v131 = pPlayer->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_FIRE);
17260 v90 = pPlayer->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_FIRE);
17261 if ( v131 > 99 || v90 > 99 )
17262 a2c = format_4E2E68;
17263 v91 = v90;
17264 v92 = UI_GetHealthManaStringColor(v131, v90);
17265 sprintf(pTmpBuf, a2c, pGlobalTXT_LocalizationStrings[87], v92, v131, v91);
17266 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, uYc, 0, pTmpBuf, 0, 0, 0);
17267 a2d = format_4E2E10;
17268 uYd = uYc + LOBYTE(pFontArrus->uFontHeight) - 2;
17269 v132 = pPlayer->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_AIR);
17270 v93 = pPlayer->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_AIR);
17271 if ( v132 > 99 || v93 > 99 )
17272 a2d = format_4E2E68;
17273 v94 = v93;
17274 v95 = UI_GetHealthManaStringColor(v132, v93);
17275 sprintf(pTmpBuf, a2d, pGlobalTXT_LocalizationStrings[6], v95, v132, v94);
17276 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, uYd, 0, pTmpBuf, 0, 0, 0);
17277 a2e = format_4E2E10;
17278 uYe = uYd + LOBYTE(pFontArrus->uFontHeight) - 2;
17279 v133 = pPlayer->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_WATER);
17280 v96 = pPlayer->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_WATER);
17281 if ( v133 > 99 || v96 > 99 )
17282 a2e = format_4E2E68;
17283 v97 = v96;
17284 v98 = UI_GetHealthManaStringColor(v133, v96);
17285 sprintf(pTmpBuf, a2e, pGlobalTXT_LocalizationStrings[240], v98, v133, v97);
17286 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, uYe, 0, pTmpBuf, 0, 0, 0);
17287 a2f = format_4E2E10;
17288 uYf = uYe + LOBYTE(pFontArrus->uFontHeight) - 2;
17289 v134 = pPlayer->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_EARTH);
17290 v99 = pPlayer->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_EARTH);
17291 if ( v134 > 99 )
17292 a2f = format_4E2E68;
17293 v100 = v99;
17294 v101 = UI_GetHealthManaStringColor(v134, v99);
17295 sprintf(pTmpBuf, a2f, pGlobalTXT_LocalizationStrings[70], v101, v134, v100);
17296 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, uYf, 0, pTmpBuf, 0, 0, 0);
17297 a2g = format_4E2E10;
17298 uYg = uYf + LOBYTE(pFontArrus->uFontHeight) - 2;
17299 v135 = pPlayer->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_MIND);
17300 v102 = pPlayer->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_MIND);
17301 v137 = v102;
17302 if ( v135 > 99 || v102 > 99 )
17303 a2g = format_4E2E68;
17304 v103 = v102;
17305 v104 = UI_GetHealthManaStringColor(v135, v102);
17306 sprintf(pTmpBuf, a2g, pGlobalTXT_LocalizationStrings[142], v104, v135, v103);
17307 if ( pPlayer->classType == PLAYER_CLASS_LICH && v137 == 200 )
17308 {
17309 v105 = pGlobalTXT_LocalizationStrings[625];
17310 v106 = UI_GetHealthManaStringColor(v135, 200);
17311 sprintf(pTmpBuf, format_4E2E00, pGlobalTXT_LocalizationStrings[142], v106, v105);
17312 }
17313 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, uYg, 0, pTmpBuf, 0, 0, 0);
17314 a2h = format_4E2E10;
17315 uYh = uYg + LOBYTE(pFontArrus->uFontHeight) - 2;
17316 v136 = pPlayer->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_BODY);
17317 v107 = pPlayer->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_BODY);
17318 v138 = v107;
17319 if ( v136 > 99 || v107 > 99 )
17320 a2h = format_4E2E68;
17321 v108 = v107;
17322 v109 = UI_GetHealthManaStringColor(v136, v107);
17323 sprintf(pTmpBuf, a2h, pGlobalTXT_LocalizationStrings[29], v109, v136, v108);
17324 if ( pPlayer->classType == PLAYER_CLASS_LICH && v138 == 200 )
17325 {
17326 v110 = pGlobalTXT_LocalizationStrings[625];
17327 v111 = UI_GetHealthManaStringColor(v136, 200);
17328 sprintf(pTmpBuf, format_4E2E00, pGlobalTXT_LocalizationStrings[29], v111, v110);
17329 }
17330 return pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, uYh, 0, pTmpBuf, 0, 0, 0);
17331 }
17332
17333 //----- (00419100) --------------------------------------------------------
17334 void FillAwardsData()
17335 {
17336 Player *pPlayer; // esi@1
17337
17338 pPlayer = pPlayers[uActiveCharacter];
17339 memset(&achievedAwardsIndex, 0, 4000);
17340 memset(pTmpBuf2, 0, 0x7D0u);
17341 dword_506544 = 0;
17342 dword_506548 = 0;
17343 awards_count = 0;
17344 dword_50651C = 0;
17345 dword_506528 = 0;
17346 for(int i=0; i<105; ++i)
17347 {
17348 if ( _449B57_test_bit((unsigned char*)&pPlayer->_guilds_member_bits, i) && pAwards[i].pText )
17349 achievedAwardsIndex[awards_count++] = i;
17350 }
17351 awards_count2 = awards_count;
17352 awards_count = 0;
17353 //sort awards index
17354 if ( awards_count2>0 )
17355 {
17356 for(int i=0; i<awards_count2; ++i)
17357 achievedAwardsIndex[awards_count2 + i] = rand() % 16;
17358
17359 for(int i=1; i<awards_count2-1; ++i)
17360 {
17361 for (int j = i; j < awards_count2-1; ++j )
17362 {
17363 int tmp=achievedAwardsIndex[j];
17364 if(pAwards[j].uSort < pAwards[i].uSort)
17365 {
17366 achievedAwardsIndex[j] = achievedAwardsIndex[i];
17367 achievedAwardsIndex[i] = tmp;
17368 }
17369 }
17370 }
17371 }
17372 }
17373 12056
17374 12057
17375 //----- (00419220) -------------------------------------------------------- 12058 //----- (00419220) --------------------------------------------------------
17376 void __cdecl sub_419220() 12059 void __cdecl sub_419220()
17377 { 12060 {
17465 } 12148 }
17466 } 12149 }
17467 } 12150 }
17468 12151
17469 12152
17470 //----- (00419401) --------------------------------------------------------
17471 void __cdecl CharacterUI_SkillScreen_Draw()
17472 {
17473 unsigned int v0; // ecx@3
17474 GUIButton *pButton; // eax@3
17475 GUIFont *v2; // eax@8
17476 unsigned int v3; // esi@8
17477 int v4; // eax@10
17478 unsigned int v5; // esi@14
17479 int v6; // eax@17
17480 unsigned int v7; // esi@19
17481 int v8; // eax@21
17482 unsigned int v9; // esi@25
17483 int v10; // eax@27
17484 int a2; // [sp+10h] [bp-14h]@1
17485 int v12; // [sp+14h] [bp-10h]@8
17486 int v13; // [sp+14h] [bp-10h]@19
17487 int *v14; // [sp+18h] [bp-Ch]@8
17488 int *v15; // [sp+18h] [bp-Ch]@14
17489 int *v16; // [sp+18h] [bp-Ch]@19
17490 int *v17; // [sp+18h] [bp-Ch]@25
17491 Player *v18; // [sp+1Ch] [bp-8h]@8
17492 int a5; // [sp+20h] [bp-4h]@8
17493
17494 a2 = 0;
17495 if ( dword_507CC0 )
17496 sub_4196A0();
17497 v0 = uActiveCharacter;
17498 dword_507CC0 = uActiveCharacter;
17499 for ( pButton = pGUIWindow_CurrentMenu->pControlsHead; pButton; pButton = pButton->pNext )
17500 {
17501 if ( pButton->uControlID == 120 )
17502 {
17503 dword_50698C = pButton->uX;
17504 dword_506988 = pButton->uY;
17505 dword_506984 = pButton->uZ;
17506 dword_506980 = pButton->uW;
17507 pButton->uW = 0;
17508 pButton->uZ = 0;
17509 pButton->uY = 0;
17510 pButton->uX = 0;
17511 v0 = uActiveCharacter;
17512 }
17513 }
17514 v12 = 0;
17515 a5 = pGUIWindow_CurrentMenu->uNumControls;
17516 v18 = &pParty->pPlayers[v0-1];
17517 v2 = pFontLucida;
17518 v14 = pWeaponSkills;
17519 v3 = 2 * LOBYTE(pFontLucida->uFontHeight) + 13;
17520 do
17521 {
17522 if ( v18->pActiveSkills[*v14] & 0x3F )//crash
17523 {
17524 v4 = LOBYTE(v2->uFontHeight);
17525 v3 = v3 + v4 - 3;
17526 ++a2;
17527 ++v12;
17528 pGUIWindow_CurrentMenu->CreateButton(0x18u, v3, 0xCCu, v4 - 3, 3, *v14 | 0x8000, 0x79u, *v14, 0, "", 0, 0);
17529 v2 = pFontLucida;
17530 }
17531 ++v14;
17532 }
17533 while ( v14 <= &pWeaponSkills[8] );
17534 if ( !v12 )
17535 v3 = v3 + LOBYTE(v2->uFontHeight) - 3;
17536 v15 = pMagicSkills;
17537 v5 = v3 + 2 * LOBYTE(v2->uFontHeight) - 6;
17538 do
17539 {
17540 if ( v18->pActiveSkills[*v15] & 0x3F && a2 < 15 )
17541 {
17542 v6 = LOBYTE(v2->uFontHeight);
17543 v5 = v5 + v6 - 3;
17544 ++a2;
17545 pGUIWindow_CurrentMenu->CreateButton(0x18u, v5, 0xCCu, v6 - 3, 3, *v15 | 0x8000, 0x79u, *v15, 0, "", 0, 0);
17546 v2 = pFontLucida;
17547 }
17548 ++v15;
17549 }
17550 while ( v15 <= &pMagicSkills[8] );
17551 v13 = 0;
17552 v16 = pArmorSkills;
17553 v7 = 2 * LOBYTE(v2->uFontHeight) + 13;
17554 do
17555 {
17556 if ( v18->pActiveSkills[*v16] & 0x3F )
17557 {
17558 v8 = LOBYTE(v2->uFontHeight);
17559 v7 = v7 + v8 - 3;
17560 ++a2;
17561 ++v13;
17562 pGUIWindow_CurrentMenu->CreateButton(0xF6u, v7, 0xCCu, v8 - 3, 3, *v16 | 0x8000, 0x79u, *v16, 0, "", 0, 0);
17563 v2 = pFontLucida;
17564 }
17565 ++v16;
17566 }
17567 while ( v16 <= &pArmorSkills[4] );
17568 if ( !v13 )
17569 v7 = v7 + LOBYTE(v2->uFontHeight) - 3;
17570 v17 = pMiscSkills;
17571 v9 = v7 + 2 * LOBYTE(v2->uFontHeight) - 6;
17572 do
17573 {
17574 if ( v18->pActiveSkills[*v17] & 0x3F )
17575 {
17576 v10 = LOBYTE(v2->uFontHeight);
17577 v9 = v9 + v10 - 3;
17578 ++a2;
17579 pGUIWindow_CurrentMenu->CreateButton(0xF6u, v9, 0xCCu, v10 - 3, 3, *v17 | 0x8000, 0x79u, *v17, 0, "", 0, 0);
17580 v2 = pFontLucida;
17581 }
17582 ++v17;
17583 }
17584 while ( v17 <= &pMiscSkills[11] );
17585 if ( a2 )
17586 pGUIWindow_CurrentMenu->_41D08F(a2, 1, 0, a5);
17587 }