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