2499
|
1 #define _CRTDBG_MAP_ALLOC
|
|
2 #include <stdlib.h>
|
|
3 #include <crtdbg.h>
|
|
4
|
|
5 #define _CRT_SECURE_NO_WARNINGS
|
|
6
|
2541
|
7 #include "Engine/Engine.h"
|
2499
|
8
|
2501
|
9 #include "Graphics/Weather.h"
|
|
10 #include "Graphics/Texture.h"
|
2502
|
11 #include "Media/MediaPlayer.h"
|
|
12 #include "IO/Mouse.h"
|
2499
|
13
|
|
14 #include "MapInfo.h"
|
2501
|
15 #include "Graphics/Render.h"
|
2502
|
16 #include "GUI/GUIWindow.h"
|
|
17 #include "GUI/GUIProgressBar.h"
|
2501
|
18 #include "Objects/SpriteObject.h"
|
|
19 #include "Objects/Chest.h"
|
2499
|
20 #include "MapsLongTimer.h"
|
|
21 #include "LOD.h"
|
2501
|
22 #include "Objects/Actor.h"
|
2499
|
23 #include "Party.h"
|
|
24 #include "OurMath.h"
|
2502
|
25 #include "Media/Audio/AudioPlayer.h"
|
2501
|
26 #include "Graphics/Indoor.h"
|
|
27 #include "Graphics/Viewport.h"
|
2499
|
28 #include "texts.h"
|
|
29 #include "stru123.h"
|
|
30 #include "stru159.h"
|
|
31 #include "Events.h"
|
|
32 #include "Events2D.h"
|
2501
|
33 #include "..\GUI\UI\UIHouses.h"
|
|
34 #include "Graphics/Level/Decoration.h"
|
2499
|
35 #include "LuaVM.h"
|
2501
|
36 #include "Graphics/DecorationList.h"
|
2499
|
37
|
|
38
|
|
39 std::array<EventIndex, 4400> pSomeOtherEVT_Events;
|
|
40 signed int uSomeOtherEVT_NumEvents;
|
|
41 char *pSomeOtherEVT;
|
|
42 std::array<EventIndex, 4400> pSomeEVT_Events;
|
|
43 signed int uSomeEVT_NumEvents;
|
|
44 char *pSomeEVT;
|
|
45
|
|
46 unsigned int uGlobalEVT_NumEvents;
|
|
47 unsigned int uGlobalEVT_Size;
|
|
48 std::array<char, 46080> pGlobalEVT;
|
|
49 std::array<EventIndex, 4400> pGlobalEVT_Index;
|
|
50
|
|
51 std::array<unsigned int, 500> pLevelStrOffsets;
|
|
52 unsigned int uLevelStrNumStrings;
|
|
53 unsigned int uLevelStrFileSize;
|
|
54 signed int uLevelEVT_NumEvents;
|
|
55 unsigned int uLevelEVT_Size;
|
|
56 std::array<char, 9216> pLevelStr;
|
|
57 std::array<char, 9216> pLevelEVT;
|
|
58 std::array<EventIndex, 4400> pLevelEVT_Index;
|
|
59
|
|
60 _2devent p2DEvents[525];
|
|
61
|
|
62
|
|
63
|
|
64 //----- (00443CE1) --------------------------------------------------------
|
|
65 unsigned int LoadEventsToBuffer(const char *pContainerName, char *pBuffer, unsigned int uBufferSize)
|
|
66 {
|
|
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 Error("Unable to load %s", pContainerName);
|
|
77
|
|
78 fread(&DstBuf, 1, 48, pLodFile);
|
|
79 uTextureSize = DstBuf.uDecompressedSize;
|
|
80 if ( !DstBuf.uDecompressedSize )
|
|
81 uTextureSize = DstBuf.uTextureSize;
|
|
82 memset(&DstBuf, 0, 72);
|
|
83 if ( uTextureSize >= (signed int)uBufferSize )
|
|
84 Error("File %s Size %lu - Buffer size %lu", pContainerName, uTextureSize, uBufferSize);
|
|
85
|
|
86 memcpy(pBuffer, ptr, uTextureSize);
|
|
87 free(ptr);
|
|
88 return uTextureSize;
|
|
89 }
|
|
90
|
|
91 //----- (00443DA1) --------------------------------------------------------
|
|
92 void Initialize_GlobalEVT()
|
|
93 {
|
|
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.data(), 46080);
|
|
106 if ( !uGlobalEVT_Size )
|
|
107 return;
|
|
108 memset(pGlobalEVT_Index.data(), 0x80, sizeof(pGlobalEVT_Index));//52800
|
|
109 events_count = uGlobalEVT_NumEvents;
|
|
110 current_hdr=(raw_event_header *)pGlobalEVT.data();
|
|
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;
|
|
118
|
|
119 current_hdr=(raw_event_header *)&pGlobalEVT[offset_in];
|
|
120 }
|
|
121 uGlobalEVT_NumEvents = events_count;
|
|
122
|
|
123 assert(uGlobalEVT_NumEvents < 4400);
|
|
124 }
|
|
125
|
|
126
|
|
127
|
|
128 //----- (00443EF8) --------------------------------------------------------
|
|
129 void LoadLevel_InitializeLevelEvt()
|
|
130 {
|
|
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
|
|
142 if (!uLevelEVT_Size)
|
|
143 return;
|
|
144
|
|
145 memset(MapsLongTimersList, 0, 3200);
|
|
146 memset(pLevelEVT_Index.data(), 80, sizeof(EventIndex)*4400);
|
|
147
|
|
148 uLevelEVT_NumEvents = 0;
|
|
149 MapsLongTimers_count = 0;
|
|
150
|
|
151 current_hdr=(raw_event_header *)pLevelEVT.data();
|
|
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;
|
|
159
|
|
160 current_hdr=(raw_event_header *)&pLevelEVT[offset_in];
|
|
161 }
|
|
162 uLevelEVT_NumEvents = events_count;
|
|
163
|
|
164 /*
|
|
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
|
|
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
|
|
187 Emerald Isle #111 // ???
|
|
188 Initialize
|
|
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 {
|
|
225 1 if (Map.Variables[3] == 0)
|
|
226 {
|
|
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
|
|
255 0 Initialize
|
|
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 */
|
|
279 }
|
|
280
|
|
281
|
|
282 //----- (0044684A) --------------------------------------------------------
|
|
283 void EventProcessor(int uEventID, int targetObj, int canShowMessages, int entry_line)
|
|
284 {
|
|
285 signed int v4; // esi@7
|
|
286 int v11; // eax@14
|
|
287 char *v12; // eax@15
|
|
288 const char *v16; // esi@21
|
|
289 bool v17; // edx@21
|
|
290 int v18; // ecx@22
|
|
291 int v19; // ebp@36
|
|
292 signed int v20; // ecx@40
|
|
293 int v21; // eax@40
|
|
294 int v22; // edx@40
|
|
295 int v23; // eax@40
|
|
296 unsigned __int16 v24; // ax@45
|
|
297 LevelDecoration *v26; // eax@55
|
|
298 int v27; // eax@57
|
|
299 int pEventID; // eax@58
|
|
300 int pNPC_ID; // ecx@58
|
|
301 int pIndex; // esi@58
|
|
302 NPCData *pNPC; // ecx@58
|
|
303 int v38; // eax@78
|
|
304 int v39; // ecx@78
|
|
305 int v42; // eax@84
|
|
306 int v43; // ecx@84
|
|
307 GUIButton *v48; // ecx@93
|
|
308 GUIButton *v49; // esi@94
|
|
309 signed int pValue; // ebp@124
|
|
310 Player *pPlayer; // esi@125
|
|
311 int v83; // eax@212
|
|
312 int v84; // ebp@220
|
|
313 int v90; // eax@243
|
|
314 const char *v91; // ecx@247
|
|
315 int v94; // ecx@262
|
|
316 int v95; // ebp@262
|
|
317 int v96; // edx@262
|
|
318 int v97; // eax@262
|
|
319 unsigned int v98; // edx@265
|
|
320 const char *v99; // esi@267
|
|
321 int v100; // edx@267
|
|
322 unsigned int v102; // esi@281
|
|
323 int v104; // eax@288
|
|
324 int v106; // [sp-20h] [bp-4C8h]@278
|
|
325 signed int v109; // [sp-14h] [bp-4BCh]@278
|
|
326 signed int v110; // [sp-10h] [bp-4B8h]@278
|
|
327 int curr_seq_num; // [sp+10h] [bp-498h]@4
|
|
328 int v126; // [sp+1Ch] [bp-48Ch]@262
|
|
329 int player_choose; // [sp+20h] [bp-488h]@4
|
|
330 int v128; // [sp+24h] [bp-484h]@21
|
|
331 int v129; // [sp+24h] [bp-484h]@262
|
|
332 signed int v130; // [sp+28h] [bp-480h]@0
|
|
333 int v132; // [sp+30h] [bp-478h]@262
|
|
334 signed int v133; // [sp+34h] [bp-474h]@1
|
|
335 int v134; // [sp+38h] [bp-470h]@262
|
|
336 int v135; // [sp+3Ch] [bp-46Ch]@262
|
|
337 int v136; // [sp+40h] [bp-468h]@40
|
|
338 int v137; // [sp+44h] [bp-464h]@40
|
|
339 int v138; // [sp+48h] [bp-460h]@40
|
|
340 int v139; // [sp+4Ch] [bp-45Ch]@40
|
|
341 ItemGen item; // [sp+50h] [bp-458h]@15
|
|
342 char Source[120]; // [sp+74h] [bp-434h]@15
|
|
343 char Str[120]; // [sp+ECh] [bp-3BCh]@21
|
|
344 Actor Dst; // [sp+164h] [bp-344h]@53
|
|
345
|
|
346 v133 = 0;
|
|
347 EvtTargetObj = targetObj;
|
|
348 dword_5B65C4_cancelEventProcessing = 0;
|
|
349 if ( uEventID == 114 )//for test script
|
|
350 {
|
|
351 if (!lua->DoFile("out01.lua"))
|
|
352 Log::Warning(L"Error opening out01.lua\n");
|
|
353 Log::Warning(L"being tested that well\n");
|
|
354 return;
|
|
355 }
|
|
356 if ( !uEventID )
|
|
357 {
|
|
358 if ( !GameUI_Footer_TimeLeft )
|
|
359 ShowStatusBarString(pGlobalTXT_LocalizationStrings[521], 2u);// Nothing here
|
|
360 return;
|
|
361 }
|
|
362 player_choose = (uActiveCharacter == 0)?6:4; //4 - active or 6 - random player if active =0
|
|
363 curr_seq_num = entry_line;
|
|
364
|
|
365 if ( activeLevelDecoration )
|
|
366 {
|
|
367 uSomeEVT_NumEvents = uGlobalEVT_NumEvents;
|
|
368 pSomeEVT = pGlobalEVT.data();
|
|
369 memcpy(pSomeEVT_Events.data(), pGlobalEVT_Index.data(), sizeof(EventIndex)*4400); //4400 evts
|
|
370 }
|
|
371 else
|
|
372 {
|
|
373 uSomeEVT_NumEvents = uLevelEVT_NumEvents;
|
|
374 pSomeEVT = pLevelEVT.data();
|
|
375 memcpy(pSomeEVT_Events.data(), pLevelEVT_Index.data(), sizeof(EventIndex)*4400);
|
|
376 }
|
|
377
|
|
378 for ( v4 = 0; v4 < uSomeEVT_NumEvents; ++v4 )
|
|
379 {
|
|
380 if ( dword_5B65C4_cancelEventProcessing )
|
|
381 {
|
|
382 if ( v133 == 1 )
|
|
383 OnMapLeave();
|
|
384 return;
|
|
385 }
|
|
386 if ( pSomeEVT_Events[v4].uEventID == uEventID && pSomeEVT_Events[v4].event_sequence_num == curr_seq_num )
|
|
387 {
|
|
388 _evt_raw * _evt = (_evt_raw *)(pSomeEVT + pSomeEVT_Events[v4].uEventOffsetInEVT);
|
|
389
|
|
390 switch (_evt->_e_type)
|
|
391 {
|
|
392 case EVENT_CheckSeason:
|
|
393 if ( !sub_4465DF_check_season(_evt->v5) )
|
|
394 {
|
|
395 ++curr_seq_num;
|
|
396 //v4 = v124;
|
|
397 break;
|
|
398 }
|
|
399 v4 = -1;
|
|
400 curr_seq_num = _evt->v6 - 1;
|
|
401 ++curr_seq_num;
|
|
402 break;
|
|
403 case EVENT_ShowMovie:
|
|
404 {
|
|
405 strcpy(Source, (char *)&_evt->v7);
|
|
406 v12 = (char *)&item.uExpireTime + strlen(Source) + 7;
|
|
407 if ( *v12 == 32 )
|
|
408 *v12 = 0;
|
|
409 if (pMediaPlayer->bPlaying_Movie)
|
|
410 pMediaPlayer->Unload();
|
|
411 pMediaPlayer->bStopBeforeSchedule = 0;
|
|
412 // pMediaPlayer->pResetflag = 0;
|
|
413
|
2541
|
414 v128 = current_screen_type;
|
2499
|
415 strcpy(Str, Source);
|
|
416 v16 = RemoveQuotes(Str);
|
|
417 pMediaPlayer->FullscreenMovieLoop(v16, 0/*, _evt->v5*/);
|
|
418 if ( !_stricmp(v16, "arbiter good") )
|
|
419 {
|
|
420 pParty->alignment = PartyAlignment_Good;
|
|
421 v18 = 0;
|
|
422 LOBYTE(v17) = 1;
|
|
423 SetUserInterface(PartyAlignment_Good, v17);
|
2541
|
424 if (!_evt->v6 || v128 == SCREEN_BOOKS)
|
2499
|
425 {
|
2541
|
426 current_screen_type = (CURRENT_SCREEN)v128;
|
|
427 if (v128 == SCREEN_BOOKS)
|
|
428 pGameLoadingUI_ProgressBar->uType = GUIProgressBar::TYPE_Fullscreen;
|
|
429 if (v128 == SCREEN_HOUSE)
|
|
430 pMediaPlayer->OpenHouseMovie(pAnimatedRooms[uCurrentHouse_Animation].video_name, 1);
|
2499
|
431 }
|
|
432 ++curr_seq_num;
|
|
433 break;
|
|
434 }
|
|
435 if ( !_stricmp(v16, "arbiter evil") )
|
|
436 {
|
|
437 v18 = 2;
|
|
438 pParty->alignment = PartyAlignment_Evil;
|
|
439 LOBYTE(v17) = 1;
|
|
440 SetUserInterface(PartyAlignment_Evil, v17);
|
2541
|
441 if (!_evt->v6 || v128 == SCREEN_BOOKS)
|
2499
|
442 {
|
2541
|
443 current_screen_type = (CURRENT_SCREEN)v128;
|
|
444 if (v128 == SCREEN_BOOKS)
|
|
445 pGameLoadingUI_ProgressBar->uType = GUIProgressBar::TYPE_Fullscreen;
|
|
446 if (v128 == SCREEN_HOUSE)
|
|
447 pMediaPlayer->OpenHouseMovie(pAnimatedRooms[uCurrentHouse_Animation].video_name, 1);
|
2499
|
448 }
|
|
449 ++curr_seq_num;
|
|
450 break;
|
|
451 }
|
|
452 if ( !_stricmp(v16, "pcout01") ) // moving to harmondale from emerald isle
|
|
453 {
|
|
454 Rest(0x2760u);
|
|
455 pParty->RestAndHeal();
|
|
456 pParty->days_played_without_rest = 0;
|
|
457 }
|
2541
|
458 if (!_evt->v6 || v128 == SCREEN_BOOKS)
|
2499
|
459 {
|
2541
|
460 current_screen_type = (CURRENT_SCREEN)v128;
|
|
461 if (v128 == SCREEN_BOOKS)
|
|
462 pGameLoadingUI_ProgressBar->uType = GUIProgressBar::TYPE_Fullscreen;
|
|
463 if (v128 == SCREEN_HOUSE)
|
|
464 pMediaPlayer->OpenHouseMovie(pAnimatedRooms[uCurrentHouse_Animation].video_name, 1);
|
2499
|
465 }
|
|
466 ++curr_seq_num;
|
|
467 }
|
|
468 break;
|
|
469 case EVENT_CheckSkill:
|
|
470 {
|
|
471 v19 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((unsigned int)_evt->v10 << 8)) << 8)) << 8);
|
|
472 if ( player_choose < 0 )
|
|
473 goto LABEL_47;
|
|
474 if ( player_choose <= 3 )
|
|
475 v24 = pParty->pPlayers[0].pActiveSkills[3486 * player_choose + _evt->v5];
|
|
476 else
|
|
477 {
|
|
478 if ( player_choose == 4 )
|
|
479 v24 = pPlayers[uActiveCharacter]->pActiveSkills[_evt->v5];
|
|
480 else
|
|
481 {
|
|
482 if ( player_choose == 5 )
|
|
483 {
|
|
484 v20 = 0;
|
|
485 v21 = 3486 * v130 + _evt->v5;
|
|
486 v136 = 1;
|
|
487 LOWORD(v21) = pParty->pPlayers[0].pActiveSkills[v21];
|
|
488 v137 = v21 & 0x40;
|
|
489 v138 = v21 & 0x80;
|
|
490 v22 = v21 & 0x100;
|
|
491 v23 = v21 & 0x3F;
|
|
492 v139 = v22;
|
|
493 while ( v23 < v19 || !*(&v136 + _evt->v6) )
|
|
494 {
|
|
495 ++v20;
|
|
496 if ( v20 >= 4 )
|
|
497 {
|
|
498 ++curr_seq_num;
|
|
499 break;
|
|
500 }
|
|
501 }
|
|
502 curr_seq_num = _evt->v11 - 1;
|
|
503 ++curr_seq_num;
|
|
504 break;
|
|
505 }
|
|
506 LABEL_47:
|
|
507 //v10 = (ByteArray *)&v5[v9];
|
|
508 v24 = pParty->pPlayers[0].pActiveSkills[_evt->v5 + 3486 * rand() % 4];
|
|
509 }
|
|
510 }
|
|
511 v136 = 1;
|
|
512 v137 = v24 & 0x40;
|
|
513 v138 = v24 & 0x80;
|
|
514 v139 = v24 & 0x100;
|
|
515 if ( (v24 & 0x3F) >= v19 && *(&v136 + _evt->v6) )
|
|
516 {
|
|
517 curr_seq_num = _evt->v11 - 1;
|
|
518 ++curr_seq_num;
|
|
519 break;
|
|
520 }
|
|
521 ++curr_seq_num;
|
|
522 }
|
|
523 break;
|
|
524
|
|
525 case EVENT_SpeakNPC:
|
|
526 if ( canShowMessages )
|
|
527 {
|
|
528 //Actor::Actor(&Dst);
|
|
529 memset(&Dst, 0, 0x344u);
|
|
530 dword_5B65D0_dialogue_actor_npc_id = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((unsigned int)_evt->v8 << 8)) << 8)) << 8);
|
|
531 Dst.sNPC_ID = dword_5B65D0_dialogue_actor_npc_id;
|
|
532 GameUI_InitializeDialogue(&Dst, false);
|
|
533 }
|
|
534 else
|
|
535 bDialogueUI_InitializeActor_NPC_ID = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((unsigned int)_evt->v8 << 8)) << 8)) << 8);
|
|
536 ++curr_seq_num;
|
|
537 break;
|
|
538 case EVENT_ChangeEvent:
|
|
539 if ( EVT_DWORD(_evt->v5) )
|
|
540 stru_5E4C90_MapPersistVars._decor_events[activeLevelDecoration->_idx_in_stru123] = _evt->v5 - 124;
|
|
541 else
|
|
542 {
|
|
543 v26 = (LevelDecoration *)activeLevelDecoration;
|
|
544 stru_5E4C90_MapPersistVars._decor_events[activeLevelDecoration ->_idx_in_stru123] = 0;
|
|
545 v26->uFlags |= LEVEL_DECORATION_INVISIBLE;
|
|
546 }
|
|
547 ++curr_seq_num;
|
|
548
|
|
549 break;
|
|
550 case EVENT_SetNPCGreeting:
|
|
551 v27 = EVT_DWORD(_evt->v5);
|
|
552 pNPCStats->pNewNPCData[v27].uFlags &= 0xFFFFFFFCu;
|
|
553 pNPCStats->pNewNPCData[v27].greet = EVT_DWORD(_evt->v9);
|
|
554 ++curr_seq_num;
|
|
555 break;
|
|
556 case EVENT_SetNPCTopic:
|
|
557 {
|
|
558 //v29 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
|
|
559 pEventID = _evt->v10 + ((_evt->v11 + ((_evt->v12 + ((uint)_evt->v13 << 8)) << 8)) << 8);
|
|
560 pNPC_ID = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
|
|
561 pIndex = _evt->v9;
|
|
562 pNPC = &pNPCStats->pNewNPCData[pNPC_ID];
|
|
563 if ( pIndex == 0 )
|
|
564 pNPC->evt_A = pEventID;
|
|
565 if ( pIndex == 1 )
|
|
566 pNPC->evt_B = pEventID;
|
|
567 if ( pIndex == 2 )
|
|
568 pNPC->evt_C = pEventID;
|
|
569 if ( pIndex == 3 )
|
|
570 pNPC->evt_D = pEventID;
|
|
571 if ( pIndex == 4 )
|
|
572 pNPC->evt_E = pEventID;
|
|
573 if ( pIndex == 5 )
|
|
574 pNPC->evt_F = pEventID;
|
|
575 if ( pNPC_ID == 8 )
|
|
576 {
|
|
577 if ( pEventID == 78 )
|
|
578 {
|
|
579 HouseDialogPressCloseBtn();
|
|
580 window_SpeakInHouse->Release();
|
|
581 pParty->uFlags &= ~2;
|
|
582 if ( EnterHouse(HOUSE_DARK_GUILD_PIT) )
|
|
583 {
|
|
584 pAudioPlayer->StopChannels(-1, -1);
|
|
585 window_SpeakInHouse = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_HouseInterior, 170, 0);
|
|
586 window_SpeakInHouse->CreateButton( 61, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 1, '1', "", 0);
|
|
587 window_SpeakInHouse->CreateButton(177, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 2, '2', "", 0);
|
|
588 window_SpeakInHouse->CreateButton(292, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 3, '3', "", 0);
|
|
589 window_SpeakInHouse->CreateButton(407, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 4, '4', "", 0);
|
|
590 window_SpeakInHouse->CreateButton( 0, 0, 0, 0, 1, 0, UIMSG_CycleCharacters, 0, '\t', "", 0);
|
|
591 current_npc_text = pNPCTopics[90].pText;
|
|
592 }
|
|
593 }
|
|
594 }
|
|
595 ++curr_seq_num;
|
|
596 }
|
|
597 break;
|
|
598 case EVENT_NPCSetItem:
|
|
599 sub_448518_npc_set_item(EVT_DWORD(_evt->v5),EVT_DWORD(_evt->v9), _evt->v13);
|
|
600 ++curr_seq_num;
|
|
601 break;
|
|
602 case EVENT_SetActorItem:
|
|
603 Actor::GiveItem(EVT_DWORD(_evt->v5),EVT_DWORD(_evt->v9), _evt->v13);
|
|
604 ++curr_seq_num;
|
|
605 break;
|
|
606 case EVENT_SetNPCGroupNews:
|
|
607 pNPCStats->pGroups_copy[_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8)] = _evt->v9 + ((uint)_evt->v10 << 8);
|
|
608 ++curr_seq_num;
|
|
609 break;
|
|
610 case EVENT_SetActorGroup:
|
|
611 __debugbreak();
|
|
612 *(&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);
|
|
613 ++curr_seq_num;
|
|
614 break;
|
|
615 case EVENT_ChangeGroup:
|
|
616 v38 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
|
|
617 v39 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
|
|
618 __debugbreak();
|
|
619 for ( uint actor_id = 0; actor_id < uNumActors; actor_id++ )
|
|
620 {
|
|
621 if ( pActors[actor_id].uGroup == v38 )
|
|
622 pActors[actor_id].uGroup = v39;
|
|
623 }
|
|
624 ++curr_seq_num;
|
|
625 break;
|
|
626 case EVENT_ChangeGroupAlly:
|
|
627 v42 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
|
|
628 v43 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
|
|
629 __debugbreak();
|
|
630 for ( uint actor_id = 0; actor_id < uNumActors; actor_id++ )
|
|
631 {
|
|
632 if ( pActors[actor_id].uGroup == v42 )
|
|
633 pActors[actor_id].uAlly = v43;
|
|
634 }
|
|
635 ++curr_seq_num;
|
|
636 break;
|
|
637 case EVENT_MoveNPC:
|
|
638 {
|
|
639 pNPCStats->pNewNPCData[EVT_DWORD(_evt->v5)].Location2D =EVT_DWORD(_evt->v9);
|
|
640 if ( window_SpeakInHouse )
|
|
641 {
|
|
642
|
|
643 if ( window_SpeakInHouse->par1C == 165 )
|
|
644 {
|
|
645 HouseDialogPressCloseBtn();
|
|
646 pMediaPlayer->Unload();
|
|
647 window_SpeakInHouse->Release();
|
|
648 pParty->uFlags &= ~2;
|
|
649 activeLevelDecoration = (LevelDecoration*)1;
|
|
650 if ( EnterHouse(HOUSE_BODY_GUILD_ERATHIA) )
|
|
651 {
|
2506
|
652 pAudioPlayer->PlaySound(SOUND_Invalid, 0, 0, -1, 0, 0, 0, 0);
|
2499
|
653 window_SpeakInHouse = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_HouseInterior, 165, 0);
|
|
654 v48 = window_SpeakInHouse->pControlsHead;
|
|
655 if ( window_SpeakInHouse->pControlsHead )
|
|
656 {
|
|
657 do
|
|
658 {
|
|
659 v49 = v48->pNext;
|
|
660 free(v48);
|
|
661 v48 = v49;
|
|
662 }
|
|
663 while ( v49 );
|
|
664 }
|
|
665 window_SpeakInHouse->pControlsHead = 0;
|
|
666 window_SpeakInHouse->pControlsTail = 0;
|
|
667 window_SpeakInHouse->uNumControls = 0;
|
|
668 }
|
|
669 }
|
|
670 else
|
|
671 {
|
|
672 if ( window_SpeakInHouse->par1C == 553 )
|
|
673 pMediaPlayer->bLoopPlaying = 0;
|
|
674 }
|
|
675 }
|
|
676
|
|
677 }
|
|
678 ++curr_seq_num;
|
|
679 break;
|
|
680 case EVENT_Jmp:
|
|
681 curr_seq_num = _evt->v5 - 1;
|
|
682 ++curr_seq_num;
|
|
683 v4 = -1;
|
|
684
|
|
685 break;
|
|
686 case EVENT_ShowFace:
|
|
687 if ( _evt->v5 <= 3u ) //someone
|
|
688 pParty->pPlayers[_evt->v5].PlayEmotion((CHARACTER_EXPRESSION_ID)_evt->v6, 0);
|
|
689 else if ( _evt->v5 == 4 ) //active
|
|
690 pParty->pPlayers[uActiveCharacter].PlayEmotion((CHARACTER_EXPRESSION_ID)_evt->v6, 0);
|
|
691 else if ( _evt->v5 == 5 ) //all players
|
|
692 {
|
|
693 for(int i = 0; i < 4; ++i)
|
|
694 pParty->pPlayers[i].PlayEmotion((CHARACTER_EXPRESSION_ID)_evt->v6, 0);
|
|
695 }
|
|
696 else //random player
|
|
697 pParty->pPlayers[rand() % 4].PlayEmotion((CHARACTER_EXPRESSION_ID)_evt->v6, 0);
|
|
698 ++curr_seq_num;
|
|
699 break;
|
|
700 case EVENT_CharacterAnimation:
|
|
701 if ( _evt->v5 <= 3 ) //someone
|
|
702 pParty->pPlayers[_evt->v5].PlaySound((PlayerSpeech) _evt->v6, 0);
|
|
703 else if ( _evt->v5 == 4 ) //active
|
|
704 pParty->pPlayers[uActiveCharacter].PlaySound((PlayerSpeech) _evt->v6, 0);
|
|
705 else if ( _evt->v5 == 5 ) //all
|
|
706 for(int i = 0; i < 4; ++i)
|
|
707 pParty->pPlayers[i].PlaySound((PlayerSpeech) _evt->v6, 0);
|
|
708 else //random
|
|
709 pParty->pPlayers[rand() % 4].PlaySound((PlayerSpeech) _evt->v6, 0);
|
|
710 ++curr_seq_num;
|
|
711 break;
|
|
712 case EVENT_ForPartyMember:
|
|
713 player_choose = _evt->v5;
|
|
714 ++curr_seq_num;
|
|
715 break;
|
|
716 case EVENT_SummonItem:
|
|
717 SpriteObject::sub_42F7EB_DropItemAt(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
|
|
718 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8),
|
|
719 _evt->v13 + ((_evt->v14 + ((_evt->v15 + ((uint)_evt->v16 << 8)) << 8)) << 8),
|
|
720 _evt->v17 + ((_evt->v18 + ((_evt->v19 + ((uint)_evt->v20 << 8)) << 8)) << 8),
|
|
721 _evt->v21 + ((_evt->v22 + ((_evt->v23 + ((uint)_evt->v24 << 8)) << 8)) << 8),
|
|
722 _evt->v25, _evt->v26, 0, 0);
|
|
723 ++curr_seq_num;
|
|
724 break;
|
|
725 case EVENT_Compare:
|
|
726 pValue = EVT_DWORD(_evt->v7);
|
|
727 if ( player_choose <= 3 )
|
|
728 {
|
|
729 if ( pPlayers[player_choose]->CompareVariable((enum VariableType)EVT_WORD(_evt->v5), pValue) )
|
|
730 {
|
|
731 // v124 = -1;
|
|
732 curr_seq_num = _evt->v11 - 1;
|
|
733 }
|
|
734 }
|
|
735 else if ( player_choose == 4 ) //active
|
|
736 {
|
|
737 if ( uActiveCharacter )
|
|
738 {
|
|
739 if ( pPlayers[uActiveCharacter]->CompareVariable((enum VariableType)EVT_WORD(_evt->v5), pValue) )
|
|
740 {
|
|
741 // v124 = -1;
|
|
742 curr_seq_num = _evt->v11 - 1;
|
|
743 }
|
|
744 }
|
|
745 }
|
|
746 else if ( player_choose == 5 )//all
|
|
747 {
|
|
748 v130 = 0;
|
|
749 for(int i = 1; i < 5; ++i)
|
|
750 {
|
|
751 if ( pPlayers[i]->CompareVariable((enum VariableType)EVT_WORD(_evt->v5), pValue) )
|
|
752 {
|
|
753 // v124 = -1;
|
|
754 curr_seq_num = _evt->v11 - 1;
|
|
755 break;
|
|
756 }
|
|
757 ++v130;
|
|
758 }
|
|
759 }
|
|
760 else if ( player_choose == 6 ) //random
|
|
761 {
|
|
762 if ( pPlayers[rand() % 4 + 1]->CompareVariable((enum VariableType)EVT_WORD(_evt->v5), pValue) )
|
|
763 {
|
|
764 // v124 = -1;
|
|
765 curr_seq_num = _evt->v11 - 1;
|
|
766 }
|
|
767 }
|
|
768 ++curr_seq_num;
|
|
769 v4 = -1;
|
|
770 break;
|
|
771 case EVENT_IsActorAlive:
|
|
772 if (IsActorAlive(EVT_BYTE(_evt->v5), EVT_DWORD(_evt->v6), EVT_BYTE(_evt->v10)))
|
|
773 {
|
|
774 //v124 = -1;
|
|
775 curr_seq_num = _evt->v11 - 1;
|
|
776 }
|
|
777 ++curr_seq_num;
|
|
778 v4 = -1;
|
|
779 break;
|
|
780 case EVENT_Substract:
|
|
781 pValue = EVT_DWORD(_evt->v7);
|
|
782 /*if ( EVT_WORD(_evt->v5) == VAR_PlayerItemInHands )
|
|
783 {
|
|
784 if ( pParty->pPickedItem.uItemID == pValue )//In hand
|
|
785 {
|
|
786 pMouse->RemoveHoldingItem();
|
|
787 ++curr_seq_num;
|
|
788 v4 = v124;
|
|
789 break;
|
|
790 }
|
|
791 //v67 = (int)pPlayers[uActiveCharacter]->pInventoryMatrix.data();
|
|
792 for ( v65 = 0; v65 < 126; ++v65 )
|
|
793 {
|
|
794 v67 = &pPlayers[uActiveCharacter]->pInventoryMatrix[v65];
|
|
795 if ( v67 > 0 )
|
|
796 {
|
|
797 if ( pPlayers[uActiveCharacter]->pInventoryItemList[v67 - 1].uItemID == pValue )
|
|
798 {
|
|
799 pPlayers[uActiveCharacter]->RemoveItemAtInventoryIndex(v65);
|
|
800 //++curr_seq_num;
|
|
801 //v4 = v124;
|
|
802 goto substract;
|
|
803 }
|
|
804 }
|
|
805 //v67 += 4;
|
|
806 }
|
|
807 //while ( (signed int)v65 < 126 );
|
|
808 //v69 = (int)&pPlayers[uActiveCharacter]->pEquipment.pIndices;
|
|
809 for ( v68 = 0; v68 < 16; ++v68 )
|
|
810 {
|
|
811 if ( pPlayers[uActiveCharacter]->pInventoryItemList[pPlayers[uActiveCharacter]->pEquipment.pIndices[v68]].uItemID == pValue )
|
|
812 {
|
|
813 pPlayers[uActiveCharacter]->pEquipment.pIndices[v68] = 0;
|
|
814 //++curr_seq_num;
|
|
815 //v4 = v124;
|
|
816 goto substract;
|
|
817 }
|
|
818 //v69 += 4;
|
|
819 }
|
|
820 for (int i = 1; i < 5; i++)
|
|
821 {
|
|
822 //v72 = (int)pPlayers[i]->pInventoryMatrix.data();
|
|
823 for ( int v71 = 0; v71 < 126; ++v71 )
|
|
824 {
|
|
825 v72 = &pPlayers[i]->pInventoryMatrix[v71];
|
|
826 if ( v72 > 0 )
|
|
827 {
|
|
828 if ( pPlayers[i]->pInventoryItemList[v72 - 1].uItemID == pValue )
|
|
829 {
|
|
830 pPlayers[i]->RemoveItemAtInventoryIndex(v71);
|
|
831 goto substract;
|
|
832 }
|
|
833 }
|
|
834 //v72 += 4;
|
|
835 }
|
|
836 for ( v73 = 0; v73 < 16; ++v73 )
|
|
837 {
|
|
838 //v74 = (int)&pPlayers[i]->pEquipment;
|
|
839 if (pPlayers[i]->pEquipment.pIndices[v73])
|
|
840 {
|
|
841 if (pPlayers[i]->pInventoryItemList[pPlayers[i]->pEquipment.pIndices[v73] - 1].uItemID == pValue )
|
|
842 {
|
|
843 pPlayers[i]->pEquipment.pIndices[v73] = 0;
|
|
844 //v74 += 4;
|
|
845 goto substract;
|
|
846 }
|
|
847 }
|
|
848 }
|
|
849 }
|
|
850 }*/
|
|
851 if ( player_choose <= 3 )
|
|
852 pParty->pPlayers[player_choose].SubtractVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
|
|
853 else if ( player_choose == 4 ) //active
|
|
854 {
|
|
855 if ( uActiveCharacter )
|
|
856 pPlayers[uActiveCharacter]->SubtractVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
|
|
857 }
|
|
858 else if ( player_choose == 5 )//all
|
|
859 {
|
|
860 for(int i = 1; i < 5; ++i)
|
|
861 pPlayers[i]->SubtractVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
|
|
862 }
|
|
863 else if ( player_choose == 6 ) //random
|
|
864 pParty->pPlayers[rand() % 4].SubtractVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
|
|
865 ++curr_seq_num;
|
|
866 break;
|
|
867 case EVENT_Set:
|
|
868 pValue = EVT_DWORD(_evt->v7);
|
|
869 if ( player_choose <= 3 )
|
|
870 pParty->pPlayers[player_choose].SetVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
|
|
871 else if ( player_choose == 4 ) //active
|
|
872 {
|
|
873 if ( uActiveCharacter )
|
|
874 pPlayers[uActiveCharacter]->SetVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
|
|
875 }
|
|
876 else if ( player_choose == 5 )//all
|
|
877 {
|
|
878 //recheck v130
|
|
879 for ( int i = 1; i < 5; ++i )
|
|
880 pPlayers[i]->SetVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
|
|
881 }
|
|
882 else if ( player_choose == 6 ) //random
|
|
883 pParty->pPlayers[rand() % 4].SetVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
|
|
884 ++curr_seq_num;
|
|
885 break;
|
|
886 case EVENT_Add:
|
|
887 pValue = EVT_DWORD(_evt->v7);
|
|
888 if ( player_choose <= 3 )
|
|
889 {
|
|
890 pPlayer = &pParty->pPlayers[player_choose];
|
|
891 pPlayer->AddVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
|
|
892 }
|
|
893 else if ( player_choose == 4 ) //active
|
|
894 {
|
|
895 if ( uActiveCharacter )
|
|
896 pPlayers[uActiveCharacter]->AddVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
|
|
897 }
|
|
898 else if ( player_choose == 5 )//all
|
|
899 {
|
|
900 for(int i = 1; i < 5; ++i)
|
|
901 pPlayers[i]->AddVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
|
|
902 }
|
|
903 else if ( player_choose == 6 ) //random
|
|
904 pParty->pPlayers[rand() % 4].AddVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
|
|
905 v83 = EVT_WORD(_evt->v5);
|
|
906 if (v83 == 21 || // gold well on emerald isle
|
|
907 v83 == 22 || v83 == 23 || v83 == 24 )
|
|
908 {
|
|
909 //__debugbreak(); // bonfire
|
|
910 viewparams->bRedrawGameUI = true;
|
|
911 }
|
|
912 ++curr_seq_num;
|
|
913 break;
|
|
914 case EVENT_InputString:
|
|
915 if ( !entry_line )
|
|
916 {
|
|
917 strcpy(GameUI_Footer_TimedString.data(), &pLevelStr[pLevelStrOffsets[EVT_DWORD(_evt->v5 )]]);
|
|
918 sub_4451A8_press_any_key(uEventID, curr_seq_num, 26);
|
|
919 if ( v133 == 1 )
|
|
920 OnMapLeave();
|
|
921 return;
|
|
922 }
|
|
923 v84 = _evt->v13 + ((_evt->v14 + ((_evt->v15 + ((uint)_evt->v16 << 8)) << 8)) << 8);
|
|
924 if ( !_stricmp(GameUI_Footer_TimedString.data(), &pLevelStr[pLevelStrOffsets[_evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8)]])
|
|
925 || !_stricmp(GameUI_Footer_TimedString.data(), &pLevelStr[pLevelStrOffsets[v84]]) )
|
|
926 {
|
|
927 v11 = _evt->v17;
|
|
928 curr_seq_num = v11 - 1;
|
|
929 }
|
|
930 ++curr_seq_num;
|
|
931 v4 = -1;
|
|
932 break;
|
|
933 case EVENT_RandomGoTo:
|
|
934 //v124 = -1;
|
|
935 v11 = (unsigned __int8)*(&_evt->v5 + rand() % ((_evt->v5 != 0) + (_evt->v6 != 0) + (_evt->v7 != 0) + (_evt->v8 != 0) + (_evt->v9 != 0)
|
|
936 + (_evt->v10 != 0)));
|
|
937 curr_seq_num = v11 - 1;
|
|
938 ++curr_seq_num;
|
|
939 v4 = -1;
|
|
940 break;
|
|
941 case EVENT_ReceiveDamage:
|
|
942 if ( (unsigned __int8)_evt->v5 <= 3 )
|
|
943 {
|
|
944 pParty->pPlayers[(unsigned __int8)_evt->v5].ReceiveDamage(EVT_DWORD(_evt->v7 ), (DAMAGE_TYPE)_evt->v6);
|
|
945 ++curr_seq_num;
|
|
946 break;
|
|
947 }
|
|
948 if ( _evt->v5 == 4 )
|
|
949 {
|
|
950 if ( !uActiveCharacter )
|
|
951 {
|
|
952 ++curr_seq_num;
|
|
953 break;
|
|
954 }
|
|
955 pPlayers[uActiveCharacter]->ReceiveDamage(EVT_DWORD(_evt->v7 ), (DAMAGE_TYPE)_evt->v6);
|
|
956 ++curr_seq_num;
|
|
957 break;
|
|
958 }
|
|
959 if ( _evt->v5 != 5 )
|
|
960 {
|
|
961 pParty->pPlayers[rand() % 4].ReceiveDamage(EVT_DWORD(_evt->v7 ), (DAMAGE_TYPE)_evt->v6);
|
|
962 ++curr_seq_num;
|
|
963 break;
|
|
964 }
|
|
965 for ( uint pl_id = 0;pl_id < 4; pl_id++ )
|
|
966 pParty->pPlayers[pl_id].ReceiveDamage(EVT_DWORD(_evt->v7 ), (DAMAGE_TYPE)_evt->v6);
|
|
967 ++curr_seq_num;
|
|
968 break;
|
|
969 case EVENT_ToggleIndoorLight:
|
|
970 pIndoor->ToggleLight(EVT_DWORD(_evt->v5 ), _evt->v9);
|
|
971 ++curr_seq_num;
|
|
972 break;
|
|
973 case EVENT_SetFacesBit:
|
|
974 sub_44892E_set_faces_bit(EVT_DWORD(_evt->v5),EVT_DWORD(_evt->v9), _evt->v13);
|
|
975 ++curr_seq_num;
|
|
976 break;
|
|
977 case EVENT_ToggleChestFlag:
|
|
978 Chest::ToggleFlag(EVT_DWORD(_evt->v5 ), EVT_DWORD(_evt->v9 ), _evt->v13);
|
|
979 ++curr_seq_num;
|
|
980 break;
|
|
981 case EVENT_ToggleActorFlag:
|
|
982 Actor::ToggleFlag(EVT_DWORD(_evt->v5 ), EVT_DWORD(_evt->v9 ), _evt->v13);
|
|
983 ++curr_seq_num;
|
|
984 break;
|
|
985 case EVENT_ToggleActorGroupFlag:
|
|
986 ToggleActorGroupFlag(EVT_DWORD(_evt->v5 ), EVT_DWORD(_evt->v9 ), _evt->v13);
|
|
987 ++curr_seq_num;
|
|
988 break;
|
|
989 case EVENT_SetSnow:
|
|
990 if ( !_evt->v5 )
|
|
991 pWeather->bRenderSnow = _evt->v6 != 0;
|
|
992 ++curr_seq_num;
|
|
993 break;
|
|
994 case EVENT_StatusText:
|
|
995 v90 = EVT_DWORD(_evt->v5 );
|
|
996 if ( activeLevelDecoration )
|
|
997 {
|
|
998 if ( activeLevelDecoration == (LevelDecoration*)1 )
|
|
999 current_npc_text = pNPCTopics[v90-1].pText;//(&dword_721664)[8 * v90];
|
|
1000 if ( canShowMessages == 1 )
|
|
1001 {
|
|
1002 v91 = pNPCTopics[v90-1].pText;//(&dword_721664)[8 * v90];
|
|
1003 //LABEL_248:
|
|
1004 ShowStatusBarString(v91, 2);
|
|
1005 }
|
|
1006 }
|
|
1007 else
|
|
1008 {
|
|
1009 if ( canShowMessages == 1 )
|
|
1010 {
|
|
1011 v91 = &pLevelStr[pLevelStrOffsets[v90]];
|
|
1012 ShowStatusBarString(v91, 2);
|
|
1013 }
|
|
1014 }
|
|
1015 ++curr_seq_num;
|
|
1016 break;
|
|
1017 case EVENT_ShowMessage:
|
|
1018 if ( activeLevelDecoration )
|
|
1019 {
|
|
1020 current_npc_text = pNPCTopics[EVT_DWORD(_evt->v5 )-1].pText;//(&dword_721664)[8 * v92];
|
|
1021 byte_5B0938[0] = 0;
|
|
1022 }
|
|
1023 else
|
|
1024 strcpy(byte_5B0938.data(), &pLevelStr[pLevelStrOffsets[EVT_DWORD(_evt->v5 )]]);
|
|
1025 ++curr_seq_num;
|
|
1026 break;
|
|
1027 case EVENT_CastSpell:
|
|
1028 EventCastSpell(_evt->v5, _evt->v6, _evt->v7, EVT_DWORD(_evt->v8 ),
|
|
1029 EVT_DWORD(_evt->v12 ), EVT_DWORD(_evt->v16 ), EVT_DWORD(_evt->v20 ),
|
|
1030 EVT_DWORD(_evt->v24 ), EVT_DWORD(_evt->v28 ));
|
|
1031 ++curr_seq_num;
|
|
1032 break;
|
|
1033 case EVENT_SetTexture:
|
|
1034 sub_44861E_set_texture(EVT_DWORD(_evt->v5 ), (char *)&_evt->v9);
|
|
1035 ++curr_seq_num;
|
|
1036 break;
|
|
1037 case EVENT_SetSprite:
|
|
1038 SetDecorationSprite(EVT_DWORD(_evt->v5 ), _evt->v9, (char *)&_evt->v10);
|
|
1039 ++curr_seq_num;
|
|
1040 break;
|
|
1041 case EVENT_SummonMonsters:
|
|
1042 sub_448CF4_spawn_monsters(_evt->v5, _evt->v6, _evt->v7,EVT_DWORD(_evt->v8 ),
|
|
1043 EVT_DWORD(_evt->v12 ), EVT_DWORD(_evt->v16 ), EVT_DWORD(_evt->v20 ),
|
|
1044 EVT_DWORD(_evt->v24 ));
|
|
1045 ++curr_seq_num;
|
|
1046 break;
|
|
1047 case EVENT_MouseOver:
|
|
1048 case EVENT_LocationName:
|
|
1049 --curr_seq_num;
|
|
1050 ++curr_seq_num;
|
|
1051 break;
|
|
1052 case EVENT_ChangeDoorState:
|
|
1053 Door_switch_animation(_evt->v5, _evt->v6);
|
|
1054 ++curr_seq_num;
|
|
1055 break;
|
|
1056 case EVENT_OpenChest:
|
|
1057 if ( !Chest::Open(_evt->v5) )
|
|
1058 {
|
|
1059 if ( v133 == 1 )
|
|
1060 OnMapLeave();
|
|
1061 return;
|
|
1062 }
|
|
1063 ++curr_seq_num;
|
|
1064 break;
|
|
1065 case EVENT_MoveToMap:
|
|
1066 v94 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
|
|
1067 v135 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
|
|
1068 v132 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
|
|
1069 v126 = _evt->v13 + ((_evt->v14 + ((_evt->v15 + ((uint)_evt->v16 << 8)) << 8)) << 8);
|
|
1070 v129 = _evt->v17 + ((_evt->v18 + ((_evt->v19 + ((uint)_evt->v20 << 8)) << 8)) << 8);
|
|
1071 v95 = _evt->v21 + ((_evt->v22 + ((_evt->v23 + ((uint)_evt->v24 << 8)) << 8)) << 8);
|
|
1072 v96 = _evt->v25;
|
|
1073 v97 = v96 + ((_evt->v26 + ((_evt->v27 + ((uint)_evt->v28 << 8)) << 8)) << 8);
|
|
1074 v134 = v96 + ((_evt->v26 + ((_evt->v27 + ((uint)_evt->v28 << 8)) << 8)) << 8);
|
|
1075 if ( _evt->v29 || _evt->v30 )
|
|
1076 {
|
|
1077 pRenderer->Sub01();
|
|
1078 TransitionUI_Load(_evt->v29, _evt->v30, v135, v132, v126, v129, v95, v134, (char *)&_evt->v31);
|
|
1079 dword_5C3418 = uEventID;
|
|
1080 dword_5C341C = curr_seq_num + 1;
|
|
1081 if ( v133 == 1 )
|
|
1082 OnMapLeave();
|
|
1083 return;
|
|
1084 }
|
|
1085 _5B65AC_npcdata_fame_or_other = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
|
|
1086 _5B65A8_npcdata_uflags_or_other = v94;
|
|
1087 _5B65B0_npcdata_rep_or_other = v126;
|
|
1088 if ( v129 == -1 )
|
|
1089 v98 = _5B65B4_npcdata_loword_house_or_other;
|
|
1090 else
|
|
1091 {
|
|
1092 v98 = v129 & stru_5C6E00->uDoublePiMask;
|
|
1093 _5B65B4_npcdata_loword_house_or_other = v129 & stru_5C6E00->uDoublePiMask;
|
|
1094 }
|
|
1095 v99 = (char *)&_evt->v31;
|
|
1096 _5B65B8_npcdata_hiword_house_or_other = v95;
|
|
1097 dword_5B65BC = v97;
|
|
1098 v100 = v94 | v132 | v126 | v95 | v97 | v98;
|
|
1099 dword_5B65C0 = v100;
|
|
1100 if ( *v99 == 48 )
|
|
1101 {
|
|
1102 if ( v100 )
|
|
1103 {
|
|
1104 pParty->vPosition.x = v135;
|
|
1105 pParty->vPosition.y = v132;
|
|
1106 pParty->vPosition.z = v126;
|
|
1107 pParty->uFallStartY = v126;
|
|
1108 if ( _5B65B4_npcdata_loword_house_or_other != -1 )
|
|
1109 pParty->sRotationY = _5B65B4_npcdata_loword_house_or_other;
|
|
1110 _5B65B4_npcdata_loword_house_or_other = -1;
|
|
1111 pParty->sRotationX = v95;
|
|
1112 pParty->uFallSpeed = v134;
|
|
1113 dword_5B65C0 = 0;
|
|
1114 dword_5B65BC = 0;
|
|
1115 _5B65B8_npcdata_hiword_house_or_other = 0;
|
|
1116 _5B65B0_npcdata_rep_or_other = 0;
|
|
1117 _5B65AC_npcdata_fame_or_other = 0;
|
|
1118 _5B65A8_npcdata_uflags_or_other = 0;
|
|
1119 v106 = 232;
|
|
1120 pAudioPlayer->PlaySound((SoundID)v106, 0, 0, -1, 0, 0, 0, 0);
|
|
1121 }
|
|
1122 }
|
|
1123 else
|
|
1124 {
|
|
1125 pGameLoadingUI_ProgressBar->uType = (GUIProgressBar::Type)((activeLevelDecoration == NULL) + 1);
|
|
1126 Transition_StopSound_Autosave(v99, MapStartPoint_Party);
|
|
1127 v133 = 1;
|
2541
|
1128 if ( current_screen_type == SCREEN_HOUSE )
|
2499
|
1129 {
|
|
1130 if ( uGameState == GAME_STATE_CHANGE_LOCATION )
|
|
1131 {
|
|
1132 pAudioPlayer->StopChannels(-1, -1);
|
|
1133 dialog_menu_id = HOUSE_DIALOGUE_NULL;
|
|
1134 while ( HouseDialogPressCloseBtn() )
|
|
1135 ;
|
|
1136 pMediaPlayer->Unload();
|
|
1137 window_SpeakInHouse->Release();
|
|
1138 window_SpeakInHouse = 0;
|
|
1139 if ( pMessageQueue_50CBD0->uNumMessages )
|
|
1140 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
|
2541
|
1141 current_screen_type = SCREEN_GAME;
|
2499
|
1142 viewparams->bRedrawGameUI = 1;
|
|
1143 pDialogueNPCCount = 0;
|
|
1144 pDialogueWindow->Release();
|
|
1145 dialog_menu_id = HOUSE_DIALOGUE_NULL;
|
|
1146 pDialogueWindow = 0;
|
|
1147 pIcons_LOD->SyncLoadedFilesCount();
|
|
1148 }
|
|
1149 OnMapLeave();
|
|
1150 return;
|
|
1151 }
|
|
1152 }
|
|
1153 ++curr_seq_num;
|
|
1154 break;
|
|
1155 case EVENT_PlaySound:
|
|
1156 v110 = _evt->v13 + ((_evt->v14 + ((_evt->v15 + ((uint)_evt->v16 << 8)) << 8)) << 8);
|
|
1157 v109 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
|
|
1158 v106 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
|
|
1159 pAudioPlayer->PlaySound((SoundID)v106, 0, 0, v109, v110, 0, 0, 0);
|
|
1160 ++curr_seq_num;
|
|
1161 break;
|
|
1162 case EVENT_GiveItem:
|
|
1163 item.Reset();
|
|
1164 v102 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8);
|
|
1165 pItemsTable->GenerateItem(_evt->v5, _evt->v6, &item);
|
|
1166 if ( v102 )
|
|
1167 item.uItemID = v102;
|
|
1168 pParty->SetHoldingItem(&item);
|
|
1169 ++curr_seq_num;
|
|
1170 break;
|
|
1171 case EVENT_SpeakInHouse:
|
|
1172 if ( EnterHouse((enum HOUSE_ID)EVT_DWORD(_evt->v5)))
|
|
1173 {
|
|
1174 pRenderer->Sub01();
|
2506
|
1175 pAudioPlayer->PlaySound(SOUND_Invalid, 0, 0, -1, 0, 0, 0, 0);
|
2534
|
1176 pAudioPlayer->PlaySound(SOUND_enter, 814, 0, -1, 0, 0, 0, 0);
|
2499
|
1177 v104 = 187;
|
|
1178 if ( uCurrentHouse_Animation != 167 )
|
|
1179 v104 = EVT_DWORD(_evt->v5);
|
|
1180 window_SpeakInHouse = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_HouseInterior, v104, 0);
|
|
1181 window_SpeakInHouse->CreateButton( 61, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 1, '1', "", 0);
|
|
1182 window_SpeakInHouse->CreateButton(177, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 2, '2', "", 0);
|
|
1183 window_SpeakInHouse->CreateButton(292, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 3, '3', "", 0);
|
|
1184 window_SpeakInHouse->CreateButton(407, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 4, '4', "", 0);
|
|
1185 window_SpeakInHouse->CreateButton( 0, 0, 0, 0, 1, 0, UIMSG_CycleCharacters, 0, '\t', "", 0);
|
|
1186 }
|
|
1187 ++curr_seq_num;
|
|
1188 break;
|
|
1189 case EVENT_PressAnyKey:
|
|
1190 sub_4451A8_press_any_key(uEventID, curr_seq_num + 1, 33);
|
|
1191 if ( v133 == 1 )
|
|
1192 OnMapLeave();
|
|
1193 return;
|
|
1194 case EVENT_Exit:
|
|
1195 if ( v133 == 1 )
|
|
1196 OnMapLeave();
|
|
1197 return;
|
|
1198 default:
|
|
1199 ++curr_seq_num;
|
|
1200 break;
|
|
1201 }
|
|
1202 }
|
|
1203 }
|
|
1204 if ( v133 == 1 )
|
|
1205 OnMapLeave();
|
|
1206 return;
|
|
1207 }
|
|
1208
|
|
1209 //----- (00444732) --------------------------------------------------------
|
|
1210 char *GetEventHintString(unsigned int uEventID)
|
|
1211 {
|
|
1212 signed int event_index; // edx@1
|
|
1213 int event_pos; // esi@4
|
|
1214 char *result; // eax@6
|
|
1215 unsigned int str_index; // eax@9
|
|
1216 int i; // esi@11
|
|
1217 _evt_raw* test_evt;
|
|
1218 _evt_raw* last_evt;
|
|
1219
|
|
1220 event_index = 0;
|
|
1221 if ( uLevelEVT_NumEvents <= 0 )
|
|
1222 return NULL;
|
|
1223
|
|
1224 //v2 = (char *)&pLevelEVT_Index[0].uEventOffsetInEVT;
|
|
1225 while ( 1 )
|
|
1226 {
|
|
1227 if ( pLevelEVT_Index[event_index].uEventID == uEventID )
|
|
1228 {
|
|
1229 test_evt=(_evt_raw*)&pLevelEVT[pLevelEVT_Index[event_index].uEventOffsetInEVT];
|
|
1230 last_evt=test_evt;
|
|
1231 event_pos = pLevelEVT_Index[event_index+1].uEventOffsetInEVT;
|
|
1232 if ( test_evt->_e_type == EVENT_MouseOver )
|
|
1233 break;
|
|
1234 }
|
|
1235 ++event_index;
|
|
1236 if ( event_index >= uLevelEVT_NumEvents )
|
|
1237 return NULL;
|
|
1238 }
|
|
1239 test_evt=(_evt_raw*)&pLevelEVT[event_pos];
|
|
1240 if ( test_evt->_e_type== EVENT_SpeakInHouse )
|
|
1241 {
|
|
1242 str_index = EVT_DWORD(test_evt->v5);
|
|
1243 result = (char *)p2DEvents[str_index - 1].pName;
|
|
1244 }
|
|
1245 else
|
|
1246 {
|
|
1247 for ( i = event_index + 1; pLevelEVT_Index[i].uEventID == uEventID; ++i )
|
|
1248 {
|
|
1249 event_pos = pLevelEVT_Index[i].uEventOffsetInEVT;
|
|
1250 test_evt=(_evt_raw*)&pLevelEVT[event_pos];
|
|
1251 if ( test_evt->_e_type == EVENT_SpeakInHouse )
|
|
1252 {
|
|
1253 str_index = EVT_DWORD(test_evt->v5);
|
|
1254 if ( str_index < 600 )
|
|
1255 return (char *)p2DEvents[str_index - 1].pName;
|
|
1256 }
|
|
1257 }
|
|
1258 result = &pLevelStr[pLevelStrOffsets[EVT_BYTE(last_evt->v5)]];
|
|
1259 }
|
|
1260
|
|
1261 return result;
|
|
1262 }
|
|
1263
|
|
1264 //----- (004613C4) --------------------------------------------------------
|
|
1265 void init_event_triggers()
|
|
1266 {
|
|
1267 uint id = pDecorationList->GetDecorIdByName("Event Trigger");
|
|
1268
|
|
1269 num_event_triggers = 0;
|
|
1270 for (uint i = 0; i < uNumLevelDecorations; ++i)
|
|
1271 if (pLevelDecorations[i].uDecorationDescID == id)
|
|
1272 event_triggers[num_event_triggers++] = i;
|
|
1273 }
|
|
1274
|
|
1275 //----- (0046CC4B) --------------------------------------------------------
|
|
1276 void check_event_triggers()
|
|
1277 {
|
|
1278 for (size_t i = 0; i < num_event_triggers; i++)
|
|
1279 {
|
|
1280 if (pLevelDecorations[event_triggers[i]].uFlags & LEVEL_DECORATION_TRIGGERED_BY_TOUCH
|
|
1281 && pLevelDecorations[event_triggers[i]].vPosition.GetDistanceTo(pParty->vPosition) < pLevelDecorations[event_triggers[i]].uTriggerRange)
|
|
1282 {
|
|
1283 EventProcessor(pLevelDecorations[event_triggers[i]].uEventID, PID(OBJECT_Decoration, i), 1);
|
|
1284 }
|
|
1285 else if (pLevelDecorations[event_triggers[i]].uFlags & LEVEL_DECORATION_TRIGGERED_BY_MONSTER)
|
|
1286 {
|
|
1287 for (size_t j = 0; j < uNumActors; j++)
|
|
1288 {
|
|
1289 if (pLevelDecorations[event_triggers[i]].vPosition.GetDistanceTo(pActors[j].vPosition) < pLevelDecorations[event_triggers[i]].uTriggerRange)
|
|
1290 EventProcessor(pLevelDecorations[event_triggers[i]].uEventID, 0, 1);
|
|
1291 }
|
|
1292 }
|
|
1293 else if (pLevelDecorations[event_triggers[i]].uFlags & LEVEL_DECORATION_TRIGGERED_BY_OBJECT)
|
|
1294 {
|
|
1295 for (size_t j = 0; j < uNumSpriteObjects; j++)
|
|
1296 {
|
|
1297 if (pLevelDecorations[event_triggers[i]].vPosition.GetDistanceTo(pSpriteObjects[j].vPosition) < pLevelDecorations[event_triggers[i]].uTriggerRange)
|
|
1298 EventProcessor(pLevelDecorations[event_triggers[i]].uEventID, 0, 1);
|
|
1299 }
|
|
1300 }
|
|
1301 }
|
|
1302 }
|
|
1303 // 6836C8: using guessed type int 6836C8_num_decorations_6807E8;
|
|
1304
|
|
1305 //----- (004465DF) --------------------------------------------------------
|
|
1306 bool sub_4465DF_check_season(int a1)
|
|
1307 {
|
|
1308 unsigned int monthPlusOne; // eax@1
|
|
1309 unsigned int daysPlusOne; // edx@1
|
|
1310
|
|
1311 monthPlusOne = pParty->uCurrentMonth + 1;
|
|
1312 daysPlusOne = pParty->uDaysPlayed + 1;
|
|
1313
|
|
1314 switch (a1)
|
|
1315 {
|
|
1316 case 3: //winter 12.21 -> 3.20
|
|
1317 return (monthPlusOne == 12 && daysPlusOne >= 21 || monthPlusOne == 1 || monthPlusOne == 2 || monthPlusOne == 3 && daysPlusOne <= 20);
|
|
1318 break;
|
|
1319 case 2:// autumn/fall 9.21 -> 12.20
|
|
1320 return (monthPlusOne == 9 && daysPlusOne >= 21 || monthPlusOne == 10 || monthPlusOne == 11 || monthPlusOne == 12 && daysPlusOne <= 20);
|
|
1321 break;
|
|
1322 case 1://summer 6.21 -> 9.20
|
|
1323 return (monthPlusOne == 6 && daysPlusOne >= 21 || monthPlusOne == 7 || monthPlusOne == 8 || monthPlusOne == 9 && daysPlusOne <= 20);
|
|
1324 break;
|
|
1325 case 0: //spring 3.21 -> 6.20
|
|
1326 return (monthPlusOne == 3 && daysPlusOne >= 21 || monthPlusOne == 4 || monthPlusOne == 5 || monthPlusOne == 6 && daysPlusOne <= 20);
|
|
1327 break;
|
|
1328 }
|
|
1329 Error("Unknown season");
|
|
1330 return false;
|
|
1331 }
|
|
1332
|
|
1333 //----- (00448CF4) --------------------------------------------------------
|
|
1334 void __fastcall sub_448CF4_spawn_monsters(__int16 typeindex, __int16 level, int count, int x, int y, int z, int group, unsigned int uUniqueName)
|
|
1335 {
|
|
1336 unsigned int map_id; // eax@1
|
|
1337 size_t old_num_actors; // ebx@2
|
|
1338 AIDirection v15; // [sp+28h] [bp-34h]@2
|
|
1339 SpawnPointMM7 pSpawnPoint; // [sp+44h] [bp-18h]@1
|
|
1340
|
|
1341 pSpawnPoint.vPosition.x = x;
|
|
1342 pSpawnPoint.vPosition.y = y;
|
|
1343 pSpawnPoint.vPosition.z = z;
|
|
1344 pSpawnPoint.uGroup = group;
|
|
1345 pSpawnPoint.uRadius = 32;
|
|
1346 pSpawnPoint.uKind = 3;
|
|
1347 pSpawnPoint.uIndex = typeindex + 2 * level + level;
|
|
1348 map_id = pMapStats->GetMapInfo(pCurrentMapName);
|
|
1349 if (map_id)
|
|
1350 {
|
|
1351 old_num_actors = uNumActors;
|
|
1352 SpawnEncounter(&pMapStats->pInfos[map_id], &pSpawnPoint, 0, count, 0);
|
|
1353 Actor::GetDirectionInfo(PID(OBJECT_Actor, old_num_actors), 4, &v15, 1);
|
|
1354 for (uint i = (unsigned int)old_num_actors; i < (unsigned int)uNumActors; ++i)
|
|
1355 {
|
|
1356 pActors[i].PrepareSprites(0);
|
|
1357 pActors[i].uYawAngle = v15.uYawAngle;
|
|
1358 pActors[i].dword_000334_unique_name = uUniqueName;
|
|
1359 }
|
|
1360 }
|
|
1361 }
|