annotate UI/UIPopup.cpp @ 1729:f44b6e02e81c

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