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