Mercurial > mm7
annotate UI/UICharacter.cpp @ 1464:b870630761df
m
author | Ritor1 |
---|---|
date | Mon, 26 Aug 2013 10:39:10 +0600 |
parents | b330df6a2183 |
children | 090ff42290c4 |
rev | line source |
---|---|
1298 | 1 #ifdef _MSC_VER |
2 #define _CRT_SECURE_NO_WARNINGS | |
3 #endif | |
4 | |
5 #include <assert.h> | |
6 #include <algorithm> | |
1299 | 7 #include "..\MM7.h" |
8 #include "..\MapInfo.h" | |
9 #include "..\Game.h" | |
10 #include "..\GUIWindow.h" | |
11 #include "..\GUIFont.h" | |
12 #include "..\GUIProgressBar.h" | |
13 #include "..\Party.h" | |
14 #include "..\AudioPlayer.h" | |
15 #include "..\Render.h" | |
16 #include "..\IndoorCamera.h" | |
17 #include "..\LOD.h" | |
18 #include "..\Viewport.h" | |
19 #include "..\Time.h" | |
20 #include "..\Awards.h" | |
21 #include "..\CastSpellInfo.h" | |
22 #include "..\texts.h" | |
23 #include "..\mm7_data.h" | |
24 #include "..\Mouse.h" | |
25 #include "..\Allocator.h" | |
1298 | 26 |
27 | |
28 int bRingsShownInCharScreen; // 5118E0 | |
29 | |
30 unsigned int ui_mainmenu_copyright_color; | |
31 | |
1393 | 32 unsigned int ui_character_tooltip_header_default_color; |
1298 | 33 unsigned int ui_character_default_text_color; |
34 unsigned int ui_character_skill_highlight_color; | |
35 unsigned int ui_character_header_text_color; | |
36 unsigned int ui_character_bonus_text_color; | |
37 unsigned int ui_character_bonus_text_color_neg; | |
38 unsigned int ui_character_skill_upgradeable_color; | |
39 unsigned int ui_character_skill_default_color; | |
1393 | 40 unsigned int ui_character_stat_default_color; |
41 unsigned int ui_character_stat_buffed_color; | |
42 unsigned int ui_character_stat_debuffed_color; | |
43 unsigned int ui_character_skillinfo_can_learn; | |
44 unsigned int ui_character_skillinfo_can_learn_gm; | |
45 unsigned int ui_character_skillinfo_cant_learn; | |
1298 | 46 std::array<unsigned int, 6> ui_character_award_color; |
47 | |
48 unsigned int ui_game_minimap_outline_color; | |
49 unsigned int ui_game_minimap_actor_friendly_color; | |
50 unsigned int ui_game_minimap_actor_hostile_color; | |
51 unsigned int ui_game_minimap_actor_corpse_color; | |
52 unsigned int ui_game_minimap_decoration_color_1; | |
53 unsigned int ui_game_minimap_projectile_color; | |
54 unsigned int ui_game_minimap_treasure_color; | |
55 std::array<unsigned int, 24> ui_game_character_record_playerbuff_colors; | |
56 | |
57 unsigned int ui_gamemenu_video_gamma_title_color; | |
58 unsigned int ui_gamemenu_keys_action_name_color; | |
59 unsigned int ui_gamemenu_keys_key_selection_blink_color_1; | |
60 unsigned int ui_gamemenu_keys_key_selection_blink_color_2; | |
61 unsigned int ui_gamemenu_keys_key_default_color; | |
62 | |
63 unsigned int ui_book_quests_title_color; | |
64 unsigned int ui_book_quests_text_color; | |
65 unsigned int ui_book_autonotes_title_color; | |
66 unsigned int ui_book_autonotes_text_color; | |
67 unsigned int ui_book_map_title_color; | |
68 unsigned int ui_book_map_coordinates_color; | |
69 | |
70 unsigned int ui_book_calendar_title_color; | |
71 unsigned int ui_book_calendar_time_color; | |
72 unsigned int ui_book_calendar_day_color; | |
73 unsigned int ui_book_calendar_month_color; | |
74 unsigned int ui_book_calendar_year_color; | |
75 unsigned int ui_book_calendar_moon_color; | |
76 unsigned int ui_book_calendar_location_color; | |
77 | |
78 unsigned int ui_book_journal_title_color; | |
79 unsigned int ui_book_journal_text_color; | |
80 unsigned int ui_book_journal_text_shadow; | |
81 | |
1393 | 82 unsigned int ui_game_dialogue_npc_name_color; |
83 unsigned int ui_game_dialogue_option_highlight_color; | |
84 unsigned int ui_game_dialogue_option_normal_color; | |
85 | |
86 unsigned int ui_house_player_cant_interact_color; | |
87 | |
88 | |
89 void set_default_ui_skin() | |
90 { | |
91 ui_mainmenu_copyright_color = TargetColor(255, 255, 255); | |
92 | |
93 ui_character_tooltip_header_default_color = TargetColor(255, 255, 155); | |
94 ui_character_default_text_color = TargetColor(255, 255, 255); | |
95 ui_character_header_text_color = TargetColor(255, 255, 155); | |
96 ui_character_bonus_text_color = TargetColor(0, 255, 0); | |
97 ui_character_bonus_text_color_neg = TargetColor(255, 0, 0); | |
98 | |
99 ui_character_skill_upgradeable_color = TargetColor(0, 175, 255); | |
100 ui_character_skill_default_color = TargetColor(255, 0, 0); | |
101 ui_character_skill_highlight_color = TargetColor(255, 0, 0); | |
102 | |
103 ui_character_stat_default_color = TargetColor(255, 255, 255); | |
104 ui_character_stat_buffed_color = TargetColor(0, 255, 0); | |
105 ui_character_stat_debuffed_color = TargetColor(255, 35, 0); | |
106 | |
107 ui_character_skillinfo_can_learn = TargetColor(255, 255, 255); | |
108 ui_character_skillinfo_can_learn_gm = TargetColor(255, 255, 0); | |
109 ui_character_skillinfo_cant_learn = TargetColor(255, 0, 0); | |
110 | |
111 ui_character_award_color[0] = TargetColor(248, 108, 160); | |
112 ui_character_award_color[1] = TargetColor(112, 220, 248); | |
113 ui_character_award_color[2] = TargetColor(192, 192, 240); | |
114 ui_character_award_color[3] = TargetColor( 64, 244, 96); | |
115 ui_character_award_color[4] = TargetColor(232, 244, 96); | |
116 ui_character_award_color[5] = TargetColor(240, 252, 192); | |
117 | |
118 ui_game_minimap_outline_color = TargetColor(0, 0, 255); | |
119 ui_game_minimap_actor_friendly_color = TargetColor(0, 255, 0); | |
120 ui_game_minimap_actor_hostile_color = TargetColor(255, 0, 0); | |
121 ui_game_minimap_actor_corpse_color = TargetColor(255, 255, 0); | |
122 ui_game_minimap_decoration_color_1 = TargetColor(255, 255, 255); | |
123 ui_game_minimap_projectile_color = TargetColor(255, 0, 0); | |
124 ui_game_minimap_treasure_color = TargetColor(0, 0, 255); | |
125 | |
126 ui_game_character_record_playerbuff_colors[0] = TargetColor(150, 212, 255); | |
127 ui_game_character_record_playerbuff_colors[1] = TargetColor(225, 225, 225); | |
128 ui_game_character_record_playerbuff_colors[2] = TargetColor(255, 128, 0); | |
129 ui_game_character_record_playerbuff_colors[3] = TargetColor(128, 128, 128); | |
130 ui_game_character_record_playerbuff_colors[4] = TargetColor(225, 225, 225); | |
131 ui_game_character_record_playerbuff_colors[5] = TargetColor(255, 85, 0); | |
132 ui_game_character_record_playerbuff_colors[6] = TargetColor(255, 128, 0); | |
133 ui_game_character_record_playerbuff_colors[7] = TargetColor(255, 85, 0); | |
134 ui_game_character_record_playerbuff_colors[8] = TargetColor(225, 225, 225); | |
135 ui_game_character_record_playerbuff_colors[9] = TargetColor(235, 15, 255); | |
136 ui_game_character_record_playerbuff_colors[10] = TargetColor(192, 192, 240); | |
137 ui_game_character_record_playerbuff_colors[11] = TargetColor(225, 225, 225); | |
138 ui_game_character_record_playerbuff_colors[12] = TargetColor(255, 128, 0); | |
139 ui_game_character_record_playerbuff_colors[13] = TargetColor(150, 212, 255); | |
140 ui_game_character_record_playerbuff_colors[14] = TargetColor(128, 128, 128); | |
141 ui_game_character_record_playerbuff_colors[15] = TargetColor(255, 255, 155); | |
142 ui_game_character_record_playerbuff_colors[16] = TargetColor(255, 255, 155); | |
143 ui_game_character_record_playerbuff_colors[17] = TargetColor(255, 255, 155); | |
144 ui_game_character_record_playerbuff_colors[18] = TargetColor(255, 255, 155); | |
145 ui_game_character_record_playerbuff_colors[19] = TargetColor(255, 255, 155); | |
146 ui_game_character_record_playerbuff_colors[20] = TargetColor(255, 255, 155); | |
147 ui_game_character_record_playerbuff_colors[21] = TargetColor(255, 255, 155); | |
148 ui_game_character_record_playerbuff_colors[22] = TargetColor(0, 128, 255); | |
149 ui_game_character_record_playerbuff_colors[23] = TargetColor(0, 128, 255); | |
150 | |
151 ui_gamemenu_video_gamma_title_color = TargetColor(255, 255, 155); | |
152 ui_gamemenu_keys_action_name_color = TargetColor(255, 255, 255); | |
153 ui_gamemenu_keys_key_selection_blink_color_1 = TargetColor(50, 0, 0); | |
154 ui_gamemenu_keys_key_selection_blink_color_2 = TargetColor(225, 205, 35); | |
155 ui_gamemenu_keys_key_default_color = TargetColor(255, 255, 255); | |
156 | |
157 ui_book_quests_title_color = TargetColor(255, 255, 255); | |
158 ui_book_quests_text_color = TargetColor(255, 255, 255); | |
159 ui_book_autonotes_title_color = TargetColor(255, 255, 255); | |
160 ui_book_autonotes_text_color = TargetColor(255, 255, 255); | |
161 ui_book_map_title_color = TargetColor(255, 255, 255); | |
162 ui_book_map_coordinates_color = TargetColor(255, 255, 255); | |
163 | |
164 ui_book_calendar_title_color = TargetColor(255, 255, 255); | |
165 ui_book_calendar_time_color = TargetColor(75, 75, 75); | |
166 ui_book_calendar_day_color = TargetColor(75, 75, 75); | |
167 ui_book_calendar_month_color = TargetColor(75, 75, 75); | |
168 ui_book_calendar_year_color = TargetColor(75, 75, 75); | |
169 ui_book_calendar_moon_color = TargetColor(75, 75, 75); | |
170 ui_book_calendar_location_color = TargetColor(75, 75, 75); | |
171 | |
172 ui_book_journal_title_color = TargetColor(255, 255, 255); | |
173 ui_book_journal_text_color = TargetColor(255, 255, 255); | |
174 ui_book_journal_text_shadow = TargetColor(0, 0, 0); | |
175 | |
176 ui_game_dialogue_npc_name_color = TargetColor(21, 153, 233); | |
177 ui_game_dialogue_option_highlight_color = TargetColor(225, 205, 35); | |
178 ui_game_dialogue_option_normal_color = TargetColor(255, 255, 255); | |
179 | |
180 ui_house_player_cant_interact_color = TargetColor(255, 255, 155); | |
181 } | |
182 | |
1298 | 183 std::array<unsigned int, 16> papredoll_dbrds; |
184 unsigned int papredoll_drhs[4]; | |
185 unsigned int papredoll_dlhus[4]; | |
186 unsigned int papredoll_dlhs[4]; | |
187 unsigned int papredoll_dbods[5]; | |
1464 | 188 int paperdoll_armor_texture[4][17][3];//0x511294 |
1298 | 189 //int paperdoll_array_51132C[165]; |
190 unsigned int papredoll_dlaus[5]; | |
191 unsigned int papredoll_dlads[4]; | |
192 int papredoll_flying_feet[777]; // idb | |
193 int paperdoll_boots_texture[4][6];//0x511638 | |
194 int paperdoll_cloak_collar_texture[4][10]; // weak | |
195 int paperdoll_cloak_texture[4][10]; | |
196 int paperdoll_helm_texture[2][16]; //511698 | |
197 int paperdoll_belt_texture[4][7]; //511718 | |
198 | |
199 const int paperdoll_Weapon[4][16][2] = {//4E4C30 | |
200 {{128, 205}, {30, 144}, {88, 85}, {0, 0}, {0, 0}, {0, 0}, {17, 104}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}}, | |
201 {{131, 201}, {38, 158}, {98, 87}, {0, 0}, {0, 0}, {0, 0}, {21, 100}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}}, | |
202 {{131, 216}, {29, 186}, {88, 119}, {0, 0}, {0, 0}, {0, 0}, { 0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}}, | |
203 {{123, 216}, {35, 184}, {98, 119}, {0, 0}, {0, 0}, {0, 0}, { 0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}}, | |
204 }; | |
205 | |
206 const int paperdoll_Boot[4][7][2] = //4E5490 | |
207 { | |
208 0xE, 0x11D, 0xD, 0x11D, 0xC, 0x10A, 0xA, 0xFF, 0xD, 0xF9, 0xD, 0x137, 0xC, 0x10E, | |
209 0x14, 0x125, 0x13, 0x122, 0x15, 0x120, 0x15, 0x114, 0x13, 0x10A, 0x11, 0x13E, 0x11, 0x116, | |
210 0x1D, 0x121, 0x1C, 0x11F, 0x1B, 0x11B, 0x1C, 0x117, 0x16, 0x116, 0x1B, 0x137, 0x1B, 0x11B, | |
211 0x1F, 0x127, 0x1F, 0x122, 0x1B, 0x11B, 0x1D, 0x117, 0x1D, 0x116, 0x1D, 0x137, 0x1B, 0x11F, | |
212 }; | |
213 const int paperdoll_Cloak[4][10][2] = //4E5570 | |
214 { | |
215 0x11, 0x68, 0xF, 0x68, 0x14, 0x71, 0x19, 0x6B, 0x21, 0x6F, 0x5, 0x68, 0x5, 0x68, 0x14, 0x71, 0x3, 0x6B, 0xF, 0x6F, | |
216 0x15, 0x64, 0xB, 0x6B, 0xE, 0x67, 0x15, 0x6B, 0x1B, 0x6F, 0x3, 0x6B, 0, 0x6B, 0xE, 0x67, 0, 0x6B, 0x3, 0x6F, | |
217 0x10, 0x8A, 0x9, 0x8B, 0x18, 0x98, 0x25, 0x91, 0x29, 0x90, 0x8, 0x8A, 0x9, 0x8B, 0x18, 0x98, 0x3, 0x91, 0x3, 0x90, | |
218 0x14, 0x92, 0x10, 0x92, 0x15, 0x98, 0x1F, 0x91, 0x22, 0x90, 0x8, 0x92, 0xC, 0x92, 0x15, 0x98, 0x3, 0x91, 0x3, 0x90, | |
219 }; | |
220 const int paperdoll_CloakCollar[4][10][2] = //4E56B0 | |
221 { | |
222 0x11, 0x68, 0x34, 0x64, 0x21, 0x69, 0x1D, 0x67, 0x20, 0x67, 0x21, 0x68, 0x34, 0x64, 0x21, 0x69, 0x1D, 0x67, 0x1F, 0x67, | |
223 0x13, 0x64, 0x35, 0x66, 0x29, 0x68, 0x1F, 0x68, 0x1F, 0x6A, 0x21, 0x6A, 0x2B, 0x66, 0x26, 0x68, 0x1F, 0x68, 0x1F, 0x6A, | |
224 0, 0, 0x30, 0x87, 0x1E, 0x86, 0x1B, 0x86, 0x1C, 0x8A, 0x21, 0x87, 0x30, 0x87, 0x1E, 0x86, 0x1B, 0x86, 0x1C, 0x8A, | |
225 0, 0, 0x38, 0x8A, 0x24, 0x8B, 0x1D, 0x8B, 0x21, 0x8C, 0x27, 0x8A, 0x34, 0x8A, 0x24, 0x8B, 0x25, 0x8B, 0x21, 0x8C, | |
226 }; | |
227 //int dword_4E56B4; // weak | |
228 const int paperdoll_Belt[4][7][2] = //4E57F0 | |
229 { | |
230 0x3A, 0xB6, 0x37, 0xB2, 0x34, 0xB9, 0x3A, 0xB9, 0x37, 0xB7, 0x38, 0xAC, 0x37, 0xB7, | |
231 0x3E, 0xAD, 0x3A, 0xAC, 0x37, 0xB0, 0x3A, 0xB1, 0x39, 0xB0, 0x3C, 0xA5, 0x39, 0xB0, | |
232 0x3B, 0xD5, 0x37, 0xD2, 0x31, 0xD5, 0x39, 0xD6, 0x37, 0xD8, 0x37, 0xD1, 0x37, 0xD8, | |
233 0x42, 0xD2, 0x3F, 0xD0, 0x3B, 0xD7, 0x3C, 0xD5, 0x3B, 0xD6, 0x3E, 0xCF, 0x36, 0xD6, | |
234 }; | |
235 const int paperdoll_Helm[4][16][2] = //4E58D0 | |
236 { | |
237 0x3E, 0x1F, 0x41, 0x2C, 0x37, 0x2F, 0x31, 0x32, 0x37, 0x2A, 0x39, 0x28, 0x36, 0x34, 0x41, 0x38, 0x40, 0x31, 0x40, 0x21, 0x40, 0x31, 0x3C, 0x33, 0x3D, 0x24, 0x3A, 0x1A, 0x37, 0x2A, 0x41, 0x48, | |
238 0x41, 0x1E, 0x42, 0x2B, 0x37, 0x2F, 0x34, 0x30, 0x39, 0x29, 0x3A, 0x26, 0x36, 0x34, 0x41, 0x37, 0x42, 0x32, 0x40, 0x21, 0x40, 0x31, 0x40, 0x2F, 0x3E, 0x22, 0x3B, 0x1A, 0x39, 0x29, 0x42, 0x47, | |
239 0x3F, 0x47, 0x41, 0x56, 0x37, 0x59, 0x32, 0x5E, 0x37, 0x58, 0x39, 0x54, 0x34, 0x61, 0x40, 0x61, 0x41, 0x5D, 0x3E, 0x4F, 0x3E, 0x5B, 0x3D, 0x5B, 0x3F, 0x4C, 0x3B, 0x45, 0x37, 0x58, 0x41, 0x74, | |
240 0x45, 0x45, 0x46, 0x54, 0x3A, 0x55, 0x38, 0x58, 0x3C, 0x54, 0x3F, 0x52, 0x39, 0x5B, 0x45, 0x5C, 0x47, 0x5C, 0x44, 0x4B, 0x44, 0x57, 0x43, 0x55, 0x44, 0x4A, 0x3E, 0x45, 0x3C, 0x54, 0x47, 0x70, | |
241 }; | |
242 const int pPaperdoll_Beards[4] = //4E5AD0 | |
243 { | |
244 52, 130, 56, 136, | |
245 }; | |
246 const int pPaperdoll_LeftHand[4][2] = //4E5AE0 | |
247 { | |
248 0x67, 0x6A, | |
249 0x65, 0x6C, | |
250 0x74, 0x8D, | |
251 0x74, 0x93, | |
252 }; | |
253 const int pPaperdoll_SecondLeftHand[4][2] = //4E5B00 | |
254 { | |
255 0x1A, 0x6B, | |
256 0x28, 0x6D, | |
257 0x19, 0x8D, | |
258 0x20, 0x92, | |
259 }; | |
260 const int pPaperdoll_RightHand[4][2] = //4E5B20 | |
261 { | |
262 0x1E, 0x90, | |
263 0x22, 0x9E, | |
264 0x19, 0xBA, | |
265 0x1F, 0xB8, | |
266 }; | |
267 const int pPaperdollLeftEmptyHand[4][2] = //4E5B40 | |
268 { | |
269 0x80, 0xCD, | |
270 0x83, 0xC9, | |
271 0x83, 0xD8, | |
272 0x7B, 0xD8, | |
273 }; | |
274 | |
275 int pPaperdoll_BodyX = 481; // 004E4C28 | |
276 int pPaperdoll_BodyY = 0; // 004E4C2C | |
277 const int paperdoll_Armor[4][17][2] = //4E4E30 | |
278 { | |
279 // X Y | |
280 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, | |
282 | |
283 0x32, 0x68, 0x32, 0x69, 0x35, 0x69, 0x33, 0x68, 0x24, 0x67, 0x30, 0x69, 0x33, 0x68, 0x31, 0x69, 0x19, 0x69, | |
284 0x19, 0x6A, 0x16, 0x66, 0x16, 0x65, 0x0F, 0x6B, 0x24, 0x67, 0x0F, 0x6B, 0x19, 0x6A, 0x31, 0x69, | |
285 | |
286 0x2A, 0x8C, 0x29, 0x8C, 0x2A, 0x89, 0x29, 0x86, 0x12, 0x87, 0x2D, 0x89, 0x2A, 0x88, 0x25, 0x87, 0x12, 0x8B, | |
287 0x12, 0x8B, 0x11, 0x8A, 0x15, 0x87, 0x09, 0x89, 0x12, 0x87, 0x09, 0x89, 0x12, 0x8B, 0x25, 0x87, | |
288 | |
289 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, | |
291 }; | |
292 const int paperdoll_shoulder[4][17][2] = //4E5050 | |
293 { | |
294 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, | |
296 | |
297 0x60, 0x6B, 0x60, 0x6C, 0x60, 0x6B, 0x61, 0x6A, 0x60, 0x69, 0x60, 0x6A, 0x60, 0x6A, 0x61, 0x69, 0x63, 0x6A, | |
298 0x64, 0x6A, 0x61, 0x66, 0x66, 0x67, 0x64, 0x6C, 0x60, 0x69, 0x64, 0x6C, 0x64, 0x6A, 0x61, 0x69, | |
299 | |
300 0x6D, 0x8C, 0x75, 0x8C, 0, 0, 0x72, 0x8D, 0x6A, 0x89, 0, 0, 0x73, 0x8C, 0x69, 0x8C, 0x6E, 0x8D, | |
301 0x71, 0x8D, 0x70, 0x8D, 0x72, 0x8D, 0x74, 0x8E, 0x6A, 0x89, 0x74, 0x8E, 0x71, 0x8D, 0x69, 0x8C, | |
302 | |
303 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, | |
305 }; | |
306 const int dword_4E5270[4][2] = | |
307 { | |
308 0, 0, | |
309 0x61, 0x67, | |
310 0, 0, | |
311 0x64, 0x69, | |
312 }; | |
313 | |
314 const char *dlad_texnames_by_face[25] = | |
315 { | |
316 "pc01lad", "pc02lad", "pc03lad", "pc04lad", "pc05lad", "pc06lad", | |
317 "pc07lad", "pc08lad", "pc09lad", "pc10lad", "pc11lad", "pc12lad", | |
318 "pc13lad", "pc14lad", "pc15lad", "pc16lad", "pc17lad", "pc18lad", | |
319 "pc19lad", "pc20lad", "pc21lad", "pc22lad", "pc23lad", "pc24lad", | |
320 "pc25lad" | |
321 }; | |
322 const char *dlau_texnames_by_face[25] = | |
323 { | |
324 "pc01lau", "pc02lau", "pc03lau", "pc04lau", "pc05lau", "pc06lau", | |
325 "pc07lau", "pc08lau", "pc09lau", "pc10lau", "pc11lau", "pc12lau", | |
326 "pc13lau", "pc14lau", "pc15lau", "pc16lau", "pc17lau", "pc18lau", | |
327 "pc19lau", "pc20lau", "pc21lau", "pc22lau", "pc23lau", "pc24lau", | |
328 "pc25lau" | |
329 }; | |
330 const char *dbod_texnames_by_face[25] = | |
331 { | |
332 "pc01bod", "pc02bod", "pc03bod", "pc04bod", "pc05bod", "pc06bod", | |
333 "pc07bod", "pc08bod", "pc09bod", "pc10bod", "pc11bod", "pc12bod", | |
334 "pc13bod", "pc14bod", "pc15bod", "pc16bod", "pc17bod", "pc18bod", | |
335 "pc19bod", "pc20bod", "pc21bod", "pc22bod", "pc23bod", "pc24bod", | |
336 "pc25bod" | |
337 }; | |
338 const char *drh_texnames_by_face[25] = | |
339 { | |
340 | |
341 "pc01rh", "pc02rh", "pc03rh", "pc04rh", "pc05rh", "pc06rh", | |
342 "pc07rh", "pc08rh", "pc09rh", "pc10rh", "pc11rh", "pc12rh", | |
343 "pc13rh", "pc14rh", "pc15rh", "pc16rh", "pc17rh", "pc18rh", | |
344 "pc19rh", "pc20rh", "pc21rh", "pc22rh", "pc23rh", "pc24rh", | |
345 "pc25rh" | |
346 }; | |
347 const char *dlh_texnames_by_face[25] = | |
348 { | |
349 "pc01lh", "pc02lh", "pc03lh", "pc04lh", "pc05lh", "pc06lh", | |
350 "pc07lh", "pc08lh", "pc09lh", "pc10lh", "pc11lh", "pc12lh", | |
351 "pc13lh", "pc14lh", "pc15lh", "pc16lh", "pc17lh", "pc18lh", | |
352 "pc19lh", "pc20lh", "pc21lh", "pc22lh", "pc23lh", "pc24lh", | |
353 "pc25lh" | |
354 }; | |
355 const char *dlhu_texnames_by_face[25] = | |
356 { | |
357 "pc01lhu", "pc02lhu", "pc03lhu", "pc04lhu", "pc05lhu", "pc06lhu", | |
358 "pc07lhu", "pc08lhu", "pc09lhu", "pc10lhu", "pc11lhu", "pc12lhu", | |
359 "pc13lhu", "pc14lhu", "pc15lhu", "pc16lhu", "pc17lhu", "pc18lhu", | |
360 "pc19lhu", "pc20lhu", "pc21lhu", "pc22lhu", "pc23lhu", "pc24lhu", | |
361 "pc25lhu" | |
362 }; | |
363 | |
364 const int pArmorSkills[5] = {PLAYER_SKILL_LEATHER, PLAYER_SKILL_CHAIN, PLAYER_SKILL_PLATE, PLAYER_SKILL_SHIELD, PLAYER_SKILL_DODGE}; | |
365 const int pWeaponSkills[9] = {PLAYER_SKILL_AXE, PLAYER_SKILL_BOW, PLAYER_SKILL_DAGGER, PLAYER_SKILL_MACE, PLAYER_SKILL_SPEAR, | |
366 PLAYER_SKILL_STAFF, PLAYER_SKILL_SWORD, PLAYER_SKILL_UNARMED, PLAYER_SKILL_BLASTER}; | |
367 const int pMiscSkills[12] = {PLAYER_SKILL_ALCHEMY, PLAYER_SKILL_ARMSMASTER, PLAYER_SKILL_BODYBUILDING, PLAYER_SKILL_ITEM_ID, PLAYER_SKILL_MONSTER_ID, | |
368 PLAYER_SKILL_LEARNING, PLAYER_SKILL_TRAP_DISARM, PLAYER_SKILL_MEDITATION, PLAYER_SKILL_MERCHANT, PLAYER_SKILL_PERCEPTION, | |
369 PLAYER_SKILL_REPAIR, PLAYER_SKILL_STEALING}; | |
370 const int pMagicSkills[9] = {PLAYER_SKILL_FIRE, PLAYER_SKILL_AIR, PLAYER_SKILL_WATER, PLAYER_SKILL_EARTH, PLAYER_SKILL_SPIRIT, | |
371 PLAYER_SKILL_MIND, PLAYER_SKILL_BODY, PLAYER_SKILL_LIGHT, PLAYER_SKILL_DARK}; | |
372 | |
373 //----- (00421626) -------------------------------------------------------- | |
374 GUIWindow *CharacterUI_Initialize(unsigned int _this) | |
375 { | |
376 GUIWindow *pWindow; // edi@3 | |
377 | |
378 ++pIcons_LOD->uTexturePacksCount; | |
379 if ( !pIcons_LOD->uNumPrevLoadedFiles ) | |
380 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; | |
381 | |
382 pEventTimer->Pause(); | |
383 pAudioPlayer->StopChannels(-1, -1); | |
384 bRingsShownInCharScreen = false; | |
385 CharacterUI_LoadPaperdollTextures(); | |
386 pCurrentScreen = _this; | |
387 | |
388 pWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_CharacterRecord, uActiveCharacter, 0); | |
389 pCharacterScreen_StatsBtn = pWindow->CreateButton(pViewport->uViewportTL_X + 12, pViewport->uViewportTL_Y + 308, | |
390 pIcons_LOD->GetTexture(papredoll_dbrds[9])->uTextureWidth, | |
391 pIcons_LOD->GetTexture(papredoll_dbrds[9])->uTextureHeight, | |
392 1, 0, UIMSG_ClickStatsBtn, 0, 'S', pGlobalTXT_LocalizationStrings[216],// Stats | |
393 pIcons_LOD->GetTexture(papredoll_dbrds[10]), | |
394 pIcons_LOD->GetTexture(papredoll_dbrds[9]), 0); | |
395 pCharacterScreen_SkillsBtn = pWindow->CreateButton(pViewport->uViewportTL_X + 102, pViewport->uViewportTL_Y + 308, | |
396 pIcons_LOD->GetTexture(papredoll_dbrds[7])->uTextureWidth, | |
397 pIcons_LOD->GetTexture(papredoll_dbrds[7])->uTextureHeight, | |
398 1, 0, UIMSG_ClickSkillsBtn, 0, 'K', pGlobalTXT_LocalizationStrings[205],//Skills | |
399 pIcons_LOD->GetTexture(papredoll_dbrds[8]), | |
400 pIcons_LOD->GetTexture(papredoll_dbrds[7]), 0); | |
401 pCharacterScreen_InventoryBtn = pWindow->CreateButton(pViewport->uViewportTL_X + 192, pViewport->uViewportTL_Y + 308, | |
402 pIcons_LOD->GetTexture(papredoll_dbrds[5])->uTextureWidth, | |
403 pIcons_LOD->GetTexture(papredoll_dbrds[5])->uTextureHeight, | |
404 1, 0, UIMSG_ClickInventoryBtn, 0, 'I', pGlobalTXT_LocalizationStrings[120], //Inventory | |
405 pIcons_LOD->GetTexture(papredoll_dbrds[6]), | |
406 pIcons_LOD->GetTexture(papredoll_dbrds[5]), 0); | |
407 pCharacterScreen_AwardsBtn = pWindow->CreateButton(pViewport->uViewportTL_X + 282, pViewport->uViewportTL_Y + 308, | |
408 pIcons_LOD->GetTexture(papredoll_dbrds[3])->uTextureWidth, | |
409 pIcons_LOD->GetTexture(papredoll_dbrds[3])->uTextureHeight, | |
410 1, 0, UIMSG_ClickAwardsBtn, 0, 'A', pGlobalTXT_LocalizationStrings[22], //Awards | |
411 pIcons_LOD->GetTexture(papredoll_dbrds[4]), | |
412 pIcons_LOD->GetTexture(papredoll_dbrds[3]), 0); | |
413 pCharacterScreen_ExitBtn = pWindow->CreateButton(pViewport->uViewportTL_X + 371, pViewport->uViewportTL_Y + 308, | |
414 pIcons_LOD->GetTexture(papredoll_dbrds[1])->uTextureWidth, | |
415 pIcons_LOD->GetTexture(papredoll_dbrds[1])->uTextureHeight, | |
416 1, 0, UIMSG_ClickExitCharacterWindowBtn, 0, 0, pGlobalTXT_LocalizationStrings[79],//Exit | |
417 pIcons_LOD->GetTexture(papredoll_dbrds[2]), | |
418 pIcons_LOD->GetTexture(papredoll_dbrds[1]), 0); | |
419 pWindow->CreateButton(0, 0, 0x1DCu, 0x159u, 1, 122, UIMSG_InventoryLeftClick, 0, 0, "", 0); | |
420 pCharacterScreen_DetalizBtn = pWindow->CreateButton(0x258u, 0x12Cu, 30, 30, 1, 0, UIMSG_ChangeDetaliz, 0, 0, pGlobalTXT_LocalizationStrings[64], 0); | |
421 pCharacterScreen_DollBtn = pWindow->CreateButton(0x1DCu, 0, 0xA4u, 0x159u, 1, 0, UIMSG_ClickPaperdoll, 0, 0, "", 0); | |
422 | |
423 pWindow->CreateButton( 61, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 1, '1', "", 0); | |
424 pWindow->CreateButton(177, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 2, '2', "", 0); | |
425 pWindow->CreateButton(292, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 3, '3', "", 0); | |
426 pWindow->CreateButton(407, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 4, '4', "", 0); | |
427 | |
428 pWindow->CreateButton(0, 0, 0, 0, 1, 0, UIMSG_CycleCharacters, 0, '\t', "", 0); | |
429 FillAwardsData(); | |
430 return pWindow; | |
431 } | |
432 | |
433 //----- (004219BE) -------------------------------------------------------- | |
1455 | 434 GUIWindow *CastSpellInfo::GetCastSpellInInventoryWindow() |
1298 | 435 { |
1455 | 436 GUIWindow *CS_inventory_window; // ebx@1 |
1298 | 437 |
438 pEventTimer->Pause(); | |
439 pAudioPlayer->StopChannels(-1, -1); | |
440 bRingsShownInCharScreen = 0; | |
441 CharacterUI_LoadPaperdollTextures(); | |
442 pCurrentScreen = SCREEN_CASTING; | |
1455 | 443 CS_inventory_window = GUIWindow::Create(0, 0, 640, 480, WINDOW_CastSpell_InInventory, (int)this, 0); |
444 pCharacterScreen_ExitBtn = CS_inventory_window->CreateButton(394, 318, 75, 33, 1, 0, UIMSG_ClickExitCharacterWindowBtn, 0, 0, | |
1298 | 445 pGlobalTXT_LocalizationStrings[79], // Close |
446 pIcons_LOD->GetTexture(papredoll_dbrds[2]), | |
447 pIcons_LOD->GetTexture(papredoll_dbrds[1]), 0); | |
1455 | 448 CS_inventory_window->CreateButton(0, 0, 0x1DCu, 0x159u, 1, 122, UIMSG_InventoryLeftClick, 0, 0, "", 0); |
449 pCharacterScreen_DollBtn = CS_inventory_window->CreateButton(0x1DCu, 0, 0xA4u, 0x159u, 1, 0, UIMSG_ClickPaperdoll, 0, 0, "", 0); | |
1298 | 450 |
1455 | 451 CS_inventory_window->CreateButton( 61, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 1, '1', "", 0); |
452 CS_inventory_window->CreateButton(177, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 2, '2', "", 0); | |
453 CS_inventory_window->CreateButton(292, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 3, '3', "", 0); | |
454 CS_inventory_window->CreateButton(407, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 4, '4', "", 0); | |
1298 | 455 |
1455 | 456 return CS_inventory_window; |
1298 | 457 } |
458 | |
459 static int CharacterUI_SkillsTab_Draw__DrawSkillTable(Player *player, int x, int y, const int *skill_list, int skill_list_size, int right_margin, const char *skill_group_name) | |
460 { | |
461 int y_offset = y; | |
462 | |
463 sprintf(pTmpBuf.data(), "%s\r%03d%s", skill_group_name, right_margin, pGlobalTXT_LocalizationStrings[131]); //"Level" | |
464 pGUIWindow_CurrentMenu->DrawText(pFontArrus, x, y, ui_character_header_text_color, pTmpBuf.data(), 0, 0, 0); | |
465 | |
466 int num_skills_drawn = 0; | |
1455 | 467 for (int i = 0; i < skill_list_size; ++i) |
1298 | 468 { |
469 auto skill = (PLAYER_SKILL_TYPE)skill_list[i]; | |
470 for (uint j = 0; j < pGUIWindow_CurrentMenu->uNumControls; ++j) | |
471 { | |
472 auto v8 = pGUIWindow_CurrentMenu->pControlsHead; | |
473 | |
474 for (int v7 = j; v7 > 0; --v7) | |
475 v8 = v8->pNext; | |
476 | |
477 auto v9 = v8->field_1C; | |
478 if ((short)(v8->field_1C) >= 0) | |
479 continue; | |
480 if ( (v9 & 0x7FFF) != skill ) | |
481 continue; | |
482 | |
483 ++num_skills_drawn; | |
484 y_offset = v8->uY; | |
485 | |
486 auto skill_value = player->pActiveSkills[skill]; | |
487 auto skill_level = skill_value & 0x3F; | |
488 | |
489 uint skill_color = 0; | |
490 uint skill_mastery_color = 0; | |
491 if (player->uSkillPoints > skill_level) | |
492 skill_color = ui_character_skill_upgradeable_color; | |
493 | |
494 if (pGUIWindow_CurrentMenu->pCurrentPosActiveItem == j) | |
495 { | |
496 if (player->uSkillPoints > skill_level) | |
497 skill_mastery_color = ui_character_bonus_text_color; | |
498 else | |
499 skill_mastery_color = ui_character_skill_default_color; | |
500 skill_color = skill_mastery_color; | |
501 } | |
502 | |
503 if (SkillToMastery(skill_value) == 1) | |
504 { | |
505 sprintfex(pTmpBuf.data(), "%s\r%03d%2d", pSkillNames[skill], right_margin, skill_level); | |
506 pGUIWindow_CurrentMenu->DrawText(pFontLucida, x, v8->uY, skill_color, pTmpBuf.data(), 0, 0, 0); | |
507 } | |
508 else | |
509 { | |
510 const char *skill_level_str = nullptr; | |
511 | |
512 switch (SkillToMastery(skill_value)) | |
513 { | |
514 case 4: skill_level_str = pGlobalTXT_LocalizationStrings[96]; break; // "Grand" | |
515 case 3: skill_level_str = pGlobalTXT_LocalizationStrings[432]; break; // Master | |
516 case 2: skill_level_str = pGlobalTXT_LocalizationStrings[433]; break; // Expert | |
517 } | |
518 | |
519 if (!skill_mastery_color) | |
520 skill_mastery_color = ui_character_header_text_color; | |
521 sprintfex(pTmpBuf.data(), "%s \f%05d%s\f%05d\r%03d%2d", pSkillNames[skill], skill_mastery_color, skill_level_str, skill_color, right_margin, skill_level); | |
522 pGUIWindow_CurrentMenu->DrawText(pFontLucida, x, v8->uY, skill_color, pTmpBuf.data(), 0, 0, 0); | |
523 } | |
524 } | |
525 } | |
526 | |
527 if (!num_skills_drawn) | |
528 { | |
529 y_offset += LOBYTE(pFontLucida->uFontHeight) - 3; | |
530 pGUIWindow_CurrentMenu->DrawText(pFontLucida, x, y_offset, 0, pGlobalTXT_LocalizationStrings[153], 0, 0, 0); //"None" | |
531 } | |
532 | |
533 return y_offset; | |
534 } | |
535 | |
536 //----- (00419719) -------------------------------------------------------- | |
537 void CharacterUI_SkillsTab_Draw(Player *player) | |
538 { | |
539 pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->LoadTexturePtr("fr_skill", TEXTURE_16BIT_PALETTE)); | |
540 | |
541 sprintfex(pTmpBuf.data(), "%s \f%05d^Pv[%s]\f00000\r177%s: \f%05d%d\f00000", | |
542 pGlobalTXT_LocalizationStrings[206], // Skills for | |
543 ui_character_header_text_color, | |
544 player->pName, | |
545 pGlobalTXT_LocalizationStrings[207], // Skill Points | |
546 player->uSkillPoints ? ui_character_bonus_text_color : ui_character_default_text_color, | |
547 player->uSkillPoints); | |
548 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 24, 18, 0, pTmpBuf.data(), 0, 0, 0); | |
549 | |
550 int y = 2 * LOBYTE(pFontLucida->uFontHeight) + 13; | |
551 y = CharacterUI_SkillsTab_Draw__DrawSkillTable(player, 24, y, pWeaponSkills, 9, 400, pGlobalTXT_LocalizationStrings[242]); // "Weapons" | |
552 | |
553 y += 2 * LOBYTE(pFontLucida->uFontHeight) - 10; | |
554 CharacterUI_SkillsTab_Draw__DrawSkillTable(player, 24, y, pMagicSkills, 9, 400, pGlobalTXT_LocalizationStrings[138]); // "Magic" | |
555 | |
556 y = 2 * LOBYTE(pFontLucida->uFontHeight) + 13; | |
557 y = CharacterUI_SkillsTab_Draw__DrawSkillTable(player, 248, y, pArmorSkills, 5, 177, pGlobalTXT_LocalizationStrings[11]); // "Armor" | |
558 | |
559 y += 2 * LOBYTE(pFontLucida->uFontHeight) - 10; | |
560 y = CharacterUI_SkillsTab_Draw__DrawSkillTable(player, 248, y, pMiscSkills, 12, 177, pGlobalTXT_LocalizationStrings[143]); //"Misc" | |
561 } | |
562 | |
563 //----- (0041A000) -------------------------------------------------------- | |
564 void CharacterUI_AwardsTab_Draw(Player *player) | |
565 { | |
1455 | 566 unsigned int result; // eax@1 |
567 char *v6; // ebx@15 | |
568 char Source[100]; // [sp+Ch] [bp-C4h]@1 | |
569 GUIWindow awards_window; // [sp+70h] [bp-60h]@1 | |
1298 | 570 |
571 pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->LoadTexturePtr("fr_award", TEXTURE_16BIT_PALETTE)); | |
572 sprintfex(pTmpBuf.data(), "%s \f%05d", pGlobalTXT_LocalizationStrings[LOCSTR_AVARDS_FOR], ui_character_header_text_color); | |
573 sprintfex(Source, pGlobalTXT_LocalizationStrings[LOCSTR_S_THE_S], player->pName, pClassNames[player->classType]); | |
574 strcat(pTmpBuf.data(), Source); | |
575 strcat(pTmpBuf.data(), "\f00000"); | |
576 | |
577 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 24, 18, 0, pTmpBuf.data(), 0, 0, 0); | |
1446 | 578 result = books_primary_item_per_page; |
1455 | 579 awards_window.uFrameX = 12; |
580 awards_window.uFrameY = 48; | |
581 awards_window.uFrameWidth = 424; | |
582 awards_window.uFrameHeight = 290; | |
583 awards_window.uFrameZ = 435; | |
584 awards_window.uFrameW = 337; | |
1446 | 585 if (BtnDown_flag && num_achieved_awards + books_primary_item_per_page < full_num_items_in_book) |
586 result = books_primary_item_per_page++ + 1; | |
1298 | 587 if (BtnUp_flag && result) |
588 { | |
589 --result; | |
1446 | 590 books_primary_item_per_page = result; |
1298 | 591 } |
592 | |
1455 | 593 if ( books_page_number < 0 ) |
594 { | |
595 result += num_achieved_awards; | |
596 books_primary_item_per_page = result; | |
597 if ( (signed int)(num_achieved_awards + result) > full_num_items_in_book ) | |
1298 | 598 { |
1455 | 599 result = full_num_items_in_book - num_achieved_awards; |
600 books_primary_item_per_page = result; | |
601 } | |
602 } | |
603 else if ( books_page_number > 0 ) | |
604 { | |
605 result -= num_achieved_awards; | |
606 books_primary_item_per_page = result; | |
607 if ( (result & 0x80000000u) != 0 ) | |
608 { | |
609 result = 0; | |
610 books_primary_item_per_page = result; | |
611 } | |
612 } | |
613 BtnDown_flag = 0; | |
614 BtnUp_flag = 0; | |
615 num_achieved_awards = 0; | |
616 books_page_number = 0; | |
1298 | 617 |
1455 | 618 for ( int i = result; i < full_num_items_in_book; ++i) |
619 { | |
620 v6 = (char *)pAwards[achieved_awards[i]].pText;//(char *)dword_723E80_award_related[v20 / 4]; | |
621 pTmpBuf[0] = 0; | |
622 switch (achieved_awards[i]) | |
623 { | |
624 case Award_Arena_PageWins: sprintf(pTmpBuf.data(), v6, pParty->uNumArenaPageWins); break; | |
625 case Award_Arena_SquireWins: sprintf(pTmpBuf.data(), v6, pParty->uNumArenaSquireWins); break; | |
626 case Award_Arena_KnightWins: sprintf(pTmpBuf.data(), v6, pParty->uNumArenaKnightWins); break; | |
627 case Award_Arena_LordWins: sprintf(pTmpBuf.data(), v6, pParty->uNumArenaLordWins); break; | |
628 case Award_ArcomageWins: sprintf(pTmpBuf.data(), v6, pParty->uNumArcomageWins); break; | |
629 case Award_ArcomageLoses: sprintf(pTmpBuf.data(), v6, pParty->uNumArcomageLoses); break; | |
630 case Award_Deaths: sprintf(pTmpBuf.data(), v6, pParty->uNumDeaths); break; | |
631 case Award_BountiesCollected: sprintf(pTmpBuf.data(), v6, pParty->uNumBountiesCollected); break; | |
632 case Award_Fine: sprintf(pTmpBuf.data(), v6, pParty->uFine); break; | |
633 case Award_PrisonTerms: sprintf(pTmpBuf.data(), v6, pParty->uNumPrisonTerms); break; | |
634 } | |
1298 | 635 |
1455 | 636 if (*pTmpBuf.data()) |
637 v6 = pTmpBuf.data(); | |
1298 | 638 |
1455 | 639 awards_window.DrawText(pFontArrus, 0, 0, ui_character_award_color[pAwards[achieved_awards[i]].uPriority % 6], v6, 0, 0, 0); |
640 awards_window.uFrameY = pFontArrus->CalcTextHeight(v6, &awards_window, 0, 0) + awards_window.uFrameY + 8; | |
641 if (awards_window.uFrameY > awards_window.uFrameHeight) | |
642 break; | |
1298 | 643 |
1455 | 644 ++num_achieved_awards; |
645 } | |
646 } | |
1298 | 647 |
648 //----- (0041A2C1) -------------------------------------------------------- | |
649 unsigned int __fastcall GetSizeInInventorySlots(unsigned int uNumPixels) | |
650 { | |
651 if ( (signed int)uNumPixels < 14 ) | |
652 uNumPixels = 14; | |
653 return ((signed int)(uNumPixels - 14) >> 5) + 1; | |
654 } | |
655 | |
656 //----- (0041A556) -------------------------------------------------------- | |
657 void draw_leather() | |
658 { | |
659 pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->GetTexture(uTextureID_Leather)); | |
660 } | |
661 | |
662 //----- (0041ABFD) -------------------------------------------------------- | |
663 void CharacterUI_CharacterScreen_Draw(Player *player) | |
664 { | |
665 pRenderer->ClearZBuffer(0, 479); | |
666 switch (pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0]) | |
667 { | |
668 case WINDOW_CharacterWindow_Stats: // stats | |
669 CharacterUI_ReleaseButtons(); | |
670 sub_419379(); | |
671 CharacterUI_StatsTab_Draw(player); | |
672 pRenderer->DrawTextureIndexed(pCharacterScreen_StatsBtn->uX, | |
673 pCharacterScreen_StatsBtn->uY, | |
674 pIcons_LOD->LoadTexturePtr("ib-cd1-d", TEXTURE_16BIT_PALETTE)); | |
675 break; | |
676 | |
677 case WINDOW_CharacterWindow_Skills: // skills | |
678 if (dword_507CC0_activ_ch != uActiveCharacter) | |
679 { | |
680 CharacterUI_ReleaseButtons(); | |
681 CharacterUI_SkillsTab_CreateButtons(); | |
682 } | |
683 sub_419379(); | |
684 CharacterUI_SkillsTab_Draw(player); | |
685 pRenderer->DrawTextureIndexed(pCharacterScreen_SkillsBtn->uX, | |
686 pCharacterScreen_SkillsBtn->uY, | |
687 pIcons_LOD->LoadTexturePtr("ib-cd2-d", TEXTURE_16BIT_PALETTE)); | |
688 break; | |
689 | |
690 case WINDOW_CharacterWindow_Awards: // awards | |
691 CharacterUI_ReleaseButtons(); | |
692 sub_419379(); | |
1455 | 693 CreateAwardsScrollBar(); |
1298 | 694 CharacterUI_AwardsTab_Draw(player); |
695 pRenderer->DrawTextureIndexed(pCharacterScreen_AwardsBtn->uX, | |
696 pCharacterScreen_AwardsBtn->uY, | |
697 pIcons_LOD->LoadTexturePtr("ib-cd4-d", TEXTURE_16BIT_PALETTE)); | |
698 break; | |
699 | |
700 case WINDOW_CharacterWindow_Inventory: // inventory and other | |
701 CharacterUI_ReleaseButtons(); | |
702 sub_419379(); | |
703 CharacterUI_InventoryTab_Draw(player, false); | |
704 pRenderer->DrawTextureIndexed(pCharacterScreen_InventoryBtn->uX, | |
705 pCharacterScreen_InventoryBtn->uY, | |
706 pIcons_LOD->LoadTexturePtr("ib-cd3-d", TEXTURE_16BIT_PALETTE)); | |
707 break; | |
708 | |
709 default: break; | |
710 } | |
711 | |
712 if (bRingsShownInCharScreen) | |
713 CharacterUI_DrawPaperdollWithRingOverlay(player); | |
714 else | |
715 CharacterUI_DrawPaperdoll(player); | |
716 } | |
717 | |
718 //----- (0043CC7C) -------------------------------------------------------- | |
719 void CharacterUI_DrawPaperdoll(Player *player) | |
720 { | |
1455 | 721 ItemGen *item; // edi@38 |
722 int item_X; // ebx@38 | |
723 int index; // eax@65 | |
1298 | 724 int v59; // ebx@129 |
725 unsigned int v75; // ebx@170 | |
726 int pArmorShoulderNum; // eax@197 | |
727 int v94; // ebx@214 | |
1455 | 728 unsigned int v127; // ebx@314 |
729 unsigned int v153; // eax@370 | |
730 char *v166; // [sp-8h] [bp-54h]@16 | |
731 const char *container; // [sp-8h] [bp-54h]@79 | |
732 char *v181; // [sp-8h] [bp-54h]@337 | |
733 int item_Y; // [sp+10h] [bp-3Ch]@38 | |
734 int pBodyComplection; // [sp+24h] [bp-28h]@6 | |
735 signed int v245; // [sp+34h] [bp-18h]@361 | |
736 signed int IsDwarf; // [sp+40h] [bp-Ch]@4 | |
1298 | 737 |
738 pIcons_LOD->LoadTexture("sptext01", TEXTURE_16BIT_PALETTE); | |
739 if (player->GetRace() == CHARACTER_RACE_DWARF) | |
740 { | |
741 IsDwarf = 1; | |
742 pBodyComplection = player->GetSexByVoice() == SEX_MALE ? 2 : 3; | |
743 } | |
744 else | |
745 { | |
746 IsDwarf = 0; | |
747 pBodyComplection = player->GetSexByVoice() == SEX_MALE ? 0 : 1; | |
748 } | |
749 | |
750 int uPlayerID = 0; | |
751 for (uint i = 0; i < 4; ++i) | |
752 if (pPlayers[i + 1] == player) | |
753 { | |
754 uPlayerID = i + 1; | |
755 break; | |
756 } | |
757 | |
758 pRenderer->ResetTextureClipRect(); | |
759 pRenderer->DrawTextureIndexed(467, 0, pIcons_LOD->GetTexture(uTextureID_BACKDOLL));//Ïîäëîæêà | |
760 if ( IsPlayerWearingWatersuit[uPlayerID] )//àêâàëàíã | |
761 { | |
762 pRenderer->DrawTextureTransparent(pPaperdoll_BodyX, pPaperdoll_BodyY, pIcons_LOD->GetTexture(papredoll_dbods[uPlayerID - 1])); | |
763 if ( !bRingsShownInCharScreen ) | |
764 pRenderer->DrawMaskToZBuffer(pPaperdoll_BodyX, pPaperdoll_BodyY, pIcons_LOD->GetTexture(papredoll_dbods[uPlayerID - 1]), player->pEquipment.uArmor); | |
1455 | 765 //Ðóêà íå çàíÿòà èëè ... |
766 if ( !player->pEquipment.uMainHand | |
767 || ( pItemsTable->pItems[pPlayers[uPlayerID]->pInventoryItemList[player->pEquipment.uMainHand - 1].uItemID].uEquipType != EQUIP_MAIN_HAND) | |
768 && (pItemsTable->pItems[pPlayers[uPlayerID]->pInventoryItemList[player->pEquipment.uMainHand - 1].uItemID].uSkillType != PLAYER_SKILL_SPEAR | |
769 || pPlayers[uPlayerID]->pEquipment.uShield) ) | |
770 pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_LeftHand[pBodyComplection][0], pPaperdoll_BodyY + pPaperdoll_LeftHand[pBodyComplection][1], | |
771 pIcons_LOD->GetTexture(papredoll_dlads[uPlayerID - 1])); | |
772 //-----------------------------------------------------(Hand/Ðóêà)--------------------------------------------------------------- | |
773 if ( pPlayers[uPlayerID]->pEquipment.uMainHand ) | |
1298 | 774 { |
1455 | 775 item = &pPlayers[uPlayerID]->pInventoryItemList[pPlayers[uPlayerID]->pEquipment.uMainHand - 1]; |
776 item_X = pPaperdoll_BodyX + paperdoll_Weapon[pBodyComplection][1][0] - pItemsTable->pItems[item->uItemID].uEquipX; | |
777 item_Y = pPaperdoll_BodyY + paperdoll_Weapon[pBodyComplection][1][1] - pItemsTable->pItems[item->uItemID].uEquipY; | |
778 if ( item->uItemID == 64 ) //blaster | |
1298 | 779 v166 = "item64v1"; |
780 else | |
1455 | 781 v166 = pItemsTable->pItems[item->uItemID].pIconName; |
782 if ( !( item->uAttributes & 0xF0 ) ) | |
1298 | 783 { |
1455 | 784 if ( item->uAttributes & 2 ) |
785 pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(v166, TEXTURE_16BIT_PALETTE))); | |
1298 | 786 else |
787 { | |
1455 | 788 if ( item->uAttributes & 1 ) |
789 pRenderer->DrawTextureTransparent(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(v166, TEXTURE_16BIT_PALETTE))); | |
1298 | 790 else |
1455 | 791 pRenderer->DrawTransparentGreenShade(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(v166, TEXTURE_16BIT_PALETTE))); |
1298 | 792 } |
793 } | |
1455 | 794 if ( item->uAttributes & 0xF0 ) |
1298 | 795 { |
1455 | 796 if ( ( item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_RED ) |
797 container = "sptext01"; | |
798 if ( ( item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_BLUE ) | |
799 container = "sp28a"; | |
800 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_GREEN ) | |
801 container = "sp30a"; | |
802 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_PURPLE ) | |
803 container = "sp91a"; | |
1298 | 804 _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; |
805 if ( _50C9A8_item_enchantment_timer <= 0 ) | |
806 { | |
807 _50C9A8_item_enchantment_timer = 0; | |
1455 | 808 item->uAttributes &= 0xFFFFFF0Fu; |
1298 | 809 ptr_50C9A4 = 0; |
810 } | |
1455 | 811 pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(v166, TEXTURE_16BIT_PALETTE)), |
812 pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), GetTickCount() * 0.1, 0, 255); | |
1298 | 813 } |
814 if ( !bRingsShownInCharScreen ) | |
1455 | 815 pRenderer->DrawMaskToZBuffer(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(v166, TEXTURE_16BIT_PALETTE)), pPlayers[uPlayerID]->pEquipment.uMainHand); |
1298 | 816 } |
817 } | |
818 else// áåç àêâàëàíãà | |
819 { | |
1455 | 820 //----------------(Bow/ Ëóê)------------------------------------------------- |
821 if ( pPlayers[uPlayerID]->pEquipment.uBow ) | |
1298 | 822 { |
1455 | 823 item = &pPlayers[uPlayerID]->pInventoryItemList[pPlayers[uPlayerID]->pEquipment.uBow - 1]; |
824 item_X = pPaperdoll_BodyX + paperdoll_Weapon[pBodyComplection][2][0] - pItemsTable->pItems[item->uItemID].uEquipX; | |
825 item_Y = pPaperdoll_BodyY + paperdoll_Weapon[pBodyComplection][2][1] - pItemsTable->pItems[item->uItemID].uEquipY; | |
826 if ( !(item->uAttributes & 0xF0) )// åñëè íå ïðèìåí¸í çàêë | |
1298 | 827 { |
1455 | 828 if ( item->uAttributes & 2 ) |
829 pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(pItemsTable->pItems[item->uItemID].pIconName, TEXTURE_16BIT_PALETTE))); | |
1298 | 830 else |
831 { | |
1455 | 832 if ( !(item->uAttributes & 1) )//íå îïîçíàííûé ëóê çåë¸íûé |
833 pRenderer->DrawTransparentGreenShade(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(pItemsTable->pItems[item->uItemID].pIconName, TEXTURE_16BIT_PALETTE))); | |
1298 | 834 else // îïîçíàííûé ëóê |
1455 | 835 pRenderer->DrawTextureTransparent(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(pItemsTable->pItems[item->uItemID].pIconName, TEXTURE_16BIT_PALETTE))); |
1298 | 836 } |
837 } | |
838 else | |
839 { | |
1455 | 840 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_RED ) |
841 container = "sptext01"; | |
842 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_BLUE ) | |
843 container = "sp28a"; | |
844 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_GREEN ) | |
845 container = "sp30a"; | |
846 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_PURPLE ) | |
847 container = "sp91a"; | |
1298 | 848 _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; |
849 if ( _50C9A8_item_enchantment_timer <= 0 ) | |
850 { | |
851 _50C9A8_item_enchantment_timer = 0; | |
1455 | 852 item->uAttributes &= 0xFFFFFF0Fu; |
1298 | 853 ptr_50C9A4 = 0; |
854 } | |
1455 | 855 pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(pItemsTable->pItems[item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)), |
856 pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), | |
857 GetTickCount() * 0.1, 0, 255); | |
1298 | 858 } |
859 if ( !bRingsShownInCharScreen ) | |
1455 | 860 pRenderer->DrawMaskToZBuffer(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(pItemsTable->pItems[item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)), |
861 pPlayers[uPlayerID]->pEquipment.uBow); | |
1298 | 862 } |
1455 | 863 //-----------------------------(Cloak/Ïëàù)--------------------------------------------------------- |
864 if ( pPlayers[uPlayerID]->pEquipment.uCloak ) | |
1298 | 865 { |
1455 | 866 item = &pPlayers[uPlayerID]->pInventoryItemList[pPlayers[uPlayerID]->pEquipment.uCloak - 1]; |
867 switch ( item->uItemID ) | |
1298 | 868 { |
869 case ITEM_RELIC_TWILIGHT: | |
1455 | 870 index = 5; |
1298 | 871 break; |
872 case ITEM_ARTIFACT_CLOAK_OF_THE_SHEEP: | |
1455 | 873 index = 6; |
1298 | 874 break; |
875 case ITEM_RARE_SUN_CLOAK: | |
1455 | 876 index = 7; |
1298 | 877 break; |
878 case ITEM_RARE_MOON_CLOAK: | |
1455 | 879 index = 8; |
1298 | 880 break; |
881 case ITEM_RARE_VAMPIRES_CAPE: | |
1455 | 882 index = 9; |
1298 | 883 break; |
884 default: | |
1455 | 885 index = item->uItemID - 105; |
1298 | 886 break; |
887 } | |
1455 | 888 if ( index >= 0 && index < 10 ) |
1298 | 889 { |
1455 | 890 item_X = pPaperdoll_BodyX + paperdoll_Cloak[pBodyComplection][index][0]; |
891 item_Y = pPaperdoll_BodyY + paperdoll_Cloak[pBodyComplection][index][1]; | |
892 if ( !(item->uAttributes & 0xF0) ) | |
1298 | 893 { |
1455 | 894 if ( item->uAttributes & 2 ) |
895 pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_cloak_texture[pBodyComplection][index])); | |
1298 | 896 else |
1455 | 897 pRenderer->DrawTextureTransparent(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_cloak_texture[pBodyComplection][index])); |
1298 | 898 } |
899 else | |
900 { | |
1455 | 901 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_RED ) |
902 container = "sptext01"; | |
903 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_BLUE ) | |
904 container = "sp28a"; | |
905 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_GREEN ) | |
906 container = "sp30a"; | |
907 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_PURPLE ) | |
908 container = "sp91a"; | |
1298 | 909 _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; |
910 if ( _50C9A8_item_enchantment_timer <= 0 ) | |
911 { | |
912 _50C9A8_item_enchantment_timer = 0; | |
1455 | 913 item->uAttributes &= 0xFFFFFF0Fu; |
1298 | 914 ptr_50C9A4 = 0; |
915 } | |
1455 | 916 pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_cloak_texture[pBodyComplection][index]), |
917 pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), GetTickCount() * 0.1, 0, 255); | |
1298 | 918 } |
919 if ( !bRingsShownInCharScreen ) | |
1455 | 920 pRenderer->DrawMaskToZBuffer(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_cloak_texture[pBodyComplection][index]), |
921 pPlayers[uPlayerID]->pEquipment.uCloak); | |
1298 | 922 } |
923 } | |
1455 | 924 //-------------------------------(Paperdoll/Êóêëà)------------------------------------------- |
925 pRenderer->DrawTextureTransparent(pPaperdoll_BodyX, pPaperdoll_BodyY, pIcons_LOD->GetTexture(papredoll_dbods[uPlayerID - 1])); | |
926 //-------------------------------(Armor/Áðîíÿ)----------------------------------------------- | |
927 if ( pPlayers[uPlayerID]->pEquipment.uArmor ) | |
1298 | 928 { |
1455 | 929 item = &pPlayers[uPlayerID]->pInventoryItemList[pPlayers[uPlayerID]->pEquipment.uArmor - 1]; |
930 switch ( item->uItemID ) | |
1298 | 931 { |
1455 | 932 case ITEM_ARTICACT_GOVERNONS_ARMOR: |
933 index = 15; | |
1298 | 934 break; |
935 case ITEM_ARTIFACT_YORUBA: | |
1455 | 936 index = 14; |
1298 | 937 break; |
938 case ITEM_RELIC_HARECS_LEATHER: | |
1455 | 939 index = 13; |
1298 | 940 break; |
941 case ITEM_ELVEN_CHAINMAIL: | |
1455 | 942 index = 16; |
1298 | 943 break; |
944 default: | |
1455 | 945 index = item->uItemID - 66; |
1298 | 946 break; |
947 } | |
1455 | 948 if ( index >= 0 && index < 17 ) |
1298 | 949 { |
1455 | 950 item_X = pPaperdoll_BodyX + paperdoll_Armor[pBodyComplection][index][0]; |
951 item_Y = pPaperdoll_BodyY + paperdoll_Armor[pBodyComplection][index][1]; | |
952 if ( !(item->uAttributes & 0xF0) ) | |
1298 | 953 { |
1455 | 954 if ( item->uAttributes & 2 ) |
955 pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_armor_texture[pBodyComplection][index][0])); | |
1298 | 956 else |
957 { | |
1455 | 958 if ( !(item->uAttributes & 1) ) |
959 pRenderer->DrawTransparentGreenShade(item_X, item_Y, &pIcons_LOD->pTextures[paperdoll_armor_texture[pBodyComplection][index][0]]); | |
1298 | 960 else |
1455 | 961 pRenderer->DrawTextureTransparent(item_X, item_Y, &pIcons_LOD->pTextures[paperdoll_armor_texture[pBodyComplection][index][0]]); |
1298 | 962 } |
963 } | |
964 else | |
965 { | |
1455 | 966 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_RED ) |
967 container = "sptext01"; | |
968 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_BLUE ) | |
969 container = "sp28a"; | |
970 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_GREEN ) | |
971 container = "sp30a"; | |
972 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_PURPLE ) | |
973 container = "sp91a"; | |
1298 | 974 _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; |
975 if ( _50C9A8_item_enchantment_timer <= 0 ) | |
976 { | |
977 _50C9A8_item_enchantment_timer = 0; | |
1455 | 978 item->uAttributes &= 0xFFFFFF0Fu; |
1298 | 979 ptr_50C9A4 = 0; |
980 } | |
1455 | 981 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); | |
1298 | 983 } |
1455 | 984 //--------------------------------(Shoulder/쑌֏)--------------------------------------------- |
985 if ( pPlayers[uPlayerID]->pEquipment.uMainHand | |
1298 | 986 && (pPlayers[uPlayerID]->GetEquippedItemEquipType(EQUIP_MAIN_HAND) == EQUIP_MAIN_HAND || |
987 pPlayers[uPlayerID]->GetEquippedItemSkillType(EQUIP_MAIN_HAND) == EQUIP_SHIELD && | |
1455 | 988 !pPlayers[uPlayerID]->pEquipment.uShield) )//áåç ùèòà |
1298 | 989 { |
1455 | 990 v94 = paperdoll_armor_texture[pBodyComplection][index][2]; |
991 if ( paperdoll_armor_texture[pBodyComplection][index][2] == pIcons_LOD->FindTextureByName("pending") ) | |
1298 | 992 { |
1455 | 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]; | |
1298 | 996 } |
997 else | |
998 { | |
1455 | 999 item_X = pPaperdoll_BodyX + dword_4E5270[index][0]; |
1000 item_Y = pPaperdoll_BodyY + dword_4E5270[index][1]; | |
1298 | 1001 } |
1455 | 1002 if ( !(item->uAttributes & 0xF0) ) |
1298 | 1003 { |
1455 | 1004 //v98 = v94 + 1; |
1005 if ( item->uAttributes & 2 ) | |
1006 pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(v94)); | |
1298 | 1007 else |
1008 { | |
1455 | 1009 if ( item->uAttributes & 1 ) |
1010 pRenderer->DrawTextureTransparent(item_X, item_Y, pIcons_LOD->GetTexture(v94)); | |
1298 | 1011 else |
1455 | 1012 pRenderer->DrawTransparentGreenShade(item_X, item_Y, pIcons_LOD->GetTexture(v94)); |
1298 | 1013 } |
1014 } | |
1015 else | |
1016 { | |
1455 | 1017 if ( paperdoll_armor_texture[pBodyComplection][index][2] != pIcons_LOD->FindTextureByName("pending") ) |
1298 | 1018 { |
1455 | 1019 if ( item->uAttributes & 0xF0 ) |
1298 | 1020 { |
1455 | 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"; | |
1298 | 1029 _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; |
1030 if ( _50C9A8_item_enchantment_timer <= 0 ) | |
1031 { | |
1032 _50C9A8_item_enchantment_timer = 0; | |
1455 | 1033 item->uAttributes &= 0xFFFFFF0Fu; |
1298 | 1034 ptr_50C9A4 = 0; |
1035 } | |
1455 | 1036 pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(v94), pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), |
1037 GetTickCount() * 0.1, 0, 255); | |
1298 | 1038 } |
1039 } | |
1040 } | |
1041 } | |
1455 | 1042 else//ñ ùèòîì |
1298 | 1043 { |
1455 | 1044 //v94 = paperdoll_armor_texture[pBodyComplection][index][1]; |
1045 if ( paperdoll_armor_texture[pBodyComplection][index][1] != pIcons_LOD->FindTextureByName("pending") ) | |
1298 | 1046 { |
1455 | 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) ) | |
1298 | 1050 { |
1455 | 1051 if ( item->uAttributes & 2 ) |
1052 pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_armor_texture[pBodyComplection][index][2])); | |
1298 | 1053 else |
1054 { | |
1455 | 1055 if ( item->uAttributes & 1 ) |
1056 pRenderer->DrawTextureTransparent(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_armor_texture[pBodyComplection][index][2])); | |
1298 | 1057 else |
1455 | 1058 pRenderer->DrawTransparentGreenShade(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_armor_texture[pBodyComplection][index][2])); |
1298 | 1059 } |
1060 } | |
1061 else | |
1062 { | |
1455 | 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"; | |
1298 | 1071 _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; |
1072 if ( _50C9A8_item_enchantment_timer <= 0 ) | |
1073 { | |
1074 _50C9A8_item_enchantment_timer = 0; | |
1455 | 1075 item->uAttributes &= 0xFFFFFF0Fu; |
1298 | 1076 ptr_50C9A4 = 0; |
1077 } | |
1455 | 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); | |
1298 | 1080 } |
1081 } | |
1082 } | |
1455 | 1083 |
1298 | 1084 if ( !bRingsShownInCharScreen ) |
1455 | 1085 pRenderer->DrawMaskToZBuffer(item_X, item_Y, &pIcons_LOD->pTextures[paperdoll_armor_texture[pBodyComplection][index][0]], |
1086 pPlayers[uPlayerID]->pEquipment.uArmor); | |
1298 | 1087 } |
1088 } | |
1455 | 1089 //----------------------------------(End of Armor/Êîíåö Áðîíè)------------------------------------------ |
1090 //----------------------------------(Boot/Îáóâü)-------------------------------------------------------- | |
1091 if ( pPlayers[uPlayerID]->pEquipment.uBoot ) | |
1298 | 1092 { |
1455 | 1093 item = &pPlayers[uPlayerID]->pInventoryItemList[pPlayers[uPlayerID]->pEquipment.uBoot - 1]; |
1094 switch ( item->uItemID ) | |
1298 | 1095 { |
1455 | 1096 case ITEM_ARTIFACT_HERMES_SANDALS: |
1097 index = 5; | |
1298 | 1098 v59 = papredoll_flying_feet[pPlayers[uPlayerID]->uCurrentFace]; |
1099 break; | |
1455 | 1100 case ITEM_ARTIFACT_LEAGUE_BOOTS: |
1101 index = 6; | |
1298 | 1102 v59 = paperdoll_boots_texture[pBodyComplection][5]; |
1103 break; | |
1104 default: | |
1455 | 1105 index = item->uItemID - 115; |
1106 v59 = paperdoll_boots_texture[pBodyComplection][index]; | |
1298 | 1107 break; |
1108 } | |
1455 | 1109 if ( index >= 0 && index < 7 ) |
1298 | 1110 { |
1455 | 1111 item_X = pPaperdoll_BodyX + paperdoll_Boot[pBodyComplection][index][0]; |
1112 item_Y = pPaperdoll_BodyY + paperdoll_Boot[pBodyComplection][index][1]; | |
1113 if ( !(item->uAttributes & 0xF0) ) | |
1298 | 1114 { |
1455 | 1115 if ( item->uAttributes & 2 ) |
1116 pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(v59)); | |
1298 | 1117 else |
1118 { | |
1455 | 1119 if ( item->uAttributes & 1 ) |
1120 pRenderer->DrawTextureTransparent(item_X, item_Y, pIcons_LOD->GetTexture(v59)); | |
1298 | 1121 else |
1455 | 1122 pRenderer->DrawTransparentGreenShade(item_X, item_Y, pIcons_LOD->GetTexture(v59)); |
1298 | 1123 } |
1124 } | |
1125 else | |
1126 { | |
1455 | 1127 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_RED ) |
1128 container = "sptext01"; | |
1129 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_BLUE ) | |
1130 container = "sp28a"; | |
1131 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_GREEN ) | |
1132 container = "sp30a"; | |
1133 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_PURPLE ) | |
1134 container = "sp91a"; | |
1298 | 1135 _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; |
1136 if ( _50C9A8_item_enchantment_timer <= 0 ) | |
1137 { | |
1138 _50C9A8_item_enchantment_timer = 0; | |
1455 | 1139 item->uAttributes &= 0xFFFFFF0Fu; |
1298 | 1140 ptr_50C9A4 = 0; |
1141 } | |
1455 | 1142 pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(v59), pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), |
1143 GetTickCount() * 0.1, 0, 255); | |
1298 | 1144 } |
1145 if ( !bRingsShownInCharScreen ) | |
1455 | 1146 pRenderer->DrawMaskToZBuffer(item_X, item_Y, pIcons_LOD->GetTexture(v59), pPlayers[uPlayerID]->pEquipment.uBoot); |
1298 | 1147 } |
1148 } | |
1455 | 1149 //--------------------------------------------(Hand/Ðóêà)------------------------------------------------------ |
1150 if ( !pPlayers[uPlayerID]->pEquipment.uMainHand | |
1151 || ( pItemsTable->pItems[pPlayers[uPlayerID]->pInventoryItemList[pPlayers[uPlayerID]->pEquipment.uMainHand -1].uItemID].uEquipType != EQUIP_MAIN_HAND) | |
1152 && (pItemsTable->pItems[pPlayers[uPlayerID]->pInventoryItemList[pPlayers[uPlayerID]->pEquipment.uMainHand -1].uItemID].uSkillType != PLAYER_SKILL_SPEAR | |
1153 || pPlayers[uPlayerID]->pEquipment.uShield) ) | |
1154 pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_LeftHand[pBodyComplection][0], | |
1155 pPaperdoll_BodyY + pPaperdoll_LeftHand[pBodyComplection][1], pIcons_LOD->GetTexture(papredoll_dlads[uPlayerID - 1])); | |
1156 //--------------------------------------------(Belt/Ïîÿñ)------------------------------------------------------- | |
1157 if ( pPlayers[uPlayerID]->pEquipment.uBelt ) | |
1158 { | |
1159 item = &pPlayers[uPlayerID]->pInventoryItemList[pPlayers[uPlayerID]->pEquipment.uBelt - 1]; | |
1160 switch ( item->uItemID ) | |
1298 | 1161 { |
1162 case ITEM_RILIC_TITANS_BELT: | |
1455 | 1163 index = 5; |
1298 | 1164 break; |
1165 case ITEM_ARTIFACT_HEROS_BELT: | |
1455 | 1166 index = 6; |
1298 | 1167 break; |
1168 default: | |
1455 | 1169 index = item->uItemID - 100; |
1298 | 1170 break; |
1171 } | |
1455 | 1172 if ( index >= 0 && index < 7 ) |
1298 | 1173 { |
1455 | 1174 item_X = pPaperdoll_BodyX + paperdoll_Belt[pBodyComplection][index][0]; |
1175 item_Y = pPaperdoll_BodyY + paperdoll_Belt[pBodyComplection][index][1]; | |
1176 if ( IsDwarf != 1 || index == 5 ) | |
1177 v75 = paperdoll_belt_texture[pBodyComplection][index]; | |
1298 | 1178 else |
1455 | 1179 v75 = paperdoll_belt_texture[pBodyComplection - 2][index]; |
1180 if ( !(item->uAttributes & 0xF0) ) | |
1298 | 1181 { |
1455 | 1182 if ( item->uAttributes & 2 ) |
1183 pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(v75)); | |
1298 | 1184 else |
1185 { | |
1455 | 1186 if ( item->uAttributes & 1 ) |
1187 pRenderer->DrawTextureTransparent(item_X, item_Y, pIcons_LOD->GetTexture(v75)); | |
1298 | 1188 else |
1455 | 1189 pRenderer->DrawTransparentGreenShade(item_X, item_Y, pIcons_LOD->GetTexture(v75)); |
1298 | 1190 } |
1191 if ( !bRingsShownInCharScreen ) | |
1455 | 1192 pRenderer->DrawMaskToZBuffer(item_X, item_Y, pIcons_LOD->GetTexture(v75), pPlayers[uPlayerID]->pEquipment.uBelt); |
1298 | 1193 } |
1194 else | |
1195 { | |
1455 | 1196 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_RED ) |
1197 container = "sptext01"; | |
1198 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_BLUE ) | |
1199 container = "sp28a"; | |
1200 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_GREEN ) | |
1201 container = "sp30a"; | |
1202 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_PURPLE ) | |
1203 container = "sp91a"; | |
1298 | 1204 _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; |
1205 if ( _50C9A8_item_enchantment_timer <= 0 ) | |
1206 { | |
1207 _50C9A8_item_enchantment_timer = 0; | |
1455 | 1208 item->uAttributes &= 0xFFFFFF0Fu; |
1298 | 1209 ptr_50C9A4 = 0; |
1210 } | |
1455 | 1211 pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(v75), pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), |
1212 GetTickCount() * 0.1, 0, 255); | |
1298 | 1213 } |
1214 } | |
1215 } | |
1455 | 1216 //---------------------------------------------(Hand2/Ðóêà2)-------------------------------------------------- |
1217 if ( pPlayers[uPlayerID]->pEquipment.uMainHand ) | |
1298 | 1218 { |
1455 | 1219 if ( pItemsTable->pItems[pPlayers[uPlayerID]->pInventoryItemList[pPlayers[uPlayerID]->pEquipment.uMainHand - 1].uItemID].uEquipType == EQUIP_MAIN_HAND |
1220 || pItemsTable->pItems[pPlayers[uPlayerID]->pInventoryItemList[pPlayers[uPlayerID]->pEquipment.uMainHand - 1].uItemID].uSkillType == PLAYER_SKILL_SPEAR | |
1221 && !pPlayers[uPlayerID]->pEquipment.uShield ) | |
1298 | 1222 pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_SecondLeftHand[pBodyComplection][0], |
1455 | 1223 pPaperdoll_BodyY + pPaperdoll_SecondLeftHand[pBodyComplection][1], pIcons_LOD->GetTexture(papredoll_dlaus[uPlayerID - 1])); |
1298 | 1224 } |
1455 | 1225 //----------------------------------------------(Cloak collar/âîðîòíèê ïëàùà)------------------------------------- |
1226 if ( pPlayers[uPlayerID]->pEquipment.uCloak ) | |
1298 | 1227 { |
1455 | 1228 item = &pPlayers[uPlayerID]->pInventoryItemList[pPlayers[uPlayerID]->pEquipment.uCloak - 1]; |
1229 switch ( item->uItemID ) | |
1298 | 1230 { |
1455 | 1231 case ITEM_RELIC_TWILIGHT: |
1232 index = 5; | |
1298 | 1233 break; |
1455 | 1234 case ITEM_ARTIFACT_CLOAK_OF_THE_SHEEP: |
1235 index = 6; | |
1298 | 1236 break; |
1455 | 1237 case ITEM_RARE_SUN_CLOAK: |
1238 index = 7; | |
1298 | 1239 break; |
1455 | 1240 case ITEM_RARE_MOON_CLOAK: |
1241 index = 8; | |
1298 | 1242 break; |
1455 | 1243 case ITEM_RARE_VAMPIRES_CAPE: |
1244 index = 9; | |
1298 | 1245 break; |
1246 default: | |
1455 | 1247 index = item->uItemID - 105; |
1298 | 1248 } |
1455 | 1249 if ( index >= 0 && index < 10 ) |
1298 | 1250 { |
1455 | 1251 item_X = pPaperdoll_BodyX + paperdoll_CloakCollar[pBodyComplection][index][0]; |
1252 item_Y = pPaperdoll_BodyY + paperdoll_CloakCollar[pBodyComplection][index][1]; | |
1253 if ( paperdoll_cloak_collar_texture[pBodyComplection][index] != pIcons_LOD->FindTextureByName("pending") ) | |
1298 | 1254 { |
1455 | 1255 if ( !(item->uAttributes & 0xF0) ) |
1298 | 1256 { |
1455 | 1257 if ( item->uAttributes & 2 ) |
1258 pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_cloak_collar_texture[pBodyComplection][index])); | |
1298 | 1259 else |
1455 | 1260 pRenderer->DrawTextureTransparent(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_cloak_collar_texture[pBodyComplection][index])); |
1298 | 1261 if ( !bRingsShownInCharScreen ) |
1455 | 1262 pRenderer->DrawMaskToZBuffer(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_cloak_collar_texture[pBodyComplection][index]), |
1263 pPlayers[uPlayerID]->pEquipment.uCloak); | |
1298 | 1264 } |
1265 else | |
1266 { | |
1455 | 1267 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_RED ) |
1268 container = "sptext01"; | |
1269 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_BLUE ) | |
1270 container = "sp28a"; | |
1271 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_GREEN ) | |
1272 container = "sp30a"; | |
1273 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_PURPLE ) | |
1274 container = "sp91a"; | |
1298 | 1275 _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; |
1276 if ( _50C9A8_item_enchantment_timer <= 0 ) | |
1277 { | |
1278 _50C9A8_item_enchantment_timer = 0; | |
1455 | 1279 item->uAttributes &= 0xFFFFFF0Fu; |
1298 | 1280 ptr_50C9A4 = 0; |
1281 } | |
1455 | 1282 pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_cloak_collar_texture[pBodyComplection][index]), |
1283 pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), GetTickCount() * 0.1, 0, 255); | |
1298 | 1284 } |
1285 } | |
1286 } | |
1287 } | |
1455 | 1288 //--------------------------------------------(Beards/Áîðîäà)------------------------------------------------------- |
1298 | 1289 if ( pPlayers[uPlayerID]->uCurrentFace == 12 || pPlayers[uPlayerID]->uCurrentFace == 13 ) |
1290 { | |
1455 | 1291 if ( papredoll_dbrds[pPlayers[uPlayerID]->uCurrentFace] != pIcons_LOD->FindTextureByName("Pending") ) |
1298 | 1292 pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_Beards[2 * pPlayers[uPlayerID]->uCurrentFace - 24], |
1293 pPaperdoll_BodyY + pPaperdoll_Beards[2 * pPlayers[uPlayerID]->uCurrentFace - 23], | |
1455 | 1294 pIcons_LOD->GetTexture(papredoll_dbrds[pPlayers[uPlayerID]->uCurrentFace])); |
1298 | 1295 } |
1455 | 1296 //--------------------------------------------(Helm/Øëåì)------------------------------------------------------------ |
1297 if ( pPlayers[uPlayerID]->pEquipment.uHelm ) | |
1298 | 1298 { |
1455 | 1299 item = &pPlayers[uPlayerID]->pInventoryItemList[pPlayers[uPlayerID]->pEquipment.uHelm - 1]; |
1300 switch ( item->uItemID ) | |
1298 | 1301 { |
1455 | 1302 case ITEM_RELIC_TALEDONS_HELM: |
1303 index = 11; | |
1298 | 1304 break; |
1455 | 1305 case ITEM_RELIC_SCHOLARS_CAP: |
1306 index = 12; | |
1298 | 1307 break; |
1455 | 1308 case ITEM_RELIC_PHYNAXIAN_CROWN: |
1309 index = 13; | |
1298 | 1310 break; |
1455 | 1311 case ITEM_ARTIFACT_MINDS_EYE: |
1312 index = 14; | |
1298 | 1313 break; |
1455 | 1314 case ITEM_RARE_SHADOWS_MASK: |
1315 index = 15; | |
1298 | 1316 break; |
1317 default: | |
1455 | 1318 index = item->uItemID - 89; |
1298 | 1319 } |
1455 | 1320 if ( index >= 0 && index < 16 ) |
1298 | 1321 { |
1455 | 1322 item_X = pPaperdoll_BodyX + paperdoll_Helm[pBodyComplection][index][0]; |
1323 item_Y = pPaperdoll_BodyY + paperdoll_Helm[pBodyComplection][index][1]; | |
1324 if ( IsDwarf != 1 || item->uItemID != 92 ) | |
1325 v127 = paperdoll_helm_texture[player->GetSexByVoice()][index]; | |
1298 | 1326 else |
1327 v127 = papredoll_dbrds[11]; | |
1455 | 1328 if ( item->uAttributes & 0xF0 ) |
1298 | 1329 { |
1455 | 1330 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_RED ) |
1331 container = "sptext01"; | |
1332 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_BLUE ) | |
1333 container = "sp28a"; | |
1334 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_GREEN ) | |
1335 container = "sp30a"; | |
1336 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_PURPLE ) | |
1337 container = "sp91a"; | |
1298 | 1338 _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; |
1339 if ( _50C9A8_item_enchantment_timer <= 0 ) | |
1340 { | |
1341 _50C9A8_item_enchantment_timer = 0; | |
1455 | 1342 item->uAttributes &= 0xFFFFFF0Fu; |
1298 | 1343 ptr_50C9A4 = 0; |
1344 } | |
1455 | 1345 pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(v127), pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), |
1346 GetTickCount() * 0.1, 0, 255); | |
1298 | 1347 } |
1348 else | |
1349 { | |
1455 | 1350 if ( item->uAttributes & 2 ) |
1351 pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(v127)); | |
1298 | 1352 else |
1353 { | |
1455 | 1354 if ( item->uAttributes & 1 ) |
1355 pRenderer->DrawTextureTransparent(item_X, item_Y, pIcons_LOD->GetTexture(v127)); | |
1298 | 1356 else |
1455 | 1357 pRenderer->DrawTransparentGreenShade(item_X, item_Y, pIcons_LOD->GetTexture(v127)); |
1298 | 1358 } |
1359 } | |
1360 if ( !bRingsShownInCharScreen ) | |
1455 | 1361 pRenderer->DrawMaskToZBuffer(item_X, item_Y, pIcons_LOD->GetTexture(v127), pPlayers[uPlayerID]->pEquipment.uHelm); |
1298 | 1362 } |
1363 } | |
1455 | 1364 //------------------------------------------------(Hand3/Ðóêà3)------------------------------------------- |
1365 if ( pPlayers[uPlayerID]->pEquipment.uMainHand ) | |
1298 | 1366 { |
1455 | 1367 item = &pPlayers[uPlayerID]->pInventoryItemList[pPlayers[uPlayerID]->pEquipment.uMainHand - 1]; |
1368 item_X = pPaperdoll_BodyX + paperdoll_Weapon[pBodyComplection][1][0] - pItemsTable->pItems[item->uItemID].uEquipX; | |
1369 item_Y = pPaperdoll_BodyY + paperdoll_Weapon[pBodyComplection][1][1] - pItemsTable->pItems[item->uItemID].uEquipY; | |
1370 if ( item->uItemID == 64 ) | |
1298 | 1371 v181 = "item64v1"; |
1372 else | |
1455 | 1373 v181 = pItemsTable->pItems[item->uItemID].pIconName; |
1374 if ( !(item->uAttributes & 0xF0) ) | |
1298 | 1375 { |
1455 | 1376 if ( item->uAttributes & 2 ) |
1377 pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(v181, TEXTURE_16BIT_PALETTE))); | |
1298 | 1378 else |
1379 { | |
1455 | 1380 if ( item->uAttributes & 1 ) |
1381 pRenderer->DrawTextureTransparent(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(v181, TEXTURE_16BIT_PALETTE))); | |
1298 | 1382 else |
1455 | 1383 pRenderer->DrawTransparentGreenShade(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(v181, TEXTURE_16BIT_PALETTE))); |
1298 | 1384 } |
1385 } | |
1386 else | |
1387 { | |
1455 | 1388 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_RED ) |
1389 container = "sptext01"; | |
1390 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_BLUE ) | |
1391 container = "sp28a"; | |
1392 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_GREEN ) | |
1393 container = "sp30a"; | |
1394 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_PURPLE ) | |
1395 container = "sp91a"; | |
1298 | 1396 _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; |
1397 if ( _50C9A8_item_enchantment_timer <= 0 ) | |
1398 { | |
1399 _50C9A8_item_enchantment_timer = 0; | |
1455 | 1400 item->uAttributes &= 0xFFFFFF0Fu; |
1298 | 1401 ptr_50C9A4 = 0; |
1402 } | |
1455 | 1403 pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(v181, TEXTURE_16BIT_PALETTE)), |
1404 pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), GetTickCount() * 0.1, 0, 255); | |
1298 | 1405 } |
1406 if ( !bRingsShownInCharScreen ) | |
1455 | 1407 pRenderer->DrawMaskToZBuffer(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(v181, TEXTURE_16BIT_PALETTE)), |
1408 pPlayers[uPlayerID]->pEquipment.uMainHand); | |
1298 | 1409 } |
1455 | 1410 //--------------------------------------------------(Shield/Ùèò)--------------------------------------------- |
1411 if ( pPlayers[uPlayerID]->pEquipment.uShield ) | |
1298 | 1412 { |
1455 | 1413 item = &pPlayers[uPlayerID]->pInventoryItemList[pPlayers[uPlayerID]->pEquipment.uShield - 1]; |
1414 if ( pItemsTable->pItems[item->uItemID].uSkillType == PLAYER_SKILL_DAGGER | |
1415 || pItemsTable->pItems[item->uItemID].uSkillType == PLAYER_SKILL_SWORD ) | |
1298 | 1416 { |
1455 | 1417 //v151 = item->uItemID - 400; |
1418 item_X = 596; | |
1298 | 1419 v245 = 1; |
1455 | 1420 switch ( item->uItemID ) |
1298 | 1421 { |
1422 case 400: | |
1455 | 1423 item_Y = 86; |
1298 | 1424 break; |
1425 case 403: | |
1455 | 1426 item_Y = 28; |
1298 | 1427 break; |
1428 case 415: | |
1455 | 1429 item_X = 595; |
1430 item_Y = 33; | |
1298 | 1431 break; |
1432 default: | |
1455 | 1433 item_X = pPaperdoll_BodyX + paperdoll_Weapon[pBodyComplection][0][0] - pItemsTable->pItems[item->uItemID].uEquipX; |
1434 item_Y = pPaperdoll_BodyY + paperdoll_Weapon[pBodyComplection][0][1] - pItemsTable->pItems[item->uItemID].uEquipY; | |
1298 | 1435 break; |
1436 } | |
1437 } | |
1438 else | |
1439 { | |
1440 v245 = 0; | |
1455 | 1441 item_X = pPaperdoll_BodyX + paperdoll_Weapon[pBodyComplection][0][0] - pItemsTable->pItems[item->uItemID].uEquipX; |
1442 item_Y = pPaperdoll_BodyY + paperdoll_Weapon[pBodyComplection][0][1] - pItemsTable->pItems[item->uItemID].uEquipY; | |
1298 | 1443 } |
1455 | 1444 v153 = pIcons_LOD->LoadTexture(pItemsTable->pItems[item->uItemID].pIconName, TEXTURE_16BIT_PALETTE); |
1445 if ( !(item->uAttributes & 0xF0) ) | |
1298 | 1446 { |
1455 | 1447 if ( item->uAttributes & 2 ) |
1448 pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(v153)); | |
1298 | 1449 else |
1450 { | |
1455 | 1451 //v160 = (char *)pIcons_LOD->GetTexture(v153); |
1452 if ( !(item->uAttributes & 1) ) | |
1453 pRenderer->DrawTransparentGreenShade(item_X, item_Y, pIcons_LOD->GetTexture(v153)); | |
1298 | 1454 else |
1455 | 1455 pRenderer->DrawTextureTransparent(item_X, item_Y, pIcons_LOD->GetTexture(v153)); |
1298 | 1456 } |
1457 } | |
1458 else | |
1459 { | |
1455 | 1460 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_RED ) |
1461 container = "sptext01"; | |
1462 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_BLUE ) | |
1463 container = "sp28a"; | |
1464 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_GREEN ) | |
1465 container = "sp30a"; | |
1466 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_PURPLE ) | |
1467 container = "sp91a"; | |
1298 | 1468 _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; |
1469 if ( _50C9A8_item_enchantment_timer <= 0 ) | |
1470 { | |
1471 _50C9A8_item_enchantment_timer = 0; | |
1455 | 1472 item->uAttributes &= 0xFFFFFF0Fu; |
1298 | 1473 ptr_50C9A4 = 0; |
1474 } | |
1455 | 1475 pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(v153), pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), |
1476 GetTickCount() * 0.1, 0, 255); | |
1298 | 1477 if ( v245 ) |
1478 pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdollLeftEmptyHand[pBodyComplection][0], | |
1479 pPaperdoll_BodyY + pPaperdollLeftEmptyHand[pBodyComplection][1], pIcons_LOD->GetTexture(papredoll_dlhs[uPlayerID - 1])); | |
1480 } | |
1481 if ( !bRingsShownInCharScreen ) | |
1455 | 1482 pRenderer->DrawMaskToZBuffer(item_X, item_Y, pIcons_LOD->GetTexture(v153), pPlayers[uPlayerID]->pEquipment.uShield); |
1298 | 1483 } |
1484 } | |
1455 | 1485 //--------------------------------------------------------(RightHand/Ïðàâàÿ ðóêà)-------------------------------------------------- |
1298 | 1486 pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_RightHand[pBodyComplection][0], pPaperdoll_BodyY + pPaperdoll_RightHand[pBodyComplection][1], pIcons_LOD->GetTexture(papredoll_drhs[uPlayerID - 1])); |
1455 | 1487 //--------------------------------------------------------(LeftHand/Ëåâàÿ ðóêà)---------------------------------------------------- |
1488 if ( pPlayers[uPlayerID]->pEquipment.uMainHand ) | |
1298 | 1489 { |
1455 | 1490 item = &pPlayers[uPlayerID]->pInventoryItemList[pPlayers[uPlayerID]->pEquipment.uMainHand - 1]; |
1491 if ( pItemsTable->pItems[item->uItemID].uEquipType == EQUIP_MAIN_HAND | |
1492 || pItemsTable->pItems[item->uItemID].uSkillType == PLAYER_SKILL_SPEAR | |
1493 && !pPlayers[uPlayerID]->pEquipment.uShield ) | |
1298 | 1494 pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_SecondLeftHand[pBodyComplection][0], |
1495 pPaperdoll_BodyY + pPaperdoll_SecondLeftHand[pBodyComplection][1], | |
1496 pIcons_LOD->GetTexture(papredoll_dlhus[uPlayerID - 1])); | |
1497 } | |
1498 if ( !bRingsShownInCharScreen )//ðèñîâàíèå ëóïû | |
1499 pRenderer->DrawTextureTransparent(603, 299, pIcons_LOD->GetTexture(uTextureID_MAGNIF_B)); | |
1500 pRenderer->DrawTextureTransparent(468, 0, pIcons_LOD->GetTexture(uTextureID_right_panel_loop));//îáðàìëåíèå | |
1501 } | |
1502 | |
1503 //----- (0041A2D1) -------------------------------------------------------- | |
1504 void CharacterUI_InventoryTab_Draw(Player *player, bool a2) | |
1505 { | |
1506 Texture *v7; // esi@6 | |
1507 signed int v11; // edx@6 | |
1508 int v13; // eax@13 | |
1509 signed int v14; // edx@13 | |
1510 int v15; // eax@13 | |
1511 unsigned int v17; // edi@15 | |
1512 Texture *pTexture; // ebx@24 | |
1513 unsigned int uCellX; // [sp+30h] [bp-8h]@5 | |
1514 unsigned int uCellY; // [sp+34h] [bp-4h]@5 | |
1515 | |
1516 pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->GetTexture(uTextureID_CharacterUI_InventoryBackground)); | |
1517 if (a2) | |
1518 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) | |
1522 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1365
diff
changeset
|
1523 int v26 = (int)(player->pInventoryMatrix + i); |
1298 | 1524 |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1365
diff
changeset
|
1525 if (player->pInventoryMatrix[i] <= 0) |
1298 | 1526 continue; |
1527 | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1365
diff
changeset
|
1528 int item_idx = player->pInventoryMatrix[i]; |
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1365
diff
changeset
|
1529 auto item = &player->pInventoryItemList[item_idx - 1]; |
1298 | 1530 if (!item->uItemID) |
1531 continue; | |
1532 | |
1533 uCellY = 32 * (i / 14) + 17; | |
1534 uCellX = 32 * (i % 14) + 14; | |
1535 uint item_texture_id = pIcons_LOD->LoadTexture(pItemsTable->pItems[item->uItemID].pIconName, TEXTURE_16BIT_PALETTE); | |
1536 v7 = pIcons_LOD->GetTexture(item_texture_id); | |
1537 | |
1538 v11 = v7->uTextureWidth; | |
1539 if (v11 < 14) | |
1540 v11 = 14; | |
1541 | |
1542 if ( (v11 - 14) / 32 == 0 && v7->uTextureWidth < 32) | |
1543 uCellX += (32 - v7->uTextureWidth) / 2; | |
1544 v13 = v11 - 14; | |
1545 LOBYTE(v13) = v13 & 0xE0; | |
1546 v15 = v13 + 32; | |
1547 v14 = v7->uTextureHeight; | |
1548 if (v14 < 14 ) | |
1549 v14 = 14; | |
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 { | |
1556 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; | |
1558 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; | |
1560 } | |
1561 | |
1562 _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; | |
1563 if (_50C9A8_item_enchantment_timer <= 0) | |
1564 { | |
1565 _50C9A8_item_enchantment_timer = 0; | |
1566 LOBYTE(item->uAttributes) &= 0xF; | |
1567 ptr_50C9A4 = 0; | |
1568 } | |
1569 | |
1455 | 1570 pRenderer->DrawAura(uCellX, uCellY, v7, pTexture, GetTickCount() * 0.1, 0, 255); |
1298 | 1571 ZBuffer_Fill(&pRenderer->pActiveZBuffer[v17], item_texture_id, item_idx); |
1572 } | |
1573 else | |
1574 { | |
1575 if (item->Identified() || pCurrentScreen != SCREEN_HOUSE) | |
1576 { | |
1577 if (item->Broken()) | |
1578 pRenderer->DrawTransparentRedShade(uCellX, uCellY, v7); | |
1579 else | |
1580 pRenderer->DrawTextureTransparent(uCellX, uCellY, v7); | |
1581 } | |
1582 else | |
1583 pRenderer->DrawTransparentGreenShade(uCellX, uCellY, v7); | |
1584 | |
1585 ZBuffer_Fill(&pRenderer->pActiveZBuffer[v17], item_texture_id, item_idx); | |
1586 continue; | |
1587 } | |
1588 } | |
1589 } | |
1590 | |
1591 | |
1592 | |
1593 static void CharacterUI_DrawItem(int x, int y, ItemGen *item, int id) | |
1594 { | |
1595 auto item_texture = pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[item->uItemID].pIconName, TEXTURE_16BIT_PALETTE); | |
1596 | |
1597 if (item->uAttributes & 0xF0) // enchant animation | |
1598 { | |
1599 Texture *enchantment_texture = nullptr; | |
1600 switch (item->uAttributes & 0xF0) | |
1601 { | |
1602 case ITEM_AURA_EFFECT_RED: enchantment_texture = pIcons_LOD->LoadTexturePtr("sptext01", TEXTURE_16BIT_PALETTE); break; | |
1603 case ITEM_AURA_EFFECT_BLUE: enchantment_texture = pIcons_LOD->LoadTexturePtr("sp28a", TEXTURE_16BIT_PALETTE); break; | |
1604 case ITEM_AURA_EFFECT_GREEN: enchantment_texture = pIcons_LOD->LoadTexturePtr("sp30a", TEXTURE_16BIT_PALETTE); break; | |
1605 case ITEM_AURA_EFFECT_PURPLE: enchantment_texture = pIcons_LOD->LoadTexturePtr("sp91a", TEXTURE_16BIT_PALETTE); break; | |
1606 } | |
1607 | |
1608 _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; | |
1609 if (_50C9A8_item_enchantment_timer <= 0) | |
1610 { | |
1611 _50C9A8_item_enchantment_timer = 0; | |
1612 item->uAttributes &= 0xFFFFFF0F; | |
1613 ptr_50C9A4 = 0; | |
1614 } | |
1455 | 1615 pRenderer->DrawAura(x, y, item_texture, enchantment_texture, GetTickCount() * 0.1, 0, 255); |
1298 | 1616 } |
1617 else | |
1618 { | |
1619 if (item->Broken()) | |
1620 pRenderer->DrawTransparentRedShade(x, y, item_texture); | |
1621 else if (!item->Identified()) | |
1622 pRenderer->DrawTransparentGreenShade(x, y, item_texture); | |
1623 else | |
1624 pRenderer->DrawTextureTransparent(x, y, item_texture); | |
1625 | |
1626 pRenderer->ZBuffer_Fill_2(x, y, item_texture, id); | |
1627 } | |
1628 } | |
1629 | |
1630 | |
1631 //----- (0043E825) -------------------------------------------------------- | |
1632 void CharacterUI_DrawPaperdollWithRingOverlay(Player *player) | |
1633 { | |
1634 CharacterUI_DrawPaperdoll(player); | |
1635 | |
1636 pRenderer->DrawTextureTransparent(0x1D9u, 0, pIcons_LOD->GetTexture(uTextureID_BACKHAND)); | |
1637 pRenderer->DrawTextureTransparent(0x1D4u, 0, pIcons_LOD->GetTexture(uTextureID_right_panel_loop)); | |
1638 pRenderer->DrawTextureIndexed(pCharacterScreen_DetalizBtn->uX, | |
1639 pCharacterScreen_DetalizBtn->uY, | |
1640 pIcons_LOD->GetTexture(uTextureID_detaliz_close_button)); | |
1641 | |
1642 for (uint i = 0; i < 6; ++i) | |
1643 { | |
1644 if (!player->pEquipment.uRings[i]) | |
1645 continue; | |
1646 | |
1647 static int pPaperdollRingsX[6] = {0x1EA, 0x21A, 0x248, 0x1EA, 0x21A, 0x248}; | |
1648 static int pPaperdollRingsY[6] = {0x0CA, 0x0CA, 0x0CA, 0x0FA, 0x0FA, 0x0FA}; | |
1649 | |
1650 CharacterUI_DrawItem(pPaperdollRingsX[i], | |
1651 pPaperdollRingsY[i], | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1365
diff
changeset
|
1652 &player->pInventoryItemList[player->pEquipment.uRings[i] - 1], |
1298 | 1653 player->pEquipment.uRings[i]); |
1654 } | |
1655 | |
1656 | |
1657 if (player->pEquipment.uAmulet) | |
1658 { | |
1659 CharacterUI_DrawItem(493, 91, | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1365
diff
changeset
|
1660 &player->pInventoryItemList[player->pEquipment.uAmulet - 1], |
1298 | 1661 player->pEquipment.uAmulet); |
1662 } | |
1663 | |
1664 if (player->pEquipment.uGlove) | |
1665 { | |
1666 CharacterUI_DrawItem(586, 88, | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1365
diff
changeset
|
1667 &player->pInventoryItemList[player->pEquipment.uGlove - 1], |
1298 | 1668 player->pEquipment.uGlove); |
1669 } | |
1670 } | |
1671 | |
1672 //----- (0043BCA7) -------------------------------------------------------- | |
1673 void CharacterUI_LoadPaperdollTextures() | |
1674 { | |
1675 int v0; // edi@7 | |
1676 enum CHARACTER_RACE pRace; // ebx@7 | |
1677 signed int pSex; // eax@7 | |
1678 int v3; // ebx@10 | |
1679 Player *pPlayer; // edi@12 | |
1680 unsigned __int8 v5; // cl@12 | |
1681 int v6; // edi@16 | |
1682 unsigned int v7; // eax@16 | |
1683 Player *pPlayer2; // ebx@16 | |
1684 char *v9; // ebx@16 | |
1685 char v10; // al@16 | |
1686 signed int v11; // edi@21 | |
1687 unsigned int v22; // eax@76 | |
1688 int v23; // ecx@76 | |
1689 unsigned int v24; // eax@78 | |
1690 int v25; // ecx@78 | |
1691 int v26; // ebx@79 | |
1692 unsigned int v27; // eax@80 | |
1693 int v28; // ecx@80 | |
1694 int v30; // [sp+10h] [bp-28h]@5 | |
1695 signed int v32; // [sp+10h] [bp-28h]@75 | |
1696 signed int v33; // [sp+10h] [bp-28h]@77 | |
1697 int v34; // [sp+10h] [bp-28h]@79 | |
1698 int pItemTXTNum; // [sp+14h] [bp-24h]@75 | |
1699 int v37; // [sp+14h] [bp-24h]@77 | |
1700 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 | |
1704 | |
1705 uTextureID_MAGNIF_B = pIcons_LOD->LoadTexture("MAGNIF-B", TEXTURE_16BIT_PALETTE); | |
1706 //if ( !pParty->uAlignment || pParty->uAlignment == 1 || pParty->uAlignment == 2 ) | |
1707 uTextureID_BACKDOLL = pIcons_LOD->LoadTexture("BACKDOLL", TEXTURE_16BIT_PALETTE); | |
1708 uTextureID_right_panel_loop = uTextureID_right_panel; | |
1709 v30 = 0; | |
1710 uTextureID_BACKHAND = pIcons_LOD->LoadTexture("BACKHAND", TEXTURE_16BIT_PALETTE); | |
1711 uTextureID_detaliz_close_button = uExitCancelTextureId; | |
1712 do | |
1713 { | |
1714 v42 = v30 + 1; | |
1715 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(v30 + 1) ) | |
1716 { | |
1717 v0 = v30; | |
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 | |
1723 v3 = (pSex != 0) + 1; | |
1724 wsprintfA(pContainer, "pc23v%dBod", v3); | |
1725 papredoll_dbods[v0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);//Body texture | |
1726 wsprintfA(pContainer, "pc23v%dlad", v3); | |
1727 papredoll_dlads[v0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);// Left Hand | |
1728 wsprintfA(pContainer, "pc23v%dlau", v3); | |
1729 papredoll_dlaus[v0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);// Left Hand2 | |
1730 wsprintfA(pContainer, "pc23v%drh", v3); | |
1731 papredoll_drhs[v0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);// Right Hand | |
1732 wsprintfA(pContainer, "pc23v%dlh", v3); | |
1733 papredoll_dlhs[v0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);// Left Fist | |
1734 wsprintfA(pContainer, "pc23v%dlhu", v3); | |
1735 papredoll_dlhus[v0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); // Left Fist 2 | |
1736 pPlayer = pPlayers[v0 + 1]; | |
1737 v5 = pPlayer->uCurrentFace; | |
1738 if ( v5 == 12 || v5 == 13 ) | |
1739 papredoll_dbrds[(char)v5] = 0; | |
1740 papredoll_flying_feet[pPlayer->uCurrentFace] = 0; | |
1741 IsPlayerWearingWatersuit[v30 + 1] = 1; | |
1742 } | |
1743 else | |
1744 { | |
1745 papredoll_dbods[v30] = pIcons_LOD->LoadTexture(dbod_texnames_by_face[pPlayers[v30 + 1]->uCurrentFace], TEXTURE_16BIT_PALETTE); | |
1746 papredoll_dlads[v30] = pIcons_LOD->LoadTexture(dlad_texnames_by_face[pPlayers[v30 + 1]->uCurrentFace], TEXTURE_16BIT_PALETTE); | |
1747 papredoll_dlaus[v30] = pIcons_LOD->LoadTexture(dlau_texnames_by_face[pPlayers[v30 + 1]->uCurrentFace], TEXTURE_16BIT_PALETTE); | |
1748 papredoll_drhs[v30] = pIcons_LOD->LoadTexture(drh_texnames_by_face[pPlayers[v30 + 1]->uCurrentFace], TEXTURE_16BIT_PALETTE); | |
1749 papredoll_dlhs[v30] = pIcons_LOD->LoadTexture(dlh_texnames_by_face[pPlayers[v30 + 1]->uCurrentFace], TEXTURE_16BIT_PALETTE); | |
1750 papredoll_dlhus[v30] = pIcons_LOD->LoadTexture(dlhu_texnames_by_face[pPlayers[v30 + 1]->uCurrentFace], TEXTURE_16BIT_PALETTE); | |
1751 v10 = pPlayers[v30 + 1]->uCurrentFace; | |
1752 if ( v10 == 12 || v10 == 13 ) | |
1753 { | |
1754 wsprintfA(pContainer, "pc%02dbrd", v10 + 1); | |
1755 papredoll_dbrds[v10] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
1756 } | |
1757 wsprintfA(pContainer, "item281pc%02d", v10 + 1); | |
1758 papredoll_flying_feet[pPlayers[v30 + 1]->uCurrentFace] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
1759 IsPlayerWearingWatersuit[v30 + 1] = 0; | |
1760 } | |
1761 ++v30; | |
1762 } | |
1763 while ( v42 < 4 ); | |
1764 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); | |
1766 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); | |
1768 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); | |
1770 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); | |
1772 papredoll_dbrds[1] = pIcons_LOD->LoadTexture("ib-cd5-d", TEXTURE_16BIT_PALETTE); | |
1773 for ( v11 = 0; v11 < 54; ++v11 )// test equipment | |
1774 { | |
1775 party_has_equipment[v11] = 0; | |
1776 if ( pParty->pPickedItem.uItemID != v11 + 66 ) | |
1777 { | |
1778 for ( uint i = 0; i < 4; ++i) | |
1779 { | |
1780 if ( Player_has_item(v11 + 66, &pParty->pPlayers[i], 0) ) | |
1781 party_has_equipment[v11] = 1; | |
1782 } | |
1783 } | |
1784 } | |
1785 memset(byte_5111F6.data(), 0, 16); | |
1786 for (uint i = 0; i < 4; ++i) | |
1787 { | |
1788 auto player = pParty->pPlayers + i; | |
1789 | |
1790 if (Player_has_item(ITEM_ARTICACT_GOVERNONS_ARMOR, player, 1)) byte_5111F6[0] = 1; | |
1791 if (Player_has_item(ITEM_ARTIFACT_YORUBA, player, 1)) byte_5111F6[1] = 1; | |
1792 if (Player_has_item(ITEM_RELIC_HARECS_LEATHER, player, 1)) byte_5111F6[2] = 1; | |
1793 if (Player_has_item(ITEM_ARTIFACT_LEAGUE_BOOTS, player, 1)) byte_5111F6[3] = 1; | |
1794 if (Player_has_item(ITEM_RELIC_TALEDONS_HELM, player, 1)) byte_5111F6[4] = 1; | |
1795 if (Player_has_item(ITEM_RELIC_SCHOLARS_CAP, player, 1)) byte_5111F6[5] = 1; | |
1796 if (Player_has_item(ITEM_RELIC_PHYNAXIAN_CROWN, player, 1)) byte_5111F6[6] = 1; | |
1797 if (Player_has_item(ITEM_ARTIFACT_MINDS_EYE, player, 1)) byte_5111F6[7] = 1; | |
1798 if (Player_has_item(ITEM_RARE_SHADOWS_MASK, player, 1)) byte_5111F6[8] = 1; | |
1799 if (Player_has_item(ITEM_RILIC_TITANS_BELT, player, 1)) byte_5111F6[9] = 1; | |
1800 if (Player_has_item(ITEM_ARTIFACT_HEROS_BELT, player, 1)) byte_5111F6[10] = 1; | |
1801 if (Player_has_item(ITEM_RELIC_TWILIGHT, player, 1)) byte_5111F6[11] = 1; | |
1802 if (Player_has_item(ITEM_ARTIFACT_CLOAK_OF_THE_SHEEP, player, 1)) byte_5111F6[12] = 1; | |
1803 if (Player_has_item(ITEM_RARE_SUN_CLOAK, player, 1)) byte_5111F6[13] = 1; | |
1804 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; | |
1806 if (Player_has_item(ITEM_ELVEN_CHAINMAIL, player, 1)) byte_5111F6[16] = 1; | |
1807 } | |
1808 | |
1809 | |
1810 for (uint i = 0; i < 2; ++i) | |
1811 { | |
1812 for ( uint j = 0; j < 5; ++j )//Belt | |
1813 { | |
1814 GetItemTextureFilename(pContainer, j + 100, i + 1, 0); | |
1815 paperdoll_belt_texture[i][j] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
1816 } | |
1817 GetItemTextureFilename(pContainer, 535, i + 1, 0); | |
1818 paperdoll_belt_texture[i][6] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
1819 for ( uint j = 0; j < 11; ++j )//Helm | |
1820 { | |
1821 GetItemTextureFilename(pContainer, j + 89, i + 1, 0); | |
1822 paperdoll_helm_texture[i][j] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
1823 } | |
1824 GetItemTextureFilename(pContainer, 521, i + 1, 0); | |
1825 paperdoll_helm_texture[i][11] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
1826 GetItemTextureFilename(pContainer, 522, i + 1, 0); | |
1827 paperdoll_helm_texture[i][12] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
1828 GetItemTextureFilename(pContainer, 523, i + 1, 0); | |
1829 paperdoll_helm_texture[i][13] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
1830 GetItemTextureFilename(pContainer, 532, i + 1, 0); | |
1831 paperdoll_helm_texture[i][14] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
1832 GetItemTextureFilename(pContainer, 544, i + 1, 0); | |
1833 paperdoll_helm_texture[i][15] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
1834 if ( _43ED6F_check_party_races(true) ) | |
1835 papredoll_dbrds[11] = pIcons_LOD->LoadTexture("item092v3", TEXTURE_16BIT_PALETTE); | |
1836 } | |
1837 v43 = 0; | |
1838 for (uint i = 0; i < 4; ++i) | |
1839 { | |
1840 if ( sub_43EDB9_get_some_race_sex_relation_2(i) ) | |
1841 { | |
1842 GetItemTextureFilename(pContainer, 524, i + 1, 0); | |
1843 paperdoll_belt_texture[i][5] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);//Titans belt | |
1844 pItemTXTNum = 66; | |
1845 for ( v32 = 0; v32 < 13; ++v32 )//simple armor | |
1846 { | |
1847 GetItemTextureFilename(pContainer, pItemTXTNum, i + 1, 0); | |
1848 paperdoll_armor_texture[i][v32][0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
1849 GetItemTextureFilename(pContainer, pItemTXTNum, i + 1, 1); | |
1850 paperdoll_armor_texture[i][v32][1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
1851 GetItemTextureFilename(pContainer, pItemTXTNum, i + 1, 2); | |
1852 paperdoll_armor_texture[i][v32][2] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
1853 pItemTXTNum++; | |
1854 } | |
1855 GetItemTextureFilename(pContainer, 516, i + 1, 0);//artefacts | |
1856 paperdoll_armor_texture[i][v32][0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
1857 GetItemTextureFilename(pContainer, 516, i + 1, 1); | |
1858 paperdoll_armor_texture[i][v32][1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
1859 GetItemTextureFilename(pContainer, 516, i + 1, 2); | |
1860 paperdoll_armor_texture[i][v32][2] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
1861 GetItemTextureFilename(pContainer, 505, i + 1, 0); | |
1862 paperdoll_armor_texture[i][v32 + 1][0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
1863 GetItemTextureFilename(pContainer, 505, i + 1, 1); | |
1864 paperdoll_armor_texture[i][v32 + 1][1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
1865 GetItemTextureFilename(pContainer, 505, i + 1, 2); | |
1866 paperdoll_armor_texture[i][v32 + 1][2] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
1867 GetItemTextureFilename(pContainer, 504, i + 1, 0); | |
1868 paperdoll_armor_texture[i][v32 + 2][0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
1869 GetItemTextureFilename(pContainer, 504, i + 1, 1); | |
1870 paperdoll_armor_texture[i][v32 + 2][1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
1871 GetItemTextureFilename(pContainer, 504, i + 1, 2); | |
1872 paperdoll_armor_texture[i][v32 + 2][2] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
1873 GetItemTextureFilename(pContainer, 533, i + 1, 0); | |
1874 paperdoll_armor_texture[i][v32 + 3][0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
1875 GetItemTextureFilename(pContainer, 533, i + 1, 1); | |
1876 paperdoll_armor_texture[i][v32 + 3][1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
1877 GetItemTextureFilename(pContainer, 533, i + 1, 2); | |
1878 paperdoll_armor_texture[i][v32 + 3][2] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
1879 for ( v33 = 0; v33 < 5; ++v33 )//boots | |
1880 { | |
1881 GetItemTextureFilename(pContainer, v33 + 115, i + 1, 0); | |
1882 paperdoll_boots_texture[i][v33] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
1883 } | |
1884 GetItemTextureFilename(pContainer, 512, i + 1, 0); | |
1885 paperdoll_boots_texture[i][v33] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
1886 for ( v38 = 0; v38 < 5; ++v38 )//Cloak | |
1887 { | |
1888 GetItemTextureFilename(pContainer, v38 + 105, i + 1, 0); | |
1889 paperdoll_cloak_texture[i][v38] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
1890 GetItemTextureFilename(pContainer, v38 + 105, i + 1, 1); | |
1891 paperdoll_cloak_collar_texture[i][v38] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
1892 } | |
1893 GetItemTextureFilename(pContainer, 525, i + 1, 0); | |
1894 paperdoll_cloak_texture[i][5] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
1895 GetItemTextureFilename(pContainer, 530, i + 1, 0); | |
1896 paperdoll_cloak_texture[i][6] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
1897 GetItemTextureFilename(pContainer, 547, i + 1, 0); | |
1898 paperdoll_cloak_texture[i][7] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
1899 GetItemTextureFilename(pContainer, 548, i + 1, 0); | |
1900 paperdoll_cloak_texture[i][8] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
1901 GetItemTextureFilename(pContainer, 550, i + 1, 0); | |
1902 paperdoll_cloak_texture[i][9] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
1903 GetItemTextureFilename(pContainer, 525, i + 1, 1); | |
1904 paperdoll_cloak_collar_texture[i][5] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
1905 GetItemTextureFilename(pContainer, 530, i + 1, 1); | |
1906 paperdoll_cloak_collar_texture[i][6] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
1907 GetItemTextureFilename(pContainer, 547, i + 1, 1); | |
1908 paperdoll_cloak_collar_texture[i][7] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
1909 GetItemTextureFilename(pContainer, 548, i + 1, 1); | |
1910 paperdoll_cloak_collar_texture[i][8] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
1911 GetItemTextureFilename(pContainer, 550, i + 1, 1); | |
1912 paperdoll_cloak_collar_texture[i][9] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
1913 } | |
1914 else | |
1915 { | |
1916 v26 = v43; | |
1917 } | |
1918 v43 = v26 + 40; | |
1919 } | |
1920 } | |
1921 | |
1922 //----- (00419401) -------------------------------------------------------- | |
1923 void CharacterUI_SkillsTab_CreateButtons() | |
1924 { | |
1925 // unsigned int v0; // ecx@3 | |
1926 GUIButton *pButton; // eax@3 | |
1927 unsigned int current_Y; // esi@8 | |
1928 int buttons_count; // [sp+10h] [bp-14h]@1 | |
1929 int first_rows; // [sp+14h] [bp-10h]@19 | |
1930 int skill_id; // [sp+18h] [bp-Ch]@8 | |
1931 Player *curr_player; // [sp+1Ch] [bp-8h]@8 | |
1932 int i; | |
1933 int uCurrFontHeght; | |
1934 | |
1935 buttons_count = 0; | |
1936 if ( dword_507CC0_activ_ch ) | |
1937 CharacterUI_ReleaseButtons(); | |
1938 dword_507CC0_activ_ch = uActiveCharacter; | |
1939 for ( pButton = pGUIWindow_CurrentMenu->pControlsHead; pButton; pButton = pButton->pNext ) | |
1940 { | |
1941 if ( pButton->msg == UIMSG_InventoryLeftClick ) | |
1942 { | |
1943 dword_50698C_uX = pButton->uX; | |
1944 dword_506988_uY = pButton->uY; | |
1945 dword_506984_uZ = pButton->uZ; | |
1946 dword_506980_uW = pButton->uW; | |
1947 pButton->uW = 0; | |
1948 pButton->uZ = 0; | |
1949 pButton->uY = 0; | |
1950 pButton->uX = 0; | |
1951 } | |
1952 } | |
1953 first_rows = 0; | |
1954 // a5 = pGUIWindow_CurrentMenu->uNumControls; | |
1955 curr_player = &pParty->pPlayers[uActiveCharacter-1]; | |
1956 | |
1957 uCurrFontHeght=pFontLucida->uFontHeight; | |
1958 current_Y = 2 *uCurrFontHeght + 13; | |
1959 for(i=0; i<9;++i) | |
1960 { | |
1961 skill_id = pWeaponSkills[i]; | |
1962 if ( curr_player->pActiveSkills[skill_id] & 0x3F ) | |
1963 { | |
1964 current_Y += uCurrFontHeght - 3; | |
1965 ++buttons_count; | |
1966 ++first_rows; | |
1967 pGUIWindow_CurrentMenu->CreateButton(24, current_Y, 204, uCurrFontHeght - 3, 3, skill_id | 0x8000, UIMSG_SkillUp, skill_id, 0, "", 0, 0); | |
1968 } | |
1969 } | |
1970 if ( !first_rows ) | |
1971 current_Y += uCurrFontHeght - 3; | |
1972 current_Y += 2 * uCurrFontHeght - 6; | |
1973 for(i=0; i<9;++i) | |
1974 { | |
1975 skill_id = pMagicSkills[i]; | |
1976 if ( curr_player->pActiveSkills[skill_id] & 0x3F && buttons_count < 15 ) | |
1977 { | |
1978 current_Y += uCurrFontHeght - 3; | |
1979 ++buttons_count; | |
1980 pGUIWindow_CurrentMenu->CreateButton(24, current_Y, 204, uCurrFontHeght - 3, 3, skill_id | 0x8000, UIMSG_SkillUp, skill_id, 0, "", 0, 0); | |
1981 } | |
1982 } | |
1983 first_rows = 0; | |
1984 current_Y = 2 * uCurrFontHeght + 13; | |
1985 for(i=0; i<5;++i) | |
1986 { | |
1987 skill_id = pArmorSkills[i]; | |
1988 if ( curr_player->pActiveSkills[skill_id] & 0x3F ) | |
1989 { | |
1990 current_Y+= uCurrFontHeght - 3; | |
1991 ++buttons_count; | |
1992 ++first_rows; | |
1993 pGUIWindow_CurrentMenu->CreateButton(246, current_Y, 204, uCurrFontHeght - 3, 3, skill_id | 0x8000, UIMSG_SkillUp, skill_id, 0, "", 0, 0); | |
1994 } | |
1995 } | |
1996 if ( !first_rows ) | |
1997 current_Y += uCurrFontHeght - 3; | |
1998 current_Y += 2 * uCurrFontHeght - 6; | |
1999 for(i=0; i<12; ++i) | |
2000 { | |
2001 skill_id = pMiscSkills[i]; | |
2002 if ( curr_player->pActiveSkills[skill_id] & 0x3F ) | |
2003 { | |
2004 current_Y += uCurrFontHeght - 3; | |
2005 ++buttons_count; | |
2006 pGUIWindow_CurrentMenu->CreateButton(246, current_Y, 204, uCurrFontHeght - 3, 3, skill_id | 0x8000, UIMSG_SkillUp, skill_id, 0, "", 0, 0); | |
2007 } | |
2008 } | |
2009 | |
2010 if ( buttons_count ) | |
2011 pGUIWindow_CurrentMenu->_41D08F_set_keyboard_control_group(buttons_count, 1, 0, pGUIWindow_CurrentMenu->uNumControls); | |
2012 } | |
2013 | |
2014 | |
2015 | |
2016 //----- (00418511) -------------------------------------------------------- | |
2017 void CharacterUI_StatsTab_Draw( Player *player ) | |
2018 { | |
2019 //Player *pPlayer; // edi@1 | |
2020 //unsigned int v4; // eax@2 | |
2021 int v7; // ebp@4 | |
2022 int v8; // eax@4 | |
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)); | |
2099 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" | |
2101 strcat(pTmpBuf.data(), pTmpBuf2.data()); | |
2102 sprintfex(pTmpBuf2.data(), "\f00000\r180%s: \f%05d%d\f00000\n\n\n", | |
2103 pGlobalTXT_LocalizationStrings[207], // "Skill points" | |
2104 player->uSkillPoints ? ui_character_bonus_text_color : ui_character_default_text_color, | |
2105 player->uSkillPoints); | |
2106 strcat(pTmpBuf.data(), pTmpBuf2.data()); | |
2107 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, 18, 0, pTmpBuf.data(), 0, 0, 0); | |
2108 | |
2109 v10 = 53; | |
2110 v7 = player->GetBaseStrength(); | |
2111 v8 = player->GetActualMight(); | |
2112 v9 = UI_GetHealthManaStringColor(v8, v7); | |
2113 sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[144], v9, v8, v7);//Might | |
2114 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf.data(), 0, 0, 0); | |
2115 | |
2116 v10 += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2117 v13 = player->GetBaseIntelligence(); | |
2118 v14 = player->GetActualIntelligence(); | |
2119 v15 = UI_GetHealthManaStringColor(v14, v13); | |
2120 sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[116], v15, v14, v13);//Intellect | |
2121 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf.data(), 0, 0, 0); | |
2122 | |
2123 v10 += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2124 v19 = player->GetBaseWillpower(); | |
2125 v20 = player->GetActualWillpower(); | |
2126 v21 = UI_GetHealthManaStringColor(v20, v19); | |
2127 sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[163], v21, v20, v19);// | |
2128 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf.data(), 0, 0, 0); | |
2129 | |
2130 v10 += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2131 v25 = player->GetBaseEndurance(); | |
2132 v26 = player->GetActualEndurance(); | |
2133 v27 = UI_GetHealthManaStringColor(v26, v25); | |
2134 sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[75], v27, v26, v25);// | |
2135 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf.data(), 0, 0, 0); | |
2136 | |
2137 v10 += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2138 v31 = player->GetBaseAccuracy(); | |
2139 v32 = player->GetActualAccuracy(); | |
2140 v33 = UI_GetHealthManaStringColor(v32, v31); | |
2141 sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[1], v33, v32, v31); | |
2142 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf.data(), 0, 0, 0); | |
2143 | |
2144 v10 += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2145 v37 = player->GetBaseSpeed(); | |
2146 v38 = player->GetActualSpeed(); | |
2147 v39 = UI_GetHealthManaStringColor(v38, v37); | |
2148 sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[211], v39, v38, v37); | |
2149 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf.data(), 0, 0, 0); | |
2150 | |
2151 v10 += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2152 v43 = player->GetBaseLuck(); | |
2153 v44 = player->GetActualLuck(); | |
2154 v45 = UI_GetHealthManaStringColor(v44, v43); | |
2155 sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n\n", pGlobalTXT_LocalizationStrings[136], v45, v44, v43); | |
2156 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf.data(), 0, 0, 0); | |
2157 | |
2158 a2 = "%s\f%05u\r424%d\f00000 /\t185%d\n"; | |
2159 v10 += 2 * LOBYTE(pFontArrus->uFontHeight) + 5; | |
2160 if ( player->GetMaxHealth() >= 1000 ) | |
2161 a2 = "%s\f%05u\r388%d\f00000 / %d\n"; | |
2162 v49 = player->GetMaxHealth(); | |
2163 v50 = UI_GetHealthManaStringColor(player->sHealth, v49); | |
2164 sprintf(pTmpBuf.data(), a2, pGlobalTXT_LocalizationStrings[108], v50, player->sHealth, v49); | |
2165 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf.data(), 0, 0, 0); | |
2166 | |
2167 a2a = "%s\f%05u\r424%d\f00000 /\t185%d\n"; | |
2168 v10 += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2169 if ( player->GetMaxMana() >= 1000 ) | |
2170 a2a = "%s\f%05u\r388%d\f00000 / %d\n"; | |
2171 v53 = player->GetMaxMana(); | |
2172 v54 = UI_GetHealthManaStringColor(player->sMana, v53); | |
2173 sprintf(pTmpBuf.data(), a2a, pGlobalTXT_LocalizationStrings[212], v54, player->sMana, v53); | |
2174 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf.data(), 0, 0, 0); | |
2175 | |
2176 v10 += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2177 v58 = player->GetBaseAC(); | |
2178 v59 = player->GetActualAC(); | |
2179 v60 = UI_GetHealthManaStringColor(v59, v58); | |
2180 sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n\n", pGlobalTXT_LocalizationStrings[12], v60, v59, v58); | |
2181 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf.data(), 0, 0, 0); | |
2182 | |
2183 v10 += 2 * LOBYTE(pFontArrus->uFontHeight) - 2; | |
2184 v62 = player->GetMajorConditionIdx(); | |
2185 v64 = GetConditionDrawColor(v62); | |
2186 sprintf(pTmpBuf.data(), "%s: \f%05d%s\n", pGlobalTXT_LocalizationStrings[47], v64, aCharacterConditionNames[v62]); | |
2187 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x1Au, v10, 0, pTmpBuf.data(), 226, 0); | |
2188 | |
2189 v10 += LOBYTE(pFontArrus->uFontHeight) + - 1; | |
2190 if (player->uQuickSpell) | |
2191 v67 = pSpellStats->pInfos[player->uQuickSpell].pShortName; | |
2192 else | |
2193 v67 = pGlobalTXT_LocalizationStrings[153]; | |
2194 sprintf(pTmpBuf.data(), "%s: %s", pGlobalTXT_LocalizationStrings[172], v67); | |
2195 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x1Au, v10, 0, pTmpBuf.data(), 226, 0); | |
2196 | |
2197 v10 = 50; | |
2198 v70 = player->GetBaseAge(); | |
2199 v71 = player->GetActualAge(); | |
2200 v72 = UI_GetHealthManaStringColor(v71, v70); | |
2201 sprintf(pTmpBuf.data(), "%s\f%05u\t100%d\f00000 / %d\n", pGlobalTXT_LocalizationStrings[5], v72, v71, v70); | |
2202 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf.data(), 0, 0, 0); | |
2203 | |
2204 a2b = "%s\f%05u\t100%d\f00000 / %d\n"; | |
2205 v10 += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2206 if ( player->GetBaseLevel() > 99 ) | |
2207 a2b = "%s\f%05u\t180%d\f00000 / %d\n"; | |
2208 v75 = player->GetBaseLevel(); | |
2209 v76 = player->GetActualLevel(); | |
2210 v77 = UI_GetHealthManaStringColor(v76, v75); | |
2211 sprintf(pTmpBuf.data(), a2b, pGlobalTXT_LocalizationStrings[131], v77, v76, v75); | |
2212 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf.data(), 0, 0, 0); | |
2213 | |
2214 v10 += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2215 if (player->uExperience <= 9999999) | |
2216 v78 = pGlobalTXT_LocalizationStrings[83]; // "Experience" | |
2217 else | |
2218 v78 = pGlobalTXT_LocalizationStrings[17]; // "Exp." | |
2219 v81 = player->GetExperienceDisplayColor(); | |
2220 sprintf(pTmpBuf.data(), "%s\r180\f%05d%lu\f00000\n\n", v78, v81, LODWORD(player->uExperience)); | |
2221 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf.data(), 0, 0, 0); | |
2222 | |
2223 v10 += 2 * LOBYTE(pFontArrus->uFontHeight); | |
2224 v83 = player->GetActualAttack(0); | |
2225 sprintf(pTmpBuf.data(), "%s\t100%+d\n", pGlobalTXT_LocalizationStrings[18], v83); | |
2226 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf.data(), 0, 0, 0); | |
2227 | |
2228 v10 += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2229 v85 = player->GetMeleeDamageString(); | |
2230 sprintf(pTmpBuf.data(), "%s\t100 %s\n", pGlobalTXT_LocalizationStrings[53], v85); | |
2231 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf.data(), 0, 0, 0); | |
2232 | |
2233 v10 += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2234 v87 = player->GetRangedAttack(); | |
2235 sprintf(pTmpBuf.data(), "%s\t100%+d\n", pGlobalTXT_LocalizationStrings[203], v87); | |
2236 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf.data(), 0, 0, 0); | |
2237 | |
2238 v10 += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2239 v89 = player->GetRangedDamageString(); | |
2240 sprintf(pTmpBuf.data(), "%s\t100 %s\n\n", pGlobalTXT_LocalizationStrings[53], v89); | |
2241 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf.data(), 0, 0, 0); | |
2242 | |
2243 a2c = format_4E2E10; | |
2244 v10 += 2 * LOBYTE(pFontArrus->uFontHeight) - 4; | |
2245 v131 = player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_FIRE); | |
2246 v90 = player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_FIRE); | |
2247 if ( v131 > 99 || v90 > 99 ) | |
2248 a2c = "%s\f%05u\t180%d\f00000 / %d\n"; | |
2249 v92 = UI_GetHealthManaStringColor(v131, v90); | |
2250 sprintf(pTmpBuf.data(), a2c, pGlobalTXT_LocalizationStrings[87], v92, v131, v90); | |
2251 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf.data(), 0, 0, 0); | |
2252 | |
2253 a2d = format_4E2E10; | |
2254 v10 += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2255 v132 = player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_AIR); | |
2256 v93 = player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_AIR); | |
2257 if ( v132 > 99 || v93 > 99 ) | |
2258 a2d = "%s\f%05u\t180%d\f00000 / %d\n"; | |
2259 v95 = UI_GetHealthManaStringColor(v132, v93); | |
2260 sprintf(pTmpBuf.data(), a2d, pGlobalTXT_LocalizationStrings[6], v95, v132, v93); | |
2261 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf.data(), 0, 0, 0); | |
2262 | |
2263 a2e = format_4E2E10; | |
2264 v10 += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2265 v133 = player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_WATER); | |
2266 v96 = player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_WATER); | |
2267 if ( v133 > 99 || v96 > 99 ) | |
2268 a2e = "%s\f%05u\t180%d\f00000 / %d\n"; | |
2269 v98 = UI_GetHealthManaStringColor(v133, v96); | |
2270 sprintf(pTmpBuf.data(), a2e, pGlobalTXT_LocalizationStrings[240], v98, v133, v96); | |
2271 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf.data(), 0, 0, 0); | |
2272 | |
2273 a2f = format_4E2E10; | |
2274 v10 += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2275 v134 = player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_EARTH); | |
2276 v99 = player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_EARTH); | |
2277 if ( v134 > 99 ) | |
2278 a2f = "%s\f%05u\t180%d\f00000 / %d\n"; | |
2279 v101 = UI_GetHealthManaStringColor(v134, v99); | |
2280 sprintf(pTmpBuf.data(), a2f, pGlobalTXT_LocalizationStrings[70], v101, v134, v99); | |
2281 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf.data(), 0, 0, 0); | |
2282 | |
2283 a2g = format_4E2E10; | |
2284 v10 += LOBYTE(pFontArrus->uFontHeight) - 2; | |
2285 v135 = player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_MIND); | |
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 } | |
2313 | |
2314 bool awardSort (int i,int j) { | |
2315 if (pAwards[i].uPriority == 0) //none | |
2316 { | |
2317 return false; | |
2318 } | |
2319 else if (pAwards[j].uPriority == 0) | |
2320 { | |
2321 return true; | |
2322 } | |
2323 else if(pAwards[i].uPriority == 1) //fines,arena stuff,etc | |
2324 { | |
2325 return false; | |
2326 } | |
2327 else if(pAwards[j].uPriority == 1) | |
2328 { | |
2329 return true; | |
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 } | |
2344 | |
2345 //----- (00419100) -------------------------------------------------------- | |
2346 void FillAwardsData() | |
2347 { | |
2348 auto pPlayer = pPlayers[uActiveCharacter]; | |
2349 | |
2350 memset(achieved_awards.data(), 0, 4000); | |
2351 num_achieved_awards = 0; | |
2352 | |
2353 memset(pTmpBuf2.data(), 0, 0x7D0u); | |
2354 BtnDown_flag = 0; | |
2355 BtnUp_flag = 0; | |
1446 | 2356 books_page_number = 0; |
2357 books_primary_item_per_page = 0; | |
1298 | 2358 for (int i = 0; i < 105; ++i) |
2359 { | |
2360 if ( _449B57_test_bit(pPlayer->_guilds_member_bits, i) && pAwards[i].pText ) | |
2361 { | |
2362 achieved_awards[num_achieved_awards++] = (AwardType)i; | |
2363 } | |
2364 } | |
1446 | 2365 full_num_items_in_book = num_achieved_awards; |
1298 | 2366 num_achieved_awards = 0; |
2367 | |
2368 //sort awards index | |
1446 | 2369 if (full_num_items_in_book > 0) |
1298 | 2370 { |
2371 std::stable_sort(achieved_awards.begin(), achieved_awards.end(), awardSort); | |
2372 } | |
2373 } | |
2374 | |
2375 | |
2376 //----- (0043EF2B) -------------------------------------------------------- | |
2377 void WetsuitOn( unsigned int uPlayerID ) | |
2378 { | |
2379 CHARACTER_RACE player_race; // edi@2 | |
2380 signed int player_sex; // eax@2 | |
2381 int texture_num; // ecx@5 | |
2382 char pContainer[20]; // [sp+4h] [bp-1Ch]@7 | |
2383 | |
2384 if ( uPlayerID> 0 ) | |
2385 { | |
2386 player_race = pPlayers[uPlayerID]->GetRace(); | |
2387 player_sex = pPlayers[uPlayerID]->GetSexByVoice(); | |
2388 if ( player_race == CHARACTER_RACE_DWARF ) | |
2389 texture_num = (player_sex != 0) + 3; | |
2390 else | |
2391 texture_num = (player_sex != 0) + 1; | |
2392 wsprintfA(pContainer, "pc23v%dBod", texture_num); | |
2393 papredoll_dbods[uPlayerID - 1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
2394 wsprintfA(pContainer, "pc23v%dlad", texture_num); | |
2395 papredoll_dlads[uPlayerID - 1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
2396 wsprintfA(pContainer, "pc23v%dlau", texture_num); | |
2397 papredoll_dlaus[uPlayerID - 1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
2398 wsprintfA(pContainer, "pc23v%drh", texture_num); | |
2399 papredoll_drhs[uPlayerID - 1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
2400 wsprintfA(pContainer, "pc23v%dlh", texture_num); | |
2401 papredoll_dlhs[uPlayerID - 1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
2402 wsprintfA(pContainer, "pc23v%dlhu", texture_num); | |
2403 papredoll_dlhus[uPlayerID - 1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
2404 | |
2405 if ( pPlayers[uPlayerID]->uCurrentFace == 12 || pPlayers[uPlayerID]->uCurrentFace == 13 ) | |
2406 papredoll_dbrds[pPlayers[uPlayerID]->uCurrentFace] = 0; | |
2407 | |
2408 papredoll_flying_feet[pPlayers[uPlayerID]->uCurrentFace] = 0; | |
2409 IsPlayerWearingWatersuit[uPlayerID] = 1; | |
2410 } | |
2411 } | |
2412 | |
2413 //----- (0043F0BD) -------------------------------------------------------- | |
2414 void WetsuitOff( unsigned int uPlayerID ) | |
2415 { | |
2416 char pContainer[20]; // [sp+0h] [bp-18h]@4 | |
2417 | |
2418 if (uPlayerID > 0 ) | |
2419 { | |
2420 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); | |
2422 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); | |
2424 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); | |
2426 | |
2427 if ( pPlayers[uPlayerID]->uCurrentFace == 12 || pPlayers[uPlayerID]->uCurrentFace == 13 ) | |
2428 { | |
2429 wsprintfA(pContainer, "pc%02dbrd", pPlayers[uPlayerID]->uCurrentFace + 1); | |
2430 papredoll_dbrds[pPlayers[uPlayerID]->uCurrentFace] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
2431 } | |
2432 wsprintfA(pContainer, "item281pc%02d", pPlayers[uPlayerID]->uCurrentFace + 1); | |
2433 papredoll_flying_feet[pPlayers[uPlayerID]->uCurrentFace] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
2434 IsPlayerWearingWatersuit[uPlayerID] = 0; | |
2435 } | |
2436 } | |
2437 //----- (00468F8A) -------------------------------------------------------- | |
2438 void __cdecl OnPaperdollLeftClick() | |
2439 { | |
2440 int v1; // ecx@1 | |
2441 unsigned int v2; // edi@1 | |
2442 unsigned int v3; // edx@4 | |
2443 unsigned int pSkillType; // esi@5 | |
2444 unsigned __int16 v5; // ax@7 | |
2445 unsigned int v6; // edi@19 | |
2446 int v7; // esi@27 | |
1365
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1358
diff
changeset
|
2447 int v8; // eax@29 |
1298 | 2448 int v9; // edx@32 |
2449 int v10; // esi@34 | |
2450 int v11; // eax@34 | |
2451 int v12; // esi@38 | |
2452 int v13; // eax@38 | |
2453 char v14; // zf@38 | |
2454 int v15; // esi@42 | |
2455 int v16; // eax@42 | |
2456 int v17; // eax@44 | |
2457 unsigned int v18; // ecx@55 | |
2458 unsigned int v19; // eax@55 | |
2459 int v20; // esi@60 | |
2460 int v21; // eax@60 | |
2461 unsigned int v22; // eax@61 | |
1365
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1358
diff
changeset
|
2462 int v23; // eax@62 |
1298 | 2463 int v24; // esi@65 |
2464 int v25; // eax@65 | |
1365
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1358
diff
changeset
|
2465 int v26; // eax@69 |
1298 | 2466 int v27; // esi@81 |
2467 int v28; // eax@81 | |
2468 int v29; // esi@84 | |
2469 int v30; // eax@84 | |
2470 int v31; // eax@85 | |
2471 unsigned int v32; // ecx@88 | |
2472 unsigned int v33; // eax@88 | |
2473 int v34; // esi@90 | |
2474 unsigned int v35; // eax@91 | |
2475 int v36; // esi@93 | |
2476 int v37; // edi@93 | |
2477 ItemGen *v38; // edi@93 | |
2478 __int16 v39; // dx@99 | |
2479 ItemGen _this; // [sp+Ch] [bp-40h]@1 | |
2480 unsigned int v48; // [sp+30h] [bp-1Ch]@88 | |
2481 unsigned int v49; // [sp+34h] [bp-18h]@57 | |
2482 unsigned int v50; // [sp+38h] [bp-14h]@50 | |
2483 int v51; // [sp+3Ch] [bp-10h]@1 | |
1365
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1358
diff
changeset
|
2484 int v52; // [sp+40h] [bp-Ch]@5 |
1298 | 2485 //int v53; // [sp+44h] [bp-8h]@1 |
2486 //unsigned int v54; // [sp+48h] [bp-4h]@1 | |
2487 | |
2488 v51 = 0; | |
2489 _this.Reset(); | |
2490 //v0 = pPlayers[uActiveCharacter]; | |
2491 v1 = pPlayers[uActiveCharacter]->pEquipment.uMainHand; | |
2492 v2 = pPlayers[uActiveCharacter]->pEquipment.uShield; | |
2493 //v54 = pPlayers[uActiveCharacter]->pEquipment.uShield; | |
2494 //v53 = v1; | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1365
diff
changeset
|
2495 if ( v1 && pItemsTable->pItems[*(int *)&pPlayers[uActiveCharacter]->pInventoryItemList[v1 - 1]].uEquipType == 1 ) |
1298 | 2496 v51 = v1; |
2497 v3 = pParty->pPickedItem.uItemID; | |
2498 if ( pParty->pPickedItem.uItemID ) | |
2499 { | |
2500 v52 = pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType; | |
2501 pSkillType = pItemsTable->pItems[pParty->pPickedItem.uItemID].uSkillType; | |
2502 if ( pSkillType == 4 ) | |
2503 { | |
2504 if ( v2 ) | |
2505 { | |
2506 LOBYTE(v5) = pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_SPEAR); | |
2507 if ( (signed int)SkillToMastery(v5) < 3 ) | |
2508 { | |
2509 pPlayers[uActiveCharacter]->PlaySound(SPEECH_39, 0); | |
2510 return; | |
2511 } | |
2512 v3 = pParty->pPickedItem.uItemID; | |
2513 } | |
2514 } | |
2515 else | |
2516 { | |
2517 if ( (pSkillType == 8 || pSkillType == 1 || pSkillType == 2) | |
2518 && v1 | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1365
diff
changeset
|
2519 && pItemsTable->pItems[*(int *)&pPlayers[uActiveCharacter]->pInventoryItemList[v1-1]].uSkillType == 4 ) |
1298 | 2520 { |
2521 LOBYTE(v5) = pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_SPEAR); | |
2522 if ( (signed int)SkillToMastery(v5) < 3 ) | |
2523 { | |
2524 pPlayers[uActiveCharacter]->PlaySound(SPEECH_39, 0); | |
2525 return; | |
2526 } | |
2527 } | |
2528 } | |
2529 if ( !pPlayers[uActiveCharacter]->CanEquip_RaceAndAlignmentCheck(v3) ) | |
2530 { | |
2531 | |
2532 pPlayers[uActiveCharacter]->PlaySound(SPEECH_39, 0); | |
2533 return; | |
2534 } | |
1358
61010a655c94
a few itemID changed to their enum values + added a few new ones
Grumpy7
parents:
1299
diff
changeset
|
2535 if ( pParty->pPickedItem.uItemID == ITEM_WETSUIT ) |
1298 | 2536 { |
2537 pPlayers[uActiveCharacter]->EquipBody((ITEM_EQUIP_TYPE)3); | |
2538 WetsuitOn(uActiveCharacter); | |
2539 return; | |
2540 } | |
2541 v6 = v52; | |
2542 switch ( v52 ) | |
2543 { | |
2544 case 2u: | |
2545 case 3u: | |
2546 case 5u: | |
2547 case 6u: | |
2548 case 7u: | |
2549 case 8u: | |
2550 case 9u: | |
2551 case 0xBu: | |
2552 if ( !pPlayers[uActiveCharacter]->HasSkill(pSkillType) ) | |
2553 { | |
2554 pPlayers[uActiveCharacter]->PlaySound(SPEECH_39, 0); | |
2555 return; | |
2556 } | |
2557 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) && (v6 != 3 || bUnderwater) ) | |
2558 { | |
2559 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); | |
2560 return; | |
2561 } | |
2562 pPlayers[uActiveCharacter]->EquipBody((ITEM_EQUIP_TYPE)v6); | |
1358
61010a655c94
a few itemID changed to their enum values + added a few new ones
Grumpy7
parents:
1299
diff
changeset
|
2563 if ( pParty->pPickedItem.uItemID == ITEM_WETSUIT ) |
1298 | 2564 WetsuitOff(uActiveCharacter); |
2565 return; | |
2566 case 0xAu: | |
2567 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) ) | |
2568 { | |
2569 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); | |
2570 return; | |
2571 } | |
2572 v52 = 10; | |
2573 v7 = (int)&pPlayers[uActiveCharacter]->pEquipment.uRings; | |
2574 while ( 1 ) | |
2575 { | |
2576 if ( !*(int *)v7 ) | |
2577 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1365
diff
changeset
|
2578 v8 = pPlayers[uActiveCharacter]->FindFreeInventoryListSlot(); |
1365
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1358
diff
changeset
|
2579 if ( v8 >= 0 ) |
1298 | 2580 { |
2581 v9 = v52; | |
2582 pParty->pPickedItem.uBodyAnchor = v52 + 1; | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1365
diff
changeset
|
2583 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v8], &pParty->pPickedItem, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v8])); |
1298 | 2584 *(&pPlayers[uActiveCharacter]->pEquipment.uShield + v9) = v8 + 1; |
2585 pMouse->RemoveHoldingItem(); | |
2586 break; | |
2587 } | |
2588 } | |
2589 ++v52; | |
2590 v7 += 4; | |
2591 if ( (signed int)v52 > 15 ) | |
2592 break; | |
2593 } | |
2594 if ( v52 == 16 ) | |
2595 { | |
2596 v52 = pPlayers[uActiveCharacter]->pEquipment.uRings[6] - 1; | |
2597 memcpy(&_this, &pParty->pPickedItem, sizeof(_this)); | |
2598 v10 = (int)((char *)pPlayers[uActiveCharacter] + 36 * v52); | |
2599 *(char *)(v10 + 556) = 0; | |
2600 pParty->pPickedItem.Reset(); | |
2601 pParty->SetHoldingItem((ItemGen *)(v10 + 532)); | |
2602 _this.uBodyAnchor = 16; | |
2603 v11 = v52 + 1; | |
2604 memcpy((void *)(v10 + 532), &_this, 0x24u); | |
2605 pPlayers[uActiveCharacter]->pEquipment.uRings[6] = v11; | |
2606 } | |
2607 return; | |
2608 case 4u: | |
2609 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) ) | |
2610 { | |
2611 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); | |
2612 return; | |
2613 } | |
2614 if ( !pPlayers[uActiveCharacter]->HasSkill(pSkillType) ) | |
2615 { | |
2616 pPlayers[uActiveCharacter]->PlaySound(SPEECH_39, 0); | |
2617 return; | |
2618 } | |
2619 if ( v2 ) | |
2620 { | |
2621 --v2; | |
2622 memcpy(&_this, &pParty->pPickedItem, sizeof(_this)); | |
2623 v12 = (int)((char *)pPlayers[uActiveCharacter] + 36 * v2); | |
2624 *(char *)(v12 + 556) = 0; | |
2625 pParty->pPickedItem.Reset(); | |
2626 pParty->SetHoldingItem((ItemGen *)(v12 + 532)); | |
2627 _this.uBodyAnchor = 1; | |
2628 v13 = v2 + 1; | |
2629 v14 = v51 == 0; | |
2630 memcpy((void *)(v12 + 532), &_this, 0x24u); | |
2631 pPlayers[uActiveCharacter]->pEquipment.uShield = v13; | |
2632 if ( v14 ) | |
2633 return; | |
2634 } | |
2635 else | |
2636 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1365
diff
changeset
|
2637 v52 = pPlayers[uActiveCharacter]->FindFreeInventoryListSlot(); |
1365
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1358
diff
changeset
|
2638 if ( v52 < 0 ) |
1298 | 2639 return; |
2640 if ( !v51 ) | |
2641 { | |
2642 pParty->pPickedItem.uBodyAnchor = 1; | |
2643 v17 = v52 + 1; | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1365
diff
changeset
|
2644 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v52], &pParty->pPickedItem, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v52])); |
1298 | 2645 pPlayers[uActiveCharacter]->pEquipment.uShield = v17; |
2646 pMouse->RemoveHoldingItem(); | |
2647 return; | |
2648 } | |
2649 memcpy(&_this, &pParty->pPickedItem, sizeof(_this)); | |
2650 v15 = (int)((char *)pPlayers[uActiveCharacter] + 36 * (v1 - 1)); | |
2651 *(char *)(v15 + 556) = 0; | |
2652 pParty->pPickedItem.Reset(); | |
2653 pParty->SetHoldingItem((ItemGen *)(v15 + 532)); | |
2654 _this.uBodyAnchor = 1; | |
2655 v16 = v52 + 1; | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1365
diff
changeset
|
2656 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v52], &_this, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v52])); |
1298 | 2657 pPlayers[uActiveCharacter]->pEquipment.uShield = v16; |
2658 } | |
2659 pPlayers[uActiveCharacter]->pEquipment.uMainHand = 0; | |
2660 return; | |
2661 case 0u: | |
2662 case 0xCu: | |
2663 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) | |
2664 && pParty->pPickedItem.uItemID != 64 | |
2665 && pParty->pPickedItem.uItemID != 65 ) | |
2666 { | |
2667 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); | |
2668 return; | |
2669 } | |
2670 if ( !pPlayers[uActiveCharacter]->HasSkill(pSkillType) ) | |
2671 { | |
2672 pPlayers[uActiveCharacter]->PlaySound(SPEECH_39, 0); | |
2673 return; | |
2674 } | |
2675 v50 = 0; | |
2676 if ( pSkillType == 2 && (unsigned __int16)(pPlayers[uActiveCharacter]->pActiveSkills[2] & 0xFFC0) | |
2677 || pSkillType == 1 && (signed int)SkillToMastery(pPlayers[uActiveCharacter]->pActiveSkills[1]) >= 3 ) | |
2678 { | |
2679 | |
2680 v18 = pMouse->uMouseClickX; | |
2681 v19 = pMouse->uMouseClickY; | |
2682 | |
2683 v49 = v19; | |
2684 if ( (signed int)v18 >= 560 ) | |
2685 { | |
2686 if ( !v51 ) | |
2687 { | |
2688 if ( v2 ) | |
2689 { | |
2690 --v2; | |
2691 memcpy(&_this, &pParty->pPickedItem, sizeof(_this)); | |
2692 v20 = (int)((char *)pPlayers[uActiveCharacter] + 36 * v2); | |
2693 *(char *)(v20 + 556) = 0; | |
2694 pParty->pPickedItem.Reset(); | |
2695 pParty->SetHoldingItem((ItemGen *)(v20 + 532)); | |
2696 _this.uBodyAnchor = 1; | |
2697 v21 = v2 + 1; | |
2698 v14 = v52 == 12; | |
2699 memcpy((void *)(v20 + 532), &_this, 0x24u); | |
2700 pPlayers[uActiveCharacter]->pEquipment.uShield = v21; | |
2701 if ( !v14 ) | |
2702 return; | |
2703 v22 = _this.uItemID; | |
2704 v50 = v22; | |
2705 if ( v50 ) | |
2706 { | |
2707 __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); | |
2709 } | |
2710 break; | |
2711 } | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1365
diff
changeset
|
2712 v23 = pPlayers[uActiveCharacter]->FindFreeInventoryListSlot(); |
1365
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1358
diff
changeset
|
2713 if ( v23 < 0 ) |
1298 | 2714 return; |
2715 pParty->pPickedItem.uBodyAnchor = 1; | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1365
diff
changeset
|
2716 v50 = (unsigned int)&pPlayers[uActiveCharacter]->pInventoryItemList[v23]; |
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1365
diff
changeset
|
2717 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v23], &pParty->pPickedItem, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v23])); |
1298 | 2718 pPlayers[uActiveCharacter]->pEquipment.uShield = v23 + 1; |
2719 pMouse->RemoveHoldingItem(); | |
2720 if ( v52 != 12 ) | |
2721 return; | |
2722 v22 = *(int *)v50; | |
2723 v50 = v22; | |
2724 if ( v50 ) | |
2725 { | |
2726 __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); | |
2728 } | |
2729 break; | |
2730 } | |
2731 } | |
2732 } | |
2733 if ( !v1 ) | |
2734 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1365
diff
changeset
|
2735 v26 = pPlayers[uActiveCharacter]->FindFreeInventoryListSlot(); |
1365
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1358
diff
changeset
|
2736 if ( v26 < 0 ) |
1298 | 2737 return; |
2738 pParty->pPickedItem.uBodyAnchor = 2; | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1365
diff
changeset
|
2739 v50 = (unsigned int)&pPlayers[uActiveCharacter]->pInventoryItemList[v26]; |
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1365
diff
changeset
|
2740 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v26], &pParty->pPickedItem, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v26])); |
1298 | 2741 pPlayers[uActiveCharacter]->pEquipment.uMainHand = v26 + 1; |
2742 pMouse->RemoveHoldingItem(); | |
2743 if ( v52 != 12 ) | |
2744 return; | |
2745 v22 = *(int *)v50; | |
2746 v50 = v22; | |
2747 if ( v50 ) | |
2748 { | |
2749 __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); | |
2751 } | |
2752 break; | |
2753 } | |
2754 --v1; | |
2755 memcpy(&_this, &pParty->pPickedItem, sizeof(_this)); | |
2756 v24 = (int)((char *)pPlayers[uActiveCharacter] + 36 * v1); | |
2757 *(char *)(v24 + 556) = 0; | |
2758 pParty->pPickedItem.Reset(); | |
2759 pParty->SetHoldingItem((ItemGen *)(v24 + 532)); | |
2760 _this.uBodyAnchor = 2; | |
2761 v25 = v1 + 1; | |
2762 v14 = v52 == 12; | |
2763 memcpy((void *)(v24 + 532), &_this, 0x24u); | |
2764 pPlayers[uActiveCharacter]->pEquipment.uMainHand = v25; | |
2765 if ( v14 ) | |
2766 v50 = _this.uItemID; | |
2767 if ( v51 ) | |
2768 pPlayers[uActiveCharacter]->pEquipment.uShield = 0; | |
2769 if ( v50 ) | |
2770 { | |
2771 __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); | |
2773 } | |
2774 break; | |
2775 case 1u: | |
2776 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) ) | |
2777 { | |
2778 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); | |
2779 return; | |
2780 } | |
2781 if ( !pPlayers[uActiveCharacter]->HasSkill(pSkillType) ) | |
2782 { | |
2783 pPlayers[uActiveCharacter]->PlaySound(SPEECH_39, 0); | |
2784 return; | |
2785 } | |
2786 if ( v1 ) | |
2787 { | |
2788 if ( v2 ) | |
2789 { | |
2790 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); | |
2791 return; | |
2792 } | |
2793 --v1; | |
2794 memcpy(&_this, &pParty->pPickedItem, sizeof(_this)); | |
2795 v27 = (int)((char *)pPlayers[uActiveCharacter] + 36 * v1); | |
2796 *(char *)(v27 + 556) = 0; | |
2797 pParty->pPickedItem.Reset(); | |
2798 pParty->SetHoldingItem((ItemGen *)(v27 + 532)); | |
2799 _this.uBodyAnchor = 2; | |
2800 v28 = v1 + 1; | |
2801 memcpy((void *)(v27 + 532), &_this, 0x24u); | |
2802 pPlayers[uActiveCharacter]->pEquipment.uMainHand = v28; | |
2803 } | |
2804 else | |
2805 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1365
diff
changeset
|
2806 v52 = pPlayers[uActiveCharacter]->FindFreeInventoryListSlot(); |
1365
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1358
diff
changeset
|
2807 if ( v52 >= 0 ) |
1298 | 2808 { |
2809 if ( v2 ) | |
2810 { | |
2811 memcpy(&_this, &pParty->pPickedItem, sizeof(_this)); | |
2812 v29 = (int)((char *)pPlayers[uActiveCharacter] + 36 * (v2 - 1)); | |
2813 *(char *)(v29 + 556) = 0; | |
2814 pParty->pPickedItem.Reset(); | |
2815 pParty->SetHoldingItem((ItemGen *)(v29 + 532)); | |
2816 _this.uBodyAnchor = 2; | |
2817 v30 = v52 + 1; | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1365
diff
changeset
|
2818 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v52], &_this, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v52])); |
1298 | 2819 pPlayers[uActiveCharacter]->pEquipment.uShield = 0; |
2820 pPlayers[uActiveCharacter]->pEquipment.uMainHand = v30; | |
2821 } | |
2822 else | |
2823 { | |
2824 pParty->pPickedItem.uBodyAnchor = 2; | |
2825 v31 = v52 + 1; | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1365
diff
changeset
|
2826 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v52], &pParty->pPickedItem, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v52])); |
1298 | 2827 pPlayers[uActiveCharacter]->pEquipment.uMainHand = v31; |
2828 pMouse->RemoveHoldingItem(); | |
2829 } | |
2830 } | |
2831 } | |
2832 return; | |
2833 default: | |
2834 pPlayers[uActiveCharacter]->UseItem_DrinkPotion_etc(uActiveCharacter, 0); | |
2835 return; | |
2836 } | |
2837 return; | |
2838 } | |
2839 | |
2840 v32 = pMouse->uMouseClickX; | |
2841 v33 = pMouse->uMouseClickY; | |
2842 | |
2843 v34 = pRenderer->pActiveZBuffer[v32 + pSRZBufferLineOffsets[v33]] & 0xFFFF; | |
2844 if ( v34 ) | |
2845 { | |
2846 v36 = v34 - 1; | |
2847 v37 = (int)((char *)pPlayers[uActiveCharacter] + 36 * v36); | |
2848 v50 = v37; | |
2849 v38 = (ItemGen *)(v37 + 532); | |
1358
61010a655c94
a few itemID changed to their enum values + added a few new ones
Grumpy7
parents:
1299
diff
changeset
|
2850 v14 = v38->uItemID == ITEM_WETSUIT; |
1298 | 2851 v52 = pItemsTable->pItems[v38->uItemID].uEquipType; |
2852 if ( v14 ) | |
2853 { | |
2854 if ( bUnderwater ) | |
2855 { | |
2856 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); | |
2857 return; | |
2858 } | |
2859 WetsuitOff(uActiveCharacter); | |
2860 } | |
2861 if ( unk_50C9A0 ) | |
2862 { | |
2863 *((char *)pGUIWindow_Settings->ptr_1C + 8) &= 0x7Fu; | |
2864 *((short *)pGUIWindow_Settings->ptr_1C + 2) = uActiveCharacter - 1; | |
2865 v39 = v52; | |
2866 *((int *)pGUIWindow_Settings->ptr_1C + 3) = v36; | |
2867 *((short *)pGUIWindow_Settings->ptr_1C + 3) = v39; | |
2868 ptr_50C9A4 = v38; | |
2869 unk_50C9A0 = 0; | |
2870 if ( pMessageQueue_50CBD0->uNumMessages ) | |
2871 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
2872 pMouse->SetCursorBitmap("MICON1"); | |
2873 dword_50C9D4 = 0; | |
2874 dword_50C9D0 = 113; | |
2875 dword_50C9D8 = 256; | |
2876 } | |
2877 else | |
2878 { | |
2879 if ( !ptr_50C9A4 ) | |
2880 { | |
2881 pParty->SetHoldingItem(v38); | |
2882 *(&pPlayers[uActiveCharacter]->uBirthYear + *(char *)(v50 + 556)) = 0; | |
2883 v38->Reset(); | |
2884 } | |
2885 } | |
2886 } | |
2887 else | |
2888 { | |
2889 v35 = pPlayers[uActiveCharacter]->pEquipment.uBow; | |
2890 if ( v35 ) | |
2891 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1365
diff
changeset
|
2892 auto _a = (ItemGen *)&pPlayers[uActiveCharacter]->pInventoryItemList[v35 - 1]; |
1298 | 2893 pParty->SetHoldingItem(_a); |
2894 _a->Reset(); | |
2895 pPlayers[uActiveCharacter]->pEquipment.uBow = 0; | |
2896 } | |
2897 } | |
2898 } | |
2899 //----- (004196A0) -------------------------------------------------------- | |
2900 void CharacterUI_ReleaseButtons() | |
2901 { | |
2902 GUIButton *i; // esi@2 | |
2903 GUIButton *j; // esi@7 | |
2904 | |
2905 if ( dword_507CC0_activ_ch ) | |
2906 { | |
2907 dword_507CC0_activ_ch = 0; | |
2908 for ( i = pGUIWindow_CurrentMenu->pControlsHead; i; i = j ) | |
2909 { | |
1462 | 2910 j = i->pNext; |
2911 if ( BYTE1(i->field_1C) & 0x80 ) | |
2912 { | |
1298 | 2913 i->Release(); |
1462 | 2914 pAllocator->FreeChunk(i); |
2915 } | |
1298 | 2916 } |
2917 for ( j = pGUIWindow_CurrentMenu->pControlsHead; j; j = j->pNext ) | |
2918 { | |
2919 if ( j->msg == UIMSG_InventoryLeftClick) | |
2920 { | |
2921 j->uX = dword_50698C_uX; | |
2922 j->uY = dword_506988_uY; | |
2923 j->uZ = dword_506984_uZ; | |
2924 j->uW = dword_506980_uW; | |
2925 pGUIWindow_CurrentMenu->_41D08F_set_keyboard_control_group(1, 0, 0, 0); | |
2926 } | |
2927 } | |
2928 } | |
2929 } |