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