annotate GUI/UI/UIHouses.cpp @ 2548:87e5590d034b

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