annotate Events.cpp @ 1495:990fadbaac18

Cleanup of LevelDecoration. (2)
author yoctozepto
date Sun, 01 Sep 2013 11:57:07 +0200
parents db0dfdb9871e
children c4ab816fcc5e
rev   line source
1165
29a8defbad9e temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents: 1104
diff changeset
1 #ifdef _MSC_VER
29a8defbad9e temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents: 1104
diff changeset
2 #define _CRT_SECURE_NO_WARNINGS
29a8defbad9e temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents: 1104
diff changeset
3 #endif
29a8defbad9e temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents: 1104
diff changeset
4
762
cf2fbac6edc9 Misc cleaning
Nomad
parents: 747
diff changeset
5 #include <assert.h>
307
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
6 #include <stdlib.h>
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
7
1323
bfde0563ecdc removed weather.h from indoor.h
Grumpy7
parents: 1299
diff changeset
8 #include "Weather.h"
1262
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
9 #include "Texture.h"
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
10 #include "mm7_data.h"
1016
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 978
diff changeset
11 #include "VideoPlayer.h"
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 978
diff changeset
12 #include "Mouse.h"
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 978
diff changeset
13
307
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
14 #include "MapInfo.h"
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
15 #include "Game.h"
1254
b9747d9e9b4e more included header cleanup
Grumpy7
parents: 1205
diff changeset
16 #include "Render.h"
307
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
17 #include "GUIWindow.h"
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
18 #include "GUIProgressBar.h"
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
19 #include "Chest.h"
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
20 #include "stru176.h"
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
21 #include "LOD.h"
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
22 #include "Actor.h"
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
23 #include "Party.h"
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
24 #include "Math.h"
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
25 #include "AudioPlayer.h"
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
26 #include "Indoor.h"
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
27 #include "Viewport.h"
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
28 #include "texts.h"
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
29 #include "Allocator.h"
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
30 #include "stru123.h"
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
31 #include "stru159.h"
0
Ritor1
parents:
diff changeset
32 #include "Events.h"
Ritor1
parents:
diff changeset
33 #include "Events2D.h"
1299
8c2f689b5f0b folder UI
Ritor1
parents: 1295
diff changeset
34 #include "UI\UIHouses.h"
1052
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
35 #include "Log.h"
481
5b6e2021c6fe HOUSE_ID
Ritor1
parents: 480
diff changeset
36 #include "MM7.h"
0
Ritor1
parents:
diff changeset
37
Ritor1
parents:
diff changeset
38
Ritor1
parents:
diff changeset
39
1202
0dbf6c4dd029 arrays to std::arrays phase 1
Grumpy7
parents: 1179
diff changeset
40 std::array<EventIndex, 4400> pSomeOtherEVT_Events;
423
88c30918eef7 NPC_EventProcessor
Gloval
parents: 373
diff changeset
41 signed int uSomeOtherEVT_NumEvents;
0
Ritor1
parents:
diff changeset
42 char *pSomeOtherEVT;
1202
0dbf6c4dd029 arrays to std::arrays phase 1
Grumpy7
parents: 1179
diff changeset
43 std::array<EventIndex, 4400> pSomeEVT_Events;
428
24936a5ff8ca level hints
Gloval
parents: 423
diff changeset
44 signed int uSomeEVT_NumEvents;
0
Ritor1
parents:
diff changeset
45 char *pSomeEVT;
Ritor1
parents:
diff changeset
46
Ritor1
parents:
diff changeset
47 unsigned int uGlobalEVT_NumEvents;
Ritor1
parents:
diff changeset
48 unsigned int uGlobalEVT_Size;
1202
0dbf6c4dd029 arrays to std::arrays phase 1
Grumpy7
parents: 1179
diff changeset
49 std::array<char, 46080> pGlobalEVT;
0dbf6c4dd029 arrays to std::arrays phase 1
Grumpy7
parents: 1179
diff changeset
50 std::array<EventIndex, 4400> pGlobalEVT_Index;
0
Ritor1
parents:
diff changeset
51
1202
0dbf6c4dd029 arrays to std::arrays phase 1
Grumpy7
parents: 1179
diff changeset
52 std::array<unsigned int, 500> pLevelStrOffsets;
0
Ritor1
parents:
diff changeset
53 unsigned int uLevelStrNumStrings;
Ritor1
parents:
diff changeset
54 unsigned int uLevelStrFileSize;
428
24936a5ff8ca level hints
Gloval
parents: 423
diff changeset
55 signed int uLevelEVT_NumEvents;
0
Ritor1
parents:
diff changeset
56 unsigned int uLevelEVT_Size;
1202
0dbf6c4dd029 arrays to std::arrays phase 1
Grumpy7
parents: 1179
diff changeset
57 std::array<char, 9216> pLevelStr;
0dbf6c4dd029 arrays to std::arrays phase 1
Grumpy7
parents: 1179
diff changeset
58 std::array<char, 9216> pLevelEVT;
0dbf6c4dd029 arrays to std::arrays phase 1
Grumpy7
parents: 1179
diff changeset
59 std::array<EventIndex, 4400> pLevelEVT_Index;
0
Ritor1
parents:
diff changeset
60
1289
Ritor1
parents: 1205
diff changeset
61 _2devent p2DEvents[525];
307
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
62
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
63
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
64
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
65 //----- (00443CE1) --------------------------------------------------------
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
66 unsigned int LoadEventsToBuffer(const char *pContainerName, char *pBuffer, unsigned int uBufferSize)
1052
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
67 {
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
68 FILE *pLodFile; // eax@1
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
69 unsigned int uTextureSize; // esi@3
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
70 char Args[60]; // [sp+8h] [bp-B4h]@6
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
71 void *ptr; // [sp+B8h] [bp-4h]@1
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
72 Texture DstBuf; // [sp+6Ch] [bp-50h]@1
307
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
73
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
74 ptr = pEvents_LOD->LoadRaw(pContainerName, 0);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
75 pLodFile = pEvents_LOD->FindContainer(pContainerName, 0);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
76 if ( !pLodFile )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
77 Abortf("Unable to load %s", pContainerName);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
78 fread(&DstBuf, 1, 48, pLodFile);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
79 uTextureSize = DstBuf.uDecompressedSize;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
80 if ( !DstBuf.uDecompressedSize )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
81 uTextureSize = DstBuf.uTextureSize;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
82 memset(&DstBuf, 0, 72);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
83 if ( uTextureSize >= (signed int)uBufferSize )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
84 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
85 sprintf(Args, "File %s Size %lu - Buffer size %lu", pContainerName, uTextureSize, uBufferSize);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
86 Abortf(Args);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
87 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
88 memcpy(pBuffer, ptr, uTextureSize);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
89 pAllocator->FreeChunk(ptr);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
90 return uTextureSize;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
91 }
307
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
92
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
93 //----- (00443DA1) --------------------------------------------------------
1458
934074e7fcc1 ModalWindow
Nomad
parents: 1384
diff changeset
94 void Initialize_GlobalEVT()
762
cf2fbac6edc9 Misc cleaning
Nomad
parents: 747
diff changeset
95 {
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
96 struct raw_event_header
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
97 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
98 unsigned char evt_size;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
99 unsigned char evt_id_l;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
100 unsigned char evt_id_h;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
101 unsigned char evt_sequence_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
102 } ;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
103 uint events_count;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
104 unsigned int offset_in;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
105 raw_event_header *current_hdr;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
106 uGlobalEVT_NumEvents = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
107 uGlobalEVT_Size = LoadEventsToBuffer("global.evt", pGlobalEVT.data(), 46080);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
108 if ( !uGlobalEVT_Size )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
109 return;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
110 memset(pGlobalEVT_Index.data(), 0x80, sizeof(pGlobalEVT_Index));//52800
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
111 events_count = uGlobalEVT_NumEvents;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
112 current_hdr=(raw_event_header *)pGlobalEVT.data();
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
113 offset_in=0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
114 for (events_count = 0, offset_in = 0; offset_in < uGlobalEVT_Size; ++events_count)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
115 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
116 pGlobalEVT_Index[events_count].uEventID=current_hdr->evt_id_l+(current_hdr->evt_id_h<<8);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
117 pGlobalEVT_Index[events_count].event_sequence_num=current_hdr->evt_sequence_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
118 pGlobalEVT_Index[events_count].uEventOffsetInEVT=offset_in;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
119 offset_in+=current_hdr->evt_size+1;
1052
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
120
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
121 current_hdr=(raw_event_header *)&pGlobalEVT[offset_in];
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
122 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
123 uGlobalEVT_NumEvents = events_count;
307
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
124
762
cf2fbac6edc9 Misc cleaning
Nomad
parents: 747
diff changeset
125 assert(uGlobalEVT_NumEvents < 4400);
cf2fbac6edc9 Misc cleaning
Nomad
parents: 747
diff changeset
126 }
307
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
127
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
128
1052
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
129
307
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
130 //----- (00443EF8) --------------------------------------------------------
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
131 void LoadLevel_InitializeLevelEvt()
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
132 {
601
d59398528e4f level events loading fix
Gloval
parents: 569
diff changeset
133 struct raw_event_header
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
134 {
601
d59398528e4f level events loading fix
Gloval
parents: 569
diff changeset
135 unsigned char evt_size;
d59398528e4f level events loading fix
Gloval
parents: 569
diff changeset
136 unsigned char evt_id_l;
d59398528e4f level events loading fix
Gloval
parents: 569
diff changeset
137 unsigned char evt_id_h;
d59398528e4f level events loading fix
Gloval
parents: 569
diff changeset
138 unsigned char evt_sequence_num;
d59398528e4f level events loading fix
Gloval
parents: 569
diff changeset
139 } ;
d59398528e4f level events loading fix
Gloval
parents: 569
diff changeset
140 uint events_count;
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
141 unsigned int offset_in;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
142 raw_event_header *current_hdr;
601
d59398528e4f level events loading fix
Gloval
parents: 569
diff changeset
143
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
144 if (!uLevelEVT_Size)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
145 return;
307
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
146
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
147 memset(array_5B5928_timers, 0, 3200);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
148 memset(pLevelEVT_Index.data(), 80, sizeof(EventIndex)*4400);
307
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
149
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
150 uLevelEVT_NumEvents = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
151 dword_5B65C8_timers_count = 0;
307
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
152
1202
0dbf6c4dd029 arrays to std::arrays phase 1
Grumpy7
parents: 1179
diff changeset
153 current_hdr=(raw_event_header *)pLevelEVT.data();
601
d59398528e4f level events loading fix
Gloval
parents: 569
diff changeset
154 offset_in=0;
d59398528e4f level events loading fix
Gloval
parents: 569
diff changeset
155 for (events_count = 0, offset_in = 0; offset_in < uLevelEVT_Size; ++events_count)
d59398528e4f level events loading fix
Gloval
parents: 569
diff changeset
156 {
d59398528e4f level events loading fix
Gloval
parents: 569
diff changeset
157 pLevelEVT_Index[events_count].uEventID=current_hdr->evt_id_l+(current_hdr->evt_id_h<<8);
d59398528e4f level events loading fix
Gloval
parents: 569
diff changeset
158 pLevelEVT_Index[events_count].event_sequence_num=current_hdr->evt_sequence_num;
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
159 pLevelEVT_Index[events_count].uEventOffsetInEVT=offset_in;
601
d59398528e4f level events loading fix
Gloval
parents: 569
diff changeset
160 offset_in+=current_hdr->evt_size+1;
1052
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
161
601
d59398528e4f level events loading fix
Gloval
parents: 569
diff changeset
162 current_hdr=(raw_event_header *)&pLevelEVT[offset_in];
d59398528e4f level events loading fix
Gloval
parents: 569
diff changeset
163 }
d59398528e4f level events loading fix
Gloval
parents: 569
diff changeset
164 uLevelEVT_NumEvents = events_count;
d59398528e4f level events loading fix
Gloval
parents: 569
diff changeset
165
d59398528e4f level events loading fix
Gloval
parents: 569
diff changeset
166 /*
1052
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
167 EmeraldIsle::Variables:
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
168 [0] ???
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
169 [1] ???
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
170 [2] Luck Fountain uses left
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
171 [3] Gold Fountain used this week
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
172 [4] Gold Fountain total uses
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
173
1053
1c10b24a4159 BLV picky-blicky
Nomad
parents: 1052
diff changeset
174
1c10b24a4159 BLV picky-blicky
Nomad
parents: 1052
diff changeset
175 Emerald Isle #110 // Fire Resistance fountain
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
176 0 LocationName
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
177 0 if (Player.FireResistance < 50)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
178 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
179 1 Set(Player.FireResistance, 50)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
180 2 SetFooterString(22) // +50 Fire Resistance (temporarily)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
181 3 Add(Party.Autonotes, 2)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
182 4 goto return
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
183 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
184 5 SetFooterString(11) // Refreshing!
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
185 6 return
1053
1c10b24a4159 BLV picky-blicky
Nomad
parents: 1052
diff changeset
186
1c10b24a4159 BLV picky-blicky
Nomad
parents: 1052
diff changeset
187
1c10b24a4159 BLV picky-blicky
Nomad
parents: 1052
diff changeset
188
1052
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
189 Emerald Isle #111 // ???
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
190 Initialize
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
191 Set(Map.Variables[0], 30)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
192 Set(Map.Variables[1], 30)
1052
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
193
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
194
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
195 Emerald Isle #114 // month timer - manage luck fountain
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
196 0 LocationName
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
197 0 if (Player.BaseLuck >= 15)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
198 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
199 2 SetFooterString(11) // Refreshing!
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
200 3 return
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
201 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
202 else
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
203 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
204 1 if (Map.Variables[2] >= 1)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
205 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
206 4 Sub(Map.Variables[2], 1)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
207 5 Add(Player.BaseLuck, 2)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
208 6 SetFooterString(25) // +2 Luck (Permament)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
209 7 return
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
210 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
211 else
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
212 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
213 2 SetFooterString(11) // Refreshing!
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
214 3 return
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
215 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
216 }
1052
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
217
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
218 8 Initialize
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
219 9 Set Map.Variables[2], 8
1052
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
220
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
221
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
222
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
223 Emerald Isle #115 // week timer - gold fountain in the center of town
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
224 0 LocationName
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
225 0 if (Map.Variables[4] < 3)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
226 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
227 1 if (Map.Variables[3] == 0)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
228 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
229 2 if (Party.Gold < 201)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
230 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
231 3 if (Player.BaseLuck >= 15)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
232 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
233 5 Add(Map.Variables[3], 1)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
234 6 Add(Party.Gold, 1000)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
235 7 Add(Map.Variables[4], 1)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
236 8 goto return
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
237 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
238 else
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
239 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
240 4 goto 9
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
241 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
242 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
243 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
244 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
245 9 SetFooterString(11) // Refreshing!
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
246 10 return
1052
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
247
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
248 11 Initialize
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
249 12 Set(Map.Variables[3], 0)
1052
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
250
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
251
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
252
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
253
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
254
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
255 Emerald Isle #220 // day timer - monster spawner
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
256 0 LocationName
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
257 0 Initialize
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
258 1 if (NumAliveActors(group=20) != 0)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
259 2 return
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
260 3 SpawnMonsters(1, level=1, count=10, x=-336, y=14512, z=0, group=20)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
261 4 SpawnMonsters(1, level=2, count=5, x=16, y=16352, z=90, group=20)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
262 5 SpawnMonsters(1, level=1, count=10, x=480, y=18288, z=6, group=20)
1052
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
263
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
264
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
265
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
266 Emerald Isle #200 // margareth dock tip
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
267 0 if (!QBits.QuestDone[17])
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
268 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
269 1 InitiateNPCDialogue(npc=19)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
270 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
271 2 return
1052
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
272
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
273
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
274 Emerald Isle #201 // margareth armoury tip
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
275 0 if (!QBits.QuestDone[17])
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
276 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
277 1 InitiateNPCDialogue(npc=20)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
278 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
279 2 return
1052
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
280 */
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
281 }
307
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
282
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
283
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
284 //----- (0044684A) --------------------------------------------------------
1052
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
285 void EventProcessor(int uEventID, int targetObj, int canShowMessages, int entry_line)
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
286 {
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
287 unsigned int v3; // eax@5
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
288 signed int v4; // esi@7
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
289 //char *v5; // eax@8
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
290 Player *v6; // ecx@8
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
291 //char *v7; // ebp@8
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
292 //signed int v8; // edx@10
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
293 //int v9; // edi@12
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
294 //ByteArray *v10; // esi@12
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
295 int v11; // eax@14
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
296 char *v12; // eax@15
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
297 //char *v13; // edi@21
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
298 int v14; // ebp@21
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
299 int v15; // edi@21
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
300 const char *v16; // esi@21
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
301 bool v17; // edx@21
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
302 int v18; // ecx@22
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
303 int v19; // ebp@36
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
304 signed int v20; // ecx@40
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
305 int v21; // eax@40
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
306 int v22; // edx@40
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
307 int v23; // eax@40
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
308 unsigned __int16 v24; // ax@45
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
309 int v25; // eax@54
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
310 LevelDecoration *v26; // eax@55
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
311 int v27; // eax@57
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
312 int v28; // ecx@57
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
313 //int v29; // edx@58
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
314 int pEventID; // eax@58
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
315 int pNPC_ID; // ecx@58
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
316 int pIndex; // esi@58
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
317 NPCData *pNPC; // ecx@58
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
318 int v34; // esi@59
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
319 int v35; // esi@60
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
320 int v36; // esi@61
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
321 int v37; // esi@62
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
322 int v38; // eax@78
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
323 int v39; // ecx@78
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
324 size_t v40; // edx@78
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
325 Actor *v41; // esi@79
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
326 int v42; // eax@84
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
327 int v43; // ecx@84
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
328 size_t v44; // edx@84
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
329 Actor *v45; // esi@85
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
330 void *v46; // eax@91
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
331 GUIWindow *v47; // eax@93
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
332 GUIButton *v48; // ecx@93
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
333 GUIButton *v49; // esi@94
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
334 char v50; // al@100
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
335 Player *v51; // esi@103
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
336 Player *v52; // ecx@106
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
337 int v53; // ecx@107
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
338 char v54; // al@111
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
339 Player *v55; // esi@114
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
340 Player *v56; // ecx@117
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
341 int v57; // ecx@118
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
342 signed int pValue; // ebp@124
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
343 Player *pPlayer; // esi@125
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
344 int v60; // eax@126
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
345 int v61; // edx@133
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
346 int v62; // eax@139
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
347 int v63; // ebp@145
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
348 signed int v64; // edi@146
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
349 unsigned int v65; // edx@148
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
350 Player *v66; // ecx@148
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
351 int v67; // esi@148
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
352 signed int v68; // eax@151
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
353 int v69; // esi@151
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
354 Player *v70; // ecx@158
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
355 unsigned int v71; // eax@159
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
356 int v72; // esi@159
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
357 signed int v73; // eax@162
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
358 int v74; // esi@162
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
359 int v75; // edx@172
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
360 Player *v76; // esi@173
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
361 signed int v77; // ebp@186
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
362 int v78; // edx@186
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
363 Player *v79; // esi@187
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
364 //signed int v80; // ebp@200
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
365 //int v81; // edx@200
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
366 Player *v82; // esi@201
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
367 int v83; // eax@212
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
368 int v84; // ebp@220
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
369 signed int v85; // ebp@224
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
370 char v86; // al@224
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
371 Player *v87; // esi@227
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
372 Player *v88; // ecx@231
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
373 int v89; // ecx@232
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
374 int v90; // eax@243
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
375 const char *v91; // ecx@247
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
376 int v92; // eax@251
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
377 char *v93; // eax@252
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
378 int v94; // ecx@262
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
379 int v95; // ebp@262
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
380 int v96; // edx@262
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
381 int v97; // eax@262
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
382 unsigned int v98; // edx@265
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
383 const char *v99; // esi@267
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
384 int v100; // edx@267
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
385 //char *v101; // edi@281
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
386 unsigned int v102; // esi@281
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
387 int v103; // edi@284
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
388 int v104; // eax@288
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
389 int v105; // edx@294
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
390 int v106; // [sp-20h] [bp-4C8h]@278
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
391 signed int v107; // [sp-1Ch] [bp-4C4h]@278
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
392 unsigned int v108; // [sp-18h] [bp-4C0h]@278
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
393 signed int v109; // [sp-14h] [bp-4BCh]@278
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
394 signed int v110; // [sp-10h] [bp-4B8h]@278
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
395 int v111; // [sp-Ch] [bp-4B4h]@278
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
396 // Event *v112; // [sp-8h] [bp-4B0h]@5
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
397 int v113; // [sp-8h] [bp-4B0h]@106
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
398 int v114; // [sp-8h] [bp-4B0h]@117
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
399 signed int v115; // [sp-8h] [bp-4B0h]@231
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
400 unsigned int v116; // [sp-8h] [bp-4B0h]@278
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
401 int v117; // [sp-4h] [bp-4ACh]@106
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
402 int v118; // [sp-4h] [bp-4ACh]@117
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
403 int v119; // [sp-4h] [bp-4ACh]@231
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
404 int v120; // [sp-4h] [bp-4ACh]@278
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
405 int v121; // [sp-4h] [bp-4ACh]@294
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
406 int curr_seq_num; // [sp+10h] [bp-498h]@4
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
407 //char *v123; // [sp+14h] [bp-494h]@0
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
408 signed int v124; // [sp+18h] [bp-490h]@7
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
409 //signed int v125; // [sp+1Ch] [bp-48Ch]@155
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
410 int v126; // [sp+1Ch] [bp-48Ch]@262
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
411 int player_choose; // [sp+20h] [bp-488h]@4
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
412 int v128; // [sp+24h] [bp-484h]@21
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
413 int v129; // [sp+24h] [bp-484h]@262
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
414 signed int v130; // [sp+28h] [bp-480h]@0
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
415 //int v131; // [sp+2Ch] [bp-47Ch]@1
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
416 int v132; // [sp+30h] [bp-478h]@262
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
417 signed int v133; // [sp+34h] [bp-474h]@1
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
418 int v134; // [sp+38h] [bp-470h]@262
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
419 int v135; // [sp+3Ch] [bp-46Ch]@262
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
420 int v136; // [sp+40h] [bp-468h]@40
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
421 int v137; // [sp+44h] [bp-464h]@40
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
422 int v138; // [sp+48h] [bp-460h]@40
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
423 int v139; // [sp+4Ch] [bp-45Ch]@40
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
424 ItemGen item; // [sp+50h] [bp-458h]@15
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
425 char Source[120]; // [sp+74h] [bp-434h]@15
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
426 char Str[120]; // [sp+ECh] [bp-3BCh]@21
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
427 Actor Dst; // [sp+164h] [bp-344h]@53
307
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
428
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
429 //v131 = uEventID;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
430 v133 = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
431 EvtTargetObj = targetObj;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
432 dword_5B65C4 = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
433 if ( !uEventID )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
434 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
435 if ( !GameUI_Footer_TimeLeft )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
436 ShowStatusBarString(pGlobalTXT_LocalizationStrings[521], 2u);// Nothing here
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
437 return;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
438 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
439 player_choose = (uActiveCharacter == 0)?6:4; //4 - active or 6 - random player if active =0
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
440 curr_seq_num = entry_line;
1052
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
441
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
442 if ( activeLevelDecoration )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
443 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
444 uSomeEVT_NumEvents = uGlobalEVT_NumEvents;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
445 pSomeEVT = pGlobalEVT.data();
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
446 memcpy(pSomeEVT_Events.data(), pGlobalEVT_Index.data(), sizeof(EventIndex)*4400); //4400 evts
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
447 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
448 else
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
449 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
450 uSomeEVT_NumEvents = uLevelEVT_NumEvents;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
451 pSomeEVT = pLevelEVT.data();
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
452 memcpy(pSomeEVT_Events.data(), pLevelEVT_Index.data(), sizeof(EventIndex)*4400);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
453 }
307
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
454
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
455 v4 = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
456 v124 = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
457 //for (uint i = 0; i < uSomeEVT_NumEvents; ++i)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
458 // {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
459 //v6 = v123;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
460 //v7 = "";
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
461 while ( 1 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
462 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
463 if ( dword_5B65C4 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
464 goto LABEL_301;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
465 //v8 = v4;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
466 if ( pSomeEVT_Events[v4].uEventID == uEventID && pSomeEVT_Events[v4].event_sequence_num == curr_seq_num )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
467 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
468 //v9 = pSomeEVT_Events[v8].uEventOffsetInEVT;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
469 //v10 = (ByteArray *)&v5[v9];
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
470 auto _evt = (_evt_raw *)(pSomeEVT + pSomeEVT_Events[v4].uEventOffsetInEVT);
307
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
471
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
472 switch (_evt->_e_type)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
473 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
474 case EVENT_CheckSeason:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
475 //
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
476 if ( !sub_4465DF_check_season(_evt->v5) )
1052
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
477 {
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
478 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
479 v4 = v124;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
480 break;
1052
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
481 }
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
482 v124 = -1;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
483 curr_seq_num = _evt->v6 - 1;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
484 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
485 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
486 case EVENT_ShowMovie:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
487 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
488 strcpy(Source, (char *)&_evt->v7);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
489 v12 = (char *)&item.uExpireTime + strlen(Source) + 7;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
490 if ( *v12 == 32 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
491 *v12 = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
492 if ( pVideoPlayer->field_54 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
493 pVideoPlayer->Unload();
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
494 pVideoPlayer->bStopBeforeSchedule = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
495 pVideoPlayer->pResetflag = 0;
1038
39f42990698f Cleanings
Nomad
parents: 1033
diff changeset
496
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
497 v128 = pCurrentScreen;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
498 //v13 = &pSomeEVT[v9];
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
499 //v14 = (unsigned __int8)v13[5];
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
500 //v15 = (unsigned __int8)v13[6];
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
501 v14 = _evt->v5;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
502 v15 = _evt->v6;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
503 strcpy(Str, Source);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
504 v16 = RemoveQuotes(Str);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
505 VideoPlayer::MovieLoop(v16, 0, v14, 1);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
506 if ( !_stricmp(v16, "arbiter good") )
373
edd2d8b7e3c4 Interface reloading fix & party alignment enum
Nomad
parents: 336
diff changeset
507 {
edd2d8b7e3c4 Interface reloading fix & party alignment enum
Nomad
parents: 336
diff changeset
508 pParty->alignment = PartyAlignment_Good;
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
509 v18 = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
510 LOBYTE(v17) = 1;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
511 SetUserInterface(PartyAlignment_Good, v17);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
512 if ( !v15 || v128 == 3 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
513 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
514 pCurrentScreen = v128;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
515 if ( v128 == 3 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
516 pGameLoadingUI_ProgressBar->uType = GUIProgressBar::TYPE_Fullscreen;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
517 if ( v128 == 13 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
518 pVideoPlayer->OpenHouseMovie(pAnimatedRooms[uCurrentHouse_Animation].video_name, 1u);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
519 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
520
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
521 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
522 v4 = v124;
1038
39f42990698f Cleanings
Nomad
parents: 1033
diff changeset
523
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
524 //v6 = v123;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
525 //v7 = "";
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
526 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
527 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
528 if ( !_stricmp(v16, "arbiter evil") )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
529 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
530 v18 = 2;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
531 pParty->alignment = PartyAlignment_Evil;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
532 LOBYTE(v17) = 1;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
533 SetUserInterface(PartyAlignment_Evil, v17);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
534 if ( !v15 || v128 == 3 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
535 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
536 pCurrentScreen = v128;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
537 if ( v128 == 3 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
538 pGameLoadingUI_ProgressBar->uType = GUIProgressBar::TYPE_Fullscreen;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
539 if ( v128 == 13 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
540 pVideoPlayer->OpenHouseMovie(pAnimatedRooms[uCurrentHouse_Animation].video_name, 1u);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
541 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
542 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
543 v4 = v124;
307
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
544
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
545 //v6 = v123;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
546 //v7 = "";
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
547
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
548 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
549 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
550 if ( !_stricmp(v16, "pcout01") ) // moving to harmondale from emerald isle
766
a464d28566a6 days_played_without_rest
Nomad
parents: 762
diff changeset
551 {
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
552 Rest(0x2760u);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
553 pParty->RestAndHeal();
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
554 pParty->days_played_without_rest = 0;
766
a464d28566a6 days_played_without_rest
Nomad
parents: 762
diff changeset
555 }
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
556 if ( !v15 || v128 == 3 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
557 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
558 pCurrentScreen = v128;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
559 if ( v128 == 3 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
560 pGameLoadingUI_ProgressBar->uType = GUIProgressBar::TYPE_Fullscreen;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
561 if ( v128 == 13 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
562 pVideoPlayer->OpenHouseMovie(pAnimatedRooms[uCurrentHouse_Animation].video_name, 1u);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
563 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
564 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
565 v4 = v124;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
566
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
567 //v6 = v123;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
568 //v7 = "";
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
569 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
570 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
571 case EVENT_CheckSkill:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
572 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
573 v19 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((unsigned int)_evt->v10 << 8)) << 8)) << 8);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
574 if ( player_choose < 0 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
575 goto LABEL_47;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
576 if ( player_choose <= 3 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
577 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
578 v24 = pParty->pPlayers[0].pActiveSkills[3486 * player_choose + _evt->v5];
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
579 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
580 else
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
581 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
582 if ( player_choose == 4 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
583 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
584 v24 = pPlayers[uActiveCharacter]->pActiveSkills[_evt->v5];
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
585 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
586 else
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
587 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
588 if ( player_choose == 5 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
589 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
590 v20 = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
591 v21 = 3486 * v130 + _evt->v5;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
592 v136 = 1;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
593 LOWORD(v21) = pParty->pPlayers[0].pActiveSkills[v21];
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
594 v137 = v21 & 0x40;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
595 v138 = v21 & 0x80;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
596 v22 = v21 & 0x100;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
597 v23 = v21 & 0x3F;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
598 v139 = v22;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
599 while ( v23 < v19 || !*(&v136 + _evt->v6) )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
600 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
601 ++v20;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
602 if ( v20 >= 4 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
603 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
604 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
605 v4 = v124;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
606
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
607 //v6 = v123;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
608 //v7 = "";
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
609 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
610 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
611 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
612 v11 = _evt->v11;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
613 goto LABEL_130;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
614 }
307
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
615 LABEL_47:
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
616 //v10 = (ByteArray *)&v5[v9];
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
617 v24 = pParty->pPlayers[0].pActiveSkills[_evt->v5 + 3486 * rand() % 4];
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
618 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
619 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
620 v136 = 1;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
621 v137 = v24 & 0x40;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
622 v138 = v24 & 0x80;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
623 v139 = v24 & 0x100;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
624 if ( (v24 & 0x3F) >= v19 && *(&v136 + _evt->v6) )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
625 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
626 v11 = _evt->v11;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
627 goto LABEL_130;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
628 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
629 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
630 v4 = v124;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
631
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
632 //v6 = v123;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
633 //v7 = "";
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
634 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
635 break;
307
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
636
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
637 case EVENT_SpeakNPC:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
638 if ( canShowMessages )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
639 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
640 //Actor::Actor(&Dst);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
641 memset(&Dst, 0, 0x344u);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
642 dword_5B65D0_dialogue_actor_npc_id = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((unsigned int)_evt->v8 << 8)) << 8)) << 8);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
643 Dst.sNPC_ID = dword_5B65D0_dialogue_actor_npc_id;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
644 GameUI_InitializeDialogue(&Dst, false);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
645 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
646 else
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
647 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
648 bDialogueUI_InitializeActor_NPC_ID = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((unsigned int)_evt->v8 << 8)) << 8)) << 8);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
649 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
650 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
651 v4 = v124;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
652
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
653 //v6 = v123;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
654 //v7 = "";
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
655 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
656 case EVENT_ChangeEvent:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
657 v25 = EVT_DWORD(_evt->v5);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
658 if ( v25 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
659 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
660 stru_5E4C90._decor_events[activeLevelDecoration->_idx_in_stru123] = _evt->v5 - 124;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
661 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
662 else
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
663 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
664 v26 = (LevelDecoration *)activeLevelDecoration;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
665 stru_5E4C90._decor_events[activeLevelDecoration ->_idx_in_stru123] = 0;
1489
a27cdb3d753e Cleanup of LevelDecoration and related.
yoctozepto
parents: 1458
diff changeset
666 v26->uFlags |= LEVEL_DECORATION_INVISIBLE;
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
667 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
668 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
669 v4 = v124;
525
e7b3fa10d58d events cleanup
Gloval
parents: 520
diff changeset
670
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
671 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
672 case EVENT_SetNPCGreeting:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
673 v27 = EVT_DWORD(_evt->v5);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
674 pNPCStats->pNewNPCData[v27].uFlags &= 0xFFFFFFFCu;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
675 pNPCStats->pNewNPCData[v27].greet = EVT_DWORD(_evt->v9);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
676 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
677 v4 = v124;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
678
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
679 //v6 = v123;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
680 //v7 = "";
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
681 break;
827
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
682 case EVENT_SetNPCTopic:
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
683 {
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
684 //v29 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
685 pEventID = _evt->v10 + ((_evt->v11 + ((_evt->v12 + ((uint)_evt->v13 << 8)) << 8)) << 8);
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
686 pNPC_ID = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
687 pIndex = _evt->v9;
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
688 pNPC = &pNPCStats->pNewNPCData[pNPC_ID];
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
689 if ( pIndex == 0 )
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
690 pNPC->evt_A = pEventID;
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
691 if ( pIndex == 1 )
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
692 pNPC->evt_B = pEventID;
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
693 if ( pIndex == 2 )
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
694 pNPC->evt_C = pEventID;
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
695 if ( pIndex == 3 )
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
696 pNPC->evt_D = pEventID;
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
697 if ( pIndex == 4 )
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
698 pNPC->evt_E = pEventID;
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
699 if ( pIndex == 5 )
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
700 pNPC->evt_F = pEventID;
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
701 if ( pNPC_ID == 8 )
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
702 {
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
703 if ( pEventID == 78 )
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
704 {
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
705 sub_4BD8B5();
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
706 window_SpeakInHouse->Release();
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
707 pParty->uFlags &= ~2;
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
708 if ( EnterHouse(HOUSE_DARK_GUILD_PIT) )
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
709 {
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
710 pAudioPlayer->StopChannels(-1, -1);
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
711 window_SpeakInHouse = GUIWindow::Create(0, 0, 640, 480, WINDOW_HouseInterior, 170, 0);
948
5a2dbb00c399 Code cleaning.
Nomad
parents: 898
diff changeset
712 window_SpeakInHouse->CreateButton( 61, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 1, '1', "", 0);
5a2dbb00c399 Code cleaning.
Nomad
parents: 898
diff changeset
713 window_SpeakInHouse->CreateButton(177, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 2, '2', "", 0);
5a2dbb00c399 Code cleaning.
Nomad
parents: 898
diff changeset
714 window_SpeakInHouse->CreateButton(292, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 3, '3', "", 0);
5a2dbb00c399 Code cleaning.
Nomad
parents: 898
diff changeset
715 window_SpeakInHouse->CreateButton(407, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 4, '4', "", 0);
5a2dbb00c399 Code cleaning.
Nomad
parents: 898
diff changeset
716 window_SpeakInHouse->CreateButton( 0, 0, 0, 0, 1, 0, UIMSG_CycleCharacters, 0, '\t', "", 0);
827
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
717 current_npc_text = pNPCTopics[90].pText;
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
718 }
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
719 }
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
720 }
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
721 ++curr_seq_num;
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
722 }
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
723 v4 = v124;
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
724 break;
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
725 case EVENT_NPCSetItem:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
726 sub_448518_npc_set_item(EVT_DWORD(_evt->v5),EVT_DWORD(_evt->v9), _evt->v13);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
727 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
728 v4 = v124;
525
e7b3fa10d58d events cleanup
Gloval
parents: 520
diff changeset
729
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
730 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
731 case EVENT_SetActorItem:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
732 Actor::GiveItem(EVT_DWORD(_evt->v5),EVT_DWORD(_evt->v9), _evt->v13);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
733 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
734 v4 = v124;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
735 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
736 case EVENT_SetNPCGroupNews:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
737 pNPCStats->pGroups_copy[_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8)] = _evt->v9 + ((uint)_evt->v10 << 8);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
738 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
739 v4 = v124;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
740 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
741 case EVENT_SetActorGroup:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
742 __debugbreak();
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
743 *(&pActors[0].uGroup + 0x11000000 * _evt->v8 + 209 * (_evt->v5 + ((_evt->v6 + ((uint)_evt->v7 << 8)) << 8))) = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
744 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
745 v4 = v124;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
746 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
747 case EVENT_ChangeGroup:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
748 v38 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
749 v39 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
750 v40 = uNumActors;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
751 __debugbreak();
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
752 if ( (signed int)uNumActors > 0 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
753 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
754 v41 = pActors.data();//[0].uGroup;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
755 do
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
756 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
757 if ( v41->uGroup == v38 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
758 v41->uGroup = v39;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
759 ++v41;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
760 --v40;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
761 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
762 while ( v40 );
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
763 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
764 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
765 v4 = v124;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
766
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
767 //v6 = v123;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
768 //v7 = "";
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
769 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
770 case EVENT_ChangeGroupAlly:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
771 v42 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
772 v43 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
773 v44 = uNumActors;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
774 __debugbreak();
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
775 if ( (signed int)uNumActors > 0 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
776 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
777 v45 = pActors.data();//[0].uAlly;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
778 do
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
779 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
780 if ( v45->uGroup == v42 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
781 v45->uAlly = v43;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
782 ++v45;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
783 --v44;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
784 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
785 while ( v44 );
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
786 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
787 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
788 v4 = v124;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
789
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
790 //v6 = v123;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
791 //v7 = "";
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
792 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
793 case EVENT_MoveNPC:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
794 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
795
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
796 pNPCStats->pNewNPCData[EVT_DWORD(_evt->v5)].Location2D =EVT_DWORD(_evt->v9);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
797 if ( window_SpeakInHouse )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
798 {
310
Gloval
parents: 307
diff changeset
799
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
800 if ( window_SpeakInHouse->par1C == 165 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
801 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
802 sub_4BD8B5();
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
803 pVideoPlayer->Unload();
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
804 window_SpeakInHouse->Release();
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
805 pParty->uFlags &= ~2;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
806 activeLevelDecoration = (LevelDecoration*)1;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
807 if ( EnterHouse(HOUSE_BODY_GUILD_ERATHIA) )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
808 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
809 pAudioPlayer->PlaySound((SoundID)0, 0, 0, -1, 0, 0, 0, 0);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
810 window_SpeakInHouse = GUIWindow::Create(0, 0, 640, 480, WINDOW_HouseInterior, 165, 0);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
811 v48 = window_SpeakInHouse->pControlsHead;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
812 if ( v48 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
813 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
814 do
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
815 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
816 v49 = v48->pNext;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
817 pAllocator->FreeChunk(v48);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
818 v48 = v49;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
819 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
820 while ( v49 );
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
821 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
822 window_SpeakInHouse->pControlsHead = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
823 window_SpeakInHouse->pControlsTail = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
824 window_SpeakInHouse->uNumControls = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
825 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
826 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
827 else
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
828 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
829 if ( window_SpeakInHouse->par1C == 553 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
830 pVideoPlayer->bLoopPlaying = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
831 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
832 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
833
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
834 }
525
e7b3fa10d58d events cleanup
Gloval
parents: 520
diff changeset
835 ++curr_seq_num;
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
836 v4 = v124;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
837
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
838 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
839 case EVENT_Jmp:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
840 curr_seq_num = _evt->v5 - 1;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
841 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
842 v4 = -1;
525
e7b3fa10d58d events cleanup
Gloval
parents: 520
diff changeset
843
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
844 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
845 case EVENT_ShowFace:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
846 if ( _evt->v5 <= 3u ) //someone
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
847 pParty->pPlayers[_evt->v5].PlayEmotion((CHARACTER_EXPRESSION_ID)_evt->v6, 0);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
848 else if ( _evt->v5 == 4 ) //active
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
849 pParty->pPlayers[uActiveCharacter].PlayEmotion((CHARACTER_EXPRESSION_ID)_evt->v6, 0);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
850 else if ( _evt->v5 == 5 ) //all players
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
851 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
852 for(int i=0; i<4; ++i)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
853 pParty->pPlayers[i].PlayEmotion((CHARACTER_EXPRESSION_ID)_evt->v6, 0);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
854 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
855 else //random player
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
856 pParty->pPlayers[rand() % 4].PlayEmotion((CHARACTER_EXPRESSION_ID)_evt->v6, 0);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
857 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
858 v4 = v124;
525
e7b3fa10d58d events cleanup
Gloval
parents: 520
diff changeset
859
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
860 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
861 case EVENT_CharacterAnimation:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
862 if ( _evt->v5 <= 3u ) //someone
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
863 pParty->pPlayers[_evt->v5].PlaySound((PlayerSpeech) _evt->v6, 0);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
864 else if ( _evt->v5 == 4 ) //active
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
865 pParty->pPlayers[uActiveCharacter].PlaySound((PlayerSpeech) _evt->v6, 0);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
866 else if ( _evt->v5 == 5 ) //all
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
867 for(int i=0; i<4; ++i)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
868 pParty->pPlayers[i].PlaySound((PlayerSpeech) _evt->v6, 0);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
869 else //random
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
870 pParty->pPlayers[rand() % 4].PlaySound((PlayerSpeech) _evt->v6, 0);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
871 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
872 v4 = v124;
525
e7b3fa10d58d events cleanup
Gloval
parents: 520
diff changeset
873
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
874 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
875 case EVENT_ForPartyMember:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
876 player_choose = _evt->v5;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
877 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
878 v4 = v124;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
879 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
880 case EVENT_SummonItem:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
881 sub_42F7EB_DropItemAt(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
882 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8),
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
883 _evt->v13 + ((_evt->v14 + ((_evt->v15 + ((uint)_evt->v16 << 8)) << 8)) << 8),
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
884 _evt->v17 + ((_evt->v18 + ((_evt->v19 + ((uint)_evt->v20 << 8)) << 8)) << 8),
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
885 _evt->v21 + ((_evt->v22 + ((_evt->v23 + ((uint)_evt->v24 << 8)) << 8)) << 8),
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
886 _evt->v25, _evt->v26, 0, 0);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
887 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
888 v4 = v124;
525
e7b3fa10d58d events cleanup
Gloval
parents: 520
diff changeset
889
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
890 //v6 = v123;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
891 //v7 = "";
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
892 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
893 case EVENT_Compare:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
894 pValue = EVT_DWORD(_evt->v7);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
895 if ( player_choose <= 3 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
896 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
897 if ( pPlayers[player_choose]->CompareVariable((enum VariableType)EVT_WORD(_evt->v5), pValue) )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
898 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
899 v124 = -1;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
900 curr_seq_num = _evt->v11 - 1;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
901 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
902 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
903 else if ( player_choose == 4 ) //active
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
904 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
905 if ( uActiveCharacter )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
906 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
907 if ( pPlayers[uActiveCharacter]->CompareVariable((enum VariableType)EVT_WORD(_evt->v5), pValue) )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
908 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
909 v124 = -1;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
910 curr_seq_num = _evt->v11 - 1;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
911 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
912 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
913 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
914 else if ( player_choose == 5 )//all
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
915 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
916 v130=0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
917 for(int i = 1; i < 5; ++i)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
918 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
919 if ( pPlayers[i]->CompareVariable((enum VariableType)EVT_WORD(_evt->v5), pValue) )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
920 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
921 v124 = -1;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
922 curr_seq_num = _evt->v11 - 1;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
923 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
924 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
925 ++v130;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
926 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
927 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
928 else if ( player_choose == 6 ) //random
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
929 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
930 if ( pPlayers[rand() % 4]->CompareVariable((enum VariableType)EVT_WORD(_evt->v5), pValue) )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
931 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
932 v124 = -1;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
933 curr_seq_num = _evt->v11 - 1;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
934 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
935 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
936 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
937 v4 = v124;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
938 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
939 case EVENT_IsActorAlive:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
940 if (IsActorAlive(EVT_BYTE(_evt->v5), EVT_DWORD(_evt->v6), EVT_BYTE(_evt->v10)))
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
941 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
942 v124 = -1;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
943 curr_seq_num = _evt->v11 - 1;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
944 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
945 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
946 v4 = v124;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
947 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
948 case EVENT_Substract:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
949 pValue = EVT_DWORD(_evt->v7);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
950 if ( EVT_WORD(_evt->v5) == VAR_PlayerItemInHands )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
951 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
952 if ( pParty->pPickedItem.uItemID == pValue )//In hand
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
953 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
954 pMouse->RemoveHoldingItem();
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
955 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
956 v4 = v124;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
957 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
958 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
959 v67 = (int)pPlayers[uActiveCharacter]->pInventoryMatrix;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
960 for ( v65 = 0; v65 < 126; ++v65 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
961 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
962 if ( (int)&pPlayers[uActiveCharacter]->pInventoryItemList[v67] == pValue )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
963 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
964 pPlayers[uActiveCharacter]->RemoveItemAtInventoryIndex(v65);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
965 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
966 v4 = v124;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
967 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
968 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
969 v67 += 4;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
970 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
971 while ( (signed int)v65 < 126 );
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
972 v69 = (int)&pPlayers[uActiveCharacter]->pEquipment;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
973 for ( v68 = 0; v68 < 16; ++v68 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
974 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
975 if ( *(int *)v69 && (int)&pPlayers[uActiveCharacter]->pInventoryItemList[v69] == pValue )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
976 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
977 *(&pPlayers[uActiveCharacter]->pEquipment.uShield + v68) = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
978 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
979 v4 = v124;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
980 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
981 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
982 v69 += 4;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
983 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
984 for (int i = 1; i < 5; i++)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
985 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
986 v72 = (int)pPlayers[i]->pInventoryMatrix;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
987 for ( int v71 = 0; v71 < 126; ++v71 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
988 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
989 if ( (int)&pPlayers[i]->pInventoryItemList[v72] == pValue )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
990 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
991 pPlayers[i]->RemoveItemAtInventoryIndex(v71);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
992 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
993 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
994 v72 += 4;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
995 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
996 v73 = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
997 v74 = (int)&pPlayers[i]->pEquipment;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
998 while ( !*(int *)v74 || (int)&pPlayer->pInventoryItemList[v74] != pValue )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
999 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1000 ++v73;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1001 v74 += 4;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1002 if ( v73 >= 16 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1003 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1004 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1005 *(&pPlayers[i]->pEquipment.uShield + v73) = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1006 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1007 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1008 if ( player_choose <= 3 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1009 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1010 pPlayer = &pParty->pPlayers[player_choose];
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1011 pPlayer->SubtractVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1012 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1013 else if ( player_choose == 4 ) //active
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1014 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1015 if ( uActiveCharacter )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1016 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1017 pPlayer = pPlayers[uActiveCharacter];
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1018 pPlayer->SubtractVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1019 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1020 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1021 else if ( player_choose == 5 )//all
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1022 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1023 v130 = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1024 for(int i = 1; i < 5; ++i)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1025 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1026 if ( pPlayers[i]->SubtractVariable((enum VariableType)EVT_WORD(_evt->v5), pValue) )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1027 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1028 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1029 ++v130;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1030 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1031 else if ( player_choose == 6 ) //random
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1032 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1033 player_choose = rand() % 4;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1034 pPlayer = &pParty->pPlayers[player_choose];
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1035 pPlayer->SubtractVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1036 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1037 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1038 v4 = v124;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1039 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1040 case EVENT_Set:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1041 pValue = EVT_DWORD(_evt->v7);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1042 if ( player_choose <= 3 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1043 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1044 pPlayer = &pParty->pPlayers[player_choose];
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1045 pPlayer->SetVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1046 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1047 else if ( player_choose == 4 ) //active
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1048 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1049 if ( uActiveCharacter )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1050 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1051 pPlayer = pPlayers[uActiveCharacter];
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1052 pPlayer->SetVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1053 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1054 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1055 else if ( player_choose == 5 )//all
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1056 {
525
e7b3fa10d58d events cleanup
Gloval
parents: 520
diff changeset
1057 //recheck v130
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1058 for(int i = 1; i < 5; ++i)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1059 pPlayers[i]->SetVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
525
e7b3fa10d58d events cleanup
Gloval
parents: 520
diff changeset
1060
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1061 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1062 else if ( player_choose == 6 ) //random
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1063 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1064 player_choose = rand() % 4;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1065 pPlayer = &pParty->pPlayers[player_choose];
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1066 pPlayer->SetVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
525
e7b3fa10d58d events cleanup
Gloval
parents: 520
diff changeset
1067
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1068 }
525
e7b3fa10d58d events cleanup
Gloval
parents: 520
diff changeset
1069 ++curr_seq_num;
e7b3fa10d58d events cleanup
Gloval
parents: 520
diff changeset
1070 v4 = v124;
e7b3fa10d58d events cleanup
Gloval
parents: 520
diff changeset
1071 break;
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1072 case EVENT_Add:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1073 pValue = EVT_DWORD(_evt->v7);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1074 if ( player_choose <= 3 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1075 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1076 pPlayer = &pParty->pPlayers[player_choose];
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1077 pPlayer->AddVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1078 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1079 else if ( player_choose == 4 ) //active
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1080 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1081 if ( uActiveCharacter )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1082 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1083 pPlayer = pPlayers[uActiveCharacter];
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1084 pPlayer->AddVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1085 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1086 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1087 else if ( player_choose == 5 )//all
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1088 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1089 //v130 = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1090 for(int i = 1; i < 5; ++i)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1091 pPlayers[i]->AddVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
525
e7b3fa10d58d events cleanup
Gloval
parents: 520
diff changeset
1092
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1093 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1094 else if ( player_choose == 6 ) //random
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1095 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1096 player_choose = rand() % 4;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1097 pPlayer = &pParty->pPlayers[player_choose];
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1098 pPlayer->AddVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1099 }
525
e7b3fa10d58d events cleanup
Gloval
parents: 520
diff changeset
1100 v83 = EVT_WORD(_evt->v5);
1052
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
1101 if (v83 == 21 || // gold well on emerald isle
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
1102 v83 == 22 || v83 == 23 || v83 == 24 )
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
1103 {
1179
883eaee77094 sub_424829
Ritor1
parents: 1165
diff changeset
1104 //__debugbreak(); // bonfire
1052
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
1105 viewparams->bRedrawGameUI = true;
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
1106 }
525
e7b3fa10d58d events cleanup
Gloval
parents: 520
diff changeset
1107 ++curr_seq_num;
e7b3fa10d58d events cleanup
Gloval
parents: 520
diff changeset
1108 v4 = v124;
e7b3fa10d58d events cleanup
Gloval
parents: 520
diff changeset
1109 break;
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1110 case EVENT_InputString:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1111 if ( !entry_line )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1112 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1113 strcpy(GameUI_Footer_TimedString.data(), &pLevelStr[pLevelStrOffsets[EVT_DWORD(_evt->v5 )]]);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1114 v105 = curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1115 v121 = 26;
307
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
1116 LABEL_295:
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1117 sub_4451A8_press_any_key(uEventID, v105, v121);
307
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
1118 LABEL_301:
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1119 if ( v133 == 1 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1120 OnMapLeave();
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1121 return;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1122 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1123 v84 = _evt->v13 + ((_evt->v14 + ((_evt->v15 + ((uint)_evt->v16 << 8)) << 8)) << 8);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1124 if ( !_stricmp(GameUI_Footer_TimedString.data(), &pLevelStr[pLevelStrOffsets[_evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8)]])
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1125 || !_stricmp(GameUI_Footer_TimedString.data(), &pLevelStr[pLevelStrOffsets[v84]]) )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1126 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1127 v11 = _evt->v17;
307
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
1128 LABEL_130:
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1129 //v124 = -1;
307
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
1130 LABEL_131:
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1131 curr_seq_num = v11 - 1;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1132 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1133 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1134 v4 = v124;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1135
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1136 //v6 = v123;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1137 //v7 = "";
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1138 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1139 case EVENT_RandomGoTo:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1140 //v124 = -1;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1141 v11 = (unsigned __int8)*(&_evt->v5 + rand() % ((_evt->v5 != 0) + (_evt->v6 != 0) + (_evt->v7 != 0) + (_evt->v8 != 0) + (_evt->v9 != 0)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1142 + (_evt->v10 != 0)));
525
e7b3fa10d58d events cleanup
Gloval
parents: 520
diff changeset
1143 curr_seq_num = v11 - 1;
787
3a77fbf7d0b8 GetSector
Ritor1
parents: 774
diff changeset
1144 ++curr_seq_num;
3a77fbf7d0b8 GetSector
Ritor1
parents: 774
diff changeset
1145 v4 = v124;
3a77fbf7d0b8 GetSector
Ritor1
parents: 774
diff changeset
1146 break;
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1147 case EVENT_ReceiveDamage:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1148 v85 = EVT_DWORD(_evt->v7 );
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1149 v86 = _evt->v5;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1150 if ( (unsigned __int8)v86 <= 3 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1151 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1152 v119 = _evt->v6;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1153 v115 = EVT_DWORD(_evt->v7 );
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1154 v89 = (unsigned __int8)v86;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1155 v88 = &pParty->pPlayers[v89];
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1156 v88->ReceiveDamage(v115, (DAMAGE_TYPE)v119);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1157 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1158 v4 = v124;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1159 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1160 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1161 if ( v86 == 4 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1162 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1163 if ( !uActiveCharacter )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1164 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1165 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1166 v4 = v124;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1167
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1168 //v6 = v123;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1169 //v7 = "";
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1170 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1171 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1172 v119 = _evt->v6;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1173 v88 = pPlayers[uActiveCharacter];
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1174 v115 = EVT_DWORD(_evt->v7 );
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1175 v88->ReceiveDamage(v115, (DAMAGE_TYPE)v119);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1176 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1177 v4 = v124;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1178 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1179 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1180 if ( v86 != 5 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1181 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1182 v119 = _evt->v6;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1183 v115 = EVT_DWORD(_evt->v7 );
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1184 v89 = rand() % 4;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1185 v88 = &pParty->pPlayers[v89];
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1186 v88->ReceiveDamage(v115, (DAMAGE_TYPE)v119);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1187 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1188 v4 = v124;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1189
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1190 //v6 = v123;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1191 //v7 = "";
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1192 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1193 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1194 v87 = pParty->pPlayers;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1195 do
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1196 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1197 v87->ReceiveDamage(v85, (DAMAGE_TYPE)_evt->v6);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1198 ++v87;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1199 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1200 while ( (signed int)v87 < (signed int)pParty->pHirelings );
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1201 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1202 v4 = v124;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1203
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1204 //v6 = v123;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1205 //v7 = "";
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1206 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1207 case EVENT_ToggleIndoorLight:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1208 pIndoor->ToggleLight(EVT_DWORD(_evt->v5 ), _evt->v9);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1209 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1210 v4 = v124;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1211
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1212 //v6 = v123;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1213 //v7 = "";
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1214 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1215 case EVENT_SetFacesBit:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1216 sub_44892E_set_faces_bit(EVT_DWORD(_evt->v5),EVT_DWORD(_evt->v9), _evt->v13);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1217 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1218 v4 = v124;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1219
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1220 //v6 = v123;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1221 //v7 = "";
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1222 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1223 case EVENT_ToggleChestFlag:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1224 Chest::ToggleFlag(EVT_DWORD(_evt->v5 ), EVT_DWORD(_evt->v9 ), _evt->v13);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1225 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1226 v4 = v124;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1227
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1228 //v6 = v123;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1229 //v7 = "";
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1230 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1231 case EVENT_ToggleActorFlag:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1232 Actor::ToggleFlag(EVT_DWORD(_evt->v5 ), EVT_DWORD(_evt->v9 ), _evt->v13);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1233 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1234 v4 = v124;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1235
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1236 //v6 = v123;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1237 //v7 = "";
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1238 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1239 case EVENT_ToggleActorGroupFlag:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1240 ToggleActorGroupFlag(EVT_DWORD(_evt->v5 ), EVT_DWORD(_evt->v9 ), _evt->v13);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1241 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1242 v4 = v124;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1243
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1244 //v6 = v123;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1245 //v7 = "";
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1246 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1247 case EVENT_SetSnow:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1248 if ( !_evt->v5 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1249 pWeather->bRenderSnow = _evt->v6 != 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1250 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1251 v4 = v124;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1252
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1253 //v6 = v123;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1254 //v7 = "";
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1255 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1256 case EVENT_StatusText:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1257 v90 = EVT_DWORD(_evt->v5 );
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1258 if ( activeLevelDecoration )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1259 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1260 if ( activeLevelDecoration == (LevelDecoration*)1 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1261 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1262 current_npc_text = pNPCTopics[v90-1].pText;//(&dword_721664)[8 * v90];
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1263 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1264 if ( canShowMessages == 1 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1265 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1266 v91 = pNPCTopics[v90-1].pText;//(&dword_721664)[8 * v90];
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1267 //LABEL_248:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1268 ShowStatusBarString(v91, 2u);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1269 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1270 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1271 else
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1272 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1273 if ( canShowMessages == 1 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1274 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1275 v91 = &pLevelStr[pLevelStrOffsets[v90]];
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1276 ShowStatusBarString(v91, 2u);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1277 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1278 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1279 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1280 v4 = v124;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1281
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1282 //v6 = v123;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1283 //v7 = "";
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1284 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1285 case EVENT_ShowMessage:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1286 v92 = EVT_DWORD(_evt->v5 );
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1287 if ( activeLevelDecoration )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1288 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1289 v93 = (char *)pNPCTopics[v92-1].pText;//(&dword_721664)[8 * v92];
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1290 byte_5B0938[0] = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1291 current_npc_text = v93;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1292 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1293 else
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1294 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1295 strcpy(byte_5B0938.data(), &pLevelStr[pLevelStrOffsets[v92]]);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1296 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1297 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1298 v4 = v124;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1299
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1300 //v6 = v123;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1301 //v7 = "";
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1302 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1303 case EVENT_CastSpell:
835
72f6df90df98 EventCastSpell
Ritor1
parents: 827
diff changeset
1304 EventCastSpell(_evt->v5, _evt->v6, _evt->v7, EVT_DWORD(_evt->v8 ),
525
e7b3fa10d58d events cleanup
Gloval
parents: 520
diff changeset
1305 EVT_DWORD(_evt->v12 ), EVT_DWORD(_evt->v16 ), EVT_DWORD(_evt->v20 ),
e7b3fa10d58d events cleanup
Gloval
parents: 520
diff changeset
1306 EVT_DWORD(_evt->v24 ), EVT_DWORD(_evt->v28 ));
835
72f6df90df98 EventCastSpell
Ritor1
parents: 827
diff changeset
1307 ++curr_seq_num;
72f6df90df98 EventCastSpell
Ritor1
parents: 827
diff changeset
1308 v4 = v124;
72f6df90df98 EventCastSpell
Ritor1
parents: 827
diff changeset
1309 break;
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1310 case EVENT_SetTexture:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1311 sub_44861E_set_texture(EVT_DWORD(_evt->v5 ), (char *)&_evt->v9);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1312 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1313 v4 = v124;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1314
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1315 //v6 = v123;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1316 //v7 = "";
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1317 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1318 case EVENT_SetSprite:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1319 SetDecorationSprite(EVT_DWORD(_evt->v5 ), _evt->v9, (char *)&_evt->v10);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1320 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1321 v4 = v124;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1322
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1323 //v6 = v123;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1324 //v7 = "";
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1325 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1326 case EVENT_SummonMonsters:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1327 sub_448CF4_spawn_monsters(_evt->v5, _evt->v6, _evt->v7,EVT_DWORD(_evt->v8 ),
525
e7b3fa10d58d events cleanup
Gloval
parents: 520
diff changeset
1328 EVT_DWORD(_evt->v12 ), EVT_DWORD(_evt->v16 ), EVT_DWORD(_evt->v20 ),
e7b3fa10d58d events cleanup
Gloval
parents: 520
diff changeset
1329 EVT_DWORD(_evt->v24 ));
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1330 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1331 v4 = v124;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1332
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1333 //v6 = v123;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1334 //v7 = "";
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1335 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1336 case EVENT_MouseOver:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1337 case EVENT_LocationName:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1338 --curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1339 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1340 v4 = v124;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1341
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1342 //v6 = v123;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1343 //v7 = "";
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1344 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1345 case EVENT_ChangeDoorState:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1346 sub_449A49_door_switch_animation(_evt->v5, _evt->v6);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1347 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1348 v4 = v124;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1349
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1350 //v6 = v123;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1351 //v7 = "";
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1352 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1353 case EVENT_OpenChest:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1354 if ( !Chest::Open(_evt->v5) )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1355 goto LABEL_301;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1356 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1357 v4 = v124;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1358
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1359 //v6 = v123;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1360 //v7 = "";
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1361 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1362 case EVENT_MoveToMap:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1363 v94 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1364 v135 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1365 v132 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1366 v126 = _evt->v13 + ((_evt->v14 + ((_evt->v15 + ((uint)_evt->v16 << 8)) << 8)) << 8);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1367 v129 = _evt->v17 + ((_evt->v18 + ((_evt->v19 + ((uint)_evt->v20 << 8)) << 8)) << 8);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1368 v95 = _evt->v21 + ((_evt->v22 + ((_evt->v23 + ((uint)_evt->v24 << 8)) << 8)) << 8);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1369 v96 = _evt->v25;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1370 v97 = v96 + ((_evt->v26 + ((_evt->v27 + ((uint)_evt->v28 << 8)) << 8)) << 8);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1371 v134 = v96 + ((_evt->v26 + ((_evt->v27 + ((uint)_evt->v28 << 8)) << 8)) << 8);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1372 if ( _evt->v29 || _evt->v30 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1373 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1374 if ( pRenderer->pRenderD3D && !pRenderer->bWindowMode )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1375 pRenderer->_49FD3A();
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1376 TransitionUI_Load(_evt->v29, _evt->v30, v135, v132, v126, v129, v95, v134, (char *)&_evt->v31);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1377 dword_5C3418 = uEventID;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1378 dword_5C341C = curr_seq_num + 1;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1379 goto LABEL_301;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1380 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1381 _5B65AC_npcdata_fame_or_other = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1382 _5B65A8_npcdata_uflags_or_other = v94;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1383 _5B65B0_npcdata_rep_or_other = v126;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1384 if ( v129 == -1 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1385 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1386 v98 = _5B65B4_npcdata_loword_house_or_other;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1387 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1388 else
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1389 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1390 v98 = v129 & stru_5C6E00->uDoublePiMask;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1391 _5B65B4_npcdata_loword_house_or_other = v129 & stru_5C6E00->uDoublePiMask;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1392 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1393 v99 = (char *)&_evt->v31;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1394 _5B65B8_npcdata_hiword_house_or_other = v95;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1395 dword_5B65BC = v97;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1396 v100 = v94 | v132 | v126 | v95 | v97 | v98;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1397 dword_5B65C0 = v100;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1398 if ( *v99 == 48 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1399 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1400 if ( v100 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1401 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1402 pParty->vPosition.x = v135;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1403 pParty->vPosition.y = v132;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1404 pParty->vPosition.z = v126;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1405 pParty->uFallStartY = v126;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1406 if ( _5B65B4_npcdata_loword_house_or_other != -1 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1407 pParty->sRotationY = _5B65B4_npcdata_loword_house_or_other;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1408 _5B65B4_npcdata_loword_house_or_other = -1;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1409 v120 = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1410 v116 = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1411 v111 = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1412 v110 = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1413 v109 = -1;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1414 v108 = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1415 v107 = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1416 pParty->sRotationX = v95;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1417 pParty->uFallSpeed = v134;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1418 dword_5B65C0 = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1419 dword_5B65BC = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1420 _5B65B8_npcdata_hiword_house_or_other = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1421 _5B65B0_npcdata_rep_or_other = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1422 _5B65AC_npcdata_fame_or_other = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1423 _5B65A8_npcdata_uflags_or_other = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1424 v106 = 232;
307
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
1425 LABEL_280:
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1426 pAudioPlayer->PlaySound((SoundID)v106, v107, v108, v109, v110, v111, v116, v120);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1427 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1428 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1429 else
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1430 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1431 pGameLoadingUI_ProgressBar->uType = (GUIProgressBar::Type)((activeLevelDecoration == NULL) + 1);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1432 sub_44987B(v99, MapStartPoint_Party);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1433 v133 = 1;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1434 if ( pCurrentScreen == SCREEN_HOUSE )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1435 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1436 if ( uGameState == GAME_STATE_2 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1437 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1438 pAudioPlayer->StopChannels(-1, -1);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1439 dialog_menu_id = HOUSE_DIALOGUE_NULL;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1440 while ( sub_4BD8B5() )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1441 ;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1442 pVideoPlayer->Unload();
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1443 window_SpeakInHouse->Release();
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1444 window_SpeakInHouse = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1445 if ( pMessageQueue_50CBD0->uNumMessages )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1446 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1447 pCurrentScreen = SCREEN_GAME;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1448 viewparams->bRedrawGameUI = 1;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1449 pDialogueNPCCount = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1450 pDialogueWindow->Release();
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1451 dialog_menu_id = HOUSE_DIALOGUE_NULL;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1452 pDialogueWindow = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1453 pIcons_LOD->SyncLoadedFilesCount();
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1454 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1455 OnMapLeave();
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1456 return;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1457 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1458 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1459 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1460 v4 = v124;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1461
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1462 //v6 = v123;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1463 //v7 = "";
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1464 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1465 case EVENT_PlaySound:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1466 v120 = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1467 v116 = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1468 v111 = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1469 v110 = _evt->v13 + ((_evt->v14 + ((_evt->v15 + ((uint)_evt->v16 << 8)) << 8)) << 8);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1470 v109 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1471 v108 = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1472 v107 = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1473 v106 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1474 goto LABEL_280;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1475 case EVENT_GiveItem:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1476 item.Reset();
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1477 //v101 = &pSomeEVT[v9];
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1478 v102 = _evt->v7
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1479 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1480 pItemsTable->GenerateItem(_evt->v5, _evt->v6, &item);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1481 if ( v102 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1482 item.uItemID = v102;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1483 pParty->SetHoldingItem(&item);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1484 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1485 v4 = v124;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1486 //v6 = v123;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1487 //v7 = "";
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1488 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1489 case EVENT_SpeakInHouse:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1490 if ( EnterHouse((enum HOUSE_ID)EVT_DWORD(_evt->v5)))
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1491 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1492 if ( pRenderer->pRenderD3D && !pRenderer->bWindowMode )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1493 pRenderer->_49FD3A();
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1494 pAudioPlayer->PlaySound((SoundID)0, 0, 0, -1, 0, 0, 0, 0);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1495 pAudioPlayer->PlaySound(SOUND_EnteringAHouse, 814, 0, -1, 0, 0, 0, 0);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1496 v104 = 187;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1497 if ( uCurrentHouse_Animation != 167 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1498 v104 = EVT_DWORD(_evt->v5);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1499 window_SpeakInHouse = GUIWindow::Create(0, 0, 640, 480, WINDOW_HouseInterior, v104, 0);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1500 window_SpeakInHouse->CreateButton( 61, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 1, '1', "", 0);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1501 window_SpeakInHouse->CreateButton(177, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 2, '2', "", 0);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1502 window_SpeakInHouse->CreateButton(292, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 3, '3', "", 0);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1503 window_SpeakInHouse->CreateButton(407, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 4, '4', "", 0);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1504 window_SpeakInHouse->CreateButton( 0, 0, 0, 0, 1, 0, UIMSG_CycleCharacters, 0, '\t', "", 0);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1505 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1506 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1507 v4 = v124;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1508
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1509 //v6 = v123;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1510 //v7 = "";
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1511 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1512 case EVENT_PressAnyKey:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1513 v121 = 33;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1514 v105 = curr_seq_num + 1;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1515 goto LABEL_295;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1516 case EVENT_Exit:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1517 if ( v133 == 1 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1518 OnMapLeave();
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1519 return;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1520 default:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1521 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1522 v4 = v124;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1523
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1524 //v6 = v123;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1525 //v7 = "";
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1526 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1527 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1528 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1529 ++v4;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1530 v124 = v4;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1531 if ( v4 >= uSomeEVT_NumEvents )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1532 goto LABEL_301;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1533 //}
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1534 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1535 }
307
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
1536
1295
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1537 //----- (00444732) --------------------------------------------------------
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1538 char *GetEventHintString(unsigned int uEventID)
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1539 {
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1540 signed int event_index; // edx@1
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1541 int event_pos; // esi@4
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1542 char *result; // eax@6
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1543 unsigned int str_index; // eax@9
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1544 int i; // esi@11
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1545 _evt_raw* test_evt;
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1546 _evt_raw* last_evt;
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1547
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1548 event_index = 0;
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1549 if ( uLevelEVT_NumEvents <= 0 )
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1550 return NULL;
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1551
1295
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1552 //v2 = (char *)&pLevelEVT_Index[0].uEventOffsetInEVT;
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1553 while ( 1 )
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1554 {
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1555 if ( pLevelEVT_Index[event_index].uEventID == uEventID )
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1556 {
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1557 test_evt=(_evt_raw*)&pLevelEVT[pLevelEVT_Index[event_index].uEventOffsetInEVT];
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1558 last_evt=test_evt;
1295
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1559 event_pos = pLevelEVT_Index[event_index+1].uEventOffsetInEVT;
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1560 if ( test_evt->_e_type == EVENT_MouseOver )
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1561 break;
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1562 }
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1563 ++event_index;
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1564 if ( event_index >= uLevelEVT_NumEvents )
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1565 return NULL;
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1566 }
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1567 test_evt=(_evt_raw*)&pLevelEVT[event_pos];
1295
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1568 if ( test_evt->_e_type== EVENT_SpeakInHouse )
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1569 {
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1570 str_index = EVT_DWORD(test_evt->v5);
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1571 result = (char *)p2DEvents[str_index - 1].pName;
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1572 }
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1573 else
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1574 {
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1575 for ( i = event_index+1; pLevelEVT_Index[i].uEventID == uEventID; ++i )
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1576 {
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1577 event_pos = pLevelEVT_Index[i].uEventOffsetInEVT;
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1578 test_evt=(_evt_raw*)&pLevelEVT[event_pos];
1295
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1579 if ( test_evt->_e_type == EVENT_SpeakInHouse )
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1580 {
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1581 str_index = EVT_DWORD(test_evt->v5);
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1582 if ( str_index < 600 )
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1583 return (char *)p2DEvents[str_index - 1].pName;
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1584 }
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1585 }
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1586 result = &pLevelStr[pLevelStrOffsets[EVT_BYTE(last_evt->v5)]];
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1587 }
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1588
1295
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1589 return result;
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1590 }