annotate UI/UIHouses.cpp @ 2374:802460e60eee

add UIArena.cpp and UIArena.h and other
author Ritor1
date Sun, 01 Jun 2014 18:37:09 +0600
parents bddcaf5d5db2
children 6a7309a847ea
rev   line source
2253
aff7a7b072b7 adding _CRT_SECURE_NO_WARNINGS to get rid of a few hundrer annoying warnings + adding count parameter to swprintf
Grumpy7
parents: 2234
diff changeset
1 #define _CRT_SECURE_NO_WARNINGS
2350
7c10dfb6d802 Finishing moving all known UI functions to their appropriate headers
Grumpy7
parents: 2349
diff changeset
2 #include "UIGuilds.h"
7c10dfb6d802 Finishing moving all known UI functions to their appropriate headers
Grumpy7
parents: 2349
diff changeset
3 #include "UIPartyCreation.h"
7c10dfb6d802 Finishing moving all known UI functions to their appropriate headers
Grumpy7
parents: 2349
diff changeset
4 #include "UIShops.h"
2349
7ebc07cd6c53 Adding GUIButton.h
Grumpy7
parents: 2346
diff changeset
5 #include "..\GUIButton.h"
2336
d6887ee81068 header file include cleanup
Grumpy7
parents: 2335
diff changeset
6 #include "..\mm7_unsorted_subs.h"
2343
5d263539bbec Moving functions from unsorted_subs.h pt5
Grumpy7
parents: 2336
diff changeset
7 #include "..\SaveLoad.h"
1299
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
8 #include "..\Texture.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
9 #include "..\mm7_data.h"
2336
d6887ee81068 header file include cleanup
Grumpy7
parents: 2335
diff changeset
10 #include "..\ErrorHandling.h"
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
11 #include "UIHouses.h"
1299
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
12 #include "..\Party.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
13 #include "..\texts.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
14 #include "..\Events.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
15 #include "..\Arcomage.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
16 #include "..\LOD.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
17 #include "..\Mouse.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
18 #include "..\GUIWindow.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
19 #include "..\GUIFont.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
20 #include "..\Overlays.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
21 #include "..\Outdoor.h"
1638
ccde94f02b75 class IndoorCamera split into BLVRenderParams and ODMRenderParams
Nomad
parents: 1630
diff changeset
22 #include "..\Outdoor_stuff.h"
1299
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
23 #include "..\AudioPlayer.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
24 #include "..\VideoPlayer.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
25 #include "..\Monsters.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
26 #include "..\Viewport.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
27 #include "..\Keyboard.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
28 #include "..\MapInfo.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
29 #include "..\Log.h"
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
30 #include "..\Game.h"
2343
5d263539bbec Moving functions from unsorted_subs.h pt5
Grumpy7
parents: 2336
diff changeset
31 #include "..\CastSpellInfo.h"
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
32
2374
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
33 #include "../Level/Decoration.h"
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
34
1299
8c2f689b5f0b folder UI
Ritor1
parents: 1298
diff changeset
35 #include "..\stru159.h"
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
36 int uHouse_ExitPic; // weak
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
37
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
38 int dword_591080; // weak
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
39
1411
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
40 BuildingType in_current_building_type; // 00F8B198
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
41 HOUSE_DIALOGUE_MENU dialog_menu_id; // 00F8B19C
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
42
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
43 #pragma pack(push, 1)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
44 struct stru365_travel_info
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
45 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
46 unsigned char uMapInfoID;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
47 unsigned char pSchedule[7];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
48 unsigned int uTravelTime;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
49 int arrival_x;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
50 int arrival_y;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
51 int arrival_z;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
52 int arrival_rot_y;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
53 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
54 };
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
55 #pragma pack(pop)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
56 stru365_travel_info transport_schedule[35] = // 004F09B0
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
57 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
58 {MAP_STEADWICK, {1, 0, 1, 0, 1, 0, 0}, 2, -18048, 4636, 833, 1536, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
59 {MAP_PIERPONT, {0, 1, 0, 1, 0, 1, 0}, 2, -2527, -6773, 1153, 896, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
60 {MAP_TATALIA, {1, 0, 1, 0, 1, 0, 0}, 2, 4730, -10580, 320, 1024, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
61 {MAP_HARMONDALE, {0, 1, 0, 1, 0, 1, 0}, 2, -5692, 11137, 1, 1024, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
62 {MAP_DEYJA, {1, 0, 0, 1, 0, 0, 0}, 3, 7227, -16007, 2625, 640, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
63 {MAP_BRAKADA_DESERT, {0, 0, 1, 0, 0, 1, 0}, 3, 8923, 17191, 1, 512, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
64 {MAP_AVLEE, {1, 0, 1, 0, 1, 0, 0}, 3, 17059, 12331, 512, 1152, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
65 {MAP_DEYJA, {0, 1, 0, 0, 1, 0, 1}, 2, 7227, -16007, 2625, 640, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
66 {MAP_HARMONDALE, {0, 1, 0, 1, 0, 1, 0}, 2, -5692, 11137, 1, 1024, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
67 {MAP_STEADWICK, {1, 0, 1, 0, 1, 0, 0}, 3, -18048, 4636, 833, 1536, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
68 {MAP_PIERPONT, {0, 1, 0, 1, 0, 1, 0}, 2, -2527, -6773, 1153, 896, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
69 {MAP_STEADWICK, {1, 0, 1, 0, 1, 0, 1}, 3, -18048, 4636, 833, 1536, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
70 {MAP_HARMONDALE, {0, 1, 0, 0, 0, 1, 0}, 5, -5692, 11137, 1, 1024, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
71 {MAP_STEADWICK, {0, 1, 0, 1, 0, 1, 0}, 2, -18048, 4636, 833, 1536, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
72 {MAP_PIERPONT, {0, 1, 0, 1, 0, 1, 0}, 3, -2527, -16007, 1153, 896, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
73 {MAP_DEYJA, {0, 0, 1, 0, 0, 0, 1}, 5, 7227, -16007, 2625, 640, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
74 {MAP_TATALIA, {0, 1, 0, 1, 0, 1, 0}, 2, -2183, -6941, 97, 0, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
75 {MAP_AVLEE, {1, 0, 0, 0, 1, 0, 0}, 4, 7913, 9476, 193, 0, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
76 {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
77 {MAP_BRAKADA_DESERT, {0, 0, 1, 0, 0, 0, 0}, 6, 19171, -19722, 193, 1024, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
78 {MAP_AVLEE, {0, 1, 0, 1, 0, 1, 0}, 3, 7913, 9476, 193, 0, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
79 {MAP_BRAKADA_DESERT, {1, 0, 1, 0, 0, 0, 0}, 6, 19171, -19722, 193, 1024, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
80 {MAP_TATALIA, {1, 0, 1, 0, 1, 0, 0}, 4, -2183, -6941, 97, 0, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
81 {MAP_PIERPONT, {0, 0, 0, 0, 0, 1, 0}, 6, -709, -14087, 193, 1024, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
82 {MAP_STEADWICK, {0, 0, 0, 0, 0, 0, 1}, 6, -10471, 13497, 193, 1536, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
83 {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
84 {MAP_BRAKADA_DESERT, {0, 1, 0, 1, 0, 0, 0}, 1, 19171, -19722, 193, 1024, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
85 {MAP_STEADWICK, {0, 1, 0, 1, 0, 1, 0}, 2, -10471, 13497, 193, 1536, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
86 {MAP_BRAKADA_DESERT, {1, 0, 1, 0, 0, 0, 0}, 4, 19171, -19722, 193, 1024, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
87 {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
88 {MAP_AVLEE, {0, 0, 0, 0, 1, 0, 0}, 5, 7913, 9476, 193, 0, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
89 {MAP_STEADWICK, {0, 1, 0, 0, 0, 1, 0}, 4, -10471, 13497, 193, 1536, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
90 {MAP_PIERPONT, {1, 0, 1, 0, 1, 0, 0}, 3, -709, -14087, 193, 1024, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
91 {MAP_TATALIA, {0, 0, 0, 1, 0, 0, 0}, 5, -2183, -6941, 97, 0, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
92 {MAP_ARENA, {0, 0, 0, 0, 0, 0, 1}, 4, 3844, 2906, 193, 512, 0}
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
93 };
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
94
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
95 unsigned char transport_routes[20][4] =
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
96 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
97 { 0, 1, 1, 34}, // HOUSE_STABLES_HARMONDALE
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
98 { 2, 3, 4, 5}, // HOUSE_STABLES_STEADWICK
1589
Ritor1
parents: 1588
diff changeset
99 { 6, 7, 8, 8}, // HOUSE_STABLES_TULAREAN_FOREST
Ritor1
parents: 1588
diff changeset
100 { 9, 10, 10, 10}, // HOUSE_STABLES_DEYJA
1610
Ritor1
parents: 1609
diff changeset
101 { 11, 11, 12, 12}, // HOUSE_STABLES_BRACADA_DESERT
Ritor1
parents: 1609
diff changeset
102 { 13, 13, 13, 13}, // HOUSE_STABLES_TATALIA
Ritor1
parents: 1609
diff changeset
103 { 14, 14, 15, 15}, // HOUSE_STABLES_AVLEE
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
104 {255, 255, 255, 255}, // HOUSE_STABLES_61
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
105 {255, 255, 255, 255}, // HOUSE_STABLES_62
1610
Ritor1
parents: 1609
diff changeset
106 {255, 255, 255, 255}, // HOUSE_BOATS_EMERALD_ISLE
Ritor1
parents: 1609
diff changeset
107 { 16, 17, 18, 19}, // HOUSE_BOATS_ERATHIA
Ritor1
parents: 1609
diff changeset
108 { 18, 20, 21, 21}, // HOUSE_BOATS_TULAREAN_FOREST
Ritor1
parents: 1609
diff changeset
109 { 22, 23, 24, 25}, // HOUSE_BOATS_BRACADA_DESERT
Ritor1
parents: 1609
diff changeset
110 { 22, 22, 23, 23}, // HOUSE_BOATS_EVENMORN_ISLAND
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
111 {255, 255, 255, 255}, // HOUSE_BOATS_68
1610
Ritor1
parents: 1609
diff changeset
112 { 27, 28, 29, 30}, // HOUSE_BOATS_TATALIA
Ritor1
parents: 1609
diff changeset
113 { 31, 32, 33, 33}, // HOUSE_BOATS_AVLEE
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
114 { 24, 24, 24, 24}, // HOUSE_BOATS_71
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
115 {255, 255, 255, 255}, // HOUSE_BOATS_72
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
116 {255, 255, 255, 255} // HOUSE_BOATS_73
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
117 };
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
118
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
119 std::array<const stru159, 196> pAnimatedRooms = //0x4E5F70
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
120 {{
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
121 {"", 0x4, 0x1F4, 0, 0, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
122 {"Human Armor01", 0x20, 0x2C0, 2, 58, 0},
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
123 {"Necromancer Armor01", 0x20, 0x2D7, 2, 70, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
124 {"Dwarven Armor01", 0x20, 0x2EE, 2, 5, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
125 {"Wizard Armor", 0x20, 0x3BD, 2, 19, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
126 {"Warlock Armor", 0x20, 0x2D6, 2, 35, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
127 {"Elf Armor", 0x20, 0x2BC, 2, 79, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
128 {"Human Alchemisht01", 0xE, 0x2BE, 4, 95, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
129 {"Necromancer Alchemist01", 0xE, 0x2D6, 4, 69, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
130 {"Dwarven Achemist01", 0xE, 0x387, 4, 4, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
131 {"Wizard Alchemist", 0xE, 0x232, 4, 25, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
132 {"Warlock Alchemist", 0xE, 0x2BE, 4, 42, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
133 {"Elf Alchemist", 0xE, 0x38A, 4, 84, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
134 {"Human Bank01", 0x6, 0x384, 22, 52, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
135 {"Necromancer Bank01", 0x6, 0x2D8, 22, 71, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
136 {"Dwarven Bank", 0x6, 0x2F3, 22, 6, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
137 {"Wizard Bank", 0x6, 0x3BA, 22, 20, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
138 {"Warlock Bank", 0x6, 0x39F, 22, 36, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
139 {"Elf Bank", 0x6, 0x2BC, 22, 71, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
140 {"Boat01", 0xF, 0x4C, 28, 53, 3 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
141 {"Boat01d", 0xF, 0x4C, 28, 53, 3 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
142 {"Human Magic Shop01", 0xA, 0x2C8, 3, 54, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
143 {"Necromancer Magic Shop01", 0xE, 0x2DC, 3, 66, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
144 {"Dwarven Magic Shop01", 0x2A, 0x2EF, 3, 91, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
145 {"Wizard Magic Shop", 0x1E, 0x2DF, 3, 15, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
146 {"Warlock Magic Shop", 0x7, 0x3B9, 3, 15, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
147 {"Elf Magic Shop", 0x24, 0x2CC, 3, 82, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
148 {"Human Stables01", 0x21, 0x31, 27, 48, 3 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
149 {"Necromancer Stables", 0x21, 0x2DD, 27, 67, 3 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
150 {"", 0x21, 0x2F0, 27, 91, 3 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
151 {"Wizard Stables", 0x21, 0x3BA, 27, 16, 3 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
152 {"Warlock Stables", 0x21, 0x181, 27, 77, 3 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
153 {"Elf Stables", 0x21, 0x195, 27, 77, 3 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
154 {"Human Tavern01", 0xD, 0x2C2, 21, 49, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
155 {"Necromancer Tavern01", 0xD, 0x3B0, 21, 57, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
156 {"Dwarven Tavern01", 0xD, 0x2FE, 21, 94, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
157 {"Wizard Tavern", 0xD, 0x3BB, 21, 17, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
158 {"Warlock Tavern", 0xD, 0x3A8, 21, 33, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
159 {"Elf Tavern", 0xD, 0x2CD, 21, 78, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
160 {"Human Temple01", 0x24, 0x2DB, 23, 50, 3 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
161 {"Necromancer Temple", 0x24, 0x2DF, 23, 60, 3 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
162 {"Dwarven Temple01", 0x24, 0x2F1, 23, 86, 3 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
163 {"Wizard Temple", 0x24, 0x2E0, 23, 10, 3 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
164 {"Warlock Temple", 0x24, 0x3A4, 23, 27, 3 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
165 {"Elf Temple", 0x24, 0x2CE, 23, 72, 3 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
166 {"Human Town Hall", 0x10, 0x39C, 17, 14, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
167 {"Necromancer Town Hall01", 0x10, 0x3A4, 17, 61, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
168 {"Dwarven Town Hall", 0x10, 0x2DB, 17, 88, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
169 {"Wizard Town Hall", 0x10, 0x3BD, 17, 11, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
170 {"Warlock Town Hall", 0x10, 0x2DB, 17, 28, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
171 {"Elf Town Hall", 0x10, 0x27A, 17, 73, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
172 {"Human Training Ground01", 0x18, 0x2C7, 30, 44, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
173 {"Necromancer Training Ground", 0x18, 0x3AD, 30, 62, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
174 {"Dwarven Training Ground", 0x18, 0x2F2, 30, 89, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
175 {"Wizard Training Ground", 0x18, 0x3A3, 30, 12, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
176 {"Warlock Training Ground", 0x18, 0x3A6, 30, 29, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
177 {"Elf Training Ground", 0x18, 0x19F, 30, 74, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
178 {"Human Weapon Smith01", 0x16, 0x2C1, 1, 45, 4 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
179 {"Necromancer Weapon Smith01", 0x16, 0x2D9, 1, 63, 4 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
180 {"Dwarven Weapon Smith01", 0x16, 0x2EE, 1, 82, 4 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
181 {"Wizard Weapon Smith", 0x16, 0x2D5, 1, 13, 4 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
182 {"Warlock Weapon Smith", 0x16, 0x2D7, 1, 23, 4 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
183 {"Elf Weapon Smith", 0x16, 0x2CA, 1, 75, 4 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
184 {"Air Guild", 0x1D, 0xA4, 6, 1, 3 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
185 {"Body Guild", 0x19, 0x3BF, 11, 2, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
186 {"DarkGuild", 0x19, 0x2D1, 13, 3, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
187 {"EarthGuild", 0x19, 0x2CB, 8, 83, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
188 {"Fire Guild", 0x1C, 0x2BF, 5, 56, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
189 {"Light Guild", 0x1C, 0x2D5, 12, 46, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
190 {"Mind Guild", 0x1C, 0xE5, 10, 40, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
191 {"Spirit Guild", 0x1C, 0x2D2, 9, 41, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
192 {"Water Guild", 0x1B, 0x2D3, 7, 24, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
193 {"Lord And Judge Out01", 1, 0, 29, 39, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
194 {"Human Poor House 1", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
195 {"Human Poor House 2", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
196 {"Human Poor House 3", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
197 {"Human Medium House 1", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
198 {"Human Medium House 2", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
199 {"Human Medium House 3", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
200 {"Human Rich House 1", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
201 {"Human Rich House 2", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
202 {"Human Rich House 3", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
203 {"Elven Poor House 1", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
204 {"Elven Poor House 2", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
205 {"Elven Poor House 3", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
206 {"Elven Medium House 1", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
207 {"Elven Medium House 2", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
208 {"Elven Medium House 3", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
209 {"Elven Rich House 1", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
210 {"Elven Rich House 2", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
211 {"Elven Rich House 3", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
212 {"Dwarven Poor House 1", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
213 {"Dwarven Poor House 2", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
214 {"Dwarven Poor House 3", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
215 {"Dwarven Medium House 1", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
216 {"Dwarven Medium house 2", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
217 {"Dwarven Medium House 3", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
218 {"Dwarven Rich House 1", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
219 {"Dwarven Rich House 2", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
220 {"Dwarven Rich House 3", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
221 {"Wizard Poor House 1", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
222 {"Wizard Poor House 2", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
223 {"Wizard Poor House 3", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
224 {"Wizard Medium House 1", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
225 {"Wizard Medium House 2", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
226 {"Wizard Mdeium House 3", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
227 {"Wizard Rich House 1", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
228 {"Wizard Rich House 2", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
229 {"Wizard Rich House 3", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
230 {"Necromancer Poor House 1", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
231 {"Necromancer Poor House 2", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
232 {"Necromancer Poor House 3", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
233 {"Necromancer Medium House 1", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
234 {"Necromancer Medium House 2", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
235 {"Necromancer Mdeium House 3", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
236 {"Necromancer Rich House 1", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
237 {"Necromancer Rich House 2", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
238 {"Necromancer Rich House 3", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
239 {"Warlock Poor House 1", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
240 {"Warlock Poor House 2", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
241 {"Warlock Poor House 3", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
242 {"Warlock Medium House 1", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
243 {"Warlock Medium House 2", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
244 {"Warlock Mdeium House 3", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
245 {"Warlock Rich House 1", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
246 {"Warlock Rich House 2", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
247 {"Warlock Rich House 3", 8, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
248 {"Out01 Temple of the Moon", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
249 {"Out01 Dragon Cave", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
250 {"Out02 Castle Harmondy", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
251 {"Out02 White Cliff Cave", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
252 {"Out03 Erathian Sewer", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
253 {"Out03 Fort Riverstride", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
254 {"Out03 Castle Gryphonheart", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
255 {"Out04 Elf Castle", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
256 {"Out04 Tularean Caves", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
257 {"Out04 Clanker's Laboratory", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
258 {"Out05 Hall of the Pit", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
259 {"Out05 Watchtower 6", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
260 {"Out06 School of Sorcery", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
261 {"Out06 Red Dwarf Mines", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
262 {"Out07 Castle Lambert", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
263 {"Out07 Walls of Mist", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
264 {"Out07 Temple of the Light", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
265 {"Out08 Evil Entrance", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
266 {"Out08 Breeding Zone", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
267 {"Out08 Temple of the Dark", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
268 {"Out09 Grand Temple of the Moon", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
269 {"Out09 Grand Tempple of the Sun", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
270 {"Out10 Thunderfist Mountain", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
271 {"Out10 The Maze", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
272 {"Out10 Connecting Tunnel Cave #1", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
273 {"", 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 {"Out11 Stone City", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
276 {"", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
277 {"Out12 Colony Zod", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
278 {"Out12 Connecting Tunnel Cave #1", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
279 {"", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
280 {"", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
281 {"Out13 Mercenary Guild", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
282 {"Out13 Tidewater Caverns", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
283 {"Out13 Wine Cellar", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
284 {"Out14 Titan's Stronghold", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
285 {"Out14 Temple Of Baa", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
286 {"Out14 Hall under the Hill", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
287 {"Out15 The Linclon", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
288 {"Jail", 0x24, 0, 31, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
289 {"Harmondale Throne Room", 0x24, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
290 {"Gryphonheart Throne Room", 0x24, 0, 20, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
291 {"Elf Castle Throne Room", 0x24, 0, 20, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
292 {"Wizard Castle Throne Room", 0x24, 0, 20, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
293 {"Necromancer Casstle Trone Room", 0x24, 0, 20, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
294 {"Master Thief", 0x24, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
295 {"Dwarven King", 0x24, 0, 20, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
296 {"Arms Master", 0x24, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
297 {"Warlock", 0x24, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
298 {"Lord Markam", 0x24, 0, 20, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
299 {"Arbiter Neutral Town", 0x24, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
300 {"Arbiter Good Town", 0x24, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
301 {"Arbiter Evil Town", 0x24, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
302 {"Necromancer Throne Room Empty", 0x24, 0, 20, 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 {"", 0x24, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
306 {"", 0x24, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
307 {"Boat01", 0xF, 0, 29, 53, 3 },
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, 28, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
310 {"", 0x24, 0, 28, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
311 {"", 0x24, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
312 {"Arbiter Room Neutral", 0x24, 0, 29, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
313 {"Out02 Castle Harmondy Abandoned", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
314 {"Human Temple02", 0x24, 0x3AB, 23, 27, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
315 {"Player Castle Good", 0x24, 0, 25, 0, 0 },
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
316 {"Player Castle Bad", 0x24, 0, 25, 0, 0}
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
317 }};
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
318
1393
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1313
diff changeset
319
1411
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
320
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
321 //----- (004B3A72) --------------------------------------------------------
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
322 void InitializaDialogueOptions_Tavern(BuildingType type)
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
323 {
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
324 int num_buttons; // esi@1
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
325
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
326 num_buttons = 0;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
327 if (type == BuildingType_Tavern)
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
328 {
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
329 num_buttons = 2;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
330 CreateButtonInColumn(0, 102);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
331 CreateButtonInColumn(1, 103);
1526
f47eab1a70d8 UIHouses.cpp cleaning(continue)
Ritor1
parents: 1496
diff changeset
332 if ( pParty->HasItem(651) ) //Arcomage Deck
1411
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
333 {
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
334 num_buttons = 3;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
335 CreateButtonInColumn(2, 104);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
336 }
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
337 }
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
338 pDialogueWindow->_41D08F_set_keyboard_control_group(num_buttons, 1, 0, 2);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
339 dword_F8B1E0 = pDialogueWindow->pNumPresenceButton;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
340 }
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
341 // F8B1E0: using guessed type int dword_F8B1E0;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
342
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
343 //----- (004B3AD4) --------------------------------------------------------
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
344 void InitializaDialogueOptions_Shops(BuildingType type)
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
345 {
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
346 switch (type)
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
347 {
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
348 case BuildingType_WeaponShop:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
349 case BuildingType_ArmorShop:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
350 case BuildingType_MagicShop:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
351 {
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
352 CreateButtonInColumn(0, 3);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
353 CreateButtonInColumn(1, 4);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
354 CreateButtonInColumn(2, 5);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
355 pDialogueWindow->_41D08F_set_keyboard_control_group(3, 1, 0, 2);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
356 }
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
357 break;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
358
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
359 case BuildingType_AlchemistShop:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
360 {
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
361 CreateButtonInColumn(0, 3);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
362 CreateButtonInColumn(1, 4);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
363 pDialogueWindow->_41D08F_set_keyboard_control_group(2, 1, 0, 2);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
364 }
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
365 break;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
366 }
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
367
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
368 dword_F8B1E0 = pDialogueWindow->pNumPresenceButton;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
369 }
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
370 // F8B1E0: using guessed type int dword_F8B1E0;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
371
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
372 //----- (004B3B42) --------------------------------------------------------
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
373 void InitializaDialogueOptions(BuildingType type)
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
374 {
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
375 switch (type)
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
376 {
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
377 case BuildingType_WeaponShop:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
378 case BuildingType_ArmorShop:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
379 case BuildingType_MagicShop:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
380 case BuildingType_AlchemistShop:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
381 {
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
382 CreateButtonInColumn(0, 2);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
383 CreateButtonInColumn(1, 95);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
384 CreateButtonInColumn(2, 94);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
385 CreateButtonInColumn(3, 96);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
386 pDialogueWindow->_41D08F_set_keyboard_control_group(4, 1, 0, 2);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
387 }
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
388 break;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
389
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
390 case BuildingType_FireGuild:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
391 {
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
392 CreateButtonInColumn(0, 18);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
393 CreateButtonInColumn(1, 48);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
394 CreateButtonInColumn(2, 72);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
395 pDialogueWindow->_41D08F_set_keyboard_control_group(3, 1, 0, 2);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
396 }
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
397 break;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
398
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
399 case BuildingType_AirGuild:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
400 {
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
401 CreateButtonInColumn(0, 18);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
402 CreateButtonInColumn(1, 49);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
403 CreateButtonInColumn(2, 72);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
404 pDialogueWindow->_41D08F_set_keyboard_control_group(3, 1, 0, 2);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
405 }
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
406 break;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
407
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
408 case BuildingType_WaterGuild:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
409 {
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
410 CreateButtonInColumn(0, 18);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
411 CreateButtonInColumn(1, 50);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
412 CreateButtonInColumn(2, 72);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
413 pDialogueWindow->_41D08F_set_keyboard_control_group(3, 1, 0, 2);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
414 }
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
415 break;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
416
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
417 case BuildingType_EarthGuild:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
418 {
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
419 CreateButtonInColumn(0, 18);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
420 CreateButtonInColumn(1, 51);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
421 CreateButtonInColumn(2, 72);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
422 pDialogueWindow->_41D08F_set_keyboard_control_group(3, 1, 0, 2);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
423 }
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
424 break;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
425
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
426 case BuildingType_SpiritGuild:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
427 {
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
428 CreateButtonInColumn(0, 18);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
429 CreateButtonInColumn(1, 52);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
430 CreateButtonInColumn(2, 61);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
431 pDialogueWindow->_41D08F_set_keyboard_control_group(3, 1, 0, 2);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
432 }
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
433 break;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
434
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
435 case BuildingType_MindGuild:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
436 {
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
437 CreateButtonInColumn(0, 18);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
438 CreateButtonInColumn(1, 53);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
439 CreateButtonInColumn(2, 61);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
440 pDialogueWindow->_41D08F_set_keyboard_control_group(3, 1, 0, 2);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
441 }
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
442 break;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
443
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
444 case BuildingType_BodyGuild:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
445 {
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
446 CreateButtonInColumn(0, 18);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
447 CreateButtonInColumn(1, 54);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
448 CreateButtonInColumn(2, 61);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
449 pDialogueWindow->_41D08F_set_keyboard_control_group(3, 1, 0, 2);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
450 }
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
451 break;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
452
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
453 case BuildingType_LightGuild:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
454 {
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
455 CreateButtonInColumn(0, 18);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
456 CreateButtonInColumn(1, 55);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
457 pDialogueWindow->_41D08F_set_keyboard_control_group(2, 1, 0, 2);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
458 }
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
459 break;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
460
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
461 case BuildingType_DarkGuild:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
462 {
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
463 CreateButtonInColumn(0, 18);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
464 CreateButtonInColumn(1, 56);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
465 pDialogueWindow->_41D08F_set_keyboard_control_group(2, 1, 0, 2);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
466 }
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
467 break;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
468
1644
dbd6f940f26c Fixed Celestia sky a bit.
Nomad
parents: 1640
diff changeset
469 case BuildingType_ElementalGuild:
1411
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
470 {
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
471 CreateButtonInColumn(0, 18);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
472 CreateButtonInColumn(1, 48);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
473 CreateButtonInColumn(2, 49);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
474 CreateButtonInColumn(3, 50);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
475 CreateButtonInColumn(4, 51);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
476 pDialogueWindow->_41D08F_set_keyboard_control_group(5, 1, 0, 2);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
477 }
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
478 break;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
479
1644
dbd6f940f26c Fixed Celestia sky a bit.
Nomad
parents: 1640
diff changeset
480 case BuildingType_SelfGuild:
1411
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
481 {
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
482 CreateButtonInColumn(0, 18);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
483 CreateButtonInColumn(1, 52);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
484 CreateButtonInColumn(2, 53);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
485 CreateButtonInColumn(3, 54);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
486 pDialogueWindow->_41D08F_set_keyboard_control_group(4, 1, 0, 2);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
487 }
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
488 break;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
489
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
490 case BuildingType_16:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
491 case BuildingType_TownHall:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
492 {
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
493 int num_buttons = 1;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
494 CreateButtonInColumn(0, 99);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
495
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
496 if (pParty->uFine)
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
497 {
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
498 num_buttons++;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
499 CreateButtonInColumn(1, 100);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
500 }
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
501
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
502 pDialogueWindow->_41D08F_set_keyboard_control_group(num_buttons, 1, 0, 2);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
503 }
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
504 break;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
505
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
506 case BuildingType_Bank:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
507 {
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
508 CreateButtonInColumn(0, 7);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
509 CreateButtonInColumn(1, 8);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
510 pDialogueWindow->_41D08F_set_keyboard_control_group(2, 1, 0, 2);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
511 }
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
512 break;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
513
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
514 case BuildingType_Temple:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
515 {
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
516 CreateButtonInColumn(0, 10);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
517 CreateButtonInColumn(1, 11);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
518 CreateButtonInColumn(2, 96);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
519 pDialogueWindow->_41D08F_set_keyboard_control_group(3, 1, 0, 2);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
520 }
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
521 break;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
522
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
523 case BuildingType_Stables:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
524 case BuildingType_Boats:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
525 {
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
526 CreateButtonInColumn(0, 105);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
527 CreateButtonInColumn(1, 106);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
528 CreateButtonInColumn(2, 107);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
529 CreateButtonInColumn(3, 108);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
530 pDialogueWindow->_41D08F_set_keyboard_control_group(4, 1, 0, 2);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
531 }
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
532 break;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
533
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
534 case BuildingType_Training:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
535 {
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
536 CreateButtonInColumn(0, 17);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
537 CreateButtonInColumn(1, 96);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
538 pDialogueWindow->_41D08F_set_keyboard_control_group(2, 1, 0, 2);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
539 }
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
540 break;
1429
c7489dd19f88 BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents: 1411
diff changeset
541
c7489dd19f88 BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents: 1411
diff changeset
542 case BuildingType_Tavern:
c7489dd19f88 BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents: 1411
diff changeset
543 {
c7489dd19f88 BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents: 1411
diff changeset
544 CreateButtonInColumn(0, 0xFu);
c7489dd19f88 BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents: 1411
diff changeset
545 CreateButtonInColumn(1, 0x10u);
c7489dd19f88 BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents: 1411
diff changeset
546 CreateButtonInColumn(2, 0x60u);
c7489dd19f88 BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents: 1411
diff changeset
547 if ( (signed int)window_SpeakInHouse->ptr_1C < 108 || (signed int)window_SpeakInHouse->ptr_1C > 120 )
c7489dd19f88 BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents: 1411
diff changeset
548 {
c7489dd19f88 BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents: 1411
diff changeset
549 pDialogueWindow->_41D08F_set_keyboard_control_group(3, 1, 0, 2);
c7489dd19f88 BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents: 1411
diff changeset
550 break;
c7489dd19f88 BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents: 1411
diff changeset
551 }
c7489dd19f88 BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents: 1411
diff changeset
552 CreateButtonInColumn(3, 101);
c7489dd19f88 BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents: 1411
diff changeset
553 pDialogueWindow->_41D08F_set_keyboard_control_group(4, 1, 0, 2);
c7489dd19f88 BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents: 1411
diff changeset
554 }
c7489dd19f88 BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents: 1411
diff changeset
555 break;
c7489dd19f88 BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents: 1411
diff changeset
556
1411
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
557 case BuildingType_18:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
558 case BuildingType_19:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
559 case BuildingType_Throne_Room:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
560 case BuildingType_24:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
561 case BuildingType_Unic:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
562 case BuildingType_1A:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
563 case BuildingType_House:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
564 case BuildingType_Jail:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
565 break;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
566
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
567 default:
1545
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1531
diff changeset
568 Error("Invalid enumeration value: %u", type);
1411
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
569 }
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
570
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
571 /* if ( a1 > 13 )
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
572 {
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
573 if ( a1 > 22 )
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
574 {
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
575 if ( a1 == 23 )
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
576 {
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
577 CreateButtonInColumn(0, 0xAu);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
578 CreateButtonInColumn(1, 0xBu);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
579 v14 = 96;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
580 LABEL_41:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
581 CreateButtonInColumn(2, v14);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
582 v17 = 2;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
583 v11 = 0;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
584 v10 = 1;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
585 v9 = 3;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
586 goto LABEL_42;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
587 }
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
588 if ( a1 <= 26 )
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
589 goto LABEL_43;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
590 if ( a1 > 28 )
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
591 {
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
592 if ( a1 != 30 )
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
593 goto LABEL_43;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
594 CreateButtonInColumn(0, 0x11u);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
595 v16 = 96;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
596 goto LABEL_37;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
597 }
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
598 CreateButtonInColumn(0, 0x69u);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
599 CreateButtonInColumn(1, 0x6Au);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
600 CreateButtonInColumn(2, 0x6Bu);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
601 v12 = 108;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
602 }
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
603 else
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
604 {
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
605 if ( a1 == 22 )
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
606 {
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
607 CreateButtonInColumn(0, 7u);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
608 v16 = 8;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
609 goto LABEL_37;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
610 }
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
611 v1 = a1 - 14;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
612 if ( !v1 ) // == 14
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
613 {
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
614 CreateButtonInColumn(0, 0x12u);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
615 CreateButtonInColumn(1, 0x30u);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
616 CreateButtonInColumn(2, 0x31u);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
617 CreateButtonInColumn(3, 0x32u);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
618 CreateButtonInColumn(4, 0x33u);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
619 v17 = 2;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
620 v11 = 0;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
621 v10 = 1;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
622 v9 = 5;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
623 goto LABEL_42;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
624 }
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
625 v2 = v1 - 1;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
626 if ( v2 ) // > 15
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
627 {
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
628 v3 = v2 - 2;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
629 if ( v3 ) // > 17
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
630 {
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
631 if ( v3 != 4 ) // 18, 19, 20
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
632 goto LABEL_43;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
633 CreateButtonInColumn(0, 0xFu); // 21
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
634 CreateButtonInColumn(1, 0x10u);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
635 v4 = 3;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
636 CreateButtonInColumn(2, 0x60u);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
637 v5 = (signed int)window_SpeakInHouse->ptr_1C;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
638 if ( v5 < 108 || v5 > 120 )
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
639 goto LABEL_28;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
640 v4 = 4;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
641 v6 = 101;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
642 v7 = 3;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
643 }
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
644 else // 16, 17
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
645 {
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
646 v4 = 1;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
647 CreateButtonInColumn(0, 0x63u);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
648 if ( !pParty->uFine )
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
649 {
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
650 LABEL_28:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
651 v17 = 2;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
652 v11 = 0;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
653 v10 = 1;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
654 v9 = v4;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
655 LABEL_42:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
656 pDialogueWindow->_41D08F_set_keyboard_control_group(v9, v10, v11, v17);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
657 goto LABEL_43;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
658 }
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
659 v4 = 2;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
660 v7 = 1;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
661 v6 = 100;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
662 }
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
663 CreateButtonInColumn(v7, v6);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
664 goto LABEL_28;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
665 }
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
666 CreateButtonInColumn(0, 0x12u); // 15
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
667 CreateButtonInColumn(1, 0x34u);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
668 CreateButtonInColumn(2, 0x35u);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
669 v12 = 54;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
670 }
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
671 LABEL_39:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
672 CreateButtonInColumn(3, v12);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
673 v17 = 2;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
674 v11 = 0;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
675 v10 = 1;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
676 v9 = 4;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
677 goto LABEL_42;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
678 }
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
679 if ( a1 == 13 )
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
680 {
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
681 CreateButtonInColumn(0, 0x12u);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
682 v16 = 56;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
683 LABEL_37:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
684 CreateButtonInColumn(1, v16);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
685 v17 = 2;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
686 v11 = 0;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
687 v10 = 1;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
688 v9 = 2;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
689 goto LABEL_42;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
690 }
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
691 switch ( a1 )
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
692 {
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
693 case 1:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
694 case 2:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
695 case 3:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
696 case 4:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
697 CreateButtonInColumn(0, 2u);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
698 CreateButtonInColumn(1, 0x5Fu);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
699 CreateButtonInColumn(2, 0x5Eu);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
700 v12 = 96;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
701 goto LABEL_39;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
702 case 5:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
703 CreateButtonInColumn(0, 0x12u);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
704 v13 = 48;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
705 goto LABEL_9;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
706 case 6:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
707 CreateButtonInColumn(0, 0x12u);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
708 v13 = 49;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
709 goto LABEL_9;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
710 case 7:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
711 CreateButtonInColumn(0, 0x12u);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
712 v13 = 50;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
713 goto LABEL_9;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
714 case 8:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
715 CreateButtonInColumn(0, 0x12u);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
716 v13 = 51;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
717 LABEL_9:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
718 CreateButtonInColumn(1, v13);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
719 v14 = 72;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
720 goto LABEL_41;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
721 case 9:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
722 CreateButtonInColumn(0, 0x12u);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
723 v15 = 52;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
724 goto LABEL_13;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
725 case 10:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
726 CreateButtonInColumn(0, 0x12u);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
727 v15 = 53;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
728 goto LABEL_13;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
729 case 11:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
730 CreateButtonInColumn(0, 0x12u);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
731 v15 = 54;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
732 LABEL_13:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
733 CreateButtonInColumn(1, v15);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
734 v14 = 61;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
735 goto LABEL_41;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
736 case 12:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
737 CreateButtonInColumn(0, 0x12u);
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
738 v16 = 55;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
739 goto LABEL_37;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
740 default:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
741 break;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
742 }
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
743 LABEL_43:*/
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
744 dword_F8B1E0 = pDialogueWindow->pNumPresenceButton;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
745 }
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
746 // F8B1E0: using guessed type int dword_F8B1E0;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
747
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
748
1393
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1313
diff changeset
749 //----- (004B1784) --------------------------------------------------------
1458
934074e7fcc1 ModalWindow
Nomad
parents: 1445
diff changeset
750 bool HouseUI_CheckIfPlayerCanInteract()
1393
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1313
diff changeset
751 {
1526
f47eab1a70d8 UIHouses.cpp cleaning(continue)
Ritor1
parents: 1496
diff changeset
752 GUIWindow window; // [sp+4h] [bp-54h]@3
1393
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1313
diff changeset
753
1526
f47eab1a70d8 UIHouses.cpp cleaning(continue)
Ritor1
parents: 1496
diff changeset
754 if ( pPlayers[uActiveCharacter]->CanAct() )
1393
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1313
diff changeset
755 {
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1313
diff changeset
756 pDialogueWindow->pNumPresenceButton = dword_F8B1E0;
1526
f47eab1a70d8 UIHouses.cpp cleaning(continue)
Ritor1
parents: 1496
diff changeset
757 return true;
1393
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1313
diff changeset
758 }
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1313
diff changeset
759 else
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1313
diff changeset
760 {
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1313
diff changeset
761 pDialogueWindow->pNumPresenceButton = 0;
1526
f47eab1a70d8 UIHouses.cpp cleaning(continue)
Ritor1
parents: 1496
diff changeset
762 memcpy(&window, pPrimaryWindow, sizeof(window));
f47eab1a70d8 UIHouses.cpp cleaning(continue)
Ritor1
parents: 1496
diff changeset
763 window.uFrameX = 483;
f47eab1a70d8 UIHouses.cpp cleaning(continue)
Ritor1
parents: 1496
diff changeset
764 window.uFrameWidth = 148;
f47eab1a70d8 UIHouses.cpp cleaning(continue)
Ritor1
parents: 1496
diff changeset
765 window.uFrameZ = 334;
f47eab1a70d8 UIHouses.cpp cleaning(continue)
Ritor1
parents: 1496
diff changeset
766 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[427], pPlayers[uActiveCharacter]->pName,
f47eab1a70d8 UIHouses.cpp cleaning(continue)
Ritor1
parents: 1496
diff changeset
767 pGlobalTXT_LocalizationStrings[562]); // "%s is in no condition to %s""do anything"
f47eab1a70d8 UIHouses.cpp cleaning(continue)
Ritor1
parents: 1496
diff changeset
768 window.DrawTitleText(pFontArrus, 0, (212 - pFontArrus->CalcTextHeight(pTmpBuf.data(), &window, 0, 0)) / 2 + 101, ui_house_player_cant_interact_color, pTmpBuf.data(), 3);
f47eab1a70d8 UIHouses.cpp cleaning(continue)
Ritor1
parents: 1496
diff changeset
769 return false;
1393
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1313
diff changeset
770 }
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1313
diff changeset
771 }
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1313
diff changeset
772
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
773 //----- (0044622E) --------------------------------------------------------
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
774 bool EnterHouse(enum HOUSE_ID uHouseID)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
775 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
776 signed int uOpenTime; // eax@5
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
777 signed int uCloseTime; // esi@5
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2253
diff changeset
778 // unsigned int v5; // esi@5
ddb803517a48 unused local variables I commented
Ritor1
parents: 2253
diff changeset
779 // int v6; // edx@5
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
780 signed int am_pm_flag_open; // ecx@10
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
781 signed int am_pm_flag_close; // eax@10
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2253
diff changeset
782 // int v9; // esi@10
ddb803517a48 unused local variables I commented
Ritor1
parents: 2253
diff changeset
783 // int v11; // ecx@17
ddb803517a48 unused local variables I commented
Ritor1
parents: 2253
diff changeset
784 // unsigned int v12; // kr00_4@25
ddb803517a48 unused local variables I commented
Ritor1
parents: 2253
diff changeset
785 // int v14; // eax@25
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
786 unsigned int v17; // eax@37
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
787 signed int v18; // edi@37
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
788 signed int v19; // edi@41
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
789 char pContainer[40]; // [sp+Ch] [bp-30h]@32
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2253
diff changeset
790 // unsigned int v24; // [sp+34h] [bp-8h]@5
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
791
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
792 GameUI_Footer_TimedString[0] = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
793 pFooterString[0] = 0;
1526
f47eab1a70d8 UIHouses.cpp cleaning(continue)
Ritor1
parents: 1496
diff changeset
794 ShowStatusBarString("", 2);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
795 if ( pMessageQueue_50CBD0->uNumMessages )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
796 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
797 viewparams->bRedrawGameUI = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
798 uDialogueType = 0;
1459
2ca62c9e7b3c Function names
Nomad
parents: 1458
diff changeset
799 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_CANCELLED);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
800 pKeyActionMap->ResetKeys();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
801 if (uHouseID == HOUSE_600 || uHouseID == HOUSE_601)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
802 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
803 GameOverMenu(0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
804 return 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
805 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
806 uOpenTime = p2DEvents[uHouseID - 1].uOpenTime;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
807 uCloseTime = p2DEvents[uHouseID - 1].uCloseTime;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
808 current_npc_text = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
809 dword_F8B1E4 = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
810 memset(byte_F8B1F0.data(), 0, 4);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
811 memset(player_levels.data(), 0, 16);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
812 pRenderer->ClearZBuffer(0, 479);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
813
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
814 if (((uCloseTime - 1 <= uOpenTime)&&((pParty->uCurrentHour <uOpenTime)&&(pParty->uCurrentHour >(uCloseTime - 1))))||
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
815 ((uCloseTime - 1 > uOpenTime)&&((pParty->uCurrentHour < uOpenTime)||(pParty->uCurrentHour > (uCloseTime - 1)))))
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
816
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
817 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
818 am_pm_flag_open = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
819 am_pm_flag_close = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
820 if (uOpenTime > 12 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
821 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
822 uOpenTime -= 12;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
823 am_pm_flag_open = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
824 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
825 if ( uCloseTime > 12 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
826 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
827 uCloseTime -= 12;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
828 am_pm_flag_close = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
829 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
830 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[414], uOpenTime, aAMPMNames[am_pm_flag_open],
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
831 uCloseTime, aAMPMNames[am_pm_flag_close]); //"This place is open from %d%s to %d%s"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
832 ShowStatusBarString(pTmpBuf.data(), 2u);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
833 if ( uActiveCharacter )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
834 pPlayers[uActiveCharacter]->PlaySound(SPEECH_3, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
835 return 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
836 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
837 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
838 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
839 //v10 = uHouseID;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
840 if ( (signed int)uHouseID < 53 ) //entering shops and guilds
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
841 {
1747
cecb080929c4 Party_stru0 renamed to PartyTimeStruct, fixed its members, renamed Party::field_3C to Party::PartyTimes, started Player::SetVariable refactoring start
Grumpy7
parents: 1709
diff changeset
842 if ( !(pParty->PartyTimes._shop_ban_times[uHouseID])
cecb080929c4 Party_stru0 renamed to PartyTimeStruct, fixed its members, renamed Party::field_3C to Party::PartyTimes, started Player::SetVariable refactoring start
Grumpy7
parents: 1709
diff changeset
843 || (pParty->PartyTimes._shop_ban_times[uHouseID] <= pParty->uTimePlayed) )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
844 {
1747
cecb080929c4 Party_stru0 renamed to PartyTimeStruct, fixed its members, renamed Party::field_3C to Party::PartyTimes, started Player::SetVariable refactoring start
Grumpy7
parents: 1709
diff changeset
845 pParty->PartyTimes._shop_ban_times[uHouseID] = 0;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
846 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
847 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
848 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
849 ShowStatusBarString(pGlobalTXT_LocalizationStrings[191], 2u);// "You've been banned from this shop!"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
850 return 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
851 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
852 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
853 pAudioPlayer->StopChannels(-1, -1);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
854
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
855 uCurrentHouse_Animation = p2DEvents[uHouseID - 1].uAnimationID;
1411
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
856 in_current_building_type = (BuildingType)pAnimatedRooms[uCurrentHouse_Animation].uBuildingType;
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
857 if ( in_current_building_type == BuildingType_Throne_Room && pParty->uFine ) // going 2 jail
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
858 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
859 uCurrentHouse_Animation = (signed __int16)p2DEvents[186].uAnimationID;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
860 uHouseID = HOUSE_JAIL;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
861 pParty->uTimePlayed = pParty->uTimePlayed + 0x7620000;
1411
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
862 in_current_building_type = (BuildingType)pAnimatedRooms[p2DEvents[HOUSE_LORD_AND_JUDGE_EMERALD_ISLE].uAnimationID].uBuildingType;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
863 ++pParty->uNumPrisonTerms;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
864 pParty->uFine = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
865 for (uint i = 0; i < 4; ++i)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
866 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
867 pParty->pPlayers[i].uTimeToRecovery = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
868 pParty->pPlayers[i].uNumDivineInterventionCastsThisDay = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
869 pParty->pPlayers[i].SetVariable(VAR_Award, 87);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
870 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
871 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
872 ++pIcons_LOD->uTexturePacksCount;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
873 if ( !pIcons_LOD->uNumPrevLoadedFiles )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
874 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
875 switch (pParty->alignment)
1545
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1531
diff changeset
876 {
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
877 case PartyAlignment_Good: sprintf(pContainer, "evt%02d-b", const_2()); break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
878 case PartyAlignment_Neutral: sprintf(pContainer, "evt%02d", const_2()); break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
879 case PartyAlignment_Evil: sprintf(pContainer, "evt%02d-c", const_2()); break;
1545
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1531
diff changeset
880 default: Error("Invalid alignment type: %u", pParty->alignment);
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1531
diff changeset
881 }
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
882
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
883 v17 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
884 pDialogueNPCCount = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
885 pTexture_Dialogue_Background = &pIcons_LOD->pTextures[v17];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
886 uTextureID_right_panel_loop = uTextureID_right_panel;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
887 PrepareHouse(uHouseID);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
888 v18 = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
889 uTextureID_right_panel_loop = uTextureID_right_panel;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
890 if ( uNumDialogueNPCPortraits == 1 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
891 pDialogueNPCCount = 1;
2345
182effc4b0ee for MultimediaPlayer
Ritor1
parents: 2336
diff changeset
892 pVideoPlayer->OpenHouseMovie(pAnimatedRooms[uCurrentHouse_Animation].video_name, 1u);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
893 dword_5C35D4 = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
894 if ( (signed int)uHouseID < 139 || (signed int)uHouseID > 172 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
895 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
896 if ( (signed int)uHouseID >= HOUSE_STABLES_HARMONDALE && (signed int)uHouseID <= 73 && !IsTravelAvailable(uHouseID - HOUSE_STABLES_HARMONDALE) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
897 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
898 return 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
899 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
900 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
901 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
902 { //guilds
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
903 v19 = guild_mambership_flags[uHouseID - HOUSE_FIRE_GUILD_INITIATE_EMERALD_ISLE]; //guilds flags
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
904 //v20 = uHouseID;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
905 //if ( !((unsigned __int8)(0x80u >> v19 % 8) & pPlayers[uActiveCharacter]->_guilds_member_bits[v19 /8]) )
2234
fd0b2a697416 fixing inverted guild greetings
Grumpy7
parents: 2215
diff changeset
906 if(!_449B57_test_bit(pPlayers[uActiveCharacter]->_achieved_awards_bits,v19))
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
907 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
908 PlayHouseSound(uHouseID, HouseSound_Greeting_2);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
909 return 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
910 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
911 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
912 PlayHouseSound(uHouseID, HouseSound_Greeting);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
913 dword_5C35D4 = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
914 return 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
915 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
916 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
917
1300
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
918 //----- (0044606A) --------------------------------------------------------
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
919 void PrepareHouse(HOUSE_ID house)
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
920 {
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
921 __int16 uExitMapID; // ax@2
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2253
diff changeset
922 // int v7; // ebx@11
ddb803517a48 unused local variables I commented
Ritor1
parents: 2253
diff changeset
923 // int v13; // [sp+30h] [bp-30h]@11
1300
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
924 int npc_id_arr[6]; // [sp+34h] [bp-2Ch]@1
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
925 int uAnimationID; // [sp+50h] [bp-10h]@1
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
926
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
927
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
928 uAnimationID = p2DEvents[house - 1].uAnimationID;
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
929 memset(npc_id_arr, 0, sizeof(npc_id_arr));
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
930 uNumDialogueNPCPortraits = 0;
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
931 uHouse_ExitPic = p2DEvents[house - 1].uExitPicID;
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
932 if ( uHouse_ExitPic )
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
933 {
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
934 uExitMapID = p2DEvents[house - 1]._quest_related;
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
935 if ( uExitMapID > 0 )
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
936 {
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
937 if(_449B57_test_bit(pParty->_quest_bits,uExitMapID))
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
938 {
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
939 uHouse_ExitPic = 0;
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
940 }
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
941 }
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
942 }
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
943
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
944 dword_591080 = pAnimatedRooms[uAnimationID].house_npc_id;
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
945 HouseNPCData[0]=0;
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
946 uNumDialogueNPCPortraits = 0;
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
947 if ( dword_591080 )
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
948 {
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
949
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
950 npc_id_arr[0] = dword_591080;
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
951 uNumDialogueNPCPortraits = 1;
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
952 }
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
953
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
954 for (uint i = 1; i < pNPCStats->uNumNewNPCs; ++i)
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
955 {
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
956 if (pNPCStats->pNewNPCData[i].Location2D == house )
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
957 {
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
958 if (!(pNPCStats->pNewNPCData[i].uFlags & 0x80))
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
959 {
1313
ae6c8e1ddef4 fix enter house error
Gloval
parents: 1306
diff changeset
960 HouseNPCData[uNumDialogueNPCPortraits+1-((dword_591080 != 0) ? 1 : 0) ] = &pNPCStats->pNewNPCData[i];
1300
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
961 npc_id_arr[uNumDialogueNPCPortraits] = pNPCStats->pNewNPCData[i].uPortraitID;
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
962 ++uNumDialogueNPCPortraits;
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
963 if ((pNPCStats->pNewNPCData[i].uFlags & 3) != 2)
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
964 ++pNPCStats->pNewNPCData[i].uFlags;
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
965 }
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
966 }
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
967
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
968 }
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
969
2335
6e3ca612f132 int -> uint
Ritor1
parents: 2334
diff changeset
970 for (int i = 0; i < uNumDialogueNPCPortraits; ++i)
1300
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
971 {
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
972
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
973 char icon_name[128];
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
974 sprintfex(icon_name, "npc%03u", npc_id_arr[i]);
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
975 pDialogueNPCPortraits[i] = pIcons_LOD->LoadTexturePtr(icon_name, TEXTURE_16BIT_PALETTE);
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
976 }
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
977
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
978 if (uHouse_ExitPic)
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
979 {
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
980 pDialogueNPCPortraits[uNumDialogueNPCPortraits] = pIcons_LOD->LoadTexturePtr(pHouse_ExitPictures[uHouse_ExitPic], TEXTURE_16BIT_PALETTE);
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
981 ++uNumDialogueNPCPortraits;
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
982 uHouse_ExitPic = p2DEvents[house - 1].uExitMapID;
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
983 }
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
984 }
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
985 //----- (004B1E92) --------------------------------------------------------
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
986 void PlayHouseSound(unsigned int uHouseID, HouseSoundID sound)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
987 {
1407
d4f57df4c299 PlayerSpeechID and uSpeakingCharacter
Ritor1
parents: 1396
diff changeset
988 if ( pAnimatedRooms[p2DEvents[uHouseID].uAnimationID].uRoomSoundId )
d4f57df4c299 PlayerSpeechID and uSpeakingCharacter
Ritor1
parents: 1396
diff changeset
989 pAudioPlayer->PlaySound((SoundID)(sound + 100 * (pAnimatedRooms[p2DEvents[uHouseID].uAnimationID].uRoomSoundId + 300)),
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
990 806, 0, -1, 0, 0, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
991 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
992
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
993 //----- (004BCACC) --------------------------------------------------------
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
994 void __fastcall OnSelectShopDialogueOption(signed int uMessageParam)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
995 {
1526
f47eab1a70d8 UIHouses.cpp cleaning(continue)
Ritor1
parents: 1496
diff changeset
996 int experience_for_next_level; // eax@5
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
997 int v16; // eax@32
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
998 __int16 v24; // ax@163
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
999 signed int v36; // esi@227
1739
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1000 int pPrice; // ecx@227
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1001
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1002 if ( !pDialogueWindow->pNumPresenceButton )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1003 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1004 pRenderer->ClearZBuffer(0, 479);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1005 if (dialog_menu_id == HOUSE_DIALOGUE_MAIN)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1006 {
1529
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1007 if ( in_current_building_type == BuildingType_Training )
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1008 {
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1009 if ( uMessageParam == HOUSE_DIALOGUE_TRAININGHALL_TRAIN )
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1010 {
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1011 experience_for_next_level = 0;
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1012 if ( pPlayers[uActiveCharacter]->uLevel > 0 )
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1013 {
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1014 for( uint i = 0; i < pPlayers[uActiveCharacter]->uLevel; i++ )
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1015 experience_for_next_level += i + 1;
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1016 }
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1017 if (pPlayers[uActiveCharacter]->uLevel < pMaxLevelPerTrainingHallType[(unsigned int)window_SpeakInHouse->ptr_1C - 89] &&
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1018 (signed __int64)pPlayers[uActiveCharacter]->uExperience < 1000 * experience_for_next_level)//test experience
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1019 return;
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1020 }
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1021 pDialogueWindow->Release();
2215
e9625ad08541 fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents: 2214
diff changeset
1022 pDialogueWindow = GUIWindow::Create(0, 0, window->GetWidth(), 345, WINDOW_MainMenu, 0, 0);
1529
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1023 pBtn_ExitCancel = pDialogueWindow->CreateButton(526, 445, 75, 33, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[74],// "End Conversation"
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1024 pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0);
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1025 pDialogueWindow->CreateButton(8, 8, 450, 320, 1, 0, UIMSG_BuyInShop_Identify_Repair, 0, 0, "", nullptr);
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1026 }
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1027 if ( in_current_building_type != BuildingType_Training )
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1028 {
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1029 if ((in_current_building_type == BuildingType_Stables || in_current_building_type == BuildingType_Boats) &&
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1030 transport_schedule[transport_routes[(unsigned int)window_SpeakInHouse->ptr_1C - HOUSE_STABLES_HARMONDALE][uMessageParam - HOUSE_DIALOGUE_TRANSPORT_SCHEDULE_1]].pSchedule[pParty->uDaysPlayed % 7]
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1031 || in_current_building_type != BuildingType_Temple || uMessageParam != BuildingType_MindGuild )
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1032 {
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1033 pDialogueWindow->Release();
2215
e9625ad08541 fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents: 2214
diff changeset
1034 pDialogueWindow = GUIWindow::Create(0, 0, window->GetWidth(), 345, WINDOW_MainMenu, 0, 0);
1529
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1035 pBtn_ExitCancel = pDialogueWindow->CreateButton(526, 445, 75, 33, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[74],// "End Conversation"
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1036 pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0);
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1037 pDialogueWindow->CreateButton(8, 8, 450, 320, 1, 0, UIMSG_BuyInShop_Identify_Repair, 0, 0, "", nullptr);
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1038 }
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1039 else if (uActiveCharacter)
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1040 {
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1041 if ( !pPlayers[uActiveCharacter]->IsPlayerHealableByTemple() )
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1042 return;
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1043 }
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1044 }
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1045 dialog_menu_id = (HOUSE_DIALOGUE_MENU)uMessageParam;
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1046 if ( in_current_building_type < BuildingType_19 )
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1047 ShopTexture = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(off_4F03B8[(int)in_current_building_type], TEXTURE_16BIT_PALETTE)];
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1048 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1049
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1050 //NEW
1411
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
1051 switch (in_current_building_type)
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1052 {
1411
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
1053 case BuildingType_FireGuild:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
1054 case BuildingType_AirGuild:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
1055 case BuildingType_WaterGuild:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
1056 case BuildingType_EarthGuild:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
1057 case BuildingType_SpiritGuild:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
1058 case BuildingType_MindGuild:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
1059 case BuildingType_BodyGuild:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
1060 case BuildingType_LightGuild:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
1061 case BuildingType_DarkGuild:
1644
dbd6f940f26c Fixed Celestia sky a bit.
Nomad
parents: 1640
diff changeset
1062 case BuildingType_ElementalGuild:
dbd6f940f26c Fixed Celestia sky a bit.
Nomad
parents: 1640
diff changeset
1063 case BuildingType_SelfGuild:
1411
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
1064 case BuildingType_16:
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1065 {
1920
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1919
diff changeset
1066 if ( pParty->PartyTimes.Shops_next_generation_time[window_SpeakInHouse->par1C - 139] >= (signed __int64)pParty->uTimePlayed )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1067 {
1526
f47eab1a70d8 UIHouses.cpp cleaning(continue)
Ritor1
parents: 1496
diff changeset
1068 for ( uint i = 0; i < 12; ++i )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1069 {
1739
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1070 if ( pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C - 139][i].uItemID )
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1071 ItemsInShopTexture[i] = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C - 139][i].GetIconName(), TEXTURE_16BIT_PALETTE)];
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1072 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1073 }
1529
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1074 else//generation new books
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1075 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1076 SpellBookGenerator();
1920
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1919
diff changeset
1077 pParty->PartyTimes.Shops_next_generation_time[window_SpeakInHouse->par1C - 139] = pParty->uTimePlayed + (signed __int64)((double)(0xA8C000
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1078 * (signed int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].field_1C) * 0.033333335);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1079 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1080 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1081 }
1411
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
1082 case BuildingType_TownHall:
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1083 {
1529
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1084 if ( uMessageParam == HOUSE_DIALOGUE_TOWNHALL_MESSAGE )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1085 {
1748
Grumpy7
parents: 1747 1739
diff changeset
1086 if ( pParty->PartyTimes.bountyHunting_next_generation_time[(int)((char *)window_SpeakInHouse->ptr_1C - 102)] < (signed __int64)pParty->uTimePlayed )//new generation
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1087 {
1739
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1088 pParty->monster_for_hunting_killed[(int)((char *)window_SpeakInHouse->ptr_1C - 102)] = false;
1748
Grumpy7
parents: 1747 1739
diff changeset
1089 pParty->PartyTimes.bountyHunting_next_generation_time[(int)((char *)window_SpeakInHouse->ptr_1C - 102)] = (signed __int64)((double)(309657600 * (pParty->uCurrentMonth + 12i64 * pParty->uCurrentYear - 14015)) * 0.033333335);
1739
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1090 pParty->monster_id_for_hunting[(int)((char *)window_SpeakInHouse->ptr_1C - 102)] = rand() % 258 + 1;
1529
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1091 v16 = (int)((char *)window_SpeakInHouse->ptr_1C - 102);
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1092 if ( !v16 )
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1093 {
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1094 while ( 1 )
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1095 {
1739
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1096 v24 = pParty->monster_id_for_hunting[(int)((char *)window_SpeakInHouse->ptr_1C - 102)];
1529
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1097 if ( (unsigned __int16)v24 < 115 || (unsigned __int16)v24 > 132 )
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1098 {
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1099 if ( ((unsigned __int16)v24 < 235 || (unsigned __int16)v24 > 252)
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1100 && ((unsigned __int16)v24 < 133 || (unsigned __int16)v24 > 150)
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1101 && ((unsigned __int16)v24 < 0x97u || (unsigned __int16)v24 > 0xBAu)
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1102 && ((unsigned __int16)v24 < 0xBEu || (unsigned __int16)v24 > 0xC0u)
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1103 && ((unsigned __int16)v24 < 0xC4u || (unsigned __int16)v24 > 0xC6u)
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1104 && ((unsigned __int16)v24 < 0x2Bu || (unsigned __int16)v24 > 0x2Du)
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1105 && ((unsigned __int16)v24 < 0xCDu || (unsigned __int16)v24 > 0xCFu)
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1106 && ((unsigned __int16)v24 < 0x5Eu || (unsigned __int16)v24 > 0x60u)
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1107 && ((unsigned __int16)v24 < 0xFDu || (unsigned __int16)v24 > 0xFFu)
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1108 && ((unsigned __int16)v24 < 0x6Du || (unsigned __int16)v24 > 0x6Fu)
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1109 && ((unsigned __int16)v24 < 0x61u || (unsigned __int16)v24 > 0x63u) )
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1110 break;
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1111 }
1739
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1112 pParty->monster_id_for_hunting[(int)((char *)window_SpeakInHouse->ptr_1C - 102)] = rand() % 258 + 1;
1529
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1113 }
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1114 }
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1115 if ( v16 == 1 )
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1116 {
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1117 while ( 1 )
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1118 {
1739
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1119 v24 = pParty->monster_id_for_hunting[(int)((char *)window_SpeakInHouse->ptr_1C - 102)];
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1120 if ( (unsigned __int16)v24 < 115 || (unsigned __int16)v24 > 132 )
1529
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1121 {
1739
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1122 if ( ((unsigned __int16)v24 < 0xE8u || (unsigned __int16)v24 > 0xF9u)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1123 && ((unsigned __int16)v24 < 0x85u || (unsigned __int16)v24 > 0x96u)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1124 && ((unsigned __int16)v24 < 0x97u || (unsigned __int16)v24 > 0xBAu)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1125 && ((unsigned __int16)v24 < 0xBEu || (unsigned __int16)v24 > 0xC0u)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1126 && ((unsigned __int16)v24 < 0xC4u || (unsigned __int16)v24 > 0xC6u)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1127 && ((unsigned __int16)v24 < 0x2Bu || (unsigned __int16)v24 > 0x2Du)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1128 && ((unsigned __int16)v24 < 0x52u || (unsigned __int16)v24 > 0x54u)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1129 && ((unsigned __int16)v24 < 4 || (unsigned __int16)v24 > 6)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1130 && ((unsigned __int16)v24 < 0x37u || (unsigned __int16)v24 > 0x39u)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1131 && ((unsigned __int16)v24 < 0x3Au || (unsigned __int16)v24 > 0x3Cu)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1132 && ((unsigned __int16)v24 < 0x3Du || (unsigned __int16)v24 > 0x3Fu)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1133 && ((unsigned __int16)v24 < 0xFDu || (unsigned __int16)v24 > 0xFFu)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1134 && ((unsigned __int16)v24 < 0x61u || (unsigned __int16)v24 > 0x63u)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1135 && ((unsigned __int16)v24 < 0xCDu || (unsigned __int16)v24 > 0xCFu) )
1529
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1136 break;
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1137 }
1739
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1138 pParty->monster_id_for_hunting[(int)((char *)window_SpeakInHouse->ptr_1C - 102)] = rand() % 258 + 1;
1529
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1139 }
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1140 }
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1141 if ( v16 == 2 )
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1142 {
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1143 while ( 1 )
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1144 {
1739
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1145 v24 = pParty->monster_id_for_hunting[(int)((char *)window_SpeakInHouse->ptr_1C - 102)];
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1146 if ( (unsigned __int16)v24 < 0x73u || (unsigned __int16)v24 > 0x84u )
1529
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1147 {
1739
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1148 if ( ((unsigned __int16)v24 < 0xE8u || (unsigned __int16)v24 > 0xF9u)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1149 && ((unsigned __int16)v24 < 0x85u || (unsigned __int16)v24 > 0x96u)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1150 && ((unsigned __int16)v24 < 0x97u || (unsigned __int16)v24 > 0xBAu)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1151 && ((unsigned __int16)v24 < 0xBEu || (unsigned __int16)v24 > 0xC0u)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1152 && ((unsigned __int16)v24 < 0xC4u || (unsigned __int16)v24 > 0xC6u)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1153 && ((unsigned __int16)v24 < 0x2Bu || (unsigned __int16)v24 > 0x2Du)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1154 && ((unsigned __int16)v24 < 0x31u || (unsigned __int16)v24 > 0x33u)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1155 && ((unsigned __int16)v24 < 0x34u || (unsigned __int16)v24 > 0x36u)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1156 && ((unsigned __int16)v24 < 0xFDu || (unsigned __int16)v24 > 0xFFu)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1157 && ((unsigned __int16)v24 < 0x61u || (unsigned __int16)v24 > 0x63u)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1158 && ((unsigned __int16)v24 < 0x1Cu || (unsigned __int16)v24 > 0x1Eu) )
1529
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1159 break;
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1160 }
1739
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1161 pParty->monster_id_for_hunting[(int)((char *)window_SpeakInHouse->ptr_1C - 102)] = rand() % 258 + 1;
1529
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1162 }
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1163 }
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1164 if ( v16 == 3 )
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1165 {
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1166 while ( 1 )
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1167 {
1739
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1168 v24 = pParty->monster_id_for_hunting[(int)((char *)window_SpeakInHouse->ptr_1C - 102)];
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1169 if ( (unsigned __int16)v24 < 0x73u || (unsigned __int16)v24 > 0x84u )
1529
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1170 {
1739
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1171 if ( ((unsigned __int16)v24 < 0xE8u || (unsigned __int16)v24 > 0xF9u)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1172 && ((unsigned __int16)v24 < 0x85u || (unsigned __int16)v24 > 0x96u)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1173 && ((unsigned __int16)v24 < 0x97u || (unsigned __int16)v24 > 0xBAu)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1174 && ((unsigned __int16)v24 < 0xBEu || (unsigned __int16)v24 > 0xC0u)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1175 && ((unsigned __int16)v24 < 0xC4u || (unsigned __int16)v24 > 0xC6u)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1176 && ((unsigned __int16)v24 < 0x2Bu || (unsigned __int16)v24 > 0x2Du)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1177 && ((unsigned __int16)v24 < 0x5Eu || (unsigned __int16)v24 > 0x60u)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1178 && ((unsigned __int16)v24 < 0x43u || (unsigned __int16)v24 > 0x45u)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1179 && ((unsigned __int16)v24 < 0x4Fu || (unsigned __int16)v24 > 0x51u)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1180 && ((unsigned __int16)v24 < 0xC1u || (unsigned __int16)v24 > 0xC3u)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1181 && ((unsigned __int16)v24 < 0x13u || (unsigned __int16)v24 > 0x15u)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1182 && ((unsigned __int16)v24 < 0xFDu || (unsigned __int16)v24 > 0xFFu)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1183 && ((unsigned __int16)v24 < 0x61u || (unsigned __int16)v24 > 0x63u)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1184 && ((unsigned __int16)v24 < 0x6Au || (unsigned __int16)v24 > 0x6Cu) )
1529
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1185 break;
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1186 }
1739
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1187 pParty->monster_id_for_hunting[(int)((char *)window_SpeakInHouse->ptr_1C - 102)] = rand() % 258 + 1;
1529
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1188 }
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1189 }
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1190 if ( v16 == 4 )
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1191 {
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1192 while ( 1 )
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1193 {
1739
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1194 v24 = pParty->monster_id_for_hunting[(int)((char *)window_SpeakInHouse->ptr_1C - 102)];
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1195 if ( (unsigned __int16)v24 < 0x73u || (unsigned __int16)v24 > 0x84u )
1529
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1196 {
1739
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1197 if ( ((unsigned __int16)v24 < 0xE8u || (unsigned __int16)v24 > 0xF9u)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1198 && ((unsigned __int16)v24 < 0x85u || (unsigned __int16)v24 > 0x96u)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1199 && ((unsigned __int16)v24 < 0x97u || (unsigned __int16)v24 > 0xBAu)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1200 && ((unsigned __int16)v24 < 0xBEu || (unsigned __int16)v24 > 0xC0u)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1201 && ((unsigned __int16)v24 < 0xC4u || (unsigned __int16)v24 > 0xC6u)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1202 && ((unsigned __int16)v24 < 0x2Bu || (unsigned __int16)v24 > 0x2Du)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1203 && ((unsigned __int16)v24 < 0x6Du || (unsigned __int16)v24 > 0x6Fu)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1204 && ((unsigned __int16)v24 < 0x46u || (unsigned __int16)v24 > 0x48u)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1205 && ((unsigned __int16)v24 < 0x100u || (unsigned __int16)v24 > 0x102u)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1206 && ((unsigned __int16)v24 < 0xD9u || (unsigned __int16)v24 > 0xDBu)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1207 && ((unsigned __int16)v24 < 0xC7u || (unsigned __int16)v24 > 0xC9u)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1208 && ((unsigned __int16)v24 < 0xE5u || (unsigned __int16)v24 > 0xE7u)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1209 && ((unsigned __int16)v24 < 0xDFu || (unsigned __int16)v24 > 0xE1u)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1210 && ((unsigned __int16)v24 < 0x5Bu || (unsigned __int16)v24 > 0x5Du)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1211 && ((unsigned __int16)v24 < 0x49u || (unsigned __int16)v24 > 0x4Bu)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1212 && ((unsigned __int16)v24 < 0xFDu || (unsigned __int16)v24 > 0xFFu)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1213 && ((unsigned __int16)v24 < 0x61u || (unsigned __int16)v24 > 0x63u)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1214 && ((unsigned __int16)v24 < 0x10u || (unsigned __int16)v24 > 0x12u) )
1529
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1215 break;
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1216 }
1739
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1217 pParty->monster_id_for_hunting[(int)((char *)window_SpeakInHouse->ptr_1C - 102)] = rand() % 258 + 1;
1529
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1218 }
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1219 }
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1220 }
1739
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1221 bountyHunting_monster_id_for_hunting = pParty->monster_id_for_hunting[(int)((char *)window_SpeakInHouse->ptr_1C - 102)];
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1222 if ( !pParty->monster_for_hunting_killed[(int)((char *)window_SpeakInHouse->ptr_1C - 102)] )
1529
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1223 {
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1224 bountyHunting_text = pNPCTopics[351].pText;//" ýòîì ìåñÿöó íàçíà÷åíà íàãðàäà çà ãîëîâó %s..."
1739
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1225 if ( !pParty->monster_id_for_hunting[(int)((char *)window_SpeakInHouse->ptr_1C - 102)] )
1529
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1226 bountyHunting_text = pNPCTopics[353].pText;//"Êîå êòî óæå ïðèõîäèë â ýòîì ìåñÿöå çà íàãðàäîé"
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1227 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1228 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1229 {
1739
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1230 if ( pParty->monster_id_for_hunting[(int)((char *)window_SpeakInHouse->ptr_1C - 102)] > 0 )//get prize
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1231 {
1828
35c1e4ff6ba7 party_finds_gold to Party::PartyFindsGold, cleaned up, moved Level/Decoration.h reference out of Indoor.h
Grumpy7
parents: 1754
diff changeset
1232 pParty->PartyFindsGold(100 * pMonsterStats->pInfos[(unsigned __int16)pParty->monster_id_for_hunting[(int)((char *)window_SpeakInHouse->ptr_1C - 102)]].uLevel, 0);
1529
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1233 for ( uint i = 0; i < 4; ++i )
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1234 pParty->pPlayers[i].SetVariable(VAR_Award, 86);
1739
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1235 pParty->uNumBountiesCollected += 100 * pMonsterStats->pInfos[pParty->monster_id_for_hunting[(int)((char *)window_SpeakInHouse->ptr_1C - 102)]].uLevel;
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1236 pParty->monster_id_for_hunting[(int)((char *)window_SpeakInHouse->ptr_1C - 102)] = 0;
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1237 pParty->monster_for_hunting_killed[(int)((char *)window_SpeakInHouse->ptr_1C - 102)] = false;
1529
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1238 }
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1239 bountyHunting_text = pNPCTopics[352].pText;//"Ïîçäðàâëÿþ! Âû óñïåøíî..."
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1240 }
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1241 }
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1242 else if ( uMessageParam == HOUSE_DIALOGUE_TOWNHALL_PAY_FINE )
1739
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1243 pKeyActionMap->EnterText(1, 10, window_SpeakInHouse);
1529
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1244 break;
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1245 }
1411
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
1246 case BuildingType_Bank:
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1247 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1248 if ( dialog_menu_id >= 7 && dialog_menu_id <= 8 )
1739
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1249 pKeyActionMap->EnterText(1, 10, window_SpeakInHouse);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1250 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1251 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1252 }
1411
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
1253 case BuildingType_WeaponShop:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
1254 case BuildingType_ArmorShop:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
1255 case BuildingType_MagicShop:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
1256 case BuildingType_AlchemistShop:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
1257 case BuildingType_Tavern:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
1258 case BuildingType_Temple:
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
1259 case BuildingType_Training:
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1260 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1261 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1262 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1263 default:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1264 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1265 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1266 break;
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 switch ( uMessageParam )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1271 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1272 case HOUSE_DIALOGUE_LEARN_SKILLS:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1273 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1274 pDialogueWindow->eWindowType = WINDOW_MainMenu;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1275 UI_CreateEndConversationButton();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1276 FillAviableSkillsToTeach(in_current_building_type);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1277 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1278 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1279 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_MAIN:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1280 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1281 pDialogueWindow->eWindowType = WINDOW_MainMenu;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1282 UI_CreateEndConversationButton();
1411
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
1283 InitializaDialogueOptions_Tavern(in_current_building_type);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1284 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1285 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1286 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RULES:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1287 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_VICTORY_CONDITIONS:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1288 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1289 dialog_menu_id = (HOUSE_DIALOGUE_MENU)uMessageParam;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1290 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1291 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1292 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RESULT:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1293 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1294 pMessageQueue_50CBD0->AddMessage(UIMSG_PlayArcomage, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1295 dialog_menu_id = HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RESULT;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1296 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1297 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1298 case HOUSE_DIALOGUE_SHOP_BUY_STANDARD:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1299 case HOUSE_DIALOGUE_SHOP_BUY_SPECIAL:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1300 {
1748
Grumpy7
parents: 1747 1739
diff changeset
1301 if ( pParty->PartyTimes.Shops_next_generation_time[(unsigned int)window_SpeakInHouse->ptr_1C] < (signed __int64)pParty->uTimePlayed )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1302 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1303 GenerateStandartShopItems();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1304 GenerateSpecialShopItems();
1747
cecb080929c4 Party_stru0 renamed to PartyTimeStruct, fixed its members, renamed Party::field_3C to Party::PartyTimes, started Player::SetVariable refactoring start
Grumpy7
parents: 1709
diff changeset
1305 pParty->PartyTimes.Shops_next_generation_time[window_SpeakInHouse->par1C] = pParty->uTimePlayed + (signed __int64)((double)(11059200 * (signed int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].field_1C) * 0.033333335);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1306 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1307 if ( uMessageParam == HOUSE_DIALOGUE_SHOP_BUY_STANDARD )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1308 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1309 if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1310 {
1739
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1311 for ( uint i = 0; i < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType]; ++i )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1312 {
1739
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1313 if ( pParty->StandartItemsInShops[(int)window_SpeakInHouse->ptr_1C][i].uItemID )
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1314 ItemsInShopTexture[i] = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pParty->StandartItemsInShops[(int)window_SpeakInHouse->ptr_1C][i].GetIconName(), TEXTURE_16BIT_PALETTE)];
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1315 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1316 }
1411
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
1317 if ( in_current_building_type == BuildingType_WeaponShop )
1298
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 {
1739
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1321 for ( uint i = 0; i < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType]; ++i )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1322 {
1739
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1323 if ( pParty->StandartItemsInShops[(int)window_SpeakInHouse->ptr_1C][i].uItemID)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1324 weapons_Ypos[i] = rand() % (300 - ItemsInShopTexture[i]->uTextureHeight);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1325 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1326 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1327 }
1739
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1328 }
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1329 if ( uMessageParam == HOUSE_DIALOGUE_SHOP_BUY_SPECIAL )
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1330 {
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1331 if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType] )
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1332 {
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1333 for ( uint i = 0; i < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType]; ++i )
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1334 {
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1335 if ( pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][i].uItemID )
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1336 ItemsInShopTexture[i] = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][i].GetIconName(), TEXTURE_16BIT_PALETTE)];
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1337 }
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1338 }
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1339 if ( in_current_building_type == BuildingType_WeaponShop )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1340 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1341 if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1342 {
1739
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1343 for ( uint i = 0; i < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType]; ++i )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1344 {
1739
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1345 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][i].uItemID)
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1346 weapons_Ypos[i] = rand() % (300 - ItemsInShopTexture[i]->uTextureHeight);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1347 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1348 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1349 }
1739
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1350 }
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1351 break;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1352 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1353 case HOUSE_DIALOGUE_SHOP_SELL:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1354 case HOUSE_DIALOGUE_SHOP_IDENTIFY:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1355 case HOUSE_DIALOGUE_SHOP_REPAIR:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1356 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1357 dialog_menu_id = (HOUSE_DIALOGUE_MENU)uMessageParam;
1829
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
1358 pParty->sub_421B2C_PlaceInInventory_or_DropPickedItem();
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1359 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1360 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1361 case HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1362 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1363 pDialogueWindow->eWindowType = WINDOW_MainMenu;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1364 UI_CreateEndConversationButton();
1411
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
1365 InitializaDialogueOptions_Shops(in_current_building_type);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1366 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1367 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1368 default:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1369 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1370 if( uMessageParam >= HOUSE_DIALOGUE_36 && uMessageParam <= HOUSE_DIALOGUE_GUILD_LEARN_SKILL )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1371 {
1739
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1372 v36 = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0);
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1373 pPrice = v36 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100;
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1374 if ( pPrice < v36 / 3 )
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1375 pPrice = v36 / 3;
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1376 if(byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][uMessageParam - 36])
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1377 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1378 if ( !pPlayers[uActiveCharacter]->pActiveSkills[uMessageParam - 36] )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1379 {
1739
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1380 if ( pParty->uNumGold < pPrice )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1381 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1382 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2);
1411
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1407
diff changeset
1383 if ( in_current_building_type == BuildingType_Training || in_current_building_type == BuildingType_Tavern )
1739
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1384 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_Goodbye);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1385 else
1739
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1386 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1387 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1388 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1389 {
1739
1776d4f033a7 WeaponShop cleared
Ritor1
parents: 1709
diff changeset
1390 Party::TakeGold(pPrice);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1391 dword_F8B1E4 = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1392 pPlayers[uActiveCharacter]->pActiveSkills[uMessageParam - 36] = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1393 pPlayers[uActiveCharacter]->PlaySound(SPEECH_78, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1394 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1395 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1396 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1397 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1398 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1399 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1400 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1401 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1402 //----- (004B6943) --------------------------------------------------------
1458
934074e7fcc1 ModalWindow
Nomad
parents: 1445
diff changeset
1403 void TravelByTransport()
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1404 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1405 signed int v4; // ebx@1
1589
Ritor1
parents: 1588
diff changeset
1406 stru365_travel_info *pTravel; // esi@7
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1407 signed int v12; // esi@13
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1408 signed int v13; // edi@14
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1409 DWORD v14; // eax@26
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1410 DWORD v15; // edi@26
1589
Ritor1
parents: 1588
diff changeset
1411 int pTextHeight; // eax@36
Ritor1
parents: 1588
diff changeset
1412 int pRealTextHeight; // esi@36
Ritor1
parents: 1588
diff changeset
1413 int schedule_id; // esi@39
Ritor1
parents: 1588
diff changeset
1414 GUIButton *pButton; // ebx@39
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1415 signed int v25; // eax@41
1589
Ritor1
parents: 1588
diff changeset
1416 MapInfo pMap; // [sp-3Ch] [bp-2CCh]@62
Ritor1
parents: 1588
diff changeset
1417 char pTopicArray[5][100]; // [sp+14h] [bp-27Ch]@37
Ritor1
parents: 1588
diff changeset
1418 GUIWindow travel_window; // [sp+208h] [bp-88h]@1
Ritor1
parents: 1588
diff changeset
1419 int pPrimaryTextHeight; // [sp+260h] [bp-30h]@36
Ritor1
parents: 1588
diff changeset
1420 int index; // [sp+27Ch] [bp-14h]@36
Ritor1
parents: 1588
diff changeset
1421 unsigned int pPrice; // [sp+288h] [bp-8h]@1
Ritor1
parents: 1588
diff changeset
1422 int travel_time; // [sp+28Ch] [bp-4h]@48
Ritor1
parents: 1588
diff changeset
1423 enum PlayerSpeech pSpeech;
Ritor1
parents: 1588
diff changeset
1424 unsigned int pCurrentButton;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1425
1589
Ritor1
parents: 1588
diff changeset
1426 memcpy(&travel_window, window_SpeakInHouse, sizeof(travel_window));
Ritor1
parents: 1588
diff changeset
1427 travel_window.uFrameX = 483;
Ritor1
parents: 1588
diff changeset
1428 travel_window.uFrameWidth = 148;
Ritor1
parents: 1588
diff changeset
1429 travel_window.uFrameZ = 334;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1430
1587
Ritor1
parents: 1531
diff changeset
1431 v4 = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType == BuildingType_Stables ? 25 : 50;
Ritor1
parents: 1531
diff changeset
1432 v4 *= p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1433
1589
Ritor1
parents: 1588
diff changeset
1434 pPrice = v4 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100;
Ritor1
parents: 1588
diff changeset
1435 if ( (signed int)pPrice < v4 / 3 )
Ritor1
parents: 1588
diff changeset
1436 pPrice = v4 / 3;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1437 if ( dialog_menu_id == HOUSE_DIALOGUE_MAIN)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1438 {
1393
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1313
diff changeset
1439 if ( HouseUI_CheckIfPlayerCanInteract() )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1440 {
1589
Ritor1
parents: 1588
diff changeset
1441 index = 0;
Ritor1
parents: 1588
diff changeset
1442 strcpy(pTopicArray[4], "");
Ritor1
parents: 1588
diff changeset
1443 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[405], pPrice); // Price: %lu gold
Ritor1
parents: 1588
diff changeset
1444 pTextHeight = pFontArrus->CalcTextHeight(pTmpBuf2.data(), &travel_window, 0, 0);
Ritor1
parents: 1588
diff changeset
1445 pRealTextHeight = pTextHeight + (LOBYTE(pFontArrus->uFontHeight) - 3) + 146;
Ritor1
parents: 1588
diff changeset
1446 pPrimaryTextHeight = pRealTextHeight;
Ritor1
parents: 1588
diff changeset
1447 pCurrentButton = 2;
Ritor1
parents: 1588
diff changeset
1448 for ( uint i = pDialogueWindow->pStartingPosActiveItem; i < (unsigned int)(pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem); ++i )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1449 {
1589
Ritor1
parents: 1588
diff changeset
1450 schedule_id = transport_routes[(unsigned int)window_SpeakInHouse->ptr_1C - HOUSE_STABLES_HARMONDALE][index];
Ritor1
parents: 1588
diff changeset
1451 pButton = pDialogueWindow->GetControl(i);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1452
1589
Ritor1
parents: 1588
diff changeset
1453 if (schedule_id != 255)
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1454 {
1610
Ritor1
parents: 1609
diff changeset
1455 //if (schedule_id >= 25)
Ritor1
parents: 1609
diff changeset
1456 //Log::Warning(L"Transport UI: schedule overflow");
1589
Ritor1
parents: 1588
diff changeset
1457 if ( pCurrentButton >= 6 )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1458 v25 = true;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1459 else
1589
Ritor1
parents: 1588
diff changeset
1460 v25 = transport_schedule[schedule_id].pSchedule[pParty->uDaysPlayed % 7];
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1461 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1462
1589
Ritor1
parents: 1588
diff changeset
1463 if (schedule_id != 255 && v25 && (!transport_schedule[schedule_id].uQuestBit
1625
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
1464 || _449B57_test_bit(pParty->_quest_bits, transport_schedule[schedule_id].uQuestBit)) )//îøèáêà: ðèñóåòñÿ íåñêîëüêî ñòðî÷åê îäíîãî íàïðàâëåíèÿ ïóòåøåñòâèÿ
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1465 {
1610
Ritor1
parents: 1609
diff changeset
1466 //get color for current string(îïðåäåëåíèå öâåòà òåêóùåé ñòðîêè)----------
1589
Ritor1
parents: 1588
diff changeset
1467 if ( pDialogueWindow->pCurrentPosActiveItem == pCurrentButton )
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
1468 sprintf(pTopicArray[index], "\f%05d", Color16(255, 255, 155));
1589
Ritor1
parents: 1588
diff changeset
1469 else
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
1470 sprintf(pTopicArray[index], "\f%05d", Color16(255, 255, 255));
1589
Ritor1
parents: 1588
diff changeset
1471 //hired NPC premium(ïðåìèÿ íà¸ìíîãî ÍÏÑ)----------------------------------
Ritor1
parents: 1588
diff changeset
1472 travel_time = transport_schedule[schedule_id].uTravelTime;
1591
d687f6e7c610 Boat dialogue
Ritor1
parents: 1590
diff changeset
1473 if ( (unsigned int)window_SpeakInHouse->ptr_1C >= HOUSE_BOATS_EMERALD_ISLE )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1474 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1475 if ( CheckHiredNPCSpeciality(Sailor) )
1589
Ritor1
parents: 1588
diff changeset
1476 travel_time -= 2;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1477 if ( CheckHiredNPCSpeciality(Navigator) )
1589
Ritor1
parents: 1588
diff changeset
1478 travel_time -= 3;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1479 if ( CheckHiredNPCSpeciality(Pirate) )
1589
Ritor1
parents: 1588
diff changeset
1480 travel_time -= 2;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1481 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1482 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1483 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1484 if ( CheckHiredNPCSpeciality(Horseman) )
1589
Ritor1
parents: 1588
diff changeset
1485 travel_time -= 2;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1486 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1487 if ( CheckHiredNPCSpeciality(Explorer) )
1589
Ritor1
parents: 1588
diff changeset
1488 --travel_time;
Ritor1
parents: 1588
diff changeset
1489
Ritor1
parents: 1588
diff changeset
1490 if ( travel_time < 1 )
Ritor1
parents: 1588
diff changeset
1491 travel_time = 1;
Ritor1
parents: 1588
diff changeset
1492 if ( schedule_id != 255 )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1493 {
1589
Ritor1
parents: 1588
diff changeset
1494 memcpy(&pMap, &pMapStats->pInfos[transport_schedule[schedule_id].uMapInfoID], 0x44u);
Ritor1
parents: 1588
diff changeset
1495 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[404], travel_time, pMap.pName); // Time - %d days, destination %s
Ritor1
parents: 1588
diff changeset
1496 strcat(pTopicArray[index], pTmpBuf.data());
Ritor1
parents: 1588
diff changeset
1497 strcat(pTopicArray[index], "\n \n");
Ritor1
parents: 1588
diff changeset
1498 pButton->uY = pRealTextHeight;
Ritor1
parents: 1588
diff changeset
1499 pTextHeight = pFontArrus->CalcTextHeight(pTmpBuf.data(), &travel_window, 0, 0);
Ritor1
parents: 1588
diff changeset
1500 pButton->uHeight = pTextHeight;
1625
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
1501 pButton->uW = pButton->uY + pTextHeight - 1;
1589
Ritor1
parents: 1588
diff changeset
1502 pRealTextHeight += (LOBYTE(pFontArrus->uFontHeight) - 3) + pTextHeight;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1503 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1504 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1505 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1506 {
1589
Ritor1
parents: 1588
diff changeset
1507 strcpy(pTopicArray[index], "");
Ritor1
parents: 1588
diff changeset
1508 if ( pButton )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1509 {
1589
Ritor1
parents: 1588
diff changeset
1510 pButton->uW = 0;
Ritor1
parents: 1588
diff changeset
1511 pButton->uHeight = 0;
Ritor1
parents: 1588
diff changeset
1512 pButton->uY = 0;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1513 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1514 }
1589
Ritor1
parents: 1588
diff changeset
1515 ++index;
Ritor1
parents: 1588
diff changeset
1516 ++pCurrentButton;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1517 }
1589
Ritor1
parents: 1588
diff changeset
1518 if ( pRealTextHeight != pPrimaryTextHeight )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1519 {
1589
Ritor1
parents: 1588
diff changeset
1520 sprintf(pTmpBuf.data(), "%s\n \n%s%s%s%s%s", pTmpBuf2.data(), pTopicArray[0], pTopicArray[1], pTopicArray[2], pTopicArray[3], pTopicArray[4]);
Ritor1
parents: 1588
diff changeset
1521 travel_window.DrawTitleText(pFontArrus, 0, 146, 0, pTmpBuf.data(), 3);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1522 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1523 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1524 {
1589
Ritor1
parents: 1588
diff changeset
1525 travel_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[561], &travel_window, 0, 0)) / 2 + 138,//"Èçâèíèòå, ïðèõîäèòå â äðóãîé äåíü"
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
1526 Color16(255, 255, 255), pGlobalTXT_LocalizationStrings[561], 3);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1527 pAudioPlayer->StopChannels(-1, -1);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1528 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1529 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1530 }
1589
Ritor1
parents: 1588
diff changeset
1531 else//ïîñëå íàæàòèÿ òîïèêà
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1532 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1533 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
1534 {
1589
Ritor1
parents: 1588
diff changeset
1535 if ( pParty->uNumGold < pPrice )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1536 {
1589
Ritor1
parents: 1588
diff changeset
1537 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2);//"Ó âàñ íå õâàòàåò çîëîòà"
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1538 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_Greeting_2);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1539 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1540 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1541 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1542
1589
Ritor1
parents: 1588
diff changeset
1543 Party::TakeGold(pPrice);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1544
1589
Ritor1
parents: 1588
diff changeset
1545 pTravel = &transport_schedule[transport_routes[(unsigned int)window_SpeakInHouse->ptr_1C - HOUSE_STABLES_HARMONDALE][dialog_menu_id - HOUSE_DIALOGUE_TRANSPORT_SCHEDULE_1]];
Ritor1
parents: 1588
diff changeset
1546 if ( pTravel->pSchedule[pParty->uDaysPlayed % 7] )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1547 {
1589
Ritor1
parents: 1588
diff changeset
1548 if ( _stricmp(pCurrentMapName, pMapStats->pInfos[pTravel->uMapInfoID].pFilename) )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1549 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1550 SaveGame(1, 0);
1589
Ritor1
parents: 1588
diff changeset
1551 strcpy(pCurrentMapName, pMapStats->pInfos[pTravel->uMapInfoID].pFilename);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1552
2061
b2a434d65344 GAME_SETTINGS_* defines introduced
Nomad
parents: 2057
diff changeset
1553 dword_6BE364_game_settings_1 |= GAME_SETTINGS_0001;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1554 _5B65B8_npcdata_hiword_house_or_other = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1555 dword_5B65BC = 0;
1589
Ritor1
parents: 1588
diff changeset
1556 _5B65B4_npcdata_loword_house_or_other = pTravel->arrival_rot_y;
2124
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2069
diff changeset
1557 uGameState = GAME_STATE_CHANGE_LOCATION;
1589
Ritor1
parents: 1588
diff changeset
1558 _5B65A8_npcdata_uflags_or_other = pTravel->arrival_x;
Ritor1
parents: 1588
diff changeset
1559 _5B65AC_npcdata_fame_or_other = pTravel->arrival_y;
Ritor1
parents: 1588
diff changeset
1560 _5B65B0_npcdata_rep_or_other = pTravel->arrival_z;
Ritor1
parents: 1588
diff changeset
1561 dword_5B65C0 = pTravel->arrival_x | pTravel->arrival_y | pTravel->arrival_z | pTravel->arrival_rot_y;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1562 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1563 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1564 {
1640
afc1c3514dd5 Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents: 1639
diff changeset
1565 pGame->pIndoorCameraD3D->sRotationY = 0;
1638
ccde94f02b75 class IndoorCamera split into BLVRenderParams and ODMRenderParams
Nomad
parents: 1630
diff changeset
1566
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1567 pParty->uFlags |= 2u;
1589
Ritor1
parents: 1588
diff changeset
1568 pParty->vPosition.x = pTravel->arrival_x;
Ritor1
parents: 1588
diff changeset
1569 pParty->vPosition.y = pTravel->arrival_y;
Ritor1
parents: 1588
diff changeset
1570 pParty->vPosition.z = pTravel->arrival_z;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1571 pParty->uFallStartY = pParty->vPosition.z;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1572 pParty->sRotationX = 0;
1589
Ritor1
parents: 1588
diff changeset
1573 pParty->sRotationY = pTravel->arrival_rot_y;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1574 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1575 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
1589
Ritor1
parents: 1588
diff changeset
1576 v12 = pTravel->uTravelTime;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1577 if ( (signed int)window_SpeakInHouse->ptr_1C >= 63 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1578 {
1589
Ritor1
parents: 1588
diff changeset
1579 pSpeech = SPEECH_SetSail;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1580 v13 = 2500;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1581 if ( CheckHiredNPCSpeciality(Sailor) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1582 v12 -= 2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1583 if ( CheckHiredNPCSpeciality(Navigator) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1584 v12 -= 3;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1585 if ( CheckHiredNPCSpeciality(Pirate) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1586 v12 -= 2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1587 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1588 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1589 {
1589
Ritor1
parents: 1588
diff changeset
1590 pSpeech = SPEECH_CarriageReady;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1591 v13 = 1500;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1592 if ( CheckHiredNPCSpeciality(Horseman) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1593 v12 -= 2;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1594 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1595 if ( CheckHiredNPCSpeciality(Explorer) )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1596 --v12;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1597 if ( v12 < 1 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1598 v12 = 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1599 RestAndHeal(1440 * v12);
1589
Ritor1
parents: 1588
diff changeset
1600 pPlayers[uActiveCharacter]->PlaySound(pSpeech, 0);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1601 v14 = GetTickCount();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1602 v15 = v14 + v13;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1603 if ( v15 < v14 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1604 v15 = v14;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1605 while ( GetTickCount() < v15 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1606 sqrt(3.1415926);
1919
140ca8123384 Tavern rest fix
Ritor1
parents: 1843
diff changeset
1607 while ( HouseDialogPressCloseBtn() )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1608 ;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1609 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1610 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1611 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1612 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1613 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1614 dialog_menu_id = HOUSE_DIALOGUE_MAIN;
1754
421c29d4ab3e UITransition.cpp cleaning(continue)
Ritor1
parents: 1748
diff changeset
1615 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
1298
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 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1620 //----- (004B68EA) --------------------------------------------------------
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1621 bool __fastcall IsTravelAvailable(int a1)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1622 {
1587
Ritor1
parents: 1531
diff changeset
1623 for ( uint i = 0; i < 4; ++i )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1624 {
1587
Ritor1
parents: 1531
diff changeset
1625 if ( transport_schedule[transport_routes[a1][i]].pSchedule[pParty->uDaysPlayed % 7] )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1626 {
1587
Ritor1
parents: 1531
diff changeset
1627 if (!transport_schedule[transport_routes[a1][i]].uQuestBit || _449B57_test_bit(pParty->_quest_bits, transport_schedule[transport_routes[a1][i]].uQuestBit))
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1628 return true;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1629 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1630 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1631 return false;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1632 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1633
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1634 //----- (004B7911) --------------------------------------------------------
1458
934074e7fcc1 ModalWindow
Nomad
parents: 1445
diff changeset
1635 void TownHallDialog()
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1636 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1637 int v1; // eax@10
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1638 int v2; // esi@10
1529
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1639 signed int pStringSum; // ebx@24
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1640 signed int v16; // ebx@28
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1641 int v17; // ebx@28
1529
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1642 GUIButton *pButton; // eax@30
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1643 int pTextHeight; // eax@30
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1644 unsigned __int16 pTextColor; // ax@30
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1645 GUIWindow window; // [sp+60h] [bp-BCh]@21
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1646 GUIWindow townHall_window; // [sp+B4h] [bp-68h]@1
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1647 int v29; // [sp+10Ch] [bp-10h]@28
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1648 int v31; // [sp+114h] [bp-8h]@29
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1649 GUIFont *pOutString; // [sp+118h] [bp-4h]@21
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1650
1529
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1651 memcpy(&townHall_window, window_SpeakInHouse, sizeof(townHall_window));
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1652 townHall_window.uFrameX = 483;
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1653 townHall_window.uFrameWidth = 148;
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1654 townHall_window.uFrameZ = 334;
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1655 sprintf(pTmpBuf.data(), "%s: %d", pGlobalTXT_LocalizationStrings[605], pParty->uFine);//Òåêóùèé øòðàô
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
1656 townHall_window.DrawTitleText(pFontArrus, 0, 260, Color16(0xFFu, 0xFFu, 0x9Bu), pTmpBuf.data(), 3);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1657 switch(dialog_menu_id)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1658 {
1529
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1659 case HOUSE_DIALOGUE_MAIN:
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1660 {
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1661 pStringSum = 1;
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1662 pTextHeight = 0;
1843
2e6d3cd052e0 some char* cast removal + adding const_casts where appropriate
Grumpy7
parents: 1838
diff changeset
1663 pShopOptions[0] = const_cast<char *>(pGlobalTXT_LocalizationStrings[604]);//Îõîòà çà âîçíàãðàæäåíèå
1529
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1664 if ( pParty->uFine > 0 )
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1665 {
1843
2e6d3cd052e0 some char* cast removal + adding const_casts where appropriate
Grumpy7
parents: 1838
diff changeset
1666 pShopOptions[1] = const_cast<char *>(pGlobalTXT_LocalizationStrings[603]);//Çàïëàòèòü øòðàô
1529
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1667 pStringSum = 2;
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1668 }
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1669 for ( uint i = 0; i < pStringSum; ++i )
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1670 pTextHeight += pFontArrus->CalcTextHeight(pShopOptions[i], &townHall_window, 0, 0);
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1671 v29 = (100 - pTextHeight) / pStringSum;
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1672 v16 = 80 - pStringSum * ((100 - pTextHeight) / pStringSum);
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1673 v17 = (v16 / 2) - v29 / 2 + 158;
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1674 if ( pDialogueWindow->pNumPresenceButton > 0 )
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1675 {
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1676 v31 = 2;
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1677 uint j = 0;
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1678 for ( uint i = pDialogueWindow->pStartingPosActiveItem;
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1679 i < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem; ++i )
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1680 {
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1681 pButton = pDialogueWindow->GetControl(i);
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1682 pButton->uY = v29 + v17;
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1683 pTextHeight = pFontArrus->CalcTextHeight(pShopOptions[j], &townHall_window, 0, 0);
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1684 pButton->uHeight = pTextHeight;
1625
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
1685 v17 = pButton->uY + pTextHeight - 1;
1529
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1686 pButton->uW = v17;
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
1687 pTextColor = Color16(0xFFu, 0xFFu, 0x9Bu);
1529
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1688 if ( pDialogueWindow->pCurrentPosActiveItem != v31 )
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
1689 pTextColor = Color16(0xFFu, 0xFFu, 0xFFu);
1625
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
1690 townHall_window.DrawTitleText(pFontArrus, 0, pButton->uY, pTextColor, pShopOptions[j], 3);
1529
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1691 ++v31;
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1692 ++j;
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1693 }
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1694 }
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1695 break;
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1696 }
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1697 case HOUSE_DIALOGUE_TOWNHALL_MESSAGE:
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1698 {
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
1699 sprintf(pTmpBuf.data(), "\f%05d%s\f%05d", Color16(0xFFu, 0xFFu, 0x9Bu),
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
1700 pMonsterStats->pInfos[bountyHunting_monster_id_for_hunting].pName, Color16(0xFFu, 0xFFu, 0xFFu));
1529
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1701 sprintf(pTmpBuf2.data(), bountyHunting_text, pTmpBuf.data(), 100 * pMonsterStats->pInfos[bountyHunting_monster_id_for_hunting].uLevel);
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1702 current_npc_text = pTmpBuf2.data();
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1703 memcpy(&window, pDialogueWindow, sizeof(window));
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1704 window.uFrameWidth = 458;
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1705 window.uFrameZ = 457;
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1706 pOutString = pFontArrus;
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1707 pTextHeight = pFontArrus->CalcTextHeight(pTmpBuf2.data(), &window, 13, 0) + 7;
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1708 if ( 352 - pTextHeight < 8 )
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1709 {
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1710 pOutString = pFontCreate;
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1711 pTextHeight = pFontCreate->CalcTextHeight(current_npc_text, &window, 13, 0) + 7;
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1712 }
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1713 pRenderer->GetLeather(8, 352 - pTextHeight, pIcons_LOD->GetTexture(uTextureID_Leather), pIcons_LOD->GetTexture(uTextureID_Leather)->uTextureHeight - pTextHeight);
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1714 pRenderer->DrawTextureIndexed(8, 347 - pTextHeight, pTexture_591428);
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1715 window.DrawText(pOutString, 13, 354 - pTextHeight, 0, FitTextInAWindow(current_npc_text, pOutString, &window, 13, 0), 0, 0, 0);
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1716 break;
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1717 }
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1718 case HOUSE_DIALOGUE_TOWNHALL_PAY_FINE:
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1719 {
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1720 if ( window_SpeakInHouse->receives_keyboard_input_2 == WINDOW_INPUT_IN_PROGRESS)
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1721 {
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1722 sprintfex(pTmpBuf.data(), "%s\n%s", pGlobalTXT_LocalizationStrings[606], pGlobalTXT_LocalizationStrings[112]); // "Pay" "How Much?"
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
1723 townHall_window.DrawTitleText(pFontArrus, 0, 146, Color16(0xFFu, 0xFFu, 0x9Bu), pTmpBuf.data(), 3);
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
1724 townHall_window.DrawTitleText(pFontArrus, 0, 186, Color16(0xFFu, 0xFFu, 0xFFu), (const char *)pKeyActionMap->pPressedKeysBuffer, 3);
1529
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1725 townHall_window.DrawFlashingInputCursor(pFontArrus->GetLineWidth((const char *)pKeyActionMap->pPressedKeysBuffer) / 2 + 80, 185, pFontArrus);
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1726 return;
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1727 }
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1728 if ( window_SpeakInHouse->receives_keyboard_input_2 == WINDOW_INPUT_CONFIRMED)
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1729 {
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1730 v1 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer);
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1731 v2 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer);
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1732 if ( v1 <= 0 )
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1733 {
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1734 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1735 return;
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1736 }
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1737 if ( v1 > pParty->uNumGold )
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1738 {
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1739 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1740 v2 = pParty->uNumGold;
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1741 }
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1742 if ( v2 > pParty->uFine )
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1743 v2 = pParty->uFine;
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1744 Party::TakeGold(v2);
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1745 pParty->uFine -= v2;
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1746 if ( pParty->uFine < 0 )
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1747 pParty->uFine = 0;
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1748 if ( uActiveCharacter )
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1749 pPlayers[uActiveCharacter]->PlaySound(SPEECH_81, 0);
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1750 }
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1751 if ( window_SpeakInHouse->receives_keyboard_input_2 == WINDOW_INPUT_CANCELLED)
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1752 {
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1753 window_SpeakInHouse->receives_keyboard_input_2 = WINDOW_INPUT_NONE;
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1754 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1755 }
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1756 break;
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1757 }
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1758 default:
61458df2cb4f bountyHunting fix
Ritor1
parents: 1526
diff changeset
1759 break;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1760 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1761 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1762 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1763
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1764 //----- (004B7D7E) --------------------------------------------------------
1458
934074e7fcc1 ModalWindow
Nomad
parents: 1445
diff changeset
1765 void BankDialog()
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1766 {
1573
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1767 int entered_sum; // eax@19
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1768 unsigned int takes_sum; // esi@19
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1769 unsigned __int16 pColorText; // ax@27
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1770 GUIWindow bank_window; // [sp+Ch] [bp-5Ch]@1
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1771
1573
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1772 memcpy(&bank_window, window_SpeakInHouse, sizeof(bank_window));
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1773 bank_window.uFrameX = 483;
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1774 bank_window.uFrameWidth = 148;
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1775 bank_window.uFrameZ = 334;
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1776 sprintf(pTmpBuf.data(), "%s: %d", pGlobalTXT_LocalizationStrings[25], pParty->uNumGoldInBank);//Áàëàíñ
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
1777 bank_window.DrawTitleText(pFontArrus, 0, 220, Color16(0xFFu, 0xFFu, 0x9Bu), pTmpBuf.data(), 3);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1778 switch(dialog_menu_id)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1779 {
1573
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1780 case HOUSE_DIALOGUE_MAIN:
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1781 {
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
1782 pColorText = Color16(0xFFu, 0xFFu, 0x9Bu);
1573
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1783 if ( pDialogueWindow->pCurrentPosActiveItem != 2 )
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
1784 pColorText = Color16(0xFFu, 0xFFu, 0xFFu);
1573
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1785 bank_window.DrawTitleText(pFontArrus, 0, 146, pColorText, pGlobalTXT_LocalizationStrings[60], 3);
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
1786 pColorText = Color16(0xFFu, 0xFFu, 0x9Bu);
1573
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1787 if ( pDialogueWindow->pCurrentPosActiveItem != 3 )
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
1788 pColorText = Color16(0xFFu, 0xFFu, 0xFFu);
1573
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1789 bank_window.DrawTitleText(pFontArrus, 0, 176, pColorText, pGlobalTXT_LocalizationStrings[244], 3);
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1790 break;
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1791 }
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1792 case HOUSE_DIALOGUE_BANK_PUT_GOLD:
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1793 {
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1794 if ( window_SpeakInHouse->receives_keyboard_input_2 == WINDOW_INPUT_IN_PROGRESS)
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1795 {
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1796 sprintf(pTmpBuf.data(), "%s\n%s", pGlobalTXT_LocalizationStrings[60], pGlobalTXT_LocalizationStrings[112]);//"Ïîëîæèòü" "Ñêîëüêî?"
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
1797 bank_window.DrawTitleText(pFontArrus, 0, 146, Color16(0xFFu, 0xFFu, 0x9Bu), pTmpBuf.data(), 3);
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
1798 bank_window.DrawTitleText(pFontArrus, 0, 186, Color16(0xFFu, 0xFFu, 0xFFu), (const char *)pKeyActionMap->pPressedKeysBuffer, 3);
1573
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1799 bank_window.DrawFlashingInputCursor(pFontArrus->GetLineWidth((const char *)pKeyActionMap->pPressedKeysBuffer) / 2 + 80, 185, pFontArrus);
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1800 return;
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1801 }
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1802 if ( window_SpeakInHouse->receives_keyboard_input_2 == WINDOW_INPUT_CONFIRMED)
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1803 {
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1804 entered_sum = atoi((const char *)pKeyActionMap->pPressedKeysBuffer);
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1805 takes_sum = entered_sum;
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1806 if ( !entered_sum )
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1807 {
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1808 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1809 return;
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1810 }
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1811 if ( entered_sum > pParty->uNumGold )
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1812 {
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1813 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1814 takes_sum = pParty->uNumGold;
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1815 }
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1816 if ( takes_sum )
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1817 {
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1818 Party::TakeGold(takes_sum);
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1819 pParty->uNumGoldInBank += takes_sum;
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1820 if ( uActiveCharacter )
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1821 pPlayers[uActiveCharacter]->PlaySound(SPEECH_81, 0);
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1822 }
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1823 window_SpeakInHouse->receives_keyboard_input_2 = WINDOW_INPUT_NONE;
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1824 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1825 return;
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1826 }
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1827 if (window_SpeakInHouse->receives_keyboard_input_2 == WINDOW_INPUT_CANCELLED)
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1828 {
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1829 window_SpeakInHouse->receives_keyboard_input_2 = WINDOW_INPUT_NONE;
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1830 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1831 }
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1832 return;
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1833 }
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1834 case HOUSE_DIALOGUE_BANK_GET_GOLD:
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1835 {
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1836 if ( window_SpeakInHouse->receives_keyboard_input_2 == WINDOW_INPUT_IN_PROGRESS)
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1837 {
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1838 sprintfex(pTmpBuf.data(), "%s\n%s", pGlobalTXT_LocalizationStrings[244], pGlobalTXT_LocalizationStrings[112]);//"Ñíÿòü" "Ñêîëüêî?"
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
1839 bank_window.DrawTitleText(pFontArrus, 0, 146, Color16(0xFFu, 0xFFu, 0x9Bu), pTmpBuf.data(), 3);
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
1840 bank_window.DrawTitleText(pFontArrus, 0, 186, Color16(0xFFu, 0xFFu, 0xFFu), (const char *)pKeyActionMap->pPressedKeysBuffer, 3);
1573
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1841 bank_window.DrawFlashingInputCursor(pFontArrus->GetLineWidth((const char *)pKeyActionMap->pPressedKeysBuffer) / 2 + 80, 185, pFontArrus);
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1842 return;
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1843 }
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1844 if ( window_SpeakInHouse->receives_keyboard_input_2 == WINDOW_INPUT_CONFIRMED)
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1845 {
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1846 window_SpeakInHouse->receives_keyboard_input_2 = WINDOW_INPUT_NONE;
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1847 entered_sum = atoi((const char *)pKeyActionMap->pPressedKeysBuffer);
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1848 takes_sum = entered_sum;
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1849 if ( entered_sum )
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1850 {
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1851 if ( entered_sum > pParty->uNumGoldInBank )
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1852 {
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1853 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1854 takes_sum = pParty->uNumGoldInBank;
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1855 }
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1856 if ( takes_sum )
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1857 {
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1858 Party::SetGold(pParty->uNumGold + takes_sum);
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1859 pParty->uNumGoldInBank -= takes_sum;
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1860 }
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1861 }
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1862 window_SpeakInHouse->receives_keyboard_input_2 = WINDOW_INPUT_NONE;
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1863 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1864 return;
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1865 }
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1866 if ( window_SpeakInHouse->receives_keyboard_input_2 == WINDOW_INPUT_CANCELLED)
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1867 {
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1868 window_SpeakInHouse->receives_keyboard_input_2 = WINDOW_INPUT_NONE;
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1869 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1870 }
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1871 return;
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1872 }
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1873 default:
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1874 {
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1875 break;
6d759814a817 BankDialog() cleaned
Ritor1
parents: 1545
diff changeset
1876 }
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1877 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1878 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1879 // F8B19C: using guessed type int dword_F8B19C;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1880
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1881 //----- (004B8285) --------------------------------------------------------
1458
934074e7fcc1 ModalWindow
Nomad
parents: 1445
diff changeset
1882 void TavernDialog()
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1883 {
1630
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
1884 int pPriceRoom;
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
1885 int pPriceFood;
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
1886 int pPriceSkill;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1887 int pItemNum;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1888 double v2; // st7@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1889 int pNumString; // edi@16
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1890 signed int v9; // esi@16
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1891 unsigned int pColorText; // eax@57
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1892 GUIButton *pButton; // eax@65
1630
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
1893 int pSkillCount;
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
1894 signed int pOptionsCount; // edi@77
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1895 signed int i; // esi@79
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2253
diff changeset
1896 // signed int v53; // edi@81
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1897 int v54; // edi@81
1630
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
1898 const char *pText; // [sp-4h] [bp-278h]@93
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1899 char pTopic1[100]; // [sp+Ch] [bp-268h]@55
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1900 char pTopic4[100]; // [sp+70h] [bp-204h]@59
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1901 char pTopic2[100]; // [sp+D4h] [bp-1A0h]@57
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1902 char pTopic3[100]; // [sp+138h] [bp-13Ch]@59
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1903 GUIWindow dialog_window; // [sp+1F0h] [bp-84h]@1
1630
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
1904 int v91; // [sp+270h] [bp-4h]@3
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
1905 unsigned int pTopic1Height; // [sp+26Fh] [bp-5h]@55
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
1906 unsigned __int8 pTopic2Height; // [sp+267h] [bp-Dh]@57
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1907 unsigned __int8 pTopic3Height; // [sp+253h] [bp-21h]@59
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1908 unsigned __int8 pTopic4Height;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1909 int pTextHeight;
1630
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
1910 int all_text_height; // [sp+260h] [bp-14h]@18
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
1911 GUIFont *pOutString;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1912
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1913 memcpy(&dialog_window, window_SpeakInHouse, sizeof(dialog_window));
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1914 dialog_window.uFrameX = 483;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1915 dialog_window.uFrameWidth = 148;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1916 dialog_window.uFrameZ = 334;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1917 v2 = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier;
1630
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
1918
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
1919 pPriceRoom = ((v2 * v2) / 10) * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100;
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
1920 if ( pPriceRoom < ((v2 * v2) / 10) / 3 )
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
1921 pPriceRoom = ((v2 * v2) / 10) / 3;
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
1922 if ( pPriceRoom <= 0 )
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
1923 pPriceRoom = 1;
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
1924
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
1925 pPriceFood = ((v2 * v2) * v2 / 100) * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100;
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
1926 if ( pPriceFood < ((v2 * v2) * v2 / 100) / 3 )
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
1927 pPriceFood = ((v2 * v2) * v2 / 100) / 3;
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
1928 if ( pPriceFood <= 0 )
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
1929 pPriceFood = 1;
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
1930
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1931
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1932 switch(dialog_menu_id)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1933 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1934 case HOUSE_DIALOGUE_MAIN:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1935 {
1393
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1313
diff changeset
1936 if ( !HouseUI_CheckIfPlayerCanInteract() )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1937 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1938
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
1939 sprintf(pTopic1, "\f%05d", pDialogueWindow->pCurrentPosActiveItem == 2 ? Color16(0xFFu, 0xFFu, 0x9Bu) : Color16(0xFFu, 0xFFu, 0xFFu));
1630
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
1940 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[178], pPriceRoom); // Rent room for %d gold
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1941 strcat(pTopic1, pTmpBuf2.data());
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1942 pTopic1Height = pFontArrus->CalcTextHeight(pTopic1, &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1943 strcat(pTopic1, "\n \n");
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1944
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
1945 sprintf(pTopic2, "\f%05d", pDialogueWindow->pCurrentPosActiveItem == 3 ? Color16(0xFFu, 0xFFu, 0x9Bu) : Color16(0xFFu, 0xFFu, 0xFFu));
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1946 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[86], // Buy food for %d days for %d gold
1630
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
1947 (unsigned int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier, pPriceFood);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1948 strcat(pTopic2, pTmpBuf2.data());
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1949 pTopic2Height = pFontArrus->CalcTextHeight(pTopic2, &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1950 strcat(pTopic2, "\n \n");
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1951
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
1952 sprintf(pTopic3, "\f%05d", pDialogueWindow->pCurrentPosActiveItem == 4 ? Color16(0xFFu, 0xFFu, 0x9Bu) : Color16(0xFFu, 0xFFu, 0xFFu));
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1953 strcat(pTopic3, pGlobalTXT_LocalizationStrings[160]); // Learn Skills
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1954 pTopic3Height = pFontArrus->CalcTextHeight(pTopic3, &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1955 strcat(pTopic3, "\n \n");
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1956 pTopic4[0] = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1957 if ( (signed int)window_SpeakInHouse->par1C >= 108 && (signed int)window_SpeakInHouse->par1C <= 120 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1958 {
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
1959 sprintf(pTopic4, "\f%05d", pDialogueWindow->pCurrentPosActiveItem == 5 ? Color16(0xFFu, 0xFFu, 0x9Bu) : Color16(0xFFu, 0xFFu, 0xFFu));
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1960 strcat(pTopic4, pGlobalTXT_LocalizationStrings[611]); // Play Arcomage
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1961 pTopic4Height = pFontArrus->CalcTextHeight(pTopic4, &dialog_window, 0, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1962 }
1610
Ritor1
parents: 1609
diff changeset
1963
Ritor1
parents: 1609
diff changeset
1964 if ( pDialogueWindow->pNumPresenceButton )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1965 {
1630
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
1966 for ( pItemNum = pDialogueWindow->pStartingPosActiveItem;
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
1967 pItemNum < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton; ++pItemNum )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1968 {
1630
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
1969 pButton = pDialogueWindow->GetControl(pItemNum);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1970 if ( pButton->msg_param == 15 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1971 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1972 pButton->uHeight = pTopic1Height;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1973 pButton->uY = 146;
1630
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
1974 pButton->uW = pTopic1Height + 145;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1975 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1976 else if ( pButton->msg_param == 16 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1977 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1978 pButton->uHeight = pTopic2Height;
1630
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
1979 pButton->uY = pTopic1Height + (LOBYTE(pFontArrus->uFontHeight) - 3) + 146;
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
1980 pButton->uW = (pTopic1Height + (LOBYTE(pFontArrus->uFontHeight) - 3) + 146) + pTopic2Height - 1;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1981 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1982 else if ( pButton->msg_param == 96 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1983 {
1630
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
1984 pButton->uY = pTopic1Height + pTopic2Height + 2 * (LOBYTE(pFontArrus->uFontHeight) - 3) + 146;
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
1985 pButton->uHeight = pTopic3Height;
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
1986 pButton->uW = pTopic3Height + (pTopic1Height + pTopic2Height + 2 * (LOBYTE(pFontArrus->uFontHeight) - 3) + 146) - 1;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1987 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1988 else if ( pButton->msg_param == 101 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1989 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1990 pButton->uHeight = pTopic4Height;
1630
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
1991 pButton->uY = pTopic1Height + 3 * (LOBYTE(pFontArrus->uFontHeight) - 3) + pTopic4Height + pTopic2Height + 146;
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
1992 pButton->uW = (pTopic1Height + 3 * (LOBYTE(pFontArrus->uFontHeight) - 3) + pTopic4Height + pTopic2Height + 146) + pTopic4Height - 1;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1993 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1994 }
1610
Ritor1
parents: 1609
diff changeset
1995 sprintfex(pTmpBuf.data(), "%s%s%s%s", pTopic1, pTopic2, pTopic3, pTopic4);
Ritor1
parents: 1609
diff changeset
1996 dialog_window.DrawTitleText(pFontArrus, 0, 146, 0, pTmpBuf.data(), 3);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1997 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1998 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
1999 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2000 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RULES:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2001 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2002 pOutString = pFontArrus;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2003 strcpy(pTmpBuf.data(), pNPCTopics[354].pText);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2004 dialog_window.uFrameWidth = game_viewport_width;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2005 dialog_window.uFrameZ = 452;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2006 pTextHeight = pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 12, 0) + 7;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2007 if ( 352 - pTextHeight < 8 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2008 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2009 pOutString = pFontCreate;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2010 pTextHeight = pFontCreate->CalcTextHeight(pTmpBuf.data(), &dialog_window, 12, 0) + 7;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2011 }
1630
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2012 pRenderer->GetLeather(8, 352 - pTextHeight, pIcons_LOD->GetTexture(uTextureID_Leather), pIcons_LOD->GetTexture(uTextureID_Leather)->uTextureHeight - pTextHeight);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2013 pRenderer->DrawTextureIndexed(8, 347 - pTextHeight, pTexture_591428);
1630
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2014 window_SpeakInHouse->DrawText(pOutString, 12, 354 - pTextHeight, 0, FitTextInAWindow(pTmpBuf.data(), pOutString, &dialog_window, 0xCu, 0), 0, 0, 0);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2015 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2016 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2017 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_VICTORY_CONDITIONS:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2018 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2019 strcpy(pTmpBuf.data(), pNPCTopics[(uint)window_SpeakInHouse->ptr_1C + 247].pText);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2020 dialog_window.uFrameWidth = game_viewport_width;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2021 dialog_window.uFrameZ = 452;
1630
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2022 pTextHeight = pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 12, 0) + 7;
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2023 pRenderer->GetLeather(8, 352 - pTextHeight, pIcons_LOD->GetTexture(uTextureID_Leather), pIcons_LOD->GetTexture(uTextureID_Leather)->uTextureHeight - pTextHeight);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2024 pRenderer->DrawTextureIndexed(8, 347 - pTextHeight, pTexture_591428);
1630
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2025 window_SpeakInHouse->DrawText(pFontArrus, 12, 354 - pTextHeight, 0,
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2026 FitTextInAWindow(pTmpBuf.data(), pFontArrus, &dialog_window, 0xCu, 0), 0, 0, 0);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2027 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2028 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2029 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RESULT:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2030 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2031 if ( pArcomageGame->bGameInProgress == 1 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2032 return;
2214
20995bb8895a GameResultsApply() full refactored
Ritor1
parents: 2185
diff changeset
2033 if ( pArcomageGame->uGameWinner )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2034 {
2214
20995bb8895a GameResultsApply() full refactored
Ritor1
parents: 2185
diff changeset
2035 if ( pArcomageGame->uGameWinner == 1 )
1630
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2036 pText = pGlobalTXT_LocalizationStrings[640];// You won!
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2037 else
1630
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2038 pText = pGlobalTXT_LocalizationStrings[641];// You lost!
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2039 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2040 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2041 {
1630
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2042 pText = pGlobalTXT_LocalizationStrings[639];// A tie!
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2043 }
1630
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2044 strcpy(pTmpBuf.data(), pText);
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2045 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 0, 0)) / 2 + 138,
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
2046 Color16(0xFFu, 0xFFu, 0x9Bu), pTmpBuf.data(), 3);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2047 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2048 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2049 case HOUSE_DIALOGUE_TAVERN_REST:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2050 {
1630
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2051 if ( pParty->uNumGold >= pPriceRoom )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2052 {
1630
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2053 Party::TakeGold(pPriceRoom);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2054 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
2022
03d9336e862f SOUND_WalkingOnTo3DModel
Ritor1
parents: 1920
diff changeset
2055 dialog_menu_id = HOUSE_DIALOGUE_NULL;
1919
140ca8123384 Tavern rest fix
Ritor1
parents: 1843
diff changeset
2056 HouseDialogPressCloseBtn();
1407
d4f57df4c299 PlayerSpeechID and uSpeakingCharacter
Ritor1
parents: 1396
diff changeset
2057 GetHouseGoodbyeSpeech();
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2058 pVideoPlayer->Unload();
2022
03d9336e862f SOUND_WalkingOnTo3DModel
Ritor1
parents: 1920
diff changeset
2059 /*if ( pMessageQueue_50CBD0->uNumMessages )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2060 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2061 pMessageQueue_50CBD0->pMessages[0].eType = UIMSG_RentRoom;
1630
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2062 pMessageQueue_50CBD0->pMessages[0].param = (int)window_SpeakInHouse->ptr_1C;//107
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2063 pMessageQueue_50CBD0->pMessages[0].field_8 = 1;
2022
03d9336e862f SOUND_WalkingOnTo3DModel
Ritor1
parents: 1920
diff changeset
2064 ++pMessageQueue_50CBD0->uNumMessages;*/
03d9336e862f SOUND_WalkingOnTo3DModel
Ritor1
parents: 1920
diff changeset
2065 pMessageQueue_50CBD0->AddMessage(UIMSG_RentRoom, (int)window_SpeakInHouse->ptr_1C, 1);
1630
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2066 window_SpeakInHouse->Release();
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2067 window_SpeakInHouse = 0;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2068 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2069 }
1630
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2070 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2);//Ó âàñ íå õâàòàåò çîëîòà
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2071 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_Goodbye);
1630
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2072 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2073 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2074 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2075
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2076 case HOUSE_DIALOGUE_LEARN_SKILLS:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2077 {
1393
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1313
diff changeset
2078 if ( !HouseUI_CheckIfPlayerCanInteract() )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2079 return;
1630
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2080 pSkillCount = 0;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2081 v9 = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0);
1630
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2082 pPriceSkill = v9 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100;
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2083 if ( pPriceSkill < v9 / 3 )
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2084 pPriceSkill = v9 / 3;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2085 all_text_height = 0;
1920
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1919
diff changeset
2086 for ( int i = pDialogueWindow->pStartingPosActiveItem;
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1919
diff changeset
2087 i < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton; ++i )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2088 {
1920
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1919
diff changeset
2089 if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][pDialogueWindow->GetControl(i)->msg_param - 36]
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1919
diff changeset
2090 && !pPlayers[uActiveCharacter]->pActiveSkills[pDialogueWindow->GetControl(i)->msg_param - 36] )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2091 {
1920
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1919
diff changeset
2092 all_text_height = pFontArrus->CalcTextHeight(pSkillNames[pDialogueWindow->GetControl(i)->msg_param - 36], &dialog_window, 0, 0);
1630
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2093 pSkillCount++;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2094 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2095 }
1630
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2096 if ( pSkillCount )
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2097 {
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2098 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], pPriceSkill);//Ñòîèìîñòü íàâûêà: %lu
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2099 dialog_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3);
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2100 v91 = (149 - all_text_height) / pSkillCount;
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2101 if ( (149 - all_text_height) / pSkillCount > 32 )
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2102 v91 = 32;
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2103 v54 = (149 - pSkillCount * v91 - all_text_height) / 2 - v91 / 2 + 162;
1920
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1919
diff changeset
2104 for ( int i = pDialogueWindow->pStartingPosActiveItem;
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1919
diff changeset
2105 i < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton; i++ )
1630
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2106 {
1920
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1919
diff changeset
2107 pButton = pDialogueWindow->GetControl(i);
1630
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2108 if ( !byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][pButton->msg_param - 36]
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2109 || pPlayers[uActiveCharacter]->pActiveSkills[pButton->msg_param - 36] )
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2110 {
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2111 pButton->uW = 0;
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2112 pButton->uHeight = 0;
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2113 pButton->uY = 0;
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2114 }
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2115 else
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2116 {
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2117 pButton->uY = v91 + v54;
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2118 pTextHeight = pFontArrus->CalcTextHeight(pSkillNames[pButton->msg_param - 36], &dialog_window, 0, 0);
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2119 pButton->uHeight = pTextHeight;
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2120 v54 = pTextHeight + pButton->uY - 1;
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2121 pButton->uW = v54;
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
2122 pColorText = Color16(0xFFu, 0xFFu, 0x9Bu);
1920
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1919
diff changeset
2123 if ( pDialogueWindow->pCurrentPosActiveItem != i )
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
2124 pColorText = Color16(0xFFu, 0xFFu, 0xFFu);
1630
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2125 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, pSkillNames[pButton->msg_param - 36], 3);
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2126 }
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2127 }
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2128 return;
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2129 }
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2130 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayers[uActiveCharacter]->pName,//Ñîâåòóþ âàì %s %s ïîèñêàòü çíàíèÿ åùå ãäå-íèáóäü
1610
Ritor1
parents: 1609
diff changeset
2131 pClassNames[pPlayers[uActiveCharacter]->classType]);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2132 strcat(pTmpBuf.data(), "\n \n");
1630
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2133 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);//Áîëüøå íè÷åãî íå ìîãó ïðåäëîæèòü.
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2134 pTextHeight = (174 - pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 0, 0)) / 2 + 138;
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
2135 dialog_window.DrawTitleText(pFontArrus, 0, pTextHeight, Color16(0xFFu, 0xFFu, 0x9Bu), pTmpBuf.data(), 3);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2136 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2137 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2138
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2139 case HOUSE_DIALOGUE_TAVERN_BUY_FOOD:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2140 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2141 if ( (double)pParty->uNumFoodRations >= p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2142 {
1630
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2143 ShowStatusBarString(pGlobalTXT_LocalizationStrings[140], 2);//Âû óæå êóïèëè åäó!
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2144 if ( uActiveCharacter )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2145 pPlayers[uActiveCharacter]->PlaySound(SPEECH_67, 0);
1630
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2146 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2147 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2148 }
1630
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2149 if ( pParty->uNumGold >= pPriceFood )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2150 {
1630
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2151 Party::TakeGold(pPriceFood);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2152 pParty->uNumFoodRations = (signed __int64)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2153 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_Greeting_2);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2154 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2155 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2156 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2157 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2); // "You don't have enough gold"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2158 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_Goodbye);
1630
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2159 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2160 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2161 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2162
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2163 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_MAIN:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2164 {
1393
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1313
diff changeset
2165 if ( HouseUI_CheckIfPlayerCanInteract() )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2166 {
1630
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2167 pOptionsCount = 2;
1843
2e6d3cd052e0 some char* cast removal + adding const_casts where appropriate
Grumpy7
parents: 1838
diff changeset
2168 pShopOptions[0] = const_cast<char *>(pGlobalTXT_LocalizationStrings[620]);//Ïðàâèëà
2e6d3cd052e0 some char* cast removal + adding const_casts where appropriate
Grumpy7
parents: 1838
diff changeset
2169 pShopOptions[1] = const_cast<char *>(pGlobalTXT_LocalizationStrings[622]);//Óñëîâèÿ ïîáåäû
1630
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2170 if ( pParty->HasItem(651) )//651 - Êîëîäà äëÿ èãðû â ÀðêîÌýéäæ â Items.txt
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2171 {
1843
2e6d3cd052e0 some char* cast removal + adding const_casts where appropriate
Grumpy7
parents: 1838
diff changeset
2172 pShopOptions[2] = const_cast<char *>(pGlobalTXT_LocalizationStrings[621]);//Èãðàòü
1630
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2173 pOptionsCount = 3;
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2174 }
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2175 for ( i = 0; i < pOptionsCount; ++i )
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2176 all_text_height = pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0);
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2177 all_text_height = (174 - all_text_height) / pOptionsCount;
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2178
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2179 v54 = (174 - pOptionsCount * (174 - all_text_height) / pOptionsCount - all_text_height) / 2 - (174 - all_text_height) / pOptionsCount / 2 + 138;
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2180 pNumString = 0;
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2181 for ( pItemNum = pDialogueWindow->pStartingPosActiveItem;
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2182 pItemNum < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem ; pItemNum++ )
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2183 {
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2184 pButton = pDialogueWindow->GetControl(pItemNum);
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2185 pButton->uY = all_text_height + v54;
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2186 pTextHeight = pFontArrus->CalcTextHeight((const char *)pShopOptions[pNumString], &dialog_window, 0, 0);
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2187 pButton->uHeight = pTextHeight;
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2188 v54 = pButton->uY + pTextHeight - 1;
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2189 pButton->uW = v54;
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
2190 pColorText = Color16(0xFFu, 0xFFu, 0x9Bu);
1630
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2191 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum )
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
2192 pColorText = Color16(0xFFu, 0xFFu, 0xFFu);
1630
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2193 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, (const char *)pShopOptions[pNumString], 3);
ee4a65ac9d21 TavernDialog cleared
Ritor1
parents: 1629
diff changeset
2194 ++pNumString;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2195 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2196 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2197 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2198 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2199 default:
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2200 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2201 break;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2202 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2203 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2204 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2205
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2206 //----- (004B705E) --------------------------------------------------------
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2207 void TempleDialog()
1612
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2208 {
1622
Ritor1
parents: 1612
diff changeset
2209 int pPrice; // edi@1
Ritor1
parents: 1612
diff changeset
2210 int pTextHeight; // eax@11
Ritor1
parents: 1612
diff changeset
2211 unsigned __int16 pTextColor; // ax@21
Ritor1
parents: 1612
diff changeset
2212 DDM_DLV_Header *v26; // edi@29
Ritor1
parents: 1612
diff changeset
2213 unsigned int v30; // edx@36
Ritor1
parents: 1612
diff changeset
2214 int v35; // edi@50
Ritor1
parents: 1612
diff changeset
2215 GUIButton *pButton; // edi@64
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2253
diff changeset
2216 // int v47; // edi@71
1622
Ritor1
parents: 1612
diff changeset
2217 GUIWindow tample_window; // [sp+13Ch] [bp-88h]@1
Ritor1
parents: 1612
diff changeset
2218 unsigned __int8 index; // [sp+1B7h] [bp-Dh]@64
Ritor1
parents: 1612
diff changeset
2219 int v64; // [sp+1B8h] [bp-Ch]@6
Ritor1
parents: 1612
diff changeset
2220 unsigned int pCurrentItem; // [sp+1BCh] [bp-8h]@6
Ritor1
parents: 1612
diff changeset
2221 int all_text_height; // [sp+1C0h] [bp-4h]@6
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2222
1612
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2223 memcpy(&tample_window, window_SpeakInHouse, sizeof(tample_window));
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2224 tample_window.uFrameX = 483;
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2225 tample_window.uFrameWidth = 148;
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2226 tample_window.uFrameZ = 334;
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2227 pPrice = pPlayers[uActiveCharacter]->GetTempleHealCostModifier(p2DEvents[window_SpeakInHouse->par1C - 1].fPriceMultiplier);
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2228 if ( dialog_menu_id == HOUSE_DIALOGUE_MAIN )
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2229 {
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2230 index = 1;
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2231 pButton = pDialogueWindow->GetControl(pDialogueWindow->pStartingPosActiveItem);
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2232 pButton->uHeight = 0;
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2233 pButton->uY = 0;
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2234 if ( pPlayers[uActiveCharacter]->IsPlayerHealableByTemple() )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2235 {
1612
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2236 sprintfex(pTmpBuf.data(), "%s %d %s", pGlobalTXT_LocalizationStrings[104], pPrice, pGlobalTXT_LocalizationStrings[97]);//"Ëå÷èòü" "Çîëîòî"
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2237 pShopOptions[0] = pTmpBuf.data();
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2238 index = 0;
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2239 }
1843
2e6d3cd052e0 some char* cast removal + adding const_casts where appropriate
Grumpy7
parents: 1838
diff changeset
2240 pShopOptions[1] = const_cast<char *>(pGlobalTXT_LocalizationStrings[68]);//"Ïîæåðòâîâàòü"
2e6d3cd052e0 some char* cast removal + adding const_casts where appropriate
Grumpy7
parents: 1838
diff changeset
2241 pShopOptions[2] = const_cast<char *>(pGlobalTXT_LocalizationStrings[160]);//"Îáó÷èòüñÿ íàâûêàì"
1612
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2242 all_text_height = 0;
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2243 if ( index < pDialogueWindow->pNumPresenceButton )
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2244 {
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2245 uint i = index;
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2246 for ( uint j = index; j < pDialogueWindow->pNumPresenceButton; ++j )
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2247 {
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2248 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[1 * i], &tample_window, 0, 0);
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2249 i++;
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2250 }
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2251 }
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2252 v64 = (174 - (signed int)all_text_height) / (pDialogueWindow->pNumPresenceButton - index);
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2253 if ( v64 > 32 )
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2254 v64 = 32;
1622
Ritor1
parents: 1612
diff changeset
2255 all_text_height = (174 - v64 * (pDialogueWindow->pNumPresenceButton - index) - (signed int)all_text_height) / 2 - v64 / 2 + 138;
1612
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2256 if ( index + pDialogueWindow->pStartingPosActiveItem < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton )
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2257 {
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2258 uint i = index;
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2259 for ( pCurrentItem = index + pDialogueWindow->pStartingPosActiveItem;
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2260 (signed int)pCurrentItem < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem; ++pCurrentItem )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2261 {
1612
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2262 pButton = pDialogueWindow->GetControl(pCurrentItem);
1622
Ritor1
parents: 1612
diff changeset
2263 pButton->uY = v64 + all_text_height;
1612
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2264 pTextHeight = pFontArrus->CalcTextHeight(pShopOptions[1 * i], &tample_window, 0, 0);
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2265 pButton->uHeight = pTextHeight;
1622
Ritor1
parents: 1612
diff changeset
2266 pButton->uW = pButton->uY + pTextHeight - 1;
Ritor1
parents: 1612
diff changeset
2267 all_text_height = pButton->uW;
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
2268 pTextColor = Color16(0xFFu, 0xFFu, 0x9Bu);
1612
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2269 if ( pDialogueWindow->pCurrentPosActiveItem != index + 2 )
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
2270 pTextColor = Color16(0xFFu, 0xFFu, 0xFFu);
1622
Ritor1
parents: 1612
diff changeset
2271 tample_window.DrawTitleText(pFontArrus, 0, pButton->uY, pTextColor, pShopOptions[1 * i], 3);
1612
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2272 i++;
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2273 index++;
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2274 }
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2275 }
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2276 return;
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2277 }
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2278 //-------------------------------------------------
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2279 if ( dialog_menu_id == HOUSE_DIALOGUE_TEMPLE_HEAL )
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2280 {
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2281 if ( !pPlayers[uActiveCharacter]->IsPlayerHealableByTemple() )
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2282 return;
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2283 if ( pParty->uNumGold < pPrice )
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2284 {
1622
Ritor1
parents: 1612
diff changeset
2285 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2);//"Ó âàñ íå õâàòàåò çîëîòà"
1612
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2286 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
1622
Ritor1
parents: 1612
diff changeset
2287 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
1612
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2288 return;
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2289 }
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2290 Party::TakeGold(pPrice);
2057
b7485a6502f2 AgressorAtackInfo
Ritor1
parents: 2022
diff changeset
2291 v35 = LODWORD(pPlayers[uActiveCharacter]->pConditions[Condition_Zombie]);
1612
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2292 memset(pPlayers[uActiveCharacter], 0, 0xA0u);
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2293 pPlayers[uActiveCharacter]->sHealth = pPlayers[uActiveCharacter]->GetMaxHealth();
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2294 pPlayers[uActiveCharacter]->sMana = pPlayers[uActiveCharacter]->GetMaxMana();
1622
Ritor1
parents: 1612
diff changeset
2295 if ( (signed int)window_SpeakInHouse->ptr_1C != 78 && ((signed int)window_SpeakInHouse->ptr_1C <= 80 || (signed int)window_SpeakInHouse->ptr_1C > 82) )
1612
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2296 {
2185
385040580292 CastSpell continue
Ritor1
parents: 2153
diff changeset
2297 if ( (unsigned int)pPlayers[uActiveCharacter]->pConditions[Condition_Zombie] | v35 )// åñëè ñîñòîÿíèå çîìáè
1612
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2298 {
1622
Ritor1
parents: 1612
diff changeset
2299 pPlayers[uActiveCharacter]->uCurrentFace = pPlayers[uActiveCharacter]->uPrevFace;
Ritor1
parents: 1612
diff changeset
2300 pPlayers[uActiveCharacter]->uVoiceID = pPlayers[uActiveCharacter]->uPrevVoiceID;
Ritor1
parents: 1612
diff changeset
2301 ReloadPlayerPortraits(uActiveCharacter - 1, pPlayers[uActiveCharacter]->uPrevFace);
1612
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2302 }
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2303 pAudioPlayer->PlaySound((SoundID)(SOUND_GoldReceived|0x2), -1, 0, -1, 0, 0, 0, 0);
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2304 pPlayers[uActiveCharacter]->PlaySound(SPEECH_82, 0);
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2305 pOtherOverlayList->_4418B1(20, uActiveCharacter + 99, 0, 65536);
1622
Ritor1
parents: 1612
diff changeset
2306 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
1612
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2307 return;
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2308 }
2057
b7485a6502f2 AgressorAtackInfo
Ritor1
parents: 2022
diff changeset
2309 if ( (unsigned int)pPlayers[uActiveCharacter]->pConditions[Condition_Zombie] | v35 )
b7485a6502f2 AgressorAtackInfo
Ritor1
parents: 2022
diff changeset
2310 LODWORD(pPlayers[uActiveCharacter]->pConditions[Condition_Zombie]) = v35;
1612
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2311 else
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2312 {
2057
b7485a6502f2 AgressorAtackInfo
Ritor1
parents: 2022
diff changeset
2313 if ( !pPlayers[uActiveCharacter]->pConditions[Condition_Eradicated]
b7485a6502f2 AgressorAtackInfo
Ritor1
parents: 2022
diff changeset
2314 && !pPlayers[uActiveCharacter]->pConditions[Condition_Pertified] && !pPlayers[uActiveCharacter]->pConditions[Condition_Dead] )
1612
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2315 {
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2316 pAudioPlayer->PlaySound((SoundID)(SOUND_GoldReceived|0x2), -1, 0, -1, 0, 0, 0, 0);
1612
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2317 pPlayers[uActiveCharacter]->PlaySound(SPEECH_82, 0);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2318 pOtherOverlayList->_4418B1(20, uActiveCharacter + 99, 0, 65536);
1622
Ritor1
parents: 1612
diff changeset
2319 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
1612
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2320 return;
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2321 }
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2322 pPlayers[uActiveCharacter]->uPrevFace = pPlayers[uActiveCharacter]->uCurrentFace;
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2323 pPlayers[uActiveCharacter]->uPrevVoiceID = pPlayers[uActiveCharacter]->uVoiceID;
2185
385040580292 CastSpell continue
Ritor1
parents: 2153
diff changeset
2324 pPlayers[uActiveCharacter]->SetCondition(Condition_Zombie, 1);
1612
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2325 pPlayers[uActiveCharacter]->uVoiceID = (pPlayers[uActiveCharacter]->GetSexByVoice() != 0) + 23;
1622
Ritor1
parents: 1612
diff changeset
2326 pPlayers[uActiveCharacter]->uCurrentFace = (pPlayers[uActiveCharacter]->GetSexByVoice() != 0) + 23;
Ritor1
parents: 1612
diff changeset
2327 ReloadPlayerPortraits(uActiveCharacter - 1, (pPlayers[uActiveCharacter]->GetSexByVoice() != 0) + 23);
2185
385040580292 CastSpell continue
Ritor1
parents: 2153
diff changeset
2328 pPlayers[uActiveCharacter]->pConditions[Condition_Zombie] = pParty->uTimePlayed;
1622
Ritor1
parents: 1612
diff changeset
2329 //v39 = (GUIWindow *)HIDWORD(pParty->uTimePlayed);
1612
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2330 }
2057
b7485a6502f2 AgressorAtackInfo
Ritor1
parents: 2022
diff changeset
2331 //HIDWORD(pPlayers[uActiveCharacter]->pConditions[Condition_Zombie]) = (int)v39;
2185
385040580292 CastSpell continue
Ritor1
parents: 2153
diff changeset
2332 pPlayers[uActiveCharacter]->pConditions[Condition_Zombie] = pParty->uTimePlayed;
1612
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2333 pAudioPlayer->PlaySound((SoundID)(SOUND_GoldReceived|0x2), -1, 0, -1, 0, 0, 0, 0);
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2334 pPlayers[uActiveCharacter]->PlaySound(SPEECH_82, 0);
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2335 pOtherOverlayList->_4418B1(20, uActiveCharacter + 99, 0, 65536);
1622
Ritor1
parents: 1612
diff changeset
2336 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
1612
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2337 return;
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2338 }
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2339 //---------------------------------------------------
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2340 if ( dialog_menu_id == HOUSE_DIALOGUE_TEMPLE_DONATE )
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2341 {
1622
Ritor1
parents: 1612
diff changeset
2342 pPrice = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier;
Ritor1
parents: 1612
diff changeset
2343 if ( pParty->uNumGold >= (unsigned int)pPrice )
Ritor1
parents: 1612
diff changeset
2344 {
Ritor1
parents: 1612
diff changeset
2345 Party::TakeGold((unsigned int)pPrice);
Ritor1
parents: 1612
diff changeset
2346 v26 = &pOutdoor->ddm;
Ritor1
parents: 1612
diff changeset
2347 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor )
Ritor1
parents: 1612
diff changeset
2348 v26 = &pIndoor->dlv;
Ritor1
parents: 1612
diff changeset
2349 if ( v26->uReputation > -5 )
1612
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2350 {
1622
Ritor1
parents: 1612
diff changeset
2351 v26->uReputation = v26->uReputation - 1;
Ritor1
parents: 1612
diff changeset
2352 if ( v26->uReputation - 1 < -5 )
Ritor1
parents: 1612
diff changeset
2353 v26->uReputation = -5;
Ritor1
parents: 1612
diff changeset
2354 }
Ritor1
parents: 1612
diff changeset
2355 if ( (unsigned __int8)byte_F8B1EF[uActiveCharacter] == pParty->uDaysPlayed % 7 )
Ritor1
parents: 1612
diff changeset
2356 {
Ritor1
parents: 1612
diff changeset
2357 if ( v26->uReputation <= -5 )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2358 {
1622
Ritor1
parents: 1612
diff changeset
2359 v30 = pParty->uDaysPlayed % 7 + 1;
Ritor1
parents: 1612
diff changeset
2360 LOBYTE(v30) = v30 | 0x80;
Ritor1
parents: 1612
diff changeset
2361 _42777D_CastSpell_UseWand_ShootArrow(SPELL_AIR_WIZARD_EYE, uActiveCharacter - 1, v30, 48, 0);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2362 }
1622
Ritor1
parents: 1612
diff changeset
2363 if ( v26->uReputation <= -10 )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2364 {
1622
Ritor1
parents: 1612
diff changeset
2365 v30 = pParty->uDaysPlayed % 7 + 1;
Ritor1
parents: 1612
diff changeset
2366 LOBYTE(v30) = v30 | 0x80;
Ritor1
parents: 1612
diff changeset
2367 _42777D_CastSpell_UseWand_ShootArrow(SPELL_SPIRIT_PRESERVATION, uActiveCharacter - 1, v30, 48, 0);
Ritor1
parents: 1612
diff changeset
2368 }
Ritor1
parents: 1612
diff changeset
2369 if ( v26->uReputation <= -15 )
Ritor1
parents: 1612
diff changeset
2370 {
Ritor1
parents: 1612
diff changeset
2371 v30 = pParty->uDaysPlayed % 7 + 1;
Ritor1
parents: 1612
diff changeset
2372 LOBYTE(v30) = v30 | 0x80;
Ritor1
parents: 1612
diff changeset
2373 _42777D_CastSpell_UseWand_ShootArrow(SPELL_BODY_PROTECTION_FROM_MAGIC, uActiveCharacter - 1, v30, 48, 0);
Ritor1
parents: 1612
diff changeset
2374 }
Ritor1
parents: 1612
diff changeset
2375 if ( v26->uReputation <= -20 )
Ritor1
parents: 1612
diff changeset
2376 {
Ritor1
parents: 1612
diff changeset
2377 v30 = pParty->uDaysPlayed % 7 + 1;
Ritor1
parents: 1612
diff changeset
2378 LOBYTE(v30) = v30 | 0x80;
Ritor1
parents: 1612
diff changeset
2379 _42777D_CastSpell_UseWand_ShootArrow(SPELL_LIGHT_HOUR_OF_POWER, uActiveCharacter - 1, v30, 48, 0);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2380 }
1622
Ritor1
parents: 1612
diff changeset
2381 if ( v26->uReputation <= -25 )
Ritor1
parents: 1612
diff changeset
2382 {
Ritor1
parents: 1612
diff changeset
2383 v30 = pParty->uDaysPlayed % 7 + 1;
Ritor1
parents: 1612
diff changeset
2384 LOBYTE(v30) = v30 | 0x80;
Ritor1
parents: 1612
diff changeset
2385 _42777D_CastSpell_UseWand_ShootArrow(SPELL_LIGHT_DAY_OF_PROTECTION, uActiveCharacter - 1, v30, 48, 0);
Ritor1
parents: 1612
diff changeset
2386 }
1612
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2387 }
1622
Ritor1
parents: 1612
diff changeset
2388 ++byte_F8B1EF[uActiveCharacter];
Ritor1
parents: 1612
diff changeset
2389 pPlayers[uActiveCharacter]->PlaySound(SPEECH_83, 0);
Ritor1
parents: 1612
diff changeset
2390 ShowStatusBarString(pGlobalTXT_LocalizationStrings[527], 2); // "Thank You!"
Ritor1
parents: 1612
diff changeset
2391 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
1612
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2392 return;
1622
Ritor1
parents: 1612
diff changeset
2393 }
Ritor1
parents: 1612
diff changeset
2394 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2);//"Ó âàñ íå õâàòàåò çîëîòà"
Ritor1
parents: 1612
diff changeset
2395 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
Ritor1
parents: 1612
diff changeset
2396 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
Ritor1
parents: 1612
diff changeset
2397 return;
1612
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2398 }
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2399 //------------------------------------------------
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2400 if ( dialog_menu_id == HOUSE_DIALOGUE_LEARN_SKILLS )
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2401 {
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2402 if ( HouseUI_CheckIfPlayerCanInteract() )
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2403 {
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2404 all_text_height = 0;
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2405 pCurrentItem = (signed __int64)(p2DEvents[(signed int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0);
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2406 v64 = (signed int)(pCurrentItem * (100 - pPlayers[uActiveCharacter]->GetMerchant())) / 100;
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2407 if ( v64 < (signed int)pCurrentItem / 3 )
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2408 v64 = (signed int)pCurrentItem / 3;
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2409 pCurrentItem = 0;
1622
Ritor1
parents: 1612
diff changeset
2410 for ( int i = pDialogueWindow->pStartingPosActiveItem; i < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem; ++i )
1612
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2411 {
1622
Ritor1
parents: 1612
diff changeset
2412 if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][pDialogueWindow->GetControl(i)->msg_param - 36]
Ritor1
parents: 1612
diff changeset
2413 && !pPlayers[uActiveCharacter]->pActiveSkills[pDialogueWindow->GetControl(i)->msg_param - 36] )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2414 {
1622
Ritor1
parents: 1612
diff changeset
2415 all_text_height += pFontArrus->CalcTextHeight(pSkillNames[pDialogueWindow->GetControl(i)->msg_param - 36], &tample_window, 0, 0);
1612
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2416 ++pCurrentItem;
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2417 }
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2418 }
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2419 if ( pCurrentItem )
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2420 {
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2421 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], v64);
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2422 tample_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3);
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2423 v64 = (149 - (signed int)all_text_height) / (signed int)pCurrentItem;
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2424 if ( v64 > 32 )
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2425 v64 = 32;
1622
Ritor1
parents: 1612
diff changeset
2426 all_text_height = (signed int)(149 - pCurrentItem * v64 - (int)all_text_height) / 2 - v64 / 2 + 162;
Ritor1
parents: 1612
diff changeset
2427 if ( pDialogueWindow->pStartingPosActiveItem < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton )
1612
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2428 {
1622
Ritor1
parents: 1612
diff changeset
2429 pCurrentItem = 2;
Ritor1
parents: 1612
diff changeset
2430 for ( int i = pDialogueWindow->pStartingPosActiveItem;
Ritor1
parents: 1612
diff changeset
2431 i < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem; ++i )
1612
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2432 {
1622
Ritor1
parents: 1612
diff changeset
2433 pButton = pDialogueWindow->GetControl(i);
Ritor1
parents: 1612
diff changeset
2434 if ( !byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][pButton->msg_param - 36]
Ritor1
parents: 1612
diff changeset
2435 || pPlayers[uActiveCharacter]->pActiveSkills[pButton->msg_param - 36] )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2436 {
1622
Ritor1
parents: 1612
diff changeset
2437 pButton->uW = 0;
Ritor1
parents: 1612
diff changeset
2438 pButton->uHeight = 0;
Ritor1
parents: 1612
diff changeset
2439 pButton->uY = 0;
1612
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2440 }
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2441 else
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2442 {
1622
Ritor1
parents: 1612
diff changeset
2443 pButton->uY = v64 + all_text_height;
Ritor1
parents: 1612
diff changeset
2444 pTextHeight = pFontArrus->CalcTextHeight(pSkillNames[pButton->msg_param - 36], &tample_window, 0, 0);
Ritor1
parents: 1612
diff changeset
2445 pButton->uHeight = pTextHeight;
Ritor1
parents: 1612
diff changeset
2446 pButton->uW = pButton->uY + pTextHeight - 1;
Ritor1
parents: 1612
diff changeset
2447 all_text_height = pButton->uW;
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
2448 pTextColor = Color16(0xFFu, 0xFFu, 0x9Bu);
1622
Ritor1
parents: 1612
diff changeset
2449 if ( pDialogueWindow->pCurrentPosActiveItem != pCurrentItem )
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
2450 pTextColor = Color16(0xFFu, 0xFFu, 0xFFu);
1622
Ritor1
parents: 1612
diff changeset
2451 tample_window.DrawTitleText(pFontArrus, 0, pButton->uY, pTextColor, pSkillNames[pButton->msg_param - 36], 3);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2452 }
1622
Ritor1
parents: 1612
diff changeset
2453 pCurrentItem++;
1612
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2454 }
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2455 }
1612
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2456 }
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2457 else
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2458 {
1624
15667a0ec5b9 TampleDialog() cleaning
Ritor1
parents: 1622
diff changeset
2459 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayers[uActiveCharacter]->pName, pClassNames[pPlayers[uActiveCharacter]->classType]);//"Ñîâåòóþ âàì %s %s ïîèñêàòü çíàíèÿ åùå ãäå-íèáóäü"
1612
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2460 strcat(pTmpBuf.data(), "\n \n");
1624
15667a0ec5b9 TampleDialog() cleaning
Ritor1
parents: 1622
diff changeset
2461 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);//"Áîëüøå íè÷åãî íå ìîãó ïðåäëîæèòü."
1612
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2462 pTextHeight = pFontArrus->CalcTextHeight(pTmpBuf.data(), &tample_window, 0, 0);
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
2463 tample_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, Color16(0xFFu, 0xFFu, 0x9Bu), pTmpBuf.data(), 3);
1612
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2464 }
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2465 }
1612
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2466 }
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2467 return;
11f12a34b397 TampleDialog(cleaning continue)
Ritor1
parents: 1610
diff changeset
2468 }
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2469
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2470 //----- (004B4710) --------------------------------------------------------
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2471 void TrainingDialog()
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2472 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2473 unsigned __int64 v5; // edi@3
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2474 int v8; // edx@4
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2475 double v9; // st7@6
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2476 signed int v10; // esi@6
1625
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2477 int pPrice; // ecx@6
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2478 signed int v14; // esi@14
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2253
diff changeset
2479 // int v16; // eax@16
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2480 int v19; // ecx@24
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2481 int v33; // eax@36
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2482 unsigned int v36; // eax@38
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2483 unsigned int v42; // eax@46
1625
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2484 int index;
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2485 int all_text_height; // eax@68
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2486 int v49; // ebx@69
1625
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2487 GUIButton *pButton; // eax@71
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2488 int pTextHeight; // eax@71
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2489 unsigned __int16 pTextColor; // ax@71
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2490 GUIWindow training_dialog_window; // [sp+Ch] [bp-78h]@1
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2491 int v69; // [sp+70h] [bp-14h]@6
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2492 int v73; // [sp+80h] [bp-4h]@14
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2493
1625
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2494 memcpy(&training_dialog_window, window_SpeakInHouse, sizeof(training_dialog_window));
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2495 training_dialog_window.uFrameX = 483;
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2496 training_dialog_window.uFrameWidth = 148;
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2497 training_dialog_window.uFrameZ = 334;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2498 v5 = 1000ui64 * pPlayers[uActiveCharacter]->uLevel * (pPlayers[uActiveCharacter]->uLevel + 1) / 2; // E n = n(n + 1) / 2
1634
Ritor1
parents: 1630
diff changeset
2499 //v68 = pMaxLevelPerTrainingHallType[(unsigned int)window_SpeakInHouse->ptr_1C - HOUSE_TRAINING_HALL_EMERALD_ISLE];
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2500 if (pPlayers[uActiveCharacter]->uExperience >= v5)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2501 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2502 v8 = pPlayers[uActiveCharacter]->classType % 4 + 1;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2503 if ( v8 == 4 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2504 v8 = 3;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2505 v9 = (double)pPlayers[uActiveCharacter]->uLevel;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2506 v69 = v8;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2507 v10 = (signed __int64)(v9 * p2DEvents[(signed int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier * (double)v8);
1625
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2508 pPrice = v10 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100;
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2509 if ( pPrice < v10 / 3 )
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2510 pPrice = v10 / 3;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2511 }
1625
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2512 //-------------------------------------------------------
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2513 all_text_height = 0;
1393
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1313
diff changeset
2514 if (HouseUI_CheckIfPlayerCanInteract())
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2515 {
1625
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2516 if ( dialog_menu_id == HOUSE_DIALOGUE_MAIN )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2517 {
1625
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2518 if (HouseUI_CheckIfPlayerCanInteract())
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2519 {
1625
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2520 index = 0;
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2521 pShopOptions[0] = pTmpBuf.data();
1843
2e6d3cd052e0 some char* cast removal + adding const_casts where appropriate
Grumpy7
parents: 1838
diff changeset
2522 pShopOptions[1] = const_cast<char *>(pGlobalTXT_LocalizationStrings[160]);// "Learn Skills"
1625
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2523 if ( pDialogueWindow->pStartingPosActiveItem < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2524 {
1625
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2525 for ( int i = pDialogueWindow->pStartingPosActiveItem;
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2526 i < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem; ++i )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2527 {
1625
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2528 if ( pDialogueWindow->GetControl(i)->msg_param == HOUSE_DIALOGUE_TRAININGHALL_TRAIN )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2529 {
1634
Ritor1
parents: 1630
diff changeset
2530 if (pPlayers[uActiveCharacter]->uLevel >= pMaxLevelPerTrainingHallType[(unsigned int)window_SpeakInHouse->ptr_1C - HOUSE_TRAINING_HALL_EMERALD_ISLE])
1625
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2531 sprintfex(pShopOptions[index], "%s\n \n%s", 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."
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2532 else
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2533 {
1625
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2534 if (pPlayers[uActiveCharacter]->uExperience < v5)
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2535 sprintfex(pShopOptions[index], pGlobalTXT_LocalizationStrings[538], (uint)(v5 - pPlayers[uActiveCharacter]->uExperience), pPlayers[uActiveCharacter]->uLevel + 1); // "You need %d more experience to train to level %d"
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2536 else
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2537 sprintfex(pShopOptions[index], pGlobalTXT_LocalizationStrings[537], pPlayers[uActiveCharacter]->uLevel + 1, pPrice); // "Train to level %d for %d gold"
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2538 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2539 }
1625
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2540 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[index], &training_dialog_window, 0, 0);
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2541 ++index;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2542 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2543 }
1625
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2544 v49 = (2 * (87 - (174 - all_text_height) / 2) - all_text_height) / 2 - (174 - all_text_height) / 2 / 2 + 138;
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2545 if (pDialogueWindow->pStartingPosActiveItem < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton)
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2546 {
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2547 index = 0;
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2548 for ( int i = pDialogueWindow->pStartingPosActiveItem;
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2549 i < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton; ++i )
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2550 {
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2551 pButton = pDialogueWindow->GetControl(i);
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2552 pButton->uY = (174 - all_text_height) / 2 + v49;
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2553 pTextHeight = pFontArrus->CalcTextHeight(pShopOptions[index], &training_dialog_window, 0, 0);
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2554 pButton->uHeight = pTextHeight;
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2555 pButton->uW = pTextHeight + pButton->uY - 1;
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2556 v49 = pButton->uW;
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
2557 pTextColor = Color16(0xE1u, 0xCDu, 0x23u);
1634
Ritor1
parents: 1630
diff changeset
2558 if ( pDialogueWindow->pCurrentPosActiveItem != i )
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
2559 pTextColor = Color16(255, 255, 255);
1625
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2560 training_dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pTextColor, pShopOptions[index], 3);
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2561 ++index;
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2562 }
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2563 }
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2564 }
1625
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2565 }
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2566 //------------------------------------------------------------------
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2567 if ( dialog_menu_id == HOUSE_DIALOGUE_TRAININGHALL_TRAIN )
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2568 {
1393
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1313
diff changeset
2569 if ( !HouseUI_CheckIfPlayerCanInteract() )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2570 {
1625
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2571 v33 = pFontArrus->CalcTextHeight(pNPCTopics[122].pText, &training_dialog_window, 0, 0);
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
2572 training_dialog_window.DrawTitleText(pFontArrus, 0, (212 - v33) / 2 + 101, Color16(0xE1u, 0xCDu, 0x23u), pNPCTopics[122].pText, 3);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2573 pDialogueWindow->pNumPresenceButton = 0;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2574 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2575 }
1634
Ritor1
parents: 1630
diff changeset
2576 if ( pPlayers[uActiveCharacter]->uLevel < pMaxLevelPerTrainingHallType[(unsigned int)window_SpeakInHouse->ptr_1C - HOUSE_TRAINING_HALL_EMERALD_ISLE] )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2577 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2578 if ( (signed __int64)pPlayers[uActiveCharacter]->uExperience >= v5 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2579 {
1625
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2580 if ( pParty->uNumGold >= pPrice)
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2581 {
1625
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2582 Party::TakeGold(pPrice);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2583 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2584 ++pPlayers[uActiveCharacter]->uLevel;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2585 pPlayers[uActiveCharacter]->uSkillPoints += pPlayers[uActiveCharacter]->uLevel / 10 + 5;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2586 pPlayers[uActiveCharacter]->sHealth = pPlayers[uActiveCharacter]->GetMaxHealth();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2587 pPlayers[uActiveCharacter]->sMana = pPlayers[uActiveCharacter]->GetMaxMana();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2588 uint max_level_in_party = player_levels[0];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2589 for (uint _it = 1; _it < 4; ++_it)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2590 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2591 if (player_levels[_it] > max_level_in_party)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2592 max_level_in_party = player_levels[_it];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2593 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2594 ++player_levels[uActiveCharacter - 1];
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2595 if (player_levels[uActiveCharacter - 1] > max_level_in_party) // if we reach new maximum party level
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2596 // feature is broken thou, since this array is always zeroed in EnterHouse
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2597 {
1625
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2598 v42 = 60 * (_494820_training_time(pParty->uCurrentHour) + 4) - pParty->uCurrentMinute;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2599 if ((unsigned int)window_SpeakInHouse->ptr_1C == HOUSE_TRAINING_HALL_94 ||
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2600 (unsigned int)window_SpeakInHouse->ptr_1C == HOUSE_TRAINING_HALL_95)
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2601 v42 += 720;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2602 RestAndHeal((signed int)(v42 + 10080));
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2603 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2604 pOutdoor->SetFog();
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2605 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2606 pPlayers[uActiveCharacter]->PlaySound(SPEECH_87, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2607 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
2608 // "%s is now Level %lu and has earned %lu Skill Points!"
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2609 ShowStatusBarString(pTmpBuf.data(), 2);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2610 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2611 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2612 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2613 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2);// "You don't have enough gold"
1625
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2614 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, (HouseSoundID)4);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2615 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2616 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2617 }
1625
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2618 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[538], (unsigned int)(v5 - pPlayers[uActiveCharacter]->uExperience), pPlayers[uActiveCharacter]->uLevel + 1);//
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2619 // "You need %d more experience to train to level %d"
1625
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2620 v36 = (212 - pFontArrus->CalcTextHeight(pTmpBuf.data(), &training_dialog_window, 0, 0)) / 2 + 88;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2621 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2622 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2623 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2624 sprintf(pTmpBuf.data(), "%s\n \n%s", pGlobalTXT_LocalizationStrings[536], pGlobalTXT_LocalizationStrings[529]);//
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2625 // ""With your skills, you should be working here as a teacher.""
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2626 // ""Sorry, but we are unable to train you.""
1625
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2627 v36 = (212 - pFontArrus->CalcTextHeight(pTmpBuf.data(), &training_dialog_window, 0, 0)) / 2 + 101;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2628 }
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
2629 training_dialog_window.DrawTitleText(pFontArrus, 0, v36, Color16(0xE1u, 0xCDu, 0x23u), pTmpBuf.data(), 3);
1625
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2630 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, (HouseSoundID)3);
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2631 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2632 return;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2633 }
1625
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2634 }
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2635 //-------------------------------------------------------------
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2636 if ( dialog_menu_id == HOUSE_DIALOGUE_LEARN_SKILLS )
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2637 {
1393
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1313
diff changeset
2638 if (HouseUI_CheckIfPlayerCanInteract())
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2639 {
1625
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2640 v14 = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0);
1634
Ritor1
parents: 1630
diff changeset
2641 pPrice = v14 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100;
Ritor1
parents: 1630
diff changeset
2642 if ( pPrice < v14 / 3 )
Ritor1
parents: 1630
diff changeset
2643 pPrice = v14 / 3;
1625
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2644 index = 0;
1634
Ritor1
parents: 1630
diff changeset
2645 for ( int i = pDialogueWindow->pStartingPosActiveItem;
Ritor1
parents: 1630
diff changeset
2646 (signed int)i < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem; ++i )
1625
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2647 {
1634
Ritor1
parents: 1630
diff changeset
2648 if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][pDialogueWindow->GetControl(i)->msg_param - 36]
Ritor1
parents: 1630
diff changeset
2649 && !pPlayers[uActiveCharacter]->pActiveSkills[pDialogueWindow->GetControl(i)->msg_param - 36] )
1625
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2650 {
1634
Ritor1
parents: 1630
diff changeset
2651 all_text_height += pFontArrus->CalcTextHeight(pSkillNames[pDialogueWindow->GetControl(i)->msg_param - 36], &training_dialog_window, 0, 0);
1625
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2652 ++index;
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2653 }
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2654 }
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2655 if ( index )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2656 {
1634
Ritor1
parents: 1630
diff changeset
2657 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], pPrice);// "Skill Cost: %lu"
1625
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2658 training_dialog_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3);
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2659 v73 = (signed int)(149 - all_text_height) / index;
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2660 if ( v73 > 32 )
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2661 v73 = 32;
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2662 v19 = (signed int)(149 - index * v73 - all_text_height) / 2 - v73 / 2 + 162;
1634
Ritor1
parents: 1630
diff changeset
2663 for ( int i = pDialogueWindow->pStartingPosActiveItem;
Ritor1
parents: 1630
diff changeset
2664 (signed int)i < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton; ++i )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2665 {
1634
Ritor1
parents: 1630
diff changeset
2666 pButton = pDialogueWindow->GetControl(i);
Ritor1
parents: 1630
diff changeset
2667 if ( !byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][pButton->msg_param - 36]
Ritor1
parents: 1630
diff changeset
2668 || pPlayers[uActiveCharacter]->pActiveSkills[pButton->msg_param - 36] )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2669 {
1634
Ritor1
parents: 1630
diff changeset
2670 pButton->uW = 0;
Ritor1
parents: 1630
diff changeset
2671 pButton->uHeight = 0;
Ritor1
parents: 1630
diff changeset
2672 pButton->uY = 0;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2673 }
1634
Ritor1
parents: 1630
diff changeset
2674 else
Ritor1
parents: 1630
diff changeset
2675 {
Ritor1
parents: 1630
diff changeset
2676 pButton->uY = v73 + v19;
Ritor1
parents: 1630
diff changeset
2677 pTextHeight = pFontArrus->CalcTextHeight(pSkillNames[pButton->msg_param - 36], &training_dialog_window, 0, 0);
Ritor1
parents: 1630
diff changeset
2678 pButton->uHeight = pTextHeight;
Ritor1
parents: 1630
diff changeset
2679 pButton->uW = pButton->uY + pTextHeight - 1;
Ritor1
parents: 1630
diff changeset
2680 v19 = pButton->uY + pTextHeight - 1;
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
2681 pTextColor = Color16(0xE1u, 0xCDu, 0x23u);
1634
Ritor1
parents: 1630
diff changeset
2682 if ( pDialogueWindow->pCurrentPosActiveItem != i )
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
2683 pTextColor = Color16(255, 255, 255);
1634
Ritor1
parents: 1630
diff changeset
2684 training_dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pTextColor, pSkillNames[pButton->msg_param - 36], 3);
Ritor1
parents: 1630
diff changeset
2685 }
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2686 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2687 }
1625
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2688 else
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2689 {
1625
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2690 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayers[uActiveCharacter]->pName, pClassNames[pPlayers[uActiveCharacter]->classType]);//
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2691 // "Seek knowledge elsewhere %s the %s"
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2692 strcat(pTmpBuf.data(), "\n \n");
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2693 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);// "I can offer you nothing further."
1634
Ritor1
parents: 1630
diff changeset
2694 pTextHeight = pFontArrus->CalcTextHeight(pTmpBuf.data(), &training_dialog_window, 0, 0);
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
2695 training_dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, Color16(0xE1u, 0xCDu, 0x23u), pTmpBuf.data(), 3);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2696 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2697 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2698 }
1625
2d374de0a364 TrainingDialog cleaning(continue)
Ritor1
parents: 1624
diff changeset
2699 return;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2700 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2701
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2702 //----- (004B6478) --------------------------------------------------------
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2703 void sub_4B6478()
1634
Ritor1
parents: 1630
diff changeset
2704 {
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2705 unsigned int v2; // eax@1
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2706 signed int v3; // esi@1
1634
Ritor1
parents: 1630
diff changeset
2707 int pPrice; // ebx@1
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2708 unsigned int v5; // esi@5
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2709 int v6; // edi@6
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2253
diff changeset
2710 // int result; // eax@13
1653
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2711 int all_text_height; // eax@20
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2253
diff changeset
2712 // int v13; // eax@21
1634
Ritor1
parents: 1630
diff changeset
2713 GUIButton *pButton; // esi@27
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2253
diff changeset
2714 // unsigned int v16; // eax@28
1634
Ritor1
parents: 1630
diff changeset
2715 int pTextHeight; // eax@29
Ritor1
parents: 1630
diff changeset
2716 unsigned __int16 pTextColor; // ax@29
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2253
diff changeset
2717 // unsigned __int16 v22; // ST14_2@36
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2718 int v27; // [sp-4h] [bp-80h]@8
1634
Ritor1
parents: 1630
diff changeset
2719 GUIWindow dialog_window; // [sp+Ch] [bp-70h]@1
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2720 int v32; // [sp+6Ch] [bp-10h]@1
1653
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2721 int index; // [sp+74h] [bp-8h]@17
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2722
1634
Ritor1
parents: 1630
diff changeset
2723 memcpy(&dialog_window, window_SpeakInHouse, sizeof(dialog_window));
Ritor1
parents: 1630
diff changeset
2724 dialog_window.uFrameX = 483;
Ritor1
parents: 1630
diff changeset
2725 dialog_window.uFrameWidth = 148;
Ritor1
parents: 1630
diff changeset
2726 dialog_window.uFrameZ = 334;
Ritor1
parents: 1630
diff changeset
2727 v2 = 52 * (unsigned int)window_SpeakInHouse->ptr_1C;
Ritor1
parents: 1630
diff changeset
2728 v32 = (unsigned __int8)(((p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType != 18) - 1) & 0x96) + 100;
Ritor1
parents: 1630
diff changeset
2729 v3 = (signed __int64)((double)v32 * p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier);
Ritor1
parents: 1630
diff changeset
2730 pPrice = v3 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100;
Ritor1
parents: 1630
diff changeset
2731 if ( pPrice < v3 / 3 )
Ritor1
parents: 1630
diff changeset
2732 pPrice = v3 / 3;
Ritor1
parents: 1630
diff changeset
2733 if ( dialog_menu_id == HOUSE_DIALOGUE_MAIN)
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2734 {
1634
Ritor1
parents: 1630
diff changeset
2735 if ( !(unsigned __int16)_449B57_test_bit((unsigned __int8 *)pPlayers[uActiveCharacter]->_achieved_awards_bits, word_4F0754[2 * (unsigned int)window_SpeakInHouse->ptr_1C]) )
Ritor1
parents: 1630
diff changeset
2736 {
Ritor1
parents: 1630
diff changeset
2737 pTextHeight = pFontArrus->CalcTextHeight(pNPCTopics[171].pText, &dialog_window, 0, 0);//
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
2738 dialog_window.DrawTitleText(pFontArrus, 0, (212 - pTextHeight) / 2 + 101, Color16(0xFFu, 0xFFu, 0x9Bu), pNPCTopics[171].pText, 3);
1634
Ritor1
parents: 1630
diff changeset
2739 pDialogueWindow->pNumPresenceButton = 0;
1636
ff3d7af671ec SimpleHouseDialog cleaning(continue)
Ritor1
parents: 1634
diff changeset
2740 return;
1634
Ritor1
parents: 1630
diff changeset
2741 }
Ritor1
parents: 1630
diff changeset
2742 if ( !HouseUI_CheckIfPlayerCanInteract() )
Ritor1
parents: 1630
diff changeset
2743 return;
1653
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2744 all_text_height = 0;
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2745 index = 0;
1634
Ritor1
parents: 1630
diff changeset
2746 for ( int i = pDialogueWindow->pStartingPosActiveItem;
Ritor1
parents: 1630
diff changeset
2747 i < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem; ++i )
Ritor1
parents: 1630
diff changeset
2748 {
Ritor1
parents: 1630
diff changeset
2749 if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType / 3][pDialogueWindow->GetControl(i)->msg_param - 36]
Ritor1
parents: 1630
diff changeset
2750 && !pPlayers[uActiveCharacter]->pActiveSkills[pDialogueWindow->GetControl(i)->msg_param - 36] )
Ritor1
parents: 1630
diff changeset
2751 {
1653
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2752 all_text_height += pFontArrus->CalcTextHeight(pSkillNames[pDialogueWindow->GetControl(i)->msg_param - 36], &dialog_window, 0, 0);
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2753 ++index;
1634
Ritor1
parents: 1630
diff changeset
2754 }
Ritor1
parents: 1630
diff changeset
2755 }
1653
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2756 if ( !index )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2757 {
1634
Ritor1
parents: 1630
diff changeset
2758 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayers[uActiveCharacter]->pName, pClassNames[pPlayers[uActiveCharacter]->classType]);
Ritor1
parents: 1630
diff changeset
2759 strcat(pTmpBuf.data(), "\n \n");
Ritor1
parents: 1630
diff changeset
2760 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);//Áîëüøå íè÷åãî íå ìîãó ïðåäëîæèòü.
Ritor1
parents: 1630
diff changeset
2761 pTextHeight = pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 0, 0);
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
2762 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, Color16(0xFFu, 0xFFu, 0x9Bu), pTmpBuf.data(), 3);
1634
Ritor1
parents: 1630
diff changeset
2763 return;
Ritor1
parents: 1630
diff changeset
2764 }
Ritor1
parents: 1630
diff changeset
2765 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], pPrice);//Ñòîèìîñòü íàâûêà: %lu
Ritor1
parents: 1630
diff changeset
2766 dialog_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3);
1653
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2767 v32 = (149 - all_text_height) / index;
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2768 if ( v32 > 32 )
1634
Ritor1
parents: 1630
diff changeset
2769 v32 = 32;
1653
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2770 index = (149 - index * v32 - all_text_height) / 2 - v32 / 2 + 162;
1634
Ritor1
parents: 1630
diff changeset
2771 if ( pDialogueWindow->pStartingPosActiveItem < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton )
Ritor1
parents: 1630
diff changeset
2772 {
Ritor1
parents: 1630
diff changeset
2773 for ( int i = pDialogueWindow->pStartingPosActiveItem;
Ritor1
parents: 1630
diff changeset
2774 i <pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem; ++i )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2775 {
1634
Ritor1
parents: 1630
diff changeset
2776 pButton = pDialogueWindow->GetControl(i);
Ritor1
parents: 1630
diff changeset
2777 if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType / 3][pButton->msg_param - 36] )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2778 {
1634
Ritor1
parents: 1630
diff changeset
2779 if ( !pPlayers[uActiveCharacter]->pActiveSkills[pButton->msg_param - 36] )
Ritor1
parents: 1630
diff changeset
2780 {
1653
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2781 pButton->uY = v32 + index;
1634
Ritor1
parents: 1630
diff changeset
2782 pTextHeight = pFontArrus->CalcTextHeight(pSkillNames[pButton->msg_param - 36], &dialog_window, 0, 0);
Ritor1
parents: 1630
diff changeset
2783 pButton->uHeight = pTextHeight;
Ritor1
parents: 1630
diff changeset
2784 pButton->uW = pButton->uY + pTextHeight - 1;
1653
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2785 index = pButton->uY + pTextHeight - 1;
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
2786 pTextColor = Color16(0xFFu, 0xFFu, 0x9Bu);
1634
Ritor1
parents: 1630
diff changeset
2787 if ( pDialogueWindow->pCurrentPosActiveItem != i )
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
2788 pTextColor = Color16(0xFFu, 0xFFu, 0xFFu);
1634
Ritor1
parents: 1630
diff changeset
2789 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pTextColor, pSkillNames[pButton->msg_param - 36], 3);
Ritor1
parents: 1630
diff changeset
2790 }
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2791 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2792 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2793 {
1634
Ritor1
parents: 1630
diff changeset
2794 pButton->uW = 0;
Ritor1
parents: 1630
diff changeset
2795 pButton->uHeight = 0;
Ritor1
parents: 1630
diff changeset
2796 pButton->uY = 0;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2797 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2798 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2799 }
1634
Ritor1
parents: 1630
diff changeset
2800 return;
Ritor1
parents: 1630
diff changeset
2801 }
Ritor1
parents: 1630
diff changeset
2802
Ritor1
parents: 1630
diff changeset
2803 if ( HouseUI_CheckIfPlayerCanInteract() )
Ritor1
parents: 1630
diff changeset
2804 {
Ritor1
parents: 1630
diff changeset
2805 v5 = 0;
Ritor1
parents: 1630
diff changeset
2806 __debugbreak();
Ritor1
parents: 1630
diff changeset
2807 //pSkillAvailabilityPerClass[8 + v58->uClass][4 + v23]
Ritor1
parents: 1630
diff changeset
2808 // or
Ritor1
parents: 1630
diff changeset
2809 //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass][v23 - 36]
Ritor1
parents: 1630
diff changeset
2810 // or
Ritor1
parents: 1630
diff changeset
2811 //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass - 1][v23 + 1]
Ritor1
parents: 1630
diff changeset
2812 __debugbreak(); // whacky condition - fix
Ritor1
parents: 1630
diff changeset
2813 if (false
Ritor1
parents: 1630
diff changeset
2814 //if ( !*(&byte_4ED94C[37 * v1->uClass / 3] + dword_F8B19C)
Ritor1
parents: 1630
diff changeset
2815 || (v6 = (int)(&pPlayers[uActiveCharacter]->uIntelligence + dialog_menu_id), *(short *)v6) )
Ritor1
parents: 1630
diff changeset
2816 {
1754
421c29d4ab3e UITransition.cpp cleaning(continue)
Ritor1
parents: 1748
diff changeset
2817 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
1634
Ritor1
parents: 1630
diff changeset
2818 }
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2819 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2820 {
1634
Ritor1
parents: 1630
diff changeset
2821 if ( pParty->uNumGold < pPrice )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2822 {
1634
Ritor1
parents: 1630
diff changeset
2823 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2);//Ó âàñ íå õâàòàåò çîëîòà
Ritor1
parents: 1630
diff changeset
2824 v27 = 4;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2825 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2826 else
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2827 {
1634
Ritor1
parents: 1630
diff changeset
2828 Party::TakeGold(pPrice);
Ritor1
parents: 1630
diff changeset
2829 *(short *)v6 = 1;
Ritor1
parents: 1630
diff changeset
2830 v27 = 2;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2831 }
1634
Ritor1
parents: 1630
diff changeset
2832 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, (HouseSoundID)v27);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2833 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2834 }
1634
Ritor1
parents: 1630
diff changeset
2835 else
Ritor1
parents: 1630
diff changeset
2836 {
Ritor1
parents: 1630
diff changeset
2837 v5 = 0;
Ritor1
parents: 1630
diff changeset
2838 }
Ritor1
parents: 1630
diff changeset
2839 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, v5);
Ritor1
parents: 1630
diff changeset
2840 return; // void func
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2841 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2842
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2843 //----- (004B2A74) --------------------------------------------------------
1634
Ritor1
parents: 1630
diff changeset
2844 void SimpleHouseDialog()
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2845 {
1580
Ritor1
parents: 1573
diff changeset
2846 NPCData *pNPC; // esi@6
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2847 char *v15; // esi@14
1580
Ritor1
parents: 1573
diff changeset
2848 GUIButton *pButton; // eax@15
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2849 char *v29; // esi@42
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2850 int v31; // ST1C_4@42
1653
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2851 int index; // esi@51
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2852 int v36;
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2853 signed int all_text_height; // ecx@54
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2854 int v40; // edi@57
1653
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2855 unsigned __int16 pTextColor; // ax@60
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2856 GUIFont *pTextFont; // ebx@64
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2857 int pTextHeight;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2858 GUIWindow w; // [sp+Ch] [bp-110h]@64
1636
ff3d7af671ec SimpleHouseDialog cleaning(continue)
Ritor1
parents: 1634
diff changeset
2859 GUIWindow right_panel_window; // [sp+60h] [bp-BCh]@13
1580
Ritor1
parents: 1573
diff changeset
2860 GUIWindow house_window; // [sp+B4h] [bp-68h]@1
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2861 char *pInString; // [sp+114h] [bp-8h]@12
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2862
1580
Ritor1
parents: 1573
diff changeset
2863 memcpy(&house_window, pDialogueWindow, sizeof(house_window));
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2864 if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2865 {
1580
Ritor1
parents: 1573
diff changeset
2866 house_window.uFrameX = 493;
Ritor1
parents: 1573
diff changeset
2867 house_window.uFrameWidth = 126;
Ritor1
parents: 1573
diff changeset
2868 house_window.uFrameZ = 366;
Ritor1
parents: 1573
diff changeset
2869 house_window.DrawTitleText(pFontCreate, 0, 2, 0, pMapStats->pInfos[uHouse_ExitPic].pName, 3);
Ritor1
parents: 1573
diff changeset
2870 house_window.uFrameX = 483;
Ritor1
parents: 1573
diff changeset
2871 house_window.uFrameWidth = 148;
Ritor1
parents: 1573
diff changeset
2872 house_window.uFrameZ = 334;
1653
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2873 if ( !pTransitionStrings[uHouse_ExitPic] )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2874 {
1580
Ritor1
parents: 1573
diff changeset
2875 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[411], pMapStats->pInfos[uHouse_ExitPic].pName);//Âîéòè â ^Pv[%s]
1653
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2876 house_window.DrawTitleText(pFontCreate, 0, (212 - pFontCreate->CalcTextHeight(pTmpBuf.data(), &house_window, 0, 0)) / 2 + 101, 0, pTmpBuf.data(), 3);
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2877 return;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2878 }
1653
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2879 house_window.DrawTitleText(pFontCreate, 0,
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2880 (212 - pFontCreate->CalcTextHeight(pTransitionStrings[uHouse_ExitPic], &house_window, 0, 0)) / 2 + 101, 0, pTransitionStrings[uHouse_ExitPic], 3);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2881 return;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2882 }
1580
Ritor1
parents: 1573
diff changeset
2883 house_window.uFrameWidth -= 10;
Ritor1
parents: 1573
diff changeset
2884 house_window.uFrameZ -= 10;
Ritor1
parents: 1573
diff changeset
2885 pNPC = HouseNPCData[(unsigned int)((char *)pDialogueNPCCount + -(dword_591080 != 0) )];//- 1
Ritor1
parents: 1573
diff changeset
2886 if ( pNPC->uProfession )
Ritor1
parents: 1573
diff changeset
2887 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[429], pNPC->pName, aNPCProfessionNames[pNPC->uProfession]);//^Pi[%s] %s
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2888 else
1580
Ritor1
parents: 1573
diff changeset
2889 strcpy(pTmpBuf.data(), pNPC->pName);
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
2890 house_window.DrawTitleText(pFontCreate, 483, 113, Color16(0x15u, 0x99u, 0xE9u), pTmpBuf.data(), 3);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2891 if ( !dword_591080 )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2892 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2893 if ( !uDialogueType )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2894 {
1580
Ritor1
parents: 1573
diff changeset
2895 if ( pNPC->greet )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2896 {
1580
Ritor1
parents: 1573
diff changeset
2897 house_window.uFrameWidth = game_viewport_width;
Ritor1
parents: 1573
diff changeset
2898 house_window.uFrameZ = 452;
1655
a7eebb6ee7a2 Window Resize (change arguments to MM7_Initialize)
Nomad
parents: 1653
diff changeset
2899 pInString = pNPCStats->pNPCGreetings[pNPC->greet].pGreetings[((pNPC->uFlags & 3) == 2)];
1653
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2900 //pInString = (char *)*(&pNPCStats->field_17884 + ((pNPC->uFlags & 3) == 2) + 2 * pNPC->greet);
1580
Ritor1
parents: 1573
diff changeset
2901 pRenderer->GetLeather(8, 352 - (pFontArrus->CalcTextHeight(pInString, &house_window, 13, 0) + 7),
Ritor1
parents: 1573
diff changeset
2902 pIcons_LOD->GetTexture(uTextureID_Leather), pIcons_LOD->GetTexture(uTextureID_Leather)->uTextureHeight
Ritor1
parents: 1573
diff changeset
2903 - (pFontArrus->CalcTextHeight(pInString, &house_window, 13, 0) + 7));
Ritor1
parents: 1573
diff changeset
2904 pRenderer->DrawTextureIndexed(8, 347 - (pFontArrus->CalcTextHeight(pInString, &house_window, 13, 0) + 7), pTexture_591428);
Ritor1
parents: 1573
diff changeset
2905 pDialogueWindow->DrawText(pFontArrus, 13, 354 - (pFontArrus->CalcTextHeight(pInString, &house_window, 13, 0) + 7),
Ritor1
parents: 1573
diff changeset
2906 0, FitTextInAWindow(pInString, pFontArrus, &house_window, 0xDu, 0), 0, 0, 0);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2907 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2908 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2909 }
1636
ff3d7af671ec SimpleHouseDialog cleaning(continue)
Ritor1
parents: 1634
diff changeset
2910 //for right panel
ff3d7af671ec SimpleHouseDialog cleaning(continue)
Ritor1
parents: 1634
diff changeset
2911 memcpy(&right_panel_window, pDialogueWindow, sizeof(right_panel_window));
ff3d7af671ec SimpleHouseDialog cleaning(continue)
Ritor1
parents: 1634
diff changeset
2912 right_panel_window.uFrameX = 483;
ff3d7af671ec SimpleHouseDialog cleaning(continue)
Ritor1
parents: 1634
diff changeset
2913 right_panel_window.uFrameWidth = 148;
ff3d7af671ec SimpleHouseDialog cleaning(continue)
Ritor1
parents: 1634
diff changeset
2914 right_panel_window.uFrameZ = 334;
ff3d7af671ec SimpleHouseDialog cleaning(continue)
Ritor1
parents: 1634
diff changeset
2915 for ( int i = right_panel_window.pStartingPosActiveItem;
ff3d7af671ec SimpleHouseDialog cleaning(continue)
Ritor1
parents: 1634
diff changeset
2916 i < right_panel_window.pStartingPosActiveItem + right_panel_window.pNumPresenceButton; ++i )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2917 {
1636
ff3d7af671ec SimpleHouseDialog cleaning(continue)
Ritor1
parents: 1634
diff changeset
2918 pButton = right_panel_window.GetControl(i);
ff3d7af671ec SimpleHouseDialog cleaning(continue)
Ritor1
parents: 1634
diff changeset
2919 switch ( pButton->msg_param )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2920 {
1636
ff3d7af671ec SimpleHouseDialog cleaning(continue)
Ritor1
parents: 1634
diff changeset
2921 case 19://evt_A
1661
e1d1fe32c194 NPCTopics
Ritor1
parents: 1653
diff changeset
2922 v15 = (char *)pNPCTopics[pNPC->evt_A].pTopic;
1636
ff3d7af671ec SimpleHouseDialog cleaning(continue)
Ritor1
parents: 1634
diff changeset
2923 if ( !v15 )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2924 {
1636
ff3d7af671ec SimpleHouseDialog cleaning(continue)
Ritor1
parents: 1634
diff changeset
2925 pButton->msg_param = 0;
ff3d7af671ec SimpleHouseDialog cleaning(continue)
Ritor1
parents: 1634
diff changeset
2926 v15 = "";
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2927 }
1636
ff3d7af671ec SimpleHouseDialog cleaning(continue)
Ritor1
parents: 1634
diff changeset
2928 strcpy(pButton->pButtonName, v15);
ff3d7af671ec SimpleHouseDialog cleaning(continue)
Ritor1
parents: 1634
diff changeset
2929 continue;
ff3d7af671ec SimpleHouseDialog cleaning(continue)
Ritor1
parents: 1634
diff changeset
2930 case 20://evt_B
1661
e1d1fe32c194 NPCTopics
Ritor1
parents: 1653
diff changeset
2931 v15 = (char *)pNPCTopics[pNPC->evt_B].pTopic;
1636
ff3d7af671ec SimpleHouseDialog cleaning(continue)
Ritor1
parents: 1634
diff changeset
2932 if ( !v15 )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2933 {
1636
ff3d7af671ec SimpleHouseDialog cleaning(continue)
Ritor1
parents: 1634
diff changeset
2934 pButton->msg_param = 0;
ff3d7af671ec SimpleHouseDialog cleaning(continue)
Ritor1
parents: 1634
diff changeset
2935 v15 = "";
ff3d7af671ec SimpleHouseDialog cleaning(continue)
Ritor1
parents: 1634
diff changeset
2936 }
1653
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2937 if ( uDialogueType != 84 )
1636
ff3d7af671ec SimpleHouseDialog cleaning(continue)
Ritor1
parents: 1634
diff changeset
2938 {
1653
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2939 strcpy(pButton->pButtonName, v15);
1636
ff3d7af671ec SimpleHouseDialog cleaning(continue)
Ritor1
parents: 1634
diff changeset
2940 continue;
ff3d7af671ec SimpleHouseDialog cleaning(continue)
Ritor1
parents: 1634
diff changeset
2941 }
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
2942 sprintf(pTmpBuf.data(), format_4E2D80, Color16(0xE1u, 0xCDu, 0x23u), pItemsTable->pItems[contract_approved].pUnidentifiedName);
1653
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2943 sprintf(pTmpBuf2.data(), current_npc_text, pTmpBuf.data());
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2944 current_npc_text = pTmpBuf2.data();
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2945 strcpy(pButton->pButtonName, v15);
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2946 continue;
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2947 case 21://evt_C
1661
e1d1fe32c194 NPCTopics
Ritor1
parents: 1653
diff changeset
2948 v15 = (char *)pNPCTopics[pNPC->evt_C].pTopic;
1653
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2949 if ( !v15 )
1636
ff3d7af671ec SimpleHouseDialog cleaning(continue)
Ritor1
parents: 1634
diff changeset
2950 {
1653
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2951 pButton->msg_param = 0;
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2952 v15 = "";
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2953 }
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2954 strcpy(pButton->pButtonName, v15);
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2955 continue;
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2956 case 22://evt_D
1661
e1d1fe32c194 NPCTopics
Ritor1
parents: 1653
diff changeset
2957 v15 = (char *)pNPCTopics[pNPC->evt_D].pTopic;
1653
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2958 if ( !v15 )
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2959 {
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2960 pButton->msg_param = 0;
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2961 v15 = "";
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2962 }
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2963 strcpy(pButton->pButtonName, v15);
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2964 continue;
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2965 case 23://evt_E
1661
e1d1fe32c194 NPCTopics
Ritor1
parents: 1653
diff changeset
2966 v15 = (char *)pNPCTopics[pNPC->evt_E].pTopic;
1653
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2967 if ( !v15 )
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2968 {
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2969 pButton->msg_param = 0;
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2970 v15 = "";
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
2971 }
1653
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2972 strcpy(pButton->pButtonName, v15);
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2973 continue;
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2974 case 24://evt_F
1661
e1d1fe32c194 NPCTopics
Ritor1
parents: 1653
diff changeset
2975 v15 = (char *)pNPCTopics[pNPC->evt_F].pTopic;
1653
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2976 if ( !v15 )
1636
ff3d7af671ec SimpleHouseDialog cleaning(continue)
Ritor1
parents: 1634
diff changeset
2977 {
1653
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2978 pButton->msg_param = 0;
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2979 v15 = "";
1636
ff3d7af671ec SimpleHouseDialog cleaning(continue)
Ritor1
parents: 1634
diff changeset
2980 }
1653
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2981 strcpy(pButton->pButtonName, v15);
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2982 continue;
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2983 case 76:
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2984 strcpy(pButton->pButtonName, pGlobalTXT_LocalizationStrings[406]);//Íàíÿòü
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2985 continue;
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2986 case 77:
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2987 strcpy(pButton->pButtonName, pGlobalTXT_LocalizationStrings[407]);//Ïîäðîáíåå
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2988 continue;
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2989 case 79:
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2990 strcpy(pButton->pButtonName, _4B254D_SkillMasteryTeacher((int)right_panel_window.ptr_1C));
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2991 continue;
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2992 case 82:
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2993 strcpy(pButton->pButtonName, ContractSelectText((int)right_panel_window.ptr_1C));
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2994 continue;
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2995 case 83:
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2996 v29 = pMonsterStats->pInfos[bountyHunting_monster_id_for_hunting].pName;
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2997 v31 = *(int *)v29;
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
2998 sprintfex(pTmpBuf.data(), "\f%05d%s\f%05d", Color16(0xFFu, 0xFFu, 0x9Bu), v31, Color16(0xFFu, 0xFFu, 0xFFu));
1653
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
2999 sprintfex(pTmpBuf2.data(), bountyHunting_text, pTmpBuf.data(), 100 * (unsigned __int8)v29[8]);
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
3000 current_npc_text = pTmpBuf2.data();
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
3001 strcpy(pButton->pButtonName, "");
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
3002 continue;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3003 }
1653
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
3004 if ( pButton->msg_param > 0 && pButton->msg_param < 13 )
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
3005 {
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
3006 strcpy(pButton->pButtonName, pGlobalTXT_LocalizationStrings[122]);//Âñòóïèòü
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
3007 continue;
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
3008 }
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
3009 if ( pButton->msg_param > 13 && pButton->msg_param < 19 )
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
3010 {
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
3011 strcpy(pButton->pButtonName, "");
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
3012 continue;
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
3013 }
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
3014 if ( pButton->msg_param != 93 )
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
3015 {
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
3016 strcpy(pButton->pButtonName, "");
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
3017 continue;
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
3018 }
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3019 }
1653
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
3020 index = 0;
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
3021 all_text_height = 0;
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
3022 for ( int i = pDialogueWindow->pStartingPosActiveItem;
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
3023 i < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton; ++i )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3024 {
1653
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
3025 pButton = pDialogueWindow->GetControl(i);
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
3026 all_text_height += pFontArrus->CalcTextHeight(pButton->pButtonName, &right_panel_window, 0, 0);
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
3027 index++;
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
3028 }
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
3029 if ( index )
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
3030 {
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
3031 v36 = (174 - all_text_height) / index;
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
3032 if ( v36 > 32 )
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
3033 v36 = 32;
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
3034 v40 = (174 - v36 * index - all_text_height) / 2 - v36 / 2 + 138;
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
3035 for ( int i = pDialogueWindow->pStartingPosActiveItem; i < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem; ++i )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3036 {
1606
Ritor1
parents: 1580
diff changeset
3037 pButton = pDialogueWindow->GetControl(i);
1653
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
3038 pButton->uY = v36 + v40;
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
3039 pTextHeight = pFontArrus->CalcTextHeight(pButton->pButtonName, &right_panel_window, 0, 0);
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
3040 pButton->uHeight = pTextHeight;
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
3041 v40 = pButton->uY + pTextHeight - 1;
1606
Ritor1
parents: 1580
diff changeset
3042 pButton->uW = v40;
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
3043 pTextColor = Color16(0xE1u, 0xCDu, 0x23u);
1653
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
3044 if ( pDialogueWindow->pCurrentPosActiveItem != i )
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
3045 pTextColor = Color16(0xFFu, 0xFFu, 0xFFu);
1653
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
3046 right_panel_window.DrawTitleText(pFontArrus, 0, pButton->uY, pTextColor, pButton->pButtonName, 3);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3047 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3048 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3049 if ( current_npc_text )
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3050 {
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3051 w.uFrameWidth = 458;
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3052 w.uFrameZ = 457;
1653
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
3053 pTextFont = pFontArrus;
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
3054 pTextHeight = pFontArrus->CalcTextHeight(current_npc_text, &w, 13, 0) + 7;
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
3055 if ( 352 - pTextHeight < 8 )
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3056 {
1653
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
3057 pTextFont = pFontCreate;
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
3058 pTextHeight = pFontCreate->CalcTextHeight(current_npc_text, &w, 13, 0) + 7;
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3059 }
1653
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
3060 pRenderer->GetLeather(8, 352 - pTextHeight, pIcons_LOD->GetTexture(uTextureID_Leather), pIcons_LOD->GetTexture(uTextureID_Leather)->uTextureHeight - pTextHeight);
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
3061 pRenderer->DrawTextureIndexed(8, 347 - pTextHeight, pTexture_591428);
d453ed393d6e NPCGreetings
Ritor1
parents: 1644
diff changeset
3062 house_window.DrawText(pTextFont, 13, 354 - pTextHeight, 0, FitTextInAWindow(current_npc_text, pTextFont, &w, 13, 0), 0, 0, 0);
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3063 }
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3064 }
1434
Ritor1
parents: 1306
diff changeset
3065
1300
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
3066 //----- (004B4F4F) --------------------------------------------------------
bedc304ab617 new files in UI
Ritor1
parents: 1299
diff changeset
3067 void JailDialog()
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3068 {
1608
fb809d1891bd JailDialog
Ritor1
parents: 1606
diff changeset
3069 GUIWindow jail_dialogue_window; // [sp+8h] [bp-54h]@1
1298
b97d0cdd6c79 new folder UI
Ritor1
parents:
diff changeset
3070
1608
fb809d1891bd JailDialog
Ritor1
parents: 1606
diff changeset
3071 memcpy(&jail_dialogue_window, window_SpeakInHouse, sizeof(jail_dialogue_window));
fb809d1891bd JailDialog
Ritor1
parents: 1606
diff changeset
3072 jail_dialogue_window.uFrameX = 483;
fb809d1891bd JailDialog
Ritor1
parents: 1606
diff changeset
3073 jail_dialogue_window.uFrameWidth = 148;
fb809d1891bd JailDialog
Ritor1
parents: 1606
diff changeset
3074 jail_dialogue_window.uFrameZ = 334;
fb809d1891bd JailDialog
Ritor1
parents: 1606
diff changeset
3075 jail_dialogue_window.DrawTitleText(pFontArrus, 0, (310 - pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[672], &jail_dialogue_window, 0, 0)) / 2 + 18,
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
3076 Color16(0xFFu, 0xFFu, 0x9Bu), pGlobalTXT_LocalizationStrings[672], 3);//"Çà ìíîãî÷èñëåííûå ïðåñòóïëåíèÿ è çëîäåÿíèÿ âû áûëè ïðèãîâîðåíû ê îäíîìó ãîäó çàêëþ÷åíèÿ."
2355
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3077 }
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3078
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3079
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3080 //----- (00443801) --------------------------------------------------------
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3081 void InitializeBuildingResidents()
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3082 {
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3083
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3084 int i;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3085 char* test_string;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3086 unsigned char c;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3087 bool break_loop;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3088 unsigned int temp_str_len;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3089 char* tmp_pos;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3090 int decode_step;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3091
2369
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2355
diff changeset
3092 free(p2DEventsTXT_Raw);
2355
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3093 p2DEventsTXT_Raw = (char *)pEvents_LOD->LoadRaw("2dEvents.txt", 0);
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3094 strtok(p2DEventsTXT_Raw, "\r");
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3095 strtok(NULL, "\r");
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3096
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3097 for (i=0;i<525;++i)
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3098 {
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3099 test_string = strtok(NULL, "\r") + 1;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3100 break_loop = false;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3101 decode_step=0;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3102 do
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3103 {
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3104 c = *(unsigned char*)test_string;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3105 temp_str_len = 0;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3106 while((c!='\t')&&(c>0))
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3107 {
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3108 ++temp_str_len;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3109 c=test_string[temp_str_len];
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3110 }
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3111 tmp_pos=test_string+temp_str_len;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3112 if (*tmp_pos == 0)
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3113 break_loop = true;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3114 *tmp_pos = 0;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3115 if (temp_str_len)
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3116 {
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3117 switch (decode_step)
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3118 {
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3119 case 2:
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3120 {
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3121 if ( !_strnicmp(test_string, "wea", 3) )
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3122 {
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3123 p2DEvents[i].uType = BuildingType_WeaponShop;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3124 break;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3125 }
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3126 if ( !_strnicmp(test_string, "arm", 3) )
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3127 {
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3128 p2DEvents[i].uType = BuildingType_ArmorShop;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3129 break;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3130 }
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3131 if ( !_strnicmp(test_string, "mag", 3) )
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3132 {
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3133 p2DEvents[i].uType = BuildingType_MagicShop;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3134 break;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3135 }
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3136 if ( !_strnicmp(test_string, "alc", 3) )
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3137 {
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3138 p2DEvents[i].uType = BuildingType_AlchemistShop;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3139 break;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3140 }
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3141 if ( !_strnicmp(test_string, "sta", 3) )
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3142 {
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3143 p2DEvents[i].uType = BuildingType_Stables;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3144 break;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3145 }
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3146 if ( !_strnicmp(test_string, "boa", 3) )
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3147 {
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3148 p2DEvents[i].uType = BuildingType_Boats;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3149 break;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3150 }
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3151 if ( !_strnicmp(test_string, "tem", 3) )
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3152 {
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3153 p2DEvents[i].uType = BuildingType_Temple;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3154 break;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3155 }
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3156 if ( !_strnicmp(test_string, "tra", 3) )
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3157 {
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3158 p2DEvents[i].uType = BuildingType_Training;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3159 break;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3160 }
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3161 if ( !_strnicmp(test_string, "tow", 3) )
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3162 {
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3163 p2DEvents[i].uType = BuildingType_TownHall;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3164 break;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3165 }
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3166
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3167 if ( !_strnicmp(test_string, "tav", 3) )
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3168 {
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3169 p2DEvents[i].uType = BuildingType_Tavern;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3170 break;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3171 }
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3172 if ( !_strnicmp(test_string, "ban", 3) )
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3173 {
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3174 p2DEvents[i].uType = BuildingType_Bank;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3175 break;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3176 }
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3177 if ( !_strnicmp(test_string, "fir", 3) )
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3178 {
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3179 p2DEvents[i].uType = BuildingType_FireGuild;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3180 break;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3181 }
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3182 if ( !_strnicmp(test_string, "air", 3) )
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3183 {
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3184 p2DEvents[i].uType = BuildingType_AirGuild;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3185 break;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3186 }
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3187 if ( !_strnicmp(test_string, "wat", 3) )
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3188 {
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3189 p2DEvents[i].uType = BuildingType_WaterGuild;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3190 break;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3191 }
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3192 if ( !_strnicmp(test_string, "ear", 3) )
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3193 {
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3194 p2DEvents[i].uType = BuildingType_EarthGuild;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3195 break;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3196 }
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3197 if ( !_strnicmp(test_string, "spi", 3) )
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3198 {
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3199 p2DEvents[i].uType = BuildingType_SpiritGuild;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3200 break;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3201 }
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3202 if ( !_strnicmp(test_string, "min", 3) )
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3203 {
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3204 p2DEvents[i].uType = BuildingType_MindGuild;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3205 break;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3206 }
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3207 if ( !_strnicmp(test_string, "bod", 3) )
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3208 {
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3209 p2DEvents[i].uType = BuildingType_BodyGuild;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3210 break;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3211 }
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3212 if ( !_strnicmp(test_string, "lig", 3) )
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3213 {
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3214 p2DEvents[i].uType = BuildingType_LightGuild;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3215 break;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3216 }
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3217 if ( !_strnicmp(test_string, "dar", 3) )
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3218 {
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3219 p2DEvents[i].uType = BuildingType_DarkGuild;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3220 break;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3221 }
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3222 if ( !_strnicmp(test_string, "ele", 3) ) // "Element Guild" from mm6
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3223 {
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3224 p2DEvents[i].uType = BuildingType_ElementalGuild;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3225 break;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3226 }
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3227 if ( !_strnicmp(test_string, "sel", 3) )
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3228 {
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3229 p2DEvents[i].uType = BuildingType_SelfGuild;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3230 break;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3231 }
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3232 if ( !_strnicmp(test_string, "mir", 3) )
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3233 {
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3234 p2DEvents[i].uType = BuildingType_16;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3235 break;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3236 }
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3237 if ( !_strnicmp(test_string, "mer", 3) ) // "Merc Guild" from mm6
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3238 {
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3239 p2DEvents[i].uType = BuildingType_TownHall;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3240 break;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3241 }
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3242 p2DEvents[i].uType = BuildingType_18;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3243 }
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3244 break;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3245
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3246 case 4:
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3247 p2DEvents[i].uAnimationID = atoi(test_string);
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3248 break;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3249 case 5:
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3250 p2DEvents[i].pName = RemoveQuotes(test_string);
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3251 break;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3252 case 6:
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3253 p2DEvents[i].pProprieterName = RemoveQuotes(test_string);
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3254 break;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3255 case 7:
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3256 p2DEvents[i].pProprieterTitle = RemoveQuotes(test_string);
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3257 break;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3258 case 8:
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3259 p2DEvents[i].field_14 = atoi(test_string);
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3260 break;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3261 case 9:
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3262 p2DEvents[i]._state = atoi(test_string);
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3263 break;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3264 case 10:
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3265 p2DEvents[i]._rep = atoi(test_string);
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3266 break;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3267 case 11:
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3268 p2DEvents[i]._per = atoi(test_string);
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3269 break;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3270 case 12:
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3271 p2DEvents[i].fPriceMultiplier = atof(test_string);
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3272 break;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3273 case 13:
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3274 p2DEvents[i].flt_24 = atof(test_string);
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3275 break;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3276 case 15:
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3277 p2DEvents[i].field_1C = atoi(test_string);
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3278 break;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3279 case 18:
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3280 p2DEvents[i].uOpenTime = atoi(test_string);
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3281 break;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3282 case 19:
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3283 p2DEvents[i].uCloseTime = atoi(test_string);
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3284 break;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3285 case 20:
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3286 p2DEvents[i].uExitPicID = atoi(test_string);
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3287 break;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3288 case 21:
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3289 p2DEvents[i].uExitMapID = atoi(test_string);
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3290 break;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3291 case 22:
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3292 p2DEvents[i]._quest_related = atoi(test_string);
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3293 break;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3294 case 23:
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3295 p2DEvents[i].pEnterText = RemoveQuotes(test_string);
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3296 break;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3297 }
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3298 }
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3299 ++decode_step;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3300 test_string=tmp_pos+1;
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3301 } while ((decode_step<24)&&!break_loop);
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3302 }
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2350
diff changeset
3303
2374
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3304 }
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3305
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3306 //----- (004BD8B5) --------------------------------------------------------
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3307 int HouseDialogPressCloseBtn()
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3308 {
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3309 if ( pMessageQueue_50CBD0->uNumMessages )
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3310 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3311 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_CANCELLED);
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3312 pKeyActionMap->ResetKeys();
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3313 activeLevelDecoration = nullptr;
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3314 current_npc_text = 0;
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3315 if ( pDialogueNPCCount == 0)
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3316 return 0;
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3317
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3318 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_SPECIAL && ShopTexture )
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3319 {
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3320 ShopTexture->Release();
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3321 ShopTexture = 0;
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3322 }
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3323
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3324 switch(dialog_menu_id)
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3325 {
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3326 case -1:
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3327 _4B4224_UpdateNPCTopics((int)((char *)pDialogueNPCCount - 1));
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3328 pVideoPlayer->_4BF5B2();
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3329 break;
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3330
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3331 case HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT:
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3332 case HOUSE_DIALOGUE_LEARN_SKILLS:
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3333 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_MAIN:
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3334 pVideoPlayer->_4BF5B2();
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3335 UI_CreateEndConversationButton();
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3336 dialog_menu_id = HOUSE_DIALOGUE_MAIN;
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3337 InitializaDialogueOptions(in_current_building_type);
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3338 break;
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3339
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3340 case HOUSE_DIALOGUE_SHOP_SELL:
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3341 case HOUSE_DIALOGUE_SHOP_IDENTIFY:
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3342 case HOUSE_DIALOGUE_SHOP_REPAIR:
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3343 UI_CreateEndConversationButton();
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3344 dialog_menu_id = HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT;
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3345 InitializaDialogueOptions_Shops(in_current_building_type);
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3346 break;
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3347
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3348 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RULES:
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3349 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_VICTORY_CONDITIONS:
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3350 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RESULT:
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3351 pVideoPlayer->_4BF5B2();
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3352 UI_CreateEndConversationButton();
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3353 dialog_menu_id = HOUSE_DIALOGUE_TAVERN_ARCOMAGE_MAIN;
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3354 InitializaDialogueOptions_Tavern(in_current_building_type);
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3355 break;
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3356
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3357 case HOUSE_DIALOGUE_NULL:
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3358 case HOUSE_DIALOGUE_MAIN:
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3359 pDialogueNPCCount = 0;
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3360 pDialogueWindow->Release();
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3361 dialog_menu_id = HOUSE_DIALOGUE_NULL;
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3362 pDialogueWindow = 0;
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3363 pIcons_LOD->SyncLoadedFilesCount();
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3364
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3365 if ( uNumDialogueNPCPortraits == 1 )
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3366 return 0;
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3367
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3368 pBtn_ExitCancel = window_SpeakInHouse->pControlsHead;
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3369 if ( uNumDialogueNPCPortraits > 0 )
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3370 {
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3371 for ( uint i = 0; i < (unsigned int)uNumDialogueNPCPortraits; ++i )
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3372 {
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3373 HouseNPCPortraitsButtonsList[i] = window_SpeakInHouse->CreateButton(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][i],
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3374 pNPCPortraits_y[uNumDialogueNPCPortraits - 1][i],
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3375 63, 73, 1, 0, UIMSG_ClickHouseNPCPortrait, i, 0, byte_591180[i].data(), 0, 0, 0);
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3376 }
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3377 }
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3378
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3379 pVideoPlayer->_4BF5B2();
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3380 break;
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3381
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3382 default:
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3383 pVideoPlayer->_4BF5B2();
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3384 dialog_menu_id = HOUSE_DIALOGUE_MAIN;
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3385 InitializaDialogueOptions(in_current_building_type);
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3386 break;
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3387 }
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3388 return 1;
802460e60eee add UIArena.cpp and UIArena.h and other
Ritor1
parents: 2369
diff changeset
3389 }