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