annotate UI/UIHouses.cpp @ 1622:01c04ff9b7a5

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