annotate GUI/UI/UIPopup.cpp @ 2534:1bcadc6dd203

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