annotate UIHouses.cpp @ 878:6f32de715e30

Merge
author Nomad
date Mon, 01 Apr 2013 16:44:33 +0200
parents 231523a39203
children 1d7e7d61485b
rev   line source
620
ba08b9403e04 files for houses func
Gloval
parents:
diff changeset
1 #include "UIHouses.h"
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2 #include "Party.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3 #include "Player.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4 #include "texts.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5 #include "Events.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6 #include "Arcomage.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
7 #include "LOD.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
8 #include "Mouse.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
9 #include "GUIWindow.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
10 #include "GUIFont.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
11 #include "Events2D.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
12 #include "Overlays.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
13 #include "Render.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
14 #include "Indoor.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
15 #include "Outdoor.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
16 #include "AudioPlayer.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
17 #include "VideoPlayer.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
18 #include "Monsters.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
19 #include "Viewport.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
20 #include "Keyboard.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
21 #include "NPC.h"
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
22 #include "IndoorCamera.h"
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
23 #include "MapInfo.h"
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
24 #include "Log.h"
727
da130dd3092a Big time Travel ouverhaul
Nomad
parents: 690
diff changeset
25 #include "MM7.h"
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
26 #include "mm7_data.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
27
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
28 int uHouse_ExitPic; // weak
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
29
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
30 int dword_591080; // weak
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
31
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
32 int in_current_building_type; // 00F8B198
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
33 HOUSE_DIALOGUE_MENU dialog_menu_id; // 00F8B19C
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
34
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
35 #pragma pack(push, 1)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
36 struct stru365_travel_info
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
37 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
38 unsigned char uMapInfoID;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
39 unsigned char pSchedule[7];
776
3dc4a9b13c1b travel struct fixed
Gloval
parents: 775
diff changeset
40 unsigned int uTravelTime;
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
41 int arrival_x;
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
42 int arrival_y;
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
43 int arrival_z;
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
44 int arrival_rot_y;
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
45 unsigned int uQuestBit; // quest bit required to set for this travel option to be enabled; otherwise 0
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
46 };
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
47 #pragma pack(pop)
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
48 stru365_travel_info transport_schedule[35] = // 004F09B0
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
49 {
778
Nomad
parents: 777 776
diff changeset
50 {MAP_STEADWICK, {1, 0, 1, 0, 1, 0, 0}, 2, -18048, 4636, 833, 1536, 0},
Nomad
parents: 777 776
diff changeset
51 {MAP_PIERPONT, {0, 1, 0, 1, 0, 1, 0}, 2, -2527, -6773, 1153, 896, 0},
Nomad
parents: 777 776
diff changeset
52 {MAP_TATALIA, {1, 0, 1, 0, 1, 0, 0}, 2, 4730, -10580, 320, 1024, 0},
Nomad
parents: 777 776
diff changeset
53 {MAP_HARMONDALE, {0, 1, 0, 1, 0, 1, 0}, 2, -5692, 11137, 1, 1024, 0},
Nomad
parents: 777 776
diff changeset
54 {MAP_DEYJA, {1, 0, 0, 1, 0, 0, 0}, 3, 7227, -16007, 2625, 640, 0},
Nomad
parents: 777 776
diff changeset
55 {MAP_BRAKADA_DESERT, {0, 0, 1, 0, 0, 1, 0}, 3, 8923, 17191, 1, 512, 0},
Nomad
parents: 777 776
diff changeset
56 {MAP_AVLEE, {1, 0, 1, 0, 1, 0, 0}, 3, 17059, 12331, 512, 1152, 0},
Nomad
parents: 777 776
diff changeset
57 {MAP_DEYJA, {0, 1, 0, 0, 1, 0, 1}, 2, 7227, -16007, 2625, 640, 0},
Nomad
parents: 777 776
diff changeset
58 {MAP_HARMONDALE, {0, 1, 0, 1, 0, 1, 0}, 2, -5692, 11137, 1, 1024, 0},
Nomad
parents: 777 776
diff changeset
59 {MAP_STEADWICK, {1, 0, 1, 0, 1, 0, 0}, 3, -18048, 4636, 833, 1536, 0},
Nomad
parents: 777 776
diff changeset
60 {MAP_PIERPONT, {0, 1, 0, 1, 0, 1, 0}, 2, -2527, -6773, 1153, 896, 0},
Nomad
parents: 777 776
diff changeset
61 {MAP_STEADWICK, {1, 0, 1, 0, 1, 0, 1}, 3, -18048, 4636, 833, 1536, 0},
Nomad
parents: 777 776
diff changeset
62 {MAP_HARMONDALE, {0, 1, 0, 0, 0, 1, 0}, 5, -5692, 11137, 1, 1024, 0},
Nomad
parents: 777 776
diff changeset
63 {MAP_STEADWICK, {0, 1, 0, 1, 0, 1, 0}, 2, -18048, 4636, 833, 1536, 0},
Nomad
parents: 777 776
diff changeset
64 {MAP_PIERPONT, {0, 1, 0, 1, 0, 1, 0}, 3, -2527, -16007, 1153, 896, 0},
Nomad
parents: 777 776
diff changeset
65 {MAP_DEYJA, {0, 0, 1, 0, 0, 0, 1}, 5, 7227, -16007, 2625, 640, 0},
Nomad
parents: 777 776
diff changeset
66 {MAP_TATALIA, {0, 1, 0, 1, 0, 1, 0}, 2, -2183, -6941, 97, 0, 0},
Nomad
parents: 777 776
diff changeset
67 {MAP_AVLEE, {1, 0, 0, 0, 1, 0, 0}, 4, 7913, 9476, 193, 0, 0},
Nomad
parents: 777 776
diff changeset
68 {MAP_EVENMORN_ISLE, {0, 0, 0, 0, 0, 0, 1}, 7, 15616, 6390, 193, 1536, PARTY_QUEST_EVENMORN_MAP_FOUND},
Nomad
parents: 777 776
diff changeset
69 {MAP_BRAKADA_DESERT, {0, 0, 1, 0, 0, 0, 0}, 6, 19171, -19722, 193, 1024, 0},
Nomad
parents: 777 776
diff changeset
70 {MAP_AVLEE, {0, 1, 0, 1, 0, 1, 0}, 3, 7913, 9476, 193, 0, 0},
Nomad
parents: 777 776
diff changeset
71 {MAP_BRAKADA_DESERT, {1, 0, 1, 0, 0, 0, 0}, 6, 19171, -19722, 193, 1024, 0},
Nomad
parents: 777 776
diff changeset
72 {MAP_TATALIA, {1, 0, 1, 0, 1, 0, 0}, 4, -2183, -6941, 97, 0, 0},
Nomad
parents: 777 776
diff changeset
73 {MAP_PIERPONT, {0, 0, 0, 0, 0, 1, 0}, 6, -709, -14087, 193, 1024, 0},
Nomad
parents: 777 776
diff changeset
74 {MAP_STEADWICK, {0, 0, 0, 0, 0, 0, 1}, 6, -10471, 13497, 193, 1536, 0},
Nomad
parents: 777 776
diff changeset
75 {MAP_EVENMORN_ISLE, {0, 1, 0, 1, 0, 0, 0}, 1, 15616, 6390, 193, 1536, PARTY_QUEST_EVENMORN_MAP_FOUND},
Nomad
parents: 777 776
diff changeset
76 {MAP_BRAKADA_DESERT, {0, 1, 0, 1, 0, 0, 0}, 1, 19171, -19722, 193, 1024, 0},
Nomad
parents: 777 776
diff changeset
77 {MAP_STEADWICK, {0, 1, 0, 1, 0, 1, 0}, 2, -10471, 13497, 193, 1536, 0},
Nomad
parents: 777 776
diff changeset
78 {MAP_BRAKADA_DESERT, {1, 0, 1, 0, 0, 0, 0}, 4, 19171, -19722, 193, 1024, 0},
Nomad
parents: 777 776
diff changeset
79 {MAP_EVENMORN_ISLE, {0, 0, 0, 0, 0, 0, 1}, 5, 15616, 6390, 193, 1536, PARTY_QUEST_EVENMORN_MAP_FOUND},
Nomad
parents: 777 776
diff changeset
80 {MAP_AVLEE, {0, 0, 0, 0, 1, 0, 0}, 5, 7913, 9476, 193, 0, 0},
Nomad
parents: 777 776
diff changeset
81 {MAP_STEADWICK, {0, 1, 0, 0, 0, 1, 0}, 4, -10471, 13497, 193, 1536, 0},
Nomad
parents: 777 776
diff changeset
82 {MAP_PIERPONT, {1, 0, 1, 0, 1, 0, 0}, 3, -709, -14087, 193, 1024, 0},
Nomad
parents: 777 776
diff changeset
83 {MAP_TATALIA, {0, 0, 0, 1, 0, 0, 0}, 5, -2183, -6941, 97, 0, 0},
Nomad
parents: 777 776
diff changeset
84 {MAP_ARENA, {0, 0, 0, 0, 0, 0, 1}, 4, 3844, 2906, 193, 512, 0}
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
85 };
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
86
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
87 unsigned char transport_routes[20][4] =
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
88 {
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
89 { 0, 1, 1, 34}, // HOUSE_STABLES_HARMONDALE
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
90 { 2, 3, 4, 5}, // HOUSE_STABLES_STEADWICK
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
91 { 6, 7, 8, 8}, // HOUSE_STABLES_56
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
92 { 9, 10, 10, 10}, // HOUSE_STABLES_57
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
93 { 11, 11, 12, 12}, // HOUSE_STABLES_58
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
94 { 13, 13, 13, 13}, // HOUSE_STABLES_59
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
95 { 14, 14, 15, 15}, // HOUSE_STABLES_60
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
96 {255, 255, 255, 255}, // HOUSE_STABLES_61
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
97 {255, 255, 255, 255}, // HOUSE_STABLES_62
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
98 {255, 255, 255, 255}, // HOUSE_BOATS_63
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
99 { 16, 17, 18, 19}, // HOUSE_BOATS_64
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
100 { 18, 20, 21, 21}, // HOUSE_BOATS_65
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
101 { 22, 23, 24, 25}, // HOUSE_BOATS_66
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
102 { 22, 22, 23, 23}, // HOUSE_BOATS_67
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
103 {255, 255, 255, 255}, // HOUSE_BOATS_68
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
104 { 27, 28, 29, 30}, // HOUSE_BOATS_69
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
105 { 31, 32, 33, 33}, // HOUSE_BOATS_70
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
106 { 24, 24, 24, 24}, // HOUSE_BOATS_71
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
107 {255, 255, 255, 255}, // HOUSE_BOATS_72
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
108 {255, 255, 255, 255} // HOUSE_BOATS_73
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
109 };
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
110
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
111
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
112
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
113
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
114
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
115 const stru159 pAnimatedRooms[196] = //0x4E5F70
778
Nomad
parents: 777 776
diff changeset
116 {
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
117 {"", 0x4, 0x1F4, 0, 0, 0},
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
118 {"Human Armor01", 0x20, 0x2C0, 2, 58, 0},
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
119 {"Necromancer Armor01", 0x20, 0x2D7, 2, 70, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
120 {"Dwarven Armor01", 0x20, 0x2EE, 2, 5, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
121 {"Wizard Armor", 0x20, 0x3BD, 2, 19, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
122 {"Warlock Armor", 0x20, 0x2D6, 2, 35, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
123 {"Elf Armor", 0x20, 0x2BC, 2, 79, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
124 {"Human Alchemisht01", 0xE, 0x2BE, 4, 95, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
125 {"Necromancer Alchemist01", 0xE, 0x2D6, 4, 69, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
126 {"Dwarven Achemist01", 0xE, 0x387, 4, 4, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
127 {"Wizard Alchemist", 0xE, 0x232, 4, 25, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
128 {"Warlock Alchemist", 0xE, 0x2BE, 4, 42, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
129 {"Elf Alchemist", 0xE, 0x38A, 4, 84, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
130 {"Human Bank01", 0x6, 0x384, 22, 52, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
131 {"Necromancer Bank01", 0x6, 0x2D8, 22, 71, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
132 {"Dwarven Bank", 0x6, 0x2F3, 22, 6, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
133 {"Wizard Bank", 0x6, 0x3BA, 22, 20, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
134 {"Warlock Bank", 0x6, 0x39F, 22, 36, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
135 {"Elf Bank", 0x6, 0x2BC, 22, 71, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
136 {"Boat01", 0xF, 0x4C, 28, 53, 3 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
137 {"Boat01d", 0xF, 0x4C, 28, 53, 3 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
138 {"Human Magic Shop01", 0xA, 0x2C8, 3, 54, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
139 {"Necromancer Magic Shop01", 0xE, 0x2DC, 3, 66, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
140 {"Dwarven Magic Shop01", 0x2A, 0x2EF, 3, 91, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
141 {"Wizard Magic Shop", 0x1E, 0x2DF, 3, 15, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
142 {"Warlock Magic Shop", 0x7, 0x3B9, 3, 15, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
143 {"Elf Magic Shop", 0x24, 0x2CC, 3, 82, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
144 {"Human Stables01", 0x21, 0x31, 27, 48, 3 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
145 {"Necromancer Stables", 0x21, 0x2DD, 27, 67, 3 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
146 {"", 0x21, 0x2F0, 27, 91, 3 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
147 {"Wizard Stables", 0x21, 0x3BA, 27, 16, 3 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
148 {"Warlock Stables", 0x21, 0x181, 27, 77, 3 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
149 {"Elf Stables", 0x21, 0x195, 27, 77, 3 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
150 {"Human Tavern01", 0xD, 0x2C2, 21, 49, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
151 {"Necromancer Tavern01", 0xD, 0x3B0, 21, 57, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
152 {"Dwarven Tavern01", 0xD, 0x2FE, 21, 94, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
153 {"Wizard Tavern", 0xD, 0x3BB, 21, 17, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
154 {"Warlock Tavern", 0xD, 0x3A8, 21, 33, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
155 {"Elf Tavern", 0xD, 0x2CD, 21, 78, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
156 {"Human Temple01", 0x24, 0x2DB, 23, 50, 3 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
157 {"Necromancer Temple", 0x24, 0x2DF, 23, 60, 3 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
158 {"Dwarven Temple01", 0x24, 0x2F1, 23, 86, 3 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
159 {"Wizard Temple", 0x24, 0x2E0, 23, 10, 3 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
160 {"Warlock Temple", 0x24, 0x3A4, 23, 27, 3 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
161 {"Elf Temple", 0x24, 0x2CE, 23, 72, 3 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
162 {"Human Town Hall", 0x10, 0x39C, 17, 14, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
163 {"Necromancer Town Hall01", 0x10, 0x3A4, 17, 61, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
164 {"Dwarven Town Hall", 0x10, 0x2DB, 17, 88, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
165 {"Wizard Town Hall", 0x10, 0x3BD, 17, 11, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
166 {"Warlock Town Hall", 0x10, 0x2DB, 17, 28, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
167 {"Elf Town Hall", 0x10, 0x27A, 17, 73, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
168 {"Human Training Ground01", 0x18, 0x2C7, 30, 44, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
169 {"Necromancer Training Ground", 0x18, 0x3AD, 30, 62, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
170 {"Dwarven Training Ground", 0x18, 0x2F2, 30, 89, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
171 {"Wizard Training Ground", 0x18, 0x3A3, 30, 12, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
172 {"Warlock Training Ground", 0x18, 0x3A6, 30, 29, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
173 {"Elf Training Ground", 0x18, 0x19F, 30, 74, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
174 {"Human Weapon Smith01", 0x16, 0x2C1, 1, 45, 4 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
175 {"Necromancer Weapon Smith01", 0x16, 0x2D9, 1, 63, 4 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
176 {"Dwarven Weapon Smith01", 0x16, 0x2EE, 1, 82, 4 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
177 {"Wizard Weapon Smith", 0x16, 0x2D5, 1, 13, 4 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
178 {"Warlock Weapon Smith", 0x16, 0x2D7, 1, 23, 4 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
179 {"Elf Weapon Smith", 0x16, 0x2CA, 1, 75, 4 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
180 {"Air Guild", 0x1D, 0xA4, 6, 1, 3 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
181 {"Body Guild", 0x19, 0x3BF, 11, 2, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
182 {"DarkGuild", 0x19, 0x2D1, 13, 3, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
183 {"EarthGuild", 0x19, 0x2CB, 8, 83, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
184 {"Fire Guild", 0x1C, 0x2BF, 5, 56, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
185 {"Light Guild", 0x1C, 0x2D5, 12, 46, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
186 {"Mind Guild", 0x1C, 0xE5, 10, 40, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
187 {"Spirit Guild", 0x1C, 0x2D2, 9, 41, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
188 {"Water Guild", 0x1B, 0x2D3, 7, 24, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
189 {"Lord And Judge Out01", 1, 0, 29, 39, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
190 {"Human Poor House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
191 {"Human Poor House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
192 {"Human Poor House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
193 {"Human Medium House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
194 {"Human Medium House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
195 {"Human Medium House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
196 {"Human Rich House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
197 {"Human Rich House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
198 {"Human Rich House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
199 {"Elven Poor House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
200 {"Elven Poor House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
201 {"Elven Poor House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
202 {"Elven Medium House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
203 {"Elven Medium House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
204 {"Elven Medium House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
205 {"Elven Rich House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
206 {"Elven Rich House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
207 {"Elven Rich House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
208 {"Dwarven Poor House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
209 {"Dwarven Poor House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
210 {"Dwarven Poor House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
211 {"Dwarven Medium House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
212 {"Dwarven Medium house 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
213 {"Dwarven Medium House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
214 {"Dwarven Rich House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
215 {"Dwarven Rich House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
216 {"Dwarven Rich House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
217 {"Wizard Poor House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
218 {"Wizard Poor House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
219 {"Wizard Poor House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
220 {"Wizard Medium House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
221 {"Wizard Medium House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
222 {"Wizard Mdeium House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
223 {"Wizard Rich House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
224 {"Wizard Rich House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
225 {"Wizard Rich House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
226 {"Necromancer Poor House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
227 {"Necromancer Poor House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
228 {"Necromancer Poor House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
229 {"Necromancer Medium House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
230 {"Necromancer Medium House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
231 {"Necromancer Mdeium House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
232 {"Necromancer Rich House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
233 {"Necromancer Rich House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
234 {"Necromancer Rich House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
235 {"Warlock Poor House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
236 {"Warlock Poor House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
237 {"Warlock Poor House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
238 {"Warlock Medium House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
239 {"Warlock Medium House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
240 {"Warlock Mdeium House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
241 {"Warlock Rich House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
242 {"Warlock Rich House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
243 {"Warlock Rich House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
244 {"Out01 Temple of the Moon", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
245 {"Out01 Dragon Cave", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
246 {"Out02 Castle Harmondy", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
247 {"Out02 White Cliff Cave", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
248 {"Out03 Erathian Sewer", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
249 {"Out03 Fort Riverstride", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
250 {"Out03 Castle Gryphonheart", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
251 {"Out04 Elf Castle", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
252 {"Out04 Tularean Caves", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
253 {"Out04 Clanker's Laboratory", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
254 {"Out05 Hall of the Pit", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
255 {"Out05 Watchtower 6", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
256 {"Out06 School of Sorcery", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
257 {"Out06 Red Dwarf Mines", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
258 {"Out07 Castle Lambert", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
259 {"Out07 Walls of Mist", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
260 {"Out07 Temple of the Light", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
261 {"Out08 Evil Entrance", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
262 {"Out08 Breeding Zone", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
263 {"Out08 Temple of the Dark", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
264 {"Out09 Grand Temple of the Moon", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
265 {"Out09 Grand Tempple of the Sun", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
266 {"Out10 Thunderfist Mountain", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
267 {"Out10 The Maze", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
268 {"Out10 Connecting Tunnel Cave #1", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
269 {"", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
270 {"", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
271 {"Out11 Stone City", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
272 {"", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
273 {"Out12 Colony Zod", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
274 {"Out12 Connecting Tunnel Cave #1", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
275 {"", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
276 {"", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
277 {"Out13 Mercenary Guild", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
278 {"Out13 Tidewater Caverns", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
279 {"Out13 Wine Cellar", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
280 {"Out14 Titan's Stronghold", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
281 {"Out14 Temple Of Baa", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
282 {"Out14 Hall under the Hill", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
283 {"Out15 The Linclon", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
284 {"Jail", 0x24, 0, 31, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
285 {"Harmondale Throne Room", 0x24, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
286 {"Gryphonheart Throne Room", 0x24, 0, 20, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
287 {"Elf Castle Throne Room", 0x24, 0, 20, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
288 {"Wizard Castle Throne Room", 0x24, 0, 20, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
289 {"Necromancer Casstle Trone Room", 0x24, 0, 20, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
290 {"Master Thief", 0x24, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
291 {"Dwarven King", 0x24, 0, 20, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
292 {"Arms Master", 0x24, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
293 {"Warlock", 0x24, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
294 {"Lord Markam", 0x24, 0, 20, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
295 {"Arbiter Neutral Town", 0x24, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
296 {"Arbiter Good Town", 0x24, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
297 {"Arbiter Evil Town", 0x24, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
298 {"Necromancer Throne Room Empty", 0x24, 0, 20, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
299 {"", 0x24, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
300 {"", 0x24, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
301 {"", 0x24, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
302 {"", 0x24, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
303 {"Boat01", 0xF, 0, 29, 53, 3 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
304 {"", 0x24, 0, 28, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
305 {"", 0x24, 0, 28, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
306 {"", 0x24, 0, 28, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
307 {"", 0x24, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
308 {"Arbiter Room Neutral", 0x24, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
309 {"Out02 Castle Harmondy Abandoned", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
310 {"Human Temple02", 0x24, 0x3AB, 23, 27, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
311 {"Player Castle Good", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
312 {"Player Castle Bad", 0x24, 0, 25, 0, 0}
778
Nomad
parents: 777 776
diff changeset
313 };
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
314
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
315
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
316
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
317 //----- (0044606A) --------------------------------------------------------
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
318 void PrepareHouse(HOUSE_ID house)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
319 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
320 //unsigned int v1; // ebx@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
321 //signed int v2; // esi@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
322 //int uExitPic; // edi@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
323 __int16 uExitMapID; // ax@2
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
324 //int result; // eax@5
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
325 //unsigned int *v6; // ecx@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
326 int v7; // ebx@11
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
327 //int v8; // esi@16
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
328 //unsigned int v9; // eax@16
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
329 //unsigned int v10; // eax@19
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
330 //int v11; // ecx@19
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
331 //char pContainer[36]; // [sp+Ch] [bp-54h]@16
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
332 int v13; // [sp+30h] [bp-30h]@11
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
333 int Dst[6]; // [sp+34h] [bp-2Ch]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
334 //unsigned int v15; // [sp+4Ch] [bp-14h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
335 int uAnimationID; // [sp+50h] [bp-10h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
336 //unsigned int *v17; // [sp+54h] [bp-Ch]@3
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
337 //unsigned int v18; // [sp+58h] [bp-8h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
338 //int v19; // [sp+5Ch] [bp-4h]@7
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
339
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
340 //v15 = uHouseID;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
341 //v1 = 52 * uHouseID;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
342 //uAnimationID = p2DEvents_minus1___02[26 * uHouseID];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
343 uAnimationID = p2DEvents[house - 1].uAnimationID;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
344 //v18 = 52 * uHouseID;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
345 memset(Dst, 0, 0x18u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
346 //uExitPic = *(__int16 *)((char *)p2DEvents_minus1_::2C + v1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
347 //uExitPic = p2DEvents[uHouseID - 1].uExitPicID;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
348 uNumDialogueNPCPortraits = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
349 uHouse_ExitPic = p2DEvents[house - 1].uExitPicID;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
350 if ( uHouse_ExitPic )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
351 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
352 //uExitMapID = *(__int16 *)((char *)p2DEvents_minus1_::30 + v1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
353 uExitMapID = p2DEvents[house - 1]._quest_related;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
354 if ( uExitMapID > 0 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
355 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
356 //v17 = (unsigned int *)(uExitMapID - 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
357 if(_449B57_test_bit(pParty->_quest_bits,uExitMapID))
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
358 // if ( !((unsigned __int8)(0x80u >> (uExitMapID - 1) % 8) & pParty->_quest_bits[(uExitMapID - 1) >> 3]) )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
359 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
360 //uExitPic = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
361 uHouse_ExitPic = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
362 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
363 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
364 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
365
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
366 dword_591080 = pAnimatedRooms[uAnimationID].field_8;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
367 //result = dword_591080;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
368
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
369 //v2 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
370 uNumDialogueNPCPortraits = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
371 if ( dword_591080 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
372 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
373 //v2 = 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
374 Dst[0] = dword_591080;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
375 uNumDialogueNPCPortraits = 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
376 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
377
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
378 //v19 = 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
379 for (uint i = 0; i < pNPCStats->uNumNewNPCs; ++i)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
380 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
381 auto npc = pNPCStats->pNewNPCData + i;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
382 //v6 = &pNPCStats->pNewNPCData[1].uFlags;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
383 //v17 = &pNPCStats->pNewNPCData[1].uFlags;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
384 //do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
385 //{
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
386 if (npc->Location2D == house )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
387 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
388 if (~npc->uFlags & 0x80)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
389 //if ( !(*(char *)v6 & 0x80) )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
390 {
873
aa0172fd88c6 TavernDialog second NPCName fix
Ritor1
parents: 870
diff changeset
391 v7 = uNumDialogueNPCPortraits++ - (dword_591080 != 0) ? 1 : 0;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
392 HouseNPCData[v7] = npc;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
393 //v6 = v17;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
394 //*(&v13 + v2) = *(v17 - 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
395 Dst[uNumDialogueNPCPortraits - 1] = npc->uPortraitID;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
396 //v1 = v18;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
397 if ((npc->uFlags & 3) != 2)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
398 ++npc->uFlags;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
399 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
400 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
401 //++v19;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
402 //v6 += 19;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
403 //v17 = v6;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
404 //}
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
405 //while ( v19 < (signed int)pNPCStats->uNumNewNPCs );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
406 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
407 //uNumDialogueNPCPortraits = v2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
408
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
409 //v19 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
410 for (uint i = 0; i < uNumDialogueNPCPortraits; ++i)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
411 //if ( v2 > 0 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
412 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
413 //do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
414 //{
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
415 //v8 = v19;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
416 char icon_name[128];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
417 sprintfex(icon_name, "npc%03u", Dst[i]);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
418 //v9 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
419 //++v19;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
420 pDialogueNPCPortraits[i] = pIcons_LOD->LoadTexturePtr(icon_name, TEXTURE_16BIT_PALETTE);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
421 //result = v19;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
422 //}
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
423 //while ( v19 < uNumDialogueNPCPortraits );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
424 //uExitPic = uHouse_ExitPic;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
425 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
426
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
427 if (uHouse_ExitPic)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
428 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
429 //v10 = pIcons_LOD->LoadTexture(pHouse_ExitPictures[uHouse_ExitPic], TEXTURE_16BIT_PALETTE);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
430 //v11 = uNumDialogueNPCPortraits++;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
431 pDialogueNPCPortraits[uNumDialogueNPCPortraits++] = pIcons_LOD->LoadTexturePtr(pHouse_ExitPictures[uHouse_ExitPic], TEXTURE_16BIT_PALETTE);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
432 //result = *(__int16 *)((char *)p2DEvents_minus1_::2E + v1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
433 //result = p2DEvents[house - 1].uExitMapID;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
434 uHouse_ExitPic = p2DEvents[house - 1].uExitMapID;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
435 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
436 //return result;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
437 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
438
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
439
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
440 //----- (0044622E) --------------------------------------------------------
735
6daaa2f18d0d Fixed some house sounds & shop-related stuff
Nomad
parents: 728
diff changeset
441 bool EnterHouse(enum HOUSE_ID uHouseID)
6daaa2f18d0d Fixed some house sounds & shop-related stuff
Nomad
parents: 728
diff changeset
442 {
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
443 //enum HOUSE_ID v1; // edi@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
444 //int v2; // edi@5
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
445 signed int uOpenTime; // eax@5
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
446 signed int uCloseTime; // esi@5
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
447 unsigned int v5; // esi@5
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
448 int v6; // edx@5
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
449 signed int am_pm_flag_open; // ecx@10
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
450 signed int am_pm_flag_close; // eax@10
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
451 int v9; // esi@10
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
452 //unsigned int v10; // esi@16
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
453 int v11; // ecx@17
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
454 unsigned int v12; // kr00_4@25
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
455 //Player *v13; // esi@25
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
456 int v14; // eax@25
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
457 //Player *v15; // esi@27
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
458 //signed int v16; // eax@32
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
459 unsigned int v17; // eax@37
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
460 signed int v18; // edi@37
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
461 signed int v19; // edi@41
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
462 //unsigned int v20; // ecx@41
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
463 //const char *v22; // [sp-4h] [bp-40h]@33
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
464 char pContainer[40]; // [sp+Ch] [bp-30h]@32
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
465 unsigned int v24; // [sp+34h] [bp-8h]@5
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
466 //enum HOUSE_ID v25; // [sp+38h] [bp-4h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
467
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
468 //v1 = uHouseID;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
469 //v25 = uHouseID;
783
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 778
diff changeset
470 GameUI_Footer_TimedString[0] = 0;
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 778
diff changeset
471 pFooterString[0] = 0;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
472 ShowStatusBarString("", 2u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
473 if ( pMessageQueue_50CBD0->uNumMessages )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
474 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
475 viewparams->bRedrawGameUI = 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
476 uDialogueType = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
477 pKeyActionMap->_459ED1(3);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
478 pKeyActionMap->ResetKeys();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
479 if (uHouseID == HOUSE_600 || uHouseID == HOUSE_601)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
480 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
481 GameOverMenu(0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
482 return 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
483 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
484 uOpenTime = p2DEvents[uHouseID - 1].uOpenTime;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
485 uCloseTime = p2DEvents[uHouseID - 1].uCloseTime;
827
085eb19b7ffd mr.Malvik
Ritor1
parents: 819
diff changeset
486 current_npc_text = 0;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
487 dword_F8B1E4 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
488 dword_F8B1F4 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
489 memset(byte_F8B1F0, 0, 4);
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
490 memset(player_levels, 0, 16);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
491 pRenderer->ClearZBuffer(0, 479);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
492
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
493 if (((uCloseTime - 1 <= uOpenTime)&&((pParty->uCurrentHour <uOpenTime)&&(pParty->uCurrentHour >(uCloseTime - 1))))||
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
494 ((uCloseTime - 1 > uOpenTime)&&((pParty->uCurrentHour < uOpenTime)||(pParty->uCurrentHour > (uCloseTime - 1)))))
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
495
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
496 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
497 am_pm_flag_open = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
498 am_pm_flag_close = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
499 if (uOpenTime > 12 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
500 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
501 uOpenTime -= 12;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
502 am_pm_flag_open = 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
503 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
504 if ( uCloseTime > 12 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
505 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
506 uCloseTime -= 12;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
507 am_pm_flag_close = 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
508 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
509 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[414], uOpenTime, aAMPMNames[am_pm_flag_open],
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
510 uCloseTime, aAMPMNames[am_pm_flag_close]); //"This place is open from %d%s to %d%s"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
511 ShowStatusBarString(pTmpBuf, 2u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
512 if ( uActiveCharacter )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
513 pPlayers[uActiveCharacter]->PlaySound(SPEECH_3, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
514 return 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
515 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
516 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
517 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
518 //v10 = uHouseID;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
519 if ( (signed int)uHouseID < 53 ) //entering shops and guilds
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
520 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
521 if ( !(pParty->field_3C._shop_ban_times[uHouseID])
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
522 || (pParty->field_3C._shop_ban_times[uHouseID] <= pParty->uTimePlayed) )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
523 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
524 pParty->field_3C._shop_ban_times[uHouseID] = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
525 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
526 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
527 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
528 ShowStatusBarString(pGlobalTXT_LocalizationStrings[191], 2u);// "You've been banned from this shop!"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
529 return 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
530 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
531 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
532 if ( !start_event_seq_number )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
533 pAudioPlayer->StopChannels(-1, -1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
534
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
535 uCurrentHouse_Animation = p2DEvents[uHouseID - 1].uAnimationID;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
536 in_current_building_type = pAnimatedRooms[uCurrentHouse_Animation].uBuildingType;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
537 if ( in_current_building_type == BildingType_Throne_Room && pParty->uFine ) // going 2 jail
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
538 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
539 uCurrentHouse_Animation = (signed __int16)p2DEvents[186].uAnimationID;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
540 uHouseID = HOUSE_JAIL;
727
da130dd3092a Big time Travel ouverhaul
Nomad
parents: 690
diff changeset
541 pParty->uTimePlayed = pParty->uTimePlayed + 0x7620000;
da130dd3092a Big time Travel ouverhaul
Nomad
parents: 690
diff changeset
542 in_current_building_type = pAnimatedRooms[p2DEvents[HOUSE_LORD_AND_JUDGE_EMERALD_ISLE].uAnimationID].uBuildingType;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
543 ++pParty->uNumPrisonTerms;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
544 pParty->uFine = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
545 for (uint i = 0; i < 4; ++i)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
546 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
547 pParty->pPlayers[i].uTimeToRecovery = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
548 pParty->pPlayers[i].uNumDivineInterventionCastsThisDay = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
549 pParty->pPlayers[i].SetVariable(VAR_Award, 87);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
550 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
551 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
552 ++pIcons_LOD->uTexturePacksCount;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
553 if ( !pIcons_LOD->uNumPrevLoadedFiles )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
554 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
555 switch (pParty->alignment)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
556 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
557 case PartyAlignment_Good: sprintf(pContainer, "evt%02d-b", const_2()); break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
558 case PartyAlignment_Neutral: sprintf(pContainer, "evt%02d", const_2()); break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
559 case PartyAlignment_Evil: sprintf(pContainer, "evt%02d-c", const_2()); break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
560 default: assert(false);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
561 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
562
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
563 v17 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
564 pDialogueNPCCount = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
565 pTexture_Dialogue_Background = &pIcons_LOD->pTextures[v17];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
566 uTextureID_507B04 = uTextureID_right_panel;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
567 PrepareHouse(uHouseID);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
568 v18 = 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
569 uTextureID_507B04 = uTextureID_right_panel;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
570 if ( uNumDialogueNPCPortraits == 1 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
571 pDialogueNPCCount = 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
572 pVideoPlayer->_4BF28F(pAnimatedRooms[uCurrentHouse_Animation].video_name, 1u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
573 dword_5C35D4 = 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
574 if ( (signed int)uHouseID < 139 || (signed int)uHouseID > 172 )
727
da130dd3092a Big time Travel ouverhaul
Nomad
parents: 690
diff changeset
575 {
da130dd3092a Big time Travel ouverhaul
Nomad
parents: 690
diff changeset
576 if ( (signed int)uHouseID >= HOUSE_STABLES_HARMONDALE && (signed int)uHouseID <= 73 && !IsTravelAvailable(uHouseID - HOUSE_STABLES_HARMONDALE) )
da130dd3092a Big time Travel ouverhaul
Nomad
parents: 690
diff changeset
577 {
da130dd3092a Big time Travel ouverhaul
Nomad
parents: 690
diff changeset
578 return 1;
da130dd3092a Big time Travel ouverhaul
Nomad
parents: 690
diff changeset
579 }
da130dd3092a Big time Travel ouverhaul
Nomad
parents: 690
diff changeset
580 }
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
581 else
735
6daaa2f18d0d Fixed some house sounds & shop-related stuff
Nomad
parents: 728
diff changeset
582 { //guilds
6daaa2f18d0d Fixed some house sounds & shop-related stuff
Nomad
parents: 728
diff changeset
583 v19 = guild_mambership_flags[uHouseID - HOUSE_FIRE_GUILD_INITIATE_EMERALD_ISLE]; //guilds flags
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
584 //v20 = uHouseID;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
585 //if ( !((unsigned __int8)(0x80u >> v19 % 8) & pPlayers[uActiveCharacter]->_guilds_member_bits[v19 /8]) )
735
6daaa2f18d0d Fixed some house sounds & shop-related stuff
Nomad
parents: 728
diff changeset
586 if(_449B57_test_bit(pPlayers[uActiveCharacter]->_guilds_member_bits,v19))
6daaa2f18d0d Fixed some house sounds & shop-related stuff
Nomad
parents: 728
diff changeset
587 {
6daaa2f18d0d Fixed some house sounds & shop-related stuff
Nomad
parents: 728
diff changeset
588 PlayHouseSound(uHouseID, HouseSound_Greeting_2);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
589 return 1;
735
6daaa2f18d0d Fixed some house sounds & shop-related stuff
Nomad
parents: 728
diff changeset
590 }
6daaa2f18d0d Fixed some house sounds & shop-related stuff
Nomad
parents: 728
diff changeset
591 }
6daaa2f18d0d Fixed some house sounds & shop-related stuff
Nomad
parents: 728
diff changeset
592 PlayHouseSound(uHouseID, HouseSound_Greeting);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
593 dword_5C35D4 = 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
594 return 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
595 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
596 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
597
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
598 //----- (004B1E92) --------------------------------------------------------
735
6daaa2f18d0d Fixed some house sounds & shop-related stuff
Nomad
parents: 728
diff changeset
599 void PlayHouseSound(unsigned int uHouseID, HouseSoundID sound)
6daaa2f18d0d Fixed some house sounds & shop-related stuff
Nomad
parents: 728
diff changeset
600 {
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
601 //if ( BYTE1(pAnimatedRooms[p2DEvents_minus1___02[26 * uHouseID]].field_C) )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
602 if ( pAnimatedRooms[p2DEvents[uHouseID - 1].uAnimationID].uRoomSoundId )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
603 pAudioPlayer->PlaySound(
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
604 //(SoundID)(a2 + 100 * (BYTE1(pAnimatedRooms[p2DEvents_minus1___02[26 * uHouseID]].field_C) + 300)),
735
6daaa2f18d0d Fixed some house sounds & shop-related stuff
Nomad
parents: 728
diff changeset
605 (SoundID)(sound + 100 * (pAnimatedRooms[p2DEvents[uHouseID - 1].uAnimationID].uRoomSoundId + 300)),
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
606 806, 0, -1, 0, 0, 0, 0);
735
6daaa2f18d0d Fixed some house sounds & shop-related stuff
Nomad
parents: 728
diff changeset
607 }
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
608
762
cf2fbac6edc9 Misc cleaning
Nomad
parents: 759
diff changeset
609 //----- (004B4F4F) --------------------------------------------------------
cf2fbac6edc9 Misc cleaning
Nomad
parents: 759
diff changeset
610 void JailDialog()
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
611 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
612 const char *v0; // esi@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
613 const char *v1; // ST10_4@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
614 unsigned __int16 v2; // ST0C_2@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
615 int v3; // eax@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
616 GUIWindow v5; // [sp+8h] [bp-54h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
617
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
618 memcpy(&v5, window_SpeakInHouse, sizeof(v5));
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
619 v0 = pGlobalTXT_LocalizationStrings[672];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
620 v1 = pGlobalTXT_LocalizationStrings[672];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
621 v5.uFrameX = 483;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
622 v5.uFrameWidth = 148;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
623 v5.uFrameZ = 334;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
624 v2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
625 v3 = pFontArrus->CalcTextHeight(v0, &v5, 0, 0);
762
cf2fbac6edc9 Misc cleaning
Nomad
parents: 759
diff changeset
626 v5.DrawTitleText(pFontArrus, 0, (310 - v3) / 2 + 18, v2, v1, 3u);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
627 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
628
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
630
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
631
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
632 //----- (004BCACC) --------------------------------------------------------
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
633 void __fastcall OnSelectShopDialogueOption(signed int uMessageParam)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
634 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
635 //unsigned int v1; // edi@1
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
636 //signed int v2; // ebx@1
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
637 //signed int v3; // ecx@2
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
638 int v4; // eax@5
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
639 signed int v5; // esi@5
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
640 //Player *v6; // ecx@5
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
641 //signed int v7; // edx@5
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
642 GUIWindow *v8; // esi@10
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
643 unsigned int v9; // eax@12
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
644 int v10; // esi@31
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
645 int v11; // edi@31
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
646 int v12; // esi@32
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
647 __int16 v13; // bp@32
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
648 int v14; // edx@32
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
649 GUIWindow *v15; // eax@32
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
650 int v16; // eax@32
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
651 int v17; // eax@33
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
652 int v18; // eax@34
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
653 int v19; // eax@35
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
654 __int16 v20; // ax@37
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
655 __int16 v21; // ax@76
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
656 __int16 v22; // ax@107
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
657 __int16 v23; // ax@132
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
658 __int16 v24; // ax@163
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
659 int v25; // esi@190
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
660 __int16 v26; // ax@190
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
661 char v27; // zf@190
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
662 Player *v28; // edi@192
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
663 int v29; // eax@204
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
664 void *v30; // esi@208
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
665 unsigned __int64 v31; // qax@208
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
666 signed int v32; // edi@209
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
667 int v33; // eax@210
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
668 unsigned int v34; // eax@211
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
669 Player *v35; // edi@227
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
670 signed int v36; // esi@227
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
671 int v37; // ecx@227
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
672 int v38; // esi@230
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
673 int v39; // edx@235
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
674 int v40; // edi@243
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
675 unsigned __int64 v41; // qax@243
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
676 void *v42; // eax@244
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
677 signed int v43; // edi@244
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
678 int v44; // edx@244
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
679 int v45; // eax@246
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
680 unsigned int v46; // eax@247
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
681 void *v47; // eax@250
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
682 signed int v48; // edi@250
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
683 int v49; // eax@252
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
684 int v50; // eax@256
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
685 unsigned int v51; // eax@257
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
686 void *v52; // eax@260
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
687 signed int v53; // edi@260
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
688 int v54; // eax@262
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
689 //signed int v55; // [sp+10h] [bp-10h]@1
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
690 int v56; // [sp+14h] [bp-Ch]@31
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
691
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
692 //v1 = 0;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
693 //v2 = a1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
694 //v55 = a1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
695 if ( !pDialogueWindow->pNumPresenceButton )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
696 return;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
697 pRenderer->ClearZBuffer(0, 479);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
698 //v3 = dword_F8B198;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
699 if ( dialog_menu_id != HOUSE_DIALOGUE_MAIN)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
700 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
701 v8 = window_SpeakInHouse;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
702 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
703 //else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
704 if (dialog_menu_id == HOUSE_DIALOGUE_MAIN)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
705 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
706 if ( in_current_building_type == BildingType_Training )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
707 {
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
708 if ( uMessageParam == HOUSE_DIALOGUE_TRAININGHALL_TRAIN )
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
709 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
710 v4 = 0;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
711 v5 = 0;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
712 //v6 = pPlayers[uActiveCharacter];
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
713 //v7 = pPlayers[uActiveCharacter]->uLevel;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
714 if ( pPlayers[uActiveCharacter]->uLevel > 0 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
715 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
716 do
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
717 v4 += v5++ + 1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
718 while ( v5 < pPlayers[uActiveCharacter]->uLevel );
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
719 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
720 if (pPlayers[uActiveCharacter]->uLevel < pMaxLevelPerTrainingHallType[(unsigned int)window_SpeakInHouse->ptr_1C - 89] &&
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
721 (signed __int64)pPlayers[uActiveCharacter]->uExperience < 1000 * v4)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
722 return;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
723 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
724 pDialogueWindow->Release();
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
725 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x159u, WINDOW_MainMenu, 0, 0);
832
dfd683c4f538 Hotkeys fixed
Nomad
parents: 827
diff changeset
726 pBtn_ExitCancel = pDialogueWindow->CreateButton(526, 445, 75, 33, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[74],// "End Conversation"
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
727 pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0);
832
dfd683c4f538 Hotkeys fixed
Nomad
parents: 827
diff changeset
728 pDialogueWindow->CreateButton(8u, 8u, 0x1C2u, 0x140u, 1, 0, UIMSG_BuyInShop_Identify_Repair, 0, 0, "", nullptr);
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
729 // LABEL_10:
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
730 //v3 = dword_F8B198;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
731 v8 = window_SpeakInHouse;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
732 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
733 //else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
734 if ( in_current_building_type != BildingType_Training )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
735 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
736 v8 = window_SpeakInHouse;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
737 if ((in_current_building_type == BildingType_Stables || in_current_building_type == BildingType_Boats) &&
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
738 transport_schedule[transport_routes[(unsigned int)window_SpeakInHouse->ptr_1C - HOUSE_STABLES_HARMONDALE][uMessageParam - HOUSE_DIALOGUE_TRANSPORT_SCHEDULE_1]].pSchedule[pParty->uDaysPlayed % 7]
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
739 || in_current_building_type != BildingType_Temple || uMessageParam != BildingType_MindGuild )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
740 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
741 //LABEL_9:
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
742 pDialogueWindow->Release();
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
743 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x159u, WINDOW_MainMenu, 0, 0);
832
dfd683c4f538 Hotkeys fixed
Nomad
parents: 827
diff changeset
744 pBtn_ExitCancel = pDialogueWindow->CreateButton(526, 445, 75, 33, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[74],// "End Conversation"
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
745 pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0);
832
dfd683c4f538 Hotkeys fixed
Nomad
parents: 827
diff changeset
746 pDialogueWindow->CreateButton(8u, 8u, 0x1C2u, 0x140u, 1, 0, UIMSG_BuyInShop_Identify_Repair, 0, 0, "", nullptr);
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
747 // LABEL_10:
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
748 //v3 = dword_F8B198;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
749 v8 = window_SpeakInHouse;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
750 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
751 else if (uActiveCharacter)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
752 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
753 if ( !pPlayers[uActiveCharacter]->_4B6FF9() )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
754 return;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
755 v8 = window_SpeakInHouse;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
756 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
757 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
758 //LABEL_11:
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
759 dialog_menu_id = (HOUSE_DIALOGUE_MENU)uMessageParam;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
760 if ( in_current_building_type < BildingType_19 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
761 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
762 v9 = pIcons_LOD->LoadTexture(off_4F03B8[in_current_building_type], TEXTURE_16BIT_PALETTE);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
763 //v3 = dword_F8B198;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
764 ShopTexture = &pIcons_LOD->pTextures[v9];
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
765 //LABEL_13:
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
766 v8 = window_SpeakInHouse;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
767 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
768 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
769
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
770 //NEW
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
771 switch(in_current_building_type)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
772 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
773 case 5:
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
774 case 6:
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
775 case 7:
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
776 case 8:
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
777 case 9:
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
778 case 10:
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
779 case 11:
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
780 case 12:
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
781 case 13:
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
782 case 14:
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
783 case 15:
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
784 case 16:
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
785 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
786 if ( (signed __int64)__PAIR__(
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
787 *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)v8->ptr_1C + 44472],
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
788 *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)v8->ptr_1C + 44468]) >= (signed __int64)pParty->uTimePlayed )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
789 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
790 v32 = 0;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
791 do
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
792 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
793 //v33 = *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v32 + 12 * (unsigned int)v8->ptr_1C));
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
794 v33 = pParty->SpellBooksInGuilds[v8->par1C-139][v32].uItemID;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
795 if ( v33 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
796 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
797 v34 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v33].pIconName, TEXTURE_16BIT_PALETTE);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
798 v8 = window_SpeakInHouse;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
799 ItemsInShopTexture[v32] = &pIcons_LOD->pTextures[v34];
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
800 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
801 ++v32;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
802 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
803 while ( v32 < 12 );
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
804 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
805 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
806 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
807 SpellBookGenerator();
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
808 v30 = window_SpeakInHouse->ptr_1C;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
809 v31 = pParty->uTimePlayed
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
810 + (signed __int64)((double)(0xA8C000
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
811 //* (signed int)p2DEvents_minus1[26 * (unsigned int)ptr_507BC0->ptr_1C])
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
812 * (signed int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].field_1C)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
813 * 0.033333335);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
814 *(int *)&stru_AA1058[3].pSounds[8 * (int)v30 + 44468] = v31;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
815 *(int *)&stru_AA1058[3].pSounds[8 * (int)v30 + 44472] = HIDWORD(v31);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
816 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
817 return;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
818 break;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
819 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
820 case 17:
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
821 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
822 if ( uMessageParam == 99 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
823 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
824 v10 = (int)((char *)v8->ptr_1C - 102);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
825 v56 = v10;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
826 v11 = 8 * v10 + 11325428;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
827 if ( (signed __int64)__PAIR__(pParty->field_3C.field_0[2 * v10 + 1], pParty->field_3C.field_0[2 * v10]) >= (signed __int64)pParty->uTimePlayed )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
828 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
829 v13 = 0;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
830 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
831 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
832 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
833 v12 = v10;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
834 v13 = 0;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
835 pParty->field_75A[v12] = 0;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
836 *(_QWORD *)v11 = (signed __int64)((double)(309657600 * (pParty->uCurrentMonth + 12i64 * pParty->uCurrentYear - 14015)) * 0.033333335);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
837 v14 = rand() % 258;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
838 v15 = window_SpeakInHouse;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
839 pParty->field_750[v12] = v14 + 1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
840 v16 = (int)((char *)v15->ptr_1C - 102);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
841 if ( v16 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
842 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
843 v17 = v16 - 1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
844 if ( v17 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
845 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
846 v18 = v17 - 1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
847 if ( v18 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
848 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
849 v19 = v18 - 1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
850 if ( v19 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
851 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
852 if ( v19 == 1 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
853 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
854 while ( 1 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
855 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
856 v20 = pParty->field_750[v12];
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
857 if ( (unsigned __int16)v20 < 0x73u || (unsigned __int16)v20 > 0x84u )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
858 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
859 if ( ((unsigned __int16)v20 < 0xE8u || (unsigned __int16)v20 > 0xF9u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
860 && ((unsigned __int16)v20 < 0x85u || (unsigned __int16)v20 > 0x96u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
861 && ((unsigned __int16)v20 < 0x97u || (unsigned __int16)v20 > 0xBAu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
862 && ((unsigned __int16)v20 < 0xBEu || (unsigned __int16)v20 > 0xC0u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
863 && ((unsigned __int16)v20 < 0xC4u || (unsigned __int16)v20 > 0xC6u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
864 && ((unsigned __int16)v20 < 0x2Bu || (unsigned __int16)v20 > 0x2Du)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
865 && ((unsigned __int16)v20 < 0x6Du || (unsigned __int16)v20 > 0x6Fu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
866 && ((unsigned __int16)v20 < 0x46u || (unsigned __int16)v20 > 0x48u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
867 && ((unsigned __int16)v20 < 0x100u || (unsigned __int16)v20 > 0x102u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
868 && ((unsigned __int16)v20 < 0xD9u || (unsigned __int16)v20 > 0xDBu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
869 && ((unsigned __int16)v20 < 0xC7u || (unsigned __int16)v20 > 0xC9u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
870 && ((unsigned __int16)v20 < 0xE5u || (unsigned __int16)v20 > 0xE7u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
871 && ((unsigned __int16)v20 < 0xDFu || (unsigned __int16)v20 > 0xE1u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
872 && ((unsigned __int16)v20 < 0x5Bu || (unsigned __int16)v20 > 0x5Du)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
873 && ((unsigned __int16)v20 < 0x49u || (unsigned __int16)v20 > 0x4Bu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
874 && ((unsigned __int16)v20 < 0xFDu || (unsigned __int16)v20 > 0xFFu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
875 && ((unsigned __int16)v20 < 0x61u || (unsigned __int16)v20 > 0x63u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
876 && ((unsigned __int16)v20 < 0x10u || (unsigned __int16)v20 > 0x12u) )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
877 break;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
878 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
879 pParty->field_750[v12] = rand() % 258 + 1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
880 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
881 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
882 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
883 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
884 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
885 while ( 1 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
886 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
887 v21 = pParty->field_750[v12];
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
888 if ( (unsigned __int16)v21 < 0x73u || (unsigned __int16)v21 > 0x84u )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
889 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
890 if ( ((unsigned __int16)v21 < 0xE8u || (unsigned __int16)v21 > 0xF9u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
891 && ((unsigned __int16)v21 < 0x85u || (unsigned __int16)v21 > 0x96u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
892 && ((unsigned __int16)v21 < 0x97u || (unsigned __int16)v21 > 0xBAu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
893 && ((unsigned __int16)v21 < 0xBEu || (unsigned __int16)v21 > 0xC0u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
894 && ((unsigned __int16)v21 < 0xC4u || (unsigned __int16)v21 > 0xC6u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
895 && ((unsigned __int16)v21 < 0x2Bu || (unsigned __int16)v21 > 0x2Du)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
896 && ((unsigned __int16)v21 < 0x5Eu || (unsigned __int16)v21 > 0x60u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
897 && ((unsigned __int16)v21 < 0x43u || (unsigned __int16)v21 > 0x45u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
898 && ((unsigned __int16)v21 < 0x4Fu || (unsigned __int16)v21 > 0x51u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
899 && ((unsigned __int16)v21 < 0xC1u || (unsigned __int16)v21 > 0xC3u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
900 && ((unsigned __int16)v21 < 0x13u || (unsigned __int16)v21 > 0x15u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
901 && ((unsigned __int16)v21 < 0xFDu || (unsigned __int16)v21 > 0xFFu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
902 && ((unsigned __int16)v21 < 0x61u || (unsigned __int16)v21 > 0x63u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
903 && ((unsigned __int16)v21 < 0x6Au || (unsigned __int16)v21 > 0x6Cu) )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
904 break;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
905 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
906 pParty->field_750[v12] = rand() % 258 + 1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
907 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
908 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
909 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
910 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
911 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
912 while ( 1 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
913 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
914 v22 = pParty->field_750[v12];
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
915 if ( (unsigned __int16)v22 < 0x73u || (unsigned __int16)v22 > 0x84u )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
916 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
917 if ( ((unsigned __int16)v22 < 0xE8u || (unsigned __int16)v22 > 0xF9u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
918 && ((unsigned __int16)v22 < 0x85u || (unsigned __int16)v22 > 0x96u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
919 && ((unsigned __int16)v22 < 0x97u || (unsigned __int16)v22 > 0xBAu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
920 && ((unsigned __int16)v22 < 0xBEu || (unsigned __int16)v22 > 0xC0u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
921 && ((unsigned __int16)v22 < 0xC4u || (unsigned __int16)v22 > 0xC6u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
922 && ((unsigned __int16)v22 < 0x2Bu || (unsigned __int16)v22 > 0x2Du)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
923 && ((unsigned __int16)v22 < 0x31u || (unsigned __int16)v22 > 0x33u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
924 && ((unsigned __int16)v22 < 0x34u || (unsigned __int16)v22 > 0x36u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
925 && ((unsigned __int16)v22 < 0xFDu || (unsigned __int16)v22 > 0xFFu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
926 && ((unsigned __int16)v22 < 0x61u || (unsigned __int16)v22 > 0x63u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
927 && ((unsigned __int16)v22 < 0x1Cu || (unsigned __int16)v22 > 0x1Eu) )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
928 break;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
929 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
930 pParty->field_750[v12] = rand() % 258 + 1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
931 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
932 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
933 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
934 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
935 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
936 while ( 1 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
937 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
938 v23 = pParty->field_750[v12];
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
939 if ( (unsigned __int16)v23 < 0x73u || (unsigned __int16)v23 > 0x84u )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
940 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
941 if ( ((unsigned __int16)v23 < 0xE8u || (unsigned __int16)v23 > 0xF9u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
942 && ((unsigned __int16)v23 < 0x85u || (unsigned __int16)v23 > 0x96u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
943 && ((unsigned __int16)v23 < 0x97u || (unsigned __int16)v23 > 0xBAu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
944 && ((unsigned __int16)v23 < 0xBEu || (unsigned __int16)v23 > 0xC0u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
945 && ((unsigned __int16)v23 < 0xC4u || (unsigned __int16)v23 > 0xC6u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
946 && ((unsigned __int16)v23 < 0x2Bu || (unsigned __int16)v23 > 0x2Du)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
947 && ((unsigned __int16)v23 < 0x52u || (unsigned __int16)v23 > 0x54u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
948 && ((unsigned __int16)v23 < 4u || (unsigned __int16)v23 > 6u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
949 && ((unsigned __int16)v23 < 0x37u || (unsigned __int16)v23 > 0x39u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
950 && ((unsigned __int16)v23 < 0x3Au || (unsigned __int16)v23 > 0x3Cu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
951 && ((unsigned __int16)v23 < 0x3Du || (unsigned __int16)v23 > 0x3Fu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
952 && ((unsigned __int16)v23 < 0xFDu || (unsigned __int16)v23 > 0xFFu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
953 && ((unsigned __int16)v23 < 0x61u || (unsigned __int16)v23 > 0x63u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
954 && ((unsigned __int16)v23 < 0xCDu || (unsigned __int16)v23 > 0xCFu) )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
955 break;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
956 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
957 pParty->field_750[v12] = rand() % 258 + 1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
958 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
959 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
960 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
961 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
962 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
963 while ( 1 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
964 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
965 v24 = pParty->field_750[v12];
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
966 if ( (unsigned __int16)v24 < 0x73u || (unsigned __int16)v24 > 0x84u )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
967 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
968 if ( ((unsigned __int16)v24 < 0xEBu || (unsigned __int16)v24 > 0xFCu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
969 && ((unsigned __int16)v24 < 0x85u || (unsigned __int16)v24 > 0x96u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
970 && ((unsigned __int16)v24 < 0x97u || (unsigned __int16)v24 > 0xBAu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
971 && ((unsigned __int16)v24 < 0xBEu || (unsigned __int16)v24 > 0xC0u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
972 && ((unsigned __int16)v24 < 0xC4u || (unsigned __int16)v24 > 0xC6u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
973 && ((unsigned __int16)v24 < 0x2Bu || (unsigned __int16)v24 > 0x2Du)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
974 && ((unsigned __int16)v24 < 0xCDu || (unsigned __int16)v24 > 0xCFu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
975 && ((unsigned __int16)v24 < 0x5Eu || (unsigned __int16)v24 > 0x60u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
976 && ((unsigned __int16)v24 < 0xFDu || (unsigned __int16)v24 > 0xFFu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
977 && ((unsigned __int16)v24 < 0x6Du || (unsigned __int16)v24 > 0x6Fu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
978 && ((unsigned __int16)v24 < 0x61u || (unsigned __int16)v24 > 0x63u) )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
979 break;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
980 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
981 pParty->field_750[v12] = rand() % 258 + 1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
982 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
983 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
984 v10 = v56;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
985 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
986 v25 = v10;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
987 v26 = pParty->field_750[v25];
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
988 v27 = pParty->field_75A[v25] == v13;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
989 word_F8B1A0 = pParty->field_750[v25];
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
990 if ( v27 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
991 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
992 //v1 = 0;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
993 v27 = v26 == v13;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
994 v29 = (int)pNPCTopics[351].pText;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
995 if ( v27 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
996 v29 = (int)pNPCTopics[353].pText;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
997 dword_F8B1A4 = (char *)v29;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
998 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
999 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1000 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1001 if ( v26 != v13 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1002 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1003 party_finds_gold(100 * pMonsterStats->pInfos[(unsigned __int16)v26].uLevel, 0);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1004 v28 = pParty->pPlayers;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1005 do
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1006 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1007 v28->SetVariable(VAR_Award, 86);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1008 ++v28;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1009 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1010 while ( (signed int)v28 < (signed int)pParty->pHirelings );
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1011 pParty->uNumBountiesCollected += 100 * pMonsterStats->pInfos[pParty->field_750[v25]].uLevel;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1012 pParty->field_750[v25] = v13;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1013 pParty->field_75A[v25] = v13;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1014 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1015 //v1 = 0;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1016 dword_F8B1A4 = pNPCTopics[352].pText;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1017 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1018 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1019 else if ( uMessageParam == 100 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1020 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1021 pKeyActionMap->EnterText(1, 10, v8);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1022 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1023 break;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1024 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1025 case 22:
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1026 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1027 if ( dialog_menu_id >= 7 && dialog_menu_id <= 8 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1028 pKeyActionMap->EnterText(1, 10, v8);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1029 return;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1030 break;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1031 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1032 case 1:
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1033 case 2:
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1034 case 3:
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1035 case 4:
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1036 case 21:
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1037 case 23:
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1038 case 30:
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1039 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1040 break;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1041 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1042 default:
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1043 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1044 return;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1045 break;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1046 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1047 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1048
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1049 /*
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1050 if ( in_current_building_type > BildingType_Tavern )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1051 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1052 if ( in_current_building_type == BildingType_Bank )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1053 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1054 if ( dialog_menu_id >= 7 && dialog_menu_id <= 8 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1055 pKeyActionMap->EnterText(1, 10, v8);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1056 return;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1057 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1058 if ( in_current_building_type != BildingType_Temple && in_current_building_type != BildingType_Training )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1059 return;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1060 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1061 //else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1062 if ( in_current_building_type < BildingType_Tavern )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1063 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1064 if (in_current_building_type <= 0)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1065 return;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1066 if ( in_current_building_type > BildingType_AlchemistShop )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1067 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1068 if ( in_current_building_type <= BildingType_16 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1069 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1070 if ( (signed __int64)__PAIR__(
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1071 *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)v8->ptr_1C + 44472],
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1072 *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)v8->ptr_1C + 44468]) >= (signed __int64)pParty->uTimePlayed )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1073 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1074 v32 = 0;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1075 do
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1076 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1077 //v33 = *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v32 + 12 * (unsigned int)v8->ptr_1C));
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1078 v33 = pParty->SpellBooksInGuilds[v8->par1C-139][v32].uItemID;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1079 if ( v33 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1080 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1081 v34 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v33].pIconName, TEXTURE_16BIT_PALETTE);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1082 v8 = window_SpeakInHouse;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1083 ItemsInShopTexture[v32] = &pIcons_LOD->pTextures[v34];
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1084 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1085 ++v32;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1086 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1087 while ( v32 < 12 );
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1088 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1089 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1090 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1091 SpellBookGenerator();
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1092 v30 = window_SpeakInHouse->ptr_1C;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1093 v31 = pParty->uTimePlayed
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1094 + (signed __int64)((double)(0xA8C000
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1095 //* (signed int)p2DEvents_minus1[26 * (unsigned int)ptr_507BC0->ptr_1C])
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1096 * (signed int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].field_1C)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1097 * 0.033333335);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1098 *(int *)&stru_AA1058[3].pSounds[8 * (int)v30 + 44468] = v31;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1099 *(int *)&stru_AA1058[3].pSounds[8 * (int)v30 + 44472] = HIDWORD(v31);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1100 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1101 return;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1102 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1103 if ( in_current_building_type != BildingType_TownHall )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1104 return;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1105 if ( in_current_building_type == BildingType_TownHall )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1106 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1107 if ( uMessageParam == 99 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1108 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1109 v10 = (int)((char *)v8->ptr_1C - 102);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1110 v56 = v10;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1111 v11 = 8 * v10 + 11325428;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1112 if ( (signed __int64)__PAIR__(pParty->field_3C.field_0[2 * v10 + 1], pParty->field_3C.field_0[2 * v10]) >= (signed __int64)pParty->uTimePlayed )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1113 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1114 v13 = 0;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1115 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1116 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1117 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1118 v12 = v10;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1119 v13 = 0;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1120 pParty->field_75A[v12] = 0;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1121 *(_QWORD *)v11 = (signed __int64)((double)(309657600 * (pParty->uCurrentMonth + 12i64 * pParty->uCurrentYear - 14015)) * 0.033333335);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1122 v14 = rand() % 258;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1123 v15 = window_SpeakInHouse;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1124 pParty->field_750[v12] = v14 + 1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1125 v16 = (int)((char *)v15->ptr_1C - 102);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1126 if ( v16 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1127 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1128 v17 = v16 - 1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1129 if ( v17 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1130 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1131 v18 = v17 - 1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1132 if ( v18 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1133 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1134 v19 = v18 - 1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1135 if ( v19 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1136 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1137 if ( v19 == 1 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1138 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1139 while ( 1 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1140 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1141 v20 = pParty->field_750[v12];
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1142 if ( (unsigned __int16)v20 < 0x73u || (unsigned __int16)v20 > 0x84u )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1143 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1144 if ( ((unsigned __int16)v20 < 0xE8u || (unsigned __int16)v20 > 0xF9u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1145 && ((unsigned __int16)v20 < 0x85u || (unsigned __int16)v20 > 0x96u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1146 && ((unsigned __int16)v20 < 0x97u || (unsigned __int16)v20 > 0xBAu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1147 && ((unsigned __int16)v20 < 0xBEu || (unsigned __int16)v20 > 0xC0u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1148 && ((unsigned __int16)v20 < 0xC4u || (unsigned __int16)v20 > 0xC6u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1149 && ((unsigned __int16)v20 < 0x2Bu || (unsigned __int16)v20 > 0x2Du)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1150 && ((unsigned __int16)v20 < 0x6Du || (unsigned __int16)v20 > 0x6Fu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1151 && ((unsigned __int16)v20 < 0x46u || (unsigned __int16)v20 > 0x48u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1152 && ((unsigned __int16)v20 < 0x100u || (unsigned __int16)v20 > 0x102u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1153 && ((unsigned __int16)v20 < 0xD9u || (unsigned __int16)v20 > 0xDBu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1154 && ((unsigned __int16)v20 < 0xC7u || (unsigned __int16)v20 > 0xC9u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1155 && ((unsigned __int16)v20 < 0xE5u || (unsigned __int16)v20 > 0xE7u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1156 && ((unsigned __int16)v20 < 0xDFu || (unsigned __int16)v20 > 0xE1u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1157 && ((unsigned __int16)v20 < 0x5Bu || (unsigned __int16)v20 > 0x5Du)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1158 && ((unsigned __int16)v20 < 0x49u || (unsigned __int16)v20 > 0x4Bu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1159 && ((unsigned __int16)v20 < 0xFDu || (unsigned __int16)v20 > 0xFFu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1160 && ((unsigned __int16)v20 < 0x61u || (unsigned __int16)v20 > 0x63u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1161 && ((unsigned __int16)v20 < 0x10u || (unsigned __int16)v20 > 0x12u) )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1162 break;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1163 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1164 pParty->field_750[v12] = rand() % 258 + 1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1165 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1166 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1167 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1168 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1169 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1170 while ( 1 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1171 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1172 v21 = pParty->field_750[v12];
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1173 if ( (unsigned __int16)v21 < 0x73u || (unsigned __int16)v21 > 0x84u )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1174 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1175 if ( ((unsigned __int16)v21 < 0xE8u || (unsigned __int16)v21 > 0xF9u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1176 && ((unsigned __int16)v21 < 0x85u || (unsigned __int16)v21 > 0x96u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1177 && ((unsigned __int16)v21 < 0x97u || (unsigned __int16)v21 > 0xBAu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1178 && ((unsigned __int16)v21 < 0xBEu || (unsigned __int16)v21 > 0xC0u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1179 && ((unsigned __int16)v21 < 0xC4u || (unsigned __int16)v21 > 0xC6u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1180 && ((unsigned __int16)v21 < 0x2Bu || (unsigned __int16)v21 > 0x2Du)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1181 && ((unsigned __int16)v21 < 0x5Eu || (unsigned __int16)v21 > 0x60u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1182 && ((unsigned __int16)v21 < 0x43u || (unsigned __int16)v21 > 0x45u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1183 && ((unsigned __int16)v21 < 0x4Fu || (unsigned __int16)v21 > 0x51u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1184 && ((unsigned __int16)v21 < 0xC1u || (unsigned __int16)v21 > 0xC3u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1185 && ((unsigned __int16)v21 < 0x13u || (unsigned __int16)v21 > 0x15u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1186 && ((unsigned __int16)v21 < 0xFDu || (unsigned __int16)v21 > 0xFFu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1187 && ((unsigned __int16)v21 < 0x61u || (unsigned __int16)v21 > 0x63u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1188 && ((unsigned __int16)v21 < 0x6Au || (unsigned __int16)v21 > 0x6Cu) )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1189 break;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1190 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1191 pParty->field_750[v12] = rand() % 258 + 1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1192 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1193 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1194 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1195 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1196 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1197 while ( 1 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1198 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1199 v22 = pParty->field_750[v12];
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1200 if ( (unsigned __int16)v22 < 0x73u || (unsigned __int16)v22 > 0x84u )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1201 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1202 if ( ((unsigned __int16)v22 < 0xE8u || (unsigned __int16)v22 > 0xF9u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1203 && ((unsigned __int16)v22 < 0x85u || (unsigned __int16)v22 > 0x96u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1204 && ((unsigned __int16)v22 < 0x97u || (unsigned __int16)v22 > 0xBAu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1205 && ((unsigned __int16)v22 < 0xBEu || (unsigned __int16)v22 > 0xC0u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1206 && ((unsigned __int16)v22 < 0xC4u || (unsigned __int16)v22 > 0xC6u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1207 && ((unsigned __int16)v22 < 0x2Bu || (unsigned __int16)v22 > 0x2Du)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1208 && ((unsigned __int16)v22 < 0x31u || (unsigned __int16)v22 > 0x33u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1209 && ((unsigned __int16)v22 < 0x34u || (unsigned __int16)v22 > 0x36u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1210 && ((unsigned __int16)v22 < 0xFDu || (unsigned __int16)v22 > 0xFFu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1211 && ((unsigned __int16)v22 < 0x61u || (unsigned __int16)v22 > 0x63u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1212 && ((unsigned __int16)v22 < 0x1Cu || (unsigned __int16)v22 > 0x1Eu) )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1213 break;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1214 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1215 pParty->field_750[v12] = rand() % 258 + 1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1216 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1217 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1218 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1219 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1220 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1221 while ( 1 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1222 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1223 v23 = pParty->field_750[v12];
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1224 if ( (unsigned __int16)v23 < 0x73u || (unsigned __int16)v23 > 0x84u )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1225 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1226 if ( ((unsigned __int16)v23 < 0xE8u || (unsigned __int16)v23 > 0xF9u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1227 && ((unsigned __int16)v23 < 0x85u || (unsigned __int16)v23 > 0x96u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1228 && ((unsigned __int16)v23 < 0x97u || (unsigned __int16)v23 > 0xBAu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1229 && ((unsigned __int16)v23 < 0xBEu || (unsigned __int16)v23 > 0xC0u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1230 && ((unsigned __int16)v23 < 0xC4u || (unsigned __int16)v23 > 0xC6u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1231 && ((unsigned __int16)v23 < 0x2Bu || (unsigned __int16)v23 > 0x2Du)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1232 && ((unsigned __int16)v23 < 0x52u || (unsigned __int16)v23 > 0x54u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1233 && ((unsigned __int16)v23 < 4u || (unsigned __int16)v23 > 6u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1234 && ((unsigned __int16)v23 < 0x37u || (unsigned __int16)v23 > 0x39u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1235 && ((unsigned __int16)v23 < 0x3Au || (unsigned __int16)v23 > 0x3Cu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1236 && ((unsigned __int16)v23 < 0x3Du || (unsigned __int16)v23 > 0x3Fu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1237 && ((unsigned __int16)v23 < 0xFDu || (unsigned __int16)v23 > 0xFFu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1238 && ((unsigned __int16)v23 < 0x61u || (unsigned __int16)v23 > 0x63u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1239 && ((unsigned __int16)v23 < 0xCDu || (unsigned __int16)v23 > 0xCFu) )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1240 break;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1241 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1242 pParty->field_750[v12] = rand() % 258 + 1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1243 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1244 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1245 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1246 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1247 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1248 while ( 1 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1249 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1250 v24 = pParty->field_750[v12];
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1251 if ( (unsigned __int16)v24 < 0x73u || (unsigned __int16)v24 > 0x84u )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1252 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1253 if ( ((unsigned __int16)v24 < 0xEBu || (unsigned __int16)v24 > 0xFCu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1254 && ((unsigned __int16)v24 < 0x85u || (unsigned __int16)v24 > 0x96u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1255 && ((unsigned __int16)v24 < 0x97u || (unsigned __int16)v24 > 0xBAu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1256 && ((unsigned __int16)v24 < 0xBEu || (unsigned __int16)v24 > 0xC0u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1257 && ((unsigned __int16)v24 < 0xC4u || (unsigned __int16)v24 > 0xC6u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1258 && ((unsigned __int16)v24 < 0x2Bu || (unsigned __int16)v24 > 0x2Du)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1259 && ((unsigned __int16)v24 < 0xCDu || (unsigned __int16)v24 > 0xCFu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1260 && ((unsigned __int16)v24 < 0x5Eu || (unsigned __int16)v24 > 0x60u)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1261 && ((unsigned __int16)v24 < 0xFDu || (unsigned __int16)v24 > 0xFFu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1262 && ((unsigned __int16)v24 < 0x6Du || (unsigned __int16)v24 > 0x6Fu)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1263 && ((unsigned __int16)v24 < 0x61u || (unsigned __int16)v24 > 0x63u) )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1264 break;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1265 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1266 pParty->field_750[v12] = rand() % 258 + 1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1267 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1268 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1269 v10 = v56;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1270 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1271 v25 = v10;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1272 v26 = pParty->field_750[v25];
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1273 v27 = pParty->field_75A[v25] == v13;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1274 word_F8B1A0 = pParty->field_750[v25];
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1275 if ( v27 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1276 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1277 //v1 = 0;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1278 v27 = v26 == v13;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1279 v29 = (int)pNPCTopics[351].pText;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1280 if ( v27 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1281 v29 = (int)pNPCTopics[353].pText;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1282 dword_F8B1A4 = (char *)v29;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1283 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1284 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1285 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1286 if ( v26 != v13 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1287 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1288 party_finds_gold(100 * pMonsterStats->pInfos[(unsigned __int16)v26].uLevel, 0);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1289 v28 = pParty->pPlayers;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1290 do
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1291 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1292 v28->SetVariable(VAR_Award, 86);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1293 ++v28;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1294 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1295 while ( (signed int)v28 < (signed int)pParty->pHirelings );
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1296 pParty->uNumBountiesCollected += 100 * pMonsterStats->pInfos[pParty->field_750[v25]].uLevel;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1297 pParty->field_750[v25] = v13;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1298 pParty->field_75A[v25] = v13;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1299 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1300 //v1 = 0;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1301 dword_F8B1A4 = pNPCTopics[352].pText;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1302 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1303 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1304 else if ( uMessageParam == 100 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1305 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1306 pKeyActionMap->EnterText(1, 10, v8);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1307 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1308 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1309 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1310 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1311 */
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1312
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1313
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1314 //LABEL_196:
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1315 switch ( uMessageParam )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1316 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1317 case 96:
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1318 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1319 pDialogueWindow->eWindowType = WINDOW_MainMenu;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1320 UI_CreateEndConversationButton();
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1321 FillAviableSkillsToTeach(in_current_building_type);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1322 break;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1323 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1324 case 101:
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1325 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1326 pDialogueWindow->eWindowType = WINDOW_MainMenu;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1327 UI_CreateEndConversationButton();
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1328 sub_4B3A72(in_current_building_type);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1329 break;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1330 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1331 case 102:
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1332 case 103:
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1333 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1334 dialog_menu_id = (HOUSE_DIALOGUE_MENU)uMessageParam;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1335 break;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1336 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1337 case 104:
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1338 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1339 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1340 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1341 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)29;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1342 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1343 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = v1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1344 ++pMessageQueue_50CBD0->uNumMessages;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1345 }*/
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1346 pMessageQueue_50CBD0->AddMessage(UIMSG_PlayArcomage, 0, 0);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1347 dialog_menu_id = HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RESULT;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1348 break;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1349 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1350 case 2:
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1351 case 95:
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1352 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1353 if ( pParty->field_3C.field_50[(unsigned int)v8->ptr_1C] < (signed __int64)pParty->uTimePlayed )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1354 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1355 GenerateStandartShopItems();
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1356 GenerateSpecialShopItems();
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1357 v8 = window_SpeakInHouse;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1358 v40 = window_SpeakInHouse->par1C;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1359 //v3 = dword_F8B198;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1360 v41 = pParty->uTimePlayed
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1361 //+ (signed __int64)((double)(11059200 * (signed int)p2DEvents_minus1[26 * (unsigned int)ptr_507BC0->ptr_1C])
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1362 + (signed __int64)((double)(11059200 * (signed int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].field_1C)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1363 * 0.033333335);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1364 pParty->field_3C.field_50[v40] = v41;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1365 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1366 v42 = v8->ptr_1C;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1367 v43 = 0;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1368 //v44 = p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C];
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1369 v44 = p2DEvents[(unsigned int)v8->ptr_1C - 1].uType;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1370 if ( uMessageParam == 2 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1371 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1372 if ( uItemsAmountPerShopType[v44] )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1373 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1374 do
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1375 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1376 v45 = pParty->StandartItemsInShops[(int)v42][v43].uItemID;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1377 if ( v45 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1378 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1379 v46 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v45].pIconName, TEXTURE_16BIT_PALETTE);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1380 //v3 = dword_F8B198;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1381 v8 = window_SpeakInHouse;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1382 ItemsInShopTexture[v43] = &pIcons_LOD->pTextures[v46];
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1383 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1384 v42 = v8->ptr_1C;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1385 ++v43;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1386 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1387 //while ( v43 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1388 while ( v43 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] );
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1389 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1390 if ( in_current_building_type == BildingType_WeaponShop )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1391 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1392 v47 = v8->ptr_1C;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1393 v48 = 0;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1394 //if ( _4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1395 if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1396 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1397 do
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1398 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1399 // if ( pParty->field_777C[9 * (v48 + 12 * (int)v47)] )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1400 if ( pParty->StandartItemsInShops[(int)v47][v48].uItemID)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1401 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1402 v49 = rand();
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1403 v8 = window_SpeakInHouse;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1404 word_F8B158[v48] = v49 % (300 - ItemsInShopTexture[v48]->uTextureHeight);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1405 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1406 v47 = v8->ptr_1C;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1407 ++v48;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1408 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1409 //while ( v48 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1410 while ( v48 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] );
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1411 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1412 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1413 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1414 if ( uMessageParam == 95 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1415 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1416 if ( uItemsAmountPerShopType[v44] )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1417 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1418 do
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1419 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1420 //v50 = pParty->field_C59C[9 * (v43 + 12 * (int)v42) + 724];
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1421 v50=pParty->SpecialItemsInShops[(unsigned int)v42][(signed int)v43].uItemID;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1422 if ( v50 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1423 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1424 v51 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v50].pIconName, TEXTURE_16BIT_PALETTE);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1425 //v3 = dword_F8B198;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1426 v8 = window_SpeakInHouse;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1427 ItemsInShopTexture[v43] = &pIcons_LOD->pTextures[v51];
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1428 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1429 v42 = v8->ptr_1C;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1430 ++v43;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1431 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1432 //while ( v43 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1433 while ( v43 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] );
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1434 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1435 if ( in_current_building_type == BildingType_WeaponShop )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1436 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1437 v52 = v8->ptr_1C;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1438 v53 = 0;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1439 //if ( _4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1440 if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1441 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1442 do
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1443 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1444 // if ( pParty->field_C59C[9 * (v53 + 12 * (int)v52) + 724] )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1445 if (pParty->SpecialItemsInShops[(unsigned int)v52][v53].uItemID)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1446 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1447 v54 = rand();
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1448 v8 = window_SpeakInHouse;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1449 word_F8B158[v53] = v54 % (300 - ItemsInShopTexture[v53]->uTextureHeight);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1450 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1451 v52 = v8->ptr_1C;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1452 ++v53;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1453 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1454 //while ( v53 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1455 while ( v53 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType ] );
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1456 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1457 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1458 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1459 break;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1460 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1461 case 3:
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1462 case 4:
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1463 case 5:
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1464 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1465 dialog_menu_id = (HOUSE_DIALOGUE_MENU)uMessageParam;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1466 sub_421B2C_PlaceInInventory_or_DropPickedItem();
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1467 break;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1468 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1469 case 94:
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1470 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1471 pDialogueWindow->eWindowType = WINDOW_MainMenu;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1472 UI_CreateEndConversationButton();
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1473 sub_4B3AD4(in_current_building_type);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1474 break;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1475 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1476 default:
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1477 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1478 if( uMessageParam >= 36 && uMessageParam <= 72 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1479 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1480 v35 = pPlayers[uActiveCharacter];
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1481 //v36 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)v8->ptr_1C] * 500.0);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1482 v36 = (signed __int64)(p2DEvents[(unsigned int)v8->ptr_1C - 1].flt_24 * 500.0);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1483 v37 = v36 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1484 if ( v37 < v36 / 3 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1485 v37 = v36 / 3;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1486
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1487 //if (false)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1488 if(byte_4ED970_skill_learn_ability_by_class_table[v35->classType][uMessageParam-36])
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1489 //if ( *(&byte_4ED94C[37 * v35->uClass] + v55) )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1490 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1491 v38 = (int)(&v35->uIntelligence + uMessageParam);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1492 if ( !*(short *)v38 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1493 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1494 if ( pParty->uNumGold < v37 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1495 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1496 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1497 if ( in_current_building_type == BildingType_Training || in_current_building_type == BildingType_Tavern )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1498 v39 = 4;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1499 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1500 v39 = 2;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1501 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, (HouseSoundID)v39);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1502 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1503 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1504 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1505 Party::TakeGold(v37);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1506 dword_F8B1E4 = 1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1507 *(short *)v38 = 1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1508 v35->PlaySound(SPEECH_78, 0);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1509 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1510 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1511 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1512 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1513 break;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1514 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1515 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1516 /*
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1517 if ( uMessageParam != 95 && uMessageParam != 2 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1518 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1519 if ( uMessageParam == 3 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1520 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1521 dialog_menu_id = 3;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1522 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1523 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1524 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1525 if ( uMessageParam == 4 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1526 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1527 dialog_menu_id = 4;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1528 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1529 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1530 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1531 if ( uMessageParam != 5 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1532 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1533 if ( uMessageParam > 35 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1534 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1535 if ( uMessageParam <= 72 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1536 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1537 v35 = pPlayers[uActiveCharacter];
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1538 //v36 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)v8->ptr_1C] * 500.0);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1539 v36 = (signed __int64)(p2DEvents[(unsigned int)v8->ptr_1C - 1].flt_24 * 500.0);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1540 v37 = v36 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1541 if ( v37 < v36 / 3 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1542 v37 = v36 / 3;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1543
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1544 __debugbreak();
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1545 //pSkillAvailabilityPerClass[8 + v58->uClass][4 + v23]
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1546 // or
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1547 //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass][v23 - 36]
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1548 // or
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1549 //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass - 1][v23 + 1]
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1550
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1551 if (false)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1552 //if ( *(&byte_4ED94C[37 * v35->uClass] + v55) )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1553 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1554 v38 = (int)(&v35->uIntelligence + uMessageParam);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1555 if ( !*(short *)v38 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1556 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1557 if ( pParty->uNumGold < v37 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1558 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1559 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1560 if ( in_current_building_type == BildingType_Training || in_current_building_type == BildingType_Tavern )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1561 v39 = 4;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1562 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1563 v39 = 2;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1564 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, v39);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1565 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1566 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1567 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1568 Party::TakeGold(v37);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1569 dword_F8B1E4 = 1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1570 *(short *)v38 = 1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1571 v35->PlaySound(SPEECH_78, 0);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1572 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1573 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1574 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1575 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1576 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1577 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1578 if ( uMessageParam == 94 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1579 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1580 pDialogueWindow->eWindowType = WINDOW_MainMenu;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1581 UI_CreateEndConversationButton();
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1582 sub_4B3AD4(in_current_building_type);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1583 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1584 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1585 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1586 return;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1587 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1588 dialog_menu_id = 5;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1589 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1590 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1591 sub_421B2C_PlaceInInventory_or_DropPickedItem();
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1592 return;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1593 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1594 if ( pParty->field_3C.field_50[(unsigned int)v8->ptr_1C] < (signed __int64)pParty->uTimePlayed )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1595 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1596 GenerateStandartShopItems();
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1597 GenerateSpecialShopItems();
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1598 v8 = window_SpeakInHouse;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1599 v40 = window_SpeakInHouse->par1C;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1600 //v3 = dword_F8B198;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1601 v41 = pParty->uTimePlayed
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1602 //+ (signed __int64)((double)(11059200 * (signed int)p2DEvents_minus1[26 * (unsigned int)ptr_507BC0->ptr_1C])
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1603 + (signed __int64)((double)(11059200 * (signed int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].field_1C)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1604 * 0.033333335);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1605 pParty->field_3C.field_50[v40] = v41;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1606
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1607 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1608 v42 = v8->ptr_1C;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1609 v43 = 0;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1610 //v44 = p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C];
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1611 v44 = p2DEvents[(unsigned int)v8->ptr_1C - 1].uType;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1612 if ( uMessageParam == 2 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1613 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1614 if ( uItemsAmountPerShopType[v44] )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1615 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1616 do
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1617 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1618 v45 = pParty->StandartItemsInShops[(int)v42][v43].uItemID;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1619 if ( v45 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1620 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1621 v46 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v45].pIconName, TEXTURE_16BIT_PALETTE);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1622 //v3 = dword_F8B198;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1623 v8 = window_SpeakInHouse;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1624 ItemsInShopTexture[v43] = &pIcons_LOD->pTextures[v46];
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1625 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1626 v42 = v8->ptr_1C;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1627 ++v43;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1628 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1629 //while ( v43 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1630 while ( v43 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] );
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1631 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1632 if ( in_current_building_type == BildingType_WeaponShop )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1633 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1634 v47 = v8->ptr_1C;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1635 v48 = 0;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1636 //if ( _4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1637 if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1638 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1639 do
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1640 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1641 // if ( pParty->field_777C[9 * (v48 + 12 * (int)v47)] )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1642 if ( pParty->StandartItemsInShops[(int)v47][v48].uItemID);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1643 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1644 v49 = rand();
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1645 v8 = window_SpeakInHouse;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1646 word_F8B158[v48] = v49 % (300 - ItemsInShopTexture[v48]->uTextureHeight);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1647 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1648 v47 = v8->ptr_1C;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1649 ++v48;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1650 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1651 //while ( v48 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1652 while ( v48 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] );
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1653 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1654 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1655 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1656 if ( uMessageParam == 95 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1657 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1658 if ( uItemsAmountPerShopType[v44] )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1659 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1660 do
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1661 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1662 //v50 = pParty->field_C59C[9 * (v43 + 12 * (int)v42) + 724];
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1663 v50=pParty->SpecialItemsInShops[(unsigned int)v42][(signed int)v43].uItemID;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1664 if ( v50 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1665 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1666 v51 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v50].pIconName, TEXTURE_16BIT_PALETTE);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1667 //v3 = dword_F8B198;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1668 v8 = window_SpeakInHouse;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1669 ItemsInShopTexture[v43] = &pIcons_LOD->pTextures[v51];
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1670 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1671 v42 = v8->ptr_1C;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1672 ++v43;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1673 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1674 //while ( v43 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1675 while ( v43 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] );
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1676 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1677 if ( in_current_building_type == BildingType_WeaponShop )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1678 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1679 v52 = v8->ptr_1C;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1680 v53 = 0;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1681 //if ( _4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1682 if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1683 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1684 do
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1685 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1686 // if ( pParty->field_C59C[9 * (v53 + 12 * (int)v52) + 724] )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1687 if (pParty->SpecialItemsInShops[(unsigned int)v52][v53].uItemID)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1688 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1689 v54 = rand();
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1690 v8 = window_SpeakInHouse;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1691 word_F8B158[v53] = v54 % (300 - ItemsInShopTexture[v53]->uTextureHeight);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1692 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1693 v52 = v8->ptr_1C;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1694 ++v53;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1695 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1696 //while ( v53 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1697 while ( v53 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType ] );
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1698 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1699 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1700 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1701 */
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1702 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1703
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1704
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1705
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1706 //----- (004B6943) --------------------------------------------------------
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1707 void __cdecl TravelByTransport()
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1708 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1709 GUIWindow *v0; // ebx@1
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1710 Player *v1; // esi@1
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1711 signed int v2; // edi@1
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1712 unsigned int v3; // eax@1
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1713 signed int v4; // ebx@1
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1714 stru365_travel_info *v5; // esi@7
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1715 //int v6; // eax@9
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1716 //int v7; // eax@9
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1717 //int v8; // eax@12
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1718 //int v9; // edi@12
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1719 //int v10; // edx@12
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1720 int v11; // ecx@12
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1721 signed int v12; // esi@13
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1722 signed int v13; // edi@14
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1723 DWORD v14; // eax@26
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1724 DWORD v15; // edi@26
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1725 GUIWindow *v16; // ebx@36
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1726 int v17; // esi@36
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1727 int v18; // eax@36
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1728 int v19; // ecx@36
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1729 int v20; // esi@36
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1730 int v21; // eax@36
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1731 void *v22; // eax@39
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1732 int v23; // esi@39
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1733 GUIButton *v24; // ebx@39
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1734 signed int v25; // eax@41
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1735 //int v26; // esi@44
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1736 //const char *v27; // eax@46
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1737 char *v28; // eax@62
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1738 int v29; // eax@62
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1739 unsigned int v30; // ecx@62
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1740 char *v31; // eax@63
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1741 MapInfo v32; // [sp-3Ch] [bp-2CCh]@62
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1742 /*int v33; // [sp-38h] [bp-2C8h]@62
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1743 int v34; // [sp-34h] [bp-2C4h]@62
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1744 int v35; // [sp-30h] [bp-2C0h]@62
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1745 int v36; // [sp-2Ch] [bp-2BCh]@62
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1746 int v37; // [sp-28h] [bp-2B8h]@62
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1747 int v38; // [sp-24h] [bp-2B4h]@62
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1748 int v39; // [sp-20h] [bp-2B0h]@62
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1749 int v40; // [sp-1Ch] [bp-2ACh]@62
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1750 int v41; // [sp-18h] [bp-2A8h]@62
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1751 int v42; // [sp-14h] [bp-2A4h]@62
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1752 char *v43; // [sp-10h] [bp-2A0h]@62
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1753 char *v44; // [sp-Ch] [bp-29Ch]@62
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1754 unsigned int v45; // [sp-8h] [bp-298h]@62
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1755 char *v46; // [sp-4h] [bp-294h]@62
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1756 const char *v47[5]; // [sp+0h] [bp-290h]@7*/
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1757 char v48[5][100]; // [sp+14h] [bp-27Ch]@37
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1758 //char v49[100]; // [sp+78h] [bp-218h]@68
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1759 //char v50[100]; // [sp+DCh] [bp-1B4h]@68
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1760 //char v51[100]; // [sp+140h] [bp-150h]@68
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1761 //char Dest[100]; // [sp+1A4h] [bp-ECh]@36
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1762 GUIWindow v53; // [sp+208h] [bp-88h]@1
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1763 int v54; // [sp+25Ch] [bp-34h]@36
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1764 int v55; // [sp+260h] [bp-30h]@36
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1765 //unsigned int v56; // [sp+264h] [bp-2Ch]@1
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1766 //int v57; // [sp+268h] [bp-28h]@1
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1767 int v58; // [sp+26Ch] [bp-24h]@36
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1768 //GUIWindow *v59; // [sp+270h] [bp-20h]@1
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1769 unsigned int v60; // [sp+274h] [bp-1Ch]@36
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1770 //Player *v61; // [sp+278h] [bp-18h]@1
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1771 int v62; // [sp+27Ch] [bp-14h]@36
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1772 int v63; // [sp+280h] [bp-10h]@14
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1773 char *a1; // [sp+284h] [bp-Ch]@37
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1774 unsigned int s1; // [sp+288h] [bp-8h]@1
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1775 int v66; // [sp+28Ch] [bp-4h]@48
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1776
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1777 v0 = window_SpeakInHouse;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1778 memcpy(&v53, window_SpeakInHouse, sizeof(v53));
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1779 v2 = 255;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1780 //v61 = pPlayers[uActiveCharacter];
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1781 v1 = pPlayers[uActiveCharacter];
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1782 v53.uFrameX = 483;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1783 v53.uFrameWidth = 148;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1784 v53.uFrameZ = 334;
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1785 auto color_default = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(255, 255, 255);
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1786 auto color_selected = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(255, 255, 155);
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1787 v3 = 52 * (unsigned int)v0->ptr_1C;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1788 //v59 = (GUIWindow *)((((p2DEvents_minus1___00[v3 / 2] != 27) - 1) & 0xFFFFFFE7) + 50);
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1789 //v59 = (GUIWindow *)((((p2DEvents[(unsigned int)v0->ptr_1C - 1].uType != BildingType_Stables) - 1) & 0xFFFFFFE7) + 50);
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1790 //v4 = (signed __int64)((double)(signed int)v59 * p2DEvents_minus1__20[v3 / 4]);
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1791
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1792 v4 = p2DEvents[(unsigned int)v0->ptr_1C - 1].uType == BildingType_Stables ? 25 : 50;
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1793 v4 *= p2DEvents[(unsigned int)v0->ptr_1C - 1].fPriceMultiplier;
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1794
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1795 s1 = v4 * (100 - v1->GetMerchant()) / 100;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1796 if ( (signed int)s1 < v4 / 3 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1797 s1 = v4 / 3;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1798 if ( dialog_menu_id == HOUSE_DIALOGUE_MAIN)
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1799 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1800 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1801 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1802 v16 = pDialogueWindow;
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1803 v58 = 255;
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1804 v62 = 0;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1805 v17 = LOBYTE(pFontArrus->uFontHeight) - 3;
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1806 //v59 = pDialogueWindow;
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1807 v54 = v17;
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1808 strcpy(v48[4], "");
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1809 sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[405], s1); // Price: %lu gold
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1810 v18 = pFontArrus->CalcTextHeight(pTmpBuf2, &v53, 0, 0);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1811 v19 = v16->pNumPresenceButton;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1812 v20 = v18 + v17 + 146;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1813 v21 = v16->pStartingPosActiveItem;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1814 v63 = v20;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1815 v55 = v20;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1816 v60 = v21;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1817 if ( v21 >= v21 + v19 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1818 goto LABEL_71;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1819 s1 = 2;
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1820 a1 = (char *)v48;
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1821 while ( 1 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1822 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1823 int v47 = v60;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1824 v22 = window_SpeakInHouse->ptr_1C;
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1825 v23 = transport_routes[(unsigned int)v22 - HOUSE_STABLES_HARMONDALE][v62];
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1826 //v23 = (unsigned __int8)*(&_4F0D38_TravelInfo[4 * (unsigned int)v22] + v62); // negindex. actual address is around + 0x36
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1827 //v61 = (Player *)(unsigned __int8)*(&_4F0D38_TravelInfo[4 * (unsigned int)v22] + v62); // + 0x3F for sea travels, less for land
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1828 v24 = v16->GetControl(v60);
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1829
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1830 if (v23 != v58)
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1831 {
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1832 if (v23 >= 25)
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1833 Log::Warning(L"Transport UI: scedule overflow");
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1834 if (s1 >= 6)
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1835 v25 = true;
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1836 else
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1837 v25 = transport_schedule[v23].pSchedule[pParty->uDaysPlayed % 7];
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1838 }
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1839
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1840 if (v23 != v58 && v25 && (!transport_schedule[v23].uQuestBit || _449B57_test_bit(pParty->_quest_bits, transport_schedule[v23].uQuestBit)) )
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1841 {
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1842 v58 = v23;
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1843 if ( pDialogueWindow->pCurrentPosActiveItem == s1 )
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1844 sprintf(a1, "\f%05d", color_selected);
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1845 else
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1846 sprintf(a1, "\f%05d", color_default);
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1847
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1848 //v32.uRedbookTrackID = v27;
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1849 v66 = transport_schedule[v23].uTravelTime;
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1850 if ( (unsigned int)window_SpeakInHouse->ptr_1C >= HOUSE_BOATS_63 )
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1851 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1852 if ( CheckHiredNPCSpeciality(Sailor) )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1853 v66 -= 2;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1854 if ( CheckHiredNPCSpeciality(Navigator) )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1855 v66 -= 3;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1856 if ( CheckHiredNPCSpeciality(Pirate) )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1857 v66 -= 2;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1858 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1859 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1860 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1861 if ( CheckHiredNPCSpeciality(Horseman) )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1862 v66 -= 2;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1863 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1864 if ( CheckHiredNPCSpeciality(Explorer) )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1865 --v66;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1866 if ( v66 < 1 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1867 v66 = 1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1868 if ( v23 != v2 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1869 {
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1870 memcpy(&v32, &pMapStats->pInfos[transport_schedule[v23].uMapInfoID], 0x44u);
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1871 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[404], // Time - %d days, destination %s
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1872 v66, v32.pName);
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1873 strcat(a1, pTmpBuf);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1874 v28 = a1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1875 a1 += 100;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1876 ++v62;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1877 ++s1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1878 strcat(v28, "\n \n");
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1879 v24->uY = v63;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1880 v29 = pFontArrus->CalcTextHeight(pTmpBuf, &v53, 0, 0);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1881 v30 = v24->uY;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1882 v24->uHeight = v29;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1883 v2 = 255;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1884 v24->uW = v30 + v29 - 1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1885 v63 += v54 + v29;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1886 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1887 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1888 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1889 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1890 v31 = a1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1891 ++v62;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1892 ++s1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1893 a1 += 100;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1894 strcpy(v31, "");
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1895 if ( v24 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1896 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1897 v24->uW = 0;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1898 v24->uHeight = 0;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1899 v24->uY = 0;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1900 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1901 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1902 ++v60;
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1903 if ( (signed int)v60 >= v16->pNumPresenceButton + v16->pStartingPosActiveItem )
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1904 break;
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1905 //v16 = v59;
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1906 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1907 if ( v63 != v55 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1908 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1909 /*v47[1] = &Dest;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1910 v47[0] = &v51;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1911 v46 = &v50;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1912 v45 = (unsigned int)&v49;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1913 v44 = &v48;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1914 v43 = pTmpBuf2;*/
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1915 sprintf(pTmpBuf, "%s\n \n%s%s%s%s%s", pTmpBuf2, v48[0], v48[1], v48[2], v48[3], v48[4]);
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1916 v53.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1917 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1918 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1919 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1920 LABEL_71:
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1921 v53.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[561], &v53, 0, 0)) / 2 + 138,
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1922 color_default, pGlobalTXT_LocalizationStrings[561], 3);
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1923 pAudioPlayer->StopChannels(-1, -1);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1924 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1925 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1926 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1927 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1928 {
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1929 if ( dialog_menu_id >= HOUSE_DIALOGUE_TRANSPORT_SCHEDULE_1 && dialog_menu_id <= HOUSE_DIALOGUE_TRANSPORT_SCHEDULE_4 )
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1930 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1931 if ( pParty->uNumGold < s1 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1932 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1933 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1934 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_Greeting_2);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1935 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
778
Nomad
parents: 777 776
diff changeset
1936 return;
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1937 }
778
Nomad
parents: 777 776
diff changeset
1938
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1939 Party::TakeGold(s1);
778
Nomad
parents: 777 776
diff changeset
1940
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1941 v5 = &transport_schedule[transport_routes[(unsigned int)window_SpeakInHouse->ptr_1C - HOUSE_STABLES_HARMONDALE][dialog_menu_id - HOUSE_DIALOGUE_TRANSPORT_SCHEDULE_1]];
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1942 if ( v5->pSchedule[pParty->uDaysPlayed % 7] )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1943 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1944 if ( _strcmpi(pCurrentMapName, pMapStats->pInfos[v5->uMapInfoID].pFilename) )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1945 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1946 SaveGame(1, 0);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1947 strcpy(pCurrentMapName, pMapStats->pInfos[v5->uMapInfoID].pFilename);
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1948
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1949 dword_6BE364_game_settings_1 |= 1u;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1950 _5B65B8_npcdata_hiword_house_or_other = 0;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1951 dword_5B65BC = 0;
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1952 _5B65B4_npcdata_loword_house_or_other = v5->arrival_rot_y;
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1953 v11 = *((int *)v5 + 3);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1954 uGameState = 2;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1955 _5B65A8_npcdata_uflags_or_other = v11;
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1956 _5B65AC_npcdata_fame_or_other = v5->arrival_y;
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1957 _5B65B0_npcdata_rep_or_other = v5->arrival_z;
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1958 dword_5B65C0 = v11 | v5->arrival_y | v5->arrival_z | v5->arrival_rot_y;
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1959 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1960 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1961 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1962 pIndoorCamera->sRotationY = 0;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1963 pParty->uFlags |= 2u;
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1964 pParty->vPosition.x = v5->arrival_x;
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1965 pParty->vPosition.y = v5->arrival_y;
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1966 pParty->vPosition.z = v5->arrival_z;
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1967 pParty->uFallStartY = pParty->vPosition.z;
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1968 pParty->sRotationX = 0;
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
1969 pParty->sRotationY = v5->arrival_rot_y;
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1970 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1971 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1972 v12 = v5->uTravelTime;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1973 int _v47;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1974 if ( (signed int)window_SpeakInHouse->ptr_1C >= 63 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1975 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1976 v63 = SPEECH_SetSail;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1977 v13 = 2500;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1978 if ( CheckHiredNPCSpeciality(Sailor) )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1979 v12 -= 2;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1980 if ( CheckHiredNPCSpeciality(Navigator) )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1981 v12 -= 3;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1982 //_v47 = 45;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1983 if ( CheckHiredNPCSpeciality(Pirate) )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1984 v12 -= 2;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1985 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1986 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1987 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1988 v63 = SPEECH_CarriageReady;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1989 v13 = 1500;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1990 //_v47 = 35;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1991 if ( CheckHiredNPCSpeciality(Horseman) )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1992 v12 -= 2;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1993 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1994 if ( CheckHiredNPCSpeciality(Explorer) )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1995 --v12;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1996 if ( v12 < 1 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1997 v12 = 1;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1998 RestAndHeal(1440 * v12);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
1999 v1->PlaySound((PlayerSpeech)v63, 0);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
2000 v14 = GetTickCount();
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
2001 v15 = v14 + v13;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
2002 if ( v15 < v14 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
2003 v15 = v14;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
2004 while ( GetTickCount() < v15 )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
2005 sqrt(3.1415926);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
2006 while ( sub_4BD8B5() )
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
2007 ;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
2008 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
778
Nomad
parents: 777 776
diff changeset
2009 return;
775
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
2010 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
2011 else
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
2012 {
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
2013 dialog_menu_id = HOUSE_DIALOGUE_MAIN;
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
2014 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
2015 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
2016 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
2017 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
2018 }
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
2019
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
2020
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
2021
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
2022
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
2023
7994986603d5 Moved some subs
Nomad
parents: 762
diff changeset
2024
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2025 //----- (004B68EA) --------------------------------------------------------
727
da130dd3092a Big time Travel ouverhaul
Nomad
parents: 690
diff changeset
2026 bool __fastcall IsTravelAvailable(int a1)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2027 {
727
da130dd3092a Big time Travel ouverhaul
Nomad
parents: 690
diff changeset
2028 for (uint i = 0; i < 4; ++i)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2029 {
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
2030 uint route = transport_routes[a1][i];
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
2031 if (transport_schedule[route].pSchedule[pParty->uDaysPlayed % 7])
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2032 {
777
b9f6dd6f1444 Travel by Transport finally works (phew).
Nomad
parents: 775
diff changeset
2033 if (!transport_schedule[route].uQuestBit || _449B57_test_bit(pParty->_quest_bits, transport_schedule[route].uQuestBit))
727
da130dd3092a Big time Travel ouverhaul
Nomad
parents: 690
diff changeset
2034 return true;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2035 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2036 }
727
da130dd3092a Big time Travel ouverhaul
Nomad
parents: 690
diff changeset
2037 return false;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2038 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2039
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2040
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2041
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2042 //----- (004B7911) --------------------------------------------------------
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2043 void __cdecl TownHallDialog()
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2044 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2045 GUIWindow *v0; // eax@4
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2046 int v1; // eax@10
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2047 int v2; // esi@10
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2048 GUIFont *v3; // ST20_4@20
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2049 int v4; // eax@20
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2050 MonsterInfo *v5; // edi@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2051 unsigned int v6; // ST20_4@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2052 char *v7; // ST1C_4@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2053 unsigned int v8; // eax@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2054 int v9; // esi@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2055 char *v10; // eax@23
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2056 signed int v11; // ebx@24
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2057 signed int i; // esi@26
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2058 int v13; // eax@27
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2059 GUIWindow *v14; // ecx@28
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2060 __int64 v15; // qax@28
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2061 signed int v16; // ebx@28
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2062 int v17; // ebx@28
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2063 unsigned __int8 v18; // sf@28
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2064 char **v19; // edi@29
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2065 GUIButton *v20; // eax@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2066 GUIButton *v21; // esi@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2067 int v22; // eax@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2068 unsigned int v23; // ecx@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2069 unsigned __int16 v24; // ax@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2070 GUIWindow a1; // [sp+Ch] [bp-110h]@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2071 GUIWindow w; // [sp+60h] [bp-BCh]@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2072 GUIWindow _this; // [sp+B4h] [bp-68h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2073 int v28; // [sp+108h] [bp-14h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2074 int v29; // [sp+10Ch] [bp-10h]@28
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2075 int v30; // [sp+110h] [bp-Ch]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2076 int v31; // [sp+114h] [bp-8h]@29
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2077 GUIFont *pOutString; // [sp+118h] [bp-4h]@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2078
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2079 memcpy(&_this, window_SpeakInHouse, sizeof(_this));
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2080 _this.uFrameX = 483;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2081 _this.uFrameWidth = 148;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2082 _this.uFrameZ = 334;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2083 v28 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2084 v30 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2085 sprintf(pTmpBuf, "%s: %d", pGlobalTXT_LocalizationStrings[605], pParty->uFine);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2086 _this.DrawTitleText(pFontArrus, 0, 0x104u, v30, pTmpBuf, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2087 switch(dialog_menu_id)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2088 {
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
2089 case HOUSE_DIALOGUE_MAIN:
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2090 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2091 v11 = 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2092 pOutString = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2093 pShopOptions[0] = pGlobalTXT_LocalizationStrings[604];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2094 if ( pParty->uFine )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2095 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2096 pShopOptions[1] = pGlobalTXT_LocalizationStrings[603];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2097 v11 = 2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2098 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2099 for ( i = 0; i < v11; ++i )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2100 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2101 v13 = pFontArrus->CalcTextHeight(pShopOptions[i], &_this, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2102 pOutString = (GUIFont *)((char *)pOutString + v13);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2103 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2104 v29 = (100 - (signed int)pOutString) / v11;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2105 v14 = pDialogueWindow;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2106 v15 = 80 - v11 * (100 - (signed int)pOutString) / v11 - (signed int)pOutString;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2107 v16 = v15 - HIDWORD(v15);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2108 LODWORD(v15) = pDialogueWindow->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2109 HIDWORD(v15) = v15 + pDialogueWindow->pNumPresenceButton;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2110 v17 = (v16 >> 1) - v29 / 2 + 158;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2111 v18 = -pDialogueWindow->pNumPresenceButton < 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2112 pOutString = (GUIFont *)pDialogueWindow->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2113 if ( v18 ^ __OFSUB__((int)v15, HIDWORD(v15)) )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2114 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2115 v31 = 2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2116 v19 = pShopOptions;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2117 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2118 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2119 v20 = v14->GetControl((unsigned int)pOutString);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2120 v21 = v20;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2121 v20->uY = v29 + v17;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2122 v22 = pFontArrus->CalcTextHeight(*v19, &_this, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2123 v23 = v21->uY;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2124 v21->uHeight = v22;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2125 v17 = v23 + v22 - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2126 v21->uW = v17;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2127 v24 = v30;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2128 if ( pDialogueWindow->pCurrentPosActiveItem != v31 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2129 v24 = v28;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2130 _this.DrawTitleText(pFontArrus, 0, v23, v24, *v19, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2131 v14 = pDialogueWindow;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2132 ++v31;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2133 ++v19;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2134 pOutString = (GUIFont *)((char *)pOutString + 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2135 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2136 while ( (signed int)pOutString < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2137 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2138 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2139 }
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
2140
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
2141 case HOUSE_DIALOGUE_TOWNHALL_99:
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2142 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2143 v5 = &pMonsterStats->pInfos[word_F8B1A0];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2144 v6 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2145 v7 = v5->pName;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2146 v8 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2147 sprintf(pTmpBuf, &byte_4F0F98, v8, v7, v6);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2148 sprintf(pTmpBuf2, dword_F8B1A4, pTmpBuf, 100 * v5->uLevel);
827
085eb19b7ffd mr.Malvik
Ritor1
parents: 819
diff changeset
2149 current_npc_text = pTmpBuf2;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2150 memcpy(&a1, pDialogueWindow, sizeof(a1));
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2151 w.uFrameWidth = 458;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2152 w.uFrameZ = 457;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2153 pOutString = pFontArrus;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2154 v9 = pFontArrus->CalcTextHeight(pTmpBuf2, &w, 13, 0) + 7;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2155 if ( 352 - v9 < 8 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2156 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2157 pOutString = pFontCreate;
827
085eb19b7ffd mr.Malvik
Ritor1
parents: 819
diff changeset
2158 v9 = pFontCreate->CalcTextHeight(current_npc_text, &w, 13, 0) + 7;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2159 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2160
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2161 auto pTex = (uTextureID_Leather != -1 ? &pIcons_LOD->pTextures[uTextureID_Leather] : 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2162 pRenderer->_4A6A68(8u, 352 - v9, pTex, (pTex ? pTex->uTextureHeight : 26) - v9);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2163 pRenderer->DrawTextureIndexed(8u, 347 - v9, pTexture_591428);
827
085eb19b7ffd mr.Malvik
Ritor1
parents: 819
diff changeset
2164 v10 = FitTextInAWindow(current_npc_text, pOutString, &w, 0xDu, 0);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2165 a1.DrawText(pOutString, 13, 354 - v9, 0, v10, 0, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2166 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2167 }
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
2168 case HOUSE_DIALOGUE_TOWNHALL_100:
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2169 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2170 v0 = window_SpeakInHouse;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2171 if ( window_SpeakInHouse->field_40 == 1 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2172 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2173 sprintf(pTmpBuf, "%s\n%s", pGlobalTXT_LocalizationStrings[606], pGlobalTXT_LocalizationStrings[112]);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2174 _this.DrawTitleText(pFontArrus, 0, 0x92u, v30, pTmpBuf, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2175 _this.DrawTitleText(pFontArrus, 0, 0xBAu, v28, (const char *)pKeyActionMap->pPressedKeysBuffer, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2176 v3 = pFontArrus;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2177 v4 = pFontArrus->GetLineWidth((const char *)pKeyActionMap->pPressedKeysBuffer);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2178 _this.DrawFlashingInputCursor(v4 / 2 + 80, 185, v3);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2179 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2180 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2181 if ( window_SpeakInHouse->field_40 == 2 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2182 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2183 v1 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2184 v2 = v1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2185 if ( v1 <= 0 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2186 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2187 //LABEL_8:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2188 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2189 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2190 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2191 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2192 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2193 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2194 ++pMessageQueue_50CBD0->uNumMessages;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2195 }*/
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2196 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2197 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2198 if ( v1 > pParty->uNumGold )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2199 {
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
2200 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2201 v2 = pParty->uNumGold;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2202 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2203 if ( v2 > pParty->uFine )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2204 v2 = pParty->uFine;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2205 Party::TakeGold(v2);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2206 pParty->uFine -= v2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2207 if ( pParty->uFine < 0 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2208 pParty->uFine = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2209 if ( uActiveCharacter )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2210 pPlayers[uActiveCharacter]->PlaySound(SPEECH_81, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2211 v0 = window_SpeakInHouse;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2212 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2213 if ( window_SpeakInHouse->field_40 == 3 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2214 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2215 v0->field_40 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2216 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2217 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2218 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2219 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2220 default:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2221 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2222 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2223 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2224 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2225 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2226 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2227 // F8B19C: using guessed type int dword_F8B19C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2228 // F8B1A0: using guessed type __int16 word_F8B1A0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2229
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2230 //----- (004B7D7E) --------------------------------------------------------
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2231 void __cdecl BankDialog()
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2232 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2233 GUIWindow *v0; // eax@4
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2234 int v1; // ecx@5
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2235 int v2; // eax@6
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2236 unsigned int v3; // esi@6
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2237 GUIFont *v4; // ST10_4@12
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2238 int v5; // eax@12
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2239 int v6; // eax@19
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2240 unsigned int v7; // esi@19
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2241 unsigned __int16 v8; // ax@27
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2242 unsigned __int16 v9; // ax@29
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2243 char *v10; // [sp-8h] [bp-70h]@11
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2244 char *v11; // [sp-4h] [bp-6Ch]@11
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2245 GUIWindow _this; // [sp+Ch] [bp-5Ch]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2246 __int16 v13[2]; // [sp+60h] [bp-8h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2247 __int16 v14[2]; // [sp+64h] [bp-4h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2248
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2249 memcpy(&_this, window_SpeakInHouse, sizeof(_this));
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2250 _this.uFrameX = 483;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2251 _this.uFrameWidth = 148;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2252 _this.uFrameZ = 334;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2253 *(int *)v13 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2254 *(int *)v14 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2255 sprintf(pTmpBuf, "%s: %d", pGlobalTXT_LocalizationStrings[25], pParty->uNumGoldInBank);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2256 _this.DrawTitleText(pFontArrus, 0, 0xDCu, v14[0], pTmpBuf, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2257 switch(dialog_menu_id)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2258 {
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
2259 case HOUSE_DIALOGUE_MAIN:
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2260 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2261 v8 = v14[0];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2262 if ( pDialogueWindow->pCurrentPosActiveItem != 2 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2263 v8 = v13[0];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2264 _this.DrawTitleText(pFontArrus, 0, 0x92u, v8, pGlobalTXT_LocalizationStrings[60], 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2265 v9 = v14[0];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2266 if ( pDialogueWindow->pCurrentPosActiveItem != 3 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2267 v9 = v13[0];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2268 _this.DrawTitleText(pFontArrus, 0, 0xB0u, v9, pGlobalTXT_LocalizationStrings[244], 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2269 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2270 }
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
2271 case HOUSE_DIALOGUE_BANK_7:
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2272 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2273 v0 = window_SpeakInHouse;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2274 if ( window_SpeakInHouse->field_40 != 1 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2275 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2276 v1 = window_SpeakInHouse->field_40 - 2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2277 if ( window_SpeakInHouse->field_40 == 2 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2278 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2279 v6 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2280 v7 = v6;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2281 if ( !v6 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2282 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2283 //LABEL_17:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2284 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2285 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2286 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2287 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2288 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2289 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2290 ++pMessageQueue_50CBD0->uNumMessages;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2291 }*/
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2292 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2293 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2294 if ( v6 > pParty->uNumGold )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2295 {
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
2296 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2297 v7 = pParty->uNumGold;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2298 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2299 if ( v7 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2300 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2301 Party::TakeGold(v7);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2302 pParty->uNumGoldInBank += v7;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2303 if ( uActiveCharacter )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2304 pPlayers[uActiveCharacter]->PlaySound(SPEECH_81, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2305 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2306 v0 = window_SpeakInHouse;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2307 v0->field_40 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2308 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2309 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2310 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2311 if ( v1 != 1 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2312 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2313 v0->field_40 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2314 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2315 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2316 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2317 v11 = pGlobalTXT_LocalizationStrings[112];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2318 v10 = pGlobalTXT_LocalizationStrings[60];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2319 sprintf(pTmpBuf, "%s\n%s", v10, v11);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2320 _this.DrawTitleText(pFontArrus, 0, 0x92u, v14[0], pTmpBuf, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2321 _this.DrawTitleText(pFontArrus, 0, 0xBAu, v13[0], (const char *)pKeyActionMap->pPressedKeysBuffer, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2322 v4 = pFontArrus;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2323 v5 = pFontArrus->GetLineWidth((const char *)pKeyActionMap->pPressedKeysBuffer);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2324 _this.DrawFlashingInputCursor(v5 / 2 + 80, 185, v4);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2325 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2326 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2327
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
2328 case HOUSE_DIALOGUE_BANK_8:
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2329 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2330 v0 = window_SpeakInHouse;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2331 if ( window_SpeakInHouse->field_40 != 1 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2332 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2333 v1 = window_SpeakInHouse->field_40 - 2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2334 if ( window_SpeakInHouse->field_40 == 2 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2335 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2336 window_SpeakInHouse->field_40 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2337 v2 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2338 v3 = v2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2339 if ( v2 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2340 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2341 if ( v2 > pParty->uNumGoldInBank )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2342 {
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
2343 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2344 v3 = pParty->uNumGoldInBank;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2345 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2346 if ( v3 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2347 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2348 Party::SetGold(pParty->uNumGold + v3);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2349 pParty->uNumGoldInBank -= v3;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2350 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2351 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2352 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2353 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2354 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2355 if ( v1 != 1 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2356 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2357 v0->field_40 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2358 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2359 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2360 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2361 v11 = pGlobalTXT_LocalizationStrings[112];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2362 v10 = pGlobalTXT_LocalizationStrings[244];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2363 sprintf(pTmpBuf, "%s\n%s", v10, v11);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2364 _this.DrawTitleText(pFontArrus, 0, 0x92u, v14[0], pTmpBuf, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2365 _this.DrawTitleText(pFontArrus, 0, 0xBAu, v13[0], (const char *)pKeyActionMap->pPressedKeysBuffer, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2366 v4 = pFontArrus;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2367 v5 = pFontArrus->GetLineWidth((const char *)pKeyActionMap->pPressedKeysBuffer);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2368 _this.DrawFlashingInputCursor(v5 / 2 + 80, 185, v4);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2369 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2370 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2371 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2372
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2373 default:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2374 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2375 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2376 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2377 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2378 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2379 // F8B19C: using guessed type int dword_F8B19C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2380
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2381 //----- (004B8285) --------------------------------------------------------
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2382 void __cdecl TavernDialog()
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2383 {
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2384 int v0;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2385 int pItemNum;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2386 double v2; // st7@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2387 signed int v3; // ebx@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2388 int v4; // ecx@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2389 int v5; // esi@3
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2390 signed int v6; // edi@5
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2391 int v7; // ecx@5
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2392 int pNumString; // edi@16
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2393 signed int v9; // esi@16
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2394 unsigned int pNumActiveItem; // esi@18
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2395 int v11; // eax@18
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2396 unsigned int v12; // eax@19
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2397 int v13; // eax@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2398 int v14; // ecx@26
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2399 //GUIButton *v15; // eax@28
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2400 //GUIButton *v16; // esi@28
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2401 int v17; // eax@28
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2402 char *v18; // eax@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2403 int v19; // eax@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2404 unsigned int v20; // ecx@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2405 int v21; // edx@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2406 int v22; // eax@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2407 unsigned __int16 v23; // ax@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2408 int v24; // eax@34
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2409 int v25; // eax@34
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2410 char *v26; // esi@36
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2411 int v27; // edi@46
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2412 unsigned int pColorText; // eax@57
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2413 signed int v31; // eax@59
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2414 //GUIWindow *v33; // edi@64
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2415 int v34; // eax@64
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2416 int v35; // ecx@64
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2417 int v36; // esi@64
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2418 char v37; // sf@64
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2419 GUIButton *pButton; // eax@65
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2420 int v39; // edx@69
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2421 int v40; // ecx@69
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2422 int v41; // ecx@69
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2423 int v42; // ecx@70
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2424 unsigned int v43; // edx@70
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2425 int v44; // edx@71
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2426 int v45; // ecx@71
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2427 int v46; // ecx@72
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2428 int v47; // eax@74
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2429 signed int v48; // edi@77
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2430 signed int i; // esi@79
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2431 int v50; // eax@80
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2432 //GUIWindow *v51; // ecx@81
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2433 _QWORD v52; // qax@81
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2434 signed int v53; // edi@81
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2435 int v54; // edi@81
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2436 //GUIButton *v55; // esi@83
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2437 const char **v56; // eax@83
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2438 int v57; // eax@83
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2439 unsigned int v58; // ecx@83
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2440 //Player *v59; // edx@83
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2441 unsigned __int16 v60; // ax@83
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2442 int v61; // eax@99
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2443 char *v63; // eax@99
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2444 GUIFont *v64; // edx@99
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2445 GUIFont *v65; // edi@100
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2446 unsigned int v66; // [sp-10h] [bp-284h]@75
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2447 unsigned __int16 v67; // [sp-Ch] [bp-280h]@75
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2448 int v68; // [sp-Ch] [bp-280h]@99
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2449 char *v69; // [sp-8h] [bp-27Ch]@75
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2450 int v70; // [sp-8h] [bp-27Ch]@99
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2451 unsigned int v71; // [sp-4h] [bp-278h]@75
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2452 const char *v72; // [sp-4h] [bp-278h]@93
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2453 unsigned int v73; // [sp-4h] [bp-278h]@99
870
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2454 char pTopic1[100]; // [sp+Ch] [bp-268h]@55
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2455 char pTopic4[100]; // [sp+70h] [bp-204h]@59
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2456 char pTopic2[100]; // [sp+D4h] [bp-1A0h]@57
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2457 char pTopic3[100]; // [sp+138h] [bp-13Ch]@59
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2458 //GUIWindow v78; // [sp+19Ch] [bp-D8h]@99
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2459 GUIWindow dialog_window; // [sp+1F0h] [bp-84h]@1
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2460 char *Str[2]; // [sp+244h] [bp-30h]@30
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2461 unsigned int pColorWhite; // [sp+24Ch] [bp-28h]@1
870
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2462 unsigned __int8 pTopic3Height; // [sp+253h] [bp-21h]@59
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2463 int v83; // [sp+254h] [bp-20h]@1
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2464 int pColorYellow; // [sp+258h] [bp-1Ch]@1
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2465 Player *pPlayer; // [sp+25Ch] [bp-18h]@1
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2466 int all_text_height; // [sp+260h] [bp-14h]@18
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2467 unsigned __int8 v87; // [sp+266h] [bp-Eh]@59
870
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2468 unsigned __int8 pTopic2Height; // [sp+267h] [bp-Dh]@57
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2469 int v89; // [sp+268h] [bp-Ch]@1
870
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2470 unsigned int pTopic1Height; // [sp+26Fh] [bp-5h]@55
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2471 int v91; // [sp+270h] [bp-4h]@3
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2472 GUIFont *pOutString;
870
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2473 unsigned __int8 pTopic4Height;
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2474 int pTextHeight;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2475
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2476 pPlayer = pPlayers[uActiveCharacter];
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2477 memcpy(&dialog_window, window_SpeakInHouse, sizeof(dialog_window));
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2478 dialog_window.uFrameX = 483;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2479 dialog_window.uFrameWidth = 148;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2480 dialog_window.uFrameZ = 334;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2481 pColorWhite = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2482 pColorYellow = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2483 v2 = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2484 *(float *)&v83 = v2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2485 *(float *)&v89 = v2 * v2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2486 v3 = (signed __int64)(*(float *)&v89 * 0.1);
662
Ritor1
parents: 661
diff changeset
2487 pItemNum = v3 * (100 - pPlayer->GetMerchant()) / 100;
Ritor1
parents: 661
diff changeset
2488 if ( pItemNum < v3 / 3 )
Ritor1
parents: 661
diff changeset
2489 pItemNum = v3 / 3;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2490 v5 = 1;
662
Ritor1
parents: 661
diff changeset
2491 pOutString = (GUIFont *)pItemNum;
Ritor1
parents: 661
diff changeset
2492 if ( pItemNum <= 0 )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2493 pOutString = (GUIFont *)1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2494 v6 = (signed __int64)(*(float *)&v89 * *(float *)&v83 * 0.0099999998);
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2495 v7 = v6 * (100 - pPlayer->GetMerchant()) / 100;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2496 if ( v7 < v6 / 3 )
662
Ritor1
parents: 661
diff changeset
2497 v7 = v6 / 3;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2498 v83 = v7;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2499 if ( v7 <= 0 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2500 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2501 v7 = 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2502 v83 = 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2503 }
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
2504
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2505 switch(dialog_menu_id)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2506 {
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
2507 case HOUSE_DIALOGUE_MAIN:
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2508 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2509 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2510 return;
648
35ce4761382c Fixed numbers in tavern dialogue ui
Nomad
parents: 646
diff changeset
2511
870
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2512 sprintf(pTopic1, "\f%05d", pDialogueWindow->pCurrentPosActiveItem == 2 ? pColorYellow : pColorWhite);
648
35ce4761382c Fixed numbers in tavern dialogue ui
Nomad
parents: 646
diff changeset
2513 sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[178], pOutString); // Rent room for %d gold
870
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2514 strcat(pTopic1, pTmpBuf2);
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2515 pTopic1Height = pFontArrus->CalcTextHeight(pTopic1, &dialog_window, 0, 0);
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2516 strcat(pTopic1, "\n \n");
648
35ce4761382c Fixed numbers in tavern dialogue ui
Nomad
parents: 646
diff changeset
2517
870
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2518 sprintf(pTopic2, "\f%05d", pDialogueWindow->pCurrentPosActiveItem == 3 ? pColorYellow : pColorWhite);
648
35ce4761382c Fixed numbers in tavern dialogue ui
Nomad
parents: 646
diff changeset
2519 sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[86], // Buy food for %d days for %d gold
870
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2520 (unsigned int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier, v83);
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2521 strcat(pTopic2, pTmpBuf2);
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2522 pTopic2Height = pFontArrus->CalcTextHeight(pTopic2, &dialog_window, 0, 0);
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2523 strcat(pTopic2, "\n \n");
648
35ce4761382c Fixed numbers in tavern dialogue ui
Nomad
parents: 646
diff changeset
2524
870
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2525 sprintf(pTopic3, "\f%05d", pDialogueWindow->pCurrentPosActiveItem == 4 ? pColorYellow : pColorWhite);
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2526 strcat(pTopic3, pGlobalTXT_LocalizationStrings[160]); // Learn Skills
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2527 pTopic3Height = pFontArrus->CalcTextHeight(pTopic3, &dialog_window, 0, 0);
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2528 strcat(pTopic3, "\n \n");
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2529 pTopic4[0] = 0;
690
26dfde53decd ui fixing
Gloval
parents: 684
diff changeset
2530 if ( (signed int)window_SpeakInHouse->par1C >= 108 && (signed int)window_SpeakInHouse->par1C <= 120 )
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2531 {
870
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2532 sprintf(pTopic4, "\f%05d", pDialogueWindow->pCurrentPosActiveItem == 5 ? pColorYellow : pColorWhite);
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2533 strcat(pTopic4, pGlobalTXT_LocalizationStrings[611]); // Play Arcomage
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2534 pTopic4Height = pFontArrus->CalcTextHeight(pTopic4, &dialog_window, 0, 0);
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2535 }
662
Ritor1
parents: 661
diff changeset
2536 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2537 v36 = LOBYTE(pFontArrus->uFontHeight) - 3;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2538 v37 = -pDialogueWindow->pNumPresenceButton < 0;
662
Ritor1
parents: 661
diff changeset
2539 if ( !(v37 ^ pNumActiveItem < pNumActiveItem + pDialogueWindow->pNumPresenceButton) )
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2540 {
870
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2541 do
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2542 {
870
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2543 pButton = pDialogueWindow->GetControl(pNumActiveItem);
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2544 if ( pButton->msg_param == 15 )
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2545 {
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2546 v46 = pTopic1Height;
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2547 pButton->uHeight = pTopic1Height;
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2548 pButton->uY = 146;
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2549 v41 = v46 + 145;
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2550 pButton->uW = v41;
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2551 }
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2552 else if ( pButton->msg_param == 16 )
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2553 {
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2554 v44 = pTopic2Height;
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2555 v45 = pTopic1Height + v36 + 146;
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2556 pButton->uHeight = pTopic2Height;
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2557 pButton->uY = v45;
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2558 v41 = v45 + v44 - 1;
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2559 pButton->uW = v41;
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2560 }
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2561 else if ( pButton->msg_param == 96 )
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2562 {
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2563 v42 = pTopic1Height + pTopic2Height + 2 * v36 + 146;
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2564 v43 = pTopic3Height;
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2565 pButton->uY = v42;
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2566 pButton->uHeight = v43;
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2567 v41 = v43 + v42 - 1;
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2568 pButton->uW = v41;
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2569 }
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2570 else if ( pButton->msg_param == 101 )
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2571 {
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2572 v39 = pTopic1Height + 3 * v36 + pTopic4Height + pTopic2Height + 146;
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2573 v40 = pTopic4Height;
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2574 pButton->uHeight = pTopic4Height;
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2575 pButton->uY = v39;
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2576 v41 = v39 + v40 - 1;
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2577 pButton->uW = v41;
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2578 }
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2579 pNumActiveItem++;
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2580 if ( pNumActiveItem >= pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem )
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2581 {
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2582 sprintfex(pTmpBuf, "%s%s%s%s", &pTopic1, &pTopic2, &pTopic3, &pTopic4);
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2583 dialog_window.DrawTitleText(pFontArrus, 0, 146, 0, pTmpBuf, 3);
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2584 }
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2585 }
870
a0ae8d36c2d6 TavernDialog fixed
Ritor1
parents: 854
diff changeset
2586 while ( pNumActiveItem < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton );
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2587 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2588 break;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2589 }
854
06fc66ceecd6 for Arcomage game
Ritor1
parents: 832
diff changeset
2590 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RULES:
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2591 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2592 pOutString = pFontArrus;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2593 strcpy(pTmpBuf, pNPCTopics[354].pText);
819
9359c114f98c More on screenshot
Nomad
parents: 791
diff changeset
2594 dialog_window.uFrameWidth = game_viewport_width;
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2595 dialog_window.uFrameZ = 452;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2596 pTextHeight = pFontArrus->CalcTextHeight(pTmpBuf, &dialog_window, 12, 0) + 7;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2597 if ( 352 - pTextHeight < 8 )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2598 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2599 pOutString = pFontCreate;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2600 pTextHeight = pFontCreate->CalcTextHeight(pTmpBuf, &dialog_window, 12, 0) + 7;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2601 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2602 auto pTex = (uTextureID_Leather != -1 ? &pIcons_LOD->pTextures[uTextureID_Leather] : 0);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2603 pRenderer->_4A6A68(8, 352 - pTextHeight, pTex, (pTex ? pTex->uTextureHeight : 26) - pTextHeight);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2604 pRenderer->DrawTextureIndexed(8, 347 - pTextHeight, pTexture_591428);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2605 v63 = FitTextInAWindow(pTmpBuf, pOutString, &dialog_window, 0xCu, 0);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2606 window_SpeakInHouse->DrawText(pOutString, 12, 354 - pTextHeight, 0, v63, 0, 0, 0);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2607 break;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2608 }
854
06fc66ceecd6 for Arcomage game
Ritor1
parents: 832
diff changeset
2609 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_VICTORY_CONDITIONS:
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2610 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2611 strcpy(pTmpBuf, pNPCTopics[(uint)window_SpeakInHouse->ptr_1C + 247].pText);
819
9359c114f98c More on screenshot
Nomad
parents: 791
diff changeset
2612 dialog_window.uFrameWidth = game_viewport_width;
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2613 dialog_window.uFrameZ = 452;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2614 v61 = pFontArrus->CalcTextHeight(pTmpBuf, &dialog_window, 12, 0);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2615 pTextHeight = v61 + 7;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2616 auto pTex = (uTextureID_Leather != -1 ? &pIcons_LOD->pTextures[uTextureID_Leather] : nullptr);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2617 pRenderer->_4A6A68(8, 352 - (v61 + 7), pTex, (pTex ? pTex->uTextureHeight : 26) - (v61 + 7));
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2618 pRenderer->DrawTextureIndexed(8, 347 - pTextHeight, pTexture_591428);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2619 v63 = FitTextInAWindow(pTmpBuf, pFontArrus, &dialog_window, 0xCu, 0);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2620 window_SpeakInHouse->DrawText(pFontArrus, 12, 354 - pTextHeight, 0, v63, 0, 0, 0);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2621 break;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2622 }
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
2623 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RESULT:
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2624 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2625 if ( pArcomageGame->bGameInProgress == 1 )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2626 return;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2627 if ( pArcomageGame->uGameResult )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2628 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2629 if ( pArcomageGame->uGameResult == 1 )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2630 v72 = pGlobalTXT_LocalizationStrings[640];// You won!
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2631 else
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2632 v72 = pGlobalTXT_LocalizationStrings[641];// You lost!
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2633 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2634 else
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2635 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2636 v72 = pGlobalTXT_LocalizationStrings[639];// A tie!
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2637 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2638 strcpy(pTmpBuf, v72);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2639 v66 = (174 - pFontArrus->CalcTextHeight(pTmpBuf, &dialog_window, 0, 0)) / 2 + 138;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2640 dialog_window.DrawTitleText(pFontArrus, 0, v66, pColorYellow, pTmpBuf, 3);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2641 break;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2642 }
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
2643
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
2644 case HOUSE_DIALOGUE_TAVERN_REST:
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2645 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2646 if ( pParty->uNumGold >= (unsigned int)pOutString )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2647 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2648 Party::TakeGold((unsigned int)pOutString);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2649 v27 = (int)window_SpeakInHouse->ptr_1C;
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
2650 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
2651 dialog_menu_id = HOUSE_DIALOGUE_NULL;
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2652 sub_4BD8B5();
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2653 sub_4B1D27();
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2654 pVideoPlayer->Unload();
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2655 window_SpeakInHouse->Release();
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2656 window_SpeakInHouse = 0;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2657 if ( pMessageQueue_50CBD0->uNumMessages )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2658 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2659 pMessageQueue_50CBD0->pMessages[0].eType = UIMSG_OpenRestUI;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2660 pMessageQueue_50CBD0->pMessages[0].param = v27;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2661 pMessageQueue_50CBD0->pMessages[0].field_8 = 1;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2662 ++pMessageQueue_50CBD0->uNumMessages;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2663 return;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2664 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2665 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2);
736
Nomad
parents: 735
diff changeset
2666 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_Goodbye);
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2667 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, v5, 0);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2668 break;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2669 }
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
2670
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
2671 case HOUSE_DIALOGUE_LEARN_SKILLS:
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2672 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2673 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2674 return;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2675 v0 = 0;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2676 v9 = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2677 pItemNum = v9 * (100 - pPlayer->GetMerchant()) / 100;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2678 if ( pItemNum < v9 / 3 )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2679 pItemNum = v9 / 3;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2680 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2681 all_text_height = 0;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2682 if ( pNumActiveItem < pNumActiveItem + pDialogueWindow->pNumPresenceButton )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2683 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2684 do
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2685 {
832
dfd683c4f538 Hotkeys fixed
Nomad
parents: 827
diff changeset
2686 v12 = pDialogueWindow->GetControl(pNumActiveItem)->msg_param - 36;
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2687 if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayer->classType][v12] && !pPlayer->pActiveSkills[v12] )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2688 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2689 all_text_height = pFontArrus->CalcTextHeight(pSkillNames[v12], &dialog_window, 0, 0);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2690 v0++;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2691 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2692 ++pNumActiveItem;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2693 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2694 while ( pNumActiveItem < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton );
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2695 if ( v0 )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2696 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2697 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], pItemNum);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2698 dialog_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2699 v91 = (149 - all_text_height) / v0;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2700 if ( (149 - all_text_height) / v0 > 32 )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2701 v91 = 32;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2702 v14 = (149 - v0 * v91 - all_text_height) / 2 - v91 / 2 + 162;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2703 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2704 if ( pNumActiveItem < pNumActiveItem + pDialogueWindow->pNumPresenceButton )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2705 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2706 pItemNum = 2;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2707 do
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2708 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2709 pButton = pDialogueWindow->GetControl(pItemNum);
832
dfd683c4f538 Hotkeys fixed
Nomad
parents: 827
diff changeset
2710 v17 = pButton->msg_param - 36;
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2711 if ( !byte_4ED970_skill_learn_ability_by_class_table[pPlayer->classType][v17] || pPlayer->pActiveSkills[v17] )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2712 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2713 pButton->uW = 0;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2714 pButton->uHeight = 0;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2715 pButton->uY = 0;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2716 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2717 else
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2718 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2719 pButton->uY = v91 + v14;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2720 pTextHeight = pFontArrus->CalcTextHeight(pSkillNames[v17], &dialog_window, 0, 0);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2721 pButton->uHeight = pTextHeight;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2722 v14 = pTextHeight + pButton->uY - 1;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2723 pButton->uW = v14;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2724 pColorText = pColorYellow;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2725 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2726 pColorText = pColorWhite;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2727 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, pSkillNames[v17], 3);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2728 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2729 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2730 pItemNum++;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2731 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2732 while ( pItemNum < pNumActiveItem );
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2733 }
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2734 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2735 }
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2736 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2737 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], pPlayer->pName, pClassNames[pPlayer->classType]);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2738 strcat(pTmpBuf, "\n \n");
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2739 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2740 pTextHeight = (174 - pFontArrus->CalcTextHeight(pTmpBuf, &dialog_window, 0, 0)) / 2 + 138;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2741 dialog_window.DrawTitleText(pFontArrus, 0, pTextHeight, pColorYellow, pTmpBuf, 3);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2742 return;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2743 }
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
2744
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
2745 case HOUSE_DIALOGUE_TAVERN_BUY_FOOD:
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2746 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2747 *(_QWORD *)Str = pParty->uNumFoodRations;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2748 //if ( (double)pParty->uNumFoodRations >= p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C] )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2749 if ( (double)pParty->uNumFoodRations >= p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2750 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2751 ShowStatusBarString(pGlobalTXT_LocalizationStrings[140], 2);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2752 if ( uActiveCharacter )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2753 pPlayers[uActiveCharacter]->PlaySound(SPEECH_67, 0);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2754 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, v5, 0);
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2755 return;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2756 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2757 if ( pParty->uNumGold >= v7 )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2758 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2759 Party::TakeGold(v7);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2760 //pParty->uNumFoodRations = (signed __int64)p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C];
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2761 pParty->uNumFoodRations = (signed __int64)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier;
735
6daaa2f18d0d Fixed some house sounds & shop-related stuff
Nomad
parents: 728
diff changeset
2762 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_Greeting_2);
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2763 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2764 return;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2765 }
735
6daaa2f18d0d Fixed some house sounds & shop-related stuff
Nomad
parents: 728
diff changeset
2766 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2); // "You don't have enough gold"
736
Nomad
parents: 735
diff changeset
2767 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_Goodbye);
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2768 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, v5, 0);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2769 break;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2770 }
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
2771
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
2772 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_MAIN:
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2773 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2774 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2775 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2776 v48 = 2;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2777 pShopOptions[0] = pGlobalTXT_LocalizationStrings[620];
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2778 pShopOptions[1] = pGlobalTXT_LocalizationStrings[622];
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2779 pOutString = 0;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2780 if ( pParty->HasItem(0x28Bu) )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2781 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2782 pShopOptions[2] = pGlobalTXT_LocalizationStrings[621];
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2783 v48 = 3;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2784 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2785 for ( i = 0; i < v48; ++i )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2786 all_text_height = pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2787 all_text_height = (174 - all_text_height) / v48;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2788 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2789 v54 = (174 - v48 * (174 - all_text_height) / v48 - all_text_height) / 2 - (174 - all_text_height) / v48 / 2 + 138;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2790 v37 = -pDialogueWindow->pNumPresenceButton < 0;
854
06fc66ceecd6 for Arcomage game
Ritor1
parents: 832
diff changeset
2791 if ( pNumActiveItem < pNumActiveItem + pDialogueWindow->pNumPresenceButton )
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2792 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2793 pItemNum = 2;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2794 pNumString = 0;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2795 do
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2796 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2797 pButton = pDialogueWindow->GetControl(pItemNum);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2798 pButton->uY = all_text_height + v54;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2799 pTextHeight = pFontArrus->CalcTextHeight((const char *)pShopOptions[pNumString], &dialog_window, 0, 0);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2800 pButton->uHeight = pTextHeight;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2801 v54 = pButton->uY + pTextHeight - 1;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2802 pButton->uW = v54;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2803 pColorText = pColorYellow;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2804 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2805 pColorText = pColorWhite;
854
06fc66ceecd6 for Arcomage game
Ritor1
parents: 832
diff changeset
2806 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, (const char *)pShopOptions[pNumString], 3);
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2807 pItemNum++;
854
06fc66ceecd6 for Arcomage game
Ritor1
parents: 832
diff changeset
2808 ++pNumString;
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2809 pNumActiveItem = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2810 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2811 while ( pItemNum < pNumActiveItem );
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2812 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2813 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2814 break;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2815 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2816 default:
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2817 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2818 break;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2819 }
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2820 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2821 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2822
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2823
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2824 //----- (004B910F) --------------------------------------------------------
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2825 void __cdecl WeaponShopDialog()
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2826 {
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2827 int v0; // ebx@1
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2828 int pNumActiveItem; // eax@6
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2829 signed int v2; // esi@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2830 ItemGen *v4; // eax@11
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2831 char *v5; // ecx@12
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2832 unsigned __int8 v6; // dl@13
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2833 char *v7; // edx@14
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2834 int v9; // ST08_4@16
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2835 int v10; // eax@16
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2836 signed int v11; // esi@18
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2837 int v12; // ST08_4@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2838 int v13; // eax@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2839 int v14; // edi@23
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2840 char **v15; // esi@23
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2841 int v16; // eax@24
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2842 //int v18; // edx@25
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2843 int v19; // edi@25
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2844 unsigned __int8 v20; // sf@25
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2845 GUIButton *pButton; // esi@27
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2846 int pNewItem; // eax@27
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2847 unsigned int v24; // ecx@27
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2848 int v25; // edx@27
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2849 unsigned int pColorText; // ax@27
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2850 signed int v27; // esi@32
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2851 int v28; // ST08_4@36
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2852 int v29; // eax@36
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2853 signed int v32; // esi@41
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2854 unsigned int v33; // esi@43
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2855 int v34; // eax@43
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2856 unsigned int v35; // eax@44
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2857 int v36; // eax@46
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2858 __int32 v37; // ecx@51
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2859 int v40; // eax@53
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2860 char *v41; // eax@55
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2861 unsigned int v43; // ecx@55
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2862 const char **v44; // edx@55
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2863 int v45; // eax@55
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2864 int v47; // eax@59
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2865 const char **v48; // eax@63
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2866 unsigned int v49; // esi@65
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2867 Texture *v50; // eax@65
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2868 int v51; // edi@65
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2869 int v52; // esi@70
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2870 Texture *v53; // ST1C_4@70
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2871 int v54; // edi@70
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2872 signed int v55; // ecx@73
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2873 SHORT v56; // di@82
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2874 bool v57; // eax@82
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2875 const char *v58; // ecx@84
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2876 POINT *v59; // esi@89
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2877 LONG v60; // ecx@90
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2878 int v61; // eax@90
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2879 int v62; // ecx@90
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2880 ItemGen *v63; // esi@90
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2881 int v64; // eax@95
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2882 int all_text_height; // esi@96
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2883 char **v66; // edi@96
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2884 int v67; // eax@97
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2885 int v69; // edx@98
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2886 int v70; // edi@98
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2887 int v71;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2888 const char **v72; // eax@100
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2889 int pTextHeight; // eax@100
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2890 unsigned int v74; // ecx@100
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2891 int v78; // [sp-14h] [bp-10Ch]@14
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2892 ItemGen *v79; // [sp-10h] [bp-108h]@12
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2893 int v80; // [sp-10h] [bp-108h]@14
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2894 void *v81; // [sp-Ch] [bp-104h]@12
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2895 unsigned __int16 v82; // [sp-Ch] [bp-104h]@14
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2896 int v83; // [sp-8h] [bp-100h]@11
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2897 char *v84; // [sp-8h] [bp-100h]@14
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2898 __int64 *v85; // [sp-4h] [bp-FCh]@11
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2899 unsigned int v86; // [sp-4h] [bp-FCh]@14
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2900 POINT v87; // [sp+Ch] [bp-ECh]@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2901 POINT v88; // [sp+14h] [bp-E4h]@18
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2902 POINT v89; // [sp+1Ch] [bp-DCh]@89
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2903 POINT v90; // [sp+24h] [bp-D4h]@19
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2904 POINT v91; // [sp+2Ch] [bp-CCh]@89
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2905 POINT v92; // [sp+34h] [bp-C4h]@9
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2906 POINT v93; // [sp+3Ch] [bp-BCh]@33
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2907 POINT v94; // [sp+44h] [bp-B4h]@18
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2908 POINT v95; // [sp+4Ch] [bp-ACh]@32
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2909 POINT v96; // [sp+54h] [bp-A4h]@18
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2910 POINT v97; // [sp+5Ch] [bp-9Ch]@32
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2911 POINT a2; // [sp+64h] [bp-94h]@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2912 POINT v99; // [sp+6Ch] [bp-8Ch]@32
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2913 POINT v100; // [sp+74h] [bp-84h]@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2914 GUIWindow dialog_window; // [sp+7Ch] [bp-7Ch]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2915 char *Str; // [sp+D0h] [bp-28h]@55
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2916 __int32 v103; // [sp+D4h] [bp-24h]@25
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2917 int pColorYellow; // [sp+D8h] [bp-20h]@1
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2918 int pColorWhite; // [sp+DCh] [bp-1Ch]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2919 POINT v106; // [sp+E0h] [bp-18h]@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2920 Player *pPlayer; // [sp+E8h] [bp-10h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2921 int pItemNum; // [sp+ECh] [bp-Ch]@26
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2922 const char **v109; // [sp+F0h] [bp-8h]@26
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2923 unsigned __int8 v110; // [sp+F7h] [bp-1h]@16
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2924 int pNumString;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2925
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2926 pPlayer = pPlayers[uActiveCharacter];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2927 memcpy(&dialog_window, window_SpeakInHouse, sizeof(dialog_window));
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2928 dialog_window.uFrameX = 483;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2929 dialog_window.uFrameWidth = 148;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2930 dialog_window.uFrameZ = 334;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2931 pColorWhite = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2932 pColorYellow = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
2933
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2934 switch(dialog_menu_id)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2935 {
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
2936 case HOUSE_DIALOGUE_MAIN:
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2937 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2938 pNumActiveItem = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2939 if ( pNumActiveItem )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2940 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2941 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2942 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2943 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2944 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2945 all_text_height = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2946 for (int i = 0; i < 4; ++i)//while ( (signed int)v15 < (signed int)&unk_F8B1C8 );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2947 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2948 v103 = (174 - all_text_height) / 4;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2949 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2950 v19 = (174 - 4 * (174 - all_text_height) / 4 - all_text_height) / 2 - (174 - all_text_height) / 4 / 2 + 138;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2951 v20 = -pDialogueWindow->pNumPresenceButton < 0;
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2952 if ( v20 ^ pNumActiveItem > pNumActiveItem + pDialogueWindow->pNumPresenceButton )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2953 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2954 pItemNum = 2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2955 pNumString = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2956 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2957 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2958 pButton = pDialogueWindow->GetControl(pItemNum);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2959 pButton->uY = v103 + v19;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2960 pTextHeight = pFontArrus->CalcTextHeight((const char *)pShopOptions[pNumString], &dialog_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2961 pButton->uHeight = pTextHeight;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2962 v19 = pButton->uY + pTextHeight - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2963 pButton->uW = v19;
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2964 pColorText = pColorYellow;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2965 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum )
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2966 pColorText = pColorWhite;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2967 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, (const char *)pShopOptions[pNumString], 3);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2968 ++pItemNum;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2969 ++pNumString;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2970 pNumActiveItem = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2971 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2972 while ( pItemNum < pNumActiveItem );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2973 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2974 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2975 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2976 }
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
2977
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
2978 case HOUSE_DIALOGUE_SHOP_BUY_STANDARD:
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2979 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2980 pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2981 v48 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2982 pItemNum = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2983 v109 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2984 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2985 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2986 // if ( pParty->field_777C[9 * (int)&v48[3 * (unsigned int)window_SpeakInHouse->ptr_1C]] )
668
28109e4eee44 standard weapon shop fix
zipi
parents: 662
diff changeset
2987 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(int)v48].uItemID)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2988 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2989 v49 = word_F8B158[(signed int)v48];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2990 v50 = ItemsInShopTexture[(signed int)v48];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2991 v49 += 30;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2992 v51 = 60 - ((signed int)v50->uTextureWidth >> 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2993 pRenderer->DrawTextureTransparent(v51 + pItemNum, v49, v50);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2994 sub_40F92A(&pRenderer->pActiveZBuffer[v51 + pItemNum + 640 * v49], ItemsInShopTexture[(signed int)v109], (int)((char *)v109 + 1));
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2995 v48 = v109;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2996 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2997 pItemNum += 70;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2998 v48 = (const char **)((char *)v48 + 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2999 v109 = v48;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3000 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3001 while ( (signed int)v48 < 6 );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3002 pNumActiveItem = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3003 if ( pNumActiveItem )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3004 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3005 v55 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3006 v106.x = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3007 v106.x = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3008 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3009 {
757
0b3f4b854652 if and ; errors
zipi
parents: 749
diff changeset
3010 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v55].uItemID)//9 * (v55 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3011 ++v106.x;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3012 ++v55;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3013 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3014 while ( v55 < 6 );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3015 v56 = GetAsyncKeyState(17);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3016 v57 = pPlayer->CanSteal();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3017 Str = (char *)v57;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3018 if ( v56 && v57 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3019 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3020 v58 = pGlobalTXT_LocalizationStrings[185];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3021 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3022 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3023 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3024 v58 = pGlobalTXT_LocalizationStrings[195];
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
3025 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3026 v58 = pGlobalTXT_LocalizationStrings[196];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3027 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3028 DrawTextAtStatusBar(v58, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3029 if ( v106.x )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3030 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3031 v59 = pMouse->GetCursorPos(&v91);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3032 pNumActiveItem = v59->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v89)->y];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3033 if ( pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3034 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3035 v60 = (pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF) - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3036 v106.x = v60;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3037 v61 = (int)window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3038 // v62 = 9 * (v60 + 12 * v61);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3039 v63 = (ItemGen *)&pParty->StandartItemsInShops[(int)v61][v60];
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
3040 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3041 v63 = &pParty->SpecialItemsInShops[(int)v61][v60];//v63 = (ItemGen *)&pParty->field_C59C[v62 + 724];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3042 if ( !v56 || !Str )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3043 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3044 v64 = pPlayer->_490EEE(v63, 1, v61, 2);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3045 v7 = BuilDialogueString((char *)pMerchantsBuyPhrases[v64], uActiveCharacter - 1, v63, (char *)window_SpeakInHouse->ptr_1C, 2, 0);
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3046 pTextHeight = pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3047 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v7, 3);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3048 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3049 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3050 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3051 v7 = BuilDialogueString(pGlobalTXT_LocalizationStrings[181], uActiveCharacter - 1, v63, (char *)window_SpeakInHouse->ptr_1C, 2, 0);
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3052 pTextHeight = pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3053 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v7, 3);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3054 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3055 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3056 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3057 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3058 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3059 dialog_window.DrawCurrentTime( pParty->field_3C.field_50[(unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3060 pNumActiveItem = 0; //added
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3061 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3062 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3063 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3064 }
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
3065
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
3066 case HOUSE_DIALOGUE_SHOP_SELL:
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3067 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3068 draw_leather();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3069 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3070 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3071 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3072 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3073 if((v11 = pMouse->GetCursorPos(&v96)->x - 14, v106.x = (v11 >> 5) + 14 * ((pMouse->GetCursorPos(&v88)->y - 17) >> 5),
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3074 pMouse->GetCursorPos(&v94)->x <= 13) || pMouse->GetCursorPos(&v90)->x >= 462
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3075 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v106.x), !pNumActiveItem) )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3076 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3077 v79 = (ItemGen *)&pPlayer->pInventoryItems[pNumActiveItem - 1];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3078 v13 = pPlayer->_490EEE(v79, 1, (int)window_SpeakInHouse->ptr_1C, 3);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3079 v7 = BuilDialogueString((char *)pMerchantsSellPhrases[v13], uActiveCharacter - 1, v79, (char *)window_SpeakInHouse->ptr_1C, 3, 0);
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3080 pTextHeight = pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3081 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v7, 3);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3082 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3083 }
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
3084
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
3085 case HOUSE_DIALOGUE_SHOP_IDENTIFY:
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3086 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3087 draw_leather();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3088 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3089 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3090 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3091 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3092 if((v2 = pMouse->GetCursorPos(&a2)->x - 14, v106.x = (v2 >> 5) + 14 * ((pMouse->GetCursorPos(&v87)->y - 17) >> 5),
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3093 pMouse->GetCursorPos(&v100)->x <= 13) || pMouse->GetCursorPos(&v92)->x >= 462
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3094 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v106.x), !pNumActiveItem) )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3095 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3096 v4 = (ItemGen *)&pPlayer->pInventoryItems[pNumActiveItem - 1];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3097 if (!v4->Identified())
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3098 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3099 v10 = pPlayer->_490EEE(v4, 1, (int)window_SpeakInHouse->ptr_1C, 4);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3100 v7 = BuilDialogueString((char *)pMerchantsIdentifyPhrases[v10], uActiveCharacter - 1, v4, (char *)window_SpeakInHouse->ptr_1C, 4, 0);
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3101 pTextHeight = pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3102 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v7, 3);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3103 }
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3104 else
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3105 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3106 v7 = BuilDialogueString("%24", uActiveCharacter - 1, v4, (char *)window_SpeakInHouse->ptr_1C, 4, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3107 pTextHeight = pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3108 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v7, 3);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3109 }
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3110 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3111 }
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
3112
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
3113 case HOUSE_DIALOGUE_SHOP_REPAIR:
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3114 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3115 draw_leather();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3116 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3117 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[198], 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3118 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win())
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3119 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3120 if( (v2 = pMouse->GetCursorPos(&a2)->x - 14, v106.x = (v2 >> 5) + 14 * ((pMouse->GetCursorPos(&v87)->y - 17) >> 5),
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3121 pMouse->GetCursorPos(&v100)->x <= 13) || pMouse->GetCursorPos(&v92)->x >= 462
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3122 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v106.x), !pNumActiveItem)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3123 || (pNumActiveItem = 9 * pNumActiveItem, !(pPlayer->field_1F5[4 * pNumActiveItem + 15] & 2)) )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3124 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3125 v4 = (ItemGen *)&pPlayer->pInventoryItems[pNumActiveItem - 1];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3126 v10 = pPlayer->_490EEE(v4, 2, (int)window_SpeakInHouse->ptr_1C, 5);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3127 v7 = BuilDialogueString((char *)pMerchantsRepairPhrases[v10], uActiveCharacter - 1, v4, (char *)window_SpeakInHouse->ptr_1C, 5, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3128 pTextHeight = (174 - pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0)) / 2 + 138;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3129 dialog_window.DrawTitleText(pFontArrus, 0, pTextHeight, pColorWhite, v7, 3);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3130 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3131 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3132 break;
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
3133
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
3134 case HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT:
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3135 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3136 draw_leather();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3137 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3138 pShopOptions[0] = pGlobalTXT_LocalizationStrings[200];//sell
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3139 pShopOptions[1] = pGlobalTXT_LocalizationStrings[113];//identify
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3140 pShopOptions[2] = pGlobalTXT_LocalizationStrings[179];//repair
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3141 all_text_height = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3142 for ( int i = 0; i < 3; ++i )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3143 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3144 v103 = (174 - all_text_height) / 3;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3145 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3146 v70 = (3 * (58 - (signed int)v103) - all_text_height) / 2 - ((174 - all_text_height) / 3) / 2 + 138;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3147 v20 = -pDialogueWindow->pNumPresenceButton < 0;
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
3148 if ( v20 ^ pNumActiveItem > pNumActiveItem + pDialogueWindow->pNumPresenceButton )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3149 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3150 pItemNum = 2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3151 pNumString = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3152 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3153 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3154 pButton = pDialogueWindow->GetControl(pItemNum);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3155 pButton->uY = v103 + v70;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3156 pTextHeight = pFontArrus->CalcTextHeight((const char *)pShopOptions[pNumString], &dialog_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3157 pButton->uHeight = pTextHeight;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3158 v70 = pButton->uY + pTextHeight - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3159 pButton->uW = v70;
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
3160 pColorText = pColorYellow;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3161 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum )
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
3162 pColorText = pColorWhite;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
3163 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, (const char *)pShopOptions[pNumString], 3);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3164 ++pItemNum;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3165 ++pNumString;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3166 pNumActiveItem = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3167 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3168 while ( pItemNum < pNumActiveItem );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3169 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3170 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3171 }
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
3172
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
3173 case HOUSE_DIALOGUE_SHOP_BUY_SPECIAL:
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3174 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3175 pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3176 v109 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3177 pItemNum = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3178 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3179 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3180 // if ( pParty->field_C59C[9 * (int)&v109[3 * (unsigned int)window_SpeakInHouse->ptr_1C] + 724] )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3181 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(signed int)v109].uItemID)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3182 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3183 v52 = word_F8B158[(signed int)v109] + 30;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3184 v53 = ItemsInShopTexture[(signed int)v109];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3185 v54 = 60 - ((signed int)v53->uTextureWidth >> 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3186 pRenderer->DrawTextureTransparent(v54 + pItemNum, word_F8B158[(signed int)v109] + 30, v53);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3187 sub_40F92A(&pRenderer->pActiveZBuffer[v54 + pItemNum + 640 * v52], ItemsInShopTexture[(signed int)v109], (int)((char *)v109 + 1));
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3188 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3189 v109 = (const char **)((char *)v109 + 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3190 pItemNum += 70;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3191 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3192 while ( (signed int)v109 < 6 );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3193 pNumActiveItem = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3194 if ( pNumActiveItem )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3195 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3196 v55 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3197 v106.x = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3198 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3199 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3200 // if ( pParty->field_C59C[9 * (v55 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3201 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v55].uItemID)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3202 ++v106.x;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3203 ++v55;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3204 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3205 while ( v55 < 6 );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3206 v56 = GetAsyncKeyState(17);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3207 v57 = pPlayer->CanSteal();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3208 Str = (char *)v57;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3209 if ( v56 && v57 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3210 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3211 v58 = pGlobalTXT_LocalizationStrings[185];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3212 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3213 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3214 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3215 v58 = pGlobalTXT_LocalizationStrings[195];
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
3216 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3217 v58 = pGlobalTXT_LocalizationStrings[196];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3218 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3219 DrawTextAtStatusBar(v58, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3220 if ( v106.x )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3221 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3222 v59 = pMouse->GetCursorPos(&v91);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3223 pNumActiveItem = v59->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v89)->y];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3224 if ( pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3225 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3226 v60 = (pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF) - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3227 v106.x = v60;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3228 v61 = (int)window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3229 // v62 = 9 * (v60 + 12 * v61);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3230 v63 = (ItemGen *)&pParty->StandartItemsInShops[(int)v61][v60];
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
3231 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3232 v63 = &pParty->SpecialItemsInShops[(int)v61][v60];//v63 = (ItemGen *)&pParty->field_C59C[v62 + 724];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3233 if ( !v56 || !Str )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3234 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3235 v64 = pPlayer->_490EEE(v63, 1, v61, 2);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3236 v7 = BuilDialogueString((char *)pMerchantsBuyPhrases[v64], uActiveCharacter - 1, v63, (char *)window_SpeakInHouse->ptr_1C, 2, 0);
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3237 pTextHeight = pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3238 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v7, 3);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3239 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3240 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3241 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3242 v7 = BuilDialogueString(pGlobalTXT_LocalizationStrings[181], uActiveCharacter - 1, v63, (char *)window_SpeakInHouse->ptr_1C, 2, 0);
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3243 pTextHeight = pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3244 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v7, 3);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3245 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3246 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3247 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3248 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3249 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3250 dialog_window.DrawCurrentTime( pParty->field_3C.field_50[(unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3251 pNumActiveItem = 0; //added
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3252 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3253 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3254 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3255 }
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
3256
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
3257 case HOUSE_DIALOGUE_LEARN_SKILLS:
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3258 {
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3259 if (!sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win())
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3260 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3261 v0 = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3262 all_text_height = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3263 //v32 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (signed int)v31] * 500.0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3264 v32 = (signed __int64)(p2DEvents[(signed int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3265 pItemNum = v32 * (100 - pPlayer->GetMerchant()) / 100;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3266 if ( pItemNum < v32 / 3 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3267 pItemNum = v32 / 3;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3268 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3269 if ( pNumActiveItem >= pNumActiveItem + pDialogueWindow->pNumPresenceButton )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3270 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3271 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], pPlayer->pName, pClassNames[pPlayer->classType]);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3272 strcat(pTmpBuf, "\n \n");
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3273 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3274 pTextHeight = pFontArrus->CalcTextHeight(pTmpBuf, &dialog_window, 0, 0);
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
3275 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorYellow, pTmpBuf, 3);
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3276 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3277 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3278 do
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3279 {
832
dfd683c4f538 Hotkeys fixed
Nomad
parents: 827
diff changeset
3280 v35 = pDialogueWindow->GetControl(pNumActiveItem)->msg_param - 36;
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3281 if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayer->classType][v35] && !pPlayer->pActiveSkills[v35] )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3282 {
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3283 all_text_height += pFontArrus->CalcTextHeight(pSkillNames[v35], &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3284 v0++;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3285 }
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3286 ++pNumActiveItem;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3287 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3288 while ( pNumActiveItem < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3289 if ( !v0 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3290 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3291 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], pPlayer->pName, pClassNames[pPlayer->classType]);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3292 strcat(pTmpBuf, "\n \n");
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3293 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3294 pTextHeight = pFontArrus->CalcTextHeight(pTmpBuf, &dialog_window, 0, 0);
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
3295 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorYellow, pTmpBuf, 3);
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3296 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3297 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3298 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], pItemNum);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3299 dialog_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3300 v103 = (149 - all_text_height) / v0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3301 if ( (149 - all_text_height) / v0 > 32 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3302 v103 = 32;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3303 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3304 v37 = (149 - v0 * v103 - all_text_height) / 2 - v103 / 2 + 162;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3305 if ( pNumActiveItem < pNumActiveItem + pDialogueWindow->pNumPresenceButton )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3306 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3307 pItemNum = 2;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3308 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3309 {
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3310 pButton = pDialogueWindow->GetControl(pItemNum);
832
dfd683c4f538 Hotkeys fixed
Nomad
parents: 827
diff changeset
3311 v40 = pButton->msg_param - 36;
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3312 if ( !byte_4ED970_skill_learn_ability_by_class_table[pPlayer->classType][v40] || pPlayer->pActiveSkills[v40] )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3313 {
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3314 pButton->uW = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3315 pButton->uHeight = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3316 pButton->uY = 0;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3317 }
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3318 else
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3319 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3320 pButton->uY = v103 + v37;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3321 pTextHeight = pFontArrus->CalcTextHeight(pSkillNames[v40], &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3322 pButton->uHeight = pTextHeight;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3323 v37 = pButton->uY + pTextHeight - 1;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3324 pButton->uW = v37;
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
3325 pColorText = pColorYellow;
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3326 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum )
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
3327 pColorText = pColorWhite;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
3328 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, pSkillNames[v40], 3);
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3329 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3330 pNumActiveItem = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3331 pItemNum++;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3332 }
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3333 while ( pItemNum < pNumActiveItem );
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3334 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3335 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3336 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3337 default:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3338 {
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
3339 if( dialog_menu_id > HOUSE_DIALOGUE_SHOP_REPAIR)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3340 pNumActiveItem = dialog_menu_id - 96;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3341 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3342 pNumActiveItem = dialog_menu_id - 4;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3343 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3344 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3345 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3346 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3347
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3348
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3349
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3350 //----- (004B9CC6) --------------------------------------------------------
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3351 void __cdecl AlchemistDialog()
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3352 {
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3353 int v0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3354 int pNumActiveItem; // eax@7
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3355 signed int v5; // esi@9
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3356 unsigned int v6; // esi@11
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3357 int v7; // eax@11
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3358 unsigned int v8; // eax@12
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3359 int v9; // eax@14
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3360 int v10; // ecx@19
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3361 int v13; // eax@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3362 char *v14; // eax@23
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3363 int v15; // eax@23
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3364 unsigned int v16; // ecx@23
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3365 int v17; // edx@23
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3366 int v18; // eax@23
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3367 int v20; // eax@27
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3368 char *v21; // edx@29
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3369 int v22; // esi@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3370 char **v23; // edi@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3371 int v24; // eax@31
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3372 int v26; // edx@32
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3373 int v27; // edi@32
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3374 unsigned __int8 v28; // sf@32
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3375 const char **v30; // eax@34
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3376 int v31; // eax@34
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3377 unsigned int v32; // ecx@34
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3378 int v34; // eax@34
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3379 signed int v36; // esi@39
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3380 ItemGen *v37; // eax@42
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3381 char *v38; // ecx@43
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3382 unsigned __int8 v39; // dl@44
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3383 int v40; // eax@46
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3384 int v41; // ST08_4@47
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3385 int v42; // eax@47
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3386 signed int v43; // esi@49
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3387 int v44; // ST08_4@52
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3388 int v45; // eax@52
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3389 Texture *v46; // ecx@55
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3390 unsigned int v47; // edi@55
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3391 unsigned int v48; // esi@57
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3392 int v49; // edx@61
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3393 Texture *v50; // ecx@67
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3394 unsigned int v51; // edi@67
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3395 unsigned int v52; // esi@69
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3396 int v53; // edx@73
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3397 Texture *v54; // ecx@79
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3398 unsigned int v55; // edi@79
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3399 unsigned int v56; // esi@81
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3400 int v57; // edx@85
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3401 Texture *v58; // ecx@91
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3402 unsigned int v59; // edi@91
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3403 unsigned int v60; // esi@93
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3404 int v61; // edx@97
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3405 signed int v62; // ecx@102
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3406 SHORT v63; // di@110
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3407 bool v64; // eax@110
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3408 const char *v65; // ecx@112
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3409 POINT *v66; // esi@117
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3410 int v67; // ecx@118
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3411 int v68; // eax@118
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3412 int v69; // ecx@118
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3413 ItemGen *v70; // esi@118
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3414 int v71; // eax@123
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3415 int all_text_height; // edi@125
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3416 char **v73; // esi@125
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3417 int v74; // eax@126
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3418 int pItemNum;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3419 int v76; // edx@127
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3420 int v77; // edi@127
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3421 GUIButton *pButton; // esi@129
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3422 const char **v79; // eax@129
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3423 int pTextHeight; // eax@129
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3424 unsigned int v81; // ecx@129
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
3425 unsigned int pColorText; // ax@129
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3426 int v85; // [sp-14h] [bp-ECh]@29
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3427 int v86; // [sp-10h] [bp-E8h]@29
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3428 ItemGen *v87; // [sp-10h] [bp-E8h]@43
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3429 unsigned __int16 v88; // [sp-Ch] [bp-E4h]@29
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3430 void *v89; // [sp-Ch] [bp-E4h]@43
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3431 char *v90; // [sp-8h] [bp-E0h]@29
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3432 int v91; // [sp-8h] [bp-E0h]@42
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3433 unsigned int v92; // [sp-4h] [bp-DCh]@29
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3434 __int64 *v93; // [sp-4h] [bp-DCh]@42
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3435 POINT v94; // [sp+Ch] [bp-CCh]@39
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3436 POINT v95; // [sp+14h] [bp-C4h]@49
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3437 POINT v96; // [sp+1Ch] [bp-BCh]@117
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3438 POINT v97; // [sp+24h] [bp-B4h]@40
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3439 POINT v98; // [sp+2Ch] [bp-ACh]@117
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3440 POINT v99; // [sp+34h] [bp-A4h]@49
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3441 POINT v100; // [sp+3Ch] [bp-9Ch]@50
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3442 POINT v101; // [sp+44h] [bp-94h]@39
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3443 POINT v102; // [sp+4Ch] [bp-8Ch]@49
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3444 POINT a2; // [sp+54h] [bp-84h]@39
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3445 GUIWindow dialog_window; // [sp+5Ch] [bp-7Ch]@1
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3446 int v105; // [sp+B0h] [bp-28h]@19
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
3447 int pColorYellow; // [sp+B4h] [bp-24h]@1
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3448 int Str; // [sp+B8h] [bp-20h]@23
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3449 int pColorWhite; // [sp+BCh] [bp-1Ch]@1
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3450 __int32 v109; // [sp+C0h] [bp-18h]@39
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3451 Player *pPlayer; // [sp+C4h] [bp-14h]@1
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3452 int pNumString; // [sp+C8h] [bp-10h]@9
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3453 unsigned int v112; // [sp+CCh] [bp-Ch]@9
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3454 unsigned __int8 v113; // [sp+D3h] [bp-5h]@47
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3455 int v114; // [sp+D4h] [bp-4h]@11
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3456
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3457 pPlayer = pPlayers[uActiveCharacter];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3458 memcpy(&dialog_window, window_SpeakInHouse, sizeof(dialog_window));
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3459 dialog_window.uFrameX = 483;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3460 dialog_window.uFrameWidth = 148;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3461 dialog_window.uFrameZ = 334;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3462 pColorWhite = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
3463 pColorYellow = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3464 switch(dialog_menu_id)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3465 {
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
3466 case HOUSE_DIALOGUE_MAIN:
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3467 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3468 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3469 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3470 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3471 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3472 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3473 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3474 all_text_height = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3475 for (int i = 0; i < 4; ++i)//while ( (signed int)v15 < (signed int)&unk_F8B1C8 );
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3476 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3477 Str = (174 - all_text_height) / 4;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3478 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3479 v76 = pNumActiveItem + pDialogueWindow->pNumPresenceButton;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3480 v77 = (174 - 4 * (174 - all_text_height) / 4 - all_text_height) / 2 - (174 - all_text_height) / 4 / 2 + 138;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3481 v28 = -pDialogueWindow->pNumPresenceButton < 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3482 if ( v28 ^ pNumActiveItem > v76 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3483 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3484 pItemNum = 2;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3485 pNumString = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3486 do
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3487 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3488 pButton = pDialogueWindow->GetControl(pItemNum);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3489 pButton->uY = Str + v77;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3490 pTextHeight = pFontArrus->CalcTextHeight((const char *)pShopOptions[pNumString], &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3491 pButton->uHeight = pTextHeight;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3492 v77 = pButton->uY + pTextHeight - 1;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3493 pButton->uW = v77;
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
3494 pColorText = pColorYellow;
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3495 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum )
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
3496 pColorText = pColorWhite;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
3497 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, (const char *)pShopOptions[pNumString], 3);
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3498 ++pItemNum;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3499 ++pNumString;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3500 pNumActiveItem = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3501 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3502 while ( pItemNum < pNumActiveItem );
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3503 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3504 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3505 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3506 }
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
3507 case HOUSE_DIALOGUE_SHOP_BUY_STANDARD:
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3508 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3509 pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3510 v114 = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3511 do
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3512 {
757
0b3f4b854652 if and ; errors
zipi
parents: 749
diff changeset
3513 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v114].uItemID)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3514 {
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3515 v46 = ItemsInShopTexture[v114];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3516 v47 = 152 - v46->uTextureHeight;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3517 if ( (signed int)v47 < 1 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3518 v47 = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3519 v48 = 75 * v114 - v46->uTextureWidth / 2 + 40;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3520 if ( v114 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3521 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3522 if ( v114 == 5 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3523 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3524 v49 = ItemsInShopTexture[5]->uTextureWidth;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3525 if ( (signed int)v48 > 457 - v49 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3526 v48 = 457 - v49;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3527 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3528 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3529 else if ( (signed int)v48 < 18 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3530 v48 = 18;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3531 pRenderer->DrawTextureTransparent(v48, v47, v46);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3532 sub_40F92A(&pRenderer->pActiveZBuffer[v48 + 640 * v47], ItemsInShopTexture[v114], v114 + 1);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3533 }
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3534 ++v114;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3535 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3536 while ( v114 < 6 );
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3537 v114 = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3538 do
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3539 {
757
0b3f4b854652 if and ; errors
zipi
parents: 749
diff changeset
3540 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v114+1].uItemID)
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3541 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3542 v50 = ItemsInShopTexture[v114 + 6];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3543 v51 = 308 - v50->uTextureHeight;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3544 if ( (signed int)v51 < 1 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3545 v51 = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3546 v52 = 75 * v114 - v50->uTextureWidth / 2 + 40;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3547 if ( v114 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3548 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3549 if ( v114 == 5 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3550 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3551 v53 = ItemsInShopTexture[11]->uTextureWidth;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3552 if ( (signed int)v52 > 457 - v53 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3553 v52 = 457 - v53;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3554 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3555 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3556 else
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3557 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3558 if ( (signed int)v52 < 18 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3559 v52 = 18;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3560 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3561 pRenderer->DrawTextureTransparent(v52, v51, v50);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3562 sub_40F92A(&pRenderer->pActiveZBuffer[v52 + 640 * v51], ItemsInShopTexture[v114 + 6], v114 + 7);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3563 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3564 ++v114;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3565 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3566 while ( v114 < 6 );
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3567 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3568 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3569 v62 = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3570 v109 = 0;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3571 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3572 {
757
0b3f4b854652 if and ; errors
zipi
parents: 749
diff changeset
3573 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v62].uItemID)
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3574 ++v109;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3575 ++v62;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3576 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3577 while ( v62 < 12 );
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3578 v63 = GetAsyncKeyState(17);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3579 v64 = pPlayer->CanSteal();
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3580 Str = v64;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3581 if ( v63 && v64 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3582 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3583 v65 = pGlobalTXT_LocalizationStrings[185];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3584 }
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
3585 else if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3586 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3587 v65 = pGlobalTXT_LocalizationStrings[195];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3588 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3589 else
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3590 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3591 v65 = pGlobalTXT_LocalizationStrings[196];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3592 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3593 DrawTextAtStatusBar(v65, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3594 if ( !v109 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3595 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3596 dialog_window.DrawCurrentTime( pParty->field_3C.field_50[ (unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3597 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3598 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3599 v66 = pMouse->GetCursorPos(&v98);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3600 pNumActiveItem = v66->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v96)->y];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3601 if ( pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3602 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3603 v67 = (pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF) - 1;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3604 v70 = (ItemGen *)&pParty->StandartItemsInShops[(int)window_SpeakInHouse->ptr_1C][v67];
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
3605 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3606 v70 = &pParty->SpecialItemsInShops[(int)window_SpeakInHouse->ptr_1C][v67];//v70 = (ItemGen *)&pParty->field_C59C[v69 + 724];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3607 if ( !v63 || !Str )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3608 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3609 v71 = pPlayer->_490EEE(v70, 4, (int)window_SpeakInHouse->ptr_1C, 2);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3610 v38 = (char *)pMerchantsBuyPhrases[v71];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3611 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3612 else
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3613 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3614 v38 = pGlobalTXT_LocalizationStrings[181];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3615 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3616 v21 = BuilDialogueString(v38, uActiveCharacter - 1, v70, (char *)window_SpeakInHouse->ptr_1C, 2, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3617 v40 = pFontArrus->CalcTextHeight(v21, &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3618 dialog_window.DrawTitleText(pFontArrus, 0, (174 - v40) / 2 + 138, pColorWhite, v21, 3);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3619 return ;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3620 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3621 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3622 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3623 }
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
3624 case HOUSE_DIALOGUE_SHOP_SELL:
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3625 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3626 draw_leather();
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3627 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3628 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3629 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3630 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3631 if ((v43 = pMouse->GetCursorPos(&v99)->x - 14, v109 = (v43 >> 5) + 14 * ((pMouse->GetCursorPos(&v95)->y - 17) >> 5),
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3632 pMouse->GetCursorPos(&v102)->x <= 13) || pMouse->GetCursorPos(&v100)->x >= 462
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3633 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v109), !pNumActiveItem) )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3634 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3635 v87 = (ItemGen *)&pPlayer->pInventoryItems[pNumActiveItem - 1];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3636 v45 = pPlayer->_490EEE(v87, 4, (int)window_SpeakInHouse->ptr_1C, 3);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3637 v21 = BuilDialogueString((char *)pMerchantsSellPhrases[v45], uActiveCharacter - 1, v87, (char *)window_SpeakInHouse->ptr_1C, 3, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3638 pTextHeight = pFontArrus->CalcTextHeight(v21, &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3639 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v21, 3);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3640 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3641 }
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
3642 case HOUSE_DIALOGUE_SHOP_IDENTIFY:
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3643 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3644 draw_leather();
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3645 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3646 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3647 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3648 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3649 if ((v36 = pMouse->GetCursorPos(&a2)->x - 14, v109 = (v36 >> 5) + 14 * ((pMouse->GetCursorPos(&v94)->y - 17) >> 5),
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3650 pMouse->GetCursorPos(&v101)->x <= 13) || pMouse->GetCursorPos(&v97)->x >= 462
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3651 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v109), !pNumActiveItem) )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3652 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3653 v37 = (ItemGen *)&pPlayer->pInventoryItems[pNumActiveItem - 1];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3654 if (!v37->Identified())
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3655 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3656 v42 = pPlayer->_490EEE(v37, 4, (int)window_SpeakInHouse->ptr_1C, 4);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3657 v38 = (char *)pMerchantsIdentifyPhrases[v42];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3658 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3659 else
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3660 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3661 v38 = "%24";
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3662 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3663 v21 = BuilDialogueString(v38, uActiveCharacter - 1, v37, (char *)window_SpeakInHouse->ptr_1C, 4, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3664 v40 = pFontArrus->CalcTextHeight(v21, &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3665 dialog_window.DrawTitleText(pFontArrus, 0, (174 - v40) / 2 + 138, pColorWhite, v21, 3);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3666 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3667 }
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
3668 case HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT:
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3669 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3670 draw_leather();
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3671 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3672 pShopOptions[0] = pGlobalTXT_LocalizationStrings[200];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3673 pShopOptions[1] = pGlobalTXT_LocalizationStrings[113];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3674 all_text_height = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3675 for ( int i = 0; i < 2; ++i )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3676 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3677 Str = (174 - all_text_height) / 2;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3678 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3679 v26 = pNumActiveItem + pDialogueWindow->pNumPresenceButton;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3680 v27 = (2 * (87 - (174 - all_text_height) / 2) - all_text_height) / 2 - (174 - all_text_height) / 2 / 2 + 138;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3681 v28 = -pDialogueWindow->pNumPresenceButton < 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3682 if ( v28 ^ pNumActiveItem > v26 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3683 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3684 pItemNum = 2;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3685 pNumString = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3686 do
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3687 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3688 pButton = pDialogueWindow->GetControl(pItemNum);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3689 pButton->uY = Str + v27;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3690 pTextHeight = pFontArrus->CalcTextHeight((const char *)pShopOptions[pNumString], &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3691 pButton->uHeight = pTextHeight;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3692 v27 = pButton->uY + pTextHeight - 1;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3693 pButton->uW = v27;
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
3694 pColorText = pColorYellow;
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3695 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum )
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
3696 pColorText = pColorWhite;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
3697 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, (const char *)pShopOptions[pNumString], 3);
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3698 ++pItemNum;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3699 ++pNumString;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3700 pNumActiveItem = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3701 }
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3702 while ( pItemNum < pNumActiveItem );
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3703 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3704 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3705 }
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
3706 case HOUSE_DIALOGUE_SHOP_BUY_SPECIAL:
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3707 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3708 pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3709 v114 = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3710 do
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3711 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3712 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v114].uItemID)
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3713 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3714 v54 = ItemsInShopTexture[v114];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3715 v55 = 152 - v54->uTextureHeight;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3716 if ( (signed int)v55 < 1 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3717 v55 = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3718 v56 = 75 * v114 - v54->uTextureWidth / 2 + 40;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3719 if ( v114 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3720 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3721 if ( v114 == 5 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3722 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3723 v57 = ItemsInShopTexture[5]->uTextureWidth;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3724 if ( (signed int)v56 > 457 - v57 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3725 v56 = 457 - v57;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3726 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3727 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3728 else
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3729 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3730 if ( (signed int)v56 < 18 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3731 v56 = 18;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3732 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3733 pRenderer->DrawTextureTransparent(v56, v55, v54);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3734 sub_40F92A(&pRenderer->pActiveZBuffer[v56 + 640 * v55], ItemsInShopTexture[v114], v114 + 1);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3735 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3736 ++v114;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3737 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3738 while ( v114 < 6 );
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3739 v114 = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3740 do
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3741 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3742 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(signed int)v114].uItemID) //not itemid
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3743 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3744 v58 = ItemsInShopTexture[v114 + 6];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3745 v59 = 308 - v58->uTextureHeight;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3746 if ( (signed int)v59 < 1 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3747 v59 = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3748 v60 = 75 * v114 - v58->uTextureWidth / 2 + 40;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3749 if ( v114 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3750 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3751 if ( v114 == 5 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3752 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3753 v61 = ItemsInShopTexture[11]->uTextureWidth;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3754 if ( (signed int)v60 > 457 - v61 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3755 v60 = 457 - v61;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3756 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3757 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3758 else
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3759 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3760 if ( (signed int)v60 < 18 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3761 v60 = 18;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3762 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3763 pRenderer->DrawTextureTransparent(v60, v59, v58);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3764 sub_40F92A(&pRenderer->pActiveZBuffer[v60 + 640 * v59], ItemsInShopTexture[v114 + 6], v114 + 7);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3765 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3766 ++v114;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3767 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3768 while ( v114 < 6 );
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3769 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3770 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3771 v62 = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3772 v109 = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3773 do
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3774 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3775 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v62].uItemID)
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3776 ++v109;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3777 ++v62;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3778 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3779 while ( v62 < 12 );
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3780 v63 = GetAsyncKeyState(17);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3781 v64 = pPlayer->CanSteal();
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3782 Str = v64;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3783 if ( v63 && v64 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3784 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3785 v65 = pGlobalTXT_LocalizationStrings[185];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3786 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3787 else
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3788 {
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3789 v65 = pGlobalTXT_LocalizationStrings[195];
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
3790 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3791 v65 = pGlobalTXT_LocalizationStrings[196];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3792 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3793 DrawTextAtStatusBar(v65, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3794 if ( !v109 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3795 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3796 dialog_window.DrawCurrentTime( pParty->field_3C.field_50[ (unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3797 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3798 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3799 v66 = pMouse->GetCursorPos(&v98);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3800 pNumActiveItem = v66->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v96)->y];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3801 if ( pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3802 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3803 v67 = (pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF) - 1;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3804 v109 = v67;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3805 v68 = (int)window_SpeakInHouse->ptr_1C;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3806 // v69 = 9 * (v67 + 12 * v68);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3807 v70 = (ItemGen *)&pParty->StandartItemsInShops[v68][v67];
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
3808 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3809 v70 = &pParty->SpecialItemsInShops[(int)v68][v67];//v70 = (ItemGen *)&pParty->field_C59C[v69 + 724];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3810 if ( !v63 || !Str )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3811 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3812 v71 = pPlayer->_490EEE(v70, 4, v68, 2);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3813 v38 = (char *)pMerchantsBuyPhrases[v71];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3814 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3815 else
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3816 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3817 v38 = pGlobalTXT_LocalizationStrings[181];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3818 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3819 v21 = BuilDialogueString(v38, uActiveCharacter - 1, v70, (char *)window_SpeakInHouse->ptr_1C, 2, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3820 v40 = pFontArrus->CalcTextHeight(v21, &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3821 dialog_window.DrawTitleText(pFontArrus, 0, (174 - v40) / 2 + 138, pColorWhite, v21, 3);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3822 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3823 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3824 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3825 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3826 }
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
3827 case HOUSE_DIALOGUE_LEARN_SKILLS:
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3828 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3829 if (!sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win())
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3830 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3831 all_text_height = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3832 v5 = (signed __int64)(p2DEvents[(signed int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3833 pItemNum = v5 * (100 - pPlayer->GetMerchant()) / 100;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3834 if ( pItemNum < v5 / 3 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3835 pItemNum = v5 / 3;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3836 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3837 v114 = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3838 if ( pNumActiveItem >= pNumActiveItem + pDialogueWindow->pNumPresenceButton )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3839 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3840 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], pPlayer->pName, pClassNames[pPlayer->classType]);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3841 strcat(pTmpBuf, "\n \n");
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3842 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3843 v40 = pFontArrus->CalcTextHeight(pTmpBuf, &dialog_window, 0, 0);
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
3844 dialog_window.DrawTitleText(pFontArrus, 0, (174 - v40) / 2 + 138, pColorYellow, pTmpBuf, 3);
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3845 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3846 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3847 do
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3848 {
832
dfd683c4f538 Hotkeys fixed
Nomad
parents: 827
diff changeset
3849 v8 = pDialogueWindow->GetControl(pNumActiveItem)->msg_param - 36;
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3850 if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayer->classType][v8] && !pPlayer->pActiveSkills[v8] )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3851 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3852 all_text_height = pFontArrus->CalcTextHeight(pSkillNames[v8], &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3853 ++v114;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3854 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3855 ++pNumActiveItem;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3856 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3857 while ( pNumActiveItem < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3858 if ( !v114 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3859 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3860 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], pPlayer->pName, pClassNames[pPlayer->classType]);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3861 strcat(pTmpBuf, "\n \n");
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3862 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3863 v40 = pFontArrus->CalcTextHeight(pTmpBuf, &dialog_window, 0, 0);
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
3864 dialog_window.DrawTitleText(pFontArrus, 0, (174 - v40) / 2 + 138, pColorYellow, pTmpBuf, 3);
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3865 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3866 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3867 if ( v114 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3868 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3869 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], pItemNum);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3870 dialog_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3871 v18 = (149 - all_text_height) / v114;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3872 if ( (149 - all_text_height) / v114 > 32 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3873 v18 = 32;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3874 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3875 v105 = (149 - v114 * v18 - all_text_height) / 2 - v18 / 2 + 162;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3876 if ( pNumActiveItem < pNumActiveItem + pDialogueWindow->pNumPresenceButton )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3877 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3878 pItemNum = 2;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3879 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3880 {
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3881 pButton = pDialogueWindow->GetControl(pItemNum);
832
dfd683c4f538 Hotkeys fixed
Nomad
parents: 827
diff changeset
3882 v13 = pButton->msg_param - 36;
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3883 if ( !byte_4ED970_skill_learn_ability_by_class_table[pPlayer->classType][v13] || pPlayer->pActiveSkills[v13] )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3884 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3885 pButton->uW = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3886 pButton->uHeight = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3887 pButton->uY = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3888 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3889 else
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3890 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3891 pButton->uY = v18 + v105;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3892 pTextHeight = pFontArrus->CalcTextHeight(pSkillNames[v13], &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3893 pButton->uHeight = pTextHeight;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3894 v105 = pButton->uY + pTextHeight - 1;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3895 pButton->uW = v105;
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
3896 pColorText = pColorYellow;
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3897 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum )
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
3898 pColorText = pColorWhite;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
3899 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, pSkillNames[v13], 3);
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3900 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3901 pNumActiveItem = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3902 pItemNum++;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3903 }
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3904 while ( pItemNum < pNumActiveItem );
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3905 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3906 return;
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3907 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3908 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3909 default:
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3910 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3911 return;// (POINT *)dialog_menu_id - 96;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
3912 }
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3913 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3914 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3915
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3916 //----- (004BA928) --------------------------------------------------------
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3917 void __cdecl ArmorShopDialog()
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3918 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3919 Player *v0; // ebx@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3920 signed int v1; // esi@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3921 unsigned int v2; // eax@10
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3922 ItemGen *v3; // eax@11
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3923 unsigned __int8 v4; // dl@12
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3924 char *v5; // ecx@12
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3925 char *v6; // eax@13
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3926 int v7; // ST08_4@15
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3927 int v8; // eax@15
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3928 signed int v9; // esi@17
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3929 unsigned int v10; // eax@19
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3930 char *v11; // edi@19
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3931 int v12; // ST08_4@20
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3932 int v13; // eax@20
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3933 unsigned __int8 v14; // dl@20
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3934 char *v15; // ecx@20
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3935 char **v16; // edi@22
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3936 int all_text_height; // ebx@22
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3937 char **v18; // esi@22
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3938 int v19; // eax@23
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3939 GUIWindow *v20; // ecx@24
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3940 int v21; // eax@24
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3941 int v22; // edx@24
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3942 int v23; // ebx@24
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3943 unsigned __int8 v24; // sf@24
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3944 GUIButton *control_button; // eax@26
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3945 GUIButton *v26; // esi@26
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3946 int v27; // eax@26
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3947 unsigned int v28; // ecx@26
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3948 int v29; // edx@26
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3949
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3950 signed int v31; // esi@31
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3951 unsigned int v32; // eax@33
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3952 int v33; // eax@34
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3953 int v34; // ST08_4@35
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3954 int v35; // eax@35
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3955 char *v36; // edx@36
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3956 GUIWindow *v37; // edi@42
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3957 signed int v38; // esi@42
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3958 unsigned int v39; // esi@44
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3959 int v40; // eax@44
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3960 unsigned int v41; // eax@45
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3961 int v42; // eax@47
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3962 int v43; // ecx@52
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3963 GUIButton *v44; // eax@54
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3964 GUIButton *v45; // esi@54
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3965 int v46; // eax@54
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3966 char *v47; // eax@56
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3967 int v48; // eax@56
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3968 unsigned int v49; // ecx@56
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3969 int v50; // edx@56
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3970 int v51; // eax@56
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3971 unsigned __int16 v52; // ax@56
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3972 int v53; // eax@60
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3973 int textureH; // eax@60
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3974 signed int textureW; // ebx@65
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3975 Texture *v56; // eax@67
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3976 unsigned int v57; // edi@68
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3977 Texture *v58; // ST1C_4@68
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3978 int v59; // eax@68
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3979 int v60; // edi@69
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3980 signed int v61; // ebx@73
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3981 Texture *v62; // eax@75
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3982 int v63; // edi@76
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3983 Texture *v64; // ST1C_4@76
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3984 unsigned int v65; // ST18_4@76
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3985 int v66; // eax@76
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3986 int v67; // edi@77
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3987 signed int v68; // ecx@81
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3988 SHORT v69; // bx@89
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3989 bool v70; // eax@89
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3990 const char *v71; // ecx@91
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3991 void *v72; // eax@95
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3992 POINT *v73; // esi@97
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3993 int v74; // ecx@97
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3994 int v75; // eax@98
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3995 int v76; // ecx@98
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3996 ItemGen *selected_item; // ecx@99
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3997 unsigned __int8 v78; // bl@104
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3998 char **v79; // edi@105
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3999 int v80; // ebx@105
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4000 char **v81; // esi@105
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4001 int v82; // eax@106
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4002 GUIWindow *v83; // ecx@107
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4003 int v84; // eax@107
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4004 int v85; // edx@107
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4005 int v86; // ebx@107
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4006 GUIButton *v87; // eax@109
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4007 GUIButton *v88; // esi@109
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4008 int v89; // eax@109
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4009 unsigned int v90; // ecx@109
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4010 int v91; // edx@109
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4011 unsigned __int16 v92; // ax@109
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4012 signed int v93; // edx@114
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4013 POINT *v94; // edi@120
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4014 __int32 v95; // ecx@120
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4015 void *v96; // ST14_4@122
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4016 unsigned __int8 v97; // bl@122
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4017 ItemGen *v98; // ST10_4@122
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4018 int v99; // eax@122
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4019 char *v100; // eax@122
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4020 const char *v101; // ST18_4@122
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4021 unsigned __int16 v102; // ST14_2@122
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4022 int v103; // eax@122
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4023 signed int v104; // edi@123
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4024 Texture *v105; // eax@125
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4025 int v106; // ebx@126
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4026 Texture *v107; // ST1C_4@126
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4027 unsigned int v108; // ST18_4@126
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4028 int v109; // eax@126
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4029 int v110; // ebx@127
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4030 GUIWindow *v111; // [sp-18h] [bp-11Ch]@36
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4031 unsigned int v112; // [sp-14h] [bp-118h]@13
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4032 int v113; // [sp-14h] [bp-118h]@36
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4033 ItemGen *v114; // [sp-10h] [bp-114h]@12
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4034 unsigned int v115; // [sp-10h] [bp-114h]@13
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4035 ItemGen *v116; // [sp-10h] [bp-114h]@20
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4036 int v117; // [sp-10h] [bp-114h]@36
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4037 void *v118; // [sp-Ch] [bp-110h]@12
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4038 unsigned __int16 v119; // [sp-Ch] [bp-110h]@13
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4039 void *v120; // [sp-Ch] [bp-110h]@20
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4040 char *v121; // [sp-8h] [bp-10Ch]@13
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4041 int v122; // [sp-8h] [bp-10Ch]@20
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4042 unsigned int v123; // [sp-4h] [bp-108h]@13
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4043 __int64 *v124; // [sp-4h] [bp-108h]@20
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4044 int v125; // [sp-4h] [bp-108h]@68
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4045 int v126; // [sp-4h] [bp-108h]@76
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4046 int v127; // [sp-4h] [bp-108h]@126
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4047 POINT v128; // [sp+Ch] [bp-F8h]@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4048 POINT v129; // [sp+14h] [bp-F0h]@18
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4049 char v130; // [sp+1Ch] [bp-E8h]@120
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4050 POINT a2; // [sp+24h] [bp-E0h]@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4051 POINT v132; // [sp+2Ch] [bp-D8h]@120
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4052 POINT v133; // [sp+34h] [bp-D0h]@17
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4053 POINT v134; // [sp+3Ch] [bp-C8h]@97
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4054 POINT v135; // [sp+44h] [bp-C0h]@31
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4055 POINT v136; // [sp+4Ch] [bp-B8h]@97
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4056 POINT v137; // [sp+54h] [bp-B0h]@17
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4057 POINT v138; // [sp+5Ch] [bp-A8h]@32
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4058 POINT v139; // [sp+64h] [bp-A0h]@17
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4059 POINT v140; // [sp+6Ch] [bp-98h]@31
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4060 POINT v141; // [sp+74h] [bp-90h]@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4061 POINT v142; // [sp+7Ch] [bp-88h]@31
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4062 POINT v143; // [sp+84h] [bp-80h]@9
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4063 GUIWindow dialog_window; // [sp+8Ch] [bp-78h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4064 char *Str; // [sp+E0h] [bp-24h]@56
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4065 int v146; // [sp+E4h] [bp-20h]@24
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4066 int hilight_color; // [sp+E8h] [bp-1Ch]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4067 int m_text_color; // [sp+ECh] [bp-18h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4068 __int32 v149; // [sp+F0h] [bp-14h]@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4069 Player* _this; // [sp+F4h] [bp-10h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4070 unsigned __int8 uPlayerID; // [sp+FBh] [bp-9h]@15
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4071 int v152; // [sp+FCh] [bp-8h]@24
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4072 int v153; // [sp+100h] [bp-4h]@44
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4073 int th;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4074 short text_color;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4075
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4076 v0 = pPlayers[uActiveCharacter];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4077 _this = pPlayers[uActiveCharacter];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4078 memcpy(&dialog_window, window_SpeakInHouse, sizeof(dialog_window));
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4079 dialog_window.uFrameX = 483;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4080 dialog_window.uFrameWidth = 148;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4081 dialog_window.uFrameZ = 334;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4082 m_text_color = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4083 hilight_color = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4084 switch (dialog_menu_id)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4085 {
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
4086 case HOUSE_DIALOGUE_MAIN:
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4087 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4088 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4089 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4090 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134]; //"Buy Standard"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4091 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152]; //"Buy Special"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4092 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159]; //"Display Inventory"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4093 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4094
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4095 all_text_height = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4096 for(int i=0;i<4;++i)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4097 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4098 v146 = (174 - all_text_height) / 4;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4099
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4100 v23 = (174 - 4 * (174 - all_text_height) / 4 - all_text_height) / 2 - (174 - all_text_height) / 4 / 2 + 138;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4101 int j=0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4102 if ( pDialogueWindow->pNumPresenceButton>=0 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4103 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4104 th = 2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4105 for (v152 = pDialogueWindow->pStartingPosActiveItem; v152 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem; ++v152)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4106 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4107 control_button = pDialogueWindow->GetControl(v152);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4108 control_button->uY = v146 + v23;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4109 v27 = pFontArrus->CalcTextHeight(pShopOptions[j], &dialog_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4110 control_button->uHeight = v27;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4111 v23 = control_button->uY + control_button->uHeight - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4112 control_button->uW = v23;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4113 text_color = hilight_color;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4114 if ( pDialogueWindow->pCurrentPosActiveItem != th )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4115 text_color = m_text_color;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4116 dialog_window.DrawTitleText(pFontArrus, 0, control_button->uY, text_color, pShopOptions[j], 3);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4117 ++th;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4118 ++j;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4119 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4120 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4121 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4122 break;
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
4123 case HOUSE_DIALOGUE_SHOP_BUY_STANDARD:
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4124 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4125 pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4126 textureW = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4127 v153 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4128 for(int i=0; i<8; ++i)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4129 {
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
4130 if ( pParty->StandartItemsInShops[window_SpeakInHouse->par1C][i].uItemID)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4131 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4132 textureW = ItemsInShopTexture[i]->uTextureWidth;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4133 textureH = ItemsInShopTexture[i]->uTextureHeight;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4134 if ( i >= 4 ) //low row
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4135 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4136 v60 = 90 - (textureW/2);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4137 pRenderer->DrawTextureTransparent(v60 + v153 - 420, 126, ItemsInShopTexture[i]);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4138 v59 = v60 + v153 + 80220;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4139 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4140 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4141 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4142 v57 = 98 - textureH;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4143 v152 = 86 - (textureW/2);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4144 pRenderer->DrawTextureTransparent(v153 + v152, v57, ItemsInShopTexture[i]);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4145 v59 = v153 + v152 + 640 * v57;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4146 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4147 ZBuffer_DoFill(&pRenderer->pActiveZBuffer[v59], ItemsInShopTexture[i], i+1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4148 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4149 v153 += 105;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4150
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4151 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4152
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4153 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4154 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4155
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4156 v149 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4157 for(int i=0; i<8; ++i)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4158 {
757
0b3f4b854652 if and ; errors
zipi
parents: 749
diff changeset
4159 if ( pParty->StandartItemsInShops[window_SpeakInHouse->par1C][i].uItemID)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4160 ++v149;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4161
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4162 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4163
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4164 v69 = GetAsyncKeyState(17);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4165 v70 = _this->CanSteal();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4166 //Str = (char *)v70;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4167 if ( v69 == 0 || v70 == 0 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4168 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4169 v71 = pGlobalTXT_LocalizationStrings[195]; //"Select the Item to Buy"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4170 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4171 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4172 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4173 v71 = pGlobalTXT_LocalizationStrings[185];//"Steal item"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4174 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4175 DrawTextAtStatusBar(v71, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4176 if ( v149 != 0 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4177 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4178 v73 = pMouse->GetCursorPos(&v136);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4179 v74 = pRenderer->pActiveZBuffer[v73->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v134)->y]] & 0xFFFF;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4180 if ( !v74 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4181 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4182 v149 = v74 - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4183 selected_item = &pParty->StandartItemsInShops[window_SpeakInHouse->par1C][v74-1];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4184 if ( v69 ==0 || v70 == 0)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4185 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4186 v120 = window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4187 v15 = (char *)pMerchantsBuyPhrases[_this->_490EEE(selected_item, 2, window_SpeakInHouse->par1C, 2)];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4188 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4189 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4190 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4191 v120 = window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4192 v15 = pGlobalTXT_LocalizationStrings[181]; //"Steal %24"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4193 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4194 v36 = BuilDialogueString(v15, uActiveCharacter - 1, selected_item, (char *)v120, 2, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4195 v115 = (174 - pFontArrus->CalcTextHeight(v36, &dialog_window, 0, 0)) / 2 + 138;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4196 dialog_window.DrawTitleText(pFontArrus, 0, v115, m_text_color, v36, 3);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4197 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4198 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4199 dialog_window.DrawCurrentTime( pParty->field_3C.field_50[window_SpeakInHouse->par1C]- pParty->uTimePlayed);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4200 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4201 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4202 break;
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
4203 case HOUSE_DIALOGUE_SHOP_SELL:
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4204 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4205 draw_leather();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4206 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4207 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0);//"Select the Item to Sell"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4208 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win())
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4209 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4210
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4211 if((v9 = pMouse->GetCursorPos(&v139)->x - 14, v149 = (v9 >> 5) + 14 * ((pMouse->GetCursorPos(&v133)->y - 17) >> 5),
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4212 pMouse->GetCursorPos(&v137)->x <= 13) || pMouse->GetCursorPos(&v129)->x >= 462
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4213 || (v10 = v0->GetItemIDAtInventoryIndex((int *)&v149), v11 = 0, !v10) )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4214 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4215
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4216 v116 = (ItemGen *)&v0->pInventoryItems[v10-1];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4217 v13 = v0->_490EEE(v116, 2, window_SpeakInHouse->par1C, 3);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4218 v15 = (char *)pMerchantsSellPhrases[v0->_490EEE(v116, 2, window_SpeakInHouse->par1C, 3)];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4219 v36 = BuilDialogueString(v15, uActiveCharacter - 1, v116, (char *) window_SpeakInHouse->par1C, 3, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4220 v115 = (174 - pFontArrus->CalcTextHeight(v36, &dialog_window, 0, 0)) / 2 + 138;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4221 dialog_window.DrawTitleText(pFontArrus, 0, v115, m_text_color, v36, 3);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4222 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4223 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4224 break;
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
4225 case HOUSE_DIALOGUE_SHOP_IDENTIFY:
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4226 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4227 draw_leather();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4228 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4229 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0); //"Select the Item to Identify"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4230 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4231 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4232 v1 = pMouse->GetCursorPos(&a2)->x - 14;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4233 v149 = (v1 >> 5) + 14 * ((pMouse->GetCursorPos(&v128)->y - 17) >> 5);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4234 if ( pMouse->GetCursorPos(&v141)->x > 13 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4235 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4236 if ( pMouse->GetCursorPos(&v143)->x < 462 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4237 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4238 v2 = v0->GetItemIDAtInventoryIndex((int *)&v149);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4239 if ( v2 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4240 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4241 v3 = (ItemGen *)&v0->pInventoryItems[v2-1];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4242 if (v3->Identified())
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4243 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4244 v118 = window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4245 v4 = uActiveCharacter - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4246 v5 = "%24";
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4247 v114 = v3;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4248 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4249 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4250 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4251 v118 = window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4252 v114 = v3;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4253 v7 = (int)window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4254 uPlayerID = uActiveCharacter - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4255 v8 = v0->_490EEE(v3, 2, v7, 4);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4256 v4 = uPlayerID;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4257 v5 = (char *)pMerchantsIdentifyPhrases[v8];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4258 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4259 v6 = BuilDialogueString(v5, v4, v114, (char *)v118, 4, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4260 v115 = (174 - pFontArrus->CalcTextHeight(v6, &dialog_window, 0, 0)) / 2 + 138;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4261 dialog_window.DrawTitleText(pFontArrus, 0, v115, m_text_color, v6, 3);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4262 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4263 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4264 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4265 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4266 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4267 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4268 break;
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
4269 case HOUSE_DIALOGUE_SHOP_REPAIR:
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4270 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4271 draw_leather();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4272 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4273 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[198], 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4274 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win())
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4275 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4276
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4277 if( (v31 = pMouse->GetCursorPos(&v135)->x - 14,
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4278 v149 = (v31 >> 5) + 14 * ((pMouse->GetCursorPos(&v142)->y - 17) >> 5),
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4279 pMouse->GetCursorPos(&v140)->x <= 13)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4280 || pMouse->GetCursorPos(&v138)->x >= 462
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4281 || (v32 = v0->GetItemIDAtInventoryIndex((int *)&v149), v11 = 0, !v32)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4282 || (v33 = 9 * v32, !(v0->field_1F5[4 * v33 + 15] & 2)) )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4283 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4284
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4285
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4286 v120 = window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4287 v116 = (ItemGen *)&v0->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * v33 + 5];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4288 v34 = (int)window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4289 uPlayerID = uActiveCharacter - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4290 v35 = v0->_490EEE((ItemGen *)&v0->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * v33 + 5], 2, v34, 5);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4291 v14 = uPlayerID;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4292 v15 = (char *)pMerchantsRepairPhrases[v35];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4293 v36 = BuilDialogueString(v15, v14, v116, (char *)v120, 5, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4294 v115 = (174 - pFontArrus->CalcTextHeight(v36, &dialog_window, 0, 0)) / 2 + 138;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4295 dialog_window.DrawTitleText(pFontArrus, 0, v115, m_text_color, v36, 3);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4296 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4297 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4298 break;
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
4299 case HOUSE_DIALOGUE_SHOP_6: //buy standart
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4300 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4301 pRenderer->DrawTextureIndexed(8u, 8u, ShopTexture);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4302 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[195], 0); //"Select the Item to Buy"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4303 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4304 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4305 v149 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4306 for(int i=0;i<6;++i)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4307 if (pParty->SpecialItemsInShops[window_SpeakInHouse->par1C][i].uItemID)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4308 ++v149;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4309
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4310
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4311 if ( v149 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4312 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4313 v94 = pMouse->GetCursorPos(&v132);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4314 v149 = pRenderer->pActiveZBuffer[v94->x + pSRZBufferLineOffsets[pMouse->GetCursorPos((POINT *)&v130)->y]];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4315 v95 = v149;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4316 if ( v149 && v149 != -65536 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4317 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4318 --v149;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4319
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4320 v97 = uActiveCharacter - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4321
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4322 v99 = _this->_490EEE(
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4323 &pParty->SpecialItemsInShops[window_SpeakInHouse->par1C][v95-1], 2, window_SpeakInHouse->par1C, 2);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4324 v100 = BuilDialogueString((char *)pMerchantsBuyPhrases[v99], uActiveCharacter - 1, v98, (char *)window_SpeakInHouse->par1C, 2, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4325 v103 = pFontArrus->CalcTextHeight(v100, &dialog_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4326 dialog_window.DrawTitleText(pFontArrus, 0, (174 - v103) / 2 + 138, m_text_color, v100, 3);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4327 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4328 v104 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4329 v153 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4330 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4331 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4332 //if ( pParty->field_C59C[9 * (v104 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4333 if (pParty->SpecialItemsInShops[window_SpeakInHouse->par1C][v104].uItemID)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4334 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4335 v105 = ItemsInShopTexture[v104];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4336 if ( v104 >= 4 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4337 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4338 v110 = 90 - ((signed int)v105->uTextureWidth >> 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4339 pRenderer->DrawTextureTransparent(v153 + v110 - 420, 0x7Eu, ItemsInShopTexture[v104]);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4340 v127 = v104 + 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4341 v109 = v153 + v110 + 80220;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4342 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4343 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4344 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4345 v106 = 98 - v105->uTextureHeight;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4346 v107 = ItemsInShopTexture[v104];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4347 v108 = 98 - v105->uTextureHeight;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4348 v152 = 86 - ((signed int)v105->uTextureWidth >> 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4349 pRenderer->DrawTextureTransparent(v152 + v153, v108, v107);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4350 v127 = v104 + 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4351 v109 = v152 + v153 + 640 * v106;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4352 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4353 ZBuffer_DoFill(&pRenderer->pActiveZBuffer[v109], ItemsInShopTexture[v104], v127);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4354 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4355 v153 += 105;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4356 ++v104;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4357 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4358 while ( v104 < 8 );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4359 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4360 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4361 dialog_window.DrawCurrentTime(pParty->field_3C.field_50[window_SpeakInHouse->par1C]- pParty->uTimePlayed);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4362 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4363 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4364 break;
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
4365 case HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT:
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4366 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4367 draw_leather();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4368 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4369 v79 = pShopOptions;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4370 pShopOptions[0] = pGlobalTXT_LocalizationStrings[200]; //"Sell"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4371 pShopOptions[1] = pGlobalTXT_LocalizationStrings[113]; //"Identify"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4372 pShopOptions[2] = pGlobalTXT_LocalizationStrings[179]; //"Repair"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4373
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4374 all_text_height = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4375 for(int i=0;i<3;++i)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4376 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4377 v83 = pDialogueWindow;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4378 v152 = (174 - all_text_height) / 3;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4379 v84 = pDialogueWindow->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4380 v85 = v84 + pDialogueWindow->pNumPresenceButton;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4381 v86 = (3 * (58 - v152) - all_text_height) / 2 - v152 / 2 + 138;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4382 v24 = -pDialogueWindow->pNumPresenceButton < 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4383 _this = (Player *)pDialogueWindow->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4384 if ( v24 ^ __OFSUB__(v84, v85) )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4385 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4386 v153 = 2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4387 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4388 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4389 v87 = v83->GetControl((unsigned int)_this);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4390 v88 = v87;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4391 v87->uY = v152 + v86;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4392 v89 = pFontArrus->CalcTextHeight(*v79, &dialog_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4393 v90 = v88->uY;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4394 v91 = v153;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4395 v88->uHeight = v89;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4396 v86 = v90 + v89 - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4397 v88->uW = v86;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4398 v92 = hilight_color;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4399 if ( pDialogueWindow->pCurrentPosActiveItem != v91 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4400 v92 = m_text_color;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4401 dialog_window.DrawTitleText(pFontArrus, 0, v90, v92, *v79, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4402 v83 = pDialogueWindow;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4403 ++v153;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4404 ++v79;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4405 _this = (Player *)((char *)_this + 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4406 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4407 while ( (signed int)_this < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4408 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4409 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4410 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4411 break;
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
4412 case HOUSE_DIALOGUE_SHOP_BUY_SPECIAL:
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4413 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4414 pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4415 v11 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4416 v61 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4417 v153 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4418 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4419 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4420 if (pParty->SpecialItemsInShops[window_SpeakInHouse->par1C][v61].uItemID)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4421 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4422 v62 = ItemsInShopTexture[v61];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4423 if ( v61 >= 4 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4424 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4425 v67 = 90 - ((signed int)v62->uTextureWidth >> 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4426 pRenderer->DrawTextureTransparent(v153 + v67 - 420, 0x7Eu, ItemsInShopTexture[v61]);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4427 v66 = v153 + v67 + 80220;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4428 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4429 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4430 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4431 v63 = 98 - v62->uTextureHeight;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4432 v64 = ItemsInShopTexture[v61];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4433 v65 = 98 - v62->uTextureHeight;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4434 v152 = 86 - ((signed int)v62->uTextureWidth >> 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4435 pRenderer->DrawTextureTransparent(v152 + v153, v65, v64);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4436 v66 = v152 + v153 + 640 * v63;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4437 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4438 ZBuffer_DoFill(&pRenderer->pActiveZBuffer[v66], ItemsInShopTexture[v61], v61 + 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4439 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4440 v153 += 105;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4441 ++v61;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4442 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4443 while ( v61 < 8 );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4444
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4445 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4446 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4447 v68 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4448 v149 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4449
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4450 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4451 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4452 // if ( (char *)pParty->field_C59C[9 * (v68 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] != v11 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4453 if (pParty->SpecialItemsInShops[window_SpeakInHouse->par1C][(signed int)v68].uItemID)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4454 ++v149;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4455 ++v68;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4456 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4457 while ( v68 < 6 );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4458
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4459 v69 = GetAsyncKeyState(17);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4460 v70 = _this->CanSteal();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4461 Str = (char *)v70;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4462 if ( v69 == 0 || (char *)v70 == 0 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4463 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4464 v71 = pGlobalTXT_LocalizationStrings[196]; //Select the Special Item to Buy"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4465 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4466 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4467 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4468 v71 = pGlobalTXT_LocalizationStrings[185];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4469 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4470 DrawTextAtStatusBar(v71, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4471 if ( (char *)v149 != 0 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4472 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4473 v73 = pMouse->GetCursorPos(&v136);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4474 v74 = pRenderer->pActiveZBuffer[v73->x + pSRZBufferLineOffsets[pMouse->GetCursorPos((POINT *)&v134)->y]] & 0xFFFF;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4475 if ( !v74 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4476 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4477 v149 = v74 - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4478
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4479 if ( dialog_menu_id == 2 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4480 selected_item = &pParty->StandartItemsInShops[window_SpeakInHouse->par1C][v74-1];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4481 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4482 selected_item = &pParty->SpecialItemsInShops[window_SpeakInHouse->par1C][v74-1];//(ItemGen *)&pParty->field_C59C[v76 + 724];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4483 if ( v69 == 0 || Str == 0 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4484 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4485 v120 = window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4486 v15 = (char *)pMerchantsBuyPhrases[_this->_490EEE(selected_item, 2, window_SpeakInHouse->par1C, 2)];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4487 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4488 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4489 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4490 v120 = window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4491 v15 = pGlobalTXT_LocalizationStrings[181]; //"Steal %24"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4492 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4493 v36 = BuilDialogueString(v15, uActiveCharacter - 1, selected_item, (char *)v120, 2, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4494 v115 = (174 - pFontArrus->CalcTextHeight(v36, &dialog_window, 0, 0)) / 2 + 138;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4495 dialog_window.DrawTitleText(pFontArrus, 0, v115, m_text_color, v36, 3);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4496 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4497 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4498 dialog_window.DrawCurrentTime( pParty->field_3C.field_50[window_SpeakInHouse->par1C]- pParty->uTimePlayed);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4499 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4500 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4501 break;
747
585490c29945 House dialogue ids appended
Nomad
parents: 736
diff changeset
4502 case HOUSE_DIALOGUE_LEARN_SKILLS:
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4503 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4504 if (!sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4505 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4506 v152 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4507 v37 = pDialogueWindow;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4508 //v38 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)ptr_507BC0->ptr_1C] * 500.0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4509 v38 = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4510 _this = (Player *)(v38 * (100 - v0->GetMerchant()) / 100);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4511 if ( (signed int)_this < v38 / 3 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4512 _this = (Player *)(v38 / 3);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4513 v39 = v37->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4514 v40 = v37->pNumPresenceButton;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4515 v153 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4516 if ( (signed int)v39 < (signed int)(v39 + v40) )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4517 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4518 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4519 {
832
dfd683c4f538 Hotkeys fixed
Nomad
parents: 827
diff changeset
4520 v41 = v37->GetControl(v39)->msg_param - 36;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4521 if ( byte_4ED970_skill_learn_ability_by_class_table[v0->classType][v41] && !v0->pActiveSkills[v41] )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4522 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4523 v42 = pFontArrus->CalcTextHeight(pSkillNames[v41], &dialog_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4524 v152 += v42;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4525 ++v153;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4526 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4527 ++v39;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4528 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4529 while ( (signed int)v39 < v37->pNumPresenceButton + v37->pStartingPosActiveItem );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4530 if ( v153 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4531 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4532 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], _this);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4533 dialog_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4534 _this = (Player *)((149 - v152) / v153);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4535 if ( (149 - v152) / v153 > 32 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4536 _this = (Player *)32;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4537 v43 = (149 - v153 * (signed int)_this - v152) / 2 - (signed int)_this / 2 + 162;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4538 v152 = v37->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4539 v146 = v43;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4540 if ( v152 < v152 + v37->pNumPresenceButton )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4541 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4542 v153 = 2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4543 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4544 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4545 v44 = v37->GetControl(v152);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4546 v45 = v44;
832
dfd683c4f538 Hotkeys fixed
Nomad
parents: 827
diff changeset
4547 v46 = v44->msg_param - 36;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4548 if ( !byte_4ED970_skill_learn_ability_by_class_table[v0->classType][v46] || v0->pActiveSkills[v46] )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4549 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4550 v45->uW = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4551 v45->uHeight = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4552 v45->uY = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4553 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4554 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4555 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4556 v47 = pSkillNames[v46];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4557 v45->uY = (unsigned int)((char *)_this + v146);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4558 Str = v47;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4559 v48 = pFontArrus->CalcTextHeight(v47, &dialog_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4560 v49 = v45->uY;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4561 v50 = v153;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4562 v45->uHeight = v48;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4563 v51 = v49 + v48 - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4564 v45->uW = v51;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4565 v146 = v51;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4566 v52 = hilight_color;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4567 if ( pDialogueWindow->pCurrentPosActiveItem != v50 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4568 v52 = m_text_color;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4569 dialog_window.DrawTitleText(pFontArrus, 0, v49, v52, Str, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4570 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4571 v53 = v37->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4572 ++v152;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4573 textureH = v37->pNumPresenceButton + v53;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4574 ++v153;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4575 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4576 while ( v152 < textureH );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4577 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4578 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4579 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4580 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4581 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], v0->pName, pClassNames[v0->classType]); //"Seek knowledge elsewhere %s the %s"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4582 strcat(pTmpBuf, "\n \n");
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4583 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]); //"I can offer you nothing further."
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4584 v115 = (174 - pFontArrus->CalcTextHeight(pTmpBuf, &dialog_window, 0, 0)) / 2 + 138;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4585 dialog_window.DrawTitleText(pFontArrus, 0, v115, hilight_color, pTmpBuf, 3);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4586 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4587 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4588 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4589 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4590 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4591
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4592
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4593
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4594 //----- (004B5D7C) --------------------------------------------------------
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4595 void GuildDialog()
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4596 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4597 GUIWindow *v0; // ebx@1
874
231523a39203 Buy books(first)
Ritor1
parents: 873
diff changeset
4598 //Player *currPlayer; // edi@1
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4599 signed int base_teach_price; // ebx@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4600 int v3; // edi@6
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4601 int result; // eax@11
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4602 unsigned int v5; // ebx@13
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4603 int v6; // esi@13
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4604 signed int v7; // esi@17
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4605 int v8; // esi@22
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4606 signed int v9; // ecx@22
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4607 char *v10; // eax@22
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4608 const char *statusbar_string; // ecx@26
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4609 POINT *v12; // esi@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4610 int v13; // ecx@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4611 void *v14; // ST1C_4@31
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4612 ItemGen *v15; // ST18_4@31
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4613 int v16; // ST10_4@31
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4614 int v17; // eax@31
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4615 char *v18; // edx@31
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4616 int v19; // eax@32
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4617 GUIWindow *v20; // edi@35
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4618 int v21; // esi@35
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4619 int v22; // eax@35
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4620 unsigned int v23; // eax@36
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4621 int v24; // eax@39
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4622 int v25; // eax@40
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4623 int v26; // ecx@47
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4624 GUIButton *v27; // eax@49
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4625 GUIButton *v28; // esi@49
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4626 unsigned int v29; // eax@49
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4627 char *v30; // eax@52
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4628 int v31; // eax@55
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4629 unsigned int v32; // ecx@55
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4630 int v33; // eax@55
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4631 unsigned __int16 v34; // ax@55
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4632 int v35; // eax@58
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4633 const char *v36; // ST20_4@61
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4634 unsigned __int16 v37; // ST1C_2@61
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4635 int v38; // eax@61
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4636 GUIWindow *v39; // [sp-18h] [bp-304h]@31
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4637 int v40; // [sp-14h] [bp-300h]@31
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4638 int v41; // [sp-10h] [bp-2FCh]@31
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4639 unsigned __int16 v42; // [sp-Ch] [bp-2F8h]@31
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4640 char *v43; // [sp-8h] [bp-2F4h]@31
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4641 unsigned int v44; // [sp-4h] [bp-2F0h]@31
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4642 char Dest[100]; // [sp+Ch] [bp-2E0h]@3
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4643 char v46[100]; // [sp+70h] [bp-27Ch]@3
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4644 char v47[100]; // [sp+D4h] [bp-218h]@3
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4645 char v48[100]; // [sp+138h] [bp-1B4h]@3
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4646 char v49[100]; // [sp+19Ch] [bp-150h]@3
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4647 POINT v50; // [sp+264h] [bp-88h]@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4648 POINT v51; // [sp+26Ch] [bp-80h]@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4649 GUIWindow working_window; // [sp+274h] [bp-78h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4650 signed int v53; // [sp+27Ch] [bp-70h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4651 signed int v54; // [sp+284h] [bp-68h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4652 int v55; // [sp+2C8h] [bp-24h]@47
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4653 int main_text_color; // [sp+2CCh] [bp-20h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4654 int hi_text_color; // [sp+2D0h] [bp-1Ch]@1
874
231523a39203 Buy books(first)
Ritor1
parents: 873
diff changeset
4655 //Player *v58; // [sp+2D4h] [bp-18h]@1
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4656 unsigned __int8 uPlayerID; // [sp+2DBh] [bp-11h]@31
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4657 char *Str; // [sp+2DCh] [bp-10h]@35
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4658 int v61; // [sp+2E0h] [bp-Ch]@35
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4659 unsigned int v62; // [sp+2E4h] [bp-8h]@13
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4660 int v63; // [sp+2E8h] [bp-4h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4661
874
231523a39203 Buy books(first)
Ritor1
parents: 873
diff changeset
4662 v0 = window_SpeakInHouse;//Ritor1: in process
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4663 memcpy(&working_window, window_SpeakInHouse, sizeof(GUIWindow));
874
231523a39203 Buy books(first)
Ritor1
parents: 873
diff changeset
4664 //v58 = pPlayers[uActiveCharacter];
231523a39203 Buy books(first)
Ritor1
parents: 873
diff changeset
4665 //currPlayer = pPlayers[uActiveCharacter];
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4666 working_window.uFrameX = 483;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4667 working_window.uFrameWidth = 148;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4668 working_window.uFrameZ = 334;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4669 main_text_color = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4670 hi_text_color = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4671 //v2 = (signed __int64)(p2DEvents_minus1__20[13 * (unsigned int)v0->ptr_1C] * 500.0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4672 base_teach_price = (signed __int64)(p2DEvents[(unsigned int)v0->ptr_1C - 1].fPriceMultiplier * 500.0);
874
231523a39203 Buy books(first)
Ritor1
parents: 873
diff changeset
4673 v63 = base_teach_price * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4674 if ( v63 < base_teach_price / 3 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4675 v63 = base_teach_price / 3;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4676 strcpy(Dest, "");
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4677 strcpy(v46, "");
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4678 strcpy(v47, "");
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4679 strcpy(v48, "");
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4680 strcpy(v49, "");
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
4681 if ( dialog_menu_id != HOUSE_DIALOGUE_MAIN )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4682 {
874
231523a39203 Buy books(first)
Ritor1
parents: 873
diff changeset
4683 if ( dialog_menu_id != HOUSE_DIALOGUE_GUILD_BUY_BOOKS ) //buy skill
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4684 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4685 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4686 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4687 //v3 = (int)(&currPlayer->uIntelligence + dword_F8B19C); //test skill
874
231523a39203 Buy books(first)
Ritor1
parents: 873
diff changeset
4688 if ( pPlayers[uActiveCharacter]->pActiveSkills[dialog_menu_id-36] )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4689 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4690 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[403], pClassNames[dialog_menu_id - 16]); //"You already know the %s skill"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4691 ShowStatusBarString(pTmpBuf, 2u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4692 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4693 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4694 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4695 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4696 if ( pParty->uNumGold < v63 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4697 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4698 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u); //"You don't have enough gold"
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
4699 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4700 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4701 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4702 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4703 Party::TakeGold(v63);
874
231523a39203 Buy books(first)
Ritor1
parents: 873
diff changeset
4704 pPlayers[uActiveCharacter]->pActiveSkills[dialog_menu_id-36] = 1;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4705 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4706 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4707 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4708 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4709 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4710 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4711 pRenderer->DrawTextureIndexed(8u, 8u, ShopTexture);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4712 v5 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4713 v6 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4714 v62 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4715 v63 = 32;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4716 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4717 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4718 if (pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][v6].uItemID)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4719 // if ( *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v6 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)) )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4720
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4721 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4722 pRenderer->DrawTextureTransparent(v63, 0x5Au, ItemsInShopTexture[v6]);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4723 ZBuffer_DoFill((int *)((char *)pRenderer->pActiveZBuffer + v62 + 230528), ItemsInShopTexture[v6], v6 + 1);
874
231523a39203 Buy books(first)
Ritor1
parents: 873
diff changeset
4724 //currPlayer = v58;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4725 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4726 v63 += 70;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4727 v62 += 280;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4728 ++v6;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4729 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4730 while ( v63 < 452 );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4731
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4732 v62 = 1680;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4733 v7 = 6;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4734 v63 = 32;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4735 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4736 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4737 if (pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][v7].uItemID)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4738 // if ( *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v7 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)) )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4739 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4740 pRenderer->DrawTextureTransparent(v63, 0xFAu, ItemsInShopTexture[v7]);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4741 ZBuffer_DoFill((int *)((char *)pRenderer->pActiveZBuffer + v62 + 638448), ItemsInShopTexture[v7], v7 + 1);
874
231523a39203 Buy books(first)
Ritor1
parents: 873
diff changeset
4742 //currPlayer = v58;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4743 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4744 v63 += 70;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4745 v62 += 280;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4746 ++v7;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4747 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4748 while ( v63 < 452 );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4749
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4750 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4751 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4752 v8 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4753 v9 = 12;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4754 // v10 = (char *)(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 108 * (unsigned int)window_SpeakInHouse->ptr_1C);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4755 // v10 =
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4756 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4757 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4758 if (pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][v9].uItemID )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4759 ++v8;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4760 // v10 += 36;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4761 --v9;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4762 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4763 while ( v9 );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4764
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4765 GetAsyncKeyState(17);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4766 statusbar_string = pGlobalTXT_LocalizationStrings[195]; //"Select the Item to Buy"
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
4767 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4768 statusbar_string = pGlobalTXT_LocalizationStrings[196]; //"Select the Special Item to Buy"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4769 DrawTextAtStatusBar(statusbar_string, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4770 if ( !v8 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4771 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4772 working_window.DrawCurrentTime(
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4773 __PAIR__(
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4774 *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)window_SpeakInHouse->ptr_1C + 44472],
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4775 *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)window_SpeakInHouse->ptr_1C + 44468])
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4776 - pParty->uTimePlayed);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4777 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4778 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4779 v12 = pMouse->GetCursorPos(&v51);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4780 result = v12->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v50)->y];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4781 v13 = pRenderer->pActiveZBuffer[result] & 0xFFFF;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4782 if ( pRenderer->pActiveZBuffer[result] & 0xFFFF )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4783 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4784 v14 = window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4785 v15 = (ItemGen *)(&pParty->pPlayers[1].uExpressionTimeLength + 18 * (v13 + 12 * (int)v14));
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4786 v16 = (int)window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4787 uPlayerID = uActiveCharacter - 1;
874
231523a39203 Buy books(first)
Ritor1
parents: 873
diff changeset
4788 v17 = pPlayers[uActiveCharacter]->_490EEE( (ItemGen *)&pParty->pPlayers[1].uExpressionTimeLength + v13 + 12 * (int)v14, 3, v16, 2);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4789 v18 = BuilDialogueString((char *)pMerchantsBuyPhrases[v17], uPlayerID, v15, (char *)v14, 2, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4790 v19 = pFontArrus->CalcTextHeight(v18, &working_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4791 working_window.DrawTitleText(pFontArrus, 0, (174 - v19) / 2 + 138, main_text_color, v18, 3);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4792 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4793 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4794 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4795 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4796 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4797 if ( !(unsigned __int16)_449B57_test_bit(
874
231523a39203 Buy books(first)
Ritor1
parents: 873
diff changeset
4798 (unsigned __int8 *)pPlayers[uActiveCharacter]->_guilds_member_bits,
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4799 guild_mambership_flags[(unsigned int)window_SpeakInHouse->ptr_1C-139]) )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4800 { //you must me member
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4801 v38 = pFontArrus->CalcTextHeight(pNPCTopics[121].pText, &working_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4802 working_window.DrawTitleText(pFontArrus, 0, (212 - v38) / 2 + 101, hi_text_color, pNPCTopics[121].pText, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4803 pDialogueWindow->pNumPresenceButton = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4804 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4805 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4806
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4807 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4808 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4809 v20 = pDialogueWindow;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4810 v5 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4811 v62 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4812 Str = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4813 v21 = pDialogueWindow->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4814 v22 = v21 + pDialogueWindow->pNumPresenceButton;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4815 v61 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4816 if ( pDialogueWindow->pStartingPosActiveItem >= pDialogueWindow->pStartingPosActiveItem+pDialogueWindow->pNumPresenceButton )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4817 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4818 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], pPlayers[uActiveCharacter]->pName, pClassNames[pPlayers[uActiveCharacter]->classType]); // "Seek knowledge elsewhere %s the %s"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4819 strcat(pTmpBuf, "\n \n");
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4820 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]); //"I can offer you nothing further."
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4821 v19 = pFontArrus->CalcTextHeight(pTmpBuf, &working_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4822 working_window.DrawTitleText(pFontArrus, v5, (174 - v19) / 2 + 138, hi_text_color, pTmpBuf, 3);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4823 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4824 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4825 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4826 {
832
dfd683c4f538 Hotkeys fixed
Nomad
parents: 827
diff changeset
4827 v23 = v20->GetControl(v21)->msg_param;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4828 if ( v23 == 18 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4829 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4830 v25 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[400], &working_window, 0, 0); //"Buy Spells"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4831 v62 += v25;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4832 ++v61;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4833 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4834 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4835 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4836
874
231523a39203 Buy books(first)
Ritor1
parents: 873
diff changeset
4837 if((byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][v23-36])&&(pPlayers[uActiveCharacter]->pActiveSkills[v23-36]))
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4838 // or
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4839 //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass - 1][v23 + 1]
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4840 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4841 v24 = pFontArrus->CalcTextHeight(pClassNames[v23 - 16], &working_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4842 v62 += v24;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4843 ++v61;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4844 ++Str;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4845 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4846 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4847 ++v21;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4848 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4849 while ( v21 < v20->pNumPresenceButton + v20->pStartingPosActiveItem );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4850 if ( !v61 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4851 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4852 LABEL_64:
874
231523a39203 Buy books(first)
Ritor1
parents: 873
diff changeset
4853 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], pPlayers[uActiveCharacter]->pName, pClassNames[pPlayers[uActiveCharacter]->classType]); // "Seek knowledge elsewhere %s the %s"
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4854 strcat(pTmpBuf, "\n \n");
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4855 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]); //"I can offer you nothing further."
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4856 v19 = pFontArrus->CalcTextHeight(pTmpBuf, &working_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4857 working_window.DrawTitleText(pFontArrus, v5, (174 - v19) / 2 + 138, hi_text_color, pTmpBuf, 3);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4858 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4859 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4860 if ( Str )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4861 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4862 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], v63); //"Skill Cost: %lu"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4863 working_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4864 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4865 v63 = (signed int)(149 - v62) / v61;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4866 if ( v63 > 32 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4867 v63 = 32;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4868 v26 = (signed int)(149 - v61 * v63 - v62) / 2 - v63 / 2 + 162;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4869 v62 = v20->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4870 v55 = v26;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4871 if (v20->pStartingPosActiveItem < v20->pStartingPosActiveItem + v20->pNumPresenceButton )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4872 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4873 v61 = 2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4874 while ( 1 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4875 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4876 v27 = v20->GetControl(v62);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4877 v28 = v27;
832
dfd683c4f538 Hotkeys fixed
Nomad
parents: 827
diff changeset
4878 v29 = v27->msg_param;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4879 if ( v29 == 18 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4880 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4881
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4882 // __debugbreak();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4883 //pSkillAvailabilityPerClass[8 + v58->uClass][4 + v23]
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4884 // or
874
231523a39203 Buy books(first)
Ritor1
parents: 873
diff changeset
4885 if ((byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][v29 - 36])&&(pPlayers[uActiveCharacter]->pActiveSkills[v29-36]))
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4886 // or
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4887 //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass - 1][v23 + 1]
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4888
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4889 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4890 v30 = pClassNames[v29 -16];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4891 LABEL_55:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4892 Str = v30;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4893 v28->uY = v63 + v55;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4894 v31 = pFontArrus->CalcTextHeight(v30, &working_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4895 v32 = v28->uY;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4896 v28->uHeight = v31;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4897 v33 = v32 + v31 - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4898 v28->uW = v33;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4899 v55 = v33;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4900 v34 = hi_text_color;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4901 if ( pDialogueWindow->pCurrentPosActiveItem != v61 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4902 v34 = main_text_color;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4903 working_window.DrawTitleText(pFontArrus, 0, v32, v34, Str, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4904 v35 = v20->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4905 ++v62;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4906 ++v61;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4907 if ( (signed int)v62 >=v20->pNumPresenceButton +v20->pStartingPosActiveItem )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4908 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4909 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4910 v28->uW = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4911 v28->uHeight = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4912 v28->uY = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4913 LABEL_58:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4914 v35 = v20->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4915 ++v62;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4916 ++v61;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4917 if ( (signed int)v62 >=v20->pNumPresenceButton +v20->pStartingPosActiveItem )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4918 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4919 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4920 v30 = pGlobalTXT_LocalizationStrings[400]; //"Buy Spells"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4921 goto LABEL_55;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4922 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4923 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4924 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4925
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4926
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4927
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4928 //----- (004B705E) --------------------------------------------------------
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4929 void TempleDialog()
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4930 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4931 GUIWindow *v0; // ebx@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4932 Player *v1; // esi@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4933 int v2; // edi@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4934 int result; // eax@4
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4935 GUIWindow *v4; // edi@6
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4936 void *v5; // eax@6
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4937 int v6; // eax@6
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4938 unsigned int v7; // eax@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4939 int v8; // ecx@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4940 unsigned int v9; // eax@9
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4941 int v10; // eax@11
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4942 int v11; // eax@12
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4943 GUIWindow *v12; // ecx@16
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4944 int v13; // edx@16
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4945 GUIButton *v14; // eax@19
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4946 GUIButton *v15; // edi@19
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4947 int v16; // eax@19
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4948 const char *v17; // eax@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4949 int v18; // eax@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4950 unsigned int v19; // ecx@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4951 int v20; // eax@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4952 unsigned __int16 v21; // ax@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4953 unsigned __int16 v22; // ST14_2@27
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4954 int v23; // eax@27
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4955 double v24; // st7@28
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4956 unsigned int v25; // ebx@28
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4957 DDM_DLV_Header *v26; // edi@29
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4958 int v27; // eax@31
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4959 int v28; // eax@32
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4960 //unsigned int v29; // ecx@34
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4961 unsigned int v30; // edx@36
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4962 unsigned int v31; // edx@38
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4963 unsigned int v32; // edx@40
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4964 unsigned int v33; // edx@42
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4965 unsigned int v34; // edx@44
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4966 int v35; // edi@50
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4967 signed int v36; // eax@50
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4968 unsigned __int8 v37; // al@54
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4969 int v38; // ecx@54
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4970 GUIWindow *v39; // eax@56
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4971 unsigned __int8 v40; // al@61
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4972 GUIButton *v41; // edi@64
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4973 int v42; // esi@66
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4974 GUIWindow *v43; // ecx@66
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4975 int v44; // edi@66
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4976 int v45; // eax@68
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4977 signed int v46; // edi@69
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4978 int v47; // edi@71
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4979 GUIButton *v48; // eax@73
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4980 const char *v49; // edx@73
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4981 GUIButton *v50; // esi@73
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4982 int v51; // eax@73
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4983 unsigned int v52; // ecx@73
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4984 unsigned __int16 v53; // ax@73
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4985 char a1[300]; // [sp+10h] [bp-1B4h]@64
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4986 GUIWindow v57; // [sp+13Ch] [bp-88h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4987 __int64 v58; // [sp+190h] [bp-34h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4988 __int64 v59; // [sp+198h] [bp-2Ch]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4989 __int64 v60; // [sp+1A0h] [bp-24h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4990 GUIWindow *v61; // [sp+1ACh] [bp-18h]@6
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4991 unsigned int v62; // [sp+1B0h] [bp-14h]@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4992 unsigned __int8 v63; // [sp+1B7h] [bp-Dh]@64
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4993 int v64; // [sp+1B8h] [bp-Ch]@6
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4994 unsigned int v65; // [sp+1BCh] [bp-8h]@6
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4995 DDM_DLV_Header *v66; // [sp+1C0h] [bp-4h]@6
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4996
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4997 v0 = window_SpeakInHouse;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4998 memcpy(&v57, window_SpeakInHouse, sizeof(v57));
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4999 v57.uFrameX = 483;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5000 v57.uFrameWidth = 148;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5001 v57.uFrameZ = 334;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5002 HIDWORD(v58) = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5003 HIDWORD(v59) = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5004 v1 = pPlayers[uActiveCharacter];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5005 //v2 = pPlayers[uActiveCharacter]->_4B807C(p2DEvents_minus1__20[13 * (unsigned int)v0->ptr_1C]);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5006 v2 = pPlayers[uActiveCharacter]->_4B807C(p2DEvents[(unsigned int)v0->ptr_1C - 1].fPriceMultiplier);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5007 HIDWORD(v60) = v2;
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
5008 if ( dialog_menu_id != HOUSE_DIALOGUE_MAIN )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5009 {
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
5010 if ( dialog_menu_id != HOUSE_DIALOGUE_TEMPLE_HEAL )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5011 {
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
5012 if ( dialog_menu_id != HOUSE_DIALOGUE_TEMPLE_DONATE )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5013 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5014
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
5015 if ( dialog_menu_id == HOUSE_DIALOGUE_LEARN_SKILLS )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5016 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5017 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5018 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5019 v4 = pDialogueWindow;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5020 v61 = pDialogueWindow;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5021 v5 = window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5022 v66 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5023 //v65 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (signed int)v5] * 500.0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5024 v65 = (signed __int64)(p2DEvents[(signed int)v5 - 1].flt_24 * 500.0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5025 v6 = v1->GetMerchant();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5026 v64 = (signed int)(v65 * (100 - v6)) / 100;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5027 if ( v64 < (signed int)v65 / 3 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5028 v64 = (signed int)v65 / 3;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5029 v7 = v4->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5030 v8 = v7 + v4->pNumPresenceButton;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5031 v65 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5032 v62 = v7;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5033 if ( (signed int)v7 >= v8 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5034 goto LABEL_78;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5035 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5036 {
832
dfd683c4f538 Hotkeys fixed
Nomad
parents: 827
diff changeset
5037 v9 = v4->GetControl(v62)->msg_param - 36;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5038 if ( byte_4ED970_skill_learn_ability_by_class_table[v1->classType][v9] && !v1->pActiveSkills[v9] )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5039 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5040 v10 = pFontArrus->CalcTextHeight(pSkillNames[v9], &v57, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5041 v66 = (DDM_DLV_Header *)((char *)v66 + v10);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5042 ++v65;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5043 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5044 v11 = v4->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5045 ++v62;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5046 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5047 while ( (signed int)v62 < v4->pNumPresenceButton + v11 );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5048 if ( v65 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5049 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5050 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], v64);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5051 v57.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5052 v64 = (149 - (signed int)v66) / (signed int)v65;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5053 if ( v64 > 32 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5054 v64 = 32;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5055 v65 = (signed int)(149 - v65 * v64 - (int)v66) / 2 - v64 / 2 + 162;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5056 v12 = v61;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5057 result = v61->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5058 v13 = result + v61->pNumPresenceButton;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5059 v62 = v61->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5060 if ( result < v13 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5061 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5062 v66 = (DDM_DLV_Header *)2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5063 while ( 1 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5064 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5065 v14 = v12->GetControl(v62);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5066 v15 = v14;
832
dfd683c4f538 Hotkeys fixed
Nomad
parents: 827
diff changeset
5067 v16 = v14->msg_param - 36;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5068 if ( !byte_4ED970_skill_learn_ability_by_class_table[v1->classType][v16] || v1->pActiveSkills[v16] )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5069 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5070 v15->uW = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5071 v15->uHeight = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5072 v15->uY = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5073 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5074 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5075 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5076 v17 = pSkillNames[v16];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5077 v15->uY = v64 + v65;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5078 HIDWORD(v60) = (uint32)v17;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5079 v18 = pFontArrus->CalcTextHeight(v17, &v57, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5080 v19 = v15->uY;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5081 v15->uHeight = v18;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5082 v20 = v19 + v18 - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5083 v15->uW = v20;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5084 v65 = v20;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5085 v21 = WORD2(v59);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5086 if ( (DDM_DLV_Header *)pDialogueWindow->pCurrentPosActiveItem != v66 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5087 v21 = WORD2(v58);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5088 v57.DrawTitleText(pFontArrus, 0, v19, v21, (const char *)HIDWORD(v60), 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5089 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5090 result = (int)v61;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5091 ++v62;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5092 v66 = (DDM_DLV_Header *)((char *)v66 + 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5093 if ( (signed int)v62 >= v61->pNumPresenceButton + v61->pStartingPosActiveItem )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5094 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5095 v12 = v61;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5096 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5097 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5098 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5099 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5100 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5101 LABEL_78:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5102 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], v1->pName, pClassNames[v1->classType]);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5103 strcat(pTmpBuf, "\n \n");
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5104 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5105 v22 = WORD2(v59);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5106 v23 = pFontArrus->CalcTextHeight(pTmpBuf, &v57, 0, 0);
762
cf2fbac6edc9 Misc cleaning
Nomad
parents: 759
diff changeset
5107 v57.DrawTitleText(pFontArrus, 0, (174 - v23) / 2 + 138, v22, pTmpBuf, 3u);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5108 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5109 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5110 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5111 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5112 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5113
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5114 // DONATION
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5115 //v24 = p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5116 v24 = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5117 v25 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5118 if ( pParty->uNumGold >= (unsigned int)(signed __int64)v24 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5119 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5120 Party::TakeGold((signed __int64)v24);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5121 v26 = &pOutdoor->ddm;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5122 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5123 v26 = &pIndoor->dlv;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5124 v27 = v26->uReputation;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5125 v66 = v26;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5126 if ( v27 > -5 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5127 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5128 v28 = v27 - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5129 v26->uReputation = v28;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5130 if ( v28 < -5 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5131 v26->uReputation = -5;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5132 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5133 if ( (unsigned __int8)byte_F8B1EF[uActiveCharacter] == pParty->uDaysPlayed % 7 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5134 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5135 if ( v26->uReputation <= -5 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5136 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5137 v30 = pParty->uDaysPlayed % 7 + 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5138 LOBYTE(v30) = v30 | 0x80;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5139 _42777D_CastSpell_UseWand_ShootArrow(SPELL_AIR_WIZARD_EYE, uActiveCharacter - 1, v30, 48, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5140 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5141 if ( v26->uReputation <= -10 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5142 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5143 v31 = pParty->uDaysPlayed % 7 + 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5144 LOBYTE(v31) = v31 | 0x80;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5145 _42777D_CastSpell_UseWand_ShootArrow(SPELL_SPIRIT_PRESERVATION, uActiveCharacter - 1, v31, 48, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5146 v26 = v66;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5147 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5148 if ( v26->uReputation <= -15 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5149 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5150 v32 = pParty->uDaysPlayed % 7 + 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5151 LOBYTE(v32) = v32 | 0x80;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5152 _42777D_CastSpell_UseWand_ShootArrow(SPELL_BODY_PROTECTION_FROM_MAGIC, uActiveCharacter - 1, v32, 48, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5153 v26 = v66;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5154 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5155 if ( v26->uReputation <= -20 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5156 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5157 v33 = pParty->uDaysPlayed % 7 + 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5158 LOBYTE(v33) = v33 | 0x80;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5159 _42777D_CastSpell_UseWand_ShootArrow(SPELL_LIGHT_HOUR_OF_POWER, uActiveCharacter - 1, v33, 48, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5160 v26 = v66;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5161 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5162 if ( v26->uReputation <= -25 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5163 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5164 v34 = pParty->uDaysPlayed % 7 + 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5165 LOBYTE(v34) = v34 | 0x80;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5166 _42777D_CastSpell_UseWand_ShootArrow(SPELL_LIGHT_DAY_OF_PROTECTION, uActiveCharacter - 1, v34, 48, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5167 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5168 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5169 ++byte_F8B1EF[uActiveCharacter];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5170 v1->PlaySound(SPEECH_83, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5171 ShowStatusBarString(pGlobalTXT_LocalizationStrings[527], 2u); // "Thank You!"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5172 goto LABEL_46;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5173 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5174 goto LABEL_55;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5175 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5176 if ( !v1->_4B6FF9() )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5177 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5178 v25 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5179 if ( pParty->uNumGold < v2 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5180 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5181 LABEL_55:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5182 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5183 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5184 goto LABEL_46;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5185 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5186 Party::TakeGold(v2);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5187 v35 = LODWORD(v1->pConditions[17]);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5188 v59 = v1->pConditions[14];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5189 v58 = v1->pConditions[15];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5190 v60 = v1->pConditions[16];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5191 v61 = (GUIWindow *)HIDWORD(v1->pConditions[17]);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5192 memset(v1, 0, 0xA0u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5193 v1->sHealth = v1->GetMaxHealth();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5194 v1->sMana = v1->GetMaxMana();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5195 v36 = (signed int)window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5196 if ( v36 != 78 && (v36 <= 80 || v36 > 82) )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5197 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5198 if ( (unsigned int)v61 | v35 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5199 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5200 v37 = LOBYTE(v1->field_1928);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5201 v38 = v1->field_1924;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5202 v1->uFace = v37;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5203 v1->uVoiceID = v38;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5204 ReloadPlayerPortraits(uActiveCharacter - 1, (char)v37);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5205 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5206 goto LABEL_63;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5207 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5208 v39 = v61;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5209 if ( (unsigned int)v61 | v35 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5210 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5211 LODWORD(v1->pConditions[17]) = v35;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5212 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5213 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5214 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5215 if ( !v60 && !v58 && !v59 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5216 goto LABEL_63;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5217 v1->field_1928 = v1->uFace;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5218 v1->field_1924 = v1->uVoiceID;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5219 v1->SetCondition(0x11u, 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5220 v1->uVoiceID = (v1->GetSexByVoice() != 0) + 23;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5221 v40 = (v1->GetSexByVoice() != 0) + 23;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5222 v1->uFace = v40;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5223 ReloadPlayerPortraits(uActiveCharacter - 1, (char)v40);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5224 LODWORD(v1->pConditions[17]) = LODWORD(pParty->uTimePlayed);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5225 v39 = (GUIWindow *)HIDWORD(pParty->uTimePlayed);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5226 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5227 HIDWORD(v1->pConditions[17]) = (int)v39;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5228 LABEL_63:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5229 pAudioPlayer->PlaySound((SoundID)(SOUND_GoldReceived|0x2), -1, 0, -1, 0, 0, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5230 v1->PlaySound(SPEECH_82, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5231 pOtherOverlayList->_4418B1(20, uActiveCharacter + 99, 0, 65536);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5232 LABEL_46:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5233 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, v25);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5234 return ; // void func
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5235 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5236 v63 = 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5237 v41 = pDialogueWindow->GetControl(pDialogueWindow->pStartingPosActiveItem);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5238 strcpy(a1, "");
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5239 v41->uHeight = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5240 v41->uY = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5241 if ( v1->_4B6FF9() )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5242 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5243 sprintf(a1, "%s %d %s", pGlobalTXT_LocalizationStrings[104], HIDWORD(v60), pGlobalTXT_LocalizationStrings[97]);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5244 v63 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5245 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5246 strcpy(&a1[100], pGlobalTXT_LocalizationStrings[68]);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5247 strcpy(&a1[200], pGlobalTXT_LocalizationStrings[160]);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5248 v42 = v63;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5249 v43 = pDialogueWindow;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5250 v44 = v63;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5251 v66 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5252 if ( v63 < pDialogueWindow->pNumPresenceButton )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5253 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5254 v61 = (GUIWindow *)&a1[100 * v63];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5255 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5256 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5257 v45 = pFontArrus->CalcTextHeight((const char *)v61, &v57, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5258 v66 = (DDM_DLV_Header *)((char *)v66 + v45);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5259 v43 = pDialogueWindow;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5260 v61 = (GUIWindow *)((char *)v61 + 100);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5261 ++v44;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5262 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5263 while ( v44 < pDialogueWindow->pNumPresenceButton );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5264 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5265 v46 = v43->pNumPresenceButton - v42;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5266 v64 = (174 - (signed int)v66) / v46;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5267 if ( v64 > 32 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5268 v64 = 32;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5269 v47 = (174 - v64 * v46 - (signed int)v66) / 2 - v64 / 2 + 138;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5270 v65 = v42 + v43->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5271 if ( v42 + v43->pStartingPosActiveItem < v43->pStartingPosActiveItem + v43->pNumPresenceButton )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5272 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5273 v61 = (GUIWindow *)(v42 + 2);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5274 v66 = (DDM_DLV_Header *)&a1[100 * v42];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5275 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5276 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5277 v48 = v43->GetControl(v65);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5278 v49 = (const char *)v66;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5279 v50 = v48;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5280 v48->uY = v64 + v47;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5281 v51 = pFontArrus->CalcTextHeight(v49, &v57, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5282 v52 = v50->uY;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5283 v50->uHeight = v51;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5284 v47 = v52 + v51 - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5285 v50->uW = v47;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5286 v53 = WORD2(v59);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5287 if ( (GUIWindow *)pDialogueWindow->pCurrentPosActiveItem != v61 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5288 v53 = WORD2(v58);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5289 v57.DrawTitleText(pFontArrus, 0, v52, v53, (const char *)v66, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5290 v43 = pDialogueWindow;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5291 v66 = (DDM_DLV_Header *)((char *)v66 + 100);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5292 v61 = (GUIWindow *)((char *)v61 + 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5293 ++v65;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5294 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5295 while ( (signed int)v65 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5296 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5297 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5298 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5299
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5300 //----- (004B4710) --------------------------------------------------------
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5301 void TrainingDialog()
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5302 {
717
Ritor1
parents: 690
diff changeset
5303 //Player *v0; // ebx@1
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5304 int color2; // eax@1
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5305 //unsigned int v2; // ecx@1
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5306 //int v3; // eax@1
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5307 //signed int v4; // edx@1
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5308 unsigned __int64 v5; // edi@3
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5309 //unsigned int v6; // esi@3
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5310 //void *v7; // ecx@3
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5311 int v8; // edx@4
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5312 double v9; // st7@6
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5313 signed int v10; // esi@6
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5314 int v11; // ecx@6
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5315 //int result; // eax@9
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5316 GUIWindow *v13; // edi@14
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5317 signed int v14; // esi@14
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5318 unsigned int v15; // esi@16
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5319 int v16; // eax@16
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5320 unsigned int v17; // eax@17
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5321 int v18; // eax@19
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5322 int v19; // ecx@24
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5323 GUIButton *v20; // eax@26
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5324 GUIButton *v21; // esi@26
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5325 int v22; // eax@26
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5326 const char *v23; // eax@28
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5327 int v24; // eax@28
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5328 unsigned int v25; // ecx@28
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5329 int v26; // eax@28
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5330 unsigned __int16 v27; // ax@28
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5331 //int v28; // eax@32
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5332 unsigned __int16 v29; // ST14_2@34
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5333 int v30; // eax@34
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5334 //const char *v31; // ST18_4@36
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5335 //unsigned __int16 v32; // ST14_2@36
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5336 int v33; // eax@36
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5337 int v34; // eax@37
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5338 unsigned int v35; // edi@38
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5339 unsigned int v36; // eax@38
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5340 //int v37; // ecx@41
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5341 //char *v38; // eax@41
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5342 //int *v39; // eax@45
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5343 unsigned int v40; // eax@46
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5344 //void *v41; // ecx@46
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5345 unsigned int v42; // eax@46
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5346 GUIWindow *v43; // ecx@59
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5347 int v44; // edx@59
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5348 char **v45; // esi@60
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5349 //int v46; // eax@62
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5350 int v47; // eax@68
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5351 //int v48; // edx@69
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5352 int v49; // ebx@69
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5353 //unsigned __int8 v50; // sf@69
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5354 char **v51; // edi@70
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5355 GUIButton *v52; // eax@71
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5356 GUIButton *v53; // esi@71
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5357 int v54; // eax@71
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5358 unsigned int v55; // ecx@71
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5359 int v56; // eax@71
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5360 unsigned __int16 v57; // ax@71
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5361 unsigned __int16 v58; // [sp-Ch] [bp-90h]@38
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5362 //const char *v59; // [sp-Ch] [bp-90h]@63
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5363 char *v60; // [sp-8h] [bp-8Ch]@38
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5364 //char *v61; // [sp-8h] [bp-8Ch]@63
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5365 unsigned int v62; // [sp-4h] [bp-88h]@38
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5366 int v63; // [sp-4h] [bp-88h]@52
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5367 //char *v64; // [sp-4h] [bp-88h]@63
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5368 GUIWindow v65; // [sp+Ch] [bp-78h]@1
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5369 //__int64 v66; // [sp+60h] [bp-24h]@3
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5370 unsigned int white; // [sp+68h] [bp-1Ch]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5371 int v68; // [sp+6Ch] [bp-18h]@3
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5372 int v69; // [sp+70h] [bp-14h]@6
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5373 //unsigned int i; // [sp+74h] [bp-10h]@1
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5374 //int v71; // [sp+78h] [bp-Ch]@1
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5375 int v72; // [sp+7Ch] [bp-8h]@16
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5376 int v73; // [sp+80h] [bp-4h]@14
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5377
717
Ritor1
parents: 690
diff changeset
5378 //v0 = pPlayers[uActiveCharacter];
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5379 memcpy(&v65, window_SpeakInHouse, sizeof(v65));
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5380 v65.uFrameX = 483;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5381 v65.uFrameWidth = 148;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5382 v65.uFrameZ = 334;
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5383 white = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(255, 255, 255);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5384 color2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5385 //v71 = color2;
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5386 //v2 = v0->uLevel;
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5387 //v3 = 0;
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5388 //v4 = 0;
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5389 //for ( i = v2; v4 < (signed int)v2; ++v4 )
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5390 // v3 += v4 + 1;
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5391 //v5 = 1000 * v3;
717
Ritor1
parents: 690
diff changeset
5392 v5 = 1000ui64 * pPlayers[uActiveCharacter]->uLevel * (pPlayers[uActiveCharacter]->uLevel + 1) / 2; // E n = n(n + 1) / 2
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5393 //v6 = HIDWORD(v0->uExperience);
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5394 //v7 = window_SpeakInHouse->ptr_1C;
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5395 v68 = pMaxLevelPerTrainingHallType[(unsigned int)window_SpeakInHouse->ptr_1C - HOUSE_TRAINING_HALL_EMERALD_ISLE];
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5396 //v66 = 1000 * v3;
717
Ritor1
parents: 690
diff changeset
5397 if (pPlayers[uActiveCharacter]->uExperience >= v5)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5398 {
717
Ritor1
parents: 690
diff changeset
5399 v8 = pPlayers[uActiveCharacter]->classType % 4 + 1;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5400 if ( v8 == 4 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5401 v8 = 3;
717
Ritor1
parents: 690
diff changeset
5402 v9 = (double)pPlayers[uActiveCharacter]->uLevel;
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5403 //i = 0;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5404 v69 = v8;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5405 //v10 = (signed __int64)(v9 * p2DEvents_minus1__20[13 * (signed int)v7] * (double)v8);
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5406 v10 = (signed __int64)(v9 * p2DEvents[(signed int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier * (double)v8);
717
Ritor1
parents: 690
diff changeset
5407 v11 = v10 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5408 if ( v11 < v10 / 3 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5409 v11 = v10 / 3;
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5410 //i = v11;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5411 }
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5412
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5413 if (sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win())
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5414 {
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
5415 if ( dialog_menu_id != HOUSE_DIALOGUE_MAIN )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5416 {
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5417 if ( dialog_menu_id != HOUSE_DIALOGUE_TRAININGHALL_TRAIN )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5418 {
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
5419 if ( dialog_menu_id == HOUSE_DIALOGUE_LEARN_SKILLS )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5420 {
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5421 if (sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win())
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5422 {
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5423 //i = 0;
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5424 int _v0 = 0;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5425 v13 = pDialogueWindow;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5426 //v14 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)ptr_507BC0->ptr_1C] * 500.0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5427 v14 = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0);
717
Ritor1
parents: 690
diff changeset
5428 v73 = v14 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5429 if ( v73 < v14 / 3 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5430 v73 = v14 / 3;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5431 v15 = v13->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5432 v16 = v13->pNumPresenceButton;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5433 v72 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5434 if ( (signed int)v15 >= (signed int)(v15 + v16) )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5435 goto LABEL_76;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5436 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5437 {
832
dfd683c4f538 Hotkeys fixed
Nomad
parents: 827
diff changeset
5438 v17 = v13->GetControl(v15)->msg_param - 36;
717
Ritor1
parents: 690
diff changeset
5439 if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][v17] && !pPlayers[uActiveCharacter]->pActiveSkills[v17] )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5440 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5441 v18 = pFontArrus->CalcTextHeight(pSkillNames[v17], &v65, 0, 0);
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5442 _v0 += v18;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5443 ++v72;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5444 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5445 ++v15;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5446 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5447 while ( (signed int)v15 < v13->pNumPresenceButton + v13->pStartingPosActiveItem );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5448 if ( v72 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5449 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5450 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], v73);// "Skill Cost: %lu"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5451 v65.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u);
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5452 v73 = (signed int)(149 - _v0) / v72;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5453 if ( v73 > 32 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5454 v73 = 32;
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5455 //result = v13->pStartingPosActiveItem;
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5456 v19 = (signed int)(149 - v72 * v73 - _v0) / 2 - v73 / 2 + 162;
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5457 int _v1 = v13->pStartingPosActiveItem;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5458 v68 = v19;
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5459 if (v13->pStartingPosActiveItem < v13->pStartingPosActiveItem + v13->pNumPresenceButton )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5460 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5461 v72 = 2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5462 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5463 {
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5464 v20 = v13->GetControl(_v1);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5465 v21 = v20;
832
dfd683c4f538 Hotkeys fixed
Nomad
parents: 827
diff changeset
5466 v22 = v20->msg_param - 36;
717
Ritor1
parents: 690
diff changeset
5467 if ( !byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][v22] || pPlayers[uActiveCharacter]->pActiveSkills[v22] )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5468 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5469 v21->uW = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5470 v21->uHeight = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5471 v21->uY = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5472 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5473 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5474 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5475 v23 = pSkillNames[v22];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5476 v21->uY = v73 + v68;
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5477 //HIDWORD(v66) = (int)v23;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5478 v24 = pFontArrus->CalcTextHeight(v23, &v65, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5479 v25 = v21->uY;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5480 v21->uHeight = v24;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5481 v26 = v25 + v24 - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5482 v21->uW = v26;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5483 v68 = v26;
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5484 v27 = color2;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5485 if ( pDialogueWindow->pCurrentPosActiveItem != v72 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5486 v27 = white;
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5487 v65.DrawTitleText(pFontArrus, 0, v25, v27, v23, 3u);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5488 }
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5489 ++_v1;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5490 ++v72;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5491 }
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5492 while ( (signed int)_v1 < v13->pStartingPosActiveItem + v13->pNumPresenceButton );
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5493 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5494 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5495 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5496 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5497 LABEL_76:
717
Ritor1
parents: 690
diff changeset
5498 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], pPlayers[uActiveCharacter]->pName, pClassNames[pPlayers[uActiveCharacter]->classType]);//
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5499 // "Seek knowledge elsewhere %s the %s"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5500 strcat(pTmpBuf, "\n \n");
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5501 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);// "I can offer you nothing further."
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5502 v29 = color2;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5503 v30 = pFontArrus->CalcTextHeight(pTmpBuf, &v65, 0, 0);
762
cf2fbac6edc9 Misc cleaning
Nomad
parents: 759
diff changeset
5504 v65.DrawTitleText(pFontArrus, 0, (174 - v30) / 2 + 138, v29, pTmpBuf, 3u);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5505 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5506 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5507 }
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5508 return;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5509 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5510 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5511 {
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5512 //v31 = pNPCTopics[122].pText;
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5513 //v32 = color2;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5514 v33 = pFontArrus->CalcTextHeight(pNPCTopics[122].pText, &v65, 0, 0);
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5515 v65.DrawTitleText(pFontArrus, 0, (212 - v33) / 2 + 101, color2, pNPCTopics[122].pText, 3);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5516 pDialogueWindow->pNumPresenceButton = 0;
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5517 return;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5518 }
717
Ritor1
parents: 690
diff changeset
5519 v34 = pPlayers[uActiveCharacter]->uLevel;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5520 if ( v34 < v68 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5521 {
717
Ritor1
parents: 690
diff changeset
5522 if ( (signed __int64)pPlayers[uActiveCharacter]->uExperience >= v5 )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5523 {
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5524 if ( pParty->uNumGold >= v11)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5525 {
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5526 Party::TakeGold(v11);
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5527 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
717
Ritor1
parents: 690
diff changeset
5528 ++pPlayers[uActiveCharacter]->uLevel;
Ritor1
parents: 690
diff changeset
5529 pPlayers[uActiveCharacter]->uSkillPoints += pPlayers[uActiveCharacter]->uLevel / 10 + 5;
Ritor1
parents: 690
diff changeset
5530 pPlayers[uActiveCharacter]->sHealth = pPlayers[uActiveCharacter]->GetMaxHealth();
Ritor1
parents: 690
diff changeset
5531 pPlayers[uActiveCharacter]->sMana = pPlayers[uActiveCharacter]->GetMaxMana();
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5532
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5533 uint max_level_in_party = player_levels[0];
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5534 for (uint _it = 1; _it < 4; ++_it)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5535 {
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5536 if (player_levels[_it] > max_level_in_party)
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5537 max_level_in_party = player_levels[_it];
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5538 }
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5539
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5540 ++player_levels[uActiveCharacter - 1];
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5541 if (player_levels[uActiveCharacter - 1] > max_level_in_party) // if we reach new maximum party level
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5542 // feature is broken thou, since this array is always zeroed in EnterHouse
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5543 {
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5544 v40 = _494820_training_time(pParty->uCurrentHour);
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5545 //v41 = window_SpeakInHouse->ptr_1C;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5546 v42 = 60 * (v40 + 4) - pParty->uCurrentMinute;
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5547 if ((unsigned int)window_SpeakInHouse->ptr_1C == HOUSE_TRAINING_HALL_94 ||
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5548 (unsigned int)window_SpeakInHouse->ptr_1C == HOUSE_TRAINING_HALL_95)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5549 v42 += 720;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5550 RestAndHeal((signed int)(v42 + 10080));
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5551 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5552 pOutdoor->SetFog();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5553 }
717
Ritor1
parents: 690
diff changeset
5554 pPlayers[uActiveCharacter]->PlaySound(SPEECH_87, 0);
Ritor1
parents: 690
diff changeset
5555 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[430], pPlayers[uActiveCharacter]->pName, pPlayers[uActiveCharacter]->uLevel, pPlayers[uActiveCharacter]->uLevel / 10 + 5);//
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5556 // "%s is now Level %lu and has earned %lu Skill Points!"
717
Ritor1
parents: 690
diff changeset
5557 ShowStatusBarString(pTmpBuf, 2);
Ritor1
parents: 690
diff changeset
5558 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5559 return;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5560 }
717
Ritor1
parents: 690
diff changeset
5561 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2);// "You don't have enough gold"
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5562 v63 = 4;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5563 LABEL_55:
735
6daaa2f18d0d Fixed some house sounds & shop-related stuff
Nomad
parents: 728
diff changeset
5564 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, (HouseSoundID)v63);
717
Ritor1
parents: 690
diff changeset
5565 //LABEL_56:
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5566 /*result = pMessageQueue_50CBD0->uNumMessages;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5567 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5568 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5569 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5570 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5571 result = 3 * pMessageQueue_50CBD0->uNumMessages + 3;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5572 *(&pMessageQueue_50CBD0->uNumMessages + result) = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5573 ++pMessageQueue_50CBD0->uNumMessages;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5574 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5575 return result;*/
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5576 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5577 return;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5578 }
717
Ritor1
parents: 690
diff changeset
5579 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[538], (unsigned int)(v5 - pPlayers[uActiveCharacter]->uExperience), v34 + 1);//
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5580 // "You need %d more experience to train to level %d"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5581 v35 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5582 v62 = 3;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5583 v60 = pTmpBuf;
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5584 v58 = color2;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5585 v36 = (212 - pFontArrus->CalcTextHeight(pTmpBuf, &v65, 0, 0)) / 2 + 88;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5586 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5587 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5588 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5589 sprintf(pTmpBuf, "%s\n \n%s", pGlobalTXT_LocalizationStrings[536], pGlobalTXT_LocalizationStrings[529]);//
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5590 // ""With your skills, you should be working here as a teacher.""
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5591 // ""Sorry, but we are unable to train you.""
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5592 v35 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5593 v62 = 3;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5594 v60 = pTmpBuf;
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5595 v58 = color2;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5596 v36 = (212 - pFontArrus->CalcTextHeight(pTmpBuf, &v65, 0, 0)) / 2 + 101;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5597 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5598 v65.DrawTitleText(pFontArrus, v35, v36, v58, v60, v62);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5599 v63 = 3;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5600 goto LABEL_55;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5601 }
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5602
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5603 if (sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win())
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5604 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5605 v43 = pDialogueWindow;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5606 v72 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5607 pShopOptions[0] = pTmpBuf;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5608 pShopOptions[1] = pGlobalTXT_LocalizationStrings[160];// "Learn Skills"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5609 v44 = pDialogueWindow->pNumPresenceButton;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5610 v73 = pDialogueWindow->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5611 if ( v73 < v73 + v44 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5612 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5613 v45 = pShopOptions;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5614 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5615 {
832
dfd683c4f538 Hotkeys fixed
Nomad
parents: 827
diff changeset
5616 if ( v43->GetControl(v73)->msg_param == HOUSE_DIALOGUE_TRAININGHALL_TRAIN )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5617 {
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5618 //v46 = pPlayers[uActiveCharacter]->uLevel;
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5619 if (pPlayers[uActiveCharacter]->uLevel >= v68)
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5620 sprintfex(*v45, "%s\n \n%s",
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5621 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."
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5622 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5623 {
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5624 if (pPlayers[uActiveCharacter]->uExperience < v5)
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5625 sprintfex(*v45, pGlobalTXT_LocalizationStrings[538], // "You need %d more experience to train to level %d"
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5626 (uint)(v5 - pPlayers[uActiveCharacter]->uExperience), pPlayers[uActiveCharacter]->uLevel + 1);
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5627 else
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5628 sprintfex(*v45, pGlobalTXT_LocalizationStrings[537], // "Train to level %d for %d gold"
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5629 pPlayers[uActiveCharacter]->uLevel + 1, v11);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5630 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5631 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5632 v47 = pFontArrus->CalcTextHeight(*v45, &v65, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5633 v43 = pDialogueWindow;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5634 v72 += v47;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5635 ++v45;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5636 ++v73;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5637 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5638 while ( v73 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5639 }
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5640
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5641 v49 = (2 * (87 - (174 - v72) / 2) - v72) / 2 - (174 - v72) / 2 / 2 + 138;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5642 v73 = v43->pStartingPosActiveItem;
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5643 if (v43->pStartingPosActiveItem < v43->pStartingPosActiveItem + v43->pNumPresenceButton)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5644 {
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5645 int _v3 = 2;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5646 v51 = pShopOptions;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5647 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5648 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5649 v52 = v43->GetControl(v73);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5650 v53 = v52;
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5651 v52->uY = (174 - v72) / 2 + v49;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5652 v54 = pFontArrus->CalcTextHeight(*v51, &v65, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5653 v55 = v53->uY;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5654 v53->uHeight = v54;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5655 v56 = v54 + v55 - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5656 v53->uW = v56;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5657 v49 = v56;
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5658 v57 = color2;
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5659 if ( pDialogueWindow->pCurrentPosActiveItem != _v3 )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5660 v57 = white;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5661 v65.DrawTitleText(pFontArrus, 0, v55, v57, *v51, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5662 v43 = pDialogueWindow;
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
5663 ++_v3;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5664 ++v51;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5665 ++v73;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5666 }
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
5667 while ( v73 < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5668 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5669 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5670 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5671 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5672
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5673
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5674
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5675
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5676
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5677
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5678
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5679
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5680
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5681 //----- (004B4FCF) --------------------------------------------------------
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5682 void MagicShopDialog()
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5683 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5684 Player *v0; // ebx@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5685 int result; // eax@6
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5686 signed int v2; // esi@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5687 unsigned int v3; // ebx@10
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5688 char *v4; // eax@11
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5689 char *v5; // eax@12
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5690 unsigned int v6; // eax@12
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5691 int v7; // ST08_4@14
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5692 int v8; // eax@14
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5693 unsigned __int8 v9; // dl@14
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5694 char *v10; // ecx@14
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5695 signed int v11; // esi@16
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5696 int v12; // ST08_4@19
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5697 int v13; // eax@19
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5698 int all_text_height; // edi@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5699 char **v15; // esi@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5700 int v16; // eax@22
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5701 GUIWindow *v17; // ecx@23
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5702 int v18; // edx@23
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5703 int v19; // edi@23
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5704 unsigned __int8 v20; // sf@23
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5705 GUIButton *control_button; // esi@25
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5706 const char **v22; // eax@25
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5707 int v23; // eax@25
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5708 unsigned int v24; // ecx@25
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5709 const char **v25; // edx@25
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5710 unsigned __int16 text_color; // ax@25
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5711 signed int v27; // esi@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5712 int v28; // ST08_4@34
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5713 int v29; // eax@34
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5714 char *v30; // edx@35
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5715 GUIWindow *v31; // edi@40
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5716 void *v32; // eax@40
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5717 signed int v33; // esi@40
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5718 unsigned int v34; // esi@42
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5719 int v35; // eax@42
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5720 unsigned int v36; // eax@43
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5721 int v37; // eax@45
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5722 int v38; // ecx@50
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5723 GUIButton *v39; // eax@52
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5724 GUIButton *v40; // esi@52
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5725 int v41; // eax@52
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5726 char *v42; // eax@54
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5727 int v43; // eax@54
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5728 unsigned int v44; // ecx@54
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5729 int v45; // edx@54
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5730 int v46; // eax@54
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5731 unsigned __int16 v47; // ax@54
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5732 int v48; // eax@58
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5733 signed int v49; // esi@62
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5734 Texture *v50; // ecx@64
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5735 unsigned int v51; // edi@64
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5736 unsigned int v52; // esi@66
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5737 int v53; // edx@70
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5738 Texture *v54; // ecx@76
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5739 unsigned int v55; // edi@76
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5740 unsigned int v56; // esi@76
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5741 int v57; // edx@80
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5742 Texture *v58; // ecx@86
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5743 unsigned int v59; // edi@86
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5744 unsigned int v60; // esi@88
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5745 int v61; // edx@92
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5746 Texture *v62; // ecx@98
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5747 unsigned int v63; // edi@98
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5748 unsigned int v64; // esi@100
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5749 int v65; // edx@104
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5750 signed int v66; // ecx@109
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5751 SHORT v67; // di@117
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5752 bool v68; // eax@117
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5753 const char *v69; // ecx@119
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5754 POINT *v70; // esi@124
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5755 int v71; // ecx@125
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5756 int v72; // eax@125
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5757 int v73; // ecx@125
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5758 ItemGen *v74; // esi@125
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5759 int v75; // eax@130
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5760 int v76; // esi@131
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5761 char **v77; // edi@131
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5762 int v78; // eax@132
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5763 GUIWindow *v79; // ecx@133
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5764 int v80; // edx@133
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5765 int v81; // edi@133
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5766 GUIButton *v82; // esi@135
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5767 const char **v83; // eax@135
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5768 int v84; // eax@135
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5769 unsigned int v85; // ecx@135
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5770 int v86; // edx@135
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5771 unsigned __int16 v87; // ax@135
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5772 GUIWindow *v88; // [sp-18h] [bp-110h]@35
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5773 int v89; // [sp-14h] [bp-10Ch]@35
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5774 ItemGen *v90; // [sp-10h] [bp-108h]@14
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5775 int v91; // [sp-10h] [bp-108h]@35
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5776 unsigned __int16 v92; // [sp-Ch] [bp-104h]@12
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5777 void *v93; // [sp-Ch] [bp-104h]@14
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5778 int v94; // [sp-8h] [bp-100h]@11
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5779 char *v95; // [sp-8h] [bp-100h]@12
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5780 __int64 *v96; // [sp-4h] [bp-FCh]@11
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5781 unsigned int v97; // [sp-4h] [bp-FCh]@12
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5782 POINT v98; // [sp+Ch] [bp-ECh]@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5783 POINT v99; // [sp+14h] [bp-E4h]@16
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5784 POINT v100; // [sp+1Ch] [bp-DCh]@124
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5785 POINT v101; // [sp+24h] [bp-D4h]@17
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5786 POINT v102; // [sp+2Ch] [bp-CCh]@124
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5787 POINT v103; // [sp+34h] [bp-C4h]@9
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5788 POINT v104; // [sp+3Ch] [bp-BCh]@31
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5789 POINT v105; // [sp+44h] [bp-B4h]@16
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5790 POINT v106; // [sp+4Ch] [bp-ACh]@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5791 POINT v107; // [sp+54h] [bp-A4h]@16
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5792 POINT v108; // [sp+5Ch] [bp-9Ch]@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5793 POINT a2; // [sp+64h] [bp-94h]@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5794 POINT v110; // [sp+6Ch] [bp-8Ch]@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5795 POINT v111; // [sp+74h] [bp-84h]@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5796 GUIWindow dialog_window; // [sp+7Ch] [bp-7Ch]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5797 char *Str; // [sp+D0h] [bp-28h]@54
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5798 int v146; // [sp+D4h] [bp-24h]@23
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5799 unsigned int hilight_color; // [sp+D8h] [bp-20h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5800 unsigned int m_text_color; // [sp+DCh] [bp-1Ch]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5801 __int32 v117; // [sp+E0h] [bp-18h]@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5802 int v118; // [sp+E4h] [bp-14h]@40
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5803 const char **v119; // [sp+E8h] [bp-10h]@24
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5804 Player *_this; // [sp+ECh] [bp-Ch]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5805 unsigned __int8 uPlayerID; // [sp+F3h] [bp-5h]@14
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5806 int v152; // [sp+F4h] [bp-4h]@23
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5807 int v122;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5808 int v114;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5809
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5810 v0 = pPlayers[uActiveCharacter];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5811 _this = pPlayers[uActiveCharacter];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5812 memcpy(&dialog_window, window_SpeakInHouse, sizeof(dialog_window));
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5813 dialog_window.uFrameX = 483;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5814 dialog_window.uFrameWidth = 148;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5815 dialog_window.uFrameZ = 334;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5816 m_text_color = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5817 hilight_color = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
5818 if ( dialog_menu_id > HOUSE_DIALOGUE_SHOP_REPAIR )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5819 {
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
5820 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5821 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5822 draw_leather();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5823 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5824 pShopOptions[0] = pGlobalTXT_LocalizationStrings[200];// "Sell"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5825 pShopOptions[1] = pGlobalTXT_LocalizationStrings[113];// "Identify"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5826 pShopOptions[2] = pGlobalTXT_LocalizationStrings[179];// "Repair"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5827 v76 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5828 v77 = pShopOptions;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5829 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5830 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5831 v78 = pFontArrus->CalcTextHeight(*v77, &dialog_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5832 ++v77;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5833 v76 += v78;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5834 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5835 while ( (signed int)v77 < (signed int)&pShopOptions[3] );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5836 v79 = pDialogueWindow;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5837 _this = (Player *)((174 - v76) / 3);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5838 result = pDialogueWindow->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5839 v80 = result + pDialogueWindow->pNumPresenceButton;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5840 v81 = (3 * (58 - (signed int)_this) - v76) / 2 - (174 - v76) / 3 / 2 + 138;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5841 v20 = -pDialogueWindow->pNumPresenceButton < 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5842 v118 = pDialogueWindow->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5843 if ( v20 ^ __OFSUB__(result, v80) )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5844 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5845 v122 = 2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5846 v119 = (const char **)pShopOptions;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5847 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5848 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5849 v82 = v79->GetControl(v118);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5850 v83 = v119;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5851 v82->uY = (unsigned int)((char *)_this + v81);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5852 v84 = pFontArrus->CalcTextHeight(*v83, &dialog_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5853 v85 = v82->uY;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5854 v86 = v122;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5855 v82->uHeight = v84;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5856 v81 = v84 + v85 - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5857 v82->uW = v81;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5858 v87 = hilight_color;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5859 if ( pDialogueWindow->pCurrentPosActiveItem != v86 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5860 v87 = m_text_color;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5861 dialog_window.DrawTitleText(pFontArrus, 0, v85, v87, *v119, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5862 v79 = pDialogueWindow;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5863 ++v122;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5864 ++v119;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5865 ++v118;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5866 result = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5867 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5868 while ( v118 < result );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5869 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5870 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5871 }
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
5872 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_SPECIAL )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5873 {
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
5874 result = dialog_menu_id - HOUSE_DIALOGUE_LEARN_SKILLS;
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
5875 if ( dialog_menu_id == HOUSE_DIALOGUE_LEARN_SKILLS )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5876 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5877 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5878 if ( result )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5879 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5880 v31 = pDialogueWindow;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5881 v3 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5882 v32 = window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5883 v118 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5884 //v33 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (signed int)v32] * 500.0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5885 v33 = (signed __int64)(p2DEvents[(signed int)v32 - 1].flt_24 * 500.0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5886 v119 = (const char **)(v33 * (100 - _this->GetMerchant()) / 100);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5887 if ( (signed int)v119 < v33 / 3 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5888 v119 = (const char **)(v33 / 3);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5889 v34 = v31->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5890 v35 = v34 + v31->pNumPresenceButton;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5891 v122 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5892 if ( (signed int)v34 >= v35 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5893 goto LABEL_140;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5894 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5895 {
832
dfd683c4f538 Hotkeys fixed
Nomad
parents: 827
diff changeset
5896 v36 = v31->GetControl(v34)->msg_param - 36;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5897 if ( byte_4ED970_skill_learn_ability_by_class_table[_this->classType][v36] && !_this->pActiveSkills[v36] )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5898 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5899 v37 = pFontArrus->CalcTextHeight(pSkillNames[v36], &dialog_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5900 v118 += v37;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5901 ++v122;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5902 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5903 ++v34;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5904 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5905 while ( (signed int)v34 < v31->pNumPresenceButton + v31->pStartingPosActiveItem );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5906 if ( !v122 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5907 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5908 LABEL_140:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5909 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], _this->pName, pClassNames[_this->classType]);//
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5910 // "Seek knowledge elsewhere %s the %s"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5911 strcat(pTmpBuf, "\n \n");
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5912 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);// "I can offer you nothing further."
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5913 v30 = pTmpBuf;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5914 v97 = 3;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5915 v95 = pTmpBuf;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5916 v92 = hilight_color;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5917 v91 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5918 v89 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5919 v88 = &dialog_window;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5920 goto LABEL_61;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5921 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5922 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], v119);// "Skill Cost: %lu"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5923 dialog_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5924 v119 = (const char **)((149 - v118) / v122);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5925 if ( (149 - v118) / v122 > 32 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5926 v119 = (const char **)32;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5927 result = v31->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5928 v38 = (149 - v122 * (signed int)v119 - v118) / 2 - (signed int)v119 / 2 + 162;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5929 v118 = result;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5930 v114 = v38;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5931 if ( result < result + v31->pNumPresenceButton )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5932 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5933 v122 = 2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5934 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5935 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5936 v39 = v31->GetControl(v118);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5937 v40 = v39;
832
dfd683c4f538 Hotkeys fixed
Nomad
parents: 827
diff changeset
5938 v41 = v39->msg_param - 36;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5939 if ( !byte_4ED970_skill_learn_ability_by_class_table[_this->classType][v41] || _this->pActiveSkills[v41] )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5940 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5941 v40->uW = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5942 v40->uHeight = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5943 v40->uY = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5944 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5945 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5946 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5947 v42 = pSkillNames[v41];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5948 v40->uY = (unsigned int)((char *)v119 + v114);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5949 Str = v42;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5950 v43 = pFontArrus->CalcTextHeight(v42, &dialog_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5951 v44 = v40->uY;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5952 v45 = v122;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5953 v40->uHeight = v43;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5954 v46 = v44 + v43 - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5955 v40->uW = v46;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5956 v114 = v46;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5957 v47 = hilight_color;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5958 if ( pDialogueWindow->pCurrentPosActiveItem != v45 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5959 v47 = m_text_color;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5960 dialog_window.DrawTitleText(pFontArrus, 0, v44, v47, Str, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5961 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5962 v48 = v31->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5963 ++v118;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5964 result = v31->pNumPresenceButton + v48;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5965 ++v122;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5966 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5967 while ( v118 < result );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5968 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5969 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5970 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5971 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5972 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5973 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5974 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5975 {
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
5976 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_REPAIR)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5977 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5978 draw_leather();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5979 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5980 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[198], 0);// "Select the Item to Repair"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5981 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5982 if ( !result
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5983 || (v27 = pMouse->GetCursorPos(&v110)->x - 14,
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5984 v117 = (v27 >> 5) + 14 * ((pMouse->GetCursorPos(&v108)->y - 17) >> 5),
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5985 result = (int)pMouse->GetCursorPos(&v106),
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5986 *(int *)result <= 13)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5987 || (result = (int)pMouse->GetCursorPos(&v104), *(int *)result >= 462)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5988 || (result = v0->GetItemIDAtInventoryIndex((int *)&v117), v3 = 0, !result)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5989 || (result *= 9, !(_this->field_1F5[4 * result + 15] & 2)) )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5990 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5991 v96 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5992 v94 = 5;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5993 v93 = window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5994 v90 = (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * result + 5];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5995 v28 = (int)window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5996 uPlayerID = uActiveCharacter - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5997 v29 = _this->_490EEE((ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * result + 5], 3, v28, 5);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5998 v9 = uPlayerID;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5999 v10 = (char *)pMerchantsRepairPhrases[v29];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6000 goto LABEL_35;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6001 }
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
6002 if ( dialog_menu_id == HOUSE_DIALOGUE_MAIN)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6003 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6004 /* result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6005 if ( result )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6006 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6007 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134];// "Buy Standard"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6008 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152];// "Buy Special"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6009 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159];// "Display Inventory"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6010 v14 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6011 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160];// "Learn Skills"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6012 v15 = pShopOptions;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6013 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6014 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6015 v16 = pFontArrus->CalcTextHeight(*v15, &dialogue_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6016 ++v15;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6017 v14 += v16;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6018 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6019 while ( (signed int)v15 < (signed int)&unk_F8B1C8 );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6020 v17 = pDialogueWindow;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6021 v114 = (174 - v14) / 4;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6022 result = pDialogueWindow->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6023 v18 = result + pDialogueWindow->pNumPresenceButton;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6024 v19 = (174 - 4 * (174 - v14) / 4 - v14) / 2 - (174 - v14) / 4 / 2 + 138;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6025 v20 = -pDialogueWindow->pNumPresenceButton < 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6026 v122 = pDialogueWindow->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6027 if ( v20 ^ __OFSUB__(result, v18) )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6028 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6029 v119 = (const char **)2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6030 _this = (Player *)pShopOptions;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6031 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6032 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6033 v21 = v17->GetControl(v122);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6034 v22 = (const char **)_this;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6035 v21->uY = v114 + v19;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6036 v23 = pFontArrus->CalcTextHeight(*v22, &dialogue_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6037 v24 = v21->uY;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6038 v25 = v119;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6039 v21->uHeight = v23;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6040 v19 = v24 + v23 - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6041 v21->uW = v19;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6042 v26 = color2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6043 if ( (const char **)pDialogueWindow->pCurrentPosActiveItem != v25 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6044 v26 = m_text_color;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6045 dialogue_window.DrawTitleText(pFontArrus, 0, v24, v26, (const char *)LODWORD(_this->pConditions[0]), 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6046 v17 = pDialogueWindow;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6047 v119 = (const char **)((char *)v119 + 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6048 _this = (Player *)((char *)_this + 4);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6049 ++v122;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6050 result = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6051 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6052 while ( v122 < result );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6053 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6054 }*/
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6055 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6056 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6057 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134]; //"Buy Standard"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6058 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152]; //"Buy Special"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6059 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159]; //"Display Inventory"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6060 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6061
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6062 all_text_height = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6063 for(int i=0;i<4;++i)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6064 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6065 v146 = (174 - all_text_height) / 4;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6066
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6067 v23 = (174 - 4 * (174 - all_text_height) / 4 - all_text_height) / 2 - (174 - all_text_height) / 4 / 2 + 138;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6068 int j=0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6069 if ( pDialogueWindow->pNumPresenceButton>=0 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6070 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6071 int th = 2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6072 for (v152 = pDialogueWindow->pStartingPosActiveItem; v152 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem; ++v152)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6073 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6074 control_button = pDialogueWindow->GetControl(v152);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6075 control_button->uY = v146 + v23;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6076 v27 = pFontArrus->CalcTextHeight(pShopOptions[j], &dialog_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6077 control_button->uHeight = v27;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6078 v23 = control_button->uY + control_button->uHeight - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6079 control_button->uW = v23;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6080 text_color = hilight_color;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6081 if ( pDialogueWindow->pCurrentPosActiveItem != th )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6082 text_color = m_text_color;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6083 dialog_window.DrawTitleText(pFontArrus, 0, control_button->uY, text_color, pShopOptions[j], 3);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6084 ++th;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6085 ++j;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6086 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6087 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6088
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6089
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6090 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6091 }
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
6092 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6093 {
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
6094 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_SELL)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6095 {
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
6096 result = dialog_menu_id - HOUSE_DIALOGUE_SHOP_IDENTIFY;
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
6097 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_IDENTIFY)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6098 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6099 draw_leather();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6100 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6101 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0);// "Select the Item to Identify"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6102 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6103 if ( result )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6104 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6105 v2 = pMouse->GetCursorPos(&a2)->x - 14;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6106 v117 = (v2 >> 5) + 14 * ((pMouse->GetCursorPos(&v98)->y - 17) >> 5);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6107 result = (int)pMouse->GetCursorPos(&v111);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6108 if ( *(int *)result > 13 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6109 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6110 result = (int)pMouse->GetCursorPos(&v103);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6111 if ( *(int *)result < 462 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6112 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6113 result = v0->GetItemIDAtInventoryIndex((int *)&v117);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6114 v3 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6115 if ( result )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6116 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6117 v96 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6118 v94 = 4;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6119 v4 = (char *)&_this->pInventoryItems[result-1];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6120 if ( v4[20] & 1 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6121 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6122 v5 = BuilDialogueString("%24", uActiveCharacter - 1, (ItemGen *)v4, (char *)window_SpeakInHouse->ptr_1C, 4, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6123 v97 = 3;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6124 v95 = v5;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6125 v92 = m_text_color;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6126 v6 = (212 - pFontArrus->CalcTextHeight(v5, &dialog_window, 0, 0)) / 2 + 101;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6127
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6128 dialog_window.DrawTitleText(pFontArrus, v3, v6, v92, v95, v97);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6129 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6130 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6131 v93 = window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6132 v90 = (ItemGen *)v4;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6133 v7 = (int)window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6134 uPlayerID = uActiveCharacter - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6135 v8 = ((Player *)_this)->_490EEE((ItemGen *)v4, 3, v7, 4);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6136 v9 = uPlayerID;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6137 v10 = (char *)pMerchantsIdentifyPhrases[v8];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6138 goto LABEL_35;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6139 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6140 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6141 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6142 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6143 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6144 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6145 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6146 draw_leather();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6147 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6148 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0);// "Select the Item to Sell"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6149 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6150 if ( !result
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6151 || (v11 = pMouse->GetCursorPos(&v107)->x - 14,
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6152 v117 = (v11 >> 5) + 14 * ((pMouse->GetCursorPos(&v99)->y - 17) >> 5),
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6153 result = (int)pMouse->GetCursorPos(&v105),
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6154 *(int *)result <= 13)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6155 || (result = (int)pMouse->GetCursorPos(&v101), *(int *)result >= 462)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6156 || (result = v0->GetItemIDAtInventoryIndex((int *)&v117), v3 = 0, !result) )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6157 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6158 v96 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6159 v94 = 3;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6160 v93 = window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6161 v90 = (ItemGen *)&_this->pInventoryItems[result-1];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6162 v12 = (int)window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6163 uPlayerID = uActiveCharacter - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6164 v13 = _this->_490EEE(v90, 3, v12, 3);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6165 v9 = uPlayerID;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6166 v10 = (char *)pMerchantsSellPhrases[v13];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6167 LABEL_35:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6168 v30 = BuilDialogueString(v10, v9, v90, (char *)v93, v94, v96);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6169 v97 = 3;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6170 v95 = v30;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6171 v92 = m_text_color;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6172 v91 = v3;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6173 v89 = v3;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6174 v88 = &dialog_window;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6175 LABEL_61:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6176 v6 = (174 - pFontArrus->CalcTextHeight(v30, v88, v89, v91)) / 2 + 138;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6177 dialog_window.DrawTitleText(pFontArrus, v3, v6, v92, v95, v97);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6178 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6179 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6180 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6181 pRenderer->DrawTextureIndexed(8u, 8u, ShopTexture);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6182 v3 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6183 v49 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6184 v122 = 0;
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
6185 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6186 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6187 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6188 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6189 // if ( pParty->field_777C[9 * (v49 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] )
757
0b3f4b854652 if and ; errors
zipi
parents: 749
diff changeset
6190 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v49].uItemID)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6191 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6192 v50 = ItemsInShopTexture[v49];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6193 v51 = 152 - v50->uTextureHeight;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6194 if ( (signed int)v51 < 1 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6195 v51 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6196 v52 = 75 * v49 - v50->uTextureWidth / 2 + 40;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6197 if ( v122 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6198 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6199 if ( v122 == 5 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6200 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6201 v53 = ItemsInShopTexture[5]->uTextureWidth;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6202 if ( (signed int)v52 > 457 - v53 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6203 v52 = 457 - v53;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6204 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6205 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6206 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6207 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6208 if ( (signed int)v52 < 18 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6209 v52 = 18;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6210 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6211 pRenderer->DrawTextureTransparent(v52, v51, v50);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6212 sub_40F92A(&pRenderer->pActiveZBuffer[v52 + 640 * v51], ItemsInShopTexture[v122], v122 + 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6213 v49 = v122;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6214 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6215 ++v49;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6216 v122 = v49;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6217 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6218 while ( v49 < 6 );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6219 v122 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6220 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6221 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6222 //if ( pParty->field_777C[9 * (v122 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 54] )
757
0b3f4b854652 if and ; errors
zipi
parents: 749
diff changeset
6223 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v122+1].uItemID)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6224 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6225 v54 = ItemsInShopTexture[v122 + 6];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6226 v55 = 306 - v54->uTextureHeight;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6227 v56 = 75 * v122 - v54->uTextureWidth / 2 + 40;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6228 if ( v122 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6229 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6230 if ( v122 == 5 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6231 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6232 v57 = ItemsInShopTexture[11]->uTextureWidth;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6233 if ( (signed int)v56 > 457 - v57 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6234 v56 = 457 - v57;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6235 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6236 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6237 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6238 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6239 if ( (signed int)v56 < 18 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6240 v56 = 18;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6241 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6242 pRenderer->DrawTextureTransparent(v56, v55, v54);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6243 sub_40F92A(&pRenderer->pActiveZBuffer[v56 + 640 * v55], ItemsInShopTexture[v122 + 6], v122 + 7);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6244 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6245 ++v122;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6246 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6247 while ( v122 < 6 );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6248 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6249 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6250 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6251 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6252 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6253 // if ( pParty->field_C59C[9 * (v49 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6254 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v49].uItemID)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6255 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6256 v58 = ItemsInShopTexture[v49];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6257 v59 = 152 - v58->uTextureHeight;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6258 if ( (signed int)v59 < 1 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6259 v59 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6260 v60 = 75 * v49 - v58->uTextureWidth / 2 + 40;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6261 if ( v122 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6262 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6263 if ( v122 == 5 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6264 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6265 v61 = ItemsInShopTexture[5]->uTextureWidth;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6266 if ( (signed int)v60 > 457 - v61 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6267 v60 = 457 - v61;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6268 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6269 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6270 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6271 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6272 if ( (signed int)v60 < 18 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6273 v60 = 18;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6274 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6275 pRenderer->DrawTextureTransparent(v60, v59, v58);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6276 sub_40F92A(&pRenderer->pActiveZBuffer[v60 + 640 * v59], ItemsInShopTexture[v122], v122 + 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6277 v49 = v122;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6278 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6279 ++v49;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6280 v122 = v49;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6281 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6282 while ( v49 < 6 );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6283 v122 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6284 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6285 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6286 //if ( pParty->Spell_Item[(unsigned int)window_SpeakInHouse->ptr_1C][v49] + 778] ) //weak
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6287 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v49].uAttributes)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6288 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6289 v62 = ItemsInShopTexture[v122 + 6];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6290 v63 = 306 - v62->uTextureHeight;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6291 if ( (signed int)v63 < 1 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6292 v63 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6293 v64 = 75 * v122 - v62->uTextureWidth / 2 + 40;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6294 if ( v122 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6295 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6296 if ( v122 == 5 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6297 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6298 v65 = ItemsInShopTexture[11]->uTextureWidth;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6299 if ( (signed int)v64 > 457 - v65 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6300 v64 = 457 - v65;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6301 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6302 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6303 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6304 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6305 if ( (signed int)v64 < 18 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6306 v64 = 18;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6307 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6308 pRenderer->DrawTextureTransparent(v64, v63, v62);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6309 sub_40F92A(&pRenderer->pActiveZBuffer[v64 + 640 * v63], ItemsInShopTexture[v122 + 6], v122 + 7);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6310 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6311 ++v122;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6312 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6313 while ( v122 < 6 );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6314 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6315 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6316 if ( result )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6317 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6318 v66 = 0;
757
0b3f4b854652 if and ; errors
zipi
parents: 749
diff changeset
6319 v117 = 0;\
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
6320 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6321 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6322 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6323 {
757
0b3f4b854652 if and ; errors
zipi
parents: 749
diff changeset
6324 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v66].uItemID) //9 * (v66 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6325 ++v117;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6326 ++v66;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6327 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6328 while ( v66 < 12 );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6329 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6330 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6331 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6332 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6333 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6334 //if ( pParty->field_C59C[9 * (v66 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6335 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v66].uItemID)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6336 ++v117;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6337 ++v66;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6338 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6339 while ( v66 < 12 );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6340 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6341 v67 = GetAsyncKeyState(VK_CONTROL);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6342 v68 = _this->CanSteal();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6343 Str = (char *)v68;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6344 if ( v67 && v68 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6345 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6346 v69 = pGlobalTXT_LocalizationStrings[185];// "Steal item"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6347 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6348 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6349 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6350 v69 = pGlobalTXT_LocalizationStrings[195];// "Select the Item to Buy"
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
6351 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6352 v69 = pGlobalTXT_LocalizationStrings[196];// "Select the Special Item to Buy"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6353 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6354 DrawTextAtStatusBar(v69, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6355 if ( !v117 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6356 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6357 dialog_window.DrawCurrentTime( pParty->field_3C.field_50[(unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6358 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6359 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6360 v70 = pMouse->GetCursorPos(&v102);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6361 result = v70->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v100)->y];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6362 if ( pRenderer->pActiveZBuffer[result] & 0xFFFF )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6363 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6364 v71 = (pRenderer->pActiveZBuffer[result] & 0xFFFF) - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6365 v117 = v71;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6366 v72 = (int)window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6367 // v73 = 9 * (v71 + 12 * v72);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6368 v74 = (ItemGen *)&pParty->StandartItemsInShops[v72][v71];
749
f39fbeb65b28 Fixed bought items not disappearing from Armourer.
Nomad
parents: 747
diff changeset
6369 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6370 // v74 = (ItemGen *)&pParty->field_C59C[v73 + 724];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6371 v74 =&pParty->SpecialItemsInShops[v72][v71];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6372 if ( v67 && Str )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6373 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6374 v10 = pGlobalTXT_LocalizationStrings[181];// "Steal %24"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6375 v96 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6376 v94 = 2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6377 v93 = window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6378 v90 = v74;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6379 v9 = uActiveCharacter - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6380 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6381 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6382 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6383 v96 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6384 v94 = 2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6385 v93 = window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6386 v90 = v74;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6387 uPlayerID = uActiveCharacter - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6388 v75 = _this->_490EEE(v74, 3, v72, 2);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6389 v9 = uPlayerID;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6390 v10 = (char *)pMerchantsBuyPhrases[v75];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6391 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6392 goto LABEL_35;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6393 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6394 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6395 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6396 }