annotate Events.cpp @ 1232:8eb865b584db

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