annotate UIHouses.cpp @ 646:2f778a5dc27e

m
author Ritor1
date Tue, 12 Mar 2013 01:23:59 +0600
parents 527a052c2a98
children 35ce4761382c c76775d819d6
rev   line source
620
ba08b9403e04 files for houses func
Gloval
parents:
diff changeset
1 #include "UIHouses.h"
ba08b9403e04 files for houses func
Gloval
parents:
diff changeset
2
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3 #include "Party.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4 #include "Player.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
5 #include "texts.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
6 #include "Events.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
7 #include "Arcomage.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
8 #include "LOD.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
9 #include "Mouse.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
10 #include "GUIWindow.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
11 #include "GUIButton.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
12 #include "GUIFont.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
13 #include "Events2D.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
14 #include "Overlays.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
15 #include "Render.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
16 #include "Indoor.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
17 #include "Outdoor.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
18 #include "AudioPlayer.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
19 #include "VideoPlayer.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
20 #include "Monsters.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
21 #include "Viewport.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
22 #include "Keyboard.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
23 #include "NPC.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
24
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
25 #include "mm7_data.h"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
26
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
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
32 const stru159 pAnimatedRooms[196] = //0x4E5F70
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
33 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
34 {"", 0x4, 0x1F4, 0, 0, 0},
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
35 {"Human Armor01", 0x20, 0x2C0, 2, 58, 0},
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
36 {"Necromancer Armor01", 0x20, 0x2D7, 2, 70, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
37 {"Dwarven Armor01", 0x20, 0x2EE, 2, 5, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
38 {"Wizard Armor", 0x20, 0x3BD, 2, 19, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
39 {"Warlock Armor", 0x20, 0x2D6, 2, 35, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
40 {"Elf Armor", 0x20, 0x2BC, 2, 79, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
41 {"Human Alchemisht01", 0xE, 0x2BE, 4, 95, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
42 {"Necromancer Alchemist01", 0xE, 0x2D6, 4, 69, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
43 {"Dwarven Achemist01", 0xE, 0x387, 4, 4, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
44 {"Wizard Alchemist", 0xE, 0x232, 4, 25, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
45 {"Warlock Alchemist", 0xE, 0x2BE, 4, 42, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
46 {"Elf Alchemist", 0xE, 0x38A, 4, 84, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
47 {"Human Bank01", 0x6, 0x384, 22, 52, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
48 {"Necromancer Bank01", 0x6, 0x2D8, 22, 71, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
49 {"Dwarven Bank", 0x6, 0x2F3, 22, 6, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
50 {"Wizard Bank", 0x6, 0x3BA, 22, 20, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
51 {"Warlock Bank", 0x6, 0x39F, 22, 36, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
52 {"Elf Bank", 0x6, 0x2BC, 22, 71, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
53 {"Boat01", 0xF, 0x4C, 28, 53, 3 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
54 {"Boat01d", 0xF, 0x4C, 28, 53, 3 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
55 {"Human Magic Shop01", 0xA, 0x2C8, 3, 54, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
56 {"Necromancer Magic Shop01", 0xE, 0x2DC, 3, 66, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
57 {"Dwarven Magic Shop01", 0x2A, 0x2EF, 3, 91, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
58 {"Wizard Magic Shop", 0x1E, 0x2DF, 3, 15, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
59 {"Warlock Magic Shop", 0x7, 0x3B9, 3, 15, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
60 {"Elf Magic Shop", 0x24, 0x2CC, 3, 82, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
61 {"Human Stables01", 0x21, 0x31, 27, 48, 3 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
62 {"Necromancer Stables", 0x21, 0x2DD, 27, 67, 3 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
63 {"", 0x21, 0x2F0, 27, 91, 3 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
64 {"Wizard Stables", 0x21, 0x3BA, 27, 16, 3 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
65 {"Warlock Stables", 0x21, 0x181, 27, 77, 3 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
66 {"Elf Stables", 0x21, 0x195, 27, 77, 3 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
67 {"Human Tavern01", 0xD, 0x2C2, 21, 49, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
68 {"Necromancer Tavern01", 0xD, 0x3B0, 21, 57, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
69 {"Dwarven Tavern01", 0xD, 0x2FE, 21, 94, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
70 {"Wizard Tavern", 0xD, 0x3BB, 21, 17, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
71 {"Warlock Tavern", 0xD, 0x3A8, 21, 33, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
72 {"Elf Tavern", 0xD, 0x2CD, 21, 78, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
73 {"Human Temple01", 0x24, 0x2DB, 23, 50, 3 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
74 {"Necromancer Temple", 0x24, 0x2DF, 23, 60, 3 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
75 {"Dwarven Temple01", 0x24, 0x2F1, 23, 86, 3 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
76 {"Wizard Temple", 0x24, 0x2E0, 23, 10, 3 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
77 {"Warlock Temple", 0x24, 0x3A4, 23, 27, 3 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
78 {"Elf Temple", 0x24, 0x2CE, 23, 72, 3 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
79 {"Human Town Hall", 0x10, 0x39C, 17, 14, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
80 {"Necromancer Town Hall01", 0x10, 0x3A4, 17, 61, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
81 {"Dwarven Town Hall", 0x10, 0x2DB, 17, 88, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
82 {"Wizard Town Hall", 0x10, 0x3BD, 17, 11, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
83 {"Warlock Town Hall", 0x10, 0x2DB, 17, 28, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
84 {"Elf Town Hall", 0x10, 0x27A, 17, 73, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
85 {"Human Training Ground01", 0x18, 0x2C7, 30, 44, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
86 {"Necromancer Training Ground", 0x18, 0x3AD, 30, 62, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
87 {"Dwarven Training Ground", 0x18, 0x2F2, 30, 89, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
88 {"Wizard Training Ground", 0x18, 0x3A3, 30, 12, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
89 {"Warlock Training Ground", 0x18, 0x3A6, 30, 29, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
90 {"Elf Training Ground", 0x18, 0x19F, 30, 74, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
91 {"Human Weapon Smith01", 0x16, 0x2C1, 1, 45, 4 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
92 {"Necromancer Weapon Smith01", 0x16, 0x2D9, 1, 63, 4 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
93 {"Dwarven Weapon Smith01", 0x16, 0x2EE, 1, 82, 4 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
94 {"Wizard Weapon Smith", 0x16, 0x2D5, 1, 13, 4 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
95 {"Warlock Weapon Smith", 0x16, 0x2D7, 1, 23, 4 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
96 {"Elf Weapon Smith", 0x16, 0x2CA, 1, 75, 4 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
97 {"Air Guild", 0x1D, 0xA4, 6, 1, 3 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
98 {"Body Guild", 0x19, 0x3BF, 11, 2, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
99 {"DarkGuild", 0x19, 0x2D1, 13, 3, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
100 {"EarthGuild", 0x19, 0x2CB, 8, 83, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
101 {"Fire Guild", 0x1C, 0x2BF, 5, 56, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
102 {"Light Guild", 0x1C, 0x2D5, 12, 46, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
103 {"Mind Guild", 0x1C, 0xE5, 10, 40, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
104 {"Spirit Guild", 0x1C, 0x2D2, 9, 41, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
105 {"Water Guild", 0x1B, 0x2D3, 7, 24, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
106 {"Lord And Judge Out01", 1, 0, 29, 39, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
107 {"Human Poor House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
108 {"Human Poor House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
109 {"Human Poor House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
110 {"Human Medium House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
111 {"Human Medium House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
112 {"Human Medium House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
113 {"Human Rich House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
114 {"Human Rich House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
115 {"Human Rich House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
116 {"Elven Poor House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
117 {"Elven Poor House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
118 {"Elven Poor House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
119 {"Elven Medium House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
120 {"Elven Medium House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
121 {"Elven Medium House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
122 {"Elven Rich House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
123 {"Elven Rich House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
124 {"Elven Rich House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
125 {"Dwarven Poor House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
126 {"Dwarven Poor House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
127 {"Dwarven Poor House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
128 {"Dwarven Medium House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
129 {"Dwarven Medium house 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
130 {"Dwarven Medium House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
131 {"Dwarven Rich House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
132 {"Dwarven Rich House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
133 {"Dwarven Rich House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
134 {"Wizard Poor House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
135 {"Wizard Poor House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
136 {"Wizard Poor House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
137 {"Wizard Medium House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
138 {"Wizard Medium House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
139 {"Wizard Mdeium House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
140 {"Wizard Rich House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
141 {"Wizard Rich House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
142 {"Wizard Rich House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
143 {"Necromancer Poor House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
144 {"Necromancer Poor House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
145 {"Necromancer Poor House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
146 {"Necromancer Medium House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
147 {"Necromancer Medium House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
148 {"Necromancer Mdeium House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
149 {"Necromancer Rich House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
150 {"Necromancer Rich House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
151 {"Necromancer Rich House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
152 {"Warlock Poor House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
153 {"Warlock Poor House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
154 {"Warlock Poor House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
155 {"Warlock Medium House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
156 {"Warlock Medium House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
157 {"Warlock Mdeium House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
158 {"Warlock Rich House 1", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
159 {"Warlock Rich House 2", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
160 {"Warlock Rich House 3", 8, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
161 {"Out01 Temple of the Moon", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
162 {"Out01 Dragon Cave", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
163 {"Out02 Castle Harmondy", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
164 {"Out02 White Cliff Cave", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
165 {"Out03 Erathian Sewer", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
166 {"Out03 Fort Riverstride", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
167 {"Out03 Castle Gryphonheart", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
168 {"Out04 Elf Castle", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
169 {"Out04 Tularean Caves", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
170 {"Out04 Clanker's Laboratory", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
171 {"Out05 Hall of the Pit", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
172 {"Out05 Watchtower 6", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
173 {"Out06 School of Sorcery", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
174 {"Out06 Red Dwarf Mines", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
175 {"Out07 Castle Lambert", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
176 {"Out07 Walls of Mist", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
177 {"Out07 Temple of the Light", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
178 {"Out08 Evil Entrance", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
179 {"Out08 Breeding Zone", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
180 {"Out08 Temple of the Dark", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
181 {"Out09 Grand Temple of the Moon", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
182 {"Out09 Grand Tempple of the Sun", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
183 {"Out10 Thunderfist Mountain", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
184 {"Out10 The Maze", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
185 {"Out10 Connecting Tunnel Cave #1", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
186 {"", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
187 {"", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
188 {"Out11 Stone City", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
189 {"", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
190 {"Out12 Colony Zod", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
191 {"Out12 Connecting Tunnel Cave #1", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
192 {"", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
193 {"", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
194 {"Out13 Mercenary Guild", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
195 {"Out13 Tidewater Caverns", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
196 {"Out13 Wine Cellar", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
197 {"Out14 Titan's Stronghold", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
198 {"Out14 Temple Of Baa", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
199 {"Out14 Hall under the Hill", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
200 {"Out15 The Linclon", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
201 {"Jail", 0x24, 0, 31, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
202 {"Harmondale Throne Room", 0x24, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
203 {"Gryphonheart Throne Room", 0x24, 0, 20, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
204 {"Elf Castle Throne Room", 0x24, 0, 20, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
205 {"Wizard Castle Throne Room", 0x24, 0, 20, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
206 {"Necromancer Casstle Trone Room", 0x24, 0, 20, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
207 {"Master Thief", 0x24, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
208 {"Dwarven King", 0x24, 0, 20, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
209 {"Arms Master", 0x24, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
210 {"Warlock", 0x24, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
211 {"Lord Markam", 0x24, 0, 20, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
212 {"Arbiter Neutral Town", 0x24, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
213 {"Arbiter Good Town", 0x24, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
214 {"Arbiter Evil Town", 0x24, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
215 {"Necromancer Throne Room Empty", 0x24, 0, 20, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
216 {"", 0x24, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
217 {"", 0x24, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
218 {"", 0x24, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
219 {"", 0x24, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
220 {"Boat01", 0xF, 0, 29, 53, 3 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
221 {"", 0x24, 0, 28, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
222 {"", 0x24, 0, 28, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
223 {"", 0x24, 0, 28, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
224 {"", 0x24, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
225 {"Arbiter Room Neutral", 0x24, 0, 29, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
226 {"Out02 Castle Harmondy Abandoned", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
227 {"Human Temple02", 0x24, 0x3AB, 23, 27, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
228 {"Player Castle Good", 0x24, 0, 25, 0, 0 },
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
229 {"Player Castle Bad", 0x24, 0, 25, 0, 0}
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
230 };
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
231
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
232
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
233
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
234
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
235 //----- (0044606A) --------------------------------------------------------
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
236 void PrepareHouse(HOUSE_ID house)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
237 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
238 //unsigned int v1; // ebx@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
239 //signed int v2; // esi@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
240 //int uExitPic; // edi@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
241 __int16 uExitMapID; // ax@2
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
242 //int result; // eax@5
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
243 //unsigned int *v6; // ecx@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
244 int v7; // ebx@11
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
245 //int v8; // esi@16
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
246 //unsigned int v9; // eax@16
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
247 //unsigned int v10; // eax@19
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
248 //int v11; // ecx@19
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
249 //char pContainer[36]; // [sp+Ch] [bp-54h]@16
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
250 int v13; // [sp+30h] [bp-30h]@11
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
251 int Dst[6]; // [sp+34h] [bp-2Ch]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
252 //unsigned int v15; // [sp+4Ch] [bp-14h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
253 int uAnimationID; // [sp+50h] [bp-10h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
254 //unsigned int *v17; // [sp+54h] [bp-Ch]@3
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
255 //unsigned int v18; // [sp+58h] [bp-8h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
256 //int v19; // [sp+5Ch] [bp-4h]@7
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
257
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
258 //v15 = uHouseID;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
259 //v1 = 52 * uHouseID;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
260 //uAnimationID = p2DEvents_minus1___02[26 * uHouseID];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
261 uAnimationID = p2DEvents[house - 1].uAnimationID;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
262 //v18 = 52 * uHouseID;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
263 memset(Dst, 0, 0x18u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
264 //uExitPic = *(__int16 *)((char *)p2DEvents_minus1_::2C + v1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
265 //uExitPic = p2DEvents[uHouseID - 1].uExitPicID;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
266 uNumDialogueNPCPortraits = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
267 uHouse_ExitPic = p2DEvents[house - 1].uExitPicID;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
268 if ( uHouse_ExitPic )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
269 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
270 //uExitMapID = *(__int16 *)((char *)p2DEvents_minus1_::30 + v1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
271 uExitMapID = p2DEvents[house - 1]._quest_related;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
272 if ( uExitMapID > 0 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
273 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
274 //v17 = (unsigned int *)(uExitMapID - 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
275 if(_449B57_test_bit(pParty->_quest_bits,uExitMapID))
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
276 // if ( !((unsigned __int8)(0x80u >> (uExitMapID - 1) % 8) & pParty->_quest_bits[(uExitMapID - 1) >> 3]) )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
277 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
278 //uExitPic = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
279 uHouse_ExitPic = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
280 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
281 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
282 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
283
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
284 dword_591080 = pAnimatedRooms[uAnimationID].field_8;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
285 //result = dword_591080;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
286
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
287 //v2 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
288 uNumDialogueNPCPortraits = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
289 if ( dword_591080 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
290 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
291 //v2 = 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
292 Dst[0] = dword_591080;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
293 uNumDialogueNPCPortraits = 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
294 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
295
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
296 //v19 = 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
297 for (uint i = 0; i < pNPCStats->uNumNewNPCs; ++i)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
298 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
299 auto npc = pNPCStats->pNewNPCData + i;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
300 //v6 = &pNPCStats->pNewNPCData[1].uFlags;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
301 //v17 = &pNPCStats->pNewNPCData[1].uFlags;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
302 //do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
303 //{
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
304 if (npc->Location2D == house )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
305 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
306 if (~npc->uFlags & 0x80)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
307 //if ( !(*(char *)v6 & 0x80) )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
308 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
309 v7 = uNumDialogueNPCPortraits++ - dword_591080 ? 1 : 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
310 HouseNPCData[v7] = npc;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
311 //v6 = v17;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
312 //*(&v13 + v2) = *(v17 - 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
313 Dst[uNumDialogueNPCPortraits - 1] = npc->uPortraitID;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
314 //v1 = v18;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
315 if ((npc->uFlags & 3) != 2)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
316 ++npc->uFlags;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
317 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
318 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
319 //++v19;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
320 //v6 += 19;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
321 //v17 = v6;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
322 //}
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
323 //while ( v19 < (signed int)pNPCStats->uNumNewNPCs );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
324 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
325 //uNumDialogueNPCPortraits = v2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
326
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
327 //v19 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
328 for (uint i = 0; i < uNumDialogueNPCPortraits; ++i)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
329 //if ( v2 > 0 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
330 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
331 //do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
332 //{
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
333 //v8 = v19;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
334 char icon_name[128];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
335 sprintfex(icon_name, "npc%03u", Dst[i]);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
336 //v9 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
337 //++v19;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
338 pDialogueNPCPortraits[i] = pIcons_LOD->LoadTexturePtr(icon_name, TEXTURE_16BIT_PALETTE);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
339 //result = v19;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
340 //}
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
341 //while ( v19 < uNumDialogueNPCPortraits );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
342 //uExitPic = uHouse_ExitPic;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
343 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
344
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
345 if (uHouse_ExitPic)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
346 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
347 //v10 = pIcons_LOD->LoadTexture(pHouse_ExitPictures[uHouse_ExitPic], TEXTURE_16BIT_PALETTE);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
348 //v11 = uNumDialogueNPCPortraits++;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
349 pDialogueNPCPortraits[uNumDialogueNPCPortraits++] = pIcons_LOD->LoadTexturePtr(pHouse_ExitPictures[uHouse_ExitPic], TEXTURE_16BIT_PALETTE);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
350 //result = *(__int16 *)((char *)p2DEvents_minus1_::2E + v1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
351 //result = p2DEvents[house - 1].uExitMapID;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
352 uHouse_ExitPic = p2DEvents[house - 1].uExitMapID;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
353 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
354 //return result;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
355 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
356
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
357
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
358
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
359 //----- (0044622E) --------------------------------------------------------
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
360 bool EnterHouse(enum HOUSE_ID uHouseID)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
361 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
362 //enum HOUSE_ID v1; // edi@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
363 //int v2; // edi@5
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
364 signed int uOpenTime; // eax@5
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
365 signed int uCloseTime; // esi@5
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
366 unsigned int v5; // esi@5
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
367 int v6; // edx@5
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
368 signed int am_pm_flag_open; // ecx@10
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
369 signed int am_pm_flag_close; // eax@10
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
370 int v9; // esi@10
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
371 //unsigned int v10; // esi@16
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
372 int v11; // ecx@17
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
373 unsigned int v12; // kr00_4@25
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
374 //Player *v13; // esi@25
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
375 int v14; // eax@25
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
376 //Player *v15; // esi@27
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
377 //signed int v16; // eax@32
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
378 unsigned int v17; // eax@37
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
379 signed int v18; // edi@37
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
380 signed int v19; // edi@41
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
381 //unsigned int v20; // ecx@41
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
382 //const char *v22; // [sp-4h] [bp-40h]@33
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
383 char pContainer[40]; // [sp+Ch] [bp-30h]@32
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
384 unsigned int v24; // [sp+34h] [bp-8h]@5
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
385 //enum HOUSE_ID v25; // [sp+38h] [bp-4h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
386
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
387 //v1 = uHouseID;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
388 //v25 = uHouseID;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
389 GameUI_StatusBar_TimedString[0] = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
390 pStatusBarString[0] = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
391 ShowStatusBarString("", 2u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
392 if ( pMessageQueue_50CBD0->uNumMessages )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
393 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
394 viewparams->bRedrawGameUI = 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
395 uDialogueType = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
396 pKeyActionMap->_459ED1(3);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
397 pKeyActionMap->ResetKeys();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
398 if (uHouseID == HOUSE_600 || uHouseID == HOUSE_601)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
399 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
400 GameOverMenu(0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
401 return 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
402 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
403 uOpenTime = p2DEvents[uHouseID - 1].uOpenTime;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
404 uCloseTime = p2DEvents[uHouseID - 1].uCloseTime;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
405 ptr_F8B1E8 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
406 dword_F8B1E4 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
407 dword_F8B1F4 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
408 memset(byte_F8B1F0, 0, 4);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
409 memset(byte_F8B148, 0, 16);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
410 pRenderer->ClearZBuffer(0, 479);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
411
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
412 if (((uCloseTime - 1 <= uOpenTime)&&((pParty->uCurrentHour <uOpenTime)&&(pParty->uCurrentHour >(uCloseTime - 1))))||
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
413 ((uCloseTime - 1 > uOpenTime)&&((pParty->uCurrentHour < uOpenTime)||(pParty->uCurrentHour > (uCloseTime - 1)))))
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
414
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
415 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
416 am_pm_flag_open = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
417 am_pm_flag_close = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
418 if (uOpenTime > 12 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
419 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
420 uOpenTime -= 12;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
421 am_pm_flag_open = 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
422 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
423 if ( uCloseTime > 12 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
424 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
425 uCloseTime -= 12;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
426 am_pm_flag_close = 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
427 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
428 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[414], uOpenTime, aAMPMNames[am_pm_flag_open],
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
429 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
430 ShowStatusBarString(pTmpBuf, 2u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
431 if ( uActiveCharacter )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
432 pPlayers[uActiveCharacter]->PlaySound(SPEECH_3, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
433 return 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
434 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
435 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
436 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
437 //v10 = uHouseID;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
438 if ( (signed int)uHouseID < 53 ) //entering shops and guilds
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
439 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
440 if ( !(pParty->field_3C._shop_ban_times[uHouseID])
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
441 || (pParty->field_3C._shop_ban_times[uHouseID] <= pParty->uTimePlayed) )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
442 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
443 pParty->field_3C._shop_ban_times[uHouseID] = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
444 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
445 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
446 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
447 ShowStatusBarString(pGlobalTXT_LocalizationStrings[191], 2u);// "You've been banned from this shop!"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
448 return 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
449 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
450 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
451 if ( !start_event_seq_number )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
452 pAudioPlayer->StopChannels(-1, -1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
453
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
454 uCurrentHouse_Animation = p2DEvents[uHouseID - 1].uAnimationID;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
455 in_current_building_type = pAnimatedRooms[uCurrentHouse_Animation].uBuildingType;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
456 if ( in_current_building_type == BildingType_Throne_Room && pParty->uFine ) // going 2 jail
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
457 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
458 uCurrentHouse_Animation = (signed __int16)p2DEvents[186].uAnimationID;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
459 uHouseID = HOUSE_JAIL;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
460 pParty->uTimePlayed = pParty->uTimePlayed+ 0x7620000;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
461 in_current_building_type = pAnimatedRooms[p2DEvents[HOUSE_LORD_AND_JUDGE].uAnimationID].uBuildingType;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
462 ++pParty->uNumPrisonTerms;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
463 pParty->uFine = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
464 for (uint i = 0; i < 4; ++i)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
465 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
466 pParty->pPlayers[i].uTimeToRecovery = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
467 pParty->pPlayers[i].uNumDivineInterventionCastsThisDay = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
468 pParty->pPlayers[i].SetVariable(VAR_Award, 87);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
469 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
470 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
471 ++pIcons_LOD->uTexturePacksCount;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
472 if ( !pIcons_LOD->uNumPrevLoadedFiles )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
473 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
474 switch (pParty->alignment)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
475 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
476 case PartyAlignment_Good: sprintf(pContainer, "evt%02d-b", const_2()); break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
477 case PartyAlignment_Neutral: sprintf(pContainer, "evt%02d", const_2()); break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
478 case PartyAlignment_Evil: sprintf(pContainer, "evt%02d-c", const_2()); break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
479 default: assert(false);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
480 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
481
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
482 v17 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
483 pDialogueNPCCount = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
484 pTexture_Dialogue_Background = &pIcons_LOD->pTextures[v17];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
485 uTextureID_507B04 = uTextureID_right_panel;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
486 PrepareHouse(uHouseID);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
487 v18 = 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
488 uTextureID_507B04 = uTextureID_right_panel;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
489 if ( uNumDialogueNPCPortraits == 1 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
490 pDialogueNPCCount = 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
491 pVideoPlayer->_4BF28F(pAnimatedRooms[uCurrentHouse_Animation].video_name, 1u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
492 dword_5C35D4 = 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
493 if ( (signed int)uHouseID < 139 || (signed int)uHouseID > 172 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
494 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
495 if ( (signed int)uHouseID >= 54 && (signed int)uHouseID <= 73 && !sub_4B68EA(uHouseID - 54) )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
496 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
497 return 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
498 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
499 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
500 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
501 { //guilds
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
502 v19 = guild_mambership_flags[uHouseID-139]; //guilds flags
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
503 //v20 = uHouseID;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
504 //if ( !((unsigned __int8)(0x80u >> v19 % 8) & pPlayers[uActiveCharacter]->_guilds_member_bits[v19 /8]) )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
505 if(_449B57_test_bit((unsigned char*)pPlayers[uActiveCharacter]->_guilds_member_bits,v19))
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
506 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
507 HousePlaySomeSound(uHouseID, 3);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
508 return 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
509 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
510 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
511 HousePlaySomeSound(uHouseID, 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
512 dword_5C35D4 = 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
513 return 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
514 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
515 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
516
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
517 //----- (004B1E92) --------------------------------------------------------
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
518 void __fastcall HousePlaySomeSound(unsigned int uHouseID, int a2)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
519 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
520 //if ( BYTE1(pAnimatedRooms[p2DEvents_minus1___02[26 * uHouseID]].field_C) )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
521 if ( pAnimatedRooms[p2DEvents[uHouseID - 1].uAnimationID].uRoomSoundId )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
522 pAudioPlayer->PlaySound(
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
523 //(SoundID)(a2 + 100 * (BYTE1(pAnimatedRooms[p2DEvents_minus1___02[26 * uHouseID]].field_C) + 300)),
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
524 (SoundID)(a2 + 100 * (pAnimatedRooms[p2DEvents[uHouseID - 1].uAnimationID].uRoomSoundId) + 300),
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
525 806, 0, -1, 0, 0, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
526 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
527
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
528 //----- (004B4F4F) --------------------------------------------------------
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
529 char *__cdecl JailDialog()
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
530 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
531 const char *v0; // esi@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
532 const char *v1; // ST10_4@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
533 unsigned __int16 v2; // ST0C_2@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
534 int v3; // eax@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
535 GUIWindow v5; // [sp+8h] [bp-54h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
536
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
537 memcpy(&v5, window_SpeakInHouse, sizeof(v5));
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
538 v0 = pGlobalTXT_LocalizationStrings[672];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
539 v1 = pGlobalTXT_LocalizationStrings[672];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
540 v5.uFrameX = 483;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
541 v5.uFrameWidth = 148;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
542 v5.uFrameZ = 334;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
543 v2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
544 v3 = pFontArrus->CalcTextHeight(v0, &v5, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
545 return v5.DrawTitleText(pFontArrus, 0, (310 - v3) / 2 + 18, v2, v1, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
546 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
547
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
548
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
549
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
550 //----- (004B68EA) --------------------------------------------------------
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
551 bool __fastcall sub_4B68EA(int a1)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
552 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
553 signed int v1; // edi@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
554 int *v2; // esi@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
555 int v3; // ecx@2
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
556
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
557 v1 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
558 v2 = &dword_4F0E10[a1];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
559 while ( 1 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
560 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
561 v3 = 8 * *((char *)v2 + v1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
562 if ( *(&byte_4F09B1[pParty->uDaysPlayed % 7] + v3 * 4) )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
563 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
564 if ( !dword_4F09CC[v3] || (unsigned __int16)_449B57_test_bit(pParty->_quest_bits, LOWORD(dword_4F09CC[v3])) )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
565 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
566 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
567 ++v1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
568 if ( v1 >= 4 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
569 return 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
570 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
571 return 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
572 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
573
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
574
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
575
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
576 //----- (004B7911) --------------------------------------------------------
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
577 void __cdecl TownHallDialog()
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
578 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
579 GUIWindow *v0; // eax@4
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
580 int v1; // eax@10
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
581 int v2; // esi@10
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
582 GUIFont *v3; // ST20_4@20
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
583 int v4; // eax@20
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
584 MonsterInfo *v5; // edi@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
585 unsigned int v6; // ST20_4@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
586 char *v7; // ST1C_4@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
587 unsigned int v8; // eax@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
588 int v9; // esi@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
589 char *v10; // eax@23
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
590 signed int v11; // ebx@24
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
591 signed int i; // esi@26
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
592 int v13; // eax@27
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
593 GUIWindow *v14; // ecx@28
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
594 __int64 v15; // qax@28
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
595 signed int v16; // ebx@28
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
596 int v17; // ebx@28
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
597 unsigned __int8 v18; // sf@28
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
598 char **v19; // edi@29
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
599 GUIButton *v20; // eax@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
600 GUIButton *v21; // esi@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
601 int v22; // eax@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
602 unsigned int v23; // ecx@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
603 unsigned __int16 v24; // ax@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
604 GUIWindow a1; // [sp+Ch] [bp-110h]@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
605 GUIWindow w; // [sp+60h] [bp-BCh]@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
606 GUIWindow _this; // [sp+B4h] [bp-68h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
607 int v28; // [sp+108h] [bp-14h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
608 int v29; // [sp+10Ch] [bp-10h]@28
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
609 int v30; // [sp+110h] [bp-Ch]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
610 int v31; // [sp+114h] [bp-8h]@29
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
611 GUIFont *pOutString; // [sp+118h] [bp-4h]@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
612
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
613 memcpy(&_this, window_SpeakInHouse, sizeof(_this));
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
614 _this.uFrameX = 483;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
615 _this.uFrameWidth = 148;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
616 _this.uFrameZ = 334;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
617 v28 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
618 v30 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
619 sprintf(pTmpBuf, "%s: %d", pGlobalTXT_LocalizationStrings[605], pParty->uFine);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
620 _this.DrawTitleText(pFontArrus, 0, 0x104u, v30, pTmpBuf, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
621 switch(dialog_menu_id)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
622 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
623 case 1:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
624 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
625 v11 = 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
626 pOutString = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
627 pShopOptions[0] = pGlobalTXT_LocalizationStrings[604];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
628 if ( pParty->uFine )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
629 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
630 pShopOptions[1] = pGlobalTXT_LocalizationStrings[603];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
631 v11 = 2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
632 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
633 for ( i = 0; i < v11; ++i )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
634 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
635 v13 = pFontArrus->CalcTextHeight(pShopOptions[i], &_this, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
636 pOutString = (GUIFont *)((char *)pOutString + v13);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
637 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
638 v29 = (100 - (signed int)pOutString) / v11;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
639 v14 = pDialogueWindow;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
640 v15 = 80 - v11 * (100 - (signed int)pOutString) / v11 - (signed int)pOutString;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
641 v16 = v15 - HIDWORD(v15);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
642 LODWORD(v15) = pDialogueWindow->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
643 HIDWORD(v15) = v15 + pDialogueWindow->pNumPresenceButton;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
644 v17 = (v16 >> 1) - v29 / 2 + 158;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
645 v18 = -pDialogueWindow->pNumPresenceButton < 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
646 pOutString = (GUIFont *)pDialogueWindow->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
647 if ( v18 ^ __OFSUB__((int)v15, HIDWORD(v15)) )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
648 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
649 v31 = 2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
650 v19 = pShopOptions;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
651 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
652 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
653 v20 = v14->GetControl((unsigned int)pOutString);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
654 v21 = v20;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
655 v20->uY = v29 + v17;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
656 v22 = pFontArrus->CalcTextHeight(*v19, &_this, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
657 v23 = v21->uY;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
658 v21->uHeight = v22;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
659 v17 = v23 + v22 - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
660 v21->uW = v17;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
661 v24 = v30;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
662 if ( pDialogueWindow->pCurrentPosActiveItem != v31 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
663 v24 = v28;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
664 _this.DrawTitleText(pFontArrus, 0, v23, v24, *v19, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
665 v14 = pDialogueWindow;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
666 ++v31;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
667 ++v19;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
668 pOutString = (GUIFont *)((char *)pOutString + 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
669 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
670 while ( (signed int)pOutString < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
671 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
672 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
673 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
674 case 99:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
675 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
676 v5 = &pMonsterStats->pInfos[word_F8B1A0];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
677 v6 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
678 v7 = v5->pName;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
679 v8 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
680 sprintf(pTmpBuf, &byte_4F0F98, v8, v7, v6);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
681 sprintf(pTmpBuf2, dword_F8B1A4, pTmpBuf, 100 * v5->uLevel);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
682 ptr_F8B1E8 = pTmpBuf2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
683 memcpy(&a1, pDialogueWindow, sizeof(a1));
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
684 w.uFrameWidth = 458;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
685 w.uFrameZ = 457;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
686 pOutString = pFontArrus;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
687 v9 = pFontArrus->CalcTextHeight(pTmpBuf2, &w, 13, 0) + 7;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
688 if ( 352 - v9 < 8 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
689 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
690 pOutString = pFontCreate;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
691 v9 = pFontCreate->CalcTextHeight(ptr_F8B1E8, &w, 13, 0) + 7;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
692 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
693
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
694 auto pTex = (uTextureID_Leather != -1 ? &pIcons_LOD->pTextures[uTextureID_Leather] : 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
695 pRenderer->_4A6A68(8u, 352 - v9, pTex, (pTex ? pTex->uTextureHeight : 26) - v9);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
696 pRenderer->DrawTextureIndexed(8u, 347 - v9, pTexture_591428);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
697 v10 = FitTextInAWindow(ptr_F8B1E8, pOutString, &w, 0xDu, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
698 a1.DrawText(pOutString, 13, 354 - v9, 0, v10, 0, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
699 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
700 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
701 case 100:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
702 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
703 v0 = window_SpeakInHouse;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
704 if ( window_SpeakInHouse->field_40 == 1 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
705 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
706 sprintf(pTmpBuf, "%s\n%s", pGlobalTXT_LocalizationStrings[606], pGlobalTXT_LocalizationStrings[112]);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
707 _this.DrawTitleText(pFontArrus, 0, 0x92u, v30, pTmpBuf, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
708 _this.DrawTitleText(pFontArrus, 0, 0xBAu, v28, (const char *)pKeyActionMap->pPressedKeysBuffer, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
709 v3 = pFontArrus;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
710 v4 = pFontArrus->GetLineWidth((const char *)pKeyActionMap->pPressedKeysBuffer);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
711 _this.DrawFlashingInputCursor(v4 / 2 + 80, 185, v3);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
712 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
713 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
714 if ( window_SpeakInHouse->field_40 == 2 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
715 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
716 v1 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
717 v2 = v1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
718 if ( v1 <= 0 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
719 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
720 //LABEL_8:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
721 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
722 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
723 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
724 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
725 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
726 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
727 ++pMessageQueue_50CBD0->uNumMessages;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
728 }*/
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
729 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
730 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
731 if ( v1 > pParty->uNumGold )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
732 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
733 HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 2);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
734 v2 = pParty->uNumGold;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
735 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
736 if ( v2 > pParty->uFine )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
737 v2 = pParty->uFine;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
738 Party::TakeGold(v2);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
739 pParty->uFine -= v2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
740 if ( pParty->uFine < 0 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
741 pParty->uFine = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
742 if ( uActiveCharacter )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
743 pPlayers[uActiveCharacter]->PlaySound(SPEECH_81, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
744 v0 = window_SpeakInHouse;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
745 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
746 if ( window_SpeakInHouse->field_40 == 3 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
747 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
748 v0->field_40 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
749 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
750 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
751 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
752 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
753 default:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
754 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
755 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
756 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
757 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
758 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
759 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
760 // F8B19C: using guessed type int dword_F8B19C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
761 // F8B1A0: using guessed type __int16 word_F8B1A0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
762
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
763 //----- (004B7D7E) --------------------------------------------------------
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
764 void __cdecl BankDialog()
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
765 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
766 GUIWindow *v0; // eax@4
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
767 int v1; // ecx@5
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
768 int v2; // eax@6
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
769 unsigned int v3; // esi@6
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
770 GUIFont *v4; // ST10_4@12
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
771 int v5; // eax@12
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
772 int v6; // eax@19
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
773 unsigned int v7; // esi@19
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
774 unsigned __int16 v8; // ax@27
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
775 unsigned __int16 v9; // ax@29
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
776 char *v10; // [sp-8h] [bp-70h]@11
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
777 char *v11; // [sp-4h] [bp-6Ch]@11
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
778 GUIWindow _this; // [sp+Ch] [bp-5Ch]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
779 __int16 v13[2]; // [sp+60h] [bp-8h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
780 __int16 v14[2]; // [sp+64h] [bp-4h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
781
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
782 memcpy(&_this, window_SpeakInHouse, sizeof(_this));
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
783 _this.uFrameX = 483;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
784 _this.uFrameWidth = 148;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
785 _this.uFrameZ = 334;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
786 *(int *)v13 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
787 *(int *)v14 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
788 sprintf(pTmpBuf, "%s: %d", pGlobalTXT_LocalizationStrings[25], pParty->uNumGoldInBank);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
789 _this.DrawTitleText(pFontArrus, 0, 0xDCu, v14[0], pTmpBuf, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
790 switch(dialog_menu_id)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
791 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
792 case 1:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
793 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
794 v8 = v14[0];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
795 if ( pDialogueWindow->pCurrentPosActiveItem != 2 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
796 v8 = v13[0];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
797 _this.DrawTitleText(pFontArrus, 0, 0x92u, v8, pGlobalTXT_LocalizationStrings[60], 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
798 v9 = v14[0];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
799 if ( pDialogueWindow->pCurrentPosActiveItem != 3 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
800 v9 = v13[0];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
801 _this.DrawTitleText(pFontArrus, 0, 0xB0u, v9, pGlobalTXT_LocalizationStrings[244], 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
802 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
803 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
804 case 7:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
805 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
806 v0 = window_SpeakInHouse;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
807 if ( window_SpeakInHouse->field_40 != 1 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
808 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
809 v1 = window_SpeakInHouse->field_40 - 2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
810 if ( window_SpeakInHouse->field_40 == 2 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
811 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
812 v6 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
813 v7 = v6;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
814 if ( !v6 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
815 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
816 //LABEL_17:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
817 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
818 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
819 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
820 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
821 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
822 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
823 ++pMessageQueue_50CBD0->uNumMessages;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
824 }*/
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
825 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
826 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
827 if ( v6 > pParty->uNumGold )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
828 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
829 HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 2);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
830 v7 = pParty->uNumGold;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
831 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
832 if ( v7 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
833 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
834 Party::TakeGold(v7);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
835 pParty->uNumGoldInBank += v7;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
836 if ( uActiveCharacter )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
837 pPlayers[uActiveCharacter]->PlaySound(SPEECH_81, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
838 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
839 v0 = window_SpeakInHouse;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
840 v0->field_40 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
841 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
842 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
843 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
844 if ( v1 != 1 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
845 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
846 v0->field_40 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
847 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
848 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
849 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
850 v11 = pGlobalTXT_LocalizationStrings[112];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
851 v10 = pGlobalTXT_LocalizationStrings[60];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
852 sprintf(pTmpBuf, "%s\n%s", v10, v11);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
853 _this.DrawTitleText(pFontArrus, 0, 0x92u, v14[0], pTmpBuf, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
854 _this.DrawTitleText(pFontArrus, 0, 0xBAu, v13[0], (const char *)pKeyActionMap->pPressedKeysBuffer, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
855 v4 = pFontArrus;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
856 v5 = pFontArrus->GetLineWidth((const char *)pKeyActionMap->pPressedKeysBuffer);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
857 _this.DrawFlashingInputCursor(v5 / 2 + 80, 185, v4);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
858 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
859 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
860
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
861 case 8:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
862 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
863 v0 = window_SpeakInHouse;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
864 if ( window_SpeakInHouse->field_40 != 1 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
865 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
866 v1 = window_SpeakInHouse->field_40 - 2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
867 if ( window_SpeakInHouse->field_40 == 2 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
868 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
869 window_SpeakInHouse->field_40 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
870 v2 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
871 v3 = v2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
872 if ( v2 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
873 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
874 if ( v2 > pParty->uNumGoldInBank )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
875 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
876 HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 2);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
877 v3 = pParty->uNumGoldInBank;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
878 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
879 if ( v3 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
880 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
881 Party::SetGold(pParty->uNumGold + v3);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
882 pParty->uNumGoldInBank -= v3;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
883 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
884 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
885 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
886 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
887 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
888 if ( v1 != 1 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
889 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
890 v0->field_40 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
891 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
892 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
893 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
894 v11 = pGlobalTXT_LocalizationStrings[112];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
895 v10 = pGlobalTXT_LocalizationStrings[244];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
896 sprintf(pTmpBuf, "%s\n%s", v10, v11);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
897 _this.DrawTitleText(pFontArrus, 0, 0x92u, v14[0], pTmpBuf, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
898 _this.DrawTitleText(pFontArrus, 0, 0xBAu, v13[0], (const char *)pKeyActionMap->pPressedKeysBuffer, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
899 v4 = pFontArrus;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
900 v5 = pFontArrus->GetLineWidth((const char *)pKeyActionMap->pPressedKeysBuffer);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
901 _this.DrawFlashingInputCursor(v5 / 2 + 80, 185, v4);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
902 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
903 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
904 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
905
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
906 default:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
907 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
908 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
909 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
910 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
911 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
912 // F8B19C: using guessed type int dword_F8B19C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
913
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
914 //----- (004B8285) --------------------------------------------------------
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
915 void __cdecl TavernDialog()
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
916 {
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
917 int v0;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
918 int pItemNum;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
919 double v2; // st7@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
920 signed int v3; // ebx@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
921 int v4; // ecx@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
922 int v5; // esi@3
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
923 signed int v6; // edi@5
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
924 int v7; // ecx@5
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
925 int pNumString; // edi@16
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
926 signed int v9; // esi@16
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
927 unsigned int pNumActiveItem; // esi@18
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
928 int v11; // eax@18
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
929 unsigned int v12; // eax@19
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
930 int v13; // eax@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
931 int v14; // ecx@26
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
932 //GUIButton *v15; // eax@28
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
933 //GUIButton *v16; // esi@28
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
934 int v17; // eax@28
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
935 char *v18; // eax@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
936 int v19; // eax@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
937 unsigned int v20; // ecx@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
938 int v21; // edx@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
939 int v22; // eax@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
940 unsigned __int16 v23; // ax@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
941 int v24; // eax@34
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
942 int v25; // eax@34
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
943 char *v26; // esi@36
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
944 int v27; // edi@46
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
945 unsigned int pColorText; // eax@57
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
946 signed int v31; // eax@59
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
947 //GUIWindow *v33; // edi@64
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
948 int v34; // eax@64
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
949 int v35; // ecx@64
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
950 int v36; // esi@64
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
951 char v37; // sf@64
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
952 GUIButton *pButton; // eax@65
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
953 int v39; // edx@69
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
954 int v40; // ecx@69
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
955 int v41; // ecx@69
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
956 int v42; // ecx@70
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
957 unsigned int v43; // edx@70
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
958 int v44; // edx@71
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
959 int v45; // ecx@71
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
960 int v46; // ecx@72
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
961 int v47; // eax@74
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
962 signed int v48; // edi@77
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
963 signed int i; // esi@79
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
964 int v50; // eax@80
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
965 //GUIWindow *v51; // ecx@81
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
966 _QWORD v52; // qax@81
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
967 signed int v53; // edi@81
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
968 int v54; // edi@81
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
969 //GUIButton *v55; // esi@83
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
970 const char **v56; // eax@83
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
971 int v57; // eax@83
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
972 unsigned int v58; // ecx@83
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
973 //Player *v59; // edx@83
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
974 unsigned __int16 v60; // ax@83
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
975 int v61; // eax@99
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
976 char *v63; // eax@99
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
977 GUIFont *v64; // edx@99
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
978 GUIFont *v65; // edi@100
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
979 unsigned int v66; // [sp-10h] [bp-284h]@75
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
980 unsigned __int16 v67; // [sp-Ch] [bp-280h]@75
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
981 int v68; // [sp-Ch] [bp-280h]@99
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
982 char *v69; // [sp-8h] [bp-27Ch]@75
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
983 int v70; // [sp-8h] [bp-27Ch]@99
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
984 unsigned int v71; // [sp-4h] [bp-278h]@75
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
985 const char *v72; // [sp-4h] [bp-278h]@93
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
986 unsigned int v73; // [sp-4h] [bp-278h]@99
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
987 char Dest[100]; // [sp+Ch] [bp-268h]@55
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
988 char v75[100]; // [sp+70h] [bp-204h]@59
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
989 char a1[100]; // [sp+D4h] [bp-1A0h]@57
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
990 char v77[100]; // [sp+138h] [bp-13Ch]@59
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
991 //GUIWindow v78; // [sp+19Ch] [bp-D8h]@99
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
992 GUIWindow dialog_window; // [sp+1F0h] [bp-84h]@1
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
993 char *Str[2]; // [sp+244h] [bp-30h]@30
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
994 unsigned int pColorWhite; // [sp+24Ch] [bp-28h]@1
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
995 unsigned __int8 v82; // [sp+253h] [bp-21h]@59
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
996 int v83; // [sp+254h] [bp-20h]@1
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
997 int pColorYellow; // [sp+258h] [bp-1Ch]@1
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
998 Player *pPlayer; // [sp+25Ch] [bp-18h]@1
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
999 int all_text_height; // [sp+260h] [bp-14h]@18
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1000 unsigned __int8 v87; // [sp+266h] [bp-Eh]@59
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1001 unsigned __int8 v88; // [sp+267h] [bp-Dh]@57
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1002 int v89; // [sp+268h] [bp-Ch]@1
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1003 unsigned int pTextHeight; // [sp+26Fh] [bp-5h]@55
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1004 int v91; // [sp+270h] [bp-4h]@3
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1005 GUIFont *pOutString;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1006
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1007 pPlayer = pPlayers[uActiveCharacter];
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1008 memcpy(&dialog_window, window_SpeakInHouse, sizeof(dialog_window));
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1009 dialog_window.uFrameX = 483;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1010 dialog_window.uFrameWidth = 148;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1011 dialog_window.uFrameZ = 334;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1012 pColorWhite = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1013 pColorYellow = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1014 v2 = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1015 *(float *)&v83 = v2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1016 *(float *)&v89 = v2 * v2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1017 v3 = (signed __int64)(*(float *)&v89 * 0.1);
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1018 v4 = v3 * (100 - pPlayer->GetMerchant()) / 100;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1019 if ( v4 < v3 / 3 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1020 v4 = v3 / 3;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1021 v5 = 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1022 pOutString = (GUIFont *)v4;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1023 if ( v4 <= 0 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1024 pOutString = (GUIFont *)1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1025 v6 = (signed __int64)(*(float *)&v89 * *(float *)&v83 * 0.0099999998);
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1026 v7 = v6 * (100 - pPlayer->GetMerchant()) / 100;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1027 if ( v7 < v6 / 3 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1028 v7 = v6 / 3;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1029 v83 = v7;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1030 if ( v7 <= 0 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1031 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1032 v7 = 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1033 v83 = 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1034 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1035 switch(dialog_menu_id)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1036 {
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1037 case DIALOG_SHOP_MAIN:
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1038 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1039 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
1040 return;
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1041 pColorText = pColorYellow;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1042 if ( pDialogueWindow->pCurrentPosActiveItem != 2 )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1043 pColorText = pColorWhite;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1044 sprintf(Dest, format_4E2DC8, pColorText);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1045 sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[178], pOutString);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1046 strcat(Dest, pTmpBuf2);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1047 pTextHeight = pFontArrus->CalcTextHeight(Dest, &dialog_window, 0, 0);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1048 strcat(Dest, "\n \n");
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1049 pColorText = pColorYellow;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1050 if ( pDialogueWindow->pCurrentPosActiveItem != 3 )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1051 pColorText = pColorWhite;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1052 sprintf(a1, format_4E2DC8, pColorText);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1053 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[86],
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1054 (signed __int64)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier,
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1055 v83);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1056 strcat(a1, pTmpBuf2);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1057 v88 = pFontArrus->CalcTextHeight(a1, &dialog_window, 0, 0);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1058 strcat(a1, "\n \n");
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1059 pColorText = pColorYellow;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1060 if ( pDialogueWindow->pCurrentPosActiveItem != 4 )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1061 pColorText = pColorWhite;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1062 sprintf(v77, format_4E2DC8, pColorText);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1063 strcat(v77, pGlobalTXT_LocalizationStrings[160]);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1064 v82 = pFontArrus->CalcTextHeight(v77, &dialog_window, 0, 0);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1065 strcat(v77, "\n \n");
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1066 v75[0] = 0;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1067 pTextHeight = 0;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1068 v31 = (signed int)window_SpeakInHouse->ptr_1C;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1069 if ( v31 >= 108 && v31 <= 120 )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1070 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1071 pColorText = pColorYellow;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1072 if ( pDialogueWindow->pCurrentPosActiveItem != 5 )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1073 pColorText = pColorWhite;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1074 sprintf(v75, format_4E2DC8, pColorText);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1075 strcat(v75, pGlobalTXT_LocalizationStrings[611]);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1076 pTextHeight = pFontArrus->CalcTextHeight(v75, &dialog_window, 0, 0);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1077 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1078 v34 = pDialogueWindow->pStartingPosActiveItem;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1079 v35 = v34 + pDialogueWindow->pNumPresenceButton;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1080 v36 = LOBYTE(pFontArrus->uFontHeight) - 3;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1081 v37 = -pDialogueWindow->pNumPresenceButton < 0;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1082 pOutString = (GUIFont *)pDialogueWindow->pStartingPosActiveItem;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1083 if ( !(v37 ^ v34 < v35) )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1084 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1085 sprintf(pTmpBuf, "%s%s%s%s", &Dest, &a1, &v77, &v75);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1086 dialog_window.DrawTitleText(pFontArrus, 0, 146, 0, pTmpBuf, 3);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1087 return;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1088 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1089 while ( 1 )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1090 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1091 pButton = pDialogueWindow->GetControl((unsigned int)pOutString);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1092 if ( pButton->uControlParam == 15 )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1093 {
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1094 v46 = pTextHeight;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1095 pButton->uHeight = pTextHeight;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1096 pButton->uY = 146;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1097 v41 = v46 + 145;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1098 pButton->uW = v41;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1099 }
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1100 else if ( pButton->uControlParam == 16 )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1101 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1102 v44 = v88;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1103 v45 = pTextHeight + v36 + 146;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1104 pButton->uHeight = v88;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1105 pButton->uY = v45;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1106 v41 = v45 + v44 - 1;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1107 pButton->uW = v41;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1108 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1109 else if ( pButton->uControlParam == 96 )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1110 {
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1111 v42 = pTextHeight + v88 + 2 * v36 + 146;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1112 v43 = v82;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1113 pButton->uY = v42;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1114 pButton->uHeight = v43;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1115 v41 = v43 + v42 - 1;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1116 pButton->uW = v41;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1117 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1118 else if ( pButton->uControlParam == 101 )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1119 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1120 v39 = pTextHeight + 3 * v36 + pTextHeight + v88 + 146;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1121 v40 = v87;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1122 pButton->uHeight = pTextHeight;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1123 pButton->uY = v39;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1124 v41 = v39 + v40 - 1;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1125 pButton->uW = v41;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1126 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1127 pOutString = (GUIFont *)((char *)pOutString + 1);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1128 if ( (signed int)pOutString >= pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1129 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1130 sprintf(pTmpBuf, "%s%s%s%s", &Dest, &a1, &v77, &v75);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1131 dialog_window.DrawTitleText(pFontArrus, 0, 146, 0, pTmpBuf, 3);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1132 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1133 }
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1134 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1135 break;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1136 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1137 case DIALOG_SHOP_ARCOMAGE_102:
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1138 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1139 __debugbreak;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1140 pOutString = pFontArrus;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1141 strcpy(pTmpBuf, pNPCTopics[354].pText);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1142 dialog_window.uFrameWidth = 460;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1143 dialog_window.uFrameZ = 452;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1144 pTextHeight = pFontArrus->CalcTextHeight(pTmpBuf, &dialog_window, 12, 0) + 7;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1145 if ( 352 - pTextHeight < 8 )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1146 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1147 pOutString = pFontCreate;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1148 pTextHeight = pFontCreate->CalcTextHeight(pTmpBuf, &dialog_window, 12, 0) + 7;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1149 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1150 auto pTex = (uTextureID_Leather != -1 ? &pIcons_LOD->pTextures[uTextureID_Leather] : 0);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1151 pRenderer->_4A6A68(8, 352 - pTextHeight, pTex, (pTex ? pTex->uTextureHeight : 26) - pTextHeight);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1152 pRenderer->DrawTextureIndexed(8, 347 - pTextHeight, pTexture_591428);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1153 v63 = FitTextInAWindow(pTmpBuf, pOutString, &dialog_window, 0xCu, 0);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1154 window_SpeakInHouse->DrawText(pOutString, 12, 354 - pTextHeight, 0, v63, 0, 0, 0);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1155 break;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1156 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1157 case DIALOG_SHOP_ARCOMAGE_103:
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1158 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1159 __debugbreak;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1160 strcpy(pTmpBuf, pNPCTopics[(uint)window_SpeakInHouse->ptr_1C + 247].pText);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1161 dialog_window.uFrameWidth = 460;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1162 dialog_window.uFrameZ = 452;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1163 v61 = pFontArrus->CalcTextHeight(pTmpBuf, &dialog_window, 12, 0);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1164 pTextHeight = v61 + 7;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1165 auto pTex = (uTextureID_Leather != -1 ? &pIcons_LOD->pTextures[uTextureID_Leather] : nullptr);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1166 pRenderer->_4A6A68(8, 352 - (v61 + 7), pTex, (pTex ? pTex->uTextureHeight : 26) - (v61 + 7));
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1167 pRenderer->DrawTextureIndexed(8, 347 - pTextHeight, pTexture_591428);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1168 v63 = FitTextInAWindow(pTmpBuf, pFontArrus, &dialog_window, 0xCu, 0);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1169 window_SpeakInHouse->DrawText(pFontArrus, 12, 354 - pTextHeight, 0, v63, 0, 0, 0);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1170 break;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1171 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1172 case DIALOG_SHOP_ARCOMAGE_RESULT:
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1173 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1174 if ( pArcomageGame->bGameInProgress == 1 )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1175 return;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1176 if ( pArcomageGame->uGameResult )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1177 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1178 if ( pArcomageGame->uGameResult == 1 )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1179 v72 = pGlobalTXT_LocalizationStrings[640];// You won!
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1180 else
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1181 v72 = pGlobalTXT_LocalizationStrings[641];// You lost!
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1182 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1183 else
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1184 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1185 v72 = pGlobalTXT_LocalizationStrings[639];// A tie!
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1186 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1187 strcpy(pTmpBuf, v72);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1188 v66 = (174 - pFontArrus->CalcTextHeight(pTmpBuf, &dialog_window, 0, 0)) / 2 + 138;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1189 dialog_window.DrawTitleText(pFontArrus, 0, v66, pColorYellow, pTmpBuf, 3);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1190 break;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1191 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1192 case DIALOG_SHOP_REST:
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1193 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1194 if ( pParty->uNumGold >= (unsigned int)pOutString )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1195 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1196 Party::TakeGold((unsigned int)pOutString);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1197 v27 = (int)window_SpeakInHouse->ptr_1C;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1198 HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 2);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1199 dialog_menu_id = 0;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1200 sub_4BD8B5();
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1201 sub_4B1D27();
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1202 pVideoPlayer->Unload();
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1203 window_SpeakInHouse->Release();
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1204 window_SpeakInHouse = 0;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1205 if ( pMessageQueue_50CBD0->uNumMessages )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1206 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1207 pMessageQueue_50CBD0->pMessages[0].eType = UIMSG_OpenRestUI;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1208 pMessageQueue_50CBD0->pMessages[0].param = v27;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1209 pMessageQueue_50CBD0->pMessages[0].field_8 = 1;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1210 ++pMessageQueue_50CBD0->uNumMessages;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1211 return;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1212 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1213 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1214 HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 4);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1215 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, v5, 0);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1216 break;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1217 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1218 case DIALOG_SHOP_SKILLS:
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1219 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1220 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1221 return;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1222 v0 = 0;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1223 v9 = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1224 pItemNum = v9 * (100 - pPlayer->GetMerchant()) / 100;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1225 if ( pItemNum < v9 / 3 )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1226 pItemNum = v9 / 3;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1227 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1228 all_text_height = 0;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1229 if ( pNumActiveItem < pNumActiveItem + pDialogueWindow->pNumPresenceButton )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1230 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1231 do
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1232 {
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1233 v12 = pDialogueWindow->GetControl(pNumActiveItem)->uControlParam - 36;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1234 if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayer->classType][v12] && !pPlayer->pActiveSkills[v12] )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1235 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1236 all_text_height = pFontArrus->CalcTextHeight(pSkillNames[v12], &dialog_window, 0, 0);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1237 v0++;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1238 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1239 ++pNumActiveItem;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1240 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1241 while ( pNumActiveItem < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton );
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1242 if ( v0 )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1243 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1244 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], pItemNum);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1245 dialog_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1246 v91 = (149 - all_text_height) / v0;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1247 if ( (149 - all_text_height) / v0 > 32 )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1248 v91 = 32;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1249 v14 = (149 - v0 * v91 - all_text_height) / 2 - v91 / 2 + 162;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1250 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1251 if ( pNumActiveItem < pNumActiveItem + pDialogueWindow->pNumPresenceButton )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1252 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1253 pItemNum = 2;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1254 do
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1255 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1256 pButton = pDialogueWindow->GetControl(pItemNum);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1257 v17 = pButton->uControlParam - 36;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1258 if ( !byte_4ED970_skill_learn_ability_by_class_table[pPlayer->classType][v17] || pPlayer->pActiveSkills[v17] )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1259 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1260 pButton->uW = 0;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1261 pButton->uHeight = 0;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1262 pButton->uY = 0;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1263 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1264 else
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1265 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1266 pButton->uY = v91 + v14;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1267 pTextHeight = pFontArrus->CalcTextHeight(pSkillNames[v17], &dialog_window, 0, 0);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1268 pButton->uHeight = pTextHeight;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1269 v14 = pTextHeight + pButton->uY - 1;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1270 pButton->uW = v14;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1271 pColorText = pColorYellow;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1272 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1273 pColorText = pColorWhite;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1274 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, pSkillNames[v17], 3);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1275 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1276 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1277 pItemNum++;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1278 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1279 while ( pItemNum < pNumActiveItem );
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1280 }
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1281 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1282 }
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1283 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1284 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], pPlayer->pName, pClassNames[pPlayer->classType]);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1285 strcat(pTmpBuf, "\n \n");
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1286 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1287 pTextHeight = (174 - pFontArrus->CalcTextHeight(pTmpBuf, &dialog_window, 0, 0)) / 2 + 138;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1288 dialog_window.DrawTitleText(pFontArrus, 0, pTextHeight, pColorYellow, pTmpBuf, 3);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1289 return;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1290 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1291 case DIALOG_SHOP_BYE_FOOD:
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1292 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1293 *(_QWORD *)Str = pParty->uNumFoodRations;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1294 //if ( (double)pParty->uNumFoodRations >= p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C] )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1295 if ( (double)pParty->uNumFoodRations >= p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1296 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1297 ShowStatusBarString(pGlobalTXT_LocalizationStrings[140], 2);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1298 if ( uActiveCharacter )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1299 pPlayers[uActiveCharacter]->PlaySound(SPEECH_67, 0);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1300 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, v5, 0);
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1301 return;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1302 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1303 if ( pParty->uNumGold >= v7 )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1304 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1305 Party::TakeGold(v7);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1306 //pParty->uNumFoodRations = (signed __int64)p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C];
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1307 pParty->uNumFoodRations = (signed __int64)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1308 HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 3);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1309 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1310 return;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1311 }
646
Ritor1
parents: 644
diff changeset
1312 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2);
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1313 HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 4);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1314 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, v5, 0);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1315 break;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1316 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1317 case DIALOG_SHOP_ARCOMAGE_MAIN:
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1318 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1319 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1320 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1321 v48 = 2;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1322 pShopOptions[0] = pGlobalTXT_LocalizationStrings[620];
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1323 pShopOptions[1] = pGlobalTXT_LocalizationStrings[622];
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1324 pOutString = 0;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1325 if ( pParty->HasItem(0x28Bu) )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1326 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1327 pShopOptions[2] = pGlobalTXT_LocalizationStrings[621];
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1328 v48 = 3;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1329 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1330 for ( i = 0; i < v48; ++i )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1331 all_text_height = pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1332 all_text_height = (174 - all_text_height) / v48;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1333 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1334 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
1335 v37 = -pDialogueWindow->pNumPresenceButton < 0;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1336 if ( v37 ^ pNumActiveItem < pNumActiveItem + pDialogueWindow->pNumPresenceButton )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1337 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1338 pItemNum = 2;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1339 pNumString = 0;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1340 do
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1341 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1342 pButton = pDialogueWindow->GetControl(pItemNum);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1343 pButton->uY = all_text_height + v54;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1344 pTextHeight = pFontArrus->CalcTextHeight((const char *)pShopOptions[pNumString], &dialog_window, 0, 0);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1345 pButton->uHeight = pTextHeight;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1346 v54 = pButton->uY + pTextHeight - 1;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1347 pButton->uW = v54;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1348 pColorText = pColorYellow;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1349 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum )
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1350 pColorText = pColorWhite;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1351 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, *(const char **)&pOutString->cFirstChar, 3);
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1352 pItemNum++;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1353 pNumActiveItem = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1354 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1355 while ( pItemNum < pNumActiveItem );
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1356 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1357 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1358 break;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1359 }
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1360 default:
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1361 {
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1362 break;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1363 }
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1364 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1365 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1366
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1367
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1368 //----- (004B910F) --------------------------------------------------------
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1369 void __cdecl WeaponShopDialog()
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1370 {
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1371 int v0; // ebx@1
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1372 int pNumActiveItem; // eax@6
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1373 signed int v2; // esi@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1374 ItemGen *v4; // eax@11
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1375 char *v5; // ecx@12
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1376 unsigned __int8 v6; // dl@13
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1377 char *v7; // edx@14
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1378 int v9; // ST08_4@16
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1379 int v10; // eax@16
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1380 signed int v11; // esi@18
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1381 int v12; // ST08_4@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1382 int v13; // eax@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1383 int v14; // edi@23
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1384 char **v15; // esi@23
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1385 int v16; // eax@24
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1386 //int v18; // edx@25
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1387 int v19; // edi@25
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1388 unsigned __int8 v20; // sf@25
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1389 GUIButton *pButton; // esi@27
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1390 int pNewItem; // eax@27
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1391 unsigned int v24; // ecx@27
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1392 int v25; // edx@27
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1393 unsigned int pColorText; // ax@27
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1394 signed int v27; // esi@32
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1395 int v28; // ST08_4@36
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1396 int v29; // eax@36
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1397 signed int v32; // esi@41
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1398 unsigned int v33; // esi@43
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1399 int v34; // eax@43
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1400 unsigned int v35; // eax@44
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1401 int v36; // eax@46
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1402 __int32 v37; // ecx@51
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1403 int v40; // eax@53
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1404 char *v41; // eax@55
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1405 unsigned int v43; // ecx@55
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1406 const char **v44; // edx@55
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1407 int v45; // eax@55
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1408 int v47; // eax@59
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1409 const char **v48; // eax@63
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1410 unsigned int v49; // esi@65
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1411 Texture *v50; // eax@65
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1412 int v51; // edi@65
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1413 int v52; // esi@70
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1414 Texture *v53; // ST1C_4@70
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1415 int v54; // edi@70
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1416 signed int v55; // ecx@73
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1417 SHORT v56; // di@82
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1418 bool v57; // eax@82
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1419 const char *v58; // ecx@84
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1420 POINT *v59; // esi@89
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1421 LONG v60; // ecx@90
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1422 int v61; // eax@90
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1423 int v62; // ecx@90
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1424 ItemGen *v63; // esi@90
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1425 int v64; // eax@95
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1426 int all_text_height; // esi@96
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1427 char **v66; // edi@96
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1428 int v67; // eax@97
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1429 int v69; // edx@98
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1430 int v70; // edi@98
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1431 int v71;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1432 const char **v72; // eax@100
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1433 int pTextHeight; // eax@100
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1434 unsigned int v74; // ecx@100
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1435 int v78; // [sp-14h] [bp-10Ch]@14
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1436 ItemGen *v79; // [sp-10h] [bp-108h]@12
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1437 int v80; // [sp-10h] [bp-108h]@14
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1438 void *v81; // [sp-Ch] [bp-104h]@12
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1439 unsigned __int16 v82; // [sp-Ch] [bp-104h]@14
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1440 int v83; // [sp-8h] [bp-100h]@11
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1441 char *v84; // [sp-8h] [bp-100h]@14
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1442 __int64 *v85; // [sp-4h] [bp-FCh]@11
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1443 unsigned int v86; // [sp-4h] [bp-FCh]@14
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1444 POINT v87; // [sp+Ch] [bp-ECh]@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1445 POINT v88; // [sp+14h] [bp-E4h]@18
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1446 POINT v89; // [sp+1Ch] [bp-DCh]@89
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1447 POINT v90; // [sp+24h] [bp-D4h]@19
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1448 POINT v91; // [sp+2Ch] [bp-CCh]@89
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1449 POINT v92; // [sp+34h] [bp-C4h]@9
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1450 POINT v93; // [sp+3Ch] [bp-BCh]@33
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1451 POINT v94; // [sp+44h] [bp-B4h]@18
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1452 POINT v95; // [sp+4Ch] [bp-ACh]@32
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1453 POINT v96; // [sp+54h] [bp-A4h]@18
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1454 POINT v97; // [sp+5Ch] [bp-9Ch]@32
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1455 POINT a2; // [sp+64h] [bp-94h]@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1456 POINT v99; // [sp+6Ch] [bp-8Ch]@32
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1457 POINT v100; // [sp+74h] [bp-84h]@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1458 GUIWindow dialog_window; // [sp+7Ch] [bp-7Ch]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1459 char *Str; // [sp+D0h] [bp-28h]@55
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1460 __int32 v103; // [sp+D4h] [bp-24h]@25
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1461 int pColorYellow; // [sp+D8h] [bp-20h]@1
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1462 int pColorWhite; // [sp+DCh] [bp-1Ch]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1463 POINT v106; // [sp+E0h] [bp-18h]@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1464 Player *pPlayer; // [sp+E8h] [bp-10h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1465 int pItemNum; // [sp+ECh] [bp-Ch]@26
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1466 const char **v109; // [sp+F0h] [bp-8h]@26
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1467 unsigned __int8 v110; // [sp+F7h] [bp-1h]@16
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1468 int pNumString;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1469
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1470 pPlayer = pPlayers[uActiveCharacter];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1471 memcpy(&dialog_window, window_SpeakInHouse, sizeof(dialog_window));
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1472 dialog_window.uFrameX = 483;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1473 dialog_window.uFrameWidth = 148;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1474 dialog_window.uFrameZ = 334;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1475 pColorWhite = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1476 pColorYellow = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1477 switch(dialog_menu_id)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1478 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1479 case DIALOG_SHOP_MAIN:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1480 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1481 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
1482 if ( pNumActiveItem )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1483 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1484 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1485 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1486 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1487 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1488 all_text_height = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1489 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
1490 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1491 v103 = (174 - all_text_height) / 4;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1492 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1493 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
1494 v20 = -pDialogueWindow->pNumPresenceButton < 0;
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1495 if ( v20 ^ pNumActiveItem > pNumActiveItem + pDialogueWindow->pNumPresenceButton )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1496 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1497 pItemNum = 2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1498 pNumString = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1499 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1500 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1501 pButton = pDialogueWindow->GetControl(pItemNum);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1502 pButton->uY = v103 + v19;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1503 pTextHeight = pFontArrus->CalcTextHeight((const char *)pShopOptions[pNumString], &dialog_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1504 pButton->uHeight = pTextHeight;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1505 v19 = pButton->uY + pTextHeight - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1506 pButton->uW = v19;
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1507 pColorText = pColorYellow;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1508 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum )
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1509 pColorText = pColorWhite;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1510 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
1511 ++pItemNum;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1512 ++pNumString;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1513 pNumActiveItem = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1514 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1515 while ( pItemNum < pNumActiveItem );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1516 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1517 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1518 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1519 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1520 case DIALOG_SHOP_BUY_STANDART:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1521 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1522 pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1523 v48 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1524 pItemNum = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1525 v109 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1526 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1527 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1528 // if ( pParty->field_777C[9 * (int)&v48[3 * (unsigned int)window_SpeakInHouse->ptr_1C]] )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1529 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(int)v48].uItemID);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1530 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1531 v49 = word_F8B158[(signed int)v48];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1532 v50 = ItemsInShopTexture[(signed int)v48];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1533 v49 += 30;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1534 v51 = 60 - ((signed int)v50->uTextureWidth >> 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1535 pRenderer->DrawTextureTransparent(v51 + pItemNum, v49, v50);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1536 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
1537 v48 = v109;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1538 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1539 pItemNum += 70;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1540 v48 = (const char **)((char *)v48 + 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1541 v109 = v48;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1542 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1543 while ( (signed int)v48 < 6 );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1544 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
1545 if ( pNumActiveItem )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1546 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1547 v55 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1548 v106.x = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1549 v106.x = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1550 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1551 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1552 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v55].uItemID);//9 * (v55 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1553 ++v106.x;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1554 ++v55;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1555 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1556 while ( v55 < 6 );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1557 v56 = GetAsyncKeyState(17);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1558 v57 = pPlayer->CanSteal();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1559 Str = (char *)v57;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1560 if ( v56 && v57 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1561 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1562 v58 = pGlobalTXT_LocalizationStrings[185];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1563 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1564 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1565 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1566 v58 = pGlobalTXT_LocalizationStrings[195];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1567 if ( dialog_menu_id != 2 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1568 v58 = pGlobalTXT_LocalizationStrings[196];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1569 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1570 DrawTextAtStatusBar(v58, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1571 if ( v106.x )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1572 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1573 v59 = pMouse->GetCursorPos(&v91);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1574 pNumActiveItem = v59->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v89)->y];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1575 if ( pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1576 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1577 v60 = (pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF) - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1578 v106.x = v60;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1579 v61 = (int)window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1580 // v62 = 9 * (v60 + 12 * v61);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1581 v63 = (ItemGen *)&pParty->StandartItemsInShops[(int)v61][v60];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1582 if ( dialog_menu_id != 2 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1583 v63 = &pParty->SpecialItemsInShops[(int)v61][v60];//v63 = (ItemGen *)&pParty->field_C59C[v62 + 724];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1584 if ( !v56 || !Str )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1585 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1586 v64 = pPlayer->_490EEE(v63, 1, v61, 2);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1587 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
1588 pTextHeight = pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1589 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v7, 3);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1590 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1591 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1592 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1593 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
1594 pTextHeight = pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1595 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v7, 3);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1596 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1597 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1598 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1599 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1600 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1601 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
1602 pNumActiveItem = 0; //added
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1603 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1604 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1605 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1606 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1607 case DIALOG_SHOP_SELL:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1608 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1609 draw_leather();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1610 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1611 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1612 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
1613 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1614 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
1615 pMouse->GetCursorPos(&v94)->x <= 13) || pMouse->GetCursorPos(&v90)->x >= 462
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1616 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v106.x), !pNumActiveItem) )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1617 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1618 v79 = (ItemGen *)&pPlayer->pInventoryItems[pNumActiveItem - 1];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1619 v13 = pPlayer->_490EEE(v79, 1, (int)window_SpeakInHouse->ptr_1C, 3);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1620 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
1621 pTextHeight = pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1622 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v7, 3);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1623 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1624 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1625 case DIALOG_SHOP_IDENTIFY:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1626 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1627 draw_leather();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1628 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1629 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1630 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
1631 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1632 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
1633 pMouse->GetCursorPos(&v100)->x <= 13) || pMouse->GetCursorPos(&v92)->x >= 462
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1634 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v106.x), !pNumActiveItem) )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1635 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1636 v4 = (ItemGen *)&pPlayer->pInventoryItems[pNumActiveItem - 1];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1637 if (!v4->Identified())
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1638 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1639 v10 = pPlayer->_490EEE(v4, 1, (int)window_SpeakInHouse->ptr_1C, 4);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1640 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
1641 pTextHeight = pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1642 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v7, 3);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1643 }
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1644 else
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1645 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1646 v7 = BuilDialogueString("%24", uActiveCharacter - 1, v4, (char *)window_SpeakInHouse->ptr_1C, 4, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1647 pTextHeight = pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1648 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v7, 3);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1649 }
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1650 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1651 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1652 case DIALOG_SHOP_REPAIR:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1653 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1654 draw_leather();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1655 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1656 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[198], 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1657 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
1658 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1659 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
1660 pMouse->GetCursorPos(&v100)->x <= 13) || pMouse->GetCursorPos(&v92)->x >= 462
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1661 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v106.x), !pNumActiveItem)
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1662 || (pNumActiveItem = 9 * pNumActiveItem, !(pPlayer->field_1F5[4 * pNumActiveItem + 15] & 2)) )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1663 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1664 v4 = (ItemGen *)&pPlayer->pInventoryItems[pNumActiveItem - 1];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1665 v10 = pPlayer->_490EEE(v4, 2, (int)window_SpeakInHouse->ptr_1C, 5);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1666 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
1667 pTextHeight = (174 - pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0)) / 2 + 138;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1668 dialog_window.DrawTitleText(pFontArrus, 0, pTextHeight, pColorWhite, v7, 3);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1669 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1670 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1671 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1672 case DIALOG_SHOP_DISPLAY_EQUIPMENT:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1673 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1674 draw_leather();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1675 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1676 pShopOptions[0] = pGlobalTXT_LocalizationStrings[200];//sell
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1677 pShopOptions[1] = pGlobalTXT_LocalizationStrings[113];//identify
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1678 pShopOptions[2] = pGlobalTXT_LocalizationStrings[179];//repair
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1679 all_text_height = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1680 for ( int i = 0; i < 3; ++i )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1681 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1682 v103 = (174 - all_text_height) / 3;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1683 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1684 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
1685 v20 = -pDialogueWindow->pNumPresenceButton < 0;
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1686 if ( v20 ^ pNumActiveItem > pNumActiveItem + pDialogueWindow->pNumPresenceButton )
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1687 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1688 pItemNum = 2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1689 pNumString = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1690 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1691 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1692 pButton = pDialogueWindow->GetControl(pItemNum);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1693 pButton->uY = v103 + v70;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1694 pTextHeight = pFontArrus->CalcTextHeight((const char *)pShopOptions[pNumString], &dialog_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1695 pButton->uHeight = pTextHeight;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1696 v70 = pButton->uY + pTextHeight - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1697 pButton->uW = v70;
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1698 pColorText = pColorYellow;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1699 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum )
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1700 pColorText = pColorWhite;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1701 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
1702 ++pItemNum;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1703 ++pNumString;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1704 pNumActiveItem = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1705 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1706 while ( pItemNum < pNumActiveItem );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1707 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1708 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1709 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1710 case DIALOG_SHOP_BUY_SPECIAL:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1711 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1712 pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1713 v109 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1714 pItemNum = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1715 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1716 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1717 // 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
1718 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(signed int)v109].uItemID)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1719 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1720 v52 = word_F8B158[(signed int)v109] + 30;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1721 v53 = ItemsInShopTexture[(signed int)v109];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1722 v54 = 60 - ((signed int)v53->uTextureWidth >> 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1723 pRenderer->DrawTextureTransparent(v54 + pItemNum, word_F8B158[(signed int)v109] + 30, v53);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1724 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
1725 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1726 v109 = (const char **)((char *)v109 + 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1727 pItemNum += 70;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1728 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1729 while ( (signed int)v109 < 6 );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1730 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
1731 if ( pNumActiveItem )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1732 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1733 v55 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1734 v106.x = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1735 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1736 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1737 // 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
1738 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v55].uItemID)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1739 ++v106.x;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1740 ++v55;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1741 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1742 while ( v55 < 6 );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1743 v56 = GetAsyncKeyState(17);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1744 v57 = pPlayer->CanSteal();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1745 Str = (char *)v57;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1746 if ( v56 && v57 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1747 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1748 v58 = pGlobalTXT_LocalizationStrings[185];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1749 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1750 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1751 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1752 v58 = pGlobalTXT_LocalizationStrings[195];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1753 if ( dialog_menu_id != 2 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1754 v58 = pGlobalTXT_LocalizationStrings[196];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1755 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1756 DrawTextAtStatusBar(v58, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1757 if ( v106.x )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1758 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1759 v59 = pMouse->GetCursorPos(&v91);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1760 pNumActiveItem = v59->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v89)->y];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1761 if ( pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1762 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1763 v60 = (pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF) - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1764 v106.x = v60;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1765 v61 = (int)window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1766 // v62 = 9 * (v60 + 12 * v61);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1767 v63 = (ItemGen *)&pParty->StandartItemsInShops[(int)v61][v60];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1768 if ( dialog_menu_id != 2 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1769 v63 = &pParty->SpecialItemsInShops[(int)v61][v60];//v63 = (ItemGen *)&pParty->field_C59C[v62 + 724];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1770 if ( !v56 || !Str )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1771 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1772 v64 = pPlayer->_490EEE(v63, 1, v61, 2);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1773 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
1774 pTextHeight = pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1775 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v7, 3);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1776 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1777 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1778 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1779 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
1780 pTextHeight = pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1781 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v7, 3);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1782 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1783 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1784 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1785 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1786 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1787 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
1788 pNumActiveItem = 0; //added
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1789 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1790 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1791 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1792 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1793 case DIALOG_SHOP_SKILLS:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1794 {
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1795 if (!sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win())
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1796 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1797 v0 = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1798 all_text_height = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1799 //v32 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (signed int)v31] * 500.0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1800 v32 = (signed __int64)(p2DEvents[(signed int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1801 pItemNum = v32 * (100 - pPlayer->GetMerchant()) / 100;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1802 if ( pItemNum < v32 / 3 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1803 pItemNum = v32 / 3;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1804 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1805 if ( pNumActiveItem >= pNumActiveItem + pDialogueWindow->pNumPresenceButton )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1806 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1807 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], pPlayer->pName, pClassNames[pPlayer->classType]);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1808 strcat(pTmpBuf, "\n \n");
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1809 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1810 pTextHeight = pFontArrus->CalcTextHeight(pTmpBuf, &dialog_window, 0, 0);
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1811 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorYellow, pTmpBuf, 3);
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1812 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1813 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1814 do
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1815 {
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1816 v35 = pDialogueWindow->GetControl(pNumActiveItem)->uControlParam - 36;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1817 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
1818 {
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1819 all_text_height += pFontArrus->CalcTextHeight(pSkillNames[v35], &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1820 v0++;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1821 }
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1822 ++pNumActiveItem;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1823 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1824 while ( pNumActiveItem < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1825 if ( !v0 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1826 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1827 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], pPlayer->pName, pClassNames[pPlayer->classType]);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1828 strcat(pTmpBuf, "\n \n");
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1829 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1830 pTextHeight = pFontArrus->CalcTextHeight(pTmpBuf, &dialog_window, 0, 0);
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1831 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorYellow, pTmpBuf, 3);
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1832 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1833 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1834 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], pItemNum);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1835 dialog_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1836 v103 = (149 - all_text_height) / v0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1837 if ( (149 - all_text_height) / v0 > 32 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1838 v103 = 32;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1839 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1840 v37 = (149 - v0 * v103 - all_text_height) / 2 - v103 / 2 + 162;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1841 if ( pNumActiveItem < pNumActiveItem + pDialogueWindow->pNumPresenceButton )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1842 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1843 pItemNum = 2;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1844 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1845 {
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1846 pButton = pDialogueWindow->GetControl(pItemNum);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1847 v40 = pButton->uControlParam - 36;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1848 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
1849 {
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1850 pButton->uW = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1851 pButton->uHeight = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1852 pButton->uY = 0;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1853 }
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1854 else
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1855 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1856 pButton->uY = v103 + v37;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1857 pTextHeight = pFontArrus->CalcTextHeight(pSkillNames[v40], &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1858 pButton->uHeight = pTextHeight;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1859 v37 = pButton->uY + pTextHeight - 1;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1860 pButton->uW = v37;
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1861 pColorText = pColorYellow;
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1862 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum )
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1863 pColorText = pColorWhite;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1864 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, pSkillNames[v40], 3);
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1865 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1866 pNumActiveItem = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1867 pItemNum++;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1868 }
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1869 while ( pItemNum < pNumActiveItem );
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1870 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1871 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1872 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1873 default:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1874 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1875 if( dialog_menu_id > 5 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1876 pNumActiveItem = dialog_menu_id - 96;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1877 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1878 pNumActiveItem = dialog_menu_id - 4;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1879 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1880 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1881 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1882 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1883
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1884
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1885
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1886 //----- (004B9CC6) --------------------------------------------------------
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1887 void __cdecl AlchemistDialog()
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1888 {
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1889 int v0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1890 int pNumActiveItem; // eax@7
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1891 signed int v5; // esi@9
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1892 unsigned int v6; // esi@11
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1893 int v7; // eax@11
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1894 unsigned int v8; // eax@12
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1895 int v9; // eax@14
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1896 int v10; // ecx@19
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1897 int v13; // eax@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1898 char *v14; // eax@23
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1899 int v15; // eax@23
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1900 unsigned int v16; // ecx@23
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1901 int v17; // edx@23
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1902 int v18; // eax@23
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1903 int v20; // eax@27
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1904 char *v21; // edx@29
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1905 int v22; // esi@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1906 char **v23; // edi@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1907 int v24; // eax@31
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1908 int v26; // edx@32
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1909 int v27; // edi@32
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1910 unsigned __int8 v28; // sf@32
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1911 const char **v30; // eax@34
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1912 int v31; // eax@34
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1913 unsigned int v32; // ecx@34
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1914 int v34; // eax@34
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1915 signed int v36; // esi@39
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1916 ItemGen *v37; // eax@42
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1917 char *v38; // ecx@43
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1918 unsigned __int8 v39; // dl@44
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1919 int v40; // eax@46
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1920 int v41; // ST08_4@47
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1921 int v42; // eax@47
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1922 signed int v43; // esi@49
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1923 int v44; // ST08_4@52
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1924 int v45; // eax@52
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1925 Texture *v46; // ecx@55
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1926 unsigned int v47; // edi@55
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1927 unsigned int v48; // esi@57
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1928 int v49; // edx@61
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1929 Texture *v50; // ecx@67
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1930 unsigned int v51; // edi@67
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1931 unsigned int v52; // esi@69
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1932 int v53; // edx@73
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1933 Texture *v54; // ecx@79
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1934 unsigned int v55; // edi@79
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1935 unsigned int v56; // esi@81
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1936 int v57; // edx@85
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1937 Texture *v58; // ecx@91
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1938 unsigned int v59; // edi@91
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1939 unsigned int v60; // esi@93
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1940 int v61; // edx@97
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1941 signed int v62; // ecx@102
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1942 SHORT v63; // di@110
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1943 bool v64; // eax@110
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1944 const char *v65; // ecx@112
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1945 POINT *v66; // esi@117
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1946 int v67; // ecx@118
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1947 int v68; // eax@118
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1948 int v69; // ecx@118
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1949 ItemGen *v70; // esi@118
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1950 int v71; // eax@123
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1951 int all_text_height; // edi@125
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1952 char **v73; // esi@125
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1953 int v74; // eax@126
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1954 int pItemNum;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1955 int v76; // edx@127
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1956 int v77; // edi@127
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1957 GUIButton *pButton; // esi@129
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1958 const char **v79; // eax@129
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1959 int pTextHeight; // eax@129
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1960 unsigned int v81; // ecx@129
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1961 unsigned int pColorText; // ax@129
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1962 int v85; // [sp-14h] [bp-ECh]@29
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1963 int v86; // [sp-10h] [bp-E8h]@29
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1964 ItemGen *v87; // [sp-10h] [bp-E8h]@43
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1965 unsigned __int16 v88; // [sp-Ch] [bp-E4h]@29
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1966 void *v89; // [sp-Ch] [bp-E4h]@43
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1967 char *v90; // [sp-8h] [bp-E0h]@29
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1968 int v91; // [sp-8h] [bp-E0h]@42
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1969 unsigned int v92; // [sp-4h] [bp-DCh]@29
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1970 __int64 *v93; // [sp-4h] [bp-DCh]@42
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1971 POINT v94; // [sp+Ch] [bp-CCh]@39
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1972 POINT v95; // [sp+14h] [bp-C4h]@49
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1973 POINT v96; // [sp+1Ch] [bp-BCh]@117
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1974 POINT v97; // [sp+24h] [bp-B4h]@40
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1975 POINT v98; // [sp+2Ch] [bp-ACh]@117
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1976 POINT v99; // [sp+34h] [bp-A4h]@49
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1977 POINT v100; // [sp+3Ch] [bp-9Ch]@50
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1978 POINT v101; // [sp+44h] [bp-94h]@39
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1979 POINT v102; // [sp+4Ch] [bp-8Ch]@49
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1980 POINT a2; // [sp+54h] [bp-84h]@39
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1981 GUIWindow dialog_window; // [sp+5Ch] [bp-7Ch]@1
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1982 int v105; // [sp+B0h] [bp-28h]@19
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1983 int pColorYellow; // [sp+B4h] [bp-24h]@1
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1984 int Str; // [sp+B8h] [bp-20h]@23
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1985 int pColorWhite; // [sp+BCh] [bp-1Ch]@1
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1986 __int32 v109; // [sp+C0h] [bp-18h]@39
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1987 Player *pPlayer; // [sp+C4h] [bp-14h]@1
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1988 int pNumString; // [sp+C8h] [bp-10h]@9
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1989 unsigned int v112; // [sp+CCh] [bp-Ch]@9
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1990 unsigned __int8 v113; // [sp+D3h] [bp-5h]@47
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1991 int v114; // [sp+D4h] [bp-4h]@11
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
1992
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1993 pPlayer = pPlayers[uActiveCharacter];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1994 memcpy(&dialog_window, window_SpeakInHouse, sizeof(dialog_window));
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1995 dialog_window.uFrameX = 483;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1996 dialog_window.uFrameWidth = 148;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1997 dialog_window.uFrameZ = 334;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
1998 pColorWhite = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
1999 pColorYellow = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2000 switch(dialog_menu_id)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2001 {
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2002 case DIALOG_SHOP_MAIN:
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2003 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2004 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2005 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2006 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2007 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2008 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2009 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2010 all_text_height = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2011 for (int i = 0; i < 4; ++i)//while ( (signed int)v15 < (signed int)&unk_F8B1C8 );
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2012 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2013 Str = (174 - all_text_height) / 4;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2014 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2015 v76 = pNumActiveItem + pDialogueWindow->pNumPresenceButton;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2016 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
2017 v28 = -pDialogueWindow->pNumPresenceButton < 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2018 if ( v28 ^ pNumActiveItem > v76 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2019 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2020 pItemNum = 2;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2021 pNumString = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2022 do
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2023 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2024 pButton = pDialogueWindow->GetControl(pItemNum);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2025 pButton->uY = Str + v77;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2026 pTextHeight = pFontArrus->CalcTextHeight((const char *)pShopOptions[pNumString], &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2027 pButton->uHeight = pTextHeight;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2028 v77 = pButton->uY + pTextHeight - 1;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2029 pButton->uW = v77;
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2030 pColorText = pColorYellow;
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2031 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum )
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2032 pColorText = pColorWhite;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2033 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, (const char *)pShopOptions[pNumString], 3);
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2034 ++pItemNum;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2035 ++pNumString;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2036 pNumActiveItem = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2037 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2038 while ( pItemNum < pNumActiveItem );
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2039 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2040 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2041 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2042 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2043 case DIALOG_SHOP_BUY_STANDART:
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2044 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2045 pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2046 v114 = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2047 do
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2048 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2049 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v114].uItemID);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2050 {
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2051 v46 = ItemsInShopTexture[v114];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2052 v47 = 152 - v46->uTextureHeight;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2053 if ( (signed int)v47 < 1 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2054 v47 = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2055 v48 = 75 * v114 - v46->uTextureWidth / 2 + 40;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2056 if ( v114 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2057 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2058 if ( v114 == 5 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2059 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2060 v49 = ItemsInShopTexture[5]->uTextureWidth;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2061 if ( (signed int)v48 > 457 - v49 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2062 v48 = 457 - v49;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2063 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2064 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2065 else if ( (signed int)v48 < 18 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2066 v48 = 18;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2067 pRenderer->DrawTextureTransparent(v48, v47, v46);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2068 sub_40F92A(&pRenderer->pActiveZBuffer[v48 + 640 * v47], ItemsInShopTexture[v114], v114 + 1);
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2069 }
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2070 ++v114;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2071 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2072 while ( v114 < 6 );
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2073 v114 = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2074 do
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2075 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2076 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v114+1].uItemID);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2077 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2078 v50 = ItemsInShopTexture[v114 + 6];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2079 v51 = 308 - v50->uTextureHeight;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2080 if ( (signed int)v51 < 1 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2081 v51 = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2082 v52 = 75 * v114 - v50->uTextureWidth / 2 + 40;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2083 if ( v114 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2084 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2085 if ( v114 == 5 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2086 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2087 v53 = ItemsInShopTexture[11]->uTextureWidth;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2088 if ( (signed int)v52 > 457 - v53 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2089 v52 = 457 - v53;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2090 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2091 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2092 else
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2093 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2094 if ( (signed int)v52 < 18 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2095 v52 = 18;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2096 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2097 pRenderer->DrawTextureTransparent(v52, v51, v50);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2098 sub_40F92A(&pRenderer->pActiveZBuffer[v52 + 640 * v51], ItemsInShopTexture[v114 + 6], v114 + 7);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2099 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2100 ++v114;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2101 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2102 while ( v114 < 6 );
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2103 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2104 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2105 v62 = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2106 v109 = 0;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2107 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2108 {
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2109 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v62].uItemID);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2110 ++v109;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2111 ++v62;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2112 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2113 while ( v62 < 12 );
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2114 v63 = GetAsyncKeyState(17);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2115 v64 = pPlayer->CanSteal();
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2116 Str = v64;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2117 if ( v63 && v64 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2118 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2119 v65 = pGlobalTXT_LocalizationStrings[185];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2120 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2121 else if ( dialog_menu_id == 2 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2122 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2123 v65 = pGlobalTXT_LocalizationStrings[195];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2124 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2125 else
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2126 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2127 v65 = pGlobalTXT_LocalizationStrings[196];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2128 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2129 DrawTextAtStatusBar(v65, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2130 if ( !v109 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2131 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2132 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
2133 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2134 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2135 v66 = pMouse->GetCursorPos(&v98);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2136 pNumActiveItem = v66->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v96)->y];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2137 if ( pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2138 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2139 v67 = (pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF) - 1;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2140 v70 = (ItemGen *)&pParty->StandartItemsInShops[(int)window_SpeakInHouse->ptr_1C][v67];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2141 if ( dialog_menu_id != 2 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2142 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
2143 if ( !v63 || !Str )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2144 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2145 v71 = pPlayer->_490EEE(v70, 4, (int)window_SpeakInHouse->ptr_1C, 2);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2146 v38 = (char *)pMerchantsBuyPhrases[v71];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2147 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2148 else
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2149 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2150 v38 = pGlobalTXT_LocalizationStrings[181];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2151 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2152 v21 = BuilDialogueString(v38, uActiveCharacter - 1, v70, (char *)window_SpeakInHouse->ptr_1C, 2, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2153 v40 = pFontArrus->CalcTextHeight(v21, &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2154 dialog_window.DrawTitleText(pFontArrus, 0, (174 - v40) / 2 + 138, pColorWhite, v21, 3);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2155 return ;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2156 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2157 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2158 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2159 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2160 case DIALOG_SHOP_SELL:
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2161 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2162 draw_leather();
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2163 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2164 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2165 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2166 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2167 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
2168 pMouse->GetCursorPos(&v102)->x <= 13) || pMouse->GetCursorPos(&v100)->x >= 462
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2169 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v109), !pNumActiveItem) )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2170 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2171 v87 = (ItemGen *)&pPlayer->pInventoryItems[pNumActiveItem - 1];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2172 v45 = pPlayer->_490EEE(v87, 4, (int)window_SpeakInHouse->ptr_1C, 3);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2173 v21 = BuilDialogueString((char *)pMerchantsSellPhrases[v45], uActiveCharacter - 1, v87, (char *)window_SpeakInHouse->ptr_1C, 3, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2174 pTextHeight = pFontArrus->CalcTextHeight(v21, &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2175 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v21, 3);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2176 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2177 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2178 case DIALOG_SHOP_IDENTIFY:
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2179 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2180 draw_leather();
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2181 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2182 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2183 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2184 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2185 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
2186 pMouse->GetCursorPos(&v101)->x <= 13) || pMouse->GetCursorPos(&v97)->x >= 462
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2187 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v109), !pNumActiveItem) )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2188 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2189 v37 = (ItemGen *)&pPlayer->pInventoryItems[pNumActiveItem - 1];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2190 if (!v37->Identified())
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2191 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2192 v42 = pPlayer->_490EEE(v37, 4, (int)window_SpeakInHouse->ptr_1C, 4);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2193 v38 = (char *)pMerchantsIdentifyPhrases[v42];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2194 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2195 else
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2196 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2197 v38 = "%24";
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2198 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2199 v21 = BuilDialogueString(v38, uActiveCharacter - 1, v37, (char *)window_SpeakInHouse->ptr_1C, 4, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2200 v40 = pFontArrus->CalcTextHeight(v21, &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2201 dialog_window.DrawTitleText(pFontArrus, 0, (174 - v40) / 2 + 138, pColorWhite, v21, 3);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2202 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2203 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2204 case DIALOG_SHOP_DISPLAY_EQUIPMENT:
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2205 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2206 draw_leather();
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2207 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2208 pShopOptions[0] = pGlobalTXT_LocalizationStrings[200];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2209 pShopOptions[1] = pGlobalTXT_LocalizationStrings[113];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2210 all_text_height = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2211 for ( int i = 0; i < 2; ++i )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2212 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2213 Str = (174 - all_text_height) / 2;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2214 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2215 v26 = pNumActiveItem + pDialogueWindow->pNumPresenceButton;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2216 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
2217 v28 = -pDialogueWindow->pNumPresenceButton < 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2218 if ( v28 ^ pNumActiveItem > v26 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2219 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2220 pItemNum = 2;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2221 pNumString = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2222 do
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2223 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2224 pButton = pDialogueWindow->GetControl(pItemNum);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2225 pButton->uY = Str + v27;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2226 pTextHeight = pFontArrus->CalcTextHeight((const char *)pShopOptions[pNumString], &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2227 pButton->uHeight = pTextHeight;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2228 v27 = pButton->uY + pTextHeight - 1;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2229 pButton->uW = v27;
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2230 pColorText = pColorYellow;
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2231 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum )
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2232 pColorText = pColorWhite;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2233 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, (const char *)pShopOptions[pNumString], 3);
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2234 ++pItemNum;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2235 ++pNumString;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2236 pNumActiveItem = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2237 }
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2238 while ( pItemNum < pNumActiveItem );
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2239 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2240 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2241 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2242 case DIALOG_SHOP_BUY_SPECIAL:
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2243 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2244 pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2245 v114 = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2246 do
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2247 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2248 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v114].uItemID)
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2249 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2250 v54 = ItemsInShopTexture[v114];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2251 v55 = 152 - v54->uTextureHeight;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2252 if ( (signed int)v55 < 1 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2253 v55 = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2254 v56 = 75 * v114 - v54->uTextureWidth / 2 + 40;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2255 if ( v114 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2256 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2257 if ( v114 == 5 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2258 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2259 v57 = ItemsInShopTexture[5]->uTextureWidth;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2260 if ( (signed int)v56 > 457 - v57 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2261 v56 = 457 - v57;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2262 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2263 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2264 else
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2265 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2266 if ( (signed int)v56 < 18 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2267 v56 = 18;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2268 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2269 pRenderer->DrawTextureTransparent(v56, v55, v54);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2270 sub_40F92A(&pRenderer->pActiveZBuffer[v56 + 640 * v55], ItemsInShopTexture[v114], v114 + 1);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2271 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2272 ++v114;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2273 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2274 while ( v114 < 6 );
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2275 v114 = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2276 do
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2277 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2278 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(signed int)v114].uItemID) //not itemid
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2279 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2280 v58 = ItemsInShopTexture[v114 + 6];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2281 v59 = 308 - v58->uTextureHeight;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2282 if ( (signed int)v59 < 1 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2283 v59 = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2284 v60 = 75 * v114 - v58->uTextureWidth / 2 + 40;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2285 if ( v114 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2286 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2287 if ( v114 == 5 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2288 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2289 v61 = ItemsInShopTexture[11]->uTextureWidth;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2290 if ( (signed int)v60 > 457 - v61 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2291 v60 = 457 - v61;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2292 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2293 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2294 else
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2295 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2296 if ( (signed int)v60 < 18 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2297 v60 = 18;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2298 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2299 pRenderer->DrawTextureTransparent(v60, v59, v58);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2300 sub_40F92A(&pRenderer->pActiveZBuffer[v60 + 640 * v59], ItemsInShopTexture[v114 + 6], v114 + 7);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2301 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2302 ++v114;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2303 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2304 while ( v114 < 6 );
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2305 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2306 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2307 v62 = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2308 v109 = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2309 do
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2310 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2311 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v62].uItemID)
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2312 ++v109;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2313 ++v62;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2314 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2315 while ( v62 < 12 );
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2316 v63 = GetAsyncKeyState(17);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2317 v64 = pPlayer->CanSteal();
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2318 Str = v64;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2319 if ( v63 && v64 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2320 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2321 v65 = pGlobalTXT_LocalizationStrings[185];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2322 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2323 else
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2324 {
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2325 v65 = pGlobalTXT_LocalizationStrings[195];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2326 if ( dialog_menu_id != 2 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2327 v65 = pGlobalTXT_LocalizationStrings[196];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2328 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2329 DrawTextAtStatusBar(v65, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2330 if ( !v109 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2331 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2332 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
2333 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2334 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2335 v66 = pMouse->GetCursorPos(&v98);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2336 pNumActiveItem = v66->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v96)->y];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2337 if ( pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2338 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2339 v67 = (pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF) - 1;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2340 v109 = v67;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2341 v68 = (int)window_SpeakInHouse->ptr_1C;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2342 // v69 = 9 * (v67 + 12 * v68);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2343 v70 = (ItemGen *)&pParty->StandartItemsInShops[v68][v67];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2344 if ( dialog_menu_id != 2 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2345 v70 = &pParty->SpecialItemsInShops[(int)v68][v67];//v70 = (ItemGen *)&pParty->field_C59C[v69 + 724];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2346 if ( !v63 || !Str )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2347 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2348 v71 = pPlayer->_490EEE(v70, 4, v68, 2);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2349 v38 = (char *)pMerchantsBuyPhrases[v71];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2350 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2351 else
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2352 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2353 v38 = pGlobalTXT_LocalizationStrings[181];
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2354 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2355 v21 = BuilDialogueString(v38, uActiveCharacter - 1, v70, (char *)window_SpeakInHouse->ptr_1C, 2, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2356 v40 = pFontArrus->CalcTextHeight(v21, &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2357 dialog_window.DrawTitleText(pFontArrus, 0, (174 - v40) / 2 + 138, pColorWhite, v21, 3);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2358 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2359 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2360 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2361 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2362 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2363 case DIALOG_SHOP_SKILLS:
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2364 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2365 if (!sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win())
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2366 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2367 all_text_height = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2368 v5 = (signed __int64)(p2DEvents[(signed int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2369 pItemNum = v5 * (100 - pPlayer->GetMerchant()) / 100;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2370 if ( pItemNum < v5 / 3 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2371 pItemNum = v5 / 3;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2372 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2373 v114 = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2374 if ( pNumActiveItem >= pNumActiveItem + pDialogueWindow->pNumPresenceButton )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2375 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2376 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], pPlayer->pName, pClassNames[pPlayer->classType]);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2377 strcat(pTmpBuf, "\n \n");
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2378 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2379 v40 = pFontArrus->CalcTextHeight(pTmpBuf, &dialog_window, 0, 0);
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2380 dialog_window.DrawTitleText(pFontArrus, 0, (174 - v40) / 2 + 138, pColorYellow, pTmpBuf, 3);
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2381 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2382 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2383 do
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2384 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2385 v8 = pDialogueWindow->GetControl(pNumActiveItem)->uControlParam - 36;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2386 if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayer->classType][v8] && !pPlayer->pActiveSkills[v8] )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2387 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2388 all_text_height = pFontArrus->CalcTextHeight(pSkillNames[v8], &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2389 ++v114;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2390 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2391 ++pNumActiveItem;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2392 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2393 while ( pNumActiveItem < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2394 if ( !v114 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2395 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2396 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], pPlayer->pName, pClassNames[pPlayer->classType]);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2397 strcat(pTmpBuf, "\n \n");
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2398 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2399 v40 = pFontArrus->CalcTextHeight(pTmpBuf, &dialog_window, 0, 0);
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2400 dialog_window.DrawTitleText(pFontArrus, 0, (174 - v40) / 2 + 138, pColorYellow, pTmpBuf, 3);
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2401 return;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2402 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2403 if ( v114 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2404 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2405 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], pItemNum);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2406 dialog_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2407 v18 = (149 - all_text_height) / v114;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2408 if ( (149 - all_text_height) / v114 > 32 )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2409 v18 = 32;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2410 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2411 v105 = (149 - v114 * v18 - all_text_height) / 2 - v18 / 2 + 162;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2412 if ( pNumActiveItem < pNumActiveItem + pDialogueWindow->pNumPresenceButton )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2413 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2414 pItemNum = 2;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2415 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2416 {
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2417 pButton = pDialogueWindow->GetControl(pItemNum);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2418 v13 = pButton->uControlParam - 36;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2419 if ( !byte_4ED970_skill_learn_ability_by_class_table[pPlayer->classType][v13] || pPlayer->pActiveSkills[v13] )
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2420 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2421 pButton->uW = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2422 pButton->uHeight = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2423 pButton->uY = 0;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2424 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2425 else
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2426 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2427 pButton->uY = v18 + v105;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2428 pTextHeight = pFontArrus->CalcTextHeight(pSkillNames[v13], &dialog_window, 0, 0);
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2429 pButton->uHeight = pTextHeight;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2430 v105 = pButton->uY + pTextHeight - 1;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2431 pButton->uW = v105;
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2432 pColorText = pColorYellow;
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2433 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum )
644
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2434 pColorText = pColorWhite;
527a052c2a98 TavernDialog little clean
Ritor1
parents: 634
diff changeset
2435 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, pSkillNames[v13], 3);
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2436 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2437 pNumActiveItem = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2438 pItemNum++;
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2439 }
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2440 while ( pItemNum < pNumActiveItem );
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2441 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2442 return;
634
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2443 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2444 }
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2445 default:
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2446 {
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2447 return;// (POINT *)dialog_menu_id - 96;
efa8ceae21d4 AlchemistShop little clean
Ritor1
parents: 629
diff changeset
2448 }
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2449 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2450 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2451
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2452
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2453 //----- (004BA928) --------------------------------------------------------
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2454 void __cdecl ArmorShopDialog()
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2455 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2456 Player *v0; // ebx@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2457 signed int v1; // esi@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2458 unsigned int v2; // eax@10
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2459 ItemGen *v3; // eax@11
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2460 unsigned __int8 v4; // dl@12
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2461 char *v5; // ecx@12
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2462 char *v6; // eax@13
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2463 int v7; // ST08_4@15
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2464 int v8; // eax@15
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2465 signed int v9; // esi@17
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2466 unsigned int v10; // eax@19
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2467 char *v11; // edi@19
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2468 int v12; // ST08_4@20
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2469 int v13; // eax@20
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2470 unsigned __int8 v14; // dl@20
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2471 char *v15; // ecx@20
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2472 char **v16; // edi@22
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2473 int all_text_height; // ebx@22
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2474 char **v18; // esi@22
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2475 int v19; // eax@23
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2476 GUIWindow *v20; // ecx@24
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2477 int v21; // eax@24
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2478 int v22; // edx@24
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2479 int v23; // ebx@24
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2480 unsigned __int8 v24; // sf@24
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2481 GUIButton *control_button; // eax@26
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2482 GUIButton *v26; // esi@26
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2483 int v27; // eax@26
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2484 unsigned int v28; // ecx@26
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2485 int v29; // edx@26
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2486
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2487 signed int v31; // esi@31
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2488 unsigned int v32; // eax@33
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2489 int v33; // eax@34
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2490 int v34; // ST08_4@35
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2491 int v35; // eax@35
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2492 char *v36; // edx@36
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2493 GUIWindow *v37; // edi@42
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2494 signed int v38; // esi@42
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2495 unsigned int v39; // esi@44
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2496 int v40; // eax@44
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2497 unsigned int v41; // eax@45
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2498 int v42; // eax@47
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2499 int v43; // ecx@52
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2500 GUIButton *v44; // eax@54
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2501 GUIButton *v45; // esi@54
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2502 int v46; // eax@54
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2503 char *v47; // eax@56
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2504 int v48; // eax@56
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2505 unsigned int v49; // ecx@56
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2506 int v50; // edx@56
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2507 int v51; // eax@56
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2508 unsigned __int16 v52; // ax@56
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2509 int v53; // eax@60
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2510 int textureH; // eax@60
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2511 signed int textureW; // ebx@65
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2512 Texture *v56; // eax@67
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2513 unsigned int v57; // edi@68
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2514 Texture *v58; // ST1C_4@68
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2515 int v59; // eax@68
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2516 int v60; // edi@69
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2517 signed int v61; // ebx@73
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2518 Texture *v62; // eax@75
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2519 int v63; // edi@76
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2520 Texture *v64; // ST1C_4@76
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2521 unsigned int v65; // ST18_4@76
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2522 int v66; // eax@76
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2523 int v67; // edi@77
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2524 signed int v68; // ecx@81
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2525 SHORT v69; // bx@89
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2526 bool v70; // eax@89
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2527 const char *v71; // ecx@91
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2528 void *v72; // eax@95
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2529 POINT *v73; // esi@97
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2530 int v74; // ecx@97
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2531 int v75; // eax@98
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2532 int v76; // ecx@98
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2533 ItemGen *selected_item; // ecx@99
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2534 unsigned __int8 v78; // bl@104
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2535 char **v79; // edi@105
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2536 int v80; // ebx@105
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2537 char **v81; // esi@105
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2538 int v82; // eax@106
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2539 GUIWindow *v83; // ecx@107
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2540 int v84; // eax@107
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2541 int v85; // edx@107
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2542 int v86; // ebx@107
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2543 GUIButton *v87; // eax@109
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2544 GUIButton *v88; // esi@109
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2545 int v89; // eax@109
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2546 unsigned int v90; // ecx@109
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2547 int v91; // edx@109
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2548 unsigned __int16 v92; // ax@109
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2549 signed int v93; // edx@114
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2550 POINT *v94; // edi@120
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2551 __int32 v95; // ecx@120
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2552 void *v96; // ST14_4@122
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2553 unsigned __int8 v97; // bl@122
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2554 ItemGen *v98; // ST10_4@122
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2555 int v99; // eax@122
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2556 char *v100; // eax@122
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2557 const char *v101; // ST18_4@122
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2558 unsigned __int16 v102; // ST14_2@122
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2559 int v103; // eax@122
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2560 signed int v104; // edi@123
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2561 Texture *v105; // eax@125
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2562 int v106; // ebx@126
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2563 Texture *v107; // ST1C_4@126
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2564 unsigned int v108; // ST18_4@126
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2565 int v109; // eax@126
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2566 int v110; // ebx@127
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2567 GUIWindow *v111; // [sp-18h] [bp-11Ch]@36
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2568 unsigned int v112; // [sp-14h] [bp-118h]@13
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2569 int v113; // [sp-14h] [bp-118h]@36
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2570 ItemGen *v114; // [sp-10h] [bp-114h]@12
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2571 unsigned int v115; // [sp-10h] [bp-114h]@13
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2572 ItemGen *v116; // [sp-10h] [bp-114h]@20
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2573 int v117; // [sp-10h] [bp-114h]@36
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2574 void *v118; // [sp-Ch] [bp-110h]@12
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2575 unsigned __int16 v119; // [sp-Ch] [bp-110h]@13
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2576 void *v120; // [sp-Ch] [bp-110h]@20
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2577 char *v121; // [sp-8h] [bp-10Ch]@13
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2578 int v122; // [sp-8h] [bp-10Ch]@20
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2579 unsigned int v123; // [sp-4h] [bp-108h]@13
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2580 __int64 *v124; // [sp-4h] [bp-108h]@20
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2581 int v125; // [sp-4h] [bp-108h]@68
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2582 int v126; // [sp-4h] [bp-108h]@76
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2583 int v127; // [sp-4h] [bp-108h]@126
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2584 POINT v128; // [sp+Ch] [bp-F8h]@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2585 POINT v129; // [sp+14h] [bp-F0h]@18
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2586 char v130; // [sp+1Ch] [bp-E8h]@120
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2587 POINT a2; // [sp+24h] [bp-E0h]@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2588 POINT v132; // [sp+2Ch] [bp-D8h]@120
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2589 POINT v133; // [sp+34h] [bp-D0h]@17
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2590 POINT v134; // [sp+3Ch] [bp-C8h]@97
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2591 POINT v135; // [sp+44h] [bp-C0h]@31
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2592 POINT v136; // [sp+4Ch] [bp-B8h]@97
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2593 POINT v137; // [sp+54h] [bp-B0h]@17
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2594 POINT v138; // [sp+5Ch] [bp-A8h]@32
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2595 POINT v139; // [sp+64h] [bp-A0h]@17
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2596 POINT v140; // [sp+6Ch] [bp-98h]@31
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2597 POINT v141; // [sp+74h] [bp-90h]@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2598 POINT v142; // [sp+7Ch] [bp-88h]@31
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2599 POINT v143; // [sp+84h] [bp-80h]@9
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2600 GUIWindow dialog_window; // [sp+8Ch] [bp-78h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2601 char *Str; // [sp+E0h] [bp-24h]@56
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2602 int v146; // [sp+E4h] [bp-20h]@24
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2603 int hilight_color; // [sp+E8h] [bp-1Ch]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2604 int m_text_color; // [sp+ECh] [bp-18h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2605 __int32 v149; // [sp+F0h] [bp-14h]@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2606 Player* _this; // [sp+F4h] [bp-10h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2607 unsigned __int8 uPlayerID; // [sp+FBh] [bp-9h]@15
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2608 int v152; // [sp+FCh] [bp-8h]@24
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2609 int v153; // [sp+100h] [bp-4h]@44
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2610 int th;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2611 short text_color;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2612
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2613 v0 = pPlayers[uActiveCharacter];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2614 _this = pPlayers[uActiveCharacter];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2615 memcpy(&dialog_window, window_SpeakInHouse, sizeof(dialog_window));
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2616 dialog_window.uFrameX = 483;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2617 dialog_window.uFrameWidth = 148;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2618 dialog_window.uFrameZ = 334;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2619 m_text_color = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2620 hilight_color = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2621 switch (dialog_menu_id)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2622 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2623 case DIALOG_SHOP_MAIN:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2624 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2625 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
2626 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2627 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134]; //"Buy Standard"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2628 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152]; //"Buy Special"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2629 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159]; //"Display Inventory"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2630 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2631
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2632 all_text_height = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2633 for(int i=0;i<4;++i)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2634 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2635 v146 = (174 - all_text_height) / 4;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2636
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2637 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
2638 int j=0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2639 if ( pDialogueWindow->pNumPresenceButton>=0 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2640 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2641 th = 2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2642 for (v152 = pDialogueWindow->pStartingPosActiveItem; v152 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem; ++v152)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2643 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2644 control_button = pDialogueWindow->GetControl(v152);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2645 control_button->uY = v146 + v23;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2646 v27 = pFontArrus->CalcTextHeight(pShopOptions[j], &dialog_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2647 control_button->uHeight = v27;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2648 v23 = control_button->uY + control_button->uHeight - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2649 control_button->uW = v23;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2650 text_color = hilight_color;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2651 if ( pDialogueWindow->pCurrentPosActiveItem != th )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2652 text_color = m_text_color;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2653 dialog_window.DrawTitleText(pFontArrus, 0, control_button->uY, text_color, pShopOptions[j], 3);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2654 ++th;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2655 ++j;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2656 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2657 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2658 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2659 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2660 case DIALOG_SHOP_BUY_STANDART:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2661 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2662 pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2663 textureW = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2664 v153 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2665 for(int i=0; i<8; ++i)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2666 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2667 if ( pParty->StandartItemsInShops[window_SpeakInHouse->par1C][i].uItemID);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2668 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2669 textureW = ItemsInShopTexture[i]->uTextureWidth;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2670 textureH = ItemsInShopTexture[i]->uTextureHeight;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2671 if ( i >= 4 ) //low row
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2672 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2673 v60 = 90 - (textureW/2);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2674 pRenderer->DrawTextureTransparent(v60 + v153 - 420, 126, ItemsInShopTexture[i]);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2675 v59 = v60 + v153 + 80220;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2676 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2677 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2678 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2679 v57 = 98 - textureH;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2680 v152 = 86 - (textureW/2);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2681 pRenderer->DrawTextureTransparent(v153 + v152, v57, ItemsInShopTexture[i]);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2682 v59 = v153 + v152 + 640 * v57;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2683 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2684 ZBuffer_DoFill(&pRenderer->pActiveZBuffer[v59], ItemsInShopTexture[i], i+1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2685 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2686 v153 += 105;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2687
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2688 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2689
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2690 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
2691 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2692
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2693 v149 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2694 for(int i=0; i<8; ++i)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2695 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2696 if ( pParty->StandartItemsInShops[window_SpeakInHouse->par1C][i].uItemID);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2697 ++v149;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2698
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2699 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2700
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2701 v69 = GetAsyncKeyState(17);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2702 v70 = _this->CanSteal();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2703 //Str = (char *)v70;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2704 if ( v69 == 0 || v70 == 0 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2705 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2706 v71 = pGlobalTXT_LocalizationStrings[195]; //"Select the Item to Buy"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2707 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2708 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2709 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2710 v71 = pGlobalTXT_LocalizationStrings[185];//"Steal item"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2711 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2712 DrawTextAtStatusBar(v71, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2713 if ( v149 != 0 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2714 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2715 v73 = pMouse->GetCursorPos(&v136);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2716 v74 = pRenderer->pActiveZBuffer[v73->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v134)->y]] & 0xFFFF;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2717 if ( !v74 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2718 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2719 v149 = v74 - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2720 selected_item = &pParty->StandartItemsInShops[window_SpeakInHouse->par1C][v74-1];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2721 if ( v69 ==0 || v70 == 0)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2722 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2723 v120 = window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2724 v15 = (char *)pMerchantsBuyPhrases[_this->_490EEE(selected_item, 2, window_SpeakInHouse->par1C, 2)];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2725 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2726 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2727 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2728 v120 = window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2729 v15 = pGlobalTXT_LocalizationStrings[181]; //"Steal %24"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2730 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2731 v36 = BuilDialogueString(v15, uActiveCharacter - 1, selected_item, (char *)v120, 2, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2732 v115 = (174 - pFontArrus->CalcTextHeight(v36, &dialog_window, 0, 0)) / 2 + 138;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2733 dialog_window.DrawTitleText(pFontArrus, 0, v115, m_text_color, v36, 3);
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 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2736 dialog_window.DrawCurrentTime( pParty->field_3C.field_50[window_SpeakInHouse->par1C]- pParty->uTimePlayed);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2737 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2738 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2739 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2740 case DIALOG_SHOP_SELL:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2741 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2742 draw_leather();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2743 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2744 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0);//"Select the Item to Sell"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2745 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
2746 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2747
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2748 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
2749 pMouse->GetCursorPos(&v137)->x <= 13) || pMouse->GetCursorPos(&v129)->x >= 462
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2750 || (v10 = v0->GetItemIDAtInventoryIndex((int *)&v149), v11 = 0, !v10) )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2751 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2752
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2753 v116 = (ItemGen *)&v0->pInventoryItems[v10-1];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2754 v13 = v0->_490EEE(v116, 2, window_SpeakInHouse->par1C, 3);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2755 v15 = (char *)pMerchantsSellPhrases[v0->_490EEE(v116, 2, window_SpeakInHouse->par1C, 3)];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2756 v36 = BuilDialogueString(v15, uActiveCharacter - 1, v116, (char *) window_SpeakInHouse->par1C, 3, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2757 v115 = (174 - pFontArrus->CalcTextHeight(v36, &dialog_window, 0, 0)) / 2 + 138;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2758 dialog_window.DrawTitleText(pFontArrus, 0, v115, m_text_color, v36, 3);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2759 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2760 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2761 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2762 case DIALOG_SHOP_IDENTIFY:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2763 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2764 draw_leather();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2765 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2766 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0); //"Select the Item to Identify"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2767 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
2768 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2769 v1 = pMouse->GetCursorPos(&a2)->x - 14;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2770 v149 = (v1 >> 5) + 14 * ((pMouse->GetCursorPos(&v128)->y - 17) >> 5);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2771 if ( pMouse->GetCursorPos(&v141)->x > 13 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2772 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2773 if ( pMouse->GetCursorPos(&v143)->x < 462 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2774 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2775 v2 = v0->GetItemIDAtInventoryIndex((int *)&v149);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2776 if ( v2 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2777 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2778 v3 = (ItemGen *)&v0->pInventoryItems[v2-1];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2779 if (v3->Identified())
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2780 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2781 v118 = window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2782 v4 = uActiveCharacter - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2783 v5 = "%24";
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2784 v114 = v3;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2785 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2786 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2787 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2788 v118 = window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2789 v114 = v3;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2790 v7 = (int)window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2791 uPlayerID = uActiveCharacter - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2792 v8 = v0->_490EEE(v3, 2, v7, 4);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2793 v4 = uPlayerID;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2794 v5 = (char *)pMerchantsIdentifyPhrases[v8];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2795 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2796 v6 = BuilDialogueString(v5, v4, v114, (char *)v118, 4, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2797 v115 = (174 - pFontArrus->CalcTextHeight(v6, &dialog_window, 0, 0)) / 2 + 138;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2798 dialog_window.DrawTitleText(pFontArrus, 0, v115, m_text_color, v6, 3);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2799 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2800 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2801 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2802 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2803 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2804 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2805 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2806 case DIALOG_SHOP_REPAIR:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2807 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2808 draw_leather();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2809 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2810 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[198], 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2811 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
2812 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2813
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2814 if( (v31 = pMouse->GetCursorPos(&v135)->x - 14,
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2815 v149 = (v31 >> 5) + 14 * ((pMouse->GetCursorPos(&v142)->y - 17) >> 5),
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2816 pMouse->GetCursorPos(&v140)->x <= 13)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2817 || pMouse->GetCursorPos(&v138)->x >= 462
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2818 || (v32 = v0->GetItemIDAtInventoryIndex((int *)&v149), v11 = 0, !v32)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2819 || (v33 = 9 * v32, !(v0->field_1F5[4 * v33 + 15] & 2)) )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2820 return;
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 v120 = window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2824 v116 = (ItemGen *)&v0->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * v33 + 5];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2825 v34 = (int)window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2826 uPlayerID = uActiveCharacter - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2827 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
2828 v14 = uPlayerID;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2829 v15 = (char *)pMerchantsRepairPhrases[v35];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2830 v36 = BuilDialogueString(v15, v14, v116, (char *)v120, 5, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2831 v115 = (174 - pFontArrus->CalcTextHeight(v36, &dialog_window, 0, 0)) / 2 + 138;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2832 dialog_window.DrawTitleText(pFontArrus, 0, v115, m_text_color, v36, 3);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2833 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2834 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2835 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2836 case 6: //buy standart
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2837 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2838 pRenderer->DrawTextureIndexed(8u, 8u, ShopTexture);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2839 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[195], 0); //"Select the Item to Buy"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2840 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
2841 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2842 v149 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2843 for(int i=0;i<6;++i)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2844 if (pParty->SpecialItemsInShops[window_SpeakInHouse->par1C][i].uItemID)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2845 ++v149;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2846
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2847
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2848 if ( v149 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2849 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2850 v94 = pMouse->GetCursorPos(&v132);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2851 v149 = pRenderer->pActiveZBuffer[v94->x + pSRZBufferLineOffsets[pMouse->GetCursorPos((POINT *)&v130)->y]];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2852 v95 = v149;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2853 if ( v149 && v149 != -65536 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2854 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2855 --v149;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2856
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2857 v97 = uActiveCharacter - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2858
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2859 v99 = _this->_490EEE(
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2860 &pParty->SpecialItemsInShops[window_SpeakInHouse->par1C][v95-1], 2, window_SpeakInHouse->par1C, 2);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2861 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
2862 v103 = pFontArrus->CalcTextHeight(v100, &dialog_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2863 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
2864 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2865 v104 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2866 v153 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2867 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2868 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2869 //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
2870 if (pParty->SpecialItemsInShops[window_SpeakInHouse->par1C][v104].uItemID)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2871 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2872 v105 = ItemsInShopTexture[v104];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2873 if ( v104 >= 4 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2874 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2875 v110 = 90 - ((signed int)v105->uTextureWidth >> 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2876 pRenderer->DrawTextureTransparent(v153 + v110 - 420, 0x7Eu, ItemsInShopTexture[v104]);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2877 v127 = v104 + 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2878 v109 = v153 + v110 + 80220;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2879 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2880 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2881 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2882 v106 = 98 - v105->uTextureHeight;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2883 v107 = ItemsInShopTexture[v104];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2884 v108 = 98 - v105->uTextureHeight;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2885 v152 = 86 - ((signed int)v105->uTextureWidth >> 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2886 pRenderer->DrawTextureTransparent(v152 + v153, v108, v107);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2887 v127 = v104 + 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2888 v109 = v152 + v153 + 640 * v106;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2889 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2890 ZBuffer_DoFill(&pRenderer->pActiveZBuffer[v109], ItemsInShopTexture[v104], v127);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2891 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2892 v153 += 105;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2893 ++v104;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2894 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2895 while ( v104 < 8 );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2896 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2897 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2898 dialog_window.DrawCurrentTime(pParty->field_3C.field_50[window_SpeakInHouse->par1C]- pParty->uTimePlayed);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2899 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2900 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2901 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2902 case DIALOG_SHOP_DISPLAY_EQUIPMENT:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2903 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2904 draw_leather();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2905 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2906 v79 = pShopOptions;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2907 pShopOptions[0] = pGlobalTXT_LocalizationStrings[200]; //"Sell"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2908 pShopOptions[1] = pGlobalTXT_LocalizationStrings[113]; //"Identify"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2909 pShopOptions[2] = pGlobalTXT_LocalizationStrings[179]; //"Repair"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2910
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2911 all_text_height = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2912 for(int i=0;i<3;++i)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2913 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2914 v83 = pDialogueWindow;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2915 v152 = (174 - all_text_height) / 3;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2916 v84 = pDialogueWindow->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2917 v85 = v84 + pDialogueWindow->pNumPresenceButton;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2918 v86 = (3 * (58 - v152) - all_text_height) / 2 - v152 / 2 + 138;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2919 v24 = -pDialogueWindow->pNumPresenceButton < 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2920 _this = (Player *)pDialogueWindow->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2921 if ( v24 ^ __OFSUB__(v84, v85) )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2922 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2923 v153 = 2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2924 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2925 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2926 v87 = v83->GetControl((unsigned int)_this);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2927 v88 = v87;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2928 v87->uY = v152 + v86;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2929 v89 = pFontArrus->CalcTextHeight(*v79, &dialog_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2930 v90 = v88->uY;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2931 v91 = v153;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2932 v88->uHeight = v89;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2933 v86 = v90 + v89 - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2934 v88->uW = v86;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2935 v92 = hilight_color;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2936 if ( pDialogueWindow->pCurrentPosActiveItem != v91 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2937 v92 = m_text_color;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2938 dialog_window.DrawTitleText(pFontArrus, 0, v90, v92, *v79, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2939 v83 = pDialogueWindow;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2940 ++v153;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2941 ++v79;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2942 _this = (Player *)((char *)_this + 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2943 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2944 while ( (signed int)_this < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2945 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2946 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2947 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2948 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2949 case DIALOG_SHOP_BUY_SPECIAL:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2950 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2951 pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2952 v11 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2953 v61 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2954 v153 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2955 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2956 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2957 if (pParty->SpecialItemsInShops[window_SpeakInHouse->par1C][v61].uItemID)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2958 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2959 v62 = ItemsInShopTexture[v61];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2960 if ( v61 >= 4 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2961 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2962 v67 = 90 - ((signed int)v62->uTextureWidth >> 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2963 pRenderer->DrawTextureTransparent(v153 + v67 - 420, 0x7Eu, ItemsInShopTexture[v61]);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2964 v66 = v153 + v67 + 80220;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2965 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2966 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2967 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2968 v63 = 98 - v62->uTextureHeight;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2969 v64 = ItemsInShopTexture[v61];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2970 v65 = 98 - v62->uTextureHeight;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2971 v152 = 86 - ((signed int)v62->uTextureWidth >> 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2972 pRenderer->DrawTextureTransparent(v152 + v153, v65, v64);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2973 v66 = v152 + v153 + 640 * v63;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2974 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2975 ZBuffer_DoFill(&pRenderer->pActiveZBuffer[v66], ItemsInShopTexture[v61], v61 + 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2976 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2977 v153 += 105;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2978 ++v61;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2979 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2980 while ( v61 < 8 );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2981
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2982 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
2983 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2984 v68 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2985 v149 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2986
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2987 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2988 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2989 // 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
2990 if (pParty->SpecialItemsInShops[window_SpeakInHouse->par1C][(signed int)v68].uItemID)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2991 ++v149;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2992 ++v68;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2993 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2994 while ( v68 < 6 );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2995
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2996 v69 = GetAsyncKeyState(17);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2997 v70 = _this->CanSteal();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2998 Str = (char *)v70;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
2999 if ( v69 == 0 || (char *)v70 == 0 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3000 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3001 v71 = pGlobalTXT_LocalizationStrings[196]; //Select the Special Item to Buy"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3002 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3003 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3004 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3005 v71 = pGlobalTXT_LocalizationStrings[185];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3006 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3007 DrawTextAtStatusBar(v71, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3008 if ( (char *)v149 != 0 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3009 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3010 v73 = pMouse->GetCursorPos(&v136);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3011 v74 = pRenderer->pActiveZBuffer[v73->x + pSRZBufferLineOffsets[pMouse->GetCursorPos((POINT *)&v134)->y]] & 0xFFFF;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3012 if ( !v74 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3013 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3014 v149 = v74 - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3015
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3016 if ( dialog_menu_id == 2 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3017 selected_item = &pParty->StandartItemsInShops[window_SpeakInHouse->par1C][v74-1];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3018 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3019 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
3020 if ( v69 == 0 || Str == 0 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3021 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3022 v120 = window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3023 v15 = (char *)pMerchantsBuyPhrases[_this->_490EEE(selected_item, 2, window_SpeakInHouse->par1C, 2)];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3024 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3025 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3026 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3027 v120 = window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3028 v15 = pGlobalTXT_LocalizationStrings[181]; //"Steal %24"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3029 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3030 v36 = BuilDialogueString(v15, uActiveCharacter - 1, selected_item, (char *)v120, 2, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3031 v115 = (174 - pFontArrus->CalcTextHeight(v36, &dialog_window, 0, 0)) / 2 + 138;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3032 dialog_window.DrawTitleText(pFontArrus, 0, v115, m_text_color, v36, 3);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3033 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3034 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3035 dialog_window.DrawCurrentTime( pParty->field_3C.field_50[window_SpeakInHouse->par1C]- pParty->uTimePlayed);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3036 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3037 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3038 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3039 case DIALOG_SHOP_SKILLS:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3040 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3041 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
3042 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3043 v152 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3044 v37 = pDialogueWindow;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3045 //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
3046 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
3047 _this = (Player *)(v38 * (100 - v0->GetMerchant()) / 100);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3048 if ( (signed int)_this < v38 / 3 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3049 _this = (Player *)(v38 / 3);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3050 v39 = v37->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3051 v40 = v37->pNumPresenceButton;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3052 v153 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3053 if ( (signed int)v39 < (signed int)(v39 + v40) )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3054 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3055 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3056 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3057 v41 = v37->GetControl(v39)->uControlParam - 36;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3058 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
3059 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3060 v42 = pFontArrus->CalcTextHeight(pSkillNames[v41], &dialog_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3061 v152 += v42;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3062 ++v153;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3063 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3064 ++v39;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3065 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3066 while ( (signed int)v39 < v37->pNumPresenceButton + v37->pStartingPosActiveItem );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3067 if ( v153 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3068 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3069 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], _this);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3070 dialog_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3071 _this = (Player *)((149 - v152) / v153);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3072 if ( (149 - v152) / v153 > 32 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3073 _this = (Player *)32;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3074 v43 = (149 - v153 * (signed int)_this - v152) / 2 - (signed int)_this / 2 + 162;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3075 v152 = v37->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3076 v146 = v43;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3077 if ( v152 < v152 + v37->pNumPresenceButton )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3078 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3079 v153 = 2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3080 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3081 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3082 v44 = v37->GetControl(v152);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3083 v45 = v44;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3084 v46 = v44->uControlParam - 36;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3085 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
3086 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3087 v45->uW = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3088 v45->uHeight = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3089 v45->uY = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3090 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3091 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3092 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3093 v47 = pSkillNames[v46];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3094 v45->uY = (unsigned int)((char *)_this + v146);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3095 Str = v47;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3096 v48 = pFontArrus->CalcTextHeight(v47, &dialog_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3097 v49 = v45->uY;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3098 v50 = v153;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3099 v45->uHeight = v48;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3100 v51 = v49 + v48 - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3101 v45->uW = v51;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3102 v146 = v51;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3103 v52 = hilight_color;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3104 if ( pDialogueWindow->pCurrentPosActiveItem != v50 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3105 v52 = m_text_color;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3106 dialog_window.DrawTitleText(pFontArrus, 0, v49, v52, Str, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3107 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3108 v53 = v37->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3109 ++v152;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3110 textureH = v37->pNumPresenceButton + v53;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3111 ++v153;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3112 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3113 while ( v152 < textureH );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3114 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3115 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3116 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3117 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3118 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
3119 strcat(pTmpBuf, "\n \n");
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3120 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]); //"I can offer you nothing further."
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3121 v115 = (174 - pFontArrus->CalcTextHeight(pTmpBuf, &dialog_window, 0, 0)) / 2 + 138;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3122 dialog_window.DrawTitleText(pFontArrus, 0, v115, hilight_color, pTmpBuf, 3);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3123 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3124 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3125 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3126 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3127 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3128
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3129
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3130
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3131 //----- (004B5D7C) --------------------------------------------------------
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3132 void GuildDialog()
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3133 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3134 GUIWindow *v0; // ebx@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3135 Player *currPlayer; // edi@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3136 signed int base_teach_price; // ebx@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3137 int v3; // edi@6
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3138 int result; // eax@11
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3139 unsigned int v5; // ebx@13
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3140 int v6; // esi@13
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3141 signed int v7; // esi@17
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3142 int v8; // esi@22
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3143 signed int v9; // ecx@22
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3144 char *v10; // eax@22
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3145 const char *statusbar_string; // ecx@26
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3146 POINT *v12; // esi@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3147 int v13; // ecx@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3148 void *v14; // ST1C_4@31
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3149 ItemGen *v15; // ST18_4@31
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3150 int v16; // ST10_4@31
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3151 int v17; // eax@31
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3152 char *v18; // edx@31
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3153 int v19; // eax@32
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3154 GUIWindow *v20; // edi@35
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3155 int v21; // esi@35
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3156 int v22; // eax@35
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3157 unsigned int v23; // eax@36
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3158 int v24; // eax@39
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3159 int v25; // eax@40
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3160 int v26; // ecx@47
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3161 GUIButton *v27; // eax@49
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3162 GUIButton *v28; // esi@49
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3163 unsigned int v29; // eax@49
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3164 char *v30; // eax@52
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3165 int v31; // eax@55
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3166 unsigned int v32; // ecx@55
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3167 int v33; // eax@55
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3168 unsigned __int16 v34; // ax@55
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3169 int v35; // eax@58
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3170 const char *v36; // ST20_4@61
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3171 unsigned __int16 v37; // ST1C_2@61
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3172 int v38; // eax@61
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3173 GUIWindow *v39; // [sp-18h] [bp-304h]@31
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3174 int v40; // [sp-14h] [bp-300h]@31
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3175 int v41; // [sp-10h] [bp-2FCh]@31
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3176 unsigned __int16 v42; // [sp-Ch] [bp-2F8h]@31
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3177 char *v43; // [sp-8h] [bp-2F4h]@31
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3178 unsigned int v44; // [sp-4h] [bp-2F0h]@31
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3179 char Dest[100]; // [sp+Ch] [bp-2E0h]@3
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3180 char v46[100]; // [sp+70h] [bp-27Ch]@3
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3181 char v47[100]; // [sp+D4h] [bp-218h]@3
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3182 char v48[100]; // [sp+138h] [bp-1B4h]@3
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3183 char v49[100]; // [sp+19Ch] [bp-150h]@3
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3184 POINT v50; // [sp+264h] [bp-88h]@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3185 POINT v51; // [sp+26Ch] [bp-80h]@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3186 GUIWindow working_window; // [sp+274h] [bp-78h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3187 signed int v53; // [sp+27Ch] [bp-70h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3188 signed int v54; // [sp+284h] [bp-68h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3189 int v55; // [sp+2C8h] [bp-24h]@47
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3190 int main_text_color; // [sp+2CCh] [bp-20h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3191 int hi_text_color; // [sp+2D0h] [bp-1Ch]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3192 Player *v58; // [sp+2D4h] [bp-18h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3193 unsigned __int8 uPlayerID; // [sp+2DBh] [bp-11h]@31
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3194 char *Str; // [sp+2DCh] [bp-10h]@35
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3195 int v61; // [sp+2E0h] [bp-Ch]@35
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3196 unsigned int v62; // [sp+2E4h] [bp-8h]@13
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3197 int v63; // [sp+2E8h] [bp-4h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3198
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3199 v0 = window_SpeakInHouse;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3200 memcpy(&working_window, window_SpeakInHouse, sizeof(GUIWindow));
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3201 v58 = pPlayers[uActiveCharacter];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3202 currPlayer = v58;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3203 working_window.uFrameX = 483;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3204 working_window.uFrameWidth = 148;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3205 working_window.uFrameZ = 334;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3206 main_text_color = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3207 hi_text_color = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3208 //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
3209 base_teach_price = (signed __int64)(p2DEvents[(unsigned int)v0->ptr_1C - 1].fPriceMultiplier * 500.0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3210 v63 = base_teach_price * (100 - currPlayer->GetMerchant()) / 100;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3211 if ( v63 < base_teach_price / 3 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3212 v63 = base_teach_price / 3;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3213 strcpy(Dest, "");
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3214 strcpy(v46, "");
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3215 strcpy(v47, "");
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3216 strcpy(v48, "");
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3217 strcpy(v49, "");
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3218 if ( dialog_menu_id != 1 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3219 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3220 if ( dialog_menu_id != 18 ) //buy skill
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3221 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3222 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
3223 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3224 //v3 = (int)(&currPlayer->uIntelligence + dword_F8B19C); //test skill
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3225 if ( v58->pActiveSkills[dialog_menu_id-36] )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3226 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3227 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
3228 ShowStatusBarString(pTmpBuf, 2u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3229 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3230 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3231 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3232 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3233 if ( pParty->uNumGold < v63 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3234 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3235 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u); //"You don't have enough gold"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3236 HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 2);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3237 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3238 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3239 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3240 Party::TakeGold(v63);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3241 v58->pActiveSkills[dialog_menu_id-36] = 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3242 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3243 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3244 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3245 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3246 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3247 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3248 pRenderer->DrawTextureIndexed(8u, 8u, ShopTexture);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3249 v5 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3250 v6 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3251 v62 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3252 v63 = 32;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3253 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3254 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3255 if (pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][v6].uItemID)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3256 // 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
3257
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3258 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3259 pRenderer->DrawTextureTransparent(v63, 0x5Au, ItemsInShopTexture[v6]);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3260 ZBuffer_DoFill((int *)((char *)pRenderer->pActiveZBuffer + v62 + 230528), ItemsInShopTexture[v6], v6 + 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3261 currPlayer = v58;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3262 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3263 v63 += 70;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3264 v62 += 280;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3265 ++v6;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3266 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3267 while ( v63 < 452 );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3268
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3269 v62 = 1680;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3270 v7 = 6;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3271 v63 = 32;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3272 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3273 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3274 if (pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][v7].uItemID)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3275 // 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
3276 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3277 pRenderer->DrawTextureTransparent(v63, 0xFAu, ItemsInShopTexture[v7]);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3278 ZBuffer_DoFill((int *)((char *)pRenderer->pActiveZBuffer + v62 + 638448), ItemsInShopTexture[v7], v7 + 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3279 currPlayer = v58;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3280 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3281 v63 += 70;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3282 v62 += 280;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3283 ++v7;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3284 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3285 while ( v63 < 452 );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3286
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3287 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
3288 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3289 v8 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3290 v9 = 12;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3291 // 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
3292 // v10 =
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3293 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3294 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3295 if (pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][v9].uItemID )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3296 ++v8;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3297 // v10 += 36;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3298 --v9;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3299 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3300 while ( v9 );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3301
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3302 GetAsyncKeyState(17);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3303 statusbar_string = pGlobalTXT_LocalizationStrings[195]; //"Select the Item to Buy"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3304 if ( dialog_menu_id != 2 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3305 statusbar_string = pGlobalTXT_LocalizationStrings[196]; //"Select the Special Item to Buy"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3306 DrawTextAtStatusBar(statusbar_string, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3307 if ( !v8 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3308 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3309 working_window.DrawCurrentTime(
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3310 __PAIR__(
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3311 *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)window_SpeakInHouse->ptr_1C + 44472],
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3312 *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)window_SpeakInHouse->ptr_1C + 44468])
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3313 - pParty->uTimePlayed);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3314 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3315 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3316 v12 = pMouse->GetCursorPos(&v51);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3317 result = v12->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v50)->y];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3318 v13 = pRenderer->pActiveZBuffer[result] & 0xFFFF;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3319 if ( pRenderer->pActiveZBuffer[result] & 0xFFFF )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3320 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3321 v14 = window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3322 v15 = (ItemGen *)(&pParty->pPlayers[1].uExpressionTimeLength + 18 * (v13 + 12 * (int)v14));
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3323 v16 = (int)window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3324 uPlayerID = uActiveCharacter - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3325 v17 = currPlayer->_490EEE( (ItemGen *)&pParty->pPlayers[1].uExpressionTimeLength + v13 + 12 * (int)v14, 3, v16, 2);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3326 v18 = BuilDialogueString((char *)pMerchantsBuyPhrases[v17], uPlayerID, v15, (char *)v14, 2, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3327 v19 = pFontArrus->CalcTextHeight(v18, &working_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3328 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
3329 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3330 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3331 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3332 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3333 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3334 if ( !(unsigned __int16)_449B57_test_bit(
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3335 (unsigned __int8 *)currPlayer->_guilds_member_bits,
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3336 guild_mambership_flags[(unsigned int)window_SpeakInHouse->ptr_1C-139]) )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3337 { //you must me member
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3338 v38 = pFontArrus->CalcTextHeight(pNPCTopics[121].pText, &working_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3339 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
3340 pDialogueWindow->pNumPresenceButton = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3341 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3342 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3343
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3344 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
3345 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3346 v20 = pDialogueWindow;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3347 v5 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3348 v62 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3349 Str = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3350 v21 = pDialogueWindow->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3351 v22 = v21 + pDialogueWindow->pNumPresenceButton;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3352 v61 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3353 if ( pDialogueWindow->pStartingPosActiveItem >= pDialogueWindow->pStartingPosActiveItem+pDialogueWindow->pNumPresenceButton )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3354 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3355 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
3356 strcat(pTmpBuf, "\n \n");
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3357 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]); //"I can offer you nothing further."
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3358 v19 = pFontArrus->CalcTextHeight(pTmpBuf, &working_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3359 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
3360 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3361 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3362 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3363 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3364 v23 = v20->GetControl(v21)->uControlParam;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3365 if ( v23 == 18 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3366 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3367 v25 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[400], &working_window, 0, 0); //"Buy Spells"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3368 v62 += v25;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3369 ++v61;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3370 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3371 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3372 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3373
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3374 if((byte_4ED970_skill_learn_ability_by_class_table[v58->classType][v23-36])&&(v58->pActiveSkills[v23-36]))
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3375 // or
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3376 //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass - 1][v23 + 1]
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3377 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3378 v24 = pFontArrus->CalcTextHeight(pClassNames[v23 - 16], &working_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3379 v62 += v24;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3380 ++v61;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3381 ++Str;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3382 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3383 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3384 ++v21;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3385 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3386 while ( v21 < v20->pNumPresenceButton + v20->pStartingPosActiveItem );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3387 if ( !v61 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3388 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3389 LABEL_64:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3390 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], v58->pName, pClassNames[v58->classType]); // "Seek knowledge elsewhere %s the %s"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3391 strcat(pTmpBuf, "\n \n");
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3392 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]); //"I can offer you nothing further."
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3393 v19 = pFontArrus->CalcTextHeight(pTmpBuf, &working_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3394 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
3395 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3396 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3397 if ( Str )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3398 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3399 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], v63); //"Skill Cost: %lu"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3400 working_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3401 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3402 v63 = (signed int)(149 - v62) / v61;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3403 if ( v63 > 32 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3404 v63 = 32;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3405 v26 = (signed int)(149 - v61 * v63 - v62) / 2 - v63 / 2 + 162;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3406 v62 = v20->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3407 v55 = v26;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3408 if (v20->pStartingPosActiveItem < v20->pStartingPosActiveItem + v20->pNumPresenceButton )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3409 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3410 v61 = 2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3411 while ( 1 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3412 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3413 v27 = v20->GetControl(v62);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3414 v28 = v27;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3415 v29 = v27->uControlParam;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3416 if ( v29 == 18 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3417 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3418
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3419 // __debugbreak();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3420 //pSkillAvailabilityPerClass[8 + v58->uClass][4 + v23]
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3421 // or
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3422 if ((byte_4ED970_skill_learn_ability_by_class_table[v58->classType][v29 - 36])&&(v58->pActiveSkills[v29-36]))
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3423 // or
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3424 //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass - 1][v23 + 1]
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3425
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3426 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3427 v30 = pClassNames[v29 -16];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3428 LABEL_55:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3429 Str = v30;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3430 v28->uY = v63 + v55;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3431 v31 = pFontArrus->CalcTextHeight(v30, &working_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3432 v32 = v28->uY;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3433 v28->uHeight = v31;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3434 v33 = v32 + v31 - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3435 v28->uW = v33;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3436 v55 = v33;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3437 v34 = hi_text_color;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3438 if ( pDialogueWindow->pCurrentPosActiveItem != v61 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3439 v34 = main_text_color;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3440 working_window.DrawTitleText(pFontArrus, 0, v32, v34, Str, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3441 v35 = v20->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3442 ++v62;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3443 ++v61;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3444 if ( (signed int)v62 >=v20->pNumPresenceButton +v20->pStartingPosActiveItem )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3445 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3446 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3447 v28->uW = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3448 v28->uHeight = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3449 v28->uY = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3450 LABEL_58:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3451 v35 = v20->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3452 ++v62;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3453 ++v61;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3454 if ( (signed int)v62 >=v20->pNumPresenceButton +v20->pStartingPosActiveItem )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3455 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3456 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3457 v30 = pGlobalTXT_LocalizationStrings[400]; //"Buy Spells"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3458 goto LABEL_55;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3459 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3460 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3461 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3462
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3463
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3464
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3465 //----- (004B705E) --------------------------------------------------------
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3466 void TempleDialog()
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3467 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3468 GUIWindow *v0; // ebx@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3469 Player *v1; // esi@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3470 int v2; // edi@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3471 int result; // eax@4
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3472 GUIWindow *v4; // edi@6
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3473 void *v5; // eax@6
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3474 int v6; // eax@6
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3475 unsigned int v7; // eax@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3476 int v8; // ecx@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3477 unsigned int v9; // eax@9
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3478 int v10; // eax@11
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3479 int v11; // eax@12
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3480 GUIWindow *v12; // ecx@16
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3481 int v13; // edx@16
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3482 GUIButton *v14; // eax@19
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3483 GUIButton *v15; // edi@19
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3484 int v16; // eax@19
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3485 const char *v17; // eax@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3486 int v18; // eax@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3487 unsigned int v19; // ecx@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3488 int v20; // eax@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3489 unsigned __int16 v21; // ax@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3490 unsigned __int16 v22; // ST14_2@27
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3491 int v23; // eax@27
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3492 double v24; // st7@28
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3493 unsigned int v25; // ebx@28
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3494 DDM_DLV_Header *v26; // edi@29
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3495 int v27; // eax@31
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3496 int v28; // eax@32
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3497 //unsigned int v29; // ecx@34
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3498 unsigned int v30; // edx@36
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3499 unsigned int v31; // edx@38
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3500 unsigned int v32; // edx@40
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3501 unsigned int v33; // edx@42
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3502 unsigned int v34; // edx@44
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3503 int v35; // edi@50
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3504 signed int v36; // eax@50
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3505 unsigned __int8 v37; // al@54
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3506 int v38; // ecx@54
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3507 GUIWindow *v39; // eax@56
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3508 unsigned __int8 v40; // al@61
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3509 GUIButton *v41; // edi@64
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3510 int v42; // esi@66
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3511 GUIWindow *v43; // ecx@66
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3512 int v44; // edi@66
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3513 int v45; // eax@68
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3514 signed int v46; // edi@69
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3515 int v47; // edi@71
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3516 GUIButton *v48; // eax@73
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3517 const char *v49; // edx@73
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3518 GUIButton *v50; // esi@73
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3519 int v51; // eax@73
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3520 unsigned int v52; // ecx@73
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3521 unsigned __int16 v53; // ax@73
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3522 char a1[300]; // [sp+10h] [bp-1B4h]@64
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3523 GUIWindow v57; // [sp+13Ch] [bp-88h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3524 __int64 v58; // [sp+190h] [bp-34h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3525 __int64 v59; // [sp+198h] [bp-2Ch]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3526 __int64 v60; // [sp+1A0h] [bp-24h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3527 GUIWindow *v61; // [sp+1ACh] [bp-18h]@6
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3528 unsigned int v62; // [sp+1B0h] [bp-14h]@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3529 unsigned __int8 v63; // [sp+1B7h] [bp-Dh]@64
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3530 int v64; // [sp+1B8h] [bp-Ch]@6
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3531 unsigned int v65; // [sp+1BCh] [bp-8h]@6
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3532 DDM_DLV_Header *v66; // [sp+1C0h] [bp-4h]@6
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3533
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3534 v0 = window_SpeakInHouse;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3535 memcpy(&v57, window_SpeakInHouse, sizeof(v57));
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3536 v57.uFrameX = 483;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3537 v57.uFrameWidth = 148;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3538 v57.uFrameZ = 334;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3539 HIDWORD(v58) = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3540 HIDWORD(v59) = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3541 v1 = pPlayers[uActiveCharacter];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3542 //v2 = pPlayers[uActiveCharacter]->_4B807C(p2DEvents_minus1__20[13 * (unsigned int)v0->ptr_1C]);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3543 v2 = pPlayers[uActiveCharacter]->_4B807C(p2DEvents[(unsigned int)v0->ptr_1C - 1].fPriceMultiplier);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3544 HIDWORD(v60) = v2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3545 if ( dialog_menu_id != 1 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3546 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3547 if ( dialog_menu_id != 10 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3548 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3549 if ( dialog_menu_id != 11 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3550 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3551
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3552 if ( dialog_menu_id == 96 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3553 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3554 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
3555 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3556 v4 = pDialogueWindow;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3557 v61 = pDialogueWindow;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3558 v5 = window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3559 v66 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3560 //v65 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (signed int)v5] * 500.0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3561 v65 = (signed __int64)(p2DEvents[(signed int)v5 - 1].flt_24 * 500.0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3562 v6 = v1->GetMerchant();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3563 v64 = (signed int)(v65 * (100 - v6)) / 100;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3564 if ( v64 < (signed int)v65 / 3 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3565 v64 = (signed int)v65 / 3;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3566 v7 = v4->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3567 v8 = v7 + v4->pNumPresenceButton;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3568 v65 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3569 v62 = v7;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3570 if ( (signed int)v7 >= v8 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3571 goto LABEL_78;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3572 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3573 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3574 v9 = v4->GetControl(v62)->uControlParam - 36;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3575 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
3576 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3577 v10 = pFontArrus->CalcTextHeight(pSkillNames[v9], &v57, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3578 v66 = (DDM_DLV_Header *)((char *)v66 + v10);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3579 ++v65;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3580 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3581 v11 = v4->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3582 ++v62;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3583 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3584 while ( (signed int)v62 < v4->pNumPresenceButton + v11 );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3585 if ( v65 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3586 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3587 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], v64);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3588 v57.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3589 v64 = (149 - (signed int)v66) / (signed int)v65;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3590 if ( v64 > 32 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3591 v64 = 32;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3592 v65 = (signed int)(149 - v65 * v64 - (int)v66) / 2 - v64 / 2 + 162;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3593 v12 = v61;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3594 result = v61->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3595 v13 = result + v61->pNumPresenceButton;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3596 v62 = v61->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3597 if ( result < v13 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3598 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3599 v66 = (DDM_DLV_Header *)2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3600 while ( 1 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3601 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3602 v14 = v12->GetControl(v62);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3603 v15 = v14;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3604 v16 = v14->uControlParam - 36;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3605 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
3606 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3607 v15->uW = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3608 v15->uHeight = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3609 v15->uY = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3610 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3611 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3612 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3613 v17 = pSkillNames[v16];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3614 v15->uY = v64 + v65;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3615 HIDWORD(v60) = (uint32)v17;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3616 v18 = pFontArrus->CalcTextHeight(v17, &v57, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3617 v19 = v15->uY;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3618 v15->uHeight = v18;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3619 v20 = v19 + v18 - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3620 v15->uW = v20;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3621 v65 = v20;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3622 v21 = WORD2(v59);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3623 if ( (DDM_DLV_Header *)pDialogueWindow->pCurrentPosActiveItem != v66 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3624 v21 = WORD2(v58);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3625 v57.DrawTitleText(pFontArrus, 0, v19, v21, (const char *)HIDWORD(v60), 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3626 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3627 result = (int)v61;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3628 ++v62;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3629 v66 = (DDM_DLV_Header *)((char *)v66 + 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3630 if ( (signed int)v62 >= v61->pNumPresenceButton + v61->pStartingPosActiveItem )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3631 break;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3632 v12 = v61;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3633 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3634 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3635 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3636 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3637 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3638 LABEL_78:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3639 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], v1->pName, pClassNames[v1->classType]);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3640 strcat(pTmpBuf, "\n \n");
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3641 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3642 v22 = WORD2(v59);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3643 v23 = pFontArrus->CalcTextHeight(pTmpBuf, &v57, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3644 result = (int)v57.DrawTitleText(pFontArrus, 0, (174 - v23) / 2 + 138, v22, pTmpBuf, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3645 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3646 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3647 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3648 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3649 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3650
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3651 // DONATION
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3652 //v24 = p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3653 v24 = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3654 v25 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3655 if ( pParty->uNumGold >= (unsigned int)(signed __int64)v24 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3656 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3657 Party::TakeGold((signed __int64)v24);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3658 v26 = &pOutdoor->ddm;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3659 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3660 v26 = &pIndoor->dlv;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3661 v27 = v26->uReputation;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3662 v66 = v26;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3663 if ( v27 > -5 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3664 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3665 v28 = v27 - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3666 v26->uReputation = v28;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3667 if ( v28 < -5 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3668 v26->uReputation = -5;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3669 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3670 if ( (unsigned __int8)byte_F8B1EF[uActiveCharacter] == pParty->uDaysPlayed % 7 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3671 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3672 if ( v26->uReputation <= -5 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3673 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3674 v30 = pParty->uDaysPlayed % 7 + 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3675 LOBYTE(v30) = v30 | 0x80;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3676 _42777D_CastSpell_UseWand_ShootArrow(SPELL_AIR_WIZARD_EYE, uActiveCharacter - 1, v30, 48, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3677 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3678 if ( v26->uReputation <= -10 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3679 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3680 v31 = pParty->uDaysPlayed % 7 + 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3681 LOBYTE(v31) = v31 | 0x80;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3682 _42777D_CastSpell_UseWand_ShootArrow(SPELL_SPIRIT_PRESERVATION, uActiveCharacter - 1, v31, 48, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3683 v26 = v66;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3684 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3685 if ( v26->uReputation <= -15 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3686 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3687 v32 = pParty->uDaysPlayed % 7 + 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3688 LOBYTE(v32) = v32 | 0x80;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3689 _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
3690 v26 = v66;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3691 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3692 if ( v26->uReputation <= -20 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3693 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3694 v33 = pParty->uDaysPlayed % 7 + 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3695 LOBYTE(v33) = v33 | 0x80;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3696 _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
3697 v26 = v66;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3698 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3699 if ( v26->uReputation <= -25 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3700 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3701 v34 = pParty->uDaysPlayed % 7 + 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3702 LOBYTE(v34) = v34 | 0x80;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3703 _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
3704 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3705 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3706 ++byte_F8B1EF[uActiveCharacter];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3707 v1->PlaySound(SPEECH_83, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3708 ShowStatusBarString(pGlobalTXT_LocalizationStrings[527], 2u); // "Thank You!"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3709 goto LABEL_46;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3710 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3711 goto LABEL_55;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3712 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3713 if ( !v1->_4B6FF9() )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3714 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3715 v25 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3716 if ( pParty->uNumGold < v2 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3717 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3718 LABEL_55:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3719 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3720 HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 2);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3721 goto LABEL_46;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3722 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3723 Party::TakeGold(v2);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3724 v35 = LODWORD(v1->pConditions[17]);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3725 v59 = v1->pConditions[14];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3726 v58 = v1->pConditions[15];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3727 v60 = v1->pConditions[16];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3728 v61 = (GUIWindow *)HIDWORD(v1->pConditions[17]);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3729 memset(v1, 0, 0xA0u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3730 v1->sHealth = v1->GetMaxHealth();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3731 v1->sMana = v1->GetMaxMana();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3732 v36 = (signed int)window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3733 if ( v36 != 78 && (v36 <= 80 || v36 > 82) )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3734 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3735 if ( (unsigned int)v61 | v35 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3736 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3737 v37 = LOBYTE(v1->field_1928);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3738 v38 = v1->field_1924;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3739 v1->uFace = v37;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3740 v1->uVoiceID = v38;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3741 ReloadPlayerPortraits(uActiveCharacter - 1, (char)v37);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3742 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3743 goto LABEL_63;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3744 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3745 v39 = v61;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3746 if ( (unsigned int)v61 | v35 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3747 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3748 LODWORD(v1->pConditions[17]) = v35;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3749 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3750 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3751 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3752 if ( !v60 && !v58 && !v59 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3753 goto LABEL_63;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3754 v1->field_1928 = v1->uFace;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3755 v1->field_1924 = v1->uVoiceID;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3756 v1->SetCondition(0x11u, 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3757 v1->uVoiceID = (v1->GetSexByVoice() != 0) + 23;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3758 v40 = (v1->GetSexByVoice() != 0) + 23;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3759 v1->uFace = v40;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3760 ReloadPlayerPortraits(uActiveCharacter - 1, (char)v40);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3761 LODWORD(v1->pConditions[17]) = LODWORD(pParty->uTimePlayed);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3762 v39 = (GUIWindow *)HIDWORD(pParty->uTimePlayed);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3763 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3764 HIDWORD(v1->pConditions[17]) = (int)v39;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3765 LABEL_63:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3766 pAudioPlayer->PlaySound((SoundID)(SOUND_GoldReceived|0x2), -1, 0, -1, 0, 0, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3767 v1->PlaySound(SPEECH_82, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3768 pOtherOverlayList->_4418B1(20, uActiveCharacter + 99, 0, 65536);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3769 LABEL_46:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3770 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, v25);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3771 return ; // void func
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3772 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3773 v63 = 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3774 v41 = pDialogueWindow->GetControl(pDialogueWindow->pStartingPosActiveItem);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3775 strcpy(a1, "");
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3776 v41->uHeight = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3777 v41->uY = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3778 if ( v1->_4B6FF9() )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3779 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3780 sprintf(a1, "%s %d %s", pGlobalTXT_LocalizationStrings[104], HIDWORD(v60), pGlobalTXT_LocalizationStrings[97]);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3781 v63 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3782 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3783 strcpy(&a1[100], pGlobalTXT_LocalizationStrings[68]);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3784 strcpy(&a1[200], pGlobalTXT_LocalizationStrings[160]);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3785 v42 = v63;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3786 v43 = pDialogueWindow;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3787 v44 = v63;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3788 v66 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3789 if ( v63 < pDialogueWindow->pNumPresenceButton )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3790 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3791 v61 = (GUIWindow *)&a1[100 * v63];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3792 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3793 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3794 v45 = pFontArrus->CalcTextHeight((const char *)v61, &v57, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3795 v66 = (DDM_DLV_Header *)((char *)v66 + v45);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3796 v43 = pDialogueWindow;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3797 v61 = (GUIWindow *)((char *)v61 + 100);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3798 ++v44;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3799 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3800 while ( v44 < pDialogueWindow->pNumPresenceButton );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3801 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3802 v46 = v43->pNumPresenceButton - v42;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3803 v64 = (174 - (signed int)v66) / v46;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3804 if ( v64 > 32 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3805 v64 = 32;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3806 v47 = (174 - v64 * v46 - (signed int)v66) / 2 - v64 / 2 + 138;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3807 v65 = v42 + v43->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3808 if ( v42 + v43->pStartingPosActiveItem < v43->pStartingPosActiveItem + v43->pNumPresenceButton )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3809 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3810 v61 = (GUIWindow *)(v42 + 2);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3811 v66 = (DDM_DLV_Header *)&a1[100 * v42];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3812 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3813 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3814 v48 = v43->GetControl(v65);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3815 v49 = (const char *)v66;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3816 v50 = v48;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3817 v48->uY = v64 + v47;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3818 v51 = pFontArrus->CalcTextHeight(v49, &v57, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3819 v52 = v50->uY;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3820 v50->uHeight = v51;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3821 v47 = v52 + v51 - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3822 v50->uW = v47;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3823 v53 = WORD2(v59);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3824 if ( (GUIWindow *)pDialogueWindow->pCurrentPosActiveItem != v61 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3825 v53 = WORD2(v58);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3826 v57.DrawTitleText(pFontArrus, 0, v52, v53, (const char *)v66, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3827 v43 = pDialogueWindow;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3828 v66 = (DDM_DLV_Header *)((char *)v66 + 100);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3829 v61 = (GUIWindow *)((char *)v61 + 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3830 ++v65;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3831 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3832 while ( (signed int)v65 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3833 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3834 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3835 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3836
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3837 //----- (004B4710) --------------------------------------------------------
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3838 int __cdecl TrainingDialog()
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3839 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3840 Player *v0; // ebx@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3841 int color2; // eax@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3842 unsigned int v2; // ecx@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3843 int v3; // eax@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3844 signed int v4; // edx@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3845 int v5; // edi@3
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3846 unsigned int v6; // esi@3
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3847 void *v7; // ecx@3
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3848 int v8; // edx@4
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3849 double v9; // st7@6
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3850 signed int v10; // esi@6
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3851 int v11; // ecx@6
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3852 int result; // eax@9
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3853 GUIWindow *v13; // edi@14
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3854 signed int v14; // esi@14
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3855 unsigned int v15; // esi@16
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3856 int v16; // eax@16
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3857 unsigned int v17; // eax@17
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3858 int v18; // eax@19
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3859 int v19; // ecx@24
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3860 GUIButton *v20; // eax@26
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3861 GUIButton *v21; // esi@26
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3862 int v22; // eax@26
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3863 const char *v23; // eax@28
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3864 int v24; // eax@28
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3865 unsigned int v25; // ecx@28
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3866 int v26; // eax@28
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3867 unsigned __int16 v27; // ax@28
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3868 int v28; // eax@32
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3869 unsigned __int16 v29; // ST14_2@34
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3870 int v30; // eax@34
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3871 const char *v31; // ST18_4@36
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3872 unsigned __int16 v32; // ST14_2@36
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3873 int v33; // eax@36
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3874 int v34; // eax@37
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3875 unsigned int v35; // edi@38
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3876 unsigned int v36; // eax@38
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3877 int v37; // ecx@41
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3878 char *v38; // eax@41
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3879 int *v39; // eax@45
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3880 unsigned int v40; // eax@46
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3881 void *v41; // ecx@46
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3882 unsigned int v42; // eax@46
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3883 GUIWindow *v43; // ecx@59
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3884 int v44; // edx@59
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3885 char **v45; // esi@60
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3886 int v46; // eax@62
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3887 int v47; // eax@68
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3888 int v48; // edx@69
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3889 int v49; // ebx@69
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3890 unsigned __int8 v50; // sf@69
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3891 char **v51; // edi@70
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3892 GUIButton *v52; // eax@71
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3893 GUIButton *v53; // esi@71
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3894 int v54; // eax@71
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3895 unsigned int v55; // ecx@71
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3896 int v56; // eax@71
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3897 unsigned __int16 v57; // ax@71
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3898 unsigned __int16 v58; // [sp-Ch] [bp-90h]@38
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3899 const char *v59; // [sp-Ch] [bp-90h]@63
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3900 char *v60; // [sp-8h] [bp-8Ch]@38
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3901 char *v61; // [sp-8h] [bp-8Ch]@63
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3902 unsigned int v62; // [sp-4h] [bp-88h]@38
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3903 int v63; // [sp-4h] [bp-88h]@52
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3904 char *v64; // [sp-4h] [bp-88h]@63
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3905 GUIWindow v65; // [sp+Ch] [bp-78h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3906 __int64 v66; // [sp+60h] [bp-24h]@3
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3907 unsigned int white; // [sp+68h] [bp-1Ch]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3908 int v68; // [sp+6Ch] [bp-18h]@3
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3909 int v69; // [sp+70h] [bp-14h]@6
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3910 unsigned int i; // [sp+74h] [bp-10h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3911 int v71; // [sp+78h] [bp-Ch]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3912 int v72; // [sp+7Ch] [bp-8h]@16
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3913 int v73; // [sp+80h] [bp-4h]@14
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3914
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3915 v0 = pPlayers[uActiveCharacter];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3916 memcpy(&v65, window_SpeakInHouse, sizeof(v65));
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3917 v65.uFrameX = 483;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3918 v65.uFrameWidth = 148;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3919 v65.uFrameZ = 334;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3920 white = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3921 color2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3922 v2 = v0->uLevel;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3923 v71 = color2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3924 v3 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3925 v4 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3926 for ( i = v2; v4 < (signed int)v2; ++v4 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3927 v3 += v4 + 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3928 v5 = 1000 * v3;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3929 v6 = HIDWORD(v0->uExperience);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3930 v7 = window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3931 v68 = (unsigned __int16)word_4F0866[(signed int)v7];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3932 v66 = 1000 * v3;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3933 if ( (signed __int64)__PAIR__(v6, LODWORD(v0->uExperience)) >= v66 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3934 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3935 v8 = v0->classType % 4 + 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3936 if ( v8 == 4 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3937 v8 = 3;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3938 v9 = (double)(signed int)i;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3939 i = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3940 v69 = v8;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3941 //v10 = (signed __int64)(v9 * p2DEvents_minus1__20[13 * (signed int)v7] * (double)v8);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3942 v10 = (signed __int64)(v9 * p2DEvents[(signed int)v7 - 1].fPriceMultiplier * (double)v8);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3943 v11 = v10 * (100 - v0->GetMerchant()) / 100;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3944 if ( v11 < v10 / 3 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3945 v11 = v10 / 3;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3946 i = v11;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3947 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3948 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
3949 if ( result )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3950 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3951 if ( dialog_menu_id != 1 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3952 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3953 if ( dialog_menu_id != 17 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3954 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3955 result = dialog_menu_id - 96;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3956 if ( dialog_menu_id == 96 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3957 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3958 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
3959 if ( result )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3960 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3961 i = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3962 v13 = pDialogueWindow;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3963 //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
3964 v14 = (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
3965 v73 = v14 * (100 - v0->GetMerchant()) / 100;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3966 if ( v73 < v14 / 3 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3967 v73 = v14 / 3;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3968 v15 = v13->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3969 v16 = v13->pNumPresenceButton;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3970 v72 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3971 if ( (signed int)v15 >= (signed int)(v15 + v16) )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3972 goto LABEL_76;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3973 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3974 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3975 v17 = v13->GetControl(v15)->uControlParam - 36;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3976 if ( byte_4ED970_skill_learn_ability_by_class_table[v0->classType][v17] && !v0->pActiveSkills[v17] )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3977 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3978 v18 = pFontArrus->CalcTextHeight(pSkillNames[v17], &v65, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3979 i += v18;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3980 ++v72;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3981 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3982 ++v15;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3983 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3984 while ( (signed int)v15 < v13->pNumPresenceButton + v13->pStartingPosActiveItem );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3985 if ( v72 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3986 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3987 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], v73);// "Skill Cost: %lu"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3988 v65.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3989 v73 = (signed int)(149 - i) / v72;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3990 if ( v73 > 32 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3991 v73 = 32;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3992 result = v13->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3993 v19 = (signed int)(149 - v72 * v73 - i) / 2 - v73 / 2 + 162;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3994 i = result;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3995 v68 = v19;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3996 if ( result < result + v13->pNumPresenceButton )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3997 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3998 v72 = 2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
3999 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4000 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4001 v20 = v13->GetControl(i);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4002 v21 = v20;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4003 v22 = v20->uControlParam - 36;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4004 if ( !byte_4ED970_skill_learn_ability_by_class_table[v0->classType][v22] || v0->pActiveSkills[v22] )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4005 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4006 v21->uW = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4007 v21->uHeight = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4008 v21->uY = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4009 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4010 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4011 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4012 v23 = pSkillNames[v22];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4013 v21->uY = v73 + v68;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4014 HIDWORD(v66) = (int)v23;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4015 v24 = pFontArrus->CalcTextHeight(v23, &v65, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4016 v25 = v21->uY;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4017 v21->uHeight = v24;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4018 v26 = v25 + v24 - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4019 v21->uW = v26;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4020 v68 = v26;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4021 v27 = v71;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4022 if ( pDialogueWindow->pCurrentPosActiveItem != v72 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4023 v27 = white;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4024 v65.DrawTitleText(pFontArrus, 0, v25, v27, (char *)HIDWORD(v66), 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4025 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4026 v28 = v13->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4027 ++i;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4028 result = v13->pNumPresenceButton + v28;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4029 ++v72;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4030 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4031 while ( (signed int)i < result );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4032 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4033 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4034 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4035 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4036 LABEL_76:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4037 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], v0->pName, pClassNames[v0->classType]);//
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4038 // "Seek knowledge elsewhere %s the %s"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4039 strcat(pTmpBuf, "\n \n");
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4040 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);// "I can offer you nothing further."
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4041 v29 = v71;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4042 v30 = pFontArrus->CalcTextHeight(pTmpBuf, &v65, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4043 result = (int)v65.DrawTitleText(pFontArrus, 0, (174 - v30) / 2 + 138, v29, pTmpBuf, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4044 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4045 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4046 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4047 return result;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4048 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4049 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
4050 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4051 v31 = pNPCTopics[122].pText;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4052 v32 = v71;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4053 v33 = pFontArrus->CalcTextHeight(pNPCTopics[122].pText, &v65, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4054 v65.DrawTitleText(pFontArrus, 0, (212 - v33) / 2 + 101, v32, v31, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4055 result = (int)pDialogueWindow;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4056 pDialogueWindow->pNumPresenceButton = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4057 return result;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4058 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4059 v34 = v0->uLevel;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4060 if ( v34 < v68 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4061 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4062 if ( (signed __int64)v0->uExperience >= v66 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4063 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4064 if ( pParty->uNumGold >= i )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4065 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4066 Party::TakeGold(i);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4067 HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 2);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4068 ++v0->uLevel;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4069 v0->uSkillPoints += v0->uLevel / 10 + 5;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4070 v0->sHealth = v0->GetMaxHealth();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4071 v0->sMana = v0->GetMaxMana();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4072 v37 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4073 v38 = byte_F8B148;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4074 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4075 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4076 if ( *(int *)v38 > v37 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4077 v37 = *(int *)v38;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4078 v38 += 4;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4079 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4080 while ( (signed int)v38 < (signed int)word_F8B158 );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4081 v39 = &dword_F8B144 + uActiveCharacter;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4082 ++*v39;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4083 if ( *v39 > v37 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4084 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4085 v40 = sub_494820(pParty->uCurrentHour);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4086 v41 = window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4087 v42 = 60 * (v40 + 4) - pParty->uCurrentMinute;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4088 if ( v41 == (void *)94 || v41 == (void *)95 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4089 v42 += 720;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4090 RestAndHeal((signed int)(v42 + 10080));
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4091 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4092 pOutdoor->SetFog();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4093 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4094 v0->PlaySound(SPEECH_87, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4095 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[430], v0->pName, v0->uLevel, v0->uLevel / 10 + 5);//
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4096 // "%s is now Level %lu and has earned %lu Skill Points!"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4097 ShowStatusBarString(pTmpBuf, 2u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4098 goto LABEL_56;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4099 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4100 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);// "You don't have enough gold"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4101 v63 = 4;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4102 LABEL_55:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4103 HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, v63);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4104 LABEL_56:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4105 /*result = pMessageQueue_50CBD0->uNumMessages;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4106 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4107 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4108 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4109 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4110 result = 3 * pMessageQueue_50CBD0->uNumMessages + 3;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4111 *(&pMessageQueue_50CBD0->uNumMessages + result) = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4112 ++pMessageQueue_50CBD0->uNumMessages;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4113 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4114 return result;*/
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4115 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4116 return 1; // void function actually
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4117 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4118 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[538], v5 - LODWORD(v0->uExperience), v34 + 1);//
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4119 // "You need %d more experience to train to level %d"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4120 v35 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4121 v62 = 3;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4122 v60 = pTmpBuf;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4123 v58 = v71;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4124 v36 = (212 - pFontArrus->CalcTextHeight(pTmpBuf, &v65, 0, 0)) / 2 + 88;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4125 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4126 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4127 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4128 sprintf(pTmpBuf, "%s\n \n%s", pGlobalTXT_LocalizationStrings[536], pGlobalTXT_LocalizationStrings[529]);//
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4129 // ""With your skills, you should be working here as a teacher.""
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4130 // ""Sorry, but we are unable to train you.""
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4131 v35 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4132 v62 = 3;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4133 v60 = pTmpBuf;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4134 v58 = v71;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4135 v36 = (212 - pFontArrus->CalcTextHeight(pTmpBuf, &v65, 0, 0)) / 2 + 101;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4136 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4137 v65.DrawTitleText(pFontArrus, v35, v36, v58, v60, v62);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4138 v63 = 3;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4139 goto LABEL_55;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4140 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4141 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
4142 if ( result )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4143 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4144 v43 = pDialogueWindow;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4145 v72 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4146 pShopOptions[0] = pTmpBuf;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4147 pShopOptions[1] = pGlobalTXT_LocalizationStrings[160];// "Learn Skills"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4148 v44 = pDialogueWindow->pNumPresenceButton;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4149 v73 = pDialogueWindow->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4150 if ( v73 < v73 + v44 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4151 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4152 v45 = pShopOptions;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4153 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4154 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4155 if ( v43->GetControl(v73)->uControlParam == 17 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4156 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4157 v46 = v0->uLevel;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4158 if ( v46 < v68 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4159 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4160 if ( (signed __int64)v0->uExperience < v66 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4161 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4162 v64 = (char *)(v46 + 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4163 v61 = (char *)(v5 - LODWORD(v0->uExperience));
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4164 v59 = pGlobalTXT_LocalizationStrings[538];// "You need %d more experience to train to level %d"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4165 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4166 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4167 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4168 v64 = (char *)i;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4169 v61 = (char *)(v46 + 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4170 v59 = pGlobalTXT_LocalizationStrings[537];// "Train to level %d for %d gold"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4171 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4172 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4173 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4174 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4175 v64 = pGlobalTXT_LocalizationStrings[529];// ""Sorry, but we are unable to train you.""
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4176 v61 = pGlobalTXT_LocalizationStrings[536];// ""With your skills, you should be working here as a teacher.""
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4177 v59 = "%s\n \n%s";
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4178 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4179 sprintf(*v45, v59, v61, v64);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4180 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4181 v47 = pFontArrus->CalcTextHeight(*v45, &v65, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4182 v43 = pDialogueWindow;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4183 v72 += v47;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4184 ++v45;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4185 ++v73;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4186 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4187 while ( v73 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4188 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4189 HIDWORD(v66) = (174 - v72) / 2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4190 result = v43->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4191 v48 = result + v43->pNumPresenceButton;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4192 v49 = (2 * (87 - (174 - v72) / 2) - v72) / 2 - (174 - v72) / 2 / 2 + 138;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4193 v50 = -v43->pNumPresenceButton < 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4194 v73 = v43->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4195 if ( v50 ^ __OFSUB__(result, v48) )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4196 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4197 i = 2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4198 v51 = pShopOptions;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4199 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4200 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4201 v52 = v43->GetControl(v73);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4202 v53 = v52;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4203 v52->uY = HIDWORD(v66) + v49;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4204 v54 = pFontArrus->CalcTextHeight(*v51, &v65, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4205 v55 = v53->uY;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4206 v53->uHeight = v54;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4207 v56 = v54 + v55 - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4208 v53->uW = v56;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4209 v49 = v56;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4210 v57 = v71;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4211 if ( pDialogueWindow->pCurrentPosActiveItem != i )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4212 v57 = white;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4213 v65.DrawTitleText(pFontArrus, 0, v55, v57, *v51, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4214 v43 = pDialogueWindow;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4215 ++i;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4216 ++v51;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4217 ++v73;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4218 result = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4219 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4220 while ( v73 < result );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4221 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4222 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4223 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4224 return result;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4225 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4226
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4227
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4228
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4229
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4230
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4231
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4232
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4233
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4234
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4235 //----- (004B4FCF) --------------------------------------------------------
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4236 void MagicShopDialog()
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4237 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4238 Player *v0; // ebx@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4239 int result; // eax@6
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4240 signed int v2; // esi@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4241 unsigned int v3; // ebx@10
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4242 char *v4; // eax@11
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4243 char *v5; // eax@12
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4244 unsigned int v6; // eax@12
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4245 int v7; // ST08_4@14
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4246 int v8; // eax@14
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4247 unsigned __int8 v9; // dl@14
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4248 char *v10; // ecx@14
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4249 signed int v11; // esi@16
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4250 int v12; // ST08_4@19
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4251 int v13; // eax@19
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4252 int all_text_height; // edi@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4253 char **v15; // esi@21
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4254 int v16; // eax@22
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4255 GUIWindow *v17; // ecx@23
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4256 int v18; // edx@23
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4257 int v19; // edi@23
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4258 unsigned __int8 v20; // sf@23
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4259 GUIButton *control_button; // esi@25
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4260 const char **v22; // eax@25
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4261 int v23; // eax@25
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4262 unsigned int v24; // ecx@25
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4263 const char **v25; // edx@25
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4264 unsigned __int16 text_color; // ax@25
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4265 signed int v27; // esi@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4266 int v28; // ST08_4@34
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4267 int v29; // eax@34
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4268 char *v30; // edx@35
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4269 GUIWindow *v31; // edi@40
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4270 void *v32; // eax@40
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4271 signed int v33; // esi@40
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4272 unsigned int v34; // esi@42
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4273 int v35; // eax@42
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4274 unsigned int v36; // eax@43
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4275 int v37; // eax@45
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4276 int v38; // ecx@50
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4277 GUIButton *v39; // eax@52
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4278 GUIButton *v40; // esi@52
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4279 int v41; // eax@52
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4280 char *v42; // eax@54
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4281 int v43; // eax@54
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4282 unsigned int v44; // ecx@54
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4283 int v45; // edx@54
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4284 int v46; // eax@54
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4285 unsigned __int16 v47; // ax@54
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4286 int v48; // eax@58
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4287 signed int v49; // esi@62
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4288 Texture *v50; // ecx@64
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4289 unsigned int v51; // edi@64
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4290 unsigned int v52; // esi@66
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4291 int v53; // edx@70
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4292 Texture *v54; // ecx@76
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4293 unsigned int v55; // edi@76
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4294 unsigned int v56; // esi@76
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4295 int v57; // edx@80
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4296 Texture *v58; // ecx@86
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4297 unsigned int v59; // edi@86
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4298 unsigned int v60; // esi@88
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4299 int v61; // edx@92
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4300 Texture *v62; // ecx@98
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4301 unsigned int v63; // edi@98
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4302 unsigned int v64; // esi@100
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4303 int v65; // edx@104
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4304 signed int v66; // ecx@109
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4305 SHORT v67; // di@117
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4306 bool v68; // eax@117
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4307 const char *v69; // ecx@119
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4308 POINT *v70; // esi@124
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4309 int v71; // ecx@125
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4310 int v72; // eax@125
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4311 int v73; // ecx@125
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4312 ItemGen *v74; // esi@125
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4313 int v75; // eax@130
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4314 int v76; // esi@131
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4315 char **v77; // edi@131
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4316 int v78; // eax@132
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4317 GUIWindow *v79; // ecx@133
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4318 int v80; // edx@133
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4319 int v81; // edi@133
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4320 GUIButton *v82; // esi@135
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4321 const char **v83; // eax@135
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4322 int v84; // eax@135
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4323 unsigned int v85; // ecx@135
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4324 int v86; // edx@135
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4325 unsigned __int16 v87; // ax@135
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4326 GUIWindow *v88; // [sp-18h] [bp-110h]@35
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4327 int v89; // [sp-14h] [bp-10Ch]@35
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4328 ItemGen *v90; // [sp-10h] [bp-108h]@14
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4329 int v91; // [sp-10h] [bp-108h]@35
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4330 unsigned __int16 v92; // [sp-Ch] [bp-104h]@12
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4331 void *v93; // [sp-Ch] [bp-104h]@14
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4332 int v94; // [sp-8h] [bp-100h]@11
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4333 char *v95; // [sp-8h] [bp-100h]@12
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4334 __int64 *v96; // [sp-4h] [bp-FCh]@11
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4335 unsigned int v97; // [sp-4h] [bp-FCh]@12
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4336 POINT v98; // [sp+Ch] [bp-ECh]@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4337 POINT v99; // [sp+14h] [bp-E4h]@16
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4338 POINT v100; // [sp+1Ch] [bp-DCh]@124
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4339 POINT v101; // [sp+24h] [bp-D4h]@17
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4340 POINT v102; // [sp+2Ch] [bp-CCh]@124
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4341 POINT v103; // [sp+34h] [bp-C4h]@9
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4342 POINT v104; // [sp+3Ch] [bp-BCh]@31
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4343 POINT v105; // [sp+44h] [bp-B4h]@16
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4344 POINT v106; // [sp+4Ch] [bp-ACh]@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4345 POINT v107; // [sp+54h] [bp-A4h]@16
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4346 POINT v108; // [sp+5Ch] [bp-9Ch]@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4347 POINT a2; // [sp+64h] [bp-94h]@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4348 POINT v110; // [sp+6Ch] [bp-8Ch]@30
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4349 POINT v111; // [sp+74h] [bp-84h]@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4350 GUIWindow dialog_window; // [sp+7Ch] [bp-7Ch]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4351 char *Str; // [sp+D0h] [bp-28h]@54
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4352 int v146; // [sp+D4h] [bp-24h]@23
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4353 unsigned int hilight_color; // [sp+D8h] [bp-20h]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4354 unsigned int m_text_color; // [sp+DCh] [bp-1Ch]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4355 __int32 v117; // [sp+E0h] [bp-18h]@8
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4356 int v118; // [sp+E4h] [bp-14h]@40
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4357 const char **v119; // [sp+E8h] [bp-10h]@24
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4358 Player *_this; // [sp+ECh] [bp-Ch]@1
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4359 unsigned __int8 uPlayerID; // [sp+F3h] [bp-5h]@14
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4360 int v152; // [sp+F4h] [bp-4h]@23
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4361 int v122;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4362 int v114;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4363
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4364 v0 = pPlayers[uActiveCharacter];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4365 _this = pPlayers[uActiveCharacter];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4366 memcpy(&dialog_window, window_SpeakInHouse, sizeof(dialog_window));
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4367 dialog_window.uFrameX = 483;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4368 dialog_window.uFrameWidth = 148;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4369 dialog_window.uFrameZ = 334;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4370 m_text_color = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4371 hilight_color = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4372 if ( dialog_menu_id > 5 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4373 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4374 if ( dialog_menu_id == 94 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4375 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4376 draw_leather();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4377 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4378 pShopOptions[0] = pGlobalTXT_LocalizationStrings[200];// "Sell"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4379 pShopOptions[1] = pGlobalTXT_LocalizationStrings[113];// "Identify"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4380 pShopOptions[2] = pGlobalTXT_LocalizationStrings[179];// "Repair"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4381 v76 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4382 v77 = pShopOptions;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4383 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4384 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4385 v78 = pFontArrus->CalcTextHeight(*v77, &dialog_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4386 ++v77;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4387 v76 += v78;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4388 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4389 while ( (signed int)v77 < (signed int)&pShopOptions[3] );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4390 v79 = pDialogueWindow;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4391 _this = (Player *)((174 - v76) / 3);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4392 result = pDialogueWindow->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4393 v80 = result + pDialogueWindow->pNumPresenceButton;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4394 v81 = (3 * (58 - (signed int)_this) - v76) / 2 - (174 - v76) / 3 / 2 + 138;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4395 v20 = -pDialogueWindow->pNumPresenceButton < 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4396 v118 = pDialogueWindow->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4397 if ( v20 ^ __OFSUB__(result, v80) )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4398 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4399 v122 = 2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4400 v119 = (const char **)pShopOptions;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4401 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4402 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4403 v82 = v79->GetControl(v118);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4404 v83 = v119;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4405 v82->uY = (unsigned int)((char *)_this + v81);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4406 v84 = pFontArrus->CalcTextHeight(*v83, &dialog_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4407 v85 = v82->uY;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4408 v86 = v122;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4409 v82->uHeight = v84;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4410 v81 = v84 + v85 - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4411 v82->uW = v81;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4412 v87 = hilight_color;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4413 if ( pDialogueWindow->pCurrentPosActiveItem != v86 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4414 v87 = m_text_color;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4415 dialog_window.DrawTitleText(pFontArrus, 0, v85, v87, *v119, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4416 v79 = pDialogueWindow;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4417 ++v122;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4418 ++v119;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4419 ++v118;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4420 result = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4421 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4422 while ( v118 < result );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4423 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4424 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4425 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4426 if ( dialog_menu_id != 95 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4427 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4428 result = dialog_menu_id - 96;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4429 if ( dialog_menu_id == 96 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4430 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4431 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
4432 if ( result )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4433 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4434 v31 = pDialogueWindow;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4435 v3 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4436 v32 = window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4437 v118 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4438 //v33 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (signed int)v32] * 500.0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4439 v33 = (signed __int64)(p2DEvents[(signed int)v32 - 1].flt_24 * 500.0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4440 v119 = (const char **)(v33 * (100 - _this->GetMerchant()) / 100);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4441 if ( (signed int)v119 < v33 / 3 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4442 v119 = (const char **)(v33 / 3);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4443 v34 = v31->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4444 v35 = v34 + v31->pNumPresenceButton;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4445 v122 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4446 if ( (signed int)v34 >= v35 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4447 goto LABEL_140;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4448 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4449 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4450 v36 = v31->GetControl(v34)->uControlParam - 36;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4451 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
4452 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4453 v37 = pFontArrus->CalcTextHeight(pSkillNames[v36], &dialog_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4454 v118 += v37;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4455 ++v122;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4456 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4457 ++v34;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4458 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4459 while ( (signed int)v34 < v31->pNumPresenceButton + v31->pStartingPosActiveItem );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4460 if ( !v122 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4461 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4462 LABEL_140:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4463 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], _this->pName, pClassNames[_this->classType]);//
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4464 // "Seek knowledge elsewhere %s the %s"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4465 strcat(pTmpBuf, "\n \n");
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4466 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);// "I can offer you nothing further."
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4467 v30 = pTmpBuf;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4468 v97 = 3;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4469 v95 = pTmpBuf;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4470 v92 = hilight_color;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4471 v91 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4472 v89 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4473 v88 = &dialog_window;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4474 goto LABEL_61;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4475 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4476 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], v119);// "Skill Cost: %lu"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4477 dialog_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4478 v119 = (const char **)((149 - v118) / v122);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4479 if ( (149 - v118) / v122 > 32 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4480 v119 = (const char **)32;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4481 result = v31->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4482 v38 = (149 - v122 * (signed int)v119 - v118) / 2 - (signed int)v119 / 2 + 162;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4483 v118 = result;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4484 v114 = v38;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4485 if ( result < result + v31->pNumPresenceButton )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4486 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4487 v122 = 2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4488 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4489 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4490 v39 = v31->GetControl(v118);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4491 v40 = v39;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4492 v41 = v39->uControlParam - 36;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4493 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
4494 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4495 v40->uW = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4496 v40->uHeight = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4497 v40->uY = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4498 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4499 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4500 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4501 v42 = pSkillNames[v41];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4502 v40->uY = (unsigned int)((char *)v119 + v114);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4503 Str = v42;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4504 v43 = pFontArrus->CalcTextHeight(v42, &dialog_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4505 v44 = v40->uY;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4506 v45 = v122;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4507 v40->uHeight = v43;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4508 v46 = v44 + v43 - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4509 v40->uW = v46;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4510 v114 = v46;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4511 v47 = hilight_color;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4512 if ( pDialogueWindow->pCurrentPosActiveItem != v45 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4513 v47 = m_text_color;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4514 dialog_window.DrawTitleText(pFontArrus, 0, v44, v47, Str, 3u);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4515 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4516 v48 = v31->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4517 ++v118;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4518 result = v31->pNumPresenceButton + v48;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4519 ++v122;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4520 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4521 while ( v118 < result );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4522 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4523 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4524 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4525 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4526 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4527 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4528 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4529 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4530 if ( dialog_menu_id == 5 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4531 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4532 draw_leather();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4533 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4534 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[198], 0);// "Select the Item to Repair"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4535 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
4536 if ( !result
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4537 || (v27 = pMouse->GetCursorPos(&v110)->x - 14,
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4538 v117 = (v27 >> 5) + 14 * ((pMouse->GetCursorPos(&v108)->y - 17) >> 5),
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4539 result = (int)pMouse->GetCursorPos(&v106),
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4540 *(int *)result <= 13)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4541 || (result = (int)pMouse->GetCursorPos(&v104), *(int *)result >= 462)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4542 || (result = v0->GetItemIDAtInventoryIndex((int *)&v117), v3 = 0, !result)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4543 || (result *= 9, !(_this->field_1F5[4 * result + 15] & 2)) )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4544 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4545 v96 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4546 v94 = 5;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4547 v93 = window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4548 v90 = (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * result + 5];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4549 v28 = (int)window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4550 uPlayerID = uActiveCharacter - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4551 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
4552 v9 = uPlayerID;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4553 v10 = (char *)pMerchantsRepairPhrases[v29];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4554 goto LABEL_35;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4555 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4556 if ( dialog_menu_id == 1 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4557 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4558 /* 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
4559 if ( result )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4560 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4561 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134];// "Buy Standard"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4562 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152];// "Buy Special"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4563 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159];// "Display Inventory"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4564 v14 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4565 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160];// "Learn Skills"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4566 v15 = pShopOptions;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4567 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4568 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4569 v16 = pFontArrus->CalcTextHeight(*v15, &dialogue_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4570 ++v15;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4571 v14 += v16;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4572 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4573 while ( (signed int)v15 < (signed int)&unk_F8B1C8 );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4574 v17 = pDialogueWindow;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4575 v114 = (174 - v14) / 4;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4576 result = pDialogueWindow->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4577 v18 = result + pDialogueWindow->pNumPresenceButton;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4578 v19 = (174 - 4 * (174 - v14) / 4 - v14) / 2 - (174 - v14) / 4 / 2 + 138;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4579 v20 = -pDialogueWindow->pNumPresenceButton < 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4580 v122 = pDialogueWindow->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4581 if ( v20 ^ __OFSUB__(result, v18) )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4582 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4583 v119 = (const char **)2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4584 _this = (Player *)pShopOptions;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4585 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4586 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4587 v21 = v17->GetControl(v122);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4588 v22 = (const char **)_this;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4589 v21->uY = v114 + v19;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4590 v23 = pFontArrus->CalcTextHeight(*v22, &dialogue_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4591 v24 = v21->uY;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4592 v25 = v119;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4593 v21->uHeight = v23;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4594 v19 = v24 + v23 - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4595 v21->uW = v19;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4596 v26 = color2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4597 if ( (const char **)pDialogueWindow->pCurrentPosActiveItem != v25 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4598 v26 = m_text_color;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4599 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
4600 v17 = pDialogueWindow;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4601 v119 = (const char **)((char *)v119 + 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4602 _this = (Player *)((char *)_this + 4);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4603 ++v122;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4604 result = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4605 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4606 while ( v122 < result );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4607 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4608 }*/
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4609 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
4610 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4611 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134]; //"Buy Standard"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4612 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152]; //"Buy Special"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4613 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159]; //"Display Inventory"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4614 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4615
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4616 all_text_height = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4617 for(int i=0;i<4;++i)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4618 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4619 v146 = (174 - all_text_height) / 4;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4620
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4621 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
4622 int j=0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4623 if ( pDialogueWindow->pNumPresenceButton>=0 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4624 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4625 int th = 2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4626 for (v152 = pDialogueWindow->pStartingPosActiveItem; v152 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem; ++v152)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4627 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4628 control_button = pDialogueWindow->GetControl(v152);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4629 control_button->uY = v146 + v23;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4630 v27 = pFontArrus->CalcTextHeight(pShopOptions[j], &dialog_window, 0, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4631 control_button->uHeight = v27;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4632 v23 = control_button->uY + control_button->uHeight - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4633 control_button->uW = v23;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4634 text_color = hilight_color;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4635 if ( pDialogueWindow->pCurrentPosActiveItem != th )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4636 text_color = m_text_color;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4637 dialog_window.DrawTitleText(pFontArrus, 0, control_button->uY, text_color, pShopOptions[j], 3);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4638 ++th;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4639 ++j;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4640 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4641 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4642
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4643
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4644 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4645 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4646 if ( dialog_menu_id != 2 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4647 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4648 if ( dialog_menu_id != 3 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4649 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4650 result = dialog_menu_id - 4;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4651 if ( dialog_menu_id == 4 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4652 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4653 draw_leather();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4654 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4655 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0);// "Select the Item to Identify"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4656 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
4657 if ( result )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4658 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4659 v2 = pMouse->GetCursorPos(&a2)->x - 14;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4660 v117 = (v2 >> 5) + 14 * ((pMouse->GetCursorPos(&v98)->y - 17) >> 5);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4661 result = (int)pMouse->GetCursorPos(&v111);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4662 if ( *(int *)result > 13 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4663 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4664 result = (int)pMouse->GetCursorPos(&v103);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4665 if ( *(int *)result < 462 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4666 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4667 result = v0->GetItemIDAtInventoryIndex((int *)&v117);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4668 v3 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4669 if ( result )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4670 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4671 v96 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4672 v94 = 4;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4673 v4 = (char *)&_this->pInventoryItems[result-1];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4674 if ( v4[20] & 1 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4675 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4676 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
4677 v97 = 3;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4678 v95 = v5;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4679 v92 = m_text_color;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4680 v6 = (212 - pFontArrus->CalcTextHeight(v5, &dialog_window, 0, 0)) / 2 + 101;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4681
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4682 dialog_window.DrawTitleText(pFontArrus, v3, v6, v92, v95, v97);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4683 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4684 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4685 v93 = window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4686 v90 = (ItemGen *)v4;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4687 v7 = (int)window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4688 uPlayerID = uActiveCharacter - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4689 v8 = ((Player *)_this)->_490EEE((ItemGen *)v4, 3, v7, 4);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4690 v9 = uPlayerID;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4691 v10 = (char *)pMerchantsIdentifyPhrases[v8];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4692 goto LABEL_35;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4693 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4694 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4695 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4696 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4697 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4698 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4699 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4700 draw_leather();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4701 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4702 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0);// "Select the Item to Sell"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4703 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
4704 if ( !result
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4705 || (v11 = pMouse->GetCursorPos(&v107)->x - 14,
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4706 v117 = (v11 >> 5) + 14 * ((pMouse->GetCursorPos(&v99)->y - 17) >> 5),
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4707 result = (int)pMouse->GetCursorPos(&v105),
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4708 *(int *)result <= 13)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4709 || (result = (int)pMouse->GetCursorPos(&v101), *(int *)result >= 462)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4710 || (result = v0->GetItemIDAtInventoryIndex((int *)&v117), v3 = 0, !result) )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4711 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4712 v96 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4713 v94 = 3;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4714 v93 = window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4715 v90 = (ItemGen *)&_this->pInventoryItems[result-1];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4716 v12 = (int)window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4717 uPlayerID = uActiveCharacter - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4718 v13 = _this->_490EEE(v90, 3, v12, 3);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4719 v9 = uPlayerID;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4720 v10 = (char *)pMerchantsSellPhrases[v13];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4721 LABEL_35:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4722 v30 = BuilDialogueString(v10, v9, v90, (char *)v93, v94, v96);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4723 v97 = 3;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4724 v95 = v30;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4725 v92 = m_text_color;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4726 v91 = v3;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4727 v89 = v3;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4728 v88 = &dialog_window;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4729 LABEL_61:
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4730 v6 = (174 - pFontArrus->CalcTextHeight(v30, v88, v89, v91)) / 2 + 138;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4731 dialog_window.DrawTitleText(pFontArrus, v3, v6, v92, v95, v97);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4732 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4733 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4734 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4735 pRenderer->DrawTextureIndexed(8u, 8u, ShopTexture);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4736 v3 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4737 v49 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4738 v122 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4739 if ( dialog_menu_id == 2 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4740 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4741 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4742 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4743 // if ( pParty->field_777C[9 * (v49 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4744 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v49].uItemID);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4745 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4746 v50 = ItemsInShopTexture[v49];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4747 v51 = 152 - v50->uTextureHeight;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4748 if ( (signed int)v51 < 1 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4749 v51 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4750 v52 = 75 * v49 - v50->uTextureWidth / 2 + 40;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4751 if ( v122 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4752 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4753 if ( v122 == 5 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4754 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4755 v53 = ItemsInShopTexture[5]->uTextureWidth;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4756 if ( (signed int)v52 > 457 - v53 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4757 v52 = 457 - v53;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4758 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4759 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4760 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4761 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4762 if ( (signed int)v52 < 18 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4763 v52 = 18;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4764 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4765 pRenderer->DrawTextureTransparent(v52, v51, v50);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4766 sub_40F92A(&pRenderer->pActiveZBuffer[v52 + 640 * v51], ItemsInShopTexture[v122], v122 + 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4767 v49 = v122;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4768 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4769 ++v49;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4770 v122 = v49;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4771 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4772 while ( v49 < 6 );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4773 v122 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4774 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4775 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4776 //if ( pParty->field_777C[9 * (v122 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 54] )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4777 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v122+1].uItemID);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4778 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4779 v54 = ItemsInShopTexture[v122 + 6];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4780 v55 = 306 - v54->uTextureHeight;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4781 v56 = 75 * v122 - v54->uTextureWidth / 2 + 40;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4782 if ( v122 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4783 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4784 if ( v122 == 5 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4785 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4786 v57 = ItemsInShopTexture[11]->uTextureWidth;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4787 if ( (signed int)v56 > 457 - v57 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4788 v56 = 457 - v57;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4789 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4790 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4791 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4792 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4793 if ( (signed int)v56 < 18 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4794 v56 = 18;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4795 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4796 pRenderer->DrawTextureTransparent(v56, v55, v54);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4797 sub_40F92A(&pRenderer->pActiveZBuffer[v56 + 640 * v55], ItemsInShopTexture[v122 + 6], v122 + 7);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4798 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4799 ++v122;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4800 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4801 while ( v122 < 6 );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4802 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4803 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4804 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4805 do
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 ( pParty->field_C59C[9 * (v49 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4808 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v49].uItemID)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4809 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4810 v58 = ItemsInShopTexture[v49];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4811 v59 = 152 - v58->uTextureHeight;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4812 if ( (signed int)v59 < 1 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4813 v59 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4814 v60 = 75 * v49 - v58->uTextureWidth / 2 + 40;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4815 if ( v122 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4816 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4817 if ( v122 == 5 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4818 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4819 v61 = ItemsInShopTexture[5]->uTextureWidth;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4820 if ( (signed int)v60 > 457 - v61 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4821 v60 = 457 - v61;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4822 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4823 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4824 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4825 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4826 if ( (signed int)v60 < 18 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4827 v60 = 18;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4828 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4829 pRenderer->DrawTextureTransparent(v60, v59, v58);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4830 sub_40F92A(&pRenderer->pActiveZBuffer[v60 + 640 * v59], ItemsInShopTexture[v122], v122 + 1);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4831 v49 = v122;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4832 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4833 ++v49;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4834 v122 = v49;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4835 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4836 while ( v49 < 6 );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4837 v122 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4838 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4839 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4840 //if ( pParty->Spell_Item[(unsigned int)window_SpeakInHouse->ptr_1C][v49] + 778] ) //weak
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4841 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v49].uAttributes)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4842 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4843 v62 = ItemsInShopTexture[v122 + 6];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4844 v63 = 306 - v62->uTextureHeight;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4845 if ( (signed int)v63 < 1 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4846 v63 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4847 v64 = 75 * v122 - v62->uTextureWidth / 2 + 40;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4848 if ( v122 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4849 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4850 if ( v122 == 5 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4851 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4852 v65 = ItemsInShopTexture[11]->uTextureWidth;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4853 if ( (signed int)v64 > 457 - v65 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4854 v64 = 457 - v65;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4855 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4856 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4857 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4858 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4859 if ( (signed int)v64 < 18 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4860 v64 = 18;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4861 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4862 pRenderer->DrawTextureTransparent(v64, v63, v62);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4863 sub_40F92A(&pRenderer->pActiveZBuffer[v64 + 640 * v63], ItemsInShopTexture[v122 + 6], v122 + 7);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4864 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4865 ++v122;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4866 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4867 while ( v122 < 6 );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4868 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4869 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
4870 if ( result )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4871 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4872 v66 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4873 v117 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4874 if ( dialog_menu_id == 2 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4875 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4876 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4877 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4878 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v66].uItemID); //9 * (v66 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4879 ++v117;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4880 ++v66;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4881 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4882 while ( v66 < 12 );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4883 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4884 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4885 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4886 do
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4887 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4888 //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
4889 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v66].uItemID)
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4890 ++v117;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4891 ++v66;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4892 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4893 while ( v66 < 12 );
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4894 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4895 v67 = GetAsyncKeyState(VK_CONTROL);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4896 v68 = _this->CanSteal();
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4897 Str = (char *)v68;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4898 if ( v67 && v68 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4899 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4900 v69 = pGlobalTXT_LocalizationStrings[185];// "Steal item"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4901 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4902 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4903 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4904 v69 = pGlobalTXT_LocalizationStrings[195];// "Select the Item to Buy"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4905 if ( dialog_menu_id != 2 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4906 v69 = pGlobalTXT_LocalizationStrings[196];// "Select the Special Item to Buy"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4907 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4908 DrawTextAtStatusBar(v69, 0);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4909 if ( !v117 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4910 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4911 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
4912 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4913 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4914 v70 = pMouse->GetCursorPos(&v102);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4915 result = v70->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v100)->y];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4916 if ( pRenderer->pActiveZBuffer[result] & 0xFFFF )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4917 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4918 v71 = (pRenderer->pActiveZBuffer[result] & 0xFFFF) - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4919 v117 = v71;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4920 v72 = (int)window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4921 // v73 = 9 * (v71 + 12 * v72);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4922 v74 = (ItemGen *)&pParty->StandartItemsInShops[v72][v71];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4923 if ( dialog_menu_id != 2 )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4924 // v74 = (ItemGen *)&pParty->field_C59C[v73 + 724];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4925 v74 =&pParty->SpecialItemsInShops[v72][v71];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4926 if ( v67 && Str )
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4927 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4928 v10 = pGlobalTXT_LocalizationStrings[181];// "Steal %24"
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4929 v96 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4930 v94 = 2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4931 v93 = window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4932 v90 = v74;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4933 v9 = uActiveCharacter - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4934 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4935 else
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4936 {
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4937 v96 = 0;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4938 v94 = 2;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4939 v93 = window_SpeakInHouse->ptr_1C;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4940 v90 = v74;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4941 uPlayerID = uActiveCharacter - 1;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4942 v75 = _this->_490EEE(v74, 3, v72, 2);
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4943 v9 = uPlayerID;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4944 v10 = (char *)pMerchantsBuyPhrases[v75];
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4945 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4946 goto LABEL_35;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4947 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4948 }
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4949 return;
59713bb36033 houses func moved to uihouses
Gloval
parents: 620
diff changeset
4950 }