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