annotate Events.cpp @ 2464:104fdbea0386

cleaning project part 2
author zipi
date Sun, 17 Aug 2014 17:49:34 +0100
parents 0f17a30149ec
children b054ea5daf45
rev   line source
2415
f4af3b203f65 LOD.cpp cleaned and search memory corrupt
Ritor1
parents: 2386
diff changeset
1 #define _CRTDBG_MAP_ALLOC
f4af3b203f65 LOD.cpp cleaned and search memory corrupt
Ritor1
parents: 2386
diff changeset
2 #include <stdlib.h>
f4af3b203f65 LOD.cpp cleaned and search memory corrupt
Ritor1
parents: 2386
diff changeset
3 #include <crtdbg.h>
f4af3b203f65 LOD.cpp cleaned and search memory corrupt
Ritor1
parents: 2386
diff changeset
4
2253
aff7a7b072b7 adding _CRT_SECURE_NO_WARNINGS to get rid of a few hundrer annoying warnings + adding count parameter to swprintf
Grumpy7
parents: 2215
diff changeset
5 #define _CRT_SECURE_NO_WARNINGS
307
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
6 #include <stdlib.h>
2464
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
7
2336
d6887ee81068 header file include cleanup
Grumpy7
parents: 2334
diff changeset
8 #include "ErrorHandling.h"
307
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
9
1323
bfde0563ecdc removed weather.h from indoor.h
Grumpy7
parents: 1299
diff changeset
10 #include "Weather.h"
1262
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
11 #include "Texture.h"
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
12 #include "mm7_data.h"
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2431
diff changeset
13 #include "MediaPlayer.h"
1016
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 978
diff changeset
14 #include "Mouse.h"
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 978
diff changeset
15
307
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
16 #include "MapInfo.h"
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
17 #include "Game.h"
1254
b9747d9e9b4e more included header cleanup
Grumpy7
parents: 1205
diff changeset
18 #include "Render.h"
307
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
19 #include "GUIWindow.h"
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
20 #include "GUIProgressBar.h"
2331
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2268
diff changeset
21 #include "SpriteObject.h"
307
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
22 #include "Chest.h"
2386
41c36ecc9f32 MapsLongTimer.h
Ritor1
parents: 2336
diff changeset
23 #include "MapsLongTimer.h"
307
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
24 #include "LOD.h"
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
25 #include "Actor.h"
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
26 #include "Party.h"
2037
7a9477135943 Renamed Math.h -> OurMath.h (file resolution was sometimes ambiguous)
Nomad
parents: 2025
diff changeset
27 #include "OurMath.h"
307
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
28 #include "AudioPlayer.h"
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
29 #include "Indoor.h"
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
30 #include "Viewport.h"
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
31 #include "texts.h"
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
32 #include "stru123.h"
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
33 #include "stru159.h"
0
Ritor1
parents:
diff changeset
34 #include "Events.h"
Ritor1
parents:
diff changeset
35 #include "Events2D.h"
1299
8c2f689b5f0b folder UI
Ritor1
parents: 1295
diff changeset
36 #include "UI\UIHouses.h"
1052
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
37 #include "Log.h"
481
5b6e2021c6fe HOUSE_ID
Ritor1
parents: 480
diff changeset
38 #include "MM7.h"
1828
35c1e4ff6ba7 party_finds_gold to Party::PartyFindsGold, cleaned up, moved Level/Decoration.h reference out of Indoor.h
Grumpy7
parents: 1826
diff changeset
39 #include "Level/Decoration.h"
2052
71a814f4482a Moved implementation to cpp
Nomad
parents: 2050
diff changeset
40 #include "LuaVM.h"
0
Ritor1
parents:
diff changeset
41
2463
0f17a30149ec cleaning project part 1
zipi
parents: 2455
diff changeset
42 #include "DecorationList.h"
0
Ritor1
parents:
diff changeset
43
Ritor1
parents:
diff changeset
44
1202
0dbf6c4dd029 arrays to std::arrays phase 1
Grumpy7
parents: 1179
diff changeset
45 std::array<EventIndex, 4400> pSomeOtherEVT_Events;
423
88c30918eef7 NPC_EventProcessor
Gloval
parents: 373
diff changeset
46 signed int uSomeOtherEVT_NumEvents;
0
Ritor1
parents:
diff changeset
47 char *pSomeOtherEVT;
1202
0dbf6c4dd029 arrays to std::arrays phase 1
Grumpy7
parents: 1179
diff changeset
48 std::array<EventIndex, 4400> pSomeEVT_Events;
428
24936a5ff8ca level hints
Gloval
parents: 423
diff changeset
49 signed int uSomeEVT_NumEvents;
0
Ritor1
parents:
diff changeset
50 char *pSomeEVT;
Ritor1
parents:
diff changeset
51
Ritor1
parents:
diff changeset
52 unsigned int uGlobalEVT_NumEvents;
Ritor1
parents:
diff changeset
53 unsigned int uGlobalEVT_Size;
1202
0dbf6c4dd029 arrays to std::arrays phase 1
Grumpy7
parents: 1179
diff changeset
54 std::array<char, 46080> pGlobalEVT;
0dbf6c4dd029 arrays to std::arrays phase 1
Grumpy7
parents: 1179
diff changeset
55 std::array<EventIndex, 4400> pGlobalEVT_Index;
0
Ritor1
parents:
diff changeset
56
1202
0dbf6c4dd029 arrays to std::arrays phase 1
Grumpy7
parents: 1179
diff changeset
57 std::array<unsigned int, 500> pLevelStrOffsets;
0
Ritor1
parents:
diff changeset
58 unsigned int uLevelStrNumStrings;
Ritor1
parents:
diff changeset
59 unsigned int uLevelStrFileSize;
428
24936a5ff8ca level hints
Gloval
parents: 423
diff changeset
60 signed int uLevelEVT_NumEvents;
0
Ritor1
parents:
diff changeset
61 unsigned int uLevelEVT_Size;
1202
0dbf6c4dd029 arrays to std::arrays phase 1
Grumpy7
parents: 1179
diff changeset
62 std::array<char, 9216> pLevelStr;
0dbf6c4dd029 arrays to std::arrays phase 1
Grumpy7
parents: 1179
diff changeset
63 std::array<char, 9216> pLevelEVT;
0dbf6c4dd029 arrays to std::arrays phase 1
Grumpy7
parents: 1179
diff changeset
64 std::array<EventIndex, 4400> pLevelEVT_Index;
0
Ritor1
parents:
diff changeset
65
1289
Ritor1
parents: 1205
diff changeset
66 _2devent p2DEvents[525];
307
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
67
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
68
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
69
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
70 //----- (00443CE1) --------------------------------------------------------
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
71 unsigned int LoadEventsToBuffer(const char *pContainerName, char *pBuffer, unsigned int uBufferSize)
1052
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
72 {
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
73 FILE *pLodFile; // eax@1
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
74 unsigned int uTextureSize; // esi@3
1545
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1490
diff changeset
75 //char Args[60]; // [sp+8h] [bp-B4h]@6
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
76 void *ptr; // [sp+B8h] [bp-4h]@1
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
77 Texture DstBuf; // [sp+6Ch] [bp-50h]@1
307
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
78
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
79 ptr = pEvents_LOD->LoadRaw(pContainerName, 0);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
80 pLodFile = pEvents_LOD->FindContainer(pContainerName, 0);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
81 if ( !pLodFile )
1545
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1490
diff changeset
82 Error("Unable to load %s", pContainerName);
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1490
diff changeset
83
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
84 fread(&DstBuf, 1, 48, pLodFile);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
85 uTextureSize = DstBuf.uDecompressedSize;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
86 if ( !DstBuf.uDecompressedSize )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
87 uTextureSize = DstBuf.uTextureSize;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
88 memset(&DstBuf, 0, 72);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
89 if ( uTextureSize >= (signed int)uBufferSize )
1545
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1490
diff changeset
90 Error("File %s Size %lu - Buffer size %lu", pContainerName, uTextureSize, uBufferSize);
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1490
diff changeset
91
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
92 memcpy(pBuffer, ptr, uTextureSize);
1583
75fafd8ced59 Allocator (CMemory) bye-bye
Nomad
parents: 1545
diff changeset
93 free(ptr);
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
94 return uTextureSize;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
95 }
307
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
96
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
97 //----- (00443DA1) --------------------------------------------------------
1458
934074e7fcc1 ModalWindow
Nomad
parents: 1384
diff changeset
98 void Initialize_GlobalEVT()
762
cf2fbac6edc9 Misc cleaning
Nomad
parents: 747
diff changeset
99 {
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
100 struct raw_event_header
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
101 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
102 unsigned char evt_size;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
103 unsigned char evt_id_l;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
104 unsigned char evt_id_h;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
105 unsigned char evt_sequence_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
106 } ;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
107 uint events_count;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
108 unsigned int offset_in;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
109 raw_event_header *current_hdr;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
110 uGlobalEVT_NumEvents = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
111 uGlobalEVT_Size = LoadEventsToBuffer("global.evt", pGlobalEVT.data(), 46080);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
112 if ( !uGlobalEVT_Size )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
113 return;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
114 memset(pGlobalEVT_Index.data(), 0x80, sizeof(pGlobalEVT_Index));//52800
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
115 events_count = uGlobalEVT_NumEvents;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
116 current_hdr=(raw_event_header *)pGlobalEVT.data();
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
117 offset_in=0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
118 for (events_count = 0, offset_in = 0; offset_in < uGlobalEVT_Size; ++events_count)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
119 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
120 pGlobalEVT_Index[events_count].uEventID=current_hdr->evt_id_l+(current_hdr->evt_id_h<<8);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
121 pGlobalEVT_Index[events_count].event_sequence_num=current_hdr->evt_sequence_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
122 pGlobalEVT_Index[events_count].uEventOffsetInEVT=offset_in;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
123 offset_in+=current_hdr->evt_size+1;
1052
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
124
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
125 current_hdr=(raw_event_header *)&pGlobalEVT[offset_in];
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
126 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
127 uGlobalEVT_NumEvents = events_count;
307
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
128
762
cf2fbac6edc9 Misc cleaning
Nomad
parents: 747
diff changeset
129 assert(uGlobalEVT_NumEvents < 4400);
cf2fbac6edc9 Misc cleaning
Nomad
parents: 747
diff changeset
130 }
307
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
131
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
132
1052
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
133
307
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
134 //----- (00443EF8) --------------------------------------------------------
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
135 void LoadLevel_InitializeLevelEvt()
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
136 {
601
d59398528e4f level events loading fix
Gloval
parents: 569
diff changeset
137 struct raw_event_header
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
138 {
601
d59398528e4f level events loading fix
Gloval
parents: 569
diff changeset
139 unsigned char evt_size;
d59398528e4f level events loading fix
Gloval
parents: 569
diff changeset
140 unsigned char evt_id_l;
d59398528e4f level events loading fix
Gloval
parents: 569
diff changeset
141 unsigned char evt_id_h;
d59398528e4f level events loading fix
Gloval
parents: 569
diff changeset
142 unsigned char evt_sequence_num;
d59398528e4f level events loading fix
Gloval
parents: 569
diff changeset
143 } ;
d59398528e4f level events loading fix
Gloval
parents: 569
diff changeset
144 uint events_count;
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
145 unsigned int offset_in;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
146 raw_event_header *current_hdr;
601
d59398528e4f level events loading fix
Gloval
parents: 569
diff changeset
147
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
148 if (!uLevelEVT_Size)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
149 return;
307
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
150
2386
41c36ecc9f32 MapsLongTimer.h
Ritor1
parents: 2336
diff changeset
151 memset(MapsLongTimersList, 0, 3200);
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
152 memset(pLevelEVT_Index.data(), 80, sizeof(EventIndex)*4400);
307
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
153
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
154 uLevelEVT_NumEvents = 0;
2386
41c36ecc9f32 MapsLongTimer.h
Ritor1
parents: 2336
diff changeset
155 MapsLongTimers_count = 0;
307
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
156
1202
0dbf6c4dd029 arrays to std::arrays phase 1
Grumpy7
parents: 1179
diff changeset
157 current_hdr=(raw_event_header *)pLevelEVT.data();
601
d59398528e4f level events loading fix
Gloval
parents: 569
diff changeset
158 offset_in=0;
d59398528e4f level events loading fix
Gloval
parents: 569
diff changeset
159 for (events_count = 0, offset_in = 0; offset_in < uLevelEVT_Size; ++events_count)
d59398528e4f level events loading fix
Gloval
parents: 569
diff changeset
160 {
d59398528e4f level events loading fix
Gloval
parents: 569
diff changeset
161 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
162 pLevelEVT_Index[events_count].event_sequence_num=current_hdr->evt_sequence_num;
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
163 pLevelEVT_Index[events_count].uEventOffsetInEVT=offset_in;
601
d59398528e4f level events loading fix
Gloval
parents: 569
diff changeset
164 offset_in+=current_hdr->evt_size+1;
1052
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
165
601
d59398528e4f level events loading fix
Gloval
parents: 569
diff changeset
166 current_hdr=(raw_event_header *)&pLevelEVT[offset_in];
d59398528e4f level events loading fix
Gloval
parents: 569
diff changeset
167 }
d59398528e4f level events loading fix
Gloval
parents: 569
diff changeset
168 uLevelEVT_NumEvents = events_count;
d59398528e4f level events loading fix
Gloval
parents: 569
diff changeset
169
d59398528e4f level events loading fix
Gloval
parents: 569
diff changeset
170 /*
1052
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
171 EmeraldIsle::Variables:
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
172 [0] ???
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
173 [1] ???
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
174 [2] Luck Fountain uses left
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
175 [3] Gold Fountain used this week
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
176 [4] Gold Fountain total uses
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
177
1053
1c10b24a4159 BLV picky-blicky
Nomad
parents: 1052
diff changeset
178
1c10b24a4159 BLV picky-blicky
Nomad
parents: 1052
diff changeset
179 Emerald Isle #110 // Fire Resistance fountain
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
180 0 LocationName
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
181 0 if (Player.FireResistance < 50)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
182 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
183 1 Set(Player.FireResistance, 50)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
184 2 SetFooterString(22) // +50 Fire Resistance (temporarily)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
185 3 Add(Party.Autonotes, 2)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
186 4 goto return
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
187 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
188 5 SetFooterString(11) // Refreshing!
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
189 6 return
1053
1c10b24a4159 BLV picky-blicky
Nomad
parents: 1052
diff changeset
190
1c10b24a4159 BLV picky-blicky
Nomad
parents: 1052
diff changeset
191
1c10b24a4159 BLV picky-blicky
Nomad
parents: 1052
diff changeset
192
1052
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
193 Emerald Isle #111 // ???
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
194 Initialize
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
195 Set(Map.Variables[0], 30)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
196 Set(Map.Variables[1], 30)
1052
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
197
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
198
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
199 Emerald Isle #114 // month timer - manage luck fountain
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
200 0 LocationName
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
201 0 if (Player.BaseLuck >= 15)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
202 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
203 2 SetFooterString(11) // Refreshing!
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
204 3 return
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
205 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
206 else
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
207 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
208 1 if (Map.Variables[2] >= 1)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
209 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
210 4 Sub(Map.Variables[2], 1)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
211 5 Add(Player.BaseLuck, 2)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
212 6 SetFooterString(25) // +2 Luck (Permament)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
213 7 return
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
214 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
215 else
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
216 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
217 2 SetFooterString(11) // Refreshing!
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
218 3 return
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
219 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
220 }
1052
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
221
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
222 8 Initialize
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
223 9 Set Map.Variables[2], 8
1052
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
224
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
225
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
226
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
227 Emerald Isle #115 // week timer - gold fountain in the center of town
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
228 0 LocationName
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
229 0 if (Map.Variables[4] < 3)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
230 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
231 1 if (Map.Variables[3] == 0)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
232 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
233 2 if (Party.Gold < 201)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
234 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
235 3 if (Player.BaseLuck >= 15)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
236 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
237 5 Add(Map.Variables[3], 1)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
238 6 Add(Party.Gold, 1000)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
239 7 Add(Map.Variables[4], 1)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
240 8 goto return
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
241 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
242 else
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
243 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
244 4 goto 9
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
245 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
246 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
247 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
248 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
249 9 SetFooterString(11) // Refreshing!
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
250 10 return
1052
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
251
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
252 11 Initialize
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
253 12 Set(Map.Variables[3], 0)
1052
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
254
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
255
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
256
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
257
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
258
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
259 Emerald Isle #220 // day timer - monster spawner
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
260 0 LocationName
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
261 0 Initialize
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
262 1 if (NumAliveActors(group=20) != 0)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
263 2 return
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
264 3 SpawnMonsters(1, level=1, count=10, x=-336, y=14512, z=0, group=20)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
265 4 SpawnMonsters(1, level=2, count=5, x=16, y=16352, z=90, group=20)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
266 5 SpawnMonsters(1, level=1, count=10, x=480, y=18288, z=6, group=20)
1052
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
267
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
268
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
269
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
270 Emerald Isle #200 // margareth dock tip
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
271 0 if (!QBits.QuestDone[17])
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
272 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
273 1 InitiateNPCDialogue(npc=19)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
274 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
275 2 return
1052
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
276
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
277
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
278 Emerald Isle #201 // margareth armoury tip
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
279 0 if (!QBits.QuestDone[17])
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
280 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
281 1 InitiateNPCDialogue(npc=20)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
282 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
283 2 return
1052
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
284 */
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
285 }
307
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
286
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
287
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
288 //----- (0044684A) --------------------------------------------------------
1052
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
289 void EventProcessor(int uEventID, int targetObj, int canShowMessages, int entry_line)
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
290 {
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
291 signed int v4; // esi@7
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
292 int v11; // eax@14
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
293 char *v12; // eax@15
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
294 const char *v16; // esi@21
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
295 bool v17; // edx@21
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
296 int v18; // ecx@22
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
297 int v19; // ebp@36
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
298 signed int v20; // ecx@40
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
299 int v21; // eax@40
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
300 int v22; // edx@40
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
301 int v23; // eax@40
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
302 unsigned __int16 v24; // ax@45
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
303 LevelDecoration *v26; // eax@55
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
304 int v27; // eax@57
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
305 int pEventID; // eax@58
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
306 int pNPC_ID; // ecx@58
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
307 int pIndex; // esi@58
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
308 NPCData *pNPC; // ecx@58
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
309 int v38; // eax@78
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
310 int v39; // ecx@78
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
311 int v42; // eax@84
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
312 int v43; // ecx@84
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
313 GUIButton *v48; // ecx@93
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
314 GUIButton *v49; // esi@94
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
315 signed int pValue; // ebp@124
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
316 Player *pPlayer; // esi@125
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
317 int v83; // eax@212
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
318 int v84; // ebp@220
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
319 int v90; // eax@243
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
320 const char *v91; // ecx@247
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
321 int v94; // ecx@262
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
322 int v95; // ebp@262
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
323 int v96; // edx@262
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
324 int v97; // eax@262
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
325 unsigned int v98; // edx@265
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
326 const char *v99; // esi@267
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
327 int v100; // edx@267
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
328 unsigned int v102; // esi@281
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
329 int v104; // eax@288
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
330 int v106; // [sp-20h] [bp-4C8h]@278
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
331 signed int v109; // [sp-14h] [bp-4BCh]@278
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
332 signed int v110; // [sp-10h] [bp-4B8h]@278
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
333 int curr_seq_num; // [sp+10h] [bp-498h]@4
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
334 int v126; // [sp+1Ch] [bp-48Ch]@262
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
335 int player_choose; // [sp+20h] [bp-488h]@4
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
336 int v128; // [sp+24h] [bp-484h]@21
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
337 int v129; // [sp+24h] [bp-484h]@262
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
338 signed int v130; // [sp+28h] [bp-480h]@0
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
339 int v132; // [sp+30h] [bp-478h]@262
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
340 signed int v133; // [sp+34h] [bp-474h]@1
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
341 int v134; // [sp+38h] [bp-470h]@262
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
342 int v135; // [sp+3Ch] [bp-46Ch]@262
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
343 int v136; // [sp+40h] [bp-468h]@40
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
344 int v137; // [sp+44h] [bp-464h]@40
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
345 int v138; // [sp+48h] [bp-460h]@40
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
346 int v139; // [sp+4Ch] [bp-45Ch]@40
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
347 ItemGen item; // [sp+50h] [bp-458h]@15
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
348 char Source[120]; // [sp+74h] [bp-434h]@15
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
349 char Str[120]; // [sp+ECh] [bp-3BCh]@21
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
350 Actor Dst; // [sp+164h] [bp-344h]@53
307
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
351
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
352 v133 = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
353 EvtTargetObj = targetObj;
1825
23deb6b09c8c cancelEventProcessing to dword_5B65C4_cancelEventProcessing
Grumpy7
parents: 1821
diff changeset
354 dword_5B65C4_cancelEventProcessing = 0;
2455
51d4f38aca6c audio through OpenAL (begining)
Ritor1
parents: 2450
diff changeset
355 /*if ( uEventID == 114 )//for test script
2050
bf89a2e9eea1 LuaClass.h
Ritor1
parents: 2037
diff changeset
356 {
2052
71a814f4482a Moved implementation to cpp
Nomad
parents: 2050
diff changeset
357 if (!lua->DoFile("out01.lua"))
2050
bf89a2e9eea1 LuaClass.h
Ritor1
parents: 2037
diff changeset
358 Log::Warning(L"Error opening out01.lua\n");
2068
a290d9fbdc95 ODM_GetFloorLevel small fix
Ritor1
parents: 2066
diff changeset
359 Log::Warning(L"being tested that well\n");
2066
f7e5b9f236ae inline LuaVM()
Ritor1
parents: 2052
diff changeset
360 return;
2144
cfe04d858766 ODM_ProcessPartyActions continue
Ritor1
parents: 2137
diff changeset
361 } */
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
362 if ( !uEventID )
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
363 {
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
364 if ( !GameUI_Footer_TimeLeft )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
365 ShowStatusBarString(pGlobalTXT_LocalizationStrings[521], 2u);// Nothing here
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
366 return;
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
367 }
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
368 player_choose = (uActiveCharacter == 0)?6:4; //4 - active or 6 - random player if active =0
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
369 curr_seq_num = entry_line;
1052
d48c762de563 -nomarg
Nomad
parents: 1039
diff changeset
370
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
371 if ( activeLevelDecoration )
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
372 {
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
373 uSomeEVT_NumEvents = uGlobalEVT_NumEvents;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
374 pSomeEVT = pGlobalEVT.data();
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
375 memcpy(pSomeEVT_Events.data(), pGlobalEVT_Index.data(), sizeof(EventIndex)*4400); //4400 evts
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
376 }
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
377 else
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
378 {
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
379 uSomeEVT_NumEvents = uLevelEVT_NumEvents;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
380 pSomeEVT = pLevelEVT.data();
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
381 memcpy(pSomeEVT_Events.data(), pLevelEVT_Index.data(), sizeof(EventIndex)*4400);
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
382 }
307
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
383
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
384 for ( v4 = 0; v4 < uSomeEVT_NumEvents; ++v4 )
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
385 {
1825
23deb6b09c8c cancelEventProcessing to dword_5B65C4_cancelEventProcessing
Grumpy7
parents: 1821
diff changeset
386 if ( dword_5B65C4_cancelEventProcessing )
2266
01489aec3cb0 EventProcessor cleared
Ritor1
parents: 2253
diff changeset
387 {
01489aec3cb0 EventProcessor cleared
Ritor1
parents: 2253
diff changeset
388 if ( v133 == 1 )
01489aec3cb0 EventProcessor cleared
Ritor1
parents: 2253
diff changeset
389 OnMapLeave();
01489aec3cb0 EventProcessor cleared
Ritor1
parents: 2253
diff changeset
390 return;
01489aec3cb0 EventProcessor cleared
Ritor1
parents: 2253
diff changeset
391 }
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
392 if ( pSomeEVT_Events[v4].uEventID == uEventID && pSomeEVT_Events[v4].event_sequence_num == curr_seq_num )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
393 {
1980
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1919
diff changeset
394 _evt_raw * _evt = (_evt_raw *)(pSomeEVT + pSomeEVT_Events[v4].uEventOffsetInEVT);
307
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
395
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
396 switch (_evt->_e_type)
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
397 {
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
398 case EVENT_CheckSeason:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
399 if ( !sub_4465DF_check_season(_evt->v5) )
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
400 {
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
401 ++curr_seq_num;
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
402 //v4 = v124;
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
403 break;
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
404 }
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
405 v4 = -1;
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
406 curr_seq_num = _evt->v6 - 1;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
407 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
408 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
409 case EVENT_ShowMovie:
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
410 {
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
411 strcpy(Source, (char *)&_evt->v7);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
412 v12 = (char *)&item.uExpireTime + strlen(Source) + 7;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
413 if ( *v12 == 32 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
414 *v12 = 0;
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2431
diff changeset
415 if (pMediaPlayer->bPlaying_Movie)
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2431
diff changeset
416 pMediaPlayer->Unload();
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2431
diff changeset
417 pMediaPlayer->bStopBeforeSchedule = 0;
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2431
diff changeset
418 // pMediaPlayer->pResetflag = 0;
1038
39f42990698f Cleanings
Nomad
parents: 1033
diff changeset
419
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
420 v128 = pCurrentScreen;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
421 strcpy(Str, Source);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
422 v16 = RemoveQuotes(Str);
2455
51d4f38aca6c audio through OpenAL (begining)
Ritor1
parents: 2450
diff changeset
423 pMediaPlayer->FullscreenMovieLoop(v16, 0/*, _evt->v5*/);
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
424 if ( !_stricmp(v16, "arbiter good") )
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2431
diff changeset
425 {
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2431
diff changeset
426 pParty->alignment = PartyAlignment_Good;
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
427 v18 = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
428 LOBYTE(v17) = 1;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
429 SetUserInterface(PartyAlignment_Good, v17);
2266
01489aec3cb0 EventProcessor cleared
Ritor1
parents: 2253
diff changeset
430 if ( !_evt->v6 || v128 == 3 )
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
431 {
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
432 pCurrentScreen = v128;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
433 if ( v128 == 3 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
434 pGameLoadingUI_ProgressBar->uType = GUIProgressBar::TYPE_Fullscreen;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
435 if ( v128 == 13 )
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2431
diff changeset
436 pMediaPlayer->OpenHouseMovie(pAnimatedRooms[uCurrentHouse_Animation].video_name, 1u);
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
437 }
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
438 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
439 break;
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
440 }
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
441 if ( !_stricmp(v16, "arbiter evil") )
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
442 {
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
443 v18 = 2;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
444 pParty->alignment = PartyAlignment_Evil;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
445 LOBYTE(v17) = 1;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
446 SetUserInterface(PartyAlignment_Evil, v17);
2266
01489aec3cb0 EventProcessor cleared
Ritor1
parents: 2253
diff changeset
447 if ( !_evt->v6 || v128 == 3 )
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
448 {
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
449 pCurrentScreen = v128;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
450 if ( v128 == 3 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
451 pGameLoadingUI_ProgressBar->uType = GUIProgressBar::TYPE_Fullscreen;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
452 if ( v128 == 13 )
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2431
diff changeset
453 pMediaPlayer->OpenHouseMovie(pAnimatedRooms[uCurrentHouse_Animation].video_name, 1);
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
454 }
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
455 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
456 break;
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
457 }
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
458 if ( !_stricmp(v16, "pcout01") ) // moving to harmondale from emerald isle
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
459 {
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
460 Rest(0x2760u);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
461 pParty->RestAndHeal();
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
462 pParty->days_played_without_rest = 0;
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
463 }
2266
01489aec3cb0 EventProcessor cleared
Ritor1
parents: 2253
diff changeset
464 if ( !_evt->v6 || v128 == 3 )
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
465 {
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
466 pCurrentScreen = v128;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
467 if ( v128 == 3 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
468 pGameLoadingUI_ProgressBar->uType = GUIProgressBar::TYPE_Fullscreen;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
469 if ( v128 == 13 )
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2431
diff changeset
470 pMediaPlayer->OpenHouseMovie(pAnimatedRooms[uCurrentHouse_Animation].video_name, 1);
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
471 }
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
472 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
473 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
474 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
475 case EVENT_CheckSkill:
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
476 {
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
477 v19 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((unsigned int)_evt->v10 << 8)) << 8)) << 8);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
478 if ( player_choose < 0 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
479 goto LABEL_47;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
480 if ( player_choose <= 3 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
481 v24 = pParty->pPlayers[0].pActiveSkills[3486 * player_choose + _evt->v5];
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
482 else
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
483 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
484 if ( player_choose == 4 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
485 v24 = pPlayers[uActiveCharacter]->pActiveSkills[_evt->v5];
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
486 else
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
487 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
488 if ( player_choose == 5 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
489 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
490 v20 = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
491 v21 = 3486 * v130 + _evt->v5;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
492 v136 = 1;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
493 LOWORD(v21) = pParty->pPlayers[0].pActiveSkills[v21];
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
494 v137 = v21 & 0x40;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
495 v138 = v21 & 0x80;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
496 v22 = v21 & 0x100;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
497 v23 = v21 & 0x3F;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
498 v139 = v22;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
499 while ( v23 < v19 || !*(&v136 + _evt->v6) )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
500 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
501 ++v20;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
502 if ( v20 >= 4 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
503 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
504 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
505 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
506 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
507 }
2266
01489aec3cb0 EventProcessor cleared
Ritor1
parents: 2253
diff changeset
508 curr_seq_num = _evt->v11 - 1;
01489aec3cb0 EventProcessor cleared
Ritor1
parents: 2253
diff changeset
509 ++curr_seq_num;
01489aec3cb0 EventProcessor cleared
Ritor1
parents: 2253
diff changeset
510 break;
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
511 }
307
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
512 LABEL_47:
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
513 //v10 = (ByteArray *)&v5[v9];
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
514 v24 = pParty->pPlayers[0].pActiveSkills[_evt->v5 + 3486 * rand() % 4];
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
515 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
516 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
517 v136 = 1;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
518 v137 = v24 & 0x40;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
519 v138 = v24 & 0x80;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
520 v139 = v24 & 0x100;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
521 if ( (v24 & 0x3F) >= v19 && *(&v136 + _evt->v6) )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
522 {
2266
01489aec3cb0 EventProcessor cleared
Ritor1
parents: 2253
diff changeset
523 curr_seq_num = _evt->v11 - 1;
01489aec3cb0 EventProcessor cleared
Ritor1
parents: 2253
diff changeset
524 ++curr_seq_num;
01489aec3cb0 EventProcessor cleared
Ritor1
parents: 2253
diff changeset
525 break;
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
526 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
527 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
528 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
529 break;
307
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
530
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
531 case EVENT_SpeakNPC:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
532 if ( canShowMessages )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
533 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
534 //Actor::Actor(&Dst);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
535 memset(&Dst, 0, 0x344u);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
536 dword_5B65D0_dialogue_actor_npc_id = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((unsigned int)_evt->v8 << 8)) << 8)) << 8);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
537 Dst.sNPC_ID = dword_5B65D0_dialogue_actor_npc_id;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
538 GameUI_InitializeDialogue(&Dst, false);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
539 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
540 else
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
541 bDialogueUI_InitializeActor_NPC_ID = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((unsigned int)_evt->v8 << 8)) << 8)) << 8);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
542 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
543 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
544 case EVENT_ChangeEvent:
2266
01489aec3cb0 EventProcessor cleared
Ritor1
parents: 2253
diff changeset
545 if ( EVT_DWORD(_evt->v5) )
1736
c6fe09a06712 Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents: 1583
diff changeset
546 stru_5E4C90_MapPersistVars._decor_events[activeLevelDecoration->_idx_in_stru123] = _evt->v5 - 124;
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
547 else
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
548 {
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
549 v26 = (LevelDecoration *)activeLevelDecoration;
1736
c6fe09a06712 Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents: 1583
diff changeset
550 stru_5E4C90_MapPersistVars._decor_events[activeLevelDecoration ->_idx_in_stru123] = 0;
1489
a27cdb3d753e Cleanup of LevelDecoration and related.
yoctozepto
parents: 1458
diff changeset
551 v26->uFlags |= LEVEL_DECORATION_INVISIBLE;
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
552 }
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
553 ++curr_seq_num;
525
e7b3fa10d58d events cleanup
Gloval
parents: 520
diff changeset
554
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
555 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
556 case EVENT_SetNPCGreeting:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
557 v27 = EVT_DWORD(_evt->v5);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
558 pNPCStats->pNewNPCData[v27].uFlags &= 0xFFFFFFFCu;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
559 pNPCStats->pNewNPCData[v27].greet = EVT_DWORD(_evt->v9);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
560 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
561 break;
827
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
562 case EVENT_SetNPCTopic:
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
563 {
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
564 //v29 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
565 pEventID = _evt->v10 + ((_evt->v11 + ((_evt->v12 + ((uint)_evt->v13 << 8)) << 8)) << 8);
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
566 pNPC_ID = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
567 pIndex = _evt->v9;
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
568 pNPC = &pNPCStats->pNewNPCData[pNPC_ID];
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
569 if ( pIndex == 0 )
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
570 pNPC->evt_A = pEventID;
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
571 if ( pIndex == 1 )
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
572 pNPC->evt_B = pEventID;
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
573 if ( pIndex == 2 )
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
574 pNPC->evt_C = pEventID;
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
575 if ( pIndex == 3 )
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
576 pNPC->evt_D = pEventID;
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
577 if ( pIndex == 4 )
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
578 pNPC->evt_E = pEventID;
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
579 if ( pIndex == 5 )
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
580 pNPC->evt_F = pEventID;
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
581 if ( pNPC_ID == 8 )
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
582 {
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
583 if ( pEventID == 78 )
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
584 {
1919
140ca8123384 Tavern rest fix
Ritor1
parents: 1861
diff changeset
585 HouseDialogPressCloseBtn();
827
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
586 window_SpeakInHouse->Release();
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
587 pParty->uFlags &= ~2;
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
588 if ( EnterHouse(HOUSE_DARK_GUILD_PIT) )
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
589 {
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
590 pAudioPlayer->StopChannels(-1, -1);
2215
e9625ad08541 fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents: 2153
diff changeset
591 window_SpeakInHouse = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_HouseInterior, 170, 0);
948
5a2dbb00c399 Code cleaning.
Nomad
parents: 898
diff changeset
592 window_SpeakInHouse->CreateButton( 61, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 1, '1', "", 0);
5a2dbb00c399 Code cleaning.
Nomad
parents: 898
diff changeset
593 window_SpeakInHouse->CreateButton(177, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 2, '2', "", 0);
5a2dbb00c399 Code cleaning.
Nomad
parents: 898
diff changeset
594 window_SpeakInHouse->CreateButton(292, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 3, '3', "", 0);
5a2dbb00c399 Code cleaning.
Nomad
parents: 898
diff changeset
595 window_SpeakInHouse->CreateButton(407, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 4, '4', "", 0);
5a2dbb00c399 Code cleaning.
Nomad
parents: 898
diff changeset
596 window_SpeakInHouse->CreateButton( 0, 0, 0, 0, 1, 0, UIMSG_CycleCharacters, 0, '\t', "", 0);
827
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
597 current_npc_text = pNPCTopics[90].pText;
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
598 }
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
599 }
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
600 }
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
601 ++curr_seq_num;
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
602 }
085eb19b7ffd mr.Malvik
Ritor1
parents: 801
diff changeset
603 break;
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
604 case EVENT_NPCSetItem:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
605 sub_448518_npc_set_item(EVT_DWORD(_evt->v5),EVT_DWORD(_evt->v9), _evt->v13);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
606 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
607 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
608 case EVENT_SetActorItem:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
609 Actor::GiveItem(EVT_DWORD(_evt->v5),EVT_DWORD(_evt->v9), _evt->v13);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
610 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
611 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
612 case EVENT_SetNPCGroupNews:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
613 pNPCStats->pGroups_copy[_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8)] = _evt->v9 + ((uint)_evt->v10 << 8);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
614 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
615 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
616 case EVENT_SetActorGroup:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
617 __debugbreak();
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
618 *(&pActors[0].uGroup + 0x11000000 * _evt->v8 + 209 * (_evt->v5 + ((_evt->v6 + ((uint)_evt->v7 << 8)) << 8))) = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
619 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
620 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
621 case EVENT_ChangeGroup:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
622 v38 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
623 v39 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
624 __debugbreak();
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
625 for ( uint actor_id = 0; actor_id < uNumActors; actor_id++ )
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
626 {
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
627 if ( pActors[actor_id].uGroup == v38 )
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
628 pActors[actor_id].uGroup = v39;
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
629 }
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
630 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
631 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
632 case EVENT_ChangeGroupAlly:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
633 v42 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
634 v43 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
635 __debugbreak();
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
636 for ( uint actor_id = 0; actor_id < uNumActors; actor_id++ )
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
637 {
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
638 if ( pActors[actor_id].uGroup == v42 )
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
639 pActors[actor_id].uAlly = v43;
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
640 }
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
641 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
642 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
643 case EVENT_MoveNPC:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
644 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
645 pNPCStats->pNewNPCData[EVT_DWORD(_evt->v5)].Location2D =EVT_DWORD(_evt->v9);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
646 if ( window_SpeakInHouse )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
647 {
310
Gloval
parents: 307
diff changeset
648
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
649 if ( window_SpeakInHouse->par1C == 165 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
650 {
1919
140ca8123384 Tavern rest fix
Ritor1
parents: 1861
diff changeset
651 HouseDialogPressCloseBtn();
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2431
diff changeset
652 pMediaPlayer->Unload();
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
653 window_SpeakInHouse->Release();
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
654 pParty->uFlags &= ~2;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
655 activeLevelDecoration = (LevelDecoration*)1;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
656 if ( EnterHouse(HOUSE_BODY_GUILD_ERATHIA) )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
657 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
658 pAudioPlayer->PlaySound((SoundID)0, 0, 0, -1, 0, 0, 0, 0);
2215
e9625ad08541 fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents: 2153
diff changeset
659 window_SpeakInHouse = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_HouseInterior, 165, 0);
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
660 v48 = window_SpeakInHouse->pControlsHead;
2266
01489aec3cb0 EventProcessor cleared
Ritor1
parents: 2253
diff changeset
661 if ( window_SpeakInHouse->pControlsHead )
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
662 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
663 do
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
664 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
665 v49 = v48->pNext;
1583
75fafd8ced59 Allocator (CMemory) bye-bye
Nomad
parents: 1545
diff changeset
666 free(v48);
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
667 v48 = v49;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
668 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
669 while ( v49 );
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
670 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
671 window_SpeakInHouse->pControlsHead = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
672 window_SpeakInHouse->pControlsTail = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
673 window_SpeakInHouse->uNumControls = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
674 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
675 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
676 else
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
677 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
678 if ( window_SpeakInHouse->par1C == 553 )
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2431
diff changeset
679 pMediaPlayer->bLoopPlaying = 0;
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
680 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
681 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
682
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
683 }
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
684 ++curr_seq_num;
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
685 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
686 case EVENT_Jmp:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
687 curr_seq_num = _evt->v5 - 1;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
688 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
689 v4 = -1;
525
e7b3fa10d58d events cleanup
Gloval
parents: 520
diff changeset
690
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
691 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
692 case EVENT_ShowFace:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
693 if ( _evt->v5 <= 3u ) //someone
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
694 pParty->pPlayers[_evt->v5].PlayEmotion((CHARACTER_EXPRESSION_ID)_evt->v6, 0);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
695 else if ( _evt->v5 == 4 ) //active
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
696 pParty->pPlayers[uActiveCharacter].PlayEmotion((CHARACTER_EXPRESSION_ID)_evt->v6, 0);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
697 else if ( _evt->v5 == 5 ) //all players
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
698 {
2266
01489aec3cb0 EventProcessor cleared
Ritor1
parents: 2253
diff changeset
699 for(int i = 0; i < 4; ++i)
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
700 pParty->pPlayers[i].PlayEmotion((CHARACTER_EXPRESSION_ID)_evt->v6, 0);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
701 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
702 else //random player
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
703 pParty->pPlayers[rand() % 4].PlayEmotion((CHARACTER_EXPRESSION_ID)_evt->v6, 0);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
704 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
705 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
706 case EVENT_CharacterAnimation:
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
707 if ( _evt->v5 <= 3 ) //someone
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
708 pParty->pPlayers[_evt->v5].PlaySound((PlayerSpeech) _evt->v6, 0);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
709 else if ( _evt->v5 == 4 ) //active
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
710 pParty->pPlayers[uActiveCharacter].PlaySound((PlayerSpeech) _evt->v6, 0);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
711 else if ( _evt->v5 == 5 ) //all
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
712 for(int i = 0; i < 4; ++i)
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
713 pParty->pPlayers[i].PlaySound((PlayerSpeech) _evt->v6, 0);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
714 else //random
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
715 pParty->pPlayers[rand() % 4].PlaySound((PlayerSpeech) _evt->v6, 0);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
716 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
717 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
718 case EVENT_ForPartyMember:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
719 player_choose = _evt->v5;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
720 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
721 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
722 case EVENT_SummonItem:
2331
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2268
diff changeset
723 SpriteObject::sub_42F7EB_DropItemAt(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
724 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8),
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
725 _evt->v13 + ((_evt->v14 + ((_evt->v15 + ((uint)_evt->v16 << 8)) << 8)) << 8),
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
726 _evt->v17 + ((_evt->v18 + ((_evt->v19 + ((uint)_evt->v20 << 8)) << 8)) << 8),
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
727 _evt->v21 + ((_evt->v22 + ((_evt->v23 + ((uint)_evt->v24 << 8)) << 8)) << 8),
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
728 _evt->v25, _evt->v26, 0, 0);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
729 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
730 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
731 case EVENT_Compare:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
732 pValue = EVT_DWORD(_evt->v7);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
733 if ( player_choose <= 3 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
734 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
735 if ( pPlayers[player_choose]->CompareVariable((enum VariableType)EVT_WORD(_evt->v5), pValue) )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
736 {
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
737 // v124 = -1;
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
738 curr_seq_num = _evt->v11 - 1;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
739 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
740 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
741 else if ( player_choose == 4 ) //active
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
742 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
743 if ( uActiveCharacter )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
744 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
745 if ( pPlayers[uActiveCharacter]->CompareVariable((enum VariableType)EVT_WORD(_evt->v5), pValue) )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
746 {
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
747 // v124 = -1;
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
748 curr_seq_num = _evt->v11 - 1;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
749 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
750 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
751 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
752 else if ( player_choose == 5 )//all
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
753 {
2266
01489aec3cb0 EventProcessor cleared
Ritor1
parents: 2253
diff changeset
754 v130 = 0;
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
755 for(int i = 1; i < 5; ++i)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
756 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
757 if ( pPlayers[i]->CompareVariable((enum VariableType)EVT_WORD(_evt->v5), pValue) )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
758 {
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
759 // v124 = -1;
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
760 curr_seq_num = _evt->v11 - 1;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
761 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
762 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
763 ++v130;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
764 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
765 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
766 else if ( player_choose == 6 ) //random
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
767 {
1817
0f1543750bf8 Changing itemlist accesses to helper functions + getting rid of some pPlayers array accesses
Grumpy7
parents: 1736
diff changeset
768 if ( pPlayers[rand() % 4 + 1]->CompareVariable((enum VariableType)EVT_WORD(_evt->v5), pValue) )
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
769 {
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
770 // v124 = -1;
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
771 curr_seq_num = _evt->v11 - 1;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
772 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
773 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
774 ++curr_seq_num;
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
775 v4 = -1;
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
776 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
777 case EVENT_IsActorAlive:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
778 if (IsActorAlive(EVT_BYTE(_evt->v5), EVT_DWORD(_evt->v6), EVT_BYTE(_evt->v10)))
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
779 {
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
780 //v124 = -1;
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
781 curr_seq_num = _evt->v11 - 1;
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
782 }
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
783 ++curr_seq_num;
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
784 v4 = -1;
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
785 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
786 case EVENT_Substract:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
787 pValue = EVT_DWORD(_evt->v7);
2025
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
788 /*if ( EVT_WORD(_evt->v5) == VAR_PlayerItemInHands )
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
789 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
790 if ( pParty->pPickedItem.uItemID == pValue )//In hand
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
791 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
792 pMouse->RemoveHoldingItem();
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
793 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
794 v4 = v124;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
795 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
796 }
2024
bb0da61e4a7e substract item and AddItem for Alexis fix
Ritor1
parents: 1980
diff changeset
797 //v67 = (int)pPlayers[uActiveCharacter]->pInventoryMatrix.data();
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
798 for ( v65 = 0; v65 < 126; ++v65 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
799 {
2025
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
800 v67 = &pPlayers[uActiveCharacter]->pInventoryMatrix[v65];
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
801 if ( v67 > 0 )
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
802 {
2025
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
803 if ( pPlayers[uActiveCharacter]->pInventoryItemList[v67 - 1].uItemID == pValue )
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
804 {
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
805 pPlayers[uActiveCharacter]->RemoveItemAtInventoryIndex(v65);
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
806 //++curr_seq_num;
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
807 //v4 = v124;
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
808 goto substract;
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
809 }
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
810 }
2024
bb0da61e4a7e substract item and AddItem for Alexis fix
Ritor1
parents: 1980
diff changeset
811 //v67 += 4;
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
812 }
2024
bb0da61e4a7e substract item and AddItem for Alexis fix
Ritor1
parents: 1980
diff changeset
813 //while ( (signed int)v65 < 126 );
2025
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
814 //v69 = (int)&pPlayers[uActiveCharacter]->pEquipment.pIndices;
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
815 for ( v68 = 0; v68 < 16; ++v68 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
816 {
2025
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
817 if ( pPlayers[uActiveCharacter]->pInventoryItemList[pPlayers[uActiveCharacter]->pEquipment.pIndices[v68]].uItemID == pValue )
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
818 {
2025
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
819 pPlayers[uActiveCharacter]->pEquipment.pIndices[v68] = 0;
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
820 //++curr_seq_num;
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
821 //v4 = v124;
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
822 goto substract;
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
823 }
2025
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
824 //v69 += 4;
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
825 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
826 for (int i = 1; i < 5; i++)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
827 {
2024
bb0da61e4a7e substract item and AddItem for Alexis fix
Ritor1
parents: 1980
diff changeset
828 //v72 = (int)pPlayers[i]->pInventoryMatrix.data();
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
829 for ( int v71 = 0; v71 < 126; ++v71 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
830 {
2025
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
831 v72 = &pPlayers[i]->pInventoryMatrix[v71];
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
832 if ( v72 > 0 )
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
833 {
2025
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
834 if ( pPlayers[i]->pInventoryItemList[v72 - 1].uItemID == pValue )
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
835 {
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
836 pPlayers[i]->RemoveItemAtInventoryIndex(v71);
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
837 goto substract;
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
838 }
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
839 }
2024
bb0da61e4a7e substract item and AddItem for Alexis fix
Ritor1
parents: 1980
diff changeset
840 //v72 += 4;
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
841 }
2025
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
842 for ( v73 = 0; v73 < 16; ++v73 )
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
843 {
2025
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
844 //v74 = (int)&pPlayers[i]->pEquipment;
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
845 if (pPlayers[i]->pEquipment.pIndices[v73])
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
846 {
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
847 if (pPlayers[i]->pInventoryItemList[pPlayers[i]->pEquipment.pIndices[v73] - 1].uItemID == pValue )
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
848 {
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
849 pPlayers[i]->pEquipment.pIndices[v73] = 0;
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
850 //v74 += 4;
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
851 goto substract;
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
852 }
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
853 }
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
854 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
855 }
2025
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
856 }*/
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
857 if ( player_choose <= 3 )
2025
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
858 pParty->pPlayers[player_choose].SubtractVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
859 else if ( player_choose == 4 ) //active
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
860 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
861 if ( uActiveCharacter )
2025
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
862 pPlayers[uActiveCharacter]->SubtractVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
863 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
864 else if ( player_choose == 5 )//all
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
865 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
866 for(int i = 1; i < 5; ++i)
1820
af7f08135ffb Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents: 1817
diff changeset
867 pPlayers[i]->SubtractVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
868 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
869 else if ( player_choose == 6 ) //random
2266
01489aec3cb0 EventProcessor cleared
Ritor1
parents: 2253
diff changeset
870 pParty->pPlayers[rand() % 4].SubtractVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
871 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
872 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
873 case EVENT_Set:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
874 pValue = EVT_DWORD(_evt->v7);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
875 if ( player_choose <= 3 )
2025
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
876 pParty->pPlayers[player_choose].SetVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
877 else if ( player_choose == 4 ) //active
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
878 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
879 if ( uActiveCharacter )
2025
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
880 pPlayers[uActiveCharacter]->SetVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
881 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
882 else if ( player_choose == 5 )//all
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
883 {
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
884 //recheck v130
2025
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
885 for ( int i = 1; i < 5; ++i )
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
886 pPlayers[i]->SetVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
887 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
888 else if ( player_choose == 6 ) //random
2266
01489aec3cb0 EventProcessor cleared
Ritor1
parents: 2253
diff changeset
889 pParty->pPlayers[rand() % 4].SetVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
2025
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
890 ++curr_seq_num;
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
891 break;
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
892 case EVENT_Add:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
893 pValue = EVT_DWORD(_evt->v7);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
894 if ( player_choose <= 3 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
895 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
896 pPlayer = &pParty->pPlayers[player_choose];
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
897 pPlayer->AddVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
898 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
899 else if ( player_choose == 4 ) //active
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
900 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
901 if ( uActiveCharacter )
2025
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
902 pPlayers[uActiveCharacter]->AddVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
903 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
904 else if ( player_choose == 5 )//all
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
905 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
906 for(int i = 1; i < 5; ++i)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
907 pPlayers[i]->AddVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
908 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
909 else if ( player_choose == 6 ) //random
2266
01489aec3cb0 EventProcessor cleared
Ritor1
parents: 2253
diff changeset
910 pParty->pPlayers[rand() % 4].AddVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
2025
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
911 v83 = EVT_WORD(_evt->v5);
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
912 if (v83 == 21 || // gold well on emerald isle
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
913 v83 == 22 || v83 == 23 || v83 == 24 )
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
914 {
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
915 //__debugbreak(); // bonfire
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
916 viewparams->bRedrawGameUI = true;
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
917 }
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
918 ++curr_seq_num;
4000f8184c29 EVENT_Substract fix
Ritor1
parents: 2024
diff changeset
919 break;
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
920 case EVENT_InputString:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
921 if ( !entry_line )
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
922 {
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
923 strcpy(GameUI_Footer_TimedString.data(), &pLevelStr[pLevelStrOffsets[EVT_DWORD(_evt->v5 )]]);
2266
01489aec3cb0 EventProcessor cleared
Ritor1
parents: 2253
diff changeset
924 sub_4451A8_press_any_key(uEventID, curr_seq_num, 26);
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
925 if ( v133 == 1 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
926 OnMapLeave();
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
927 return;
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
928 }
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
929 v84 = _evt->v13 + ((_evt->v14 + ((_evt->v15 + ((uint)_evt->v16 << 8)) << 8)) << 8);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
930 if ( !_stricmp(GameUI_Footer_TimedString.data(), &pLevelStr[pLevelStrOffsets[_evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8)]])
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
931 || !_stricmp(GameUI_Footer_TimedString.data(), &pLevelStr[pLevelStrOffsets[v84]]) )
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
932 {
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
933 v11 = _evt->v17;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
934 curr_seq_num = v11 - 1;
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
935 }
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
936 ++curr_seq_num;
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
937 v4 = -1;
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
938 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
939 case EVENT_RandomGoTo:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
940 //v124 = -1;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
941 v11 = (unsigned __int8)*(&_evt->v5 + rand() % ((_evt->v5 != 0) + (_evt->v6 != 0) + (_evt->v7 != 0) + (_evt->v8 != 0) + (_evt->v9 != 0)
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
942 + (_evt->v10 != 0)));
525
e7b3fa10d58d events cleanup
Gloval
parents: 520
diff changeset
943 curr_seq_num = v11 - 1;
787
3a77fbf7d0b8 GetSector
Ritor1
parents: 774
diff changeset
944 ++curr_seq_num;
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
945 v4 = -1;
787
3a77fbf7d0b8 GetSector
Ritor1
parents: 774
diff changeset
946 break;
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
947 case EVENT_ReceiveDamage:
2266
01489aec3cb0 EventProcessor cleared
Ritor1
parents: 2253
diff changeset
948 if ( (unsigned __int8)_evt->v5 <= 3 )
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
949 {
2266
01489aec3cb0 EventProcessor cleared
Ritor1
parents: 2253
diff changeset
950 pParty->pPlayers[(unsigned __int8)_evt->v5].ReceiveDamage(EVT_DWORD(_evt->v7 ), (DAMAGE_TYPE)_evt->v6);
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
951 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
952 break;
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
953 }
2266
01489aec3cb0 EventProcessor cleared
Ritor1
parents: 2253
diff changeset
954 if ( _evt->v5 == 4 )
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
955 {
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
956 if ( !uActiveCharacter )
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
957 {
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
958 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
959 break;
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
960 }
2266
01489aec3cb0 EventProcessor cleared
Ritor1
parents: 2253
diff changeset
961 pPlayers[uActiveCharacter]->ReceiveDamage(EVT_DWORD(_evt->v7 ), (DAMAGE_TYPE)_evt->v6);
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
962 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
963 break;
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
964 }
2266
01489aec3cb0 EventProcessor cleared
Ritor1
parents: 2253
diff changeset
965 if ( _evt->v5 != 5 )
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
966 {
2266
01489aec3cb0 EventProcessor cleared
Ritor1
parents: 2253
diff changeset
967 pParty->pPlayers[rand() % 4].ReceiveDamage(EVT_DWORD(_evt->v7 ), (DAMAGE_TYPE)_evt->v6);
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
968 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
969 break;
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
970 }
2266
01489aec3cb0 EventProcessor cleared
Ritor1
parents: 2253
diff changeset
971 for ( uint pl_id = 0;pl_id < 4; pl_id++ )
01489aec3cb0 EventProcessor cleared
Ritor1
parents: 2253
diff changeset
972 pParty->pPlayers[pl_id].ReceiveDamage(EVT_DWORD(_evt->v7 ), (DAMAGE_TYPE)_evt->v6);
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
973 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
974 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
975 case EVENT_ToggleIndoorLight:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
976 pIndoor->ToggleLight(EVT_DWORD(_evt->v5 ), _evt->v9);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
977 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
978 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
979 case EVENT_SetFacesBit:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
980 sub_44892E_set_faces_bit(EVT_DWORD(_evt->v5),EVT_DWORD(_evt->v9), _evt->v13);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
981 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
982 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
983 case EVENT_ToggleChestFlag:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
984 Chest::ToggleFlag(EVT_DWORD(_evt->v5 ), EVT_DWORD(_evt->v9 ), _evt->v13);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
985 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
986 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
987 case EVENT_ToggleActorFlag:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
988 Actor::ToggleFlag(EVT_DWORD(_evt->v5 ), EVT_DWORD(_evt->v9 ), _evt->v13);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
989 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
990 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
991 case EVENT_ToggleActorGroupFlag:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
992 ToggleActorGroupFlag(EVT_DWORD(_evt->v5 ), EVT_DWORD(_evt->v9 ), _evt->v13);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
993 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
994 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
995 case EVENT_SetSnow:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
996 if ( !_evt->v5 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
997 pWeather->bRenderSnow = _evt->v6 != 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
998 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
999 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1000 case EVENT_StatusText:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1001 v90 = EVT_DWORD(_evt->v5 );
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1002 if ( activeLevelDecoration )
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
1003 {
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1004 if ( activeLevelDecoration == (LevelDecoration*)1 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1005 current_npc_text = pNPCTopics[v90-1].pText;//(&dword_721664)[8 * v90];
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1006 if ( canShowMessages == 1 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1007 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1008 v91 = pNPCTopics[v90-1].pText;//(&dword_721664)[8 * v90];
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1009 //LABEL_248:
2266
01489aec3cb0 EventProcessor cleared
Ritor1
parents: 2253
diff changeset
1010 ShowStatusBarString(v91, 2);
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1011 }
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
1012 }
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1013 else
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
1014 {
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
1015 if ( canShowMessages == 1 )
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1016 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1017 v91 = &pLevelStr[pLevelStrOffsets[v90]];
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
1018 ShowStatusBarString(v91, 2);
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1019 }
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
1020 }
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1021 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1022 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1023 case EVENT_ShowMessage:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1024 if ( activeLevelDecoration )
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
1025 {
2266
01489aec3cb0 EventProcessor cleared
Ritor1
parents: 2253
diff changeset
1026 current_npc_text = pNPCTopics[EVT_DWORD(_evt->v5 )-1].pText;//(&dword_721664)[8 * v92];
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1027 byte_5B0938[0] = 0;
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
1028 }
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1029 else
2266
01489aec3cb0 EventProcessor cleared
Ritor1
parents: 2253
diff changeset
1030 strcpy(byte_5B0938.data(), &pLevelStr[pLevelStrOffsets[EVT_DWORD(_evt->v5 )]]);
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1031 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1032 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1033 case EVENT_CastSpell:
835
72f6df90df98 EventCastSpell
Ritor1
parents: 827
diff changeset
1034 EventCastSpell(_evt->v5, _evt->v6, _evt->v7, EVT_DWORD(_evt->v8 ),
525
e7b3fa10d58d events cleanup
Gloval
parents: 520
diff changeset
1035 EVT_DWORD(_evt->v12 ), EVT_DWORD(_evt->v16 ), EVT_DWORD(_evt->v20 ),
e7b3fa10d58d events cleanup
Gloval
parents: 520
diff changeset
1036 EVT_DWORD(_evt->v24 ), EVT_DWORD(_evt->v28 ));
835
72f6df90df98 EventCastSpell
Ritor1
parents: 827
diff changeset
1037 ++curr_seq_num;
72f6df90df98 EventCastSpell
Ritor1
parents: 827
diff changeset
1038 break;
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1039 case EVENT_SetTexture:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1040 sub_44861E_set_texture(EVT_DWORD(_evt->v5 ), (char *)&_evt->v9);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1041 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1042 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1043 case EVENT_SetSprite:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1044 SetDecorationSprite(EVT_DWORD(_evt->v5 ), _evt->v9, (char *)&_evt->v10);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1045 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1046 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1047 case EVENT_SummonMonsters:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1048 sub_448CF4_spawn_monsters(_evt->v5, _evt->v6, _evt->v7,EVT_DWORD(_evt->v8 ),
525
e7b3fa10d58d events cleanup
Gloval
parents: 520
diff changeset
1049 EVT_DWORD(_evt->v12 ), EVT_DWORD(_evt->v16 ), EVT_DWORD(_evt->v20 ),
e7b3fa10d58d events cleanup
Gloval
parents: 520
diff changeset
1050 EVT_DWORD(_evt->v24 ));
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1051 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1052 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1053 case EVENT_MouseOver:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1054 case EVENT_LocationName:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1055 --curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1056 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1057 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1058 case EVENT_ChangeDoorState:
2085
52abdea20b9e Door_switch_animation
Ritor1
parents: 2068
diff changeset
1059 Door_switch_animation(_evt->v5, _evt->v6);
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1060 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1061 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1062 case EVENT_OpenChest:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1063 if ( !Chest::Open(_evt->v5) )
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
1064 {
2266
01489aec3cb0 EventProcessor cleared
Ritor1
parents: 2253
diff changeset
1065 if ( v133 == 1 )
01489aec3cb0 EventProcessor cleared
Ritor1
parents: 2253
diff changeset
1066 OnMapLeave();
01489aec3cb0 EventProcessor cleared
Ritor1
parents: 2253
diff changeset
1067 return;
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
1068 }
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1069 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1070 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1071 case EVENT_MoveToMap:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1072 v94 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1073 v135 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1074 v132 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1075 v126 = _evt->v13 + ((_evt->v14 + ((_evt->v15 + ((uint)_evt->v16 << 8)) << 8)) << 8);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1076 v129 = _evt->v17 + ((_evt->v18 + ((_evt->v19 + ((uint)_evt->v20 << 8)) << 8)) << 8);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1077 v95 = _evt->v21 + ((_evt->v22 + ((_evt->v23 + ((uint)_evt->v24 << 8)) << 8)) << 8);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1078 v96 = _evt->v25;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1079 v97 = v96 + ((_evt->v26 + ((_evt->v27 + ((uint)_evt->v28 << 8)) << 8)) << 8);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1080 v134 = v96 + ((_evt->v26 + ((_evt->v27 + ((uint)_evt->v28 << 8)) << 8)) << 8);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1081 if ( _evt->v29 || _evt->v30 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1082 {
2153
d28d3c006077 Some Render decoupling.
Nomad
parents: 2145
diff changeset
1083 pRenderer->Sub01();
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1084 TransitionUI_Load(_evt->v29, _evt->v30, v135, v132, v126, v129, v95, v134, (char *)&_evt->v31);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1085 dword_5C3418 = uEventID;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1086 dword_5C341C = curr_seq_num + 1;
2266
01489aec3cb0 EventProcessor cleared
Ritor1
parents: 2253
diff changeset
1087 if ( v133 == 1 )
01489aec3cb0 EventProcessor cleared
Ritor1
parents: 2253
diff changeset
1088 OnMapLeave();
01489aec3cb0 EventProcessor cleared
Ritor1
parents: 2253
diff changeset
1089 return;
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1090 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1091 _5B65AC_npcdata_fame_or_other = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1092 _5B65A8_npcdata_uflags_or_other = v94;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1093 _5B65B0_npcdata_rep_or_other = v126;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1094 if ( v129 == -1 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1095 v98 = _5B65B4_npcdata_loword_house_or_other;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1096 else
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
1097 {
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1098 v98 = v129 & stru_5C6E00->uDoublePiMask;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1099 _5B65B4_npcdata_loword_house_or_other = v129 & stru_5C6E00->uDoublePiMask;
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
1100 }
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1101 v99 = (char *)&_evt->v31;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1102 _5B65B8_npcdata_hiword_house_or_other = v95;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1103 dword_5B65BC = v97;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1104 v100 = v94 | v132 | v126 | v95 | v97 | v98;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1105 dword_5B65C0 = v100;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1106 if ( *v99 == 48 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1107 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1108 if ( v100 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1109 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1110 pParty->vPosition.x = v135;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1111 pParty->vPosition.y = v132;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1112 pParty->vPosition.z = v126;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1113 pParty->uFallStartY = v126;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1114 if ( _5B65B4_npcdata_loword_house_or_other != -1 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1115 pParty->sRotationY = _5B65B4_npcdata_loword_house_or_other;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1116 _5B65B4_npcdata_loword_house_or_other = -1;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1117 pParty->sRotationX = v95;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1118 pParty->uFallSpeed = v134;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1119 dword_5B65C0 = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1120 dword_5B65BC = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1121 _5B65B8_npcdata_hiword_house_or_other = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1122 _5B65B0_npcdata_rep_or_other = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1123 _5B65AC_npcdata_fame_or_other = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1124 _5B65A8_npcdata_uflags_or_other = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1125 v106 = 232;
2266
01489aec3cb0 EventProcessor cleared
Ritor1
parents: 2253
diff changeset
1126 pAudioPlayer->PlaySound((SoundID)v106, 0, 0, -1, 0, 0, 0, 0);
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1127 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1128 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1129 else
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1130 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1131 pGameLoadingUI_ProgressBar->uType = (GUIProgressBar::Type)((activeLevelDecoration == NULL) + 1);
2101
ee2724b9ca05 RasterLine2D fix and etc.
Ritor1
parents: 2085
diff changeset
1132 Transition_StopSound_Autosave(v99, MapStartPoint_Party);
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1133 v133 = 1;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1134 if ( pCurrentScreen == SCREEN_HOUSE )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1135 {
2124
7f403ebf619f GAME_STATE_CHANGE_LOCATION
Ritor1
parents: 2101
diff changeset
1136 if ( uGameState == GAME_STATE_CHANGE_LOCATION )
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1137 {
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1138 pAudioPlayer->StopChannels(-1, -1);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1139 dialog_menu_id = HOUSE_DIALOGUE_NULL;
1919
140ca8123384 Tavern rest fix
Ritor1
parents: 1861
diff changeset
1140 while ( HouseDialogPressCloseBtn() )
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1141 ;
2450
90349b8048a5 remove VideoPlayer.cpp/.h
Ritor1
parents: 2431
diff changeset
1142 pMediaPlayer->Unload();
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1143 window_SpeakInHouse->Release();
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1144 window_SpeakInHouse = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1145 if ( pMessageQueue_50CBD0->uNumMessages )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1146 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1147 pCurrentScreen = SCREEN_GAME;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1148 viewparams->bRedrawGameUI = 1;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1149 pDialogueNPCCount = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1150 pDialogueWindow->Release();
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1151 dialog_menu_id = HOUSE_DIALOGUE_NULL;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1152 pDialogueWindow = 0;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1153 pIcons_LOD->SyncLoadedFilesCount();
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1154 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1155 OnMapLeave();
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1156 return;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1157 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1158 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1159 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1160 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1161 case EVENT_PlaySound:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1162 v110 = _evt->v13 + ((_evt->v14 + ((_evt->v15 + ((uint)_evt->v16 << 8)) << 8)) << 8);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1163 v109 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1164 v106 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
2266
01489aec3cb0 EventProcessor cleared
Ritor1
parents: 2253
diff changeset
1165 pAudioPlayer->PlaySound((SoundID)v106, 0, 0, v109, v110, 0, 0, 0);
01489aec3cb0 EventProcessor cleared
Ritor1
parents: 2253
diff changeset
1166 ++curr_seq_num;
01489aec3cb0 EventProcessor cleared
Ritor1
parents: 2253
diff changeset
1167 break;
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1168 case EVENT_GiveItem:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1169 item.Reset();
2266
01489aec3cb0 EventProcessor cleared
Ritor1
parents: 2253
diff changeset
1170 v102 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8);
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1171 pItemsTable->GenerateItem(_evt->v5, _evt->v6, &item);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1172 if ( v102 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1173 item.uItemID = v102;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1174 pParty->SetHoldingItem(&item);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1175 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1176 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1177 case EVENT_SpeakInHouse:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1178 if ( EnterHouse((enum HOUSE_ID)EVT_DWORD(_evt->v5)))
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1179 {
2153
d28d3c006077 Some Render decoupling.
Nomad
parents: 2145
diff changeset
1180 pRenderer->Sub01();
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1181 pAudioPlayer->PlaySound((SoundID)0, 0, 0, -1, 0, 0, 0, 0);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1182 pAudioPlayer->PlaySound(SOUND_EnteringAHouse, 814, 0, -1, 0, 0, 0, 0);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1183 v104 = 187;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1184 if ( uCurrentHouse_Animation != 167 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1185 v104 = EVT_DWORD(_evt->v5);
2215
e9625ad08541 fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents: 2153
diff changeset
1186 window_SpeakInHouse = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_HouseInterior, v104, 0);
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1187 window_SpeakInHouse->CreateButton( 61, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 1, '1', "", 0);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1188 window_SpeakInHouse->CreateButton(177, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 2, '2', "", 0);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1189 window_SpeakInHouse->CreateButton(292, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 3, '3', "", 0);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1190 window_SpeakInHouse->CreateButton(407, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 4, '4', "", 0);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1191 window_SpeakInHouse->CreateButton( 0, 0, 0, 0, 1, 0, UIMSG_CycleCharacters, 0, '\t', "", 0);
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1192 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1193 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1194 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1195 case EVENT_PressAnyKey:
2266
01489aec3cb0 EventProcessor cleared
Ritor1
parents: 2253
diff changeset
1196 sub_4451A8_press_any_key(uEventID, curr_seq_num + 1, 33);
01489aec3cb0 EventProcessor cleared
Ritor1
parents: 2253
diff changeset
1197 if ( v133 == 1 )
01489aec3cb0 EventProcessor cleared
Ritor1
parents: 2253
diff changeset
1198 OnMapLeave();
01489aec3cb0 EventProcessor cleared
Ritor1
parents: 2253
diff changeset
1199 return;
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1200 case EVENT_Exit:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1201 if ( v133 == 1 )
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1202 OnMapLeave();
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1203 return;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1204 default:
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1205 ++curr_seq_num;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1206 break;
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1207 }
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1208 }
2266
01489aec3cb0 EventProcessor cleared
Ritor1
parents: 2253
diff changeset
1209 }
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
1210 if ( v133 == 1 )
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
1211 OnMapLeave();
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
1212 return;
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1213 }
307
72faa54ff319 Events stuff moved to its file
Gloval
parents: 0
diff changeset
1214
1295
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1215 //----- (00444732) --------------------------------------------------------
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1216 char *GetEventHintString(unsigned int uEventID)
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1217 {
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1218 signed int event_index; // edx@1
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1219 int event_pos; // esi@4
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1220 char *result; // eax@6
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1221 unsigned int str_index; // eax@9
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1222 int i; // esi@11
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1223 _evt_raw* test_evt;
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1224 _evt_raw* last_evt;
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1225
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1226 event_index = 0;
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1227 if ( uLevelEVT_NumEvents <= 0 )
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1228 return NULL;
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1229
1295
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1230 //v2 = (char *)&pLevelEVT_Index[0].uEventOffsetInEVT;
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1231 while ( 1 )
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1232 {
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1233 if ( pLevelEVT_Index[event_index].uEventID == uEventID )
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1234 {
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
1235 test_evt=(_evt_raw*)&pLevelEVT[pLevelEVT_Index[event_index].uEventOffsetInEVT];
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
1236 last_evt=test_evt;
1295
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1237 event_pos = pLevelEVT_Index[event_index+1].uEventOffsetInEVT;
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1238 if ( test_evt->_e_type == EVENT_MouseOver )
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1239 break;
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1240 }
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1241 ++event_index;
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1242 if ( event_index >= uLevelEVT_NumEvents )
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1243 return NULL;
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1244 }
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
1245 test_evt=(_evt_raw*)&pLevelEVT[event_pos];
1295
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1246 if ( test_evt->_e_type== EVENT_SpeakInHouse )
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1247 {
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1248 str_index = EVT_DWORD(test_evt->v5);
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1249 result = (char *)p2DEvents[str_index - 1].pName;
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1250 }
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1251 else
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1252 {
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
1253 for ( i = event_index + 1; pLevelEVT_Index[i].uEventID == uEventID; ++i )
1295
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1254 {
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1255 event_pos = pLevelEVT_Index[i].uEventOffsetInEVT;
2268
fd788d2e9585 EventProcessor cleaned and ODM_NearClip fix
Ritor1
parents: 2266
diff changeset
1256 test_evt=(_evt_raw*)&pLevelEVT[event_pos];
1295
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1257 if ( test_evt->_e_type == EVENT_SpeakInHouse )
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1258 {
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1259 str_index = EVT_DWORD(test_evt->v5);
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1260 if ( str_index < 600 )
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1261 return (char *)p2DEvents[str_index - 1].pName;
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1262 }
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1263 }
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1264 result = &pLevelStr[pLevelStrOffsets[EVT_BYTE(last_evt->v5)]];
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1265 }
1490
db0dfdb9871e Fix indentation.
yoctozepto
parents: 1489
diff changeset
1266
1295
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1267 return result;
86a83e12d795 moving files
Ritor1
parents: 1292
diff changeset
1268 }
2463
0f17a30149ec cleaning project part 1
zipi
parents: 2455
diff changeset
1269
2464
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1270 //----- (004613C4) --------------------------------------------------------
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1271 void init_event_triggers()
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1272 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1273 uint id = pDecorationList->GetDecorIdByName("Event Trigger");
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1274
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1275 num_event_triggers = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1276 for (uint i = 0; i < uNumLevelDecorations; ++i)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1277 if (pLevelDecorations[i].uDecorationDescID == id)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1278 event_triggers[num_event_triggers++] = i;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1279 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1280
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1281 //----- (0046CC4B) --------------------------------------------------------
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1282 void check_event_triggers()
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1283 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1284 for (size_t i = 0; i < num_event_triggers; i++)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1285 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1286 if (pLevelDecorations[event_triggers[i]].uFlags & LEVEL_DECORATION_TRIGGERED_BY_TOUCH
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1287 && pLevelDecorations[event_triggers[i]].vPosition.GetDistanceTo(pParty->vPosition) < pLevelDecorations[event_triggers[i]].uTriggerRange)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1288 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1289 EventProcessor(pLevelDecorations[event_triggers[i]].uEventID, PID(OBJECT_Decoration, i), 1);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1290 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1291 else if (pLevelDecorations[event_triggers[i]].uFlags & LEVEL_DECORATION_TRIGGERED_BY_MONSTER)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1292 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1293 for (size_t j = 0; j < uNumActors; j++)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1294 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1295 if (pLevelDecorations[event_triggers[i]].vPosition.GetDistanceTo(pActors[j].vPosition) < pLevelDecorations[event_triggers[i]].uTriggerRange)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1296 EventProcessor(pLevelDecorations[event_triggers[i]].uEventID, 0, 1);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1297 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1298 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1299 else if (pLevelDecorations[event_triggers[i]].uFlags & LEVEL_DECORATION_TRIGGERED_BY_OBJECT)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1300 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1301 for (size_t j = 0; j < uNumSpriteObjects; j++)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1302 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1303 if (pLevelDecorations[event_triggers[i]].vPosition.GetDistanceTo(pSpriteObjects[j].vPosition) < pLevelDecorations[event_triggers[i]].uTriggerRange)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1304 EventProcessor(pLevelDecorations[event_triggers[i]].uEventID, 0, 1);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1305 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1306 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1307 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1308 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1309 // 6836C8: using guessed type int 6836C8_num_decorations_6807E8;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1310
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1311 //----- (004465DF) --------------------------------------------------------
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1312 bool sub_4465DF_check_season(int a1)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1313 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1314 unsigned int monthPlusOne; // eax@1
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1315 unsigned int daysPlusOne; // edx@1
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1316
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1317 monthPlusOne = pParty->uCurrentMonth + 1;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1318 daysPlusOne = pParty->uDaysPlayed + 1;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1319
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1320 switch (a1)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1321 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1322 case 3: //winter 12.21 -> 3.20
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1323 return (monthPlusOne == 12 && daysPlusOne >= 21 || monthPlusOne == 1 || monthPlusOne == 2 || monthPlusOne == 3 && daysPlusOne <= 20);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1324 break;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1325 case 2:// autumn/fall 9.21 -> 12.20
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1326 return (monthPlusOne == 9 && daysPlusOne >= 21 || monthPlusOne == 10 || monthPlusOne == 11 || monthPlusOne == 12 && daysPlusOne <= 20);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1327 break;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1328 case 1://summer 6.21 -> 9.20
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1329 return (monthPlusOne == 6 && daysPlusOne >= 21 || monthPlusOne == 7 || monthPlusOne == 8 || monthPlusOne == 9 && daysPlusOne <= 20);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1330 break;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1331 case 0: //spring 3.21 -> 6.20
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1332 return (monthPlusOne == 3 && daysPlusOne >= 21 || monthPlusOne == 4 || monthPlusOne == 5 || monthPlusOne == 6 && daysPlusOne <= 20);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1333 break;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1334 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1335 Error("Unknown season");
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1336 return false;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1337 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1338
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1339 //----- (00448CF4) --------------------------------------------------------
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1340 void __fastcall sub_448CF4_spawn_monsters(__int16 typeindex, __int16 level, int count, int x, int y, int z, int group, unsigned int uUniqueName)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1341 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1342 unsigned int map_id; // eax@1
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1343 size_t old_num_actors; // ebx@2
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1344 AIDirection v15; // [sp+28h] [bp-34h]@2
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1345 SpawnPointMM7 pSpawnPoint; // [sp+44h] [bp-18h]@1
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1346
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1347 pSpawnPoint.vPosition.x = x;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1348 pSpawnPoint.vPosition.y = y;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1349 pSpawnPoint.vPosition.z = z;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1350 pSpawnPoint.uGroup = group;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1351 pSpawnPoint.uRadius = 32;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1352 pSpawnPoint.uKind = 3;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1353 pSpawnPoint.uIndex = typeindex + 2 * level + level;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1354 map_id = pMapStats->GetMapInfo(pCurrentMapName);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1355 if (map_id)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1356 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1357 old_num_actors = uNumActors;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1358 SpawnEncounter(&pMapStats->pInfos[map_id], &pSpawnPoint, 0, count, 0);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1359 Actor::GetDirectionInfo(PID(OBJECT_Actor, old_num_actors), 4, &v15, 1);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1360 for (uint i = (unsigned int)old_num_actors; i < (unsigned int)uNumActors; ++i)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1361 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1362 pActors[i].PrepareSprites(0);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1363 pActors[i].uYawAngle = v15.uYawAngle;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1364 pActors[i].dword_000334_unique_name = uUniqueName;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1365 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1366 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
1367 }