1298
|
1 #ifdef _MSC_VER
|
|
2 #define _CRT_SECURE_NO_WARNINGS
|
|
3 #endif
|
|
4
|
1299
|
5 #include "..\Texture.h"
|
|
6 #include "..\mm7_data.h"
|
1298
|
7 #include "UIHouses.h"
|
1299
|
8 #include "..\Party.h"
|
|
9 #include "..\texts.h"
|
|
10 #include "..\Events.h"
|
|
11 #include "..\Arcomage.h"
|
|
12 #include "..\LOD.h"
|
|
13 #include "..\Mouse.h"
|
|
14 #include "..\GUIWindow.h"
|
|
15 #include "..\GUIFont.h"
|
|
16 #include "..\Events2D.h"
|
|
17 #include "..\Overlays.h"
|
|
18 #include "..\Outdoor.h"
|
|
19 #include "..\AudioPlayer.h"
|
|
20 #include "..\VideoPlayer.h"
|
|
21 #include "..\Monsters.h"
|
|
22 #include "..\Viewport.h"
|
|
23 #include "..\Keyboard.h"
|
|
24 #include "..\IndoorCamera.h"
|
|
25 #include "..\MapInfo.h"
|
|
26 #include "..\Log.h"
|
|
27 #include "..\Game.h"
|
1298
|
28
|
1299
|
29 #include "..\stru159.h"
|
1298
|
30 int uHouse_ExitPic; // weak
|
|
31
|
|
32 int dword_591080; // weak
|
|
33
|
|
34 int in_current_building_type; // 00F8B198
|
|
35 HOUSE_DIALOGUE_MENU dialog_menu_id; // 00F8B19C
|
|
36
|
|
37 #pragma pack(push, 1)
|
|
38 struct stru365_travel_info
|
|
39 {
|
|
40 unsigned char uMapInfoID;
|
|
41 unsigned char pSchedule[7];
|
|
42 unsigned int uTravelTime;
|
|
43 int arrival_x;
|
|
44 int arrival_y;
|
|
45 int arrival_z;
|
|
46 int arrival_rot_y;
|
|
47 unsigned int uQuestBit; // quest bit required to set for this travel option to be enabled; otherwise 0
|
|
48 };
|
|
49 #pragma pack(pop)
|
|
50 stru365_travel_info transport_schedule[35] = // 004F09B0
|
|
51 {
|
|
52 {MAP_STEADWICK, {1, 0, 1, 0, 1, 0, 0}, 2, -18048, 4636, 833, 1536, 0},
|
|
53 {MAP_PIERPONT, {0, 1, 0, 1, 0, 1, 0}, 2, -2527, -6773, 1153, 896, 0},
|
|
54 {MAP_TATALIA, {1, 0, 1, 0, 1, 0, 0}, 2, 4730, -10580, 320, 1024, 0},
|
|
55 {MAP_HARMONDALE, {0, 1, 0, 1, 0, 1, 0}, 2, -5692, 11137, 1, 1024, 0},
|
|
56 {MAP_DEYJA, {1, 0, 0, 1, 0, 0, 0}, 3, 7227, -16007, 2625, 640, 0},
|
|
57 {MAP_BRAKADA_DESERT, {0, 0, 1, 0, 0, 1, 0}, 3, 8923, 17191, 1, 512, 0},
|
|
58 {MAP_AVLEE, {1, 0, 1, 0, 1, 0, 0}, 3, 17059, 12331, 512, 1152, 0},
|
|
59 {MAP_DEYJA, {0, 1, 0, 0, 1, 0, 1}, 2, 7227, -16007, 2625, 640, 0},
|
|
60 {MAP_HARMONDALE, {0, 1, 0, 1, 0, 1, 0}, 2, -5692, 11137, 1, 1024, 0},
|
|
61 {MAP_STEADWICK, {1, 0, 1, 0, 1, 0, 0}, 3, -18048, 4636, 833, 1536, 0},
|
|
62 {MAP_PIERPONT, {0, 1, 0, 1, 0, 1, 0}, 2, -2527, -6773, 1153, 896, 0},
|
|
63 {MAP_STEADWICK, {1, 0, 1, 0, 1, 0, 1}, 3, -18048, 4636, 833, 1536, 0},
|
|
64 {MAP_HARMONDALE, {0, 1, 0, 0, 0, 1, 0}, 5, -5692, 11137, 1, 1024, 0},
|
|
65 {MAP_STEADWICK, {0, 1, 0, 1, 0, 1, 0}, 2, -18048, 4636, 833, 1536, 0},
|
|
66 {MAP_PIERPONT, {0, 1, 0, 1, 0, 1, 0}, 3, -2527, -16007, 1153, 896, 0},
|
|
67 {MAP_DEYJA, {0, 0, 1, 0, 0, 0, 1}, 5, 7227, -16007, 2625, 640, 0},
|
|
68 {MAP_TATALIA, {0, 1, 0, 1, 0, 1, 0}, 2, -2183, -6941, 97, 0, 0},
|
|
69 {MAP_AVLEE, {1, 0, 0, 0, 1, 0, 0}, 4, 7913, 9476, 193, 0, 0},
|
|
70 {MAP_EVENMORN_ISLE, {0, 0, 0, 0, 0, 0, 1}, 7, 15616, 6390, 193, 1536, PARTY_QUEST_EVENMORN_MAP_FOUND},
|
|
71 {MAP_BRAKADA_DESERT, {0, 0, 1, 0, 0, 0, 0}, 6, 19171, -19722, 193, 1024, 0},
|
|
72 {MAP_AVLEE, {0, 1, 0, 1, 0, 1, 0}, 3, 7913, 9476, 193, 0, 0},
|
|
73 {MAP_BRAKADA_DESERT, {1, 0, 1, 0, 0, 0, 0}, 6, 19171, -19722, 193, 1024, 0},
|
|
74 {MAP_TATALIA, {1, 0, 1, 0, 1, 0, 0}, 4, -2183, -6941, 97, 0, 0},
|
|
75 {MAP_PIERPONT, {0, 0, 0, 0, 0, 1, 0}, 6, -709, -14087, 193, 1024, 0},
|
|
76 {MAP_STEADWICK, {0, 0, 0, 0, 0, 0, 1}, 6, -10471, 13497, 193, 1536, 0},
|
|
77 {MAP_EVENMORN_ISLE, {0, 1, 0, 1, 0, 0, 0}, 1, 15616, 6390, 193, 1536, PARTY_QUEST_EVENMORN_MAP_FOUND},
|
|
78 {MAP_BRAKADA_DESERT, {0, 1, 0, 1, 0, 0, 0}, 1, 19171, -19722, 193, 1024, 0},
|
|
79 {MAP_STEADWICK, {0, 1, 0, 1, 0, 1, 0}, 2, -10471, 13497, 193, 1536, 0},
|
|
80 {MAP_BRAKADA_DESERT, {1, 0, 1, 0, 0, 0, 0}, 4, 19171, -19722, 193, 1024, 0},
|
|
81 {MAP_EVENMORN_ISLE, {0, 0, 0, 0, 0, 0, 1}, 5, 15616, 6390, 193, 1536, PARTY_QUEST_EVENMORN_MAP_FOUND},
|
|
82 {MAP_AVLEE, {0, 0, 0, 0, 1, 0, 0}, 5, 7913, 9476, 193, 0, 0},
|
|
83 {MAP_STEADWICK, {0, 1, 0, 0, 0, 1, 0}, 4, -10471, 13497, 193, 1536, 0},
|
|
84 {MAP_PIERPONT, {1, 0, 1, 0, 1, 0, 0}, 3, -709, -14087, 193, 1024, 0},
|
|
85 {MAP_TATALIA, {0, 0, 0, 1, 0, 0, 0}, 5, -2183, -6941, 97, 0, 0},
|
|
86 {MAP_ARENA, {0, 0, 0, 0, 0, 0, 1}, 4, 3844, 2906, 193, 512, 0}
|
|
87 };
|
|
88
|
|
89 unsigned char transport_routes[20][4] =
|
|
90 {
|
|
91 { 0, 1, 1, 34}, // HOUSE_STABLES_HARMONDALE
|
|
92 { 2, 3, 4, 5}, // HOUSE_STABLES_STEADWICK
|
|
93 { 6, 7, 8, 8}, // HOUSE_STABLES_56
|
|
94 { 9, 10, 10, 10}, // HOUSE_STABLES_57
|
|
95 { 11, 11, 12, 12}, // HOUSE_STABLES_58
|
|
96 { 13, 13, 13, 13}, // HOUSE_STABLES_59
|
|
97 { 14, 14, 15, 15}, // HOUSE_STABLES_60
|
|
98 {255, 255, 255, 255}, // HOUSE_STABLES_61
|
|
99 {255, 255, 255, 255}, // HOUSE_STABLES_62
|
|
100 {255, 255, 255, 255}, // HOUSE_BOATS_63
|
|
101 { 16, 17, 18, 19}, // HOUSE_BOATS_64
|
|
102 { 18, 20, 21, 21}, // HOUSE_BOATS_65
|
|
103 { 22, 23, 24, 25}, // HOUSE_BOATS_66
|
|
104 { 22, 22, 23, 23}, // HOUSE_BOATS_67
|
|
105 {255, 255, 255, 255}, // HOUSE_BOATS_68
|
|
106 { 27, 28, 29, 30}, // HOUSE_BOATS_69
|
|
107 { 31, 32, 33, 33}, // HOUSE_BOATS_70
|
|
108 { 24, 24, 24, 24}, // HOUSE_BOATS_71
|
|
109 {255, 255, 255, 255}, // HOUSE_BOATS_72
|
|
110 {255, 255, 255, 255} // HOUSE_BOATS_73
|
|
111 };
|
|
112
|
|
113
|
|
114
|
|
115
|
|
116
|
|
117 std::array<const stru159, 196> pAnimatedRooms = //0x4E5F70
|
|
118 {{
|
|
119 {"", 0x4, 0x1F4, 0, 0, 0},
|
|
120 {"Human Armor01", 0x20, 0x2C0, 2, 58, 0},
|
|
121 {"Necromancer Armor01", 0x20, 0x2D7, 2, 70, 0 },
|
|
122 {"Dwarven Armor01", 0x20, 0x2EE, 2, 5, 0 },
|
|
123 {"Wizard Armor", 0x20, 0x3BD, 2, 19, 0 },
|
|
124 {"Warlock Armor", 0x20, 0x2D6, 2, 35, 0 },
|
|
125 {"Elf Armor", 0x20, 0x2BC, 2, 79, 0 },
|
|
126 {"Human Alchemisht01", 0xE, 0x2BE, 4, 95, 0 },
|
|
127 {"Necromancer Alchemist01", 0xE, 0x2D6, 4, 69, 0 },
|
|
128 {"Dwarven Achemist01", 0xE, 0x387, 4, 4, 0 },
|
|
129 {"Wizard Alchemist", 0xE, 0x232, 4, 25, 0 },
|
|
130 {"Warlock Alchemist", 0xE, 0x2BE, 4, 42, 0 },
|
|
131 {"Elf Alchemist", 0xE, 0x38A, 4, 84, 0 },
|
|
132 {"Human Bank01", 0x6, 0x384, 22, 52, 0 },
|
|
133 {"Necromancer Bank01", 0x6, 0x2D8, 22, 71, 0 },
|
|
134 {"Dwarven Bank", 0x6, 0x2F3, 22, 6, 0 },
|
|
135 {"Wizard Bank", 0x6, 0x3BA, 22, 20, 0 },
|
|
136 {"Warlock Bank", 0x6, 0x39F, 22, 36, 0 },
|
|
137 {"Elf Bank", 0x6, 0x2BC, 22, 71, 0 },
|
|
138 {"Boat01", 0xF, 0x4C, 28, 53, 3 },
|
|
139 {"Boat01d", 0xF, 0x4C, 28, 53, 3 },
|
|
140 {"Human Magic Shop01", 0xA, 0x2C8, 3, 54, 0 },
|
|
141 {"Necromancer Magic Shop01", 0xE, 0x2DC, 3, 66, 0 },
|
|
142 {"Dwarven Magic Shop01", 0x2A, 0x2EF, 3, 91, 0 },
|
|
143 {"Wizard Magic Shop", 0x1E, 0x2DF, 3, 15, 0 },
|
|
144 {"Warlock Magic Shop", 0x7, 0x3B9, 3, 15, 0 },
|
|
145 {"Elf Magic Shop", 0x24, 0x2CC, 3, 82, 0 },
|
|
146 {"Human Stables01", 0x21, 0x31, 27, 48, 3 },
|
|
147 {"Necromancer Stables", 0x21, 0x2DD, 27, 67, 3 },
|
|
148 {"", 0x21, 0x2F0, 27, 91, 3 },
|
|
149 {"Wizard Stables", 0x21, 0x3BA, 27, 16, 3 },
|
|
150 {"Warlock Stables", 0x21, 0x181, 27, 77, 3 },
|
|
151 {"Elf Stables", 0x21, 0x195, 27, 77, 3 },
|
|
152 {"Human Tavern01", 0xD, 0x2C2, 21, 49, 0 },
|
|
153 {"Necromancer Tavern01", 0xD, 0x3B0, 21, 57, 0 },
|
|
154 {"Dwarven Tavern01", 0xD, 0x2FE, 21, 94, 0 },
|
|
155 {"Wizard Tavern", 0xD, 0x3BB, 21, 17, 0 },
|
|
156 {"Warlock Tavern", 0xD, 0x3A8, 21, 33, 0 },
|
|
157 {"Elf Tavern", 0xD, 0x2CD, 21, 78, 0 },
|
|
158 {"Human Temple01", 0x24, 0x2DB, 23, 50, 3 },
|
|
159 {"Necromancer Temple", 0x24, 0x2DF, 23, 60, 3 },
|
|
160 {"Dwarven Temple01", 0x24, 0x2F1, 23, 86, 3 },
|
|
161 {"Wizard Temple", 0x24, 0x2E0, 23, 10, 3 },
|
|
162 {"Warlock Temple", 0x24, 0x3A4, 23, 27, 3 },
|
|
163 {"Elf Temple", 0x24, 0x2CE, 23, 72, 3 },
|
|
164 {"Human Town Hall", 0x10, 0x39C, 17, 14, 0 },
|
|
165 {"Necromancer Town Hall01", 0x10, 0x3A4, 17, 61, 0 },
|
|
166 {"Dwarven Town Hall", 0x10, 0x2DB, 17, 88, 0 },
|
|
167 {"Wizard Town Hall", 0x10, 0x3BD, 17, 11, 0 },
|
|
168 {"Warlock Town Hall", 0x10, 0x2DB, 17, 28, 0 },
|
|
169 {"Elf Town Hall", 0x10, 0x27A, 17, 73, 0 },
|
|
170 {"Human Training Ground01", 0x18, 0x2C7, 30, 44, 0 },
|
|
171 {"Necromancer Training Ground", 0x18, 0x3AD, 30, 62, 0 },
|
|
172 {"Dwarven Training Ground", 0x18, 0x2F2, 30, 89, 0 },
|
|
173 {"Wizard Training Ground", 0x18, 0x3A3, 30, 12, 0 },
|
|
174 {"Warlock Training Ground", 0x18, 0x3A6, 30, 29, 0 },
|
|
175 {"Elf Training Ground", 0x18, 0x19F, 30, 74, 0 },
|
|
176 {"Human Weapon Smith01", 0x16, 0x2C1, 1, 45, 4 },
|
|
177 {"Necromancer Weapon Smith01", 0x16, 0x2D9, 1, 63, 4 },
|
|
178 {"Dwarven Weapon Smith01", 0x16, 0x2EE, 1, 82, 4 },
|
|
179 {"Wizard Weapon Smith", 0x16, 0x2D5, 1, 13, 4 },
|
|
180 {"Warlock Weapon Smith", 0x16, 0x2D7, 1, 23, 4 },
|
|
181 {"Elf Weapon Smith", 0x16, 0x2CA, 1, 75, 4 },
|
|
182 {"Air Guild", 0x1D, 0xA4, 6, 1, 3 },
|
|
183 {"Body Guild", 0x19, 0x3BF, 11, 2, 0 },
|
|
184 {"DarkGuild", 0x19, 0x2D1, 13, 3, 0 },
|
|
185 {"EarthGuild", 0x19, 0x2CB, 8, 83, 0 },
|
|
186 {"Fire Guild", 0x1C, 0x2BF, 5, 56, 0 },
|
|
187 {"Light Guild", 0x1C, 0x2D5, 12, 46, 0 },
|
|
188 {"Mind Guild", 0x1C, 0xE5, 10, 40, 0 },
|
|
189 {"Spirit Guild", 0x1C, 0x2D2, 9, 41, 0 },
|
|
190 {"Water Guild", 0x1B, 0x2D3, 7, 24, 0 },
|
|
191 {"Lord And Judge Out01", 1, 0, 29, 39, 0 },
|
|
192 {"Human Poor House 1", 8, 0, 29, 0, 0 },
|
|
193 {"Human Poor House 2", 8, 0, 29, 0, 0 },
|
|
194 {"Human Poor House 3", 8, 0, 29, 0, 0 },
|
|
195 {"Human Medium House 1", 8, 0, 29, 0, 0 },
|
|
196 {"Human Medium House 2", 8, 0, 29, 0, 0 },
|
|
197 {"Human Medium House 3", 8, 0, 29, 0, 0 },
|
|
198 {"Human Rich House 1", 8, 0, 29, 0, 0 },
|
|
199 {"Human Rich House 2", 8, 0, 29, 0, 0 },
|
|
200 {"Human Rich House 3", 8, 0, 29, 0, 0 },
|
|
201 {"Elven Poor House 1", 8, 0, 29, 0, 0 },
|
|
202 {"Elven Poor House 2", 8, 0, 29, 0, 0 },
|
|
203 {"Elven Poor House 3", 8, 0, 29, 0, 0 },
|
|
204 {"Elven Medium House 1", 8, 0, 29, 0, 0 },
|
|
205 {"Elven Medium House 2", 8, 0, 29, 0, 0 },
|
|
206 {"Elven Medium House 3", 8, 0, 29, 0, 0 },
|
|
207 {"Elven Rich House 1", 8, 0, 29, 0, 0 },
|
|
208 {"Elven Rich House 2", 8, 0, 29, 0, 0 },
|
|
209 {"Elven Rich House 3", 8, 0, 29, 0, 0 },
|
|
210 {"Dwarven Poor House 1", 8, 0, 29, 0, 0 },
|
|
211 {"Dwarven Poor House 2", 8, 0, 29, 0, 0 },
|
|
212 {"Dwarven Poor House 3", 8, 0, 29, 0, 0 },
|
|
213 {"Dwarven Medium House 1", 8, 0, 29, 0, 0 },
|
|
214 {"Dwarven Medium house 2", 8, 0, 29, 0, 0 },
|
|
215 {"Dwarven Medium House 3", 8, 0, 29, 0, 0 },
|
|
216 {"Dwarven Rich House 1", 8, 0, 29, 0, 0 },
|
|
217 {"Dwarven Rich House 2", 8, 0, 29, 0, 0 },
|
|
218 {"Dwarven Rich House 3", 8, 0, 29, 0, 0 },
|
|
219 {"Wizard Poor House 1", 8, 0, 29, 0, 0 },
|
|
220 {"Wizard Poor House 2", 8, 0, 29, 0, 0 },
|
|
221 {"Wizard Poor House 3", 8, 0, 29, 0, 0 },
|
|
222 {"Wizard Medium House 1", 8, 0, 29, 0, 0 },
|
|
223 {"Wizard Medium House 2", 8, 0, 29, 0, 0 },
|
|
224 {"Wizard Mdeium House 3", 8, 0, 29, 0, 0 },
|
|
225 {"Wizard Rich House 1", 8, 0, 29, 0, 0 },
|
|
226 {"Wizard Rich House 2", 8, 0, 29, 0, 0 },
|
|
227 {"Wizard Rich House 3", 8, 0, 29, 0, 0 },
|
|
228 {"Necromancer Poor House 1", 8, 0, 29, 0, 0 },
|
|
229 {"Necromancer Poor House 2", 8, 0, 29, 0, 0 },
|
|
230 {"Necromancer Poor House 3", 8, 0, 29, 0, 0 },
|
|
231 {"Necromancer Medium House 1", 8, 0, 29, 0, 0 },
|
|
232 {"Necromancer Medium House 2", 8, 0, 29, 0, 0 },
|
|
233 {"Necromancer Mdeium House 3", 8, 0, 29, 0, 0 },
|
|
234 {"Necromancer Rich House 1", 8, 0, 29, 0, 0 },
|
|
235 {"Necromancer Rich House 2", 8, 0, 29, 0, 0 },
|
|
236 {"Necromancer Rich House 3", 8, 0, 29, 0, 0 },
|
|
237 {"Warlock Poor House 1", 8, 0, 29, 0, 0 },
|
|
238 {"Warlock Poor House 2", 8, 0, 29, 0, 0 },
|
|
239 {"Warlock Poor House 3", 8, 0, 29, 0, 0 },
|
|
240 {"Warlock Medium House 1", 8, 0, 29, 0, 0 },
|
|
241 {"Warlock Medium House 2", 8, 0, 29, 0, 0 },
|
|
242 {"Warlock Mdeium House 3", 8, 0, 29, 0, 0 },
|
|
243 {"Warlock Rich House 1", 8, 0, 29, 0, 0 },
|
|
244 {"Warlock Rich House 2", 8, 0, 29, 0, 0 },
|
|
245 {"Warlock Rich House 3", 8, 0, 29, 0, 0 },
|
|
246 {"Out01 Temple of the Moon", 0x24, 0, 25, 0, 0 },
|
|
247 {"Out01 Dragon Cave", 0x24, 0, 25, 0, 0 },
|
|
248 {"Out02 Castle Harmondy", 0x24, 0, 25, 0, 0 },
|
|
249 {"Out02 White Cliff Cave", 0x24, 0, 25, 0, 0 },
|
|
250 {"Out03 Erathian Sewer", 0x24, 0, 25, 0, 0 },
|
|
251 {"Out03 Fort Riverstride", 0x24, 0, 25, 0, 0 },
|
|
252 {"Out03 Castle Gryphonheart", 0x24, 0, 25, 0, 0 },
|
|
253 {"Out04 Elf Castle", 0x24, 0, 25, 0, 0 },
|
|
254 {"Out04 Tularean Caves", 0x24, 0, 25, 0, 0 },
|
|
255 {"Out04 Clanker's Laboratory", 0x24, 0, 25, 0, 0 },
|
|
256 {"Out05 Hall of the Pit", 0x24, 0, 25, 0, 0 },
|
|
257 {"Out05 Watchtower 6", 0x24, 0, 25, 0, 0 },
|
|
258 {"Out06 School of Sorcery", 0x24, 0, 25, 0, 0 },
|
|
259 {"Out06 Red Dwarf Mines", 0x24, 0, 25, 0, 0 },
|
|
260 {"Out07 Castle Lambert", 0x24, 0, 25, 0, 0 },
|
|
261 {"Out07 Walls of Mist", 0x24, 0, 25, 0, 0 },
|
|
262 {"Out07 Temple of the Light", 0x24, 0, 25, 0, 0 },
|
|
263 {"Out08 Evil Entrance", 0x24, 0, 25, 0, 0 },
|
|
264 {"Out08 Breeding Zone", 0x24, 0, 25, 0, 0 },
|
|
265 {"Out08 Temple of the Dark", 0x24, 0, 25, 0, 0 },
|
|
266 {"Out09 Grand Temple of the Moon", 0x24, 0, 25, 0, 0 },
|
|
267 {"Out09 Grand Tempple of the Sun", 0x24, 0, 25, 0, 0 },
|
|
268 {"Out10 Thunderfist Mountain", 0x24, 0, 25, 0, 0 },
|
|
269 {"Out10 The Maze", 0x24, 0, 25, 0, 0 },
|
|
270 {"Out10 Connecting Tunnel Cave #1", 0x24, 0, 25, 0, 0 },
|
|
271 {"", 0x24, 0, 25, 0, 0 },
|
|
272 {"", 0x24, 0, 25, 0, 0 },
|
|
273 {"Out11 Stone City", 0x24, 0, 25, 0, 0 },
|
|
274 {"", 0x24, 0, 25, 0, 0 },
|
|
275 {"Out12 Colony Zod", 0x24, 0, 25, 0, 0 },
|
|
276 {"Out12 Connecting Tunnel Cave #1", 0x24, 0, 25, 0, 0 },
|
|
277 {"", 0x24, 0, 25, 0, 0 },
|
|
278 {"", 0x24, 0, 25, 0, 0 },
|
|
279 {"Out13 Mercenary Guild", 0x24, 0, 25, 0, 0 },
|
|
280 {"Out13 Tidewater Caverns", 0x24, 0, 25, 0, 0 },
|
|
281 {"Out13 Wine Cellar", 0x24, 0, 25, 0, 0 },
|
|
282 {"Out14 Titan's Stronghold", 0x24, 0, 25, 0, 0 },
|
|
283 {"Out14 Temple Of Baa", 0x24, 0, 25, 0, 0 },
|
|
284 {"Out14 Hall under the Hill", 0x24, 0, 25, 0, 0 },
|
|
285 {"Out15 The Linclon", 0x24, 0, 25, 0, 0 },
|
|
286 {"Jail", 0x24, 0, 31, 0, 0 },
|
|
287 {"Harmondale Throne Room", 0x24, 0, 29, 0, 0 },
|
|
288 {"Gryphonheart Throne Room", 0x24, 0, 20, 0, 0 },
|
|
289 {"Elf Castle Throne Room", 0x24, 0, 20, 0, 0 },
|
|
290 {"Wizard Castle Throne Room", 0x24, 0, 20, 0, 0 },
|
|
291 {"Necromancer Casstle Trone Room", 0x24, 0, 20, 0, 0 },
|
|
292 {"Master Thief", 0x24, 0, 29, 0, 0 },
|
|
293 {"Dwarven King", 0x24, 0, 20, 0, 0 },
|
|
294 {"Arms Master", 0x24, 0, 29, 0, 0 },
|
|
295 {"Warlock", 0x24, 0, 29, 0, 0 },
|
|
296 {"Lord Markam", 0x24, 0, 20, 0, 0 },
|
|
297 {"Arbiter Neutral Town", 0x24, 0, 29, 0, 0 },
|
|
298 {"Arbiter Good Town", 0x24, 0, 29, 0, 0 },
|
|
299 {"Arbiter Evil Town", 0x24, 0, 29, 0, 0 },
|
|
300 {"Necromancer Throne Room Empty", 0x24, 0, 20, 0, 0 },
|
|
301 {"", 0x24, 0, 29, 0, 0 },
|
|
302 {"", 0x24, 0, 29, 0, 0 },
|
|
303 {"", 0x24, 0, 29, 0, 0 },
|
|
304 {"", 0x24, 0, 29, 0, 0 },
|
|
305 {"Boat01", 0xF, 0, 29, 53, 3 },
|
|
306 {"", 0x24, 0, 28, 0, 0 },
|
|
307 {"", 0x24, 0, 28, 0, 0 },
|
|
308 {"", 0x24, 0, 28, 0, 0 },
|
|
309 {"", 0x24, 0, 29, 0, 0 },
|
|
310 {"Arbiter Room Neutral", 0x24, 0, 29, 0, 0 },
|
|
311 {"Out02 Castle Harmondy Abandoned", 0x24, 0, 25, 0, 0 },
|
|
312 {"Human Temple02", 0x24, 0x3AB, 23, 27, 0 },
|
|
313 {"Player Castle Good", 0x24, 0, 25, 0, 0 },
|
|
314 {"Player Castle Bad", 0x24, 0, 25, 0, 0}
|
|
315 }};
|
|
316
|
|
317 //----- (0044622E) --------------------------------------------------------
|
|
318 bool EnterHouse(enum HOUSE_ID uHouseID)
|
|
319 {
|
|
320 //enum HOUSE_ID v1; // edi@1
|
|
321 //int v2; // edi@5
|
|
322 signed int uOpenTime; // eax@5
|
|
323 signed int uCloseTime; // esi@5
|
|
324 unsigned int v5; // esi@5
|
|
325 int v6; // edx@5
|
|
326 signed int am_pm_flag_open; // ecx@10
|
|
327 signed int am_pm_flag_close; // eax@10
|
|
328 int v9; // esi@10
|
|
329 //unsigned int v10; // esi@16
|
|
330 int v11; // ecx@17
|
|
331 unsigned int v12; // kr00_4@25
|
|
332 //Player *v13; // esi@25
|
|
333 int v14; // eax@25
|
|
334 //Player *v15; // esi@27
|
|
335 //signed int v16; // eax@32
|
|
336 unsigned int v17; // eax@37
|
|
337 signed int v18; // edi@37
|
|
338 signed int v19; // edi@41
|
|
339 //unsigned int v20; // ecx@41
|
|
340 //const char *v22; // [sp-4h] [bp-40h]@33
|
|
341 char pContainer[40]; // [sp+Ch] [bp-30h]@32
|
|
342 unsigned int v24; // [sp+34h] [bp-8h]@5
|
|
343 //enum HOUSE_ID v25; // [sp+38h] [bp-4h]@1
|
|
344
|
|
345 //v1 = uHouseID;
|
|
346 //v25 = uHouseID;
|
|
347 GameUI_Footer_TimedString[0] = 0;
|
|
348 pFooterString[0] = 0;
|
|
349 ShowStatusBarString("", 2u);
|
|
350 if ( pMessageQueue_50CBD0->uNumMessages )
|
|
351 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
|
|
352 viewparams->bRedrawGameUI = 1;
|
|
353 uDialogueType = 0;
|
|
354 pKeyActionMap->SetWindowInputStatus(3);
|
|
355 pKeyActionMap->ResetKeys();
|
|
356 if (uHouseID == HOUSE_600 || uHouseID == HOUSE_601)
|
|
357 {
|
|
358 GameOverMenu(0);
|
|
359 return 0;
|
|
360 }
|
|
361 uOpenTime = p2DEvents[uHouseID - 1].uOpenTime;
|
|
362 uCloseTime = p2DEvents[uHouseID - 1].uCloseTime;
|
|
363 current_npc_text = 0;
|
|
364 dword_F8B1E4 = 0;
|
|
365 dword_F8B1F4 = 0;
|
|
366 memset(byte_F8B1F0.data(), 0, 4);
|
|
367 memset(player_levels.data(), 0, 16);
|
|
368 pRenderer->ClearZBuffer(0, 479);
|
|
369
|
|
370 if (((uCloseTime - 1 <= uOpenTime)&&((pParty->uCurrentHour <uOpenTime)&&(pParty->uCurrentHour >(uCloseTime - 1))))||
|
|
371 ((uCloseTime - 1 > uOpenTime)&&((pParty->uCurrentHour < uOpenTime)||(pParty->uCurrentHour > (uCloseTime - 1)))))
|
|
372
|
|
373 {
|
|
374 am_pm_flag_open = 0;
|
|
375 am_pm_flag_close = 0;
|
|
376 if (uOpenTime > 12 )
|
|
377 {
|
|
378 uOpenTime -= 12;
|
|
379 am_pm_flag_open = 1;
|
|
380 }
|
|
381 if ( uCloseTime > 12 )
|
|
382 {
|
|
383 uCloseTime -= 12;
|
|
384 am_pm_flag_close = 1;
|
|
385 }
|
|
386 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[414], uOpenTime, aAMPMNames[am_pm_flag_open],
|
|
387 uCloseTime, aAMPMNames[am_pm_flag_close]); //"This place is open from %d%s to %d%s"
|
|
388 ShowStatusBarString(pTmpBuf.data(), 2u);
|
|
389 if ( uActiveCharacter )
|
|
390 pPlayers[uActiveCharacter]->PlaySound(SPEECH_3, 0);
|
|
391 return 0;
|
|
392 }
|
|
393 else
|
|
394 {
|
|
395 //v10 = uHouseID;
|
|
396 if ( (signed int)uHouseID < 53 ) //entering shops and guilds
|
|
397 {
|
|
398 if ( !(pParty->field_3C._shop_ban_times[uHouseID])
|
|
399 || (pParty->field_3C._shop_ban_times[uHouseID] <= pParty->uTimePlayed) )
|
|
400 {
|
|
401 pParty->field_3C._shop_ban_times[uHouseID] = 0;
|
|
402 }
|
|
403 else
|
|
404 {
|
|
405 ShowStatusBarString(pGlobalTXT_LocalizationStrings[191], 2u);// "You've been banned from this shop!"
|
|
406 return 0;
|
|
407 }
|
|
408 }
|
|
409 pAudioPlayer->StopChannels(-1, -1);
|
|
410
|
|
411 uCurrentHouse_Animation = p2DEvents[uHouseID - 1].uAnimationID;
|
|
412 in_current_building_type = pAnimatedRooms[uCurrentHouse_Animation].uBuildingType;
|
|
413 if ( in_current_building_type == BildingType_Throne_Room && pParty->uFine ) // going 2 jail
|
|
414 {
|
|
415 uCurrentHouse_Animation = (signed __int16)p2DEvents[186].uAnimationID;
|
|
416 uHouseID = HOUSE_JAIL;
|
|
417 pParty->uTimePlayed = pParty->uTimePlayed + 0x7620000;
|
|
418 in_current_building_type = pAnimatedRooms[p2DEvents[HOUSE_LORD_AND_JUDGE_EMERALD_ISLE].uAnimationID].uBuildingType;
|
|
419 ++pParty->uNumPrisonTerms;
|
|
420 pParty->uFine = 0;
|
|
421 for (uint i = 0; i < 4; ++i)
|
|
422 {
|
|
423 pParty->pPlayers[i].uTimeToRecovery = 0;
|
|
424 pParty->pPlayers[i].uNumDivineInterventionCastsThisDay = 0;
|
|
425 pParty->pPlayers[i].SetVariable(VAR_Award, 87);
|
|
426 }
|
|
427 }
|
|
428 ++pIcons_LOD->uTexturePacksCount;
|
|
429 if ( !pIcons_LOD->uNumPrevLoadedFiles )
|
|
430 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
|
|
431 switch (pParty->alignment)
|
|
432 {
|
|
433 case PartyAlignment_Good: sprintf(pContainer, "evt%02d-b", const_2()); break;
|
|
434 case PartyAlignment_Neutral: sprintf(pContainer, "evt%02d", const_2()); break;
|
|
435 case PartyAlignment_Evil: sprintf(pContainer, "evt%02d-c", const_2()); break;
|
|
436 default: assert(false);
|
|
437 }
|
|
438
|
|
439 v17 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
|
|
440 pDialogueNPCCount = 0;
|
|
441 pTexture_Dialogue_Background = &pIcons_LOD->pTextures[v17];
|
|
442 uTextureID_right_panel_loop = uTextureID_right_panel;
|
|
443 PrepareHouse(uHouseID);
|
|
444 v18 = 1;
|
|
445 uTextureID_right_panel_loop = uTextureID_right_panel;
|
|
446 if ( uNumDialogueNPCPortraits == 1 )
|
|
447 pDialogueNPCCount = 1;
|
|
448 pVideoPlayer->OpenHouseMovie(pAnimatedRooms[uCurrentHouse_Animation].video_name, 1u);
|
|
449 dword_5C35D4 = 1;
|
|
450 if ( (signed int)uHouseID < 139 || (signed int)uHouseID > 172 )
|
|
451 {
|
|
452 if ( (signed int)uHouseID >= HOUSE_STABLES_HARMONDALE && (signed int)uHouseID <= 73 && !IsTravelAvailable(uHouseID - HOUSE_STABLES_HARMONDALE) )
|
|
453 {
|
|
454 return 1;
|
|
455 }
|
|
456 }
|
|
457 else
|
|
458 { //guilds
|
|
459 v19 = guild_mambership_flags[uHouseID - HOUSE_FIRE_GUILD_INITIATE_EMERALD_ISLE]; //guilds flags
|
|
460 //v20 = uHouseID;
|
|
461 //if ( !((unsigned __int8)(0x80u >> v19 % 8) & pPlayers[uActiveCharacter]->_guilds_member_bits[v19 /8]) )
|
|
462 if(_449B57_test_bit(pPlayers[uActiveCharacter]->_guilds_member_bits,v19))
|
|
463 {
|
|
464 PlayHouseSound(uHouseID, HouseSound_Greeting_2);
|
|
465 return 1;
|
|
466 }
|
|
467 }
|
|
468 PlayHouseSound(uHouseID, HouseSound_Greeting);
|
|
469 dword_5C35D4 = 1;
|
|
470 return 1;
|
|
471 }
|
|
472 }
|
|
473
|
1300
|
474 //----- (0044606A) --------------------------------------------------------
|
|
475 void PrepareHouse(HOUSE_ID house)
|
|
476 {
|
|
477 //unsigned int v1; // ebx@1
|
|
478 //signed int v2; // esi@1
|
|
479 //int uExitPic; // edi@1
|
|
480 __int16 uExitMapID; // ax@2
|
|
481 //int result; // eax@5
|
|
482 //unsigned int *v6; // ecx@8
|
|
483 int v7; // ebx@11
|
|
484 //int v8; // esi@16
|
|
485 //unsigned int v9; // eax@16
|
|
486 //unsigned int v10; // eax@19
|
|
487 //int v11; // ecx@19
|
|
488 //char pContainer[36]; // [sp+Ch] [bp-54h]@16
|
|
489 int v13; // [sp+30h] [bp-30h]@11
|
|
490 int npc_id_arr[6]; // [sp+34h] [bp-2Ch]@1
|
|
491 //unsigned int v15; // [sp+4Ch] [bp-14h]@1
|
|
492 int uAnimationID; // [sp+50h] [bp-10h]@1
|
|
493 //unsigned int *v17; // [sp+54h] [bp-Ch]@3
|
|
494 //unsigned int v18; // [sp+58h] [bp-8h]@1
|
|
495 //int v19; // [sp+5Ch] [bp-4h]@7
|
|
496
|
|
497
|
|
498 uAnimationID = p2DEvents[house - 1].uAnimationID;
|
|
499 memset(npc_id_arr, 0, sizeof(npc_id_arr));
|
|
500 uNumDialogueNPCPortraits = 0;
|
|
501 uHouse_ExitPic = p2DEvents[house - 1].uExitPicID;
|
|
502 if ( uHouse_ExitPic )
|
|
503 {
|
|
504 uExitMapID = p2DEvents[house - 1]._quest_related;
|
|
505 if ( uExitMapID > 0 )
|
|
506 {
|
|
507 if(_449B57_test_bit(pParty->_quest_bits,uExitMapID))
|
|
508 {
|
|
509 uHouse_ExitPic = 0;
|
|
510 }
|
|
511 }
|
|
512 }
|
|
513
|
|
514 dword_591080 = pAnimatedRooms[uAnimationID].house_npc_id;
|
|
515 HouseNPCData[0]=0;
|
|
516 uNumDialogueNPCPortraits = 0;
|
|
517 if ( dword_591080 )
|
|
518 {
|
|
519
|
|
520 npc_id_arr[0] = dword_591080;
|
|
521 uNumDialogueNPCPortraits = 1;
|
|
522 }
|
|
523
|
|
524 for (uint i = 1; i < pNPCStats->uNumNewNPCs; ++i)
|
|
525 {
|
|
526 if (pNPCStats->pNewNPCData[i].Location2D == house )
|
|
527 {
|
|
528 if (!(pNPCStats->pNewNPCData[i].uFlags & 0x80))
|
|
529 {
|
1313
|
530 HouseNPCData[uNumDialogueNPCPortraits+1-((dword_591080 != 0) ? 1 : 0) ] = &pNPCStats->pNewNPCData[i];
|
1300
|
531 npc_id_arr[uNumDialogueNPCPortraits] = pNPCStats->pNewNPCData[i].uPortraitID;
|
|
532 ++uNumDialogueNPCPortraits;
|
|
533 if ((pNPCStats->pNewNPCData[i].uFlags & 3) != 2)
|
|
534 ++pNPCStats->pNewNPCData[i].uFlags;
|
|
535 }
|
|
536 }
|
|
537
|
|
538 }
|
|
539
|
|
540 for (uint i = 0; i < uNumDialogueNPCPortraits; ++i)
|
|
541 {
|
|
542
|
|
543 char icon_name[128];
|
|
544 sprintfex(icon_name, "npc%03u", npc_id_arr[i]);
|
|
545 pDialogueNPCPortraits[i] = pIcons_LOD->LoadTexturePtr(icon_name, TEXTURE_16BIT_PALETTE);
|
|
546 }
|
|
547
|
|
548 if (uHouse_ExitPic)
|
|
549 {
|
|
550 pDialogueNPCPortraits[uNumDialogueNPCPortraits] = pIcons_LOD->LoadTexturePtr(pHouse_ExitPictures[uHouse_ExitPic], TEXTURE_16BIT_PALETTE);
|
|
551 ++uNumDialogueNPCPortraits;
|
|
552 uHouse_ExitPic = p2DEvents[house - 1].uExitMapID;
|
|
553 }
|
|
554 }
|
1298
|
555 //----- (004B1E92) --------------------------------------------------------
|
|
556 void PlayHouseSound(unsigned int uHouseID, HouseSoundID sound)
|
|
557 {
|
|
558 //if ( BYTE1(pAnimatedRooms[p2DEvents_minus1___02[26 * uHouseID]].field_C) )
|
|
559 if ( pAnimatedRooms[p2DEvents[uHouseID].uAnimationID].uRoomSoundId )
|
|
560 pAudioPlayer->PlaySound(
|
|
561 //(SoundID)(a2 + 100 * (BYTE1(pAnimatedRooms[p2DEvents_minus1___02[26 * uHouseID]].field_C) + 300)),
|
|
562 (SoundID)(sound + 100 * (pAnimatedRooms[p2DEvents[uHouseID].uAnimationID].uRoomSoundId + 300)),
|
|
563 806, 0, -1, 0, 0, 0, 0);
|
|
564 }
|
|
565
|
|
566 //----- (004BCACC) --------------------------------------------------------
|
|
567 void __fastcall OnSelectShopDialogueOption(signed int uMessageParam)
|
|
568 {
|
|
569 //unsigned int v1; // edi@1
|
|
570 //signed int v2; // ebx@1
|
|
571 //signed int v3; // ecx@2
|
|
572 int v4; // eax@5
|
|
573 signed int v5; // esi@5
|
|
574 //Player *v6; // ecx@5
|
|
575 //signed int v7; // edx@5
|
|
576 GUIWindow *v8; // esi@10
|
|
577 unsigned int v9; // eax@12
|
|
578 int v10; // esi@31
|
|
579 int v11; // edi@31
|
|
580 int v12; // esi@32
|
|
581 __int16 v13; // bp@32
|
|
582 int v14; // edx@32
|
|
583 GUIWindow *v15; // eax@32
|
|
584 int v16; // eax@32
|
|
585 int v17; // eax@33
|
|
586 int v18; // eax@34
|
|
587 int v19; // eax@35
|
|
588 __int16 v20; // ax@37
|
|
589 __int16 v21; // ax@76
|
|
590 __int16 v22; // ax@107
|
|
591 __int16 v23; // ax@132
|
|
592 __int16 v24; // ax@163
|
|
593 int v25; // esi@190
|
|
594 __int16 v26; // ax@190
|
|
595 char v27; // zf@190
|
|
596 Player *v28; // edi@192
|
|
597 int v29; // eax@204
|
|
598 void *v30; // esi@208
|
|
599 unsigned __int64 v31; // qax@208
|
|
600 signed int v32; // edi@209
|
|
601 int v33; // eax@210
|
|
602 unsigned int v34; // eax@211
|
|
603 //Player *v35; // edi@227
|
|
604 signed int v36; // esi@227
|
|
605 int v37; // ecx@227
|
|
606 int v38; // esi@230
|
|
607 int v39; // edx@235
|
|
608 int v40; // edi@243
|
|
609 unsigned __int64 v41; // qax@243
|
|
610 //void *v42; // eax@244
|
|
611 signed int v43; // edi@244
|
|
612 int v44; // edx@244
|
|
613 int v45; // eax@246
|
|
614 unsigned int v46; // eax@247
|
|
615 void *v47; // eax@250
|
|
616 signed int v48; // edi@250
|
|
617 int v49; // eax@252
|
|
618 int v50; // eax@256
|
|
619 unsigned int v51; // eax@257
|
|
620 void *v52; // eax@260
|
|
621 signed int v53; // edi@260
|
|
622 int v54; // eax@262
|
|
623 //signed int v55; // [sp+10h] [bp-10h]@1
|
|
624 int v56; // [sp+14h] [bp-Ch]@31
|
|
625
|
|
626 //v1 = 0;
|
|
627 //v2 = a1;
|
|
628 //v55 = a1;
|
|
629 if ( !pDialogueWindow->pNumPresenceButton )
|
|
630 return;
|
|
631 pRenderer->ClearZBuffer(0, 479);
|
|
632 //v3 = dword_F8B198;
|
|
633 if ( dialog_menu_id != HOUSE_DIALOGUE_MAIN)
|
|
634 v8 = window_SpeakInHouse;
|
|
635 //else
|
|
636 if (dialog_menu_id == HOUSE_DIALOGUE_MAIN)
|
|
637 {
|
|
638 if ( in_current_building_type == BildingType_Training )
|
|
639 {
|
|
640 if ( uMessageParam == HOUSE_DIALOGUE_TRAININGHALL_TRAIN )
|
|
641 {
|
|
642 v4 = 0;
|
|
643 v5 = 0;
|
|
644 //v6 = pPlayers[uActiveCharacter];
|
|
645 //v7 = pPlayers[uActiveCharacter]->uLevel;
|
|
646 if ( pPlayers[uActiveCharacter]->uLevel > 0 )
|
|
647 {
|
|
648 do
|
|
649 v4 += v5++ + 1;
|
|
650 while ( v5 < pPlayers[uActiveCharacter]->uLevel );
|
|
651 }
|
|
652 if (pPlayers[uActiveCharacter]->uLevel < pMaxLevelPerTrainingHallType[(unsigned int)window_SpeakInHouse->ptr_1C - 89] &&
|
|
653 (signed __int64)pPlayers[uActiveCharacter]->uExperience < 1000 * v4)
|
|
654 return;
|
|
655 }
|
|
656 pDialogueWindow->Release();
|
|
657 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x159u, WINDOW_MainMenu, 0, 0);
|
|
658 pBtn_ExitCancel = pDialogueWindow->CreateButton(526, 445, 75, 33, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[74],// "End Conversation"
|
|
659 pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0);
|
|
660 pDialogueWindow->CreateButton(8, 8, 0x1C2, 0x140, 1, 0, UIMSG_BuyInShop_Identify_Repair, 0, 0, "", nullptr);
|
|
661 // LABEL_10:
|
|
662 //v3 = dword_F8B198;
|
|
663 v8 = window_SpeakInHouse;
|
|
664 }
|
|
665 //else
|
|
666 if ( in_current_building_type != BildingType_Training )
|
|
667 {
|
|
668 v8 = window_SpeakInHouse;
|
|
669 if ((in_current_building_type == BildingType_Stables || in_current_building_type == BildingType_Boats) &&
|
|
670 transport_schedule[transport_routes[(unsigned int)window_SpeakInHouse->ptr_1C - HOUSE_STABLES_HARMONDALE][uMessageParam - HOUSE_DIALOGUE_TRANSPORT_SCHEDULE_1]].pSchedule[pParty->uDaysPlayed % 7]
|
|
671 || in_current_building_type != BildingType_Temple || uMessageParam != BildingType_MindGuild )
|
|
672 {
|
|
673 //LABEL_9:
|
|
674 pDialogueWindow->Release();
|
|
675 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x159u, WINDOW_MainMenu, 0, 0);
|
|
676 pBtn_ExitCancel = pDialogueWindow->CreateButton(526, 445, 75, 33, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[74],// "End Conversation"
|
|
677 pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0);
|
|
678 pDialogueWindow->CreateButton(8u, 8u, 0x1C2u, 0x140u, 1, 0, UIMSG_BuyInShop_Identify_Repair, 0, 0, "", nullptr);
|
|
679 // LABEL_10:
|
|
680 //v3 = dword_F8B198;
|
|
681 v8 = window_SpeakInHouse;
|
|
682 }
|
|
683 else if (uActiveCharacter)
|
|
684 {
|
|
685 if ( !pPlayers[uActiveCharacter]->IsPlayerHealableByTemple() )
|
|
686 return;
|
|
687 v8 = window_SpeakInHouse;
|
|
688 }
|
|
689 }
|
|
690 //LABEL_11:
|
|
691 dialog_menu_id = (HOUSE_DIALOGUE_MENU)uMessageParam;
|
|
692 if ( in_current_building_type < BildingType_19 )
|
|
693 {
|
|
694 v9 = pIcons_LOD->LoadTexture(off_4F03B8[in_current_building_type], TEXTURE_16BIT_PALETTE);
|
|
695 //v3 = dword_F8B198;
|
|
696 ShopTexture = &pIcons_LOD->pTextures[v9];
|
|
697 //LABEL_13:
|
|
698 v8 = window_SpeakInHouse;
|
|
699 }
|
|
700 }
|
|
701
|
|
702 //NEW
|
|
703 switch(in_current_building_type)
|
|
704 {
|
|
705 case BildingType_FireGuild:
|
|
706 case BildingType_AirGuild:
|
|
707 case BildingType_WaterGuild:
|
|
708 case BildingType_EarthGuild:
|
|
709 case BildingType_SpiritGuild:
|
|
710 case BildingType_MindGuild:
|
|
711 case BildingType_BodyGuild:
|
|
712 case BildingType_LightGuild:
|
|
713 case BildingType_DarkGuild:
|
|
714 case BildingType_14:
|
|
715 case BildingType_15:
|
|
716 case BildingType_16:
|
|
717 {
|
|
718 if ( *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)v8->ptr_1C + 44472] >= (signed __int64)pParty->uTimePlayed &&
|
|
719 *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)v8->ptr_1C + 44468] >= (signed __int64)pParty->uTimePlayed )
|
|
720 {
|
|
721 v32 = 0;
|
|
722 do
|
|
723 {
|
|
724 //v33 = *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v32 + 12 * (unsigned int)v8->ptr_1C));
|
|
725 v33 = pParty->SpellBooksInGuilds[v8->par1C-139][v32].uItemID;
|
|
726 if ( v33 )
|
|
727 {
|
|
728 v34 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v33].pIconName, TEXTURE_16BIT_PALETTE);
|
|
729 v8 = window_SpeakInHouse;
|
|
730 ItemsInShopTexture[v32] = &pIcons_LOD->pTextures[v34];
|
|
731 }
|
|
732 ++v32;
|
|
733 }
|
|
734 while ( v32 < 12 );
|
|
735 }
|
|
736 else
|
|
737 {
|
|
738 SpellBookGenerator();
|
|
739 v30 = window_SpeakInHouse->ptr_1C;
|
|
740 v31 = pParty->uTimePlayed + (signed __int64)((double)(0xA8C000
|
|
741 //* (signed int)p2DEvents_minus1[26 * (unsigned int)ptr_507BC0->ptr_1C])
|
|
742 * (signed int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].field_1C) * 0.033333335);
|
|
743 *(int *)&stru_AA1058[3].pSounds[8 * (int)v30 + 44468] = v31;
|
|
744 *(int *)&stru_AA1058[3].pSounds[8 * (int)v30 + 44472] = HIDWORD(v31);
|
|
745 }
|
|
746 //return;
|
|
747 break;
|
|
748 }
|
|
749 case BildingType_TownHall:
|
|
750 {
|
|
751 if ( uMessageParam == 99 )
|
|
752 {
|
|
753 v10 = (int)((char *)v8->ptr_1C - 102);
|
|
754 v56 = v10;
|
|
755 v11 = 8 * v10 + 11325428;
|
|
756 if ( pParty->field_3C.field_0[2 * v10 + 1] >= (signed __int64)pParty->uTimePlayed
|
|
757 && pParty->field_3C.field_0[2 * v10] >= (signed __int64)pParty->uTimePlayed )
|
|
758 {
|
|
759 v13 = 0;
|
|
760 }
|
|
761 else
|
|
762 {
|
|
763 v12 = v10;
|
|
764 v13 = 0;
|
|
765 pParty->field_75A[v12] = 0;
|
|
766 *(_QWORD *)v11 = (signed __int64)((double)(309657600 * (pParty->uCurrentMonth + 12i64 * pParty->uCurrentYear - 14015)) * 0.033333335);
|
|
767 v14 = rand() % 258;
|
|
768 v15 = window_SpeakInHouse;
|
|
769 pParty->field_750[v12] = v14 + 1;
|
|
770 v16 = (int)((char *)v15->ptr_1C - 102);
|
|
771 if ( v16 )
|
|
772 {
|
|
773 v17 = v16 - 1;
|
|
774 if ( v17 )
|
|
775 {
|
|
776 v18 = v17 - 1;
|
|
777 if ( v18 )
|
|
778 {
|
|
779 v19 = v18 - 1;
|
|
780 if ( v19 )
|
|
781 {
|
|
782 if ( v19 == 1 )
|
|
783 {
|
|
784 while ( 1 )
|
|
785 {
|
|
786 v20 = pParty->field_750[v12];
|
|
787 if ( (unsigned __int16)v20 < 0x73u || (unsigned __int16)v20 > 0x84u )
|
|
788 {
|
|
789 if ( ((unsigned __int16)v20 < 0xE8u || (unsigned __int16)v20 > 0xF9u)
|
|
790 && ((unsigned __int16)v20 < 0x85u || (unsigned __int16)v20 > 0x96u)
|
|
791 && ((unsigned __int16)v20 < 0x97u || (unsigned __int16)v20 > 0xBAu)
|
|
792 && ((unsigned __int16)v20 < 0xBEu || (unsigned __int16)v20 > 0xC0u)
|
|
793 && ((unsigned __int16)v20 < 0xC4u || (unsigned __int16)v20 > 0xC6u)
|
|
794 && ((unsigned __int16)v20 < 0x2Bu || (unsigned __int16)v20 > 0x2Du)
|
|
795 && ((unsigned __int16)v20 < 0x6Du || (unsigned __int16)v20 > 0x6Fu)
|
|
796 && ((unsigned __int16)v20 < 0x46u || (unsigned __int16)v20 > 0x48u)
|
|
797 && ((unsigned __int16)v20 < 0x100u || (unsigned __int16)v20 > 0x102u)
|
|
798 && ((unsigned __int16)v20 < 0xD9u || (unsigned __int16)v20 > 0xDBu)
|
|
799 && ((unsigned __int16)v20 < 0xC7u || (unsigned __int16)v20 > 0xC9u)
|
|
800 && ((unsigned __int16)v20 < 0xE5u || (unsigned __int16)v20 > 0xE7u)
|
|
801 && ((unsigned __int16)v20 < 0xDFu || (unsigned __int16)v20 > 0xE1u)
|
|
802 && ((unsigned __int16)v20 < 0x5Bu || (unsigned __int16)v20 > 0x5Du)
|
|
803 && ((unsigned __int16)v20 < 0x49u || (unsigned __int16)v20 > 0x4Bu)
|
|
804 && ((unsigned __int16)v20 < 0xFDu || (unsigned __int16)v20 > 0xFFu)
|
|
805 && ((unsigned __int16)v20 < 0x61u || (unsigned __int16)v20 > 0x63u)
|
|
806 && ((unsigned __int16)v20 < 0x10u || (unsigned __int16)v20 > 0x12u) )
|
|
807 break;
|
|
808 }
|
|
809 pParty->field_750[v12] = rand() % 258 + 1;
|
|
810 }
|
|
811 }
|
|
812 }
|
|
813 else
|
|
814 {
|
|
815 while ( 1 )
|
|
816 {
|
|
817 v21 = pParty->field_750[v12];
|
|
818 if ( (unsigned __int16)v21 < 0x73u || (unsigned __int16)v21 > 0x84u )
|
|
819 {
|
|
820 if ( ((unsigned __int16)v21 < 0xE8u || (unsigned __int16)v21 > 0xF9u)
|
|
821 && ((unsigned __int16)v21 < 0x85u || (unsigned __int16)v21 > 0x96u)
|
|
822 && ((unsigned __int16)v21 < 0x97u || (unsigned __int16)v21 > 0xBAu)
|
|
823 && ((unsigned __int16)v21 < 0xBEu || (unsigned __int16)v21 > 0xC0u)
|
|
824 && ((unsigned __int16)v21 < 0xC4u || (unsigned __int16)v21 > 0xC6u)
|
|
825 && ((unsigned __int16)v21 < 0x2Bu || (unsigned __int16)v21 > 0x2Du)
|
|
826 && ((unsigned __int16)v21 < 0x5Eu || (unsigned __int16)v21 > 0x60u)
|
|
827 && ((unsigned __int16)v21 < 0x43u || (unsigned __int16)v21 > 0x45u)
|
|
828 && ((unsigned __int16)v21 < 0x4Fu || (unsigned __int16)v21 > 0x51u)
|
|
829 && ((unsigned __int16)v21 < 0xC1u || (unsigned __int16)v21 > 0xC3u)
|
|
830 && ((unsigned __int16)v21 < 0x13u || (unsigned __int16)v21 > 0x15u)
|
|
831 && ((unsigned __int16)v21 < 0xFDu || (unsigned __int16)v21 > 0xFFu)
|
|
832 && ((unsigned __int16)v21 < 0x61u || (unsigned __int16)v21 > 0x63u)
|
|
833 && ((unsigned __int16)v21 < 0x6Au || (unsigned __int16)v21 > 0x6Cu) )
|
|
834 break;
|
|
835 }
|
|
836 pParty->field_750[v12] = rand() % 258 + 1;
|
|
837 }
|
|
838 }
|
|
839 }
|
|
840 else
|
|
841 {
|
|
842 while ( 1 )
|
|
843 {
|
|
844 v22 = pParty->field_750[v12];
|
|
845 if ( (unsigned __int16)v22 < 0x73u || (unsigned __int16)v22 > 0x84u )
|
|
846 {
|
|
847 if ( ((unsigned __int16)v22 < 0xE8u || (unsigned __int16)v22 > 0xF9u)
|
|
848 && ((unsigned __int16)v22 < 0x85u || (unsigned __int16)v22 > 0x96u)
|
|
849 && ((unsigned __int16)v22 < 0x97u || (unsigned __int16)v22 > 0xBAu)
|
|
850 && ((unsigned __int16)v22 < 0xBEu || (unsigned __int16)v22 > 0xC0u)
|
|
851 && ((unsigned __int16)v22 < 0xC4u || (unsigned __int16)v22 > 0xC6u)
|
|
852 && ((unsigned __int16)v22 < 0x2Bu || (unsigned __int16)v22 > 0x2Du)
|
|
853 && ((unsigned __int16)v22 < 0x31u || (unsigned __int16)v22 > 0x33u)
|
|
854 && ((unsigned __int16)v22 < 0x34u || (unsigned __int16)v22 > 0x36u)
|
|
855 && ((unsigned __int16)v22 < 0xFDu || (unsigned __int16)v22 > 0xFFu)
|
|
856 && ((unsigned __int16)v22 < 0x61u || (unsigned __int16)v22 > 0x63u)
|
|
857 && ((unsigned __int16)v22 < 0x1Cu || (unsigned __int16)v22 > 0x1Eu) )
|
|
858 break;
|
|
859 }
|
|
860 pParty->field_750[v12] = rand() % 258 + 1;
|
|
861 }
|
|
862 }
|
|
863 }
|
|
864 else
|
|
865 {
|
|
866 while ( 1 )
|
|
867 {
|
|
868 v23 = pParty->field_750[v12];
|
|
869 if ( (unsigned __int16)v23 < 0x73u || (unsigned __int16)v23 > 0x84u )
|
|
870 {
|
|
871 if ( ((unsigned __int16)v23 < 0xE8u || (unsigned __int16)v23 > 0xF9u)
|
|
872 && ((unsigned __int16)v23 < 0x85u || (unsigned __int16)v23 > 0x96u)
|
|
873 && ((unsigned __int16)v23 < 0x97u || (unsigned __int16)v23 > 0xBAu)
|
|
874 && ((unsigned __int16)v23 < 0xBEu || (unsigned __int16)v23 > 0xC0u)
|
|
875 && ((unsigned __int16)v23 < 0xC4u || (unsigned __int16)v23 > 0xC6u)
|
|
876 && ((unsigned __int16)v23 < 0x2Bu || (unsigned __int16)v23 > 0x2Du)
|
|
877 && ((unsigned __int16)v23 < 0x52u || (unsigned __int16)v23 > 0x54u)
|
|
878 && ((unsigned __int16)v23 < 4u || (unsigned __int16)v23 > 6u)
|
|
879 && ((unsigned __int16)v23 < 0x37u || (unsigned __int16)v23 > 0x39u)
|
|
880 && ((unsigned __int16)v23 < 0x3Au || (unsigned __int16)v23 > 0x3Cu)
|
|
881 && ((unsigned __int16)v23 < 0x3Du || (unsigned __int16)v23 > 0x3Fu)
|
|
882 && ((unsigned __int16)v23 < 0xFDu || (unsigned __int16)v23 > 0xFFu)
|
|
883 && ((unsigned __int16)v23 < 0x61u || (unsigned __int16)v23 > 0x63u)
|
|
884 && ((unsigned __int16)v23 < 0xCDu || (unsigned __int16)v23 > 0xCFu) )
|
|
885 break;
|
|
886 }
|
|
887 pParty->field_750[v12] = rand() % 258 + 1;
|
|
888 }
|
|
889 }
|
|
890 }
|
|
891 else
|
|
892 {
|
|
893 while ( 1 )
|
|
894 {
|
|
895 v24 = pParty->field_750[v12];
|
|
896 if ( (unsigned __int16)v24 < 0x73u || (unsigned __int16)v24 > 0x84u )
|
|
897 {
|
|
898 if ( ((unsigned __int16)v24 < 0xEBu || (unsigned __int16)v24 > 0xFCu)
|
|
899 && ((unsigned __int16)v24 < 0x85u || (unsigned __int16)v24 > 0x96u)
|
|
900 && ((unsigned __int16)v24 < 0x97u || (unsigned __int16)v24 > 0xBAu)
|
|
901 && ((unsigned __int16)v24 < 0xBEu || (unsigned __int16)v24 > 0xC0u)
|
|
902 && ((unsigned __int16)v24 < 0xC4u || (unsigned __int16)v24 > 0xC6u)
|
|
903 && ((unsigned __int16)v24 < 0x2Bu || (unsigned __int16)v24 > 0x2Du)
|
|
904 && ((unsigned __int16)v24 < 0xCDu || (unsigned __int16)v24 > 0xCFu)
|
|
905 && ((unsigned __int16)v24 < 0x5Eu || (unsigned __int16)v24 > 0x60u)
|
|
906 && ((unsigned __int16)v24 < 0xFDu || (unsigned __int16)v24 > 0xFFu)
|
|
907 && ((unsigned __int16)v24 < 0x6Du || (unsigned __int16)v24 > 0x6Fu)
|
|
908 && ((unsigned __int16)v24 < 0x61u || (unsigned __int16)v24 > 0x63u) )
|
|
909 break;
|
|
910 }
|
|
911 pParty->field_750[v12] = rand() % 258 + 1;
|
|
912 }
|
|
913 }
|
|
914 v10 = v56;
|
|
915 }
|
|
916 v25 = v10;
|
|
917 v26 = pParty->field_750[v25];
|
|
918 v27 = pParty->field_75A[v25] == v13;
|
|
919 word_F8B1A0 = pParty->field_750[v25];
|
|
920 if ( v27 )
|
|
921 {
|
|
922 //v1 = 0;
|
|
923 v27 = v26 == v13;
|
|
924 v29 = (int)pNPCTopics[351].pText;
|
|
925 if ( v27 )
|
|
926 v29 = (int)pNPCTopics[353].pText;
|
|
927 dword_F8B1A4 = (char *)v29;
|
|
928 }
|
|
929 else
|
|
930 {
|
|
931 if ( v26 != v13 )
|
|
932 {
|
|
933 party_finds_gold(100 * pMonsterStats->pInfos[(unsigned __int16)v26].uLevel, 0);
|
|
934 v28 = pParty->pPlayers;
|
|
935 do
|
|
936 {
|
|
937 v28->SetVariable(VAR_Award, 86);
|
|
938 ++v28;
|
|
939 }
|
|
940 while ( (signed int)v28 < (signed int)pParty->pHirelings );
|
|
941 pParty->uNumBountiesCollected += 100 * pMonsterStats->pInfos[pParty->field_750[v25]].uLevel;
|
|
942 pParty->field_750[v25] = v13;
|
|
943 pParty->field_75A[v25] = v13;
|
|
944 }
|
|
945 //v1 = 0;
|
|
946 dword_F8B1A4 = pNPCTopics[352].pText;
|
|
947 }
|
|
948 }
|
|
949 else if ( uMessageParam == HOUSE_DIALOGUE_TOWNHALL_100 )
|
|
950 {
|
|
951 pKeyActionMap->EnterText(1, 10, v8);
|
|
952 }
|
|
953 break;
|
|
954 }
|
|
955 case BildingType_Bank:
|
|
956 {
|
|
957 if ( dialog_menu_id >= 7 && dialog_menu_id <= 8 )
|
|
958 pKeyActionMap->EnterText(1, 10, v8);
|
|
959 return;
|
|
960 break;
|
|
961 }
|
|
962 case BildingType_WeaponShop:
|
|
963 case BildingType_ArmorShop:
|
|
964 case BildingType_MagicShop:
|
|
965 case BildingType_AlchemistShop:
|
|
966 case BildingType_Tavern:
|
|
967 case BildingType_Temple:
|
|
968 case BildingType_Training:
|
|
969 {
|
|
970 break;
|
|
971 }
|
|
972 default:
|
|
973 {
|
|
974 return;
|
|
975 break;
|
|
976 }
|
|
977 }
|
|
978
|
|
979 /*
|
|
980 if ( in_current_building_type > BildingType_Tavern )
|
|
981 {
|
|
982 if ( in_current_building_type == BildingType_Bank )
|
|
983 {
|
|
984 if ( dialog_menu_id >= 7 && dialog_menu_id <= 8 )
|
|
985 pKeyActionMap->EnterText(1, 10, v8);
|
|
986 return;
|
|
987 }
|
|
988 if ( in_current_building_type != BildingType_Temple && in_current_building_type != BildingType_Training )
|
|
989 return;
|
|
990 }
|
|
991 //else
|
|
992 if ( in_current_building_type < BildingType_Tavern )
|
|
993 {
|
|
994 if (in_current_building_type <= 0)
|
|
995 return;
|
|
996 if ( in_current_building_type > BildingType_AlchemistShop )
|
|
997 {
|
|
998 if ( in_current_building_type <= BildingType_16 )
|
|
999 {
|
|
1000 if ( (signed __int64)__PAIR__(
|
|
1001 *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)v8->ptr_1C + 44472],
|
|
1002 *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)v8->ptr_1C + 44468]) >= (signed __int64)pParty->uTimePlayed )
|
|
1003 {
|
|
1004 v32 = 0;
|
|
1005 do
|
|
1006 {
|
|
1007 //v33 = *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v32 + 12 * (unsigned int)v8->ptr_1C));
|
|
1008 v33 = pParty->SpellBooksInGuilds[v8->par1C-139][v32].uItemID;
|
|
1009 if ( v33 )
|
|
1010 {
|
|
1011 v34 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v33].pIconName, TEXTURE_16BIT_PALETTE);
|
|
1012 v8 = window_SpeakInHouse;
|
|
1013 ItemsInShopTexture[v32] = &pIcons_LOD->pTextures[v34];
|
|
1014 }
|
|
1015 ++v32;
|
|
1016 }
|
|
1017 while ( v32 < 12 );
|
|
1018 }
|
|
1019 else
|
|
1020 {
|
|
1021 SpellBookGenerator();
|
|
1022 v30 = window_SpeakInHouse->ptr_1C;
|
|
1023 v31 = pParty->uTimePlayed
|
|
1024 + (signed __int64)((double)(0xA8C000
|
|
1025 //* (signed int)p2DEvents_minus1[26 * (unsigned int)ptr_507BC0->ptr_1C])
|
|
1026 * (signed int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].field_1C)
|
|
1027 * 0.033333335);
|
|
1028 *(int *)&stru_AA1058[3].pSounds[8 * (int)v30 + 44468] = v31;
|
|
1029 *(int *)&stru_AA1058[3].pSounds[8 * (int)v30 + 44472] = HIDWORD(v31);
|
|
1030 }
|
|
1031 return;
|
|
1032 }
|
|
1033 if ( in_current_building_type != BildingType_TownHall )
|
|
1034 return;
|
|
1035 if ( in_current_building_type == BildingType_TownHall )
|
|
1036 {
|
|
1037 if ( uMessageParam == 99 )
|
|
1038 {
|
|
1039 v10 = (int)((char *)v8->ptr_1C - 102);
|
|
1040 v56 = v10;
|
|
1041 v11 = 8 * v10 + 11325428;
|
|
1042 if ( (signed __int64)__PAIR__(pParty->field_3C.field_0[2 * v10 + 1], pParty->field_3C.field_0[2 * v10]) >= (signed __int64)pParty->uTimePlayed )
|
|
1043 {
|
|
1044 v13 = 0;
|
|
1045 }
|
|
1046 else
|
|
1047 {
|
|
1048 v12 = v10;
|
|
1049 v13 = 0;
|
|
1050 pParty->field_75A[v12] = 0;
|
|
1051 *(_QWORD *)v11 = (signed __int64)((double)(309657600 * (pParty->uCurrentMonth + 12i64 * pParty->uCurrentYear - 14015)) * 0.033333335);
|
|
1052 v14 = rand() % 258;
|
|
1053 v15 = window_SpeakInHouse;
|
|
1054 pParty->field_750[v12] = v14 + 1;
|
|
1055 v16 = (int)((char *)v15->ptr_1C - 102);
|
|
1056 if ( v16 )
|
|
1057 {
|
|
1058 v17 = v16 - 1;
|
|
1059 if ( v17 )
|
|
1060 {
|
|
1061 v18 = v17 - 1;
|
|
1062 if ( v18 )
|
|
1063 {
|
|
1064 v19 = v18 - 1;
|
|
1065 if ( v19 )
|
|
1066 {
|
|
1067 if ( v19 == 1 )
|
|
1068 {
|
|
1069 while ( 1 )
|
|
1070 {
|
|
1071 v20 = pParty->field_750[v12];
|
|
1072 if ( (unsigned __int16)v20 < 0x73u || (unsigned __int16)v20 > 0x84u )
|
|
1073 {
|
|
1074 if ( ((unsigned __int16)v20 < 0xE8u || (unsigned __int16)v20 > 0xF9u)
|
|
1075 && ((unsigned __int16)v20 < 0x85u || (unsigned __int16)v20 > 0x96u)
|
|
1076 && ((unsigned __int16)v20 < 0x97u || (unsigned __int16)v20 > 0xBAu)
|
|
1077 && ((unsigned __int16)v20 < 0xBEu || (unsigned __int16)v20 > 0xC0u)
|
|
1078 && ((unsigned __int16)v20 < 0xC4u || (unsigned __int16)v20 > 0xC6u)
|
|
1079 && ((unsigned __int16)v20 < 0x2Bu || (unsigned __int16)v20 > 0x2Du)
|
|
1080 && ((unsigned __int16)v20 < 0x6Du || (unsigned __int16)v20 > 0x6Fu)
|
|
1081 && ((unsigned __int16)v20 < 0x46u || (unsigned __int16)v20 > 0x48u)
|
|
1082 && ((unsigned __int16)v20 < 0x100u || (unsigned __int16)v20 > 0x102u)
|
|
1083 && ((unsigned __int16)v20 < 0xD9u || (unsigned __int16)v20 > 0xDBu)
|
|
1084 && ((unsigned __int16)v20 < 0xC7u || (unsigned __int16)v20 > 0xC9u)
|
|
1085 && ((unsigned __int16)v20 < 0xE5u || (unsigned __int16)v20 > 0xE7u)
|
|
1086 && ((unsigned __int16)v20 < 0xDFu || (unsigned __int16)v20 > 0xE1u)
|
|
1087 && ((unsigned __int16)v20 < 0x5Bu || (unsigned __int16)v20 > 0x5Du)
|
|
1088 && ((unsigned __int16)v20 < 0x49u || (unsigned __int16)v20 > 0x4Bu)
|
|
1089 && ((unsigned __int16)v20 < 0xFDu || (unsigned __int16)v20 > 0xFFu)
|
|
1090 && ((unsigned __int16)v20 < 0x61u || (unsigned __int16)v20 > 0x63u)
|
|
1091 && ((unsigned __int16)v20 < 0x10u || (unsigned __int16)v20 > 0x12u) )
|
|
1092 break;
|
|
1093 }
|
|
1094 pParty->field_750[v12] = rand() % 258 + 1;
|
|
1095 }
|
|
1096 }
|
|
1097 }
|
|
1098 else
|
|
1099 {
|
|
1100 while ( 1 )
|
|
1101 {
|
|
1102 v21 = pParty->field_750[v12];
|
|
1103 if ( (unsigned __int16)v21 < 0x73u || (unsigned __int16)v21 > 0x84u )
|
|
1104 {
|
|
1105 if ( ((unsigned __int16)v21 < 0xE8u || (unsigned __int16)v21 > 0xF9u)
|
|
1106 && ((unsigned __int16)v21 < 0x85u || (unsigned __int16)v21 > 0x96u)
|
|
1107 && ((unsigned __int16)v21 < 0x97u || (unsigned __int16)v21 > 0xBAu)
|
|
1108 && ((unsigned __int16)v21 < 0xBEu || (unsigned __int16)v21 > 0xC0u)
|
|
1109 && ((unsigned __int16)v21 < 0xC4u || (unsigned __int16)v21 > 0xC6u)
|
|
1110 && ((unsigned __int16)v21 < 0x2Bu || (unsigned __int16)v21 > 0x2Du)
|
|
1111 && ((unsigned __int16)v21 < 0x5Eu || (unsigned __int16)v21 > 0x60u)
|
|
1112 && ((unsigned __int16)v21 < 0x43u || (unsigned __int16)v21 > 0x45u)
|
|
1113 && ((unsigned __int16)v21 < 0x4Fu || (unsigned __int16)v21 > 0x51u)
|
|
1114 && ((unsigned __int16)v21 < 0xC1u || (unsigned __int16)v21 > 0xC3u)
|
|
1115 && ((unsigned __int16)v21 < 0x13u || (unsigned __int16)v21 > 0x15u)
|
|
1116 && ((unsigned __int16)v21 < 0xFDu || (unsigned __int16)v21 > 0xFFu)
|
|
1117 && ((unsigned __int16)v21 < 0x61u || (unsigned __int16)v21 > 0x63u)
|
|
1118 && ((unsigned __int16)v21 < 0x6Au || (unsigned __int16)v21 > 0x6Cu) )
|
|
1119 break;
|
|
1120 }
|
|
1121 pParty->field_750[v12] = rand() % 258 + 1;
|
|
1122 }
|
|
1123 }
|
|
1124 }
|
|
1125 else
|
|
1126 {
|
|
1127 while ( 1 )
|
|
1128 {
|
|
1129 v22 = pParty->field_750[v12];
|
|
1130 if ( (unsigned __int16)v22 < 0x73u || (unsigned __int16)v22 > 0x84u )
|
|
1131 {
|
|
1132 if ( ((unsigned __int16)v22 < 0xE8u || (unsigned __int16)v22 > 0xF9u)
|
|
1133 && ((unsigned __int16)v22 < 0x85u || (unsigned __int16)v22 > 0x96u)
|
|
1134 && ((unsigned __int16)v22 < 0x97u || (unsigned __int16)v22 > 0xBAu)
|
|
1135 && ((unsigned __int16)v22 < 0xBEu || (unsigned __int16)v22 > 0xC0u)
|
|
1136 && ((unsigned __int16)v22 < 0xC4u || (unsigned __int16)v22 > 0xC6u)
|
|
1137 && ((unsigned __int16)v22 < 0x2Bu || (unsigned __int16)v22 > 0x2Du)
|
|
1138 && ((unsigned __int16)v22 < 0x31u || (unsigned __int16)v22 > 0x33u)
|
|
1139 && ((unsigned __int16)v22 < 0x34u || (unsigned __int16)v22 > 0x36u)
|
|
1140 && ((unsigned __int16)v22 < 0xFDu || (unsigned __int16)v22 > 0xFFu)
|
|
1141 && ((unsigned __int16)v22 < 0x61u || (unsigned __int16)v22 > 0x63u)
|
|
1142 && ((unsigned __int16)v22 < 0x1Cu || (unsigned __int16)v22 > 0x1Eu) )
|
|
1143 break;
|
|
1144 }
|
|
1145 pParty->field_750[v12] = rand() % 258 + 1;
|
|
1146 }
|
|
1147 }
|
|
1148 }
|
|
1149 else
|
|
1150 {
|
|
1151 while ( 1 )
|
|
1152 {
|
|
1153 v23 = pParty->field_750[v12];
|
|
1154 if ( (unsigned __int16)v23 < 0x73u || (unsigned __int16)v23 > 0x84u )
|
|
1155 {
|
|
1156 if ( ((unsigned __int16)v23 < 0xE8u || (unsigned __int16)v23 > 0xF9u)
|
|
1157 && ((unsigned __int16)v23 < 0x85u || (unsigned __int16)v23 > 0x96u)
|
|
1158 && ((unsigned __int16)v23 < 0x97u || (unsigned __int16)v23 > 0xBAu)
|
|
1159 && ((unsigned __int16)v23 < 0xBEu || (unsigned __int16)v23 > 0xC0u)
|
|
1160 && ((unsigned __int16)v23 < 0xC4u || (unsigned __int16)v23 > 0xC6u)
|
|
1161 && ((unsigned __int16)v23 < 0x2Bu || (unsigned __int16)v23 > 0x2Du)
|
|
1162 && ((unsigned __int16)v23 < 0x52u || (unsigned __int16)v23 > 0x54u)
|
|
1163 && ((unsigned __int16)v23 < 4u || (unsigned __int16)v23 > 6u)
|
|
1164 && ((unsigned __int16)v23 < 0x37u || (unsigned __int16)v23 > 0x39u)
|
|
1165 && ((unsigned __int16)v23 < 0x3Au || (unsigned __int16)v23 > 0x3Cu)
|
|
1166 && ((unsigned __int16)v23 < 0x3Du || (unsigned __int16)v23 > 0x3Fu)
|
|
1167 && ((unsigned __int16)v23 < 0xFDu || (unsigned __int16)v23 > 0xFFu)
|
|
1168 && ((unsigned __int16)v23 < 0x61u || (unsigned __int16)v23 > 0x63u)
|
|
1169 && ((unsigned __int16)v23 < 0xCDu || (unsigned __int16)v23 > 0xCFu) )
|
|
1170 break;
|
|
1171 }
|
|
1172 pParty->field_750[v12] = rand() % 258 + 1;
|
|
1173 }
|
|
1174 }
|
|
1175 }
|
|
1176 else
|
|
1177 {
|
|
1178 while ( 1 )
|
|
1179 {
|
|
1180 v24 = pParty->field_750[v12];
|
|
1181 if ( (unsigned __int16)v24 < 0x73u || (unsigned __int16)v24 > 0x84u )
|
|
1182 {
|
|
1183 if ( ((unsigned __int16)v24 < 0xEBu || (unsigned __int16)v24 > 0xFCu)
|
|
1184 && ((unsigned __int16)v24 < 0x85u || (unsigned __int16)v24 > 0x96u)
|
|
1185 && ((unsigned __int16)v24 < 0x97u || (unsigned __int16)v24 > 0xBAu)
|
|
1186 && ((unsigned __int16)v24 < 0xBEu || (unsigned __int16)v24 > 0xC0u)
|
|
1187 && ((unsigned __int16)v24 < 0xC4u || (unsigned __int16)v24 > 0xC6u)
|
|
1188 && ((unsigned __int16)v24 < 0x2Bu || (unsigned __int16)v24 > 0x2Du)
|
|
1189 && ((unsigned __int16)v24 < 0xCDu || (unsigned __int16)v24 > 0xCFu)
|
|
1190 && ((unsigned __int16)v24 < 0x5Eu || (unsigned __int16)v24 > 0x60u)
|
|
1191 && ((unsigned __int16)v24 < 0xFDu || (unsigned __int16)v24 > 0xFFu)
|
|
1192 && ((unsigned __int16)v24 < 0x6Du || (unsigned __int16)v24 > 0x6Fu)
|
|
1193 && ((unsigned __int16)v24 < 0x61u || (unsigned __int16)v24 > 0x63u) )
|
|
1194 break;
|
|
1195 }
|
|
1196 pParty->field_750[v12] = rand() % 258 + 1;
|
|
1197 }
|
|
1198 }
|
|
1199 v10 = v56;
|
|
1200 }
|
|
1201 v25 = v10;
|
|
1202 v26 = pParty->field_750[v25];
|
|
1203 v27 = pParty->field_75A[v25] == v13;
|
|
1204 word_F8B1A0 = pParty->field_750[v25];
|
|
1205 if ( v27 )
|
|
1206 {
|
|
1207 //v1 = 0;
|
|
1208 v27 = v26 == v13;
|
|
1209 v29 = (int)pNPCTopics[351].pText;
|
|
1210 if ( v27 )
|
|
1211 v29 = (int)pNPCTopics[353].pText;
|
|
1212 dword_F8B1A4 = (char *)v29;
|
|
1213 }
|
|
1214 else
|
|
1215 {
|
|
1216 if ( v26 != v13 )
|
|
1217 {
|
|
1218 party_finds_gold(100 * pMonsterStats->pInfos[(unsigned __int16)v26].uLevel, 0);
|
|
1219 v28 = pParty->pPlayers;
|
|
1220 do
|
|
1221 {
|
|
1222 v28->SetVariable(VAR_Award, 86);
|
|
1223 ++v28;
|
|
1224 }
|
|
1225 while ( (signed int)v28 < (signed int)pParty->pHirelings );
|
|
1226 pParty->uNumBountiesCollected += 100 * pMonsterStats->pInfos[pParty->field_750[v25]].uLevel;
|
|
1227 pParty->field_750[v25] = v13;
|
|
1228 pParty->field_75A[v25] = v13;
|
|
1229 }
|
|
1230 //v1 = 0;
|
|
1231 dword_F8B1A4 = pNPCTopics[352].pText;
|
|
1232 }
|
|
1233 }
|
|
1234 else if ( uMessageParam == 100 )
|
|
1235 {
|
|
1236 pKeyActionMap->EnterText(1, 10, v8);
|
|
1237 }
|
|
1238 }
|
|
1239 }
|
|
1240 }
|
|
1241 */
|
|
1242
|
|
1243
|
|
1244 //LABEL_196:
|
|
1245 switch ( uMessageParam )
|
|
1246 {
|
|
1247 case HOUSE_DIALOGUE_LEARN_SKILLS:
|
|
1248 {
|
|
1249 pDialogueWindow->eWindowType = WINDOW_MainMenu;
|
|
1250 UI_CreateEndConversationButton();
|
|
1251 FillAviableSkillsToTeach(in_current_building_type);
|
|
1252 break;
|
|
1253 }
|
|
1254 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_MAIN:
|
|
1255 {
|
|
1256 pDialogueWindow->eWindowType = WINDOW_MainMenu;
|
|
1257 UI_CreateEndConversationButton();
|
|
1258 sub_4B3A72(in_current_building_type);
|
|
1259 break;
|
|
1260 }
|
|
1261 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RULES:
|
|
1262 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_VICTORY_CONDITIONS:
|
|
1263 {
|
|
1264 dialog_menu_id = (HOUSE_DIALOGUE_MENU)uMessageParam;
|
|
1265 break;
|
|
1266 }
|
|
1267 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RESULT:
|
|
1268 {
|
|
1269 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
|
|
1270 {
|
|
1271 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_PlayArcomage;
|
|
1272 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v1;
|
|
1273 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = v1;
|
|
1274 ++pMessageQueue_50CBD0->uNumMessages;
|
|
1275 }*/
|
|
1276 pMessageQueue_50CBD0->AddMessage(UIMSG_PlayArcomage, 0, 0);
|
|
1277 dialog_menu_id = HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RESULT;
|
|
1278 break;
|
|
1279 }
|
|
1280 case HOUSE_DIALOGUE_SHOP_BUY_STANDARD:
|
|
1281 case HOUSE_DIALOGUE_SHOP_BUY_SPECIAL:
|
|
1282 {
|
|
1283 if ( pParty->field_3C.field_50[(unsigned int)v8->ptr_1C] < (signed __int64)pParty->uTimePlayed )
|
|
1284 {
|
|
1285 GenerateStandartShopItems();
|
|
1286 GenerateSpecialShopItems();
|
|
1287 pParty->field_3C.field_50[window_SpeakInHouse->par1C] = pParty->uTimePlayed + (signed __int64)((double)(11059200 * (signed int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].field_1C) * 0.033333335);
|
|
1288 }
|
|
1289 if ( uMessageParam == HOUSE_DIALOGUE_SHOP_BUY_STANDARD )
|
|
1290 {
|
|
1291 if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType] )
|
|
1292 {
|
|
1293 for ( v43 = 0; v43 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType]; ++v43 )
|
|
1294 {
|
|
1295 if ( pParty->StandartItemsInShops[(int)window_SpeakInHouse->ptr_1C][v43].uItemID )
|
|
1296 {
|
|
1297 v46 = pIcons_LOD->LoadTexture(pItemsTable->pItems[pParty->StandartItemsInShops[(int)window_SpeakInHouse->ptr_1C][v43].uItemID].pIconName, TEXTURE_16BIT_PALETTE);
|
|
1298 ItemsInShopTexture[v43] = &pIcons_LOD->pTextures[v46];
|
|
1299 }
|
|
1300 }
|
|
1301 }
|
|
1302 if ( in_current_building_type == BildingType_WeaponShop )
|
|
1303 {
|
|
1304 v48 = 0;
|
|
1305 if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType] )
|
|
1306 {
|
|
1307 do
|
|
1308 {
|
|
1309 if ( pParty->StandartItemsInShops[(int)window_SpeakInHouse->ptr_1C][v48].uItemID)
|
|
1310 word_F8B158[v48] = rand() % (300 - ItemsInShopTexture[v48]->uTextureHeight);
|
|
1311 ++v48;
|
|
1312 }
|
|
1313 while ( v48 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType] );
|
|
1314 }
|
|
1315 }
|
|
1316 }
|
|
1317 if ( uMessageParam == HOUSE_DIALOGUE_SHOP_BUY_SPECIAL )
|
|
1318 {
|
|
1319 if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType] )
|
|
1320 {
|
|
1321 for ( v43 = 0; v43 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType]; ++v43 )
|
|
1322 {
|
|
1323 if ( pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(signed int)v43].uItemID )
|
|
1324 {
|
|
1325 v51 = pIcons_LOD->LoadTexture(pItemsTable->pItems[pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(signed int)v43].uItemID].pIconName, TEXTURE_16BIT_PALETTE);
|
|
1326 ItemsInShopTexture[v43] = &pIcons_LOD->pTextures[v51];
|
|
1327 }
|
|
1328 }
|
|
1329 }
|
|
1330 if ( in_current_building_type == BildingType_WeaponShop )
|
|
1331 {
|
|
1332 v53 = 0;
|
|
1333 if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType] )
|
|
1334 {
|
|
1335 do
|
|
1336 {
|
|
1337 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v53].uItemID)
|
|
1338 word_F8B158[v53] = rand() % (300 - ItemsInShopTexture[v53]->uTextureHeight);
|
|
1339 ++v53;
|
|
1340 }
|
|
1341 while ( v53 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType ] );
|
|
1342 }
|
|
1343 }
|
|
1344 }
|
|
1345 break;
|
|
1346 }
|
|
1347 case HOUSE_DIALOGUE_SHOP_SELL:
|
|
1348 case HOUSE_DIALOGUE_SHOP_IDENTIFY:
|
|
1349 case HOUSE_DIALOGUE_SHOP_REPAIR:
|
|
1350 {
|
|
1351 dialog_menu_id = (HOUSE_DIALOGUE_MENU)uMessageParam;
|
|
1352 sub_421B2C_PlaceInInventory_or_DropPickedItem();
|
|
1353 break;
|
|
1354 }
|
|
1355 case HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT:
|
|
1356 {
|
|
1357 pDialogueWindow->eWindowType = WINDOW_MainMenu;
|
|
1358 UI_CreateEndConversationButton();
|
|
1359 sub_4B3AD4(in_current_building_type);
|
|
1360 break;
|
|
1361 }
|
|
1362 default:
|
|
1363 {
|
|
1364 if( uMessageParam >= HOUSE_DIALOGUE_36 && uMessageParam <= HOUSE_DIALOGUE_GUILD_LEARN_SKILL )
|
|
1365 {
|
|
1366 //v35 = pPlayers[uActiveCharacter];
|
|
1367 //v36 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)v8->ptr_1C] * 500.0);
|
|
1368 v36 = (signed __int64)(p2DEvents[(unsigned int)v8->ptr_1C - 1].flt_24 * 500.0);
|
|
1369 v37 = v36 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100;
|
|
1370 if ( v37 < v36 / 3 )
|
|
1371 v37 = v36 / 3;
|
|
1372 //if (false)
|
|
1373 if(byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][uMessageParam-36])
|
|
1374 //if ( *(&byte_4ED94C[37 * v35->uClass] + v55) )
|
|
1375 {
|
|
1376 //v38 = (int)(&pPlayers[uActiveCharacter]->uIntelligence + uMessageParam);
|
|
1377 if ( !pPlayers[uActiveCharacter]->pActiveSkills[uMessageParam - 36] )
|
|
1378 {
|
|
1379 if ( pParty->uNumGold < v37 )
|
|
1380 {
|
|
1381 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2);
|
|
1382 if ( in_current_building_type == BildingType_Training || in_current_building_type == BildingType_Tavern )
|
|
1383 v39 = 4;
|
|
1384 else
|
|
1385 v39 = 2;
|
|
1386 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, (HouseSoundID)v39);
|
|
1387 }
|
|
1388 else
|
|
1389 {
|
|
1390 Party::TakeGold(v37);
|
|
1391 dword_F8B1E4 = 1;
|
|
1392 pPlayers[uActiveCharacter]->pActiveSkills[uMessageParam - 36] = 1;
|
|
1393 pPlayers[uActiveCharacter]->PlaySound(SPEECH_78, 0);
|
|
1394 }
|
|
1395 }
|
|
1396 }
|
|
1397 }
|
|
1398 break;
|
|
1399 }
|
|
1400 }
|
|
1401 /*
|
|
1402 if ( uMessageParam != 95 && uMessageParam != 2 )
|
|
1403 {
|
|
1404 if ( uMessageParam == 3 )
|
|
1405 {
|
|
1406 dialog_menu_id = 3;
|
|
1407 }
|
|
1408 else
|
|
1409 {
|
|
1410 if ( uMessageParam == 4 )
|
|
1411 {
|
|
1412 dialog_menu_id = 4;
|
|
1413 }
|
|
1414 else
|
|
1415 {
|
|
1416 if ( uMessageParam != 5 )
|
|
1417 {
|
|
1418 if ( uMessageParam > 35 )
|
|
1419 {
|
|
1420 if ( uMessageParam <= 72 )
|
|
1421 {
|
|
1422 v35 = pPlayers[uActiveCharacter];
|
|
1423 //v36 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)v8->ptr_1C] * 500.0);
|
|
1424 v36 = (signed __int64)(p2DEvents[(unsigned int)v8->ptr_1C - 1].flt_24 * 500.0);
|
|
1425 v37 = v36 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100;
|
|
1426 if ( v37 < v36 / 3 )
|
|
1427 v37 = v36 / 3;
|
|
1428
|
|
1429 __debugbreak();
|
|
1430 //pSkillAvailabilityPerClass[8 + v58->uClass][4 + v23]
|
|
1431 // or
|
|
1432 //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass][v23 - 36]
|
|
1433 // or
|
|
1434 //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass - 1][v23 + 1]
|
|
1435
|
|
1436 if (false)
|
|
1437 //if ( *(&byte_4ED94C[37 * v35->uClass] + v55) )
|
|
1438 {
|
|
1439 v38 = (int)(&v35->uIntelligence + uMessageParam);
|
|
1440 if ( !*(short *)v38 )
|
|
1441 {
|
|
1442 if ( pParty->uNumGold < v37 )
|
|
1443 {
|
|
1444 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
|
|
1445 if ( in_current_building_type == BildingType_Training || in_current_building_type == BildingType_Tavern )
|
|
1446 v39 = 4;
|
|
1447 else
|
|
1448 v39 = 2;
|
|
1449 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, v39);
|
|
1450 }
|
|
1451 else
|
|
1452 {
|
|
1453 Party::TakeGold(v37);
|
|
1454 dword_F8B1E4 = 1;
|
|
1455 *(short *)v38 = 1;
|
|
1456 v35->PlaySound(SPEECH_78, 0);
|
|
1457 }
|
|
1458 }
|
|
1459 }
|
|
1460 }
|
|
1461 else
|
|
1462 {
|
|
1463 if ( uMessageParam == 94 )
|
|
1464 {
|
|
1465 pDialogueWindow->eWindowType = WINDOW_MainMenu;
|
|
1466 UI_CreateEndConversationButton();
|
|
1467 sub_4B3AD4(in_current_building_type);
|
|
1468 }
|
|
1469 }
|
|
1470 }
|
|
1471 return;
|
|
1472 }
|
|
1473 dialog_menu_id = 5;
|
|
1474 }
|
|
1475 }
|
|
1476 sub_421B2C_PlaceInInventory_or_DropPickedItem();
|
|
1477 return;
|
|
1478 }
|
|
1479 if ( pParty->field_3C.field_50[(unsigned int)v8->ptr_1C] < (signed __int64)pParty->uTimePlayed )
|
|
1480 {
|
|
1481 GenerateStandartShopItems();
|
|
1482 GenerateSpecialShopItems();
|
|
1483 v8 = window_SpeakInHouse;
|
|
1484 v40 = window_SpeakInHouse->par1C;
|
|
1485 //v3 = dword_F8B198;
|
|
1486 v41 = pParty->uTimePlayed
|
|
1487 //+ (signed __int64)((double)(11059200 * (signed int)p2DEvents_minus1[26 * (unsigned int)ptr_507BC0->ptr_1C])
|
|
1488 + (signed __int64)((double)(11059200 * (signed int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].field_1C)
|
|
1489 * 0.033333335);
|
|
1490 pParty->field_3C.field_50[v40] = v41;
|
|
1491
|
|
1492 }
|
|
1493 v42 = v8->ptr_1C;
|
|
1494 v43 = 0;
|
|
1495 //v44 = p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C];
|
|
1496 v44 = p2DEvents[(unsigned int)v8->ptr_1C - 1].uType;
|
|
1497 if ( uMessageParam == 2 )
|
|
1498 {
|
|
1499 if ( uItemsAmountPerShopType[v44] )
|
|
1500 {
|
|
1501 do
|
|
1502 {
|
|
1503 v45 = pParty->StandartItemsInShops[(int)v42][v43].uItemID;
|
|
1504 if ( v45 )
|
|
1505 {
|
|
1506 v46 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v45].pIconName, TEXTURE_16BIT_PALETTE);
|
|
1507 //v3 = dword_F8B198;
|
|
1508 v8 = window_SpeakInHouse;
|
|
1509 ItemsInShopTexture[v43] = &pIcons_LOD->pTextures[v46];
|
|
1510 }
|
|
1511 v42 = v8->ptr_1C;
|
|
1512 ++v43;
|
|
1513 }
|
|
1514 //while ( v43 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
|
|
1515 while ( v43 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] );
|
|
1516 }
|
|
1517 if ( in_current_building_type == BildingType_WeaponShop )
|
|
1518 {
|
|
1519 v47 = v8->ptr_1C;
|
|
1520 v48 = 0;
|
|
1521 //if ( _4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] )
|
|
1522 if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] )
|
|
1523 {
|
|
1524 do
|
|
1525 {
|
|
1526 // if ( pParty->field_777C[9 * (v48 + 12 * (int)v47)] )
|
|
1527 if ( pParty->StandartItemsInShops[(int)v47][v48].uItemID);
|
|
1528 {
|
|
1529 v49 = rand();
|
|
1530 v8 = window_SpeakInHouse;
|
|
1531 word_F8B158[v48] = v49 % (300 - ItemsInShopTexture[v48]->uTextureHeight);
|
|
1532 }
|
|
1533 v47 = v8->ptr_1C;
|
|
1534 ++v48;
|
|
1535 }
|
|
1536 //while ( v48 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
|
|
1537 while ( v48 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] );
|
|
1538 }
|
|
1539 }
|
|
1540 }
|
|
1541 if ( uMessageParam == 95 )
|
|
1542 {
|
|
1543 if ( uItemsAmountPerShopType[v44] )
|
|
1544 {
|
|
1545 do
|
|
1546 {
|
|
1547 //v50 = pParty->field_C59C[9 * (v43 + 12 * (int)v42) + 724];
|
|
1548 v50=pParty->SpecialItemsInShops[(unsigned int)v42][(signed int)v43].uItemID;
|
|
1549 if ( v50 )
|
|
1550 {
|
|
1551 v51 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v50].pIconName, TEXTURE_16BIT_PALETTE);
|
|
1552 //v3 = dword_F8B198;
|
|
1553 v8 = window_SpeakInHouse;
|
|
1554 ItemsInShopTexture[v43] = &pIcons_LOD->pTextures[v51];
|
|
1555 }
|
|
1556 v42 = v8->ptr_1C;
|
|
1557 ++v43;
|
|
1558 }
|
|
1559 //while ( v43 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
|
|
1560 while ( v43 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] );
|
|
1561 }
|
|
1562 if ( in_current_building_type == BildingType_WeaponShop )
|
|
1563 {
|
|
1564 v52 = v8->ptr_1C;
|
|
1565 v53 = 0;
|
|
1566 //if ( _4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] )
|
|
1567 if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] )
|
|
1568 {
|
|
1569 do
|
|
1570 {
|
|
1571 // if ( pParty->field_C59C[9 * (v53 + 12 * (int)v52) + 724] )
|
|
1572 if (pParty->SpecialItemsInShops[(unsigned int)v52][v53].uItemID)
|
|
1573 {
|
|
1574 v54 = rand();
|
|
1575 v8 = window_SpeakInHouse;
|
|
1576 word_F8B158[v53] = v54 % (300 - ItemsInShopTexture[v53]->uTextureHeight);
|
|
1577 }
|
|
1578 v52 = v8->ptr_1C;
|
|
1579 ++v53;
|
|
1580 }
|
|
1581 //while ( v53 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
|
|
1582 while ( v53 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType ] );
|
|
1583 }
|
|
1584 }
|
|
1585 }
|
|
1586 */
|
|
1587 }
|
|
1588 //----- (004B6943) --------------------------------------------------------
|
|
1589 void __cdecl TravelByTransport()
|
|
1590 {
|
|
1591 GUIWindow *v0; // ebx@1
|
|
1592 Player *v1; // esi@1
|
|
1593 signed int v2; // edi@1
|
|
1594 unsigned int v3; // eax@1
|
|
1595 signed int v4; // ebx@1
|
|
1596 stru365_travel_info *v5; // esi@7
|
|
1597 //int v6; // eax@9
|
|
1598 //int v7; // eax@9
|
|
1599 //int v8; // eax@12
|
|
1600 //int v9; // edi@12
|
|
1601 //int v10; // edx@12
|
|
1602 int v11; // ecx@12
|
|
1603 signed int v12; // esi@13
|
|
1604 signed int v13; // edi@14
|
|
1605 DWORD v14; // eax@26
|
|
1606 DWORD v15; // edi@26
|
|
1607 GUIWindow *v16; // ebx@36
|
|
1608 int v17; // esi@36
|
|
1609 int v18; // eax@36
|
|
1610 int v19; // ecx@36
|
|
1611 int v20; // esi@36
|
|
1612 int v21; // eax@36
|
|
1613 void *v22; // eax@39
|
|
1614 int v23; // esi@39
|
|
1615 GUIButton *v24; // ebx@39
|
|
1616 signed int v25; // eax@41
|
|
1617 //int v26; // esi@44
|
|
1618 //const char *v27; // eax@46
|
|
1619 char *v28; // eax@62
|
|
1620 int v29; // eax@62
|
|
1621 unsigned int v30; // ecx@62
|
|
1622 char *v31; // eax@63
|
|
1623 MapInfo v32; // [sp-3Ch] [bp-2CCh]@62
|
|
1624 /*int v33; // [sp-38h] [bp-2C8h]@62
|
|
1625 int v34; // [sp-34h] [bp-2C4h]@62
|
|
1626 int v35; // [sp-30h] [bp-2C0h]@62
|
|
1627 int v36; // [sp-2Ch] [bp-2BCh]@62
|
|
1628 int v37; // [sp-28h] [bp-2B8h]@62
|
|
1629 int v38; // [sp-24h] [bp-2B4h]@62
|
|
1630 int v39; // [sp-20h] [bp-2B0h]@62
|
|
1631 int v40; // [sp-1Ch] [bp-2ACh]@62
|
|
1632 int v41; // [sp-18h] [bp-2A8h]@62
|
|
1633 int v42; // [sp-14h] [bp-2A4h]@62
|
|
1634 char *v43; // [sp-10h] [bp-2A0h]@62
|
|
1635 char *v44; // [sp-Ch] [bp-29Ch]@62
|
|
1636 unsigned int v45; // [sp-8h] [bp-298h]@62
|
|
1637 char *v46; // [sp-4h] [bp-294h]@62
|
|
1638 const char *v47[5]; // [sp+0h] [bp-290h]@7*/
|
|
1639 char v48[5][100]; // [sp+14h] [bp-27Ch]@37
|
|
1640 //char v49[100]; // [sp+78h] [bp-218h]@68
|
|
1641 //char v50[100]; // [sp+DCh] [bp-1B4h]@68
|
|
1642 //char v51[100]; // [sp+140h] [bp-150h]@68
|
|
1643 //char Dest[100]; // [sp+1A4h] [bp-ECh]@36
|
|
1644 GUIWindow v53; // [sp+208h] [bp-88h]@1
|
|
1645 int v54; // [sp+25Ch] [bp-34h]@36
|
|
1646 int v55; // [sp+260h] [bp-30h]@36
|
|
1647 //unsigned int v56; // [sp+264h] [bp-2Ch]@1
|
|
1648 //int v57; // [sp+268h] [bp-28h]@1
|
|
1649 int v58; // [sp+26Ch] [bp-24h]@36
|
|
1650 //GUIWindow *v59; // [sp+270h] [bp-20h]@1
|
|
1651 unsigned int v60; // [sp+274h] [bp-1Ch]@36
|
|
1652 //Player *v61; // [sp+278h] [bp-18h]@1
|
|
1653 int v62; // [sp+27Ch] [bp-14h]@36
|
|
1654 int v63; // [sp+280h] [bp-10h]@14
|
|
1655 char *a1; // [sp+284h] [bp-Ch]@37
|
|
1656 unsigned int s1; // [sp+288h] [bp-8h]@1
|
|
1657 int v66; // [sp+28Ch] [bp-4h]@48
|
|
1658
|
|
1659 v0 = window_SpeakInHouse;
|
|
1660 memcpy(&v53, window_SpeakInHouse, sizeof(v53));
|
|
1661 v2 = 255;
|
|
1662 //v61 = pPlayers[uActiveCharacter];
|
|
1663 v1 = pPlayers[uActiveCharacter];
|
|
1664 v53.uFrameX = 483;
|
|
1665 v53.uFrameWidth = 148;
|
|
1666 v53.uFrameZ = 334;
|
|
1667 auto color_default = TargetColor(255, 255, 255);
|
|
1668 auto color_selected = TargetColor(255, 255, 155);
|
|
1669 v3 = 52 * (unsigned int)v0->ptr_1C;
|
|
1670 //v59 = (GUIWindow *)((((p2DEvents_minus1___00[v3 / 2] != 27) - 1) & 0xFFFFFFE7) + 50);
|
|
1671 //v59 = (GUIWindow *)((((p2DEvents[(unsigned int)v0->ptr_1C - 1].uType != BildingType_Stables) - 1) & 0xFFFFFFE7) + 50);
|
|
1672 //v4 = (signed __int64)((double)(signed int)v59 * p2DEvents_minus1__20[v3 / 4]);
|
|
1673
|
|
1674 v4 = p2DEvents[(unsigned int)v0->ptr_1C - 1].uType == BildingType_Stables ? 25 : 50;
|
|
1675 v4 *= p2DEvents[(unsigned int)v0->ptr_1C - 1].fPriceMultiplier;
|
|
1676
|
|
1677 s1 = v4 * (100 - v1->GetMerchant()) / 100;
|
|
1678 if ( (signed int)s1 < v4 / 3 )
|
|
1679 s1 = v4 / 3;
|
|
1680 if ( dialog_menu_id == HOUSE_DIALOGUE_MAIN)
|
|
1681 {
|
|
1682 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
|
|
1683 {
|
|
1684 v16 = pDialogueWindow;
|
|
1685 v58 = 255;
|
|
1686 v62 = 0;
|
|
1687 v17 = LOBYTE(pFontArrus->uFontHeight) - 3;
|
|
1688 //v59 = pDialogueWindow;
|
|
1689 v54 = v17;
|
|
1690 strcpy(v48[4], "");
|
|
1691 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[405], s1); // Price: %lu gold
|
|
1692 v18 = pFontArrus->CalcTextHeight(pTmpBuf2.data(), &v53, 0, 0);
|
|
1693 v19 = v16->pNumPresenceButton;
|
|
1694 v20 = v18 + v17 + 146;
|
|
1695 v21 = v16->pStartingPosActiveItem;
|
|
1696 v63 = v20;
|
|
1697 v55 = v20;
|
|
1698 v60 = v21;
|
|
1699 if ( v21 >= v21 + v19 )
|
|
1700 goto LABEL_71;
|
|
1701 s1 = 2;
|
|
1702 a1 = (char *)v48;
|
|
1703 while ( 1 )
|
|
1704 {
|
|
1705 int v47 = v60;
|
|
1706 v22 = window_SpeakInHouse->ptr_1C;
|
|
1707 v23 = transport_routes[(unsigned int)v22 - HOUSE_STABLES_HARMONDALE][v62];
|
|
1708 //v23 = (unsigned __int8)*(&_4F0D38_TravelInfo[4 * (unsigned int)v22] + v62); // negindex. actual address is around + 0x36
|
|
1709 //v61 = (Player *)(unsigned __int8)*(&_4F0D38_TravelInfo[4 * (unsigned int)v22] + v62); // + 0x3F for sea travels, less for land
|
|
1710 v24 = v16->GetControl(v60);
|
|
1711
|
|
1712 if (v23 != v58)
|
|
1713 {
|
|
1714 if (v23 >= 25)
|
|
1715 Log::Warning(L"Transport UI: scedule overflow");
|
|
1716 if (s1 >= 6)
|
|
1717 v25 = true;
|
|
1718 else
|
|
1719 v25 = transport_schedule[v23].pSchedule[pParty->uDaysPlayed % 7];
|
|
1720 }
|
|
1721
|
|
1722 if (v23 != v58 && v25 && (!transport_schedule[v23].uQuestBit || _449B57_test_bit(pParty->_quest_bits, transport_schedule[v23].uQuestBit)) )
|
|
1723 {
|
|
1724 v58 = v23;
|
|
1725 if ( pDialogueWindow->pCurrentPosActiveItem == s1 )
|
|
1726 sprintf(a1, "\f%05d", color_selected);
|
|
1727 else
|
|
1728 sprintf(a1, "\f%05d", color_default);
|
|
1729
|
|
1730 //v32.uRedbookTrackID = v27;
|
|
1731 v66 = transport_schedule[v23].uTravelTime;
|
|
1732 if ( (unsigned int)window_SpeakInHouse->ptr_1C >= HOUSE_BOATS_63 )
|
|
1733 {
|
|
1734 if ( CheckHiredNPCSpeciality(Sailor) )
|
|
1735 v66 -= 2;
|
|
1736 if ( CheckHiredNPCSpeciality(Navigator) )
|
|
1737 v66 -= 3;
|
|
1738 if ( CheckHiredNPCSpeciality(Pirate) )
|
|
1739 v66 -= 2;
|
|
1740 }
|
|
1741 else
|
|
1742 {
|
|
1743 if ( CheckHiredNPCSpeciality(Horseman) )
|
|
1744 v66 -= 2;
|
|
1745 }
|
|
1746 if ( CheckHiredNPCSpeciality(Explorer) )
|
|
1747 --v66;
|
|
1748 if ( v66 < 1 )
|
|
1749 v66 = 1;
|
|
1750 if ( v23 != v2 )
|
|
1751 {
|
|
1752 memcpy(&v32, &pMapStats->pInfos[transport_schedule[v23].uMapInfoID], 0x44u);
|
|
1753 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[404], // Time - %d days, destination %s
|
|
1754 v66, v32.pName);
|
|
1755 strcat(a1, pTmpBuf.data());
|
|
1756 v28 = a1;
|
|
1757 a1 += 100;
|
|
1758 ++v62;
|
|
1759 ++s1;
|
|
1760 strcat(v28, "\n \n");
|
|
1761 v24->uY = v63;
|
|
1762 v29 = pFontArrus->CalcTextHeight(pTmpBuf.data(), &v53, 0, 0);
|
|
1763 v30 = v24->uY;
|
|
1764 v24->uHeight = v29;
|
|
1765 v2 = 255;
|
|
1766 v24->uW = v30 + v29 - 1;
|
|
1767 v63 += v54 + v29;
|
|
1768 }
|
|
1769 }
|
|
1770 else
|
|
1771 {
|
|
1772 v31 = a1;
|
|
1773 ++v62;
|
|
1774 ++s1;
|
|
1775 a1 += 100;
|
|
1776 strcpy(v31, "");
|
|
1777 if ( v24 )
|
|
1778 {
|
|
1779 v24->uW = 0;
|
|
1780 v24->uHeight = 0;
|
|
1781 v24->uY = 0;
|
|
1782 }
|
|
1783 }
|
|
1784 ++v60;
|
|
1785 if ( (signed int)v60 >= v16->pNumPresenceButton + v16->pStartingPosActiveItem )
|
|
1786 break;
|
|
1787 //v16 = v59;
|
|
1788 }
|
|
1789 if ( v63 != v55 )
|
|
1790 {
|
|
1791 /*v47[1] = &Dest;
|
|
1792 v47[0] = &v51;
|
|
1793 v46 = &v50;
|
|
1794 v45 = (unsigned int)&v49;
|
|
1795 v44 = &v48;
|
|
1796 v43 = pTmpBuf2.data();*/
|
|
1797 sprintf(pTmpBuf.data(), "%s\n \n%s%s%s%s%s", pTmpBuf2.data(), v48[0], v48[1], v48[2], v48[3], v48[4]);
|
|
1798 v53.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3u);
|
|
1799 }
|
|
1800 else
|
|
1801 {
|
|
1802 LABEL_71:
|
|
1803 v53.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[561], &v53, 0, 0)) / 2 + 138,
|
|
1804 color_default, pGlobalTXT_LocalizationStrings[561], 3);
|
|
1805 pAudioPlayer->StopChannels(-1, -1);
|
|
1806 }
|
|
1807 }
|
|
1808 }
|
|
1809 else
|
|
1810 {
|
|
1811 if ( dialog_menu_id >= HOUSE_DIALOGUE_TRANSPORT_SCHEDULE_1 && dialog_menu_id <= HOUSE_DIALOGUE_TRANSPORT_SCHEDULE_4 )
|
|
1812 {
|
|
1813 if ( pParty->uNumGold < s1 )
|
|
1814 {
|
|
1815 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
|
|
1816 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_Greeting_2);
|
|
1817 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
|
|
1818 return;
|
|
1819 }
|
|
1820
|
|
1821 Party::TakeGold(s1);
|
|
1822
|
|
1823 v5 = &transport_schedule[transport_routes[(unsigned int)window_SpeakInHouse->ptr_1C - HOUSE_STABLES_HARMONDALE][dialog_menu_id - HOUSE_DIALOGUE_TRANSPORT_SCHEDULE_1]];
|
|
1824 if ( v5->pSchedule[pParty->uDaysPlayed % 7] )
|
|
1825 {
|
|
1826 if ( _stricmp(pCurrentMapName.data(), pMapStats->pInfos[v5->uMapInfoID].pFilename) )
|
|
1827 {
|
|
1828 SaveGame(1, 0);
|
|
1829 strcpy(pCurrentMapName.data(), pMapStats->pInfos[v5->uMapInfoID].pFilename);
|
|
1830
|
|
1831 dword_6BE364_game_settings_1 |= 1u;
|
|
1832 _5B65B8_npcdata_hiword_house_or_other = 0;
|
|
1833 dword_5B65BC = 0;
|
|
1834 _5B65B4_npcdata_loword_house_or_other = v5->arrival_rot_y;
|
|
1835 v11 = *((int *)v5 + 3);
|
|
1836 uGameState = GAME_STATE_2;
|
|
1837 _5B65A8_npcdata_uflags_or_other = v11;
|
|
1838 _5B65AC_npcdata_fame_or_other = v5->arrival_y;
|
|
1839 _5B65B0_npcdata_rep_or_other = v5->arrival_z;
|
|
1840 dword_5B65C0 = v11 | v5->arrival_y | v5->arrival_z | v5->arrival_rot_y;
|
|
1841 }
|
|
1842 else
|
|
1843 {
|
|
1844 pIndoorCamera->sRotationY = 0;
|
|
1845 pParty->uFlags |= 2u;
|
|
1846 pParty->vPosition.x = v5->arrival_x;
|
|
1847 pParty->vPosition.y = v5->arrival_y;
|
|
1848 pParty->vPosition.z = v5->arrival_z;
|
|
1849 pParty->uFallStartY = pParty->vPosition.z;
|
|
1850 pParty->sRotationX = 0;
|
|
1851 pParty->sRotationY = v5->arrival_rot_y;
|
|
1852 }
|
|
1853 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
|
|
1854 v12 = v5->uTravelTime;
|
|
1855 int _v47;
|
|
1856 if ( (signed int)window_SpeakInHouse->ptr_1C >= 63 )
|
|
1857 {
|
|
1858 v63 = SPEECH_SetSail;
|
|
1859 v13 = 2500;
|
|
1860 if ( CheckHiredNPCSpeciality(Sailor) )
|
|
1861 v12 -= 2;
|
|
1862 if ( CheckHiredNPCSpeciality(Navigator) )
|
|
1863 v12 -= 3;
|
|
1864 //_v47 = 45;
|
|
1865 if ( CheckHiredNPCSpeciality(Pirate) )
|
|
1866 v12 -= 2;
|
|
1867 }
|
|
1868 else
|
|
1869 {
|
|
1870 v63 = SPEECH_CarriageReady;
|
|
1871 v13 = 1500;
|
|
1872 //_v47 = 35;
|
|
1873 if ( CheckHiredNPCSpeciality(Horseman) )
|
|
1874 v12 -= 2;
|
|
1875 }
|
|
1876 if ( CheckHiredNPCSpeciality(Explorer) )
|
|
1877 --v12;
|
|
1878 if ( v12 < 1 )
|
|
1879 v12 = 1;
|
|
1880 RestAndHeal(1440 * v12);
|
|
1881 v1->PlaySound((PlayerSpeech)v63, 0);
|
|
1882 v14 = GetTickCount();
|
|
1883 v15 = v14 + v13;
|
|
1884 if ( v15 < v14 )
|
|
1885 v15 = v14;
|
|
1886 while ( GetTickCount() < v15 )
|
|
1887 sqrt(3.1415926);
|
|
1888 while ( sub_4BD8B5() )
|
|
1889 ;
|
|
1890 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
|
|
1891 return;
|
|
1892 }
|
|
1893 else
|
|
1894 {
|
|
1895 dialog_menu_id = HOUSE_DIALOGUE_MAIN;
|
|
1896 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
|
|
1897 }
|
|
1898 }
|
|
1899 }
|
|
1900 }
|
|
1901 //----- (004B68EA) --------------------------------------------------------
|
|
1902 bool __fastcall IsTravelAvailable(int a1)
|
|
1903 {
|
|
1904 for (uint i = 0; i < 4; ++i)
|
|
1905 {
|
|
1906 uint route = transport_routes[a1][i];
|
|
1907 if (transport_schedule[route].pSchedule[pParty->uDaysPlayed % 7])
|
|
1908 {
|
|
1909 if (!transport_schedule[route].uQuestBit || _449B57_test_bit(pParty->_quest_bits, transport_schedule[route].uQuestBit))
|
|
1910 return true;
|
|
1911 }
|
|
1912 }
|
|
1913 return false;
|
|
1914 }
|
|
1915
|
|
1916
|
|
1917
|
|
1918 //----- (004B7911) --------------------------------------------------------
|
|
1919 void __cdecl TownHallDialog()
|
|
1920 {
|
|
1921 GUIWindow *v0; // eax@4
|
|
1922 int v1; // eax@10
|
|
1923 int v2; // esi@10
|
|
1924 GUIFont *v3; // ST20_4@20
|
|
1925 int v4; // eax@20
|
|
1926 MonsterInfo *v5; // edi@21
|
|
1927 unsigned int v6; // ST20_4@21
|
|
1928 char *v7; // ST1C_4@21
|
|
1929 unsigned int v8; // eax@21
|
|
1930 int v9; // esi@21
|
|
1931 char *v10; // eax@23
|
|
1932 signed int v11; // ebx@24
|
|
1933 signed int i; // esi@26
|
|
1934 int v13; // eax@27
|
|
1935 GUIWindow *v14; // ecx@28
|
|
1936 __int64 v15; // qax@28
|
|
1937 signed int v16; // ebx@28
|
|
1938 int v17; // ebx@28
|
|
1939 unsigned __int8 v18; // sf@28
|
|
1940 char **v19; // edi@29
|
|
1941 GUIButton *v20; // eax@30
|
|
1942 GUIButton *v21; // esi@30
|
|
1943 int v22; // eax@30
|
|
1944 unsigned int v23; // ecx@30
|
|
1945 unsigned __int16 v24; // ax@30
|
|
1946 GUIWindow a1; // [sp+Ch] [bp-110h]@21
|
|
1947 GUIWindow w; // [sp+60h] [bp-BCh]@21
|
|
1948 GUIWindow _this; // [sp+B4h] [bp-68h]@1
|
|
1949 int v28; // [sp+108h] [bp-14h]@1
|
|
1950 int v29; // [sp+10Ch] [bp-10h]@28
|
|
1951 int v30; // [sp+110h] [bp-Ch]@1
|
|
1952 int v31; // [sp+114h] [bp-8h]@29
|
|
1953 GUIFont *pOutString; // [sp+118h] [bp-4h]@21
|
|
1954
|
|
1955 memcpy(&_this, window_SpeakInHouse, sizeof(_this));
|
|
1956 _this.uFrameX = 483;
|
|
1957 _this.uFrameWidth = 148;
|
|
1958 _this.uFrameZ = 334;
|
|
1959 v28 = TargetColor(0xFFu, 0xFFu, 0xFFu);
|
|
1960 v30 = TargetColor(0xFFu, 0xFFu, 0x9Bu);
|
|
1961 sprintf(pTmpBuf.data(), "%s: %d", pGlobalTXT_LocalizationStrings[605], pParty->uFine);
|
|
1962 _this.DrawTitleText(pFontArrus, 0, 0x104u, v30, pTmpBuf.data(), 3u);
|
|
1963 switch(dialog_menu_id)
|
|
1964 {
|
|
1965 case HOUSE_DIALOGUE_MAIN:
|
|
1966 {
|
|
1967 v11 = 1;
|
|
1968 pOutString = 0;
|
|
1969 pShopOptions[0] = pGlobalTXT_LocalizationStrings[604];
|
|
1970 if ( pParty->uFine )
|
|
1971 {
|
|
1972 pShopOptions[1] = pGlobalTXT_LocalizationStrings[603];
|
|
1973 v11 = 2;
|
|
1974 }
|
|
1975 for ( i = 0; i < v11; ++i )
|
|
1976 {
|
|
1977 v13 = pFontArrus->CalcTextHeight(pShopOptions[i], &_this, 0, 0);
|
|
1978 pOutString = (GUIFont *)((char *)pOutString + v13);
|
|
1979 }
|
|
1980 v29 = (100 - (signed int)pOutString) / v11;
|
|
1981 v14 = pDialogueWindow;
|
|
1982 v15 = 80 - v11 * (100 - (signed int)pOutString) / v11 - (signed int)pOutString;
|
|
1983 v16 = v15 - HIDWORD(v15);
|
|
1984 LODWORD(v15) = pDialogueWindow->pStartingPosActiveItem;
|
|
1985 HIDWORD(v15) = v15 + pDialogueWindow->pNumPresenceButton;
|
|
1986 v17 = (v16 >> 1) - v29 / 2 + 158;
|
|
1987 v18 = -pDialogueWindow->pNumPresenceButton < 0;
|
|
1988 pOutString = (GUIFont *)pDialogueWindow->pStartingPosActiveItem;
|
|
1989 if ( v18 ^ __OFSUB__((int)v15, HIDWORD(v15)) )
|
|
1990 {
|
|
1991 v31 = 2;
|
|
1992 v19 = pShopOptions.data();
|
|
1993 do
|
|
1994 {
|
|
1995 v20 = v14->GetControl((unsigned int)pOutString);
|
|
1996 v21 = v20;
|
|
1997 v20->uY = v29 + v17;
|
|
1998 v22 = pFontArrus->CalcTextHeight(*v19, &_this, 0, 0);
|
|
1999 v23 = v21->uY;
|
|
2000 v21->uHeight = v22;
|
|
2001 v17 = v23 + v22 - 1;
|
|
2002 v21->uW = v17;
|
|
2003 v24 = v30;
|
|
2004 if ( pDialogueWindow->pCurrentPosActiveItem != v31 )
|
|
2005 v24 = v28;
|
|
2006 _this.DrawTitleText(pFontArrus, 0, v23, v24, *v19, 3u);
|
|
2007 v14 = pDialogueWindow;
|
|
2008 ++v31;
|
|
2009 ++v19;
|
|
2010 pOutString = (GUIFont *)((char *)pOutString + 1);
|
|
2011 }
|
|
2012 while ( (signed int)pOutString < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
|
|
2013 }
|
|
2014 break;
|
|
2015 }
|
|
2016
|
|
2017 case HOUSE_DIALOGUE_TOWNHALL_99:
|
|
2018 {
|
|
2019 v5 = &pMonsterStats->pInfos[word_F8B1A0];
|
|
2020 v6 = TargetColor(0xFFu, 0xFFu, 0xFFu);
|
|
2021 v7 = v5->pName;
|
|
2022 v8 = TargetColor(0xFFu, 0xFFu, 0x9Bu);
|
|
2023 sprintf(pTmpBuf.data(), "\f%05d%s\f%05d", v8, v7, v6);
|
|
2024 sprintf(pTmpBuf2.data(), dword_F8B1A4, pTmpBuf.data(), 100 * v5->uLevel);
|
|
2025 current_npc_text = pTmpBuf2.data();
|
|
2026 memcpy(&a1, pDialogueWindow, sizeof(a1));
|
|
2027 w.uFrameWidth = 458;
|
|
2028 w.uFrameZ = 457;
|
|
2029 pOutString = pFontArrus;
|
|
2030 v9 = pFontArrus->CalcTextHeight(pTmpBuf2.data(), &w, 13, 0) + 7;
|
|
2031 if ( 352 - v9 < 8 )
|
|
2032 {
|
|
2033 pOutString = pFontCreate;
|
|
2034 v9 = pFontCreate->CalcTextHeight(current_npc_text, &w, 13, 0) + 7;
|
|
2035 }
|
|
2036
|
|
2037 auto pTex = pIcons_LOD->GetTexture(uTextureID_Leather);
|
|
2038 pRenderer->_4A6A68(8u, 352 - v9, pTex, pTex->uTextureHeight - v9);
|
|
2039 pRenderer->DrawTextureIndexed(8u, 347 - v9, pTexture_591428);
|
|
2040 v10 = FitTextInAWindow(current_npc_text, pOutString, &w, 0xDu, 0);
|
|
2041 a1.DrawText(pOutString, 13, 354 - v9, 0, v10, 0, 0, 0);
|
|
2042 break;
|
|
2043 }
|
|
2044 case HOUSE_DIALOGUE_TOWNHALL_100:
|
|
2045 {
|
|
2046 v0 = window_SpeakInHouse;
|
|
2047 if ( window_SpeakInHouse->receives_keyboard_input_2 == WINDOW_INPUT_IN_PROGRESS)
|
|
2048 {
|
|
2049 sprintfex(pTmpBuf.data(), "%s\n%s", pGlobalTXT_LocalizationStrings[606], pGlobalTXT_LocalizationStrings[112]); // "Pay" "How Much?"
|
|
2050 _this.DrawTitleText(pFontArrus, 0, 0x92u, v30, pTmpBuf.data(), 3u);
|
|
2051 _this.DrawTitleText(pFontArrus, 0, 0xBAu, v28, (const char *)pKeyActionMap->pPressedKeysBuffer, 3);
|
|
2052 v3 = pFontArrus;
|
|
2053 v4 = pFontArrus->GetLineWidth((const char *)pKeyActionMap->pPressedKeysBuffer);
|
|
2054 _this.DrawFlashingInputCursor(v4 / 2 + 80, 185, v3);
|
|
2055 return;
|
|
2056 }
|
|
2057 if ( window_SpeakInHouse->receives_keyboard_input_2 == WINDOW_INPUT_CONFIRMED)
|
|
2058 {
|
|
2059 v1 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer);
|
|
2060 v2 = v1;
|
|
2061 if ( v1 <= 0 )
|
|
2062 {
|
|
2063 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
|
|
2064 return;
|
|
2065 }
|
|
2066 if ( v1 > pParty->uNumGold )
|
|
2067 {
|
|
2068 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
|
|
2069 v2 = pParty->uNumGold;
|
|
2070 }
|
|
2071 if ( v2 > pParty->uFine )
|
|
2072 v2 = pParty->uFine;
|
|
2073 Party::TakeGold(v2);
|
|
2074 pParty->uFine -= v2;
|
|
2075 if ( pParty->uFine < 0 )
|
|
2076 pParty->uFine = 0;
|
|
2077 if ( uActiveCharacter )
|
|
2078 pPlayers[uActiveCharacter]->PlaySound(SPEECH_81, 0);
|
|
2079 v0 = window_SpeakInHouse;
|
|
2080 }
|
|
2081 if ( window_SpeakInHouse->receives_keyboard_input_2 == WINDOW_INPUT_CANCELLED)
|
|
2082 {
|
|
2083 v0->receives_keyboard_input_2 = WINDOW_INPUT_NONE;
|
|
2084 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
|
|
2085 }
|
|
2086 break;
|
|
2087 }
|
|
2088 default:
|
|
2089 {
|
|
2090 break;
|
|
2091 }
|
|
2092 }
|
|
2093 return;
|
|
2094 }
|
|
2095
|
|
2096 //----- (004B7D7E) --------------------------------------------------------
|
|
2097 void __cdecl BankDialog()
|
|
2098 {
|
|
2099 GUIWindow *v0; // eax@4
|
|
2100 //int v1; // ecx@5
|
|
2101 int v2; // eax@6
|
|
2102 unsigned int v3; // esi@6
|
|
2103 GUIFont *v4; // ST10_4@12
|
|
2104 int v5; // eax@12
|
|
2105 int v6; // eax@19
|
|
2106 unsigned int v7; // esi@19
|
|
2107 unsigned __int16 v8; // ax@27
|
|
2108 unsigned __int16 v9; // ax@29
|
|
2109 char *v10; // [sp-8h] [bp-70h]@11
|
|
2110 char *v11; // [sp-4h] [bp-6Ch]@11
|
|
2111 GUIWindow _this; // [sp+Ch] [bp-5Ch]@1
|
|
2112 __int16 v13[2]; // [sp+60h] [bp-8h]@1
|
|
2113 __int16 v14[2]; // [sp+64h] [bp-4h]@1
|
|
2114
|
|
2115 memcpy(&_this, window_SpeakInHouse, sizeof(_this));
|
|
2116 _this.uFrameX = 483;
|
|
2117 _this.uFrameWidth = 148;
|
|
2118 _this.uFrameZ = 334;
|
|
2119 *(int *)v13 = TargetColor(0xFFu, 0xFFu, 0xFFu);
|
|
2120 *(int *)v14 = TargetColor(0xFFu, 0xFFu, 0x9Bu);
|
|
2121 sprintf(pTmpBuf.data(), "%s: %d", pGlobalTXT_LocalizationStrings[25], pParty->uNumGoldInBank);
|
|
2122 _this.DrawTitleText(pFontArrus, 0, 0xDCu, v14[0], pTmpBuf.data(), 3u);
|
|
2123 switch(dialog_menu_id)
|
|
2124 {
|
|
2125 case HOUSE_DIALOGUE_MAIN:
|
|
2126 {
|
|
2127 v8 = v14[0];
|
|
2128 if ( pDialogueWindow->pCurrentPosActiveItem != 2 )
|
|
2129 v8 = v13[0];
|
|
2130 _this.DrawTitleText(pFontArrus, 0, 0x92u, v8, pGlobalTXT_LocalizationStrings[60], 3u);
|
|
2131 v9 = v14[0];
|
|
2132 if ( pDialogueWindow->pCurrentPosActiveItem != 3 )
|
|
2133 v9 = v13[0];
|
|
2134 _this.DrawTitleText(pFontArrus, 0, 0xB0u, v9, pGlobalTXT_LocalizationStrings[244], 3u);
|
|
2135 break;
|
|
2136 }
|
|
2137 case HOUSE_DIALOGUE_BANK_7:
|
|
2138 {
|
|
2139 v0 = window_SpeakInHouse;
|
|
2140 if ( window_SpeakInHouse->receives_keyboard_input_2 != WINDOW_INPUT_IN_PROGRESS)
|
|
2141 {
|
|
2142 if ( window_SpeakInHouse->receives_keyboard_input_2 == WINDOW_INPUT_CONFIRMED)
|
|
2143 {
|
|
2144 v6 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer);
|
|
2145 v7 = v6;
|
|
2146 if ( !v6 )
|
|
2147 {
|
|
2148 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
|
|
2149 return;
|
|
2150 }
|
|
2151 if ( v6 > pParty->uNumGold )
|
|
2152 {
|
|
2153 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
|
|
2154 v7 = pParty->uNumGold;
|
|
2155 }
|
|
2156 if ( v7 )
|
|
2157 {
|
|
2158 Party::TakeGold(v7);
|
|
2159 pParty->uNumGoldInBank += v7;
|
|
2160 if ( uActiveCharacter )
|
|
2161 pPlayers[uActiveCharacter]->PlaySound(SPEECH_81, 0);
|
|
2162 }
|
|
2163 v0 = window_SpeakInHouse;
|
|
2164 v0->receives_keyboard_input_2 = WINDOW_INPUT_NONE;
|
|
2165 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
|
|
2166 return;
|
|
2167 }
|
|
2168 if (window_SpeakInHouse->receives_keyboard_input_2 != WINDOW_INPUT_CANCELLED)
|
|
2169 return;
|
|
2170 v0->receives_keyboard_input_2 = WINDOW_INPUT_NONE;
|
|
2171 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
|
|
2172 return;
|
|
2173 }
|
|
2174 v11 = pGlobalTXT_LocalizationStrings[112];
|
|
2175 v10 = pGlobalTXT_LocalizationStrings[60];
|
|
2176 sprintf(pTmpBuf.data(), "%s\n%s", v10, v11);
|
|
2177 _this.DrawTitleText(pFontArrus, 0, 0x92u, v14[0], pTmpBuf.data(), 3u);
|
|
2178 _this.DrawTitleText(pFontArrus, 0, 0xBAu, v13[0], (const char *)pKeyActionMap->pPressedKeysBuffer, 3u);
|
|
2179 v4 = pFontArrus;
|
|
2180 v5 = pFontArrus->GetLineWidth((const char *)pKeyActionMap->pPressedKeysBuffer);
|
|
2181 _this.DrawFlashingInputCursor(v5 / 2 + 80, 185, v4);
|
|
2182 break;
|
|
2183 }
|
|
2184
|
|
2185 case HOUSE_DIALOGUE_BANK_8:
|
|
2186 {
|
|
2187 v0 = window_SpeakInHouse;
|
|
2188 if ( window_SpeakInHouse->receives_keyboard_input_2 != WINDOW_INPUT_IN_PROGRESS)
|
|
2189 {
|
|
2190 if ( window_SpeakInHouse->receives_keyboard_input_2 == WINDOW_INPUT_CONFIRMED)
|
|
2191 {
|
|
2192 window_SpeakInHouse->receives_keyboard_input_2 = WINDOW_INPUT_NONE;
|
|
2193 v2 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer);
|
|
2194 v3 = v2;
|
|
2195 if ( v2 )
|
|
2196 {
|
|
2197 if ( v2 > pParty->uNumGoldInBank )
|
|
2198 {
|
|
2199 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
|
|
2200 v3 = pParty->uNumGoldInBank;
|
|
2201 }
|
|
2202 if ( v3 )
|
|
2203 {
|
|
2204 Party::SetGold(pParty->uNumGold + v3);
|
|
2205 pParty->uNumGoldInBank -= v3;
|
|
2206 }
|
|
2207 }
|
|
2208 v0->receives_keyboard_input_2 = WINDOW_INPUT_NONE;
|
|
2209 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
|
|
2210 return;
|
|
2211 }
|
|
2212 if ( window_SpeakInHouse->receives_keyboard_input_2 != WINDOW_INPUT_CANCELLED)
|
|
2213 return;
|
|
2214 v0->receives_keyboard_input_2 = WINDOW_INPUT_NONE;
|
|
2215 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
|
|
2216 return;
|
|
2217 }
|
|
2218 v11 = pGlobalTXT_LocalizationStrings[112];
|
|
2219 v10 = pGlobalTXT_LocalizationStrings[244];
|
|
2220 sprintfex(pTmpBuf.data(), "%s\n%s", v10, v11);
|
|
2221 _this.DrawTitleText(pFontArrus, 0, 0x92u, v14[0], pTmpBuf.data(), 3u);
|
|
2222 _this.DrawTitleText(pFontArrus, 0, 0xBAu, v13[0], (const char *)pKeyActionMap->pPressedKeysBuffer, 3u);
|
|
2223 v4 = pFontArrus;
|
|
2224 v5 = pFontArrus->GetLineWidth((const char *)pKeyActionMap->pPressedKeysBuffer);
|
|
2225 _this.DrawFlashingInputCursor(v5 / 2 + 80, 185, v4);
|
|
2226 return;
|
|
2227 break;
|
|
2228 }
|
|
2229
|
|
2230 default:
|
|
2231 {
|
|
2232 break;
|
|
2233 }
|
|
2234 }
|
|
2235 }
|
|
2236 // F8B19C: using guessed type int dword_F8B19C;
|
|
2237
|
|
2238 //----- (004B8285) --------------------------------------------------------
|
|
2239 void __cdecl TavernDialog()
|
|
2240 {
|
|
2241 int v0;
|
|
2242 int pItemNum;
|
|
2243 double v2; // st7@1
|
|
2244 signed int v3; // ebx@1
|
|
2245 int v4; // ecx@1
|
|
2246 int v5; // esi@3
|
|
2247 signed int v6; // edi@5
|
|
2248 int v7; // ecx@5
|
|
2249 int pNumString; // edi@16
|
|
2250 signed int v9; // esi@16
|
|
2251 unsigned int pNumActiveItem; // esi@18
|
|
2252 int v11; // eax@18
|
|
2253 unsigned int v12; // eax@19
|
|
2254 int v13; // eax@21
|
|
2255 int v14; // ecx@26
|
|
2256 //GUIButton *v15; // eax@28
|
|
2257 //GUIButton *v16; // esi@28
|
|
2258 int v17; // eax@28
|
|
2259 char *v18; // eax@30
|
|
2260 int v19; // eax@30
|
|
2261 unsigned int v20; // ecx@30
|
|
2262 int v21; // edx@30
|
|
2263 int v22; // eax@30
|
|
2264 unsigned __int16 v23; // ax@30
|
|
2265 int v24; // eax@34
|
|
2266 int v25; // eax@34
|
|
2267 char *v26; // esi@36
|
|
2268 int v27; // edi@46
|
|
2269 unsigned int pColorText; // eax@57
|
|
2270 signed int v31; // eax@59
|
|
2271 //GUIWindow *v33; // edi@64
|
|
2272 int v34; // eax@64
|
|
2273 int v35; // ecx@64
|
|
2274 int v36; // esi@64
|
|
2275 char v37; // sf@64
|
|
2276 GUIButton *pButton; // eax@65
|
|
2277 int v39; // edx@69
|
|
2278 int v40; // ecx@69
|
|
2279 int v41; // ecx@69
|
|
2280 int v42; // ecx@70
|
|
2281 unsigned int v43; // edx@70
|
|
2282 int v44; // edx@71
|
|
2283 int v45; // ecx@71
|
|
2284 int v46; // ecx@72
|
|
2285 int v47; // eax@74
|
|
2286 signed int v48; // edi@77
|
|
2287 signed int i; // esi@79
|
|
2288 int v50; // eax@80
|
|
2289 //GUIWindow *v51; // ecx@81
|
|
2290 _QWORD v52; // qax@81
|
|
2291 signed int v53; // edi@81
|
|
2292 int v54; // edi@81
|
|
2293 //GUIButton *v55; // esi@83
|
|
2294 const char **v56; // eax@83
|
|
2295 int v57; // eax@83
|
|
2296 unsigned int v58; // ecx@83
|
|
2297 //Player *v59; // edx@83
|
|
2298 unsigned __int16 v60; // ax@83
|
|
2299 int v61; // eax@99
|
|
2300 char *v63; // eax@99
|
|
2301 GUIFont *v64; // edx@99
|
|
2302 GUIFont *v65; // edi@100
|
|
2303 unsigned int v66; // [sp-10h] [bp-284h]@75
|
|
2304 unsigned __int16 v67; // [sp-Ch] [bp-280h]@75
|
|
2305 int v68; // [sp-Ch] [bp-280h]@99
|
|
2306 char *v69; // [sp-8h] [bp-27Ch]@75
|
|
2307 int v70; // [sp-8h] [bp-27Ch]@99
|
|
2308 unsigned int v71; // [sp-4h] [bp-278h]@75
|
|
2309 const char *v72; // [sp-4h] [bp-278h]@93
|
|
2310 unsigned int v73; // [sp-4h] [bp-278h]@99
|
|
2311 char pTopic1[100]; // [sp+Ch] [bp-268h]@55
|
|
2312 char pTopic4[100]; // [sp+70h] [bp-204h]@59
|
|
2313 char pTopic2[100]; // [sp+D4h] [bp-1A0h]@57
|
|
2314 char pTopic3[100]; // [sp+138h] [bp-13Ch]@59
|
|
2315 //GUIWindow v78; // [sp+19Ch] [bp-D8h]@99
|
|
2316 GUIWindow dialog_window; // [sp+1F0h] [bp-84h]@1
|
|
2317 char *Str[2]; // [sp+244h] [bp-30h]@30
|
|
2318 unsigned int pColorWhite; // [sp+24Ch] [bp-28h]@1
|
|
2319 unsigned __int8 pTopic3Height; // [sp+253h] [bp-21h]@59
|
|
2320 int v83; // [sp+254h] [bp-20h]@1
|
|
2321 int pColorYellow; // [sp+258h] [bp-1Ch]@1
|
|
2322 Player *pPlayer; // [sp+25Ch] [bp-18h]@1
|
|
2323 int all_text_height; // [sp+260h] [bp-14h]@18
|
|
2324 unsigned __int8 v87; // [sp+266h] [bp-Eh]@59
|
|
2325 unsigned __int8 pTopic2Height; // [sp+267h] [bp-Dh]@57
|
|
2326 int v89; // [sp+268h] [bp-Ch]@1
|
|
2327 unsigned int pTopic1Height; // [sp+26Fh] [bp-5h]@55
|
|
2328 int v91; // [sp+270h] [bp-4h]@3
|
|
2329 GUIFont *pOutString;
|
|
2330 unsigned __int8 pTopic4Height;
|
|
2331 int pTextHeight;
|
|
2332
|
|
2333 pPlayer = pPlayers[uActiveCharacter];
|
|
2334 memcpy(&dialog_window, window_SpeakInHouse, sizeof(dialog_window));
|
|
2335 dialog_window.uFrameX = 483;
|
|
2336 dialog_window.uFrameWidth = 148;
|
|
2337 dialog_window.uFrameZ = 334;
|
|
2338 pColorWhite = TargetColor(0xFFu, 0xFFu, 0xFFu);
|
|
2339 pColorYellow = TargetColor(0xFFu, 0xFFu, 0x9Bu);
|
|
2340 v2 = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier;
|
|
2341 *(float *)&v83 = v2;
|
|
2342 *(float *)&v89 = v2 * v2;
|
|
2343 v3 = (signed __int64)(*(float *)&v89 * 0.1);
|
|
2344 pItemNum = v3 * (100 - pPlayer->GetMerchant()) / 100;
|
|
2345 if ( pItemNum < v3 / 3 )
|
|
2346 pItemNum = v3 / 3;
|
|
2347 v5 = 1;
|
|
2348 pOutString = (GUIFont *)pItemNum;
|
|
2349 if ( pItemNum <= 0 )
|
|
2350 pOutString = (GUIFont *)1;
|
|
2351 v6 = (signed __int64)(*(float *)&v89 * *(float *)&v83 * 0.0099999998);
|
|
2352 v7 = v6 * (100 - pPlayer->GetMerchant()) / 100;
|
|
2353 if ( v7 < v6 / 3 )
|
|
2354 v7 = v6 / 3;
|
|
2355 v83 = v7;
|
|
2356 if ( v7 <= 0 )
|
|
2357 {
|
|
2358 v7 = 1;
|
|
2359 v83 = 1;
|
|
2360 }
|
|
2361
|
|
2362 switch(dialog_menu_id)
|
|
2363 {
|
|
2364 case HOUSE_DIALOGUE_MAIN:
|
|
2365 {
|
|
2366 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
|
|
2367 return;
|
|
2368
|
|
2369 sprintf(pTopic1, "\f%05d", pDialogueWindow->pCurrentPosActiveItem == 2 ? pColorYellow : pColorWhite);
|
|
2370 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[178], pOutString); // Rent room for %d gold
|
|
2371 strcat(pTopic1, pTmpBuf2.data());
|
|
2372 pTopic1Height = pFontArrus->CalcTextHeight(pTopic1, &dialog_window, 0, 0);
|
|
2373 strcat(pTopic1, "\n \n");
|
|
2374
|
|
2375 sprintf(pTopic2, "\f%05d", pDialogueWindow->pCurrentPosActiveItem == 3 ? pColorYellow : pColorWhite);
|
|
2376 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[86], // Buy food for %d days for %d gold
|
|
2377 (unsigned int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier, v83);
|
|
2378 strcat(pTopic2, pTmpBuf2.data());
|
|
2379 pTopic2Height = pFontArrus->CalcTextHeight(pTopic2, &dialog_window, 0, 0);
|
|
2380 strcat(pTopic2, "\n \n");
|
|
2381
|
|
2382 sprintf(pTopic3, "\f%05d", pDialogueWindow->pCurrentPosActiveItem == 4 ? pColorYellow : pColorWhite);
|
|
2383 strcat(pTopic3, pGlobalTXT_LocalizationStrings[160]); // Learn Skills
|
|
2384 pTopic3Height = pFontArrus->CalcTextHeight(pTopic3, &dialog_window, 0, 0);
|
|
2385 strcat(pTopic3, "\n \n");
|
|
2386 pTopic4[0] = 0;
|
|
2387 if ( (signed int)window_SpeakInHouse->par1C >= 108 && (signed int)window_SpeakInHouse->par1C <= 120 )
|
|
2388 {
|
|
2389 sprintf(pTopic4, "\f%05d", pDialogueWindow->pCurrentPosActiveItem == 5 ? pColorYellow : pColorWhite);
|
|
2390 strcat(pTopic4, pGlobalTXT_LocalizationStrings[611]); // Play Arcomage
|
|
2391 pTopic4Height = pFontArrus->CalcTextHeight(pTopic4, &dialog_window, 0, 0);
|
|
2392 }
|
|
2393 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
|
|
2394 v36 = LOBYTE(pFontArrus->uFontHeight) - 3;
|
|
2395 v37 = -pDialogueWindow->pNumPresenceButton < 0;
|
|
2396 if ( !(v37 ^ (pNumActiveItem < pNumActiveItem + pDialogueWindow->pNumPresenceButton)) )
|
|
2397 {
|
|
2398 do
|
|
2399 {
|
|
2400 pButton = pDialogueWindow->GetControl(pNumActiveItem);
|
|
2401 if ( pButton->msg_param == 15 )
|
|
2402 {
|
|
2403 v46 = pTopic1Height;
|
|
2404 pButton->uHeight = pTopic1Height;
|
|
2405 pButton->uY = 146;
|
|
2406 v41 = v46 + 145;
|
|
2407 pButton->uW = v41;
|
|
2408 }
|
|
2409 else if ( pButton->msg_param == 16 )
|
|
2410 {
|
|
2411 v44 = pTopic2Height;
|
|
2412 v45 = pTopic1Height + v36 + 146;
|
|
2413 pButton->uHeight = pTopic2Height;
|
|
2414 pButton->uY = v45;
|
|
2415 v41 = v45 + v44 - 1;
|
|
2416 pButton->uW = v41;
|
|
2417 }
|
|
2418 else if ( pButton->msg_param == 96 )
|
|
2419 {
|
|
2420 v42 = pTopic1Height + pTopic2Height + 2 * v36 + 146;
|
|
2421 v43 = pTopic3Height;
|
|
2422 pButton->uY = v42;
|
|
2423 pButton->uHeight = v43;
|
|
2424 v41 = v43 + v42 - 1;
|
|
2425 pButton->uW = v41;
|
|
2426 }
|
|
2427 else if ( pButton->msg_param == 101 )
|
|
2428 {
|
|
2429 v39 = pTopic1Height + 3 * v36 + pTopic4Height + pTopic2Height + 146;
|
|
2430 v40 = pTopic4Height;
|
|
2431 pButton->uHeight = pTopic4Height;
|
|
2432 pButton->uY = v39;
|
|
2433 v41 = v39 + v40 - 1;
|
|
2434 pButton->uW = v41;
|
|
2435 }
|
|
2436 pNumActiveItem++;
|
|
2437 if ( pNumActiveItem >= pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem )
|
|
2438 {
|
|
2439 sprintfex(pTmpBuf.data(), "%s%s%s%s", &pTopic1, &pTopic2, &pTopic3, &pTopic4);
|
|
2440 dialog_window.DrawTitleText(pFontArrus, 0, 146, 0, pTmpBuf.data(), 3);
|
|
2441 }
|
|
2442 }
|
|
2443 while ( pNumActiveItem < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton );
|
|
2444 }
|
|
2445 break;
|
|
2446 }
|
|
2447 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RULES:
|
|
2448 {
|
|
2449 pOutString = pFontArrus;
|
|
2450 strcpy(pTmpBuf.data(), pNPCTopics[354].pText);
|
|
2451 dialog_window.uFrameWidth = game_viewport_width;
|
|
2452 dialog_window.uFrameZ = 452;
|
|
2453 pTextHeight = pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 12, 0) + 7;
|
|
2454 if ( 352 - pTextHeight < 8 )
|
|
2455 {
|
|
2456 pOutString = pFontCreate;
|
|
2457 pTextHeight = pFontCreate->CalcTextHeight(pTmpBuf.data(), &dialog_window, 12, 0) + 7;
|
|
2458 }
|
|
2459 auto pTex = pIcons_LOD->GetTexture(uTextureID_Leather);
|
|
2460 pRenderer->_4A6A68(8, 352 - pTextHeight, pTex, pTex->uTextureHeight - pTextHeight);
|
|
2461 pRenderer->DrawTextureIndexed(8, 347 - pTextHeight, pTexture_591428);
|
|
2462 v63 = FitTextInAWindow(pTmpBuf.data(), pOutString, &dialog_window, 0xCu, 0);
|
|
2463 window_SpeakInHouse->DrawText(pOutString, 12, 354 - pTextHeight, 0, v63, 0, 0, 0);
|
|
2464 break;
|
|
2465 }
|
|
2466 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_VICTORY_CONDITIONS:
|
|
2467 {
|
|
2468 strcpy(pTmpBuf.data(), pNPCTopics[(uint)window_SpeakInHouse->ptr_1C + 247].pText);
|
|
2469 dialog_window.uFrameWidth = game_viewport_width;
|
|
2470 dialog_window.uFrameZ = 452;
|
|
2471 v61 = pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 12, 0);
|
|
2472 pTextHeight = v61 + 7;
|
|
2473 auto pTex = pIcons_LOD->GetTexture(uTextureID_Leather);
|
|
2474 pRenderer->_4A6A68(8, 352 - (v61 + 7), pTex, pTex->uTextureHeight - (v61 + 7));
|
|
2475 pRenderer->DrawTextureIndexed(8, 347 - pTextHeight, pTexture_591428);
|
|
2476 v63 = FitTextInAWindow(pTmpBuf.data(), pFontArrus, &dialog_window, 0xCu, 0);
|
|
2477 window_SpeakInHouse->DrawText(pFontArrus, 12, 354 - pTextHeight, 0, v63, 0, 0, 0);
|
|
2478 break;
|
|
2479 }
|
|
2480 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RESULT:
|
|
2481 {
|
|
2482 if ( pArcomageGame->bGameInProgress == 1 )
|
|
2483 return;
|
|
2484 if ( pArcomageGame->uGameResult )
|
|
2485 {
|
|
2486 if ( pArcomageGame->uGameResult == 1 )
|
|
2487 v72 = pGlobalTXT_LocalizationStrings[640];// You won!
|
|
2488 else
|
|
2489 v72 = pGlobalTXT_LocalizationStrings[641];// You lost!
|
|
2490 }
|
|
2491 else
|
|
2492 {
|
|
2493 v72 = pGlobalTXT_LocalizationStrings[639];// A tie!
|
|
2494 }
|
|
2495 strcpy(pTmpBuf.data(), v72);
|
|
2496 v66 = (174 - pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 0, 0)) / 2 + 138;
|
|
2497 dialog_window.DrawTitleText(pFontArrus, 0, v66, pColorYellow, pTmpBuf.data(), 3);
|
|
2498 break;
|
|
2499 }
|
|
2500 case HOUSE_DIALOGUE_TAVERN_REST:
|
|
2501 {
|
|
2502 if ( pParty->uNumGold >= (unsigned int)pOutString )
|
|
2503 {
|
|
2504 Party::TakeGold((unsigned int)pOutString);
|
|
2505 v27 = (int)window_SpeakInHouse->ptr_1C;//107
|
|
2506 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
|
|
2507 dialog_menu_id = HOUSE_DIALOGUE_NULL;
|
|
2508 sub_4BD8B5();
|
|
2509 sub_4B1D27();
|
|
2510 pVideoPlayer->Unload();
|
|
2511 window_SpeakInHouse->Release();
|
|
2512 window_SpeakInHouse = 0;
|
|
2513 if ( pMessageQueue_50CBD0->uNumMessages )
|
|
2514 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
|
|
2515 pMessageQueue_50CBD0->pMessages[0].eType = UIMSG_RentRoom;
|
|
2516 pMessageQueue_50CBD0->pMessages[0].param = v27;
|
|
2517 pMessageQueue_50CBD0->pMessages[0].field_8 = 1;
|
|
2518 ++pMessageQueue_50CBD0->uNumMessages;
|
|
2519 return;
|
|
2520 }
|
|
2521 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2);
|
|
2522 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_Goodbye);
|
|
2523 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, v5, 0);
|
|
2524 break;
|
|
2525 }
|
|
2526
|
|
2527 case HOUSE_DIALOGUE_LEARN_SKILLS:
|
|
2528 {
|
|
2529 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
|
|
2530 return;
|
|
2531 v0 = 0;
|
|
2532 v9 = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0);
|
|
2533 pItemNum = v9 * (100 - pPlayer->GetMerchant()) / 100;
|
|
2534 if ( pItemNum < v9 / 3 )
|
|
2535 pItemNum = v9 / 3;
|
|
2536 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
|
|
2537 all_text_height = 0;
|
|
2538 if ( pNumActiveItem < pNumActiveItem + pDialogueWindow->pNumPresenceButton )
|
|
2539 {
|
|
2540 do
|
|
2541 {
|
|
2542 v12 = pDialogueWindow->GetControl(pNumActiveItem)->msg_param - 36;
|
|
2543 if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayer->classType][v12] && !pPlayer->pActiveSkills[v12] )
|
|
2544 {
|
|
2545 all_text_height = pFontArrus->CalcTextHeight(pSkillNames[v12], &dialog_window, 0, 0);
|
|
2546 v0++;
|
|
2547 }
|
|
2548 ++pNumActiveItem;
|
|
2549 }
|
|
2550 while ( pNumActiveItem < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton );
|
|
2551 if ( v0 )
|
|
2552 {
|
|
2553 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], pItemNum);
|
|
2554 dialog_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3);
|
|
2555 v91 = (149 - all_text_height) / v0;
|
|
2556 if ( (149 - all_text_height) / v0 > 32 )
|
|
2557 v91 = 32;
|
|
2558 v14 = (149 - v0 * v91 - all_text_height) / 2 - v91 / 2 + 162;
|
|
2559 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
|
|
2560 if ( pNumActiveItem < pNumActiveItem + pDialogueWindow->pNumPresenceButton )
|
|
2561 {
|
|
2562 pItemNum = 2;
|
|
2563 do
|
|
2564 {
|
|
2565 pButton = pDialogueWindow->GetControl(pItemNum);
|
|
2566 v17 = pButton->msg_param - 36;
|
|
2567 if ( !byte_4ED970_skill_learn_ability_by_class_table[pPlayer->classType][v17] || pPlayer->pActiveSkills[v17] )
|
|
2568 {
|
|
2569 pButton->uW = 0;
|
|
2570 pButton->uHeight = 0;
|
|
2571 pButton->uY = 0;
|
|
2572 }
|
|
2573 else
|
|
2574 {
|
|
2575 pButton->uY = v91 + v14;
|
|
2576 pTextHeight = pFontArrus->CalcTextHeight(pSkillNames[v17], &dialog_window, 0, 0);
|
|
2577 pButton->uHeight = pTextHeight;
|
|
2578 v14 = pTextHeight + pButton->uY - 1;
|
|
2579 pButton->uW = v14;
|
|
2580 pColorText = pColorYellow;
|
|
2581 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum )
|
|
2582 pColorText = pColorWhite;
|
|
2583 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, pSkillNames[v17], 3);
|
|
2584 }
|
|
2585 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton;
|
|
2586 pItemNum++;
|
|
2587 }
|
|
2588 while ( pItemNum < pNumActiveItem );
|
|
2589 }
|
|
2590 return;
|
|
2591 }
|
|
2592 }
|
|
2593 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayer->pName, pClassNames[pPlayer->classType]);
|
|
2594 strcat(pTmpBuf.data(), "\n \n");
|
|
2595 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);
|
|
2596 pTextHeight = (174 - pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 0, 0)) / 2 + 138;
|
|
2597 dialog_window.DrawTitleText(pFontArrus, 0, pTextHeight, pColorYellow, pTmpBuf.data(), 3);
|
|
2598 return;
|
|
2599 }
|
|
2600
|
|
2601 case HOUSE_DIALOGUE_TAVERN_BUY_FOOD:
|
|
2602 {
|
|
2603 *(_QWORD *)Str = pParty->uNumFoodRations;
|
|
2604 //if ( (double)pParty->uNumFoodRations >= p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C] )
|
|
2605 if ( (double)pParty->uNumFoodRations >= p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier )
|
|
2606 {
|
|
2607 ShowStatusBarString(pGlobalTXT_LocalizationStrings[140], 2);
|
|
2608 if ( uActiveCharacter )
|
|
2609 pPlayers[uActiveCharacter]->PlaySound(SPEECH_67, 0);
|
|
2610 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, v5, 0);
|
|
2611 return;
|
|
2612 }
|
|
2613 if ( pParty->uNumGold >= v7 )
|
|
2614 {
|
|
2615 Party::TakeGold(v7);
|
|
2616 //pParty->uNumFoodRations = (signed __int64)p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C];
|
|
2617 pParty->uNumFoodRations = (signed __int64)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier;
|
|
2618 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_Greeting_2);
|
|
2619 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
|
|
2620 return;
|
|
2621 }
|
|
2622 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2); // "You don't have enough gold"
|
|
2623 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_Goodbye);
|
|
2624 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, v5, 0);
|
|
2625 break;
|
|
2626 }
|
|
2627
|
|
2628 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_MAIN:
|
|
2629 {
|
|
2630 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
|
|
2631 {
|
|
2632 v48 = 2;
|
|
2633 pShopOptions[0] = pGlobalTXT_LocalizationStrings[620];
|
|
2634 pShopOptions[1] = pGlobalTXT_LocalizationStrings[622];
|
|
2635 pOutString = 0;
|
|
2636 if ( pParty->HasItem(0x28Bu) )
|
|
2637 {
|
|
2638 pShopOptions[2] = pGlobalTXT_LocalizationStrings[621];
|
|
2639 v48 = 3;
|
|
2640 }
|
|
2641 for ( i = 0; i < v48; ++i )
|
|
2642 all_text_height = pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0);
|
|
2643 all_text_height = (174 - all_text_height) / v48;
|
|
2644 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
|
|
2645 v54 = (174 - v48 * (174 - all_text_height) / v48 - all_text_height) / 2 - (174 - all_text_height) / v48 / 2 + 138;
|
|
2646 v37 = -pDialogueWindow->pNumPresenceButton < 0;
|
|
2647 if ( pNumActiveItem < pNumActiveItem + pDialogueWindow->pNumPresenceButton )
|
|
2648 {
|
|
2649 pItemNum = 2;
|
|
2650 pNumString = 0;
|
|
2651 do
|
|
2652 {
|
|
2653 pButton = pDialogueWindow->GetControl(pItemNum);
|
|
2654 pButton->uY = all_text_height + v54;
|
|
2655 pTextHeight = pFontArrus->CalcTextHeight((const char *)pShopOptions[pNumString], &dialog_window, 0, 0);
|
|
2656 pButton->uHeight = pTextHeight;
|
|
2657 v54 = pButton->uY + pTextHeight - 1;
|
|
2658 pButton->uW = v54;
|
|
2659 pColorText = pColorYellow;
|
|
2660 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum )
|
|
2661 pColorText = pColorWhite;
|
|
2662 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, (const char *)pShopOptions[pNumString], 3);
|
|
2663 pItemNum++;
|
|
2664 ++pNumString;
|
|
2665 pNumActiveItem = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem;
|
|
2666 }
|
|
2667 while ( pItemNum < pNumActiveItem );
|
|
2668 }
|
|
2669 }
|
|
2670 break;
|
|
2671 }
|
|
2672 default:
|
|
2673 {
|
|
2674 break;
|
|
2675 }
|
|
2676 }
|
|
2677 }
|
|
2678
|
|
2679 //----- (004B705E) --------------------------------------------------------
|
|
2680 void TempleDialog()
|
|
2681 {
|
|
2682 GUIWindow *v0; // ebx@1
|
|
2683 Player *v1; // esi@1
|
|
2684 int v2; // edi@1
|
|
2685 int result; // eax@4
|
|
2686 GUIWindow *v4; // edi@6
|
|
2687 void *v5; // eax@6
|
|
2688 int v6; // eax@6
|
|
2689 unsigned int v7; // eax@8
|
|
2690 int v8; // ecx@8
|
|
2691 unsigned int v9; // eax@9
|
|
2692 int v10; // eax@11
|
|
2693 int v11; // eax@12
|
|
2694 GUIWindow *v12; // ecx@16
|
|
2695 int v13; // edx@16
|
|
2696 GUIButton *v14; // eax@19
|
|
2697 GUIButton *v15; // edi@19
|
|
2698 int v16; // eax@19
|
|
2699 const char *v17; // eax@21
|
|
2700 int v18; // eax@21
|
|
2701 unsigned int v19; // ecx@21
|
|
2702 int v20; // eax@21
|
|
2703 unsigned __int16 v21; // ax@21
|
|
2704 unsigned __int16 v22; // ST14_2@27
|
|
2705 int v23; // eax@27
|
|
2706 double v24; // st7@28
|
|
2707 unsigned int v25; // ebx@28
|
|
2708 DDM_DLV_Header *v26; // edi@29
|
|
2709 int v27; // eax@31
|
|
2710 int v28; // eax@32
|
|
2711 //unsigned int v29; // ecx@34
|
|
2712 unsigned int v30; // edx@36
|
|
2713 unsigned int v31; // edx@38
|
|
2714 unsigned int v32; // edx@40
|
|
2715 unsigned int v33; // edx@42
|
|
2716 unsigned int v34; // edx@44
|
|
2717 int v35; // edi@50
|
|
2718 signed int v36; // eax@50
|
|
2719 unsigned __int8 v37; // al@54
|
|
2720 int v38; // ecx@54
|
|
2721 GUIWindow *v39; // eax@56
|
|
2722 unsigned __int8 v40; // al@61
|
|
2723 GUIButton *v41; // edi@64
|
|
2724 int v42; // esi@66
|
|
2725 GUIWindow *v43; // ecx@66
|
|
2726 int v44; // edi@66
|
|
2727 int v45; // eax@68
|
|
2728 signed int v46; // edi@69
|
|
2729 int v47; // edi@71
|
|
2730 GUIButton *v48; // eax@73
|
|
2731 const char *v49; // edx@73
|
|
2732 GUIButton *v50; // esi@73
|
|
2733 int v51; // eax@73
|
|
2734 unsigned int v52; // ecx@73
|
|
2735 unsigned __int16 v53; // ax@73
|
|
2736 char a1[300]; // [sp+10h] [bp-1B4h]@64
|
|
2737 GUIWindow v57; // [sp+13Ch] [bp-88h]@1
|
|
2738 __int64 v58; // [sp+190h] [bp-34h]@1
|
|
2739 __int64 v59; // [sp+198h] [bp-2Ch]@1
|
|
2740 __int64 v60; // [sp+1A0h] [bp-24h]@1
|
|
2741 GUIWindow *v61; // [sp+1ACh] [bp-18h]@6
|
|
2742 unsigned int v62; // [sp+1B0h] [bp-14h]@8
|
|
2743 unsigned __int8 v63; // [sp+1B7h] [bp-Dh]@64
|
|
2744 int v64; // [sp+1B8h] [bp-Ch]@6
|
|
2745 unsigned int v65; // [sp+1BCh] [bp-8h]@6
|
|
2746 DDM_DLV_Header *v66; // [sp+1C0h] [bp-4h]@6
|
|
2747
|
|
2748 v0 = window_SpeakInHouse;
|
|
2749 memcpy(&v57, window_SpeakInHouse, sizeof(v57));
|
|
2750 v57.uFrameX = 483;
|
|
2751 v57.uFrameWidth = 148;
|
|
2752 v57.uFrameZ = 334;
|
|
2753 HIDWORD(v58) = TargetColor(0xFFu, 0xFFu, 0xFFu);
|
|
2754 HIDWORD(v59) = TargetColor(0xFFu, 0xFFu, 0x9Bu);
|
|
2755 v1 = pPlayers[uActiveCharacter];
|
|
2756 //v2 = pPlayers[uActiveCharacter]->_4B807C(p2DEvents_minus1__20[13 * (unsigned int)v0->ptr_1C]);
|
|
2757 v2 = pPlayers[uActiveCharacter]->GetTempleHealCostModifier(p2DEvents[v0->par1C - 1].fPriceMultiplier);
|
|
2758 HIDWORD(v60) = v2;
|
|
2759 if ( dialog_menu_id != HOUSE_DIALOGUE_MAIN )
|
|
2760 {
|
|
2761 if ( dialog_menu_id != HOUSE_DIALOGUE_TEMPLE_HEAL )
|
|
2762 {
|
|
2763 if ( dialog_menu_id != HOUSE_DIALOGUE_TEMPLE_DONATE )
|
|
2764 {
|
|
2765 if ( dialog_menu_id == HOUSE_DIALOGUE_LEARN_SKILLS )
|
|
2766 {
|
|
2767 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
|
|
2768 {
|
|
2769 v4 = pDialogueWindow;
|
|
2770 v61 = pDialogueWindow;
|
|
2771 v5 = window_SpeakInHouse->ptr_1C;
|
|
2772 v66 = 0;
|
|
2773 //v65 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (signed int)v5] * 500.0);
|
|
2774 v65 = (signed __int64)(p2DEvents[(signed int)v5 - 1].flt_24 * 500.0);
|
|
2775 v6 = v1->GetMerchant();
|
|
2776 v64 = (signed int)(v65 * (100 - v6)) / 100;
|
|
2777 if ( v64 < (signed int)v65 / 3 )
|
|
2778 v64 = (signed int)v65 / 3;
|
|
2779 v7 = v4->pStartingPosActiveItem;
|
|
2780 v8 = v7 + v4->pNumPresenceButton;
|
|
2781 v65 = 0;
|
|
2782 v62 = v7;
|
|
2783 if ( (signed int)v7 >= v8 )
|
|
2784 goto LABEL_78;
|
|
2785 do
|
|
2786 {
|
|
2787 v9 = v4->GetControl(v62)->msg_param - 36;
|
|
2788 if ( byte_4ED970_skill_learn_ability_by_class_table[v1->classType][v9] && !v1->pActiveSkills[v9] )
|
|
2789 {
|
|
2790 v10 = pFontArrus->CalcTextHeight(pSkillNames[v9], &v57, 0, 0);
|
|
2791 v66 = (DDM_DLV_Header *)((char *)v66 + v10);
|
|
2792 ++v65;
|
|
2793 }
|
|
2794 v11 = v4->pStartingPosActiveItem;
|
|
2795 ++v62;
|
|
2796 }
|
|
2797 while ( (signed int)v62 < v4->pNumPresenceButton + v11 );
|
|
2798 if ( v65 )
|
|
2799 {
|
|
2800 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], v64);
|
|
2801 v57.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3u);
|
|
2802 v64 = (149 - (signed int)v66) / (signed int)v65;
|
|
2803 if ( v64 > 32 )
|
|
2804 v64 = 32;
|
|
2805 v65 = (signed int)(149 - v65 * v64 - (int)v66) / 2 - v64 / 2 + 162;
|
|
2806 v12 = v61;
|
|
2807 result = v61->pStartingPosActiveItem;
|
|
2808 v13 = result + v61->pNumPresenceButton;
|
|
2809 v62 = v61->pStartingPosActiveItem;
|
|
2810 if ( result < v13 )
|
|
2811 {
|
|
2812 v66 = (DDM_DLV_Header *)2;
|
|
2813 while ( 1 )
|
|
2814 {
|
|
2815 v14 = v12->GetControl(v62);
|
|
2816 v15 = v14;
|
|
2817 v16 = v14->msg_param - 36;
|
|
2818 if ( !byte_4ED970_skill_learn_ability_by_class_table[v1->classType][v16] || v1->pActiveSkills[v16] )
|
|
2819 {
|
|
2820 v15->uW = 0;
|
|
2821 v15->uHeight = 0;
|
|
2822 v15->uY = 0;
|
|
2823 }
|
|
2824 else
|
|
2825 {
|
|
2826 v17 = pSkillNames[v16];
|
|
2827 v15->uY = v64 + v65;
|
|
2828 HIDWORD(v60) = (uint32)v17;
|
|
2829 v18 = pFontArrus->CalcTextHeight(v17, &v57, 0, 0);
|
|
2830 v19 = v15->uY;
|
|
2831 v15->uHeight = v18;
|
|
2832 v20 = v19 + v18 - 1;
|
|
2833 v15->uW = v20;
|
|
2834 v65 = v20;
|
|
2835 v21 = WORD2(v59);
|
|
2836 if ( (DDM_DLV_Header *)pDialogueWindow->pCurrentPosActiveItem != v66 )
|
|
2837 v21 = WORD2(v58);
|
|
2838 v57.DrawTitleText(pFontArrus, 0, v19, v21, (const char *)HIDWORD(v60), 3u);
|
|
2839 }
|
|
2840 result = (int)v61;
|
|
2841 ++v62;
|
|
2842 v66 = (DDM_DLV_Header *)((char *)v66 + 1);
|
|
2843 if ( (signed int)v62 >= v61->pNumPresenceButton + v61->pStartingPosActiveItem )
|
|
2844 break;
|
|
2845 v12 = v61;
|
|
2846 }
|
|
2847 }
|
|
2848 }
|
|
2849 else
|
|
2850 {
|
|
2851 LABEL_78:
|
|
2852 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], v1->pName, pClassNames[v1->classType]);
|
|
2853 strcat(pTmpBuf.data(), "\n \n");
|
|
2854 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);
|
|
2855 v22 = WORD2(v59);
|
|
2856 v23 = pFontArrus->CalcTextHeight(pTmpBuf.data(), &v57, 0, 0);
|
|
2857 v57.DrawTitleText(pFontArrus, 0, (174 - v23) / 2 + 138, v22, pTmpBuf.data(), 3u);
|
|
2858 }
|
|
2859 }
|
|
2860 }
|
|
2861 return;
|
|
2862 }
|
|
2863 // DONATION
|
|
2864 //v24 = p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C];
|
|
2865 v24 = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier;
|
|
2866 v25 = 0;
|
|
2867 if ( pParty->uNumGold >= (unsigned int)(signed __int64)v24 )
|
|
2868 {
|
|
2869 Party::TakeGold((signed __int64)v24);
|
|
2870 v26 = &pOutdoor->ddm;
|
|
2871 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor )
|
|
2872 v26 = &pIndoor->dlv;
|
|
2873 v27 = v26->uReputation;
|
|
2874 v66 = v26;
|
|
2875 if ( v27 > -5 )
|
|
2876 {
|
|
2877 v28 = v27 - 1;
|
|
2878 v26->uReputation = v28;
|
|
2879 if ( v28 < -5 )
|
|
2880 v26->uReputation = -5;
|
|
2881 }
|
|
2882 if ( (unsigned __int8)byte_F8B1EF[uActiveCharacter] == pParty->uDaysPlayed % 7 )
|
|
2883 {
|
|
2884 if ( v26->uReputation <= -5 )
|
|
2885 {
|
|
2886 v30 = pParty->uDaysPlayed % 7 + 1;
|
|
2887 LOBYTE(v30) = v30 | 0x80;
|
|
2888 _42777D_CastSpell_UseWand_ShootArrow(SPELL_AIR_WIZARD_EYE, uActiveCharacter - 1, v30, 48, 0);
|
|
2889 }
|
|
2890 if ( v26->uReputation <= -10 )
|
|
2891 {
|
|
2892 v31 = pParty->uDaysPlayed % 7 + 1;
|
|
2893 LOBYTE(v31) = v31 | 0x80;
|
|
2894 _42777D_CastSpell_UseWand_ShootArrow(SPELL_SPIRIT_PRESERVATION, uActiveCharacter - 1, v31, 48, 0);
|
|
2895 v26 = v66;
|
|
2896 }
|
|
2897 if ( v26->uReputation <= -15 )
|
|
2898 {
|
|
2899 v32 = pParty->uDaysPlayed % 7 + 1;
|
|
2900 LOBYTE(v32) = v32 | 0x80;
|
|
2901 _42777D_CastSpell_UseWand_ShootArrow(SPELL_BODY_PROTECTION_FROM_MAGIC, uActiveCharacter - 1, v32, 48, 0);
|
|
2902 v26 = v66;
|
|
2903 }
|
|
2904 if ( v26->uReputation <= -20 )
|
|
2905 {
|
|
2906 v33 = pParty->uDaysPlayed % 7 + 1;
|
|
2907 LOBYTE(v33) = v33 | 0x80;
|
|
2908 _42777D_CastSpell_UseWand_ShootArrow(SPELL_LIGHT_HOUR_OF_POWER, uActiveCharacter - 1, v33, 48, 0);
|
|
2909 v26 = v66;
|
|
2910 }
|
|
2911 if ( v26->uReputation <= -25 )
|
|
2912 {
|
|
2913 v34 = pParty->uDaysPlayed % 7 + 1;
|
|
2914 LOBYTE(v34) = v34 | 0x80;
|
|
2915 _42777D_CastSpell_UseWand_ShootArrow(SPELL_LIGHT_DAY_OF_PROTECTION, uActiveCharacter - 1, v34, 48, 0);
|
|
2916 }
|
|
2917 }
|
|
2918 ++byte_F8B1EF[uActiveCharacter];
|
|
2919 v1->PlaySound(SPEECH_83, 0);
|
|
2920 ShowStatusBarString(pGlobalTXT_LocalizationStrings[527], 2u); // "Thank You!"
|
|
2921 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, v25);
|
|
2922 return;
|
|
2923 }
|
|
2924 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
|
|
2925 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
|
|
2926 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, v25);
|
|
2927 return;
|
|
2928 }
|
|
2929 if ( !v1->IsPlayerHealableByTemple() )
|
|
2930 return;
|
|
2931 v25 = 0;
|
|
2932 if ( pParty->uNumGold < v2 )
|
|
2933 {
|
|
2934 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
|
|
2935 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
|
|
2936 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, v25);
|
|
2937 return;
|
|
2938 }
|
|
2939 Party::TakeGold(v2);
|
|
2940 v35 = LODWORD(v1->pConditions[17]);
|
|
2941 v59 = v1->pConditions[14];
|
|
2942 v58 = v1->pConditions[15];
|
|
2943 v60 = v1->pConditions[16];
|
|
2944 v61 = (GUIWindow *)HIDWORD(v1->pConditions[17]);
|
|
2945 memset(v1, 0, 0xA0u);
|
|
2946 v1->sHealth = v1->GetMaxHealth();
|
|
2947 v1->sMana = v1->GetMaxMana();
|
|
2948 v36 = (signed int)window_SpeakInHouse->ptr_1C;
|
|
2949 if ( v36 != 78 && (v36 <= 80 || v36 > 82) )
|
|
2950 {
|
|
2951 if ( (unsigned int)v61 | v35 )
|
|
2952 {
|
|
2953 v37 = LOBYTE(v1->uPrevFace);
|
|
2954 v38 = v1->uPrevVoiceID;
|
|
2955 v1->uCurrentFace = v37;
|
|
2956 v1->uVoiceID = v38;
|
|
2957 ReloadPlayerPortraits(uActiveCharacter - 1, (char)v37);
|
|
2958 }
|
|
2959 pAudioPlayer->PlaySound((SoundID)(SOUND_GoldReceived|0x2), -1, 0, -1, 0, 0, 0, 0);
|
|
2960 v1->PlaySound(SPEECH_82, 0);
|
|
2961 pOtherOverlayList->_4418B1(20, uActiveCharacter + 99, 0, 65536);
|
|
2962 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, v25);
|
|
2963 return;
|
|
2964 }
|
|
2965 v39 = v61;
|
|
2966 if ( (unsigned int)v61 | v35 )
|
|
2967 {
|
|
2968 LODWORD(v1->pConditions[17]) = v35;
|
|
2969 }
|
|
2970 else
|
|
2971 {
|
|
2972 if ( !v60 && !v58 && !v59 )
|
|
2973 {
|
|
2974 pAudioPlayer->PlaySound((SoundID)(SOUND_GoldReceived|0x2), -1, 0, -1, 0, 0, 0, 0);
|
|
2975 v1->PlaySound(SPEECH_82, 0);
|
|
2976 pOtherOverlayList->_4418B1(20, uActiveCharacter + 99, 0, 65536);
|
|
2977 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, v25);
|
|
2978 return;
|
|
2979 }
|
|
2980 v1->uPrevFace = v1->uCurrentFace;
|
|
2981 v1->uPrevVoiceID = v1->uVoiceID;
|
|
2982 v1->SetCondition(0x11u, 1);
|
|
2983 v1->uVoiceID = (v1->GetSexByVoice() != 0) + 23;
|
|
2984 v40 = (v1->GetSexByVoice() != 0) + 23;
|
|
2985 v1->uCurrentFace = v40;
|
|
2986 ReloadPlayerPortraits(uActiveCharacter - 1, (char)v40);
|
|
2987 LODWORD(v1->pConditions[17]) = LODWORD(pParty->uTimePlayed);
|
|
2988 v39 = (GUIWindow *)HIDWORD(pParty->uTimePlayed);
|
|
2989 }
|
|
2990 HIDWORD(v1->pConditions[17]) = (int)v39;
|
|
2991 pAudioPlayer->PlaySound((SoundID)(SOUND_GoldReceived|0x2), -1, 0, -1, 0, 0, 0, 0);
|
|
2992 v1->PlaySound(SPEECH_82, 0);
|
|
2993 pOtherOverlayList->_4418B1(20, uActiveCharacter + 99, 0, 65536);
|
|
2994 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, v25);
|
|
2995 return; // void func
|
|
2996 }
|
|
2997 v63 = 1;
|
|
2998 v41 = pDialogueWindow->GetControl(pDialogueWindow->pStartingPosActiveItem);
|
|
2999 strcpy(a1, "");
|
|
3000 v41->uHeight = 0;
|
|
3001 v41->uY = 0;
|
|
3002 if ( v1->IsPlayerHealableByTemple() )
|
|
3003 {
|
|
3004 sprintf(a1, "%s %d %s", pGlobalTXT_LocalizationStrings[104], HIDWORD(v60), pGlobalTXT_LocalizationStrings[97]);
|
|
3005 v63 = 0;
|
|
3006 }
|
|
3007 strcpy(&a1[100], pGlobalTXT_LocalizationStrings[68]);
|
|
3008 strcpy(&a1[200], pGlobalTXT_LocalizationStrings[160]);
|
|
3009 v42 = v63;
|
|
3010 v43 = pDialogueWindow;
|
|
3011 v44 = v63;
|
|
3012 v66 = 0;
|
|
3013 if ( v63 < pDialogueWindow->pNumPresenceButton )
|
|
3014 {
|
|
3015 v61 = (GUIWindow *)&a1[100 * v63];
|
|
3016 do
|
|
3017 {
|
|
3018 v45 = pFontArrus->CalcTextHeight((const char *)v61, &v57, 0, 0);
|
|
3019 v66 = (DDM_DLV_Header *)((char *)v66 + v45);
|
|
3020 v43 = pDialogueWindow;
|
|
3021 v61 = (GUIWindow *)((char *)v61 + 100);
|
|
3022 ++v44;
|
|
3023 }
|
|
3024 while ( v44 < pDialogueWindow->pNumPresenceButton );
|
|
3025 }
|
|
3026 v46 = v43->pNumPresenceButton - v42;
|
|
3027 v64 = (174 - (signed int)v66) / v46;
|
|
3028 if ( v64 > 32 )
|
|
3029 v64 = 32;
|
|
3030 v47 = (174 - v64 * v46 - (signed int)v66) / 2 - v64 / 2 + 138;
|
|
3031 v65 = v42 + v43->pStartingPosActiveItem;
|
|
3032 if ( v42 + v43->pStartingPosActiveItem < v43->pStartingPosActiveItem + v43->pNumPresenceButton )
|
|
3033 {
|
|
3034 v61 = (GUIWindow *)(v42 + 2);
|
|
3035 v66 = (DDM_DLV_Header *)&a1[100 * v42];
|
|
3036 do
|
|
3037 {
|
|
3038 v48 = v43->GetControl(v65);
|
|
3039 v49 = (const char *)v66;
|
|
3040 v50 = v48;
|
|
3041 v48->uY = v64 + v47;
|
|
3042 v51 = pFontArrus->CalcTextHeight(v49, &v57, 0, 0);
|
|
3043 v52 = v50->uY;
|
|
3044 v50->uHeight = v51;
|
|
3045 v47 = v52 + v51 - 1;
|
|
3046 v50->uW = v47;
|
|
3047 v53 = WORD2(v59);
|
|
3048 if ( (GUIWindow *)pDialogueWindow->pCurrentPosActiveItem != v61 )
|
|
3049 v53 = WORD2(v58);
|
|
3050 v57.DrawTitleText(pFontArrus, 0, v52, v53, (const char *)v66, 3u);
|
|
3051 v43 = pDialogueWindow;
|
|
3052 v66 = (DDM_DLV_Header *)((char *)v66 + 100);
|
|
3053 v61 = (GUIWindow *)((char *)v61 + 1);
|
|
3054 ++v65;
|
|
3055 }
|
|
3056 while ( (signed int)v65 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
|
|
3057 }
|
|
3058 return;
|
|
3059 }
|
|
3060
|
|
3061 //----- (004B4710) --------------------------------------------------------
|
|
3062 void TrainingDialog()
|
|
3063 {
|
|
3064 //Player *v0; // ebx@1
|
|
3065 int color2; // eax@1
|
|
3066 //unsigned int v2; // ecx@1
|
|
3067 //int v3; // eax@1
|
|
3068 //signed int v4; // edx@1
|
|
3069 unsigned __int64 v5; // edi@3
|
|
3070 //unsigned int v6; // esi@3
|
|
3071 //void *v7; // ecx@3
|
|
3072 int v8; // edx@4
|
|
3073 double v9; // st7@6
|
|
3074 signed int v10; // esi@6
|
|
3075 int v11; // ecx@6
|
|
3076 //int result; // eax@9
|
|
3077 GUIWindow *v13; // edi@14
|
|
3078 signed int v14; // esi@14
|
|
3079 unsigned int v15; // esi@16
|
|
3080 int v16; // eax@16
|
|
3081 unsigned int v17; // eax@17
|
|
3082 int v18; // eax@19
|
|
3083 int v19; // ecx@24
|
|
3084 GUIButton *v20; // eax@26
|
|
3085 GUIButton *v21; // esi@26
|
|
3086 int v22; // eax@26
|
|
3087 const char *v23; // eax@28
|
|
3088 int v24; // eax@28
|
|
3089 unsigned int v25; // ecx@28
|
|
3090 int v26; // eax@28
|
|
3091 unsigned __int16 v27; // ax@28
|
|
3092 //int v28; // eax@32
|
|
3093 unsigned __int16 v29; // ST14_2@34
|
|
3094 int v30; // eax@34
|
|
3095 //const char *v31; // ST18_4@36
|
|
3096 //unsigned __int16 v32; // ST14_2@36
|
|
3097 int v33; // eax@36
|
|
3098 int v34; // eax@37
|
|
3099 unsigned int v35; // edi@38
|
|
3100 unsigned int v36; // eax@38
|
|
3101 //int v37; // ecx@41
|
|
3102 //char *v38; // eax@41
|
|
3103 //int *v39; // eax@45
|
|
3104 unsigned int v40; // eax@46
|
|
3105 //void *v41; // ecx@46
|
|
3106 unsigned int v42; // eax@46
|
|
3107 GUIWindow *v43; // ecx@59
|
|
3108 int v44; // edx@59
|
|
3109 char **v45; // esi@60
|
|
3110 //int v46; // eax@62
|
|
3111 int v47; // eax@68
|
|
3112 //int v48; // edx@69
|
|
3113 int v49; // ebx@69
|
|
3114 //unsigned __int8 v50; // sf@69
|
|
3115 char **v51; // edi@70
|
|
3116 GUIButton *v52; // eax@71
|
|
3117 GUIButton *v53; // esi@71
|
|
3118 int v54; // eax@71
|
|
3119 unsigned int v55; // ecx@71
|
|
3120 int v56; // eax@71
|
|
3121 unsigned __int16 v57; // ax@71
|
|
3122 unsigned __int16 v58; // [sp-Ch] [bp-90h]@38
|
|
3123 //const char *v59; // [sp-Ch] [bp-90h]@63
|
|
3124 char *v60; // [sp-8h] [bp-8Ch]@38
|
|
3125 //char *v61; // [sp-8h] [bp-8Ch]@63
|
|
3126 unsigned int v62; // [sp-4h] [bp-88h]@38
|
|
3127 int v63; // [sp-4h] [bp-88h]@52
|
|
3128 //char *v64; // [sp-4h] [bp-88h]@63
|
|
3129 GUIWindow v65; // [sp+Ch] [bp-78h]@1
|
|
3130 //__int64 v66; // [sp+60h] [bp-24h]@3
|
|
3131 unsigned int white; // [sp+68h] [bp-1Ch]@1
|
|
3132 int v68; // [sp+6Ch] [bp-18h]@3
|
|
3133 int v69; // [sp+70h] [bp-14h]@6
|
|
3134 //unsigned int i; // [sp+74h] [bp-10h]@1
|
|
3135 //int v71; // [sp+78h] [bp-Ch]@1
|
|
3136 int v72; // [sp+7Ch] [bp-8h]@16
|
|
3137 int v73; // [sp+80h] [bp-4h]@14
|
|
3138
|
|
3139 //v0 = pPlayers[uActiveCharacter];
|
|
3140 memcpy(&v65, window_SpeakInHouse, sizeof(v65));
|
|
3141 v65.uFrameX = 483;
|
|
3142 v65.uFrameWidth = 148;
|
|
3143 v65.uFrameZ = 334;
|
|
3144 white = TargetColor(255, 255, 255);
|
|
3145 color2 = TargetColor(0xE1u, 0xCDu, 0x23u);
|
|
3146 //v71 = color2;
|
|
3147 //v2 = v0->uLevel;
|
|
3148 //v3 = 0;
|
|
3149 //v4 = 0;
|
|
3150 //for ( i = v2; v4 < (signed int)v2; ++v4 )
|
|
3151 // v3 += v4 + 1;
|
|
3152 //v5 = 1000 * v3;
|
|
3153 v5 = 1000ui64 * pPlayers[uActiveCharacter]->uLevel * (pPlayers[uActiveCharacter]->uLevel + 1) / 2; // E n = n(n + 1) / 2
|
|
3154 //v6 = HIDWORD(v0->uExperience);
|
|
3155 //v7 = window_SpeakInHouse->ptr_1C;
|
|
3156 v68 = pMaxLevelPerTrainingHallType[(unsigned int)window_SpeakInHouse->ptr_1C - HOUSE_TRAINING_HALL_EMERALD_ISLE];
|
|
3157 //v66 = 1000 * v3;
|
|
3158 if (pPlayers[uActiveCharacter]->uExperience >= v5)
|
|
3159 {
|
|
3160 v8 = pPlayers[uActiveCharacter]->classType % 4 + 1;
|
|
3161 if ( v8 == 4 )
|
|
3162 v8 = 3;
|
|
3163 v9 = (double)pPlayers[uActiveCharacter]->uLevel;
|
|
3164 //i = 0;
|
|
3165 v69 = v8;
|
|
3166 //v10 = (signed __int64)(v9 * p2DEvents_minus1__20[13 * (signed int)v7] * (double)v8);
|
|
3167 v10 = (signed __int64)(v9 * p2DEvents[(signed int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier * (double)v8);
|
|
3168 v11 = v10 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100;
|
|
3169 if ( v11 < v10 / 3 )
|
|
3170 v11 = v10 / 3;
|
|
3171 //i = v11;
|
|
3172 }
|
|
3173
|
|
3174 if (sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win())
|
|
3175 {
|
|
3176 if ( dialog_menu_id != HOUSE_DIALOGUE_MAIN )
|
|
3177 {
|
|
3178 if ( dialog_menu_id != HOUSE_DIALOGUE_TRAININGHALL_TRAIN )
|
|
3179 {
|
|
3180 if ( dialog_menu_id == HOUSE_DIALOGUE_LEARN_SKILLS )
|
|
3181 {
|
|
3182 if (sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win())
|
|
3183 {
|
|
3184 //i = 0;
|
|
3185 int _v0 = 0;
|
|
3186 v13 = pDialogueWindow;
|
|
3187 //v14 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)ptr_507BC0->ptr_1C] * 500.0);
|
|
3188 v14 = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0);
|
|
3189 v73 = v14 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100;
|
|
3190 if ( v73 < v14 / 3 )
|
|
3191 v73 = v14 / 3;
|
|
3192 v15 = v13->pStartingPosActiveItem;
|
|
3193 v16 = v13->pNumPresenceButton;
|
|
3194 v72 = 0;
|
|
3195 if ( (signed int)v15 >= (signed int)(v15 + v16) )
|
|
3196 goto LABEL_76;
|
|
3197 do
|
|
3198 {
|
|
3199 v17 = v13->GetControl(v15)->msg_param - 36;
|
|
3200 if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][v17] && !pPlayers[uActiveCharacter]->pActiveSkills[v17] )
|
|
3201 {
|
|
3202 v18 = pFontArrus->CalcTextHeight(pSkillNames[v17], &v65, 0, 0);
|
|
3203 _v0 += v18;
|
|
3204 ++v72;
|
|
3205 }
|
|
3206 ++v15;
|
|
3207 }
|
|
3208 while ( (signed int)v15 < v13->pNumPresenceButton + v13->pStartingPosActiveItem );
|
|
3209 if ( v72 )
|
|
3210 {
|
|
3211 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], v73);// "Skill Cost: %lu"
|
|
3212 v65.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3u);
|
|
3213 v73 = (signed int)(149 - _v0) / v72;
|
|
3214 if ( v73 > 32 )
|
|
3215 v73 = 32;
|
|
3216 //result = v13->pStartingPosActiveItem;
|
|
3217 v19 = (signed int)(149 - v72 * v73 - _v0) / 2 - v73 / 2 + 162;
|
|
3218 int _v1 = v13->pStartingPosActiveItem;
|
|
3219 v68 = v19;
|
|
3220 if (v13->pStartingPosActiveItem < v13->pStartingPosActiveItem + v13->pNumPresenceButton )
|
|
3221 {
|
|
3222 v72 = 2;
|
|
3223 do
|
|
3224 {
|
|
3225 v20 = v13->GetControl(_v1);
|
|
3226 v21 = v20;
|
|
3227 v22 = v20->msg_param - 36;
|
|
3228 if ( !byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][v22] || pPlayers[uActiveCharacter]->pActiveSkills[v22] )
|
|
3229 {
|
|
3230 v21->uW = 0;
|
|
3231 v21->uHeight = 0;
|
|
3232 v21->uY = 0;
|
|
3233 }
|
|
3234 else
|
|
3235 {
|
|
3236 v23 = pSkillNames[v22];
|
|
3237 v21->uY = v73 + v68;
|
|
3238 //HIDWORD(v66) = (int)v23;
|
|
3239 v24 = pFontArrus->CalcTextHeight(v23, &v65, 0, 0);
|
|
3240 v25 = v21->uY;
|
|
3241 v21->uHeight = v24;
|
|
3242 v26 = v25 + v24 - 1;
|
|
3243 v21->uW = v26;
|
|
3244 v68 = v26;
|
|
3245 v27 = color2;
|
|
3246 if ( pDialogueWindow->pCurrentPosActiveItem != v72 )
|
|
3247 v27 = white;
|
|
3248 v65.DrawTitleText(pFontArrus, 0, v25, v27, v23, 3u);
|
|
3249 }
|
|
3250 ++_v1;
|
|
3251 ++v72;
|
|
3252 }
|
|
3253 while ( (signed int)_v1 < v13->pStartingPosActiveItem + v13->pNumPresenceButton );
|
|
3254 }
|
|
3255 }
|
|
3256 else
|
|
3257 {
|
|
3258 LABEL_76:
|
|
3259 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayers[uActiveCharacter]->pName, pClassNames[pPlayers[uActiveCharacter]->classType]);//
|
|
3260 // "Seek knowledge elsewhere %s the %s"
|
|
3261 strcat(pTmpBuf.data(), "\n \n");
|
|
3262 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);// "I can offer you nothing further."
|
|
3263 v29 = color2;
|
|
3264 v30 = pFontArrus->CalcTextHeight(pTmpBuf.data(), &v65, 0, 0);
|
|
3265 v65.DrawTitleText(pFontArrus, 0, (174 - v30) / 2 + 138, v29, pTmpBuf.data(), 3u);
|
|
3266 }
|
|
3267 }
|
|
3268 }
|
|
3269 return;
|
|
3270 }
|
|
3271 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
|
|
3272 {
|
|
3273 //v31 = pNPCTopics[122].pText;
|
|
3274 //v32 = color2;
|
|
3275 v33 = pFontArrus->CalcTextHeight(pNPCTopics[122].pText, &v65, 0, 0);
|
|
3276 v65.DrawTitleText(pFontArrus, 0, (212 - v33) / 2 + 101, color2, pNPCTopics[122].pText, 3);
|
|
3277 pDialogueWindow->pNumPresenceButton = 0;
|
|
3278 return;
|
|
3279 }
|
|
3280 v34 = pPlayers[uActiveCharacter]->uLevel;
|
|
3281 if ( v34 < v68 )
|
|
3282 {
|
|
3283 if ( (signed __int64)pPlayers[uActiveCharacter]->uExperience >= v5 )
|
|
3284 {
|
|
3285 if ( pParty->uNumGold >= v11)
|
|
3286 {
|
|
3287 Party::TakeGold(v11);
|
|
3288 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
|
|
3289 ++pPlayers[uActiveCharacter]->uLevel;
|
|
3290 pPlayers[uActiveCharacter]->uSkillPoints += pPlayers[uActiveCharacter]->uLevel / 10 + 5;
|
|
3291 pPlayers[uActiveCharacter]->sHealth = pPlayers[uActiveCharacter]->GetMaxHealth();
|
|
3292 pPlayers[uActiveCharacter]->sMana = pPlayers[uActiveCharacter]->GetMaxMana();
|
|
3293
|
|
3294 uint max_level_in_party = player_levels[0];
|
|
3295 for (uint _it = 1; _it < 4; ++_it)
|
|
3296 {
|
|
3297 if (player_levels[_it] > max_level_in_party)
|
|
3298 max_level_in_party = player_levels[_it];
|
|
3299 }
|
|
3300
|
|
3301 ++player_levels[uActiveCharacter - 1];
|
|
3302 if (player_levels[uActiveCharacter - 1] > max_level_in_party) // if we reach new maximum party level
|
|
3303 // feature is broken thou, since this array is always zeroed in EnterHouse
|
|
3304 {
|
|
3305 v40 = _494820_training_time(pParty->uCurrentHour);
|
|
3306 //v41 = window_SpeakInHouse->ptr_1C;
|
|
3307 v42 = 60 * (v40 + 4) - pParty->uCurrentMinute;
|
|
3308 if ((unsigned int)window_SpeakInHouse->ptr_1C == HOUSE_TRAINING_HALL_94 ||
|
|
3309 (unsigned int)window_SpeakInHouse->ptr_1C == HOUSE_TRAINING_HALL_95)
|
|
3310 v42 += 720;
|
|
3311 RestAndHeal((signed int)(v42 + 10080));
|
|
3312 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
|
|
3313 pOutdoor->SetFog();
|
|
3314 }
|
|
3315 pPlayers[uActiveCharacter]->PlaySound(SPEECH_87, 0);
|
|
3316 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[430], pPlayers[uActiveCharacter]->pName, pPlayers[uActiveCharacter]->uLevel, pPlayers[uActiveCharacter]->uLevel / 10 + 5);//
|
|
3317 // "%s is now Level %lu and has earned %lu Skill Points!"
|
|
3318 ShowStatusBarString(pTmpBuf.data(), 2);
|
|
3319 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
|
|
3320 return;
|
|
3321 }
|
|
3322 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2);// "You don't have enough gold"
|
|
3323 v63 = 4;
|
|
3324 LABEL_55:
|
|
3325 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, (HouseSoundID)v63);
|
|
3326 //LABEL_56:
|
|
3327 /*result = pMessageQueue_50CBD0->uNumMessages;
|
|
3328 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
|
|
3329 {
|
|
3330 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
|
|
3331 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
|
|
3332 result = 3 * pMessageQueue_50CBD0->uNumMessages + 3;
|
|
3333 *(&pMessageQueue_50CBD0->uNumMessages + result) = 0;
|
|
3334 ++pMessageQueue_50CBD0->uNumMessages;
|
|
3335 }
|
|
3336 return result;*/
|
|
3337 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
|
|
3338 return;
|
|
3339 }
|
|
3340 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[538], (unsigned int)(v5 - pPlayers[uActiveCharacter]->uExperience), v34 + 1);//
|
|
3341 // "You need %d more experience to train to level %d"
|
|
3342 v35 = 0;
|
|
3343 v62 = 3;
|
|
3344 v60 = pTmpBuf.data();
|
|
3345 v58 = color2;
|
|
3346 v36 = (212 - pFontArrus->CalcTextHeight(pTmpBuf.data(), &v65, 0, 0)) / 2 + 88;
|
|
3347 }
|
|
3348 else
|
|
3349 {
|
|
3350 sprintf(pTmpBuf.data(), "%s\n \n%s", pGlobalTXT_LocalizationStrings[536], pGlobalTXT_LocalizationStrings[529]);//
|
|
3351 // ""With your skills, you should be working here as a teacher.""
|
|
3352 // ""Sorry, but we are unable to train you.""
|
|
3353 v35 = 0;
|
|
3354 v62 = 3;
|
|
3355 v60 = pTmpBuf.data();
|
|
3356 v58 = color2;
|
|
3357 v36 = (212 - pFontArrus->CalcTextHeight(pTmpBuf.data(), &v65, 0, 0)) / 2 + 101;
|
|
3358 }
|
|
3359 v65.DrawTitleText(pFontArrus, v35, v36, v58, v60, v62);
|
|
3360 v63 = 3;
|
|
3361 goto LABEL_55;
|
|
3362 }
|
|
3363
|
|
3364 if (sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win())
|
|
3365 {
|
|
3366 v43 = pDialogueWindow;
|
|
3367 v72 = 0;
|
|
3368 pShopOptions[0] = pTmpBuf.data();
|
|
3369 pShopOptions[1] = pGlobalTXT_LocalizationStrings[160];// "Learn Skills"
|
|
3370 v44 = pDialogueWindow->pNumPresenceButton;
|
|
3371 v73 = pDialogueWindow->pStartingPosActiveItem;
|
|
3372 if ( v73 < v73 + v44 )
|
|
3373 {
|
|
3374 v45 = pShopOptions.data();
|
|
3375 do
|
|
3376 {
|
|
3377 if ( v43->GetControl(v73)->msg_param == HOUSE_DIALOGUE_TRAININGHALL_TRAIN )
|
|
3378 {
|
|
3379 //v46 = pPlayers[uActiveCharacter]->uLevel;
|
|
3380 if (pPlayers[uActiveCharacter]->uLevel >= v68)
|
|
3381 sprintfex(*v45, "%s\n \n%s",
|
|
3382 pGlobalTXT_LocalizationStrings[536], pGlobalTXT_LocalizationStrings[529]); //"With your skills, you should be working here as a teacher." "Sorry, but we are unable to train you."
|
|
3383 else
|
|
3384 {
|
|
3385 if (pPlayers[uActiveCharacter]->uExperience < v5)
|
|
3386 sprintfex(*v45, pGlobalTXT_LocalizationStrings[538], // "You need %d more experience to train to level %d"
|
|
3387 (uint)(v5 - pPlayers[uActiveCharacter]->uExperience), pPlayers[uActiveCharacter]->uLevel + 1);
|
|
3388 else
|
|
3389 sprintfex(*v45, pGlobalTXT_LocalizationStrings[537], // "Train to level %d for %d gold"
|
|
3390 pPlayers[uActiveCharacter]->uLevel + 1, v11);
|
|
3391 }
|
|
3392 }
|
|
3393 v47 = pFontArrus->CalcTextHeight(*v45, &v65, 0, 0);
|
|
3394 v43 = pDialogueWindow;
|
|
3395 v72 += v47;
|
|
3396 ++v45;
|
|
3397 ++v73;
|
|
3398 }
|
|
3399 while ( v73 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
|
|
3400 }
|
|
3401
|
|
3402 v49 = (2 * (87 - (174 - v72) / 2) - v72) / 2 - (174 - v72) / 2 / 2 + 138;
|
|
3403 v73 = v43->pStartingPosActiveItem;
|
|
3404 if (v43->pStartingPosActiveItem < v43->pStartingPosActiveItem + v43->pNumPresenceButton)
|
|
3405 {
|
|
3406 int _v3 = 2;
|
|
3407 v51 = pShopOptions.data();
|
|
3408 do
|
|
3409 {
|
|
3410 v52 = v43->GetControl(v73);
|
|
3411 v53 = v52;
|
|
3412 v52->uY = (174 - v72) / 2 + v49;
|
|
3413 v54 = pFontArrus->CalcTextHeight(*v51, &v65, 0, 0);
|
|
3414 v55 = v53->uY;
|
|
3415 v53->uHeight = v54;
|
|
3416 v56 = v54 + v55 - 1;
|
|
3417 v53->uW = v56;
|
|
3418 v49 = v56;
|
|
3419 v57 = color2;
|
|
3420 if ( pDialogueWindow->pCurrentPosActiveItem != _v3 )
|
|
3421 v57 = white;
|
|
3422 v65.DrawTitleText(pFontArrus, 0, v55, v57, *v51, 3u);
|
|
3423 v43 = pDialogueWindow;
|
|
3424 ++_v3;
|
|
3425 ++v51;
|
|
3426 ++v73;
|
|
3427 }
|
|
3428 while ( v73 < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton);
|
|
3429 }
|
|
3430 }
|
|
3431 }
|
|
3432 }
|
|
3433
|
|
3434 //----- (004B6478) --------------------------------------------------------
|
|
3435 void sub_4B6478()
|
|
3436 {
|
|
3437 GUIWindow *v0; // ebx@1
|
|
3438 Player *v1; // edi@1
|
|
3439 unsigned int v2; // eax@1
|
|
3440 signed int v3; // esi@1
|
|
3441 int v4; // ebx@1
|
|
3442 unsigned int v5; // esi@5
|
|
3443 int v6; // edi@6
|
|
3444 int result; // eax@13
|
|
3445 GUIWindow *v8; // ebx@17
|
|
3446 int v9; // eax@17
|
|
3447 int v10; // ecx@17
|
|
3448 unsigned int v11; // ecx@18
|
|
3449 int v12; // eax@20
|
|
3450 int v13; // eax@21
|
|
3451 GUIButton *v14; // esi@27
|
|
3452 int v15; // ecx@27
|
|
3453 unsigned int v16; // eax@28
|
|
3454 const char *v17; // ebx@29
|
|
3455 int v18; // eax@29
|
|
3456 unsigned int v19; // ecx@29
|
|
3457 int v20; // eax@29
|
|
3458 unsigned __int16 v21; // ax@29
|
|
3459 unsigned __int16 v22; // ST14_2@36
|
|
3460 int v23; // eax@36
|
|
3461 const char *v24; // ST18_4@37
|
|
3462 unsigned __int16 v25; // ST14_2@37
|
|
3463 int v26; // eax@37
|
|
3464 int v27; // [sp-4h] [bp-80h]@8
|
|
3465 GUIWindow v28; // [sp+Ch] [bp-70h]@1
|
|
3466 GUIWindow *v29; // [sp+60h] [bp-1Ch]@17
|
|
3467 unsigned int v30; // [sp+64h] [bp-18h]@1
|
|
3468 int v31; // [sp+68h] [bp-14h]@1
|
|
3469 int v32; // [sp+6Ch] [bp-10h]@1
|
|
3470 int v33; // [sp+70h] [bp-Ch]@17
|
|
3471 int v34; // [sp+74h] [bp-8h]@17
|
|
3472 int v35; // [sp+78h] [bp-4h]@17
|
|
3473
|
|
3474 v0 = window_SpeakInHouse;
|
|
3475 memcpy(&v28, window_SpeakInHouse, sizeof(v28));
|
|
3476 v1 = pPlayers[uActiveCharacter];
|
|
3477 v28.uFrameX = 483;
|
|
3478 v28.uFrameWidth = 148;
|
|
3479 v28.uFrameZ = 334;
|
|
3480 v30 = TargetColor(0xFFu, 0xFFu, 0xFFu);
|
|
3481 v31 = TargetColor(0xFFu, 0xFFu, 0x9Bu);
|
|
3482 v2 = 52 * (unsigned int)v0->ptr_1C;
|
|
3483 //v32 = (unsigned __int8)(((p2DEvents_minus1___00[v2 / 2] != 18) - 1) & 0x96) + 100;
|
|
3484 v32 = (unsigned __int8)(((p2DEvents[(unsigned int)v0->ptr_1C - 1].uType != 18) - 1) & 0x96) + 100;
|
|
3485 //v3 = (signed __int64)((double)v32 * p2DEvents_minus1__20[v2 / 4]);
|
|
3486 v3 = (signed __int64)((double)v32 * p2DEvents[(unsigned int)v0->ptr_1C - 1].fPriceMultiplier);
|
|
3487 v4 = v3 * (100 - v1->GetMerchant()) / 100;
|
|
3488 v32 = v4;
|
|
3489 if ( v4 < v3 / 3 )
|
|
3490 {
|
|
3491 v4 = v3 / 3;
|
|
3492 v32 = v3 / 3;
|
|
3493 }
|
|
3494 if ( dialog_menu_id != HOUSE_DIALOGUE_MAIN)
|
|
3495 {
|
|
3496 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
|
|
3497 {
|
|
3498 v5 = 0;
|
|
3499
|
|
3500 __debugbreak();
|
|
3501 //pSkillAvailabilityPerClass[8 + v58->uClass][4 + v23]
|
|
3502 // or
|
|
3503 //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass][v23 - 36]
|
|
3504 // or
|
|
3505 //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass - 1][v23 + 1]
|
|
3506 __debugbreak(); // whacky condition - fix
|
|
3507 if (false
|
|
3508 //if ( !*(&byte_4ED94C[37 * v1->uClass / 3] + dword_F8B19C)
|
|
3509 || (v6 = (int)(&v1->uIntelligence + dialog_menu_id), *(short *)v6) )
|
|
3510 {
|
|
3511 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
|
|
3512 }
|
|
3513 else
|
|
3514 {
|
|
3515 if ( pParty->uNumGold < v4 )
|
|
3516 {
|
|
3517 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
|
|
3518 v27 = 4;
|
|
3519 }
|
|
3520 else
|
|
3521 {
|
|
3522 Party::TakeGold(v4);
|
|
3523 *(short *)v6 = 1;
|
|
3524 v27 = 2;
|
|
3525 }
|
|
3526 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, (HouseSoundID)v27);
|
|
3527 }
|
|
3528 }
|
|
3529 else
|
|
3530 {
|
|
3531 v5 = 0;
|
|
3532 }
|
|
3533 /*result = pMessageQueue_50CBD0->uNumMessages;
|
|
3534 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
|
|
3535 {
|
|
3536 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
|
|
3537 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
|
|
3538 result = 3 * pMessageQueue_50CBD0->uNumMessages + 3;
|
|
3539 *(&pMessageQueue_50CBD0->uNumMessages + result) = v5;
|
|
3540 ++pMessageQueue_50CBD0->uNumMessages;
|
|
3541 }*/
|
|
3542 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, v5);
|
|
3543 return; // void func
|
|
3544 }
|
|
3545 if ( !(unsigned __int16)_449B57_test_bit((unsigned __int8 *)v1->_guilds_member_bits, word_4F0754[2 * (unsigned int)window_SpeakInHouse->ptr_1C]) )
|
|
3546 {
|
|
3547 v24 = pNPCTopics[171].pText;
|
|
3548 v25 = v31;
|
|
3549 v26 = pFontArrus->CalcTextHeight(pNPCTopics[171].pText, &v28, 0, 0);
|
|
3550 v28.DrawTitleText(pFontArrus, 0, (212 - v26) / 2 + 101, v25, v24, 3u);
|
|
3551 pDialogueWindow->pNumPresenceButton = 0;
|
|
3552 return ;
|
|
3553 }
|
|
3554
|
|
3555 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
|
|
3556 return;
|
|
3557 v8 = pDialogueWindow;
|
|
3558 v33 = 0;
|
|
3559 v34 = 0;
|
|
3560 v29 = pDialogueWindow;
|
|
3561 v9 = pDialogueWindow->pStartingPosActiveItem;
|
|
3562 v10 = v9 + pDialogueWindow->pNumPresenceButton;
|
|
3563 v35 = pDialogueWindow->pStartingPosActiveItem;
|
|
3564 if ( v9 >= v10 )
|
|
3565 goto LABEL_40;
|
|
3566 do
|
|
3567 {
|
|
3568 v11 = v8->GetControl(v35)->msg_param - 36;
|
|
3569 if ( byte_4ED970_skill_learn_ability_by_class_table[v1->classType / 3][v11] && !v1->pActiveSkills[v11] )
|
|
3570 {
|
|
3571 v12 = pFontArrus->CalcTextHeight(pSkillNames[v11], &v28, 0, 0);
|
|
3572 v33 += v12;
|
|
3573 ++v34;
|
|
3574 }
|
|
3575 v13 = v8->pStartingPosActiveItem;
|
|
3576 ++v35;
|
|
3577 }
|
|
3578 while ( v35 < v8->pNumPresenceButton + v13 );
|
|
3579 if ( !v34 )
|
|
3580 {
|
|
3581 LABEL_40:
|
|
3582 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], v1->pName, pClassNames[v1->classType]);
|
|
3583 strcat(pTmpBuf.data(), "\n \n");
|
|
3584 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);
|
|
3585 v22 = v31;
|
|
3586 v23 = pFontArrus->CalcTextHeight(pTmpBuf.data(), &v28, 0, 0);
|
|
3587 v28.DrawTitleText(pFontArrus, 0, (174 - v23) / 2 + 138, v22, pTmpBuf.data(), 3u);
|
|
3588 return;
|
|
3589 }
|
|
3590 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], v32);
|
|
3591 v28.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3u);
|
|
3592 v32 = (149 - v33) / v34;
|
|
3593 if ( (149 - v33) / v34 > 32 )
|
|
3594 v32 = 32;
|
|
3595
|
|
3596 v35 = v8->pStartingPosActiveItem;
|
|
3597 v34 = (149 - v34 * v32 - v33) / 2 - v32 / 2 + 162;
|
|
3598 if ( v8->pStartingPosActiveItem < v8->pStartingPosActiveItem+ v8->pNumPresenceButton )
|
|
3599 {
|
|
3600 v33 = 2;
|
|
3601 do
|
|
3602 {
|
|
3603 v14 = v8->GetControl(v35);
|
|
3604 v15 = v14->msg_param - 36;
|
|
3605 if ( byte_4ED970_skill_learn_ability_by_class_table[v1->classType / 3][v15] )
|
|
3606 {
|
|
3607 v16 = 0;
|
|
3608 if ( !v1->pActiveSkills[v15] )
|
|
3609 {
|
|
3610 v17 = pSkillNames[v15];
|
|
3611 v14->uY = v32 + v34;
|
|
3612 v18 = pFontArrus->CalcTextHeight(v17, &v28, 0, 0);
|
|
3613 v19 = v14->uY;
|
|
3614 v14->uHeight = v18;
|
|
3615 v20 = v19 + v18 - 1;
|
|
3616 v14->uW = v20;
|
|
3617 v34 = v20;
|
|
3618 v21 = v31;
|
|
3619 if ( pDialogueWindow->pCurrentPosActiveItem != v33 )
|
|
3620 v21 = v30;
|
|
3621 v28.DrawTitleText(pFontArrus, 0, v19, v21, v17, 3u);
|
|
3622 goto LABEL_34;
|
|
3623 }
|
|
3624 }
|
|
3625 else
|
|
3626 {
|
|
3627 v16 = 0;
|
|
3628 }
|
|
3629 v14->uW = v16;
|
|
3630 v14->uHeight = v16;
|
|
3631 v14->uY = v16;
|
|
3632 LABEL_34:
|
|
3633 v8 = v29;
|
|
3634 ++v35;
|
|
3635 ++v33;
|
|
3636 }
|
|
3637 while ( v35 <v29->pNumPresenceButton + v29->pStartingPosActiveItem );
|
|
3638 }
|
|
3639 return;
|
|
3640 }
|
|
3641
|
|
3642 //----- (004B2A74) --------------------------------------------------------
|
|
3643 void SimpleHouseAndBoatsDialog()
|
|
3644 {
|
|
3645 char *v0; // esi@3
|
|
3646 char *v1; // ST1C_4@3
|
|
3647 char *v2; // eax@3
|
|
3648 const char *v3; // ST1C_4@5
|
|
3649 int v4; // eax@5
|
|
3650 unsigned int i; // eax@5
|
|
3651 NPCData *v6; // esi@6
|
|
3652 unsigned __int16 v7; // bx@6
|
|
3653 unsigned int v8; // eax@6
|
|
3654 int v9; // eax@11
|
|
3655 unsigned int v10; // ecx@12
|
|
3656 int v11; // eax@12
|
|
3657 int v12; // esi@12
|
|
3658 char *v13; // eax@12
|
|
3659 GUIWindow *v14; // ebx@13
|
|
3660 char *v15; // esi@14
|
|
3661 GUIButton *v16; // eax@15
|
|
3662 unsigned int v17; // ecx@15
|
|
3663 int v18; // ecx@17
|
|
3664 int v19; // ecx@18
|
|
3665 int v20; // ecx@19
|
|
3666 int v21; // ecx@20
|
|
3667 int v22; // ecx@21
|
|
3668 unsigned int v23; // ecx@23
|
|
3669 int v24; // ecx@35
|
|
3670 int v25; // ecx@36
|
|
3671 int v26; // ecx@37
|
|
3672 int v27; // ecx@38
|
|
3673 int v28; // ecx@39
|
|
3674 char *v29; // esi@42
|
|
3675 unsigned int v30; // ST20_4@42
|
|
3676 int v31; // ST1C_4@42
|
|
3677 unsigned int v32; // eax@42
|
|
3678 char *v33; // eax@43
|
|
3679 int v34; // esi@51
|
|
3680 int v35; // eax@51
|
|
3681 unsigned int v36; // edi@51
|
|
3682 GUIButton *v37; // eax@52
|
|
3683 int v38; // eax@52
|
|
3684 signed int v39; // ecx@54
|
|
3685 int v40; // edi@57
|
|
3686 GUIButton *v41; // eax@60
|
|
3687 GUIButton *v42; // esi@60
|
|
3688 const char *v43; // ebx@60
|
|
3689 int v44; // eax@60
|
|
3690 unsigned int v45; // ecx@60
|
|
3691 unsigned __int16 v46; // ax@60
|
|
3692 GUIFont *v47; // ebx@64
|
|
3693 int v48; // esi@64
|
|
3694 char *v49; // eax@66
|
|
3695 GUIWindow w; // [sp+Ch] [bp-110h]@64
|
|
3696 GUIWindow v52; // [sp+60h] [bp-BCh]@13
|
|
3697 GUIWindow a1; // [sp+B4h] [bp-68h]@1
|
|
3698 unsigned int v54; // [sp+108h] [bp-14h]@14
|
|
3699 int v55; // [sp+10Ch] [bp-10h]@6
|
|
3700 int v56; // [sp+110h] [bp-Ch]@13
|
|
3701 char *pInString; // [sp+114h] [bp-8h]@12
|
|
3702 NPCData *v58; // [sp+118h] [bp-4h]@6
|
|
3703
|
|
3704 memcpy(&a1, pDialogueWindow, sizeof(a1));
|
|
3705 if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic )
|
|
3706 {
|
|
3707 v0 = pMapStats->pInfos[uHouse_ExitPic].pName;
|
|
3708 v1 = pMapStats->pInfos[uHouse_ExitPic].pName;
|
|
3709 a1.uFrameX = 493;
|
|
3710 a1.uFrameWidth = 126;
|
|
3711 a1.uFrameZ = 366;
|
|
3712 a1.DrawTitleText(pFontCreate, 0, 2u, 0, v1, 3u);
|
|
3713 a1.uFrameX = 483;
|
|
3714 a1.uFrameWidth = 148;
|
|
3715 a1.uFrameZ = 334;
|
|
3716 v2 = pTransitionStrings[uHouse_ExitPic];
|
|
3717 if ( !v2 )
|
|
3718 {
|
|
3719 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[411], v0);
|
|
3720 v2 = pTmpBuf.data();
|
|
3721 }
|
|
3722 v3 = v2;
|
|
3723 v4 = pFontCreate->CalcTextHeight(v2, &a1, 0, 0);
|
|
3724 a1.DrawTitleText(pFontCreate, 0, (212 - v4) / 2 + 101, 0, v3, 3u);
|
|
3725 return;
|
|
3726 }
|
|
3727 a1.uFrameWidth -= 10;
|
|
3728 a1.uFrameZ -= 10;
|
|
3729 v58 = HouseNPCData[(unsigned int)((char *)pDialogueNPCCount + -(dword_591080 != 0) )];//- 1
|
|
3730 v6 = v58;
|
|
3731 v55 = TargetColor(0xE1u, 0xCDu, 0x23u);
|
|
3732 v7 = TargetColor(0x15u, 0x99u, 0xE9u);
|
|
3733 v8 = v6->uProfession;
|
|
3734 if ( v8 )
|
|
3735 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[429], v6->pName, aNPCProfessionNames[v8]);
|
|
3736 else
|
|
3737 strcpy(pTmpBuf.data(), v6->pName);
|
|
3738 a1.DrawTitleText(pFontCreate, 0x1E3u, 0x71u, v7, pTmpBuf.data(), 3u);
|
|
3739 if ( !dword_591080 )
|
|
3740 {
|
|
3741 if ( !uDialogueType )
|
|
3742 {
|
|
3743 v9 = v6->greet;
|
|
3744 if ( v9 )
|
|
3745 {
|
|
3746 v10 = v6->uFlags;
|
|
3747 a1.uFrameWidth = game_viewport_width;
|
|
3748 a1.uFrameZ = 452;
|
|
3749 pInString = (char *)*(&pNPCStats->field_17884 + ((v10 & 3) == 2) + 2 * v9);
|
|
3750 v11 = pFontArrus->CalcTextHeight(pInString, &a1, 13, 0);
|
|
3751 v12 = v11 + 7;
|
|
3752 pRenderer->_4A6A68(8, 352 - (v11 + 7),
|
|
3753 pIcons_LOD->GetTexture(uTextureID_Leather),
|
|
3754 pIcons_LOD->GetTexture(uTextureID_Leather)->uTextureHeight - (v11 + 7));
|
|
3755 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428);
|
|
3756 v13 = FitTextInAWindow(pInString, pFontArrus, &a1, 0xDu, 0);
|
|
3757 pDialogueWindow->DrawText(pFontArrus, 13, 354 - v12, 0, v13, 0, 0, 0);
|
|
3758 }
|
|
3759 }
|
|
3760 }
|
|
3761 v14 = pDialogueWindow;
|
|
3762 memcpy(&v52, pDialogueWindow, sizeof(v52));
|
|
3763 v52.uFrameX = 483;
|
|
3764 v52.uFrameWidth = 148;
|
|
3765 v52.uFrameZ = 334;
|
|
3766 v56 = v52.pStartingPosActiveItem;
|
|
3767 if ( v52.pStartingPosActiveItem < v52.pStartingPosActiveItem + v52.pNumPresenceButton )
|
|
3768 {
|
|
3769 v15 = "";//(char *)v54;
|
|
3770 while ( 1 )
|
|
3771 {
|
|
3772 v16 = v52.GetControl(v56);
|
|
3773 v17 = v16->msg_param;
|
|
3774 pInString = (char *)v16;
|
|
3775 if ( (signed int)v17 > 24 )
|
|
3776 {
|
|
3777 v24 = v17 - 76;
|
|
3778 if ( !v24 )
|
|
3779 {
|
|
3780 v15 = pGlobalTXT_LocalizationStrings[406];
|
|
3781 goto LABEL_49;
|
|
3782 }
|
|
3783 v25 = v24 - 1;
|
|
3784 if ( !v25 )
|
|
3785 {
|
|
3786 v15 = pGlobalTXT_LocalizationStrings[407];
|
|
3787 goto LABEL_49;
|
|
3788 }
|
|
3789 v26 = v25 - 2;
|
|
3790 if ( !v26 )
|
|
3791 {
|
|
3792 v33 = _4B254D_SkillMasteryTeacher((int)v52.ptr_1C);
|
|
3793 LABEL_44:
|
|
3794 v15 = v33;
|
|
3795 LABEL_45:
|
|
3796 v16 = (GUIButton *)pInString;
|
|
3797 goto LABEL_49;
|
|
3798 }
|
|
3799 v27 = v26 - 3;
|
|
3800 if ( !v27 )
|
|
3801 {
|
|
3802 v33 = (char *)ContractSelectText((int)v52.ptr_1C);
|
|
3803 goto LABEL_44;
|
|
3804 }
|
|
3805 v28 = v27 - 1;
|
|
3806 if ( !v28 )
|
|
3807 {
|
|
3808 v29 = (char *)&pMonsterStats + 88 * word_F8B1A0;
|
|
3809 v30 = TargetColor(0xFFu, 0xFFu, 0xFFu);
|
|
3810 v31 = *(int *)v29;
|
|
3811 v32 = TargetColor(0xFFu, 0xFFu, 0x9Bu);
|
|
3812 sprintfex(pTmpBuf.data(), "\f%05d%s\f%05d", v32, v31, v30);
|
|
3813 sprintfex(pTmpBuf2.data(), dword_F8B1A4, pTmpBuf.data(), 100 * (unsigned __int8)v29[8]);
|
|
3814 current_npc_text = pTmpBuf2.data();
|
|
3815 v15 = "";
|
|
3816 goto LABEL_45;
|
|
3817 }
|
|
3818 if ( v28 != 10 )
|
|
3819 goto LABEL_41;
|
|
3820 }
|
|
3821 else
|
|
3822 {
|
|
3823 if ( v17 == 24 )
|
|
3824 {
|
|
3825 v23 = v58->evt_F;
|
|
3826 LABEL_33:
|
|
3827 v15 = (char *)pNPCTopics[v23-1].pTopic;//(&dword_721660)[8 * v23];
|
|
3828 if ( !v15 )
|
|
3829 {
|
|
3830 v16->msg_param = 0;
|
|
3831 v15 = "";
|
|
3832 }
|
|
3833 goto LABEL_49;
|
|
3834 }
|
|
3835 v18 = v17 - 13;
|
|
3836 if ( v18 )
|
|
3837 {
|
|
3838 v19 = v18 - 6;
|
|
3839 if ( !v19 )
|
|
3840 {
|
|
3841 v23 = v58->evt_A;
|
|
3842 goto LABEL_33;
|
|
3843 }
|
|
3844 v20 = v19 - 1;
|
|
3845 if ( !v20 )
|
|
3846 {
|
|
3847 v15 = (char *)pNPCTopics[v58->evt_B-1].pTopic;//(&dword_721660)[8 * v58->evtb];
|
|
3848 if ( !v15 )
|
|
3849 {
|
|
3850 v16->msg_param = 0;
|
|
3851 v15 = "";
|
|
3852 }
|
|
3853 if ( uDialogueType != 84 )
|
|
3854 goto LABEL_49;
|
|
3855 sprintf(pTmpBuf.data(), format_4E2D80, v55, pItemsTable->pItems[contract_approved].pUnidentifiedName);
|
|
3856 sprintf(pTmpBuf2.data(), current_npc_text, pTmpBuf.data());
|
|
3857 current_npc_text = pTmpBuf2.data();
|
|
3858 goto LABEL_45;
|
|
3859 }
|
|
3860 v21 = v20 - 1;
|
|
3861 if ( !v21 )
|
|
3862 {
|
|
3863 v23 = v58->evt_C;
|
|
3864 goto LABEL_33;
|
|
3865 }
|
|
3866 v22 = v21 - 1;
|
|
3867 if ( !v22 )
|
|
3868 {
|
|
3869 v23 = v58->evt_D;
|
|
3870 goto LABEL_33;
|
|
3871 }
|
|
3872 if ( v22 == 1 )
|
|
3873 {
|
|
3874 v23 = v58->evt_E;
|
|
3875 goto LABEL_33;
|
|
3876 }
|
|
3877 LABEL_41:
|
|
3878 v15 = "";
|
|
3879 goto LABEL_49;
|
|
3880 }
|
|
3881 v15 = pGlobalTXT_LocalizationStrings[122];
|
|
3882 }
|
|
3883 LABEL_49:
|
|
3884 strcpy(v16->pButtonName, v15);
|
|
3885 ++v56;
|
|
3886 if ( v56 >= v52.pStartingPosActiveItem + v52.pNumPresenceButton )
|
|
3887 {
|
|
3888 v14 = pDialogueWindow;
|
|
3889 break;
|
|
3890 }
|
|
3891 }
|
|
3892 }
|
|
3893 v34 = 0;
|
|
3894 v54 = TargetColor(0xFFu, 0xFFu, 0xFFu);
|
|
3895 v35 = TargetColor(0xE1u, 0xCDu, 0x23u);
|
|
3896 v36 = v14->pStartingPosActiveItem;
|
|
3897 v55 = v35;
|
|
3898 for ( i = v36 + v14->pNumPresenceButton; (signed int)v36 < (signed int)i; i = pDialogueWindow->pNumPresenceButton
|
|
3899 + pDialogueWindow->pStartingPosActiveItem )
|
|
3900 {
|
|
3901 v37 = v14->GetControl(v36);
|
|
3902 v38 = pFontArrus->CalcTextHeight(v37->pButtonName, &v52, 0, 0);
|
|
3903 v14 = pDialogueWindow;
|
|
3904 v34 += v38;
|
|
3905 ++v36;
|
|
3906 }
|
|
3907 v39 = v14->pNumPresenceButton;
|
|
3908 if ( v39 )
|
|
3909 {
|
|
3910 v58 = (NPCData *)((174 - v34) / v39);
|
|
3911 if ( (signed int)v58 > 32 )
|
|
3912 v58 = (NPCData *)32;
|
|
3913 pInString = (char *)2;
|
|
3914 v40 = (174 - (signed int)v58 * v39 - v34) / 2 - (signed int)v58 / 2 + 138;
|
|
3915 v56 = v14->pStartingPosActiveItem;
|
|
3916 i = v56;
|
|
3917 if ( (signed int)i < (signed int)(i + v39) )
|
|
3918 {
|
|
3919 while ( 1 )
|
|
3920 {
|
|
3921 v41 = v14->GetControl(i);
|
|
3922 v42 = v41;
|
|
3923 v43 = v41->pButtonName;
|
|
3924 v41->uY = (unsigned int)((char *)v58 + v40);
|
|
3925 v44 = pFontArrus->CalcTextHeight(v41->pButtonName, &v52, 0, 0);
|
|
3926 v45 = v42->uY;
|
|
3927 v42->uHeight = v44;
|
|
3928 v40 = v45 + v44 - 1;
|
|
3929 v42->uW = v40;
|
|
3930 v46 = v55;
|
|
3931 if ( (char *)pDialogueWindow->pCurrentPosActiveItem != pInString )
|
|
3932 v46 = v54;
|
|
3933 v52.DrawTitleText(pFontArrus, 0, v45, v46, v43, 3u);
|
|
3934 v14 = pDialogueWindow;
|
|
3935 ++pInString;
|
|
3936 ++v56;
|
|
3937 i = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem;
|
|
3938 if ( v56 >= (signed int)i )
|
|
3939 break;
|
|
3940 i = v56;
|
|
3941 }
|
|
3942 }
|
|
3943 }
|
|
3944 if ( current_npc_text )
|
|
3945 {
|
|
3946 w.uFrameWidth = 458;
|
|
3947 w.uFrameZ = 457;
|
|
3948 v47 = pFontArrus;
|
|
3949 v48 = pFontArrus->CalcTextHeight(current_npc_text, &w, 13, 0) + 7;
|
|
3950 if ( 352 - v48 < 8 )
|
|
3951 {
|
|
3952 v47 = pFontCreate;
|
|
3953 v48 = pFontCreate->CalcTextHeight(current_npc_text, &w, 13, 0) + 7;
|
|
3954 }
|
|
3955 pRenderer->_4A6A68(8, 352 - v48,
|
|
3956 pIcons_LOD->GetTexture(uTextureID_Leather),
|
|
3957 pIcons_LOD->GetTexture(uTextureID_Leather)->uTextureHeight - v48);
|
|
3958 pRenderer->DrawTextureIndexed(8u, 347 - v48, pTexture_591428);
|
|
3959 v49 = FitTextInAWindow(current_npc_text, v47, &w, 0xDu, 0);
|
|
3960 a1.DrawText(v47, 13, 354 - v48, 0, v49, 0, 0, 0);
|
|
3961 }
|
|
3962 }
|
1300
|
3963 //----- (004B4F4F) --------------------------------------------------------
|
|
3964 void JailDialog()
|
1298
|
3965 {
|
1300
|
3966 const char *v0; // esi@1
|
|
3967 const char *v1; // ST10_4@1
|
|
3968 unsigned __int16 v2; // ST0C_2@1
|
|
3969 int v3; // eax@1
|
|
3970 GUIWindow v5; // [sp+8h] [bp-54h]@1
|
1298
|
3971
|
1300
|
3972 memcpy(&v5, window_SpeakInHouse, sizeof(v5));
|
|
3973 v0 = pGlobalTXT_LocalizationStrings[672];
|
|
3974 v1 = pGlobalTXT_LocalizationStrings[672];
|
|
3975 v5.uFrameX = 483;
|
|
3976 v5.uFrameWidth = 148;
|
|
3977 v5.uFrameZ = 334;
|
|
3978 v2 = TargetColor(0xFFu, 0xFFu, 0x9Bu);
|
|
3979 v3 = pFontArrus->CalcTextHeight(v0, &v5, 0, 0);
|
|
3980 v5.DrawTitleText(pFontArrus, 0, (310 - v3) / 2 + 18, v2, v1, 3u);
|
1298
|
3981 } |