annotate UI/UIHouses.cpp @ 1298:b97d0cdd6c79

new folder UI
author Ritor1
date Wed, 19 Jun 2013 17:18:35 +0600
parents
children 8c2f689b5f0b
rev   line source
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1 #ifdef _MSC_VER
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2 #define _CRT_SECURE_NO_WARNINGS
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3 #endif
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5 #include "Texture.h"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6 #include "mm7_data.h"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7 #include "UIHouses.h"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
8 #include "Party.h"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
9 #include "texts.h"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
10 #include "Events.h"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
11 #include "Arcomage.h"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
12 #include "LOD.h"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
13 #include "Mouse.h"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
14 #include "GUIWindow.h"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
15 #include "GUIFont.h"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
16 #include "Events2D.h"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
17 #include "Overlays.h"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
18 #include "Outdoor.h"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
19 #include "AudioPlayer.h"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
20 #include "VideoPlayer.h"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
21 #include "Monsters.h"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
22 #include "Viewport.h"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
23 #include "Keyboard.h"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
24 #include "IndoorCamera.h"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
25 #include "MapInfo.h"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
26 #include "Log.h"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
27 #include "Game.h"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
28
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
29 #include "stru159.h"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
30 int uHouse_ExitPic; // weak
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
31
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
32 int dword_591080; // weak
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
33
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
34 int in_current_building_type; // 00F8B198
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
35 HOUSE_DIALOGUE_MENU dialog_menu_id; // 00F8B19C
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
36
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
37 #pragma pack(push, 1)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
38 struct stru365_travel_info
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
39 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
40 unsigned char uMapInfoID;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
41 unsigned char pSchedule[7];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
42 unsigned int uTravelTime;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
43 int arrival_x;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
44 int arrival_y;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
45 int arrival_z;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
46 int arrival_rot_y;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
47 unsigned int uQuestBit; // quest bit required to set for this travel option to be enabled; otherwise 0
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
48 };
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
49 #pragma pack(pop)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
50 stru365_travel_info transport_schedule[35] = // 004F09B0
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
51 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
52 {MAP_STEADWICK, {1, 0, 1, 0, 1, 0, 0}, 2, -18048, 4636, 833, 1536, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
53 {MAP_PIERPONT, {0, 1, 0, 1, 0, 1, 0}, 2, -2527, -6773, 1153, 896, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
54 {MAP_TATALIA, {1, 0, 1, 0, 1, 0, 0}, 2, 4730, -10580, 320, 1024, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
55 {MAP_HARMONDALE, {0, 1, 0, 1, 0, 1, 0}, 2, -5692, 11137, 1, 1024, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
56 {MAP_DEYJA, {1, 0, 0, 1, 0, 0, 0}, 3, 7227, -16007, 2625, 640, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
57 {MAP_BRAKADA_DESERT, {0, 0, 1, 0, 0, 1, 0}, 3, 8923, 17191, 1, 512, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
58 {MAP_AVLEE, {1, 0, 1, 0, 1, 0, 0}, 3, 17059, 12331, 512, 1152, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
59 {MAP_DEYJA, {0, 1, 0, 0, 1, 0, 1}, 2, 7227, -16007, 2625, 640, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
60 {MAP_HARMONDALE, {0, 1, 0, 1, 0, 1, 0}, 2, -5692, 11137, 1, 1024, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
61 {MAP_STEADWICK, {1, 0, 1, 0, 1, 0, 0}, 3, -18048, 4636, 833, 1536, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
62 {MAP_PIERPONT, {0, 1, 0, 1, 0, 1, 0}, 2, -2527, -6773, 1153, 896, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
63 {MAP_STEADWICK, {1, 0, 1, 0, 1, 0, 1}, 3, -18048, 4636, 833, 1536, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
64 {MAP_HARMONDALE, {0, 1, 0, 0, 0, 1, 0}, 5, -5692, 11137, 1, 1024, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
65 {MAP_STEADWICK, {0, 1, 0, 1, 0, 1, 0}, 2, -18048, 4636, 833, 1536, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
66 {MAP_PIERPONT, {0, 1, 0, 1, 0, 1, 0}, 3, -2527, -16007, 1153, 896, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
67 {MAP_DEYJA, {0, 0, 1, 0, 0, 0, 1}, 5, 7227, -16007, 2625, 640, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
68 {MAP_TATALIA, {0, 1, 0, 1, 0, 1, 0}, 2, -2183, -6941, 97, 0, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
69 {MAP_AVLEE, {1, 0, 0, 0, 1, 0, 0}, 4, 7913, 9476, 193, 0, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
70 {MAP_EVENMORN_ISLE, {0, 0, 0, 0, 0, 0, 1}, 7, 15616, 6390, 193, 1536, PARTY_QUEST_EVENMORN_MAP_FOUND},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
71 {MAP_BRAKADA_DESERT, {0, 0, 1, 0, 0, 0, 0}, 6, 19171, -19722, 193, 1024, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
72 {MAP_AVLEE, {0, 1, 0, 1, 0, 1, 0}, 3, 7913, 9476, 193, 0, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
73 {MAP_BRAKADA_DESERT, {1, 0, 1, 0, 0, 0, 0}, 6, 19171, -19722, 193, 1024, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
74 {MAP_TATALIA, {1, 0, 1, 0, 1, 0, 0}, 4, -2183, -6941, 97, 0, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
75 {MAP_PIERPONT, {0, 0, 0, 0, 0, 1, 0}, 6, -709, -14087, 193, 1024, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
76 {MAP_STEADWICK, {0, 0, 0, 0, 0, 0, 1}, 6, -10471, 13497, 193, 1536, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
77 {MAP_EVENMORN_ISLE, {0, 1, 0, 1, 0, 0, 0}, 1, 15616, 6390, 193, 1536, PARTY_QUEST_EVENMORN_MAP_FOUND},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
78 {MAP_BRAKADA_DESERT, {0, 1, 0, 1, 0, 0, 0}, 1, 19171, -19722, 193, 1024, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
79 {MAP_STEADWICK, {0, 1, 0, 1, 0, 1, 0}, 2, -10471, 13497, 193, 1536, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
80 {MAP_BRAKADA_DESERT, {1, 0, 1, 0, 0, 0, 0}, 4, 19171, -19722, 193, 1024, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
81 {MAP_EVENMORN_ISLE, {0, 0, 0, 0, 0, 0, 1}, 5, 15616, 6390, 193, 1536, PARTY_QUEST_EVENMORN_MAP_FOUND},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
82 {MAP_AVLEE, {0, 0, 0, 0, 1, 0, 0}, 5, 7913, 9476, 193, 0, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
83 {MAP_STEADWICK, {0, 1, 0, 0, 0, 1, 0}, 4, -10471, 13497, 193, 1536, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
84 {MAP_PIERPONT, {1, 0, 1, 0, 1, 0, 0}, 3, -709, -14087, 193, 1024, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
85 {MAP_TATALIA, {0, 0, 0, 1, 0, 0, 0}, 5, -2183, -6941, 97, 0, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
86 {MAP_ARENA, {0, 0, 0, 0, 0, 0, 1}, 4, 3844, 2906, 193, 512, 0}
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
87 };
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
88
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
89 unsigned char transport_routes[20][4] =
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
90 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
91 { 0, 1, 1, 34}, // HOUSE_STABLES_HARMONDALE
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
92 { 2, 3, 4, 5}, // HOUSE_STABLES_STEADWICK
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
93 { 6, 7, 8, 8}, // HOUSE_STABLES_56
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
94 { 9, 10, 10, 10}, // HOUSE_STABLES_57
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
95 { 11, 11, 12, 12}, // HOUSE_STABLES_58
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
96 { 13, 13, 13, 13}, // HOUSE_STABLES_59
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
97 { 14, 14, 15, 15}, // HOUSE_STABLES_60
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
98 {255, 255, 255, 255}, // HOUSE_STABLES_61
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
99 {255, 255, 255, 255}, // HOUSE_STABLES_62
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
100 {255, 255, 255, 255}, // HOUSE_BOATS_63
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
101 { 16, 17, 18, 19}, // HOUSE_BOATS_64
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
102 { 18, 20, 21, 21}, // HOUSE_BOATS_65
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
103 { 22, 23, 24, 25}, // HOUSE_BOATS_66
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
104 { 22, 22, 23, 23}, // HOUSE_BOATS_67
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
105 {255, 255, 255, 255}, // HOUSE_BOATS_68
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
106 { 27, 28, 29, 30}, // HOUSE_BOATS_69
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
107 { 31, 32, 33, 33}, // HOUSE_BOATS_70
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
108 { 24, 24, 24, 24}, // HOUSE_BOATS_71
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
109 {255, 255, 255, 255}, // HOUSE_BOATS_72
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
110 {255, 255, 255, 255} // HOUSE_BOATS_73
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
111 };
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
112
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
113
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
114
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
115
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
116
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
117 std::array<const stru159, 196> pAnimatedRooms = //0x4E5F70
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
118 {{
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
119 {"", 0x4, 0x1F4, 0, 0, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
120 {"Human Armor01", 0x20, 0x2C0, 2, 58, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
121 {"Necromancer Armor01", 0x20, 0x2D7, 2, 70, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
122 {"Dwarven Armor01", 0x20, 0x2EE, 2, 5, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
123 {"Wizard Armor", 0x20, 0x3BD, 2, 19, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
124 {"Warlock Armor", 0x20, 0x2D6, 2, 35, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
125 {"Elf Armor", 0x20, 0x2BC, 2, 79, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
126 {"Human Alchemisht01", 0xE, 0x2BE, 4, 95, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
127 {"Necromancer Alchemist01", 0xE, 0x2D6, 4, 69, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
128 {"Dwarven Achemist01", 0xE, 0x387, 4, 4, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
129 {"Wizard Alchemist", 0xE, 0x232, 4, 25, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
130 {"Warlock Alchemist", 0xE, 0x2BE, 4, 42, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
131 {"Elf Alchemist", 0xE, 0x38A, 4, 84, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
132 {"Human Bank01", 0x6, 0x384, 22, 52, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
133 {"Necromancer Bank01", 0x6, 0x2D8, 22, 71, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
134 {"Dwarven Bank", 0x6, 0x2F3, 22, 6, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
135 {"Wizard Bank", 0x6, 0x3BA, 22, 20, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
136 {"Warlock Bank", 0x6, 0x39F, 22, 36, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
137 {"Elf Bank", 0x6, 0x2BC, 22, 71, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
138 {"Boat01", 0xF, 0x4C, 28, 53, 3 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
139 {"Boat01d", 0xF, 0x4C, 28, 53, 3 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
140 {"Human Magic Shop01", 0xA, 0x2C8, 3, 54, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
141 {"Necromancer Magic Shop01", 0xE, 0x2DC, 3, 66, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
142 {"Dwarven Magic Shop01", 0x2A, 0x2EF, 3, 91, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
143 {"Wizard Magic Shop", 0x1E, 0x2DF, 3, 15, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
144 {"Warlock Magic Shop", 0x7, 0x3B9, 3, 15, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
145 {"Elf Magic Shop", 0x24, 0x2CC, 3, 82, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
146 {"Human Stables01", 0x21, 0x31, 27, 48, 3 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
147 {"Necromancer Stables", 0x21, 0x2DD, 27, 67, 3 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
148 {"", 0x21, 0x2F0, 27, 91, 3 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
149 {"Wizard Stables", 0x21, 0x3BA, 27, 16, 3 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
150 {"Warlock Stables", 0x21, 0x181, 27, 77, 3 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
151 {"Elf Stables", 0x21, 0x195, 27, 77, 3 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
152 {"Human Tavern01", 0xD, 0x2C2, 21, 49, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
153 {"Necromancer Tavern01", 0xD, 0x3B0, 21, 57, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
154 {"Dwarven Tavern01", 0xD, 0x2FE, 21, 94, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
155 {"Wizard Tavern", 0xD, 0x3BB, 21, 17, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
156 {"Warlock Tavern", 0xD, 0x3A8, 21, 33, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
157 {"Elf Tavern", 0xD, 0x2CD, 21, 78, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
158 {"Human Temple01", 0x24, 0x2DB, 23, 50, 3 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
159 {"Necromancer Temple", 0x24, 0x2DF, 23, 60, 3 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
160 {"Dwarven Temple01", 0x24, 0x2F1, 23, 86, 3 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
161 {"Wizard Temple", 0x24, 0x2E0, 23, 10, 3 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
162 {"Warlock Temple", 0x24, 0x3A4, 23, 27, 3 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
163 {"Elf Temple", 0x24, 0x2CE, 23, 72, 3 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
164 {"Human Town Hall", 0x10, 0x39C, 17, 14, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
165 {"Necromancer Town Hall01", 0x10, 0x3A4, 17, 61, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
166 {"Dwarven Town Hall", 0x10, 0x2DB, 17, 88, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
167 {"Wizard Town Hall", 0x10, 0x3BD, 17, 11, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
168 {"Warlock Town Hall", 0x10, 0x2DB, 17, 28, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
169 {"Elf Town Hall", 0x10, 0x27A, 17, 73, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
170 {"Human Training Ground01", 0x18, 0x2C7, 30, 44, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
171 {"Necromancer Training Ground", 0x18, 0x3AD, 30, 62, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
172 {"Dwarven Training Ground", 0x18, 0x2F2, 30, 89, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
173 {"Wizard Training Ground", 0x18, 0x3A3, 30, 12, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
174 {"Warlock Training Ground", 0x18, 0x3A6, 30, 29, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
175 {"Elf Training Ground", 0x18, 0x19F, 30, 74, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
176 {"Human Weapon Smith01", 0x16, 0x2C1, 1, 45, 4 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
177 {"Necromancer Weapon Smith01", 0x16, 0x2D9, 1, 63, 4 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
178 {"Dwarven Weapon Smith01", 0x16, 0x2EE, 1, 82, 4 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
179 {"Wizard Weapon Smith", 0x16, 0x2D5, 1, 13, 4 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
180 {"Warlock Weapon Smith", 0x16, 0x2D7, 1, 23, 4 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
181 {"Elf Weapon Smith", 0x16, 0x2CA, 1, 75, 4 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
182 {"Air Guild", 0x1D, 0xA4, 6, 1, 3 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
183 {"Body Guild", 0x19, 0x3BF, 11, 2, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
184 {"DarkGuild", 0x19, 0x2D1, 13, 3, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
185 {"EarthGuild", 0x19, 0x2CB, 8, 83, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
186 {"Fire Guild", 0x1C, 0x2BF, 5, 56, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
187 {"Light Guild", 0x1C, 0x2D5, 12, 46, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
188 {"Mind Guild", 0x1C, 0xE5, 10, 40, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
189 {"Spirit Guild", 0x1C, 0x2D2, 9, 41, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
190 {"Water Guild", 0x1B, 0x2D3, 7, 24, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
191 {"Lord And Judge Out01", 1, 0, 29, 39, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
192 {"Human Poor House 1", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
193 {"Human Poor House 2", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
194 {"Human Poor House 3", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
195 {"Human Medium House 1", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
196 {"Human Medium House 2", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
197 {"Human Medium House 3", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
198 {"Human Rich House 1", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
199 {"Human Rich House 2", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
200 {"Human Rich House 3", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
201 {"Elven Poor House 1", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
202 {"Elven Poor House 2", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
203 {"Elven Poor House 3", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
204 {"Elven Medium House 1", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
205 {"Elven Medium House 2", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
206 {"Elven Medium House 3", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
207 {"Elven Rich House 1", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
208 {"Elven Rich House 2", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
209 {"Elven Rich House 3", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
210 {"Dwarven Poor House 1", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
211 {"Dwarven Poor House 2", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
212 {"Dwarven Poor House 3", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
213 {"Dwarven Medium House 1", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
214 {"Dwarven Medium house 2", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
215 {"Dwarven Medium House 3", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
216 {"Dwarven Rich House 1", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
217 {"Dwarven Rich House 2", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
218 {"Dwarven Rich House 3", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
219 {"Wizard Poor House 1", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
220 {"Wizard Poor House 2", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
221 {"Wizard Poor House 3", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
222 {"Wizard Medium House 1", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
223 {"Wizard Medium House 2", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
224 {"Wizard Mdeium House 3", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
225 {"Wizard Rich House 1", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
226 {"Wizard Rich House 2", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
227 {"Wizard Rich House 3", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
228 {"Necromancer Poor House 1", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
229 {"Necromancer Poor House 2", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
230 {"Necromancer Poor House 3", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
231 {"Necromancer Medium House 1", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
232 {"Necromancer Medium House 2", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
233 {"Necromancer Mdeium House 3", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
234 {"Necromancer Rich House 1", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
235 {"Necromancer Rich House 2", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
236 {"Necromancer Rich House 3", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
237 {"Warlock Poor House 1", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
238 {"Warlock Poor House 2", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
239 {"Warlock Poor House 3", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
240 {"Warlock Medium House 1", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
241 {"Warlock Medium House 2", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
242 {"Warlock Mdeium House 3", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
243 {"Warlock Rich House 1", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
244 {"Warlock Rich House 2", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
245 {"Warlock Rich House 3", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
246 {"Out01 Temple of the Moon", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
247 {"Out01 Dragon Cave", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
248 {"Out02 Castle Harmondy", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
249 {"Out02 White Cliff Cave", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
250 {"Out03 Erathian Sewer", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
251 {"Out03 Fort Riverstride", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
252 {"Out03 Castle Gryphonheart", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
253 {"Out04 Elf Castle", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
254 {"Out04 Tularean Caves", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
255 {"Out04 Clanker's Laboratory", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
256 {"Out05 Hall of the Pit", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
257 {"Out05 Watchtower 6", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
258 {"Out06 School of Sorcery", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
259 {"Out06 Red Dwarf Mines", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
260 {"Out07 Castle Lambert", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
261 {"Out07 Walls of Mist", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
262 {"Out07 Temple of the Light", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
263 {"Out08 Evil Entrance", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
264 {"Out08 Breeding Zone", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
265 {"Out08 Temple of the Dark", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
266 {"Out09 Grand Temple of the Moon", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
267 {"Out09 Grand Tempple of the Sun", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
268 {"Out10 Thunderfist Mountain", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
269 {"Out10 The Maze", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
270 {"Out10 Connecting Tunnel Cave #1", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
271 {"", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
272 {"", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
273 {"Out11 Stone City", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
274 {"", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
275 {"Out12 Colony Zod", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
276 {"Out12 Connecting Tunnel Cave #1", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
277 {"", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
278 {"", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
279 {"Out13 Mercenary Guild", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
280 {"Out13 Tidewater Caverns", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
281 {"Out13 Wine Cellar", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
282 {"Out14 Titan's Stronghold", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
283 {"Out14 Temple Of Baa", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
284 {"Out14 Hall under the Hill", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
285 {"Out15 The Linclon", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
286 {"Jail", 0x24, 0, 31, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
287 {"Harmondale Throne Room", 0x24, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
288 {"Gryphonheart Throne Room", 0x24, 0, 20, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
289 {"Elf Castle Throne Room", 0x24, 0, 20, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
290 {"Wizard Castle Throne Room", 0x24, 0, 20, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
291 {"Necromancer Casstle Trone Room", 0x24, 0, 20, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
292 {"Master Thief", 0x24, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
293 {"Dwarven King", 0x24, 0, 20, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
294 {"Arms Master", 0x24, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
295 {"Warlock", 0x24, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
296 {"Lord Markam", 0x24, 0, 20, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
297 {"Arbiter Neutral Town", 0x24, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
298 {"Arbiter Good Town", 0x24, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
299 {"Arbiter Evil Town", 0x24, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
300 {"Necromancer Throne Room Empty", 0x24, 0, 20, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
301 {"", 0x24, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
302 {"", 0x24, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
303 {"", 0x24, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
304 {"", 0x24, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
305 {"Boat01", 0xF, 0, 29, 53, 3 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
306 {"", 0x24, 0, 28, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
307 {"", 0x24, 0, 28, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
308 {"", 0x24, 0, 28, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
309 {"", 0x24, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
310 {"Arbiter Room Neutral", 0x24, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
311 {"Out02 Castle Harmondy Abandoned", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
312 {"Human Temple02", 0x24, 0x3AB, 23, 27, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
313 {"Player Castle Good", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
314 {"Player Castle Bad", 0x24, 0, 25, 0, 0}
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
315 }};
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
316
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
317
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
318
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
319 //----- (0044606A) --------------------------------------------------------
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
320 void PrepareHouse(HOUSE_ID house)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
321 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
322 //unsigned int v1; // ebx@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
323 //signed int v2; // esi@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
324 //int uExitPic; // edi@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
325 __int16 uExitMapID; // ax@2
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
326 //int result; // eax@5
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
327 //unsigned int *v6; // ecx@8
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
328 int v7; // ebx@11
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
329 //int v8; // esi@16
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
330 //unsigned int v9; // eax@16
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
331 //unsigned int v10; // eax@19
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
332 //int v11; // ecx@19
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
333 //char pContainer[36]; // [sp+Ch] [bp-54h]@16
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
334 int v13; // [sp+30h] [bp-30h]@11
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
335 int npc_id_arr[6]; // [sp+34h] [bp-2Ch]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
336 //unsigned int v15; // [sp+4Ch] [bp-14h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
337 int uAnimationID; // [sp+50h] [bp-10h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
338 //unsigned int *v17; // [sp+54h] [bp-Ch]@3
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
339 //unsigned int v18; // [sp+58h] [bp-8h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
340 //int v19; // [sp+5Ch] [bp-4h]@7
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
341
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
342
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
343 uAnimationID = p2DEvents[house - 1].uAnimationID;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
344 memset(npc_id_arr, 0, sizeof(npc_id_arr));
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
345 uNumDialogueNPCPortraits = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
346 uHouse_ExitPic = p2DEvents[house - 1].uExitPicID;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
347 if ( uHouse_ExitPic )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
348 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
349 uExitMapID = p2DEvents[house - 1]._quest_related;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
350 if ( uExitMapID > 0 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
351 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
352 if(_449B57_test_bit(pParty->_quest_bits,uExitMapID))
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
353 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
354 uHouse_ExitPic = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
355 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
356 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
357 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
358
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
359 dword_591080 = pAnimatedRooms[uAnimationID].house_npc_id;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
360 HouseNPCData[0]=0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
361 uNumDialogueNPCPortraits = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
362 if ( dword_591080 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
363 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
364
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
365 npc_id_arr[0] = dword_591080;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
366 uNumDialogueNPCPortraits = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
367 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
368
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
369 for (uint i = 1; i < pNPCStats->uNumNewNPCs; ++i)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
370 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
371 if (pNPCStats->pNewNPCData[i].Location2D == house )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
372 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
373 if (!(pNPCStats->pNewNPCData[i].uFlags & 0x80))
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
374 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
375
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
376 HouseNPCData[uNumDialogueNPCPortraits+1- (dword_591080 != 0) ? 1 : 0] = &pNPCStats->pNewNPCData[i];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
377 npc_id_arr[uNumDialogueNPCPortraits] = pNPCStats->pNewNPCData[i].uPortraitID;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
378 ++uNumDialogueNPCPortraits;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
379 if ((pNPCStats->pNewNPCData[i].uFlags & 3) != 2)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
380 ++pNPCStats->pNewNPCData[i].uFlags;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
381 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
382 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
383
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
384 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
385
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
386 for (uint i = 0; i < uNumDialogueNPCPortraits; ++i)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
387 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
388
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
389 char icon_name[128];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
390 sprintfex(icon_name, "npc%03u", npc_id_arr[i]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
391 pDialogueNPCPortraits[i] = pIcons_LOD->LoadTexturePtr(icon_name, TEXTURE_16BIT_PALETTE);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
392 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
393
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
394 if (uHouse_ExitPic)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
395 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
396 pDialogueNPCPortraits[uNumDialogueNPCPortraits] = pIcons_LOD->LoadTexturePtr(pHouse_ExitPictures[uHouse_ExitPic], TEXTURE_16BIT_PALETTE);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
397 ++uNumDialogueNPCPortraits;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
398 uHouse_ExitPic = p2DEvents[house - 1].uExitMapID;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
399 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
400 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
401
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
402
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
403 //----- (0044622E) --------------------------------------------------------
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
404 bool EnterHouse(enum HOUSE_ID uHouseID)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
405 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
406 //enum HOUSE_ID v1; // edi@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
407 //int v2; // edi@5
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
408 signed int uOpenTime; // eax@5
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
409 signed int uCloseTime; // esi@5
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
410 unsigned int v5; // esi@5
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
411 int v6; // edx@5
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
412 signed int am_pm_flag_open; // ecx@10
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
413 signed int am_pm_flag_close; // eax@10
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
414 int v9; // esi@10
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
415 //unsigned int v10; // esi@16
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
416 int v11; // ecx@17
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
417 unsigned int v12; // kr00_4@25
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
418 //Player *v13; // esi@25
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
419 int v14; // eax@25
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
420 //Player *v15; // esi@27
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
421 //signed int v16; // eax@32
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
422 unsigned int v17; // eax@37
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
423 signed int v18; // edi@37
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
424 signed int v19; // edi@41
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
425 //unsigned int v20; // ecx@41
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
426 //const char *v22; // [sp-4h] [bp-40h]@33
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
427 char pContainer[40]; // [sp+Ch] [bp-30h]@32
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
428 unsigned int v24; // [sp+34h] [bp-8h]@5
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
429 //enum HOUSE_ID v25; // [sp+38h] [bp-4h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
430
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
431 //v1 = uHouseID;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
432 //v25 = uHouseID;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
433 GameUI_Footer_TimedString[0] = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
434 pFooterString[0] = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
435 ShowStatusBarString("", 2u);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
436 if ( pMessageQueue_50CBD0->uNumMessages )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
437 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
438 viewparams->bRedrawGameUI = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
439 uDialogueType = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
440 pKeyActionMap->SetWindowInputStatus(3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
441 pKeyActionMap->ResetKeys();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
442 if (uHouseID == HOUSE_600 || uHouseID == HOUSE_601)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
443 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
444 GameOverMenu(0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
445 return 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
446 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
447 uOpenTime = p2DEvents[uHouseID - 1].uOpenTime;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
448 uCloseTime = p2DEvents[uHouseID - 1].uCloseTime;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
449 current_npc_text = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
450 dword_F8B1E4 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
451 dword_F8B1F4 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
452 memset(byte_F8B1F0.data(), 0, 4);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
453 memset(player_levels.data(), 0, 16);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
454 pRenderer->ClearZBuffer(0, 479);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
455
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
456 if (((uCloseTime - 1 <= uOpenTime)&&((pParty->uCurrentHour <uOpenTime)&&(pParty->uCurrentHour >(uCloseTime - 1))))||
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
457 ((uCloseTime - 1 > uOpenTime)&&((pParty->uCurrentHour < uOpenTime)||(pParty->uCurrentHour > (uCloseTime - 1)))))
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
458
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
459 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
460 am_pm_flag_open = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
461 am_pm_flag_close = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
462 if (uOpenTime > 12 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
463 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
464 uOpenTime -= 12;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
465 am_pm_flag_open = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
466 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
467 if ( uCloseTime > 12 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
468 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
469 uCloseTime -= 12;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
470 am_pm_flag_close = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
471 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
472 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[414], uOpenTime, aAMPMNames[am_pm_flag_open],
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
473 uCloseTime, aAMPMNames[am_pm_flag_close]); //"This place is open from %d%s to %d%s"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
474 ShowStatusBarString(pTmpBuf.data(), 2u);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
475 if ( uActiveCharacter )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
476 pPlayers[uActiveCharacter]->PlaySound(SPEECH_3, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
477 return 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
478 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
479 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
480 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
481 //v10 = uHouseID;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
482 if ( (signed int)uHouseID < 53 ) //entering shops and guilds
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
483 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
484 if ( !(pParty->field_3C._shop_ban_times[uHouseID])
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
485 || (pParty->field_3C._shop_ban_times[uHouseID] <= pParty->uTimePlayed) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
486 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
487 pParty->field_3C._shop_ban_times[uHouseID] = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
488 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
489 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
490 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
491 ShowStatusBarString(pGlobalTXT_LocalizationStrings[191], 2u);// "You've been banned from this shop!"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
492 return 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
493 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
494 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
495 pAudioPlayer->StopChannels(-1, -1);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
496
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
497 uCurrentHouse_Animation = p2DEvents[uHouseID - 1].uAnimationID;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
498 in_current_building_type = pAnimatedRooms[uCurrentHouse_Animation].uBuildingType;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
499 if ( in_current_building_type == BildingType_Throne_Room && pParty->uFine ) // going 2 jail
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
500 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
501 uCurrentHouse_Animation = (signed __int16)p2DEvents[186].uAnimationID;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
502 uHouseID = HOUSE_JAIL;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
503 pParty->uTimePlayed = pParty->uTimePlayed + 0x7620000;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
504 in_current_building_type = pAnimatedRooms[p2DEvents[HOUSE_LORD_AND_JUDGE_EMERALD_ISLE].uAnimationID].uBuildingType;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
505 ++pParty->uNumPrisonTerms;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
506 pParty->uFine = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
507 for (uint i = 0; i < 4; ++i)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
508 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
509 pParty->pPlayers[i].uTimeToRecovery = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
510 pParty->pPlayers[i].uNumDivineInterventionCastsThisDay = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
511 pParty->pPlayers[i].SetVariable(VAR_Award, 87);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
512 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
513 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
514 ++pIcons_LOD->uTexturePacksCount;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
515 if ( !pIcons_LOD->uNumPrevLoadedFiles )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
516 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
517 switch (pParty->alignment)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
518 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
519 case PartyAlignment_Good: sprintf(pContainer, "evt%02d-b", const_2()); break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
520 case PartyAlignment_Neutral: sprintf(pContainer, "evt%02d", const_2()); break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
521 case PartyAlignment_Evil: sprintf(pContainer, "evt%02d-c", const_2()); break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
522 default: assert(false);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
523 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
524
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
525 v17 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
526 pDialogueNPCCount = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
527 pTexture_Dialogue_Background = &pIcons_LOD->pTextures[v17];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
528 uTextureID_right_panel_loop = uTextureID_right_panel;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
529 PrepareHouse(uHouseID);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
530 v18 = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
531 uTextureID_right_panel_loop = uTextureID_right_panel;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
532 if ( uNumDialogueNPCPortraits == 1 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
533 pDialogueNPCCount = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
534 pVideoPlayer->OpenHouseMovie(pAnimatedRooms[uCurrentHouse_Animation].video_name, 1u);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
535 dword_5C35D4 = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
536 if ( (signed int)uHouseID < 139 || (signed int)uHouseID > 172 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
537 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
538 if ( (signed int)uHouseID >= HOUSE_STABLES_HARMONDALE && (signed int)uHouseID <= 73 && !IsTravelAvailable(uHouseID - HOUSE_STABLES_HARMONDALE) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
539 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
540 return 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
541 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
542 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
543 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
544 { //guilds
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
545 v19 = guild_mambership_flags[uHouseID - HOUSE_FIRE_GUILD_INITIATE_EMERALD_ISLE]; //guilds flags
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
546 //v20 = uHouseID;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
547 //if ( !((unsigned __int8)(0x80u >> v19 % 8) & pPlayers[uActiveCharacter]->_guilds_member_bits[v19 /8]) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
548 if(_449B57_test_bit(pPlayers[uActiveCharacter]->_guilds_member_bits,v19))
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
549 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
550 PlayHouseSound(uHouseID, HouseSound_Greeting_2);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
551 return 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
552 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
553 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
554 PlayHouseSound(uHouseID, HouseSound_Greeting);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
555 dword_5C35D4 = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
556 return 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
557 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
558 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
559
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
560 //----- (004B1E92) --------------------------------------------------------
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
561 void PlayHouseSound(unsigned int uHouseID, HouseSoundID sound)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
562 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
563 //if ( BYTE1(pAnimatedRooms[p2DEvents_minus1___02[26 * uHouseID]].field_C) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
564 if ( pAnimatedRooms[p2DEvents[uHouseID].uAnimationID].uRoomSoundId )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
565 pAudioPlayer->PlaySound(
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
566 //(SoundID)(a2 + 100 * (BYTE1(pAnimatedRooms[p2DEvents_minus1___02[26 * uHouseID]].field_C) + 300)),
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
567 (SoundID)(sound + 100 * (pAnimatedRooms[p2DEvents[uHouseID].uAnimationID].uRoomSoundId + 300)),
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
568 806, 0, -1, 0, 0, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
569 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
570
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
571 //----- (004B4F4F) --------------------------------------------------------
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
572 void JailDialog()
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
573 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
574 const char *v0; // esi@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
575 const char *v1; // ST10_4@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
576 unsigned __int16 v2; // ST0C_2@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
577 int v3; // eax@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
578 GUIWindow v5; // [sp+8h] [bp-54h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
579
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
580 memcpy(&v5, window_SpeakInHouse, sizeof(v5));
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
581 v0 = pGlobalTXT_LocalizationStrings[672];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
582 v1 = pGlobalTXT_LocalizationStrings[672];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
583 v5.uFrameX = 483;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
584 v5.uFrameWidth = 148;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
585 v5.uFrameZ = 334;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
586 v2 = TargetColor(0xFFu, 0xFFu, 0x9Bu);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
587 v3 = pFontArrus->CalcTextHeight(v0, &v5, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
588 v5.DrawTitleText(pFontArrus, 0, (310 - v3) / 2 + 18, v2, v1, 3u);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
589 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
590
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
591
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
592
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
593
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
594 //----- (004BCACC) --------------------------------------------------------
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
595 void __fastcall OnSelectShopDialogueOption(signed int uMessageParam)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
596 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
597 //unsigned int v1; // edi@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
598 //signed int v2; // ebx@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
599 //signed int v3; // ecx@2
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
600 int v4; // eax@5
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
601 signed int v5; // esi@5
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
602 //Player *v6; // ecx@5
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
603 //signed int v7; // edx@5
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
604 GUIWindow *v8; // esi@10
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
605 unsigned int v9; // eax@12
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
606 int v10; // esi@31
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
607 int v11; // edi@31
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
608 int v12; // esi@32
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
609 __int16 v13; // bp@32
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
610 int v14; // edx@32
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
611 GUIWindow *v15; // eax@32
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
612 int v16; // eax@32
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
613 int v17; // eax@33
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
614 int v18; // eax@34
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
615 int v19; // eax@35
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
616 __int16 v20; // ax@37
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
617 __int16 v21; // ax@76
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
618 __int16 v22; // ax@107
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
619 __int16 v23; // ax@132
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
620 __int16 v24; // ax@163
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
621 int v25; // esi@190
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
622 __int16 v26; // ax@190
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
623 char v27; // zf@190
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
624 Player *v28; // edi@192
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
625 int v29; // eax@204
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
626 void *v30; // esi@208
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
627 unsigned __int64 v31; // qax@208
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
628 signed int v32; // edi@209
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
629 int v33; // eax@210
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
630 unsigned int v34; // eax@211
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
631 //Player *v35; // edi@227
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
632 signed int v36; // esi@227
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
633 int v37; // ecx@227
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
634 int v38; // esi@230
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
635 int v39; // edx@235
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
636 int v40; // edi@243
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
637 unsigned __int64 v41; // qax@243
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
638 //void *v42; // eax@244
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
639 signed int v43; // edi@244
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
640 int v44; // edx@244
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
641 int v45; // eax@246
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
642 unsigned int v46; // eax@247
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
643 void *v47; // eax@250
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
644 signed int v48; // edi@250
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
645 int v49; // eax@252
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
646 int v50; // eax@256
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
647 unsigned int v51; // eax@257
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
648 void *v52; // eax@260
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
649 signed int v53; // edi@260
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
650 int v54; // eax@262
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
651 //signed int v55; // [sp+10h] [bp-10h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
652 int v56; // [sp+14h] [bp-Ch]@31
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
653
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
654 //v1 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
655 //v2 = a1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
656 //v55 = a1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
657 if ( !pDialogueWindow->pNumPresenceButton )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
658 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
659 pRenderer->ClearZBuffer(0, 479);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
660 //v3 = dword_F8B198;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
661 if ( dialog_menu_id != HOUSE_DIALOGUE_MAIN)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
662 v8 = window_SpeakInHouse;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
663 //else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
664 if (dialog_menu_id == HOUSE_DIALOGUE_MAIN)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
665 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
666 if ( in_current_building_type == BildingType_Training )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
667 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
668 if ( uMessageParam == HOUSE_DIALOGUE_TRAININGHALL_TRAIN )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
669 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
670 v4 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
671 v5 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
672 //v6 = pPlayers[uActiveCharacter];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
673 //v7 = pPlayers[uActiveCharacter]->uLevel;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
674 if ( pPlayers[uActiveCharacter]->uLevel > 0 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
675 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
676 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
677 v4 += v5++ + 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
678 while ( v5 < pPlayers[uActiveCharacter]->uLevel );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
679 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
680 if (pPlayers[uActiveCharacter]->uLevel < pMaxLevelPerTrainingHallType[(unsigned int)window_SpeakInHouse->ptr_1C - 89] &&
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
681 (signed __int64)pPlayers[uActiveCharacter]->uExperience < 1000 * v4)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
682 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
683 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
684 pDialogueWindow->Release();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
685 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x159u, WINDOW_MainMenu, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
686 pBtn_ExitCancel = pDialogueWindow->CreateButton(526, 445, 75, 33, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[74],// "End Conversation"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
687 pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
688 pDialogueWindow->CreateButton(8, 8, 0x1C2, 0x140, 1, 0, UIMSG_BuyInShop_Identify_Repair, 0, 0, "", nullptr);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
689 // LABEL_10:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
690 //v3 = dword_F8B198;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
691 v8 = window_SpeakInHouse;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
692 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
693 //else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
694 if ( in_current_building_type != BildingType_Training )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
695 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
696 v8 = window_SpeakInHouse;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
697 if ((in_current_building_type == BildingType_Stables || in_current_building_type == BildingType_Boats) &&
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
698 transport_schedule[transport_routes[(unsigned int)window_SpeakInHouse->ptr_1C - HOUSE_STABLES_HARMONDALE][uMessageParam - HOUSE_DIALOGUE_TRANSPORT_SCHEDULE_1]].pSchedule[pParty->uDaysPlayed % 7]
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
699 || in_current_building_type != BildingType_Temple || uMessageParam != BildingType_MindGuild )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
700 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
701 //LABEL_9:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
702 pDialogueWindow->Release();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
703 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x159u, WINDOW_MainMenu, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
704 pBtn_ExitCancel = pDialogueWindow->CreateButton(526, 445, 75, 33, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[74],// "End Conversation"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
705 pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
706 pDialogueWindow->CreateButton(8u, 8u, 0x1C2u, 0x140u, 1, 0, UIMSG_BuyInShop_Identify_Repair, 0, 0, "", nullptr);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
707 // LABEL_10:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
708 //v3 = dword_F8B198;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
709 v8 = window_SpeakInHouse;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
710 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
711 else if (uActiveCharacter)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
712 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
713 if ( !pPlayers[uActiveCharacter]->IsPlayerHealableByTemple() )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
714 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
715 v8 = window_SpeakInHouse;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
716 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
717 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
718 //LABEL_11:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
719 dialog_menu_id = (HOUSE_DIALOGUE_MENU)uMessageParam;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
720 if ( in_current_building_type < BildingType_19 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
721 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
722 v9 = pIcons_LOD->LoadTexture(off_4F03B8[in_current_building_type], TEXTURE_16BIT_PALETTE);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
723 //v3 = dword_F8B198;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
724 ShopTexture = &pIcons_LOD->pTextures[v9];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
725 //LABEL_13:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
726 v8 = window_SpeakInHouse;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
727 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
728 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
729
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
730 //NEW
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
731 switch(in_current_building_type)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
732 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
733 case BildingType_FireGuild:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
734 case BildingType_AirGuild:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
735 case BildingType_WaterGuild:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
736 case BildingType_EarthGuild:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
737 case BildingType_SpiritGuild:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
738 case BildingType_MindGuild:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
739 case BildingType_BodyGuild:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
740 case BildingType_LightGuild:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
741 case BildingType_DarkGuild:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
742 case BildingType_14:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
743 case BildingType_15:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
744 case BildingType_16:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
745 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
746 if ( *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)v8->ptr_1C + 44472] >= (signed __int64)pParty->uTimePlayed &&
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
747 *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)v8->ptr_1C + 44468] >= (signed __int64)pParty->uTimePlayed )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
748 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
749 v32 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
750 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
751 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
752 //v33 = *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v32 + 12 * (unsigned int)v8->ptr_1C));
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
753 v33 = pParty->SpellBooksInGuilds[v8->par1C-139][v32].uItemID;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
754 if ( v33 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
755 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
756 v34 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v33].pIconName, TEXTURE_16BIT_PALETTE);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
757 v8 = window_SpeakInHouse;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
758 ItemsInShopTexture[v32] = &pIcons_LOD->pTextures[v34];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
759 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
760 ++v32;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
761 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
762 while ( v32 < 12 );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
763 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
764 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
765 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
766 SpellBookGenerator();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
767 v30 = window_SpeakInHouse->ptr_1C;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
768 v31 = pParty->uTimePlayed + (signed __int64)((double)(0xA8C000
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
769 //* (signed int)p2DEvents_minus1[26 * (unsigned int)ptr_507BC0->ptr_1C])
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
770 * (signed int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].field_1C) * 0.033333335);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
771 *(int *)&stru_AA1058[3].pSounds[8 * (int)v30 + 44468] = v31;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
772 *(int *)&stru_AA1058[3].pSounds[8 * (int)v30 + 44472] = HIDWORD(v31);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
773 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
774 //return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
775 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
776 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
777 case BildingType_TownHall:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
778 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
779 if ( uMessageParam == 99 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
780 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
781 v10 = (int)((char *)v8->ptr_1C - 102);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
782 v56 = v10;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
783 v11 = 8 * v10 + 11325428;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
784 if ( pParty->field_3C.field_0[2 * v10 + 1] >= (signed __int64)pParty->uTimePlayed
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
785 && pParty->field_3C.field_0[2 * v10] >= (signed __int64)pParty->uTimePlayed )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
786 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
787 v13 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
788 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
789 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
790 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
791 v12 = v10;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
792 v13 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
793 pParty->field_75A[v12] = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
794 *(_QWORD *)v11 = (signed __int64)((double)(309657600 * (pParty->uCurrentMonth + 12i64 * pParty->uCurrentYear - 14015)) * 0.033333335);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
795 v14 = rand() % 258;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
796 v15 = window_SpeakInHouse;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
797 pParty->field_750[v12] = v14 + 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
798 v16 = (int)((char *)v15->ptr_1C - 102);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
799 if ( v16 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
800 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
801 v17 = v16 - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
802 if ( v17 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
803 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
804 v18 = v17 - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
805 if ( v18 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
806 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
807 v19 = v18 - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
808 if ( v19 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
809 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
810 if ( v19 == 1 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
811 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
812 while ( 1 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
813 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
814 v20 = pParty->field_750[v12];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
815 if ( (unsigned __int16)v20 < 0x73u || (unsigned __int16)v20 > 0x84u )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
816 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
817 if ( ((unsigned __int16)v20 < 0xE8u || (unsigned __int16)v20 > 0xF9u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
818 && ((unsigned __int16)v20 < 0x85u || (unsigned __int16)v20 > 0x96u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
819 && ((unsigned __int16)v20 < 0x97u || (unsigned __int16)v20 > 0xBAu)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
820 && ((unsigned __int16)v20 < 0xBEu || (unsigned __int16)v20 > 0xC0u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
821 && ((unsigned __int16)v20 < 0xC4u || (unsigned __int16)v20 > 0xC6u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
822 && ((unsigned __int16)v20 < 0x2Bu || (unsigned __int16)v20 > 0x2Du)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
823 && ((unsigned __int16)v20 < 0x6Du || (unsigned __int16)v20 > 0x6Fu)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
824 && ((unsigned __int16)v20 < 0x46u || (unsigned __int16)v20 > 0x48u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
825 && ((unsigned __int16)v20 < 0x100u || (unsigned __int16)v20 > 0x102u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
826 && ((unsigned __int16)v20 < 0xD9u || (unsigned __int16)v20 > 0xDBu)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
827 && ((unsigned __int16)v20 < 0xC7u || (unsigned __int16)v20 > 0xC9u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
828 && ((unsigned __int16)v20 < 0xE5u || (unsigned __int16)v20 > 0xE7u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
829 && ((unsigned __int16)v20 < 0xDFu || (unsigned __int16)v20 > 0xE1u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
830 && ((unsigned __int16)v20 < 0x5Bu || (unsigned __int16)v20 > 0x5Du)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
831 && ((unsigned __int16)v20 < 0x49u || (unsigned __int16)v20 > 0x4Bu)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
832 && ((unsigned __int16)v20 < 0xFDu || (unsigned __int16)v20 > 0xFFu)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
833 && ((unsigned __int16)v20 < 0x61u || (unsigned __int16)v20 > 0x63u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
834 && ((unsigned __int16)v20 < 0x10u || (unsigned __int16)v20 > 0x12u) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
835 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
836 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
837 pParty->field_750[v12] = rand() % 258 + 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
838 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
839 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
840 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
841 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
842 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
843 while ( 1 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
844 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
845 v21 = pParty->field_750[v12];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
846 if ( (unsigned __int16)v21 < 0x73u || (unsigned __int16)v21 > 0x84u )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
847 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
848 if ( ((unsigned __int16)v21 < 0xE8u || (unsigned __int16)v21 > 0xF9u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
849 && ((unsigned __int16)v21 < 0x85u || (unsigned __int16)v21 > 0x96u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
850 && ((unsigned __int16)v21 < 0x97u || (unsigned __int16)v21 > 0xBAu)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
851 && ((unsigned __int16)v21 < 0xBEu || (unsigned __int16)v21 > 0xC0u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
852 && ((unsigned __int16)v21 < 0xC4u || (unsigned __int16)v21 > 0xC6u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
853 && ((unsigned __int16)v21 < 0x2Bu || (unsigned __int16)v21 > 0x2Du)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
854 && ((unsigned __int16)v21 < 0x5Eu || (unsigned __int16)v21 > 0x60u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
855 && ((unsigned __int16)v21 < 0x43u || (unsigned __int16)v21 > 0x45u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
856 && ((unsigned __int16)v21 < 0x4Fu || (unsigned __int16)v21 > 0x51u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
857 && ((unsigned __int16)v21 < 0xC1u || (unsigned __int16)v21 > 0xC3u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
858 && ((unsigned __int16)v21 < 0x13u || (unsigned __int16)v21 > 0x15u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
859 && ((unsigned __int16)v21 < 0xFDu || (unsigned __int16)v21 > 0xFFu)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
860 && ((unsigned __int16)v21 < 0x61u || (unsigned __int16)v21 > 0x63u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
861 && ((unsigned __int16)v21 < 0x6Au || (unsigned __int16)v21 > 0x6Cu) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
862 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
863 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
864 pParty->field_750[v12] = rand() % 258 + 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
865 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
866 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
867 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
868 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
869 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
870 while ( 1 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
871 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
872 v22 = pParty->field_750[v12];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
873 if ( (unsigned __int16)v22 < 0x73u || (unsigned __int16)v22 > 0x84u )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
874 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
875 if ( ((unsigned __int16)v22 < 0xE8u || (unsigned __int16)v22 > 0xF9u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
876 && ((unsigned __int16)v22 < 0x85u || (unsigned __int16)v22 > 0x96u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
877 && ((unsigned __int16)v22 < 0x97u || (unsigned __int16)v22 > 0xBAu)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
878 && ((unsigned __int16)v22 < 0xBEu || (unsigned __int16)v22 > 0xC0u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
879 && ((unsigned __int16)v22 < 0xC4u || (unsigned __int16)v22 > 0xC6u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
880 && ((unsigned __int16)v22 < 0x2Bu || (unsigned __int16)v22 > 0x2Du)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
881 && ((unsigned __int16)v22 < 0x31u || (unsigned __int16)v22 > 0x33u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
882 && ((unsigned __int16)v22 < 0x34u || (unsigned __int16)v22 > 0x36u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
883 && ((unsigned __int16)v22 < 0xFDu || (unsigned __int16)v22 > 0xFFu)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
884 && ((unsigned __int16)v22 < 0x61u || (unsigned __int16)v22 > 0x63u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
885 && ((unsigned __int16)v22 < 0x1Cu || (unsigned __int16)v22 > 0x1Eu) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
886 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
887 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
888 pParty->field_750[v12] = rand() % 258 + 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
889 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
890 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
891 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
892 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
893 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
894 while ( 1 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
895 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
896 v23 = pParty->field_750[v12];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
897 if ( (unsigned __int16)v23 < 0x73u || (unsigned __int16)v23 > 0x84u )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
898 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
899 if ( ((unsigned __int16)v23 < 0xE8u || (unsigned __int16)v23 > 0xF9u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
900 && ((unsigned __int16)v23 < 0x85u || (unsigned __int16)v23 > 0x96u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
901 && ((unsigned __int16)v23 < 0x97u || (unsigned __int16)v23 > 0xBAu)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
902 && ((unsigned __int16)v23 < 0xBEu || (unsigned __int16)v23 > 0xC0u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
903 && ((unsigned __int16)v23 < 0xC4u || (unsigned __int16)v23 > 0xC6u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
904 && ((unsigned __int16)v23 < 0x2Bu || (unsigned __int16)v23 > 0x2Du)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
905 && ((unsigned __int16)v23 < 0x52u || (unsigned __int16)v23 > 0x54u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
906 && ((unsigned __int16)v23 < 4u || (unsigned __int16)v23 > 6u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
907 && ((unsigned __int16)v23 < 0x37u || (unsigned __int16)v23 > 0x39u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
908 && ((unsigned __int16)v23 < 0x3Au || (unsigned __int16)v23 > 0x3Cu)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
909 && ((unsigned __int16)v23 < 0x3Du || (unsigned __int16)v23 > 0x3Fu)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
910 && ((unsigned __int16)v23 < 0xFDu || (unsigned __int16)v23 > 0xFFu)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
911 && ((unsigned __int16)v23 < 0x61u || (unsigned __int16)v23 > 0x63u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
912 && ((unsigned __int16)v23 < 0xCDu || (unsigned __int16)v23 > 0xCFu) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
913 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
914 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
915 pParty->field_750[v12] = rand() % 258 + 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
916 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
917 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
918 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
919 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
920 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
921 while ( 1 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
922 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
923 v24 = pParty->field_750[v12];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
924 if ( (unsigned __int16)v24 < 0x73u || (unsigned __int16)v24 > 0x84u )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
925 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
926 if ( ((unsigned __int16)v24 < 0xEBu || (unsigned __int16)v24 > 0xFCu)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
927 && ((unsigned __int16)v24 < 0x85u || (unsigned __int16)v24 > 0x96u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
928 && ((unsigned __int16)v24 < 0x97u || (unsigned __int16)v24 > 0xBAu)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
929 && ((unsigned __int16)v24 < 0xBEu || (unsigned __int16)v24 > 0xC0u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
930 && ((unsigned __int16)v24 < 0xC4u || (unsigned __int16)v24 > 0xC6u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
931 && ((unsigned __int16)v24 < 0x2Bu || (unsigned __int16)v24 > 0x2Du)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
932 && ((unsigned __int16)v24 < 0xCDu || (unsigned __int16)v24 > 0xCFu)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
933 && ((unsigned __int16)v24 < 0x5Eu || (unsigned __int16)v24 > 0x60u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
934 && ((unsigned __int16)v24 < 0xFDu || (unsigned __int16)v24 > 0xFFu)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
935 && ((unsigned __int16)v24 < 0x6Du || (unsigned __int16)v24 > 0x6Fu)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
936 && ((unsigned __int16)v24 < 0x61u || (unsigned __int16)v24 > 0x63u) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
937 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
938 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
939 pParty->field_750[v12] = rand() % 258 + 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
940 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
941 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
942 v10 = v56;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
943 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
944 v25 = v10;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
945 v26 = pParty->field_750[v25];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
946 v27 = pParty->field_75A[v25] == v13;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
947 word_F8B1A0 = pParty->field_750[v25];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
948 if ( v27 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
949 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
950 //v1 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
951 v27 = v26 == v13;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
952 v29 = (int)pNPCTopics[351].pText;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
953 if ( v27 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
954 v29 = (int)pNPCTopics[353].pText;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
955 dword_F8B1A4 = (char *)v29;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
956 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
957 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
958 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
959 if ( v26 != v13 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
960 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
961 party_finds_gold(100 * pMonsterStats->pInfos[(unsigned __int16)v26].uLevel, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
962 v28 = pParty->pPlayers;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
963 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
964 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
965 v28->SetVariable(VAR_Award, 86);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
966 ++v28;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
967 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
968 while ( (signed int)v28 < (signed int)pParty->pHirelings );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
969 pParty->uNumBountiesCollected += 100 * pMonsterStats->pInfos[pParty->field_750[v25]].uLevel;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
970 pParty->field_750[v25] = v13;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
971 pParty->field_75A[v25] = v13;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
972 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
973 //v1 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
974 dword_F8B1A4 = pNPCTopics[352].pText;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
975 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
976 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
977 else if ( uMessageParam == HOUSE_DIALOGUE_TOWNHALL_100 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
978 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
979 pKeyActionMap->EnterText(1, 10, v8);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
980 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
981 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
982 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
983 case BildingType_Bank:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
984 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
985 if ( dialog_menu_id >= 7 && dialog_menu_id <= 8 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
986 pKeyActionMap->EnterText(1, 10, v8);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
987 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
988 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
989 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
990 case BildingType_WeaponShop:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
991 case BildingType_ArmorShop:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
992 case BildingType_MagicShop:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
993 case BildingType_AlchemistShop:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
994 case BildingType_Tavern:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
995 case BildingType_Temple:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
996 case BildingType_Training:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
997 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
998 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
999 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1000 default:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1001 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1002 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1003 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1004 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1005 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1006
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1007 /*
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1008 if ( in_current_building_type > BildingType_Tavern )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1009 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1010 if ( in_current_building_type == BildingType_Bank )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1011 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1012 if ( dialog_menu_id >= 7 && dialog_menu_id <= 8 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1013 pKeyActionMap->EnterText(1, 10, v8);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1014 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1015 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1016 if ( in_current_building_type != BildingType_Temple && in_current_building_type != BildingType_Training )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1017 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1018 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1019 //else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1020 if ( in_current_building_type < BildingType_Tavern )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1021 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1022 if (in_current_building_type <= 0)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1023 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1024 if ( in_current_building_type > BildingType_AlchemistShop )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1025 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1026 if ( in_current_building_type <= BildingType_16 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1027 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1028 if ( (signed __int64)__PAIR__(
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1029 *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)v8->ptr_1C + 44472],
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1030 *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)v8->ptr_1C + 44468]) >= (signed __int64)pParty->uTimePlayed )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1031 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1032 v32 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1033 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1034 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1035 //v33 = *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v32 + 12 * (unsigned int)v8->ptr_1C));
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1036 v33 = pParty->SpellBooksInGuilds[v8->par1C-139][v32].uItemID;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1037 if ( v33 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1038 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1039 v34 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v33].pIconName, TEXTURE_16BIT_PALETTE);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1040 v8 = window_SpeakInHouse;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1041 ItemsInShopTexture[v32] = &pIcons_LOD->pTextures[v34];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1042 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1043 ++v32;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1044 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1045 while ( v32 < 12 );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1046 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1047 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1048 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1049 SpellBookGenerator();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1050 v30 = window_SpeakInHouse->ptr_1C;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1051 v31 = pParty->uTimePlayed
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1052 + (signed __int64)((double)(0xA8C000
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1053 //* (signed int)p2DEvents_minus1[26 * (unsigned int)ptr_507BC0->ptr_1C])
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1054 * (signed int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].field_1C)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1055 * 0.033333335);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1056 *(int *)&stru_AA1058[3].pSounds[8 * (int)v30 + 44468] = v31;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1057 *(int *)&stru_AA1058[3].pSounds[8 * (int)v30 + 44472] = HIDWORD(v31);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1058 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1059 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1060 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1061 if ( in_current_building_type != BildingType_TownHall )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1062 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1063 if ( in_current_building_type == BildingType_TownHall )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1064 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1065 if ( uMessageParam == 99 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1066 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1067 v10 = (int)((char *)v8->ptr_1C - 102);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1068 v56 = v10;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1069 v11 = 8 * v10 + 11325428;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1070 if ( (signed __int64)__PAIR__(pParty->field_3C.field_0[2 * v10 + 1], pParty->field_3C.field_0[2 * v10]) >= (signed __int64)pParty->uTimePlayed )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1071 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1072 v13 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1073 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1074 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1075 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1076 v12 = v10;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1077 v13 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1078 pParty->field_75A[v12] = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1079 *(_QWORD *)v11 = (signed __int64)((double)(309657600 * (pParty->uCurrentMonth + 12i64 * pParty->uCurrentYear - 14015)) * 0.033333335);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1080 v14 = rand() % 258;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1081 v15 = window_SpeakInHouse;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1082 pParty->field_750[v12] = v14 + 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1083 v16 = (int)((char *)v15->ptr_1C - 102);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1084 if ( v16 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1085 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1086 v17 = v16 - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1087 if ( v17 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1088 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1089 v18 = v17 - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1090 if ( v18 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1091 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1092 v19 = v18 - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1093 if ( v19 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1094 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1095 if ( v19 == 1 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1096 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1097 while ( 1 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1098 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1099 v20 = pParty->field_750[v12];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1100 if ( (unsigned __int16)v20 < 0x73u || (unsigned __int16)v20 > 0x84u )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1101 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1102 if ( ((unsigned __int16)v20 < 0xE8u || (unsigned __int16)v20 > 0xF9u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1103 && ((unsigned __int16)v20 < 0x85u || (unsigned __int16)v20 > 0x96u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1104 && ((unsigned __int16)v20 < 0x97u || (unsigned __int16)v20 > 0xBAu)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1105 && ((unsigned __int16)v20 < 0xBEu || (unsigned __int16)v20 > 0xC0u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1106 && ((unsigned __int16)v20 < 0xC4u || (unsigned __int16)v20 > 0xC6u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1107 && ((unsigned __int16)v20 < 0x2Bu || (unsigned __int16)v20 > 0x2Du)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1108 && ((unsigned __int16)v20 < 0x6Du || (unsigned __int16)v20 > 0x6Fu)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1109 && ((unsigned __int16)v20 < 0x46u || (unsigned __int16)v20 > 0x48u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1110 && ((unsigned __int16)v20 < 0x100u || (unsigned __int16)v20 > 0x102u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1111 && ((unsigned __int16)v20 < 0xD9u || (unsigned __int16)v20 > 0xDBu)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1112 && ((unsigned __int16)v20 < 0xC7u || (unsigned __int16)v20 > 0xC9u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1113 && ((unsigned __int16)v20 < 0xE5u || (unsigned __int16)v20 > 0xE7u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1114 && ((unsigned __int16)v20 < 0xDFu || (unsigned __int16)v20 > 0xE1u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1115 && ((unsigned __int16)v20 < 0x5Bu || (unsigned __int16)v20 > 0x5Du)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1116 && ((unsigned __int16)v20 < 0x49u || (unsigned __int16)v20 > 0x4Bu)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1117 && ((unsigned __int16)v20 < 0xFDu || (unsigned __int16)v20 > 0xFFu)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1118 && ((unsigned __int16)v20 < 0x61u || (unsigned __int16)v20 > 0x63u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1119 && ((unsigned __int16)v20 < 0x10u || (unsigned __int16)v20 > 0x12u) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1120 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1121 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1122 pParty->field_750[v12] = rand() % 258 + 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1123 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1124 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1125 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1126 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1127 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1128 while ( 1 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1129 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1130 v21 = pParty->field_750[v12];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1131 if ( (unsigned __int16)v21 < 0x73u || (unsigned __int16)v21 > 0x84u )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1132 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1133 if ( ((unsigned __int16)v21 < 0xE8u || (unsigned __int16)v21 > 0xF9u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1134 && ((unsigned __int16)v21 < 0x85u || (unsigned __int16)v21 > 0x96u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1135 && ((unsigned __int16)v21 < 0x97u || (unsigned __int16)v21 > 0xBAu)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1136 && ((unsigned __int16)v21 < 0xBEu || (unsigned __int16)v21 > 0xC0u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1137 && ((unsigned __int16)v21 < 0xC4u || (unsigned __int16)v21 > 0xC6u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1138 && ((unsigned __int16)v21 < 0x2Bu || (unsigned __int16)v21 > 0x2Du)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1139 && ((unsigned __int16)v21 < 0x5Eu || (unsigned __int16)v21 > 0x60u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1140 && ((unsigned __int16)v21 < 0x43u || (unsigned __int16)v21 > 0x45u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1141 && ((unsigned __int16)v21 < 0x4Fu || (unsigned __int16)v21 > 0x51u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1142 && ((unsigned __int16)v21 < 0xC1u || (unsigned __int16)v21 > 0xC3u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1143 && ((unsigned __int16)v21 < 0x13u || (unsigned __int16)v21 > 0x15u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1144 && ((unsigned __int16)v21 < 0xFDu || (unsigned __int16)v21 > 0xFFu)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1145 && ((unsigned __int16)v21 < 0x61u || (unsigned __int16)v21 > 0x63u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1146 && ((unsigned __int16)v21 < 0x6Au || (unsigned __int16)v21 > 0x6Cu) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1147 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1148 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1149 pParty->field_750[v12] = rand() % 258 + 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1150 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1151 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1152 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1153 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1154 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1155 while ( 1 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1156 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1157 v22 = pParty->field_750[v12];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1158 if ( (unsigned __int16)v22 < 0x73u || (unsigned __int16)v22 > 0x84u )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1159 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1160 if ( ((unsigned __int16)v22 < 0xE8u || (unsigned __int16)v22 > 0xF9u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1161 && ((unsigned __int16)v22 < 0x85u || (unsigned __int16)v22 > 0x96u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1162 && ((unsigned __int16)v22 < 0x97u || (unsigned __int16)v22 > 0xBAu)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1163 && ((unsigned __int16)v22 < 0xBEu || (unsigned __int16)v22 > 0xC0u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1164 && ((unsigned __int16)v22 < 0xC4u || (unsigned __int16)v22 > 0xC6u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1165 && ((unsigned __int16)v22 < 0x2Bu || (unsigned __int16)v22 > 0x2Du)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1166 && ((unsigned __int16)v22 < 0x31u || (unsigned __int16)v22 > 0x33u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1167 && ((unsigned __int16)v22 < 0x34u || (unsigned __int16)v22 > 0x36u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1168 && ((unsigned __int16)v22 < 0xFDu || (unsigned __int16)v22 > 0xFFu)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1169 && ((unsigned __int16)v22 < 0x61u || (unsigned __int16)v22 > 0x63u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1170 && ((unsigned __int16)v22 < 0x1Cu || (unsigned __int16)v22 > 0x1Eu) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1171 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1172 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1173 pParty->field_750[v12] = rand() % 258 + 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1174 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1175 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1176 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1177 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1178 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1179 while ( 1 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1180 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1181 v23 = pParty->field_750[v12];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1182 if ( (unsigned __int16)v23 < 0x73u || (unsigned __int16)v23 > 0x84u )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1183 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1184 if ( ((unsigned __int16)v23 < 0xE8u || (unsigned __int16)v23 > 0xF9u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1185 && ((unsigned __int16)v23 < 0x85u || (unsigned __int16)v23 > 0x96u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1186 && ((unsigned __int16)v23 < 0x97u || (unsigned __int16)v23 > 0xBAu)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1187 && ((unsigned __int16)v23 < 0xBEu || (unsigned __int16)v23 > 0xC0u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1188 && ((unsigned __int16)v23 < 0xC4u || (unsigned __int16)v23 > 0xC6u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1189 && ((unsigned __int16)v23 < 0x2Bu || (unsigned __int16)v23 > 0x2Du)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1190 && ((unsigned __int16)v23 < 0x52u || (unsigned __int16)v23 > 0x54u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1191 && ((unsigned __int16)v23 < 4u || (unsigned __int16)v23 > 6u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1192 && ((unsigned __int16)v23 < 0x37u || (unsigned __int16)v23 > 0x39u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1193 && ((unsigned __int16)v23 < 0x3Au || (unsigned __int16)v23 > 0x3Cu)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1194 && ((unsigned __int16)v23 < 0x3Du || (unsigned __int16)v23 > 0x3Fu)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1195 && ((unsigned __int16)v23 < 0xFDu || (unsigned __int16)v23 > 0xFFu)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1196 && ((unsigned __int16)v23 < 0x61u || (unsigned __int16)v23 > 0x63u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1197 && ((unsigned __int16)v23 < 0xCDu || (unsigned __int16)v23 > 0xCFu) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1198 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1199 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1200 pParty->field_750[v12] = rand() % 258 + 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1201 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1202 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1203 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1204 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1205 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1206 while ( 1 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1207 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1208 v24 = pParty->field_750[v12];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1209 if ( (unsigned __int16)v24 < 0x73u || (unsigned __int16)v24 > 0x84u )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1210 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1211 if ( ((unsigned __int16)v24 < 0xEBu || (unsigned __int16)v24 > 0xFCu)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1212 && ((unsigned __int16)v24 < 0x85u || (unsigned __int16)v24 > 0x96u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1213 && ((unsigned __int16)v24 < 0x97u || (unsigned __int16)v24 > 0xBAu)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1214 && ((unsigned __int16)v24 < 0xBEu || (unsigned __int16)v24 > 0xC0u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1215 && ((unsigned __int16)v24 < 0xC4u || (unsigned __int16)v24 > 0xC6u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1216 && ((unsigned __int16)v24 < 0x2Bu || (unsigned __int16)v24 > 0x2Du)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1217 && ((unsigned __int16)v24 < 0xCDu || (unsigned __int16)v24 > 0xCFu)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1218 && ((unsigned __int16)v24 < 0x5Eu || (unsigned __int16)v24 > 0x60u)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1219 && ((unsigned __int16)v24 < 0xFDu || (unsigned __int16)v24 > 0xFFu)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1220 && ((unsigned __int16)v24 < 0x6Du || (unsigned __int16)v24 > 0x6Fu)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1221 && ((unsigned __int16)v24 < 0x61u || (unsigned __int16)v24 > 0x63u) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1222 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1223 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1224 pParty->field_750[v12] = rand() % 258 + 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1225 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1226 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1227 v10 = v56;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1228 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1229 v25 = v10;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1230 v26 = pParty->field_750[v25];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1231 v27 = pParty->field_75A[v25] == v13;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1232 word_F8B1A0 = pParty->field_750[v25];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1233 if ( v27 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1234 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1235 //v1 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1236 v27 = v26 == v13;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1237 v29 = (int)pNPCTopics[351].pText;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1238 if ( v27 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1239 v29 = (int)pNPCTopics[353].pText;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1240 dword_F8B1A4 = (char *)v29;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1241 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1242 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1243 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1244 if ( v26 != v13 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1245 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1246 party_finds_gold(100 * pMonsterStats->pInfos[(unsigned __int16)v26].uLevel, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1247 v28 = pParty->pPlayers;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1248 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1249 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1250 v28->SetVariable(VAR_Award, 86);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1251 ++v28;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1252 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1253 while ( (signed int)v28 < (signed int)pParty->pHirelings );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1254 pParty->uNumBountiesCollected += 100 * pMonsterStats->pInfos[pParty->field_750[v25]].uLevel;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1255 pParty->field_750[v25] = v13;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1256 pParty->field_75A[v25] = v13;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1257 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1258 //v1 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1259 dword_F8B1A4 = pNPCTopics[352].pText;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1260 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1261 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1262 else if ( uMessageParam == 100 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1263 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1264 pKeyActionMap->EnterText(1, 10, v8);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1265 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1266 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1267 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1268 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1269 */
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1270
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1271
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1272 //LABEL_196:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1273 switch ( uMessageParam )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1274 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1275 case HOUSE_DIALOGUE_LEARN_SKILLS:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1276 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1277 pDialogueWindow->eWindowType = WINDOW_MainMenu;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1278 UI_CreateEndConversationButton();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1279 FillAviableSkillsToTeach(in_current_building_type);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1280 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1281 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1282 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_MAIN:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1283 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1284 pDialogueWindow->eWindowType = WINDOW_MainMenu;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1285 UI_CreateEndConversationButton();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1286 sub_4B3A72(in_current_building_type);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1287 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1288 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1289 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RULES:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1290 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_VICTORY_CONDITIONS:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1291 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1292 dialog_menu_id = (HOUSE_DIALOGUE_MENU)uMessageParam;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1293 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1294 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1295 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RESULT:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1296 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1297 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1298 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1299 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_PlayArcomage;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1300 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1301 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = v1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1302 ++pMessageQueue_50CBD0->uNumMessages;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1303 }*/
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1304 pMessageQueue_50CBD0->AddMessage(UIMSG_PlayArcomage, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1305 dialog_menu_id = HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RESULT;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1306 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1307 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1308 case HOUSE_DIALOGUE_SHOP_BUY_STANDARD:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1309 case HOUSE_DIALOGUE_SHOP_BUY_SPECIAL:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1310 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1311 if ( pParty->field_3C.field_50[(unsigned int)v8->ptr_1C] < (signed __int64)pParty->uTimePlayed )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1312 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1313 GenerateStandartShopItems();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1314 GenerateSpecialShopItems();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1315 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);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1316 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1317 if ( uMessageParam == HOUSE_DIALOGUE_SHOP_BUY_STANDARD )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1318 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1319 if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1320 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1321 for ( v43 = 0; v43 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType]; ++v43 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1322 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1323 if ( pParty->StandartItemsInShops[(int)window_SpeakInHouse->ptr_1C][v43].uItemID )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1324 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1325 v46 = pIcons_LOD->LoadTexture(pItemsTable->pItems[pParty->StandartItemsInShops[(int)window_SpeakInHouse->ptr_1C][v43].uItemID].pIconName, TEXTURE_16BIT_PALETTE);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1326 ItemsInShopTexture[v43] = &pIcons_LOD->pTextures[v46];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1327 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1328 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1329 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1330 if ( in_current_building_type == BildingType_WeaponShop )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1331 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1332 v48 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1333 if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1334 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1335 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1336 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1337 if ( pParty->StandartItemsInShops[(int)window_SpeakInHouse->ptr_1C][v48].uItemID)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1338 word_F8B158[v48] = rand() % (300 - ItemsInShopTexture[v48]->uTextureHeight);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1339 ++v48;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1340 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1341 while ( v48 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType] );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1342 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1343 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1344 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1345 if ( uMessageParam == HOUSE_DIALOGUE_SHOP_BUY_SPECIAL )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1346 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1347 if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1348 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1349 for ( v43 = 0; v43 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType]; ++v43 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1350 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1351 if ( pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(signed int)v43].uItemID )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1352 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1353 v51 = pIcons_LOD->LoadTexture(pItemsTable->pItems[pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(signed int)v43].uItemID].pIconName, TEXTURE_16BIT_PALETTE);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1354 ItemsInShopTexture[v43] = &pIcons_LOD->pTextures[v51];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1355 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1356 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1357 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1358 if ( in_current_building_type == BildingType_WeaponShop )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1359 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1360 v53 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1361 if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1362 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1363 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1364 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1365 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v53].uItemID)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1366 word_F8B158[v53] = rand() % (300 - ItemsInShopTexture[v53]->uTextureHeight);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1367 ++v53;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1368 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1369 while ( v53 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType ] );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1370 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1371 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1372 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1373 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1374 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1375 case HOUSE_DIALOGUE_SHOP_SELL:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1376 case HOUSE_DIALOGUE_SHOP_IDENTIFY:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1377 case HOUSE_DIALOGUE_SHOP_REPAIR:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1378 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1379 dialog_menu_id = (HOUSE_DIALOGUE_MENU)uMessageParam;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1380 sub_421B2C_PlaceInInventory_or_DropPickedItem();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1381 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1382 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1383 case HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1384 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1385 pDialogueWindow->eWindowType = WINDOW_MainMenu;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1386 UI_CreateEndConversationButton();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1387 sub_4B3AD4(in_current_building_type);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1388 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1389 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1390 default:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1391 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1392 if( uMessageParam >= HOUSE_DIALOGUE_36 && uMessageParam <= HOUSE_DIALOGUE_GUILD_LEARN_SKILL )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1393 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1394 //v35 = pPlayers[uActiveCharacter];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1395 //v36 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)v8->ptr_1C] * 500.0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1396 v36 = (signed __int64)(p2DEvents[(unsigned int)v8->ptr_1C - 1].flt_24 * 500.0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1397 v37 = v36 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1398 if ( v37 < v36 / 3 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1399 v37 = v36 / 3;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1400 //if (false)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1401 if(byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][uMessageParam-36])
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1402 //if ( *(&byte_4ED94C[37 * v35->uClass] + v55) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1403 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1404 //v38 = (int)(&pPlayers[uActiveCharacter]->uIntelligence + uMessageParam);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1405 if ( !pPlayers[uActiveCharacter]->pActiveSkills[uMessageParam - 36] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1406 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1407 if ( pParty->uNumGold < v37 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1408 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1409 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1410 if ( in_current_building_type == BildingType_Training || in_current_building_type == BildingType_Tavern )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1411 v39 = 4;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1412 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1413 v39 = 2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1414 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, (HouseSoundID)v39);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1415 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1416 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1417 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1418 Party::TakeGold(v37);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1419 dword_F8B1E4 = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1420 pPlayers[uActiveCharacter]->pActiveSkills[uMessageParam - 36] = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1421 pPlayers[uActiveCharacter]->PlaySound(SPEECH_78, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1422 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1423 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1424 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1425 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1426 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1427 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1428 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1429 /*
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1430 if ( uMessageParam != 95 && uMessageParam != 2 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1431 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1432 if ( uMessageParam == 3 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1433 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1434 dialog_menu_id = 3;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1435 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1436 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1437 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1438 if ( uMessageParam == 4 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1439 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1440 dialog_menu_id = 4;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1441 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1442 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1443 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1444 if ( uMessageParam != 5 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1445 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1446 if ( uMessageParam > 35 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1447 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1448 if ( uMessageParam <= 72 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1449 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1450 v35 = pPlayers[uActiveCharacter];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1451 //v36 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)v8->ptr_1C] * 500.0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1452 v36 = (signed __int64)(p2DEvents[(unsigned int)v8->ptr_1C - 1].flt_24 * 500.0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1453 v37 = v36 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1454 if ( v37 < v36 / 3 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1455 v37 = v36 / 3;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1456
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1457 __debugbreak();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1458 //pSkillAvailabilityPerClass[8 + v58->uClass][4 + v23]
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1459 // or
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1460 //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass][v23 - 36]
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1461 // or
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1462 //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass - 1][v23 + 1]
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1463
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1464 if (false)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1465 //if ( *(&byte_4ED94C[37 * v35->uClass] + v55) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1466 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1467 v38 = (int)(&v35->uIntelligence + uMessageParam);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1468 if ( !*(short *)v38 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1469 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1470 if ( pParty->uNumGold < v37 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1471 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1472 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1473 if ( in_current_building_type == BildingType_Training || in_current_building_type == BildingType_Tavern )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1474 v39 = 4;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1475 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1476 v39 = 2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1477 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, v39);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1478 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1479 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1480 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1481 Party::TakeGold(v37);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1482 dword_F8B1E4 = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1483 *(short *)v38 = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1484 v35->PlaySound(SPEECH_78, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1485 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1486 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1487 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1488 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1489 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1490 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1491 if ( uMessageParam == 94 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1492 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1493 pDialogueWindow->eWindowType = WINDOW_MainMenu;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1494 UI_CreateEndConversationButton();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1495 sub_4B3AD4(in_current_building_type);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1496 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1497 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1498 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1499 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1500 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1501 dialog_menu_id = 5;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1502 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1503 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1504 sub_421B2C_PlaceInInventory_or_DropPickedItem();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1505 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1506 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1507 if ( pParty->field_3C.field_50[(unsigned int)v8->ptr_1C] < (signed __int64)pParty->uTimePlayed )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1508 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1509 GenerateStandartShopItems();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1510 GenerateSpecialShopItems();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1511 v8 = window_SpeakInHouse;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1512 v40 = window_SpeakInHouse->par1C;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1513 //v3 = dword_F8B198;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1514 v41 = pParty->uTimePlayed
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1515 //+ (signed __int64)((double)(11059200 * (signed int)p2DEvents_minus1[26 * (unsigned int)ptr_507BC0->ptr_1C])
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1516 + (signed __int64)((double)(11059200 * (signed int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].field_1C)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1517 * 0.033333335);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1518 pParty->field_3C.field_50[v40] = v41;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1519
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1520 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1521 v42 = v8->ptr_1C;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1522 v43 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1523 //v44 = p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1524 v44 = p2DEvents[(unsigned int)v8->ptr_1C - 1].uType;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1525 if ( uMessageParam == 2 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1526 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1527 if ( uItemsAmountPerShopType[v44] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1528 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1529 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1530 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1531 v45 = pParty->StandartItemsInShops[(int)v42][v43].uItemID;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1532 if ( v45 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1533 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1534 v46 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v45].pIconName, TEXTURE_16BIT_PALETTE);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1535 //v3 = dword_F8B198;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1536 v8 = window_SpeakInHouse;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1537 ItemsInShopTexture[v43] = &pIcons_LOD->pTextures[v46];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1538 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1539 v42 = v8->ptr_1C;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1540 ++v43;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1541 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1542 //while ( v43 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1543 while ( v43 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1544 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1545 if ( in_current_building_type == BildingType_WeaponShop )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1546 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1547 v47 = v8->ptr_1C;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1548 v48 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1549 //if ( _4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1550 if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1551 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1552 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1553 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1554 // if ( pParty->field_777C[9 * (v48 + 12 * (int)v47)] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1555 if ( pParty->StandartItemsInShops[(int)v47][v48].uItemID);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1556 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1557 v49 = rand();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1558 v8 = window_SpeakInHouse;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1559 word_F8B158[v48] = v49 % (300 - ItemsInShopTexture[v48]->uTextureHeight);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1560 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1561 v47 = v8->ptr_1C;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1562 ++v48;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1563 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1564 //while ( v48 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1565 while ( v48 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1566 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1567 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1568 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1569 if ( uMessageParam == 95 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1570 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1571 if ( uItemsAmountPerShopType[v44] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1572 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1573 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1574 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1575 //v50 = pParty->field_C59C[9 * (v43 + 12 * (int)v42) + 724];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1576 v50=pParty->SpecialItemsInShops[(unsigned int)v42][(signed int)v43].uItemID;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1577 if ( v50 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1578 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1579 v51 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v50].pIconName, TEXTURE_16BIT_PALETTE);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1580 //v3 = dword_F8B198;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1581 v8 = window_SpeakInHouse;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1582 ItemsInShopTexture[v43] = &pIcons_LOD->pTextures[v51];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1583 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1584 v42 = v8->ptr_1C;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1585 ++v43;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1586 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1587 //while ( v43 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1588 while ( v43 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1589 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1590 if ( in_current_building_type == BildingType_WeaponShop )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1591 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1592 v52 = v8->ptr_1C;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1593 v53 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1594 //if ( _4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1595 if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1596 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1597 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1598 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1599 // if ( pParty->field_C59C[9 * (v53 + 12 * (int)v52) + 724] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1600 if (pParty->SpecialItemsInShops[(unsigned int)v52][v53].uItemID)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1601 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1602 v54 = rand();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1603 v8 = window_SpeakInHouse;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1604 word_F8B158[v53] = v54 % (300 - ItemsInShopTexture[v53]->uTextureHeight);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1605 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1606 v52 = v8->ptr_1C;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1607 ++v53;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1608 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1609 //while ( v53 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1610 while ( v53 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType ] );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1611 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1612 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1613 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1614 */
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1615 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1616
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1617
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1618
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1619 //----- (004B6943) --------------------------------------------------------
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1620 void __cdecl TravelByTransport()
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1621 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1622 GUIWindow *v0; // ebx@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1623 Player *v1; // esi@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1624 signed int v2; // edi@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1625 unsigned int v3; // eax@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1626 signed int v4; // ebx@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1627 stru365_travel_info *v5; // esi@7
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1628 //int v6; // eax@9
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1629 //int v7; // eax@9
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1630 //int v8; // eax@12
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1631 //int v9; // edi@12
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1632 //int v10; // edx@12
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1633 int v11; // ecx@12
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1634 signed int v12; // esi@13
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1635 signed int v13; // edi@14
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1636 DWORD v14; // eax@26
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1637 DWORD v15; // edi@26
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1638 GUIWindow *v16; // ebx@36
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1639 int v17; // esi@36
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1640 int v18; // eax@36
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1641 int v19; // ecx@36
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1642 int v20; // esi@36
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1643 int v21; // eax@36
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1644 void *v22; // eax@39
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1645 int v23; // esi@39
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1646 GUIButton *v24; // ebx@39
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1647 signed int v25; // eax@41
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1648 //int v26; // esi@44
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1649 //const char *v27; // eax@46
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1650 char *v28; // eax@62
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1651 int v29; // eax@62
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1652 unsigned int v30; // ecx@62
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1653 char *v31; // eax@63
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1654 MapInfo v32; // [sp-3Ch] [bp-2CCh]@62
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1655 /*int v33; // [sp-38h] [bp-2C8h]@62
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1656 int v34; // [sp-34h] [bp-2C4h]@62
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1657 int v35; // [sp-30h] [bp-2C0h]@62
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1658 int v36; // [sp-2Ch] [bp-2BCh]@62
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1659 int v37; // [sp-28h] [bp-2B8h]@62
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1660 int v38; // [sp-24h] [bp-2B4h]@62
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1661 int v39; // [sp-20h] [bp-2B0h]@62
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1662 int v40; // [sp-1Ch] [bp-2ACh]@62
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1663 int v41; // [sp-18h] [bp-2A8h]@62
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1664 int v42; // [sp-14h] [bp-2A4h]@62
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1665 char *v43; // [sp-10h] [bp-2A0h]@62
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1666 char *v44; // [sp-Ch] [bp-29Ch]@62
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1667 unsigned int v45; // [sp-8h] [bp-298h]@62
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1668 char *v46; // [sp-4h] [bp-294h]@62
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1669 const char *v47[5]; // [sp+0h] [bp-290h]@7*/
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1670 char v48[5][100]; // [sp+14h] [bp-27Ch]@37
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1671 //char v49[100]; // [sp+78h] [bp-218h]@68
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1672 //char v50[100]; // [sp+DCh] [bp-1B4h]@68
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1673 //char v51[100]; // [sp+140h] [bp-150h]@68
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1674 //char Dest[100]; // [sp+1A4h] [bp-ECh]@36
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1675 GUIWindow v53; // [sp+208h] [bp-88h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1676 int v54; // [sp+25Ch] [bp-34h]@36
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1677 int v55; // [sp+260h] [bp-30h]@36
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1678 //unsigned int v56; // [sp+264h] [bp-2Ch]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1679 //int v57; // [sp+268h] [bp-28h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1680 int v58; // [sp+26Ch] [bp-24h]@36
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1681 //GUIWindow *v59; // [sp+270h] [bp-20h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1682 unsigned int v60; // [sp+274h] [bp-1Ch]@36
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1683 //Player *v61; // [sp+278h] [bp-18h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1684 int v62; // [sp+27Ch] [bp-14h]@36
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1685 int v63; // [sp+280h] [bp-10h]@14
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1686 char *a1; // [sp+284h] [bp-Ch]@37
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1687 unsigned int s1; // [sp+288h] [bp-8h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1688 int v66; // [sp+28Ch] [bp-4h]@48
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1689
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1690 v0 = window_SpeakInHouse;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1691 memcpy(&v53, window_SpeakInHouse, sizeof(v53));
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1692 v2 = 255;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1693 //v61 = pPlayers[uActiveCharacter];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1694 v1 = pPlayers[uActiveCharacter];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1695 v53.uFrameX = 483;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1696 v53.uFrameWidth = 148;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1697 v53.uFrameZ = 334;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1698 auto color_default = TargetColor(255, 255, 255);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1699 auto color_selected = TargetColor(255, 255, 155);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1700 v3 = 52 * (unsigned int)v0->ptr_1C;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1701 //v59 = (GUIWindow *)((((p2DEvents_minus1___00[v3 / 2] != 27) - 1) & 0xFFFFFFE7) + 50);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1702 //v59 = (GUIWindow *)((((p2DEvents[(unsigned int)v0->ptr_1C - 1].uType != BildingType_Stables) - 1) & 0xFFFFFFE7) + 50);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1703 //v4 = (signed __int64)((double)(signed int)v59 * p2DEvents_minus1__20[v3 / 4]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1704
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1705 v4 = p2DEvents[(unsigned int)v0->ptr_1C - 1].uType == BildingType_Stables ? 25 : 50;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1706 v4 *= p2DEvents[(unsigned int)v0->ptr_1C - 1].fPriceMultiplier;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1707
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1708 s1 = v4 * (100 - v1->GetMerchant()) / 100;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1709 if ( (signed int)s1 < v4 / 3 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1710 s1 = v4 / 3;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1711 if ( dialog_menu_id == HOUSE_DIALOGUE_MAIN)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1712 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1713 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1714 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1715 v16 = pDialogueWindow;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1716 v58 = 255;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1717 v62 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1718 v17 = LOBYTE(pFontArrus->uFontHeight) - 3;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1719 //v59 = pDialogueWindow;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1720 v54 = v17;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1721 strcpy(v48[4], "");
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1722 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[405], s1); // Price: %lu gold
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1723 v18 = pFontArrus->CalcTextHeight(pTmpBuf2.data(), &v53, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1724 v19 = v16->pNumPresenceButton;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1725 v20 = v18 + v17 + 146;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1726 v21 = v16->pStartingPosActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1727 v63 = v20;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1728 v55 = v20;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1729 v60 = v21;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1730 if ( v21 >= v21 + v19 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1731 goto LABEL_71;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1732 s1 = 2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1733 a1 = (char *)v48;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1734 while ( 1 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1735 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1736 int v47 = v60;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1737 v22 = window_SpeakInHouse->ptr_1C;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1738 v23 = transport_routes[(unsigned int)v22 - HOUSE_STABLES_HARMONDALE][v62];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1739 //v23 = (unsigned __int8)*(&_4F0D38_TravelInfo[4 * (unsigned int)v22] + v62); // negindex. actual address is around + 0x36
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1740 //v61 = (Player *)(unsigned __int8)*(&_4F0D38_TravelInfo[4 * (unsigned int)v22] + v62); // + 0x3F for sea travels, less for land
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1741 v24 = v16->GetControl(v60);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1742
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1743 if (v23 != v58)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1744 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1745 if (v23 >= 25)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1746 Log::Warning(L"Transport UI: scedule overflow");
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1747 if (s1 >= 6)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1748 v25 = true;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1749 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1750 v25 = transport_schedule[v23].pSchedule[pParty->uDaysPlayed % 7];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1751 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1752
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1753 if (v23 != v58 && v25 && (!transport_schedule[v23].uQuestBit || _449B57_test_bit(pParty->_quest_bits, transport_schedule[v23].uQuestBit)) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1754 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1755 v58 = v23;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1756 if ( pDialogueWindow->pCurrentPosActiveItem == s1 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1757 sprintf(a1, "\f%05d", color_selected);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1758 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1759 sprintf(a1, "\f%05d", color_default);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1760
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1761 //v32.uRedbookTrackID = v27;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1762 v66 = transport_schedule[v23].uTravelTime;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1763 if ( (unsigned int)window_SpeakInHouse->ptr_1C >= HOUSE_BOATS_63 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1764 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1765 if ( CheckHiredNPCSpeciality(Sailor) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1766 v66 -= 2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1767 if ( CheckHiredNPCSpeciality(Navigator) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1768 v66 -= 3;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1769 if ( CheckHiredNPCSpeciality(Pirate) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1770 v66 -= 2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1771 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1772 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1773 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1774 if ( CheckHiredNPCSpeciality(Horseman) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1775 v66 -= 2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1776 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1777 if ( CheckHiredNPCSpeciality(Explorer) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1778 --v66;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1779 if ( v66 < 1 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1780 v66 = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1781 if ( v23 != v2 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1782 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1783 memcpy(&v32, &pMapStats->pInfos[transport_schedule[v23].uMapInfoID], 0x44u);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1784 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[404], // Time - %d days, destination %s
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1785 v66, v32.pName);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1786 strcat(a1, pTmpBuf.data());
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1787 v28 = a1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1788 a1 += 100;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1789 ++v62;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1790 ++s1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1791 strcat(v28, "\n \n");
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1792 v24->uY = v63;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1793 v29 = pFontArrus->CalcTextHeight(pTmpBuf.data(), &v53, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1794 v30 = v24->uY;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1795 v24->uHeight = v29;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1796 v2 = 255;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1797 v24->uW = v30 + v29 - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1798 v63 += v54 + v29;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1799 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1800 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1801 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1802 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1803 v31 = a1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1804 ++v62;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1805 ++s1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1806 a1 += 100;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1807 strcpy(v31, "");
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1808 if ( v24 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1809 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1810 v24->uW = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1811 v24->uHeight = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1812 v24->uY = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1813 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1814 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1815 ++v60;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1816 if ( (signed int)v60 >= v16->pNumPresenceButton + v16->pStartingPosActiveItem )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1817 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1818 //v16 = v59;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1819 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1820 if ( v63 != v55 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1821 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1822 /*v47[1] = &Dest;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1823 v47[0] = &v51;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1824 v46 = &v50;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1825 v45 = (unsigned int)&v49;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1826 v44 = &v48;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1827 v43 = pTmpBuf2.data();*/
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1828 sprintf(pTmpBuf.data(), "%s\n \n%s%s%s%s%s", pTmpBuf2.data(), v48[0], v48[1], v48[2], v48[3], v48[4]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1829 v53.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3u);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1830 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1831 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1832 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1833 LABEL_71:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1834 v53.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[561], &v53, 0, 0)) / 2 + 138,
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1835 color_default, pGlobalTXT_LocalizationStrings[561], 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1836 pAudioPlayer->StopChannels(-1, -1);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1837 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1838 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1839 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1840 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1841 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1842 if ( dialog_menu_id >= HOUSE_DIALOGUE_TRANSPORT_SCHEDULE_1 && dialog_menu_id <= HOUSE_DIALOGUE_TRANSPORT_SCHEDULE_4 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1843 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1844 if ( pParty->uNumGold < s1 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1845 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1846 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1847 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_Greeting_2);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1848 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1849 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1850 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1851
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1852 Party::TakeGold(s1);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1853
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1854 v5 = &transport_schedule[transport_routes[(unsigned int)window_SpeakInHouse->ptr_1C - HOUSE_STABLES_HARMONDALE][dialog_menu_id - HOUSE_DIALOGUE_TRANSPORT_SCHEDULE_1]];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1855 if ( v5->pSchedule[pParty->uDaysPlayed % 7] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1856 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1857 if ( _stricmp(pCurrentMapName.data(), pMapStats->pInfos[v5->uMapInfoID].pFilename) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1858 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1859 SaveGame(1, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1860 strcpy(pCurrentMapName.data(), pMapStats->pInfos[v5->uMapInfoID].pFilename);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1861
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1862 dword_6BE364_game_settings_1 |= 1u;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1863 _5B65B8_npcdata_hiword_house_or_other = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1864 dword_5B65BC = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1865 _5B65B4_npcdata_loword_house_or_other = v5->arrival_rot_y;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1866 v11 = *((int *)v5 + 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1867 uGameState = GAME_STATE_2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1868 _5B65A8_npcdata_uflags_or_other = v11;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1869 _5B65AC_npcdata_fame_or_other = v5->arrival_y;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1870 _5B65B0_npcdata_rep_or_other = v5->arrival_z;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1871 dword_5B65C0 = v11 | v5->arrival_y | v5->arrival_z | v5->arrival_rot_y;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1872 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1873 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1874 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1875 pIndoorCamera->sRotationY = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1876 pParty->uFlags |= 2u;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1877 pParty->vPosition.x = v5->arrival_x;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1878 pParty->vPosition.y = v5->arrival_y;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1879 pParty->vPosition.z = v5->arrival_z;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1880 pParty->uFallStartY = pParty->vPosition.z;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1881 pParty->sRotationX = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1882 pParty->sRotationY = v5->arrival_rot_y;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1883 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1884 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1885 v12 = v5->uTravelTime;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1886 int _v47;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1887 if ( (signed int)window_SpeakInHouse->ptr_1C >= 63 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1888 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1889 v63 = SPEECH_SetSail;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1890 v13 = 2500;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1891 if ( CheckHiredNPCSpeciality(Sailor) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1892 v12 -= 2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1893 if ( CheckHiredNPCSpeciality(Navigator) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1894 v12 -= 3;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1895 //_v47 = 45;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1896 if ( CheckHiredNPCSpeciality(Pirate) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1897 v12 -= 2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1898 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1899 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1900 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1901 v63 = SPEECH_CarriageReady;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1902 v13 = 1500;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1903 //_v47 = 35;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1904 if ( CheckHiredNPCSpeciality(Horseman) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1905 v12 -= 2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1906 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1907 if ( CheckHiredNPCSpeciality(Explorer) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1908 --v12;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1909 if ( v12 < 1 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1910 v12 = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1911 RestAndHeal(1440 * v12);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1912 v1->PlaySound((PlayerSpeech)v63, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1913 v14 = GetTickCount();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1914 v15 = v14 + v13;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1915 if ( v15 < v14 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1916 v15 = v14;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1917 while ( GetTickCount() < v15 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1918 sqrt(3.1415926);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1919 while ( sub_4BD8B5() )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1920 ;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1921 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1922 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1923 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1924 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1925 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1926 dialog_menu_id = HOUSE_DIALOGUE_MAIN;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1927 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1928 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1929 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1930 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1931 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1932
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1933
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1934
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1935
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1936
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1937
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1938 //----- (004B68EA) --------------------------------------------------------
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1939 bool __fastcall IsTravelAvailable(int a1)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1940 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1941 for (uint i = 0; i < 4; ++i)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1942 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1943 uint route = transport_routes[a1][i];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1944 if (transport_schedule[route].pSchedule[pParty->uDaysPlayed % 7])
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1945 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1946 if (!transport_schedule[route].uQuestBit || _449B57_test_bit(pParty->_quest_bits, transport_schedule[route].uQuestBit))
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1947 return true;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1948 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1949 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1950 return false;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1951 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1952
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1953
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1954
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1955 //----- (004B7911) --------------------------------------------------------
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1956 void __cdecl TownHallDialog()
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1957 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1958 GUIWindow *v0; // eax@4
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1959 int v1; // eax@10
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1960 int v2; // esi@10
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1961 GUIFont *v3; // ST20_4@20
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1962 int v4; // eax@20
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1963 MonsterInfo *v5; // edi@21
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1964 unsigned int v6; // ST20_4@21
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1965 char *v7; // ST1C_4@21
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1966 unsigned int v8; // eax@21
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1967 int v9; // esi@21
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1968 char *v10; // eax@23
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1969 signed int v11; // ebx@24
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1970 signed int i; // esi@26
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1971 int v13; // eax@27
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1972 GUIWindow *v14; // ecx@28
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1973 __int64 v15; // qax@28
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1974 signed int v16; // ebx@28
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1975 int v17; // ebx@28
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1976 unsigned __int8 v18; // sf@28
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1977 char **v19; // edi@29
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1978 GUIButton *v20; // eax@30
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1979 GUIButton *v21; // esi@30
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1980 int v22; // eax@30
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1981 unsigned int v23; // ecx@30
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1982 unsigned __int16 v24; // ax@30
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1983 GUIWindow a1; // [sp+Ch] [bp-110h]@21
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1984 GUIWindow w; // [sp+60h] [bp-BCh]@21
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1985 GUIWindow _this; // [sp+B4h] [bp-68h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1986 int v28; // [sp+108h] [bp-14h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1987 int v29; // [sp+10Ch] [bp-10h]@28
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1988 int v30; // [sp+110h] [bp-Ch]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1989 int v31; // [sp+114h] [bp-8h]@29
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1990 GUIFont *pOutString; // [sp+118h] [bp-4h]@21
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1991
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1992 memcpy(&_this, window_SpeakInHouse, sizeof(_this));
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1993 _this.uFrameX = 483;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1994 _this.uFrameWidth = 148;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1995 _this.uFrameZ = 334;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1996 v28 = TargetColor(0xFFu, 0xFFu, 0xFFu);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1997 v30 = TargetColor(0xFFu, 0xFFu, 0x9Bu);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1998 sprintf(pTmpBuf.data(), "%s: %d", pGlobalTXT_LocalizationStrings[605], pParty->uFine);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1999 _this.DrawTitleText(pFontArrus, 0, 0x104u, v30, pTmpBuf.data(), 3u);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2000 switch(dialog_menu_id)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2001 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2002 case HOUSE_DIALOGUE_MAIN:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2003 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2004 v11 = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2005 pOutString = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2006 pShopOptions[0] = pGlobalTXT_LocalizationStrings[604];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2007 if ( pParty->uFine )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2008 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2009 pShopOptions[1] = pGlobalTXT_LocalizationStrings[603];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2010 v11 = 2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2011 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2012 for ( i = 0; i < v11; ++i )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2013 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2014 v13 = pFontArrus->CalcTextHeight(pShopOptions[i], &_this, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2015 pOutString = (GUIFont *)((char *)pOutString + v13);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2016 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2017 v29 = (100 - (signed int)pOutString) / v11;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2018 v14 = pDialogueWindow;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2019 v15 = 80 - v11 * (100 - (signed int)pOutString) / v11 - (signed int)pOutString;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2020 v16 = v15 - HIDWORD(v15);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2021 LODWORD(v15) = pDialogueWindow->pStartingPosActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2022 HIDWORD(v15) = v15 + pDialogueWindow->pNumPresenceButton;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2023 v17 = (v16 >> 1) - v29 / 2 + 158;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2024 v18 = -pDialogueWindow->pNumPresenceButton < 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2025 pOutString = (GUIFont *)pDialogueWindow->pStartingPosActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2026 if ( v18 ^ __OFSUB__((int)v15, HIDWORD(v15)) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2027 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2028 v31 = 2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2029 v19 = pShopOptions.data();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2030 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2031 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2032 v20 = v14->GetControl((unsigned int)pOutString);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2033 v21 = v20;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2034 v20->uY = v29 + v17;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2035 v22 = pFontArrus->CalcTextHeight(*v19, &_this, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2036 v23 = v21->uY;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2037 v21->uHeight = v22;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2038 v17 = v23 + v22 - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2039 v21->uW = v17;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2040 v24 = v30;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2041 if ( pDialogueWindow->pCurrentPosActiveItem != v31 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2042 v24 = v28;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2043 _this.DrawTitleText(pFontArrus, 0, v23, v24, *v19, 3u);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2044 v14 = pDialogueWindow;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2045 ++v31;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2046 ++v19;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2047 pOutString = (GUIFont *)((char *)pOutString + 1);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2048 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2049 while ( (signed int)pOutString < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2050 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2051 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2052 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2053
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2054 case HOUSE_DIALOGUE_TOWNHALL_99:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2055 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2056 v5 = &pMonsterStats->pInfos[word_F8B1A0];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2057 v6 = TargetColor(0xFFu, 0xFFu, 0xFFu);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2058 v7 = v5->pName;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2059 v8 = TargetColor(0xFFu, 0xFFu, 0x9Bu);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2060 sprintf(pTmpBuf.data(), "\f%05d%s\f%05d", v8, v7, v6);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2061 sprintf(pTmpBuf2.data(), dword_F8B1A4, pTmpBuf.data(), 100 * v5->uLevel);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2062 current_npc_text = pTmpBuf2.data();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2063 memcpy(&a1, pDialogueWindow, sizeof(a1));
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2064 w.uFrameWidth = 458;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2065 w.uFrameZ = 457;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2066 pOutString = pFontArrus;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2067 v9 = pFontArrus->CalcTextHeight(pTmpBuf2.data(), &w, 13, 0) + 7;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2068 if ( 352 - v9 < 8 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2069 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2070 pOutString = pFontCreate;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2071 v9 = pFontCreate->CalcTextHeight(current_npc_text, &w, 13, 0) + 7;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2072 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2073
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2074 auto pTex = pIcons_LOD->GetTexture(uTextureID_Leather);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2075 pRenderer->_4A6A68(8u, 352 - v9, pTex, pTex->uTextureHeight - v9);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2076 pRenderer->DrawTextureIndexed(8u, 347 - v9, pTexture_591428);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2077 v10 = FitTextInAWindow(current_npc_text, pOutString, &w, 0xDu, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2078 a1.DrawText(pOutString, 13, 354 - v9, 0, v10, 0, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2079 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2080 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2081 case HOUSE_DIALOGUE_TOWNHALL_100:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2082 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2083 v0 = window_SpeakInHouse;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2084 if ( window_SpeakInHouse->receives_keyboard_input_2 == WINDOW_INPUT_IN_PROGRESS)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2085 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2086 sprintfex(pTmpBuf.data(), "%s\n%s", pGlobalTXT_LocalizationStrings[606], pGlobalTXT_LocalizationStrings[112]); // "Pay" "How Much?"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2087 _this.DrawTitleText(pFontArrus, 0, 0x92u, v30, pTmpBuf.data(), 3u);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2088 _this.DrawTitleText(pFontArrus, 0, 0xBAu, v28, (const char *)pKeyActionMap->pPressedKeysBuffer, 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2089 v3 = pFontArrus;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2090 v4 = pFontArrus->GetLineWidth((const char *)pKeyActionMap->pPressedKeysBuffer);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2091 _this.DrawFlashingInputCursor(v4 / 2 + 80, 185, v3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2092 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2093 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2094 if ( window_SpeakInHouse->receives_keyboard_input_2 == WINDOW_INPUT_CONFIRMED)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2095 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2096 v1 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2097 v2 = v1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2098 if ( v1 <= 0 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2099 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2100 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2101 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2102 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2103 if ( v1 > pParty->uNumGold )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2104 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2105 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2106 v2 = pParty->uNumGold;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2107 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2108 if ( v2 > pParty->uFine )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2109 v2 = pParty->uFine;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2110 Party::TakeGold(v2);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2111 pParty->uFine -= v2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2112 if ( pParty->uFine < 0 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2113 pParty->uFine = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2114 if ( uActiveCharacter )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2115 pPlayers[uActiveCharacter]->PlaySound(SPEECH_81, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2116 v0 = window_SpeakInHouse;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2117 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2118 if ( window_SpeakInHouse->receives_keyboard_input_2 == WINDOW_INPUT_CANCELLED)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2119 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2120 v0->receives_keyboard_input_2 = WINDOW_INPUT_NONE;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2121 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2122 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2123 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2124 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2125 default:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2126 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2127 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2128 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2129 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2130 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2131 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2132
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2133
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2134
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2135 //----- (004B7D7E) --------------------------------------------------------
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2136 void __cdecl BankDialog()
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2137 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2138 GUIWindow *v0; // eax@4
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2139 //int v1; // ecx@5
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2140 int v2; // eax@6
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2141 unsigned int v3; // esi@6
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2142 GUIFont *v4; // ST10_4@12
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2143 int v5; // eax@12
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2144 int v6; // eax@19
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2145 unsigned int v7; // esi@19
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2146 unsigned __int16 v8; // ax@27
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2147 unsigned __int16 v9; // ax@29
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2148 char *v10; // [sp-8h] [bp-70h]@11
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2149 char *v11; // [sp-4h] [bp-6Ch]@11
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2150 GUIWindow _this; // [sp+Ch] [bp-5Ch]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2151 __int16 v13[2]; // [sp+60h] [bp-8h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2152 __int16 v14[2]; // [sp+64h] [bp-4h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2153
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2154 memcpy(&_this, window_SpeakInHouse, sizeof(_this));
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2155 _this.uFrameX = 483;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2156 _this.uFrameWidth = 148;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2157 _this.uFrameZ = 334;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2158 *(int *)v13 = TargetColor(0xFFu, 0xFFu, 0xFFu);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2159 *(int *)v14 = TargetColor(0xFFu, 0xFFu, 0x9Bu);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2160 sprintf(pTmpBuf.data(), "%s: %d", pGlobalTXT_LocalizationStrings[25], pParty->uNumGoldInBank);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2161 _this.DrawTitleText(pFontArrus, 0, 0xDCu, v14[0], pTmpBuf.data(), 3u);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2162 switch(dialog_menu_id)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2163 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2164 case HOUSE_DIALOGUE_MAIN:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2165 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2166 v8 = v14[0];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2167 if ( pDialogueWindow->pCurrentPosActiveItem != 2 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2168 v8 = v13[0];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2169 _this.DrawTitleText(pFontArrus, 0, 0x92u, v8, pGlobalTXT_LocalizationStrings[60], 3u);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2170 v9 = v14[0];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2171 if ( pDialogueWindow->pCurrentPosActiveItem != 3 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2172 v9 = v13[0];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2173 _this.DrawTitleText(pFontArrus, 0, 0xB0u, v9, pGlobalTXT_LocalizationStrings[244], 3u);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2174 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2175 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2176 case HOUSE_DIALOGUE_BANK_7:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2177 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2178 v0 = window_SpeakInHouse;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2179 if ( window_SpeakInHouse->receives_keyboard_input_2 != WINDOW_INPUT_IN_PROGRESS)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2180 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2181 if ( window_SpeakInHouse->receives_keyboard_input_2 == WINDOW_INPUT_CONFIRMED)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2182 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2183 v6 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2184 v7 = v6;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2185 if ( !v6 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2186 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2187 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2188 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2189 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2190 if ( v6 > pParty->uNumGold )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2191 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2192 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2193 v7 = pParty->uNumGold;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2194 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2195 if ( v7 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2196 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2197 Party::TakeGold(v7);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2198 pParty->uNumGoldInBank += v7;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2199 if ( uActiveCharacter )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2200 pPlayers[uActiveCharacter]->PlaySound(SPEECH_81, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2201 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2202 v0 = window_SpeakInHouse;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2203 v0->receives_keyboard_input_2 = WINDOW_INPUT_NONE;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2204 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2205 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2206 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2207 if (window_SpeakInHouse->receives_keyboard_input_2 != WINDOW_INPUT_CANCELLED)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2208 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2209 v0->receives_keyboard_input_2 = WINDOW_INPUT_NONE;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2210 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2211 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2212 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2213 v11 = pGlobalTXT_LocalizationStrings[112];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2214 v10 = pGlobalTXT_LocalizationStrings[60];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2215 sprintf(pTmpBuf.data(), "%s\n%s", v10, v11);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2216 _this.DrawTitleText(pFontArrus, 0, 0x92u, v14[0], pTmpBuf.data(), 3u);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2217 _this.DrawTitleText(pFontArrus, 0, 0xBAu, v13[0], (const char *)pKeyActionMap->pPressedKeysBuffer, 3u);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2218 v4 = pFontArrus;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2219 v5 = pFontArrus->GetLineWidth((const char *)pKeyActionMap->pPressedKeysBuffer);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2220 _this.DrawFlashingInputCursor(v5 / 2 + 80, 185, v4);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2221 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2222 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2223
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2224 case HOUSE_DIALOGUE_BANK_8:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2225 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2226 v0 = window_SpeakInHouse;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2227 if ( window_SpeakInHouse->receives_keyboard_input_2 != WINDOW_INPUT_IN_PROGRESS)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2228 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2229 if ( window_SpeakInHouse->receives_keyboard_input_2 == WINDOW_INPUT_CONFIRMED)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2230 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2231 window_SpeakInHouse->receives_keyboard_input_2 = WINDOW_INPUT_NONE;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2232 v2 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2233 v3 = v2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2234 if ( v2 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2235 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2236 if ( v2 > pParty->uNumGoldInBank )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2237 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2238 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2239 v3 = pParty->uNumGoldInBank;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2240 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2241 if ( v3 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2242 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2243 Party::SetGold(pParty->uNumGold + v3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2244 pParty->uNumGoldInBank -= v3;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2245 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2246 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2247 v0->receives_keyboard_input_2 = WINDOW_INPUT_NONE;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2248 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2249 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2250 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2251 if ( window_SpeakInHouse->receives_keyboard_input_2 != WINDOW_INPUT_CANCELLED)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2252 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2253 v0->receives_keyboard_input_2 = WINDOW_INPUT_NONE;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2254 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2255 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2256 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2257 v11 = pGlobalTXT_LocalizationStrings[112];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2258 v10 = pGlobalTXT_LocalizationStrings[244];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2259 sprintfex(pTmpBuf.data(), "%s\n%s", v10, v11);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2260 _this.DrawTitleText(pFontArrus, 0, 0x92u, v14[0], pTmpBuf.data(), 3u);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2261 _this.DrawTitleText(pFontArrus, 0, 0xBAu, v13[0], (const char *)pKeyActionMap->pPressedKeysBuffer, 3u);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2262 v4 = pFontArrus;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2263 v5 = pFontArrus->GetLineWidth((const char *)pKeyActionMap->pPressedKeysBuffer);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2264 _this.DrawFlashingInputCursor(v5 / 2 + 80, 185, v4);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2265 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2266 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2267 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2268
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2269 default:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2270 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2271 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2272 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2273 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2274 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2275 // F8B19C: using guessed type int dword_F8B19C;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2276
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2277 //----- (004B8285) --------------------------------------------------------
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2278 void __cdecl TavernDialog()
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2279 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2280 int v0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2281 int pItemNum;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2282 double v2; // st7@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2283 signed int v3; // ebx@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2284 int v4; // ecx@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2285 int v5; // esi@3
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2286 signed int v6; // edi@5
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2287 int v7; // ecx@5
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2288 int pNumString; // edi@16
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2289 signed int v9; // esi@16
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2290 unsigned int pNumActiveItem; // esi@18
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2291 int v11; // eax@18
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2292 unsigned int v12; // eax@19
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2293 int v13; // eax@21
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2294 int v14; // ecx@26
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2295 //GUIButton *v15; // eax@28
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2296 //GUIButton *v16; // esi@28
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2297 int v17; // eax@28
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2298 char *v18; // eax@30
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2299 int v19; // eax@30
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2300 unsigned int v20; // ecx@30
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2301 int v21; // edx@30
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2302 int v22; // eax@30
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2303 unsigned __int16 v23; // ax@30
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2304 int v24; // eax@34
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2305 int v25; // eax@34
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2306 char *v26; // esi@36
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2307 int v27; // edi@46
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2308 unsigned int pColorText; // eax@57
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2309 signed int v31; // eax@59
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2310 //GUIWindow *v33; // edi@64
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2311 int v34; // eax@64
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2312 int v35; // ecx@64
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2313 int v36; // esi@64
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2314 char v37; // sf@64
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2315 GUIButton *pButton; // eax@65
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2316 int v39; // edx@69
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2317 int v40; // ecx@69
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2318 int v41; // ecx@69
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2319 int v42; // ecx@70
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2320 unsigned int v43; // edx@70
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2321 int v44; // edx@71
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2322 int v45; // ecx@71
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2323 int v46; // ecx@72
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2324 int v47; // eax@74
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2325 signed int v48; // edi@77
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2326 signed int i; // esi@79
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2327 int v50; // eax@80
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2328 //GUIWindow *v51; // ecx@81
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2329 _QWORD v52; // qax@81
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2330 signed int v53; // edi@81
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2331 int v54; // edi@81
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2332 //GUIButton *v55; // esi@83
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2333 const char **v56; // eax@83
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2334 int v57; // eax@83
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2335 unsigned int v58; // ecx@83
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2336 //Player *v59; // edx@83
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2337 unsigned __int16 v60; // ax@83
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2338 int v61; // eax@99
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2339 char *v63; // eax@99
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2340 GUIFont *v64; // edx@99
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2341 GUIFont *v65; // edi@100
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2342 unsigned int v66; // [sp-10h] [bp-284h]@75
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2343 unsigned __int16 v67; // [sp-Ch] [bp-280h]@75
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2344 int v68; // [sp-Ch] [bp-280h]@99
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2345 char *v69; // [sp-8h] [bp-27Ch]@75
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2346 int v70; // [sp-8h] [bp-27Ch]@99
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2347 unsigned int v71; // [sp-4h] [bp-278h]@75
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2348 const char *v72; // [sp-4h] [bp-278h]@93
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2349 unsigned int v73; // [sp-4h] [bp-278h]@99
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2350 char pTopic1[100]; // [sp+Ch] [bp-268h]@55
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2351 char pTopic4[100]; // [sp+70h] [bp-204h]@59
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2352 char pTopic2[100]; // [sp+D4h] [bp-1A0h]@57
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2353 char pTopic3[100]; // [sp+138h] [bp-13Ch]@59
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2354 //GUIWindow v78; // [sp+19Ch] [bp-D8h]@99
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2355 GUIWindow dialog_window; // [sp+1F0h] [bp-84h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2356 char *Str[2]; // [sp+244h] [bp-30h]@30
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2357 unsigned int pColorWhite; // [sp+24Ch] [bp-28h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2358 unsigned __int8 pTopic3Height; // [sp+253h] [bp-21h]@59
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2359 int v83; // [sp+254h] [bp-20h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2360 int pColorYellow; // [sp+258h] [bp-1Ch]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2361 Player *pPlayer; // [sp+25Ch] [bp-18h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2362 int all_text_height; // [sp+260h] [bp-14h]@18
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2363 unsigned __int8 v87; // [sp+266h] [bp-Eh]@59
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2364 unsigned __int8 pTopic2Height; // [sp+267h] [bp-Dh]@57
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2365 int v89; // [sp+268h] [bp-Ch]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2366 unsigned int pTopic1Height; // [sp+26Fh] [bp-5h]@55
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2367 int v91; // [sp+270h] [bp-4h]@3
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2368 GUIFont *pOutString;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2369 unsigned __int8 pTopic4Height;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2370 int pTextHeight;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2371
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2372 pPlayer = pPlayers[uActiveCharacter];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2373 memcpy(&dialog_window, window_SpeakInHouse, sizeof(dialog_window));
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2374 dialog_window.uFrameX = 483;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2375 dialog_window.uFrameWidth = 148;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2376 dialog_window.uFrameZ = 334;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2377 pColorWhite = TargetColor(0xFFu, 0xFFu, 0xFFu);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2378 pColorYellow = TargetColor(0xFFu, 0xFFu, 0x9Bu);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2379 v2 = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2380 *(float *)&v83 = v2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2381 *(float *)&v89 = v2 * v2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2382 v3 = (signed __int64)(*(float *)&v89 * 0.1);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2383 pItemNum = v3 * (100 - pPlayer->GetMerchant()) / 100;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2384 if ( pItemNum < v3 / 3 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2385 pItemNum = v3 / 3;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2386 v5 = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2387 pOutString = (GUIFont *)pItemNum;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2388 if ( pItemNum <= 0 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2389 pOutString = (GUIFont *)1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2390 v6 = (signed __int64)(*(float *)&v89 * *(float *)&v83 * 0.0099999998);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2391 v7 = v6 * (100 - pPlayer->GetMerchant()) / 100;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2392 if ( v7 < v6 / 3 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2393 v7 = v6 / 3;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2394 v83 = v7;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2395 if ( v7 <= 0 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2396 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2397 v7 = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2398 v83 = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2399 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2400
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2401 switch(dialog_menu_id)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2402 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2403 case HOUSE_DIALOGUE_MAIN:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2404 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2405 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2406 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2407
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2408 sprintf(pTopic1, "\f%05d", pDialogueWindow->pCurrentPosActiveItem == 2 ? pColorYellow : pColorWhite);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2409 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[178], pOutString); // Rent room for %d gold
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2410 strcat(pTopic1, pTmpBuf2.data());
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2411 pTopic1Height = pFontArrus->CalcTextHeight(pTopic1, &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2412 strcat(pTopic1, "\n \n");
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2413
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2414 sprintf(pTopic2, "\f%05d", pDialogueWindow->pCurrentPosActiveItem == 3 ? pColorYellow : pColorWhite);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2415 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[86], // Buy food for %d days for %d gold
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2416 (unsigned int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier, v83);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2417 strcat(pTopic2, pTmpBuf2.data());
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2418 pTopic2Height = pFontArrus->CalcTextHeight(pTopic2, &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2419 strcat(pTopic2, "\n \n");
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2420
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2421 sprintf(pTopic3, "\f%05d", pDialogueWindow->pCurrentPosActiveItem == 4 ? pColorYellow : pColorWhite);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2422 strcat(pTopic3, pGlobalTXT_LocalizationStrings[160]); // Learn Skills
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2423 pTopic3Height = pFontArrus->CalcTextHeight(pTopic3, &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2424 strcat(pTopic3, "\n \n");
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2425 pTopic4[0] = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2426 if ( (signed int)window_SpeakInHouse->par1C >= 108 && (signed int)window_SpeakInHouse->par1C <= 120 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2427 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2428 sprintf(pTopic4, "\f%05d", pDialogueWindow->pCurrentPosActiveItem == 5 ? pColorYellow : pColorWhite);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2429 strcat(pTopic4, pGlobalTXT_LocalizationStrings[611]); // Play Arcomage
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2430 pTopic4Height = pFontArrus->CalcTextHeight(pTopic4, &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2431 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2432 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2433 v36 = LOBYTE(pFontArrus->uFontHeight) - 3;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2434 v37 = -pDialogueWindow->pNumPresenceButton < 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2435 if ( !(v37 ^ (pNumActiveItem < pNumActiveItem + pDialogueWindow->pNumPresenceButton)) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2436 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2437 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2438 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2439 pButton = pDialogueWindow->GetControl(pNumActiveItem);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2440 if ( pButton->msg_param == 15 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2441 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2442 v46 = pTopic1Height;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2443 pButton->uHeight = pTopic1Height;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2444 pButton->uY = 146;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2445 v41 = v46 + 145;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2446 pButton->uW = v41;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2447 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2448 else if ( pButton->msg_param == 16 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2449 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2450 v44 = pTopic2Height;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2451 v45 = pTopic1Height + v36 + 146;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2452 pButton->uHeight = pTopic2Height;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2453 pButton->uY = v45;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2454 v41 = v45 + v44 - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2455 pButton->uW = v41;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2456 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2457 else if ( pButton->msg_param == 96 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2458 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2459 v42 = pTopic1Height + pTopic2Height + 2 * v36 + 146;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2460 v43 = pTopic3Height;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2461 pButton->uY = v42;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2462 pButton->uHeight = v43;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2463 v41 = v43 + v42 - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2464 pButton->uW = v41;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2465 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2466 else if ( pButton->msg_param == 101 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2467 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2468 v39 = pTopic1Height + 3 * v36 + pTopic4Height + pTopic2Height + 146;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2469 v40 = pTopic4Height;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2470 pButton->uHeight = pTopic4Height;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2471 pButton->uY = v39;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2472 v41 = v39 + v40 - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2473 pButton->uW = v41;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2474 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2475 pNumActiveItem++;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2476 if ( pNumActiveItem >= pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2477 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2478 sprintfex(pTmpBuf.data(), "%s%s%s%s", &pTopic1, &pTopic2, &pTopic3, &pTopic4);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2479 dialog_window.DrawTitleText(pFontArrus, 0, 146, 0, pTmpBuf.data(), 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2480 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2481 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2482 while ( pNumActiveItem < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2483 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2484 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2485 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2486 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RULES:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2487 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2488 pOutString = pFontArrus;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2489 strcpy(pTmpBuf.data(), pNPCTopics[354].pText);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2490 dialog_window.uFrameWidth = game_viewport_width;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2491 dialog_window.uFrameZ = 452;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2492 pTextHeight = pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 12, 0) + 7;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2493 if ( 352 - pTextHeight < 8 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2494 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2495 pOutString = pFontCreate;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2496 pTextHeight = pFontCreate->CalcTextHeight(pTmpBuf.data(), &dialog_window, 12, 0) + 7;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2497 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2498 auto pTex = pIcons_LOD->GetTexture(uTextureID_Leather);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2499 pRenderer->_4A6A68(8, 352 - pTextHeight, pTex, pTex->uTextureHeight - pTextHeight);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2500 pRenderer->DrawTextureIndexed(8, 347 - pTextHeight, pTexture_591428);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2501 v63 = FitTextInAWindow(pTmpBuf.data(), pOutString, &dialog_window, 0xCu, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2502 window_SpeakInHouse->DrawText(pOutString, 12, 354 - pTextHeight, 0, v63, 0, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2503 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2504 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2505 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_VICTORY_CONDITIONS:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2506 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2507 strcpy(pTmpBuf.data(), pNPCTopics[(uint)window_SpeakInHouse->ptr_1C + 247].pText);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2508 dialog_window.uFrameWidth = game_viewport_width;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2509 dialog_window.uFrameZ = 452;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2510 v61 = pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 12, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2511 pTextHeight = v61 + 7;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2512 auto pTex = pIcons_LOD->GetTexture(uTextureID_Leather);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2513 pRenderer->_4A6A68(8, 352 - (v61 + 7), pTex, pTex->uTextureHeight - (v61 + 7));
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2514 pRenderer->DrawTextureIndexed(8, 347 - pTextHeight, pTexture_591428);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2515 v63 = FitTextInAWindow(pTmpBuf.data(), pFontArrus, &dialog_window, 0xCu, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2516 window_SpeakInHouse->DrawText(pFontArrus, 12, 354 - pTextHeight, 0, v63, 0, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2517 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2518 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2519 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RESULT:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2520 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2521 if ( pArcomageGame->bGameInProgress == 1 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2522 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2523 if ( pArcomageGame->uGameResult )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2524 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2525 if ( pArcomageGame->uGameResult == 1 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2526 v72 = pGlobalTXT_LocalizationStrings[640];// You won!
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2527 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2528 v72 = pGlobalTXT_LocalizationStrings[641];// You lost!
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2529 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2530 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2531 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2532 v72 = pGlobalTXT_LocalizationStrings[639];// A tie!
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2533 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2534 strcpy(pTmpBuf.data(), v72);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2535 v66 = (174 - pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 0, 0)) / 2 + 138;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2536 dialog_window.DrawTitleText(pFontArrus, 0, v66, pColorYellow, pTmpBuf.data(), 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2537 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2538 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2539 case HOUSE_DIALOGUE_TAVERN_REST:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2540 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2541 if ( pParty->uNumGold >= (unsigned int)pOutString )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2542 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2543 Party::TakeGold((unsigned int)pOutString);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2544 v27 = (int)window_SpeakInHouse->ptr_1C;//107
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2545 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2546 dialog_menu_id = HOUSE_DIALOGUE_NULL;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2547 sub_4BD8B5();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2548 sub_4B1D27();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2549 pVideoPlayer->Unload();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2550 window_SpeakInHouse->Release();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2551 window_SpeakInHouse = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2552 if ( pMessageQueue_50CBD0->uNumMessages )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2553 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2554 pMessageQueue_50CBD0->pMessages[0].eType = UIMSG_RentRoom;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2555 pMessageQueue_50CBD0->pMessages[0].param = v27;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2556 pMessageQueue_50CBD0->pMessages[0].field_8 = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2557 ++pMessageQueue_50CBD0->uNumMessages;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2558 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2559 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2560 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2561 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_Goodbye);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2562 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, v5, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2563 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2564 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2565
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2566 case HOUSE_DIALOGUE_LEARN_SKILLS:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2567 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2568 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2569 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2570 v0 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2571 v9 = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2572 pItemNum = v9 * (100 - pPlayer->GetMerchant()) / 100;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2573 if ( pItemNum < v9 / 3 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2574 pItemNum = v9 / 3;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2575 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2576 all_text_height = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2577 if ( pNumActiveItem < pNumActiveItem + pDialogueWindow->pNumPresenceButton )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2578 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2579 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2580 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2581 v12 = pDialogueWindow->GetControl(pNumActiveItem)->msg_param - 36;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2582 if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayer->classType][v12] && !pPlayer->pActiveSkills[v12] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2583 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2584 all_text_height = pFontArrus->CalcTextHeight(pSkillNames[v12], &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2585 v0++;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2586 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2587 ++pNumActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2588 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2589 while ( pNumActiveItem < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2590 if ( v0 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2591 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2592 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], pItemNum);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2593 dialog_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2594 v91 = (149 - all_text_height) / v0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2595 if ( (149 - all_text_height) / v0 > 32 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2596 v91 = 32;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2597 v14 = (149 - v0 * v91 - all_text_height) / 2 - v91 / 2 + 162;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2598 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2599 if ( pNumActiveItem < pNumActiveItem + pDialogueWindow->pNumPresenceButton )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2600 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2601 pItemNum = 2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2602 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2603 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2604 pButton = pDialogueWindow->GetControl(pItemNum);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2605 v17 = pButton->msg_param - 36;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2606 if ( !byte_4ED970_skill_learn_ability_by_class_table[pPlayer->classType][v17] || pPlayer->pActiveSkills[v17] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2607 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2608 pButton->uW = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2609 pButton->uHeight = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2610 pButton->uY = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2611 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2612 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2613 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2614 pButton->uY = v91 + v14;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2615 pTextHeight = pFontArrus->CalcTextHeight(pSkillNames[v17], &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2616 pButton->uHeight = pTextHeight;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2617 v14 = pTextHeight + pButton->uY - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2618 pButton->uW = v14;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2619 pColorText = pColorYellow;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2620 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2621 pColorText = pColorWhite;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2622 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, pSkillNames[v17], 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2623 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2624 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2625 pItemNum++;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2626 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2627 while ( pItemNum < pNumActiveItem );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2628 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2629 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2630 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2631 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2632 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayer->pName, pClassNames[pPlayer->classType]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2633 strcat(pTmpBuf.data(), "\n \n");
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2634 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2635 pTextHeight = (174 - pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 0, 0)) / 2 + 138;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2636 dialog_window.DrawTitleText(pFontArrus, 0, pTextHeight, pColorYellow, pTmpBuf.data(), 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2637 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2638 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2639
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2640 case HOUSE_DIALOGUE_TAVERN_BUY_FOOD:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2641 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2642 *(_QWORD *)Str = pParty->uNumFoodRations;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2643 //if ( (double)pParty->uNumFoodRations >= p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2644 if ( (double)pParty->uNumFoodRations >= p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2645 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2646 ShowStatusBarString(pGlobalTXT_LocalizationStrings[140], 2);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2647 if ( uActiveCharacter )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2648 pPlayers[uActiveCharacter]->PlaySound(SPEECH_67, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2649 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, v5, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2650 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2651 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2652 if ( pParty->uNumGold >= v7 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2653 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2654 Party::TakeGold(v7);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2655 //pParty->uNumFoodRations = (signed __int64)p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2656 pParty->uNumFoodRations = (signed __int64)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2657 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_Greeting_2);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2658 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2659 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2660 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2661 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2); // "You don't have enough gold"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2662 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_Goodbye);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2663 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, v5, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2664 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2665 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2666
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2667 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_MAIN:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2668 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2669 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2670 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2671 v48 = 2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2672 pShopOptions[0] = pGlobalTXT_LocalizationStrings[620];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2673 pShopOptions[1] = pGlobalTXT_LocalizationStrings[622];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2674 pOutString = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2675 if ( pParty->HasItem(0x28Bu) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2676 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2677 pShopOptions[2] = pGlobalTXT_LocalizationStrings[621];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2678 v48 = 3;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2679 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2680 for ( i = 0; i < v48; ++i )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2681 all_text_height = pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2682 all_text_height = (174 - all_text_height) / v48;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2683 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2684 v54 = (174 - v48 * (174 - all_text_height) / v48 - all_text_height) / 2 - (174 - all_text_height) / v48 / 2 + 138;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2685 v37 = -pDialogueWindow->pNumPresenceButton < 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2686 if ( pNumActiveItem < pNumActiveItem + pDialogueWindow->pNumPresenceButton )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2687 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2688 pItemNum = 2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2689 pNumString = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2690 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2691 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2692 pButton = pDialogueWindow->GetControl(pItemNum);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2693 pButton->uY = all_text_height + v54;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2694 pTextHeight = pFontArrus->CalcTextHeight((const char *)pShopOptions[pNumString], &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2695 pButton->uHeight = pTextHeight;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2696 v54 = pButton->uY + pTextHeight - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2697 pButton->uW = v54;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2698 pColorText = pColorYellow;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2699 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2700 pColorText = pColorWhite;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2701 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, (const char *)pShopOptions[pNumString], 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2702 pItemNum++;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2703 ++pNumString;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2704 pNumActiveItem = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2705 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2706 while ( pItemNum < pNumActiveItem );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2707 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2708 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2709 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2710 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2711 default:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2712 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2713 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2714 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2715 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2716 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2717
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2718
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2719 //----- (004B910F) --------------------------------------------------------
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2720 void __cdecl WeaponShopDialog()
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2721 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2722 int v0; // ebx@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2723 int pNumActiveItem; // eax@6
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2724 signed int v2; // esi@8
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2725 ItemGen *v4; // eax@11
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2726 char *v5; // ecx@12
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2727 unsigned __int8 v6; // dl@13
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2728 char *v7; // edx@14
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2729 int v9; // ST08_4@16
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2730 int v10; // eax@16
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2731 signed int v11; // esi@18
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2732 int v12; // ST08_4@21
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2733 int v13; // eax@21
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2734 int v14; // edi@23
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2735 char **v15; // esi@23
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2736 int v16; // eax@24
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2737 //int v18; // edx@25
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2738 int v19; // edi@25
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2739 unsigned __int8 v20; // sf@25
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2740 GUIButton *pButton; // esi@27
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2741 int pNewItem; // eax@27
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2742 unsigned int v24; // ecx@27
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2743 int v25; // edx@27
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2744 unsigned int pColorText; // ax@27
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2745 signed int v27; // esi@32
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2746 int v28; // ST08_4@36
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2747 int v29; // eax@36
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2748 signed int v32; // esi@41
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2749 unsigned int v33; // esi@43
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2750 int v34; // eax@43
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2751 unsigned int v35; // eax@44
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2752 int v36; // eax@46
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2753 __int32 v37; // ecx@51
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2754 int v40; // eax@53
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2755 char *v41; // eax@55
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2756 unsigned int v43; // ecx@55
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2757 const char **v44; // edx@55
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2758 int v45; // eax@55
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2759 int v47; // eax@59
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2760 const char **v48; // eax@63
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2761 unsigned int v49; // esi@65
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2762 Texture *v50; // eax@65
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2763 int v51; // edi@65
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2764 int v52; // esi@70
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2765 Texture *v53; // ST1C_4@70
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2766 int v54; // edi@70
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2767 signed int v55; // ecx@73
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2768 SHORT v56; // di@82
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2769 bool v57; // eax@82
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2770 const char *v58; // ecx@84
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2771 POINT *v59; // esi@89
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2772 LONG v60; // ecx@90
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2773 int v61; // eax@90
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2774 int v62; // ecx@90
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2775 ItemGen *pItemInShop; // esi@90
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2776 int v64; // eax@95
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2777 int all_text_height; // esi@96
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2778 char **v66; // edi@96
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2779 int v67; // eax@97
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2780 int v69; // edx@98
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2781 int v70; // edi@98
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2782 int v71;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2783 const char **v72; // eax@100
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2784 int pTextHeight; // eax@100
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2785 unsigned int v74; // ecx@100
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2786 int v78; // [sp-14h] [bp-10Ch]@14
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2787 ItemGen *v79; // [sp-10h] [bp-108h]@12
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2788 int v80; // [sp-10h] [bp-108h]@14
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2789 void *v81; // [sp-Ch] [bp-104h]@12
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2790 unsigned __int16 v82; // [sp-Ch] [bp-104h]@14
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2791 int v83; // [sp-8h] [bp-100h]@11
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2792 char *v84; // [sp-8h] [bp-100h]@14
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2793 __int64 *v85; // [sp-4h] [bp-FCh]@11
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2794 unsigned int v86; // [sp-4h] [bp-FCh]@14
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2795 POINT v87; // [sp+Ch] [bp-ECh]@8
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2796 POINT v88; // [sp+14h] [bp-E4h]@18
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2797 POINT v89; // [sp+1Ch] [bp-DCh]@89
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2798 POINT v90; // [sp+24h] [bp-D4h]@19
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2799 POINT v91; // [sp+2Ch] [bp-CCh]@89
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2800 POINT v92; // [sp+34h] [bp-C4h]@9
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2801 POINT v93; // [sp+3Ch] [bp-BCh]@33
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2802 POINT v94; // [sp+44h] [bp-B4h]@18
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2803 POINT v95; // [sp+4Ch] [bp-ACh]@32
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2804 POINT v96; // [sp+54h] [bp-A4h]@18
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2805 POINT v97; // [sp+5Ch] [bp-9Ch]@32
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2806 POINT a2; // [sp+64h] [bp-94h]@8
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2807 POINT v99; // [sp+6Ch] [bp-8Ch]@32
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2808 POINT v100; // [sp+74h] [bp-84h]@8
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2809 GUIWindow dialog_window; // [sp+7Ch] [bp-7Ch]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2810 char *Str; // [sp+D0h] [bp-28h]@55
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2811 __int32 v103; // [sp+D4h] [bp-24h]@25
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2812 int pColorYellow; // [sp+D8h] [bp-20h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2813 int pColorWhite; // [sp+DCh] [bp-1Ch]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2814 POINT v106; // [sp+E0h] [bp-18h]@8
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2815 Player *pPlayer; // [sp+E8h] [bp-10h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2816 int pItemNum; // [sp+ECh] [bp-Ch]@26
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2817 const char **v109; // [sp+F0h] [bp-8h]@26
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2818 unsigned __int8 v110; // [sp+F7h] [bp-1h]@16
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2819 int pNumString;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2820
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2821 pPlayer = pPlayers[uActiveCharacter];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2822 memcpy(&dialog_window, window_SpeakInHouse, sizeof(dialog_window));
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2823 dialog_window.uFrameX = 483;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2824 dialog_window.uFrameWidth = 148;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2825 dialog_window.uFrameZ = 334;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2826 pColorWhite = TargetColor(0xFFu, 0xFFu, 0xFFu);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2827 pColorYellow = TargetColor(0xE1u, 0xCDu, 0x23u);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2828
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2829 switch(dialog_menu_id)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2830 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2831 case HOUSE_DIALOGUE_MAIN:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2832 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2833 pNumActiveItem = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2834 if ( pNumActiveItem )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2835 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2836 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2837 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2838 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2839 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2840 all_text_height = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2841 for (int i = 0; i < 4; ++i)//while ( (signed int)v15 < (signed int)&unk_F8B1C8 );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2842 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2843 v103 = (174 - all_text_height) / 4;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2844 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2845 v19 = (174 - 4 * (174 - all_text_height) / 4 - all_text_height) / 2 - (174 - all_text_height) / 4 / 2 + 138;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2846 v20 = -pDialogueWindow->pNumPresenceButton < 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2847 if ( v20 ^ (pNumActiveItem > pNumActiveItem + pDialogueWindow->pNumPresenceButton ))
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2848 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2849 pItemNum = 2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2850 pNumString = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2851 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2852 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2853 pButton = pDialogueWindow->GetControl(pItemNum);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2854 pButton->uY = v103 + v19;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2855 pTextHeight = pFontArrus->CalcTextHeight((const char *)pShopOptions[pNumString], &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2856 pButton->uHeight = pTextHeight;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2857 v19 = pButton->uY + pTextHeight - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2858 pButton->uW = v19;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2859 pColorText = pColorYellow;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2860 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2861 pColorText = pColorWhite;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2862 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, (const char *)pShopOptions[pNumString], 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2863 ++pItemNum;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2864 ++pNumString;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2865 pNumActiveItem = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2866 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2867 while ( pItemNum < pNumActiveItem );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2868 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2869 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2870 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2871 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2872
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2873 case HOUSE_DIALOGUE_SHOP_BUY_STANDARD:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2874 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2875 pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2876 v48 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2877 pItemNum = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2878 v109 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2879 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2880 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2881 // if ( pParty->field_777C[9 * (int)&v48[3 * (unsigned int)window_SpeakInHouse->ptr_1C]] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2882 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(int)v48].uItemID)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2883 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2884 v49 = word_F8B158[(signed int)v48];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2885 v50 = ItemsInShopTexture[(signed int)v48];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2886 v49 += 30;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2887 v51 = 60 - ((signed int)v50->uTextureWidth >> 1);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2888 pRenderer->DrawTextureTransparent(v51 + pItemNum, v49, v50);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2889 sub_40F92A(&pRenderer->pActiveZBuffer[v51 + pItemNum + 640 * v49], ItemsInShopTexture[(signed int)v109], (int)((char *)v109 + 1));
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2890 v48 = v109;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2891 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2892 pItemNum += 70;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2893 v48 = (const char **)((char *)v48 + 1);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2894 v109 = v48;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2895 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2896 while ( (signed int)v48 < 6 );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2897 pNumActiveItem = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2898 if ( pNumActiveItem )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2899 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2900 v55 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2901 v106.x = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2902 v106.x = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2903 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2904 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2905 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v55].uItemID)//9 * (v55 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2906 ++v106.x;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2907 ++v55;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2908 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2909 while ( v55 < 6 );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2910 v56 = GetAsyncKeyState(17);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2911 v57 = pPlayer->CanSteal();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2912 Str = (char *)v57;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2913 if ( v56 && v57 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2914 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2915 v58 = pGlobalTXT_LocalizationStrings[185];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2916 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2917 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2918 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2919 v58 = pGlobalTXT_LocalizationStrings[195];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2920 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2921 v58 = pGlobalTXT_LocalizationStrings[196];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2922 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2923 DrawTextAtStatusBar(v58, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2924 if ( v106.x )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2925 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2926 v59 = pMouse->GetCursorPos(&v91);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2927 pNumActiveItem = v59->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v89)->y];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2928 if ( pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2929 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2930 v60 = (pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF) - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2931 v106.x = v60;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2932 v61 = (int)window_SpeakInHouse->ptr_1C;//maybe ptr_1C - BuildID_2Events
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2933 // v62 = 9 * (v60 + 12 * v61);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2934 pItemInShop = (ItemGen *)&pParty->StandartItemsInShops[(int)v61][v60];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2935 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2936 pItemInShop = &pParty->SpecialItemsInShops[(int)v61][v60];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2937 if ( !v56 || !Str )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2938 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2939 v64 = pPlayer->SelectPhrasesTransaction(pItemInShop, BildingType_WeaponShop, v61, 2);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2940 v7 = BuilDialogueString((char *)pMerchantsBuyPhrases[v64], uActiveCharacter - 1, pItemInShop, (char *)window_SpeakInHouse->ptr_1C, 2, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2941 pTextHeight = pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2942 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v7, 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2943 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2944 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2945 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2946 v7 = BuilDialogueString(pGlobalTXT_LocalizationStrings[181], uActiveCharacter - 1, pItemInShop, (char *)window_SpeakInHouse->ptr_1C, 2, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2947 pTextHeight = pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2948 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v7, 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2949 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2950 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2951 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2952 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2953 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2954 dialog_window.DrawCurrentTime( pParty->field_3C.field_50[(unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2955 pNumActiveItem = 0; //added
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2956 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2957 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2958 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2959 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2960
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2961 case HOUSE_DIALOGUE_SHOP_SELL:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2962 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2963 draw_leather();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2964 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2965 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2966 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2967 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2968 if((v11 = pMouse->GetCursorPos(&v96)->x - 14, v106.x = (v11 >> 5) + 14 * ((pMouse->GetCursorPos(&v88)->y - 17) >> 5),
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2969 pMouse->GetCursorPos(&v94)->x <= 13) || pMouse->GetCursorPos(&v90)->x >= 462
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2970 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v106.x), !pNumActiveItem) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2971 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2972 v79 = (ItemGen *)&pPlayer->pInventoryItems[pNumActiveItem - 1];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2973 v13 = pPlayer->SelectPhrasesTransaction(v79, BildingType_WeaponShop, (int)window_SpeakInHouse->ptr_1C, 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2974 v7 = BuilDialogueString((char *)pMerchantsSellPhrases[v13], uActiveCharacter - 1, v79, (char *)window_SpeakInHouse->ptr_1C, 3, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2975 pTextHeight = pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2976 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v7, 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2977 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2978 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2979
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2980 case HOUSE_DIALOGUE_SHOP_IDENTIFY:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2981 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2982 draw_leather();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2983 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2984 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2985 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2986 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2987 if((v2 = pMouse->GetCursorPos(&a2)->x - 14, v106.x = (v2 >> 5) + 14 * ((pMouse->GetCursorPos(&v87)->y - 17) >> 5),
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2988 pMouse->GetCursorPos(&v100)->x <= 13) || pMouse->GetCursorPos(&v92)->x >= 462
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2989 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v106.x), !pNumActiveItem) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2990 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2991 v4 = (ItemGen *)&pPlayer->pInventoryItems[pNumActiveItem - 1];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2992 if (!v4->Identified())
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2993 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2994 v10 = pPlayer->SelectPhrasesTransaction(v4, BildingType_WeaponShop, (int)window_SpeakInHouse->ptr_1C, 4);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2995 v7 = BuilDialogueString((char *)pMerchantsIdentifyPhrases[v10], uActiveCharacter - 1, v4, (char *)window_SpeakInHouse->ptr_1C, 4, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2996 pTextHeight = pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2997 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v7, 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2998 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2999 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3000 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3001 v7 = BuilDialogueString("%24", uActiveCharacter - 1, v4, (char *)window_SpeakInHouse->ptr_1C, 4, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3002 pTextHeight = pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3003 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v7, 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3004 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3005 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3006 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3007
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3008 case HOUSE_DIALOGUE_SHOP_REPAIR:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3009 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3010 draw_leather();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3011 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3012 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[198], 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3013 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win())
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3014 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3015 if( (v2 = pMouse->GetCursorPos(&a2)->x - 14, v106.x = (v2 >> 5) + 14 * ((pMouse->GetCursorPos(&v87)->y - 17) >> 5),
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3016 pMouse->GetCursorPos(&v100)->x <= 13) || pMouse->GetCursorPos(&v92)->x >= 462
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3017 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v106.x), !pNumActiveItem)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3018 || (!(pPlayer->pOwnItems[pNumActiveItem-1].uAttributes& 2)) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3019 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3020 v4 = (ItemGen *)&pPlayer->pInventoryItems[pNumActiveItem - 1];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3021 v10 = pPlayer->SelectPhrasesTransaction(v4, BildingType_ArmorShop, (int)window_SpeakInHouse->ptr_1C, 5);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3022 v7 = BuilDialogueString((char *)pMerchantsRepairPhrases[v10], uActiveCharacter - 1, v4, (char *)window_SpeakInHouse->ptr_1C, 5, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3023 pTextHeight = (174 - pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0)) / 2 + 138;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3024 dialog_window.DrawTitleText(pFontArrus, 0, pTextHeight, pColorWhite, v7, 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3025 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3026 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3027 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3028
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3029 case HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3030 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3031 draw_leather();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3032 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3033 pShopOptions[0] = pGlobalTXT_LocalizationStrings[200];//sell
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3034 pShopOptions[1] = pGlobalTXT_LocalizationStrings[113];//identify
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3035 pShopOptions[2] = pGlobalTXT_LocalizationStrings[179];//repair
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3036 all_text_height = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3037 for ( int i = 0; i < 3; ++i )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3038 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3039 v103 = (174 - all_text_height) / 3;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3040 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3041 v70 = (3 * (58 - (signed int)v103) - all_text_height) / 2 - ((174 - all_text_height) / 3) / 2 + 138;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3042 v20 = -pDialogueWindow->pNumPresenceButton < 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3043 if ( v20 ^ (pNumActiveItem > pNumActiveItem + pDialogueWindow->pNumPresenceButton ))
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3044 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3045 pItemNum = 2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3046 pNumString = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3047 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3048 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3049 pButton = pDialogueWindow->GetControl(pItemNum);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3050 pButton->uY = v103 + v70;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3051 pTextHeight = pFontArrus->CalcTextHeight((const char *)pShopOptions[pNumString], &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3052 pButton->uHeight = pTextHeight;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3053 v70 = pButton->uY + pTextHeight - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3054 pButton->uW = v70;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3055 pColorText = pColorYellow;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3056 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3057 pColorText = pColorWhite;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3058 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, (const char *)pShopOptions[pNumString], 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3059 ++pItemNum;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3060 ++pNumString;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3061 pNumActiveItem = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3062 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3063 while ( pItemNum < pNumActiveItem );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3064 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3065 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3066 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3067
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3068 case HOUSE_DIALOGUE_SHOP_BUY_SPECIAL:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3069 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3070 pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3071 v109 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3072 pItemNum = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3073 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3074 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3075 // if ( pParty->field_C59C[9 * (int)&v109[3 * (unsigned int)window_SpeakInHouse->ptr_1C] + 724] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3076 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(signed int)v109].uItemID)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3077 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3078 v52 = word_F8B158[(signed int)v109] + 30;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3079 v53 = ItemsInShopTexture[(signed int)v109];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3080 v54 = 60 - ((signed int)v53->uTextureWidth >> 1);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3081 pRenderer->DrawTextureTransparent(v54 + pItemNum, word_F8B158[(signed int)v109] + 30, v53);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3082 sub_40F92A(&pRenderer->pActiveZBuffer[v54 + pItemNum + 640 * v52], ItemsInShopTexture[(signed int)v109], (int)((char *)v109 + 1));
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3083 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3084 v109 = (const char **)((char *)v109 + 1);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3085 pItemNum += 70;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3086 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3087 while ( (signed int)v109 < 6 );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3088 pNumActiveItem = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3089 if ( pNumActiveItem )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3090 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3091 v55 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3092 v106.x = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3093 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3094 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3095 // if ( pParty->field_C59C[9 * (v55 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3096 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v55].uItemID)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3097 ++v106.x;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3098 ++v55;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3099 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3100 while ( v55 < 6 );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3101 v56 = GetAsyncKeyState(17);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3102 v57 = pPlayer->CanSteal();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3103 Str = (char *)v57;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3104 if ( v56 && v57 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3105 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3106 v58 = pGlobalTXT_LocalizationStrings[185];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3107 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3108 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3109 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3110 v58 = pGlobalTXT_LocalizationStrings[195];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3111 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3112 v58 = pGlobalTXT_LocalizationStrings[196];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3113 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3114 DrawTextAtStatusBar(v58, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3115 if ( v106.x )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3116 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3117 v59 = pMouse->GetCursorPos(&v91);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3118 pNumActiveItem = v59->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v89)->y];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3119 if ( pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3120 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3121 v60 = (pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF) - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3122 v106.x = v60;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3123 v61 = (int)window_SpeakInHouse->ptr_1C;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3124 // v62 = 9 * (v60 + 12 * v61);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3125 pItemInShop = (ItemGen *)&pParty->StandartItemsInShops[(int)v61][v60];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3126 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3127 pItemInShop = &pParty->SpecialItemsInShops[(int)v61][v60];//v63 = (ItemGen *)&pParty->field_C59C[v62 + 724];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3128 if ( !v56 || !Str )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3129 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3130 v64 = pPlayer->SelectPhrasesTransaction(pItemInShop, BildingType_WeaponShop, v61, 2);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3131 v7 = BuilDialogueString((char *)pMerchantsBuyPhrases[v64], uActiveCharacter - 1, pItemInShop, (char *)window_SpeakInHouse->ptr_1C, 2, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3132 pTextHeight = pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3133 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v7, 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3134 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3135 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3136 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3137 v7 = BuilDialogueString(pGlobalTXT_LocalizationStrings[181], uActiveCharacter - 1, pItemInShop, (char *)window_SpeakInHouse->ptr_1C, 2, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3138 pTextHeight = pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3139 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v7, 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3140 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3141 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3142 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3143 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3144 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3145 dialog_window.DrawCurrentTime( pParty->field_3C.field_50[(unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3146 pNumActiveItem = 0; //added
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3147 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3148 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3149 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3150 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3151
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3152 case HOUSE_DIALOGUE_LEARN_SKILLS:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3153 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3154 if (!sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win())
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3155 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3156 v0 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3157 all_text_height = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3158 //v32 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (signed int)v31] * 500.0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3159 v32 = (signed __int64)(p2DEvents[(signed int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3160 pItemNum = v32 * (100 - pPlayer->GetMerchant()) / 100;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3161 if ( pItemNum < v32 / 3 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3162 pItemNum = v32 / 3;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3163 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3164 if ( pNumActiveItem >= pNumActiveItem + pDialogueWindow->pNumPresenceButton )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3165 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3166 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayer->pName, pClassNames[pPlayer->classType]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3167 strcat(pTmpBuf.data(), "\n \n");
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3168 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3169 pTextHeight = pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3170 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorYellow, pTmpBuf.data(), 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3171 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3172 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3173 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3174 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3175 v35 = pDialogueWindow->GetControl(pNumActiveItem)->msg_param - 36;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3176 if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayer->classType][v35] && !pPlayer->pActiveSkills[v35] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3177 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3178 all_text_height += pFontArrus->CalcTextHeight(pSkillNames[v35], &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3179 v0++;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3180 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3181 ++pNumActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3182 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3183 while ( pNumActiveItem < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3184 if ( !v0 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3185 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3186 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayer->pName, pClassNames[pPlayer->classType]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3187 strcat(pTmpBuf.data(), "\n \n");
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3188 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3189 pTextHeight = pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3190 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorYellow, pTmpBuf.data(), 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3191 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3192 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3193 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], pItemNum);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3194 dialog_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3195 v103 = (149 - all_text_height) / v0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3196 if ( (149 - all_text_height) / v0 > 32 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3197 v103 = 32;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3198 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3199 v37 = (149 - v0 * v103 - all_text_height) / 2 - v103 / 2 + 162;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3200 if ( pNumActiveItem < pNumActiveItem + pDialogueWindow->pNumPresenceButton )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3201 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3202 pItemNum = 2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3203 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3204 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3205 pButton = pDialogueWindow->GetControl(pItemNum);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3206 v40 = pButton->msg_param - 36;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3207 if ( !byte_4ED970_skill_learn_ability_by_class_table[pPlayer->classType][v40] || pPlayer->pActiveSkills[v40] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3208 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3209 pButton->uW = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3210 pButton->uHeight = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3211 pButton->uY = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3212 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3213 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3214 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3215 pButton->uY = v103 + v37;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3216 pTextHeight = pFontArrus->CalcTextHeight(pSkillNames[v40], &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3217 pButton->uHeight = pTextHeight;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3218 v37 = pButton->uY + pTextHeight - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3219 pButton->uW = v37;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3220 pColorText = pColorYellow;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3221 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3222 pColorText = pColorWhite;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3223 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, pSkillNames[v40], 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3224 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3225 pNumActiveItem = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3226 pItemNum++;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3227 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3228 while ( pItemNum < pNumActiveItem );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3229 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3230 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3231 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3232 default:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3233 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3234 if( dialog_menu_id > HOUSE_DIALOGUE_SHOP_REPAIR)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3235 pNumActiveItem = dialog_menu_id - 96;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3236 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3237 pNumActiveItem = dialog_menu_id - 4;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3238 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3239 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3240 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3241 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3242
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3243
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3244
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3245 //----- (004B9CC6) --------------------------------------------------------
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3246 void __cdecl AlchemistDialog()
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3247 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3248 int v0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3249 int pNumActiveItem; // eax@7
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3250 signed int v5; // esi@9
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3251 unsigned int v6; // esi@11
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3252 int v7; // eax@11
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3253 unsigned int v8; // eax@12
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3254 int v9; // eax@14
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3255 int v10; // ecx@19
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3256 int v13; // eax@21
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3257 char *v14; // eax@23
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3258 int v15; // eax@23
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3259 unsigned int v16; // ecx@23
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3260 int v17; // edx@23
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3261 int v18; // eax@23
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3262 int v20; // eax@27
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3263 char *v21; // edx@29
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3264 int v22; // esi@30
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3265 char **v23; // edi@30
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3266 int v24; // eax@31
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3267 int v26; // edx@32
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3268 int v27; // edi@32
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3269 unsigned __int8 v28; // sf@32
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3270 const char **v30; // eax@34
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3271 int v31; // eax@34
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3272 unsigned int v32; // ecx@34
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3273 int v34; // eax@34
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3274 signed int v36; // esi@39
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3275 ItemGen *v37; // eax@42
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3276 char *v38; // ecx@43
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3277 unsigned __int8 v39; // dl@44
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3278 int v40; // eax@46
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3279 int v41; // ST08_4@47
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3280 int v42; // eax@47
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3281 signed int v43; // esi@49
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3282 int v44; // ST08_4@52
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3283 int v45; // eax@52
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3284 Texture *v46; // ecx@55
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3285 unsigned int v47; // edi@55
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3286 unsigned int v48; // esi@57
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3287 int v49; // edx@61
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3288 Texture *v50; // ecx@67
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3289 unsigned int v51; // edi@67
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3290 unsigned int v52; // esi@69
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3291 int v53; // edx@73
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3292 Texture *v54; // ecx@79
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3293 unsigned int v55; // edi@79
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3294 unsigned int v56; // esi@81
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3295 int v57; // edx@85
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3296 Texture *v58; // ecx@91
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3297 unsigned int v59; // edi@91
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3298 unsigned int v60; // esi@93
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3299 int v61; // edx@97
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3300 signed int v62; // ecx@102
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3301 SHORT v63; // di@110
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3302 bool v64; // eax@110
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3303 const char *v65; // ecx@112
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3304 POINT *v66; // esi@117
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3305 int v67; // ecx@118
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3306 int v68; // eax@118
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3307 int v69; // ecx@118
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3308 ItemGen *v70; // esi@118
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3309 int v71; // eax@123
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3310 int all_text_height; // edi@125
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3311 char **v73; // esi@125
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3312 int v74; // eax@126
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3313 int pItemNum;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3314 int v76; // edx@127
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3315 int v77; // edi@127
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3316 GUIButton *pButton; // esi@129
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3317 const char **v79; // eax@129
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3318 int pTextHeight; // eax@129
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3319 unsigned int v81; // ecx@129
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3320 unsigned int pColorText; // ax@129
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3321 int v85; // [sp-14h] [bp-ECh]@29
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3322 int v86; // [sp-10h] [bp-E8h]@29
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3323 ItemGen *v87; // [sp-10h] [bp-E8h]@43
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3324 unsigned __int16 v88; // [sp-Ch] [bp-E4h]@29
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3325 void *v89; // [sp-Ch] [bp-E4h]@43
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3326 char *v90; // [sp-8h] [bp-E0h]@29
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3327 int v91; // [sp-8h] [bp-E0h]@42
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3328 unsigned int v92; // [sp-4h] [bp-DCh]@29
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3329 __int64 *v93; // [sp-4h] [bp-DCh]@42
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3330 POINT v94; // [sp+Ch] [bp-CCh]@39
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3331 POINT v95; // [sp+14h] [bp-C4h]@49
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3332 POINT v96; // [sp+1Ch] [bp-BCh]@117
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3333 POINT v97; // [sp+24h] [bp-B4h]@40
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3334 POINT v98; // [sp+2Ch] [bp-ACh]@117
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3335 POINT v99; // [sp+34h] [bp-A4h]@49
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3336 POINT v100; // [sp+3Ch] [bp-9Ch]@50
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3337 POINT v101; // [sp+44h] [bp-94h]@39
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3338 POINT v102; // [sp+4Ch] [bp-8Ch]@49
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3339 POINT a2; // [sp+54h] [bp-84h]@39
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3340 GUIWindow dialog_window; // [sp+5Ch] [bp-7Ch]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3341 int v105; // [sp+B0h] [bp-28h]@19
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3342 int pColorYellow; // [sp+B4h] [bp-24h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3343 int Str; // [sp+B8h] [bp-20h]@23
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3344 int pColorWhite; // [sp+BCh] [bp-1Ch]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3345 __int32 v109; // [sp+C0h] [bp-18h]@39
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3346 Player *pPlayer; // [sp+C4h] [bp-14h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3347 int pNumString; // [sp+C8h] [bp-10h]@9
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3348 unsigned int v112; // [sp+CCh] [bp-Ch]@9
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3349 unsigned __int8 v113; // [sp+D3h] [bp-5h]@47
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3350 int v114; // [sp+D4h] [bp-4h]@11
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3351
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3352 pPlayer = pPlayers[uActiveCharacter];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3353 memcpy(&dialog_window, window_SpeakInHouse, sizeof(dialog_window));
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3354 dialog_window.uFrameX = 483;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3355 dialog_window.uFrameWidth = 148;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3356 dialog_window.uFrameZ = 334;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3357 pColorWhite = TargetColor(0xFFu, 0xFFu, 0xFFu);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3358 pColorYellow = TargetColor(0xE1u, 0xCDu, 0x23u);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3359 switch(dialog_menu_id)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3360 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3361 case HOUSE_DIALOGUE_MAIN:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3362 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3363 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3364 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3365 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3366 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3367 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3368 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3369 all_text_height = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3370 for (int i = 0; i < 4; ++i)//while ( (signed int)v15 < (signed int)&unk_F8B1C8 );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3371 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3372 Str = (174 - all_text_height) / 4;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3373 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3374 v76 = pNumActiveItem + pDialogueWindow->pNumPresenceButton;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3375 v77 = (174 - 4 * (174 - all_text_height) / 4 - all_text_height) / 2 - (174 - all_text_height) / 4 / 2 + 138;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3376 v28 = -pDialogueWindow->pNumPresenceButton < 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3377 if ( v28 ^ (pNumActiveItem > v76) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3378 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3379 pItemNum = 2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3380 pNumString = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3381 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3382 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3383 pButton = pDialogueWindow->GetControl(pItemNum);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3384 pButton->uY = Str + v77;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3385 pTextHeight = pFontArrus->CalcTextHeight((const char *)pShopOptions[pNumString], &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3386 pButton->uHeight = pTextHeight;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3387 v77 = pButton->uY + pTextHeight - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3388 pButton->uW = v77;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3389 pColorText = pColorYellow;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3390 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3391 pColorText = pColorWhite;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3392 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, (const char *)pShopOptions[pNumString], 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3393 ++pItemNum;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3394 ++pNumString;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3395 pNumActiveItem = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3396 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3397 while ( pItemNum < pNumActiveItem );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3398 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3399 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3400 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3401 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3402 case HOUSE_DIALOGUE_SHOP_BUY_STANDARD:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3403 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3404 pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3405 v114 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3406 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3407 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3408 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v114].uItemID)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3409 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3410 v46 = ItemsInShopTexture[v114];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3411 v47 = 152 - v46->uTextureHeight;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3412 if ( (signed int)v47 < 1 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3413 v47 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3414 v48 = 75 * v114 - v46->uTextureWidth / 2 + 40;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3415 if ( v114 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3416 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3417 if ( v114 == 5 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3418 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3419 v49 = ItemsInShopTexture[5]->uTextureWidth;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3420 if ( (signed int)v48 > 457 - v49 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3421 v48 = 457 - v49;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3422 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3423 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3424 else if ( (signed int)v48 < 18 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3425 v48 = 18;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3426 pRenderer->DrawTextureTransparent(v48, v47, v46);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3427 sub_40F92A(&pRenderer->pActiveZBuffer[v48 + 640 * v47], ItemsInShopTexture[v114], v114 + 1);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3428 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3429 ++v114;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3430 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3431 while ( v114 < 6 );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3432 v114 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3433 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3434 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3435 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v114 + 6].uItemID)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3436 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3437 v50 = ItemsInShopTexture[v114 + 6];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3438 v51 = 308 - v50->uTextureHeight;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3439 if ( (signed int)v51 < 1 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3440 v51 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3441 v52 = 75 * v114 - v50->uTextureWidth / 2 + 40;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3442 if ( v114 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3443 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3444 if ( v114 == 5 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3445 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3446 v53 = ItemsInShopTexture[11]->uTextureWidth;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3447 if ( (signed int)v52 > 457 - v53 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3448 v52 = 457 - v53;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3449 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3450 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3451 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3452 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3453 if ( (signed int)v52 < 18 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3454 v52 = 18;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3455 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3456 pRenderer->DrawTextureTransparent(v52, v51, v50);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3457 sub_40F92A(&pRenderer->pActiveZBuffer[v52 + 640 * v51], ItemsInShopTexture[v114 + 6], v114 + 7);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3458 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3459 ++v114;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3460 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3461 while ( v114 < 6 );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3462 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3463 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3464 v62 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3465 v109 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3466 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3467 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3468 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v62].uItemID)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3469 ++v109;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3470 ++v62;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3471 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3472 while ( v62 < 12 );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3473 v63 = GetAsyncKeyState(17);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3474 v64 = pPlayer->CanSteal();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3475 Str = v64;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3476 if ( v63 && v64 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3477 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3478 v65 = pGlobalTXT_LocalizationStrings[185];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3479 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3480 else if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3481 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3482 v65 = pGlobalTXT_LocalizationStrings[195];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3483 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3484 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3485 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3486 v65 = pGlobalTXT_LocalizationStrings[196];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3487 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3488 DrawTextAtStatusBar(v65, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3489 if ( !v109 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3490 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3491 dialog_window.DrawCurrentTime( pParty->field_3C.field_50[ (unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3492 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3493 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3494 v66 = pMouse->GetCursorPos(&v98);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3495 pNumActiveItem = v66->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v96)->y];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3496 if ( pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3497 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3498 v67 = (pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF) - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3499 v70 = (ItemGen *)&pParty->StandartItemsInShops[(int)window_SpeakInHouse->ptr_1C][v67];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3500 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3501 v70 = &pParty->SpecialItemsInShops[(int)window_SpeakInHouse->ptr_1C][v67];//v70 = (ItemGen *)&pParty->field_C59C[v69 + 724];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3502 if ( !v63 || !Str )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3503 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3504 v71 = pPlayer->SelectPhrasesTransaction(v70, BildingType_AlchemistShop, (int)window_SpeakInHouse->ptr_1C, 2);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3505 v38 = (char *)pMerchantsBuyPhrases[v71];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3506 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3507 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3508 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3509 v38 = pGlobalTXT_LocalizationStrings[181];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3510 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3511 v21 = BuilDialogueString(v38, uActiveCharacter - 1, v70, (char *)window_SpeakInHouse->ptr_1C, 2, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3512 v40 = pFontArrus->CalcTextHeight(v21, &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3513 dialog_window.DrawTitleText(pFontArrus, 0, (174 - v40) / 2 + 138, pColorWhite, v21, 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3514 return ;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3515 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3516 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3517 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3518 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3519 case HOUSE_DIALOGUE_SHOP_SELL:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3520 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3521 draw_leather();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3522 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3523 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3524 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3525 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3526 if ((v43 = pMouse->GetCursorPos(&v99)->x - 14, v109 = (v43 >> 5) + 14 * ((pMouse->GetCursorPos(&v95)->y - 17) >> 5),
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3527 pMouse->GetCursorPos(&v102)->x <= 13) || pMouse->GetCursorPos(&v100)->x >= 462
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3528 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v109), !pNumActiveItem) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3529 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3530 v87 = (ItemGen *)&pPlayer->pInventoryItems[pNumActiveItem - 1];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3531 v45 = pPlayer->SelectPhrasesTransaction(v87, BildingType_AlchemistShop, (int)window_SpeakInHouse->ptr_1C, 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3532 v21 = BuilDialogueString((char *)pMerchantsSellPhrases[v45], uActiveCharacter - 1, v87, (char *)window_SpeakInHouse->ptr_1C, 3, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3533 pTextHeight = pFontArrus->CalcTextHeight(v21, &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3534 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v21, 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3535 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3536 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3537 case HOUSE_DIALOGUE_SHOP_IDENTIFY:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3538 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3539 draw_leather();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3540 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3541 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3542 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3543 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3544 if ((v36 = pMouse->GetCursorPos(&a2)->x - 14, v109 = (v36 >> 5) + 14 * ((pMouse->GetCursorPos(&v94)->y - 17) >> 5),
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3545 pMouse->GetCursorPos(&v101)->x <= 13) || pMouse->GetCursorPos(&v97)->x >= 462
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3546 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v109), !pNumActiveItem) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3547 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3548 v37 = (ItemGen *)&pPlayer->pInventoryItems[pNumActiveItem - 1];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3549 if (!v37->Identified())
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3550 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3551 v42 = pPlayer->SelectPhrasesTransaction(v37, BildingType_AlchemistShop, (int)window_SpeakInHouse->ptr_1C, 4);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3552 v38 = (char *)pMerchantsIdentifyPhrases[v42];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3553 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3554 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3555 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3556 v38 = "%24";
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3557 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3558 v21 = BuilDialogueString(v38, uActiveCharacter - 1, v37, (char *)window_SpeakInHouse->ptr_1C, 4, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3559 v40 = pFontArrus->CalcTextHeight(v21, &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3560 dialog_window.DrawTitleText(pFontArrus, 0, (174 - v40) / 2 + 138, pColorWhite, v21, 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3561 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3562 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3563 case HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3564 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3565 draw_leather();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3566 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3567 pShopOptions[0] = pGlobalTXT_LocalizationStrings[200];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3568 pShopOptions[1] = pGlobalTXT_LocalizationStrings[113];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3569 all_text_height = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3570 for ( int i = 0; i < 2; ++i )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3571 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3572 Str = (174 - all_text_height) / 2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3573 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3574 v26 = pNumActiveItem + pDialogueWindow->pNumPresenceButton;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3575 v27 = (2 * (87 - (174 - all_text_height) / 2) - all_text_height) / 2 - (174 - all_text_height) / 2 / 2 + 138;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3576 v28 = -pDialogueWindow->pNumPresenceButton < 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3577 if ( v28 ^ (pNumActiveItem > v26) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3578 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3579 pItemNum = 2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3580 pNumString = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3581 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3582 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3583 pButton = pDialogueWindow->GetControl(pItemNum);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3584 pButton->uY = Str + v27;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3585 pTextHeight = pFontArrus->CalcTextHeight((const char *)pShopOptions[pNumString], &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3586 pButton->uHeight = pTextHeight;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3587 v27 = pButton->uY + pTextHeight - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3588 pButton->uW = v27;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3589 pColorText = pColorYellow;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3590 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3591 pColorText = pColorWhite;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3592 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, (const char *)pShopOptions[pNumString], 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3593 ++pItemNum;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3594 ++pNumString;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3595 pNumActiveItem = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3596 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3597 while ( pItemNum < pNumActiveItem );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3598 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3599 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3600 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3601 case HOUSE_DIALOGUE_SHOP_BUY_SPECIAL:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3602 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3603 pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3604 v114 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3605 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3606 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3607 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v114].uItemID)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3608 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3609 v54 = ItemsInShopTexture[v114];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3610 v55 = 152 - v54->uTextureHeight;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3611 if ( (signed int)v55 < 1 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3612 v55 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3613 v56 = 75 * v114 - v54->uTextureWidth / 2 + 40;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3614 if ( v114 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3615 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3616 if ( v114 == 5 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3617 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3618 v57 = ItemsInShopTexture[5]->uTextureWidth;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3619 if ( (signed int)v56 > 457 - v57 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3620 v56 = 457 - v57;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3621 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3622 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3623 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3624 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3625 if ( (signed int)v56 < 18 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3626 v56 = 18;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3627 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3628 pRenderer->DrawTextureTransparent(v56, v55, v54);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3629 sub_40F92A(&pRenderer->pActiveZBuffer[v56 + 640 * v55], ItemsInShopTexture[v114], v114 + 1);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3630 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3631 ++v114;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3632 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3633 while ( v114 < 6 );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3634 v114 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3635 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3636 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3637 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(signed int)v114 + 6].uItemID) //not itemid
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3638 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3639 v58 = ItemsInShopTexture[v114 + 6];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3640 v59 = 308 - v58->uTextureHeight;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3641 if ( (signed int)v59 < 1 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3642 v59 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3643 v60 = 75 * v114 - v58->uTextureWidth / 2 + 40;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3644 if ( v114 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3645 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3646 if ( v114 == 5 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3647 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3648 v61 = ItemsInShopTexture[11]->uTextureWidth;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3649 if ( (signed int)v60 > 457 - v61 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3650 v60 = 457 - v61;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3651 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3652 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3653 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3654 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3655 if ( (signed int)v60 < 18 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3656 v60 = 18;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3657 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3658 pRenderer->DrawTextureTransparent(v60, v59, v58);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3659 sub_40F92A(&pRenderer->pActiveZBuffer[v60 + 640 * v59], ItemsInShopTexture[v114 + 6], v114 + 7);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3660 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3661 ++v114;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3662 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3663 while ( v114 < 6 );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3664 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3665 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3666 v62 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3667 v109 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3668 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3669 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3670 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v62].uItemID)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3671 ++v109;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3672 ++v62;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3673 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3674 while ( v62 < 12 );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3675 v63 = GetAsyncKeyState(17);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3676 v64 = pPlayer->CanSteal();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3677 Str = v64;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3678 if ( v63 && v64 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3679 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3680 v65 = pGlobalTXT_LocalizationStrings[185];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3681 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3682 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3683 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3684 v65 = pGlobalTXT_LocalizationStrings[195];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3685 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3686 v65 = pGlobalTXT_LocalizationStrings[196];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3687 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3688 DrawTextAtStatusBar(v65, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3689 if ( !v109 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3690 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3691 dialog_window.DrawCurrentTime( pParty->field_3C.field_50[ (unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3692 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3693 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3694 v66 = pMouse->GetCursorPos(&v98);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3695 pNumActiveItem = v66->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v96)->y];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3696 if ( pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3697 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3698 v67 = (pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF) - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3699 v109 = v67;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3700 v68 = (int)window_SpeakInHouse->ptr_1C;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3701 // v69 = 9 * (v67 + 12 * v68);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3702 v70 = (ItemGen *)&pParty->StandartItemsInShops[v68][v67];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3703 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3704 v70 = &pParty->SpecialItemsInShops[(int)v68][v67];//v70 = (ItemGen *)&pParty->field_C59C[v69 + 724];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3705 if ( !v63 || !Str )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3706 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3707 v71 = pPlayer->SelectPhrasesTransaction(v70, BildingType_AlchemistShop, v68, 2);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3708 v38 = (char *)pMerchantsBuyPhrases[v71];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3709 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3710 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3711 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3712 v38 = pGlobalTXT_LocalizationStrings[181];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3713 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3714 v21 = BuilDialogueString(v38, uActiveCharacter - 1, v70, (char *)window_SpeakInHouse->ptr_1C, 2, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3715 v40 = pFontArrus->CalcTextHeight(v21, &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3716 dialog_window.DrawTitleText(pFontArrus, 0, (174 - v40) / 2 + 138, pColorWhite, v21, 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3717 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3718 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3719 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3720 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3721 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3722 case HOUSE_DIALOGUE_LEARN_SKILLS:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3723 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3724 if (!sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win())
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3725 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3726 all_text_height = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3727 v5 = (signed __int64)(p2DEvents[(signed int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3728 pItemNum = v5 * (100 - pPlayer->GetMerchant()) / 100;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3729 if ( pItemNum < v5 / 3 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3730 pItemNum = v5 / 3;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3731 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3732 v114 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3733 if ( pNumActiveItem >= pNumActiveItem + pDialogueWindow->pNumPresenceButton )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3734 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3735 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayer->pName, pClassNames[pPlayer->classType]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3736 strcat(pTmpBuf.data(), "\n \n");
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3737 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3738 v40 = pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3739 dialog_window.DrawTitleText(pFontArrus, 0, (174 - v40) / 2 + 138, pColorYellow, pTmpBuf.data(), 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3740 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3741 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3742 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3743 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3744 v8 = pDialogueWindow->GetControl(pNumActiveItem)->msg_param - 36;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3745 if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayer->classType][v8] && !pPlayer->pActiveSkills[v8] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3746 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3747 all_text_height = pFontArrus->CalcTextHeight(pSkillNames[v8], &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3748 ++v114;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3749 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3750 ++pNumActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3751 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3752 while ( pNumActiveItem < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3753 if ( !v114 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3754 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3755 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayer->pName, pClassNames[pPlayer->classType]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3756 strcat(pTmpBuf.data(), "\n \n");
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3757 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3758 v40 = pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3759 dialog_window.DrawTitleText(pFontArrus, 0, (174 - v40) / 2 + 138, pColorYellow, pTmpBuf.data(), 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3760 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3761 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3762 if ( v114 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3763 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3764 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], pItemNum);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3765 dialog_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3766 v18 = (149 - all_text_height) / v114;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3767 if ( (149 - all_text_height) / v114 > 32 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3768 v18 = 32;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3769 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3770 v105 = (149 - v114 * v18 - all_text_height) / 2 - v18 / 2 + 162;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3771 if ( pNumActiveItem < pNumActiveItem + pDialogueWindow->pNumPresenceButton )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3772 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3773 pItemNum = 2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3774 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3775 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3776 pButton = pDialogueWindow->GetControl(pItemNum);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3777 v13 = pButton->msg_param - 36;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3778 if ( !byte_4ED970_skill_learn_ability_by_class_table[pPlayer->classType][v13] || pPlayer->pActiveSkills[v13] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3779 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3780 pButton->uW = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3781 pButton->uHeight = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3782 pButton->uY = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3783 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3784 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3785 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3786 pButton->uY = v18 + v105;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3787 pTextHeight = pFontArrus->CalcTextHeight(pSkillNames[v13], &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3788 pButton->uHeight = pTextHeight;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3789 v105 = pButton->uY + pTextHeight - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3790 pButton->uW = v105;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3791 pColorText = pColorYellow;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3792 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3793 pColorText = pColorWhite;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3794 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, pSkillNames[v13], 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3795 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3796 pNumActiveItem = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3797 pItemNum++;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3798 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3799 while ( pItemNum < pNumActiveItem );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3800 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3801 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3802 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3803 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3804 default:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3805 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3806 return;// (POINT *)dialog_menu_id - 96;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3807 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3808 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3809 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3810
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3811 //----- (004BA928) --------------------------------------------------------
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3812 void __cdecl ArmorShopDialog()
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3813 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3814 signed int v1; // esi@8
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3815 unsigned int v2; // eax@10
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3816 ItemGen *v3; // eax@11
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3817 char *v5; // ecx@12
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3818 char *v6; // eax@13
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3819 int v8; // eax@15
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3820 signed int v9; // esi@17
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3821 unsigned int v10; // eax@19
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3822 char *v11; // edi@19
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3823 int v12; // ST08_4@20
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3824 int v13; // eax@20
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3825 char *v15; // ecx@20
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3826 char **v16; // edi@22
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3827 int all_text_height; // ebx@22
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3828 char **v18; // esi@22
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3829 int v19; // eax@23
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3830 GUIWindow *v20; // ecx@24
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3831 int v21; // eax@24
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3832 int v22; // edx@24
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3833 int v23; // ebx@24
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3834 unsigned __int8 v24; // sf@24
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3835 GUIButton *pButton; // eax@26
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3836 unsigned int v28; // ecx@26
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3837 int v29; // edx@26
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3838 signed int v31; // esi@31
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3839 unsigned int v32; // eax@33
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3840 int v33; // eax@34
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3841 int v35; // eax@35
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3842 char *v36; // edx@36
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3843 signed int v38; // esi@42
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3844 unsigned int v39; // esi@44
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3845 int v40; // eax@44
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3846 unsigned int v41; // eax@45
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3847 int v42; // eax@47
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3848 int v43; // ecx@52
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3849 int v46; // eax@54
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3850 unsigned int v49; // ecx@56
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3851 int v51; // eax@56
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3852 int v53; // eax@60
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3853 int textureH; // eax@60
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3854 signed int textureW; // ebx@65
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3855 Texture *v56; // eax@67
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3856 unsigned int pY_item; // edi@68
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3857 Texture *v58; // ST1C_4@68
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3858 int v59; // eax@68
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3859 int v60; // edi@69
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3860 signed int v61; // ebx@73
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3861 Texture *v62; // eax@75
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3862 int v63; // edi@76
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3863 Texture *v64; // ST1C_4@76
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3864 unsigned int v65; // ST18_4@76
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3865 int v66; // eax@76
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3866 int v67; // edi@77
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3867 signed int v68; // ecx@81
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3868 const char *pStatusText; // ecx@91
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3869 void *v72; // eax@95
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3870 POINT *v73; // esi@97
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3871 int v74; // ecx@97
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3872 int v75; // eax@98
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3873 int v76; // ecx@98
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3874 ItemGen *selected_item; // ecx@99
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3875 unsigned __int8 v78; // bl@104
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3876 int v80; // ebx@105
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3877 char **v81; // esi@105
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3878 int v82; // eax@106
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3879 int v86; // ebx@107
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3880 int pTextHeight; // eax@109
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3881 unsigned int v90; // ecx@109
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3882 int pNumString; // edx@109
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3883 unsigned __int16 pTextColor; // ax@109
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3884 signed int v93; // edx@114
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3885 POINT *v94; // edi@120
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3886 __int32 v95; // ecx@120
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3887 void *v96; // ST14_4@122
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3888 unsigned __int8 v97; // bl@122
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3889 ItemGen *v98; // ST10_4@122
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3890 int v99; // eax@122
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3891 char *v100; // eax@122
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3892 const char *v101; // ST18_4@122
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3893 unsigned __int16 v102; // ST14_2@122
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3894 int v103; // eax@122
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3895 signed int v104; // edi@123
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3896 Texture *v105; // eax@125
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3897 int v106; // ebx@126
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3898 unsigned int v108; // ST18_4@126
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3899 int v109; // eax@126
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3900 int v110; // ebx@127
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3901 GUIWindow *v111; // [sp-18h] [bp-11Ch]@36
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3902 unsigned int v112; // [sp-14h] [bp-118h]@13
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3903 int v113; // [sp-14h] [bp-118h]@36
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3904 unsigned int v115; // [sp-10h] [bp-114h]@13
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3905 ItemGen *v116; // [sp-10h] [bp-114h]@20
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3906 int v117; // [sp-10h] [bp-114h]@36
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3907 unsigned __int16 v119; // [sp-Ch] [bp-110h]@13
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3908 char *v121; // [sp-8h] [bp-10Ch]@13
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3909 int v122; // [sp-8h] [bp-10Ch]@20
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3910 unsigned int v123; // [sp-4h] [bp-108h]@13
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3911 __int64 *v124; // [sp-4h] [bp-108h]@20
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3912 int v125; // [sp-4h] [bp-108h]@68
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3913 int v126; // [sp-4h] [bp-108h]@76
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3914 int v127; // [sp-4h] [bp-108h]@126
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3915 POINT v128; // [sp+Ch] [bp-F8h]@8
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3916 POINT v129; // [sp+14h] [bp-F0h]@18
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3917 char v130; // [sp+1Ch] [bp-E8h]@120
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3918 POINT a2; // [sp+24h] [bp-E0h]@8
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3919 POINT v132; // [sp+2Ch] [bp-D8h]@120
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3920 POINT v133; // [sp+34h] [bp-D0h]@17
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3921 POINT v134; // [sp+3Ch] [bp-C8h]@97
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3922 POINT v135; // [sp+44h] [bp-C0h]@31
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3923 POINT v136; // [sp+4Ch] [bp-B8h]@97
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3924 POINT v137; // [sp+54h] [bp-B0h]@17
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3925 POINT v138; // [sp+5Ch] [bp-A8h]@32
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3926 POINT v139; // [sp+64h] [bp-A0h]@17
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3927 POINT v140; // [sp+6Ch] [bp-98h]@31
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3928 POINT v141; // [sp+74h] [bp-90h]@8
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3929 POINT v142; // [sp+7Ch] [bp-88h]@31
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3930 POINT v143; // [sp+84h] [bp-80h]@9
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3931 GUIWindow dialog_window; // [sp+8Ch] [bp-78h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3932 int v146; // [sp+E4h] [bp-20h]@24
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3933 int pYellowColor; // [sp+E8h] [bp-1Ch]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3934 int pWhiteColor; // [sp+ECh] [bp-18h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3935 __int32 pItemCount; // [sp+F0h] [bp-14h]@8
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3936 int v152; // [sp+FCh] [bp-8h]@24
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3937 int v153; // [sp+100h] [bp-4h]@44
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3938 int th;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3939 short text_color;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3940 int pActiveButton;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3941
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3942 memcpy(&dialog_window, window_SpeakInHouse, sizeof(dialog_window));
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3943 dialog_window.uFrameX = 483;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3944 dialog_window.uFrameWidth = 148;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3945 dialog_window.uFrameZ = 334;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3946 pWhiteColor = TargetColor(0xFFu, 0xFFu, 0xFFu);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3947 pYellowColor = TargetColor(0xE1u, 0xCDu, 0x23u);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3948 switch (dialog_menu_id)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3949 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3950 case HOUSE_DIALOGUE_MAIN:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3951 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3952 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3953 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3954 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134]; //"Buy Standard"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3955 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152]; //"Buy Special"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3956 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159]; //"Display Inventory"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3957 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3958 all_text_height = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3959 for( int i = 0; i < 4; ++i )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3960 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3961 v146 = ( 174 - all_text_height ) / 4;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3962 v23 = ( 174 - 4 * ( 174 - all_text_height ) / 4 - all_text_height ) / 2 - ( 174 - all_text_height ) / 4 / 2 + 138;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3963 pNumString = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3964 if ( pDialogueWindow->pNumPresenceButton>=0 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3965 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3966 for (pActiveButton = pDialogueWindow->pStartingPosActiveItem; pActiveButton < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem; ++pActiveButton)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3967 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3968 pButton = pDialogueWindow->GetControl(pActiveButton);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3969 pButton->uY = v146 + v23;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3970 pTextHeight = pFontArrus->CalcTextHeight(pShopOptions[pNumString], &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3971 pButton->uHeight = pTextHeight;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3972 v23 = pButton->uY + pButton->uHeight - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3973 pButton->uW = v23;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3974 pTextColor = pYellowColor;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3975 if ( pDialogueWindow->pCurrentPosActiveItem != pActiveButton )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3976 pTextColor = pWhiteColor;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3977 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pTextColor, pShopOptions[pNumString], 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3978 ++pNumString;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3979 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3980 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3981 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3982 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3983 case HOUSE_DIALOGUE_SHOP_BUY_STANDARD:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3984 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3985 pRenderer->DrawTextureIndexed(8, 8, ShopTexture);// ïîäëîæêà
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3986 textureW = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3987 v153 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3988 for ( int i = 0; i < 8; ++i )// ðàçìåñòèòü âåùè
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3989 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3990 if ( pParty->StandartItemsInShops[window_SpeakInHouse->par1C][i].uItemID)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3991 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3992 textureW = ItemsInShopTexture[i]->uTextureWidth;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3993 textureH = ItemsInShopTexture[i]->uTextureHeight;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3994 if ( i >= 4 ) //low row
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3995 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3996 v60 = 90 - (textureW/2);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3997 pRenderer->DrawTextureTransparent(v60 + v153 - 420, 126, ItemsInShopTexture[i]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3998 v59 = v60 + v153 + 80220;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3999 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4000 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4001 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4002 pY_item = 98 - textureH;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4003 v152 = 86 - (textureW/2);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4004 pRenderer->DrawTextureTransparent(v152 + v153, pY_item, ItemsInShopTexture[i]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4005 v59 = v153 + v152 + 640 * pY_item;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4006 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4007 ZBuffer_DoFill(&pRenderer->pActiveZBuffer[v59], ItemsInShopTexture[i], i + 1);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4008 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4009 v153 += 105;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4010 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4011 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4012 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4013 pItemCount = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4014 for ( int i = 0; i < 8; ++i )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4015 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4016 if ( pParty->StandartItemsInShops[window_SpeakInHouse->par1C][i].uItemID )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4017 ++pItemCount;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4018 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4019 if ( GetAsyncKeyState(17) == 0 || pPlayers[uActiveCharacter]->CanSteal() == 0 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4020 pStatusText = pGlobalTXT_LocalizationStrings[195]; //"Select the Item to Buy"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4021 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4022 pStatusText = pGlobalTXT_LocalizationStrings[185];//"Steal item"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4023 DrawTextAtStatusBar(pStatusText, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4024 if ( pItemCount != 0 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4025 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4026 v73 = pMouse->GetCursorPos(&v136);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4027 v74 = pRenderer->pActiveZBuffer[v73->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v134)->y]] & 0xFFFF;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4028 if ( !v74 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4029 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4030 pItemCount = v74 - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4031 selected_item = &pParty->StandartItemsInShops[window_SpeakInHouse->par1C][v74-1];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4032 if ( GetAsyncKeyState(17) == 0 || pPlayers[uActiveCharacter]->CanSteal() == 0)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4033 v15 = (char *)pMerchantsBuyPhrases[pPlayers[uActiveCharacter]->SelectPhrasesTransaction(selected_item, BildingType_ArmorShop, window_SpeakInHouse->par1C, 2)];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4034 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4035 v15 = pGlobalTXT_LocalizationStrings[181]; //"Steal %24"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4036 v36 = BuilDialogueString(v15, uActiveCharacter - 1, selected_item, (char *)window_SpeakInHouse->ptr_1C, 2, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4037 v115 = (174 - pFontArrus->CalcTextHeight(v36, &dialog_window, 0, 0)) / 2 + 138;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4038 dialog_window.DrawTitleText(pFontArrus, 0, v115, pWhiteColor, v36, 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4039 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4040 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4041 dialog_window.DrawCurrentTime( pParty->field_3C.field_50[window_SpeakInHouse->par1C]- pParty->uTimePlayed);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4042 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4043 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4044 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4045 case HOUSE_DIALOGUE_SHOP_BUY_SPECIAL:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4046 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4047 pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4048 v11 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4049 v61 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4050 v153 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4051 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4052 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4053 if (pParty->SpecialItemsInShops[window_SpeakInHouse->par1C][v61].uItemID)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4054 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4055 v62 = ItemsInShopTexture[v61];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4056 if ( v61 >= 4 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4057 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4058 v67 = 90 - ((signed int)v62->uTextureWidth >> 1);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4059 pRenderer->DrawTextureTransparent(v153 + v67 - 420, 0x7Eu, ItemsInShopTexture[v61]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4060 v66 = v153 + v67 + 80220;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4061 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4062 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4063 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4064 v63 = 98 - v62->uTextureHeight;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4065 v64 = ItemsInShopTexture[v61];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4066 v65 = 98 - v62->uTextureHeight;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4067 v152 = 86 - ((signed int)v62->uTextureWidth >> 1);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4068 pRenderer->DrawTextureTransparent(v152 + v153, v65, v64);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4069 v66 = v152 + v153 + 640 * v63;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4070 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4071 ZBuffer_DoFill(&pRenderer->pActiveZBuffer[v66], ItemsInShopTexture[v61], v61 + 1);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4072 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4073 v153 += 105;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4074 ++v61;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4075 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4076 while ( v61 < 8 );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4077 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4078 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4079 v68 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4080 pItemCount = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4081 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4082 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4083 if (pParty->SpecialItemsInShops[window_SpeakInHouse->par1C][(signed int)v68].uItemID)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4084 ++pItemCount;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4085 ++v68;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4086 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4087 while ( v68 < 6 );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4088 if ( GetAsyncKeyState(17) == 0 || pPlayers[uActiveCharacter]->CanSteal() == 0 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4089 pStatusText = pGlobalTXT_LocalizationStrings[196]; //Select the Special Item to Buy"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4090 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4091 pStatusText = pGlobalTXT_LocalizationStrings[185];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4092 DrawTextAtStatusBar(pStatusText, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4093 if ( (char *)pItemCount != 0 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4094 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4095 v73 = pMouse->GetCursorPos(&v136);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4096 v74 = pRenderer->pActiveZBuffer[v73->x + pSRZBufferLineOffsets[pMouse->GetCursorPos((POINT *)&v134)->y]] & 0xFFFF;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4097 if ( !v74 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4098 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4099 pItemCount = v74 - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4100 if ( dialog_menu_id == 2 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4101 selected_item = &pParty->StandartItemsInShops[window_SpeakInHouse->par1C][v74 - 1];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4102 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4103 selected_item = &pParty->SpecialItemsInShops[window_SpeakInHouse->par1C][v74 - 1];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4104 if ( GetAsyncKeyState(17) == 0 || pPlayers[uActiveCharacter]->CanSteal() == 0 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4105 v15 = (char *)pMerchantsBuyPhrases[pPlayers[uActiveCharacter]->SelectPhrasesTransaction(selected_item, BildingType_ArmorShop, window_SpeakInHouse->par1C, 2)];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4106 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4107 v15 = pGlobalTXT_LocalizationStrings[181]; //"Steal %24"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4108 v36 = BuilDialogueString(v15, uActiveCharacter - 1, selected_item, (char *)window_SpeakInHouse->ptr_1C, 2, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4109 v115 = (174 - pFontArrus->CalcTextHeight(v36, &dialog_window, 0, 0)) / 2 + 138;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4110 dialog_window.DrawTitleText(pFontArrus, 0, v115, pWhiteColor, v36, 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4111 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4112 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4113 dialog_window.DrawCurrentTime( pParty->field_3C.field_50[window_SpeakInHouse->par1C]- pParty->uTimePlayed);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4114 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4115 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4116 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4117 case HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4118 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4119 draw_leather();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4120 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4121 pShopOptions[0] = pGlobalTXT_LocalizationStrings[200]; //"Sell"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4122 pShopOptions[1] = pGlobalTXT_LocalizationStrings[113]; //"Identify"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4123 pShopOptions[2] = pGlobalTXT_LocalizationStrings[179]; //"Repair"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4124 all_text_height = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4125 for ( int i = 0; i < 3; ++i )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4126 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4127 v152 = (174 - all_text_height) / 3;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4128 v86 = (3 * (58 - v152) - all_text_height) / 2 - v152 / 2 + 138;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4129 v24 = -pDialogueWindow->pNumPresenceButton < 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4130 pActiveButton = pDialogueWindow->pStartingPosActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4131 if ( v24 ^ (pDialogueWindow->pStartingPosActiveItem > pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4132 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4133 pNumString = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4134 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4135 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4136 pButton = pDialogueWindow->GetControl((unsigned int)pActiveButton);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4137 pButton->uY = v152 + v86;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4138 pTextHeight = pFontArrus->CalcTextHeight(pShopOptions[pNumString], &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4139 v90 = pButton->uY;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4140 pButton->uHeight = pTextHeight;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4141 v86 = v90 + pTextHeight - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4142 pButton->uW = v86;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4143 pTextColor = pYellowColor;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4144 if ( pDialogueWindow->pCurrentPosActiveItem != pActiveButton )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4145 pTextColor = pWhiteColor;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4146 dialog_window.DrawTitleText(pFontArrus, 0, v90, pTextColor, pShopOptions[pNumString], 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4147 ++pNumString;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4148 ++pActiveButton;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4149 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4150 while ( (signed int)pActiveButton < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4151 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4152 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4153 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4154 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4155 case HOUSE_DIALOGUE_SHOP_SELL:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4156 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4157 draw_leather();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4158 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4159 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0);//"Select the Item to Sell"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4160 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win())
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4161 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4162 if((v9 = pMouse->GetCursorPos(&v139)->x - 14, pItemCount = (v9 >> 5) + 14 * ((pMouse->GetCursorPos(&v133)->y - 17) >> 5),
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4163 pMouse->GetCursorPos(&v137)->x <= 13) || pMouse->GetCursorPos(&v129)->x >= 462
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4164 || (v10 = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&pItemCount), v11 = 0, !v10) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4165 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4166 v116 = (ItemGen *)&pPlayers[uActiveCharacter]->pInventoryItems[v10 - 1];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4167 v13 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(v116, BildingType_ArmorShop, window_SpeakInHouse->par1C, 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4168 v15 = (char *)pMerchantsSellPhrases[pPlayers[uActiveCharacter]->SelectPhrasesTransaction(v116, BildingType_ArmorShop, window_SpeakInHouse->par1C, 3)];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4169 v36 = BuilDialogueString(v15, uActiveCharacter - 1, v116, (char *) window_SpeakInHouse->par1C, 3, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4170 v115 = (174 - pFontArrus->CalcTextHeight(v36, &dialog_window, 0, 0)) / 2 + 138;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4171 dialog_window.DrawTitleText(pFontArrus, 0, v115, pWhiteColor, v36, 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4172 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4173 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4174 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4175 case HOUSE_DIALOGUE_SHOP_IDENTIFY:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4176 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4177 draw_leather();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4178 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4179 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0); //"Select the Item to Identify"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4180 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4181 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4182 v1 = pMouse->GetCursorPos(&a2)->x - 14;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4183 pItemCount = (v1 >> 5) + 14 * ((pMouse->GetCursorPos(&v128)->y - 17) >> 5);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4184 if ( pMouse->GetCursorPos(&v141)->x > 13 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4185 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4186 if ( pMouse->GetCursorPos(&v143)->x < 462 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4187 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4188 v2 = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&pItemCount);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4189 if ( v2 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4190 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4191 v3 = (ItemGen *)&pPlayers[uActiveCharacter]->pInventoryItems[v2-1];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4192 if (v3->Identified())
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4193 v5 = "%24";
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4194 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4195 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4196 v8 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(v3, BildingType_ArmorShop, (int)window_SpeakInHouse->ptr_1C, 4);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4197 v5 = (char *)pMerchantsIdentifyPhrases[v8];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4198 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4199 v6 = BuilDialogueString(v5, uActiveCharacter - 1, v3, (char *)window_SpeakInHouse->ptr_1C, 4, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4200 v115 = (174 - pFontArrus->CalcTextHeight(v6, &dialog_window, 0, 0)) / 2 + 138;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4201 dialog_window.DrawTitleText(pFontArrus, 0, v115, pWhiteColor, v6, 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4202 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4203 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4204 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4205 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4206 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4207 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4208 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4209 case HOUSE_DIALOGUE_SHOP_REPAIR:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4210 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4211 draw_leather();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4212 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4213 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[198], 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4214 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win())
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4215 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4216 if( (v31 = pMouse->GetCursorPos(&v135)->x - 14,
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4217 pItemCount = (v31 >> 5) + 14 * ((pMouse->GetCursorPos(&v142)->y - 17) >> 5),
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4218 pMouse->GetCursorPos(&v140)->x <= 13)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4219 || pMouse->GetCursorPos(&v138)->x >= 462
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4220 || (v32 = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&pItemCount), v11 = 0, !v32)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4221 || (!(pPlayers[uActiveCharacter]->pOwnItems[v32-1].uAttributes& 2)) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4222 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4223 v116 = &pPlayers[uActiveCharacter]->pInventoryItems[v33 - 1];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4224 v35 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(&pPlayers[uActiveCharacter]->pInventoryItems[v32 - 1], BildingType_ArmorShop, window_SpeakInHouse->par1C, 5);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4225 v15 = (char *)pMerchantsRepairPhrases[v35];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4226 v36 = BuilDialogueString(v15, uActiveCharacter - 1, v116, (char *)window_SpeakInHouse->ptr_1C, 5, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4227 v115 = (174 - pFontArrus->CalcTextHeight(v36, &dialog_window, 0, 0)) / 2 + 138;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4228 dialog_window.DrawTitleText(pFontArrus, 0, v115, pWhiteColor, v36, 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4229 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4230 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4231 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4232 case HOUSE_DIALOGUE_SHOP_6: //buy standart ???
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4233 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4234 pRenderer->DrawTextureIndexed(8u, 8u, ShopTexture);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4235 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[195], 0); //"Select the Item to Buy"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4236 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4237 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4238 pItemCount = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4239 for( int i = 0; i < 6 ; ++i )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4240 if (pParty->SpecialItemsInShops[window_SpeakInHouse->par1C][i].uItemID)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4241 ++pItemCount;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4242 if ( pItemCount )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4243 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4244 v94 = pMouse->GetCursorPos(&v132);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4245 pItemCount = pRenderer->pActiveZBuffer[v94->x + pSRZBufferLineOffsets[pMouse->GetCursorPos((POINT *)&v130)->y]];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4246 v95 = pItemCount;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4247 if ( pItemCount && pItemCount != -65536 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4248 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4249 --pItemCount;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4250 v97 = uActiveCharacter - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4251 v99 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(&pParty->SpecialItemsInShops[window_SpeakInHouse->par1C][v95-1], BildingType_ArmorShop, window_SpeakInHouse->par1C, 2);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4252 v100 = BuilDialogueString((char *)pMerchantsBuyPhrases[v99], uActiveCharacter - 1, v98, (char *)window_SpeakInHouse->par1C, 2, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4253 v103 = pFontArrus->CalcTextHeight(v100, &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4254 dialog_window.DrawTitleText(pFontArrus, 0, (174 - v103) / 2 + 138, pWhiteColor, v100, 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4255 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4256 v104 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4257 v153 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4258 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4259 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4260 //if ( pParty->field_C59C[9 * (v104 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4261 if (pParty->SpecialItemsInShops[window_SpeakInHouse->par1C][v104].uItemID)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4262 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4263 v105 = ItemsInShopTexture[v104];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4264 if ( v104 >= 4 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4265 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4266 v110 = 90 - ((signed int)v105->uTextureWidth >> 1);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4267 pRenderer->DrawTextureTransparent(v153 + v110 - 420, 0x7Eu, ItemsInShopTexture[v104]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4268 v127 = v104 + 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4269 v109 = v153 + v110 + 80220;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4270 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4271 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4272 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4273 v106 = 98 - v105->uTextureHeight;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4274 v108 = 98 - v105->uTextureHeight;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4275 v152 = 86 - ((signed int)v105->uTextureWidth >> 1);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4276 pRenderer->DrawTextureTransparent(v152 + v153, v108, ItemsInShopTexture[v104]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4277 v127 = v104 + 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4278 v109 = v152 + v153 + 640 * v106;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4279 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4280 ZBuffer_DoFill(&pRenderer->pActiveZBuffer[v109], ItemsInShopTexture[v104], v127);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4281 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4282 v153 += 105;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4283 ++v104;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4284 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4285 while ( v104 < 8 );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4286 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4287 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4288 dialog_window.DrawCurrentTime(pParty->field_3C.field_50[window_SpeakInHouse->par1C]- pParty->uTimePlayed);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4289 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4290 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4291 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4292 case HOUSE_DIALOGUE_LEARN_SKILLS:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4293 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4294 if (!sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4295 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4296 v152 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4297 v38 = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4298 pActiveButton = v38 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4299 if ( (signed int)pActiveButton < v38 / 3 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4300 pActiveButton = v38 / 3;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4301 v39 = pDialogueWindow->pStartingPosActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4302 v40 = pDialogueWindow->pNumPresenceButton;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4303 v153 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4304 if ( (signed int)v39 < (signed int)(v39 + v40) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4305 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4306 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4307 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4308 v41 = pDialogueWindow->GetControl(v39)->msg_param - 36;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4309 if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][v41] && !pPlayers[uActiveCharacter]->pActiveSkills[v41] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4310 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4311 v42 = pFontArrus->CalcTextHeight(pSkillNames[v41], &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4312 v152 += v42;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4313 ++v153;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4314 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4315 ++v39;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4316 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4317 while ( (signed int)v39 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4318 if ( v153 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4319 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4320 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], pActiveButton);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4321 dialog_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4322 pActiveButton = (149 - v152) / v153;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4323 if ( (149 - v152) / v153 > 32 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4324 pActiveButton = 32;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4325 v43 = (149 - v153 * (signed int)pActiveButton - v152) / 2 - (signed int)pActiveButton / 2 + 162;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4326 v152 = pDialogueWindow->pStartingPosActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4327 v146 = v43;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4328 if ( v152 < v152 + pDialogueWindow->pNumPresenceButton )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4329 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4330 v153 = 2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4331 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4332 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4333 pButton = pDialogueWindow->GetControl(v152);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4334 v46 = pButton->msg_param - 36;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4335 if ( !byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][v46] || pPlayers[uActiveCharacter]->pActiveSkills[v46] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4336 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4337 pButton->uW = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4338 pButton->uHeight = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4339 pButton->uY = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4340 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4341 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4342 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4343 pButton->uY = (unsigned int)((char *)pActiveButton + v146);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4344 pTextHeight = pFontArrus->CalcTextHeight(pSkillNames[v46], &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4345 v49 = pButton->uY;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4346 pButton->uHeight = pTextHeight;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4347 v51 = v49 + pTextHeight - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4348 pButton->uW = v51;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4349 v146 = v51;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4350 pTextColor = pYellowColor;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4351 if ( pDialogueWindow->pCurrentPosActiveItem != v153 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4352 pTextColor = pWhiteColor;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4353 dialog_window.DrawTitleText(pFontArrus, 0, v49, pTextColor, pSkillNames[v46], 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4354 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4355 v53 = pDialogueWindow->pStartingPosActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4356 ++v152;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4357 textureH = pDialogueWindow->pNumPresenceButton + v53;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4358 ++v153;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4359 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4360 while ( v152 < textureH );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4361 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4362 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4363 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4364 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4365 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayers[uActiveCharacter]->pName, pClassNames[pPlayers[uActiveCharacter]->classType]); //"Seek knowledge elsewhere %s the %s"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4366 strcat(pTmpBuf.data(), "\n \n");
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4367 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]); //"I can offer you nothing further."
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4368 v115 = (174 - pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 0, 0)) / 2 + 138;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4369 dialog_window.DrawTitleText(pFontArrus, 0, v115, pYellowColor, pTmpBuf.data(), 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4370 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4371 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4372 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4373 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4374 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4375
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4376 //----- (004B5D7C) --------------------------------------------------------
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4377 void GuildDialog()
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4378 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4379 signed int base_teach_price; // ebx@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4380 int v3; // edi@6
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4381 int result; // eax@11
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4382 int v6; // esi@13
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4383 signed int v7; // esi@17
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4384 int v8; // esi@22
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4385 signed int v9; // ecx@22
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4386 char *v10; // eax@22
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4387 const char *statusbar_string; // ecx@26
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4388 POINT *v12; // esi@30
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4389 int v13; // ecx@30
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4390 void *v14; // ST1C_4@31
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4391 ItemGen *v15; // ST18_4@31
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4392 int v16; // ST10_4@31
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4393 int v17; // eax@31
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4394 char *v18; // edx@31
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4395 int v19; // eax@32
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4396 int pActiveItem; // esi@35
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4397 int v22; // eax@35
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4398 unsigned int v23; // eax@36
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4399 int v24; // eax@39
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4400 int v25; // eax@40
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4401 int v26; // ecx@47
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4402 GUIButton *pButton; // eax@49
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4403 unsigned int v29; // eax@49
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4404 char *pText; // eax@52
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4405 int pTextHeight; // eax@55
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4406 unsigned int v32; // ecx@55
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4407 int v33; // eax@55
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4408 unsigned __int16 pTextColor; // ax@55
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4409 int v35; // eax@58
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4410 const char *v36; // ST20_4@61
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4411 unsigned __int16 v37; // ST1C_2@61
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4412 int v38; // eax@61
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4413 int v40; // [sp-14h] [bp-300h]@31
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4414 int v41; // [sp-10h] [bp-2FCh]@31
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4415 unsigned __int16 v42; // [sp-Ch] [bp-2F8h]@31
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4416 char *v43; // [sp-8h] [bp-2F4h]@31
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4417 unsigned int v44; // [sp-4h] [bp-2F0h]@31
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4418 char Dest[100]; // [sp+Ch] [bp-2E0h]@3
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4419 char v46[100]; // [sp+70h] [bp-27Ch]@3
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4420 char v47[100]; // [sp+D4h] [bp-218h]@3
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4421 char v48[100]; // [sp+138h] [bp-1B4h]@3
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4422 char v49[100]; // [sp+19Ch] [bp-150h]@3
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4423 POINT v50; // [sp+264h] [bp-88h]@30
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4424 POINT v51; // [sp+26Ch] [bp-80h]@30
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4425 GUIWindow working_window; // [sp+274h] [bp-78h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4426 signed int v53; // [sp+27Ch] [bp-70h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4427 signed int v54; // [sp+284h] [bp-68h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4428 int pColorWhite; // [sp+2CCh] [bp-20h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4429 int pColorYellow; // [sp+2D0h] [bp-1Ch]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4430 int v58; // [sp+2D4h] [bp-18h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4431 unsigned __int8 uPlayerID; // [sp+2DBh] [bp-11h]@31
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4432 bool pSkillFlag; // [sp+2DCh] [bp-10h]@35
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4433 int v61; // [sp+2E0h] [bp-Ch]@35
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4434 int pItemNum;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4435 unsigned int v62; // [sp+2E4h] [bp-8h]@13
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4436 int v63; // [sp+2E8h] [bp-4h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4437 int pNumActivItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4438 int all_text_height;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4439
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4440 memcpy(&working_window, window_SpeakInHouse, sizeof(GUIWindow));
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4441 working_window.uFrameX = 483;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4442 working_window.uFrameWidth = 148;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4443 working_window.uFrameZ = 334;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4444 pColorWhite = TargetColor(0xFFu, 0xFFu, 0xFFu);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4445 pColorYellow = TargetColor(0xFFu, 0xFFu, 0x9Bu);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4446 base_teach_price = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier * 500.0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4447 v63 = base_teach_price * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4448 if ( v63 < base_teach_price / 3 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4449 v63 = base_teach_price / 3;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4450 strcpy(Dest, "");
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4451 strcpy(v46, "");
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4452 strcpy(v47, "");
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4453 strcpy(v48, "");
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4454 strcpy(v49, "");
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4455 if ( dialog_menu_id != HOUSE_DIALOGUE_MAIN )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4456 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4457 if ( dialog_menu_id != HOUSE_DIALOGUE_GUILD_BUY_BOOKS ) //buy skill
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4458 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4459 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4460 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4461 if ( pPlayers[uActiveCharacter]->pActiveSkills[dialog_menu_id-36] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4462 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4463 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[403], pClassNames[dialog_menu_id - 16]); //"You already know the %s skill"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4464 ShowStatusBarString(pTmpBuf.data(), 2);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4465 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4466 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4467 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4468 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4469 if ( pParty->uNumGold < v63 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4470 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4471 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u); //"You don't have enough gold"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4472 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4473 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4474 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4475 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4476 Party::TakeGold(v63);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4477 pPlayers[uActiveCharacter]->pActiveSkills[dialog_menu_id-36] = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4478 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4479 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4480 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4481 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4482 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4483 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4484 pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4485 v6 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4486 v62 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4487 v63 = 32;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4488 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4489 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4490 if (pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][v6].uItemID)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4491 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4492 pRenderer->DrawTextureTransparent(v63, 0x5Au, ItemsInShopTexture[v6]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4493 ZBuffer_DoFill((int *)((char *)pRenderer->pActiveZBuffer + v62 + 230528), ItemsInShopTexture[v6], v6 + 1);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4494 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4495 v63 += 70;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4496 v62 += 280;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4497 ++v6;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4498 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4499 while ( v63 < 452 );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4500 v62 = 1680;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4501 v7 = 6;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4502 v63 = 32;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4503 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4504 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4505 if (pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][v7].uItemID)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4506 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4507 pRenderer->DrawTextureTransparent(v63, 0xFAu, ItemsInShopTexture[v7]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4508 ZBuffer_DoFill((int *)((char *)pRenderer->pActiveZBuffer + v62 + 638448), ItemsInShopTexture[v7], v7 + 1);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4509 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4510 v63 += 70;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4511 v62 += 280;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4512 ++v7;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4513 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4514 while ( v63 < 452 );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4515 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4516 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4517 v8 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4518 v9 = 12;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4519 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4520 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4521 if (pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][v9].uItemID )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4522 ++v8;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4523 --v9;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4524 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4525 while ( v9 );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4526 GetAsyncKeyState(17);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4527 statusbar_string = pGlobalTXT_LocalizationStrings[195]; //"Select the Item to Buy"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4528 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4529 statusbar_string = pGlobalTXT_LocalizationStrings[196]; //"Select the Special Item to Buy"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4530 DrawTextAtStatusBar(statusbar_string, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4531 if ( !v8 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4532 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4533 working_window.DrawCurrentTime(__PAIR__( *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)window_SpeakInHouse->ptr_1C + 44472],
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4534 *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)window_SpeakInHouse->ptr_1C + 44468]) - pParty->uTimePlayed);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4535 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4536 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4537 v12 = pMouse->GetCursorPos(&v51);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4538 result = v12->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v50)->y];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4539 v13 = pRenderer->pActiveZBuffer[result] & 0xFFFF;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4540 if ( pRenderer->pActiveZBuffer[result] & 0xFFFF )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4541 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4542 v14 = window_SpeakInHouse->ptr_1C;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4543 v15 = (ItemGen *)(&pParty->pPlayers[1].uExpressionTimeLength + 18 * (v13 + 12 * (int)v14));
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4544 v16 = (int)window_SpeakInHouse->ptr_1C;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4545 uPlayerID = uActiveCharacter - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4546 v17 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction( (ItemGen *)&pParty->pPlayers[1].uExpressionTimeLength + v13 + 12 * (int)v14, BildingType_MagicShop, v16, 2);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4547 v18 = BuilDialogueString((char *)pMerchantsBuyPhrases[v17], uPlayerID, v15, (char *)v14, 2, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4548 v19 = pFontArrus->CalcTextHeight(v18, &working_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4549 working_window.DrawTitleText(pFontArrus, 0, (174 - v19) / 2 + 138, pColorWhite, v18, 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4550 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4551 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4552 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4553 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4554 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4555 if ( !(unsigned __int16)_449B57_test_bit((unsigned __int8 *)pPlayers[uActiveCharacter]->_guilds_member_bits,
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4556 guild_mambership_flags[(unsigned int)window_SpeakInHouse->ptr_1C-139]) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4557 { //you must me member
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4558 v38 = pFontArrus->CalcTextHeight(pNPCTopics[121].pText, &working_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4559 working_window.DrawTitleText(pFontArrus, 0, (212 - v38) / 2 + 101, pColorYellow, pNPCTopics[121].pText, 3u);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4560 pDialogueWindow->pNumPresenceButton = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4561 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4562 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4563 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4564 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4565 v61 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4566 pSkillFlag = false;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4567 pActiveItem = pDialogueWindow->pStartingPosActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4568 v22 = pActiveItem + pDialogueWindow->pNumPresenceButton;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4569 pItemNum = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4570 if ( pDialogueWindow->pStartingPosActiveItem >= pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4571 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4572 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayers[uActiveCharacter]->pName, pClassNames[pPlayers[uActiveCharacter]->classType]); // "Seek knowledge elsewhere %s the %s"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4573 strcat(pTmpBuf.data(), "\n \n");
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4574 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]); //"I can offer you nothing further."
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4575 v19 = pFontArrus->CalcTextHeight(pTmpBuf.data(), &working_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4576 working_window.DrawTitleText(pFontArrus, 0, (174 - v19) / 2 + 138, pColorYellow, pTmpBuf.data(), 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4577 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4578 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4579 all_text_height = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4580 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4581 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4582 v23 = pDialogueWindow->GetControl(pActiveItem)->msg_param;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4583 if ( v23 == 18 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4584 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4585 all_text_height += pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[400], &working_window, 0, 0); //"Buy Spells"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4586 v61++;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4587 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4588 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4589 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4590 if( byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][v23 - 36]
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4591 && !pPlayers[uActiveCharacter]->pActiveSkills[v23 - 36] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4592 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4593 all_text_height += pFontArrus->CalcTextHeight(pSkillNames[v23 - 36], &working_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4594 v61++;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4595 pSkillFlag = true;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4596 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4597 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4598 ++pActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4599 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4600 while ( pActiveItem < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4601 if ( !v61 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4602 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4603 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayers[uActiveCharacter]->pName, pClassNames[pPlayers[uActiveCharacter]->classType]); // "Seek knowledge elsewhere %s the %s"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4604 strcat(pTmpBuf.data(), "\n \n");
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4605 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]); //"I can offer you nothing further."
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4606 v19 = pFontArrus->CalcTextHeight(pTmpBuf.data(), &working_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4607 working_window.DrawTitleText(pFontArrus, 0, (174 - v19) / 2 + 138, pColorYellow, pTmpBuf.data(), 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4608 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4609 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4610 if ( pSkillFlag )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4611 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4612 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], v63); //"Skill Cost: %lu"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4613 working_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4614 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4615 v58 = (149 - all_text_height) / v61;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4616 if ( v58 > 32 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4617 v58 = 32;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4618 v26 = (149 - v61 * v58 - all_text_height) / 2 - v58 / 2 + 162;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4619 pNumActivItem = pDialogueWindow->pStartingPosActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4620 if (pDialogueWindow->pStartingPosActiveItem < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4621 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4622 pItemNum = 2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4623 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4624 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4625 pButton = pDialogueWindow->GetControl(pItemNum);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4626 v29 = pButton->msg_param;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4627 if ( v29 == 18 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4628 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4629 pText = pGlobalTXT_LocalizationStrings[400]; //"Buy Spells"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4630 pButton->uY = v58 + v26;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4631 pTextHeight = pFontArrus->CalcTextHeight(pText, &working_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4632 v32 = pButton->uY;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4633 pButton->uHeight = pTextHeight;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4634 v33 = v32 + pTextHeight - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4635 pButton->uW = v33;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4636 v26 = v33;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4637 pTextColor = pColorYellow;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4638 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4639 pTextColor = pColorWhite;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4640 working_window.DrawTitleText(pFontArrus, 0, v32, pTextColor, pText, 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4641 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4642 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4643 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4644 if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][v29 - 36]
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4645 && !pPlayers[uActiveCharacter]->pActiveSkills[v29 - 36] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4646 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4647 pButton->uY = v58 + v26;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4648 pTextHeight = pFontArrus->CalcTextHeight(pSkillNames[v29 - 36], &working_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4649 v32 = pButton->uY;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4650 pButton->uHeight = pTextHeight;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4651 v33 = v32 + pTextHeight - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4652 pButton->uW = v33;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4653 v26 = v33;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4654 pTextColor = pColorYellow;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4655 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4656 pTextColor = pColorWhite;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4657 working_window.DrawTitleText(pFontArrus, 0, v32, pTextColor, pSkillNames[v29 - 36], 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4658 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4659 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4660 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4661 pButton->uW = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4662 pButton->uHeight = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4663 pButton->uY = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4664 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4665 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4666 ++pItemNum;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4667 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4668 while ( pItemNum < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4669 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4670 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4671 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4672
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4673 //----- (004B705E) --------------------------------------------------------
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4674 void TempleDialog()
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4675 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4676 GUIWindow *v0; // ebx@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4677 Player *v1; // esi@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4678 int v2; // edi@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4679 int result; // eax@4
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4680 GUIWindow *v4; // edi@6
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4681 void *v5; // eax@6
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4682 int v6; // eax@6
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4683 unsigned int v7; // eax@8
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4684 int v8; // ecx@8
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4685 unsigned int v9; // eax@9
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4686 int v10; // eax@11
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4687 int v11; // eax@12
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4688 GUIWindow *v12; // ecx@16
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4689 int v13; // edx@16
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4690 GUIButton *v14; // eax@19
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4691 GUIButton *v15; // edi@19
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4692 int v16; // eax@19
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4693 const char *v17; // eax@21
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4694 int v18; // eax@21
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4695 unsigned int v19; // ecx@21
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4696 int v20; // eax@21
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4697 unsigned __int16 v21; // ax@21
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4698 unsigned __int16 v22; // ST14_2@27
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4699 int v23; // eax@27
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4700 double v24; // st7@28
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4701 unsigned int v25; // ebx@28
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4702 DDM_DLV_Header *v26; // edi@29
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4703 int v27; // eax@31
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4704 int v28; // eax@32
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4705 //unsigned int v29; // ecx@34
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4706 unsigned int v30; // edx@36
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4707 unsigned int v31; // edx@38
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4708 unsigned int v32; // edx@40
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4709 unsigned int v33; // edx@42
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4710 unsigned int v34; // edx@44
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4711 int v35; // edi@50
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4712 signed int v36; // eax@50
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4713 unsigned __int8 v37; // al@54
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4714 int v38; // ecx@54
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4715 GUIWindow *v39; // eax@56
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4716 unsigned __int8 v40; // al@61
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4717 GUIButton *v41; // edi@64
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4718 int v42; // esi@66
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4719 GUIWindow *v43; // ecx@66
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4720 int v44; // edi@66
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4721 int v45; // eax@68
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4722 signed int v46; // edi@69
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4723 int v47; // edi@71
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4724 GUIButton *v48; // eax@73
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4725 const char *v49; // edx@73
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4726 GUIButton *v50; // esi@73
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4727 int v51; // eax@73
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4728 unsigned int v52; // ecx@73
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4729 unsigned __int16 v53; // ax@73
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4730 char a1[300]; // [sp+10h] [bp-1B4h]@64
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4731 GUIWindow v57; // [sp+13Ch] [bp-88h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4732 __int64 v58; // [sp+190h] [bp-34h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4733 __int64 v59; // [sp+198h] [bp-2Ch]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4734 __int64 v60; // [sp+1A0h] [bp-24h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4735 GUIWindow *v61; // [sp+1ACh] [bp-18h]@6
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4736 unsigned int v62; // [sp+1B0h] [bp-14h]@8
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4737 unsigned __int8 v63; // [sp+1B7h] [bp-Dh]@64
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4738 int v64; // [sp+1B8h] [bp-Ch]@6
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4739 unsigned int v65; // [sp+1BCh] [bp-8h]@6
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4740 DDM_DLV_Header *v66; // [sp+1C0h] [bp-4h]@6
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4741
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4742 v0 = window_SpeakInHouse;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4743 memcpy(&v57, window_SpeakInHouse, sizeof(v57));
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4744 v57.uFrameX = 483;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4745 v57.uFrameWidth = 148;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4746 v57.uFrameZ = 334;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4747 HIDWORD(v58) = TargetColor(0xFFu, 0xFFu, 0xFFu);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4748 HIDWORD(v59) = TargetColor(0xFFu, 0xFFu, 0x9Bu);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4749 v1 = pPlayers[uActiveCharacter];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4750 //v2 = pPlayers[uActiveCharacter]->_4B807C(p2DEvents_minus1__20[13 * (unsigned int)v0->ptr_1C]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4751 v2 = pPlayers[uActiveCharacter]->GetTempleHealCostModifier(p2DEvents[v0->par1C - 1].fPriceMultiplier);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4752 HIDWORD(v60) = v2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4753 if ( dialog_menu_id != HOUSE_DIALOGUE_MAIN )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4754 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4755 if ( dialog_menu_id != HOUSE_DIALOGUE_TEMPLE_HEAL )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4756 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4757 if ( dialog_menu_id != HOUSE_DIALOGUE_TEMPLE_DONATE )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4758 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4759 if ( dialog_menu_id == HOUSE_DIALOGUE_LEARN_SKILLS )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4760 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4761 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4762 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4763 v4 = pDialogueWindow;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4764 v61 = pDialogueWindow;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4765 v5 = window_SpeakInHouse->ptr_1C;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4766 v66 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4767 //v65 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (signed int)v5] * 500.0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4768 v65 = (signed __int64)(p2DEvents[(signed int)v5 - 1].flt_24 * 500.0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4769 v6 = v1->GetMerchant();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4770 v64 = (signed int)(v65 * (100 - v6)) / 100;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4771 if ( v64 < (signed int)v65 / 3 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4772 v64 = (signed int)v65 / 3;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4773 v7 = v4->pStartingPosActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4774 v8 = v7 + v4->pNumPresenceButton;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4775 v65 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4776 v62 = v7;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4777 if ( (signed int)v7 >= v8 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4778 goto LABEL_78;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4779 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4780 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4781 v9 = v4->GetControl(v62)->msg_param - 36;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4782 if ( byte_4ED970_skill_learn_ability_by_class_table[v1->classType][v9] && !v1->pActiveSkills[v9] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4783 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4784 v10 = pFontArrus->CalcTextHeight(pSkillNames[v9], &v57, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4785 v66 = (DDM_DLV_Header *)((char *)v66 + v10);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4786 ++v65;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4787 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4788 v11 = v4->pStartingPosActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4789 ++v62;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4790 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4791 while ( (signed int)v62 < v4->pNumPresenceButton + v11 );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4792 if ( v65 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4793 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4794 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], v64);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4795 v57.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3u);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4796 v64 = (149 - (signed int)v66) / (signed int)v65;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4797 if ( v64 > 32 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4798 v64 = 32;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4799 v65 = (signed int)(149 - v65 * v64 - (int)v66) / 2 - v64 / 2 + 162;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4800 v12 = v61;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4801 result = v61->pStartingPosActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4802 v13 = result + v61->pNumPresenceButton;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4803 v62 = v61->pStartingPosActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4804 if ( result < v13 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4805 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4806 v66 = (DDM_DLV_Header *)2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4807 while ( 1 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4808 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4809 v14 = v12->GetControl(v62);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4810 v15 = v14;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4811 v16 = v14->msg_param - 36;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4812 if ( !byte_4ED970_skill_learn_ability_by_class_table[v1->classType][v16] || v1->pActiveSkills[v16] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4813 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4814 v15->uW = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4815 v15->uHeight = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4816 v15->uY = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4817 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4818 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4819 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4820 v17 = pSkillNames[v16];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4821 v15->uY = v64 + v65;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4822 HIDWORD(v60) = (uint32)v17;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4823 v18 = pFontArrus->CalcTextHeight(v17, &v57, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4824 v19 = v15->uY;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4825 v15->uHeight = v18;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4826 v20 = v19 + v18 - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4827 v15->uW = v20;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4828 v65 = v20;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4829 v21 = WORD2(v59);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4830 if ( (DDM_DLV_Header *)pDialogueWindow->pCurrentPosActiveItem != v66 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4831 v21 = WORD2(v58);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4832 v57.DrawTitleText(pFontArrus, 0, v19, v21, (const char *)HIDWORD(v60), 3u);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4833 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4834 result = (int)v61;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4835 ++v62;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4836 v66 = (DDM_DLV_Header *)((char *)v66 + 1);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4837 if ( (signed int)v62 >= v61->pNumPresenceButton + v61->pStartingPosActiveItem )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4838 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4839 v12 = v61;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4840 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4841 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4842 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4843 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4844 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4845 LABEL_78:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4846 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], v1->pName, pClassNames[v1->classType]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4847 strcat(pTmpBuf.data(), "\n \n");
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4848 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4849 v22 = WORD2(v59);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4850 v23 = pFontArrus->CalcTextHeight(pTmpBuf.data(), &v57, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4851 v57.DrawTitleText(pFontArrus, 0, (174 - v23) / 2 + 138, v22, pTmpBuf.data(), 3u);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4852 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4853 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4854 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4855 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4856 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4857 // DONATION
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4858 //v24 = p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4859 v24 = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4860 v25 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4861 if ( pParty->uNumGold >= (unsigned int)(signed __int64)v24 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4862 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4863 Party::TakeGold((signed __int64)v24);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4864 v26 = &pOutdoor->ddm;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4865 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4866 v26 = &pIndoor->dlv;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4867 v27 = v26->uReputation;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4868 v66 = v26;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4869 if ( v27 > -5 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4870 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4871 v28 = v27 - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4872 v26->uReputation = v28;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4873 if ( v28 < -5 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4874 v26->uReputation = -5;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4875 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4876 if ( (unsigned __int8)byte_F8B1EF[uActiveCharacter] == pParty->uDaysPlayed % 7 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4877 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4878 if ( v26->uReputation <= -5 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4879 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4880 v30 = pParty->uDaysPlayed % 7 + 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4881 LOBYTE(v30) = v30 | 0x80;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4882 _42777D_CastSpell_UseWand_ShootArrow(SPELL_AIR_WIZARD_EYE, uActiveCharacter - 1, v30, 48, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4883 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4884 if ( v26->uReputation <= -10 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4885 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4886 v31 = pParty->uDaysPlayed % 7 + 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4887 LOBYTE(v31) = v31 | 0x80;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4888 _42777D_CastSpell_UseWand_ShootArrow(SPELL_SPIRIT_PRESERVATION, uActiveCharacter - 1, v31, 48, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4889 v26 = v66;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4890 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4891 if ( v26->uReputation <= -15 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4892 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4893 v32 = pParty->uDaysPlayed % 7 + 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4894 LOBYTE(v32) = v32 | 0x80;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4895 _42777D_CastSpell_UseWand_ShootArrow(SPELL_BODY_PROTECTION_FROM_MAGIC, uActiveCharacter - 1, v32, 48, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4896 v26 = v66;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4897 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4898 if ( v26->uReputation <= -20 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4899 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4900 v33 = pParty->uDaysPlayed % 7 + 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4901 LOBYTE(v33) = v33 | 0x80;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4902 _42777D_CastSpell_UseWand_ShootArrow(SPELL_LIGHT_HOUR_OF_POWER, uActiveCharacter - 1, v33, 48, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4903 v26 = v66;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4904 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4905 if ( v26->uReputation <= -25 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4906 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4907 v34 = pParty->uDaysPlayed % 7 + 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4908 LOBYTE(v34) = v34 | 0x80;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4909 _42777D_CastSpell_UseWand_ShootArrow(SPELL_LIGHT_DAY_OF_PROTECTION, uActiveCharacter - 1, v34, 48, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4910 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4911 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4912 ++byte_F8B1EF[uActiveCharacter];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4913 v1->PlaySound(SPEECH_83, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4914 ShowStatusBarString(pGlobalTXT_LocalizationStrings[527], 2u); // "Thank You!"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4915 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, v25);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4916 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4917 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4918 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4919 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4920 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, v25);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4921 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4922 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4923 if ( !v1->IsPlayerHealableByTemple() )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4924 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4925 v25 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4926 if ( pParty->uNumGold < v2 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4927 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4928 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4929 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4930 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, v25);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4931 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4932 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4933 Party::TakeGold(v2);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4934 v35 = LODWORD(v1->pConditions[17]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4935 v59 = v1->pConditions[14];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4936 v58 = v1->pConditions[15];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4937 v60 = v1->pConditions[16];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4938 v61 = (GUIWindow *)HIDWORD(v1->pConditions[17]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4939 memset(v1, 0, 0xA0u);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4940 v1->sHealth = v1->GetMaxHealth();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4941 v1->sMana = v1->GetMaxMana();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4942 v36 = (signed int)window_SpeakInHouse->ptr_1C;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4943 if ( v36 != 78 && (v36 <= 80 || v36 > 82) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4944 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4945 if ( (unsigned int)v61 | v35 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4946 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4947 v37 = LOBYTE(v1->uPrevFace);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4948 v38 = v1->uPrevVoiceID;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4949 v1->uCurrentFace = v37;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4950 v1->uVoiceID = v38;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4951 ReloadPlayerPortraits(uActiveCharacter - 1, (char)v37);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4952 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4953 pAudioPlayer->PlaySound((SoundID)(SOUND_GoldReceived|0x2), -1, 0, -1, 0, 0, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4954 v1->PlaySound(SPEECH_82, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4955 pOtherOverlayList->_4418B1(20, uActiveCharacter + 99, 0, 65536);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4956 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, v25);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4957 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4958 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4959 v39 = v61;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4960 if ( (unsigned int)v61 | v35 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4961 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4962 LODWORD(v1->pConditions[17]) = v35;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4963 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4964 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4965 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4966 if ( !v60 && !v58 && !v59 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4967 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4968 pAudioPlayer->PlaySound((SoundID)(SOUND_GoldReceived|0x2), -1, 0, -1, 0, 0, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4969 v1->PlaySound(SPEECH_82, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4970 pOtherOverlayList->_4418B1(20, uActiveCharacter + 99, 0, 65536);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4971 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, v25);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4972 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4973 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4974 v1->uPrevFace = v1->uCurrentFace;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4975 v1->uPrevVoiceID = v1->uVoiceID;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4976 v1->SetCondition(0x11u, 1);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4977 v1->uVoiceID = (v1->GetSexByVoice() != 0) + 23;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4978 v40 = (v1->GetSexByVoice() != 0) + 23;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4979 v1->uCurrentFace = v40;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4980 ReloadPlayerPortraits(uActiveCharacter - 1, (char)v40);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4981 LODWORD(v1->pConditions[17]) = LODWORD(pParty->uTimePlayed);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4982 v39 = (GUIWindow *)HIDWORD(pParty->uTimePlayed);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4983 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4984 HIDWORD(v1->pConditions[17]) = (int)v39;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4985 pAudioPlayer->PlaySound((SoundID)(SOUND_GoldReceived|0x2), -1, 0, -1, 0, 0, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4986 v1->PlaySound(SPEECH_82, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4987 pOtherOverlayList->_4418B1(20, uActiveCharacter + 99, 0, 65536);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4988 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, v25);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4989 return; // void func
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4990 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4991 v63 = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4992 v41 = pDialogueWindow->GetControl(pDialogueWindow->pStartingPosActiveItem);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4993 strcpy(a1, "");
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4994 v41->uHeight = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4995 v41->uY = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4996 if ( v1->IsPlayerHealableByTemple() )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4997 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4998 sprintf(a1, "%s %d %s", pGlobalTXT_LocalizationStrings[104], HIDWORD(v60), pGlobalTXT_LocalizationStrings[97]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
4999 v63 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5000 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5001 strcpy(&a1[100], pGlobalTXT_LocalizationStrings[68]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5002 strcpy(&a1[200], pGlobalTXT_LocalizationStrings[160]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5003 v42 = v63;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5004 v43 = pDialogueWindow;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5005 v44 = v63;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5006 v66 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5007 if ( v63 < pDialogueWindow->pNumPresenceButton )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5008 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5009 v61 = (GUIWindow *)&a1[100 * v63];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5010 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5011 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5012 v45 = pFontArrus->CalcTextHeight((const char *)v61, &v57, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5013 v66 = (DDM_DLV_Header *)((char *)v66 + v45);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5014 v43 = pDialogueWindow;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5015 v61 = (GUIWindow *)((char *)v61 + 100);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5016 ++v44;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5017 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5018 while ( v44 < pDialogueWindow->pNumPresenceButton );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5019 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5020 v46 = v43->pNumPresenceButton - v42;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5021 v64 = (174 - (signed int)v66) / v46;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5022 if ( v64 > 32 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5023 v64 = 32;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5024 v47 = (174 - v64 * v46 - (signed int)v66) / 2 - v64 / 2 + 138;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5025 v65 = v42 + v43->pStartingPosActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5026 if ( v42 + v43->pStartingPosActiveItem < v43->pStartingPosActiveItem + v43->pNumPresenceButton )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5027 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5028 v61 = (GUIWindow *)(v42 + 2);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5029 v66 = (DDM_DLV_Header *)&a1[100 * v42];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5030 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5031 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5032 v48 = v43->GetControl(v65);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5033 v49 = (const char *)v66;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5034 v50 = v48;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5035 v48->uY = v64 + v47;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5036 v51 = pFontArrus->CalcTextHeight(v49, &v57, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5037 v52 = v50->uY;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5038 v50->uHeight = v51;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5039 v47 = v52 + v51 - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5040 v50->uW = v47;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5041 v53 = WORD2(v59);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5042 if ( (GUIWindow *)pDialogueWindow->pCurrentPosActiveItem != v61 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5043 v53 = WORD2(v58);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5044 v57.DrawTitleText(pFontArrus, 0, v52, v53, (const char *)v66, 3u);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5045 v43 = pDialogueWindow;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5046 v66 = (DDM_DLV_Header *)((char *)v66 + 100);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5047 v61 = (GUIWindow *)((char *)v61 + 1);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5048 ++v65;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5049 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5050 while ( (signed int)v65 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5051 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5052 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5053 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5054
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5055 //----- (004B4710) --------------------------------------------------------
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5056 void TrainingDialog()
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5057 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5058 //Player *v0; // ebx@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5059 int color2; // eax@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5060 //unsigned int v2; // ecx@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5061 //int v3; // eax@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5062 //signed int v4; // edx@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5063 unsigned __int64 v5; // edi@3
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5064 //unsigned int v6; // esi@3
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5065 //void *v7; // ecx@3
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5066 int v8; // edx@4
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5067 double v9; // st7@6
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5068 signed int v10; // esi@6
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5069 int v11; // ecx@6
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5070 //int result; // eax@9
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5071 GUIWindow *v13; // edi@14
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5072 signed int v14; // esi@14
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5073 unsigned int v15; // esi@16
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5074 int v16; // eax@16
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5075 unsigned int v17; // eax@17
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5076 int v18; // eax@19
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5077 int v19; // ecx@24
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5078 GUIButton *v20; // eax@26
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5079 GUIButton *v21; // esi@26
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5080 int v22; // eax@26
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5081 const char *v23; // eax@28
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5082 int v24; // eax@28
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5083 unsigned int v25; // ecx@28
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5084 int v26; // eax@28
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5085 unsigned __int16 v27; // ax@28
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5086 //int v28; // eax@32
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5087 unsigned __int16 v29; // ST14_2@34
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5088 int v30; // eax@34
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5089 //const char *v31; // ST18_4@36
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5090 //unsigned __int16 v32; // ST14_2@36
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5091 int v33; // eax@36
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5092 int v34; // eax@37
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5093 unsigned int v35; // edi@38
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5094 unsigned int v36; // eax@38
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5095 //int v37; // ecx@41
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5096 //char *v38; // eax@41
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5097 //int *v39; // eax@45
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5098 unsigned int v40; // eax@46
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5099 //void *v41; // ecx@46
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5100 unsigned int v42; // eax@46
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5101 GUIWindow *v43; // ecx@59
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5102 int v44; // edx@59
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5103 char **v45; // esi@60
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5104 //int v46; // eax@62
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5105 int v47; // eax@68
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5106 //int v48; // edx@69
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5107 int v49; // ebx@69
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5108 //unsigned __int8 v50; // sf@69
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5109 char **v51; // edi@70
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5110 GUIButton *v52; // eax@71
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5111 GUIButton *v53; // esi@71
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5112 int v54; // eax@71
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5113 unsigned int v55; // ecx@71
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5114 int v56; // eax@71
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5115 unsigned __int16 v57; // ax@71
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5116 unsigned __int16 v58; // [sp-Ch] [bp-90h]@38
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5117 //const char *v59; // [sp-Ch] [bp-90h]@63
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5118 char *v60; // [sp-8h] [bp-8Ch]@38
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5119 //char *v61; // [sp-8h] [bp-8Ch]@63
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5120 unsigned int v62; // [sp-4h] [bp-88h]@38
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5121 int v63; // [sp-4h] [bp-88h]@52
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5122 //char *v64; // [sp-4h] [bp-88h]@63
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5123 GUIWindow v65; // [sp+Ch] [bp-78h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5124 //__int64 v66; // [sp+60h] [bp-24h]@3
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5125 unsigned int white; // [sp+68h] [bp-1Ch]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5126 int v68; // [sp+6Ch] [bp-18h]@3
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5127 int v69; // [sp+70h] [bp-14h]@6
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5128 //unsigned int i; // [sp+74h] [bp-10h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5129 //int v71; // [sp+78h] [bp-Ch]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5130 int v72; // [sp+7Ch] [bp-8h]@16
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5131 int v73; // [sp+80h] [bp-4h]@14
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5132
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5133 //v0 = pPlayers[uActiveCharacter];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5134 memcpy(&v65, window_SpeakInHouse, sizeof(v65));
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5135 v65.uFrameX = 483;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5136 v65.uFrameWidth = 148;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5137 v65.uFrameZ = 334;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5138 white = TargetColor(255, 255, 255);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5139 color2 = TargetColor(0xE1u, 0xCDu, 0x23u);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5140 //v71 = color2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5141 //v2 = v0->uLevel;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5142 //v3 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5143 //v4 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5144 //for ( i = v2; v4 < (signed int)v2; ++v4 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5145 // v3 += v4 + 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5146 //v5 = 1000 * v3;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5147 v5 = 1000ui64 * pPlayers[uActiveCharacter]->uLevel * (pPlayers[uActiveCharacter]->uLevel + 1) / 2; // E n = n(n + 1) / 2
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5148 //v6 = HIDWORD(v0->uExperience);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5149 //v7 = window_SpeakInHouse->ptr_1C;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5150 v68 = pMaxLevelPerTrainingHallType[(unsigned int)window_SpeakInHouse->ptr_1C - HOUSE_TRAINING_HALL_EMERALD_ISLE];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5151 //v66 = 1000 * v3;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5152 if (pPlayers[uActiveCharacter]->uExperience >= v5)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5153 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5154 v8 = pPlayers[uActiveCharacter]->classType % 4 + 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5155 if ( v8 == 4 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5156 v8 = 3;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5157 v9 = (double)pPlayers[uActiveCharacter]->uLevel;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5158 //i = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5159 v69 = v8;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5160 //v10 = (signed __int64)(v9 * p2DEvents_minus1__20[13 * (signed int)v7] * (double)v8);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5161 v10 = (signed __int64)(v9 * p2DEvents[(signed int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier * (double)v8);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5162 v11 = v10 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5163 if ( v11 < v10 / 3 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5164 v11 = v10 / 3;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5165 //i = v11;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5166 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5167
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5168 if (sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win())
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5169 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5170 if ( dialog_menu_id != HOUSE_DIALOGUE_MAIN )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5171 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5172 if ( dialog_menu_id != HOUSE_DIALOGUE_TRAININGHALL_TRAIN )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5173 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5174 if ( dialog_menu_id == HOUSE_DIALOGUE_LEARN_SKILLS )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5175 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5176 if (sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win())
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5177 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5178 //i = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5179 int _v0 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5180 v13 = pDialogueWindow;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5181 //v14 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)ptr_507BC0->ptr_1C] * 500.0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5182 v14 = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5183 v73 = v14 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5184 if ( v73 < v14 / 3 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5185 v73 = v14 / 3;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5186 v15 = v13->pStartingPosActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5187 v16 = v13->pNumPresenceButton;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5188 v72 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5189 if ( (signed int)v15 >= (signed int)(v15 + v16) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5190 goto LABEL_76;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5191 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5192 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5193 v17 = v13->GetControl(v15)->msg_param - 36;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5194 if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][v17] && !pPlayers[uActiveCharacter]->pActiveSkills[v17] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5195 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5196 v18 = pFontArrus->CalcTextHeight(pSkillNames[v17], &v65, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5197 _v0 += v18;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5198 ++v72;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5199 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5200 ++v15;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5201 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5202 while ( (signed int)v15 < v13->pNumPresenceButton + v13->pStartingPosActiveItem );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5203 if ( v72 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5204 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5205 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], v73);// "Skill Cost: %lu"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5206 v65.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3u);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5207 v73 = (signed int)(149 - _v0) / v72;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5208 if ( v73 > 32 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5209 v73 = 32;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5210 //result = v13->pStartingPosActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5211 v19 = (signed int)(149 - v72 * v73 - _v0) / 2 - v73 / 2 + 162;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5212 int _v1 = v13->pStartingPosActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5213 v68 = v19;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5214 if (v13->pStartingPosActiveItem < v13->pStartingPosActiveItem + v13->pNumPresenceButton )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5215 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5216 v72 = 2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5217 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5218 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5219 v20 = v13->GetControl(_v1);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5220 v21 = v20;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5221 v22 = v20->msg_param - 36;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5222 if ( !byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][v22] || pPlayers[uActiveCharacter]->pActiveSkills[v22] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5223 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5224 v21->uW = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5225 v21->uHeight = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5226 v21->uY = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5227 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5228 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5229 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5230 v23 = pSkillNames[v22];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5231 v21->uY = v73 + v68;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5232 //HIDWORD(v66) = (int)v23;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5233 v24 = pFontArrus->CalcTextHeight(v23, &v65, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5234 v25 = v21->uY;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5235 v21->uHeight = v24;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5236 v26 = v25 + v24 - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5237 v21->uW = v26;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5238 v68 = v26;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5239 v27 = color2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5240 if ( pDialogueWindow->pCurrentPosActiveItem != v72 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5241 v27 = white;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5242 v65.DrawTitleText(pFontArrus, 0, v25, v27, v23, 3u);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5243 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5244 ++_v1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5245 ++v72;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5246 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5247 while ( (signed int)_v1 < v13->pStartingPosActiveItem + v13->pNumPresenceButton );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5248 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5249 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5250 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5251 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5252 LABEL_76:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5253 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayers[uActiveCharacter]->pName, pClassNames[pPlayers[uActiveCharacter]->classType]);//
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5254 // "Seek knowledge elsewhere %s the %s"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5255 strcat(pTmpBuf.data(), "\n \n");
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5256 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);// "I can offer you nothing further."
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5257 v29 = color2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5258 v30 = pFontArrus->CalcTextHeight(pTmpBuf.data(), &v65, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5259 v65.DrawTitleText(pFontArrus, 0, (174 - v30) / 2 + 138, v29, pTmpBuf.data(), 3u);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5260 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5261 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5262 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5263 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5264 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5265 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5266 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5267 //v31 = pNPCTopics[122].pText;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5268 //v32 = color2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5269 v33 = pFontArrus->CalcTextHeight(pNPCTopics[122].pText, &v65, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5270 v65.DrawTitleText(pFontArrus, 0, (212 - v33) / 2 + 101, color2, pNPCTopics[122].pText, 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5271 pDialogueWindow->pNumPresenceButton = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5272 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5273 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5274 v34 = pPlayers[uActiveCharacter]->uLevel;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5275 if ( v34 < v68 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5276 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5277 if ( (signed __int64)pPlayers[uActiveCharacter]->uExperience >= v5 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5278 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5279 if ( pParty->uNumGold >= v11)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5280 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5281 Party::TakeGold(v11);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5282 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5283 ++pPlayers[uActiveCharacter]->uLevel;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5284 pPlayers[uActiveCharacter]->uSkillPoints += pPlayers[uActiveCharacter]->uLevel / 10 + 5;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5285 pPlayers[uActiveCharacter]->sHealth = pPlayers[uActiveCharacter]->GetMaxHealth();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5286 pPlayers[uActiveCharacter]->sMana = pPlayers[uActiveCharacter]->GetMaxMana();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5287
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5288 uint max_level_in_party = player_levels[0];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5289 for (uint _it = 1; _it < 4; ++_it)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5290 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5291 if (player_levels[_it] > max_level_in_party)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5292 max_level_in_party = player_levels[_it];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5293 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5294
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5295 ++player_levels[uActiveCharacter - 1];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5296 if (player_levels[uActiveCharacter - 1] > max_level_in_party) // if we reach new maximum party level
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5297 // feature is broken thou, since this array is always zeroed in EnterHouse
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5298 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5299 v40 = _494820_training_time(pParty->uCurrentHour);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5300 //v41 = window_SpeakInHouse->ptr_1C;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5301 v42 = 60 * (v40 + 4) - pParty->uCurrentMinute;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5302 if ((unsigned int)window_SpeakInHouse->ptr_1C == HOUSE_TRAINING_HALL_94 ||
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5303 (unsigned int)window_SpeakInHouse->ptr_1C == HOUSE_TRAINING_HALL_95)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5304 v42 += 720;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5305 RestAndHeal((signed int)(v42 + 10080));
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5306 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5307 pOutdoor->SetFog();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5308 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5309 pPlayers[uActiveCharacter]->PlaySound(SPEECH_87, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5310 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[430], pPlayers[uActiveCharacter]->pName, pPlayers[uActiveCharacter]->uLevel, pPlayers[uActiveCharacter]->uLevel / 10 + 5);//
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5311 // "%s is now Level %lu and has earned %lu Skill Points!"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5312 ShowStatusBarString(pTmpBuf.data(), 2);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5313 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5314 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5315 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5316 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2);// "You don't have enough gold"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5317 v63 = 4;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5318 LABEL_55:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5319 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, (HouseSoundID)v63);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5320 //LABEL_56:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5321 /*result = pMessageQueue_50CBD0->uNumMessages;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5322 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5323 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5324 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5325 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5326 result = 3 * pMessageQueue_50CBD0->uNumMessages + 3;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5327 *(&pMessageQueue_50CBD0->uNumMessages + result) = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5328 ++pMessageQueue_50CBD0->uNumMessages;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5329 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5330 return result;*/
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5331 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5332 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5333 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5334 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[538], (unsigned int)(v5 - pPlayers[uActiveCharacter]->uExperience), v34 + 1);//
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5335 // "You need %d more experience to train to level %d"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5336 v35 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5337 v62 = 3;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5338 v60 = pTmpBuf.data();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5339 v58 = color2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5340 v36 = (212 - pFontArrus->CalcTextHeight(pTmpBuf.data(), &v65, 0, 0)) / 2 + 88;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5341 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5342 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5343 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5344 sprintf(pTmpBuf.data(), "%s\n \n%s", pGlobalTXT_LocalizationStrings[536], pGlobalTXT_LocalizationStrings[529]);//
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5345 // ""With your skills, you should be working here as a teacher.""
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5346 // ""Sorry, but we are unable to train you.""
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5347 v35 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5348 v62 = 3;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5349 v60 = pTmpBuf.data();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5350 v58 = color2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5351 v36 = (212 - pFontArrus->CalcTextHeight(pTmpBuf.data(), &v65, 0, 0)) / 2 + 101;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5352 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5353 v65.DrawTitleText(pFontArrus, v35, v36, v58, v60, v62);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5354 v63 = 3;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5355 goto LABEL_55;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5356 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5357
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5358 if (sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win())
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5359 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5360 v43 = pDialogueWindow;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5361 v72 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5362 pShopOptions[0] = pTmpBuf.data();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5363 pShopOptions[1] = pGlobalTXT_LocalizationStrings[160];// "Learn Skills"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5364 v44 = pDialogueWindow->pNumPresenceButton;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5365 v73 = pDialogueWindow->pStartingPosActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5366 if ( v73 < v73 + v44 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5367 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5368 v45 = pShopOptions.data();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5369 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5370 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5371 if ( v43->GetControl(v73)->msg_param == HOUSE_DIALOGUE_TRAININGHALL_TRAIN )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5372 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5373 //v46 = pPlayers[uActiveCharacter]->uLevel;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5374 if (pPlayers[uActiveCharacter]->uLevel >= v68)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5375 sprintfex(*v45, "%s\n \n%s",
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5376 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."
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5377 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5378 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5379 if (pPlayers[uActiveCharacter]->uExperience < v5)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5380 sprintfex(*v45, pGlobalTXT_LocalizationStrings[538], // "You need %d more experience to train to level %d"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5381 (uint)(v5 - pPlayers[uActiveCharacter]->uExperience), pPlayers[uActiveCharacter]->uLevel + 1);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5382 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5383 sprintfex(*v45, pGlobalTXT_LocalizationStrings[537], // "Train to level %d for %d gold"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5384 pPlayers[uActiveCharacter]->uLevel + 1, v11);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5385 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5386 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5387 v47 = pFontArrus->CalcTextHeight(*v45, &v65, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5388 v43 = pDialogueWindow;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5389 v72 += v47;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5390 ++v45;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5391 ++v73;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5392 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5393 while ( v73 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5394 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5395
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5396 v49 = (2 * (87 - (174 - v72) / 2) - v72) / 2 - (174 - v72) / 2 / 2 + 138;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5397 v73 = v43->pStartingPosActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5398 if (v43->pStartingPosActiveItem < v43->pStartingPosActiveItem + v43->pNumPresenceButton)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5399 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5400 int _v3 = 2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5401 v51 = pShopOptions.data();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5402 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5403 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5404 v52 = v43->GetControl(v73);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5405 v53 = v52;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5406 v52->uY = (174 - v72) / 2 + v49;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5407 v54 = pFontArrus->CalcTextHeight(*v51, &v65, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5408 v55 = v53->uY;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5409 v53->uHeight = v54;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5410 v56 = v54 + v55 - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5411 v53->uW = v56;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5412 v49 = v56;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5413 v57 = color2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5414 if ( pDialogueWindow->pCurrentPosActiveItem != _v3 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5415 v57 = white;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5416 v65.DrawTitleText(pFontArrus, 0, v55, v57, *v51, 3u);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5417 v43 = pDialogueWindow;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5418 ++_v3;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5419 ++v51;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5420 ++v73;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5421 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5422 while ( v73 < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5423 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5424 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5425 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5426 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5427
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5428 //----- (004B4FCF) --------------------------------------------------------
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5429 void MagicShopDialog()
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5430 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5431 int result; // eax@6
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5432 signed int v2; // esi@8
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5433 unsigned int v3; // ebx@10
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5434 char *v4; // eax@11
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5435 char *v5; // eax@12
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5436 unsigned int v6; // eax@12
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5437 int v7; // ST08_4@14
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5438 int v8; // eax@14
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5439 unsigned __int8 v9; // dl@14
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5440 char *v10; // ecx@14
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5441 signed int v11; // esi@16
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5442 int v12; // ST08_4@19
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5443 int v13; // eax@19
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5444 int all_text_height; // edi@21
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5445 char **v15; // esi@21
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5446 int v16; // eax@22
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5447 int v18; // edx@23
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5448 int v19; // edi@23
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5449 unsigned __int8 v20; // sf@23
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5450 GUIButton *control_button; // esi@25
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5451 const char **v22; // eax@25
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5452 int v23; // eax@25
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5453 unsigned int v24; // ecx@25
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5454 const char **v25; // edx@25
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5455 unsigned __int16 text_color; // ax@25
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5456 signed int pTextHeight; // esi@30
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5457 int v28; // ST08_4@34
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5458 int v29; // eax@34
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5459 char *v30; // edx@35
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5460 void *v32; // eax@40
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5461 signed int v33; // esi@40
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5462 unsigned int v34; // esi@42
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5463 int v35; // eax@42
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5464 unsigned int v36; // eax@43
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5465 int v37; // eax@45
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5466 int v38; // ecx@50
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5467 int v41; // eax@52
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5468 char *v42; // eax@54
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5469 int v43; // eax@54
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5470 unsigned int v44; // ecx@54
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5471 int v45; // edx@54
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5472 int v46; // eax@54
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5473 unsigned __int16 v47; // ax@54
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5474 int v48; // eax@58
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5475 signed int v49; // esi@62
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5476 Texture *v50; // ecx@64
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5477 unsigned int v51; // edi@64
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5478 unsigned int v52; // esi@66
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5479 int v53; // edx@70
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5480 Texture *v54; // ecx@76
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5481 unsigned int v55; // edi@76
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5482 unsigned int v56; // esi@76
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5483 int v57; // edx@80
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5484 unsigned int v59; // edi@86
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5485 unsigned int v60; // esi@88
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5486 int v61; // edx@92
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5487 unsigned int v63; // edi@98
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5488 unsigned int v64; // esi@100
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5489 int v65; // edx@104
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5490 signed int v66; // ecx@109
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5491 SHORT v67; // di@117
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5492 bool v68; // eax@117
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5493 const char *v69; // ecx@119
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5494 POINT *v70; // esi@124
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5495 int v71; // ecx@125
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5496 int v73; // ecx@125
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5497 int v75; // eax@130
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5498 int v78; // eax@132
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5499 int v80; // edx@133
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5500 int v81; // edi@133
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5501 const char **v83; // eax@135
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5502 int v84; // eax@135
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5503 unsigned int v85; // ecx@135
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5504 int v86; // edx@135
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5505 int v89; // [sp-14h] [bp-10Ch]@35
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5506 int v91; // [sp-10h] [bp-108h]@35
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5507 unsigned __int16 v92; // [sp-Ch] [bp-104h]@12
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5508 void *v93; // [sp-Ch] [bp-104h]@14
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5509 int v94; // [sp-8h] [bp-100h]@11
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5510 char *v95; // [sp-8h] [bp-100h]@12
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5511 __int64 *v96; // [sp-4h] [bp-FCh]@11
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5512 unsigned int v97; // [sp-4h] [bp-FCh]@12
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5513 POINT v98; // [sp+Ch] [bp-ECh]@8
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5514 POINT v99; // [sp+14h] [bp-E4h]@16
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5515 POINT v100; // [sp+1Ch] [bp-DCh]@124
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5516 POINT v101; // [sp+24h] [bp-D4h]@17
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5517 POINT v102; // [sp+2Ch] [bp-CCh]@124
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5518 POINT v103; // [sp+34h] [bp-C4h]@9
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5519 POINT v104; // [sp+3Ch] [bp-BCh]@31
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5520 POINT v105; // [sp+44h] [bp-B4h]@16
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5521 POINT v106; // [sp+4Ch] [bp-ACh]@30
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5522 POINT v107; // [sp+54h] [bp-A4h]@16
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5523 POINT v108; // [sp+5Ch] [bp-9Ch]@30
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5524 POINT a2; // [sp+64h] [bp-94h]@8
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5525 POINT v110; // [sp+6Ch] [bp-8Ch]@30
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5526 POINT v111; // [sp+74h] [bp-84h]@8
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5527 GUIWindow dialog_window; // [sp+7Ch] [bp-7Ch]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5528 char *Str; // [sp+D0h] [bp-28h]@54
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5529 int v146; // [sp+D4h] [bp-24h]@23
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5530 unsigned int pYellowColor; // [sp+D8h] [bp-20h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5531 unsigned int pWhiteColor; // [sp+DCh] [bp-1Ch]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5532 __int32 v117; // [sp+E0h] [bp-18h]@8
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5533 int v118; // [sp+E4h] [bp-14h]@40
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5534 const char **v119; // [sp+E8h] [bp-10h]@24
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5535 int _this; // [sp+ECh] [bp-Ch]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5536 unsigned __int8 uPlayerID; // [sp+F3h] [bp-5h]@14
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5537 int v152; // [sp+F4h] [bp-4h]@23
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5538 int v122;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5539 int v114;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5540 int pSrtingNum;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5541 int pActiveItemNum;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5542 ItemGen *item;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5543
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5544 memcpy(&dialog_window, window_SpeakInHouse, sizeof(dialog_window));
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5545 dialog_window.uFrameX = 483;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5546 dialog_window.uFrameWidth = 148;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5547 dialog_window.uFrameZ = 334;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5548 pWhiteColor = TargetColor(255, 255, 255);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5549 pYellowColor = TargetColor(225, 205, 35);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5550 if ( dialog_menu_id == HOUSE_DIALOGUE_MAIN)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5551 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5552 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5553 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5554 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134]; //"Buy Standard"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5555 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152]; //"Buy Special"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5556 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159]; //"Display Inventory"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5557 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5558 all_text_height = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5559 for ( int i = 0; i < 4; ++i )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5560 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5561 v146 = (174 - all_text_height) / 4;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5562 v23 = (174 - 4 * (174 - all_text_height) / 4 - all_text_height) / 2 - (174 - all_text_height) / 4 / 2 + 138;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5563 int j = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5564 if ( pDialogueWindow->pNumPresenceButton>=0 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5565 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5566 int th = 2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5567 for (v152 = pDialogueWindow->pStartingPosActiveItem; v152 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem; ++v152)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5568 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5569 control_button = pDialogueWindow->GetControl(v152);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5570 control_button->uY = v146 + v23;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5571 pTextHeight = pFontArrus->CalcTextHeight(pShopOptions[j], &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5572 control_button->uHeight = pTextHeight;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5573 v23 = control_button->uY + control_button->uHeight - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5574 control_button->uW = v23;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5575 text_color = pYellowColor;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5576 if ( pDialogueWindow->pCurrentPosActiveItem != th )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5577 text_color = pWhiteColor;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5578 dialog_window.DrawTitleText(pFontArrus, 0, control_button->uY, text_color, pShopOptions[j], 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5579 ++th;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5580 ++j;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5581 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5582 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5583 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5584 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5585 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5586 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5587 pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5588 v3 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5589 v49 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5590 v122 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5591 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5592 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5593 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v49].uItemID)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5594 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5595 v50 = ItemsInShopTexture[v49];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5596 v51 = 152 - v50->uTextureHeight;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5597 if ( (signed int)v51 < 1 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5598 v51 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5599 v52 = 75 * v49 - v50->uTextureWidth / 2 + 40;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5600 if ( v122 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5601 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5602 if ( v122 == 5 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5603 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5604 v53 = ItemsInShopTexture[5]->uTextureWidth;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5605 if ( (signed int)v52 > 457 - v53 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5606 v52 = 457 - v53;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5607 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5608 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5609 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5610 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5611 if ( (signed int)v52 < 18 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5612 v52 = 18;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5613 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5614 pRenderer->DrawTextureTransparent(v52, v51, v50);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5615 sub_40F92A(&pRenderer->pActiveZBuffer[v52 + 640 * v51], ItemsInShopTexture[v122], v122 + 1);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5616 v49 = v122;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5617 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5618 ++v49;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5619 v122 = v49;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5620 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5621 while ( v49 < 6 );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5622 v122 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5623 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5624 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5625 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v122 + 6].uItemID)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5626 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5627 v54 = ItemsInShopTexture[v122 + 6];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5628 v55 = 306 - v54->uTextureHeight;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5629 v56 = 75 * v122 - v54->uTextureWidth / 2 + 40;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5630 if ( v122 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5631 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5632 if ( v122 == 5 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5633 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5634 v57 = ItemsInShopTexture[11]->uTextureWidth;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5635 if ( (signed int)v56 > 457 - v57 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5636 v56 = 457 - v57;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5637 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5638 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5639 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5640 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5641 if ( (signed int)v56 < 18 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5642 v56 = 18;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5643 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5644 pRenderer->DrawTextureTransparent(v56, v55, v54);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5645 sub_40F92A(&pRenderer->pActiveZBuffer[v56 + 640 * v55], ItemsInShopTexture[v122 + 6], v122 + 7);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5646 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5647 ++v122;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5648 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5649 while ( v122 < 6 );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5650 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5651 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5652 v66 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5653 v117 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5654 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5655 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5656 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5657 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5658 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v66].uItemID) //9 * (v66 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5659 ++v117;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5660 ++v66;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5661 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5662 while ( v66 < 12 );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5663 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5664 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5665 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5666 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5667 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5668 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v66].uItemID)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5669 ++v117;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5670 ++v66;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5671 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5672 while ( v66 < 12 );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5673 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5674 v67 = GetAsyncKeyState(VK_CONTROL);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5675 v68 = pPlayers[uActiveCharacter]->CanSteal();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5676 Str = (char *)v68;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5677 if ( v67 && v68 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5678 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5679 v69 = pGlobalTXT_LocalizationStrings[185];// "Steal item"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5680 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5681 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5682 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5683 v69 = pGlobalTXT_LocalizationStrings[195];// "Select the Item to Buy"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5684 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5685 v69 = pGlobalTXT_LocalizationStrings[196];// "Select the Special Item to Buy"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5686 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5687 DrawTextAtStatusBar(v69, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5688 if ( !v117 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5689 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5690 dialog_window.DrawCurrentTime( pParty->field_3C.field_50[(unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5691 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5692 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5693 v70 = pMouse->GetCursorPos(&v102);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5694 result = v70->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v100)->y];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5695 if ( pRenderer->pActiveZBuffer[result] & 0xFFFF )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5696 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5697 v71 = (pRenderer->pActiveZBuffer[result] & 0xFFFF) - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5698 item = &pParty->StandartItemsInShops[(int)window_SpeakInHouse->ptr_1C][v71];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5699 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5700 item = &pParty->SpecialItemsInShops[(int)window_SpeakInHouse->ptr_1C][v71];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5701 if ( v67 && Str )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5702 v10 = pGlobalTXT_LocalizationStrings[181];// "Steal %24"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5703 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5704 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5705 v75 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 2);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5706 v10 = (char *)pMerchantsBuyPhrases[v75];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5707 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5708 v30 = BuilDialogueString(v10, uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 2, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5709 v6 = (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, v3, v3)) / 2 + 138;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5710 dialog_window.DrawTitleText(pFontArrus, v3, v6, pWhiteColor, v30, 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5711 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5712 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5713 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5714 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5715 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5716 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_SPECIAL)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5717 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5718 pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5719 v3 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5720 v49 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5721 v122 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5722 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5723 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5724 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v49].uItemID)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5725 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5726 v59 = 152 - ItemsInShopTexture[v49]->uTextureHeight;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5727 if ( (signed int)v59 < 1 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5728 v59 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5729 v60 = 75 * v49 - ItemsInShopTexture[v49]->uTextureWidth / 2 + 40;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5730 if ( v122 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5731 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5732 if ( v122 == 5 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5733 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5734 v61 = ItemsInShopTexture[5]->uTextureWidth;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5735 if ( (signed int)v60 > 457 - v61 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5736 v60 = 457 - v61;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5737 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5738 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5739 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5740 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5741 if ( (signed int)v60 < 18 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5742 v60 = 18;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5743 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5744 pRenderer->DrawTextureTransparent(v60, v59, ItemsInShopTexture[v49]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5745 sub_40F92A(&pRenderer->pActiveZBuffer[v60 + 640 * v59], ItemsInShopTexture[v122], v122 + 1);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5746 v49 = v122;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5747 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5748 ++v49;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5749 v122 = v49;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5750 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5751 while ( v49 < 6 );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5752 v122 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5753 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5754 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5755 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v122 + 6].uItemID)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5756 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5757 v63 = 306 - ItemsInShopTexture[v122 + 6]->uTextureHeight;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5758 if ( (signed int)v63 < 1 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5759 v63 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5760 v64 = 75 * v122 - ItemsInShopTexture[v122 + 6]->uTextureWidth / 2 + 40;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5761 if ( v122 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5762 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5763 if ( v122 == 5 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5764 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5765 v65 = ItemsInShopTexture[11]->uTextureWidth;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5766 if ( (signed int)v64 > 457 - v65 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5767 v64 = 457 - v65;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5768 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5769 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5770 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5771 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5772 if ( (signed int)v64 < 18 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5773 v64 = 18;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5774 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5775 pRenderer->DrawTextureTransparent(v64, v63, ItemsInShopTexture[v122 + 6]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5776 sub_40F92A(&pRenderer->pActiveZBuffer[v64 + 640 * v63], ItemsInShopTexture[v122 + 6], v122 + 7);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5777 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5778 ++v122;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5779 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5780 while ( v122 < 6 );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5781 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5782 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5783 v66 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5784 v117 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5785 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5786 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5787 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5788 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5789 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v66].uItemID) //9 * (v66 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5790 ++v117;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5791 ++v66;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5792 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5793 while ( v66 < 12 );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5794 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5795 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5796 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5797 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5798 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5799 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v66].uItemID)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5800 ++v117;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5801 ++v66;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5802 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5803 while ( v66 < 12 );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5804 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5805 v67 = GetAsyncKeyState(VK_CONTROL);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5806 v68 = pPlayers[uActiveCharacter]->CanSteal();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5807 Str = (char *)v68;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5808 if ( v67 && v68 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5809 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5810 v69 = pGlobalTXT_LocalizationStrings[185];// "Steal item"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5811 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5812 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5813 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5814 v69 = pGlobalTXT_LocalizationStrings[195];// "Select the Item to Buy"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5815 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5816 v69 = pGlobalTXT_LocalizationStrings[196];// "Select the Special Item to Buy"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5817 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5818 DrawTextAtStatusBar(v69, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5819 if ( !v117 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5820 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5821 dialog_window.DrawCurrentTime( pParty->field_3C.field_50[(unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5822 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5823 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5824 v70 = pMouse->GetCursorPos(&v102);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5825 result = v70->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v100)->y];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5826 if ( pRenderer->pActiveZBuffer[result] & 0xFFFF )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5827 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5828 v71 = (pRenderer->pActiveZBuffer[result] & 0xFFFF) - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5829 item = &pParty->StandartItemsInShops[(int)window_SpeakInHouse->ptr_1C][v71];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5830 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5831 item = &pParty->SpecialItemsInShops[(int)window_SpeakInHouse->ptr_1C][v71];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5832 if ( v67 && Str )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5833 v10 = pGlobalTXT_LocalizationStrings[181];// "Steal %24"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5834 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5835 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5836 v75 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 2);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5837 v10 = (char *)pMerchantsBuyPhrases[v75];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5838 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5839 v30 = BuilDialogueString(v10, uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 2, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5840 v6 = (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, v3, v3)) / 2 + 138;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5841 dialog_window.DrawTitleText(pFontArrus, v3, v6, pWhiteColor, v30, 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5842 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5843 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5844 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5845 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5846 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5847 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5848 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5849 draw_leather();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5850 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5851 pShopOptions[0] = pGlobalTXT_LocalizationStrings[200];// "Sell"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5852 pShopOptions[1] = pGlobalTXT_LocalizationStrings[113];// "Identify"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5853 pShopOptions[2] = pGlobalTXT_LocalizationStrings[179];// "Repair"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5854 all_text_height = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5855 for ( uint i = 0; i < 3; ++i )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5856 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5857 _this = ((174 - all_text_height) / 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5858 v81 = (3 * (58 - (signed int)_this) - all_text_height) / 2 - (174 - all_text_height) / 3 / 2 + 138;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5859 v20 = -pDialogueWindow->pNumPresenceButton < 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5860 v118 = pDialogueWindow->pStartingPosActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5861 if ( v20 ^ (pDialogueWindow->pStartingPosActiveItem > pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5862 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5863 v122 = 2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5864 pSrtingNum = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5865 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5866 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5867 control_button = pDialogueWindow->GetControl(v118);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5868 control_button->uY = (unsigned int)((char *)_this + v81);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5869 pTextHeight = pFontArrus->CalcTextHeight(pShopOptions[pSrtingNum], &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5870 v85 = control_button->uY;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5871 control_button->uHeight = pTextHeight;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5872 v81 = pTextHeight + v85 - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5873 control_button->uW = v81;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5874 text_color = pYellowColor;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5875 if ( pDialogueWindow->pCurrentPosActiveItem != v122 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5876 text_color = pWhiteColor;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5877 dialog_window.DrawTitleText(pFontArrus, 0, v85, text_color, pShopOptions[pSrtingNum], 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5878 ++v122;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5879 ++pSrtingNum;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5880 ++v118;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5881 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5882 while ( v118 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5883 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5884 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5885 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5886 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_SELL)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5887 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5888 draw_leather();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5889 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5890 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0);// "Select the Item to Sell"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5891 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win()
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5892 || (v11 = pMouse->GetCursorPos(&v107)->x - 14,
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5893 v117 = (v11 >> 5) + 14 * ((pMouse->GetCursorPos(&v99)->y - 17) >> 5),
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5894 result = (int)pMouse->GetCursorPos(&v105),
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5895 *(int *)result <= 13)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5896 || (result = (int)pMouse->GetCursorPos(&v101), *(int *)result >= 462)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5897 || (result = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v117), v3 = 0, !result) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5898 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5899 item = &pPlayers[uActiveCharacter]->pInventoryItems[result - 1];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5900 v13 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5901 v30 = BuilDialogueString((char *)pMerchantsSellPhrases[v13], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 3, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5902 v6 = (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, v3, v3)) / 2 + 138;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5903 dialog_window.DrawTitleText(pFontArrus, v3, v6, pWhiteColor, v30, 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5904 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5905 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5906 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_IDENTIFY)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5907 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5908 draw_leather();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5909 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5910 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0);// "Select the Item to Identify"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5911 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5912 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5913 v2 = pMouse->GetCursorPos(&a2)->x - 14;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5914 v117 = (v2 >> 5) + 14 * ((pMouse->GetCursorPos(&v98)->y - 17) >> 5);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5915 result = (int)pMouse->GetCursorPos(&v111);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5916 if ( *(int *)result > 13 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5917 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5918 result = (int)pMouse->GetCursorPos(&v103);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5919 if ( *(int *)result < 462 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5920 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5921 result = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v117);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5922 if ( result )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5923 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5924 item = &pPlayers[uActiveCharacter]->pInventoryItems[result-1];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5925 if ( item->uAttributes & 1 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5926 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5927 v5 = BuilDialogueString("%24", uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 4, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5928 v6 = (212 - pFontArrus->CalcTextHeight(v5, &dialog_window, 0, 0)) / 2 + 101;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5929 dialog_window.DrawTitleText(pFontArrus, 0, v6, pWhiteColor, v5, 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5930 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5931 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5932 v8 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 4);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5933 v30 = BuilDialogueString((char *)pMerchantsIdentifyPhrases[v8], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 4, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5934 v6 = (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, 0, 0)) / 2 + 138;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5935 dialog_window.DrawTitleText(pFontArrus, 0, v6, pWhiteColor, v30, 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5936 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5937 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5938 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5939 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5940 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5941 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5942 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5943 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_REPAIR)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5944 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5945 draw_leather();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5946 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5947 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[198], 0);// "Select the Item to Repair"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5948 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win()
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5949 || (pTextHeight = pMouse->GetCursorPos(&v110)->x - 14,
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5950 v117 = (pTextHeight >> 5) + 14 * ((pMouse->GetCursorPos(&v108)->y - 17) >> 5),
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5951 result = (int)pMouse->GetCursorPos(&v106),
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5952 *(int *)result <= 13)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5953 || (result = (int)pMouse->GetCursorPos(&v104), *(int *)result >= 462)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5954 || (result = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v117), v3 = 0, !result)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5955 // || (result *= 9, !(pPlayers[uActiveCharacter]->field_1F5[4 * result + 15] & 2)) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5956 || (!(pPlayers[uActiveCharacter]->pOwnItems[result-1].uAttributes& 2)) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5957 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5958 item = &pPlayers[uActiveCharacter]->pInventoryItems[result - 1];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5959 v29 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(&pPlayers[uActiveCharacter]->pInventoryItems[result - 1], BildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 5);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5960 v30 = BuilDialogueString((char *)pMerchantsRepairPhrases[v29], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 5, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5961 v6 = (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, v3, v3)) / 2 + 138;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5962 dialog_window.DrawTitleText(pFontArrus, v3, v6, pWhiteColor, v30, 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5963 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5964 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5965 if ( dialog_menu_id == HOUSE_DIALOGUE_LEARN_SKILLS )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5966 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5967 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5968 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5969 v3 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5970 all_text_height = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5971 v33 = (signed __int64)(p2DEvents[(signed int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5972 v119 = (const char **)(v33 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5973 if ( (signed int)v119 < v33 / 3 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5974 v119 = (const char **)(v33 / 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5975 pActiveItemNum = pDialogueWindow->pStartingPosActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5976 v122 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5977 if ( (signed int)pDialogueWindow->pStartingPosActiveItem >= pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5978 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5979 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayers[uActiveCharacter]->pName, pClassNames[pPlayers[uActiveCharacter]->classType]);//
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5980 // "Seek knowledge elsewhere %s the %s"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5981 strcat(pTmpBuf.data(), "\n \n");
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5982 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);// "I can offer you nothing further."
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5983 v6 = (174 - pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 0, 0)) / 2 + 138;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5984 dialog_window.DrawTitleText(pFontArrus, v3, v6, pYellowColor, pTmpBuf.data(), 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5985 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5986 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5987 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5988 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5989 v36 = pDialogueWindow->GetControl(pActiveItemNum)->msg_param - 36;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5990 if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][v36] && !pPlayers[uActiveCharacter]->pActiveSkills[v36] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5991 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5992 all_text_height += pFontArrus->CalcTextHeight(pSkillNames[v36], &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5993 ++v122;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5994 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5995 ++pActiveItemNum;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5996 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5997 while ( pActiveItemNum < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5998 if ( !v122 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
5999 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6000 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayers[uActiveCharacter]->pName, pClassNames[pPlayers[uActiveCharacter]->classType]);//
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6001 // "Seek knowledge elsewhere %s the %s"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6002 strcat(pTmpBuf.data(), "\n \n");
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6003 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);// "I can offer you nothing further."
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6004 v6 = (174 - pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 0, 0)) / 2 + 138;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6005 dialog_window.DrawTitleText(pFontArrus, v3, v6, pYellowColor, pTmpBuf.data(), 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6006 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6007 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6008 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], v119);// "Skill Cost: %lu"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6009 dialog_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3u);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6010 v119 = (const char **)((149 - all_text_height) / v122);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6011 if ( (149 - all_text_height) / v122 > 32 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6012 v119 = (const char **)32;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6013 v38 = (149 - v122 * (signed int)v119 - all_text_height) / 2 - (signed int)v119 / 2 + 162;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6014 v118 = 2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6015 if ( pDialogueWindow->pStartingPosActiveItem < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6016 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6017 v122 = 2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6018 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6019 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6020 control_button = pDialogueWindow->GetControl(v122);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6021 v41 = control_button->msg_param - 36;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6022 if ( !byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][v41] || pPlayers[uActiveCharacter]->pActiveSkills[v41] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6023 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6024 control_button->uW = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6025 control_button->uHeight = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6026 control_button->uY = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6027 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6028 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6029 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6030 control_button->uY = (unsigned int)((char *)v119 + v38);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6031 pTextHeight = pFontArrus->CalcTextHeight(pSkillNames[v41], &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6032 v44 = control_button->uY;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6033 control_button->uHeight = pTextHeight;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6034 v38 = v44 + pTextHeight - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6035 control_button->uW = v38;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6036 text_color = pYellowColor;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6037 if ( pDialogueWindow->pCurrentPosActiveItem != v122 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6038 text_color = pWhiteColor;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6039 dialog_window.DrawTitleText(pFontArrus, 0, v44, text_color, pSkillNames[v41], 3);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6040 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6041 ++v122;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6042 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6043 while ( v122 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6044 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6045 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6046 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6047 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6048 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6049 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6050
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6051
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6052 //----- (004B6478) --------------------------------------------------------
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6053 void sub_4B6478()
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6054 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6055 GUIWindow *v0; // ebx@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6056 Player *v1; // edi@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6057 unsigned int v2; // eax@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6058 signed int v3; // esi@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6059 int v4; // ebx@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6060 unsigned int v5; // esi@5
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6061 int v6; // edi@6
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6062 int result; // eax@13
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6063 GUIWindow *v8; // ebx@17
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6064 int v9; // eax@17
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6065 int v10; // ecx@17
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6066 unsigned int v11; // ecx@18
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6067 int v12; // eax@20
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6068 int v13; // eax@21
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6069 GUIButton *v14; // esi@27
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6070 int v15; // ecx@27
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6071 unsigned int v16; // eax@28
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6072 const char *v17; // ebx@29
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6073 int v18; // eax@29
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6074 unsigned int v19; // ecx@29
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6075 int v20; // eax@29
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6076 unsigned __int16 v21; // ax@29
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6077 unsigned __int16 v22; // ST14_2@36
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6078 int v23; // eax@36
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6079 const char *v24; // ST18_4@37
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6080 unsigned __int16 v25; // ST14_2@37
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6081 int v26; // eax@37
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6082 int v27; // [sp-4h] [bp-80h]@8
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6083 GUIWindow v28; // [sp+Ch] [bp-70h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6084 GUIWindow *v29; // [sp+60h] [bp-1Ch]@17
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6085 unsigned int v30; // [sp+64h] [bp-18h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6086 int v31; // [sp+68h] [bp-14h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6087 int v32; // [sp+6Ch] [bp-10h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6088 int v33; // [sp+70h] [bp-Ch]@17
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6089 int v34; // [sp+74h] [bp-8h]@17
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6090 int v35; // [sp+78h] [bp-4h]@17
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6091
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6092 v0 = window_SpeakInHouse;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6093 memcpy(&v28, window_SpeakInHouse, sizeof(v28));
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6094 v1 = pPlayers[uActiveCharacter];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6095 v28.uFrameX = 483;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6096 v28.uFrameWidth = 148;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6097 v28.uFrameZ = 334;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6098 v30 = TargetColor(0xFFu, 0xFFu, 0xFFu);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6099 v31 = TargetColor(0xFFu, 0xFFu, 0x9Bu);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6100 v2 = 52 * (unsigned int)v0->ptr_1C;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6101 //v32 = (unsigned __int8)(((p2DEvents_minus1___00[v2 / 2] != 18) - 1) & 0x96) + 100;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6102 v32 = (unsigned __int8)(((p2DEvents[(unsigned int)v0->ptr_1C - 1].uType != 18) - 1) & 0x96) + 100;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6103 //v3 = (signed __int64)((double)v32 * p2DEvents_minus1__20[v2 / 4]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6104 v3 = (signed __int64)((double)v32 * p2DEvents[(unsigned int)v0->ptr_1C - 1].fPriceMultiplier);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6105 v4 = v3 * (100 - v1->GetMerchant()) / 100;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6106 v32 = v4;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6107 if ( v4 < v3 / 3 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6108 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6109 v4 = v3 / 3;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6110 v32 = v3 / 3;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6111 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6112 if ( dialog_menu_id != HOUSE_DIALOGUE_MAIN)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6113 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6114 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6115 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6116 v5 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6117
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6118 __debugbreak();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6119 //pSkillAvailabilityPerClass[8 + v58->uClass][4 + v23]
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6120 // or
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6121 //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass][v23 - 36]
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6122 // or
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6123 //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass - 1][v23 + 1]
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6124 __debugbreak(); // whacky condition - fix
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6125 if (false
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6126 //if ( !*(&byte_4ED94C[37 * v1->uClass / 3] + dword_F8B19C)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6127 || (v6 = (int)(&v1->uIntelligence + dialog_menu_id), *(short *)v6) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6128 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6129 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6130 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6131 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6132 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6133 if ( pParty->uNumGold < v4 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6134 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6135 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6136 v27 = 4;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6137 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6138 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6139 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6140 Party::TakeGold(v4);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6141 *(short *)v6 = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6142 v27 = 2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6143 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6144 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, (HouseSoundID)v27);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6145 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6146 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6147 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6148 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6149 v5 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6150 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6151 /*result = pMessageQueue_50CBD0->uNumMessages;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6152 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6153 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6154 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6155 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6156 result = 3 * pMessageQueue_50CBD0->uNumMessages + 3;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6157 *(&pMessageQueue_50CBD0->uNumMessages + result) = v5;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6158 ++pMessageQueue_50CBD0->uNumMessages;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6159 }*/
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6160 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, v5);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6161 return; // void func
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6162 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6163 if ( !(unsigned __int16)_449B57_test_bit((unsigned __int8 *)v1->_guilds_member_bits, word_4F0754[2 * (unsigned int)window_SpeakInHouse->ptr_1C]) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6164 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6165 v24 = pNPCTopics[171].pText;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6166 v25 = v31;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6167 v26 = pFontArrus->CalcTextHeight(pNPCTopics[171].pText, &v28, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6168 v28.DrawTitleText(pFontArrus, 0, (212 - v26) / 2 + 101, v25, v24, 3u);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6169 pDialogueWindow->pNumPresenceButton = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6170 return ;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6171 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6172
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6173 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6174 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6175 v8 = pDialogueWindow;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6176 v33 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6177 v34 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6178 v29 = pDialogueWindow;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6179 v9 = pDialogueWindow->pStartingPosActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6180 v10 = v9 + pDialogueWindow->pNumPresenceButton;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6181 v35 = pDialogueWindow->pStartingPosActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6182 if ( v9 >= v10 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6183 goto LABEL_40;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6184 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6185 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6186 v11 = v8->GetControl(v35)->msg_param - 36;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6187 if ( byte_4ED970_skill_learn_ability_by_class_table[v1->classType / 3][v11] && !v1->pActiveSkills[v11] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6188 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6189 v12 = pFontArrus->CalcTextHeight(pSkillNames[v11], &v28, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6190 v33 += v12;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6191 ++v34;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6192 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6193 v13 = v8->pStartingPosActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6194 ++v35;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6195 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6196 while ( v35 < v8->pNumPresenceButton + v13 );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6197 if ( !v34 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6198 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6199 LABEL_40:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6200 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], v1->pName, pClassNames[v1->classType]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6201 strcat(pTmpBuf.data(), "\n \n");
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6202 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6203 v22 = v31;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6204 v23 = pFontArrus->CalcTextHeight(pTmpBuf.data(), &v28, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6205 v28.DrawTitleText(pFontArrus, 0, (174 - v23) / 2 + 138, v22, pTmpBuf.data(), 3u);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6206 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6207 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6208 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], v32);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6209 v28.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3u);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6210 v32 = (149 - v33) / v34;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6211 if ( (149 - v33) / v34 > 32 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6212 v32 = 32;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6213
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6214 v35 = v8->pStartingPosActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6215 v34 = (149 - v34 * v32 - v33) / 2 - v32 / 2 + 162;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6216 if ( v8->pStartingPosActiveItem < v8->pStartingPosActiveItem+ v8->pNumPresenceButton )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6217 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6218 v33 = 2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6219 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6220 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6221 v14 = v8->GetControl(v35);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6222 v15 = v14->msg_param - 36;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6223 if ( byte_4ED970_skill_learn_ability_by_class_table[v1->classType / 3][v15] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6224 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6225 v16 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6226 if ( !v1->pActiveSkills[v15] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6227 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6228 v17 = pSkillNames[v15];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6229 v14->uY = v32 + v34;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6230 v18 = pFontArrus->CalcTextHeight(v17, &v28, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6231 v19 = v14->uY;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6232 v14->uHeight = v18;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6233 v20 = v19 + v18 - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6234 v14->uW = v20;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6235 v34 = v20;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6236 v21 = v31;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6237 if ( pDialogueWindow->pCurrentPosActiveItem != v33 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6238 v21 = v30;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6239 v28.DrawTitleText(pFontArrus, 0, v19, v21, v17, 3u);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6240 goto LABEL_34;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6241 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6242 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6243 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6244 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6245 v16 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6246 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6247 v14->uW = v16;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6248 v14->uHeight = v16;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6249 v14->uY = v16;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6250 LABEL_34:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6251 v8 = v29;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6252 ++v35;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6253 ++v33;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6254 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6255 while ( v35 <v29->pNumPresenceButton + v29->pStartingPosActiveItem );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6256 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6257 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6258 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6259 //----- (004B1A2D) --------------------------------------------------------
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6260 void __cdecl ShowPopupShopItem()
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6261 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6262 POINT *v1; // esi@5
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6263 unsigned int v2; // eax@5
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6264 int v3; // ecx@5
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6265 POINT *v4; // esi@12
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6266 int v5; // eax@12
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6267 unsigned int v6; // eax@13
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6268 ItemGen *v7; // ecx@13
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6269 signed int v8; // esi@17
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6270 unsigned int v9; // eax@19
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6271 POINT v10; // [sp+8h] [bp-44h]@12
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6272 POINT v11; // [sp+10h] [bp-3Ch]@12
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6273 POINT v12; // [sp+18h] [bp-34h]@18
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6274 POINT v13; // [sp+20h] [bp-2Ch]@17
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6275 POINT v14; // [sp+28h] [bp-24h]@17
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6276 POINT v15; // [sp+30h] [bp-1Ch]@17
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6277 POINT v16; // [sp+38h] [bp-14h]@5
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6278 POINT a2; // [sp+40h] [bp-Ch]@5
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6279
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6280 if ( in_current_building_type <= 0 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6281 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6282 if ( in_current_building_type <= BildingType_AlchemistShop )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6283 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6284 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6285 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6286 if ( dialog_menu_id <= HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6287 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6288 if ( dialog_menu_id <= HOUSE_DIALOGUE_SHOP_REPAIR || dialog_menu_id == HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6289 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6290 v8 = pMouse->GetCursorPos(&v15)->x - 14;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6291 v5 = (v8 >> 5) + 14 * ((pMouse->GetCursorPos(&v14)->y - 17) >> 5);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6292 if ( pMouse->GetCursorPos(&v13)->x <= 13
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6293 || pMouse->GetCursorPos(&v12)->x >= 462
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6294 || (v9 = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex(&v5)) == 0 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6295 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6296 GameUI_DrawItemInfo(&pPlayers[uActiveCharacter]->pInventoryItems[v9 - 1]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6297 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6298 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6299 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_SPECIAL )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6300 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6301 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6302 v4 = pMouse->GetCursorPos(&v11);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6303 v5 = pRenderer->pActiveZBuffer[v4->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v10)->y]] & 0xFFFF;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6304 if ( !v5 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6305 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6306 v6 = 9 * (v5 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6307 v7 = (ItemGen *)((char *)&pParty->pPickedItem + 4 * v6 + 4);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6308 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6309 v7 = &pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v5 - 1];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6310 GameUI_DrawItemInfo(v7);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6311 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6312 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6313 if ( in_current_building_type <= BildingType_16 && dialog_menu_id == HOUSE_DIALOGUE_GUILD_BUY_BOOKS )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6314 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6315 v1 = pMouse->GetCursorPos(&a2);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6316 v2 = v1->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v16)->y];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6317 v3 = pRenderer->pActiveZBuffer[v2] & 0xFFFF;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6318 v5 = pRenderer->pActiveZBuffer[v2] & 0xFFFF;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6319 if ( v5 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6320 sub_4B1523((int *)&pParty->pPlayers[1].uExpressionTimeLength + 9 * (v3 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C));
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6321 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6322 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6323 //----- (004B1D27) --------------------------------------------------------
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6324 void __cdecl sub_4B1D27()
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6325 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6326 int v0; // edx@2
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6327 unsigned int v1; // ecx@7
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6328 signed int v2; // edi@10
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6329 int v3; // esi@10
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6330 __int16 v4; // ax@15
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6331 signed int v5; // edi@20
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6332 int v6; // esi@20
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6333 int v7[4]; // [sp+Ch] [bp-10h]@12
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6334
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6335 if ( in_current_building_type > 0 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6336 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6337 v0 = 3;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6338 if ( in_current_building_type > BildingType_MagicShop )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6339 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6340 if ( in_current_building_type == BildingType_Bank )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6341 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6342 if ( !dword_F8B1E4 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6343 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6344 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6345 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6346 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6347 if ( in_current_building_type != BildingType_Temple )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6348 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6349 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6350 v1 = (unsigned int)window_SpeakInHouse->ptr_1C;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6351 PlayHouseSound(v1, (HouseSoundID)v0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6352 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6353 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6354 v1 = (unsigned int)window_SpeakInHouse->ptr_1C;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6355 if ( (signed __int64)pParty->field_3C._shop_ban_times[v1 ]<= (signed __int64)pParty->uTimePlayed )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6356 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6357 if ( pParty->uNumGold <= 0x2710 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6358 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6359 if ( !dword_F8B1E4 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6360 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6361 v0 = 4;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6362 PlayHouseSound(v1, (HouseSoundID)v0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6363 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6364 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6365 PlayHouseSound(v1, (HouseSoundID)(dword_F8B1E4 + 3));
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6366 if ( !dword_F8B1E4 && !qword_A750D8 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6367 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6368 v5 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6369 v6 = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6370 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6371 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6372 if ( pPlayers[v6]->CanAct() )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6373 v7[v5++] = v6;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6374 ++v6;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6375 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6376 while ( v6 <= 4 );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6377 if ( v5 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6378 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6379 qword_A750D8 = 256i64;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6380 word_A750E0 = 80;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6381 v4 = LOWORD(v7[rand() % v5]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6382 word_A750E2 = v4;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6383 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6384 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6385 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6386 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6387 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6388 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6389 if ( !qword_A750D8 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6390 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6391 v2 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6392 v3 = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6393 do
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6394 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6395 if ( pPlayers[v3]->CanAct() )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6396 v7[v2++] = v3;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6397 ++v3;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6398 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6399 while ( v3 <= 4 );
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6400 if ( v2 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6401 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6402 qword_A750D8 = 256i64;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6403 word_A750E0 = 80;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6404 v4 = LOWORD(v7[rand() % v2]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6405 word_A750E2 = v4;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6406 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6407 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6408 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6409 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6410 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6411 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6412 //----- (004B2A74) --------------------------------------------------------
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6413 void SimpleHouseAndBoatsDialog()
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6414 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6415 char *v0; // esi@3
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6416 char *v1; // ST1C_4@3
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6417 char *v2; // eax@3
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6418 const char *v3; // ST1C_4@5
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6419 int v4; // eax@5
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6420 unsigned int i; // eax@5
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6421 NPCData *v6; // esi@6
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6422 unsigned __int16 v7; // bx@6
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6423 unsigned int v8; // eax@6
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6424 int v9; // eax@11
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6425 unsigned int v10; // ecx@12
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6426 int v11; // eax@12
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6427 int v12; // esi@12
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6428 char *v13; // eax@12
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6429 GUIWindow *v14; // ebx@13
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6430 char *v15; // esi@14
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6431 GUIButton *v16; // eax@15
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6432 unsigned int v17; // ecx@15
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6433 int v18; // ecx@17
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6434 int v19; // ecx@18
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6435 int v20; // ecx@19
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6436 int v21; // ecx@20
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6437 int v22; // ecx@21
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6438 unsigned int v23; // ecx@23
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6439 int v24; // ecx@35
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6440 int v25; // ecx@36
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6441 int v26; // ecx@37
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6442 int v27; // ecx@38
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6443 int v28; // ecx@39
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6444 char *v29; // esi@42
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6445 unsigned int v30; // ST20_4@42
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6446 int v31; // ST1C_4@42
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6447 unsigned int v32; // eax@42
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6448 char *v33; // eax@43
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6449 int v34; // esi@51
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6450 int v35; // eax@51
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6451 unsigned int v36; // edi@51
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6452 GUIButton *v37; // eax@52
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6453 int v38; // eax@52
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6454 signed int v39; // ecx@54
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6455 int v40; // edi@57
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6456 GUIButton *v41; // eax@60
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6457 GUIButton *v42; // esi@60
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6458 const char *v43; // ebx@60
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6459 int v44; // eax@60
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6460 unsigned int v45; // ecx@60
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6461 unsigned __int16 v46; // ax@60
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6462 GUIFont *v47; // ebx@64
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6463 int v48; // esi@64
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6464 char *v49; // eax@66
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6465 GUIWindow w; // [sp+Ch] [bp-110h]@64
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6466 GUIWindow v52; // [sp+60h] [bp-BCh]@13
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6467 GUIWindow a1; // [sp+B4h] [bp-68h]@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6468 unsigned int v54; // [sp+108h] [bp-14h]@14
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6469 int v55; // [sp+10Ch] [bp-10h]@6
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6470 int v56; // [sp+110h] [bp-Ch]@13
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6471 char *pInString; // [sp+114h] [bp-8h]@12
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6472 NPCData *v58; // [sp+118h] [bp-4h]@6
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6473
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6474 memcpy(&a1, pDialogueWindow, sizeof(a1));
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6475 if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6476 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6477 v0 = pMapStats->pInfos[uHouse_ExitPic].pName;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6478 v1 = pMapStats->pInfos[uHouse_ExitPic].pName;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6479 a1.uFrameX = 493;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6480 a1.uFrameWidth = 126;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6481 a1.uFrameZ = 366;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6482 a1.DrawTitleText(pFontCreate, 0, 2u, 0, v1, 3u);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6483 a1.uFrameX = 483;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6484 a1.uFrameWidth = 148;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6485 a1.uFrameZ = 334;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6486 v2 = pTransitionStrings[uHouse_ExitPic];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6487 if ( !v2 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6488 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6489 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[411], v0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6490 v2 = pTmpBuf.data();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6491 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6492 v3 = v2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6493 v4 = pFontCreate->CalcTextHeight(v2, &a1, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6494 a1.DrawTitleText(pFontCreate, 0, (212 - v4) / 2 + 101, 0, v3, 3u);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6495 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6496 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6497 a1.uFrameWidth -= 10;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6498 a1.uFrameZ -= 10;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6499 v58 = HouseNPCData[(unsigned int)((char *)pDialogueNPCCount + -(dword_591080 != 0) )];//- 1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6500 v6 = v58;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6501 v55 = TargetColor(0xE1u, 0xCDu, 0x23u);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6502 v7 = TargetColor(0x15u, 0x99u, 0xE9u);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6503 v8 = v6->uProfession;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6504 if ( v8 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6505 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[429], v6->pName, aNPCProfessionNames[v8]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6506 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6507 strcpy(pTmpBuf.data(), v6->pName);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6508 a1.DrawTitleText(pFontCreate, 0x1E3u, 0x71u, v7, pTmpBuf.data(), 3u);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6509 if ( !dword_591080 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6510 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6511 if ( !uDialogueType )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6512 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6513 v9 = v6->greet;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6514 if ( v9 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6515 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6516 v10 = v6->uFlags;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6517 a1.uFrameWidth = game_viewport_width;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6518 a1.uFrameZ = 452;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6519 pInString = (char *)*(&pNPCStats->field_17884 + ((v10 & 3) == 2) + 2 * v9);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6520 v11 = pFontArrus->CalcTextHeight(pInString, &a1, 13, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6521 v12 = v11 + 7;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6522 pRenderer->_4A6A68(8, 352 - (v11 + 7),
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6523 pIcons_LOD->GetTexture(uTextureID_Leather),
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6524 pIcons_LOD->GetTexture(uTextureID_Leather)->uTextureHeight - (v11 + 7));
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6525 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6526 v13 = FitTextInAWindow(pInString, pFontArrus, &a1, 0xDu, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6527 pDialogueWindow->DrawText(pFontArrus, 13, 354 - v12, 0, v13, 0, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6528 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6529 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6530 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6531 v14 = pDialogueWindow;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6532 memcpy(&v52, pDialogueWindow, sizeof(v52));
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6533 v52.uFrameX = 483;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6534 v52.uFrameWidth = 148;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6535 v52.uFrameZ = 334;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6536 v56 = v52.pStartingPosActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6537 if ( v52.pStartingPosActiveItem < v52.pStartingPosActiveItem + v52.pNumPresenceButton )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6538 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6539 v15 = "";//(char *)v54;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6540 while ( 1 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6541 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6542 v16 = v52.GetControl(v56);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6543 v17 = v16->msg_param;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6544 pInString = (char *)v16;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6545 if ( (signed int)v17 > 24 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6546 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6547 v24 = v17 - 76;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6548 if ( !v24 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6549 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6550 v15 = pGlobalTXT_LocalizationStrings[406];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6551 goto LABEL_49;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6552 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6553 v25 = v24 - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6554 if ( !v25 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6555 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6556 v15 = pGlobalTXT_LocalizationStrings[407];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6557 goto LABEL_49;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6558 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6559 v26 = v25 - 2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6560 if ( !v26 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6561 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6562 v33 = _4B254D_SkillMasteryTeacher((int)v52.ptr_1C);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6563 LABEL_44:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6564 v15 = v33;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6565 LABEL_45:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6566 v16 = (GUIButton *)pInString;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6567 goto LABEL_49;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6568 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6569 v27 = v26 - 3;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6570 if ( !v27 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6571 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6572 v33 = (char *)ContractSelectText((int)v52.ptr_1C);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6573 goto LABEL_44;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6574 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6575 v28 = v27 - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6576 if ( !v28 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6577 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6578 v29 = (char *)&pMonsterStats + 88 * word_F8B1A0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6579 v30 = TargetColor(0xFFu, 0xFFu, 0xFFu);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6580 v31 = *(int *)v29;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6581 v32 = TargetColor(0xFFu, 0xFFu, 0x9Bu);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6582 sprintfex(pTmpBuf.data(), "\f%05d%s\f%05d", v32, v31, v30);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6583 sprintfex(pTmpBuf2.data(), dword_F8B1A4, pTmpBuf.data(), 100 * (unsigned __int8)v29[8]);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6584 current_npc_text = pTmpBuf2.data();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6585 v15 = "";
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6586 goto LABEL_45;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6587 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6588 if ( v28 != 10 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6589 goto LABEL_41;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6590 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6591 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6592 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6593 if ( v17 == 24 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6594 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6595 v23 = v58->evt_F;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6596 LABEL_33:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6597 v15 = (char *)pNPCTopics[v23-1].pTopic;//(&dword_721660)[8 * v23];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6598 if ( !v15 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6599 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6600 v16->msg_param = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6601 v15 = "";
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6602 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6603 goto LABEL_49;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6604 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6605 v18 = v17 - 13;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6606 if ( v18 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6607 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6608 v19 = v18 - 6;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6609 if ( !v19 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6610 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6611 v23 = v58->evt_A;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6612 goto LABEL_33;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6613 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6614 v20 = v19 - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6615 if ( !v20 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6616 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6617 v15 = (char *)pNPCTopics[v58->evt_B-1].pTopic;//(&dword_721660)[8 * v58->evtb];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6618 if ( !v15 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6619 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6620 v16->msg_param = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6621 v15 = "";
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6622 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6623 if ( uDialogueType != 84 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6624 goto LABEL_49;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6625 sprintf(pTmpBuf.data(), format_4E2D80, v55, pItemsTable->pItems[contract_approved].pUnidentifiedName);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6626 sprintf(pTmpBuf2.data(), current_npc_text, pTmpBuf.data());
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6627 current_npc_text = pTmpBuf2.data();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6628 goto LABEL_45;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6629 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6630 v21 = v20 - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6631 if ( !v21 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6632 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6633 v23 = v58->evt_C;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6634 goto LABEL_33;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6635 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6636 v22 = v21 - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6637 if ( !v22 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6638 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6639 v23 = v58->evt_D;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6640 goto LABEL_33;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6641 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6642 if ( v22 == 1 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6643 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6644 v23 = v58->evt_E;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6645 goto LABEL_33;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6646 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6647 LABEL_41:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6648 v15 = "";
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6649 goto LABEL_49;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6650 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6651 v15 = pGlobalTXT_LocalizationStrings[122];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6652 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6653 LABEL_49:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6654 strcpy(v16->pButtonName, v15);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6655 ++v56;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6656 if ( v56 >= v52.pStartingPosActiveItem + v52.pNumPresenceButton )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6657 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6658 v14 = pDialogueWindow;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6659 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6660 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6661 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6662 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6663 v34 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6664 v54 = TargetColor(0xFFu, 0xFFu, 0xFFu);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6665 v35 = TargetColor(0xE1u, 0xCDu, 0x23u);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6666 v36 = v14->pStartingPosActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6667 v55 = v35;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6668 for ( i = v36 + v14->pNumPresenceButton; (signed int)v36 < (signed int)i; i = pDialogueWindow->pNumPresenceButton
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6669 + pDialogueWindow->pStartingPosActiveItem )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6670 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6671 v37 = v14->GetControl(v36);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6672 v38 = pFontArrus->CalcTextHeight(v37->pButtonName, &v52, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6673 v14 = pDialogueWindow;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6674 v34 += v38;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6675 ++v36;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6676 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6677 v39 = v14->pNumPresenceButton;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6678 if ( v39 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6679 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6680 v58 = (NPCData *)((174 - v34) / v39);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6681 if ( (signed int)v58 > 32 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6682 v58 = (NPCData *)32;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6683 pInString = (char *)2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6684 v40 = (174 - (signed int)v58 * v39 - v34) / 2 - (signed int)v58 / 2 + 138;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6685 v56 = v14->pStartingPosActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6686 i = v56;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6687 if ( (signed int)i < (signed int)(i + v39) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6688 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6689 while ( 1 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6690 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6691 v41 = v14->GetControl(i);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6692 v42 = v41;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6693 v43 = v41->pButtonName;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6694 v41->uY = (unsigned int)((char *)v58 + v40);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6695 v44 = pFontArrus->CalcTextHeight(v41->pButtonName, &v52, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6696 v45 = v42->uY;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6697 v42->uHeight = v44;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6698 v40 = v45 + v44 - 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6699 v42->uW = v40;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6700 v46 = v55;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6701 if ( (char *)pDialogueWindow->pCurrentPosActiveItem != pInString )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6702 v46 = v54;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6703 v52.DrawTitleText(pFontArrus, 0, v45, v46, v43, 3u);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6704 v14 = pDialogueWindow;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6705 ++pInString;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6706 ++v56;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6707 i = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6708 if ( v56 >= (signed int)i )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6709 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6710 i = v56;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6711 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6712 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6713 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6714 if ( current_npc_text )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6715 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6716 w.uFrameWidth = 458;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6717 w.uFrameZ = 457;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6718 v47 = pFontArrus;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6719 v48 = pFontArrus->CalcTextHeight(current_npc_text, &w, 13, 0) + 7;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6720 if ( 352 - v48 < 8 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6721 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6722 v47 = pFontCreate;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6723 v48 = pFontCreate->CalcTextHeight(current_npc_text, &w, 13, 0) + 7;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6724 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6725 pRenderer->_4A6A68(8, 352 - v48,
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6726 pIcons_LOD->GetTexture(uTextureID_Leather),
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6727 pIcons_LOD->GetTexture(uTextureID_Leather)->uTextureHeight - v48);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6728 pRenderer->DrawTextureIndexed(8u, 347 - v48, pTexture_591428);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6729 v49 = FitTextInAWindow(current_npc_text, v47, &w, 0xDu, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6730 a1.DrawText(v47, 13, 354 - v48, 0, v49, 0, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6731 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6732 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6733 //----- (004BDB56) --------------------------------------------------------
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6734 void __cdecl UIShop_Buy_Identify_Repair()
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6735 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6736 int v8; // eax@15
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6737 unsigned int pItemID; // esi@20
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6738 ItemGen *item; // esi@21
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6739 unsigned int v15; // eax@33
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6740 POINT *pCursorPos; // esi@37
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6741 int v18; // ecx@37
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6742 float pPriceMultiplier; // ST1C_4@38
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6743 int taken_item; // eax@40
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6744 ItemGen *bought_item; // esi@51
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6745 int party_reputation; // eax@55
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6746 int v39; // eax@63
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6747 int v42; // esi@74
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6748 signed int v43; // ebx@74
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6749 unsigned __int16 *pSkill; // esi@77
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6750 int v55; // [sp+0h] [bp-B4h]@26
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6751 POINT cursor; // [sp+40h] [bp-74h]@37
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6752 int a6; // [sp+98h] [bp-1Ch]@57
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6753 int a3; // [sp+9Ch] [bp-18h]@53
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6754 unsigned int uNumSeconds; // [sp+A4h] [bp-10h]@53
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6755 unsigned int v79; // [sp+A8h] [bp-Ch]@9
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6756 int uPriceItemService; // [sp+ACh] [bp-8h]@12
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6757
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6758 if ( pCurrentScreen == SCREEN_E )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6759 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6760 OnInventoryLeftClick();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6761 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6762 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6763 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6764 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6765 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6766 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6767 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6768
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6769 switch(dialog_menu_id)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6770 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6771 case HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6772 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6773 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6774 OnInventoryLeftClick();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6775 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6776 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6777 case HOUSE_DIALOGUE_GUILD_BUY_BOOKS:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6778 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6779 pCursorPos = pMouse->GetCursorPos(&cursor);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6780 v18 = pRenderer->pActiveZBuffer[pCursorPos->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&cursor)->y]] & 0xFFFF;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6781 if ( !v18 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6782 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6783 bought_item = (ItemGen *)(&pParty->pPlayers[1].uExpressionTimeLength + 18 * (v18 + 12 * (int)window_SpeakInHouse->ptr_1C));
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6784 pPriceMultiplier = p2DEvents[(signed int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6785 uPriceItemService = pPlayers[uActiveCharacter]->GetBuyingPrice(bought_item->GetValue(), pPriceMultiplier);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6786 GetAsyncKeyState(VK_CONTROL);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6787 if ( pParty->uNumGold < uPriceItemService )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6788 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6789 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, (HouseSoundID)2);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6790 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6791 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6792 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6793 taken_item = pPlayers[uActiveCharacter]->AddItem(-1, bought_item->uItemID);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6794 if ( taken_item )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6795 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6796 bought_item->SetIdentified();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6797 memcpy(&pPlayers[uActiveCharacter]->pInventoryItems[taken_item - 1], bought_item, 0x24u);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6798 dword_F8B1E4 = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6799 Party::TakeGold(uPriceItemService);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6800 viewparams->bRedrawGameUI = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6801 bought_item->Reset();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6802 pRenderer->ClearZBuffer(0, 479);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6803 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)SPEECH_75, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6804 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6805 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6806 pPlayers[uActiveCharacter]->PlaySound(SPEECH_NoRoom, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6807 ShowStatusBarString(pGlobalTXT_LocalizationStrings[563], 5); // "Pack is Full!"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6808 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6809 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6810 case HOUSE_DIALOGUE_SHOP_SELL:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6811 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6812 v79 = ((pMouse->GetCursorPos(&cursor)->x - 14) >> 5) + 14 * ((pMouse->GetCursorPos(&cursor)->y - 17) >> 5);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6813 if ( pMouse->GetCursorPos(&cursor)->x <= 13
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6814 || pMouse->GetCursorPos(&cursor)->x >= 462
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6815 || (v15 = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v79), !v15) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6816 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6817 if ( MerchandiseTest(&pPlayers[uActiveCharacter]->pInventoryItems[v15 - 1], (int)window_SpeakInHouse->ptr_1C) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6818 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6819 dword_F8B1E4 = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6820 pPlayers[uActiveCharacter]->SalesProcess(v79, v15 - 1, (int)window_SpeakInHouse->ptr_1C);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6821 viewparams->bRedrawGameUI = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6822 pRenderer->ClearZBuffer(0, 479);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6823 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)77, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6824 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6825 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6826 pPlayers[uActiveCharacter]->PlaySound(SPEECH_79, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6827 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6828 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6829 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6830 case HOUSE_DIALOGUE_SHOP_IDENTIFY:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6831 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6832 pMouse->GetCursorPos(&cursor);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6833 v79 = ((cursor.x - 14) >> 5) + 14 * ((cursor.y - 17) >> 5);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6834 if (cursor.x > 13 && cursor.x < 462)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6835 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6836 pItemID = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v79);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6837 if ( pItemID )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6838 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6839 uPriceItemService = pPlayers[uActiveCharacter]->GetPriceIdentification(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6840 item = &pPlayers[uActiveCharacter]->pInventoryItems[pItemID - 1];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6841 if ( !(item->uAttributes & 1) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6842 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6843 if ( MerchandiseTest(item, (int)window_SpeakInHouse->ptr_1C) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6844 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6845 if ( pParty->uNumGold >= uPriceItemService )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6846 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6847 dword_F8B1E4 = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6848 Party::TakeGold(uPriceItemService);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6849 item->uAttributes |= 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6850 pPlayers[uActiveCharacter]->PlaySound(SPEECH_73, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6851 ShowStatusBarString(pGlobalTXT_LocalizationStrings[569], 2);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6852 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6853 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6854 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, (HouseSoundID)2);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6855 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6856 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6857 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6858 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)79, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6859 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6860 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6861 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)76, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6862 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6863 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6864 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6865 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6866 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6867 case HOUSE_DIALOGUE_SHOP_REPAIR:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6868 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6869 v79 = ((pMouse->GetCursorPos(&cursor)->x - 14) >> 5) + 14 * ((pMouse->GetCursorPos(&cursor)->y - 17) >> 5);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6870 if ( pMouse->GetCursorPos(&cursor)->x > 13 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6871 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6872 if ( pMouse->GetCursorPos(&cursor)->x < 462 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6873 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6874 pItemID = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v79);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6875 if ( pItemID )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6876 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6877 item = &pPlayers[uActiveCharacter]->pInventoryItems[pItemID - 1];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6878 pPriceMultiplier = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6879 auto _v = (ItemGen *)&pPlayers[uActiveCharacter]->pInventoryItems[pItemID - 1];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6880 uPriceItemService = pPlayers[uActiveCharacter]->GetPriceRepair(_v->GetValue(), pPriceMultiplier);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6881 if ( item->uAttributes & 2 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6882 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6883 if ( MerchandiseTest(item, (int)window_SpeakInHouse->ptr_1C) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6884 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6885 if ( pParty->uNumGold >= uPriceItemService )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6886 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6887 dword_F8B1E4 = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6888 Party::TakeGold(uPriceItemService);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6889 v8 = item->uAttributes;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6890 LOBYTE(v8) = v8 & 0xFD;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6891 item->uAttributes = v8 | 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6892 pPlayers[uActiveCharacter]->PlaySound(SPEECH_74, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6893 ShowStatusBarString(pGlobalTXT_LocalizationStrings[570], 2);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6894 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6895 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6896 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, (HouseSoundID)2);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6897 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6898 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6899 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6900 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)79, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6901 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6902 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6903 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)76, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6904 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6905 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6906 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6907 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6908 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6909 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6910 case HOUSE_DIALOGUE_SHOP_BUY_STANDARD:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6911 case HOUSE_DIALOGUE_SHOP_BUY_SPECIAL:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6912 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6913 pCursorPos = pMouse->GetCursorPos(&cursor);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6914 v18 = pRenderer->pActiveZBuffer[pCursorPos->x + pSRZBufferLineOffsets[pCursorPos->y]] & 0xFFFF;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6915 if ( !v18 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6916 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6917 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6918 bought_item = (ItemGen *)&pParty->StandartItemsInShops[(int)window_SpeakInHouse->ptr_1C][v18 - 1];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6919 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6920 bought_item = &pParty->SpecialItemsInShops[(int)window_SpeakInHouse->ptr_1C][v18 - 1];//(ItemGen *)&pParty->field_C59C[v31 + 724];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6921 uPriceItemService = pPlayers[uActiveCharacter]->GetBuyingPrice(bought_item->GetValue(), p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6922 uNumSeconds = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6923 a3 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6924 if ( pMapStats->GetMapInfo(pCurrentMapName.data()) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6925 a3 = pMapStats->pInfos[pMapStats->GetMapInfo(pCurrentMapName.data())]._steal_perm;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6926 party_reputation = GetPartyReputation();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6927 if (pPlayers[uActiveCharacter]->CanSteal())
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6928 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6929 if ( GetAsyncKeyState(VK_CONTROL) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6930 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6931 uNumSeconds = pPlayers[uActiveCharacter]->StealFromShop(bought_item, a3, party_reputation, 0, &a6);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6932 if ( !uNumSeconds )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6933 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6934 sub_4B1447_party_fine((int)window_SpeakInHouse->ptr_1C, 0, a6);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6935 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6936 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6937 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6938 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6939 if ( pParty->uNumGold < uPriceItemService )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6940 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6941 if ( uNumSeconds != 2 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6942 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6943 if ( uNumSeconds != 1 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6944 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6945 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, (HouseSoundID)2);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6946 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2);// "You don't have enough gold"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6947 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6948 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6949 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6950 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6951 v39 = pPlayers[uActiveCharacter]->AddItem(-1, bought_item->uItemID);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6952 if ( v39 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6953 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6954 bought_item->SetIdentified();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6955 memcpy(&pPlayers[uActiveCharacter]->pInventoryItems[v39 - 1], bought_item, sizeof(ItemGen));
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6956 if ( pPlayers[uActiveCharacter]->CanSteal() )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6957 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6958 if ( GetAsyncKeyState(VK_CONTROL) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6959 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6960 if ( uNumSeconds == 1 || uNumSeconds == 2 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6961 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6962 pPlayers[uActiveCharacter]->pInventoryItems[v39 - 1].SetStolen();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6963 sub_4B1447_party_fine((int)window_SpeakInHouse->ptr_1C, uNumSeconds, a6);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6964 viewparams->bRedrawGameUI = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6965 bought_item->Reset();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6966 pRenderer->ClearZBuffer(0, 479);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6967 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)SPEECH_75, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6968 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6969 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6970 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6971 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6972 dword_F8B1E4 = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6973 Party::TakeGold(uPriceItemService);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6974 viewparams->bRedrawGameUI = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6975 bought_item->Reset();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6976 pRenderer->ClearZBuffer(0, 479);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6977 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)SPEECH_75, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6978 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6979 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6980 pPlayers[uActiveCharacter]->PlaySound(SPEECH_NoRoom, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6981 ShowStatusBarString(pGlobalTXT_LocalizationStrings[563], 2); // "Pack is Full!"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6982 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6983 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6984 default:// if click video screen in shop
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6985 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6986 __debugbreak(); // please do record these dialogue ids to the HOUSE_DIALOGUE_MENU enum
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6987 if( dialog_menu_id >= 36 && dialog_menu_id <= 72 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6988 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6989 v42 = dialog_menu_id - 36;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6990 //v43 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)ptr_507BC0->ptr_1C] * 500.0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6991 v43 = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6992 uPriceItemService = v43 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6993 if ( uPriceItemService < v43 / 3 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6994 uPriceItemService = v43 / 3;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6995 if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][v42] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6996 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6997 pSkill = &pPlayers[uActiveCharacter]->pActiveSkills[v42];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6998 if ( !*pSkill )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
6999 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7000 if ( pParty->uNumGold < uPriceItemService )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7001 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7002 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2);// "You don't have enough gold"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7003 if ( in_current_building_type == BildingType_Training )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7004 v55 = 4;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7005 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7006 v55 = 2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7007 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, (HouseSoundID)v55);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7008 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7009 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7010 Party::TakeGold(uPriceItemService);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7011 dword_F8B1E4 = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7012 *pSkill = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7013 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)78, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7014 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7015 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7016 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7017 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7018 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7019 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7020 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7021 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7022 //----- (004BC8D5) --------------------------------------------------------
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7023 void SpellBookGenerator()//for GuildDialogs
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7024 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7025 int pItemNum; // esi@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7026 int v4; // esi@7
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7027
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7028 for( int i = 0; i < 12; ++i )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7029 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7030 if ( p2DEvents[window_SpeakInHouse->par1C - 1].uType >= 5 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7031 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7032 if ( p2DEvents[window_SpeakInHouse->par1C - 1].uType <= 13 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7033 pItemNum = rand() % word_4F0F30[(signed int)window_SpeakInHouse->par1C - 139] + 11 * p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType + 345;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7034 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7035 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7036 if ( p2DEvents[window_SpeakInHouse->par1C - 1].uType == 14 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7037 v4 = rand() % 4;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7038 else if ( p2DEvents[window_SpeakInHouse->par1C - 1].uType == 15 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7039 v4 = rand() % 3 + 4;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7040 else if ( p2DEvents[window_SpeakInHouse->par1C - 1].uType == 16 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7041 v4 = rand() % 2 + 7;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7042 if( p2DEvents[window_SpeakInHouse->par1C - 1].uType <= 16 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7043 pItemNum = rand() % word_4F0F30[(signed int)window_SpeakInHouse->par1C - 139] + 11 * v4 + 400;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7044 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7045 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7046 if ( pItemNum == 487 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7047 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7048 if ( !(unsigned __int16)_449B57_test_bit(pParty->_quest_bits, 239) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7049 pItemNum = 486;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7050 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7051 ItemGen * item_spellbook = &pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][i];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7052 item_spellbook->Reset();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7053 pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][i].uItemID = pItemNum;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7054 pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][i].Identified();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7055 ItemsInShopTexture[i] = pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[pItemNum].pIconName, TEXTURE_16BIT_PALETTE);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7056 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7057 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
7058 }