2501
|
1 #define _CRTDBG_MAP_ALLOC
|
|
2 #include <stdlib.h>
|
|
3 #include <crtdbg.h>
|
|
4
|
|
5 #define _CRT_SECURE_NO_WARNINGS
|
|
6 #include "UIPopup.h"
|
|
7 #include "Books\UIMapBook.h"
|
|
8 #include "UIShops.h"
|
|
9 #include "..\../Engine/MM7.h"
|
|
10
|
2502
|
11 #include "..\../IO/Mouse.h"
|
2501
|
12
|
|
13 #include "..\../Engine/Graphics/Sprites.h"
|
|
14 #include "..\../Engine/Graphics/Vis.h"
|
|
15 #include "..\../Engine/Game.h"
|
2502
|
16 #include "..\../GUI/GUIWindow.h"
|
|
17 #include "..\../GUI/GUIFont.h"
|
2501
|
18 #include "..\../Engine/Party.h"
|
2502
|
19 #include "..\../Media/Audio/AudioPlayer.h"
|
2501
|
20 #include "..\../Engine/LOD.h"
|
|
21 #include "..\../Engine/Objects/Actor.h"
|
|
22 #include "..\../Engine/Graphics/Viewport.h"
|
|
23 #include "..\../Engine/Objects/SpriteObject.h"
|
|
24 #include "..\../Engine/Objects/ObjectList.h"
|
|
25 #include "..\../Engine/Objects/Chest.h"
|
|
26 #include "..\../Engine/Graphics/PaletteManager.h"
|
|
27 #include "..\../Engine/Timer.h"
|
|
28 #include "..\../Engine/texts.h"
|
|
29
|
|
30 #include "..\../Engine/mm7_data.h"
|
|
31 #include "..\../Engine/Events.h"
|
|
32
|
|
33 static char static_sub_417BB5_out_string[1200]; // static to a file, not sub actually
|
|
34
|
|
35
|
|
36 //----- (004179BC) --------------------------------------------------------
|
|
37 void CharacterUI_DrawTooltip(const char *Title, const char *content)
|
|
38 {
|
|
39 GUIWindow popup_window; // [sp+Ch] [bp-5Ch]@1
|
|
40 POINT v6; // [sp+60h] [bp-8h]@1
|
|
41
|
|
42 memset(&popup_window, 0, 0x54u);
|
|
43 popup_window.uFrameWidth = 384;
|
|
44 popup_window.uFrameHeight = 256;
|
|
45 popup_window.uFrameX = 128;
|
|
46 popup_window.uFrameY = pMouse->GetCursorPos(&v6)->y + 30;
|
|
47 popup_window.uFrameHeight = pFontSmallnum->CalcTextHeight(content, &popup_window, 24, 0) + 2 * LOBYTE(pFontLucida->uFontHeight) + 24;
|
|
48 popup_window.uFrameZ = popup_window.uFrameX + popup_window.uFrameWidth - 1;
|
|
49 popup_window.uFrameW = popup_window.uFrameY + popup_window.uFrameHeight - 1;
|
|
50 popup_window.DrawMessageBox(0);
|
|
51
|
|
52 popup_window.uFrameX += 12;
|
|
53 popup_window.uFrameWidth -= 24;
|
|
54 popup_window.uFrameY += 12;
|
|
55 popup_window.uFrameHeight -= 12;
|
|
56 popup_window.uFrameZ = popup_window.uFrameX + popup_window.uFrameWidth - 1;
|
|
57 popup_window.uFrameW = popup_window.uFrameY + popup_window.uFrameHeight - 1;
|
|
58 sprintf(pTmpBuf.data(), "\f%05d%s\f00000\n", ui_character_tooltip_header_default_color, Title);
|
|
59 popup_window.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf.data(), 3);
|
|
60 popup_window.DrawText(pFontSmallnum, 1, LOBYTE(pFontLucida->uFontHeight), 0, content, 0, 0, 0);
|
|
61 }
|
|
62
|
|
63 //----- (004151D9) --------------------------------------------------------
|
|
64 void __fastcall DrawPopupWindow(unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight)
|
|
65 {
|
|
66 unsigned int uNumTiles; // [sp+2Ch] [bp-Ch]@6
|
|
67 unsigned int coord_x; // [sp+2Ch] [bp-Ch]@3
|
|
68 unsigned int coord_y; // [sp+34h] [bp-4h]@5
|
|
69
|
2524
|
70 auto parchment = pIcons_LOD->GetTexture(uTextureID_Parchment);
|
|
71
|
|
72 if ( parchment->uTextureWidth && parchment->uTextureHeight)
|
2501
|
73 {
|
2524
|
74 pRenderer->SetUIClipRect(uX, uY, uX + uWidth, uY + uHeight);
|
|
75
|
|
76 uNumTiles = uWidth / parchment->uTextureWidth;
|
|
77 if ( uWidth % parchment->uTextureWidth )
|
2501
|
78 ++uNumTiles;
|
|
79 coord_y = uY;
|
2524
|
80 for ( uint j = 0; j <= uHeight / parchment->uTextureHeight; j++ )
|
2501
|
81 {
|
2524
|
82 coord_x = uX - parchment->uTextureWidth;
|
2501
|
83 for ( uint i = uNumTiles + 1; i; --i )
|
|
84 {
|
2524
|
85 coord_x += parchment->uTextureWidth;
|
|
86 pRenderer->DrawTextureIndexed(coord_x, coord_y, parchment);
|
2501
|
87 }
|
2524
|
88 coord_y += parchment->uTextureHeight;
|
2501
|
89 }
|
2524
|
90 pRenderer->DrawTextureIndexedAlpha(uX, uY, pIcons_LOD->GetTexture(uTextureID_5076AC));
|
|
91 pRenderer->DrawTextureIndexedAlpha(uX, uY + uHeight - 32, pIcons_LOD->GetTexture(uTextureID_5076B4));
|
|
92 pRenderer->DrawTextureIndexedAlpha(uX + uWidth - 32, uY, pIcons_LOD->GetTexture(uTextureID_5076A8));
|
|
93 pRenderer->DrawTextureIndexedAlpha(uX + uWidth - 32, uY + uHeight - 32, pIcons_LOD->GetTexture(uTextureID_5076B0));
|
2501
|
94 if ( uWidth > 64 )
|
|
95 {
|
2524
|
96 pRenderer->SetUIClipRect(uX + 32, uY, uX + uWidth - 32, uY + uHeight);
|
|
97 pRenderer->DrawTextureIndexedAlpha(uX + 32, uY, pIcons_LOD->GetTexture(uTextureID_507698));
|
|
98 pRenderer->DrawTextureIndexedAlpha(uX + 32, uY + uHeight - 10, pIcons_LOD->GetTexture(uTextureID_5076A4));
|
2501
|
99 if ( uWidth > 512 )
|
|
100 {
|
2524
|
101 pRenderer->DrawTextureIndexedAlpha(uX + 544, uY, pIcons_LOD->GetTexture(uTextureID_507698));
|
|
102 pRenderer->DrawTextureIndexedAlpha(uX + 544, uY + uHeight - 10, pIcons_LOD->GetTexture(uTextureID_5076A4));
|
2501
|
103 }
|
|
104 }
|
|
105 if ( uHeight > 64 )
|
|
106 {
|
2524
|
107 pRenderer->SetUIClipRect(uX, uY + 32, uX + uWidth, uY + uHeight - 32);
|
|
108 pRenderer->DrawTextureIndexedAlpha(uX, uY + 32, pIcons_LOD->GetTexture(uTextureID_5076A0));
|
|
109 pRenderer->DrawTextureIndexedAlpha(uX + uWidth - 10, uY + 32, pIcons_LOD->GetTexture(uTextureID_50769C));
|
2501
|
110 }
|
2524
|
111 pRenderer->ResetUIClipRect();
|
2501
|
112 }
|
|
113 }
|
|
114
|
|
115 //----- (0041D895) --------------------------------------------------------
|
|
116 void GameUI_DrawItemInfo( struct ItemGen* inspect_item )
|
|
117 {
|
|
118 unsigned int v2; // eax@3
|
|
119 const char *v28; // edi@69
|
|
120 int v34; // esi@81
|
|
121 const char *pText; // [sp-14h] [bp-28Ch]@110
|
|
122 char out_text[300]; // [sp+8h] [bp-270h]@40
|
|
123 char v65[120]; // [sp+134h] [bp-144h]@92
|
|
124 stru351_summoned_item v67;
|
|
125 int v77; // [sp+200h] [bp-78h]@12
|
|
126 int v78; // [sp+204h] [bp-74h]@5
|
|
127 GUIWindow iteminfo_window; // [sp+208h] [bp-70h]@2
|
|
128 POINT a2; // [sp+25Ch] [bp-1Ch]@2
|
|
129 int v81; // [sp+264h] [bp-14h]@5
|
|
130 PlayerSpeech v83; // [sp+26Ch] [bp-Ch]@18
|
|
131 char* v84;
|
|
132 int v85;
|
|
133 char *Str; // [sp+270h] [bp-8h]@65
|
|
134
|
|
135 int r_mask = 0xF800;
|
|
136 int g_mask = 0x7E0;
|
|
137 int b_mask = 0x1F;
|
|
138
|
|
139 if (!inspect_item->uItemID)
|
|
140 return;
|
|
141 iteminfo_window.Hint = nullptr;
|
|
142 iteminfo_window.uFrameWidth = 384;
|
|
143 iteminfo_window.uFrameHeight = 180;
|
|
144 iteminfo_window.uFrameY = 40;
|
|
145 if ( pMouse->GetCursorPos(&a2)->x <= 320 )
|
|
146 v2 = pMouse->GetCursorPos(&a2)->x + 30;
|
|
147 else
|
|
148 v2 = pMouse->GetCursorPos(&a2)->x - iteminfo_window.uFrameWidth - 30;
|
|
149 iteminfo_window.uFrameX = v2;
|
|
150 v78 = 100 - pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE)->uTextureWidth;
|
|
151 v81 = 144 - pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE)->uTextureHeight;
|
|
152 if ( v78 > 0 )
|
|
153 v78 = v78 / 2;
|
|
154 if ( v81 <= 0 )
|
|
155 v81 = 0;
|
|
156 else
|
|
157 v81 = v81 / 2;
|
|
158 if ( !pItemsTable->pItems[inspect_item->uItemID].uItemID_Rep_St )
|
|
159 inspect_item->SetIdentified();
|
|
160 v77 = 0;
|
|
161 if (inspect_item->GetItemEquipType() == EQUIP_GOLD)
|
|
162 v77 = inspect_item->uSpecEnchantmentType;
|
|
163 if ( uActiveCharacter )
|
|
164 {
|
|
165 //try to identify
|
|
166 if (!inspect_item->IsIdentified())
|
|
167 {
|
|
168 if ( pPlayers[uActiveCharacter]->CanIdentify(inspect_item) == 1 )
|
|
169 inspect_item->SetIdentified();
|
|
170 v83 = SPEECH_9;
|
|
171 if ( !inspect_item->IsIdentified() )
|
|
172 ShowStatusBarString(pGlobalTXT_LocalizationStrings[446], 2);//"Identify Failed"
|
|
173 else
|
|
174 {
|
|
175 v83 = SPEECH_8;
|
|
176 if ( inspect_item->GetValue() < 100 * (pPlayers[uActiveCharacter]->uLevel + 5) )
|
|
177 v83 = SPEECH_7;
|
|
178 }
|
|
179 if ( dword_4E455C )
|
|
180 {
|
|
181 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)(int)v83, 0);
|
|
182 dword_4E455C = 0;
|
|
183 }
|
|
184 }
|
|
185 inspect_item->UpdateTempBonus(pParty->uTimePlayed);
|
|
186 if (inspect_item->IsBroken())
|
|
187 {
|
|
188 if ( pPlayers[uActiveCharacter]->CanRepair(inspect_item) == 1 )
|
|
189 inspect_item->uAttributes = inspect_item->uAttributes & 0xFFFFFFFD | 1;
|
|
190 v83 = SPEECH_11;
|
|
191 if ( !inspect_item->IsBroken() )
|
|
192 v83 = SPEECH_10;
|
|
193 else
|
|
194 ShowStatusBarString(pGlobalTXT_LocalizationStrings[448], 2);//"Repair Failed"
|
|
195 if ( dword_4E455C )
|
|
196 {
|
|
197 pPlayers[uActiveCharacter]->PlaySound(v83, 0);
|
|
198 dword_4E455C = 0;
|
|
199 }
|
|
200 }
|
|
201 }
|
|
202 if (inspect_item->IsBroken())
|
|
203 {
|
|
204 iteminfo_window.DrawMessageBox(0);
|
2524
|
205 pRenderer->SetUIClipRect(iteminfo_window.uFrameX + 12, iteminfo_window.uFrameY + 12,
|
2501
|
206 iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 12,
|
|
207 iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 12);
|
|
208 iteminfo_window.uFrameWidth -= 24;
|
|
209 iteminfo_window.uFrameHeight -= 12;
|
|
210 iteminfo_window.uFrameZ = iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 1;
|
|
211 iteminfo_window.uFrameW = iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 1;
|
|
212 pRenderer->DrawTransparentRedShade(iteminfo_window.uFrameX + v78, v81 + iteminfo_window.uFrameY + 30, pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE));
|
|
213 if ( inspect_item->IsIdentified())
|
|
214 pText = (char *)inspect_item->GetIdentifiedName();
|
|
215 else
|
|
216 pText = pItemsTable->pItems[inspect_item->uItemID].pUnidentifiedName;
|
|
217 iteminfo_window.DrawTitleText(pFontArrus, 0, 0xCu, Color16(0xFFu, 0xFFu, 0x9Bu), pText, 3);
|
|
218 iteminfo_window.DrawTitleText(pFontArrus, 0x64u, ((signed int)iteminfo_window.uFrameHeight >> 1) - pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[32], &iteminfo_window, 0, 0) / 2,
|
|
219 Color16(0xFFu, 0x19u, 0x19u), pGlobalTXT_LocalizationStrings[32], 3); //"Broken Item"
|
2524
|
220 pRenderer->ResetUIClipRect();
|
2501
|
221 if ( !areWeLoadingTexture )
|
|
222 {
|
|
223 pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE)->Release();
|
|
224 pIcons_LOD->SyncLoadedFilesCount();
|
|
225 }
|
|
226 return;
|
|
227 }
|
|
228 if (!inspect_item->IsIdentified())
|
|
229 {
|
|
230 iteminfo_window.DrawMessageBox(0);
|
2524
|
231 pRenderer->SetUIClipRect(iteminfo_window.uFrameX + 12, iteminfo_window.uFrameY + 12,
|
2501
|
232 iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 12, iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 12);
|
|
233 iteminfo_window.uFrameWidth -= 24;
|
|
234 iteminfo_window.uFrameHeight -= 12;
|
|
235 iteminfo_window.uFrameZ = iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 1;
|
|
236 iteminfo_window.uFrameW = iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 1;
|
2524
|
237 pRenderer->DrawTextureIndexedAlpha(iteminfo_window.uFrameX + v78, v81 + iteminfo_window.uFrameY + 30, pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE));
|
2501
|
238 iteminfo_window.DrawTitleText(pFontArrus, 0, 0xCu, Color16(0xFFu, 0xFFu, 0x9Bu), pItemsTable->pItems[inspect_item->uItemID].pUnidentifiedName, 3);
|
|
239 iteminfo_window.DrawTitleText(pFontArrus, 0x64u, ((signed int)iteminfo_window.uFrameHeight >> 1) - pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[232], &iteminfo_window, 0, 0) / 2,
|
|
240 Color16(0xFFu, 0x19u, 0x19u), pGlobalTXT_LocalizationStrings[232], 3);//"Not Identified"
|
2524
|
241 pRenderer->ResetUIClipRect();
|
2501
|
242 if ( !areWeLoadingTexture )
|
|
243 {
|
|
244 pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE)->Release();
|
|
245 pIcons_LOD->SyncLoadedFilesCount();
|
|
246 }
|
|
247 return;
|
|
248 }
|
|
249 sprintfex(out_text, pGlobalTXT_LocalizationStrings[463], pItemsTable->pItems[inspect_item->uItemID].pUnidentifiedName); //"Type: %s"
|
|
250 out_text[100] = 0;
|
|
251 out_text[200] = 0;
|
|
252 switch (inspect_item->GetItemEquipType())
|
|
253 {
|
|
254 case EQUIP_SINGLE_HANDED:
|
|
255 case EQUIP_TWO_HANDED:
|
|
256 sprintfex(out_text + 100, "%s: +%d %s: %dd%d", pGlobalTXT_LocalizationStrings[LOCSTR_ATTACK],
|
|
257 (int)inspect_item->GetDamageMod(), pGlobalTXT_LocalizationStrings[53],
|
|
258 (int)inspect_item->GetDamageDice(), (int)inspect_item->GetDamageRoll()); //"Damage"
|
|
259 if (inspect_item->GetDamageMod())
|
|
260 {
|
|
261 char mod[16];
|
|
262 sprintf(mod, "+%d", (int)inspect_item->GetDamageMod());
|
|
263 strcat(out_text + 100, mod);
|
|
264 }
|
|
265 break;
|
|
266
|
|
267 case EQUIP_BOW:
|
|
268 sprintfex(out_text + 100, "%s: +%d %s: %dd%d", pGlobalTXT_LocalizationStrings[203], //"Shoot"
|
|
269 (int)inspect_item->GetDamageMod(), pGlobalTXT_LocalizationStrings[53], //"Damage"
|
|
270 (int)inspect_item->GetDamageDice(), (int)inspect_item->GetDamageRoll());
|
|
271 if (inspect_item->GetDamageMod())
|
|
272 {
|
|
273 char mod[16];
|
|
274 sprintf(mod, "+%d", (int)inspect_item->GetDamageMod());
|
|
275 strcat(out_text + 100, mod);
|
|
276 }
|
|
277 break;
|
|
278
|
|
279 case EQUIP_ARMOUR:
|
|
280 case EQUIP_SHIELD:
|
|
281 case EQUIP_HELMET:
|
|
282 case EQUIP_BELT:
|
|
283 case EQUIP_CLOAK:
|
|
284 case EQUIP_GAUNTLETS:
|
|
285 case EQUIP_BOOTS:
|
|
286 case EQUIP_RING:
|
|
287 case EQUIP_AMULET:
|
|
288 if (inspect_item->GetDamageDice()) //"Armor"
|
|
289 sprintfex(out_text + 100, "%s: +%d", pGlobalTXT_LocalizationStrings[11],
|
|
290 inspect_item->GetDamageDice() + inspect_item->GetDamageMod());
|
|
291 break;
|
|
292 }
|
|
293
|
|
294 if ( !v77 )
|
|
295 {
|
|
296 if (inspect_item->GetItemEquipType() ==EQUIP_POTION) //this is CORRECT! do not move to switch!
|
|
297 {
|
|
298 if ( inspect_item->uEnchantmentType )
|
|
299 sprintf(out_text + 200, "%s: %d",pGlobalTXT_LocalizationStrings[449] , inspect_item->uEnchantmentType); //"Power"
|
|
300 }
|
|
301 else if (inspect_item->GetItemEquipType() == EQUIP_REAGENT)
|
|
302 sprintf(out_text + 200, "%s: %d", pGlobalTXT_LocalizationStrings[449], inspect_item->GetDamageDice()); //"Power"
|
|
303 else if ( inspect_item->uEnchantmentType )
|
|
304 sprintf(out_text + 200, "%s: %s +%d", pGlobalTXT_LocalizationStrings[210], pItemsTable->pEnchantments[inspect_item->uEnchantmentType-1].pBonusStat, inspect_item->m_enchantmentStrength); //"Special"
|
|
305 else if ( inspect_item->uSpecEnchantmentType )
|
|
306 sprintf(out_text + 200, "%s: %s", pGlobalTXT_LocalizationStrings[210], pItemsTable->pSpecialEnchantments[inspect_item->uSpecEnchantmentType-1].pBonusStatement);
|
|
307 else if ( inspect_item->uNumCharges )
|
|
308 sprintf(out_text + 200, "%s: %lu", pGlobalTXT_LocalizationStrings[464], inspect_item->uNumCharges); //"Charges"
|
|
309 }
|
|
310 iteminfo_window.uFrameWidth -= 12;
|
|
311 iteminfo_window.uFrameZ = iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 1;
|
|
312 iteminfo_window.uFrameW = iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 1;
|
|
313 Str = (char *)(3 * (LOBYTE(pFontArrus->uFontHeight) + 8));
|
|
314 v84 = &out_text[0];
|
|
315 for ( uint i = 1; i <= 3; i++ )
|
|
316 {
|
|
317 if ( *v84 )
|
|
318 Str += pFontComic->CalcTextHeight(v84, &iteminfo_window, 100, 0) + 3;
|
|
319 v84 += 100;
|
|
320 }
|
|
321 v28 = pItemsTable->pItems[inspect_item->uItemID].pDescription;
|
|
322 if ( *v28 )
|
|
323 Str += pFontSmallnum->CalcTextHeight(pItemsTable->pItems[inspect_item->uItemID].pDescription, &iteminfo_window, 100, 0);
|
|
324 iteminfo_window.uFrameHeight = pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(),
|
|
325 TEXTURE_16BIT_PALETTE)->uTextureHeight + v81 + 54;
|
|
326 if ( (signed int)Str > (signed int)iteminfo_window.uFrameHeight )
|
|
327 iteminfo_window.uFrameHeight = (unsigned int)Str;
|
|
328 if ( inspect_item->uAttributes & ITEM_TEMP_BONUS && (inspect_item->uSpecEnchantmentType || inspect_item->uEnchantmentType) )
|
|
329 iteminfo_window.uFrameHeight += LOBYTE(pFontComic->uFontHeight);
|
|
330 v85 = 0;
|
|
331 if ( pFontArrus->uFontHeight )
|
|
332 {
|
|
333 iteminfo_window.uFrameWidth -= 24;
|
|
334 if ( pFontArrus->CalcTextHeight(inspect_item->GetIdentifiedName(), &iteminfo_window, 0, 0) / (signed int)pFontArrus->uFontHeight )
|
|
335 v85 = pFontArrus->uFontHeight;
|
|
336 iteminfo_window.uFrameWidth += 24;
|
|
337 }
|
|
338 iteminfo_window.uFrameWidth += 12;
|
|
339 iteminfo_window.uFrameHeight += (unsigned int)v85;
|
|
340 iteminfo_window.uFrameW = iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 1;
|
|
341 iteminfo_window.uFrameZ = iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 1;
|
|
342 iteminfo_window.DrawMessageBox(0);
|
2524
|
343 pRenderer->SetUIClipRect(iteminfo_window.uFrameX + 12, iteminfo_window.uFrameY + 12,
|
2501
|
344 iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 12, iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 12);
|
|
345 iteminfo_window.uFrameWidth -= 12;
|
|
346 iteminfo_window.uFrameHeight -= 12;
|
|
347 iteminfo_window.uFrameZ = iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 1;
|
|
348 iteminfo_window.uFrameW = iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 1;
|
2524
|
349 pRenderer->DrawTextureIndexedAlpha(iteminfo_window.uFrameX + v78,
|
2501
|
350 iteminfo_window.uFrameY + (signed int)(iteminfo_window.uFrameHeight - pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE)->uTextureHeight) / 2,
|
|
351 pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE));
|
|
352
|
|
353 v34 = (int)(v85 + 35);
|
|
354 Str = out_text;
|
|
355 for ( uint i = 1; i <= 3; i++ )
|
|
356 {
|
|
357 if ( *Str )
|
|
358 {
|
|
359 iteminfo_window.DrawText(pFontComic, 100, v34, 0, Str, 0, 0, 0);
|
|
360 v34 += pFontComic->CalcTextHeight(Str, &iteminfo_window, 100, 0) + 3;
|
|
361 }
|
|
362 Str += 100;
|
|
363 }
|
|
364 v28 = pItemsTable->pItems[inspect_item->uItemID].pDescription;
|
|
365 if ( *v28 )
|
|
366 iteminfo_window.DrawText(pFontSmallnum, 100, v34, 0, v28, 0, 0, 0);
|
|
367 iteminfo_window.uFrameX += 12;
|
|
368 iteminfo_window.uFrameWidth -= 24;
|
|
369 iteminfo_window.DrawTitleText(pFontArrus, 0, 0xCu, Color16(0xFFu, 0xFFu, 0x9Bu), inspect_item->GetIdentifiedName(), 3);
|
|
370 iteminfo_window.uFrameWidth += 24;
|
|
371 iteminfo_window.uFrameX -= 12;
|
|
372 if ( v77 )
|
|
373 {
|
|
374 sprintf(pTmpBuf.data(), "%s: %lu", pGlobalTXT_LocalizationStrings[465], v77);//"Value"
|
|
375 iteminfo_window.DrawText(pFontComic, 100, iteminfo_window.uFrameHeight - LOBYTE(pFontComic->uFontHeight), 0, pTmpBuf.data(), 0, 0, 0);
|
2524
|
376 pRenderer->ResetUIClipRect();
|
2501
|
377 }
|
|
378 else
|
|
379 {
|
|
380 if ( (inspect_item->uAttributes & ITEM_TEMP_BONUS) && (inspect_item->uSpecEnchantmentType || inspect_item->uEnchantmentType) )
|
|
381 {
|
|
382 init_summoned_item(&v67, inspect_item->uExpireTime - pParty->uTimePlayed);
|
|
383 strcpy(pTmpBuf.data(), "Duration:");
|
|
384 Str = (char *)(v67.field_18_expire_year - game_starting_year);
|
|
385 if (v67.field_18_expire_year != 1168 )
|
|
386 {
|
|
387 sprintf(v65, " %d:yr", v67.field_18_expire_year - game_starting_year);
|
|
388 strcat(pTmpBuf.data(), v65);
|
|
389 }
|
|
390 if ( (((v67.field_14_exprie_month || Str) &&
|
|
391 ((sprintf(v65, " %d:mo", v67.field_14_exprie_month), strcat(pTmpBuf.data(), v65), v67.field_14_exprie_month) || Str)
|
|
392 || v67.field_C_expire_day)
|
|
393 && ((sprintf(v65, " %d:dy", v67.field_C_expire_day), strcat(pTmpBuf.data(), v65), v67.field_14_exprie_month) || Str ||
|
|
394 v67.field_C_expire_day)
|
|
395 || v67.field_8_expire_hour)
|
|
396 && ((sprintf(v65, " %d:hr", v67.field_8_expire_hour), strcat(pTmpBuf.data(), v65), v67.field_14_exprie_month) || Str ||
|
|
397 v67.field_C_expire_day || v67.field_8_expire_hour)
|
|
398 || v67.field_4_expire_minute )
|
|
399 {
|
|
400 sprintf(v65, " %d:mn", v67.field_4_expire_minute);
|
|
401 strcat(pTmpBuf.data(), v65);
|
|
402 }
|
|
403 iteminfo_window.DrawText(pFontComic, 100, iteminfo_window.uFrameHeight - 2 * LOBYTE(pFontComic->uFontHeight), 0, pTmpBuf.data(), 0, 0, 0);
|
|
404 }
|
|
405 sprintf(pTmpBuf.data(), "%s: %lu", pGlobalTXT_LocalizationStrings[465], inspect_item->GetValue());
|
|
406 iteminfo_window.DrawText(pFontComic, 100, iteminfo_window.uFrameHeight - LOBYTE(pFontComic->uFontHeight), 0, pTmpBuf.data(), 0, 0, 0);
|
|
407 if ( inspect_item->uAttributes & ITEM_STOLEN )
|
|
408 pText = pGlobalTXT_LocalizationStrings[187]; //"Stolen"
|
|
409 else
|
|
410 {
|
|
411 if ( !(inspect_item->uAttributes & ITEM_HARDENED) )
|
|
412 {
|
2524
|
413 pRenderer->ResetUIClipRect();
|
2501
|
414 if ( !areWeLoadingTexture )
|
|
415 {
|
|
416 pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE)->Release();
|
|
417 pIcons_LOD->SyncLoadedFilesCount();
|
|
418 }
|
|
419 return;
|
|
420 }
|
|
421 pText = pGlobalTXT_LocalizationStrings[651]; //"Hardened"
|
|
422 }
|
|
423 LOWORD(inspect_item->uAttributes) = r_mask;
|
|
424 iteminfo_window.DrawText(pFontComic, pFontComic->GetLineWidth(pTmpBuf.data()) + 132,
|
|
425 iteminfo_window.uFrameHeight - LOBYTE(pFontComic->uFontHeight), inspect_item->uAttributes, pText, 0, 0, 0);
|
2524
|
426 pRenderer->ResetUIClipRect();
|
2501
|
427 }
|
|
428 if ( !areWeLoadingTexture )
|
|
429 {
|
|
430 pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE)->Release();
|
|
431 pIcons_LOD->SyncLoadedFilesCount();
|
|
432 }
|
|
433 return;
|
|
434 }
|
|
435 // 4E455C: using guessed type int dword_4E455C;
|
|
436 // 506128: using guessed type int areWeLoadingTexture;
|
|
437
|
|
438 //----- (0041E360) --------------------------------------------------------
|
|
439 void MonsterPopup_Draw(unsigned int uActorID, GUIWindow *pWindow)
|
|
440 {
|
|
441 unsigned __int16 v9; // dx@4
|
|
442 SpriteFrame *v10; // edi@17
|
|
443 unsigned int v18; // ecx@19
|
|
444 unsigned int v19; // eax@21
|
|
445 int skill_points; // edi@61
|
|
446 unsigned int skill_level; // eax@61
|
|
447 int pTextHeight; // edi@90
|
|
448 PlayerSpeech speech; // [sp-8h] [bp-1F4h]@79
|
|
449 DDBLTFX Dst; // [sp+Ch] [bp-1E0h]@18
|
|
450 DDSURFACEDESC2 pDesc; // [sp+70h] [bp-17Ch]@18
|
|
451 RECT dest_rect; // [sp+ECh] [bp-100h]@26
|
|
452 const char *string_name[10]; // [sp+FCh] [bp-F0h]@145
|
|
453 const char *content[11]; // [sp+124h] [bp-C8h]@127
|
|
454 unsigned char resistances[11]; // [sp+124h] [bp-C8h]@127
|
|
455 RenderBillboardTransform_local0 v106; // [sp+150h] [bp-9Ch]@3
|
|
456 unsigned int v107; // [sp+1A0h] [bp-4Ch]@18
|
|
457 bool for_effects; // [sp+1C0h] [bp-2Ch]@3
|
|
458 bool normal_level; // [sp+1D0h] [bp-1Ch]@18
|
|
459 bool expert_level; // [sp+1C4h] [bp-28h]@18
|
|
460 bool master_level; // [sp+1C8h] [bp-24h]@18
|
|
461 bool grandmaster_level; // [sp+1B4h] [bp-38h]@3
|
|
462 const char *pText; // [sp+1D4h] [bp-18h]@18
|
|
463 int pTextColorID; // [sp+1E4h] [bp-8h]@18
|
|
464 int v115;
|
|
465
|
|
466 bool monster_full_informations = false;
|
|
467 static Actor pMonsterInfoUI_Doll;
|
|
468 if ( !uActiveCharacter ) //
|
|
469 uActiveCharacter = 1;
|
|
470
|
|
471 /*if ( !(bMonsterInfoUI_bDollInitialized & 1) )
|
|
472 {
|
|
473 bMonsterInfoUI_bDollInitialized |= 1u;
|
|
474 Actor::Actor(&pMonsterInfoUI_Doll);
|
|
475 atexit(nullsub_3);
|
|
476 }*/
|
|
477 v106.sParentBillboardID = -1;
|
|
478 v115 = monster_popup_y_offsets[((signed __int16)pActors[uActorID].pMonsterInfo.uID - 1) / 3] - 40;
|
|
479 if ( pActors[uActorID].pMonsterInfo.uID == pMonsterInfoUI_Doll.pMonsterInfo.uID )
|
|
480 v9 = pMonsterInfoUI_Doll.uCurrentActionLength;
|
|
481 else
|
|
482 {
|
|
483 memcpy(&pMonsterInfoUI_Doll, &pActors[uActorID], sizeof(pMonsterInfoUI_Doll));
|
|
484 pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_Bored;
|
|
485 pMonsterInfoUI_Doll.uCurrentActionTime = 0;
|
|
486 v9 = rand() % 256 + 128;
|
|
487 pMonsterInfoUI_Doll.uCurrentActionLength = v9;
|
|
488 }
|
|
489
|
|
490 if ( (signed int)pMonsterInfoUI_Doll.uCurrentActionTime > (signed __int16)v9 )
|
|
491 {
|
|
492 pMonsterInfoUI_Doll.uCurrentActionTime = 0;
|
|
493 if ( pMonsterInfoUI_Doll.uCurrentActionAnimation == ANIM_Bored || pMonsterInfoUI_Doll.uCurrentActionAnimation == ANIM_AtkMelee)
|
|
494 {
|
|
495 pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_Standing;
|
|
496 pMonsterInfoUI_Doll.uCurrentActionLength = rand() % 128 + 128;
|
|
497 }
|
|
498 else
|
|
499 {
|
|
500 //rand();
|
|
501 pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_Bored;
|
|
502 if ( (pMonsterInfoUI_Doll.pMonsterInfo.uID < 115 || pMonsterInfoUI_Doll.pMonsterInfo.uID > 186) &&
|
|
503 (pMonsterInfoUI_Doll.pMonsterInfo.uID < 232 || pMonsterInfoUI_Doll.pMonsterInfo.uID > 249) && rand() % 30 < 100 )
|
|
504 pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_AtkMelee;
|
|
505 pMonsterInfoUI_Doll.uCurrentActionLength = 8 * pSpriteFrameTable->pSpriteSFrames[pActors[uActorID].pSpriteIDs[(signed __int16)pMonsterInfoUI_Doll.uCurrentActionAnimation]].uAnimLength;
|
|
506 }
|
|
507 }
|
|
508 v10 = pSpriteFrameTable->GetFrame( pActors[uActorID].pSpriteIDs[pMonsterInfoUI_Doll.uCurrentActionAnimation], pMonsterInfoUI_Doll.uCurrentActionTime);
|
|
509 v106.pTarget = pRenderer->pTargetSurface;
|
|
510 v106.pTargetZ = pRenderer->pActiveZBuffer;
|
|
511 v106.uTargetPitch = pRenderer->uTargetSurfacePitch;
|
|
512 v106.uViewportX = pWindow->uFrameX + 13;
|
|
513 v106.uViewportY = pWindow->uFrameY + 52;
|
|
514 v106.uViewportW = (pWindow->uFrameY + 52) + 128;
|
|
515 v106.uViewportZ = v106.uViewportX + 128;
|
|
516 v106.uScreenSpaceX = (signed int)(v106.uViewportX + 128 + v106.uViewportX) / 2;
|
|
517 v106._screenspace_x_scaler_packedfloat = 65536;
|
|
518 v106._screenspace_y_scaler_packedfloat = 65536;
|
|
519 v106.uScreenSpaceY = v115 + (pWindow->uFrameY + 52) + pSprites_LOD->pSpriteHeaders[v10->pHwSpriteIDs[0]].uHeight;
|
|
520 v106.pPalette = PaletteManager::Get_Dark_or_Red_LUT(v10->uPaletteIndex, 0, 1);
|
|
521 v106.sZValue = 0;
|
|
522 v106.uFlags = 0;
|
|
523 pRenderer->SetRasterClipRect(0, 0, window->GetWidth() - 1, window->GetHeight() - 1);
|
|
524 pRenderer->RasterLine2D(v106.uViewportX - 1, v106.uViewportY - 1, v106.uViewportX + 129, v106.uViewportY - 1, Color16(0xE1u, 255, 0x9Bu));//ãîðèçîíòàëüíàÿ âåðõíÿÿ ëèíèÿ
|
|
525 pRenderer->RasterLine2D(v106.uViewportX - 1, v106.uViewportW + 1, v106.uViewportX - 1, v106.uViewportY - 1, Color16(0xE1u, 255, 0x9Bu));//ãîðèçîíòàëüíàÿ íèæíÿÿ ëèíèÿ
|
|
526 pRenderer->RasterLine2D(v106.uViewportX + 129, v106.uViewportW + 1, v106.uViewportX - 1, v106.uViewportW + 1, Color16(0xE1u, 255, 0x9Bu));//ëåâàÿ âåðòèêàëüíàÿ ëèíèÿ
|
|
527 pRenderer->RasterLine2D(v106.uViewportX + 129, v106.uViewportY - 1, v106.uViewportX + 129, v106.uViewportW + 1, Color16(0xE1u, 255, 0x9Bu));//ïðàâàÿ âåðòèêàëüíàÿ ëèíèÿ
|
|
528 //if ( pRenderer->pRenderD3D )
|
|
529 {
|
|
530 v106.uScreenSpaceY = v115 + v106.uViewportY + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uBufferHeight;
|
|
531
|
|
532 memset(&Dst, 0, sizeof(Dst));
|
|
533 Dst.dwSize = sizeof(Dst);
|
|
534 Dst.dwFillColor = 0;
|
|
535
|
|
536 memset(&pDesc, 0, sizeof(pDesc));
|
|
537 pDesc.dwSize = sizeof(pDesc);
|
|
538
|
|
539 pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].pTextureSurface->GetSurfaceDesc(&pDesc);
|
|
540 v107 = 0;
|
|
541 uint i = 0;
|
|
542 int dst_x = v106.uScreenSpaceX + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaX - pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uBufferWidth / 2;
|
|
543 int dst_y = v106.uScreenSpaceY + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaY - pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uBufferHeight;
|
|
544 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;
|
|
545 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;
|
|
546 if (dst_x < v106.uViewportX)
|
|
547 {
|
|
548 v18 = v106.uViewportX - dst_x;
|
|
549 dst_x = v106.uViewportX;
|
|
550 v107 = v18;
|
|
551 }
|
|
552 if (dst_y < v106.uViewportY)
|
|
553 {
|
|
554 v19 = v106.uViewportY - dst_y;
|
|
555 dst_y = v106.uViewportY;
|
|
556 i = v19;
|
|
557 }
|
|
558 if (dst_z > v106.uViewportZ)
|
|
559 dst_z = v106.uViewportZ;
|
|
560 if (dst_w > v106.uViewportW)
|
|
561 dst_w = v106.uViewportW;
|
|
562 pRenderer->FillRectFast(v106.uViewportX, v106.uViewportY, v106.uViewportZ - v106.uViewportX, v106.uViewportW - v106.uViewportY, 0x7FF);
|
|
563 pRenderer->FillRectFast(v106.uViewportX, v106.uViewportY, v106.uViewportZ - v106.uViewportX, v106.uViewportW - v106.uViewportY, 0x7FF);
|
|
564 dest_rect.left = v106.uViewportX;
|
|
565 dest_rect.top = v106.uViewportY;
|
|
566 dest_rect.right = v106.uViewportZ;
|
|
567 dest_rect.bottom = v106.uViewportW;
|
|
568
|
|
569 ErrD3D(pRenderer->pBackBuffer4->Blt(&dest_rect, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &Dst));
|
|
570 /*if ( pRenderer->uTargetGBits == 5 )
|
|
571 {
|
|
572 __debugbreak(); // no monster popup for r5g5b5 will be
|
|
573 memset(&pDesc, 0, 0x7Cu);
|
|
574 pDesc.dwSize = 124;
|
|
575 if ( pRenderer->LockSurface_DDraw4(pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].pTextureSurface, &pDesc, DDLOCK_WAIT))
|
|
576 {
|
|
577 v20 = (char *)dst_y;
|
|
578 v110 = pDesc.lpSurface;
|
|
579 if (dst_y < dst_w)
|
|
580 {
|
|
581 v21 = dst_x;
|
|
582 //v22 = &pRenderer->pTargetSurface[dst_y * pRenderer->uTargetSurfacePitch + dst_x];
|
|
583 ushort* _v22_2 = v22;
|
|
584 v23 = i - dst_y;
|
|
585 v115 = i - dst_y;
|
|
586 while ( 1 )
|
|
587 {
|
|
588 dst_y = v21;
|
|
589 if ( v21 < dst_z )
|
|
590 {
|
|
591 v25 = v107 - v21;
|
|
592 v109 = (int)&v20[v23];
|
|
593 for ( i = v107 - v21; ; v25 = i )
|
|
594 {
|
|
595 v108 = (unsigned __int16 *)((pDesc.lPitch >> 1) * pDesc.dwHeight * v109 / pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaHeight);
|
|
596 v26 = (char *)v108 + pDesc.dwWidth * (v25 + dst_y++) / pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaWidth;
|
|
597 *v22 = *((short *)v110 + (int)v26);
|
|
598 ++v22;
|
|
599 if ( dst_y >= dst_z )
|
|
600 break;
|
|
601 }
|
|
602 v23 = v115;
|
|
603 }
|
|
604 v22 = (unsigned __int16 *)((char *)_v22_2 + 2 * pRenderer->uTargetSurfacePitch);
|
|
605 _v22_2 = v22;
|
|
606 v20 = (char *)(dst_y + 1);
|
|
607 v28 = __OFSUB__(dst_y + 1, dst_w);
|
|
608 v27 = (signed int)(dst_y++ + 1 - dst_w) < 0;
|
|
609 if ( !(v27 ^ v28) )
|
|
610 break;
|
|
611 v21 = dst_x;
|
|
612 }
|
|
613 }
|
|
614 pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].pTextureSurface->Unlock(0);
|
|
615 }
|
|
616 }
|
|
617 else*/
|
|
618 {
|
|
619 memset(&pDesc, 0, sizeof(pDesc));
|
|
620 pDesc.dwSize = sizeof(pDesc);
|
|
621 if ( pRenderer->LockSurface_DDraw4(pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].pTextureSurface, &pDesc, DDLOCK_WAIT) )
|
|
622 {
|
|
623 ushort* src = (unsigned __int16 *)pDesc.lpSurface;
|
|
624 uint num_top_scanlines_above_frame_y = i - dst_y;
|
|
625 for (uint y = dst_y; y < dst_w; ++y)
|
|
626 {
|
|
627 //ushort* dst = &pRenderer->pTargetSurface[y * pRenderer->uTargetSurfacePitch + dst_x];
|
|
628
|
|
629 uint src_y = num_top_scanlines_above_frame_y + y;
|
|
630 for (uint x = dst_x; x < dst_z; ++x)
|
|
631 {
|
|
632 uint src_x = v107 - dst_x + x; // num scanlines left to frame_x + current x
|
|
633
|
|
634 uint idx = pDesc.dwHeight * src_y / pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaHeight * (pDesc.lPitch / sizeof(short)) +
|
|
635 pDesc.dwWidth * src_x / pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaWidth;
|
|
636 uint b = src[idx] & 0x1F;
|
|
637 //*dst++ = b | 2 * (src[idx] & 0xFFE0);
|
|
638 pRenderer->WritePixel16(x, y, b | 2 * (src[idx] & 0xFFE0));
|
|
639 }
|
|
640 }
|
|
641 pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].pTextureSurface->Unlock(NULL);
|
|
642 }
|
|
643 }
|
|
644 }
|
|
645 /*else
|
|
646 {
|
|
647 pRenderer->FillRectFast(v106.uViewportX, v106.uViewportY, v106.uViewportZ - v106.uViewportX, v106.uViewportW - v106.uViewportY, 0);
|
|
648 if ( v10->pHwSpriteIDs[0] >= 0 )
|
|
649 pSprites_LOD->pSpriteHeaders[v10->pHwSpriteIDs[0]].DrawSprite_sw(&v106, 0);
|
|
650 }*/
|
|
651 //name and profession
|
|
652 if ( pActors[uActorID].sNPC_ID )
|
|
653 {
|
|
654 if (GetNPCData(pActors[uActorID].sNPC_ID)->uProfession)
|
|
655 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
|
|
656 else
|
|
657 strncpy(pTmpBuf.data(), GetNPCData(pActors[uActorID].sNPC_ID)->pName, 2000);
|
|
658 }
|
|
659 else
|
|
660 {
|
|
661 if ( pActors[uActorID].dword_000334_unique_name )
|
|
662 strncpy(pTmpBuf.data(), pMonsterStats->pPlaceStrings[pActors[uActorID].dword_000334_unique_name], 2000);
|
|
663 else
|
|
664 strncpy(pTmpBuf.data(), pMonsterStats->pInfos[pActors[uActorID].pMonsterInfo.uID].pName, 2000);
|
|
665 }
|
|
666 pWindow->DrawTitleText(pFontComic, 0, 0xCu, Color16(0xFFu, 0xFFu, 0x9Bu), pTmpBuf.data(), 3);
|
|
667 //health bar
|
|
668 Actor::DrawHealthBar(&pActors[uActorID], pWindow);
|
|
669
|
|
670 normal_level = 0;
|
|
671 expert_level = 0;
|
|
672 master_level = 0;
|
|
673 grandmaster_level = 0;
|
|
674 for_effects = 0;
|
|
675 pMonsterInfoUI_Doll.uCurrentActionTime += pMiscTimer->uTimeElapsed;
|
|
676 if ( pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID) )
|
|
677 {
|
|
678 skill_points = (unsigned __int8)pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID) & 0x3F;
|
|
679 skill_level = SkillToMastery(pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID)) - 1;
|
|
680 if ( skill_level == 0 )//(normal)
|
|
681 {
|
|
682 if ( skill_points + 10 >= pActors[uActorID].pMonsterInfo.uLevel )
|
|
683 normal_level = 1;
|
|
684 }
|
|
685 else if ( skill_level == 1 )//(expert)
|
|
686 {
|
|
687 if ( 2 * skill_points + 10 >= pActors[uActorID].pMonsterInfo.uLevel )
|
|
688 {
|
|
689 normal_level = 1;
|
|
690 expert_level = 1;
|
|
691 }
|
|
692 }
|
|
693 else if ( skill_level == 2 )//(master)
|
|
694 {
|
|
695 if ( 3 * skill_points + 10 >= pActors[uActorID].pMonsterInfo.uLevel )
|
|
696 {
|
|
697 normal_level = 1;
|
|
698 expert_level = 1;
|
|
699 master_level = 1;
|
|
700 }
|
|
701 }
|
|
702 else if ( skill_level == 3 )//grandmaster
|
|
703 {
|
|
704 normal_level = 1;
|
|
705 expert_level = 1;
|
|
706 master_level = 1;
|
|
707 grandmaster_level = 1;
|
|
708 }
|
|
709 }
|
|
710 if ( pActors[uActorID].uAIState != Dead
|
|
711 && pActors[uActorID].uAIState != Dying
|
|
712 && !dword_507BF0_is_there_popup_onscreen && pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID) )
|
|
713 {
|
|
714 if ( normal_level | expert_level | master_level | grandmaster_level )
|
|
715 {
|
|
716 if ( pActors[uActorID].pMonsterInfo.uLevel >= pPlayers[uActiveCharacter]->uLevel - 5 )
|
|
717 speech = SPEECH_IDENTIFY_MONSTER_STRONGER;
|
|
718 else
|
|
719 speech = SPEECH_IDENTIFY_MONSTER_WEAKER;
|
|
720 }
|
|
721 else
|
|
722 speech = SPEECH_IDENTIFY_MONSTER_106;
|
|
723 pPlayers[uActiveCharacter]->PlaySound(speech, 0);
|
|
724 }
|
|
725
|
|
726 if ( (signed int)SkillToMastery(pParty->pPlayers[uActiveCharacter - 1].GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID)) >= 3 )
|
|
727 for_effects = 1;
|
|
728
|
|
729 if ( monster_full_informations == true )
|
|
730 {
|
|
731 normal_level = 1;//
|
|
732 expert_level = 1;//
|
|
733 master_level = 1;//
|
|
734 grandmaster_level = 1;//
|
|
735 for_effects = 1;
|
|
736 }
|
|
737
|
|
738 pWindow->DrawText(pFontSmallnum, 12, 196, Color16(0xE1u, 255, 0x9Bu), pGlobalTXT_LocalizationStrings[631], 0, 0, 0);//Effects
|
|
739 if ( !for_effects && false)
|
|
740 pWindow->DrawText(pFontSmallnum, 28, LOBYTE(pFontSmallnum->uFontHeight) + 193, Color16(0xE1u, 255, 0x9Bu), pGlobalTXT_LocalizationStrings[630], 0, 0, 0);//?
|
|
741 else
|
|
742 {
|
|
743 pText = "";
|
|
744 pTextHeight = LOBYTE(pFontSmallnum->uFontHeight) + 193;
|
|
745 for ( uint i = 1; i <= 21; ++i )
|
|
746 {
|
|
747 if ( pActors[uActorID].pActorBuffs[i].uExpireTime > 0 )
|
|
748 {
|
|
749 switch ( i )
|
|
750 {
|
|
751 case ACTOR_BUFF_CHARM:
|
|
752 pTextColorID = 60;
|
|
753 pText = pGlobalTXT_LocalizationStrings[591];//Charmed
|
|
754 break;
|
|
755 case ACTOR_BUFF_SUMMONED:
|
|
756 pTextColorID = 82;
|
|
757 pText = pGlobalTXT_LocalizationStrings[649];//Summoned
|
|
758 break;
|
|
759 case ACTOR_BUFF_SHRINK:
|
|
760 pTextColorID = 92;
|
|
761 pText = pGlobalTXT_LocalizationStrings[592];//Shrunk
|
|
762 break;
|
|
763 case ACTOR_BUFF_AFRAID:
|
|
764 pTextColorID = 63;
|
|
765 pText = pGlobalTXT_LocalizationStrings[4];//Afraid
|
|
766 break;
|
|
767 case ACTOR_BUFF_STONED:
|
|
768 pText = pGlobalTXT_LocalizationStrings[220];//Stoned
|
|
769 pTextColorID = 81;
|
|
770 break;
|
|
771 case ACTOR_BUFF_PARALYZED:
|
|
772 pText = pGlobalTXT_LocalizationStrings[162];//Paralyzed
|
|
773 pTextColorID = 81;
|
|
774 break;
|
|
775 case ACTOR_BUFF_SLOWED:
|
|
776 pText = pGlobalTXT_LocalizationStrings[593];//Slowed
|
|
777 pTextColorID = 35;
|
|
778 break;
|
|
779 case ACTOR_BUFF_BERSERK:
|
|
780 pText = pGlobalTXT_LocalizationStrings[608];//Berserk
|
|
781 pTextColorID = 62;
|
|
782 break;
|
|
783 case ACTOR_BUFF_SOMETHING_THAT_HALVES_AC:
|
|
784 case ACTOR_BUFF_MASS_DISTORTION:
|
|
785 pText = "";
|
|
786 pTextColorID = 0;
|
|
787 continue;
|
|
788 case ACTOR_BUFF_FATE:
|
|
789 pTextColorID = 47;
|
|
790 pText = pGlobalTXT_LocalizationStrings[221];//Fate
|
|
791 break;
|
|
792 case ACTOR_BUFF_ENSLAVED:
|
|
793 pTextColorID = 66;
|
|
794 pText = pGlobalTXT_LocalizationStrings[607];//Enslaved
|
|
795 break;
|
|
796 case ACTOR_BUFF_DAY_OF_PROTECTION:
|
|
797 pTextColorID = 85;
|
|
798 pText = pGlobalTXT_LocalizationStrings[610];//Day of Protection
|
|
799 break;
|
|
800 case ACTOR_BUFF_HOUR_OF_POWER:
|
|
801 pTextColorID = 86;
|
|
802 pText = pGlobalTXT_LocalizationStrings[609];//Hour of Power
|
|
803 break;
|
|
804 case ACTOR_BUFF_SHIELD:
|
|
805 pTextColorID = 17;
|
|
806 pText = pGlobalTXT_LocalizationStrings[279];//Shield
|
|
807 break;
|
|
808 case ACTOR_BUFF_STONESKIN:
|
|
809 pTextColorID = 38;
|
|
810 pText = pGlobalTXT_LocalizationStrings[442];//Stoneskin
|
|
811 break;
|
|
812 case ACTOR_BUFF_BLESS:
|
|
813 pTextColorID = 46;
|
|
814 pText = pGlobalTXT_LocalizationStrings[443];//Bless
|
|
815 break;
|
|
816 case ACTOR_BUFF_HEROISM:
|
|
817 pTextColorID = 51;
|
|
818 pText = pGlobalTXT_LocalizationStrings[440];//Heroism
|
|
819 break;
|
|
820 case ACTOR_BUFF_HASTE:
|
|
821 pTextColorID = 5;
|
|
822 pText = pGlobalTXT_LocalizationStrings[441];//Haste
|
|
823 break;
|
|
824 case ACTOR_BUFF_PAIN_REFLECTION:
|
|
825 pTextColorID = 95;
|
|
826 pText = pGlobalTXT_LocalizationStrings[229];//Pain Reflection
|
|
827 break;
|
|
828 case ACTOR_BUFF_PAIN_HAMMERHANDS:
|
|
829 pTextColorID = 73;
|
|
830 pText = pGlobalTXT_LocalizationStrings[228];//Hammerhands
|
|
831 break;
|
|
832 default:
|
|
833 pText = "";
|
|
834 break;
|
|
835 }
|
|
836 if ( _stricmp(pText, "" ))
|
|
837 {
|
|
838 pWindow->DrawText(pFontSmallnum, 28, pTextHeight, GetSpellColor(pTextColorID), pText, 0, 0, 0);
|
|
839 pTextHeight = pTextHeight + *(char *)((int)pFontSmallnum + 5) - 3;
|
|
840 }
|
|
841 }
|
|
842 }
|
|
843 if ( !_stricmp(pText,"" ))
|
|
844 pWindow->DrawText(pFontSmallnum, 28, pTextHeight, Color16(0xE1u, 255, 0x9Bu), pGlobalTXT_LocalizationStrings[153], 0, 0, 0);//Íåò
|
|
845 }
|
|
846
|
|
847 if ( normal_level )
|
|
848 {
|
|
849 sprintf(pTmpBuf.data(), "%s\f%05u\t100%d\n", pGlobalTXT_LocalizationStrings[108], 0, pActors[uActorID].pMonsterInfo.uHP);
|
|
850 pWindow->DrawText(pFontSmallnum, 150, (int)v106.uViewportY, Color16(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0);
|
|
851 pTextHeight = v106.uViewportY + LOBYTE(pFontSmallnum->uFontHeight) - 3;
|
|
852 sprintf(pTmpBuf.data(), "%s\f%05u\t100%d\n", pGlobalTXT_LocalizationStrings[12], 0, pActors[uActorID].pMonsterInfo.uAC);//Armor Class
|
|
853 }
|
|
854 else
|
|
855 {
|
|
856 sprintf(pTmpBuf.data(), "%s\f%05u\t100%s\n", pGlobalTXT_LocalizationStrings[108], 0, pGlobalTXT_LocalizationStrings[630]);//? - [630] actually displays a question mark
|
|
857 pWindow->DrawText(pFontSmallnum, 150, (int)v106.uViewportY, Color16(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0);
|
|
858 pTextHeight = v106.uViewportY + LOBYTE(pFontSmallnum->uFontHeight) - 3;
|
|
859 sprintf(pTmpBuf.data(), "%s\f%05u\t100%s\n", pGlobalTXT_LocalizationStrings[12], 0, pGlobalTXT_LocalizationStrings[630]);//? - [630] actually displays a question mark
|
|
860 }
|
|
861 pWindow->DrawText(pFontSmallnum, 150, pTextHeight, Color16(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0);
|
|
862 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 6 + LOBYTE(pFontSmallnum->uFontHeight);
|
|
863
|
|
864 content[0] = pGlobalTXT_LocalizationStrings[87];
|
|
865 content[1] = pGlobalTXT_LocalizationStrings[6];
|
|
866 content[2] = pGlobalTXT_LocalizationStrings[240];
|
|
867 content[3] = pGlobalTXT_LocalizationStrings[70];
|
|
868 content[4] = pGlobalTXT_LocalizationStrings[624];
|
|
869 content[5] = pGlobalTXT_LocalizationStrings[138];
|
|
870 content[6] = pGlobalTXT_LocalizationStrings[214];
|
|
871 content[7] = pGlobalTXT_LocalizationStrings[142];
|
|
872 content[8] = pGlobalTXT_LocalizationStrings[29];
|
|
873 content[9] = pGlobalTXT_LocalizationStrings[133];
|
|
874 content[10] = pGlobalTXT_LocalizationStrings[54];
|
|
875
|
|
876 if ( expert_level )
|
|
877 {
|
|
878 sprintf(pTmpBuf.data(), "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[18], 0, content[pActors[uActorID].pMonsterInfo.uAttack1Type]);//Attack
|
|
879 pWindow->DrawText(pFontSmallnum, 150, (int)pTextHeight, Color16(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0);
|
|
880 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3;
|
|
881 if ( pActors[uActorID].pMonsterInfo.uAttack1DamageBonus )
|
|
882 sprintf(pTmpBuf.data(), "%s\f%05u\t080%dd%d+%d\n", pGlobalTXT_LocalizationStrings[53],
|
|
883 0, pActors[uActorID].pMonsterInfo.uAttack1DamageDiceRolls, pActors[uActorID].pMonsterInfo.uAttack1DamageDiceSides, pActors[uActorID].pMonsterInfo.uAttack1DamageBonus);
|
|
884 else
|
|
885 sprintf(pTmpBuf.data(), "%s\f%05u\t080%dd%d\n", pGlobalTXT_LocalizationStrings[53],
|
|
886 0, pActors[uActorID].pMonsterInfo.uAttack1DamageDiceRolls, pActors[uActorID].pMonsterInfo.uAttack1DamageDiceSides);
|
|
887 }
|
|
888 else
|
|
889 {
|
|
890 sprintf(pTmpBuf.data(), "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[18], 0, pGlobalTXT_LocalizationStrings[630]);
|
|
891 pWindow->DrawText(pFontSmallnum, 150, (int)pTextHeight, Color16(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0);
|
|
892 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3;
|
|
893 sprintf(pTmpBuf.data(), "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[53], 0, pGlobalTXT_LocalizationStrings[630]);
|
|
894 }
|
|
895 pWindow->DrawText(pFontSmallnum, 150, pTextHeight, Color16(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0);
|
|
896 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 6 + LOBYTE(pFontSmallnum->uFontHeight);
|
|
897
|
|
898 if ( !master_level )
|
|
899 {
|
|
900 sprintf(pTmpBuf.data(), "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[628], 0, pGlobalTXT_LocalizationStrings[630]);//"Spell" "?"
|
|
901 pWindow->DrawText(pFontSmallnum, 150, (int)pTextHeight, Color16(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0);
|
|
902 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3;
|
|
903 }
|
|
904 else
|
|
905 {
|
|
906 pText = pGlobalTXT_LocalizationStrings[628];//Spell
|
|
907 if ( pActors[uActorID].pMonsterInfo.uSpell1ID && pActors[uActorID].pMonsterInfo.uSpell2ID )
|
|
908 pText = pGlobalTXT_LocalizationStrings[629];//Spells
|
|
909 if ( pActors[uActorID].pMonsterInfo.uSpell1ID )
|
|
910 {
|
|
911 sprintf(pTmpBuf.data(), "%s\f%05u\t070%s\n", pText, 0, pSpellStats->pInfos[pActors[uActorID].pMonsterInfo.uSpell1ID].pShortName);//"%s\f%05u\t060%s\n"
|
|
912 pWindow->DrawText(pFontSmallnum, 150, (int)pTextHeight, Color16(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0);
|
|
913 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3;
|
|
914 }
|
|
915 if ( pActors[uActorID].pMonsterInfo.uSpell2ID )
|
|
916 {
|
|
917 sprintf(pTmpBuf.data(), "\f%05u\t070%s\n", 0, pSpellStats->pInfos[pActors[uActorID].pMonsterInfo.uSpell2ID].pShortName);//"%s\f%05u\t060%s\n"
|
|
918 pWindow->DrawText(pFontSmallnum, 150, (int)pTextHeight, Color16(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0);
|
|
919 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3;
|
|
920 }
|
|
921 if ( !pActors[uActorID].pMonsterInfo.uSpell1ID && !pActors[uActorID].pMonsterInfo.uSpell2ID )
|
|
922 {
|
|
923 sprintf(pTmpBuf.data(), "%s\f%05u\t070%s\n", pGlobalTXT_LocalizationStrings[628], 0, pGlobalTXT_LocalizationStrings[153]);//"%s\f%05u\t060%s\n"
|
|
924 pWindow->DrawText(pFontSmallnum, 150, (int)pTextHeight, Color16(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0);
|
|
925 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3;
|
|
926 }
|
|
927 }
|
|
928 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3;
|
|
929 pWindow->DrawText(pFontSmallnum, 150, pTextHeight, Color16(0xE1u, 255, 0x9Bu), pGlobalTXT_LocalizationStrings[626], 0, 0, 0);//Immune
|
|
930 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3;
|
|
931
|
|
932 string_name[0] = pGlobalTXT_LocalizationStrings[87];//Fire
|
|
933 string_name[1] = pGlobalTXT_LocalizationStrings[6];//Air
|
|
934 string_name[2] = pGlobalTXT_LocalizationStrings[240];
|
|
935 string_name[3] = pGlobalTXT_LocalizationStrings[70];
|
|
936 string_name[4] = pGlobalTXT_LocalizationStrings[142];
|
|
937 string_name[5] = pGlobalTXT_LocalizationStrings[214];
|
|
938 string_name[6] = pGlobalTXT_LocalizationStrings[29];
|
|
939 string_name[7] = pGlobalTXT_LocalizationStrings[133];
|
|
940 string_name[8] = pGlobalTXT_LocalizationStrings[54];
|
|
941 string_name[9] = pGlobalTXT_LocalizationStrings[624];
|
|
942
|
|
943 resistances[0] = pActors[uActorID].pMonsterInfo.uResFire;
|
|
944 resistances[1] = pActors[uActorID].pMonsterInfo.uResAir;
|
|
945 resistances[2] = pActors[uActorID].pMonsterInfo.uResWater;
|
|
946 resistances[3] = pActors[uActorID].pMonsterInfo.uResEarth;
|
|
947 resistances[4] = pActors[uActorID].pMonsterInfo.uResMind;
|
|
948 resistances[5] = pActors[uActorID].pMonsterInfo.uResSpirit;
|
|
949 resistances[6] = pActors[uActorID].pMonsterInfo.uResBody;
|
|
950 resistances[7] = pActors[uActorID].pMonsterInfo.uResLight;
|
|
951 resistances[8] = pActors[uActorID].pMonsterInfo.uResPhysical;
|
|
952 resistances[9] = pActors[uActorID].pMonsterInfo.uResDark;
|
|
953
|
|
954 if ( grandmaster_level )
|
|
955 {
|
|
956 for ( uint i = 0; i < 10; i++ )
|
|
957 {
|
|
958 if ( resistances[i] == 200 )
|
|
959 {
|
|
960 pText = pGlobalTXT_LocalizationStrings[625];//Immune
|
|
961 }
|
|
962 else
|
|
963 {
|
|
964 if ( resistances[i] )
|
|
965 pText = pGlobalTXT_LocalizationStrings[627];//Resistant
|
|
966 else
|
|
967 pText = pGlobalTXT_LocalizationStrings[153];//None
|
|
968 }
|
|
969 sprintf(pTmpBuf.data(), "%s\f%05u\t070%s\n", string_name[i], 0, pText);
|
|
970 pWindow->DrawText(pFontSmallnum, 170, pTextHeight, Color16(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0);
|
|
971 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3;
|
|
972 }
|
|
973 }
|
|
974 else
|
|
975 {
|
|
976 for ( uint i = 0; i < 10; ++i )
|
|
977 {
|
|
978 sprintf(pTmpBuf.data(), "%s\f%05u\t070%s\n", string_name[i], 0, pGlobalTXT_LocalizationStrings[630]); // "?"
|
|
979 pWindow->DrawText(pFontSmallnum, 170, pTextHeight, Color16(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0);
|
|
980 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3;
|
|
981 }
|
|
982 }
|
|
983 //cast spell: Detect life
|
|
984 if ( (signed __int64)pParty->pPartyBuffs[PARTY_BUFF_DETECT_LIFE].uExpireTime > 0 )
|
|
985 {
|
|
986 sprintf(pTmpBuf.data(), "%s: %d", pGlobalTXT_LocalizationStrings[650], pActors[uActorID].sCurrentHP);//Current Hit Points
|
|
987 pFontSmallnum->GetLineWidth(pTmpBuf.data());
|
|
988 pWindow->DrawTitleText(pFontSmallnum, 0, pWindow->uFrameHeight - LOBYTE(pFontSmallnum->uFontHeight) - 12, 0, pTmpBuf.data(), 3);
|
|
989 }
|
|
990 }
|
|
991
|
|
992 //----- (00417BB5) --------------------------------------------------------
|
|
993 const char *CharacterUI_GetSkillDescText(unsigned int uPlayerID, PLAYER_SKILL_TYPE uPlayerSkillType)
|
|
994 {
|
|
995 char a2[1200]; // [sp+Ch] [bp-538h]@7
|
|
996 char Source[120]; // [sp+4BCh] [bp-88h]@7
|
|
997 int v35; // [sp+53Ch] [bp-8h]@1
|
|
998
|
|
999 v35 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[431]);// Normal
|
|
1000 if ( pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[433]) > (signed int)v35 )
|
|
1001 v35 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[433]);// Expert
|
|
1002 if ( pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[432]) > (signed int)v35 )
|
|
1003 v35 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[432]);// Master
|
|
1004 if ( pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[96]) > (signed int)v35 )
|
|
1005 v35 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[96]);// Grand
|
|
1006
|
|
1007 a2[0] = 0;
|
|
1008 Source[0] = 0;
|
|
1009 strcpy(a2, "%s\n\n");
|
|
1010 sprintf(Source, "\f%05d", GetSkillColor(pParty->pPlayers[uPlayerID].classType, uPlayerSkillType, 1));
|
|
1011 strcat(a2, Source);
|
|
1012 strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
|
|
1013 sprintf(Source, "\f%05d", GetSkillColor(pParty->pPlayers[uPlayerID].classType, uPlayerSkillType, 2));
|
|
1014 strcat(a2, Source);
|
|
1015 strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
|
|
1016 sprintf(Source, "\f%05d", GetSkillColor(pParty->pPlayers[uPlayerID].classType, uPlayerSkillType, 3));
|
|
1017 strcat(a2, Source);
|
|
1018 strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
|
|
1019 sprintf(Source, "\f%05d", GetSkillColor(pParty->pPlayers[uPlayerID].classType, uPlayerSkillType, 4));
|
|
1020 strcat(a2, Source);
|
|
1021 strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
|
|
1022 if ( (pParty->pPlayers[uPlayerID].pActiveSkills[uPlayerSkillType] & 0x3F) == (pParty->pPlayers[uPlayerID].GetActualSkillLevel(uPlayerSkillType) & 0x3F) )
|
|
1023 {
|
|
1024 sprintf(static_sub_417BB5_out_string, a2, pSkillDesc[uPlayerSkillType],
|
|
1025 pGlobalTXT_LocalizationStrings[431], v35 + 3, v35 + 5, pNormalSkillDesc[uPlayerSkillType], // Normal
|
|
1026 pGlobalTXT_LocalizationStrings[433], v35 + 3, v35 + 5, pExpertSkillDesc[uPlayerSkillType], // Expert
|
|
1027 pGlobalTXT_LocalizationStrings[432], v35 + 3, v35 + 5, pMasterSkillDesc[uPlayerSkillType], // Master
|
|
1028 pGlobalTXT_LocalizationStrings[96], v35 + 3, v35 + 5, pGrandSkillDesc[uPlayerSkillType]); // Grand
|
|
1029 }
|
|
1030 else
|
|
1031 {
|
|
1032 sprintf(Source, "\f%05d", Color16(0xFFu, 0xFFu, 0xFFu));
|
|
1033 strcat(a2, Source);
|
|
1034 strcat(a2, "%s: +%d");
|
|
1035 sprintf(static_sub_417BB5_out_string, a2, pSkillDesc[uPlayerSkillType],
|
|
1036 pGlobalTXT_LocalizationStrings[431], v35 + 3, v35 + 5, pNormalSkillDesc[uPlayerSkillType],
|
|
1037 pGlobalTXT_LocalizationStrings[433], v35 + 3, v35 + 5, pExpertSkillDesc[uPlayerSkillType],
|
|
1038 pGlobalTXT_LocalizationStrings[432], v35 + 3, v35 + 5, pMasterSkillDesc[uPlayerSkillType],
|
|
1039 pGlobalTXT_LocalizationStrings[96], v35 + 3, v35 + 5, pGrandSkillDesc[uPlayerSkillType],
|
|
1040 pGlobalTXT_LocalizationStrings[623], //Bonus
|
|
1041 (pParty->pPlayers[uPlayerID].GetActualSkillLevel(uPlayerSkillType) & 0x3F) - (pParty->pPlayers[uPlayerID].pActiveSkills[uPlayerSkillType] & 0x3F));
|
|
1042 }
|
|
1043 return static_sub_417BB5_out_string;
|
|
1044 }
|
|
1045
|
|
1046 //----- (00417FE5) --------------------------------------------------------
|
|
1047 void CharacterUI_SkillsTab_ShowHint()
|
|
1048 {
|
|
1049 GUIButton *pButton; // esi@6
|
|
1050 unsigned int pX; // [sp+4h] [bp-8h]@1
|
|
1051 unsigned int pY; // [sp+8h] [bp-4h]@1
|
|
1052
|
|
1053 pMouse->GetClickPos(&pX, &pY);
|
|
1054 if ( (signed int)pX < 24 || (signed int)pX > 455 || (signed int)pY < 18 || (signed int)pY > 36 )
|
|
1055 {
|
|
1056 for ( pButton = pGUIWindow_CurrentMenu->pControlsHead; pButton; pButton = pButton->pNext )
|
|
1057 {
|
|
1058 if ( pButton->msg == UIMSG_SkillUp
|
|
1059 && (signed int)pX >= (signed int)pButton->uX
|
|
1060 && (signed int)pX <= (signed int)pButton->uZ
|
|
1061 && (signed int)pY >= (signed int)pButton->uY
|
|
1062 && (signed int)pY <= (signed int)pButton->uW )
|
|
1063 {
|
|
1064 CharacterUI_DrawTooltip(pSkillNames[pButton->msg_param], CharacterUI_GetSkillDescText(uActiveCharacter - 1, (PLAYER_SKILL_TYPE)pButton->msg_param));
|
|
1065 }
|
|
1066 }
|
|
1067 }
|
|
1068 else
|
|
1069 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[207], pSkillPointsAttributeDescription);//Î÷êè íàâûêîâ
|
|
1070 }
|
|
1071
|
|
1072 //----- (00418083) --------------------------------------------------------
|
|
1073 void CharacterUI_StatsTab_ShowHint()
|
|
1074 {
|
|
1075 int pStringNum; // edi@1
|
|
1076 signed int pTextColor; // eax@15
|
|
1077 const char *pHourWord; // ecx@17
|
|
1078 const char *pDayWord; // eax@20
|
|
1079 int v15; // ebx@28
|
|
1080 POINT a2; // [sp+Ch] [bp-24h]@1
|
|
1081 int pHour; // [sp+14h] [bp-1Ch]@15
|
|
1082 unsigned int pDay; // [sp+24h] [bp-Ch]@15
|
|
1083
|
|
1084 pMouse->GetCursorPos(&a2);
|
|
1085 for ( pStringNum = 0; pStringNum < stat_string_coord.size(); ++pStringNum )
|
|
1086 {
|
|
1087 if (a2.x >= stat_string_coord[pStringNum].x && a2.x <= stat_string_coord[pStringNum].x + stat_string_coord[pStringNum].width )
|
|
1088 {
|
|
1089 if (a2.y >= stat_string_coord[pStringNum].y && a2.y <= stat_string_coord[pStringNum].y + stat_string_coord[pStringNum].height )
|
|
1090 break;
|
|
1091 }
|
|
1092 }
|
|
1093
|
|
1094 switch ( pStringNum )
|
|
1095 {
|
|
1096 case 0:// Attributes
|
|
1097 case 1:
|
|
1098 case 2:
|
|
1099 case 3:
|
|
1100 case 4:
|
|
1101 case 5:
|
|
1102 case 6:
|
|
1103 if ( aAttributeNames[pStringNum] && pAttributeDescriptions[pStringNum] )
|
|
1104 CharacterUI_DrawTooltip(aAttributeNames[pStringNum], pAttributeDescriptions[pStringNum]);
|
|
1105 break;
|
|
1106 case 7:// Health Points
|
|
1107 if ( pGlobalTXT_LocalizationStrings[108] && pHealthPointsAttributeDescription )
|
|
1108 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[108], pHealthPointsAttributeDescription);
|
|
1109 break;
|
|
1110 case 8:// Spell Points
|
|
1111 if ( pGlobalTXT_LocalizationStrings[212] && pSpellPointsAttributeDescription )
|
|
1112 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[212], pSpellPointsAttributeDescription);
|
|
1113 break;
|
|
1114 case 9:// Armor Class
|
|
1115 if ( pGlobalTXT_LocalizationStrings[12] && pArmourClassAttributeDescription )
|
|
1116 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[12], pArmourClassAttributeDescription);
|
|
1117 break;
|
|
1118 case 10:// Player Condition
|
|
1119 strcpy(pTmpBuf2.data(), pPlayerConditionAttributeDescription);
|
|
1120 strcat(pTmpBuf2.data(), "\n");
|
|
1121 extern std::array<unsigned int, 18> pConditionImportancyTable;
|
|
1122 for ( uint i = 0; i < 18; ++i )
|
|
1123 {
|
|
1124 if ( pPlayers[uActiveCharacter]->pConditions[pConditionImportancyTable[i]] )
|
|
1125 {
|
|
1126 strcat(pTmpBuf2.data(), " \n");
|
|
1127 pHour = pParty->uTimePlayed - pPlayers[uActiveCharacter]->pConditions[pConditionImportancyTable[i]];
|
|
1128 pHour = (unsigned int)((pHour * 0.234375) / 60 / 60);
|
|
1129 pDay = (unsigned int)pHour / 24;
|
|
1130 pHour %= 24i64;
|
|
1131 pTextColor = GetConditionDrawColor(pConditionImportancyTable[i]);
|
|
1132 sprintfex(pTmpBuf.data(), format_4E2DE8, pTextColor, aCharacterConditionNames[pConditionImportancyTable[i]]);
|
|
1133 strcat(pTmpBuf2.data(), pTmpBuf.data());
|
|
1134 if ( pHour && pHour <= 1 )
|
|
1135 pHourWord = pGlobalTXT_LocalizationStrings[109];
|
|
1136 else
|
|
1137 pHourWord = pGlobalTXT_LocalizationStrings[110];
|
|
1138 if ( !pDay || (pDayWord = pGlobalTXT_LocalizationStrings[56], pDay > 1) )
|
|
1139 pDayWord = pGlobalTXT_LocalizationStrings[57];
|
|
1140 sprintfex(pTmpBuf.data(), "%lu %s, %lu %s", pDay, pDayWord, pHour, pHourWord);
|
|
1141 strcat(pTmpBuf2.data(), pTmpBuf.data());
|
|
1142 }
|
|
1143 }
|
|
1144 if ( pGlobalTXT_LocalizationStrings[47] && pTmpBuf2.data() )
|
|
1145 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[47], pTmpBuf2.data());
|
|
1146 break;
|
|
1147 case 11:// Fast Spell
|
|
1148 if ( pGlobalTXT_LocalizationStrings[172] && pFastSpellAttributeDescription )
|
|
1149 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[172], pFastSpellAttributeDescription);
|
|
1150 break;
|
|
1151 case 12:// Player Age
|
|
1152 if ( pGlobalTXT_LocalizationStrings[5] && pPlayerAgeAttributeDescription )
|
|
1153 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[5], pPlayerAgeAttributeDescription);
|
|
1154 break;
|
|
1155 case 13:// Player Level
|
|
1156 if ( pGlobalTXT_LocalizationStrings[131] && pPlayerLevelAttributeDescription )
|
|
1157 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[131], pPlayerLevelAttributeDescription);
|
|
1158 break;
|
|
1159 case 14://Experience
|
|
1160 v15 = pPlayers[uActiveCharacter]->uLevel;
|
|
1161 do
|
|
1162 {
|
|
1163 if ( (signed __int64)pPlayers[uActiveCharacter]->uExperience < (unsigned int)GetExperienceRequiredForLevel(v15) )
|
|
1164 break;
|
|
1165 ++v15;
|
|
1166 }
|
|
1167 while ( v15 <= 10000 );
|
|
1168 pTmpBuf[0] = 0;
|
|
1169 pTmpBuf2[0] = 0;
|
|
1170 if ( v15 > pPlayers[uActiveCharacter]->uLevel )
|
|
1171 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[147], v15);
|
|
1172 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[538], GetExperienceRequiredForLevel(v15) - LODWORD(pPlayers[uActiveCharacter]->uExperience), v15 + 1);
|
|
1173 strcat(pTmpBuf.data(), "\n");
|
|
1174 strcat(pTmpBuf.data(), pTmpBuf2.data());
|
|
1175 sprintf(pTmpBuf2.data(), "%s\n \n%s", pPlayerExperienceAttributeDescription, pTmpBuf.data());
|
|
1176 if ( pGlobalTXT_LocalizationStrings[83] && pTmpBuf2.data() )
|
|
1177 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[83], pTmpBuf2.data());
|
|
1178 break;
|
|
1179 case 15:// Attack Bonus
|
|
1180 if ( pGlobalTXT_LocalizationStrings[587] && pAttackBonusAttributeDescription )
|
|
1181 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[587], pAttackBonusAttributeDescription);
|
|
1182 break;
|
|
1183 case 16:// Attack Damage
|
|
1184 if ( pGlobalTXT_LocalizationStrings[588] && pAttackDamageAttributeDescription )
|
|
1185 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[588], pAttackDamageAttributeDescription);
|
|
1186 break;
|
|
1187 case 17:// Missle Bonus
|
|
1188 if ( pGlobalTXT_LocalizationStrings[589] && pMissleBonusAttributeDescription )
|
|
1189 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[589], pMissleBonusAttributeDescription);
|
|
1190 break;
|
|
1191 case 18:// Missle Damage
|
|
1192 if ( pGlobalTXT_LocalizationStrings[590] && pMissleDamageAttributeDescription )
|
|
1193 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[590], pMissleDamageAttributeDescription);
|
|
1194 break;
|
|
1195 case 19:// Fire Resistance
|
|
1196 if ( pGlobalTXT_LocalizationStrings[87] && pFireResistanceAttributeDescription )
|
|
1197 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[87], pFireResistanceAttributeDescription);
|
|
1198 break;
|
|
1199 case 20:// Air Resistance
|
|
1200 if ( pGlobalTXT_LocalizationStrings[6] && pAirResistanceAttributeDescription )
|
|
1201 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[6], pAirResistanceAttributeDescription);
|
|
1202 break;
|
|
1203 case 21:// Water Resistance
|
|
1204 if ( pGlobalTXT_LocalizationStrings[240] && pWaterResistanceAttributeDescription )
|
|
1205 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[240], pWaterResistanceAttributeDescription);
|
|
1206 break;
|
|
1207 case 22:// Earth Resistance
|
|
1208 if ( pGlobalTXT_LocalizationStrings[70] && pEarthResistanceAttributeDescription )
|
|
1209 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[70], pEarthResistanceAttributeDescription);
|
|
1210 break;
|
|
1211 case 23:// Mind Resistance
|
|
1212 if ( pGlobalTXT_LocalizationStrings[142] && pMindResistanceAttributeDescription )
|
|
1213 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[142], pMindResistanceAttributeDescription);
|
|
1214 break;
|
|
1215 case 24:// Body Resistance
|
|
1216 if ( pGlobalTXT_LocalizationStrings[29] && pBodyResistanceAttributeDescription )
|
|
1217 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[29], pBodyResistanceAttributeDescription);
|
|
1218 break;
|
|
1219 case 25: // Skill Points
|
|
1220 if ( pGlobalTXT_LocalizationStrings[207] && pSkillPointsAttributeDescription )
|
|
1221 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[207], pSkillPointsAttributeDescription);
|
|
1222 break;
|
|
1223 case 26: // Class description
|
|
1224 {
|
|
1225 if (pClassDescriptions[pPlayers[uActiveCharacter]->classType] && pClassNames[pPlayers[uActiveCharacter]->classType])
|
|
1226 CharacterUI_DrawTooltip(pClassNames[pPlayers[uActiveCharacter]->classType], pClassDescriptions[pPlayers[uActiveCharacter]->classType]);
|
|
1227 }
|
|
1228 break;
|
|
1229
|
|
1230 default:
|
|
1231 break;
|
|
1232 }
|
|
1233 }
|
|
1234
|
|
1235 //----- (00410B28) --------------------------------------------------------
|
|
1236 void DrawSpellDescriptionPopup(int spell_index)
|
|
1237 {
|
|
1238 SpellInfo *spell; // esi@1
|
|
1239 unsigned int v3; // eax@2
|
|
1240 LONG v5; // ecx@4
|
|
1241 GUIWindow spell_info_window; // [sp+Ch] [bp-68h]@4
|
|
1242 POINT mouse; // [sp+64h] [bp-10h]@1
|
|
1243
|
|
1244 spell = &pSpellStats->pInfos[spell_index + 11 * pPlayers[uActiveCharacter]->lastOpenedSpellbookPage + 1];
|
|
1245 if ( pMouse->GetCursorPos(&mouse)->y <= 250 )
|
|
1246 v3 = pMouse->GetCursorPos(&mouse)->y + 30;
|
|
1247 else
|
|
1248 v3 = 30;
|
|
1249 spell_info_window.uFrameY = v3;
|
|
1250 spell_info_window.uFrameWidth = 328;
|
|
1251 spell_info_window.uFrameHeight = 68;
|
|
1252 spell_info_window.uFrameX = 90;
|
|
1253 spell_info_window.uFrameZ = 417;
|
|
1254 spell_info_window.uFrameW = v3 + 67;
|
|
1255 spell_info_window.Hint = nullptr;
|
|
1256 v5 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_NORMAL]);
|
|
1257 if ( pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_MASTER]) > v5 )
|
|
1258 v5 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_MASTER]);
|
|
1259 if ( pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_EXPERT]) > v5 )
|
|
1260 v5 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_EXPERT]);
|
|
1261 if ( pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_GRAND]) > v5 )
|
|
1262 v5 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_GRAND]);
|
|
1263 sprintf(pTmpBuf2.data(),
|
|
1264 "%s\n\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s",
|
|
1265 spell->pDescription,
|
|
1266 pGlobalTXT_LocalizationStrings[LOCSTR_NORMAL], v5 + 3, v5 + 10, spell->pBasicSkillDesc,
|
|
1267 pGlobalTXT_LocalizationStrings[LOCSTR_EXPERT], v5 + 3, v5 + 10, spell->pExpertSkillDesc,
|
|
1268 pGlobalTXT_LocalizationStrings[LOCSTR_MASTER], v5 + 3, v5 + 10, spell->pMasterSkillDesc,
|
|
1269 pGlobalTXT_LocalizationStrings[LOCSTR_GRAND], v5 + 3, v5 + 10, spell->pGrandmasterSkillDesc);
|
|
1270 spell_info_window.uFrameHeight += pFontSmallnum->CalcTextHeight(pTmpBuf2.data(), &spell_info_window, 0, 0);
|
|
1271 if ( (signed int)spell_info_window.uFrameHeight < 150 )
|
|
1272 spell_info_window.uFrameHeight = 150;
|
|
1273 spell_info_window.uFrameWidth = game_viewport_width;
|
|
1274 spell_info_window.DrawMessageBox(0);
|
|
1275 spell_info_window.uFrameWidth -= 12;
|
|
1276 spell_info_window.uFrameHeight -= 12;
|
|
1277 spell_info_window.uFrameZ = spell_info_window.uFrameX + spell_info_window.uFrameWidth - 1;
|
|
1278 spell_info_window.uFrameW = spell_info_window.uFrameHeight + spell_info_window.uFrameY - 1;
|
|
1279 spell_info_window.DrawTitleText(pFontArrus, 0x78u, 0xCu, Color16(0xFFu, 0xFFu, 0x9Bu), spell->pName, 3);
|
|
1280 spell_info_window.DrawText(pFontSmallnum, 120, 44, 0, pTmpBuf2.data(), 0, 0, 0);
|
|
1281 spell_info_window.uFrameWidth = 108;
|
|
1282 spell_info_window.uFrameZ = spell_info_window.uFrameX + 107;
|
|
1283 int skill_level = SkillToMastery(pPlayers[uActiveCharacter]->pActiveSkills[pPlayers[uActiveCharacter]->lastOpenedSpellbookPage + 12]);
|
|
1284 spell_info_window.DrawTitleText(pFontComic, 12, 75, 0, pSkillNames[pPlayers[uActiveCharacter]->lastOpenedSpellbookPage + 12], 3);
|
|
1285 sprintf( pTmpBuf.data(), "%s\n%d", pGlobalTXT_LocalizationStrings[LOCSTR_SP_COST],
|
|
1286 pSpellDatas[spell_index + 11 * pPlayers[uActiveCharacter]->lastOpenedSpellbookPage + 1].mana_per_skill[skill_level - 1]);
|
|
1287 spell_info_window.DrawTitleText(pFontComic, 12, spell_info_window.uFrameHeight - LOBYTE(pFontComic->uFontHeight) - 16, 0, pTmpBuf.data(), 3);
|
|
1288 dword_507B00_spell_info_to_draw_in_popup = 0;
|
|
1289 }
|
|
1290 // 507B00: using guessed type int dword_507B00_spell_info_to_draw_in_popup;
|
|
1291
|
|
1292 //----- (00416D62) --------------------------------------------------------
|
|
1293 void UI_OnMouseRightClick(Vec2_int_ *_this)
|
|
1294 {
|
|
1295 int v5; // esi@62
|
|
1296 GUIButton *pButton; // esi@84
|
|
1297 const char *pStr; // edi@85
|
|
1298 const char *pHint; // edx@113
|
|
1299 GUIWindow popup_window; // [sp+4h] [bp-74h]@32
|
|
1300 struct tagPOINT Point; // [sp+60h] [bp-18h]@6
|
|
1301 unsigned int pX; // [sp+70h] [bp-8h]@3
|
|
1302 unsigned int pY; // [sp+74h] [bp-4h]@3
|
|
1303
|
|
1304 if ( pCurrentScreen == SCREEN_VIDEO || GetCurrentMenuID() == MENU_MAIN )
|
|
1305 return;
|
|
1306 if ( _this )
|
|
1307 {
|
|
1308 pX = _this->x;
|
|
1309 pY = _this->y;
|
|
1310 }
|
|
1311 else
|
|
1312 {
|
|
1313 pMouse->GetClickPos(&pX, &pY);
|
|
1314 }
|
|
1315 //if ( pRenderer->bWindowMode )
|
|
1316 {
|
|
1317 GetCursorPos(&Point);
|
|
1318 ScreenToClient(window->GetApiHandle(), &Point);
|
|
1319 if ( Point.x < 1 || Point.y < 1 || Point.x > 638 || Point.y > 478 )
|
|
1320 {
|
|
1321 back_to_game();
|
|
1322 return;
|
|
1323 }
|
|
1324 }
|
|
1325 if ( pParty->pPickedItem.uItemID )//íàæàòèå íà ïîðòðåò ïåðñà ïðàâîé êíîïêîé ìûøè ñ ðàñòâîðîì
|
|
1326 {
|
|
1327 for ( uint i = 0; i < 4; ++i )
|
|
1328 {
|
|
1329 if ( (signed int)pX > RightClickPortraitXmin[i] && (signed int)pX < RightClickPortraitXmax[i]
|
|
1330 && (signed int)pY > 375 && (signed int)pY < 466 )
|
|
1331 {
|
|
1332 pPlayers[uActiveCharacter]->UseItem_DrinkPotion_etc(i + 1, 1);
|
|
1333 return;
|
|
1334 }
|
|
1335 }
|
|
1336 }
|
|
1337
|
|
1338 pEventTimer->Pause();
|
|
1339 switch(pCurrentScreen)
|
|
1340 {
|
|
1341 case SCREEN_CASTING:
|
|
1342 {
|
|
1343 Inventory_ItemPopupAndAlchemy();
|
|
1344 break;
|
|
1345 }
|
|
1346 case SCREEN_CHEST:
|
|
1347 {
|
|
1348 if ( !pPlayers[uActiveCharacter]->CanAct() )
|
|
1349 {
|
|
1350 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[427], pPlayers[uActiveCharacter]->pName, pGlobalTXT_LocalizationStrings[541]);//%s íå â ñîñòîÿíèè %s Îïîçíàòü ïðåäìåòû
|
|
1351 popup_window.Hint = pTmpBuf.data();
|
|
1352 popup_window.uFrameWidth = 384;
|
|
1353 popup_window.uFrameHeight = 180;
|
|
1354 popup_window.uFrameY = 40;
|
|
1355 if ( (signed int)pX <= 320 )
|
|
1356 popup_window.uFrameX = pX + 30;
|
|
1357 else
|
|
1358 popup_window.uFrameX = pX - 414;
|
|
1359 popup_window.DrawMessageBox(0);
|
|
1360 }
|
|
1361 else
|
|
1362 {
|
|
1363 if ( pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]] & 0xFFFF )
|
|
1364 GameUI_DrawItemInfo(&pChests[pChestWindow->par1C].igChestItems[pChests[pChestWindow->par1C].pInventoryIndices[(pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]] & 0xFFFF) - 1] - 1]);
|
|
1365 }
|
|
1366 break;
|
|
1367 }
|
|
1368 case SCREEN_GAME://In the main menu displays a pop-up window(Â ãëàâíîì ìåíþ ïîêàçûâàåò âñïëûâàþùåå îêíî)
|
|
1369 {
|
|
1370 if (GetCurrentMenuID() > 0)
|
|
1371 break;
|
|
1372 if ( (signed int)pY > (signed int)pViewport->uViewportBR_Y )
|
|
1373 {
|
|
1374 popup_window.ptr_1C = (void *)((signed int)pX / 118);
|
|
1375 if ( (signed int)pX / 118 < 4 )//portaits zone
|
|
1376 {
|
|
1377 popup_window.Hint = nullptr;
|
|
1378 popup_window.uFrameWidth = 400;
|
|
1379 popup_window.uFrameHeight = 200;
|
|
1380 popup_window.uFrameX = 38;
|
|
1381 popup_window.uFrameY = 60;
|
|
1382 pAudioPlayer->StopChannels(-1, -1);
|
|
1383 GameUI_CharacterQuickRecord_Draw(&popup_window, pPlayers[(int)popup_window.ptr_1C + 1]);
|
|
1384 }
|
|
1385 }
|
|
1386 else if ( (signed int)pX > (signed int)pViewport->uViewportBR_X )
|
|
1387 {
|
|
1388 if ( (signed int)pY >= 130 )
|
|
1389 {
|
|
1390 if ( (signed int)pX >= 476 && (signed int)pX <= 636 && (signed int)pY >= 240 && (signed int)pY <= 300 )//buff_tooltip zone
|
|
1391 {
|
|
1392 popup_window.Hint = nullptr;
|
|
1393 popup_window.uFrameWidth = 400;
|
|
1394 popup_window.uFrameHeight = 200;
|
|
1395 popup_window.uFrameX = 38;
|
|
1396 popup_window.uFrameY = 60;
|
|
1397 pAudioPlayer->StopChannels(-1, -1);
|
|
1398 popup_window._41D73D_draw_buff_tooltip();
|
|
1399 }
|
|
1400 else if ( (signed int)pX < 485 || (signed int)pX > 548 || (signed int)pY < 156 || (signed int)pY > 229 )//NPC zone
|
|
1401 {
|
|
1402 if (!( (signed int)pX < 566 || (signed int)pX > 629 || (signed int)pY < 156 || (signed int)pY > 229 ))
|
|
1403 {
|
|
1404 pAudioPlayer->StopChannels(-1, -1);
|
|
1405 GameUI_DrawNPCPopup((void *)1);//NPC 2
|
|
1406 }
|
|
1407 }
|
|
1408 else
|
|
1409 {
|
|
1410 pAudioPlayer->StopChannels(-1, -1);
|
|
1411 GameUI_DrawNPCPopup(0);//NPC 1
|
|
1412 }
|
|
1413 }
|
|
1414 else//minimap zone
|
|
1415 {
|
|
1416 popup_window.Hint = (char *)GameUI_GetMinimapHintText();
|
|
1417 popup_window.uFrameWidth = 256;
|
|
1418 popup_window.uFrameX = 130;
|
|
1419 popup_window.uFrameY = 140;
|
|
1420 popup_window.uFrameHeight = 64;
|
|
1421 pAudioPlayer->StopChannels(-1, -1);
|
|
1422 popup_window.DrawMessageBox(0);
|
|
1423 }
|
|
1424 }
|
|
1425 else//game zone
|
|
1426 {
|
|
1427 popup_window.Hint = nullptr;
|
|
1428 popup_window.uFrameWidth = 320;
|
|
1429 popup_window.uFrameHeight = 320;
|
|
1430 popup_window.uFrameX = pX - 350;
|
|
1431 if ( (signed int)pX <= 320 )
|
|
1432 popup_window.uFrameX = pX + 30;
|
|
1433 popup_window.uFrameY = 40;
|
|
1434 //if ( pRenderer->pRenderD3D )
|
|
1435 v5 = pGame->pVisInstance->get_picked_object_zbuf_val();
|
|
1436 /*else
|
|
1437 v5 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]];*/
|
|
1438 if (PID_TYPE((unsigned __int16)v5) == OBJECT_Actor)
|
|
1439 {
|
|
1440 /*if ( pRenderer->uNumSceneBegins )
|
|
1441 {
|
|
1442 popup_window.DrawMessageBox(1);
|
|
1443 MonsterPopup_Draw(PID_ID((unsigned __int16)v5), &popup_window);
|
|
1444 }
|
|
1445 else*/
|
|
1446 {
|
|
1447 pRenderer->BeginScene();
|
|
1448 popup_window.DrawMessageBox(1);
|
|
1449 MonsterPopup_Draw(PID_ID((unsigned __int16)v5), &popup_window);
|
|
1450 pRenderer->EndScene();
|
|
1451 }
|
|
1452 }
|
|
1453 if (PID_TYPE((unsigned __int16)v5) == OBJECT_Item)
|
|
1454 {
|
|
1455 if ( !(pObjectList->pObjects[pSpriteObjects[PID_ID((unsigned __int16)v5)].uObjectDescID].uFlags & 0x10 ) )
|
|
1456 {
|
|
1457 GameUI_DrawItemInfo(&pSpriteObjects[PID_ID((unsigned __int16)v5)].stru_24);
|
|
1458 }
|
|
1459 }
|
|
1460 }
|
|
1461 break;
|
|
1462 }
|
|
1463 case SCREEN_BOOKS:
|
|
1464 {
|
|
1465 if ( !dword_506364
|
|
1466 || (signed int)pX < (signed int)pViewport->uViewportTL_X || (signed int)pX > (signed int)pViewport->uViewportBR_X
|
|
1467 || (signed int)pY < (signed int)pViewport->uViewportTL_Y || (signed int)pY > (signed int)pViewport->uViewportBR_Y
|
|
1468 || ((popup_window.Hint = (char *)GetMapBookHintText()) == 0) )
|
|
1469 break;
|
|
1470 popup_window.uFrameWidth = (pFontArrus->GetLineWidth(popup_window.Hint) + 32) + 0.5f;
|
|
1471 popup_window.uFrameX = pX + 5;
|
|
1472 popup_window.uFrameY = pY + 5;
|
|
1473 popup_window.uFrameHeight = 64;
|
|
1474 pAudioPlayer->StopChannels(-1, -1);
|
|
1475 popup_window.DrawMessageBox(0);
|
|
1476 break;
|
|
1477 }
|
|
1478 case SCREEN_CHARACTERS:
|
|
1479 case SCREEN_E:
|
|
1480 case SCREEN_CHEST_INVENTORY:
|
|
1481 {
|
|
1482 if ( (signed int)pX > 467 && pCurrentScreen != SCREEN_E )
|
|
1483 Inventory_ItemPopupAndAlchemy();
|
|
1484 else if ( (signed int)pY >= 345 )
|
|
1485 break;
|
|
1486 else if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 100 )//2DEvent - CharacerScreenStats
|
|
1487 CharacterUI_StatsTab_ShowHint();
|
|
1488 else if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 101 )//2DEvent - CharacerScreenSkills
|
|
1489 CharacterUI_SkillsTab_ShowHint();
|
|
1490 else if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 103 )//2DEvent - CharacerScreenInventory
|
|
1491 Inventory_ItemPopupAndAlchemy();
|
|
1492 break;
|
|
1493 }
|
|
1494 case SCREEN_SPELL_BOOK:
|
|
1495 {
|
|
1496 if ( dword_507B00_spell_info_to_draw_in_popup )
|
|
1497 DrawSpellDescriptionPopup(dword_507B00_spell_info_to_draw_in_popup - 1);
|
|
1498 break;
|
|
1499 }
|
|
1500 case SCREEN_HOUSE:
|
|
1501 {
|
|
1502 if ( (signed int)pY < 345 && (signed int)pX < 469 )
|
|
1503 ShowPopupShopItem();
|
|
1504 break;
|
|
1505 }
|
|
1506 case SCREEN_PARTY_CREATION:
|
|
1507 {
|
|
1508 popup_window.Hint = nullptr;
|
|
1509 pStr = 0;
|
|
1510 for ( pButton = pGUIWindow_CurrentMenu->pControlsHead; pButton; pButton = pButton->pNext)
|
|
1511 {
|
|
1512 if ( pButton->uButtonType == 1 && pButton->uButtonType != 3 && (signed int)pX > (signed int)pButton->uX && (signed int)pX < (signed int)pButton->uZ
|
|
1513 && (signed int)pY > (signed int)pButton->uY && (signed int)pY < (signed int)pButton->uW )
|
|
1514 {
|
|
1515 switch ( pButton->msg )
|
|
1516 {
|
|
1517 case UIMSG_0: //stats info
|
|
1518 popup_window.Hint = pAttributeDescriptions[(signed int)pButton->msg_param % 7];
|
|
1519 pStr = aAttributeNames[(signed int)pButton->msg_param % 7];
|
|
1520 break;
|
|
1521 case UIMSG_PlayerCreationClickPlus: //Plus button info
|
|
1522 pStr = pGlobalTXT_LocalizationStrings[670];//Äîáàâèòü
|
|
1523 popup_window.Hint = pGlobalTXT_LocalizationStrings[671];//"Äîáàâëÿåò î÷êî ê âûäåëåííîìó íàâûêó, çàáèðàÿ åãî èç íàêîïèòåëÿ î÷êîâ"
|
|
1524 break;
|
|
1525 case UIMSG_PlayerCreationClickMinus: //Minus button info
|
|
1526 pStr = pGlobalTXT_LocalizationStrings[668];//Âû÷åñòü
|
|
1527 popup_window.Hint = pGlobalTXT_LocalizationStrings[669];//"Âû÷èòàåò î÷êî èç âûäåëåííîãî íàâûêà, âîçâðàùàÿ åãî â íàêîïèòåëü î÷êîâ"
|
|
1528 break;
|
|
1529 case UIMSG_PlayerCreationSelectActiveSkill: //Available skill button info
|
|
1530 pStr = pSkillNames[pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(pButton->msg_param + 4)];
|
|
1531 popup_window.Hint = pSkillDesc[pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(pButton->msg_param + 4)];
|
|
1532 break;
|
|
1533 case UIMSG_PlayerCreationSelectClass: //Available Class Info
|
|
1534 popup_window.Hint = pClassDescriptions[pButton->msg_param];
|
|
1535 pStr = pClassNames[pButton->msg_param];
|
|
1536 break;
|
|
1537 case UIMSG_PlayerCreationClickOK: //OK Info
|
|
1538 popup_window.Hint = pGlobalTXT_LocalizationStrings[664];//Ùåëêíèòå çäåñü äëÿ óòâåðæäåíèÿ ñîñòàâà îòðÿäà è ïðîäîëæåíèÿ èãðû.
|
|
1539 pStr = pGlobalTXT_LocalizationStrings[665];//Êíîïêà ÎÊ
|
|
1540 break;
|
|
1541 case UIMSG_PlayerCreationClickReset: //Clear info
|
|
1542 popup_window.Hint = pGlobalTXT_LocalizationStrings[666];//Ñáðàñûâàåò âñå ïàðàìåòðû è íàâûêè îòðÿäà.
|
|
1543 pStr = pGlobalTXT_LocalizationStrings[667];//Êíîïêà Î÷èñòèòü
|
|
1544 break;
|
|
1545 case UIMSG_PlayerCreation_SelectAttribute: // Character info
|
|
1546 pStr = pParty->pPlayers[pButton->msg_param].pName;
|
|
1547 popup_window.Hint = pClassDescriptions[pParty->pPlayers[pButton->msg_param].classType];
|
|
1548 break;
|
|
1549 }
|
|
1550 if ( pButton->msg > UIMSG_44 && pButton->msg <= UIMSG_PlayerCreationRemoveDownSkill ) //Sellected skills info
|
|
1551 {
|
|
1552 pY = 0;
|
|
1553 if ( (signed int)pParty->pPlayers[pButton->msg_param].GetSkillIdxByOrder(pButton->msg - UIMSG_48) < 37 )
|
|
1554 {
|
|
1555 strcpy(pTmpBuf2.data(), CharacterUI_GetSkillDescText(pButton->msg_param, (PLAYER_SKILL_TYPE)pParty->pPlayers[pButton->msg_param].GetSkillIdxByOrder(pButton->msg - UIMSG_48)));
|
|
1556 popup_window.Hint = pTmpBuf2.data();
|
|
1557 pStr = pSkillNames[pParty->pPlayers[pButton->msg_param].GetSkillIdxByOrder(pButton->msg - UIMSG_48)];
|
|
1558 }
|
|
1559 }
|
|
1560 }
|
|
1561 }
|
|
1562 if ( popup_window.Hint )
|
|
1563 {
|
|
1564 pHint = popup_window.Hint;
|
|
1565 popup_window.Hint = nullptr;
|
|
1566 popup_window.uFrameWidth = 384;
|
|
1567 popup_window.uFrameHeight = 256;
|
|
1568 popup_window.uFrameX = 128;
|
|
1569 popup_window.uFrameY = 40;
|
|
1570 popup_window.uFrameHeight = pFontSmallnum->CalcTextHeight(pHint, &popup_window, 24, 0) + 2 * LOBYTE(pFontLucida->uFontHeight) + 24;
|
|
1571 popup_window.uFrameZ = popup_window.uFrameX + popup_window.uFrameWidth - 1;
|
|
1572 popup_window.uFrameW = popup_window.uFrameY + popup_window.uFrameHeight - 1;
|
|
1573 popup_window.DrawMessageBox(0);
|
|
1574 popup_window.uFrameX += 12;
|
|
1575 popup_window.uFrameWidth -= 24;
|
|
1576 popup_window.uFrameY += 12;
|
|
1577 popup_window.uFrameHeight -= 12;
|
|
1578 popup_window.uFrameZ = popup_window.uFrameX + popup_window.uFrameWidth - 1;
|
|
1579 popup_window.uFrameW = popup_window.uFrameY + popup_window.uFrameHeight - 1;
|
|
1580 sprintf(pTmpBuf.data(), "\f%05d%s\f00000\n", Color16(0xFF, 0xFF, 0x9B), pStr);
|
|
1581 popup_window.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf.data(), 3);
|
|
1582 popup_window.DrawText(pFontSmallnum, 1, pFontLucida->uFontHeight, 0, pHint, 0, 0, 0);
|
|
1583 }
|
|
1584 break;
|
|
1585 }
|
|
1586 default:
|
|
1587 break;
|
|
1588 }
|
|
1589 dword_507BF0_is_there_popup_onscreen = 1;
|
|
1590 viewparams->bRedrawGameUI = 1;
|
|
1591 }
|
|
1592 int no_rightlick_in_inventory = false; // 0050CDCC
|
|
1593 //----- (00416196) --------------------------------------------------------
|
|
1594 void Inventory_ItemPopupAndAlchemy()
|
|
1595 {
|
|
1596 int potion1_id; // edx@25
|
|
1597 unsigned int potion2_id; // edi@25
|
|
1598 signed int potionID; // edx@27
|
|
1599 unsigned int pOut_y; // edx@57
|
|
1600 double v31; // st7@112
|
|
1601 Vec3_int_ v39; // [sp-18h] [bp-A8h]@83
|
|
1602 GUIWindow message_window; // [sp+Ch] [bp-84h]@137
|
|
1603 POINT cursor; // [sp+78h] [bp-18h]@2
|
|
1604 unsigned int damage_level; // [sp+8Ch] [bp-4h]@23
|
|
1605
|
|
1606 if (no_rightlick_in_inventory)
|
|
1607 return;
|
|
1608
|
|
1609 pMouse->GetCursorPos(&cursor);
|
|
1610 int item_pid = (pRenderer->pActiveZBuffer[cursor.x + pSRZBufferLineOffsets[cursor.y]] & 0xFFFF) - 1;
|
|
1611 if (item_pid == -1) //added here to avoid crash
|
|
1612 return;
|
|
1613 ItemGen* item = &pPlayers[uActiveCharacter]->pInventoryItemList[item_pid];
|
|
1614
|
|
1615 if (cursor.x <= 13 || cursor.x >= 462)//items out of inventory(âåùè âíå èíâåíòàðÿ)
|
|
1616 {
|
|
1617 GameUI_DrawItemInfo(item);
|
|
1618 return;
|
|
1619 }
|
|
1620
|
|
1621 if (!item_pid)
|
|
1622 {
|
|
1623 int inventory_mouse_x = cursor.x - 14;
|
|
1624 int inventory_mouse_y = cursor.y - 17;
|
|
1625
|
|
1626 int mouse_cell_x = inventory_mouse_x / 32;
|
|
1627 int mouse_cell_y = inventory_mouse_y / 32;
|
|
1628
|
|
1629 if (mouse_cell_x + mouse_cell_y < 0)
|
|
1630 return;
|
|
1631
|
|
1632 int inventory_idx = mouse_cell_x + 14 * mouse_cell_y;
|
|
1633 if (inventory_idx > 126)
|
|
1634 return;
|
|
1635
|
|
1636 if (pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex(&inventory_idx) == 0)
|
|
1637 return;
|
|
1638
|
|
1639 item_pid = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex(&inventory_idx);
|
|
1640 }
|
|
1641 //check character condition(ïðîâåðêà ñîñòîÿíèÿ ïåðñîíàæà)
|
|
1642 if (!pPlayers[uActiveCharacter]->CanAct())
|
|
1643 {
|
|
1644 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[427], pPlayers[uActiveCharacter]->pName, pGlobalTXT_LocalizationStrings[541]);//%s íå â ñîñòîÿíèè %s Îïîçíàòü ïðåäìåòû
|
|
1645 message_window.Hint = pTmpBuf.data();
|
|
1646 message_window.uFrameWidth = 384;
|
|
1647 message_window.uFrameHeight = 180;
|
|
1648 if (cursor.x <= 320 )
|
|
1649 message_window.uFrameX = cursor.x + 30;
|
|
1650 else
|
|
1651 message_window.uFrameX = cursor.x - 414;
|
|
1652 message_window.uFrameY = 40;
|
|
1653 message_window.DrawMessageBox(0);
|
|
1654 return;
|
|
1655 }
|
|
1656
|
|
1657 int alchemy_skill_points = (int8_t)pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_ALCHEMY) & 0x3F;
|
|
1658 int alchemy_skill_level = SkillToMastery(pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_ALCHEMY));
|
|
1659
|
|
1660 // for potion bottle(ïðîñòàÿ áóòûëêà)
|
|
1661 if (pParty->pPickedItem.uItemID == ITEM_POTION_BOTTLE)
|
|
1662 {
|
|
1663 GameUI_DrawItemInfo(item);
|
|
1664 return;
|
|
1665 }
|
|
1666 //for recharge potion(çåëüå ïåðåçàðÿäêà)
|
|
1667 if (pParty->pPickedItem.uItemID == ITEM_POTION_RECHARGE_ITEM)
|
|
1668 {
|
|
1669 if (item->uItemID < ITEM_POTION_BOTTLE || item->uItemID > ITEM_POTION_REJUVENATION)// all potions
|
|
1670 {
|
|
1671 if (item->GetItemEquipType() != EQUIP_WAND) // can recharge only wands
|
|
1672 {
|
|
1673 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
|
|
1674 return;
|
|
1675 }
|
|
1676
|
|
1677 v31 = (70.0 - (double)pParty->pPickedItem.uEnchantmentType) * 0.01;
|
|
1678 if ( v31 < 0.0 )
|
|
1679 v31 = 0.0;
|
|
1680 item->uMaxCharges = (signed __int64)((double)item->uMaxCharges - v31 * (double)item->uMaxCharges);
|
|
1681 item->uNumCharges = (signed __int64)((double)item->uMaxCharges - v31 * (double)item->uMaxCharges);
|
|
1682
|
|
1683 pMouse->RemoveHoldingItem();
|
|
1684 no_rightlick_in_inventory = 1;
|
|
1685 return;
|
|
1686 }
|
|
1687 GameUI_DrawItemInfo(item);
|
|
1688 return;
|
|
1689 }
|
|
1690 // for harden potion(çåëüå çàêàëêà)
|
|
1691 else if (pParty->pPickedItem.uItemID == ITEM_POTION_HARDEN_ITEM)
|
|
1692 {
|
|
1693 if (item->uItemID < ITEM_POTION_BOTTLE || item->uItemID > ITEM_POTION_REJUVENATION) // bottle and all potions
|
|
1694 {
|
|
1695 if (item->IsBroken() || // cant harden broken items
|
|
1696 item->uItemID >= ITEM_ARTIFACT_PUCK || // cant harden artifacts
|
|
1697 item->GetItemEquipType() < EQUIP_SINGLE_HANDED ||
|
|
1698 item->GetItemEquipType() > EQUIP_WAND)
|
|
1699 {
|
|
1700 pMouse->RemoveHoldingItem();
|
|
1701 no_rightlick_in_inventory = true;
|
|
1702 return;
|
|
1703 }
|
|
1704
|
|
1705 item->uAttributes |= ITEM_AURA_EFFECT_RED | ITEM_HARDENED;
|
|
1706
|
|
1707 _50C9A8_item_enchantment_timer = 256;
|
|
1708 pMouse->RemoveHoldingItem();
|
|
1709 no_rightlick_in_inventory = true;
|
|
1710 return;
|
|
1711 }
|
|
1712 GameUI_DrawItemInfo(item);
|
|
1713 return;
|
|
1714 }
|
|
1715 // several potions(íåñêîëüêî çåëèé)
|
|
1716 else if (pParty->pPickedItem.uItemID >= ITEM_POTION_FLAMING_POTION && pParty->pPickedItem.uItemID <= ITEM_POTION_SWIFT_POTION ||
|
|
1717 pParty->pPickedItem.uItemID == ITEM_POTION_SLAYING_POTION)
|
|
1718 {
|
|
1719 if ( item->uItemID < ITEM_POTION_BOTTLE || item->uItemID > ITEM_POTION_REJUVENATION) // all potions
|
|
1720 {
|
|
1721 if (item->uItemID >= ITEM_BLASTER && item->uItemID <= ITEM_LASER_RIFLE ||
|
|
1722 item->uItemID >= ITEM_ARTIFACT_PUCK ||
|
|
1723 item->IsBroken() ||
|
|
1724 item->uSpecEnchantmentType ||
|
|
1725 item->uEnchantmentType ||
|
|
1726 item->GetItemEquipType() >= EQUIP_ARMOUR) // only melee weapons and bows
|
|
1727 {
|
|
1728 pMouse->RemoveHoldingItem();
|
|
1729 no_rightlick_in_inventory = true;
|
|
1730 return;
|
|
1731 }
|
|
1732
|
|
1733 item->UpdateTempBonus(pParty->uTimePlayed);
|
|
1734 if (pParty->pPickedItem.uItemID == ITEM_POTION_SLAYING_POTION)
|
|
1735 {
|
|
1736 item->uSpecEnchantmentType = 40; // of Slaying
|
|
1737 v31 = (double)(1800 * pParty->pPickedItem.uEnchantmentType * 128);
|
|
1738 }
|
|
1739 else
|
|
1740 {
|
|
1741 static int _4E2904_enchantment_by_potion_lut[] =
|
|
1742 {
|
|
1743 164, 93, 22,
|
|
1744 164, 93, 22,
|
|
1745 11, 5, 13, 7, 59
|
|
1746 };
|
|
1747 item->uSpecEnchantmentType = _4E2904_enchantment_by_potion_lut[pParty->pPickedItem.uItemID - 240];
|
|
1748 v31 = (double)(1800 * pParty->pPickedItem.uEnchantmentType * 128);
|
|
1749 }
|
|
1750
|
|
1751 item->uExpireTime = pParty->uTimePlayed + v31 * 0.033333335;
|
|
1752 item->uAttributes = alchemy_skill_level | 0x18;
|
|
1753
|
|
1754 _50C9A8_item_enchantment_timer = 256;
|
|
1755 pMouse->RemoveHoldingItem();
|
|
1756 no_rightlick_in_inventory = true;
|
|
1757 return;
|
|
1758 }
|
|
1759 GameUI_DrawItemInfo(item);
|
|
1760 return;
|
|
1761 }
|
|
1762 // use reagents(ïðèìåíåíèå ðåàãåíòîâ)
|
|
1763 if (pParty->pPickedItem.uItemID >= ITEM_REAGENT_WIDOWSWEEP_BERRIES && pParty->pPickedItem.uItemID <= ITEM_REAGENT_PHILOSOPHERS_STONE &&
|
|
1764 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID == ITEM_POTION_BOTTLE)
|
|
1765 {
|
|
1766 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uEnchantmentType = alchemy_skill_points + pParty->pPickedItem.GetDamageDice();
|
|
1767 switch ( pParty->pPickedItem.uItemID )
|
|
1768 {
|
|
1769 case 200:
|
|
1770 case 201:
|
|
1771 case 202:
|
|
1772 case 203:
|
|
1773 case 204:
|
|
1774 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID = 222;
|
|
1775 break;
|
|
1776 case 205:
|
|
1777 case 206:
|
|
1778 case 207:
|
|
1779 case 208:
|
|
1780 case 209:
|
|
1781 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID = 223;
|
|
1782 break;
|
|
1783 case 210:
|
|
1784 case 211:
|
|
1785 case 212:
|
|
1786 case 213:
|
|
1787 case 214:
|
|
1788 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID = 224;
|
|
1789 break;
|
|
1790 case 215:
|
|
1791 case 216:
|
|
1792 case 217:
|
|
1793 case 218:
|
|
1794 case 219:
|
|
1795 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID = 221;
|
|
1796 break;
|
|
1797 default:
|
|
1798 break;
|
|
1799 }
|
|
1800 pMouse->RemoveHoldingItem();
|
|
1801 no_rightlick_in_inventory = 1;
|
|
1802 if ( dword_4E455C )
|
|
1803 {
|
|
1804 pPlayers[uActiveCharacter]->PlaySound(SPEECH_DO_POTION_FINE, 0);
|
|
1805 dword_4E455C = 0;
|
|
1806 }
|
|
1807 return;
|
|
1808 }
|
|
1809 //potions mixing(ñìåøèâàíèå äâóõ çåëèé)
|
|
1810 if (pParty->pPickedItem.uItemID >= ITEM_POTION_CATALYST && pParty->pPickedItem.uItemID <= ITEM_POTION_REJUVENATION &&
|
|
1811 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID >= ITEM_POTION_CATALYST &&
|
|
1812 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID <= ITEM_POTION_REJUVENATION)
|
|
1813 {
|
|
1814 potion1_id = item->uItemID - ITEM_POTION_CURE_WOUNDS;
|
|
1815 potion2_id = pParty->pPickedItem.uItemID - ITEM_POTION_CURE_WOUNDS;
|
|
1816
|
|
1817 if ( pParty->pPickedItem.uItemID == ITEM_POTION_CATALYST || item->uItemID == ITEM_POTION_CATALYST )
|
|
1818 potionID = 5;
|
|
1819 else
|
|
1820 potionID = pItemsTable->potion_data[potion2_id][potion1_id];
|
|
1821 damage_level = 0;
|
|
1822 if ( alchemy_skill_points )
|
|
1823 {
|
|
1824 if ( potionID < ITEM_POTION_CURE_DISEASE || potionID > ITEM_POTION_AWAKEN )//< 225 >227
|
|
1825 {
|
|
1826 if ( potionID >= ITEM_POTION_HASTE && potionID <= ITEM_POTION_CURE_INSANITY && alchemy_skill_level == 1)//228 >= potionID <= 239
|
|
1827 damage_level = 2;
|
|
1828 if ( potionID >= ITEM_POTION_MIGHT_BOOST && potionID <= ITEM_POTION_BODY_RESISTANE && alchemy_skill_level <= 2)//240 >= potionID <= 261
|
|
1829 damage_level = 3;
|
|
1830 if ( potionID >= ITEM_POTION_STONE_TO_FLESH && alchemy_skill_level <= 3 )// 262 < potionID
|
|
1831 damage_level = 4;
|
|
1832 }
|
|
1833 }
|
|
1834 else//no skill(íåò íàâûêà)
|
|
1835 {
|
|
1836 if ( potionID >= ITEM_POTION_CURE_DISEASE && potionID <= ITEM_POTION_AWAKEN )//225 <= v16 <= 227
|
|
1837 damage_level = 1;
|
|
1838 if ( potionID >= ITEM_POTION_HASTE && potionID <= ITEM_POTION_CURE_INSANITY )//228 <= v16 <= 239
|
|
1839 damage_level = 2;
|
|
1840 if ( potionID >= ITEM_POTION_MIGHT_BOOST && potionID <= ITEM_POTION_BODY_RESISTANE )//240 <= v16 <= 261
|
|
1841 damage_level = 3;
|
|
1842 if ( potionID >= ITEM_POTION_STONE_TO_FLESH )//262 <= v16
|
|
1843 damage_level = 4;
|
|
1844 }
|
|
1845
|
|
1846 int pOut_x = item_pid + 1;
|
|
1847 for ( uint i = 0; i < 126; ++i )
|
|
1848 {
|
|
1849 if ( pPlayers[uActiveCharacter]->pInventoryMatrix[i] == pOut_x )
|
|
1850 {
|
|
1851 pOut_y = i;
|
|
1852 break;
|
|
1853 }
|
|
1854 }
|
|
1855 if ( !potionID )
|
|
1856 {
|
|
1857 GameUI_DrawItemInfo(item);
|
|
1858 return;
|
|
1859 }
|
|
1860 if ( damage_level == 1 )
|
|
1861 {
|
|
1862 pPlayers[uActiveCharacter]->RemoveItemAtInventoryIndex(pOut_y);
|
|
1863 pPlayers[uActiveCharacter]->ReceiveDamage(rand() % 11 + 10, DMGT_FIRE);
|
2506
|
1864 pAudioPlayer->PlaySound(SOUND_Explosion, 0, 0, -1, 0, 0, 0, 0);
|
2501
|
1865 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 0, 0);
|
|
1866 v39.z = pParty->vPosition.z + pParty->sEyelevel;
|
|
1867 v39.x = pParty->vPosition.x;
|
|
1868 v39.y = pParty->vPosition.y;
|
|
1869
|
|
1870 int rot_x, rot_y, rot_z;
|
|
1871 Vec3_int_::Rotate(64, pParty->sRotationY, pParty->sRotationX, v39, &rot_x, &rot_y, &rot_z);
|
|
1872 SpriteObject::sub_42F7EB_DropItemAt(0x41Bu, rot_x, rot_y, rot_z, 0, 1, 0, 0, 0);
|
|
1873 if ( dword_4E455C )
|
|
1874 {
|
|
1875 if ( pPlayers[uActiveCharacter]->CanAct() )
|
|
1876 pPlayers[uActiveCharacter]->PlaySound(SPEECH_17, 0);
|
|
1877 ShowStatusBarString(pGlobalTXT_LocalizationStrings[444], 2);//Îé!
|
|
1878 dword_4E455C = 0;
|
|
1879 }
|
|
1880 pMouse->RemoveHoldingItem();
|
|
1881 no_rightlick_in_inventory = 1;
|
|
1882 return;
|
|
1883 }
|
|
1884 if ( damage_level == 2 )
|
|
1885 {
|
|
1886 pPlayers[uActiveCharacter]->RemoveItemAtInventoryIndex(pOut_y);
|
|
1887 pPlayers[uActiveCharacter]->ReceiveDamage(rand() % 71 + 30, DMGT_FIRE);
|
|
1888 pPlayers[uActiveCharacter]->ItemsEnchant(1);
|
2506
|
1889 pAudioPlayer->PlaySound(SOUND_Explosion, 0, 0, -1, 0, 0, 0, 0);
|
2501
|
1890 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 0, 0);
|
|
1891
|
|
1892 v39.z = pParty->vPosition.z + pParty->sEyelevel;
|
|
1893 v39.x = pParty->vPosition.x;
|
|
1894 v39.y = pParty->vPosition.y;
|
|
1895
|
|
1896 int rot_x, rot_y, rot_z;
|
|
1897 Vec3_int_::Rotate(64, pParty->sRotationY, pParty->sRotationX, v39, &rot_x, &rot_y, &rot_z);
|
|
1898 SpriteObject::sub_42F7EB_DropItemAt(0x41Bu, rot_x, rot_y, rot_z, 0, 1, 0, 0, 0);
|
|
1899 if ( dword_4E455C )
|
|
1900 {
|
|
1901 if ( pPlayers[uActiveCharacter]->CanAct() )
|
|
1902 pPlayers[uActiveCharacter]->PlaySound(SPEECH_17, 0);
|
|
1903 ShowStatusBarString(pGlobalTXT_LocalizationStrings[444], 2);//Îé!
|
|
1904 dword_4E455C = 0;
|
|
1905 }
|
|
1906 pMouse->RemoveHoldingItem();
|
|
1907 no_rightlick_in_inventory = 1;
|
|
1908 return;
|
|
1909 }
|
|
1910 if ( damage_level == 3 )
|
|
1911 {
|
|
1912 pPlayers[uActiveCharacter]->RemoveItemAtInventoryIndex(pOut_y);
|
|
1913 pPlayers[uActiveCharacter]->ReceiveDamage(rand() % 201 + 50, DMGT_FIRE);
|
|
1914 pPlayers[uActiveCharacter]->ItemsEnchant(5);
|
2506
|
1915 pAudioPlayer->PlaySound(SOUND_Explosion, 0, 0, -1, 0, 0, 0, 0);
|
2501
|
1916
|
|
1917 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 0, 0);
|
|
1918
|
|
1919 v39.z = pParty->vPosition.z + pParty->sEyelevel;
|
|
1920 v39.x = pParty->vPosition.x;
|
|
1921 v39.y = pParty->vPosition.y;
|
|
1922
|
|
1923 int rot_x, rot_y, rot_z;
|
|
1924 Vec3_int_::Rotate(64, pParty->sRotationY, pParty->sRotationX, v39, &rot_x, &rot_y, &rot_z);
|
|
1925 SpriteObject::sub_42F7EB_DropItemAt(0x41Bu, rot_x, rot_y, rot_z, 0, 1, 0, 0, 0);
|
|
1926 if ( dword_4E455C )
|
|
1927 {
|
|
1928 if ( pPlayers[uActiveCharacter]->CanAct() )
|
|
1929 pPlayers[uActiveCharacter]->PlaySound(SPEECH_17, 0);
|
|
1930 ShowStatusBarString(pGlobalTXT_LocalizationStrings[444], 2);//Îé!
|
|
1931 dword_4E455C = 0;
|
|
1932 }
|
|
1933 pMouse->RemoveHoldingItem();
|
|
1934 no_rightlick_in_inventory = 1;
|
|
1935 return;
|
|
1936 }
|
|
1937 if ( damage_level == 4 )
|
|
1938 {
|
|
1939 pPlayers[uActiveCharacter]->RemoveItemAtInventoryIndex(pOut_y);
|
|
1940 pPlayers[uActiveCharacter]->SetCondition(Condition_Eradicated, 0);
|
|
1941 pPlayers[uActiveCharacter]->ItemsEnchant(0);
|
2506
|
1942 pAudioPlayer->PlaySound(SOUND_Explosion, 0, 0, -1, 0, 0, 0, 0);
|
2501
|
1943
|
|
1944 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 0, 0);
|
|
1945
|
|
1946 v39.z = pParty->vPosition.z + pParty->sEyelevel;
|
|
1947 v39.x = pParty->vPosition.x;
|
|
1948 v39.y = pParty->vPosition.y;
|
|
1949
|
|
1950 int rot_x, rot_y, rot_z;
|
|
1951 Vec3_int_::Rotate(64, pParty->sRotationY, pParty->sRotationX, v39, &rot_x, &rot_y, &rot_z);
|
|
1952 SpriteObject::sub_42F7EB_DropItemAt(0x41Bu, rot_x, rot_y, rot_z, 0, 1, 0, 0, 0);
|
|
1953 if ( dword_4E455C )
|
|
1954 {
|
|
1955 if ( pPlayers[uActiveCharacter]->CanAct() )
|
|
1956 pPlayers[uActiveCharacter]->PlaySound(SPEECH_17, 0);
|
|
1957 ShowStatusBarString(pGlobalTXT_LocalizationStrings[444], 2);//Îé!
|
|
1958 dword_4E455C = 0;
|
|
1959 }
|
|
1960 pMouse->RemoveHoldingItem();
|
|
1961 no_rightlick_in_inventory = 1;
|
|
1962 return;
|
|
1963 }
|
|
1964 if ( damage_level == 0 )
|
|
1965 {
|
|
1966 if ( alchemy_skill_points )
|
|
1967 {
|
|
1968 if ( pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID == 221 || pParty->pPickedItem.uItemID == 221 )//catalyst(êàòàëèçàòîð)
|
|
1969 {
|
|
1970 if ( pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID == 221 )
|
|
1971 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID = pParty->pPickedItem.uItemID;
|
|
1972 if ( pParty->pPickedItem.uItemID == 221 )
|
|
1973 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uEnchantmentType = pParty->pPickedItem.uEnchantmentType;
|
|
1974 }
|
|
1975 else
|
|
1976 {
|
|
1977 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID = potionID;
|
|
1978 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uEnchantmentType = (pParty->pPickedItem.uEnchantmentType
|
|
1979 + pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uEnchantmentType) / 2;
|
|
1980 pPlayers[uActiveCharacter]->SetVariable(VAR_AutoNotes, pItemsTable->potion_note[potion1_id][potion2_id]);
|
|
1981 }
|
|
1982 int bottle = pPlayers[uActiveCharacter]->AddItem(-1, 220);//áóòûëêà
|
|
1983 if ( bottle )
|
|
1984 pPlayers[uActiveCharacter]->pOwnItems[bottle - 1].uAttributes = ITEM_IDENTIFIED;
|
|
1985 if ( !(pItemsTable->pItems[pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID].uItemID_Rep_St) )
|
|
1986 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uAttributes |= 1;
|
|
1987 if ( !dword_4E455C )
|
|
1988 {
|
|
1989 pMouse->RemoveHoldingItem();
|
|
1990 no_rightlick_in_inventory = 1;
|
|
1991 return;
|
|
1992 }
|
|
1993 pPlayers[uActiveCharacter]->PlaySound(SPEECH_DO_POTION_FINE, 0);
|
|
1994 dword_4E455C = 0;
|
|
1995 pMouse->RemoveHoldingItem();
|
|
1996 no_rightlick_in_inventory = 1;
|
|
1997 return;
|
|
1998 }
|
|
1999 GameUI_DrawItemInfo(item);
|
|
2000 return;
|
|
2001 }
|
|
2002 }
|
|
2003 GameUI_DrawItemInfo(item);
|
|
2004 return;
|
|
2005 }
|
|
2006
|
|
2007
|
|
2008 //----- (0045828B) --------------------------------------------------------
|
|
2009 unsigned int __fastcall GetSpellColor(signed int a1)
|
|
2010 {
|
|
2011 if ( a1 == 0 )
|
|
2012 return Color16(0, 0, 0);
|
|
2013 if ( a1 < 12 )
|
|
2014 return Color16(255, 85, 0);
|
|
2015 if ( a1 < 23 )
|
|
2016 return Color16(150, 212, 255);
|
|
2017 if ( a1 < 34 )
|
|
2018 return Color16(0, 128, 255);
|
|
2019 if ( a1 < 45 )
|
|
2020 return Color16(128, 128, 128);
|
|
2021 if ( a1 < 56 )
|
|
2022 return Color16(225, 225, 225);
|
|
2023 if ( a1 < 67 )
|
|
2024 return Color16(235, 15, 255);
|
|
2025 if ( a1 < 78 )
|
|
2026 return Color16(255, 128, 0);
|
|
2027 if ( a1 < 89 )
|
|
2028 return Color16(255, 255, 155);
|
|
2029 if ( a1 < 100 )
|
|
2030 return Color16(192, 192, 240);
|
|
2031 else
|
|
2032 __debugbreak();
|
|
2033 }
|
|
2034
|
|
2035 //----- (004B46F8) --------------------------------------------------------
|
|
2036 __int64 GetExperienceRequiredForLevel(int level)
|
|
2037 {
|
|
2038 __int64 v1; // eax@1
|
|
2039 int i; // edx@1
|
|
2040
|
|
2041 v1 = 0;
|
|
2042 for (i = 0; i < level; ++i)
|
|
2043 v1 += i + 1;
|
|
2044 return 1000 * v1;
|
|
2045 }
|