comparison UI/UIPopup.cpp @ 1699:33c7cc2d48d5

MonsterPopup_Draw
author Ritor1
date Sun, 22 Sep 2013 20:38:24 +0600
parents 6faacde46271
children a395359afc8f 8251e59fd7c1
comparison
equal deleted inserted replaced
1698:8cfb2e978445 1699:33c7cc2d48d5
104 } 104 }
105 } 105 }
106 106
107 //----- (0041D895) -------------------------------------------------------- 107 //----- (0041D895) --------------------------------------------------------
108 void GameUI_DrawItemInfo( struct ItemGen* inspect_item ) 108 void GameUI_DrawItemInfo( struct ItemGen* inspect_item )
109 { 109 {
110 ItemGen *v1; // esi@1
111 unsigned int v2; // eax@3 110 unsigned int v2; // eax@3
112 signed int v6; // eax@5
113 int v7; // edx@5
114 char v10; // zf@16
115 ItemGen *v11; // eax@16
116 ItemGen *v12; // eax@25
117 const char *v16; // eax@34
118 int v17; // eax@36
119 int v18; // esi@37
120 unsigned __int16 v19; // ax@37
121 char v21; // al@44
122 int v24; // eax@52
123 int v25; // eax@57
124 int v26; // eax@60
125 int v27; // eax@67
126 const char *v28; // edi@69 111 const char *v28; // edi@69
127 int v29; // eax@70
128 char v30; // edi@78
129 const char *v31; // eax@78
130 int v32; // ecx@81
131 unsigned int v33; // eax@81
132 int v34; // esi@81 112 int v34; // esi@81
133 const char *v35; // eax@85 113 char *pText; // [sp-14h] [bp-28Ch]@110
134 const char *v36; // eax@87
135 unsigned int v37; // eax@109
136 unsigned int v38; // eax@109
137 int v39; // eax@113
138 GUIFont *v40; // edx@113
139 signed int v41; // [sp-20h] [bp-298h]@113
140 int v42; // [sp-1Ch] [bp-294h]@113
141 unsigned int v44; // [sp-18h] [bp-290h]@113
142 const char *v46; // [sp-14h] [bp-28Ch]@58
143 char *v47; // [sp-14h] [bp-28Ch]@110
144 const char *v49; // [sp-10h] [bp-288h]@56
145 char *v50; // [sp-10h] [bp-288h]@58
146 int v51; // [sp-10h] [bp-288h]@110
147 const char *v52; // [sp-Ch] [bp-284h]@36
148 char *v54; // [sp-Ch] [bp-284h]@56
149 int v55; // [sp-Ch] [bp-284h]@58
150 int v56; // [sp-Ch] [bp-284h]@110
151 unsigned int v57; // [sp-8h] [bp-280h]@36
152 int v59; // [sp-8h] [bp-280h]@56
153 int v60; // [sp-8h] [bp-280h]@58
154 unsigned int v61; // [sp-8h] [bp-280h]@110
155 char out_text[300]; // [sp+8h] [bp-270h]@40 114 char out_text[300]; // [sp+8h] [bp-270h]@40
156 char v65[120]; // [sp+134h] [bp-144h]@92 115 char v65[120]; // [sp+134h] [bp-144h]@92
157 char Source[40]; // [sp+1ACh] [bp-CCh]@49
158 stru351_summoned_item v67; 116 stru351_summoned_item v67;
159 int var88; // [sp+1F0h] [bp-88h]@1
160 Texture *v73; // [sp+1F4h] [bp-84h]@5
161 int v77; // [sp+200h] [bp-78h]@12 117 int v77; // [sp+200h] [bp-78h]@12
162 int v78; // [sp+204h] [bp-74h]@5 118 int v78; // [sp+204h] [bp-74h]@5
163 GUIWindow wHintWindow; // [sp+208h] [bp-70h]@2 119 GUIWindow iteminfo_window; // [sp+208h] [bp-70h]@2
164 POINT a2; // [sp+25Ch] [bp-1Ch]@2 120 POINT a2; // [sp+25Ch] [bp-1Ch]@2
165 int v81; // [sp+264h] [bp-14h]@5 121 int v81; // [sp+264h] [bp-14h]@5
166 PlayerSpeech v83; // [sp+26Ch] [bp-Ch]@18 122 PlayerSpeech v83; // [sp+26Ch] [bp-Ch]@18
167 char* v84; 123 char* v84;
168 int v85; 124 int v85;
169 char *Str; // [sp+270h] [bp-8h]@65 125 char *Str; // [sp+270h] [bp-8h]@65
170 126
171 v1 = inspect_item; 127 if (!inspect_item->uItemID)
172 var88 = TargetColor(0xFFu, 0xFFu, 0x9Bu); 128 return;
173 if (!inspect_item->uItemID) 129 iteminfo_window.Hint = 0;
174 return; 130 iteminfo_window.uFrameWidth = 384;
175 131 iteminfo_window.uFrameHeight = 180;
176 wHintWindow.Hint = 0; 132 iteminfo_window.uFrameY = 40;
177 wHintWindow.uFrameWidth = 384; 133 if ( pMouse->GetCursorPos(&a2)->x <= 320 )
178 wHintWindow.uFrameHeight = 180; 134 v2 = pMouse->GetCursorPos(&a2)->x + 30;
179 wHintWindow.uFrameY = 40; 135 else
180 if ( pMouse->GetCursorPos(&a2)->x <= 320 ) 136 v2 = pMouse->GetCursorPos(&a2)->x - iteminfo_window.uFrameWidth - 30;
181 v2 = pMouse->GetCursorPos(&a2)->x + 30; 137 iteminfo_window.uFrameX = v2;
138 v78 = 100 - pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)->uTextureWidth;
139 v81 = 144 - pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)->uTextureHeight;
140 if ( v78 > 0 )
141 v78 = v78 / 2;
142 if ( v81 <= 0 )
143 v81 = 0;
144 else
145 v81 = v81 / 2;
146 if ( !pItemsTable->pItems[inspect_item->uItemID].uItemID_Rep_St )
147 inspect_item->SetIdentified();
148 v77 = 0;
149 if (pItemsTable->pItems[inspect_item->uItemID].uEquipType == EQUIP_GOLD)
150 v77 = inspect_item->uSpecEnchantmentType;
151 if ( uActiveCharacter )
152 {
153 //try to identify
154 if (!inspect_item->IsIdentified())
155 {
156 //v11 = inspect_item;
157 if ( pPlayers[uActiveCharacter]->CanIdentify(inspect_item) == 1 )
158 inspect_item->SetIdentified();
159 v83 = SPEECH_9;
160 if ( !inspect_item->IsIdentified() )
161 ShowStatusBarString(pGlobalTXT_LocalizationStrings[446], 2);//"Identify Failed"
162 else
163 {
164 v83 = SPEECH_8;
165 if ( inspect_item->GetValue() < 100 * (pPlayers[uActiveCharacter]->uLevel + 5) )
166 v83 = SPEECH_7;
167 }
168 if ( dword_4E455C )
169 {
170 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)(int)v83, 0);
171 dword_4E455C = 0;
172 }
173 }
174 inspect_item->UpdateTempBonus(pParty->uTimePlayed);
175 if (inspect_item->IsBroken())
176 {
177 if ( pPlayers[uActiveCharacter]->CanRepair(inspect_item) == 1 )
178 inspect_item->uAttributes = inspect_item->uAttributes & 0xFFFFFFFD | 1;
179 v83 = SPEECH_11;
180 if ( !inspect_item->IsBroken() )
181 v83 = SPEECH_10;
182 else
183 ShowStatusBarString(pGlobalTXT_LocalizationStrings[448], 2);//"Repair Failed"
184 if ( dword_4E455C )
185 {
186 pPlayers[uActiveCharacter]->PlaySound(v83, 0);
187 dword_4E455C = 0;
188 }
189 }
190 }
191 if (inspect_item->IsBroken())
192 {
193 iteminfo_window.DrawMessageBox(0);
194 pRenderer->SetTextureClipRect(iteminfo_window.uFrameX + 12, iteminfo_window.uFrameY + 12,
195 iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 12,
196 iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 12);
197 iteminfo_window.uFrameWidth -= 24;
198 iteminfo_window.uFrameHeight -= 12;
199 iteminfo_window.uFrameZ = iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 1;
200 iteminfo_window.uFrameW = iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 1;
201 pRenderer->DrawTransparentRedShade(iteminfo_window.uFrameX + v78, v81 + iteminfo_window.uFrameY + 30, pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE));
202 if ( inspect_item->IsIdentified())
203 pText = (char *)inspect_item->GetIdentifiedName();
182 else 204 else
183 v2 = pMouse->GetCursorPos(&a2)->x - wHintWindow.uFrameWidth - 30; 205 pText = pItemsTable->pItems[inspect_item->uItemID].pUnidentifiedName;
184 wHintWindow.uFrameX = v2; 206 iteminfo_window.DrawTitleText(pFontArrus, 0, 0xCu, TargetColor(0xFFu, 0xFFu, 0x9Bu), pText, 3);
185 auto item_desc = &pItemsTable->pItems[inspect_item->uItemID]; 207 iteminfo_window.DrawTitleText(pFontArrus, 0x64u, ((signed int)iteminfo_window.uFrameHeight >> 1) - pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[32], &iteminfo_window, 0, 0) / 2,
186 //v3 = (char *)&pItemsTable->pItems[_this->uItemID].pIconName; 208 TargetColor(0xFFu, 0x19u, 0x19u), pGlobalTXT_LocalizationStrings[32], 3); //"Broken Item"
187 //v76 = v3; 209 pRenderer->ResetTextureClipRect();
188 //v4 = pIcons_LOD->LoadTexture(pItemsTable->pItems[_this->uItemID].pIconName, TEXTURE_16BIT_PALETTE); 210 if ( !areWeLoadingTexture )
189 //v5 = v4; 211 {
190 //v4 *= 72; 212 pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)->Release();
191 //v75 = v4; 213 pIcons_LOD->SyncLoadedFilesCount();
192 //v73 = &pIcons_LOD->pTextures[v4]; 214 }
193 v73 = pIcons_LOD->LoadTexturePtr(item_desc->pIconName, TEXTURE_16BIT_PALETTE); 215 return;
194 v6 = 100 - v73->uTextureWidth; 216 }
195 v7 = v73->uTextureHeight; 217 if (!inspect_item->IsIdentified())
196 v78 = v6; 218 {
197 v81 = 144 - v7; 219 iteminfo_window.DrawMessageBox(0);
198 if ( v6 > 0 ) 220 pRenderer->SetTextureClipRect(iteminfo_window.uFrameX + 12, iteminfo_window.uFrameY + 12,
199 v78 = v6 >> 1; 221 iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 12, iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 12);
200 if ( v81 <= 0 ) 222 iteminfo_window.uFrameWidth -= 24;
201 v81 = 0; 223 iteminfo_window.uFrameHeight -= 12;
202 else 224 iteminfo_window.uFrameZ = iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 1;
203 v81 >>= 1; 225 iteminfo_window.uFrameW = iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 1;
204 if ( !item_desc->uItemID_Rep_St ) 226 pRenderer->DrawTextureTransparent(iteminfo_window.uFrameX + v78, v81 + iteminfo_window.uFrameY + 30, pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE));
205 inspect_item->SetIdentified(); 227 iteminfo_window.DrawTitleText(pFontArrus, 0, 0xCu, TargetColor(0xFFu, 0xFFu, 0x9Bu), pItemsTable->pItems[inspect_item->uItemID].pUnidentifiedName, 3);
206 //v9 = v8->uAttributes; 228 iteminfo_window.DrawTitleText(pFontArrus, 0x64u, ((signed int)iteminfo_window.uFrameHeight >> 1) - pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[232], &iteminfo_window, 0, 0) / 2,
207 v77 = 0; 229 TargetColor(0xFFu, 0x19u, 0x19u), pGlobalTXT_LocalizationStrings[232], 3);//"Not Identified"
208 //a2.y = v8->uAttributes & 2; 230 pRenderer->ResetTextureClipRect();
209 if (pItemsTable->pItems[inspect_item->uItemID].uEquipType == EQUIP_GOLD) 231 if ( !areWeLoadingTexture )
210 v77 = inspect_item->uSpecEnchantmentType; 232 {
211 if ( uActiveCharacter ) 233 pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)->Release();
212 { 234 pIcons_LOD->SyncLoadedFilesCount();
213 //try to identify 235 }
214 if (!inspect_item->IsIdentified()) 236 return;
215 { 237 }
216 238 sprintfex(out_text, pGlobalTXT_LocalizationStrings[463], pItemsTable->pItems[inspect_item->uItemID].pUnidentifiedName); //"Type: %s"
217 v11 = inspect_item; 239 out_text[100] = 0;
218 if ( pPlayers[uActiveCharacter]->CanIdentify(inspect_item) == 1 ) 240 out_text[200] = 0;
219 inspect_item->SetIdentified(); 241 switch (pItemsTable->pItems[inspect_item->uItemID].uEquipType)
220 v83 = SPEECH_9; 242 {
221 if ( !inspect_item->IsIdentified() )
222 {
223 ShowStatusBarString(pGlobalTXT_LocalizationStrings[446], 2u);//"Identify Failed"
224 }
225 else
226 {
227 v83 = SPEECH_8;
228 if ( inspect_item->GetValue() < 100 * (pPlayers[uActiveCharacter]->uLevel + 5) )
229 v83 = SPEECH_7;
230 }
231 if ( dword_4E455C )
232 {
233 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)(int)v83, 0);
234 dword_4E455C = 0;
235 }
236 }
237 inspect_item->UpdateTempBonus(pParty->uTimePlayed);
238 if (inspect_item->IsBroken())
239 {
240 if ( pPlayers[uActiveCharacter]->CanRepair(inspect_item) == 1 )
241 inspect_item->uAttributes = inspect_item->uAttributes & 0xFFFFFFFD | 1;
242 v83 = SPEECH_11;
243 if ( !inspect_item->IsBroken() )
244 v83 = SPEECH_10;
245 else
246 ShowStatusBarString(pGlobalTXT_LocalizationStrings[448], 2u);//"Repair Failed"
247 if ( dword_4E455C )
248 {
249 pPlayers[uActiveCharacter]->PlaySound(v83, 0);
250 dword_4E455C = 0;
251 }
252 }
253 }
254 //v13 = _this->uAttributes;
255 //v14 = _this->Identified();
256 //a2.y = inspect_item->Identified();
257 if (inspect_item->IsBroken())
258 {
259 wHintWindow.DrawMessageBox(0);
260 //v15 = &;
261 pRenderer->SetTextureClipRect(wHintWindow.uFrameX + 12, wHintWindow.uFrameY + 12,
262 wHintWindow.uFrameX + wHintWindow.uFrameWidth - 12,
263 wHintWindow.uFrameY + wHintWindow.uFrameHeight - 12);
264 wHintWindow.uFrameWidth -= 24;
265 wHintWindow.uFrameHeight -= 12;
266 wHintWindow.uFrameZ = wHintWindow.uFrameX + wHintWindow.uFrameWidth - 1;
267 wHintWindow.uFrameW = wHintWindow.uFrameY + wHintWindow.uFrameHeight - 1;
268 pRenderer->DrawTransparentRedShade(wHintWindow.uFrameX + v78, v81 + wHintWindow.uFrameY + 30, v73);
269 if ( inspect_item->IsIdentified())
270 v16 = inspect_item->GetIdentifiedName();
271 else
272 v16 = item_desc->pUnidentifiedName;
273 wHintWindow.DrawTitleText(pFontArrus, 0, 0xCu, var88, v16, 3u);
274 v17 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[32], &wHintWindow, 0, 0); //"Broken Item"
275 v18 = v17 >> 1;
276 v19 = TargetColor(0xFFu, 0x19u, 0x19u);
277 wHintWindow.DrawTitleText(pFontArrus, 0x64u, ((signed int)wHintWindow.uFrameHeight >> 1) - v18, v19, pGlobalTXT_LocalizationStrings[32], 3); //"Broken Item"
278 pRenderer->ResetTextureClipRect();
279 if ( !areWeLoadingTexture )
280 {
281 v73->Release();
282 pIcons_LOD->SyncLoadedFilesCount();
283 }
284 return;
285 }
286 if (!inspect_item->IsIdentified())
287 {
288 wHintWindow.DrawMessageBox(0);
289 pRenderer->SetTextureClipRect(wHintWindow.uFrameX + 12, wHintWindow.uFrameY + 12,
290 wHintWindow.uFrameX + wHintWindow.uFrameWidth - 12,
291 wHintWindow.uFrameY + wHintWindow.uFrameHeight - 12);
292 wHintWindow.uFrameWidth -= 24;
293 wHintWindow.uFrameHeight -= 12;
294 wHintWindow.uFrameZ = wHintWindow.uFrameX + wHintWindow.uFrameWidth - 1;
295 wHintWindow.uFrameW = wHintWindow.uFrameY + wHintWindow.uFrameHeight - 1;
296 pRenderer->DrawTextureTransparent(wHintWindow.uFrameX + v78, v81 + wHintWindow.uFrameY + 30, v73);
297 wHintWindow.DrawTitleText(pFontArrus, 0, 0xCu, var88, item_desc->pUnidentifiedName, 3u);
298 v17 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[232], &wHintWindow, 0, 0); ///"Not Identified"
299 v18 = v17 >> 1;
300 v19 = TargetColor(0xFFu, 0x19u, 0x19u);
301 wHintWindow.DrawTitleText(pFontArrus, 0x64u, ((signed int)wHintWindow.uFrameHeight >> 1) - v18, v19, pGlobalTXT_LocalizationStrings[232], 3);
302 pRenderer->ResetTextureClipRect();
303 if ( !areWeLoadingTexture )
304 {
305 v73->Release();
306 pIcons_LOD->SyncLoadedFilesCount();
307 }
308 return;
309 }
310
311 sprintfex(out_text, pGlobalTXT_LocalizationStrings[463], item_desc->pUnidentifiedName); //"Type: %s"
312 out_text[100] = 0;
313 out_text[200] = 0;
314 //v20 = item_desc->uEquipType;
315 switch (item_desc->uEquipType)
316 {
317 case EQUIP_OFF_HAND: 243 case EQUIP_OFF_HAND:
318 case EQUIP_MAIN_HAND: 244 case EQUIP_MAIN_HAND:
319 sprintfex(out_text + 100, "%s: +%d %s: %dd%d", pGlobalTXT_LocalizationStrings[LOCSTR_ATTACK], 245 sprintfex(out_text + 100, "%s: +%d %s: %dd%d", pGlobalTXT_LocalizationStrings[LOCSTR_ATTACK],
320 (int)item_desc->uDamageMod, pGlobalTXT_LocalizationStrings[53], (int)item_desc->uDamageDice, (int)item_desc->uDamageRoll); //"Damage" 246 (int)pItemsTable->pItems[inspect_item->uItemID].uDamageMod, pGlobalTXT_LocalizationStrings[53],
321 if (item_desc->uDamageMod) 247 (int)pItemsTable->pItems[inspect_item->uItemID].uDamageDice, (int)pItemsTable->pItems[inspect_item->uItemID].uDamageRoll); //"Damage"
322 { 248 if (pItemsTable->pItems[inspect_item->uItemID].uDamageMod)
323 char mod[16]; 249 {
324 sprintf(mod, "+%d", (int)item_desc->uDamageMod); 250 char mod[16];
325 strcat(out_text + 100, mod); 251 sprintf(mod, "+%d", (int)pItemsTable->pItems[inspect_item->uItemID].uDamageMod);
326 } 252 strcat(out_text + 100, mod);
327 break; 253 }
254 break;
328 255
329 case EQUIP_BOW: 256 case EQUIP_BOW:
330 sprintfex(out_text + 100, "%s: +%d %s: %dd%d", pGlobalTXT_LocalizationStrings[203], //"Shoot" 257 sprintfex(out_text + 100, "%s: +%d %s: %dd%d", pGlobalTXT_LocalizationStrings[203], //"Shoot"
331 (int)item_desc->uDamageMod, pGlobalTXT_LocalizationStrings[53], //"Damage" 258 (int)pItemsTable->pItems[inspect_item->uItemID].uDamageMod, pGlobalTXT_LocalizationStrings[53], //"Damage"
332 (int)item_desc->uDamageDice, (int)item_desc->uDamageRoll); 259 (int)pItemsTable->pItems[inspect_item->uItemID].uDamageDice, (int)pItemsTable->pItems[inspect_item->uItemID].uDamageRoll);
333 if (item_desc->uDamageMod) 260 if (pItemsTable->pItems[inspect_item->uItemID].uDamageMod)
334 { 261 {
335 char mod[16]; 262 char mod[16];
336 sprintf(mod, "+%d", (int)item_desc->uDamageMod); 263 sprintf(mod, "+%d", (int)pItemsTable->pItems[inspect_item->uItemID].uDamageMod);
337 strcat(out_text + 100, mod); 264 strcat(out_text + 100, mod);
338 } 265 }
339 break; 266 break;
340 267
341 case EQUIP_ARMOUR: 268 case EQUIP_ARMOUR:
342 case EQUIP_SHIELD: 269 case EQUIP_SHIELD:
343 case EQUIP_HELMET: 270 case EQUIP_HELMET:
344 case EQUIP_BELT: 271 case EQUIP_BELT:
345 case EQUIP_CLOAK: 272 case EQUIP_CLOAK:
346 case EQUIP_GAUNTLETS: 273 case EQUIP_GAUNTLETS:
347 case EQUIP_BOOTS: 274 case EQUIP_BOOTS:
348 case EQUIP_RING: 275 case EQUIP_RING:
349 case EQUIP_AMULET: 276 case EQUIP_AMULET:
350 if (item_desc->uDamageDice) //"Armor" 277 if (pItemsTable->pItems[inspect_item->uItemID].uDamageDice) //"Armor"
351 sprintfex(out_text + 100, "%s: +%d", pGlobalTXT_LocalizationStrings[11], item_desc->uDamageDice + item_desc->uDamageMod); 278 sprintfex(out_text + 100, "%s: +%d", pGlobalTXT_LocalizationStrings[11],
352 break; 279 pItemsTable->pItems[inspect_item->uItemID].uDamageDice + pItemsTable->pItems[inspect_item->uItemID].uDamageMod);
353 280 break;
281 }
282
283 if ( !v77 )
284 {
285 if (pItemsTable->pItems[inspect_item->uItemID].uEquipType ==EQUIP_POTION) //this is CORRECT! do not move to switch!
286 {
287 if ( inspect_item->uEnchantmentType )
288 sprintf(out_text + 200, "%s: %d",pGlobalTXT_LocalizationStrings[449] , inspect_item->uEnchantmentType); //"Power"
289 }
290 else if (pItemsTable->pItems[inspect_item->uItemID].uEquipType == EQUIP_REAGENT)
291 sprintf(out_text + 200, "%s: %d", pGlobalTXT_LocalizationStrings[449], pItemsTable->pItems[inspect_item->uItemID].uDamageDice); //"Power"
292 else if ( inspect_item->uEnchantmentType )
293 sprintf(out_text + 200, "%s: %s +%d", pGlobalTXT_LocalizationStrings[210], pItemsTable->pEnchantments[inspect_item->uEnchantmentType-1].pBonusStat, inspect_item->m_enchantmentStrength); //"Special"
294 else if ( inspect_item->uSpecEnchantmentType )
295 sprintf(out_text + 200, "%s: %s", pGlobalTXT_LocalizationStrings[210], pItemsTable->pSpecialEnchantments[inspect_item->uSpecEnchantmentType-1].pBonusStatement, inspect_item->m_enchantmentStrength);
296 else if ( inspect_item->uNumCharges )
297 sprintf(out_text + 200, "%s: %lu", pGlobalTXT_LocalizationStrings[464], inspect_item->uNumCharges); //"Charges"
298 }
299 iteminfo_window.uFrameWidth -= 12;
300 iteminfo_window.uFrameZ = iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 1;
301 iteminfo_window.uFrameW = iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 1;
302 Str = (char *)(3 * (LOBYTE(pFontArrus->uFontHeight) + 8));
303 v84 = &out_text[0];
304 for ( uint i = 1; i <= 3; i++ )
305 {
306 if ( *v84 )
307 Str += pFontComic->CalcTextHeight(v84, &iteminfo_window, 100, 0) + 3;
308 v84 += 100;
309 }
310 v28 = pItemsTable->pItems[inspect_item->uItemID].pDescription;
311 if ( *v28 )
312 Str += pFontSmallnum->CalcTextHeight(pItemsTable->pItems[inspect_item->uItemID].pDescription, &iteminfo_window, 100, 0);
313 iteminfo_window.uFrameHeight = pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName,
314 TEXTURE_16BIT_PALETTE)->uTextureHeight + v81 + 54;
315 if ( (signed int)Str > (signed int)iteminfo_window.uFrameHeight )
316 iteminfo_window.uFrameHeight = (unsigned int)Str;
317 if ( inspect_item->uAttributes & 8 && (inspect_item->uSpecEnchantmentType || inspect_item->uEnchantmentType) )
318 iteminfo_window.uFrameHeight += LOBYTE(pFontComic->uFontHeight);
319 v85 = 0;
320 if ( pFontArrus->uFontHeight )
321 {
322 iteminfo_window.uFrameWidth -= 24;
323 if ( pFontArrus->CalcTextHeight(inspect_item->GetIdentifiedName(), &iteminfo_window, 0, 0) / (signed int)pFontArrus->uFontHeight )
324 v85 = pFontArrus->uFontHeight;
325 iteminfo_window.uFrameWidth += 24;
326 }
327 iteminfo_window.uFrameWidth += 12;
328 iteminfo_window.uFrameHeight += (unsigned int)v85;
329 iteminfo_window.uFrameW = iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 1;
330 iteminfo_window.uFrameZ = iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 1;
331 iteminfo_window.DrawMessageBox(0);
332 pRenderer->SetTextureClipRect(iteminfo_window.uFrameX + 12, iteminfo_window.uFrameY + 12,
333 iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 12, iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 12);
334 iteminfo_window.uFrameWidth -= 12;
335 //v32 = pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)->uTextureHeight;
336 iteminfo_window.uFrameHeight -= 12;
337 iteminfo_window.uFrameZ = iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 1;
338 iteminfo_window.uFrameW = iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 1;
339 pRenderer->DrawTextureTransparent(iteminfo_window.uFrameX + v78,
340 iteminfo_window.uFrameY + (signed int)(iteminfo_window.uFrameHeight - pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)->uTextureHeight) / 2,
341 pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE));
342
343 v34 = (int)(v85 + 35);
344 Str = out_text;
345 for ( uint i = 1; i <= 3; i++ )
346 {
347 if ( *Str )
348 {
349 iteminfo_window.DrawText(pFontComic, 100, v34, 0, Str, 0, 0, 0);
350 v34 += pFontComic->CalcTextHeight(Str, &iteminfo_window, 100, 0) + 3;
351 }
352 Str += 100;
353 }
354 v28 = pItemsTable->pItems[inspect_item->uItemID].pDescription;
355 if ( *v28 )
356 iteminfo_window.DrawText(pFontSmallnum, 100, v34, 0, v28, 0, 0, 0);
357 iteminfo_window.uFrameX += 12;
358 iteminfo_window.uFrameWidth -= 24;
359 iteminfo_window.DrawTitleText(pFontArrus, 0, 0xCu, TargetColor(0xFFu, 0xFFu, 0x9Bu), inspect_item->GetIdentifiedName(), 3);
360 iteminfo_window.uFrameWidth += 24;
361 iteminfo_window.uFrameX -= 12;
362 if ( v77 )
363 {
364 sprintf(pTmpBuf.data(), "%s: %lu", pGlobalTXT_LocalizationStrings[465], v77);//"Value"
365 iteminfo_window.DrawText(pFontComic, 100, iteminfo_window.uFrameHeight - LOBYTE(pFontComic->uFontHeight), 0, pTmpBuf.data(), 0, 0, 0);
366 pRenderer->ResetTextureClipRect();
367 }
368 else
369 {
370 if ( (inspect_item->uAttributes & 8) && (inspect_item->uSpecEnchantmentType || inspect_item->uEnchantmentType) )
371 {
372 init_summoned_item(&v67, inspect_item->uExpireTime - pParty->uTimePlayed);
373 strcpy(pTmpBuf.data(), "Duration:");
374 Str = (char *)(v67.field_18_expire_year - game_starting_year);
375 if (v67.field_18_expire_year != 1168 )
376 {
377 sprintf(v65, " %d:yr", v67.field_18_expire_year - game_starting_year);
378 strcat(pTmpBuf.data(), v65);
379 }
380 if ( (((v67.field_14_exprie_month || Str) &&
381 ((sprintf(v65, " %d:mo", v67.field_14_exprie_month), strcat(pTmpBuf.data(), v65), v67.field_14_exprie_month) || Str)
382 || v67.field_C_expire_day)
383 && ((sprintf(v65, " %d:dy", v67.field_C_expire_day), strcat(pTmpBuf.data(), v65), v67.field_14_exprie_month) || Str ||
384 v67.field_C_expire_day)
385 || v67.field_8_expire_hour)
386 && ((sprintf(v65, " %d:hr", v67.field_8_expire_hour), strcat(pTmpBuf.data(), v65), v67.field_14_exprie_month) || Str ||
387 v67.field_C_expire_day || v67.field_8_expire_hour)
388 || v67.field_4_expire_minute )
389 {
390 sprintf(v65, " %d:mn", v67.field_4_expire_minute);
391 strcat(pTmpBuf.data(), v65);
392 }
393 iteminfo_window.DrawText(pFontComic, 100, iteminfo_window.uFrameHeight - 2 * LOBYTE(pFontComic->uFontHeight), 0, pTmpBuf.data(), 0, 0, 0);
394 }
395 sprintf(pTmpBuf.data(), "%s: %lu", pGlobalTXT_LocalizationStrings[465], inspect_item->GetValue());
396 iteminfo_window.DrawText(pFontComic, 100, iteminfo_window.uFrameHeight - LOBYTE(pFontComic->uFontHeight), 0, pTmpBuf.data(), 0, 0, 0);
397 if ( BYTE1(inspect_item->uAttributes) & 1 )
398 pText = pGlobalTXT_LocalizationStrings[187]; //"Stolen"
399 else
400 {
401 if ( !(BYTE1(inspect_item->uAttributes) & 2) )
402 {
403 pRenderer->ResetTextureClipRect();
404 if ( !areWeLoadingTexture )
405 {
406 pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)->Release();
407 pIcons_LOD->SyncLoadedFilesCount();
354 } 408 }
355 409 return;
356 if ( !v77 ) 410 }
357 { 411 pText = pGlobalTXT_LocalizationStrings[651]; //"Hardened"
358 if (item_desc->uEquipType ==EQUIP_POTION) //this is CORRECT! do not move to switch! 412 }
359 { 413 LOWORD(inspect_item->uAttributes) = LOWORD(pRenderer->uTargetRMask);
360 if ( inspect_item->uEnchantmentType ) 414 iteminfo_window.DrawText(pFontComic, pFontComic->GetLineWidth(pTmpBuf.data()) + 132,
361 sprintf(out_text + 200, "%s: %d",pGlobalTXT_LocalizationStrings[449] , inspect_item->uEnchantmentType); //"Power" 415 iteminfo_window.uFrameHeight - LOBYTE(pFontComic->uFontHeight), inspect_item->uAttributes, pText, 0, 0, 0);
362 } 416 pRenderer->ResetTextureClipRect();
363 else if (item_desc->uEquipType == EQUIP_REAGENT) 417 }
364 { 418 if ( !areWeLoadingTexture )
365 sprintf(out_text + 200, "%s: %d", pGlobalTXT_LocalizationStrings[449], pItemsTable->pItems[inspect_item->uItemID].uDamageDice); //"Power" 419 {
366 } 420 pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)->Release();
367 421 pIcons_LOD->SyncLoadedFilesCount();
368 else if ( inspect_item->uEnchantmentType ) 422 }
369 { 423 return;
370 sprintf(out_text + 200, "%s: %s +%d", pGlobalTXT_LocalizationStrings[210], 424 }
371 pItemsTable->pEnchantments[inspect_item->uEnchantmentType-1].pBonusStat, inspect_item->m_enchantmentStrength); //"Special"
372 }
373 else if ( inspect_item->uSpecEnchantmentType )
374 {
375 sprintf(out_text + 200, "%s: %s", pGlobalTXT_LocalizationStrings[210],
376 pItemsTable->pSpecialEnchantments[inspect_item->uSpecEnchantmentType-1].pBonusStatement, inspect_item->m_enchantmentStrength);
377 }
378
379 else if ( inspect_item->uNumCharges )
380 {
381 sprintf(out_text + 200, "%s: %lu", pGlobalTXT_LocalizationStrings[464], inspect_item->uNumCharges); //"Charges"
382
383 }
384 }
385 wHintWindow.uFrameWidth -= 12;
386 v85 = 3;
387 wHintWindow.uFrameZ = wHintWindow.uFrameX + wHintWindow.uFrameWidth - 1;
388 wHintWindow.uFrameW = wHintWindow.uFrameY + wHintWindow.uFrameHeight - 1;
389 Str = (char *)(3 * (LOBYTE(pFontArrus->uFontHeight) + 8));
390 v84 = &out_text[0];
391 do
392 {
393 if ( *v84 )
394 {
395 v27 = pFontComic->CalcTextHeight(v84, &wHintWindow, 100, 0);
396 Str += v27 + 3;
397 }
398 v84 += 100;
399 --v85;
400 }
401 while ( v85 );
402 v28 = item_desc->pDescription;
403 if ( *v28 )
404 {
405 v29 = pFontSmallnum->CalcTextHeight(v28, &wHintWindow, 100, 0);
406 Str += v29;
407 }
408 wHintWindow.uFrameHeight = v73->uTextureHeight + v81 + 54;
409 if ( (signed int)Str > (signed int)wHintWindow.uFrameHeight )
410 wHintWindow.uFrameHeight = (unsigned int)Str;
411 if ( inspect_item->uAttributes & 8 && (inspect_item->uSpecEnchantmentType || inspect_item->uEnchantmentType) )
412 wHintWindow.uFrameHeight += LOBYTE(pFontComic->uFontHeight);
413 v85 = 0;
414 if ( pFontArrus->uFontHeight )
415 {
416 wHintWindow.uFrameWidth -= 24;
417 v30 = pFontArrus->uFontHeight;
418 v31 = inspect_item->GetIdentifiedName();
419 if ( pFontArrus->CalcTextHeight(v31, &wHintWindow, 0, 0) / (signed int)v30 )
420 v85 = v30;
421 wHintWindow.uFrameWidth += 24;
422 }
423 wHintWindow.uFrameWidth += 12;
424 wHintWindow.uFrameHeight += (unsigned int)v85;
425 wHintWindow.uFrameW = wHintWindow.uFrameY + wHintWindow.uFrameHeight - 1;
426 wHintWindow.uFrameZ = wHintWindow.uFrameX + wHintWindow.uFrameWidth - 1;
427 wHintWindow.DrawMessageBox(0);
428 //v15 = pRenderer;
429 pRenderer->SetTextureClipRect(wHintWindow.uFrameX + 12, wHintWindow.uFrameY + 12,
430 wHintWindow.uFrameX + wHintWindow.uFrameWidth - 12, wHintWindow.uFrameY + wHintWindow.uFrameHeight - 12);
431 wHintWindow.uFrameWidth -= 12;
432 v32 = v73->uTextureHeight;
433 v33 = wHintWindow.uFrameHeight;
434 wHintWindow.uFrameHeight -= 12;
435 wHintWindow.uFrameZ = wHintWindow.uFrameX + wHintWindow.uFrameWidth - 1;
436 wHintWindow.uFrameW = wHintWindow.uFrameY + wHintWindow.uFrameHeight - 1;
437 pRenderer->DrawTextureTransparent(
438 wHintWindow.uFrameX + v78,
439 wHintWindow.uFrameY + (signed int)(v33 - v32) / 2,
440 v73);
441
442 v34 = (int)(v85 + 35);
443 v85 = 3;
444 Str = out_text;
445 do
446 {
447 if ( *Str )
448 {
449 wHintWindow.DrawText(pFontComic, 100, v34, 0, Str, 0, 0, 0);
450 v34 += pFontComic->CalcTextHeight(Str, &wHintWindow, 100, 0) + 3;
451 }
452 Str += 100;
453 --v85;
454 }
455 while (v85 );
456 v35 = item_desc->pDescription;
457 if ( *v35 )
458 wHintWindow.DrawText(pFontSmallnum, 100, v34, 0, v35, 0, 0, 0);
459 wHintWindow.uFrameX += 12;
460 wHintWindow.uFrameWidth -= 24;
461 v36 = inspect_item->GetIdentifiedName();
462 wHintWindow.DrawTitleText(pFontArrus, 0, 0xCu, var88, v36, 3u);
463 wHintWindow.uFrameWidth += 24;
464 wHintWindow.uFrameX -= 12;
465 if ( v77 )
466 {
467 sprintf(pTmpBuf.data(), "%s: %lu", pGlobalTXT_LocalizationStrings[465], v77);//"Value"
468 v40 = pFontComic;
469 v61 = 0;
470 v56 = 0;
471 v51 = 0;
472 v47 = pTmpBuf.data();
473 v44 = 0;
474 v42 = wHintWindow.uFrameHeight - LOBYTE(pFontComic->uFontHeight);
475 v41 = 100;
476 }
477 else
478 {
479 if ( (inspect_item->uAttributes & 8) && (inspect_item->uSpecEnchantmentType || inspect_item->uEnchantmentType) )
480 {
481 init_summoned_item(&v67, inspect_item->uExpireTime - pParty->uTimePlayed);
482 strcpy(pTmpBuf.data(), "Duration:");
483 Str = (char *)(v67.field_18_expire_year - game_starting_year);
484 if (v67.field_18_expire_year != 1168 )
485 {
486 sprintf(v65, " %d:yr", v67.field_18_expire_year - game_starting_year);
487 strcat(pTmpBuf.data(), v65);
488 }
489 if ( (((v67.field_14_exprie_month || Str) &&
490 ((sprintf(v65, " %d:mo", v67.field_14_exprie_month), strcat(pTmpBuf.data(), v65), v67.field_14_exprie_month) || Str)
491 || v67.field_C_expire_day)
492 && ((sprintf(v65, " %d:dy", v67.field_C_expire_day), strcat(pTmpBuf.data(), v65), v67.field_14_exprie_month) || Str ||
493 v67.field_C_expire_day)
494 || v67.field_8_expire_hour)
495 && ((sprintf(v65, " %d:hr", v67.field_8_expire_hour), strcat(pTmpBuf.data(), v65), v67.field_14_exprie_month) || Str ||
496 v67.field_C_expire_day || v67.field_8_expire_hour)
497 || v67.field_4_expire_minute )
498 {
499 sprintf(v65, " %d:mn", v67.field_4_expire_minute);
500 strcat(pTmpBuf.data(), v65);
501 }
502 wHintWindow.DrawText(pFontComic, 100, wHintWindow.uFrameHeight - 2 * LOBYTE(pFontComic->uFontHeight), 0, pTmpBuf.data(), 0, 0, 0);
503 }
504 v37 = inspect_item->GetValue();
505 sprintf(pTmpBuf.data(), "%s: %lu", pGlobalTXT_LocalizationStrings[465], v37);
506 wHintWindow.DrawText(pFontComic, 100, wHintWindow.uFrameHeight - LOBYTE(pFontComic->uFontHeight), 0, pTmpBuf.data(), 0, 0, 0);
507 v38 = inspect_item->uAttributes;
508 if ( BYTE1(v38) & 1 )
509 {
510 v61 = 0;
511 v56 = 0;
512 v51 = 0;
513 v47 = pGlobalTXT_LocalizationStrings[187]; //"Stolen"
514 }
515 else
516 {
517 if ( !(BYTE1(v38) & 2) )
518 {
519 pRenderer->ResetTextureClipRect();
520 if ( !areWeLoadingTexture )
521 {
522 v73->Release();
523 pIcons_LOD->SyncLoadedFilesCount();
524 }
525 return;
526 }
527 v61 = 0;
528 v56 = 0;
529 v51 = 0;
530 v47 = pGlobalTXT_LocalizationStrings[651]; //"Hardened"
531 }
532 LOWORD(v38) = LOWORD(pRenderer->uTargetRMask);
533 v44 = v38;
534 v42 = wHintWindow.uFrameHeight - LOBYTE(pFontComic->uFontHeight);
535 v39 = pFontComic->GetLineWidth(pTmpBuf.data());
536 v40 = pFontComic;
537 v41 = v39 + 132;
538 }
539 wHintWindow.DrawText(v40, v41, v42, v44, v47, v51, v56, v61);
540 pRenderer->ResetTextureClipRect();
541 if ( !areWeLoadingTexture )
542 {
543 v73->Release();
544 pIcons_LOD->SyncLoadedFilesCount();
545 }
546 return;
547 }
548 // 4E455C: using guessed type int dword_4E455C; 425 // 4E455C: using guessed type int dword_4E455C;
549 // 506128: using guessed type int areWeLoadingTexture; 426 // 506128: using guessed type int areWeLoadingTexture;
550 427
551
552
553 //----- (0041E360) -------------------------------------------------------- 428 //----- (0041E360) --------------------------------------------------------
554 void MonsterPopup_Draw(unsigned int uActorID, GUIWindow *edx0) 429 void MonsterPopup_Draw(unsigned int uActorID, GUIWindow *window)
555 { 430 {
556 unsigned int v2; // esi@1
557 Actor *v3; // esi@3
558 int v4; // eax@3
559 //unsigned int v5; // ecx@3
560 NPCData *v6; // eax@3
561 unsigned __int16 v7; // cx@3
562 int v8; // eax@4 431 int v8; // eax@4
563 unsigned __int16 v9; // dx@4 432 unsigned __int16 v9; // dx@4
564 SpriteFrame *v10; // edi@17 433 SpriteFrame *v10; // edi@17
565 LODSprite *v11; // esi@17
566 unsigned int v12; // ecx@17
567 Sprite *v13; // edi@18
568 //int v14; // ecx@18
569 //int v15; // edx@18
570 //int v16; // edx@18
571 //int v17; // eax@18
572 unsigned int v18; // ecx@19 434 unsigned int v18; // ecx@19
573 unsigned int v19; // eax@21 435 unsigned int v19; // eax@21
574 char *v20; // esi@28 436 char *v20; // esi@28
575 int v21; // edx@29 437 int v21; // edx@29
576 unsigned __int16 *v22; // ecx@29 438 unsigned __int16 *v22; // ecx@29
577 int v23; // eax@29 439 int v23; // eax@29
578 int v24; // eax@32
579 int v25; // esi@32 440 int v25; // esi@32
580 char *v26; // edx@34 441 char *v26; // edx@34
581 unsigned __int8 v27; // sf@36 442 unsigned __int8 v27; // sf@36
582 unsigned __int8 v28; // of@36 443 unsigned __int8 v28; // of@36
583 //int v29; // esi@40
584 //unsigned __int16 *v30; // ecx@40
585 //int v31; // eax@40
586 //int v32; // esi@43
587 //unsigned __int16 v33; // ax@45
588 //int v34; // edx@45
589 //int v35; // eax@45
590 int v36; // eax@49
591 //char *v37; // eax@52
592 int v38; // eax@55
593 unsigned __int16 v39; // ax@59
594 SpellBuff *v40; // eax@60 444 SpellBuff *v40; // eax@60
595 int v41; // edi@61 445 int v41; // edi@61
596 unsigned int v42; // eax@61 446 unsigned int v42; // eax@61
597 int v43; // eax@62 447 int v43; // eax@62
598 int v44; // eax@63 448 int v44; // eax@63
599 signed int v45; // edi@65 449 signed int v45; // edi@65
600 unsigned __int16 v46; // ax@73
601 Player *v47; // ecx@77
602 //unsigned int v48; // eax@85
603 GUIFont *v49; // edi@90
604 int v50; // edi@90 450 int v50; // edi@90
605 SpellBuff *v51; // eax@91 451 SpellBuff *v51; // eax@91
606 char *v52; // ecx@98 452 char *v52; // ecx@98
607 char *v53; // ecx@101 453 char *v53; // ecx@101
608 char *v54; // ST0C_4@118 454 char *v54; // ST0C_4@118
612 int v58; // eax@132 458 int v58; // eax@132
613 Actor *v59; // ecx@133 459 Actor *v59; // ecx@133
614 unsigned __int8 v60; // dl@138 460 unsigned __int8 v60; // dl@138
615 char *v62; // eax@147 461 char *v62; // eax@147
616 int v63; // eax@152 462 int v63; // eax@152
617 //char *result; // eax@152
618 int v65; // eax@155 463 int v65; // eax@155
619 const char *v66; // [sp-10h] [bp-1FCh]@121
620 const char *v67; // [sp-10h] [bp-1FCh]@125 464 const char *v67; // [sp-10h] [bp-1FCh]@125
621 const char *v68; // [sp-10h] [bp-1FCh]@142 465 const char *v68; // [sp-10h] [bp-1FCh]@142
622 int v69; // [sp-Ch] [bp-1F8h]@121
623 char *v70; // [sp-Ch] [bp-1F8h]@125 466 char *v70; // [sp-Ch] [bp-1F8h]@125
624 char *v71; // [sp-Ch] [bp-1F8h]@142 467 char *v71; // [sp-Ch] [bp-1F8h]@142
625 char *v72; // [sp-8h] [bp-1F4h]@54 468 char *v72; // [sp-8h] [bp-1F4h]@54
626 int v73; // [sp-8h] [bp-1F4h]@79 469 int v73; // [sp-8h] [bp-1F4h]@79
627 int v74; // [sp-8h] [bp-1F4h]@121
628 int v75; // [sp-8h] [bp-1F4h]@125 470 int v75; // [sp-8h] [bp-1F4h]@125
629 int v76; // [sp-8h] [bp-1F4h]@142 471 int v76; // [sp-8h] [bp-1F4h]@142
630 size_t v77; // [sp-4h] [bp-1F0h]@54 472 size_t v77; // [sp-4h] [bp-1F0h]@54
631 unsigned int v78; // [sp-4h] [bp-1F0h]@121
632 unsigned int v79; // [sp-4h] [bp-1F0h]@125 473 unsigned int v79; // [sp-4h] [bp-1F0h]@125
633 char *v80; // [sp-4h] [bp-1F0h]@142 474 char *v80; // [sp-4h] [bp-1F0h]@142
634 char *v81; // [sp-4h] [bp-1F0h]@148 475 char *v81; // [sp-4h] [bp-1F0h]@148
635 DDBLTFX Dst; // [sp+Ch] [bp-1E0h]@18 476 DDBLTFX Dst; // [sp+Ch] [bp-1E0h]@18
636 DDSURFACEDESC2 pDesc; // [sp+70h] [bp-17Ch]@18 477 DDSURFACEDESC2 pDesc; // [sp+70h] [bp-17Ch]@18
640 RenderBillboardTransform_local0 v106; // [sp+150h] [bp-9Ch]@3 481 RenderBillboardTransform_local0 v106; // [sp+150h] [bp-9Ch]@3
641 unsigned int v107; // [sp+1A0h] [bp-4Ch]@18 482 unsigned int v107; // [sp+1A0h] [bp-4Ch]@18
642 unsigned __int16 *v108; // [sp+1A4h] [bp-48h]@34 483 unsigned __int16 *v108; // [sp+1A4h] [bp-48h]@34
643 unsigned int v109; // [sp+1A8h] [bp-44h]@32 484 unsigned int v109; // [sp+1A8h] [bp-44h]@32
644 LPVOID v110; // [sp+1ACh] [bp-40h]@28 485 LPVOID v110; // [sp+1ACh] [bp-40h]@28
645 unsigned int v111; // [sp+1B0h] [bp-3Ch]@29
646 int v112; // [sp+1B4h] [bp-38h]@3 486 int v112; // [sp+1B4h] [bp-38h]@3
647 int v222; // [sp+1B8h] [bp-34h]@18 487 int v222; // [sp+1B8h] [bp-34h]@18
648 unsigned __int8 v114; // [sp+1BFh] [bp-2Dh]@133 488 unsigned __int8 v114; // [sp+1BFh] [bp-2Dh]@133
649 int v115; // [sp+1C0h] [bp-2Ch]@3 489 int v115; // [sp+1C0h] [bp-2Ch]@3
650 unsigned int v116; // [sp+1C4h] [bp-28h]@18 490 unsigned int v116; // [sp+1C4h] [bp-28h]@18
651 int i; // [sp+1C8h] [bp-24h]@18 491 int i; // [sp+1C8h] [bp-24h]@18
652 int a2; // [sp+1CCh] [bp-20h]@28
653 int v119; // [sp+1D0h] [bp-1Ch]@18 492 int v119; // [sp+1D0h] [bp-1Ch]@18
654 SpellBuff *v120; // [sp+1D4h] [bp-18h]@18 493 SpellBuff *v120; // [sp+1D4h] [bp-18h]@18
655 Actor *v121; // [sp+1D8h] [bp-14h]@3
656 int a5; // [sp+1DCh] [bp-10h]@3
657 GUIWindow *a1; // [sp+1E0h] [bp-Ch]@1
658 int v124; // [sp+1E4h] [bp-8h]@18 494 int v124; // [sp+1E4h] [bp-8h]@18
659 int a4; // [sp+1E8h] [bp-4h]@18 495 int a4; // [sp+1E8h] [bp-4h]@18
660
661 a1 = edx0;
662 v2 = uActorID;
663 496
664 static Actor pMonsterInfoUI_Doll; 497 static Actor pMonsterInfoUI_Doll;
665 /*if ( !(bMonsterInfoUI_bDollInitialized & 1) ) 498 /*if ( !(bMonsterInfoUI_bDollInitialized & 1) )
666 { 499 {
667 bMonsterInfoUI_bDollInitialized |= 1u; 500 bMonsterInfoUI_bDollInitialized |= 1u;
668 Actor::Actor(&pMonsterInfoUI_Doll); 501 Actor::Actor(&pMonsterInfoUI_Doll);
669 atexit(nullsub_3); 502 atexit(nullsub_3);
670 }*/ 503 }*/
671 v106.uParentBillboardID = -1; 504 v106.uParentBillboardID = -1;
672 v3 = &pActors[v2]; 505 v115 = monster_popup_y_offsets[((signed __int16)pActors[uActorID].pMonsterInfo.uID - 1) / 3] - 40;
673 v121 = v3; 506 if ( pActors[uActorID].pMonsterInfo.uID == pMonsterInfoUI_Doll.pMonsterInfo.uID )
674 v4 = TargetColor(0xE1u, 255, 0x9Bu);
675 //v5 = v3->sNPC_ID;
676 a5 = v4;
677 v6 = GetNPCData(v3->sNPC_ID);
678 v7 = v3->pMonsterInfo.uID;
679 //v112 = (char **)v6;
680 v115 = monster_popup_y_offsets[((signed __int16)v7 - 1) / 3] - 40;
681 if ( v7 == pMonsterInfoUI_Doll.pMonsterInfo.uID )
682 {
683 v9 = pMonsterInfoUI_Doll.uCurrentActionLength; 507 v9 = pMonsterInfoUI_Doll.uCurrentActionLength;
684 }
685 else 508 else
686 { 509 {
687 memcpy(&pMonsterInfoUI_Doll, v3, sizeof(pMonsterInfoUI_Doll)); 510 memcpy(&pMonsterInfoUI_Doll, &pActors[uActorID], sizeof(pMonsterInfoUI_Doll));
688 pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_Bored; 511 pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_Bored;
689 pMonsterInfoUI_Doll.uCurrentActionTime = 0; 512 pMonsterInfoUI_Doll.uCurrentActionTime = 0;
690 v8 = rand(); 513 v8 = rand();
691 v3 = v121;
692 v9 = v8 % 256 + 128; 514 v9 = v8 % 256 + 128;
693 pMonsterInfoUI_Doll.uCurrentActionLength = v8 % 256 + 128; 515 pMonsterInfoUI_Doll.uCurrentActionLength = v8 % 256 + 128;
694 } 516 }
695 517
696 if ( (signed int)pMonsterInfoUI_Doll.uCurrentActionTime > (signed __int16)v9 ) 518 if ( (signed int)pMonsterInfoUI_Doll.uCurrentActionTime > (signed __int16)v9 )
706 //rand(); 528 //rand();
707 pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_Bored; 529 pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_Bored;
708 if ( (pMonsterInfoUI_Doll.pMonsterInfo.uID < 115 || pMonsterInfoUI_Doll.pMonsterInfo.uID > 186) && 530 if ( (pMonsterInfoUI_Doll.pMonsterInfo.uID < 115 || pMonsterInfoUI_Doll.pMonsterInfo.uID > 186) &&
709 (pMonsterInfoUI_Doll.pMonsterInfo.uID < 232 || pMonsterInfoUI_Doll.pMonsterInfo.uID > 249) && rand() % 30 < 100 ) 531 (pMonsterInfoUI_Doll.pMonsterInfo.uID < 232 || pMonsterInfoUI_Doll.pMonsterInfo.uID > 249) && rand() % 30 < 100 )
710 pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_AtkMelee; 532 pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_AtkMelee;
711 pMonsterInfoUI_Doll.uCurrentActionLength = 8 * pSpriteFrameTable->pSpriteSFrames[v3->pSpriteIDs[(signed __int16)pMonsterInfoUI_Doll.uCurrentActionAnimation]].uAnimLength; 533 pMonsterInfoUI_Doll.uCurrentActionLength = 8 * pSpriteFrameTable->pSpriteSFrames[pActors[uActorID].pSpriteIDs[(signed __int16)pMonsterInfoUI_Doll.uCurrentActionAnimation]].uAnimLength;
712 } 534 }
713 } 535 }
714 v10 = pSpriteFrameTable->GetFrame( v3->pSpriteIDs[pMonsterInfoUI_Doll.uCurrentActionAnimation], pMonsterInfoUI_Doll.uCurrentActionTime); 536 v10 = pSpriteFrameTable->GetFrame( pActors[uActorID].pSpriteIDs[pMonsterInfoUI_Doll.uCurrentActionAnimation], pMonsterInfoUI_Doll.uCurrentActionTime);
715 v11 = &pSprites_LOD->pSpriteHeaders[v10->pHwSpriteIDs[0]];//40 * v10->pHwSpriteIDs[0] + 7218180;
716 v106.pTarget = pRenderer->pTargetSurface; 537 v106.pTarget = pRenderer->pTargetSurface;
717 v106.pTargetZ = pRenderer->pActiveZBuffer; 538 v106.pTargetZ = pRenderer->pActiveZBuffer;
718 v106.uTargetPitch = pRenderer->uTargetSurfacePitch; 539 v106.uTargetPitch = pRenderer->uTargetSurfacePitch;
719 v12 = a1->uFrameY + 52; 540 v106.uViewportX = window->uFrameX + 13;
720 v106.uViewportX = a1->uFrameX + 13; 541 v106.uViewportY = window->uFrameY + 52;
721 v106.uViewportY = v12; 542 v106.uViewportW = (window->uFrameY + 52) + 128;
722 v106.uViewportW = v12 + 128;
723 v106.uViewportZ = v106.uViewportX + 128; 543 v106.uViewportZ = v106.uViewportX + 128;
724 v106.uScreenSpaceX = (signed int)(v106.uViewportX + 128 + v106.uViewportX) / 2; 544 v106.uScreenSpaceX = (signed int)(v106.uViewportX + 128 + v106.uViewportX) / 2;
725 v106._screenspace_x_scaler_packedfloat = 65536; 545 v106._screenspace_x_scaler_packedfloat = 65536;
726 v106._screenspace_y_scaler_packedfloat = 65536; 546 v106._screenspace_y_scaler_packedfloat = 65536;
727 v106.uScreenSpaceY = v115 + v12 + v11->uHeight; 547 v106.uScreenSpaceY = v115 + (window->uFrameY + 52) + pSprites_LOD->pSpriteHeaders[v10->pHwSpriteIDs[0]].uHeight;
728 v106.pPalette = PaletteManager::Get_Dark_or_Red_LUT(v10->uPaletteIndex, 0, 1); 548 v106.pPalette = PaletteManager::Get_Dark_or_Red_LUT(v10->uPaletteIndex, 0, 1);
729 v106.sZValue = 0; 549 v106.sZValue = 0;
730 v106.uFlags = 0; 550 v106.uFlags = 0;
731 pRenderer->SetRasterClipRect(0, 0, 0x27Fu, 0x1DFu); 551 pRenderer->SetRasterClipRect(0, 0, 0x27Fu, 0x1DFu);
732 pRenderer->RasterLine2D(v106.uViewportX - 1, v106.uViewportY - 1, v106.uViewportX + 129, v106.uViewportY - 1, a5); 552 pRenderer->RasterLine2D(v106.uViewportX - 1, v106.uViewportY - 1, v106.uViewportX + 129, v106.uViewportY - 1, TargetColor(0xE1u, 255, 0x9Bu));
733 pRenderer->RasterLine2D( v106.uViewportX + 129, v106.uViewportY - 1, v106.uViewportX + 129, v106.uViewportW + 1, a5); 553 pRenderer->RasterLine2D( v106.uViewportX + 129, v106.uViewportY - 1, v106.uViewportX + 129, v106.uViewportW + 1, TargetColor(0xE1u, 255, 0x9Bu));
734 pRenderer->RasterLine2D(v106.uViewportX + 129, v106.uViewportW + 1, v106.uViewportX - 1, v106.uViewportW + 1, a5); 554 pRenderer->RasterLine2D(v106.uViewportX + 129, v106.uViewportW + 1, v106.uViewportX - 1, v106.uViewportW + 1, TargetColor(0xE1u, 255, 0x9Bu));
735 pRenderer->RasterLine2D(v106.uViewportX - 1, v106.uViewportW + 1, v106.uViewportX - 1, v106.uViewportY - 1, a5); 555 pRenderer->RasterLine2D(v106.uViewportX - 1, v106.uViewportW + 1, v106.uViewportX - 1, v106.uViewportY - 1, TargetColor(0xE1u, 255, 0x9Bu));
736 if ( pRenderer->pRenderD3D ) 556 if ( pRenderer->pRenderD3D )
737 { 557 {
738 v13 = &pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]]; 558 v106.uScreenSpaceY = v115 + v106.uViewportY + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uBufferHeight;
739 v106.uScreenSpaceY = v115 + v106.uViewportY + v13->uBufferHeight;
740 //v222 = (IDirectDrawSurface *)v13->pTextureSurface;
741 memset(&Dst, 0, 0x64u); 559 memset(&Dst, 0, 0x64u);
742 Dst.dwSize = 100; 560 Dst.dwSize = 100;
743 Dst.dwFillColor = 0; 561 Dst.dwFillColor = 0;
744 memset(&pDesc, 0, 0x7Cu); 562 memset(&pDesc, 0, 0x7Cu);
745 pDesc.dwSize = 124; 563 pDesc.dwSize = 124;
746 v13->pTextureSurface->GetSurfaceDesc(&pDesc); 564 pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].pTextureSurface->GetSurfaceDesc(&pDesc);
747 //v14 = v13->uBufferHeight;
748 //v120 = (SpellBuff *)v13->uBufferWidth;
749 v107 = 0; 565 v107 = 0;
750 //v15 = v13->uAreaX;
751 //v119 = v13->uBufferWidth / 2;
752 i = 0; 566 i = 0;
753 //a4 = v106.uScreenSpaceX + v15 - v13->uBufferWidth / 2; 567 int dst_x = v106.uScreenSpaceX + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaX - pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uBufferWidth / 2;
754 int dst_x = v106.uScreenSpaceX + v13->uAreaX - v13->uBufferWidth / 2; 568 int dst_y = v106.uScreenSpaceY + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaY - pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uBufferHeight;
755 //v115 = v13->uAreaY; 569 uint dst_z = v106.uScreenSpaceX + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaX + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaWidth + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uBufferWidth / 2 - pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uBufferWidth;
756 //v16 = v13->uAreaWidth + v13->uBufferWidth / 2 + v13->uAreaX - v13->uBufferWidth; 570 uint dst_w = v106.uScreenSpaceY + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaY + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaHeight - pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uBufferHeight;
757 //v124 = v106.uScreenSpaceY + v115 - v14;
758 int dst_y = v106.uScreenSpaceY + v13->uAreaY - v13->uBufferHeight;
759 //v17 = v13->uAreaHeight + v13->uAreaY - v14;
760 //v116 = v106.uScreenSpaceX + v16;
761 uint dst_z = v106.uScreenSpaceX + v13->uAreaX + v13->uAreaWidth + v13->uBufferWidth / 2 - v13->uBufferWidth;
762 //v119 = v106.uScreenSpaceY + v17;
763 uint dst_w = v106.uScreenSpaceY + v13->uAreaY + v13->uAreaHeight - v13->uBufferHeight;
764 if (dst_x < v106.uViewportX) 571 if (dst_x < v106.uViewportX)
765 { 572 {
766 v18 = v106.uViewportX - dst_x; 573 v18 = v106.uViewportX - dst_x;
767 dst_x = v106.uViewportX; 574 dst_x = v106.uViewportX;
768 v107 = v18; 575 v107 = v18;
787 if ( pRenderer->uTargetGBits == 5 ) 594 if ( pRenderer->uTargetGBits == 5 )
788 { 595 {
789 __debugbreak(); // no monster popup for r5g5b5 yet 596 __debugbreak(); // no monster popup for r5g5b5 yet
790 memset(&pDesc, 0, 0x7Cu); 597 memset(&pDesc, 0, 0x7Cu);
791 pDesc.dwSize = 124; 598 pDesc.dwSize = 124;
792 if ( pRenderer->LockSurface_DDraw4(v13->pTextureSurface, &pDesc, DDLOCK_WAIT)) 599 if ( pRenderer->LockSurface_DDraw4(pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].pTextureSurface, &pDesc, DDLOCK_WAIT))
793 { 600 {
794 v20 = (char *)dst_y; 601 v20 = (char *)dst_y;
795 v110 = pDesc.lpSurface; 602 v110 = pDesc.lpSurface;
796 a2 = dst_y; 603 //a2 = dst_y;
797 if (dst_y < dst_w) 604 if (dst_y < dst_w)
798 { 605 {
799 //v111 = 2 * pRenderer->uTargetSurfacePitch; 606 v21 = dst_x;
800 v21 = dst_x; 607 v22 = &pRenderer->pTargetSurface[dst_y * pRenderer->uTargetSurfacePitch + dst_x];
801 v22 = &pRenderer->pTargetSurface[dst_y * pRenderer->uTargetSurfacePitch + dst_x]; 608 auto _v22_2 = v22;
802 auto _v22_2 = v22; 609 v23 = i - dst_y;
803 v23 = i - dst_y; 610 v115 = i - dst_y;
804 //v120 = (SpellBuff *)&pRenderer->pTargetSurface[(int)&a4[v124 * pRenderer->uTargetSurfacePitch]]; 611 while ( 1 )
805 v115 = i - dst_y; 612 {
806 while ( 1 ) 613 dst_y = v21;
807 { 614 if ( v21 < dst_z )
808 dst_y = v21;
809 if ( v21 < dst_z )
810 {
811 v24 = (int)&v20[v23];
812 v25 = v107 - v21;
813 v109 = v24;
814 for ( i = v107 - v21; ; v25 = i )
815 {
816 v108 = (unsigned __int16 *)((pDesc.lPitch >> 1) * pDesc.dwHeight * v109 / v13->uAreaHeight);
817 v26 = (char *)v108 + pDesc.dwWidth * (v25 + dst_y++) / v13->uAreaWidth;
818 *v22 = *((short *)v110 + (int)v26);
819 ++v22;
820 if ( dst_y >= dst_z )
821 break;
822 }
823 v23 = v115;
824 }
825 v22 = (unsigned __int16 *)((char *)_v22_2 + 2 * pRenderer->uTargetSurfacePitch);
826 _v22_2 = v22;
827 v20 = (char *)(a2 + 1);
828 v28 = __OFSUB__(a2 + 1, dst_w);
829 v27 = (signed int)(a2++ + 1 - dst_w) < 0;
830 //a2 = (Player *)((char *)a2 + 1);
831 //v120 = (SpellBuff *)((char *)v120 + v111);
832 if ( !(v27 ^ v28) )
833 break;
834 v21 = dst_x;
835 }
836 }
837 v13->pTextureSurface->Unlock(0);
838 }
839 }
840 else
841 {
842 memset(&pDesc, 0, 0x7Cu);
843 pDesc.dwSize = 124;
844 if ( pRenderer->LockSurface_DDraw4(v13->pTextureSurface, &pDesc, DDLOCK_WAIT) )
845 {
846 auto src = (unsigned __int16 *)pDesc.lpSurface;
847
848 uint num_top_scanlines_above_frame_y = i - dst_y;
849 for (uint y = dst_y; y < dst_w; ++y)
850 {
851 auto dst = &pRenderer->pTargetSurface[y * pRenderer->uTargetSurfacePitch + dst_x];
852
853 uint src_y = num_top_scanlines_above_frame_y + y;
854 for (uint x = dst_x; x < dst_z; ++x)
855 { 615 {
856 uint src_x = v107 - dst_x + x; // num scanlines left to frame_x + current x 616 v25 = v107 - v21;
857 617 v109 = (int)&v20[v23];
858 uint idx = pDesc.dwHeight * src_y / v13->uAreaHeight * (pDesc.lPitch / sizeof(short)) + 618 for ( i = v107 - v21; ; v25 = i )
859 pDesc.dwWidth * src_x / v13->uAreaWidth; 619 {
860 uint b = src[idx] & 0x1F; 620 v108 = (unsigned __int16 *)((pDesc.lPitch >> 1) * pDesc.dwHeight * v109 / pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaHeight);
861 *dst++ = b | 2 * (src[idx] & 0xFFE0); 621 v26 = (char *)v108 + pDesc.dwWidth * (v25 + dst_y++) / pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaWidth;
622 *v22 = *((short *)v110 + (int)v26);
623 ++v22;
624 if ( dst_y >= dst_z )
625 break;
626 }
627 v23 = v115;
862 } 628 }
863 } 629 v22 = (unsigned __int16 *)((char *)_v22_2 + 2 * pRenderer->uTargetSurfacePitch);
864 v13->pTextureSurface->Unlock(0); 630 _v22_2 = v22;
865 } 631 v20 = (char *)(dst_y + 1);
866 } 632 v28 = __OFSUB__(dst_y + 1, dst_w);
633 v27 = (signed int)(dst_y++ + 1 - dst_w) < 0;
634 if ( !(v27 ^ v28) )
635 break;
636 v21 = dst_x;
637 }
638 }
639 pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].pTextureSurface->Unlock(0);
640 }
641 }
642 else
643 {
644 memset(&pDesc, 0, 0x7Cu);
645 pDesc.dwSize = 124;
646 if ( pRenderer->LockSurface_DDraw4(pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].pTextureSurface, &pDesc, DDLOCK_WAIT) )
647 {
648 auto src = (unsigned __int16 *)pDesc.lpSurface;
649 uint num_top_scanlines_above_frame_y = i - dst_y;
650 for (uint y = dst_y; y < dst_w; ++y)
651 {
652 auto dst = &pRenderer->pTargetSurface[y * pRenderer->uTargetSurfacePitch + dst_x];
653
654 uint src_y = num_top_scanlines_above_frame_y + y;
655 for (uint x = dst_x; x < dst_z; ++x)
656 {
657 uint src_x = v107 - dst_x + x; // num scanlines left to frame_x + current x
658
659 uint idx = pDesc.dwHeight * src_y / pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaHeight * (pDesc.lPitch / sizeof(short)) +
660 pDesc.dwWidth * src_x / pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaWidth;
661 uint b = src[idx] & 0x1F;
662 *dst++ = b | 2 * (src[idx] & 0xFFE0);
663 }
664 }
665 pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].pTextureSurface->Unlock(0);
666 }
667 }
867 } 668 }
868 else 669 else
869 { 670 {
870 pRenderer->FillRectFast(v106.uViewportX, v106.uViewportY, v106.uViewportZ - v106.uViewportX, v106.uViewportW - v106.uViewportY, 0); 671 pRenderer->FillRectFast(v106.uViewportX, v106.uViewportY, v106.uViewportZ - v106.uViewportX, v106.uViewportW - v106.uViewportY, 0);
871 v36 = v10->pHwSpriteIDs[0]; 672 if ( v10->pHwSpriteIDs[0] >= 0 )
872 if ( v36 >= 0 ) 673 pSprites_LOD->pSpriteHeaders[v10->pHwSpriteIDs[0]].DrawSprite_sw(&v106, 0);
873 pSprites_LOD->pSpriteHeaders[v36].DrawSprite_sw(&v106, 0); 674 }
874 } 675
875 676 if ( pActors[uActorID].sNPC_ID )
876 if ( v121->sNPC_ID ) 677 {
877 { 678 if (GetNPCData(pActors[uActorID].sNPC_ID)->uProfession)
878 //v37 = v6->uProfession; 679 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[429], GetNPCData(pActors[uActorID].sNPC_ID)->pName, aNPCProfessionNames[GetNPCData(pActors[uActorID].sNPC_ID)->uProfession]); // "%s the %s" / ^Pi[%s] %s
879 if (v6->uProfession) 680 else
880 { 681 {
881 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[429], v6->pName, aNPCProfessionNames[v6->uProfession]); // "%s the %s" / ^Pi[%s] %s 682 v77 = 2000;
882 } 683 v72 = GetNPCData(pActors[uActorID].sNPC_ID)->pName;
883 else 684 }
884 {
885 v77 = 2000;
886 v72 = v6->pName;
887 }
888 } 685 }
889 else 686 else
890 { 687 {
891 v38 = v121->dword_000334_unique_name;
892 v77 = 2000; 688 v77 = 2000;
893 if ( v38 ) 689 if ( pActors[uActorID].dword_000334_unique_name )
894 v72 = pMonsterStats->pPlaceStrings[v38]; 690 v72 = pMonsterStats->pPlaceStrings[pActors[uActorID].dword_000334_unique_name];
895 else 691 else
896 v72 = pMonsterStats->pInfos[v121->pMonsterInfo.uID].pName; 692 v72 = pMonsterStats->pInfos[pActors[uActorID].pMonsterInfo.uID].pName;
897 } 693 }
898 if(!v121->sNPC_ID || (v121->sNPC_ID && !v6->uProfession)) 694 if(!pActors[uActorID].sNPC_ID || (pActors[uActorID].sNPC_ID && !GetNPCData(pActors[uActorID].sNPC_ID)->uProfession))
899 strncpy(pTmpBuf.data(), v72, v77); 695 strncpy(pTmpBuf.data(), v72, v77);
900 v39 = TargetColor(0xFFu, 0xFFu, 0x9Bu); 696 window->DrawTitleText(pFontComic, 0, 0xCu, TargetColor(0xFFu, 0xFFu, 0x9Bu), pTmpBuf.data(), 3);
901 a1->DrawTitleText(pFontComic, 0, 0xCu, v39, pTmpBuf.data(), 3u); 697 Actor::DrawHealthBar(&pActors[uActorID], window);
902 Actor::DrawHealthBar(v121, a1);
903 v119 = 0; 698 v119 = 0;
904 pMonsterInfoUI_Doll.uCurrentActionTime += pMiscTimer->uTimeElapsed; 699 pMonsterInfoUI_Doll.uCurrentActionTime += pMiscTimer->uTimeElapsed;
905 v115 = 0; 700 v115 = 0;
906 v116 = 0; 701 v116 = 0;
907 i = 0; 702 i = 0;
908 v112 = 0; 703 v112 = 0;
909 if ( !uActiveCharacter ) 704 if ( !uActiveCharacter )
910 {
911 v45 = 1; 705 v45 = 1;
912 }
913 else 706 else
914 { 707 {
915 LOBYTE(v40) = pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID); 708 LOBYTE(v40) = pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID);
916 v120 = v40; 709 v120 = v40;
917 if ( !v40 ) 710 if ( !v40 )
918 v45 = 1; 711 v45 = 1;
919 else 712 else
920 { 713 {
921 v41 = (unsigned __int8)v40 & 0x3F; 714 v41 = (unsigned __int8)v40 & 0x3F;
922 v42 = SkillToMastery((unsigned __int16)v40) - 1; 715 v42 = SkillToMastery((unsigned __int16)v40) - 1;
923 if ( !v42 ) 716 if ( !v42 )
924 { 717 {
925 if ( v41 + 10 >= v121->pMonsterInfo.uLevel ) 718 if ( v41 + 10 >= pActors[uActorID].pMonsterInfo.uLevel )
926 { 719 {
927 v45 = 1; 720 v45 = 1;
928 v119 = 1; 721 v119 = 1;
929 } 722 }
930 else 723 else
931 v45 = 1; 724 v45 = 1;
932 } 725 }
933 else 726 else
934 { 727 {
935 v43 = v42 - 1; 728 v43 = v42 - 1;
936 if ( !v43 ) 729 if ( !v43 )
937 { 730 {
938 if ( 2 * v41 + 10 >= v121->pMonsterInfo.uLevel ) 731 if ( 2 * v41 + 10 >= pActors[uActorID].pMonsterInfo.uLevel )
939 { 732 {
940 v45 = 1; 733 v45 = 1;
941 v119 = 1; 734 v119 = 1;
942 v116 = 1; 735 v116 = 1;
943 } 736 }
944 else 737 else
945 v45 = 1; 738 v45 = 1;
946 } 739 }
947 else 740 else
948 { 741 {
949 v44 = v43 - 1; 742 v44 = v43 - 1;
950 if ( !v44 ) 743 if ( !v44 )
951 { 744 {
952 if ( 3 * v41 + 10 >= v121->pMonsterInfo.uLevel ) 745 if ( 3 * v41 + 10 >= pActors[uActorID].pMonsterInfo.uLevel )
953 { 746 {
954 v45 = 1; 747 v45 = 1;
955 v119 = 1; 748 v119 = 1;
956 v116 = 1; 749 v116 = 1;
957 i = 1; 750 i = 1;
958 } 751 }
959 else 752 else
960 { 753 v45 = 1;
961 v45 = 1; 754 }
962 } 755 else
963 } 756 {
964 else 757 if ( v44 != 1 )
965 { 758 v45 = 1;
966 if ( v44 != 1 ) 759 else
967 v45 = 1; 760 {
968 else 761 v45 = 1;
969 { 762 v119 = 1;
970 v45 = 1; 763 v116 = 1;
971 v119 = 1; 764 i = 1;
972 v116 = 1; 765 v112 = 1;
973 i = 1; 766 }
974 v112 = 1; 767 }
975 } 768 }
976 } 769 }
977 } 770 }
978 } 771 if ( pActors[uActorID].uAIState != Dead
979 } 772 && pActors[uActorID].uAIState != Dying
980 // LABEL_73: 773 && !dword_507BF0_is_there_popup_onscreen && v120 )
981 v46 = v121->uAIState; 774 {
982 if ( v46 != 5 && v46 != 4 && !dword_507BF0_is_there_popup_onscreen && v120 ) 775 if ( v119 | v116 | i | (unsigned int)v112 )
983 { 776 {
984 v47 = pPlayers[uActiveCharacter]; 777 if ( pActors[uActorID].pMonsterInfo.uLevel >= pPlayers[uActiveCharacter]->uLevel - 5 )
985 if ( v119 | v116 | i | (unsigned int)v112 ) 778 v73 = SPEECH_105;
986 { 779 else
987 if ( v121->pMonsterInfo.uLevel >= v47->uLevel - 5 ) 780 v73 = SPEECH_104;
988 v73 = SPEECH_105; 781 }
989 else 782 else
990 v73 = SPEECH_104; 783 v73 = SPEECH_106;
991 } 784 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)v73, 0);
992 else 785 }
993 { 786 }
994 v73 = SPEECH_106; 787
995 } 788 for (uint i = 0; i < 4; ++i)
996 v47->PlaySound((PlayerSpeech)v73, 0); 789 {
997 }
998 }
999
1000 for (uint _it = 0; _it < 4; ++_it)
1001 {
1002 auto player = pParty->pPlayers + _it;
1003
1004 //LOBYTE(v48) = player->GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID);
1005 //v111 = v48;
1006 v111 = player->GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID);
1007 v120 = (SpellBuff *)138; 790 v120 = (SpellBuff *)138;
1008 do 791 do
1009 { 792 {
1010 if ( (signed int)SkillToMastery(v111) >= 3 ) 793 if ( (signed int)SkillToMastery(pParty->pPlayers[i].GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID)) >= 3 )
1011 v115 = v45; 794 v115 = v45;
1012 v120 = (SpellBuff *)((char *)v120 - 1); 795 v120 = (SpellBuff *)((char *)v120 - 1);
1013 } 796 }
1014 while ( v120 ); 797 while ( v120 );
1015 //++a2; 798 }
1016 } 799
1017 //while ( (signed int)a2 < (signed int)pParty->pHirelings ); 800 window->DrawText(pFontSmallnum, 12, 196, TargetColor(0xE1u, 255, 0x9Bu), pGlobalTXT_LocalizationStrings[631], 0, 0, 0);
1018
1019 v49 = pFontSmallnum;
1020 a2 = (int)pFontSmallnum;
1021 a1->DrawText(pFontSmallnum, 12, 196, a5, pGlobalTXT_LocalizationStrings[631], 0, 0, 0);
1022 v50 = LOBYTE(v49->uFontHeight) + 193;
1023 if ( !v115 ) 801 if ( !v115 )
1024 { 802 window->DrawText(pFontSmallnum, 28, LOBYTE(pFontSmallnum->uFontHeight) + 193, TargetColor(0xE1u, 255, 0x9Bu), pGlobalTXT_LocalizationStrings[630], 0, 0, 0);
1025 v78 = 0;
1026 v74 = 0;
1027 v69 = 0;
1028 v66 = pGlobalTXT_LocalizationStrings[630];
1029 a1->DrawText((GUIFont *)a2, 28, v50, a5, v66, v69, v74, v78);
1030 }
1031 else 803 else
1032 { 804 {
1033 a4 = 0; 805 a4 = 0;
1034 v51 = &v121->pActorBuffs[1]; 806 v51 = &pActors[uActorID].pActorBuffs[1];
1035 v222 = 0; 807 v222 = 0;
1036 v120 = &v121->pActorBuffs[1]; 808 v120 = &pActors[uActorID].pActorBuffs[1];
1037 do 809 do
1038 { 810 {
1039 if ( (signed __int64)v51->uExpireTime > 0 ) 811 if ( (signed __int64)v51->uExpireTime > 0 )
1040 { 812 {
1041 switch ( (int)v51 ) 813 switch ( (int)v51 )
1135 } 907 }
1136 if ( a4 ) 908 if ( a4 )
1137 { 909 {
1138 v54 = (char *)a4; 910 v54 = (char *)a4;
1139 v55 = GetSpellColor(v124); 911 v55 = GetSpellColor(v124);
1140 a1->DrawText((GUIFont *)a2, 28, v50, v55, v54, 0, 0, 0); 912 window->DrawText(pFontSmallnum, 28, LOBYTE(pFontSmallnum->uFontHeight) + 193, v55, v54, 0, 0, 0);
1141 v50 = v50 + *(char *)(a2 + 5) - 3; 913 v50 = (LOBYTE(pFontSmallnum->uFontHeight) + 193) + *(char *)((int)pFontSmallnum + 5) - 3;
1142 v51 = v120; 914 v51 = v120;
1143 } 915 }
1144 } 916 }
1145 917
1146 ++v51; 918 ++v51;
1151 } 923 }
1152 //while ( (signed int)((char *)&v222->lpVtbl + 1) < 22 ); 924 //while ( (signed int)((char *)&v222->lpVtbl + 1) < 22 );
1153 while (true); 925 while (true);
1154 926
1155 if ( !a4 ) 927 if ( !a4 )
1156 { 928 window->DrawText(pFontSmallnum, 28, v50, TargetColor(0xE1u, 255, 0x9Bu), pGlobalTXT_LocalizationStrings[153], 0, 0, 0);
1157 v78 = 0;
1158 v74 = 0;
1159 v69 = 0;
1160 v66 = pGlobalTXT_LocalizationStrings[153];
1161 a1->DrawText((GUIFont *)a2, 28, v50, a5, v66, v69, v74, v78);
1162 }
1163 } 929 }
1164 v56 = pFontSmallnum; 930 v56 = pFontSmallnum;
1165 a4 = v106.uViewportY; 931 a4 = v106.uViewportY;
1166 if ( v119 ) 932 if ( v119 )
1167 { 933 {
1168 sprintf(pTmpBuf.data(), "%s\f%05u\t100%d\n", pGlobalTXT_LocalizationStrings[108], 0, v121->pMonsterInfo.uHP); 934 sprintf(pTmpBuf.data(), "%s\f%05u\t100%d\n", pGlobalTXT_LocalizationStrings[108], 0, pActors[uActorID].pMonsterInfo.uHP);
1169 a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf.data(), 0, 0, 0); 935 window->DrawText(v56, 150, (int)a4, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0);
1170 a4 = a4 + LOBYTE(v56->uFontHeight) - 3; 936 a4 = a4 + LOBYTE(v56->uFontHeight) - 3;
1171 v79 = v121->pMonsterInfo.uAC; 937 v79 = pActors[uActorID].pMonsterInfo.uAC;
1172 v75 = 0; 938 v75 = 0;
1173 v70 = pGlobalTXT_LocalizationStrings[12]; 939 v70 = pGlobalTXT_LocalizationStrings[12];
1174 v67 = "%s\f%05u\t100%d\n"; 940 v67 = "%s\f%05u\t100%d\n";
1175 } 941 }
1176 else 942 else
1177 { 943 {
1178 sprintf(pTmpBuf.data(), "%s\f%05u\t100%s\n", pGlobalTXT_LocalizationStrings[108], 0, pGlobalTXT_LocalizationStrings[630]); 944 sprintf(pTmpBuf.data(), "%s\f%05u\t100%s\n", pGlobalTXT_LocalizationStrings[108], 0, pGlobalTXT_LocalizationStrings[630]);
1179 a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf.data(), 0, 0, 0); 945 window->DrawText(v56, 150, (int)a4, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0);
1180 v79 = (unsigned int)pGlobalTXT_LocalizationStrings[630]; 946 v79 = (unsigned int)pGlobalTXT_LocalizationStrings[630];
1181 v75 = 0; 947 v75 = 0;
1182 v70 = pGlobalTXT_LocalizationStrings[12]; 948 v70 = pGlobalTXT_LocalizationStrings[12];
1183 a4 = a4 + LOBYTE(v56->uFontHeight) - 3; 949 a4 = a4 + LOBYTE(v56->uFontHeight) - 3;
1184 v67 = "%s\f%05u\t100%s\n"; 950 v67 = "%s\f%05u\t100%s\n";
1185 } 951 }
1186 sprintf(pTmpBuf.data(), v67, v70, v75, v79); 952 sprintf(pTmpBuf.data(), v67, v70, v75, v79);
1187 a1->DrawText(v56, 150, a4, a5, pTmpBuf.data(), 0, 0, 0); 953 window->DrawText(v56, 150, a4, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0);
1188 a4 = a4 + LOBYTE(v56->uFontHeight) - 6 + LOBYTE(v56->uFontHeight); 954 a4 = a4 + LOBYTE(v56->uFontHeight) - 6 + LOBYTE(v56->uFontHeight);
1189 v95[0] = pGlobalTXT_LocalizationStrings[87]; 955 v95[0] = pGlobalTXT_LocalizationStrings[87];
1190 v95[1] = pGlobalTXT_LocalizationStrings[6]; 956 v95[1] = pGlobalTXT_LocalizationStrings[6];
1191 v95[2] = pGlobalTXT_LocalizationStrings[240]; 957 v95[2] = pGlobalTXT_LocalizationStrings[240];
1192 v95[3] = pGlobalTXT_LocalizationStrings[70]; 958 v95[3] = pGlobalTXT_LocalizationStrings[70];
1197 v95[8] = pGlobalTXT_LocalizationStrings[29]; 963 v95[8] = pGlobalTXT_LocalizationStrings[29];
1198 v95[9] = pGlobalTXT_LocalizationStrings[133]; 964 v95[9] = pGlobalTXT_LocalizationStrings[133];
1199 v95[10] = pGlobalTXT_LocalizationStrings[54]; 965 v95[10] = pGlobalTXT_LocalizationStrings[54];
1200 if ( v116 ) 966 if ( v116 )
1201 { 967 {
1202 sprintf(pTmpBuf.data(), "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[18], 0, v95[v121->pMonsterInfo.uAttack1Type]); 968 sprintf(pTmpBuf.data(), "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[18], 0, v95[pActors[uActorID].pMonsterInfo.uAttack1Type]);
1203 a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf.data(), 0, 0, 0); 969 window->DrawText(v56, 150, (int)a4, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0);
1204 a4 = a4 + LOBYTE(v56->uFontHeight) - 3; 970 a4 = a4 + LOBYTE(v56->uFontHeight) - 3;
1205 v57 = v121->pMonsterInfo.uAttack1DamageBonus; 971 v57 = pActors[uActorID].pMonsterInfo.uAttack1DamageBonus;
1206 if ( v57 ) 972 if ( v57 )
1207 sprintf(pTmpBuf.data(), "%s\f%05u\t080%dd%d+%d\n", pGlobalTXT_LocalizationStrings[53], 973 sprintf(pTmpBuf.data(), "%s\f%05u\t080%dd%d+%d\n", pGlobalTXT_LocalizationStrings[53],
1208 0, v121->pMonsterInfo.uAttack1DamageDiceRolls, v121->pMonsterInfo.uAttack1DamageDiceSides, v57); 974 0, pActors[uActorID].pMonsterInfo.uAttack1DamageDiceRolls, pActors[uActorID].pMonsterInfo.uAttack1DamageDiceSides, v57);
1209 else 975 else
1210 sprintf(pTmpBuf.data(), "%s\f%05u\t080%dd%d\n", pGlobalTXT_LocalizationStrings[53], 976 sprintf(pTmpBuf.data(), "%s\f%05u\t080%dd%d\n", pGlobalTXT_LocalizationStrings[53],
1211 0, v121->pMonsterInfo.uAttack1DamageDiceRolls, v121->pMonsterInfo.uAttack1DamageDiceSides); 977 0, pActors[uActorID].pMonsterInfo.uAttack1DamageDiceRolls, pActors[uActorID].pMonsterInfo.uAttack1DamageDiceSides);
1212 } 978 }
1213 else 979 else
1214 { 980 {
1215 sprintf(pTmpBuf.data(), "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[18], 0, pGlobalTXT_LocalizationStrings[630]); 981 sprintf(pTmpBuf.data(), "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[18], 0, pGlobalTXT_LocalizationStrings[630]);
1216 a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf.data(), 0, 0, 0); 982 window->DrawText(v56, 150, (int)a4, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0);
1217 a4 = a4 + LOBYTE(v56->uFontHeight) - 3; 983 a4 = a4 + LOBYTE(v56->uFontHeight) - 3;
1218 sprintf(pTmpBuf.data(), "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[53], 0, pGlobalTXT_LocalizationStrings[630]); 984 sprintf(pTmpBuf.data(), "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[53], 0, pGlobalTXT_LocalizationStrings[630]);
1219 } 985 }
1220 a1->DrawText(v56, 150, a4, a5, pTmpBuf.data(), 0, 0, 0); 986 window->DrawText(v56, 150, a4, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0);
1221 v58 = LOBYTE(v56->uFontHeight); 987 v58 = LOBYTE(v56->uFontHeight);
1222 a4 = a4 + v58 - 6 + v58; 988 a4 = a4 + v58 - 6 + v58;
1223 if ( !i ) 989 if ( !i )
1224 { 990 {
1225 v80 = pGlobalTXT_LocalizationStrings[630]; 991 v80 = pGlobalTXT_LocalizationStrings[630];
1226 v76 = 0; 992 v76 = 0;
1227 v71 = pGlobalTXT_LocalizationStrings[628]; 993 v71 = pGlobalTXT_LocalizationStrings[628];
1228 v68 = "%s\f%05u\t080%s\n"; 994 v68 = "%s\f%05u\t080%s\n";
1229 sprintf(pTmpBuf.data(), v68, v71, v76, v80); 995 sprintf(pTmpBuf.data(), v68, v71, v76, v80);
1230 a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf.data(), 0, 0, 0); 996 window->DrawText(v56, 150, (int)a4, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0);
1231 v58 = LOBYTE(v56->uFontHeight); 997 v58 = LOBYTE(v56->uFontHeight);
1232 a4 = a4 + v58 - 3; 998 a4 = a4 + v58 - 3;
1233 } 999 }
1234 else 1000 else
1235 { 1001 {
1236 v120 = (SpellBuff *)pGlobalTXT_LocalizationStrings[628]; 1002 v120 = (SpellBuff *)pGlobalTXT_LocalizationStrings[628];
1237 v59 = v121; 1003 v59 = &pActors[uActorID];
1238 v114 = v121->pMonsterInfo.uSpell1ID; 1004 v114 = pActors[uActorID].pMonsterInfo.uSpell1ID;
1239 if ( v114 && v121->pMonsterInfo.uSpell2ID ) 1005 if ( v114 && pActors[uActorID].pMonsterInfo.uSpell2ID )
1240 v120 = (SpellBuff *)pGlobalTXT_LocalizationStrings[629]; 1006 v120 = (SpellBuff *)pGlobalTXT_LocalizationStrings[629];
1241 if ( v114 ) 1007 if ( v114 )
1242 { 1008 {
1243 sprintf(pTmpBuf.data(), "%s\f%05u\t060%s\n", v120, 0, pSpellStats->pInfos[v114].pShortName); 1009 sprintf(pTmpBuf.data(), "%s\f%05u\t060%s\n", v120, 0, pSpellStats->pInfos[v114].pShortName);
1244 a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf.data(), 0, 0, 0); 1010 window->DrawText(v56, 150, (int)a4, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0);
1245 v58 = LOBYTE(v56->uFontHeight); 1011 v58 = LOBYTE(v56->uFontHeight);
1246 a4 = a4 + v58 - 3; 1012 a4 = a4 + v58 - 3;
1247 v59 = v121; 1013 v59 = &pActors[uActorID];
1248 } 1014 }
1249 v60 = v59->pMonsterInfo.uSpell2ID; 1015 v60 = v59->pMonsterInfo.uSpell2ID;
1250 if ( v60 ) 1016 if ( v60 )
1251 { 1017 {
1252 sprintf(pTmpBuf.data(), "\f%05u\t060%s\n", 0, pSpellStats->pInfos[v60].pShortName); 1018 sprintf(pTmpBuf.data(), "\f%05u\t060%s\n", 0, pSpellStats->pInfos[v60].pShortName);
1253 a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf.data(), 0, 0, 0); 1019 window->DrawText(v56, 150, (int)a4, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0);
1254 v58 = LOBYTE(v56->uFontHeight); 1020 v58 = LOBYTE(v56->uFontHeight);
1255 a4 = a4 + v58 - 3; 1021 a4 = a4 + v58 - 3;
1256 v59 = v121; 1022 v59 = &pActors[uActorID];
1257 } 1023 }
1258 if ( !v59->pMonsterInfo.uSpell1ID && !v59->pMonsterInfo.uSpell2ID ) 1024 if ( !v59->pMonsterInfo.uSpell1ID && !v59->pMonsterInfo.uSpell2ID )
1259 { 1025 {
1260 v80 = pGlobalTXT_LocalizationStrings[153]; 1026 v80 = pGlobalTXT_LocalizationStrings[153];
1261 v76 = 0; 1027 v76 = 0;
1262 v71 = pGlobalTXT_LocalizationStrings[628]; 1028 v71 = pGlobalTXT_LocalizationStrings[628];
1263 v68 = "%s\f%05u\t060%s\n"; 1029 v68 = "%s\f%05u\t060%s\n";
1264 sprintf(pTmpBuf.data(), v68, v71, v76, v80); 1030 sprintf(pTmpBuf.data(), v68, v71, v76, v80);
1265 a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf.data(), 0, 0, 0); 1031 window->DrawText(v56, 150, (int)a4, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0);
1266 v58 = LOBYTE(v56->uFontHeight); 1032 v58 = LOBYTE(v56->uFontHeight);
1267 a4 = a4 + v58 - 3; 1033 a4 = a4 + v58 - 3;
1268 } 1034 }
1269 } 1035 }
1270 a4 = a4 + v58 - 3; 1036 a4 = a4 + v58 - 3;
1271 a1->DrawText(v56, 150, a4, a5, pGlobalTXT_LocalizationStrings[626], 0, 0, 0); 1037 window->DrawText(v56, 150, a4, TargetColor(0xE1u, 255, 0x9Bu), pGlobalTXT_LocalizationStrings[626], 0, 0, 0);
1272 a4 = a4 + LOBYTE(v56->uFontHeight) - 3; 1038 a4 = a4 + LOBYTE(v56->uFontHeight) - 3;
1273 v85[0] = pGlobalTXT_LocalizationStrings[87]; 1039 v85[0] = pGlobalTXT_LocalizationStrings[87];
1274 v85[1] = pGlobalTXT_LocalizationStrings[6]; 1040 v85[1] = pGlobalTXT_LocalizationStrings[6];
1275 v85[2] = pGlobalTXT_LocalizationStrings[240]; 1041 v85[2] = pGlobalTXT_LocalizationStrings[240];
1276 v85[3] = pGlobalTXT_LocalizationStrings[70]; 1042 v85[3] = pGlobalTXT_LocalizationStrings[70];
1278 v85[5] = pGlobalTXT_LocalizationStrings[214]; 1044 v85[5] = pGlobalTXT_LocalizationStrings[214];
1279 v85[6] = pGlobalTXT_LocalizationStrings[29]; 1045 v85[6] = pGlobalTXT_LocalizationStrings[29];
1280 v85[7] = pGlobalTXT_LocalizationStrings[133]; 1046 v85[7] = pGlobalTXT_LocalizationStrings[133];
1281 v85[8] = pGlobalTXT_LocalizationStrings[54]; 1047 v85[8] = pGlobalTXT_LocalizationStrings[54];
1282 v85[9] = pGlobalTXT_LocalizationStrings[624]; 1048 v85[9] = pGlobalTXT_LocalizationStrings[624];
1283 v95[1] = (char *)v121->pMonsterInfo.uResFire; 1049 v95[1] = (char *)pActors[uActorID].pMonsterInfo.uResFire;
1284 v95[2] = (char *)v121->pMonsterInfo.uResAir; 1050 v95[2] = (char *)pActors[uActorID].pMonsterInfo.uResAir;
1285 v95[3] = (char *)v121->pMonsterInfo.uResWater; 1051 v95[3] = (char *)pActors[uActorID].pMonsterInfo.uResWater;
1286 v95[4] = (char *)v121->pMonsterInfo.uResEarth; 1052 v95[4] = (char *)pActors[uActorID].pMonsterInfo.uResEarth;
1287 v95[5] = (char *)v121->pMonsterInfo.uResMind; 1053 v95[5] = (char *)pActors[uActorID].pMonsterInfo.uResMind;
1288 v95[6] = (char *)v121->pMonsterInfo.uResSpirit; 1054 v95[6] = (char *)pActors[uActorID].pMonsterInfo.uResSpirit;
1289 v95[7] = (char *)v121->pMonsterInfo.uResBody; 1055 v95[7] = (char *)pActors[uActorID].pMonsterInfo.uResBody;
1290 v95[8] = (char *)v121->pMonsterInfo.uResLight; 1056 v95[8] = (char *)pActors[uActorID].pMonsterInfo.uResLight;
1291 v95[9] = (char *)v121->pMonsterInfo.uResPhysical; 1057 v95[9] = (char *)pActors[uActorID].pMonsterInfo.uResPhysical;
1292 v95[10] = (char *)v121->pMonsterInfo.uResDark; 1058 v95[10] = (char *)pActors[uActorID].pMonsterInfo.uResDark;
1293 if ( v112 ) 1059 if ( v112 )
1294 { 1060 {
1295 v124 = 0; 1061 v124 = 0;
1296 do 1062 do
1297 { 1063 {
1306 v81 = pGlobalTXT_LocalizationStrings[627]; 1072 v81 = pGlobalTXT_LocalizationStrings[627];
1307 else 1073 else
1308 v81 = pGlobalTXT_LocalizationStrings[153]; 1074 v81 = pGlobalTXT_LocalizationStrings[153];
1309 } 1075 }
1310 sprintf(pTmpBuf.data(), "%s\f%05u\t070%s\n", v85[v124], 0, v81); 1076 sprintf(pTmpBuf.data(), "%s\f%05u\t070%s\n", v85[v124], 0, v81);
1311 a1->DrawText(v56, 170, a4, a5, pTmpBuf.data(), 0, 0, 0); 1077 window->DrawText(v56, 170, a4, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0);
1312 v63 = LOBYTE(v56->uFontHeight); 1078 v63 = LOBYTE(v56->uFontHeight);
1313 v124 += 4; 1079 v124 += 4;
1314 a4 = a4 + v63 - 3; 1080 a4 = a4 + v63 - 3;
1315 } 1081 }
1316 while ( v124 < 40 ); 1082 while ( v124 < 40 );
1319 { 1085 {
1320 i = 0; 1086 i = 0;
1321 do 1087 do
1322 { 1088 {
1323 sprintf(pTmpBuf.data(), "%s\f%05u\t070%s\n", v85[i], 0, pGlobalTXT_LocalizationStrings[630]); // "?" 1089 sprintf(pTmpBuf.data(), "%s\f%05u\t070%s\n", v85[i], 0, pGlobalTXT_LocalizationStrings[630]); // "?"
1324 a1->DrawText(v56, 170, a4, a5, pTmpBuf.data(), 0, 0, 0); 1090 window->DrawText(v56, 170, a4, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0);
1325 v65 = LOBYTE(v56->uFontHeight); 1091 v65 = LOBYTE(v56->uFontHeight);
1326 ++i; 1092 ++i;
1327 a4 = a4 + v65 - 3; 1093 a4 = a4 + v65 - 3;
1328 } 1094 }
1329 while ( i < 10 ); 1095 while ( i < 10 );
1330 } 1096 }
1331 if ( (signed __int64)pParty->pPartyBuffs[PARTY_BUFF_DETECT_LIFE].uExpireTime > 0 ) 1097 if ( (signed __int64)pParty->pPartyBuffs[PARTY_BUFF_DETECT_LIFE].uExpireTime > 0 )
1332 { 1098 {
1333 sprintf(pTmpBuf.data(), "%s: %d", pGlobalTXT_LocalizationStrings[650], v121->sCurrentHP); 1099 sprintf(pTmpBuf.data(), "%s: %d", pGlobalTXT_LocalizationStrings[650], pActors[uActorID].sCurrentHP);
1334 pFontSmallnum->GetLineWidth(pTmpBuf.data()); 1100 pFontSmallnum->GetLineWidth(pTmpBuf.data());
1335 a1->DrawTitleText(pFontSmallnum, 0, a1->uFrameHeight - LOBYTE(pFontSmallnum->uFontHeight) - 12, 0, pTmpBuf.data(), 3); 1101 window->DrawTitleText(pFontSmallnum, 0, window->uFrameHeight - LOBYTE(pFontSmallnum->uFontHeight) - 12, 0, pTmpBuf.data(), 3);
1336 } 1102 }
1337 } 1103 }
1338 1104
1339 1105
1340 //----- (00417BB5) -------------------------------------------------------- 1106 //----- (00417BB5) --------------------------------------------------------