comparison UI/UICharacter.cpp @ 1483:223605b325b3

Слияние
author Ritor1
date Thu, 29 Aug 2013 12:04:55 +0600
parents cfd99b6177a3 92b63e3dca90
children 62c7f07bc05a
comparison
equal deleted inserted replaced
1482:cfd99b6177a3 1483:223605b325b3
41 unsigned int ui_character_stat_buffed_color; 41 unsigned int ui_character_stat_buffed_color;
42 unsigned int ui_character_stat_debuffed_color; 42 unsigned int ui_character_stat_debuffed_color;
43 unsigned int ui_character_skillinfo_can_learn; 43 unsigned int ui_character_skillinfo_can_learn;
44 unsigned int ui_character_skillinfo_can_learn_gm; 44 unsigned int ui_character_skillinfo_can_learn_gm;
45 unsigned int ui_character_skillinfo_cant_learn; 45 unsigned int ui_character_skillinfo_cant_learn;
46 unsigned int ui_character_condition_normal_color;
47 unsigned int ui_character_condition_light_color;
48 unsigned int ui_character_condition_moderate_color;
49 unsigned int ui_character_condition_severe_color;
46 std::array<unsigned int, 6> ui_character_award_color; 50 std::array<unsigned int, 6> ui_character_award_color;
47 51
48 unsigned int ui_game_minimap_outline_color; 52 unsigned int ui_game_minimap_outline_color;
49 unsigned int ui_game_minimap_actor_friendly_color; 53 unsigned int ui_game_minimap_actor_friendly_color;
50 unsigned int ui_game_minimap_actor_hostile_color; 54 unsigned int ui_game_minimap_actor_hostile_color;
105 ui_character_stat_debuffed_color = TargetColor(255, 35, 0); 109 ui_character_stat_debuffed_color = TargetColor(255, 35, 0);
106 110
107 ui_character_skillinfo_can_learn = TargetColor(255, 255, 255); 111 ui_character_skillinfo_can_learn = TargetColor(255, 255, 255);
108 ui_character_skillinfo_can_learn_gm = TargetColor(255, 255, 0); 112 ui_character_skillinfo_can_learn_gm = TargetColor(255, 255, 0);
109 ui_character_skillinfo_cant_learn = TargetColor(255, 0, 0); 113 ui_character_skillinfo_cant_learn = TargetColor(255, 0, 0);
114
115 ui_character_condition_normal_color = TargetColor(255, 255, 255);
116 ui_character_condition_light_color = TargetColor(0, 255, 0);
117 ui_character_condition_moderate_color = TargetColor(225, 205, 35);
118 ui_character_condition_severe_color = TargetColor(255, 35, 0);
110 119
111 ui_character_award_color[0] = TargetColor(248, 108, 160); 120 ui_character_award_color[0] = TargetColor(248, 108, 160);
112 ui_character_award_color[1] = TargetColor(112, 220, 248); 121 ui_character_award_color[1] = TargetColor(112, 220, 248);
113 ui_character_award_color[2] = TargetColor(192, 192, 240); 122 ui_character_award_color[2] = TargetColor(192, 192, 240);
114 ui_character_award_color[3] = TargetColor( 64, 244, 96); 123 ui_character_award_color[3] = TargetColor( 64, 244, 96);
183 std::array<unsigned int, 16> papredoll_dbrds; 192 std::array<unsigned int, 16> papredoll_dbrds;
184 unsigned int papredoll_drhs[4]; 193 unsigned int papredoll_drhs[4];
185 unsigned int papredoll_dlhus[4]; 194 unsigned int papredoll_dlhus[4];
186 unsigned int papredoll_dlhs[4]; 195 unsigned int papredoll_dlhs[4];
187 unsigned int papredoll_dbods[5]; 196 unsigned int papredoll_dbods[5];
188 int paperdoll_armor_texture[4][17][3]; 197 int paperdoll_armor_texture[4][17][3];//0x511294
189 //int paperdoll_array_51132C[165]; 198 //int paperdoll_array_51132C[165];
190 unsigned int papredoll_dlaus[5]; 199 unsigned int papredoll_dlaus[5];
191 unsigned int papredoll_dlads[4]; 200 unsigned int papredoll_dlads[4];
192 int papredoll_flying_feet[777]; // idb 201 int papredoll_flying_feet[777]; // idb
193 int paperdoll_boots_texture[4][6];//0x511638 202 int paperdoll_boots_texture[4][6];//0x511638
272 0x7B, 0xD8, 281 0x7B, 0xD8,
273 }; 282 };
274 283
275 int pPaperdoll_BodyX = 481; // 004E4C28 284 int pPaperdoll_BodyX = 481; // 004E4C28
276 int pPaperdoll_BodyY = 0; // 004E4C2C 285 int pPaperdoll_BodyY = 0; // 004E4C2C
277 const int paperdoll_Armor[4][17][2] = //4E4E30 286 const int paperdoll_Armor_Coord[4][17][2] = //4E4E30
278 { 287 {
279 // X Y 288 // X Y
280 0x2C, 0x67, 0x30, 0x69, 0x2D, 0x67, 0x2C, 0x64, 0x14, 0x66, 0x22, 0x67, 0x20, 0x66, 0x25, 0x66, 0x12, 0x66,//Human 289 0x2C, 0x67, 0x30, 0x69, 0x2D, 0x67, 0x2C, 0x64, 0x14, 0x66, 0x22, 0x67, 0x20, 0x66, 0x25, 0x66, 0x12, 0x66,//Human
281 0x0A, 0x66, 0x13, 0x64, 0x0E, 0x64, 0x0A, 0x63, 0x14, 0x66, 0x0A, 0x63, 0x0A, 0x66, 0x25, 0x66, 290 0x0A, 0x66, 0x13, 0x64, 0x0E, 0x64, 0x0A, 0x63, 0x14, 0x66, 0x0A, 0x63, 0x0A, 0x66, 0x25, 0x66,
282 291
287 0x12, 0x8B, 0x11, 0x8A, 0x15, 0x87, 0x09, 0x89, 0x12, 0x87, 0x09, 0x89, 0x12, 0x8B, 0x25, 0x87, 296 0x12, 0x8B, 0x11, 0x8A, 0x15, 0x87, 0x09, 0x89, 0x12, 0x87, 0x09, 0x89, 0x12, 0x8B, 0x25, 0x87,
288 297
289 0x33, 0x90, 0x32, 0x90, 0x34, 0x91, 0x32, 0x8E, 0x21, 0x8B, 0x31, 0x8B, 0x33, 0x8E, 0x2F, 0x8F, 0x16, 0x8D, 298 0x33, 0x90, 0x32, 0x90, 0x34, 0x91, 0x32, 0x8E, 0x21, 0x8B, 0x31, 0x8B, 0x33, 0x8E, 0x2F, 0x8F, 0x16, 0x8D,
290 0x18, 0x8C, 0x19, 0x8C, 0x1B, 0x8E, 0x0C, 0x8C, 0x21, 0x8B, 0x0C, 0x8C, 0x18, 0x8C, 0x2F, 0x8F, 299 0x18, 0x8C, 0x19, 0x8C, 0x1B, 0x8E, 0x0C, 0x8C, 0x21, 0x8B, 0x0C, 0x8C, 0x18, 0x8C, 0x2F, 0x8F,
291 }; 300 };
292 const int paperdoll_shoulder[4][17][2] = //4E5050 301 const int paperdoll_shoulder_coord[4][17][2] = //4E5050
293 { 302 {
294 0x64, 0x67, 0x61, 0x67, 0x65, 0x68, 0x6E, 0x74, 0x6C, 0x68, 0x61, 0x67, 0x66, 0x68, 0x6C, 0x6A, 0x6E, 0x6D, 303 0x64, 0x67, 0x61, 0x67, 0x65, 0x68, 0x6E, 0x74, 0x6C, 0x68, 0x61, 0x67, 0x66, 0x68, 0x6C, 0x6A, 0x6E, 0x6D,
295 0x67, 0x69, 0x70, 0x67, 0x6E, 0x6D, 0x6C, 0x6F, 0x6C, 0x68, 0x6C, 0x6F, 0x67, 0x69, 0x6C, 0x6A, 304 0x67, 0x69, 0x70, 0x67, 0x6E, 0x6D, 0x6C, 0x6F, 0x6C, 0x68, 0x6C, 0x6F, 0x67, 0x69, 0x6C, 0x6A,
296 305
297 0x60, 0x6B, 0x60, 0x6C, 0x60, 0x6B, 0x61, 0x6A, 0x60, 0x69, 0x60, 0x6A, 0x60, 0x6A, 0x61, 0x69, 0x63, 0x6A, 306 0x60, 0x6B, 0x60, 0x6C, 0x60, 0x6B, 0x61, 0x6A, 0x60, 0x69, 0x60, 0x6A, 0x60, 0x6A, 0x61, 0x69, 0x63, 0x6A,
301 0x71, 0x8D, 0x70, 0x8D, 0x72, 0x8D, 0x74, 0x8E, 0x6A, 0x89, 0x74, 0x8E, 0x71, 0x8D, 0x69, 0x8C, 310 0x71, 0x8D, 0x70, 0x8D, 0x72, 0x8D, 0x74, 0x8E, 0x6A, 0x89, 0x74, 0x8E, 0x71, 0x8D, 0x69, 0x8C,
302 311
303 0x72, 0x91, 0x72, 0x91, 0, 0, 0x6E, 0x92, 0x6F, 0x91, 0, 0, 0, 0, 0x6E, 0x91, 0x71, 0x90, 312 0x72, 0x91, 0x72, 0x91, 0, 0, 0x6E, 0x92, 0x6F, 0x91, 0, 0, 0, 0, 0x6E, 0x91, 0x71, 0x90,
304 0x72, 0x8D, 0x72, 0x90, 0x73, 0x93, 0x73, 0x90, 0x6F, 0x91, 0x73, 0x90, 0x72, 0x8D, 0x6E, 0x91, 313 0x72, 0x8D, 0x72, 0x90, 0x73, 0x93, 0x73, 0x90, 0x6F, 0x91, 0x73, 0x90, 0x72, 0x8D, 0x6E, 0x91,
305 }; 314 };
306 const int dword_4E5270[4][2] = 315 const int paperdoll_shoulder_second_coord[4][17][2] = //dword_4E5270
307 { 316 {
308 0, 0, 317 0, 0, 0x61, 0x67, 0, 0, 0x64, 0x69, 0x64, 0x68, 0, 0, 0, 0, 0x5E, 0x66, 0x5F, 0x69,
309 0x61, 0x67, 318 0x55, 0x69, 0x5F, 0x67, 0x5F, 0x68, 0x32, 0x69, 0x64, 0x68, 0x32, 0x69, 0x55, 0x69, 0x5E, 0x66,
310 0, 0, 319
311 0x64, 0x69, 320 0, 0, 0x60, 0x6C, 0, 0, 0x60, 0x6C, 0x5E, 0x69, 0, 0, 0, 0, 0x5D, 0x6A, 0x5B, 0x6A,
321 0x5B, 0x6A, 0x59, 0x69, 0x56, 0x68, 0x38, 0x6E, 0x5E, 0x69, 0x38, 0x6E, 0x5B, 0x6A, 0x5D, 0x6A,
322
323 0, 0, 0x75, 0x8C, 0, 0, 0x72, 0x8D, 0x62, 0x89, 0, 0, 0, 0, 0x69, 0x8C, 0x5E, 0x8D,
324 0x61, 0x8D, 0x5F, 0x8D, 0x60, 0x8D, 0x2E, 0x8C, 0x62, 0x89, 0x2E, 0x8C, 0x61, 0x8D, 0x69, 0x8C,
325
326 0, 0, 0x72, 0x91, 0, 0, 0x72, 0x91, 0x67, 0x8F, 0, 0, 0, 0, 0x6E, 0x91, 0x64, 0x93,
327 0x65, 0x8C, 0x65, 0x91, 0x67, 0x91, 0x36, 0x90, 0x67, 0x8F, 0x36, 0x90, 0x65, 0x8C, 0x6E, 0x91,
312 }; 328 };
313 329
314 const char *dlad_texnames_by_face[25] = 330 const char *dlad_texnames_by_face[25] =
315 { 331 {
316 "pc01lad", "pc02lad", "pc03lad", "pc04lad", "pc05lad", "pc06lad", 332 "pc01lad", "pc02lad", "pc03lad", "pc04lad", "pc05lad", "pc06lad",
561 } 577 }
562 578
563 //----- (0041A000) -------------------------------------------------------- 579 //----- (0041A000) --------------------------------------------------------
564 void CharacterUI_AwardsTab_Draw(Player *player) 580 void CharacterUI_AwardsTab_Draw(Player *player)
565 { 581 {
566 unsigned int result; // eax@1 582 int items_per_page; // eax@1
567 char *v6; // ebx@15 583 char *v6; // ebx@15
568 char Source[100]; // [sp+Ch] [bp-C4h]@1 584 char Source[100]; // [sp+Ch] [bp-C4h]@1
569 GUIWindow awards_window; // [sp+70h] [bp-60h]@1 585 GUIWindow awards_window; // [sp+70h] [bp-60h]@1
570 586
571 pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->LoadTexturePtr("fr_award", TEXTURE_16BIT_PALETTE)); 587 pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->LoadTexturePtr("fr_award", TEXTURE_16BIT_PALETTE));
573 sprintfex(Source, pGlobalTXT_LocalizationStrings[LOCSTR_S_THE_S], player->pName, pClassNames[player->classType]); 589 sprintfex(Source, pGlobalTXT_LocalizationStrings[LOCSTR_S_THE_S], player->pName, pClassNames[player->classType]);
574 strcat(pTmpBuf.data(), Source); 590 strcat(pTmpBuf.data(), Source);
575 strcat(pTmpBuf.data(), "\f00000"); 591 strcat(pTmpBuf.data(), "\f00000");
576 592
577 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 24, 18, 0, pTmpBuf.data(), 0, 0, 0); 593 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 24, 18, 0, pTmpBuf.data(), 0, 0, 0);
578 result = books_primary_item_per_page; 594 items_per_page = books_primary_item_per_page;
579 awards_window.uFrameX = 12; 595 awards_window.uFrameX = 12;
580 awards_window.uFrameY = 48; 596 awards_window.uFrameY = 48;
581 awards_window.uFrameWidth = 424; 597 awards_window.uFrameWidth = 424;
582 awards_window.uFrameHeight = 290; 598 awards_window.uFrameHeight = 290;
583 awards_window.uFrameZ = 435; 599 awards_window.uFrameZ = 435;
584 awards_window.uFrameW = 337; 600 awards_window.uFrameW = 337;
585 if (BtnDown_flag && num_achieved_awards + books_primary_item_per_page < full_num_items_in_book) 601 if (BtnDown_flag && num_achieved_awards + books_primary_item_per_page < full_num_items_in_book)
586 result = books_primary_item_per_page++ + 1; 602 items_per_page = books_primary_item_per_page++ + 1;
587 if (BtnUp_flag && result) 603 if (BtnUp_flag && items_per_page)
588 { 604 {
589 --result; 605 --items_per_page;
590 books_primary_item_per_page = result; 606 books_primary_item_per_page = items_per_page;
591 } 607 }
592 608
593 if ( books_page_number < 0 ) 609 if ( books_page_number < 0 )
594 { 610 {
595 result += num_achieved_awards; 611 items_per_page += num_achieved_awards;
596 books_primary_item_per_page = result; 612 books_primary_item_per_page = items_per_page;
597 if ( (signed int)(num_achieved_awards + result) > full_num_items_in_book ) 613 if ( (signed int)(num_achieved_awards + items_per_page) > full_num_items_in_book )
598 { 614 {
599 result = full_num_items_in_book - num_achieved_awards; 615 items_per_page = full_num_items_in_book - num_achieved_awards;
600 books_primary_item_per_page = result; 616 books_primary_item_per_page = items_per_page;
601 } 617 }
602 } 618 }
603 else if ( books_page_number > 0 ) 619 else if ( books_page_number > 0 )
604 { 620 {
605 result -= num_achieved_awards; 621 items_per_page -= num_achieved_awards;
606 books_primary_item_per_page = result; 622 books_primary_item_per_page = items_per_page;
607 if ( (result & 0x80000000u) != 0 ) 623 if ( items_per_page < 0 )
608 { 624 {
609 result = 0; 625 items_per_page = 0;
610 books_primary_item_per_page = result; 626 books_primary_item_per_page = items_per_page;
611 } 627 }
612 } 628 }
613 BtnDown_flag = 0; 629 BtnDown_flag = 0;
614 BtnUp_flag = 0; 630 BtnUp_flag = 0;
615 num_achieved_awards = 0; 631 num_achieved_awards = 0;
616 books_page_number = 0; 632 books_page_number = 0;
617 633
618 for ( int i = result; i < full_num_items_in_book; ++i) 634 for ( int i = items_per_page; i < full_num_items_in_book; ++i)
619 { 635 {
620 v6 = (char *)pAwards[achieved_awards[i]].pText;//(char *)dword_723E80_award_related[v20 / 4]; 636 v6 = (char *)pAwards[achieved_awards[i]].pText;//(char *)dword_723E80_award_related[v20 / 4];
621 pTmpBuf[0] = 0; 637 pTmpBuf[0] = 0;
622 switch (achieved_awards[i]) 638 switch (achieved_awards[i])
623 { 639 {
665 pRenderer->ClearZBuffer(0, 479); 681 pRenderer->ClearZBuffer(0, 479);
666 switch (pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0]) 682 switch (pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0])
667 { 683 {
668 case WINDOW_CharacterWindow_Stats: // stats 684 case WINDOW_CharacterWindow_Stats: // stats
669 CharacterUI_ReleaseButtons(); 685 CharacterUI_ReleaseButtons();
670 sub_419379(); 686 ReleaseAwardsScrollBar();
671 CharacterUI_StatsTab_Draw(player); 687 CharacterUI_StatsTab_Draw(player);
672 pRenderer->DrawTextureIndexed(pCharacterScreen_StatsBtn->uX, 688 pRenderer->DrawTextureIndexed(pCharacterScreen_StatsBtn->uX,
673 pCharacterScreen_StatsBtn->uY, 689 pCharacterScreen_StatsBtn->uY,
674 pIcons_LOD->LoadTexturePtr("ib-cd1-d", TEXTURE_16BIT_PALETTE)); 690 pIcons_LOD->LoadTexturePtr("ib-cd1-d", TEXTURE_16BIT_PALETTE));
675 break; 691 break;
678 if (dword_507CC0_activ_ch != uActiveCharacter) 694 if (dword_507CC0_activ_ch != uActiveCharacter)
679 { 695 {
680 CharacterUI_ReleaseButtons(); 696 CharacterUI_ReleaseButtons();
681 CharacterUI_SkillsTab_CreateButtons(); 697 CharacterUI_SkillsTab_CreateButtons();
682 } 698 }
683 sub_419379(); 699 ReleaseAwardsScrollBar();
684 CharacterUI_SkillsTab_Draw(player); 700 CharacterUI_SkillsTab_Draw(player);
685 pRenderer->DrawTextureIndexed(pCharacterScreen_SkillsBtn->uX, 701 pRenderer->DrawTextureIndexed(pCharacterScreen_SkillsBtn->uX,
686 pCharacterScreen_SkillsBtn->uY, 702 pCharacterScreen_SkillsBtn->uY,
687 pIcons_LOD->LoadTexturePtr("ib-cd2-d", TEXTURE_16BIT_PALETTE)); 703 pIcons_LOD->LoadTexturePtr("ib-cd2-d", TEXTURE_16BIT_PALETTE));
688 break; 704 break;
689 705
690 case WINDOW_CharacterWindow_Awards: // awards 706 case WINDOW_CharacterWindow_Awards: // awards
691 CharacterUI_ReleaseButtons(); 707 CharacterUI_ReleaseButtons();
692 sub_419379(); 708 ReleaseAwardsScrollBar();
693 CreateAwardsScrollBar(); 709 CreateAwardsScrollBar();
694 CharacterUI_AwardsTab_Draw(player); 710 CharacterUI_AwardsTab_Draw(player);
695 pRenderer->DrawTextureIndexed(pCharacterScreen_AwardsBtn->uX, 711 pRenderer->DrawTextureIndexed(pCharacterScreen_AwardsBtn->uX,
696 pCharacterScreen_AwardsBtn->uY, 712 pCharacterScreen_AwardsBtn->uY,
697 pIcons_LOD->LoadTexturePtr("ib-cd4-d", TEXTURE_16BIT_PALETTE)); 713 pIcons_LOD->LoadTexturePtr("ib-cd4-d", TEXTURE_16BIT_PALETTE));
698 break; 714 break;
699 715
700 case WINDOW_CharacterWindow_Inventory: // inventory and other 716 case WINDOW_CharacterWindow_Inventory: // inventory and other
701 CharacterUI_ReleaseButtons(); 717 CharacterUI_ReleaseButtons();
702 sub_419379(); 718 ReleaseAwardsScrollBar();
703 CharacterUI_InventoryTab_Draw(player, false); 719 CharacterUI_InventoryTab_Draw(player, false);
704 pRenderer->DrawTextureIndexed(pCharacterScreen_InventoryBtn->uX, 720 pRenderer->DrawTextureIndexed(pCharacterScreen_InventoryBtn->uX,
705 pCharacterScreen_InventoryBtn->uY, 721 pCharacterScreen_InventoryBtn->uY,
706 pIcons_LOD->LoadTexturePtr("ib-cd3-d", TEXTURE_16BIT_PALETTE)); 722 pIcons_LOD->LoadTexturePtr("ib-cd3-d", TEXTURE_16BIT_PALETTE));
707 break; 723 break;
945 index = item->uItemID - 66; 961 index = item->uItemID - 66;
946 break; 962 break;
947 } 963 }
948 if ( index >= 0 && index < 17 ) 964 if ( index >= 0 && index < 17 )
949 { 965 {
950 item_X = pPaperdoll_BodyX + paperdoll_Armor[pBodyComplection][index][0]; 966 item_X = pPaperdoll_BodyX + paperdoll_Armor_Coord[pBodyComplection][index][0];
951 item_Y = pPaperdoll_BodyY + paperdoll_Armor[pBodyComplection][index][1]; 967 item_Y = pPaperdoll_BodyY + paperdoll_Armor_Coord[pBodyComplection][index][1];
952 if ( !(item->uAttributes & 0xF0) ) 968 if ( !(item->uAttributes & 0xF0) )
953 { 969 {
954 if ( item->uAttributes & 2 ) 970 if ( item->uAttributes & 2 )
955 pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_armor_texture[pBodyComplection][index][0])); 971 pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_armor_texture[pBodyComplection][index][0]));
956 else 972 else
978 item->uAttributes &= 0xFFFFFF0Fu; 994 item->uAttributes &= 0xFFFFFF0Fu;
979 ptr_50C9A4 = 0; 995 ptr_50C9A4 = 0;
980 } 996 }
981 pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_armor_texture[pBodyComplection][index][0]), 997 pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_armor_texture[pBodyComplection][index][0]),
982 pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), GetTickCount() * 0.1, 0, 255); 998 pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), GetTickCount() * 0.1, 0, 255);
983 }
984 //--------------------------------(Shoulder/)---------------------------------------------
985 if ( pPlayers[uPlayerID]->pEquipment.uMainHand
986 && (pPlayers[uPlayerID]->GetEquippedItemEquipType(EQUIP_MAIN_HAND) == EQUIP_MAIN_HAND ||
987 pPlayers[uPlayerID]->GetEquippedItemSkillType(EQUIP_MAIN_HAND) == EQUIP_SHIELD &&
988 !pPlayers[uPlayerID]->pEquipment.uShield) )//
989 {
990 v94 = paperdoll_armor_texture[pBodyComplection][index][2];
991 if ( paperdoll_armor_texture[pBodyComplection][index][2] == pIcons_LOD->FindTextureByName("pending") )
992 {
993 v94 = paperdoll_armor_texture[pBodyComplection][index][1];
994 item_X = pPaperdoll_BodyX + paperdoll_shoulder[pBodyComplection][index][0];
995 item_Y = pPaperdoll_BodyY + paperdoll_shoulder[pBodyComplection][index][1];
996 }
997 else
998 {
999 item_X = pPaperdoll_BodyX + dword_4E5270[index][0];
1000 item_Y = pPaperdoll_BodyY + dword_4E5270[index][1];
1001 }
1002 if ( !(item->uAttributes & 0xF0) )
1003 {
1004 //v98 = v94 + 1;
1005 if ( item->uAttributes & 2 )
1006 pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(v94));
1007 else
1008 {
1009 if ( item->uAttributes & 1 )
1010 pRenderer->DrawTextureTransparent(item_X, item_Y, pIcons_LOD->GetTexture(v94));
1011 else
1012 pRenderer->DrawTransparentGreenShade(item_X, item_Y, pIcons_LOD->GetTexture(v94));
1013 }
1014 }
1015 else
1016 {
1017 if ( paperdoll_armor_texture[pBodyComplection][index][2] != pIcons_LOD->FindTextureByName("pending") )
1018 {
1019 if ( item->uAttributes & 0xF0 )
1020 {
1021 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_RED )
1022 container = "sptext01";
1023 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_BLUE )
1024 container = "sp28a";
1025 if ( ( item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_GREEN )
1026 container = "sp30a";
1027 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_PURPLE )
1028 container = "sp91a";
1029 _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed;
1030 if ( _50C9A8_item_enchantment_timer <= 0 )
1031 {
1032 _50C9A8_item_enchantment_timer = 0;
1033 item->uAttributes &= 0xFFFFFF0Fu;
1034 ptr_50C9A4 = 0;
1035 }
1036 pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(v94), pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE),
1037 GetTickCount() * 0.1, 0, 255);
1038 }
1039 }
1040 }
1041 }
1042 else//
1043 {
1044 //v94 = paperdoll_armor_texture[pBodyComplection][index][1];
1045 if ( paperdoll_armor_texture[pBodyComplection][index][1] != pIcons_LOD->FindTextureByName("pending") )
1046 {
1047 item_X = pPaperdoll_BodyX + paperdoll_shoulder[pBodyComplection][index][0];
1048 item_Y = pPaperdoll_BodyY + paperdoll_shoulder[pBodyComplection][index][1];
1049 if ( !(item->uAttributes & 0xF0) )
1050 {
1051 if ( item->uAttributes & 2 )
1052 pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_armor_texture[pBodyComplection][index][2]));
1053 else
1054 {
1055 if ( item->uAttributes & 1 )
1056 pRenderer->DrawTextureTransparent(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_armor_texture[pBodyComplection][index][2]));
1057 else
1058 pRenderer->DrawTransparentGreenShade(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_armor_texture[pBodyComplection][index][2]));
1059 }
1060 }
1061 else
1062 {
1063 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_RED )
1064 container = "sptext01";
1065 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_BLUE )
1066 container = "sp28a";
1067 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_GREEN )
1068 container = "sp30a";
1069 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_PURPLE )
1070 container = "sp91a";
1071 _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed;
1072 if ( _50C9A8_item_enchantment_timer <= 0 )
1073 {
1074 _50C9A8_item_enchantment_timer = 0;
1075 item->uAttributes &= 0xFFFFFF0Fu;
1076 ptr_50C9A4 = 0;
1077 }
1078 pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_armor_texture[pBodyComplection][index][1]),
1079 pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), GetTickCount() * 0.1, 0, 255);
1080 }
1081 }
1082 } 999 }
1083 1000
1084 if ( !bRingsShownInCharScreen ) 1001 if ( !bRingsShownInCharScreen )
1085 pRenderer->DrawMaskToZBuffer(item_X, item_Y, &pIcons_LOD->pTextures[paperdoll_armor_texture[pBodyComplection][index][0]], 1002 pRenderer->DrawMaskToZBuffer(item_X, item_Y, &pIcons_LOD->pTextures[paperdoll_armor_texture[pBodyComplection][index][0]],
1086 pPlayers[uPlayerID]->pEquipment.uArmor); 1003 pPlayers[uPlayerID]->pEquipment.uArmor);
1220 || pItemsTable->pItems[pPlayers[uPlayerID]->pInventoryItemList[pPlayers[uPlayerID]->pEquipment.uMainHand - 1].uItemID].uSkillType == PLAYER_SKILL_SPEAR 1137 || pItemsTable->pItems[pPlayers[uPlayerID]->pInventoryItemList[pPlayers[uPlayerID]->pEquipment.uMainHand - 1].uItemID].uSkillType == PLAYER_SKILL_SPEAR
1221 && !pPlayers[uPlayerID]->pEquipment.uShield ) 1138 && !pPlayers[uPlayerID]->pEquipment.uShield )
1222 pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_SecondLeftHand[pBodyComplection][0], 1139 pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_SecondLeftHand[pBodyComplection][0],
1223 pPaperdoll_BodyY + pPaperdoll_SecondLeftHand[pBodyComplection][1], pIcons_LOD->GetTexture(papredoll_dlaus[uPlayerID - 1])); 1140 pPaperdoll_BodyY + pPaperdoll_SecondLeftHand[pBodyComplection][1], pIcons_LOD->GetTexture(papredoll_dlaus[uPlayerID - 1]));
1224 } 1141 }
1142 //--------------------------------(Shoulder/)---------------------------------------------
1143 item = &pPlayers[uPlayerID]->pInventoryItemList[pPlayers[uPlayerID]->pEquipment.uArmor - 1];
1144 switch ( item->uItemID )
1145 {
1146 case ITEM_ARTICACT_GOVERNONS_ARMOR:
1147 index = 15;
1148 break;
1149 case ITEM_ARTIFACT_YORUBA:
1150 index = 14;
1151 break;
1152 case ITEM_RELIC_HARECS_LEATHER:
1153 index = 13;
1154 break;
1155 case ITEM_ELVEN_CHAINMAIL:
1156 index = 16;
1157 break;
1158 default:
1159 index = item->uItemID - 66;
1160 break;
1161 }
1162 if ( index >= 0 && index < 17 )
1163 {
1164 if ( pPlayers[uPlayerID]->pEquipment.uMainHand
1165 && (pPlayers[uPlayerID]->GetEquippedItemEquipType(EQUIP_MAIN_HAND) == EQUIP_MAIN_HAND
1166 || pPlayers[uPlayerID]->GetEquippedItemSkillType(EQUIP_MAIN_HAND) == EQUIP_SHIELD
1167 && !pPlayers[uPlayerID]->pEquipment.uShield) )//
1168 {
1169 v94 = paperdoll_armor_texture[pBodyComplection][index][2];
1170 if ( paperdoll_armor_texture[pBodyComplection][index][2] == pIcons_LOD->FindTextureByName("pending") )
1171 {
1172 v94 = paperdoll_armor_texture[pBodyComplection][index][1];
1173 item_X = pPaperdoll_BodyX + paperdoll_shoulder_coord[pBodyComplection][index][0];
1174 item_Y = pPaperdoll_BodyY + paperdoll_shoulder_coord[pBodyComplection][index][1];
1175 }
1176 else
1177 {
1178 item_X = pPaperdoll_BodyX + paperdoll_shoulder_second_coord[pBodyComplection][index][0];
1179 item_Y = pPaperdoll_BodyY + paperdoll_shoulder_second_coord[pBodyComplection][index][1];
1180 }
1181 if ( v94 != pIcons_LOD->FindTextureByName("pending") )
1182 {
1183 if ( !(item->uAttributes & 0xF0) )
1184 {
1185 if ( item->uAttributes & 2 )
1186 pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(v94));
1187 else
1188 {
1189 if ( item->uAttributes & 1 )
1190 pRenderer->DrawTextureTransparent(item_X, item_Y, pIcons_LOD->GetTexture(v94));
1191 else
1192 pRenderer->DrawTransparentGreenShade(item_X, item_Y, pIcons_LOD->GetTexture(v94));
1193 }
1194 }
1195 else
1196 {
1197 if ( paperdoll_armor_texture[pBodyComplection][index][2] != pIcons_LOD->FindTextureByName("pending") )
1198 {
1199 if ( item->uAttributes & 0xF0 )
1200 {
1201 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_RED )
1202 container = "sptext01";
1203 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_BLUE )
1204 container = "sp28a";
1205 if ( ( item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_GREEN )
1206 container = "sp30a";
1207 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_PURPLE )
1208 container = "sp91a";
1209 _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed;
1210 if ( _50C9A8_item_enchantment_timer <= 0 )
1211 {
1212 _50C9A8_item_enchantment_timer = 0;
1213 item->uAttributes &= 0xFFFFFF0Fu;
1214 ptr_50C9A4 = 0;
1215 }
1216 pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(v94), pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE),
1217 GetTickCount() * 0.1, 0, 255);
1218 }
1219 }
1220 }
1221 }
1222 }
1223 else//
1224 {
1225 //v94 = paperdoll_armor_texture[pBodyComplection][index][1];
1226 if ( paperdoll_armor_texture[pBodyComplection][index][1] != pIcons_LOD->FindTextureByName("pending") )
1227 {
1228 item_X = pPaperdoll_BodyX + paperdoll_shoulder_coord[pBodyComplection][index][0];
1229 item_Y = pPaperdoll_BodyY + paperdoll_shoulder_coord[pBodyComplection][index][1];
1230 if ( !(item->uAttributes & 0xF0) )
1231 {
1232 if ( item->uAttributes & 2 )
1233 pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_armor_texture[pBodyComplection][index][1]));
1234 else
1235 {
1236 if ( item->uAttributes & 1 )
1237 pRenderer->DrawTextureTransparent(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_armor_texture[pBodyComplection][index][1]));
1238 else
1239 pRenderer->DrawTransparentGreenShade(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_armor_texture[pBodyComplection][index][1]));
1240 }
1241 }
1242 else
1243 {
1244 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_RED )
1245 container = "sptext01";
1246 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_BLUE )
1247 container = "sp28a";
1248 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_GREEN )
1249 container = "sp30a";
1250 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_PURPLE )
1251 container = "sp91a";
1252 _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed;
1253 if ( _50C9A8_item_enchantment_timer <= 0 )
1254 {
1255 _50C9A8_item_enchantment_timer = 0;
1256 item->uAttributes &= 0xFFFFFF0Fu;
1257 ptr_50C9A4 = 0;
1258 }
1259 pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_armor_texture[pBodyComplection][index][1]),
1260 pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), GetTickCount() * 0.1, 0, 255);
1261 }
1262 }
1263 }
1264 }
1225 //----------------------------------------------(Cloak collar/ )------------------------------------- 1265 //----------------------------------------------(Cloak collar/ )-------------------------------------
1226 if ( pPlayers[uPlayerID]->pEquipment.uCloak ) 1266 if ( pPlayers[uPlayerID]->pEquipment.uCloak )
1227 { 1267 {
1228 item = &pPlayers[uPlayerID]->pInventoryItemList[pPlayers[uPlayerID]->pEquipment.uCloak - 1]; 1268 item = &pPlayers[uPlayerID]->pInventoryItemList[pPlayers[uPlayerID]->pEquipment.uCloak - 1];
1229 switch ( item->uItemID ) 1269 switch ( item->uItemID )
1501 } 1541 }
1502 1542
1503 //----- (0041A2D1) -------------------------------------------------------- 1543 //----- (0041A2D1) --------------------------------------------------------
1504 void CharacterUI_InventoryTab_Draw(Player *player, bool a2) 1544 void CharacterUI_InventoryTab_Draw(Player *player, bool a2)
1505 { 1545 {
1506 Texture *v7; // esi@6 1546 Texture *pTexture; // esi@6
1507 signed int v11; // edx@6 1547 int v13; // eax@13
1508 int v13; // eax@13 1548 int v15; // eax@13
1509 signed int v14; // edx@13 1549 unsigned int v17; // edi@15
1510 int v15; // eax@13 1550 unsigned int uCellX; // [sp+30h] [bp-8h]@5
1511 unsigned int v17; // edi@15 1551 unsigned int uCellY; // [sp+34h] [bp-4h]@5
1512 Texture *pTexture; // ebx@24
1513 unsigned int uCellX; // [sp+30h] [bp-8h]@5
1514 unsigned int uCellY; // [sp+34h] [bp-4h]@5
1515 1552
1516 pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->GetTexture(uTextureID_CharacterUI_InventoryBackground)); 1553 pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->GetTexture(uTextureID_CharacterUI_InventoryBackground));
1517 if (a2) 1554 if (a2)
1518 pRenderer->DrawTextureIndexed(8, 305, pIcons_LOD->LoadTexturePtr("fr_strip", TEXTURE_16BIT_PALETTE)); 1555 pRenderer->DrawTextureIndexed(8, 305, pIcons_LOD->LoadTexturePtr("fr_strip", TEXTURE_16BIT_PALETTE));
1519
1520 int i = 0;
1521 for (uint i = 0; i < 126; ++i) 1556 for (uint i = 0; i < 126; ++i)
1522 { 1557 {
1523 int v26 = (int)(player->pInventoryMatrix + i); 1558 if ( player->pInventoryMatrix[i] <= 0 )
1524
1525 if (player->pInventoryMatrix[i] <= 0)
1526 continue; 1559 continue;
1527 1560 if ( !player->pInventoryItemList[player->pInventoryMatrix[i] - 1].uItemID )
1528 int item_idx = player->pInventoryMatrix[i];
1529 auto item = &player->pInventoryItemList[item_idx - 1];
1530 if (!item->uItemID)
1531 continue; 1561 continue;
1532
1533 uCellY = 32 * (i / 14) + 17; 1562 uCellY = 32 * (i / 14) + 17;
1534 uCellX = 32 * (i % 14) + 14; 1563 uCellX = 32 * (i % 14) + 14;
1535 uint item_texture_id = pIcons_LOD->LoadTexture(pItemsTable->pItems[item->uItemID].pIconName, TEXTURE_16BIT_PALETTE); 1564 uint item_texture_id = pIcons_LOD->LoadTexture(pItemsTable->pItems[player->pInventoryItemList[player->pInventoryMatrix[i] - 1].uItemID].pIconName, TEXTURE_16BIT_PALETTE);
1536 v7 = pIcons_LOD->GetTexture(item_texture_id); 1565 pTexture = pIcons_LOD->GetTexture(item_texture_id);
1537 1566 if (pTexture->uTextureWidth < 14)
1538 v11 = v7->uTextureWidth; 1567 pTexture->uTextureWidth = 14;
1539 if (v11 < 14) 1568 if ( (pTexture->uTextureWidth - 14) / 32 == 0 && pTexture->uTextureWidth < 32)
1540 v11 = 14; 1569 uCellX += (32 - pTexture->uTextureWidth) / 2;
1541 1570 v13 = pTexture->uTextureWidth - 14;
1542 if ( (v11 - 14) / 32 == 0 && v7->uTextureWidth < 32) 1571 LOBYTE(v13) = v13 & 0xE0;
1543 uCellX += (32 - v7->uTextureWidth) / 2; 1572 v15 = v13 + 32;
1544 v13 = v11 - 14; 1573 if (pTexture->uTextureHeight < 14 )
1545 LOBYTE(v13) = v13 & 0xE0; 1574 pTexture->uTextureHeight = 14;
1546 v15 = v13 + 32; 1575 v17 = uCellX + ((v15 - pTexture->uTextureWidth) >> 1) + pSRZBufferLineOffsets[uCellY + (( (int)((pTexture->uTextureHeight - 14) & 0xFFFFFFE0) - pTexture->uTextureHeight + 32) >> 1)]; //added typecast. without it the value in the brackets got cat to unsigned which messed stuff up
1547 v14 = v7->uTextureHeight; 1576 if (player->pInventoryItemList[player->pInventoryMatrix[i] - 1].uAttributes & 0xF0)
1548 if (v14 < 14 ) 1577 {
1549 v14 = 14; 1578 switch (player->pInventoryItemList[player->pInventoryMatrix[i] - 1].uAttributes & 0xF0)
1550 v17 = uCellX + ((v15 - v7->uTextureWidth) >> 1) + pSRZBufferLineOffsets[uCellY + (( (int)((v14 - 14) & 0xFFFFFFE0) - v7->uTextureHeight + 32) >> 1)]; //added typecast. without it the value in the brackets got cat to unsigned which messed stuff up
1551
1552 if (item->uAttributes & 0xF0)
1553 {
1554 switch (item->uAttributes & 0xF0)
1555 { 1579 {
1556 case ITEM_AURA_EFFECT_RED: pTexture = pIcons_LOD->LoadTexturePtr("sptext01", TEXTURE_16BIT_PALETTE); break; 1580 case ITEM_AURA_EFFECT_RED: pTexture = pIcons_LOD->LoadTexturePtr("sptext01", TEXTURE_16BIT_PALETTE); break;
1557 case ITEM_AURA_EFFECT_BLUE: pTexture = pIcons_LOD->LoadTexturePtr("sp28a", TEXTURE_16BIT_PALETTE); break; 1581 case ITEM_AURA_EFFECT_BLUE: pTexture = pIcons_LOD->LoadTexturePtr("sp28a", TEXTURE_16BIT_PALETTE); break;
1558 case ITEM_AURA_EFFECT_GREEN: pTexture = pIcons_LOD->LoadTexturePtr("sp30a", TEXTURE_16BIT_PALETTE); break; 1582 case ITEM_AURA_EFFECT_GREEN: pTexture = pIcons_LOD->LoadTexturePtr("sp30a", TEXTURE_16BIT_PALETTE); break;
1559 case ITEM_AURA_EFFECT_PURPLE: pTexture = pIcons_LOD->LoadTexturePtr("sp91a", TEXTURE_16BIT_PALETTE); break; 1583 case ITEM_AURA_EFFECT_PURPLE: pTexture = pIcons_LOD->LoadTexturePtr("sp91a", TEXTURE_16BIT_PALETTE); break;
1560 } 1584 }
1561
1562 _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; 1585 _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed;
1563 if (_50C9A8_item_enchantment_timer <= 0) 1586 if (_50C9A8_item_enchantment_timer <= 0)
1564 { 1587 {
1565 _50C9A8_item_enchantment_timer = 0; 1588 _50C9A8_item_enchantment_timer = 0;
1566 LOBYTE(item->uAttributes) &= 0xF; 1589 LOBYTE(player->pInventoryItemList[player->pInventoryMatrix[i] - 1].uAttributes) &= 0xF;
1567 ptr_50C9A4 = 0; 1590 ptr_50C9A4 = 0;
1568 } 1591 }
1569 1592 pRenderer->DrawAura(uCellX, uCellY, pTexture, pTexture, GetTickCount() * 0.1, 0, 255);
1570 pRenderer->DrawAura(uCellX, uCellY, v7, pTexture, GetTickCount() * 0.1, 0, 255); 1593 ZBuffer_Fill(&pRenderer->pActiveZBuffer[v17], item_texture_id, player->pInventoryMatrix[i]);
1571 ZBuffer_Fill(&pRenderer->pActiveZBuffer[v17], item_texture_id, item_idx);
1572 } 1594 }
1573 else 1595 else
1574 { 1596 {
1575 if (item->Identified() || pCurrentScreen != SCREEN_HOUSE) 1597 if (player->pInventoryItemList[player->pInventoryMatrix[i] - 1].Identified() || pCurrentScreen != SCREEN_HOUSE)
1576 { 1598 {
1577 if (item->Broken()) 1599 if (player->pInventoryItemList[player->pInventoryMatrix[i] - 1].Broken())
1578 pRenderer->DrawTransparentRedShade(uCellX, uCellY, v7); 1600 pRenderer->DrawTransparentRedShade(uCellX, uCellY, pTexture);
1579 else 1601 else
1580 pRenderer->DrawTextureTransparent(uCellX, uCellY, v7); 1602 pRenderer->DrawTextureTransparent(uCellX, uCellY, pTexture);
1581 } 1603 }
1582 else 1604 else
1583 pRenderer->DrawTransparentGreenShade(uCellX, uCellY, v7); 1605 pRenderer->DrawTransparentGreenShade(uCellX, uCellY, pTexture);
1584 1606 ZBuffer_Fill(&pRenderer->pActiveZBuffer[v17], item_texture_id, player->pInventoryMatrix[i]);
1585 ZBuffer_Fill(&pRenderer->pActiveZBuffer[v17], item_texture_id, item_idx);
1586 continue; 1607 continue;
1587 } 1608 }
1588 } 1609 }
1589 } 1610 }
1590
1591
1592 1611
1593 static void CharacterUI_DrawItem(int x, int y, ItemGen *item, int id) 1612 static void CharacterUI_DrawItem(int x, int y, ItemGen *item, int id)
1594 { 1613 {
1595 auto item_texture = pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[item->uItemID].pIconName, TEXTURE_16BIT_PALETTE); 1614 auto item_texture = pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[item->uItemID].pIconName, TEXTURE_16BIT_PALETTE);
1596 1615
1625 1644
1626 pRenderer->ZBuffer_Fill_2(x, y, item_texture, id); 1645 pRenderer->ZBuffer_Fill_2(x, y, item_texture, id);
1627 } 1646 }
1628 } 1647 }
1629 1648
1630
1631 //----- (0043E825) -------------------------------------------------------- 1649 //----- (0043E825) --------------------------------------------------------
1632 void CharacterUI_DrawPaperdollWithRingOverlay(Player *player) 1650 void CharacterUI_DrawPaperdollWithRingOverlay(Player *player)
1633 { 1651 {
1634 CharacterUI_DrawPaperdoll(player); 1652 CharacterUI_DrawPaperdoll(player);
1635
1636 pRenderer->DrawTextureTransparent(0x1D9u, 0, pIcons_LOD->GetTexture(uTextureID_BACKHAND)); 1653 pRenderer->DrawTextureTransparent(0x1D9u, 0, pIcons_LOD->GetTexture(uTextureID_BACKHAND));
1637 pRenderer->DrawTextureTransparent(0x1D4u, 0, pIcons_LOD->GetTexture(uTextureID_right_panel_loop)); 1654 pRenderer->DrawTextureTransparent(0x1D4u, 0, pIcons_LOD->GetTexture(uTextureID_right_panel_loop));
1638 pRenderer->DrawTextureIndexed(pCharacterScreen_DetalizBtn->uX, 1655 pRenderer->DrawTextureIndexed(pCharacterScreen_DetalizBtn->uX, pCharacterScreen_DetalizBtn->uY,
1639 pCharacterScreen_DetalizBtn->uY,
1640 pIcons_LOD->GetTexture(uTextureID_detaliz_close_button)); 1656 pIcons_LOD->GetTexture(uTextureID_detaliz_close_button));
1641
1642 for (uint i = 0; i < 6; ++i) 1657 for (uint i = 0; i < 6; ++i)
1643 { 1658 {
1644 if (!player->pEquipment.uRings[i]) 1659 if (!player->pEquipment.uRings[i])
1645 continue; 1660 continue;
1646
1647 static int pPaperdollRingsX[6] = {0x1EA, 0x21A, 0x248, 0x1EA, 0x21A, 0x248}; 1661 static int pPaperdollRingsX[6] = {0x1EA, 0x21A, 0x248, 0x1EA, 0x21A, 0x248};
1648 static int pPaperdollRingsY[6] = {0x0CA, 0x0CA, 0x0CA, 0x0FA, 0x0FA, 0x0FA}; 1662 static int pPaperdollRingsY[6] = {0x0CA, 0x0CA, 0x0CA, 0x0FA, 0x0FA, 0x0FA};
1649 1663 CharacterUI_DrawItem(pPaperdollRingsX[i], pPaperdollRingsY[i], &player->pInventoryItemList[player->pEquipment.uRings[i] - 1],
1650 CharacterUI_DrawItem(pPaperdollRingsX[i],
1651 pPaperdollRingsY[i],
1652 &player->pInventoryItemList[player->pEquipment.uRings[i] - 1],
1653 player->pEquipment.uRings[i]); 1664 player->pEquipment.uRings[i]);
1654 } 1665 }
1655
1656
1657 if (player->pEquipment.uAmulet) 1666 if (player->pEquipment.uAmulet)
1658 { 1667 CharacterUI_DrawItem(493, 91, &player->pInventoryItemList[player->pEquipment.uAmulet - 1], player->pEquipment.uAmulet);
1659 CharacterUI_DrawItem(493, 91,
1660 &player->pInventoryItemList[player->pEquipment.uAmulet - 1],
1661 player->pEquipment.uAmulet);
1662 }
1663
1664 if (player->pEquipment.uGlove) 1668 if (player->pEquipment.uGlove)
1665 { 1669 CharacterUI_DrawItem(586, 88, &player->pInventoryItemList[player->pEquipment.uGlove - 1], player->pEquipment.uGlove);
1666 CharacterUI_DrawItem(586, 88,
1667 &player->pInventoryItemList[player->pEquipment.uGlove - 1],
1668 player->pEquipment.uGlove);
1669 }
1670 } 1670 }
1671 1671
1672 //----- (0043BCA7) -------------------------------------------------------- 1672 //----- (0043BCA7) --------------------------------------------------------
1673 void CharacterUI_LoadPaperdollTextures() 1673 void CharacterUI_LoadPaperdollTextures()
1674 { 1674 {
1675 int v0; // edi@7
1676 enum CHARACTER_RACE pRace; // ebx@7
1677 signed int pSex; // eax@7
1678 int v3; // ebx@10 1675 int v3; // ebx@10
1679 Player *pPlayer; // edi@12 1676 Player *pPlayer; // edi@12
1680 unsigned __int8 v5; // cl@12
1681 int v6; // edi@16 1677 int v6; // edi@16
1682 unsigned int v7; // eax@16 1678 unsigned int v7; // eax@16
1683 Player *pPlayer2; // ebx@16 1679 Player *pPlayer2; // ebx@16
1684 char *v9; // ebx@16 1680 char *v9; // ebx@16
1685 char v10; // al@16
1686 signed int v11; // edi@21
1687 unsigned int v22; // eax@76 1681 unsigned int v22; // eax@76
1688 int v23; // ecx@76 1682 int v23; // ecx@76
1689 unsigned int v24; // eax@78 1683 unsigned int v24; // eax@78
1690 int v25; // ecx@78 1684 int v25; // ecx@78
1691 int v26; // ebx@79
1692 unsigned int v27; // eax@80 1685 unsigned int v27; // eax@80
1693 int v28; // ecx@80 1686 int v28; // ecx@80
1694 int v30; // [sp+10h] [bp-28h]@5
1695 signed int v32; // [sp+10h] [bp-28h]@75 1687 signed int v32; // [sp+10h] [bp-28h]@75
1696 signed int v33; // [sp+10h] [bp-28h]@77 1688 signed int v33; // [sp+10h] [bp-28h]@77
1697 int v34; // [sp+10h] [bp-28h]@79 1689 int v34; // [sp+10h] [bp-28h]@79
1698 int pItemTXTNum; // [sp+14h] [bp-24h]@75 1690 int pItemTXTNum; // [sp+14h] [bp-24h]@75
1699 int v37; // [sp+14h] [bp-24h]@77 1691 int v37; // [sp+14h] [bp-24h]@77
1700 signed int v38; // [sp+14h] [bp-24h]@79 1692 signed int v38; // [sp+14h] [bp-24h]@79
1701 int v42; // [sp+20h] [bp-18h]@6
1702 int v43; // [sp+20h] [bp-18h]@73
1703 char pContainer[128]; // [sp+24h] [bp-14h]@12 1693 char pContainer[128]; // [sp+24h] [bp-14h]@12
1704 1694
1705 uTextureID_MAGNIF_B = pIcons_LOD->LoadTexture("MAGNIF-B", TEXTURE_16BIT_PALETTE); 1695 uTextureID_MAGNIF_B = pIcons_LOD->LoadTexture("MAGNIF-B", TEXTURE_16BIT_PALETTE);
1706 //if ( !pParty->uAlignment || pParty->uAlignment == 1 || pParty->uAlignment == 2 ) 1696 //if ( !pParty->uAlignment || pParty->uAlignment == 1 || pParty->uAlignment == 2 )
1707 uTextureID_BACKDOLL = pIcons_LOD->LoadTexture("BACKDOLL", TEXTURE_16BIT_PALETTE); 1697 uTextureID_BACKDOLL = pIcons_LOD->LoadTexture("BACKDOLL", TEXTURE_16BIT_PALETTE);
1708 uTextureID_right_panel_loop = uTextureID_right_panel; 1698 uTextureID_right_panel_loop = uTextureID_right_panel;
1709 v30 = 0;
1710 uTextureID_BACKHAND = pIcons_LOD->LoadTexture("BACKHAND", TEXTURE_16BIT_PALETTE); 1699 uTextureID_BACKHAND = pIcons_LOD->LoadTexture("BACKHAND", TEXTURE_16BIT_PALETTE);
1711 uTextureID_detaliz_close_button = uExitCancelTextureId; 1700 uTextureID_detaliz_close_button = uExitCancelTextureId;
1712 do 1701 for ( uint i = 0; i < 4; ++i )
1713 { 1702 {
1714 v42 = v30 + 1; 1703 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(i + 1) )
1715 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(v30 + 1) ) 1704 {
1716 { 1705 if ( pPlayers[i + 1]->GetRace() == CHARACTER_RACE_DWARF )
1717 v0 = v30; 1706 v3 = (pPlayers[i + 1]->GetSexByVoice() != 0) + 3;
1718 pRace = pPlayers[v30 + 1]->GetRace();
1719 pSex = pPlayers[v30 + 1]->GetSexByVoice();
1720 if ( pRace && pRace != 1 && pRace != 2 )//race == 3
1721 v3 = (pSex != 0) + 3;
1722 else 1707 else
1723 v3 = (pSex != 0) + 1; 1708 v3 = (pPlayers[i + 1]->GetSexByVoice() != 0) + 1;
1724 wsprintfA(pContainer, "pc23v%dBod", v3); 1709 wsprintfA(pContainer, "pc23v%dBod", v3);
1725 papredoll_dbods[v0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);//Body texture 1710 papredoll_dbods[i] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);//Body texture
1726 wsprintfA(pContainer, "pc23v%dlad", v3); 1711 wsprintfA(pContainer, "pc23v%dlad", v3);
1727 papredoll_dlads[v0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);// Left Hand 1712 papredoll_dlads[i] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);// Left Hand
1728 wsprintfA(pContainer, "pc23v%dlau", v3); 1713 wsprintfA(pContainer, "pc23v%dlau", v3);
1729 papredoll_dlaus[v0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);// Left Hand2 1714 papredoll_dlaus[i] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);// Left Hand2
1730 wsprintfA(pContainer, "pc23v%drh", v3); 1715 wsprintfA(pContainer, "pc23v%drh", v3);
1731 papredoll_drhs[v0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);// Right Hand 1716 papredoll_drhs[i] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);// Right Hand
1732 wsprintfA(pContainer, "pc23v%dlh", v3); 1717 wsprintfA(pContainer, "pc23v%dlh", v3);
1733 papredoll_dlhs[v0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);// Left Fist 1718 papredoll_dlhs[i] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);// Left Fist
1734 wsprintfA(pContainer, "pc23v%dlhu", v3); 1719 wsprintfA(pContainer, "pc23v%dlhu", v3);
1735 papredoll_dlhus[v0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); // Left Fist 2 1720 papredoll_dlhus[i] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); // Left Fist 2
1736 pPlayer = pPlayers[v0 + 1]; 1721 pPlayer = pPlayers[i + 1];
1737 v5 = pPlayer->uCurrentFace; 1722 if ( pPlayer->uCurrentFace == 12 || pPlayer->uCurrentFace == 13 )
1738 if ( v5 == 12 || v5 == 13 ) 1723 papredoll_dbrds[(char)pPlayer->uCurrentFace] = 0;
1739 papredoll_dbrds[(char)v5] = 0;
1740 papredoll_flying_feet[pPlayer->uCurrentFace] = 0; 1724 papredoll_flying_feet[pPlayer->uCurrentFace] = 0;
1741 IsPlayerWearingWatersuit[v30 + 1] = 1; 1725 IsPlayerWearingWatersuit[i + 1] = 1;
1742 } 1726 }
1743 else 1727 else
1744 { 1728 {
1745 papredoll_dbods[v30] = pIcons_LOD->LoadTexture(dbod_texnames_by_face[pPlayers[v30 + 1]->uCurrentFace], TEXTURE_16BIT_PALETTE); 1729 papredoll_dbods[i] = pIcons_LOD->LoadTexture(dbod_texnames_by_face[pPlayers[i + 1]->uCurrentFace], TEXTURE_16BIT_PALETTE);
1746 papredoll_dlads[v30] = pIcons_LOD->LoadTexture(dlad_texnames_by_face[pPlayers[v30 + 1]->uCurrentFace], TEXTURE_16BIT_PALETTE); 1730 papredoll_dlads[i] = pIcons_LOD->LoadTexture(dlad_texnames_by_face[pPlayers[i + 1]->uCurrentFace], TEXTURE_16BIT_PALETTE);
1747 papredoll_dlaus[v30] = pIcons_LOD->LoadTexture(dlau_texnames_by_face[pPlayers[v30 + 1]->uCurrentFace], TEXTURE_16BIT_PALETTE); 1731 papredoll_dlaus[i] = pIcons_LOD->LoadTexture(dlau_texnames_by_face[pPlayers[i + 1]->uCurrentFace], TEXTURE_16BIT_PALETTE);
1748 papredoll_drhs[v30] = pIcons_LOD->LoadTexture(drh_texnames_by_face[pPlayers[v30 + 1]->uCurrentFace], TEXTURE_16BIT_PALETTE); 1732 papredoll_drhs[i] = pIcons_LOD->LoadTexture(drh_texnames_by_face[pPlayers[i + 1]->uCurrentFace], TEXTURE_16BIT_PALETTE);
1749 papredoll_dlhs[v30] = pIcons_LOD->LoadTexture(dlh_texnames_by_face[pPlayers[v30 + 1]->uCurrentFace], TEXTURE_16BIT_PALETTE); 1733 papredoll_dlhs[i] = pIcons_LOD->LoadTexture(dlh_texnames_by_face[pPlayers[i + 1]->uCurrentFace], TEXTURE_16BIT_PALETTE);
1750 papredoll_dlhus[v30] = pIcons_LOD->LoadTexture(dlhu_texnames_by_face[pPlayers[v30 + 1]->uCurrentFace], TEXTURE_16BIT_PALETTE); 1734 papredoll_dlhus[i] = pIcons_LOD->LoadTexture(dlhu_texnames_by_face[pPlayers[i + 1]->uCurrentFace], TEXTURE_16BIT_PALETTE);
1751 v10 = pPlayers[v30 + 1]->uCurrentFace; 1735 if ( pPlayers[i + 1]->uCurrentFace == 12 || pPlayers[i + 1]->uCurrentFace == 13 )
1752 if ( v10 == 12 || v10 == 13 ) 1736 {
1753 { 1737 wsprintfA(pContainer, "pc%02dbrd", pPlayers[i + 1]->uCurrentFace + 1);
1754 wsprintfA(pContainer, "pc%02dbrd", v10 + 1); 1738 papredoll_dbrds[pPlayers[i + 1]->uCurrentFace] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
1755 papredoll_dbrds[v10] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); 1739 }
1756 } 1740 wsprintfA(pContainer, "item281pc%02d", pPlayers[i + 1]->uCurrentFace + 1);
1757 wsprintfA(pContainer, "item281pc%02d", v10 + 1); 1741 papredoll_flying_feet[pPlayers[i + 1]->uCurrentFace] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
1758 papredoll_flying_feet[pPlayers[v30 + 1]->uCurrentFace] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); 1742 IsPlayerWearingWatersuit[i + 1] = 0;
1759 IsPlayerWearingWatersuit[v30 + 1] = 0; 1743 }
1760 } 1744 }
1761 ++v30; 1745
1762 }
1763 while ( v42 < 4 );
1764 uTextureID_ar_up_up = pIcons_LOD->LoadTexture("ar_up_up", TEXTURE_16BIT_PALETTE); 1746 uTextureID_ar_up_up = pIcons_LOD->LoadTexture("ar_up_up", TEXTURE_16BIT_PALETTE);
1765 uTextureID_ar_up_dn = pIcons_LOD->LoadTexture("ar_up_dn", TEXTURE_16BIT_PALETTE); 1747 uTextureID_ar_up_dn = pIcons_LOD->LoadTexture("ar_up_dn", TEXTURE_16BIT_PALETTE);
1766 uTextureID_ar_dn_up = pIcons_LOD->LoadTexture("ar_dn_up", TEXTURE_16BIT_PALETTE); 1748 uTextureID_ar_dn_up = pIcons_LOD->LoadTexture("ar_dn_up", TEXTURE_16BIT_PALETTE);
1767 uTextureID_ar_dn_dn = pIcons_LOD->LoadTexture("ar_dn_dn", TEXTURE_16BIT_PALETTE); 1749 uTextureID_ar_dn_dn = pIcons_LOD->LoadTexture("ar_dn_dn", TEXTURE_16BIT_PALETTE);
1768 papredoll_dbrds[9] = pIcons_LOD->LoadTexture("ib-cd1-d", TEXTURE_16BIT_PALETTE); 1750 papredoll_dbrds[9] = pIcons_LOD->LoadTexture("ib-cd1-d", TEXTURE_16BIT_PALETTE);
1769 papredoll_dbrds[7] = pIcons_LOD->LoadTexture("ib-cd2-d", TEXTURE_16BIT_PALETTE); 1751 papredoll_dbrds[7] = pIcons_LOD->LoadTexture("ib-cd2-d", TEXTURE_16BIT_PALETTE);
1770 papredoll_dbrds[5] = pIcons_LOD->LoadTexture("ib-cd3-d", TEXTURE_16BIT_PALETTE); 1752 papredoll_dbrds[5] = pIcons_LOD->LoadTexture("ib-cd3-d", TEXTURE_16BIT_PALETTE);
1771 papredoll_dbrds[3] = pIcons_LOD->LoadTexture("ib-cd4-d", TEXTURE_16BIT_PALETTE); 1753 papredoll_dbrds[3] = pIcons_LOD->LoadTexture("ib-cd4-d", TEXTURE_16BIT_PALETTE);
1772 papredoll_dbrds[1] = pIcons_LOD->LoadTexture("ib-cd5-d", TEXTURE_16BIT_PALETTE); 1754 papredoll_dbrds[1] = pIcons_LOD->LoadTexture("ib-cd5-d", TEXTURE_16BIT_PALETTE);
1773 for ( v11 = 0; v11 < 54; ++v11 )// test equipment 1755 for ( uint i = 0; i < 54; ++i )// test equipment
1774 { 1756 {
1775 party_has_equipment[v11] = 0; 1757 party_has_equipment[i] = 0;
1776 if ( pParty->pPickedItem.uItemID != v11 + 66 ) 1758 if ( pParty->pPickedItem.uItemID != i + 66 )
1777 { 1759 {
1778 for ( uint i = 0; i < 4; ++i) 1760 for ( uint j = 0; j < 4; ++j)
1779 { 1761 {
1780 if ( Player_has_item(v11 + 66, &pParty->pPlayers[i], 0) ) 1762 if ( Player_has_item(i + 66, &pParty->pPlayers[j], 0) )
1781 party_has_equipment[v11] = 1; 1763 party_has_equipment[i] = 1;
1782 } 1764 }
1783 } 1765 }
1784 } 1766 }
1785 memset(byte_5111F6.data(), 0, 16); 1767 memset(byte_5111F6.data(), 0, 16);
1786 for (uint i = 0; i < 4; ++i) 1768 for (uint i = 0; i < 4; ++i)
1804 if (Player_has_item(ITEM_RARE_MOON_CLOAK, player, 1)) byte_5111F6[14] = 1; 1786 if (Player_has_item(ITEM_RARE_MOON_CLOAK, player, 1)) byte_5111F6[14] = 1;
1805 if (Player_has_item(ITEM_RARE_VAMPIRES_CAPE, player, 1)) byte_5111F6[15] = 1; 1787 if (Player_has_item(ITEM_RARE_VAMPIRES_CAPE, player, 1)) byte_5111F6[15] = 1;
1806 if (Player_has_item(ITEM_ELVEN_CHAINMAIL, player, 1)) byte_5111F6[16] = 1; 1788 if (Player_has_item(ITEM_ELVEN_CHAINMAIL, player, 1)) byte_5111F6[16] = 1;
1807 } 1789 }
1808 1790
1809
1810 for (uint i = 0; i < 2; ++i) 1791 for (uint i = 0; i < 2; ++i)
1811 { 1792 {
1812 for ( uint j = 0; j < 5; ++j )//Belt 1793 for ( uint j = 0; j < 5; ++j )//Belt
1813 { 1794 {
1814 GetItemTextureFilename(pContainer, j + 100, i + 1, 0); 1795 GetItemTextureFilename(pContainer, j + 100, i + 1, 0);
1832 GetItemTextureFilename(pContainer, 544, i + 1, 0); 1813 GetItemTextureFilename(pContainer, 544, i + 1, 0);
1833 paperdoll_helm_texture[i][15] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); 1814 paperdoll_helm_texture[i][15] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
1834 if ( _43ED6F_check_party_races(true) ) 1815 if ( _43ED6F_check_party_races(true) )
1835 papredoll_dbrds[11] = pIcons_LOD->LoadTexture("item092v3", TEXTURE_16BIT_PALETTE); 1816 papredoll_dbrds[11] = pIcons_LOD->LoadTexture("item092v3", TEXTURE_16BIT_PALETTE);
1836 } 1817 }
1837 v43 = 0; 1818 //v43 = 0;
1838 for (uint i = 0; i < 4; ++i) 1819 for (uint i = 0; i < 4; ++i)
1839 { 1820 {
1840 if ( sub_43EDB9_get_some_race_sex_relation_2(i) ) 1821 if ( sub_43EDB9_get_some_race_sex_relation_2(i) )
1841 { 1822 {
1842 GetItemTextureFilename(pContainer, 524, i + 1, 0); 1823 GetItemTextureFilename(pContainer, 524, i + 1, 0);
1843 paperdoll_belt_texture[i][5] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);//Titans belt 1824 paperdoll_belt_texture[i][5] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);//Titans belt
1844 pItemTXTNum = 66; 1825 pItemTXTNum = 66;
1845 for ( v32 = 0; v32 < 13; ++v32 )//simple armor 1826 for ( v32 = 0; v32 < 13; ++v32 )//simple armor
1846 { 1827 {
1847 GetItemTextureFilename(pContainer, pItemTXTNum, i + 1, 0); 1828 GetItemTextureFilename(pContainer, pItemTXTNum, i + 1, 0);
1848 paperdoll_armor_texture[i][v32][0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); 1829 paperdoll_armor_texture[i][v32][0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);// armor
1849 GetItemTextureFilename(pContainer, pItemTXTNum, i + 1, 1); 1830 GetItemTextureFilename(pContainer, pItemTXTNum, i + 1, 1);
1850 paperdoll_armor_texture[i][v32][1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); 1831 paperdoll_armor_texture[i][v32][1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);// shoulder 1
1851 GetItemTextureFilename(pContainer, pItemTXTNum, i + 1, 2); 1832 GetItemTextureFilename(pContainer, pItemTXTNum, i + 1, 2);
1852 paperdoll_armor_texture[i][v32][2] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); 1833 paperdoll_armor_texture[i][v32][2] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);// shoulder 2
1853 pItemTXTNum++; 1834 pItemTXTNum++;
1854 } 1835 }
1855 GetItemTextureFilename(pContainer, 516, i + 1, 0);//artefacts 1836 GetItemTextureFilename(pContainer, 516, i + 1, 0);//artefacts
1856 paperdoll_armor_texture[i][v32][0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); 1837 paperdoll_armor_texture[i][v32][0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
1857 GetItemTextureFilename(pContainer, 516, i + 1, 1); 1838 GetItemTextureFilename(pContainer, 516, i + 1, 1);
1909 GetItemTextureFilename(pContainer, 548, i + 1, 1); 1890 GetItemTextureFilename(pContainer, 548, i + 1, 1);
1910 paperdoll_cloak_collar_texture[i][8] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); 1891 paperdoll_cloak_collar_texture[i][8] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
1911 GetItemTextureFilename(pContainer, 550, i + 1, 1); 1892 GetItemTextureFilename(pContainer, 550, i + 1, 1);
1912 paperdoll_cloak_collar_texture[i][9] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); 1893 paperdoll_cloak_collar_texture[i][9] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
1913 } 1894 }
1914 else 1895 //else
1915 { 1896 //{
1916 v26 = v43; 1897 //v26 = v43;
1917 } 1898 //}
1918 v43 = v26 + 40; 1899 //v43 = v26 + 40;
1919 } 1900 }
1920 } 1901 }
1921 1902
1922 //----- (00419401) -------------------------------------------------------- 1903 //----- (00419401) --------------------------------------------------------
1923 void CharacterUI_SkillsTab_CreateButtons() 1904 void CharacterUI_SkillsTab_CreateButtons()
1924 { 1905 {
1925 // unsigned int v0; // ecx@3 1906 GUIButton *pButton; // eax@3
1926 GUIButton *pButton; // eax@3 1907 unsigned int current_Y; // esi@8
1927 unsigned int current_Y; // esi@8 1908 int buttons_count; // [sp+10h] [bp-14h]@1
1928 int buttons_count; // [sp+10h] [bp-14h]@1 1909 int first_rows; // [sp+14h] [bp-10h]@19
1929 int first_rows; // [sp+14h] [bp-10h]@19 1910 int skill_id; // [sp+18h] [bp-Ch]@8
1930 int skill_id; // [sp+18h] [bp-Ch]@8 1911 Player *curr_player; // [sp+1Ch] [bp-8h]@8
1931 Player *curr_player; // [sp+1Ch] [bp-8h]@8 1912 int i;
1932 int i; 1913 int uCurrFontHeght;
1933 int uCurrFontHeght; 1914
1934 1915 buttons_count = 0;
1935 buttons_count = 0; 1916 if ( dword_507CC0_activ_ch )
1936 if ( dword_507CC0_activ_ch ) 1917 CharacterUI_ReleaseButtons();
1937 CharacterUI_ReleaseButtons(); 1918 dword_507CC0_activ_ch = uActiveCharacter;
1938 dword_507CC0_activ_ch = uActiveCharacter; 1919 for ( pButton = pGUIWindow_CurrentMenu->pControlsHead; pButton; pButton = pButton->pNext )
1939 for ( pButton = pGUIWindow_CurrentMenu->pControlsHead; pButton; pButton = pButton->pNext ) 1920 {
1940 { 1921 if ( pButton->msg == UIMSG_InventoryLeftClick )
1941 if ( pButton->msg == UIMSG_InventoryLeftClick ) 1922 {
1942 { 1923 dword_50698C_uX = pButton->uX;
1943 dword_50698C_uX = pButton->uX; 1924 dword_506988_uY = pButton->uY;
1944 dword_506988_uY = pButton->uY; 1925 dword_506984_uZ = pButton->uZ;
1945 dword_506984_uZ = pButton->uZ; 1926 dword_506980_uW = pButton->uW;
1946 dword_506980_uW = pButton->uW; 1927 pButton->uW = 0;
1947 pButton->uW = 0; 1928 pButton->uZ = 0;
1948 pButton->uZ = 0; 1929 pButton->uY = 0;
1949 pButton->uY = 0; 1930 pButton->uX = 0;
1950 pButton->uX = 0; 1931 }
1951 } 1932 }
1952 } 1933 first_rows = 0;
1953 first_rows = 0; 1934 // a5 = pGUIWindow_CurrentMenu->uNumControls;
1954 // a5 = pGUIWindow_CurrentMenu->uNumControls; 1935 curr_player = &pParty->pPlayers[uActiveCharacter-1];
1955 curr_player = &pParty->pPlayers[uActiveCharacter-1]; 1936
1956 1937 uCurrFontHeght=pFontLucida->uFontHeight;
1957 uCurrFontHeght=pFontLucida->uFontHeight; 1938 current_Y = 2 *uCurrFontHeght + 13;
1958 current_Y = 2 *uCurrFontHeght + 13; 1939 for( i = 0; i < 9; ++i )
1959 for(i=0; i<9;++i) 1940 {
1960 { 1941 skill_id = pWeaponSkills[i];
1961 skill_id = pWeaponSkills[i]; 1942 if ( curr_player->pActiveSkills[skill_id] & 0x3F )
1962 if ( curr_player->pActiveSkills[skill_id] & 0x3F ) 1943 {
1963 { 1944 current_Y += uCurrFontHeght - 3;
1964 current_Y += uCurrFontHeght - 3; 1945 ++buttons_count;
1965 ++buttons_count; 1946 ++first_rows;
1966 ++first_rows; 1947 pGUIWindow_CurrentMenu->CreateButton(24, current_Y, 204, uCurrFontHeght - 3, 3, skill_id | 0x8000, UIMSG_SkillUp, skill_id, 0, "", 0, 0);
1967 pGUIWindow_CurrentMenu->CreateButton(24, current_Y, 204, uCurrFontHeght - 3, 3, skill_id | 0x8000, UIMSG_SkillUp, skill_id, 0, "", 0, 0); 1948 }
1968 } 1949 }
1969 } 1950 if ( !first_rows )
1970 if ( !first_rows ) 1951 current_Y += uCurrFontHeght - 3;
1971 current_Y += uCurrFontHeght - 3; 1952 current_Y += 2 * uCurrFontHeght - 6;
1972 current_Y += 2 * uCurrFontHeght - 6; 1953 for ( i = 0; i < 9; ++i )
1973 for(i=0; i<9;++i) 1954 {
1974 { 1955 skill_id = pMagicSkills[i];
1975 skill_id = pMagicSkills[i]; 1956 if ( curr_player->pActiveSkills[skill_id] & 0x3F && buttons_count < 15 )
1976 if ( curr_player->pActiveSkills[skill_id] & 0x3F && buttons_count < 15 ) 1957 {
1977 { 1958 current_Y += uCurrFontHeght - 3;
1978 current_Y += uCurrFontHeght - 3; 1959 ++buttons_count;
1979 ++buttons_count; 1960 pGUIWindow_CurrentMenu->CreateButton(24, current_Y, 204, uCurrFontHeght - 3, 3, skill_id | 0x8000, UIMSG_SkillUp, skill_id, 0, "", 0, 0);
1980 pGUIWindow_CurrentMenu->CreateButton(24, current_Y, 204, uCurrFontHeght - 3, 3, skill_id | 0x8000, UIMSG_SkillUp, skill_id, 0, "", 0, 0); 1961 }
1981 } 1962 }
1982 } 1963 first_rows = 0;
1983 first_rows = 0; 1964 current_Y = 2 * uCurrFontHeght + 13;
1984 current_Y = 2 * uCurrFontHeght + 13; 1965 for ( i = 0; i < 5; ++i )
1985 for(i=0; i<5;++i) 1966 {
1986 { 1967 skill_id = pArmorSkills[i];
1987 skill_id = pArmorSkills[i]; 1968 if ( curr_player->pActiveSkills[skill_id] & 0x3F )
1988 if ( curr_player->pActiveSkills[skill_id] & 0x3F ) 1969 {
1989 { 1970 current_Y+= uCurrFontHeght - 3;
1990 current_Y+= uCurrFontHeght - 3; 1971 ++buttons_count;
1991 ++buttons_count; 1972 ++first_rows;
1992 ++first_rows; 1973 pGUIWindow_CurrentMenu->CreateButton(246, current_Y, 204, uCurrFontHeght - 3, 3, skill_id | 0x8000, UIMSG_SkillUp, skill_id, 0, "", 0, 0);
1993 pGUIWindow_CurrentMenu->CreateButton(246, current_Y, 204, uCurrFontHeght - 3, 3, skill_id | 0x8000, UIMSG_SkillUp, skill_id, 0, "", 0, 0); 1974 }
1994 } 1975 }
1995 } 1976 if ( !first_rows )
1996 if ( !first_rows ) 1977 current_Y += uCurrFontHeght - 3;
1997 current_Y += uCurrFontHeght - 3; 1978 current_Y += 2 * uCurrFontHeght - 6;
1998 current_Y += 2 * uCurrFontHeght - 6; 1979 for ( i = 0; i < 12; ++i )
1999 for(i=0; i<12; ++i) 1980 {
2000 { 1981 skill_id = pMiscSkills[i];
2001 skill_id = pMiscSkills[i]; 1982 if ( curr_player->pActiveSkills[skill_id] & 0x3F )
2002 if ( curr_player->pActiveSkills[skill_id] & 0x3F ) 1983 {
2003 { 1984 current_Y += uCurrFontHeght - 3;
2004 current_Y += uCurrFontHeght - 3; 1985 ++buttons_count;
2005 ++buttons_count; 1986 pGUIWindow_CurrentMenu->CreateButton(246, current_Y, 204, uCurrFontHeght - 3, 3, skill_id | 0x8000, UIMSG_SkillUp, skill_id, 0, "", 0, 0);
2006 pGUIWindow_CurrentMenu->CreateButton(246, current_Y, 204, uCurrFontHeght - 3, 3, skill_id | 0x8000, UIMSG_SkillUp, skill_id, 0, "", 0, 0); 1987 }
2007 } 1988 }
2008 } 1989
2009 1990 if ( buttons_count )
2010 if ( buttons_count ) 1991 pGUIWindow_CurrentMenu->_41D08F_set_keyboard_control_group(buttons_count, 1, 0, pGUIWindow_CurrentMenu->uNumControls);
2011 pGUIWindow_CurrentMenu->_41D08F_set_keyboard_control_group(buttons_count, 1, 0, pGUIWindow_CurrentMenu->uNumControls); 1992 }
2012 }
2013
2014
2015 1993
2016 //----- (00418511) -------------------------------------------------------- 1994 //----- (00418511) --------------------------------------------------------
2017 void CharacterUI_StatsTab_Draw( Player *player ) 1995 void CharacterUI_StatsTab_Draw( Player *player )
2018 { 1996 {
2019 //Player *pPlayer; // edi@1 1997 int pY; // ST34_4@4
2020 //unsigned int v4; // eax@2 1998 char *pText; // eax@9
2021 int v7; // ebp@4 1999 const char *a2; // [sp+14h] [bp-Ch]@4
2022 int v8; // eax@4 2000
2023 unsigned int v9; // eax@4
2024 int v10; // ST34_4@4
2025 int v13; // ebp@4
2026 int v14; // eax@4
2027 unsigned int v15; // eax@4
2028 int v19; // ebp@4
2029 int v20; // eax@4
2030 unsigned int v21; // eax@4
2031 int v25; // ebp@4
2032 int v26; // eax@4
2033 unsigned int v27; // eax@4
2034 int v31; // ebp@4
2035 int v32; // eax@4
2036 unsigned int v33; // eax@4
2037 int v37; // ebp@4
2038 int v38; // eax@4
2039 unsigned int v39; // eax@4
2040 int v43; // ebp@4
2041 int v44; // eax@4
2042 unsigned int v45; // eax@4
2043 signed int v49; // eax@6
2044 unsigned int v50; // eax@6
2045 int v53; // eax@8
2046 unsigned int v54; // eax@8
2047 int v58; // ebp@8
2048 int v59; // eax@8
2049 unsigned int v60; // eax@8
2050 unsigned int v62; // eax@8
2051 signed int v64; // eax@8
2052 //unsigned __int8 v66; // al@8
2053 char *v67; // eax@9
2054 signed int v70; // ebp@11
2055 signed int v71; // eax@11
2056 unsigned int v72; // eax@11
2057 int v75; // ebp@13
2058 int v76; // eax@13
2059 unsigned int v77; // eax@13
2060 char *v78; // ecx@14
2061 unsigned int v81; // eax@16
2062 int v83; // eax@16
2063 char *v85; // eax@16
2064 int v87; // eax@16
2065 char *v89; // eax@16
2066 int v90; // eax@16
2067 unsigned int v92; // eax@19
2068 int v93; // eax@19
2069 unsigned int v95; // eax@22
2070 int v96; // eax@22
2071 unsigned int v98; // eax@25
2072 int v99; // eax@25
2073 unsigned int v101; // eax@27
2074 int v102; // eax@27
2075 unsigned int v104; // eax@30
2076 unsigned int v106; // eax@32
2077 int v107; // eax@33
2078 unsigned int v109; // eax@36
2079 unsigned int v111; // eax@38
2080 const char *a2; // [sp+14h] [bp-Ch]@4
2081 const char *a2a; // [sp+14h] [bp-Ch]@6
2082 const char *a2b; // [sp+14h] [bp-Ch]@11
2083 const char *a2c; // [sp+14h] [bp-Ch]@16
2084 const char *a2d; // [sp+14h] [bp-Ch]@19
2085 const char *a2e; // [sp+14h] [bp-Ch]@22
2086 const char *a2f; // [sp+14h] [bp-Ch]@25
2087 const char *a2g; // [sp+14h] [bp-Ch]@27
2088 const char *a2h; // [sp+14h] [bp-Ch]@33
2089 int v131; // [sp+18h] [bp-8h]@16
2090 int v132; // [sp+18h] [bp-8h]@19
2091 int v133; // [sp+18h] [bp-8h]@22
2092 int v134; // [sp+18h] [bp-8h]@25
2093 int v135; // [sp+18h] [bp-8h]@27
2094 int v136; // [sp+18h] [bp-8h]@33
2095
2096 //pPlayer = &pParty->pPlayers[uPlayerID-1];
2097 //pPlayer = player;
2098 pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->LoadTexturePtr("fr_stats", TEXTURE_16BIT_PALETTE)); 2001 pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->LoadTexturePtr("fr_stats", TEXTURE_16BIT_PALETTE));
2099 sprintf(pTmpBuf.data(), "\f%05d", ui_character_header_text_color); 2002 sprintf(pTmpBuf.data(), "\f%05d", ui_character_header_text_color);
2100 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[429], player->pName, pClassNames[player->classType]);//"^Pi[%s] %s" / "%s the %s" 2003 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[429], player->pName, pClassNames[player->classType]);//"^Pi[%s] %s" / "%s the %s"
2101 strcat(pTmpBuf.data(), pTmpBuf2.data()); 2004 strcat(pTmpBuf.data(), pTmpBuf2.data());
2102 sprintfex(pTmpBuf2.data(), "\f00000\r180%s: \f%05d%d\f00000\n\n\n", 2005 sprintfex(pTmpBuf2.data(), "\f00000\r180%s: \f%05d%d\f00000\n\n\n",
2104 player->uSkillPoints ? ui_character_bonus_text_color : ui_character_default_text_color, 2007 player->uSkillPoints ? ui_character_bonus_text_color : ui_character_default_text_color,
2105 player->uSkillPoints); 2008 player->uSkillPoints);
2106 strcat(pTmpBuf.data(), pTmpBuf2.data()); 2009 strcat(pTmpBuf.data(), pTmpBuf2.data());
2107 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, 18, 0, pTmpBuf.data(), 0, 0, 0); 2010 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, 18, 0, pTmpBuf.data(), 0, 0, 0);
2108 2011
2109 v10 = 53; 2012 //First column( )
2110 v7 = player->GetBaseStrength(); 2013 pY = 53;
2111 v8 = player->GetActualMight(); 2014 sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[144],
2112 v9 = UI_GetHealthManaStringColor(v8, v7); 2015 UI_GetHealthManaStringColor(player->GetActualMight(), player->GetBaseStrength()),
2113 sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[144], v9, v8, v7);//Might 2016 player->GetActualMight(), player->GetBaseStrength());//Might
2114 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf.data(), 0, 0, 0); 2017 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, pY, 0, pTmpBuf.data(), 0, 0, 0);
2115 2018
2116 v10 += LOBYTE(pFontArrus->uFontHeight) - 2; 2019 pY += LOBYTE(pFontArrus->uFontHeight) - 2;
2117 v13 = player->GetBaseIntelligence(); 2020 sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[116],
2118 v14 = player->GetActualIntelligence(); 2021 UI_GetHealthManaStringColor(player->GetActualIntelligence(), player->GetBaseIntelligence()),
2119 v15 = UI_GetHealthManaStringColor(v14, v13); 2022 player->GetActualIntelligence(), player->GetBaseIntelligence());//Intellect
2120 sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[116], v15, v14, v13);//Intellect 2023 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, pY, 0, pTmpBuf.data(), 0, 0, 0);
2121 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf.data(), 0, 0, 0); 2024
2122 2025 pY += LOBYTE(pFontArrus->uFontHeight) - 2;
2123 v10 += LOBYTE(pFontArrus->uFontHeight) - 2; 2026 sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[163],
2124 v19 = player->GetBaseWillpower(); 2027 UI_GetHealthManaStringColor(player->GetActualWillpower(), player->GetBaseWillpower()),
2125 v20 = player->GetActualWillpower(); 2028 player->GetActualWillpower(), player->GetBaseWillpower());//
2126 v21 = UI_GetHealthManaStringColor(v20, v19); 2029 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, pY, 0, pTmpBuf.data(), 0, 0, 0);
2127 sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[163], v21, v20, v19);// 2030
2128 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf.data(), 0, 0, 0); 2031 pY += LOBYTE(pFontArrus->uFontHeight) - 2;
2129 2032 sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[75],
2130 v10 += LOBYTE(pFontArrus->uFontHeight) - 2; 2033 UI_GetHealthManaStringColor(player->GetActualEndurance(), player->GetBaseEndurance()),
2131 v25 = player->GetBaseEndurance(); 2034 player->GetActualEndurance(), player->GetBaseEndurance());//
2132 v26 = player->GetActualEndurance(); 2035 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, pY, 0, pTmpBuf.data(), 0, 0, 0);
2133 v27 = UI_GetHealthManaStringColor(v26, v25); 2036
2134 sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[75], v27, v26, v25);// 2037 pY += LOBYTE(pFontArrus->uFontHeight) - 2;
2135 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf.data(), 0, 0, 0); 2038 sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[1],
2136 2039 UI_GetHealthManaStringColor(player->GetActualAccuracy(), player->GetBaseAccuracy()),
2137 v10 += LOBYTE(pFontArrus->uFontHeight) - 2; 2040 player->GetActualAccuracy(), player->GetBaseAccuracy());
2138 v31 = player->GetBaseAccuracy(); 2041 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, pY, 0, pTmpBuf.data(), 0, 0, 0);
2139 v32 = player->GetActualAccuracy(); 2042
2140 v33 = UI_GetHealthManaStringColor(v32, v31); 2043 pY += LOBYTE(pFontArrus->uFontHeight) - 2;
2141 sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[1], v33, v32, v31); 2044 sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[211],
2142 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf.data(), 0, 0, 0); 2045 UI_GetHealthManaStringColor(player->GetActualSpeed(), player->GetBaseSpeed()),
2143 2046 player->GetActualSpeed(), player->GetBaseSpeed());
2144 v10 += LOBYTE(pFontArrus->uFontHeight) - 2; 2047 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, pY, 0, pTmpBuf.data(), 0, 0, 0);
2145 v37 = player->GetBaseSpeed(); 2048
2146 v38 = player->GetActualSpeed(); 2049 pY += LOBYTE(pFontArrus->uFontHeight) - 2;
2147 v39 = UI_GetHealthManaStringColor(v38, v37); 2050 sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n\n", pGlobalTXT_LocalizationStrings[136],
2148 sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[211], v39, v38, v37); 2051 UI_GetHealthManaStringColor(player->GetActualLuck(), player->GetBaseLuck()),
2149 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf.data(), 0, 0, 0); 2052 player->GetActualLuck(), player->GetBaseLuck());
2150 2053 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, pY, 0, pTmpBuf.data(), 0, 0, 0);
2151 v10 += LOBYTE(pFontArrus->uFontHeight) - 2; 2054
2152 v43 = player->GetBaseLuck(); 2055 a2 = "%s\f%05u\r424%d\f00000 /\t185%d\n";
2153 v44 = player->GetActualLuck(); 2056 if ( player->GetMaxHealth() >= 1000 )
2154 v45 = UI_GetHealthManaStringColor(v44, v43); 2057 a2 = "%s\f%05u\r388%d\f00000 / %d\n";
2155 sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n\n", pGlobalTXT_LocalizationStrings[136], v45, v44, v43); 2058 pY += 2 * LOBYTE(pFontArrus->uFontHeight) + 5;
2156 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf.data(), 0, 0, 0); 2059 sprintf(pTmpBuf.data(), a2, pGlobalTXT_LocalizationStrings[108],
2157 2060 UI_GetHealthManaStringColor(player->sHealth, player->GetMaxHealth()),
2158 a2 = "%s\f%05u\r424%d\f00000 /\t185%d\n"; 2061 player->sHealth, player->GetMaxHealth());
2159 v10 += 2 * LOBYTE(pFontArrus->uFontHeight) + 5; 2062 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, pY, 0, pTmpBuf.data(), 0, 0, 0);
2160 if ( player->GetMaxHealth() >= 1000 ) 2063
2161 a2 = "%s\f%05u\r388%d\f00000 / %d\n"; 2064 a2 = "%s\f%05u\r424%d\f00000 /\t185%d\n";
2162 v49 = player->GetMaxHealth(); 2065 if ( player->GetMaxMana() >= 1000 )
2163 v50 = UI_GetHealthManaStringColor(player->sHealth, v49); 2066 a2 = "%s\f%05u\r388%d\f00000 / %d\n";
2164 sprintf(pTmpBuf.data(), a2, pGlobalTXT_LocalizationStrings[108], v50, player->sHealth, v49); 2067 pY += LOBYTE(pFontArrus->uFontHeight) - 2;
2165 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf.data(), 0, 0, 0); 2068 sprintf(pTmpBuf.data(), a2, pGlobalTXT_LocalizationStrings[212],
2166 2069 UI_GetHealthManaStringColor(player->sMana, player->GetMaxMana()),
2167 a2a = "%s\f%05u\r424%d\f00000 /\t185%d\n"; 2070 player->sMana, player->GetMaxMana());
2168 v10 += LOBYTE(pFontArrus->uFontHeight) - 2; 2071 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, pY, 0, pTmpBuf.data(), 0, 0, 0);
2169 if ( player->GetMaxMana() >= 1000 ) 2072
2170 a2a = "%s\f%05u\r388%d\f00000 / %d\n"; 2073 pY += LOBYTE(pFontArrus->uFontHeight) - 2;
2171 v53 = player->GetMaxMana(); 2074 sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n\n", pGlobalTXT_LocalizationStrings[12],
2172 v54 = UI_GetHealthManaStringColor(player->sMana, v53); 2075 UI_GetHealthManaStringColor(player->GetActualAC(), player->GetBaseAC()),
2173 sprintf(pTmpBuf.data(), a2a, pGlobalTXT_LocalizationStrings[212], v54, player->sMana, v53); 2076 player->GetActualAC(), player->GetBaseAC());
2174 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf.data(), 0, 0, 0); 2077 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, pY, 0, pTmpBuf.data(), 0, 0, 0);
2175 2078
2176 v10 += LOBYTE(pFontArrus->uFontHeight) - 2; 2079 pY += 2 * LOBYTE(pFontArrus->uFontHeight) - 2;
2177 v58 = player->GetBaseAC(); 2080 sprintf(pTmpBuf.data(), "%s: \f%05d%s\n", pGlobalTXT_LocalizationStrings[47], GetConditionDrawColor(player->GetMajorConditionIdx()),
2178 v59 = player->GetActualAC(); 2081 aCharacterConditionNames[player->GetMajorConditionIdx()]);//
2179 v60 = UI_GetHealthManaStringColor(v59, v58); 2082 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 26, pY, 0, pTmpBuf.data(), 226, 0);
2180 sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n\n", pGlobalTXT_LocalizationStrings[12], v60, v59, v58); 2083
2181 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf.data(), 0, 0, 0); 2084 pY += LOBYTE(pFontArrus->uFontHeight) + - 1;
2182 2085 pText = pGlobalTXT_LocalizationStrings[153];//
2183 v10 += 2 * LOBYTE(pFontArrus->uFontHeight) - 2; 2086 if (player->uQuickSpell)
2184 v62 = player->GetMajorConditionIdx(); 2087 pText = pSpellStats->pInfos[player->uQuickSpell].pShortName;
2185 v64 = GetConditionDrawColor(v62); 2088 sprintf(pTmpBuf.data(), "%s: %s", pGlobalTXT_LocalizationStrings[172], pText);//.
2186 sprintf(pTmpBuf.data(), "%s: \f%05d%s\n", pGlobalTXT_LocalizationStrings[47], v64, aCharacterConditionNames[v62]); 2089 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 26, pY, 0, pTmpBuf.data(), 226, 0);
2187 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x1Au, v10, 0, pTmpBuf.data(), 226, 0); 2090
2188 2091 //Second column ( )
2189 v10 += LOBYTE(pFontArrus->uFontHeight) + - 1; 2092 pY = 50;
2190 if (player->uQuickSpell) 2093 sprintf(pTmpBuf.data(), "%s\f%05u\t100%d\f00000 / %d\n", pGlobalTXT_LocalizationStrings[5],
2191 v67 = pSpellStats->pInfos[player->uQuickSpell].pShortName; 2094 UI_GetHealthManaStringColor(player->GetActualAge(), player->GetBaseAge()),
2192 else 2095 player->GetActualAge(), player->GetBaseAge());
2193 v67 = pGlobalTXT_LocalizationStrings[153]; 2096 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0);
2194 sprintf(pTmpBuf.data(), "%s: %s", pGlobalTXT_LocalizationStrings[172], v67); 2097
2195 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x1Au, v10, 0, pTmpBuf.data(), 226, 0); 2098 a2 = "%s\f%05u\t100%d\f00000 / %d\n";
2196 2099 if ( player->GetBaseLevel() > 99 )
2197 v10 = 50; 2100 a2 = "%s\f%05u\t180%d\f00000 / %d\n";
2198 v70 = player->GetBaseAge(); 2101 pY += LOBYTE(pFontArrus->uFontHeight) - 2;
2199 v71 = player->GetActualAge(); 2102 sprintf(pTmpBuf.data(), a2, pGlobalTXT_LocalizationStrings[131],//.
2200 v72 = UI_GetHealthManaStringColor(v71, v70); 2103 UI_GetHealthManaStringColor(player->GetActualLevel(), player->GetBaseLevel()),
2201 sprintf(pTmpBuf.data(), "%s\f%05u\t100%d\f00000 / %d\n", pGlobalTXT_LocalizationStrings[5], v72, v71, v70); 2104 player->GetActualLevel(), player->GetBaseLevel());
2202 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf.data(), 0, 0, 0); 2105 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0);
2203 2106
2204 a2b = "%s\f%05u\t100%d\f00000 / %d\n"; 2107 pY += LOBYTE(pFontArrus->uFontHeight) - 2;
2205 v10 += LOBYTE(pFontArrus->uFontHeight) - 2; 2108 pText = pGlobalTXT_LocalizationStrings[17]; // "Exp."
2206 if ( player->GetBaseLevel() > 99 ) 2109 if (player->uExperience <= 9999999)
2207 a2b = "%s\f%05u\t180%d\f00000 / %d\n"; 2110 pText = pGlobalTXT_LocalizationStrings[83]; // "Experience"
2208 v75 = player->GetBaseLevel(); 2111 sprintf(pTmpBuf.data(), "%s\r180\f%05d%lu\f00000\n\n", pText, player->GetExperienceDisplayColor(), LODWORD(player->uExperience));
2209 v76 = player->GetActualLevel(); 2112 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0);
2210 v77 = UI_GetHealthManaStringColor(v76, v75); 2113
2211 sprintf(pTmpBuf.data(), a2b, pGlobalTXT_LocalizationStrings[131], v77, v76, v75); 2114 pY += 2 * LOBYTE(pFontArrus->uFontHeight);
2212 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf.data(), 0, 0, 0); 2115 sprintf(pTmpBuf.data(), "%s\t100%+d\n", pGlobalTXT_LocalizationStrings[18], player->GetActualAttack(0));
2213 2116 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0);
2214 v10 += LOBYTE(pFontArrus->uFontHeight) - 2; 2117
2215 if (player->uExperience <= 9999999) 2118 pY += LOBYTE(pFontArrus->uFontHeight) - 2;
2216 v78 = pGlobalTXT_LocalizationStrings[83]; // "Experience" 2119 sprintf(pTmpBuf.data(), "%s\t100 %s\n", pGlobalTXT_LocalizationStrings[53], player->GetMeleeDamageString());
2217 else 2120 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0);
2218 v78 = pGlobalTXT_LocalizationStrings[17]; // "Exp." 2121
2219 v81 = player->GetExperienceDisplayColor(); 2122 pY += LOBYTE(pFontArrus->uFontHeight) - 2;
2220 sprintf(pTmpBuf.data(), "%s\r180\f%05d%lu\f00000\n\n", v78, v81, LODWORD(player->uExperience)); 2123 sprintf(pTmpBuf.data(), "%s\t100%+d\n", pGlobalTXT_LocalizationStrings[203], player->GetRangedAttack());
2221 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf.data(), 0, 0, 0); 2124 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0);
2222 2125
2223 v10 += 2 * LOBYTE(pFontArrus->uFontHeight); 2126 pY += LOBYTE(pFontArrus->uFontHeight) - 2;
2224 v83 = player->GetActualAttack(0); 2127 sprintf(pTmpBuf.data(), "%s\t100 %s\n\n", pGlobalTXT_LocalizationStrings[53], player->GetRangedDamageString());
2225 sprintf(pTmpBuf.data(), "%s\t100%+d\n", pGlobalTXT_LocalizationStrings[18], v83); 2128 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0);
2226 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf.data(), 0, 0, 0); 2129
2227 2130 a2 = format_4E2E10;
2228 v10 += LOBYTE(pFontArrus->uFontHeight) - 2; 2131 if ( player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_FIRE) > 99 || player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_FIRE) > 99 )
2229 v85 = player->GetMeleeDamageString(); 2132 a2 = "%s\f%05u\t180%d\f00000 / %d\n";
2230 sprintf(pTmpBuf.data(), "%s\t100 %s\n", pGlobalTXT_LocalizationStrings[53], v85); 2133 pY += 2 * LOBYTE(pFontArrus->uFontHeight) - 4;
2231 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf.data(), 0, 0, 0); 2134 sprintf(pTmpBuf.data(), a2, pGlobalTXT_LocalizationStrings[87],
2232 2135 UI_GetHealthManaStringColor(player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_FIRE), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_FIRE)),
2233 v10 += LOBYTE(pFontArrus->uFontHeight) - 2; 2136 player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_FIRE), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_FIRE));
2234 v87 = player->GetRangedAttack(); 2137 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0);
2235 sprintf(pTmpBuf.data(), "%s\t100%+d\n", pGlobalTXT_LocalizationStrings[203], v87); 2138
2236 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf.data(), 0, 0, 0); 2139 a2 = format_4E2E10;
2237 2140 if ( player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_AIR) > 99 || player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_AIR) > 99 )
2238 v10 += LOBYTE(pFontArrus->uFontHeight) - 2; 2141 a2 = "%s\f%05u\t180%d\f00000 / %d\n";
2239 v89 = player->GetRangedDamageString(); 2142 pY += LOBYTE(pFontArrus->uFontHeight) - 2;
2240 sprintf(pTmpBuf.data(), "%s\t100 %s\n\n", pGlobalTXT_LocalizationStrings[53], v89); 2143 sprintf(pTmpBuf.data(), a2, pGlobalTXT_LocalizationStrings[6],
2241 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf.data(), 0, 0, 0); 2144 UI_GetHealthManaStringColor(player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_AIR), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_AIR)),
2242 2145 player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_AIR), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_AIR));
2243 a2c = format_4E2E10; 2146 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0);
2244 v10 += 2 * LOBYTE(pFontArrus->uFontHeight) - 4; 2147
2245 v131 = player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_FIRE); 2148 a2 = format_4E2E10;
2246 v90 = player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_FIRE); 2149 if ( player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_WATER) > 99 || player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_WATER) > 99 )
2247 if ( v131 > 99 || v90 > 99 ) 2150 a2 = "%s\f%05u\t180%d\f00000 / %d\n";
2248 a2c = "%s\f%05u\t180%d\f00000 / %d\n"; 2151 pY += LOBYTE(pFontArrus->uFontHeight) - 2;
2249 v92 = UI_GetHealthManaStringColor(v131, v90); 2152 sprintf(pTmpBuf.data(), a2, pGlobalTXT_LocalizationStrings[240],
2250 sprintf(pTmpBuf.data(), a2c, pGlobalTXT_LocalizationStrings[87], v92, v131, v90); 2153 UI_GetHealthManaStringColor(player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_WATER), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_WATER)),
2251 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf.data(), 0, 0, 0); 2154 player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_WATER), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_WATER));
2252 2155 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0);
2253 a2d = format_4E2E10; 2156
2254 v10 += LOBYTE(pFontArrus->uFontHeight) - 2; 2157 a2 = format_4E2E10;
2255 v132 = player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_AIR); 2158 if ( player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_EARTH) > 99 )
2256 v93 = player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_AIR); 2159 a2 = "%s\f%05u\t180%d\f00000 / %d\n";
2257 if ( v132 > 99 || v93 > 99 ) 2160 pY += LOBYTE(pFontArrus->uFontHeight) - 2;
2258 a2d = "%s\f%05u\t180%d\f00000 / %d\n"; 2161 sprintf(pTmpBuf.data(), a2, pGlobalTXT_LocalizationStrings[70],
2259 v95 = UI_GetHealthManaStringColor(v132, v93); 2162 UI_GetHealthManaStringColor(player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_EARTH), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_EARTH)),
2260 sprintf(pTmpBuf.data(), a2d, pGlobalTXT_LocalizationStrings[6], v95, v132, v93); 2163 player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_EARTH), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_EARTH));
2261 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf.data(), 0, 0, 0); 2164 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0);
2262 2165
2263 a2e = format_4E2E10; 2166 a2 = format_4E2E10;
2264 v10 += LOBYTE(pFontArrus->uFontHeight) - 2; 2167 if ( player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_MIND) > 99 || player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_MIND) > 99 )
2265 v133 = player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_WATER); 2168 a2 = "%s\f%05u\t180%d\f00000 / %d\n";
2266 v96 = player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_WATER); 2169 pY += LOBYTE(pFontArrus->uFontHeight) - 2;
2267 if ( v133 > 99 || v96 > 99 ) 2170 sprintf(pTmpBuf.data(), a2, pGlobalTXT_LocalizationStrings[142],
2268 a2e = "%s\f%05u\t180%d\f00000 / %d\n"; 2171 UI_GetHealthManaStringColor(player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_MIND), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_MIND)),
2269 v98 = UI_GetHealthManaStringColor(v133, v96); 2172 player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_MIND), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_MIND));
2270 sprintf(pTmpBuf.data(), a2e, pGlobalTXT_LocalizationStrings[240], v98, v133, v96); 2173 if ( player->classType == PLAYER_CLASS_LICH && player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_MIND) == 200 )
2271 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf.data(), 0, 0, 0); 2174 sprintf(pTmpBuf.data(), format_4E2E00, pGlobalTXT_LocalizationStrings[142],
2272 2175 UI_GetHealthManaStringColor(player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_MIND), 200), pGlobalTXT_LocalizationStrings[625]);
2273 a2f = format_4E2E10; 2176 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0);
2274 v10 += LOBYTE(pFontArrus->uFontHeight) - 2; 2177
2275 v134 = player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_EARTH); 2178 a2 = format_4E2E10;
2276 v99 = player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_EARTH); 2179 if ( player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_BODY) > 99 || player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_BODY) > 99 )
2277 if ( v134 > 99 ) 2180 a2 = "%s\f%05u\t180%d\f00000 / %d\n";
2278 a2f = "%s\f%05u\t180%d\f00000 / %d\n"; 2181 pY += LOBYTE(pFontArrus->uFontHeight) - 2;
2279 v101 = UI_GetHealthManaStringColor(v134, v99); 2182 sprintf(pTmpBuf.data(), a2, pGlobalTXT_LocalizationStrings[29],
2280 sprintf(pTmpBuf.data(), a2f, pGlobalTXT_LocalizationStrings[70], v101, v134, v99); 2183 UI_GetHealthManaStringColor(player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_BODY), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_BODY)),
2281 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf.data(), 0, 0, 0); 2184 player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_BODY), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_BODY));
2282 2185 if ( player->classType == PLAYER_CLASS_LICH && player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_BODY) == 200 )
2283 a2g = format_4E2E10; 2186 sprintf(pTmpBuf.data(), format_4E2E00, pGlobalTXT_LocalizationStrings[29],
2284 v10 += LOBYTE(pFontArrus->uFontHeight) - 2; 2187 UI_GetHealthManaStringColor(player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_BODY), 200), pGlobalTXT_LocalizationStrings[625]);
2285 v135 = player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_MIND); 2188 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0);
2286 v102 = player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_MIND);
2287 if ( v135 > 99 || v102 > 99 )
2288 a2g = "%s\f%05u\t180%d\f00000 / %d\n";
2289 v104 = UI_GetHealthManaStringColor(v135, v102);
2290 sprintf(pTmpBuf.data(), a2g, pGlobalTXT_LocalizationStrings[142], v104, v135, v102);
2291 if ( player->classType == PLAYER_CLASS_LICH && v102 == 200 )
2292 {
2293 v106 = UI_GetHealthManaStringColor(v135, 200);
2294 sprintf(pTmpBuf.data(), format_4E2E00, pGlobalTXT_LocalizationStrings[142], v106, pGlobalTXT_LocalizationStrings[625]);
2295 }
2296 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf.data(), 0, 0, 0);
2297
2298 a2h = format_4E2E10;
2299 v10 += LOBYTE(pFontArrus->uFontHeight) - 2;
2300 v136 = player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_BODY);
2301 v107 = player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_BODY);
2302 if ( v136 > 99 || v107 > 99 )
2303 a2h = "%s\f%05u\t180%d\f00000 / %d\n";
2304 v109 = UI_GetHealthManaStringColor(v136, v107);
2305 sprintf(pTmpBuf.data(), a2h, pGlobalTXT_LocalizationStrings[29], v109, v136, v107);
2306 if ( player->classType == PLAYER_CLASS_LICH && v107 == 200 )
2307 {
2308 v111 = UI_GetHealthManaStringColor(v136, 200);
2309 sprintf(pTmpBuf.data(), format_4E2E00, pGlobalTXT_LocalizationStrings[29], v111, pGlobalTXT_LocalizationStrings[625]);
2310 }
2311 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf.data(), 0, 0, 0);
2312 } 2189 }
2313 2190
2314 bool awardSort (int i,int j) { 2191 bool awardSort (int i, int j)
2315 if (pAwards[i].uPriority == 0) //none 2192 {
2316 { 2193 if (pAwards[i].uPriority == 0) //none
2317 return false; 2194 return false;
2318 } 2195 else if (pAwards[j].uPriority == 0)
2319 else if (pAwards[j].uPriority == 0) 2196 return true;
2320 { 2197 else if(pAwards[i].uPriority == 1) //fines,arena stuff,etc
2321 return true; 2198 return false;
2322 } 2199 else if(pAwards[j].uPriority == 1)
2323 else if(pAwards[i].uPriority == 1) //fines,arena stuff,etc 2200 return true;
2324 { 2201 else if(pAwards[i].uPriority == 5) //joined guilds
2325 return false; 2202 return false;
2326 } 2203 else if(pAwards[j].uPriority == 5)
2327 else if(pAwards[j].uPriority == 1) 2204 return true;
2328 { 2205 else
2329 return true; 2206 return (pAwards[i].uPriority < pAwards[j].uPriority);
2330 }
2331 else if(pAwards[i].uPriority == 5) //joined guilds
2332 {
2333 return false;
2334 }
2335 else if(pAwards[j].uPriority == 5)
2336 {
2337 return true;
2338 }
2339 else
2340 {
2341 return (pAwards[i].uPriority<pAwards[j].uPriority);
2342 }
2343 } 2207 }
2344 2208
2345 //----- (00419100) -------------------------------------------------------- 2209 //----- (00419100) --------------------------------------------------------
2346 void FillAwardsData() 2210 void FillAwardsData()
2347 { 2211 {
2348 auto pPlayer = pPlayers[uActiveCharacter]; 2212 Player* pPlayer = pPlayers[uActiveCharacter];
2349 2213
2350 memset(achieved_awards.data(), 0, 4000); 2214 memset(achieved_awards.data(), 0, 4000);
2351 num_achieved_awards = 0; 2215 num_achieved_awards = 0;
2352 2216
2353 memset(pTmpBuf2.data(), 0, 0x7D0u); 2217 memset(pTmpBuf2.data(), 0, 0x7D0u);
2354 BtnDown_flag = 0; 2218 BtnDown_flag = 0;
2355 BtnUp_flag = 0; 2219 BtnUp_flag = 0;
2356 books_page_number = 0; 2220 books_page_number = 0;
2357 books_primary_item_per_page = 0; 2221 books_primary_item_per_page = 0;
2358 for (int i = 0; i < 105; ++i) 2222 for ( int i = 1; i < 105; ++i )
2359 { 2223 {
2360 if ( _449B57_test_bit(pPlayer->_guilds_member_bits, i) && pAwards[i].pText ) 2224 if ( _449B57_test_bit(pPlayer->_achieved_awards_bits, i) && pAwards[i].pText )
2361 { 2225 achieved_awards[num_achieved_awards++] = (AwardType)i;
2362 achieved_awards[num_achieved_awards++] = (AwardType)i; 2226 }
2363 } 2227 full_num_items_in_book = num_achieved_awards;
2364 } 2228 num_achieved_awards = 0;
2365 full_num_items_in_book = num_achieved_awards; 2229
2366 num_achieved_awards = 0; 2230 //sort awards index
2367 2231
2368 //sort awards index 2232 if (full_num_items_in_book>0)
2369 if (full_num_items_in_book > 0) 2233 {
2370 { 2234 for (int i = 0; i< full_num_items_in_book; ++i)
2371 std::stable_sort(achieved_awards.begin(), achieved_awards.end(), awardSort); 2235 achieved_awards[full_num_items_in_book+i] = (AwardType)(rand()%16);
2372 } 2236 for (int i = 1; i< full_num_items_in_book; ++i)
2373 } 2237 {
2374 2238 for (int j = i; j< full_num_items_in_book; ++j)
2239 {
2240 AwardType tmp;
2241 if (pAwards[achieved_awards[j]].uPriority < pAwards[achieved_awards[i]].uPriority)
2242 {
2243 tmp= achieved_awards[j];
2244 achieved_awards[j] = achieved_awards[i];
2245 achieved_awards[i] = tmp;
2246 }
2247 }
2248 }
2249 }
2250
2251 // if (full_num_items_in_book > 0)
2252 /* {
2253 std::stable_sort(achieved_awards.begin(), achieved_awards.end(), awardSort);
2254 }*/
2255 }
2375 2256
2376 //----- (0043EF2B) -------------------------------------------------------- 2257 //----- (0043EF2B) --------------------------------------------------------
2377 void WetsuitOn( unsigned int uPlayerID ) 2258 void WetsuitOn( unsigned int uPlayerID )
2378 { 2259 {
2379 CHARACTER_RACE player_race; // edi@2 2260 CHARACTER_RACE player_race; // edi@2
2380 signed int player_sex; // eax@2 2261 signed int player_sex; // eax@2
2381 int texture_num; // ecx@5 2262 int texture_num; // ecx@5
2382 char pContainer[20]; // [sp+4h] [bp-1Ch]@7 2263 char pContainer[20]; // [sp+4h] [bp-1Ch]@7
2383 2264
2384 if ( uPlayerID> 0 ) 2265 if ( uPlayerID> 0 )
2385 { 2266 {
2386 player_race = pPlayers[uPlayerID]->GetRace(); 2267 player_race = pPlayers[uPlayerID]->GetRace();
2387 player_sex = pPlayers[uPlayerID]->GetSexByVoice(); 2268 player_sex = pPlayers[uPlayerID]->GetSexByVoice();
2388 if ( player_race == CHARACTER_RACE_DWARF ) 2269 if ( player_race == CHARACTER_RACE_DWARF )
2389 texture_num = (player_sex != 0) + 3; 2270 texture_num = (player_sex != 0) + 3;
2390 else 2271 else
2391 texture_num = (player_sex != 0) + 1; 2272 texture_num = (player_sex != 0) + 1;
2392 wsprintfA(pContainer, "pc23v%dBod", texture_num); 2273 wsprintfA(pContainer, "pc23v%dBod", texture_num);
2393 papredoll_dbods[uPlayerID - 1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); 2274 papredoll_dbods[uPlayerID - 1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
2394 wsprintfA(pContainer, "pc23v%dlad", texture_num); 2275 wsprintfA(pContainer, "pc23v%dlad", texture_num);
2395 papredoll_dlads[uPlayerID - 1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); 2276 papredoll_dlads[uPlayerID - 1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
2396 wsprintfA(pContainer, "pc23v%dlau", texture_num); 2277 wsprintfA(pContainer, "pc23v%dlau", texture_num);
2397 papredoll_dlaus[uPlayerID - 1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); 2278 papredoll_dlaus[uPlayerID - 1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
2398 wsprintfA(pContainer, "pc23v%drh", texture_num); 2279 wsprintfA(pContainer, "pc23v%drh", texture_num);
2399 papredoll_drhs[uPlayerID - 1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); 2280 papredoll_drhs[uPlayerID - 1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
2400 wsprintfA(pContainer, "pc23v%dlh", texture_num); 2281 wsprintfA(pContainer, "pc23v%dlh", texture_num);
2401 papredoll_dlhs[uPlayerID - 1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); 2282 papredoll_dlhs[uPlayerID - 1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
2402 wsprintfA(pContainer, "pc23v%dlhu", texture_num); 2283 wsprintfA(pContainer, "pc23v%dlhu", texture_num);
2403 papredoll_dlhus[uPlayerID - 1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); 2284 papredoll_dlhus[uPlayerID - 1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
2404 2285
2405 if ( pPlayers[uPlayerID]->uCurrentFace == 12 || pPlayers[uPlayerID]->uCurrentFace == 13 ) 2286 if ( pPlayers[uPlayerID]->uCurrentFace == 12 || pPlayers[uPlayerID]->uCurrentFace == 13 )
2406 papredoll_dbrds[pPlayers[uPlayerID]->uCurrentFace] = 0; 2287 papredoll_dbrds[pPlayers[uPlayerID]->uCurrentFace] = 0;
2407 2288 papredoll_flying_feet[pPlayers[uPlayerID]->uCurrentFace] = 0;
2408 papredoll_flying_feet[pPlayers[uPlayerID]->uCurrentFace] = 0; 2289 IsPlayerWearingWatersuit[uPlayerID] = 1;
2409 IsPlayerWearingWatersuit[uPlayerID] = 1; 2290 }
2410 } 2291 }
2411 }
2412 2292
2413 //----- (0043F0BD) -------------------------------------------------------- 2293 //----- (0043F0BD) --------------------------------------------------------
2414 void WetsuitOff( unsigned int uPlayerID ) 2294 void WetsuitOff( unsigned int uPlayerID )
2415 { 2295 {
2416 char pContainer[20]; // [sp+0h] [bp-18h]@4 2296 char pContainer[20]; // [sp+0h] [bp-18h]@4
2417 2297
2418 if (uPlayerID > 0 ) 2298 if (uPlayerID > 0 )
2419 { 2299 {
2420 papredoll_dbods[uPlayerID - 1] = pIcons_LOD->LoadTexture(dbod_texnames_by_face[pPlayers[uPlayerID]->uCurrentFace], TEXTURE_16BIT_PALETTE); 2300 papredoll_dbods[uPlayerID - 1] = pIcons_LOD->LoadTexture(dbod_texnames_by_face[pPlayers[uPlayerID]->uCurrentFace], TEXTURE_16BIT_PALETTE);
2421 papredoll_dlads[uPlayerID - 1] = pIcons_LOD->LoadTexture(dlad_texnames_by_face[pPlayers[uPlayerID]->uCurrentFace], TEXTURE_16BIT_PALETTE); 2301 papredoll_dlads[uPlayerID - 1] = pIcons_LOD->LoadTexture(dlad_texnames_by_face[pPlayers[uPlayerID]->uCurrentFace], TEXTURE_16BIT_PALETTE);
2422 papredoll_dlaus[uPlayerID - 1] = pIcons_LOD->LoadTexture(dlau_texnames_by_face[pPlayers[uPlayerID]->uCurrentFace], TEXTURE_16BIT_PALETTE); 2302 papredoll_dlaus[uPlayerID - 1] = pIcons_LOD->LoadTexture(dlau_texnames_by_face[pPlayers[uPlayerID]->uCurrentFace], TEXTURE_16BIT_PALETTE);
2423 papredoll_drhs [uPlayerID - 1] = pIcons_LOD->LoadTexture(drh_texnames_by_face [pPlayers[uPlayerID]->uCurrentFace], TEXTURE_16BIT_PALETTE); 2303 papredoll_drhs [uPlayerID - 1] = pIcons_LOD->LoadTexture(drh_texnames_by_face [pPlayers[uPlayerID]->uCurrentFace], TEXTURE_16BIT_PALETTE);
2424 papredoll_dlhs [uPlayerID - 1] = pIcons_LOD->LoadTexture(dlh_texnames_by_face [pPlayers[uPlayerID]->uCurrentFace], TEXTURE_16BIT_PALETTE); 2304 papredoll_dlhs [uPlayerID - 1] = pIcons_LOD->LoadTexture(dlh_texnames_by_face [pPlayers[uPlayerID]->uCurrentFace], TEXTURE_16BIT_PALETTE);
2425 papredoll_dlhus[uPlayerID - 1] = pIcons_LOD->LoadTexture(dlhu_texnames_by_face[pPlayers[uPlayerID]->uCurrentFace], TEXTURE_16BIT_PALETTE); 2305 papredoll_dlhus[uPlayerID - 1] = pIcons_LOD->LoadTexture(dlhu_texnames_by_face[pPlayers[uPlayerID]->uCurrentFace], TEXTURE_16BIT_PALETTE);
2426 2306
2427 if ( pPlayers[uPlayerID]->uCurrentFace == 12 || pPlayers[uPlayerID]->uCurrentFace == 13 ) 2307 if ( pPlayers[uPlayerID]->uCurrentFace == 12 || pPlayers[uPlayerID]->uCurrentFace == 13 )
2428 { 2308 {
2429 wsprintfA(pContainer, "pc%02dbrd", pPlayers[uPlayerID]->uCurrentFace + 1); 2309 wsprintfA(pContainer, "pc%02dbrd", pPlayers[uPlayerID]->uCurrentFace + 1);
2430 papredoll_dbrds[pPlayers[uPlayerID]->uCurrentFace] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); 2310 papredoll_dbrds[pPlayers[uPlayerID]->uCurrentFace] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
2431 } 2311 }
2432 wsprintfA(pContainer, "item281pc%02d", pPlayers[uPlayerID]->uCurrentFace + 1); 2312 wsprintfA(pContainer, "item281pc%02d", pPlayers[uPlayerID]->uCurrentFace + 1);
2433 papredoll_flying_feet[pPlayers[uPlayerID]->uCurrentFace] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); 2313 papredoll_flying_feet[pPlayers[uPlayerID]->uCurrentFace] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
2434 IsPlayerWearingWatersuit[uPlayerID] = 0; 2314 IsPlayerWearingWatersuit[uPlayerID] = 0;
2435 } 2315 }
2436 } 2316 }
2317
2437 //----- (00468F8A) -------------------------------------------------------- 2318 //----- (00468F8A) --------------------------------------------------------
2438 void __cdecl OnPaperdollLeftClick() 2319 void OnPaperdollLeftClick()
2439 { 2320 {
2440 int v1; // ecx@1 2321 int v1; // ecx@1
2441 unsigned int v2; // edi@1 2322 unsigned int v2; // edi@1
2442 unsigned int v3; // edx@4 2323 unsigned int v3; // edx@4
2443 unsigned int pSkillType; // esi@5 2324 unsigned int pSkillType; // esi@5
2444 unsigned __int16 v5; // ax@7 2325 unsigned __int16 v5; // ax@7
2445 unsigned int v6; // edi@19 2326 //unsigned int v6; // edi@19
2446 int v7; // esi@27 2327 int v7; // esi@27
2447 int v8; // eax@29 2328 int v8; // eax@29
2448 int v9; // edx@32 2329 //int v9; // edx@32
2449 int v10; // esi@34 2330 int v10; // esi@34
2450 int v11; // eax@34 2331 //int v11; // eax@34
2451 int v12; // esi@38 2332 int v12; // esi@38
2452 int v13; // eax@38 2333 //int v13; // eax@38
2453 char v14; // zf@38 2334 char v14; // zf@38
2454 int v15; // esi@42 2335 int v15; // esi@42
2455 int v16; // eax@42 2336 //int v16; // eax@42
2456 int v17; // eax@44 2337 int v17; // eax@44
2457 unsigned int v18; // ecx@55 2338 unsigned int v18; // ecx@55
2458 unsigned int v19; // eax@55 2339 unsigned int v19; // eax@55
2459 int v20; // esi@60 2340 int v20; // esi@60
2460 int v21; // eax@60 2341 //int v21; // eax@60
2461 unsigned int v22; // eax@61 2342 unsigned int v22; // eax@61
2462 int v23; // eax@62 2343 int v23; // eax@62
2463 int v24; // esi@65 2344 int v24; // esi@65
2464 int v25; // eax@65 2345 int v25; // eax@65
2465 int v26; // eax@69 2346 int v26; // eax@69
2480 unsigned int v48; // [sp+30h] [bp-1Ch]@88 2361 unsigned int v48; // [sp+30h] [bp-1Ch]@88
2481 unsigned int v49; // [sp+34h] [bp-18h]@57 2362 unsigned int v49; // [sp+34h] [bp-18h]@57
2482 unsigned int v50; // [sp+38h] [bp-14h]@50 2363 unsigned int v50; // [sp+38h] [bp-14h]@50
2483 int v51; // [sp+3Ch] [bp-10h]@1 2364 int v51; // [sp+3Ch] [bp-10h]@1
2484 int v52; // [sp+40h] [bp-Ch]@5 2365 int v52; // [sp+40h] [bp-Ch]@5
2485 //int v53; // [sp+44h] [bp-8h]@1 2366 ITEM_EQUIP_TYPE pEquipType;
2486 //unsigned int v54; // [sp+48h] [bp-4h]@1
2487 2367
2488 v51 = 0; 2368 v51 = 0;
2489 _this.Reset(); 2369 _this.Reset();
2490 //v0 = pPlayers[uActiveCharacter]; 2370 //v0 = pPlayers[uActiveCharacter];
2491 v1 = pPlayers[uActiveCharacter]->pEquipment.uMainHand; 2371 v1 = pPlayers[uActiveCharacter]->pEquipment.uMainHand;
2495 if ( v1 && pItemsTable->pItems[*(int *)&pPlayers[uActiveCharacter]->pInventoryItemList[v1 - 1]].uEquipType == 1 ) 2375 if ( v1 && pItemsTable->pItems[*(int *)&pPlayers[uActiveCharacter]->pInventoryItemList[v1 - 1]].uEquipType == 1 )
2496 v51 = v1; 2376 v51 = v1;
2497 v3 = pParty->pPickedItem.uItemID; 2377 v3 = pParty->pPickedItem.uItemID;
2498 if ( pParty->pPickedItem.uItemID ) 2378 if ( pParty->pPickedItem.uItemID )
2499 { 2379 {
2500 v52 = pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType; 2380 pEquipType = pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType;
2501 pSkillType = pItemsTable->pItems[pParty->pPickedItem.uItemID].uSkillType; 2381 pSkillType = pItemsTable->pItems[pParty->pPickedItem.uItemID].uSkillType;
2502 if ( pSkillType == 4 ) 2382 if ( pSkillType == 4 )
2503 { 2383 {
2504 if ( v2 ) 2384 if ( v2 )
2505 { 2385 {
2536 { 2416 {
2537 pPlayers[uActiveCharacter]->EquipBody((ITEM_EQUIP_TYPE)3); 2417 pPlayers[uActiveCharacter]->EquipBody((ITEM_EQUIP_TYPE)3);
2538 WetsuitOn(uActiveCharacter); 2418 WetsuitOn(uActiveCharacter);
2539 return; 2419 return;
2540 } 2420 }
2541 v6 = v52; 2421 //v6 = v52;
2542 switch ( v52 ) 2422 switch ( pEquipType )
2543 { 2423 {
2544 case 2u: 2424 case EQUIP_BOW:
2545 case 3u: 2425 case EQUIP_ARMOUR:
2546 case 5u: 2426 case EQUIP_HELMET:
2547 case 6u: 2427 case EQUIP_BELT:
2548 case 7u: 2428 case EQUIP_CLOAK:
2549 case 8u: 2429 case EQUIP_GAUNTLETS:
2550 case 9u: 2430 case EQUIP_BOOTS:
2551 case 0xBu: 2431 case EQUIP_AMULET:
2552 if ( !pPlayers[uActiveCharacter]->HasSkill(pSkillType) ) 2432 if ( !pPlayers[uActiveCharacter]->HasSkill(pSkillType) )
2553 { 2433 {
2554 pPlayers[uActiveCharacter]->PlaySound(SPEECH_39, 0); 2434 pPlayers[uActiveCharacter]->PlaySound(SPEECH_39, 0);
2555 return; 2435 return;
2556 } 2436 }
2557 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) && (v6 != 3 || bUnderwater) ) 2437 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) && (pEquipType != EQUIP_ARMOUR || bUnderwater) )
2558 { 2438 {
2559 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); 2439 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
2560 return; 2440 return;
2561 } 2441 }
2562 pPlayers[uActiveCharacter]->EquipBody((ITEM_EQUIP_TYPE)v6); 2442 pPlayers[uActiveCharacter]->EquipBody(pEquipType);
2563 if ( pParty->pPickedItem.uItemID == ITEM_WETSUIT ) 2443 if ( pParty->pPickedItem.uItemID == ITEM_WETSUIT )
2564 WetsuitOff(uActiveCharacter); 2444 WetsuitOff(uActiveCharacter);
2565 return; 2445 return;
2566 case 0xAu: 2446
2447 case EQUIP_RING://
2567 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) ) 2448 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) )
2568 { 2449 {
2569 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); 2450 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
2570 return; 2451 return;
2571 } 2452 }
2572 v52 = 10; 2453 //
2573 v7 = (int)&pPlayers[uActiveCharacter]->pEquipment.uRings; 2454 v7 = 0;
2574 while ( 1 ) 2455 for ( v52 = 10; (signed int)v52 < 16; ++v52 )
2575 { 2456 {
2576 if ( !*(int *)v7 ) 2457 if ( !pPlayers[uActiveCharacter]->pEquipment.uRings[v7] )
2577 { 2458 {
2578 v8 = pPlayers[uActiveCharacter]->FindFreeInventoryListSlot(); 2459 v8 = pPlayers[uActiveCharacter]->FindFreeInventoryListSlot();
2579 if ( v8 >= 0 ) 2460 if ( v8 >= 0 )
2580 { 2461 {
2581 v9 = v52; 2462 pParty->pPickedItem.uBodyAnchor = v52 + 1;
2582 pParty->pPickedItem.uBodyAnchor = v52 + 1; 2463 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v8], &pParty->pPickedItem, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v8]));
2583 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v8], &pParty->pPickedItem, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v8])); 2464 pPlayers[uActiveCharacter]->pEquipment.uRings[v7] = v8 + 1;
2584 *(&pPlayers[uActiveCharacter]->pEquipment.uShield + v9) = v8 + 1; 2465 pMouse->RemoveHoldingItem();
2585 pMouse->RemoveHoldingItem();
2586 break; 2466 break;
2587 } 2467 }
2588 } 2468 }
2589 ++v52; 2469 v7++;
2590 v7 += 4; 2470 }
2591 if ( (signed int)v52 > 15 ) 2471 if ( v52 == 16 )//
2592 break;
2593 }
2594 if ( v52 == 16 )
2595 { 2472 {
2596 v52 = pPlayers[uActiveCharacter]->pEquipment.uRings[6] - 1; 2473 v52 = pPlayers[uActiveCharacter]->pEquipment.uRings[6] - 1;
2597 memcpy(&_this, &pParty->pPickedItem, sizeof(_this)); 2474 memcpy(&_this, &pParty->pPickedItem, sizeof(_this));
2598 v10 = (int)((char *)pPlayers[uActiveCharacter] + 36 * v52); 2475 v10 = (int)((char *)pPlayers[uActiveCharacter] + 36 * v52);
2599 *(char *)(v10 + 556) = 0; 2476 *(char *)(v10 + 556) = 0;
2600 pParty->pPickedItem.Reset(); 2477 pParty->pPickedItem.Reset();
2601 pParty->SetHoldingItem((ItemGen *)(v10 + 532)); 2478 pParty->SetHoldingItem((ItemGen *)(v10 + 532));
2602 _this.uBodyAnchor = 16; 2479 _this.uBodyAnchor = 16;
2603 v11 = v52 + 1;
2604 memcpy((void *)(v10 + 532), &_this, 0x24u); 2480 memcpy((void *)(v10 + 532), &_this, 0x24u);
2605 pPlayers[uActiveCharacter]->pEquipment.uRings[6] = v11; 2481 pPlayers[uActiveCharacter]->pEquipment.uRings[6] = v52 + 1;
2606 } 2482 }
2607 return; 2483 return;
2608 case 4u: 2484
2485 case EQUIP_SHIELD://
2609 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) ) 2486 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) )
2610 { 2487 {
2611 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); 2488 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
2612 return; 2489 return;
2613 } 2490 }
2614 if ( !pPlayers[uActiveCharacter]->HasSkill(pSkillType) ) 2491 if ( !pPlayers[uActiveCharacter]->HasSkill(pSkillType) )
2615 { 2492 {
2616 pPlayers[uActiveCharacter]->PlaySound(SPEECH_39, 0); 2493 pPlayers[uActiveCharacter]->PlaySound(SPEECH_39, 0);
2617 return; 2494 return;
2618 } 2495 }
2623 v12 = (int)((char *)pPlayers[uActiveCharacter] + 36 * v2); 2500 v12 = (int)((char *)pPlayers[uActiveCharacter] + 36 * v2);
2624 *(char *)(v12 + 556) = 0; 2501 *(char *)(v12 + 556) = 0;
2625 pParty->pPickedItem.Reset(); 2502 pParty->pPickedItem.Reset();
2626 pParty->SetHoldingItem((ItemGen *)(v12 + 532)); 2503 pParty->SetHoldingItem((ItemGen *)(v12 + 532));
2627 _this.uBodyAnchor = 1; 2504 _this.uBodyAnchor = 1;
2628 v13 = v2 + 1;
2629 v14 = v51 == 0; 2505 v14 = v51 == 0;
2630 memcpy((void *)(v12 + 532), &_this, 0x24u); 2506 memcpy((void *)(v12 + 532), &_this, 0x24u);
2631 pPlayers[uActiveCharacter]->pEquipment.uShield = v13; 2507 pPlayers[uActiveCharacter]->pEquipment.uShield = v2 + 1;
2632 if ( v14 ) 2508 if ( v14 )
2633 return; 2509 return;
2634 } 2510 }
2635 else 2511 else
2636 { 2512 {
2650 v15 = (int)((char *)pPlayers[uActiveCharacter] + 36 * (v1 - 1)); 2526 v15 = (int)((char *)pPlayers[uActiveCharacter] + 36 * (v1 - 1));
2651 *(char *)(v15 + 556) = 0; 2527 *(char *)(v15 + 556) = 0;
2652 pParty->pPickedItem.Reset(); 2528 pParty->pPickedItem.Reset();
2653 pParty->SetHoldingItem((ItemGen *)(v15 + 532)); 2529 pParty->SetHoldingItem((ItemGen *)(v15 + 532));
2654 _this.uBodyAnchor = 1; 2530 _this.uBodyAnchor = 1;
2655 v16 = v52 + 1;
2656 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v52], &_this, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v52])); 2531 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v52], &_this, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v52]));
2657 pPlayers[uActiveCharacter]->pEquipment.uShield = v16; 2532 pPlayers[uActiveCharacter]->pEquipment.uShield = v52 + 1;
2658 } 2533 }
2659 pPlayers[uActiveCharacter]->pEquipment.uMainHand = 0; 2534 pPlayers[uActiveCharacter]->pEquipment.uMainHand = 0;
2660 return; 2535 return;
2661 case 0u: 2536 case EQUIP_OFF_HAND:
2662 case 0xCu: 2537 case EQUIP_WAND:
2663 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) 2538 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter)
2664 && pParty->pPickedItem.uItemID != 64 2539 && pParty->pPickedItem.uItemID != 64
2665 && pParty->pPickedItem.uItemID != 65 ) 2540 && pParty->pPickedItem.uItemID != 65 )
2666 { 2541 {
2667 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); 2542 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
2668 return; 2543 return;
2669 } 2544 }
2670 if ( !pPlayers[uActiveCharacter]->HasSkill(pSkillType) ) 2545 if ( !pPlayers[uActiveCharacter]->HasSkill(pSkillType) )
2671 { 2546 {
2672 pPlayers[uActiveCharacter]->PlaySound(SPEECH_39, 0); 2547 pPlayers[uActiveCharacter]->PlaySound(SPEECH_39, 0);
2673 return; 2548 return;
2674 } 2549 }
2675 v50 = 0; 2550 v50 = 0;
2676 if ( pSkillType == 2 && (unsigned __int16)(pPlayers[uActiveCharacter]->pActiveSkills[2] & 0xFFC0) 2551 if ( pSkillType == 2 && (unsigned __int16)(pPlayers[uActiveCharacter]->pActiveSkills[2] & 0xFFC0)
2677 || pSkillType == 1 && (signed int)SkillToMastery(pPlayers[uActiveCharacter]->pActiveSkills[1]) >= 3 ) 2552 || pSkillType == 1 && (signed int)SkillToMastery(pPlayers[uActiveCharacter]->pActiveSkills[1]) >= 3 )
2678 { 2553 {
2679 2554 v18 = pMouse->uMouseClickX;
2680 v18 = pMouse->uMouseClickX; 2555 v19 = pMouse->uMouseClickY;
2681 v19 = pMouse->uMouseClickY;
2682
2683 v49 = v19; 2556 v49 = v19;
2684 if ( (signed int)v18 >= 560 ) 2557 if ( (signed int)v18 >= 560 )
2685 { 2558 {
2686 if ( !v51 ) 2559 if ( !v51 )
2687 { 2560 {
2692 v20 = (int)((char *)pPlayers[uActiveCharacter] + 36 * v2); 2565 v20 = (int)((char *)pPlayers[uActiveCharacter] + 36 * v2);
2693 *(char *)(v20 + 556) = 0; 2566 *(char *)(v20 + 556) = 0;
2694 pParty->pPickedItem.Reset(); 2567 pParty->pPickedItem.Reset();
2695 pParty->SetHoldingItem((ItemGen *)(v20 + 532)); 2568 pParty->SetHoldingItem((ItemGen *)(v20 + 532));
2696 _this.uBodyAnchor = 1; 2569 _this.uBodyAnchor = 1;
2697 v21 = v2 + 1; 2570 v14 = pEquipType == EQUIP_WAND;
2698 v14 = v52 == 12;
2699 memcpy((void *)(v20 + 532), &_this, 0x24u); 2571 memcpy((void *)(v20 + 532), &_this, 0x24u);
2700 pPlayers[uActiveCharacter]->pEquipment.uShield = v21; 2572 pPlayers[uActiveCharacter]->pEquipment.uShield = v2 + 1;
2701 if ( !v14 ) 2573 if ( !v14 )
2702 return; 2574 return;
2703 v22 = _this.uItemID; 2575 v22 = _this.uItemID;
2704 v50 = v22; 2576 v50 = v22;
2705 if ( v50 ) 2577 if ( v50 )
2706 { 2578 {
2707 __debugbreak(); // looks like offset in player's inventory and wand_lut much like case in 0042ECB5 2579 __debugbreak(); // looks like offset in player's inventory and wand_lut much like case in 0042ECB5
2708 stru_A750F8[uActiveCharacter - 1]._494836(*((int *)&pSpellDatas[66].uNormalLevelRecovery + v50), uActiveCharacter - 1 + 9); 2580 stru_A750F8[uActiveCharacter - 1]._494836(*((int *)&pSpellDatas[66].uNormalLevelRecovery + v50), uActiveCharacter - 1 + 9);
2709 } 2581 }
2710 break; 2582 break;
2711 } 2583 }
2712 v23 = pPlayers[uActiveCharacter]->FindFreeInventoryListSlot(); 2584 v23 = pPlayers[uActiveCharacter]->FindFreeInventoryListSlot();
2713 if ( v23 < 0 ) 2585 if ( v23 < 0 )
2714 return; 2586 return;
2715 pParty->pPickedItem.uBodyAnchor = 1; 2587 pParty->pPickedItem.uBodyAnchor = 1;
2716 v50 = (unsigned int)&pPlayers[uActiveCharacter]->pInventoryItemList[v23]; 2588 v50 = (unsigned int)&pPlayers[uActiveCharacter]->pInventoryItemList[v23];
2717 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v23], &pParty->pPickedItem, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v23])); 2589 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v23], &pParty->pPickedItem, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v23]));
2718 pPlayers[uActiveCharacter]->pEquipment.uShield = v23 + 1; 2590 pPlayers[uActiveCharacter]->pEquipment.uShield = v23 + 1;
2719 pMouse->RemoveHoldingItem(); 2591 pMouse->RemoveHoldingItem();
2720 if ( v52 != 12 ) 2592 if ( pEquipType != 12 )
2721 return; 2593 return;
2722 v22 = *(int *)v50; 2594 v22 = *(int *)v50;
2723 v50 = v22; 2595 v50 = v22;
2724 if ( v50 ) 2596 if ( v50 )
2725 { 2597 {
2726 __debugbreak(); // looks like offset in player's inventory and wand_lut much like case in 0042ECB5 2598 __debugbreak(); // looks like offset in player's inventory and wand_lut much like case in 0042ECB5
2727 stru_A750F8[uActiveCharacter - 1]._494836(*((int *)&pSpellDatas[66].uNormalLevelRecovery + v50), uActiveCharacter - 1 + 9); 2599 stru_A750F8[uActiveCharacter - 1]._494836(*((int *)&pSpellDatas[66].uNormalLevelRecovery + v50), uActiveCharacter - 1 + 9);
2728 } 2600 }
2729 break; 2601 break;
2730 } 2602 }
2731 } 2603 }
2732 } 2604 }
2733 if ( !v1 ) 2605 if ( !v1 )
2734 { 2606 {
2737 return; 2609 return;
2738 pParty->pPickedItem.uBodyAnchor = 2; 2610 pParty->pPickedItem.uBodyAnchor = 2;
2739 v50 = (unsigned int)&pPlayers[uActiveCharacter]->pInventoryItemList[v26]; 2611 v50 = (unsigned int)&pPlayers[uActiveCharacter]->pInventoryItemList[v26];
2740 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v26], &pParty->pPickedItem, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v26])); 2612 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v26], &pParty->pPickedItem, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v26]));
2741 pPlayers[uActiveCharacter]->pEquipment.uMainHand = v26 + 1; 2613 pPlayers[uActiveCharacter]->pEquipment.uMainHand = v26 + 1;
2742 pMouse->RemoveHoldingItem(); 2614 pMouse->RemoveHoldingItem();
2743 if ( v52 != 12 ) 2615 if ( pEquipType != 12 )
2744 return; 2616 return;
2745 v22 = *(int *)v50; 2617 v22 = *(int *)v50;
2746 v50 = v22; 2618 v50 = v22;
2747 if ( v50 ) 2619 if ( v50 )
2748 { 2620 {
2749 __debugbreak(); // looks like offset in player's inventory and wand_lut much like case in 0042ECB5 2621 __debugbreak(); // looks like offset in player's inventory and wand_lut much like case in 0042ECB5
2750 stru_A750F8[uActiveCharacter - 1]._494836(*((int *)&pSpellDatas[66].uNormalLevelRecovery + v50), uActiveCharacter - 1 + 9); 2622 stru_A750F8[uActiveCharacter - 1]._494836(*((int *)&pSpellDatas[66].uNormalLevelRecovery + v50), uActiveCharacter - 1 + 9);
2751 } 2623 }
2752 break; 2624 break;
2753 } 2625 }
2754 --v1; 2626 --v1;
2755 memcpy(&_this, &pParty->pPickedItem, sizeof(_this)); 2627 memcpy(&_this, &pParty->pPickedItem, sizeof(_this));
2756 v24 = (int)((char *)pPlayers[uActiveCharacter] + 36 * v1); 2628 v24 = (int)((char *)pPlayers[uActiveCharacter] + 36 * v1);
2757 *(char *)(v24 + 556) = 0; 2629 *(char *)(v24 + 556) = 0;
2758 pParty->pPickedItem.Reset(); 2630 pParty->pPickedItem.Reset();
2759 pParty->SetHoldingItem((ItemGen *)(v24 + 532)); 2631 pParty->SetHoldingItem((ItemGen *)(v24 + 532));
2760 _this.uBodyAnchor = 2; 2632 _this.uBodyAnchor = 2;
2761 v25 = v1 + 1; 2633 v25 = v1 + 1;
2762 v14 = v52 == 12; 2634 v14 = pEquipType == 12;
2763 memcpy((void *)(v24 + 532), &_this, 0x24u); 2635 memcpy((void *)(v24 + 532), &_this, 0x24u);
2764 pPlayers[uActiveCharacter]->pEquipment.uMainHand = v25; 2636 pPlayers[uActiveCharacter]->pEquipment.uMainHand = v25;
2765 if ( v14 ) 2637 if ( v14 )
2766 v50 = _this.uItemID; 2638 v50 = _this.uItemID;
2767 if ( v51 ) 2639 if ( v51 )
2770 { 2642 {
2771 __debugbreak(); // looks like offset in player's inventory and wand_lut much like case in 0042ECB5 2643 __debugbreak(); // looks like offset in player's inventory and wand_lut much like case in 0042ECB5
2772 stru_A750F8[uActiveCharacter - 1]._494836( *((int *)&pSpellDatas[66].uNormalLevelRecovery + v50), uActiveCharacter - 1 + 9); 2644 stru_A750F8[uActiveCharacter - 1]._494836( *((int *)&pSpellDatas[66].uNormalLevelRecovery + v50), uActiveCharacter - 1 + 9);
2773 } 2645 }
2774 break; 2646 break;
2775 case 1u: 2647 case EQUIP_MAIN_HAND:
2776 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) ) 2648 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) )
2777 { 2649 {
2778 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); 2650 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
2779 return; 2651 return;
2780 } 2652 }
2846 v36 = v34 - 1; 2718 v36 = v34 - 1;
2847 v37 = (int)((char *)pPlayers[uActiveCharacter] + 36 * v36); 2719 v37 = (int)((char *)pPlayers[uActiveCharacter] + 36 * v36);
2848 v50 = v37; 2720 v50 = v37;
2849 v38 = (ItemGen *)(v37 + 532); 2721 v38 = (ItemGen *)(v37 + 532);
2850 v14 = v38->uItemID == ITEM_WETSUIT; 2722 v14 = v38->uItemID == ITEM_WETSUIT;
2851 v52 = pItemsTable->pItems[v38->uItemID].uEquipType; 2723 pEquipType = pItemsTable->pItems[v38->uItemID].uEquipType;
2852 if ( v14 ) 2724 if ( v14 )
2853 { 2725 {
2854 if ( bUnderwater ) 2726 if ( bUnderwater )
2855 { 2727 {
2856 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); 2728 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
2860 } 2732 }
2861 if ( unk_50C9A0 ) 2733 if ( unk_50C9A0 )
2862 { 2734 {
2863 *((char *)pGUIWindow_Settings->ptr_1C + 8) &= 0x7Fu; 2735 *((char *)pGUIWindow_Settings->ptr_1C + 8) &= 0x7Fu;
2864 *((short *)pGUIWindow_Settings->ptr_1C + 2) = uActiveCharacter - 1; 2736 *((short *)pGUIWindow_Settings->ptr_1C + 2) = uActiveCharacter - 1;
2865 v39 = v52; 2737 v39 = pEquipType;
2866 *((int *)pGUIWindow_Settings->ptr_1C + 3) = v36; 2738 *((int *)pGUIWindow_Settings->ptr_1C + 3) = v36;
2867 *((short *)pGUIWindow_Settings->ptr_1C + 3) = v39; 2739 *((short *)pGUIWindow_Settings->ptr_1C + 3) = v39;
2868 ptr_50C9A4 = v38; 2740 ptr_50C9A4 = v38;
2869 unk_50C9A0 = 0; 2741 unk_50C9A0 = 0;
2870 if ( pMessageQueue_50CBD0->uNumMessages ) 2742 if ( pMessageQueue_50CBD0->uNumMessages )
2894 _a->Reset(); 2766 _a->Reset();
2895 pPlayers[uActiveCharacter]->pEquipment.uBow = 0; 2767 pPlayers[uActiveCharacter]->pEquipment.uBow = 0;
2896 } 2768 }
2897 } 2769 }
2898 } 2770 }
2771
2899 //----- (004196A0) -------------------------------------------------------- 2772 //----- (004196A0) --------------------------------------------------------
2900 void CharacterUI_ReleaseButtons() 2773 void CharacterUI_ReleaseButtons()
2901 { 2774 {
2902 GUIButton *i; // esi@2 2775 GUIButton *i; // esi@2
2903 GUIButton *j; // esi@7 2776 GUIButton *j; // esi@7