Mercurial > mm7
comparison mm7_3.cpp @ 316:922a96fdcc86
Merge
author | Nomad |
---|---|
date | Wed, 20 Feb 2013 01:21:19 +0200 |
parents | 2a09e1d6fc8f 6d584c95dcf8 |
children | e41fe9cf3613 |
comparison
equal
deleted
inserted
replaced
315:2a09e1d6fc8f | 316:922a96fdcc86 |
---|---|
14158 } while ((decode_step<24)&&!break_loop); | 14158 } while ((decode_step<24)&&!break_loop); |
14159 } | 14159 } |
14160 | 14160 |
14161 } | 14161 } |
14162 | 14162 |
14163 //----- (00443CE1) -------------------------------------------------------- | |
14164 unsigned int LoadEventsToBuffer(const char *pContainerName, char *pBuffer, unsigned int uBufferSize) | |
14165 { | |
14166 FILE *pLodFile; // eax@1 | |
14167 unsigned int uTextureSize; // esi@3 | |
14168 char Args[60]; // [sp+8h] [bp-B4h]@6 | |
14169 void *ptr; // [sp+B8h] [bp-4h]@1 | |
14170 Texture DstBuf; // [sp+6Ch] [bp-50h]@1 | |
14171 | |
14172 ptr = pEvents_LOD->LoadRaw(pContainerName, 0); | |
14173 pLodFile = pEvents_LOD->FindContainer(pContainerName, 0); | |
14174 if ( !pLodFile ) | |
14175 Abortf("Unable to load %s", pContainerName); | |
14176 fread(&DstBuf, 1, 48, pLodFile); | |
14177 uTextureSize = DstBuf.uDecompressedSize; | |
14178 if ( !DstBuf.uDecompressedSize ) | |
14179 uTextureSize = DstBuf.uTextureSize; | |
14180 memset(&DstBuf, 0, 72); | |
14181 if ( uTextureSize >= (signed int)uBufferSize ) | |
14182 { | |
14183 sprintf(Args, "File %s Size %lu - Buffer size %lu", pContainerName, uTextureSize, uBufferSize); | |
14184 Abortf(Args); | |
14185 } | |
14186 memcpy(pBuffer, ptr, uTextureSize); | |
14187 pAllocator->FreeChunk(ptr); | |
14188 return uTextureSize; | |
14189 } | |
14190 | |
14191 //----- (00443DA1) -------------------------------------------------------- | |
14192 void __cdecl Initialize_GlobalEVT() | |
14193 { | |
14194 signed int v0; // esi@1 | |
14195 unsigned int v1; // ecx@2 | |
14196 char *v2; // eax@2 | |
14197 | |
14198 v0 = 0; | |
14199 uGlobalEVT_Size = LoadEventsToBuffer("global.evt", pGlobalEVT, 0xB400u); | |
14200 if ( uGlobalEVT_Size ) | |
14201 { | |
14202 uGlobalEVT_NumEvents = 0; | |
14203 memset(pGlobalEVT_Events, 128, 0xCE40u); | |
14204 v1 = uGlobalEVT_NumEvents; | |
14205 v2 = (char *)&pGlobalEVT_Events[uGlobalEVT_NumEvents].field_4; | |
14206 do | |
14207 { | |
14208 ++v1; | |
14209 *((int *)v2 - 1) = (unsigned __int8)pGlobalEVT[v0 + 1] + ((unsigned __int8)pGlobalEVT[v0 + 2] << 8); | |
14210 *(int *)v2 = (unsigned __int8)pGlobalEVT[v0 + 3]; | |
14211 *((int *)v2 + 1) = v0; | |
14212 v2 += 12; | |
14213 v0 += (unsigned __int8)pGlobalEVT[v0] + 1; | |
14214 } | |
14215 while ( v0 < (signed int)uGlobalEVT_Size ); | |
14216 uGlobalEVT_NumEvents = v1; | |
14217 } | |
14218 } | |
14219 | 14163 |
14220 //----- (00443E31) -------------------------------------------------------- | 14164 //----- (00443E31) -------------------------------------------------------- |
14221 void __cdecl LoadLevel_InitializeLevelStr() | 14165 void __cdecl LoadLevel_InitializeLevelStr() |
14222 { | 14166 { |
14223 signed __int16 v0; // si@1 | 14167 signed __int16 v0; // si@1 |
14274 } | 14218 } |
14275 while ( (signed __int16)v6 < (signed int)uLevelStrNumStrings ); | 14219 while ( (signed __int16)v6 < (signed int)uLevelStrNumStrings ); |
14276 } | 14220 } |
14277 } | 14221 } |
14278 | 14222 |
14279 //----- (00443EF8) -------------------------------------------------------- | |
14280 void __cdecl LoadLevel_InitializeLevelEvt() | |
14281 { | |
14282 if (!uLevelEVT_Size) | |
14283 return; | |
14284 | |
14285 memset(array_5B5928, 0, 0xC80u); | |
14286 memset(pLevelEVT_Events, 128, 0xCE40u); | |
14287 | |
14288 uLevelEVT_NumEvents = 0; | |
14289 dword_5B65C8 = 0; | |
14290 | |
14291 for (uint i = 0, j = 0; j < uLevelEVT_Size; ++i) | |
14292 { | |
14293 pLevelEVT_Events[i].uEventID = pLevelEVT[j + 1] + ((unsigned short)pLevelEVT[j + 2] << 8); | |
14294 pLevelEVT_Events[i].field_4 = pLevelEVT[j + 3]; | |
14295 pLevelEVT_Events[i].uEventOffsetInEVT = j; | |
14296 j += pLevelEVT[j] + 1; | |
14297 | |
14298 uLevelEVT_NumEvents++; | |
14299 } | |
14300 } | |
14301 | 14223 |
14302 //----- (00443F95) -------------------------------------------------------- | 14224 //----- (00443F95) -------------------------------------------------------- |
14303 void __cdecl OnMapLeave() | 14225 void __cdecl OnMapLeave() |
14304 { | 14226 { |
14305 signed int v0; // edi@1 | 14227 signed int v0; // edi@1 |
14307 int v2; // ecx@4 | 14229 int v2; // ecx@4 |
14308 | 14230 |
14309 v0 = 0; | 14231 v0 = 0; |
14310 if ( (signed int)uLevelEVT_NumEvents > 0 ) | 14232 if ( (signed int)uLevelEVT_NumEvents > 0 ) |
14311 { | 14233 { |
14312 v1 = (char *)&pLevelEVT_Events[0].field_4; | 14234 v1 = (char *)&pLevelEVT_Index[0].event_sequence_num; |
14313 do | 14235 do |
14314 { | 14236 { |
14315 if ( pLevelEVT[*((short *)v1 + 2) + 4] == 53 ) | 14237 if ( pLevelEVT[*((short *)v1 + 2) + 4] == 53 ) |
14316 { | 14238 { |
14317 v2 = *((int *)v1 - 1); | 14239 v2 = *((int *)v1 - 1); |
14359 __int16 v32; // [sp+4Ch] [bp-4h]@9 | 14281 __int16 v32; // [sp+4Ch] [bp-4h]@9 |
14360 __int16 v33; // [sp+4Eh] [bp-2h]@9 | 14282 __int16 v33; // [sp+4Eh] [bp-2h]@9 |
14361 | 14283 |
14362 for (uint i = 0; i < uLevelEVT_NumEvents; ++i) | 14284 for (uint i = 0; i < uLevelEVT_NumEvents; ++i) |
14363 { | 14285 { |
14364 auto pEvent = pLevelEVT_Events + i; | 14286 auto pEvent = pLevelEVT_Index + i; |
14365 | 14287 |
14366 auto _evt = (_evt_raw *)(pLevelEVT + pEvent->uEventOffsetInEVT); | 14288 auto _evt = (_evt_raw *)(pLevelEVT + pEvent->uEventOffsetInEVT); |
14367 | 14289 |
14368 if (_evt->v4 == 3) | 14290 if (_evt->v4 == 3) |
14369 { | 14291 { |
14372 ((_evt->v6 + ((_evt->v7 + ((unsigned int)_evt->v8 << 8)) << 8)) << 8), | 14294 ((_evt->v6 + ((_evt->v7 + ((unsigned int)_evt->v8 << 8)) << 8)) << 8), |
14373 0); | 14295 0); |
14374 } | 14296 } |
14375 else if (_evt->v4 == 37) | 14297 else if (_evt->v4 == 37) |
14376 { | 14298 { |
14377 dword_597F18 = pEvent->field_4; | 14299 dword_597F18 = pEvent->event_sequence_num; |
14378 EventProcessor(pEvent->uEventID, 0, 0); | 14300 EventProcessor(pEvent->uEventID, 0, 0); |
14379 dword_597F18 = 0; | 14301 dword_597F18 = 0; |
14380 } | 14302 } |
14381 else if (_evt->v4 == 31 || _evt->v4 == 38) | 14303 else if (_evt->v4 == 31 || _evt->v4 == 38) |
14382 { | 14304 { |
14386 v20 = pIndoor->stru1.uLastVisitDay; | 14308 v20 = pIndoor->stru1.uLastVisitDay; |
14387 | 14309 |
14388 v4 = _evt->v4; | 14310 v4 = _evt->v4; |
14389 v3->field_1C = v4; | 14311 v3->field_1C = v4; |
14390 v3->field_8 = pEvent->uEventID; | 14312 v3->field_8 = pEvent->uEventID; |
14391 v3->field_A = pEvent->field_4; | 14313 v3->field_A = pEvent->event_sequence_num; |
14392 v33 = _evt->v6; | 14314 v33 = _evt->v6; |
14393 v3->field_12 = v33; | 14315 v3->field_12 = v33; |
14394 v32 = _evt->v7; | 14316 v32 = _evt->v7; |
14395 v3->field_14 = v32; | 14317 v3->field_14 = v32; |
14396 v31 = _evt->v8; | 14318 v31 = _evt->v8; |
15812 if ( !_this ) | 15734 if ( !_this ) |
15813 return 0; | 15735 return 0; |
15814 v3 = dword_597F18; | 15736 v3 = dword_597F18; |
15815 pSomeOtherEVT = pGlobalEVT; | 15737 pSomeOtherEVT = pGlobalEVT; |
15816 uSomeOtherEVT_NumEvents = uGlobalEVT_NumEvents; | 15738 uSomeOtherEVT_NumEvents = uGlobalEVT_NumEvents; |
15817 memcpy(pSomeOtherEVT_Events, pGlobalEVT_Events, 0xCE40u); | 15739 memcpy(pSomeOtherEVT_Events, pGlobalEVT_Index, 0xCE40u); |
15818 v4 = 1; | 15740 v4 = 1; |
15819 v12 = 1; | 15741 v12 = 1; |
15820 v11 = 0; | 15742 v11 = 0; |
15821 if ( (signed int)uSomeOtherEVT_NumEvents <= 0 ) | 15743 if ( (signed int)uSomeOtherEVT_NumEvents <= 0 ) |
15822 goto LABEL_16; | 15744 goto LABEL_16; |
15823 do | 15745 do |
15824 { | 15746 { |
15825 v5 = v1; | 15747 v5 = v1; |
15826 if ( (void *)pSomeOtherEVT_Events[v1].uEventID == v13 && pSomeOtherEVT_Events[v5].field_4 == v3 ) | 15748 if ( (void *)pSomeOtherEVT_Events[v1].uEventID == v13 && pSomeOtherEVT_Events[v5].event_sequence_num == v3 ) |
15827 { | 15749 { |
15828 v6 = pSomeOtherEVT_Events[v5].uEventOffsetInEVT; | 15750 v6 = pSomeOtherEVT_Events[v5].uEventOffsetInEVT; |
15829 v7 = &pSomeOtherEVT[v6]; | 15751 v7 = &pSomeOtherEVT[v6]; |
15830 if ( (unsigned __int8)pSomeOtherEVT[v6 + 4] == 1 ) | 15752 if ( (unsigned __int8)pSomeOtherEVT[v6 + 4] == 1 ) |
15831 break; | 15753 break; |
15879 result = v12 != 0; | 15801 result = v12 != 0; |
15880 else | 15802 else |
15881 LABEL_16: | 15803 LABEL_16: |
15882 result = 2; | 15804 result = 2; |
15883 return result; | 15805 return result; |
15884 } | |
15885 | |
15886 | |
15887 //----- (0044684A) -------------------------------------------------------- | |
15888 void __fastcall EventProcessor(int uEventID, int a2, int a3) | |
15889 { | |
15890 unsigned int v3; // eax@5 | |
15891 //signed int v4; // esi@7 | |
15892 //char *v5; // eax@8 | |
15893 Player *v6; // ecx@8 | |
15894 //char *v7; // ebp@8 | |
15895 //signed int v8; // edx@10 | |
15896 //int v9; // edi@12 | |
15897 //ByteArray *v10; // esi@12 | |
15898 int v11; // eax@14 | |
15899 char *v12; // eax@15 | |
15900 //char *v13; // edi@21 | |
15901 int v14; // ebp@21 | |
15902 int v15; // edi@21 | |
15903 const char *v16; // esi@21 | |
15904 bool v17; // edx@21 | |
15905 int v18; // ecx@22 | |
15906 int v19; // ebp@36 | |
15907 signed int v20; // ecx@40 | |
15908 int v21; // eax@40 | |
15909 int v22; // edx@40 | |
15910 int v23; // eax@40 | |
15911 unsigned __int16 v24; // ax@45 | |
15912 int v25; // eax@54 | |
15913 LevelDecoration *v26; // eax@55 | |
15914 int v27; // eax@57 | |
15915 int v28; // ecx@57 | |
15916 int v29; // edx@58 | |
15917 int v30; // eax@58 | |
15918 int v31; // ecx@58 | |
15919 int v32; // esi@58 | |
15920 NPCData *v33; // ecx@58 | |
15921 int v34; // esi@59 | |
15922 int v35; // esi@60 | |
15923 int v36; // esi@61 | |
15924 int v37; // esi@62 | |
15925 int v38; // eax@78 | |
15926 int v39; // ecx@78 | |
15927 size_t v40; // edx@78 | |
15928 Actor *v41; // esi@79 | |
15929 int v42; // eax@84 | |
15930 int v43; // ecx@84 | |
15931 size_t v44; // edx@84 | |
15932 Actor *v45; // esi@85 | |
15933 void *v46; // eax@91 | |
15934 GUIWindow *v47; // eax@93 | |
15935 GUIButton *v48; // ecx@93 | |
15936 GUIButton *v49; // esi@94 | |
15937 char v50; // al@100 | |
15938 Player *v51; // esi@103 | |
15939 Player *v52; // ecx@106 | |
15940 int v53; // ecx@107 | |
15941 char v54; // al@111 | |
15942 Player *v55; // esi@114 | |
15943 Player *v56; // ecx@117 | |
15944 int v57; // ecx@118 | |
15945 signed int v58; // ebp@124 | |
15946 Player *v59; // esi@125 | |
15947 int v60; // eax@126 | |
15948 int v61; // edx@133 | |
15949 int v62; // eax@139 | |
15950 void *v63; // ebp@145 | |
15951 signed int v64; // edi@146 | |
15952 unsigned int v65; // edx@148 | |
15953 Player *v66; // ecx@148 | |
15954 int v67; // esi@148 | |
15955 signed int v68; // eax@151 | |
15956 int v69; // esi@151 | |
15957 Player *v70; // ecx@158 | |
15958 unsigned int v71; // eax@159 | |
15959 int v72; // esi@159 | |
15960 signed int v73; // eax@162 | |
15961 int v74; // esi@162 | |
15962 int v75; // edx@172 | |
15963 Player *v76; // esi@173 | |
15964 signed int v77; // ebp@186 | |
15965 int v78; // edx@186 | |
15966 Player *v79; // esi@187 | |
15967 signed int v80; // ebp@200 | |
15968 int v81; // edx@200 | |
15969 Player *v82; // esi@201 | |
15970 int v83; // eax@212 | |
15971 int v84; // ebp@220 | |
15972 signed int v85; // ebp@224 | |
15973 char v86; // al@224 | |
15974 Player *v87; // esi@227 | |
15975 Player *v88; // ecx@231 | |
15976 int v89; // ecx@232 | |
15977 int v90; // eax@243 | |
15978 const char *v91; // ecx@247 | |
15979 int v92; // eax@251 | |
15980 char *v93; // eax@252 | |
15981 int v94; // ecx@262 | |
15982 int v95; // ebp@262 | |
15983 int v96; // edx@262 | |
15984 int v97; // eax@262 | |
15985 unsigned int v98; // edx@265 | |
15986 const char *v99; // esi@267 | |
15987 int v100; // edx@267 | |
15988 //char *v101; // edi@281 | |
15989 unsigned int v102; // esi@281 | |
15990 int v103; // edi@284 | |
15991 int v104; // eax@288 | |
15992 int v105; // edx@294 | |
15993 int v106; // [sp-20h] [bp-4C8h]@278 | |
15994 signed int v107; // [sp-1Ch] [bp-4C4h]@278 | |
15995 unsigned int v108; // [sp-18h] [bp-4C0h]@278 | |
15996 signed int v109; // [sp-14h] [bp-4BCh]@278 | |
15997 signed int v110; // [sp-10h] [bp-4B8h]@278 | |
15998 int v111; // [sp-Ch] [bp-4B4h]@278 | |
15999 Event *v112; // [sp-8h] [bp-4B0h]@5 | |
16000 int v113; // [sp-8h] [bp-4B0h]@106 | |
16001 int v114; // [sp-8h] [bp-4B0h]@117 | |
16002 signed int v115; // [sp-8h] [bp-4B0h]@231 | |
16003 unsigned int v116; // [sp-8h] [bp-4B0h]@278 | |
16004 int v117; // [sp-4h] [bp-4ACh]@106 | |
16005 int v118; // [sp-4h] [bp-4ACh]@117 | |
16006 int v119; // [sp-4h] [bp-4ACh]@231 | |
16007 int v120; // [sp-4h] [bp-4ACh]@278 | |
16008 int v121; // [sp-4h] [bp-4ACh]@294 | |
16009 int v122; // [sp+10h] [bp-498h]@4 | |
16010 //char *v123; // [sp+14h] [bp-494h]@0 | |
16011 //signed int v124; // [sp+18h] [bp-490h]@7 | |
16012 signed int v125; // [sp+1Ch] [bp-48Ch]@155 | |
16013 int v126; // [sp+1Ch] [bp-48Ch]@262 | |
16014 int v127; // [sp+20h] [bp-488h]@4 | |
16015 int v128; // [sp+24h] [bp-484h]@21 | |
16016 int v129; // [sp+24h] [bp-484h]@262 | |
16017 signed int v130; // [sp+28h] [bp-480h]@0 | |
16018 //int v131; // [sp+2Ch] [bp-47Ch]@1 | |
16019 int v132; // [sp+30h] [bp-478h]@262 | |
16020 signed int v133; // [sp+34h] [bp-474h]@1 | |
16021 int v134; // [sp+38h] [bp-470h]@262 | |
16022 int v135; // [sp+3Ch] [bp-46Ch]@262 | |
16023 int v136; // [sp+40h] [bp-468h]@40 | |
16024 int v137; // [sp+44h] [bp-464h]@40 | |
16025 int v138; // [sp+48h] [bp-460h]@40 | |
16026 int v139; // [sp+4Ch] [bp-45Ch]@40 | |
16027 ItemGen item; // [sp+50h] [bp-458h]@15 | |
16028 char Source[120]; // [sp+74h] [bp-434h]@15 | |
16029 char Str[120]; // [sp+ECh] [bp-3BCh]@21 | |
16030 Actor Dst; // [sp+164h] [bp-344h]@53 | |
16031 | |
16032 //v131 = uEventID; | |
16033 v133 = 0; | |
16034 dword_5B5920 = a2; | |
16035 dword_5B65C4 = 0; | |
16036 if ( !a1 ) | |
16037 { | |
16038 if ( !GameUI_StatusBar_TimedStringTimeLeft ) | |
16039 ShowStatusBarString(pGlobalTXT_LocalizationStrings[521], 2u);// Nothing here | |
16040 return; | |
16041 } | |
16042 v127 = 2 * (uActiveCharacter == 0) + 4; | |
16043 v122 = dword_597F18; | |
16044 if ( _5C3420_pDecoration ) | |
16045 { | |
16046 v3 = uGlobalEVT_NumEvents; | |
16047 pSomeEVT = pGlobalEVT; | |
16048 v112 = pGlobalEVT_Events; | |
16049 } | |
16050 else | |
16051 { | |
16052 v3 = uLevelEVT_NumEvents; | |
16053 pSomeEVT = pLevelEVT; | |
16054 v112 = pLevelEVT_Events; | |
16055 } | |
16056 uSomeEVT_NumEvents = v3; | |
16057 memcpy(pSomeEVT_Events, v112, 0xCE40u); | |
16058 //v4 = 0; | |
16059 //v124 = 0; | |
16060 for (uint i = 0; i < uSomeEVT_NumEvents; ++i) | |
16061 { | |
16062 //v5 = pSomeEVT; | |
16063 //v6 = v123; | |
16064 //v7 = ""; | |
16065 //while ( 1 ) | |
16066 //{ | |
16067 if ( dword_5B65C4 ) | |
16068 goto LABEL_301; | |
16069 //v8 = v4; | |
16070 if ( pSomeEVT_Events[i/*v4*/].uEventID == uEventID && pSomeEVT_Events[i/*v4*/].field_4 == v122 ) | |
16071 { | |
16072 //v9 = pSomeEVT_Events[v8].uEventOffsetInEVT; | |
16073 //v10 = (ByteArray *)&v5[v9]; | |
16074 auto _evt = (_evt_raw *)(pSomeEVT + pSomeEVT_Events[i/*v4*/].uEventOffsetInEVT); | |
16075 | |
16076 switch (_evt->v4) | |
16077 { | |
16078 case EVENT_CheckSeason: | |
16079 if ( !sub_4465DF_check_season(_evt->v5) ) | |
16080 { | |
16081 ++v122; | |
16082 //v4 = v124; | |
16083 //v5 = pSomeEVT; | |
16084 //v6 = v123; | |
16085 //v7 = ""; | |
16086 break; | |
16087 } | |
16088 v11 = _evt->v6; | |
16089 goto LABEL_130; | |
16090 case EVENT_ShowMovie: | |
16091 strcpy(Source, (char *)&_evt->v7); | |
16092 v12 = (char *)&item.uExpireTime + strlen(Source) + 7; | |
16093 if ( *v12 == 32 ) | |
16094 *v12 = 0; | |
16095 if ( pVideoPlayer->field_54 ) | |
16096 pVideoPlayer->Unload(); | |
16097 pVideoPlayer->bStopBeforeSchedule = 0; | |
16098 pVideoPlayer->pResetflag = 0; | |
16099 if (pAsyncMouse) | |
16100 pAsyncMouse->Suspend(); | |
16101 v128 = pCurrentScreen; | |
16102 //v13 = &pSomeEVT[v9]; | |
16103 //v14 = (unsigned __int8)v13[5]; | |
16104 //v15 = (unsigned __int8)v13[6]; | |
16105 v14 = _evt->v5; | |
16106 v15 = _evt->v6; | |
16107 strcpy(Str, Source); | |
16108 v16 = RemoveQuotes(Str); | |
16109 VideoPlayer::MovieLoop(v16, 0, v14, 1); | |
16110 if ( !_strcmpi(v16, "arbiter good") ) | |
16111 { | |
16112 pParty->uAlignment = 0; | |
16113 v18 = 0; | |
16114 LOBYTE(v17) = 1; | |
16115 SetUserInterface(v18, v17); | |
16116 if ( !v15 || v128 == 3 ) | |
16117 { | |
16118 pCurrentScreen = v128; | |
16119 if ( v128 == 3 ) | |
16120 pGameLoadingUI_ProgressBar->uType = GUIProgressBar::TYPE_Fullscreen; | |
16121 if ( v128 == 13 ) | |
16122 pVideoPlayer->_4BF28F(pAnimatedRooms[uCurrentHouse_Animation].field_0, 1u); | |
16123 } | |
16124 if (pAsyncMouse) | |
16125 pAsyncMouse->Resume(); | |
16126 ++v122; | |
16127 //v4 = v124; | |
16128 //v5 = pSomeEVT; | |
16129 //v6 = v123; | |
16130 //v7 = ""; | |
16131 break; | |
16132 } | |
16133 if ( !_strcmpi(v16, "arbiter evil") ) | |
16134 { | |
16135 v18 = 2; | |
16136 pParty->uAlignment = 2; | |
16137 LOBYTE(v17) = 1; | |
16138 SetUserInterface(v18, v17); | |
16139 if ( !v15 || v128 == 3 ) | |
16140 { | |
16141 pCurrentScreen = v128; | |
16142 if ( v128 == 3 ) | |
16143 pGameLoadingUI_ProgressBar->uType = GUIProgressBar::TYPE_Fullscreen; | |
16144 if ( v128 == 13 ) | |
16145 pVideoPlayer->_4BF28F(pAnimatedRooms[uCurrentHouse_Animation].field_0, 1u); | |
16146 } | |
16147 if (pAsyncMouse) | |
16148 pAsyncMouse->Resume(); | |
16149 ++v122; | |
16150 //v4 = v124; | |
16151 //v5 = pSomeEVT; | |
16152 //v6 = v123; | |
16153 //v7 = ""; | |
16154 break; | |
16155 } | |
16156 if ( !_strcmpi(v16, "pcout01") ) // moving to harmondale from emerald isle | |
16157 { | |
16158 Rest(0x2760u); | |
16159 pParty->RestAndHeal(); | |
16160 pParty->field_764 = 0; | |
16161 } | |
16162 if ( !v15 || v128 == 3 ) | |
16163 { | |
16164 pCurrentScreen = v128; | |
16165 if ( v128 == 3 ) | |
16166 pGameLoadingUI_ProgressBar->uType = GUIProgressBar::TYPE_Fullscreen; | |
16167 if ( v128 == 13 ) | |
16168 pVideoPlayer->_4BF28F(pAnimatedRooms[uCurrentHouse_Animation].field_0, 1u); | |
16169 } | |
16170 if (pAsyncMouse) | |
16171 pAsyncMouse->Resume(); | |
16172 ++v122; | |
16173 //v4 = v124; | |
16174 //v5 = pSomeEVT; | |
16175 //v6 = v123; | |
16176 //v7 = ""; | |
16177 break; | |
16178 case EVENT_CheckSkill: | |
16179 v19 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((unsigned int)_evt->v10 << 8)) << 8)) << 8); | |
16180 if ( v127 < 0 ) | |
16181 goto LABEL_47; | |
16182 if ( v127 <= 3 ) | |
16183 { | |
16184 v24 = pParty->pPlayers[0].pActiveSkills[3486 * v127 + _evt->v5]; | |
16185 } | |
16186 else | |
16187 { | |
16188 if ( v127 == 4 ) | |
16189 { | |
16190 v24 = pPlayers[uActiveCharacter]->pActiveSkills[_evt->v5]; | |
16191 } | |
16192 else | |
16193 { | |
16194 if ( v127 == 5 ) | |
16195 { | |
16196 v20 = 0; | |
16197 v21 = 3486 * v130 + _evt->v5; | |
16198 v136 = 1; | |
16199 LOWORD(v21) = pParty->pPlayers[0].pActiveSkills[v21]; | |
16200 v137 = v21 & 0x40; | |
16201 v138 = v21 & 0x80; | |
16202 v22 = v21 & 0x100; | |
16203 v23 = v21 & 0x3F; | |
16204 v139 = v22; | |
16205 while ( v23 < v19 || !*(&v136 + _evt->v6) ) | |
16206 { | |
16207 ++v20; | |
16208 if ( v20 >= 4 ) | |
16209 { | |
16210 ++v122; | |
16211 //v4 = v124; | |
16212 //v5 = pSomeEVT; | |
16213 //v6 = v123; | |
16214 //v7 = ""; | |
16215 break; | |
16216 } | |
16217 } | |
16218 v11 = _evt->v11; | |
16219 goto LABEL_130; | |
16220 } | |
16221 LABEL_47: | |
16222 //v10 = (ByteArray *)&v5[v9]; | |
16223 v24 = pParty->pPlayers[0].pActiveSkills[_evt->v5 + 3486 * rand() % 4]; | |
16224 } | |
16225 } | |
16226 v136 = 1; | |
16227 v137 = v24 & 0x40; | |
16228 v138 = v24 & 0x80; | |
16229 v139 = v24 & 0x100; | |
16230 if ( (v24 & 0x3F) >= v19 && *(&v136 + _evt->v6) ) | |
16231 { | |
16232 v11 = _evt->v11; | |
16233 goto LABEL_130; | |
16234 } | |
16235 ++v122; | |
16236 //v4 = v124; | |
16237 //v5 = pSomeEVT; | |
16238 //v6 = v123; | |
16239 //v7 = ""; | |
16240 break; | |
16241 case EVENT_SpeakNPC: | |
16242 if ( a3 ) | |
16243 { | |
16244 //Actor::Actor(&Dst); | |
16245 memset(&Dst, 0, 0x344u); | |
16246 dword_5B65D0_dialogue_actor_npc_id = _evt->v5 | |
16247 + ((_evt->v6 | |
16248 + ((_evt->v7 | |
16249 + ((unsigned int)_evt->v8 << 8)) << 8)) << 8); | |
16250 Dst.uNPC_ID = dword_5B65D0_dialogue_actor_npc_id; | |
16251 Dst.InitializeDialogue(0); | |
16252 } | |
16253 else | |
16254 { | |
16255 bDialogueUI_InitializeActor_NPC_ID = _evt->v5 | |
16256 + ((_evt->v6 + ((_evt->v7 + ((unsigned int)_evt->v8 << 8)) << 8)) << 8); | |
16257 } | |
16258 ++v122; | |
16259 //v4 = v124; | |
16260 //v5 = pSomeEVT; | |
16261 //v6 = v123; | |
16262 //v7 = ""; | |
16263 break; | |
16264 case EVENT_ChangeEvent: | |
16265 v25 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((unsigned int)_evt->v8 << 8)) << 8)) << 8); | |
16266 if ( v25 ) | |
16267 { | |
16268 stru_5E4C90._decor_events[_5C3420_pDecoration->_idx_in_stru123 - 75] = _evt->v5 - 124; | |
16269 } | |
16270 else | |
16271 { | |
16272 v26 = _5C3420_pDecoration; | |
16273 stru_5E4C90._decor_events[_5C3420_pDecoration->_idx_in_stru123 - 75] = 0; | |
16274 LOBYTE(v26->field_2) |= 0x20u; | |
16275 } | |
16276 ++v122; | |
16277 //v4 = v124; | |
16278 //v5 = pSomeEVT; | |
16279 //v6 = v123; | |
16280 //v7 = ""; | |
16281 break; | |
16282 case EVENT_SetNPCGreeting: | |
16283 v27 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8); | |
16284 v28 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8); | |
16285 pNPCStats->pNewNPCData[v27].uFlags &= 0xFFFFFFFCu; | |
16286 pNPCStats->pNewNPCData[v27].greet = v28; | |
16287 ++v122; | |
16288 //v4 = v124; | |
16289 //v5 = pSomeEVT; | |
16290 //v6 = v123; | |
16291 //v7 = ""; | |
16292 break; | |
16293 case EVENT_SetNPCTopic: | |
16294 v29 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8); | |
16295 v30 = _evt->v10 + ((_evt->v11 + ((_evt->v12 + ((uint)_evt->v13 << 8)) << 8)) << 8); | |
16296 v31 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8); | |
16297 v32 = _evt->v9; | |
16298 v33 = &pNPCStats->pNewNPCData[v31]; | |
16299 if ( v32 ) | |
16300 { | |
16301 v34 = v32 - 1; | |
16302 if ( v34 ) | |
16303 { | |
16304 v35 = v34 - 1; | |
16305 if ( v35 ) | |
16306 { | |
16307 v36 = v35 - 1; | |
16308 if ( v36 ) | |
16309 { | |
16310 v37 = v36 - 1; | |
16311 if ( v37 ) | |
16312 { | |
16313 if ( v37 == 1 ) | |
16314 v33->evt_F = v30; | |
16315 } | |
16316 else | |
16317 { | |
16318 v33->evt_E = v30; | |
16319 } | |
16320 } | |
16321 else | |
16322 { | |
16323 v33->evt_D = v30; | |
16324 } | |
16325 } | |
16326 else | |
16327 { | |
16328 v33->evt_C = v30; | |
16329 } | |
16330 } | |
16331 else | |
16332 { | |
16333 v33->evt_B = v30; | |
16334 } | |
16335 } | |
16336 else | |
16337 { | |
16338 v33->evt_A = v30; | |
16339 } | |
16340 if ( v29 == 8 ) | |
16341 { | |
16342 if ( v30 == 78 ) | |
16343 { | |
16344 sub_4BD8B5(); | |
16345 ptr_507BC0->Release(); | |
16346 pParty->uFlags &= 0xFFFFFFFDu; | |
16347 if ( EnterHouse((enum HOUSE_TYPE)170) ) | |
16348 { | |
16349 pAudioPlayer->StopChannels(-1, -1); | |
16350 ptr_507BC0 = GUIWindow::Create(0, 0, 640, 480, WINDOW_HouseInterior, 170, 0); | |
16351 ptr_507BC0->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 1u, 0x31u, "", 0); | |
16352 ptr_507BC0->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 2u, 0x32u, "", 0); | |
16353 ptr_507BC0->CreateButton(0x124u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 3u, 0x33u, "", 0); | |
16354 ptr_507BC0->CreateButton(0x197u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 4u, 0x34u, "", 0); | |
16355 ptr_507BC0->CreateButton(0, 0, 0, 0, 1, 0, 0xB0u, 0, 9u, "", 0); | |
16356 ptr_F8B1E8 = pNPCTopics[90].pText; | |
16357 } | |
16358 } | |
16359 } | |
16360 ++v122; | |
16361 //v4 = v124; | |
16362 //v5 = pSomeEVT; | |
16363 //v6 = v123; | |
16364 //v7 = ""; | |
16365 break; | |
16366 case EVENT_NPCSetItem: | |
16367 sub_448518_npc_set_item(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), | |
16368 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8), _evt->v13); | |
16369 ++v122; | |
16370 //v4 = v124; | |
16371 //v5 = pSomeEVT; | |
16372 //v6 = v123; | |
16373 //v7 = ""; | |
16374 break; | |
16375 case EVENT_SetActorItem: | |
16376 Actor::GiveItem(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), | |
16377 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8), _evt->v13); | |
16378 ++v122; | |
16379 //v4 = v124; | |
16380 //v5 = pSomeEVT; | |
16381 //v6 = v123; | |
16382 //v7 = ""; | |
16383 break; | |
16384 case EVENT_SetNPCGroupNews: | |
16385 pNPCStats->pGroups_copy[_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8)] = _evt->v9 + ((uint)_evt->v10 << 8); | |
16386 ++v122; | |
16387 //v4 = v124; | |
16388 //v5 = pSomeEVT; | |
16389 //v6 = v123; | |
16390 //v7 = ""; | |
16391 break; | |
16392 case EVENT_SetActorGroup: | |
16393 __debugbreak(); | |
16394 *(&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); | |
16395 ++v122; | |
16396 //v4 = v124; | |
16397 //v5 = pSomeEVT; | |
16398 //v6 = v123; | |
16399 //v7 = ""; | |
16400 break; | |
16401 case EVENT_ChangeGroup: | |
16402 v38 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8); | |
16403 v39 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8); | |
16404 v40 = uNumActors; | |
16405 __debugbreak(); | |
16406 if ( (signed int)uNumActors > 0 ) | |
16407 { | |
16408 v41 = pActors;//[0].uGroup; | |
16409 do | |
16410 { | |
16411 if ( v41->uGroup == v38 ) | |
16412 v41->uGroup = v39; | |
16413 ++v41; | |
16414 --v40; | |
16415 } | |
16416 while ( v40 ); | |
16417 } | |
16418 ++v122; | |
16419 //v4 = v124; | |
16420 //v5 = pSomeEVT; | |
16421 //v6 = v123; | |
16422 //v7 = ""; | |
16423 break; | |
16424 case EVENT_ChangeGroupAlly: | |
16425 v42 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8); | |
16426 v43 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8); | |
16427 v44 = uNumActors; | |
16428 __debugbreak(); | |
16429 if ( (signed int)uNumActors > 0 ) | |
16430 { | |
16431 v45 = pActors;//[0].uAlly; | |
16432 do | |
16433 { | |
16434 if ( v45->uGroup == v42 ) | |
16435 v45->uAlly = v43; | |
16436 ++v45; | |
16437 --v44; | |
16438 } | |
16439 while ( v44 ); | |
16440 } | |
16441 ++v122; | |
16442 //v4 = v124; | |
16443 //v5 = pSomeEVT; | |
16444 //v6 = v123; | |
16445 //v7 = ""; | |
16446 break; | |
16447 case EVENT_MoveNPC: | |
16448 pNPCStats->pNewNPCData[_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8)].Location2D = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8); | |
16449 if ( ptr_507BC0 ) | |
16450 { | |
16451 v46 = ptr_507BC0->ptr_1C; | |
16452 if ( v46 == (void *)165 ) | |
16453 { | |
16454 sub_4BD8B5(); | |
16455 pVideoPlayer->Unload(); | |
16456 ptr_507BC0->Release(); | |
16457 pParty->uFlags &= 0xFFFFFFFDu; | |
16458 _5C3420_pDecoration = (LevelDecoration *)1; | |
16459 if ( EnterHouse((enum HOUSE_TYPE)165) ) | |
16460 { | |
16461 pAudioPlayer->PlaySound((SoundID)0, 0, 0, -1, 0, 0, 0, 0); | |
16462 v47 = GUIWindow::Create(0, 0, 640, 480, WINDOW_HouseInterior, 165, 0); | |
16463 ptr_507BC0 = v47; | |
16464 v48 = v47->pControlsHead; | |
16465 if ( v48 ) | |
16466 { | |
16467 do | |
16468 { | |
16469 v49 = v48->pNext; | |
16470 pAllocator->FreeChunk(v48); | |
16471 v48 = v49; | |
16472 } | |
16473 while ( v49 ); | |
16474 v47 = ptr_507BC0; | |
16475 } | |
16476 v47->pControlsHead = 0; | |
16477 ptr_507BC0->pControlsTail = 0; | |
16478 ptr_507BC0->uNumControls = 0; | |
16479 } | |
16480 } | |
16481 else | |
16482 { | |
16483 if ( v46 == (void *)553 ) | |
16484 pVideoPlayer->bLoopPlaying = 0; | |
16485 } | |
16486 } | |
16487 ++v122; | |
16488 //v4 = v124; | |
16489 //v5 = pSomeEVT; | |
16490 //v6 = v123; | |
16491 //v7 = ""; | |
16492 break; | |
16493 case EVENT_Jmp: | |
16494 //v124 = -1; | |
16495 v122 = _evt->v5 - 1; | |
16496 ++v122; | |
16497 //v4 = v124; | |
16498 //v5 = pSomeEVT; | |
16499 //v6 = v123; | |
16500 //v7 = ""; | |
16501 break; | |
16502 case EVENT_ShowFace: | |
16503 v50 = _evt->v5; | |
16504 if ( (unsigned __int8)v50 <= 3u ) | |
16505 { | |
16506 v117 = 0; | |
16507 v113 = _evt->v6; | |
16508 v53 = (unsigned __int8)v50; | |
16509 v52 = &pParty->pPlayers[v53]; | |
16510 v52->PlayEmotion((CHARACTER_EXPRESSION_ID)v113, v117); | |
16511 ++v122; | |
16512 //v4 = v124; | |
16513 //v5 = pSomeEVT; | |
16514 //v6 = v123; | |
16515 //v7 = ""; | |
16516 break; | |
16517 } | |
16518 if ( v50 == 4 ) | |
16519 { | |
16520 v117 = 0; | |
16521 v113 = _evt->v6; | |
16522 v52 = pPlayers[uActiveCharacter]; | |
16523 v52->PlayEmotion((CHARACTER_EXPRESSION_ID)v113, v117); | |
16524 ++v122; | |
16525 //v4 = v124; | |
16526 //v5 = pSomeEVT; | |
16527 //v6 = v123; | |
16528 //v7 = ""; | |
16529 break; | |
16530 } | |
16531 if ( v50 != 5 ) | |
16532 { | |
16533 v117 = 0; | |
16534 v113 = _evt->v6; | |
16535 v53 = rand() % 4; | |
16536 v52 = &pParty->pPlayers[v53]; | |
16537 v52->PlayEmotion((CHARACTER_EXPRESSION_ID)v113, v117); | |
16538 ++v122; | |
16539 //v4 = v124; | |
16540 //v5 = pSomeEVT; | |
16541 //v6 = v123; | |
16542 //v7 = ""; | |
16543 break; | |
16544 } | |
16545 v51 = pParty->pPlayers; | |
16546 do | |
16547 { | |
16548 v51->PlayEmotion((CHARACTER_EXPRESSION_ID)_evt->v6, 0); | |
16549 ++v51; | |
16550 } | |
16551 while ( (signed int)v51 < (signed int)pParty->pHirelings ); | |
16552 //LABEL_291: | |
16553 ++v122; | |
16554 //v4 = v124; | |
16555 //v5 = pSomeEVT; | |
16556 //v6 = v123; | |
16557 //v7 = ""; | |
16558 break; | |
16559 case EVENT_CharacterAnimation: | |
16560 v54 = _evt->v5; | |
16561 if ( (unsigned __int8)v54 <= 3u ) | |
16562 { | |
16563 v118 = 0; | |
16564 v114 = _evt->v6; | |
16565 v57 = (unsigned __int8)v54; | |
16566 goto LABEL_119; | |
16567 } | |
16568 if ( v54 == 4 ) | |
16569 { | |
16570 v118 = 0; | |
16571 v114 = _evt->v6; | |
16572 v56 = pPlayers[uActiveCharacter]; | |
16573 goto LABEL_120; | |
16574 } | |
16575 if ( v54 != 5 ) | |
16576 { | |
16577 v118 = 0; | |
16578 v114 = _evt->v6; | |
16579 v57 = rand() % 4; | |
16580 LABEL_119: | |
16581 v56 = &pParty->pPlayers[v57]; | |
16582 LABEL_120: | |
16583 v56->PlaySound((PlayerSpeech)v114, v118); | |
16584 ++v122; | |
16585 //v4 = v124; | |
16586 //v5 = pSomeEVT; | |
16587 //v6 = v123; | |
16588 //v7 = ""; | |
16589 break; | |
16590 } | |
16591 v55 = pParty->pPlayers; | |
16592 for (int iii = 0; iii < 4; ++iii) | |
16593 { | |
16594 v55->PlaySound((PlayerSpeech)_evt->v6, 0); | |
16595 ++v55; | |
16596 } | |
16597 //while ( (signed int)v55 < (signed int)pParty->pHirelings ); | |
16598 ++v122; | |
16599 //v4 = v124; | |
16600 //v5 = pSomeEVT; | |
16601 //v6 = v123; | |
16602 //v7 = ""; | |
16603 break; | |
16604 case EVENT_ForPartyMember: | |
16605 v127 = _evt->v5; | |
16606 ++v122; | |
16607 //v4 = v124; | |
16608 //v5 = pSomeEVT; | |
16609 //v6 = v123; | |
16610 //v7 = ""; | |
16611 break; | |
16612 case EVENT_SummonItem: | |
16613 sub_42F7EB_DropItemAt(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), | |
16614 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8), | |
16615 _evt->v13 + ((_evt->v14 + ((_evt->v15 + ((uint)_evt->v16 << 8)) << 8)) << 8), | |
16616 _evt->v17 + ((_evt->v18 + ((_evt->v19 + ((uint)_evt->v20 << 8)) << 8)) << 8), | |
16617 _evt->v21 + ((_evt->v22 + ((_evt->v23 + ((uint)_evt->v24 << 8)) << 8)) << 8), | |
16618 _evt->v25, _evt->v26, 0, 0); | |
16619 ++v122; | |
16620 //v4 = v124; | |
16621 //v5 = pSomeEVT; | |
16622 //v6 = v123; | |
16623 //v7 = ""; | |
16624 break; | |
16625 case EVENT_Compare: | |
16626 v58 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8); | |
16627 if ( v127 == 5 ) | |
16628 { | |
16629 v130 = 0; | |
16630 v59 = pParty->pPlayers; | |
16631 while ( 1 ) | |
16632 { | |
16633 LOBYTE(v60) = v59->CompareVariable((enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)), v58); | |
16634 if ( v60 ) | |
16635 break; | |
16636 ++v130; | |
16637 ++v59; | |
16638 if ( (signed int)v59 >= (signed int)pParty->pHirelings ) | |
16639 { | |
16640 ++v122; | |
16641 //v4 = v124; | |
16642 //v5 = pSomeEVT; | |
16643 //v6 = v123; | |
16644 //v7 = ""; | |
16645 break; | |
16646 } | |
16647 } | |
16648 LABEL_129: | |
16649 v11 = _evt->v11; | |
16650 goto LABEL_130; | |
16651 } | |
16652 if ( v127 < 0 ) | |
16653 goto LABEL_139; | |
16654 v61 = v127; | |
16655 if ( v127 <= 3 ) | |
16656 goto LABEL_137; | |
16657 if ( v127 == 4 ) | |
16658 { | |
16659 if ( uActiveCharacter ) | |
16660 { | |
16661 v6 = pPlayers[uActiveCharacter]; | |
16662 goto LABEL_138; | |
16663 } | |
16664 } | |
16665 else | |
16666 { | |
16667 if ( v127 != 6 ) | |
16668 goto LABEL_139; | |
16669 } | |
16670 v61 = rand() % 4; | |
16671 //v5 = pSomeEVT; | |
16672 LABEL_137: | |
16673 v6 = &pParty->pPlayers[v61]; | |
16674 LABEL_138: | |
16675 //v123 = v6; | |
16676 LABEL_139: | |
16677 LOBYTE(v62) = ((Player *)v6)->CompareVariable( | |
16678 (enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)), | |
16679 v58); | |
16680 LABEL_140: | |
16681 if ( v62 ) | |
16682 goto LABEL_129; | |
16683 ++v122; | |
16684 //v4 = v124; | |
16685 //v5 = pSomeEVT; | |
16686 //v6 = v123; | |
16687 //v7 = ""; | |
16688 break; | |
16689 case EVENT_IsActorAlive: | |
16690 v62 = IsActorAlive( | |
16691 _evt->v5, | |
16692 _evt->v6 + ((_evt->v7 + ((_evt->v8 + ((uint)_evt->v9 << 8)) << 8)) << 8), | |
16693 _evt->v10); | |
16694 goto LABEL_140; | |
16695 case EVENT_Substract: | |
16696 v63 = (void *)(_evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8)); | |
16697 if ( _evt->v5 + ((uint)_evt->v6 << 8) == VAR_PlayerItemInHands ) | |
16698 { | |
16699 v64 = 0; | |
16700 if ( (void *)pParty->pPickedItem.uItemID == v63 ) | |
16701 { | |
16702 pMouse->RemoveHoldingItem(); | |
16703 ++v122; | |
16704 //v4 = v124; | |
16705 //v5 = pSomeEVT; | |
16706 //v6 = v123; | |
16707 //v7 = ""; | |
16708 break; | |
16709 } | |
16710 v65 = 0; | |
16711 v66 = pPlayers[uActiveCharacter]; | |
16712 v67 = (int)v66->pInventoryIndices; | |
16713 do | |
16714 { | |
16715 if ( *(void **)&v66->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v67 + 5] == v63 ) | |
16716 { | |
16717 v66->RemoveItemAtInventoryIndex(v65); | |
16718 ++v122; | |
16719 //v4 = v124; | |
16720 //v5 = pSomeEVT; | |
16721 //v6 = v123; | |
16722 //v7 = ""; | |
16723 break; | |
16724 } | |
16725 ++v65; | |
16726 v67 += 4; | |
16727 } | |
16728 while ( (signed int)v65 < 126 ); | |
16729 v68 = 0; | |
16730 v69 = (int)&v66->pEquipment; | |
16731 do | |
16732 { | |
16733 if ( *(int *)v69 && *(void **)&v66->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v69 + 5] == v63 ) | |
16734 { | |
16735 *(&v66->pEquipment.uOffHand + v68) = 0; | |
16736 ++v122; | |
16737 //v4 = v124; | |
16738 //v5 = pSomeEVT; | |
16739 //v6 = v123; | |
16740 //v7 = ""; | |
16741 break; | |
16742 } | |
16743 ++v68; | |
16744 v69 += 4; | |
16745 } | |
16746 while ( v68 < 16 ); | |
16747 v125 = (signed int)&pPlayers[1]; | |
16748 while ( 1 ) | |
16749 { | |
16750 v70 = *(Player **)v125; | |
16751 if ( !v64 ) | |
16752 { | |
16753 v71 = 0; | |
16754 v72 = (int)v70->pInventoryIndices; | |
16755 do | |
16756 { | |
16757 if ( *(void **)&v70->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v72 + 5] == v63 ) | |
16758 { | |
16759 v70->RemoveItemAtInventoryIndex(v71); | |
16760 goto LABEL_169; | |
16761 } | |
16762 ++v71; | |
16763 v72 += 4; | |
16764 } | |
16765 while ( (signed int)v71 < 126 ); | |
16766 v73 = 0; | |
16767 v74 = (int)&v70->pEquipment; | |
16768 while ( !*(int *)v74 | |
16769 || *(void **)&v70->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v74 + 5] != v63 ) | |
16770 { | |
16771 ++v73; | |
16772 v74 += 4; | |
16773 if ( v73 >= 16 ) | |
16774 goto LABEL_170; | |
16775 } | |
16776 *(&v70->pEquipment.uOffHand + v73) = 0; | |
16777 LABEL_169: | |
16778 v64 = 1; | |
16779 } | |
16780 LABEL_170: | |
16781 v125 += 4; | |
16782 if ( v125 > (signed int)&pPlayers[4] ) | |
16783 { | |
16784 ++v122; | |
16785 //v4 = v124; | |
16786 //v5 = pSomeEVT; | |
16787 //v6 = v123; | |
16788 //v7 = ""; | |
16789 break; | |
16790 } | |
16791 } | |
16792 } | |
16793 v75 = v127; | |
16794 if ( v127 != 5 ) | |
16795 { | |
16796 if ( v127 < 0 ) | |
16797 goto LABEL_183; | |
16798 if ( v127 > 3 ) | |
16799 { | |
16800 if ( v127 != 4 ) | |
16801 { | |
16802 if ( v127 == 6 ) | |
16803 goto LABEL_180; | |
16804 LABEL_183: | |
16805 ((Player *)v6)->SubtractVariable((enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)), v63); | |
16806 ++v122; | |
16807 //v4 = v124; | |
16808 //v5 = pSomeEVT; | |
16809 //v6 = v123; | |
16810 //v7 = ""; | |
16811 break; | |
16812 } | |
16813 if ( uActiveCharacter ) | |
16814 { | |
16815 v6 = pPlayers[uActiveCharacter]; | |
16816 goto LABEL_182; | |
16817 } | |
16818 LABEL_180: | |
16819 v75 = rand() % 4; | |
16820 //v5 = pSomeEVT; | |
16821 } | |
16822 v6 = &pParty->pPlayers[v75]; | |
16823 LABEL_182: | |
16824 //v123 = v6; | |
16825 goto LABEL_183; | |
16826 } | |
16827 v76 = pParty->pPlayers; | |
16828 v130 = 4; | |
16829 do | |
16830 { | |
16831 v76->SubtractVariable( | |
16832 (enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)), | |
16833 v63); | |
16834 ++v76; | |
16835 } | |
16836 while ( (signed int)v76 < (signed int)pParty->pHirelings ); | |
16837 ++v122; | |
16838 //v4 = v124; | |
16839 //v5 = pSomeEVT; | |
16840 //v6 = v123; | |
16841 //v7 = ""; | |
16842 break; | |
16843 case EVENT_Set: | |
16844 v77 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8); | |
16845 v78 = v127; | |
16846 if ( v127 != 5 ) | |
16847 { | |
16848 if ( v127 < 0 ) | |
16849 goto LABEL_197; | |
16850 if ( v127 > 3 ) | |
16851 { | |
16852 if ( v127 != 4 ) | |
16853 { | |
16854 if ( v127 == 6 ) | |
16855 goto LABEL_194; | |
16856 LABEL_197: | |
16857 ((Player *)v6)->SetVariable((enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)), v77); | |
16858 ++v122; | |
16859 //v4 = v124; | |
16860 //v5 = pSomeEVT; | |
16861 //v6 = v123; | |
16862 //v7 = ""; | |
16863 break; | |
16864 } | |
16865 if ( uActiveCharacter ) | |
16866 { | |
16867 v6 = pPlayers[uActiveCharacter]; | |
16868 goto LABEL_196; | |
16869 } | |
16870 LABEL_194: | |
16871 v78 = rand() % 4; | |
16872 //v5 = pSomeEVT; | |
16873 } | |
16874 v6 = &pParty->pPlayers[v78]; | |
16875 LABEL_196: | |
16876 //v123 = v6; | |
16877 goto LABEL_197; | |
16878 } | |
16879 v79 = pParty->pPlayers; | |
16880 v130 = 4; | |
16881 do | |
16882 { | |
16883 v79->SetVariable( | |
16884 (enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)), | |
16885 v77); | |
16886 ++v79; | |
16887 } | |
16888 while ( (signed int)v79 < (signed int)pParty->pHirelings ); | |
16889 ++v122; | |
16890 //v4 = v124; | |
16891 //v5 = pSomeEVT; | |
16892 //v6 = v123; | |
16893 //v7 = ""; | |
16894 break; | |
16895 case EVENT_Add: | |
16896 v80 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8); | |
16897 v81 = v127; | |
16898 if ( v127 != 5 ) | |
16899 { | |
16900 if ( v127 < 0 ) | |
16901 goto LABEL_211; | |
16902 if ( v127 > 3 ) | |
16903 { | |
16904 if ( v127 != 4 ) | |
16905 { | |
16906 if ( v127 == 6 ) | |
16907 goto LABEL_208; | |
16908 LABEL_211: | |
16909 ((Player *)v6)->AddVariable( | |
16910 (enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)), | |
16911 v80); | |
16912 goto LABEL_212; | |
16913 } | |
16914 if ( uActiveCharacter ) | |
16915 { | |
16916 v6 = pPlayers[uActiveCharacter]; | |
16917 goto LABEL_210; | |
16918 } | |
16919 LABEL_208: | |
16920 v81 = rand() % 4; | |
16921 //v5 = pSomeEVT; | |
16922 } | |
16923 v6 = &pParty->pPlayers[v81]; | |
16924 LABEL_210: | |
16925 //v123 = v6; | |
16926 goto LABEL_211; | |
16927 } | |
16928 v82 = pParty->pPlayers; | |
16929 v130 = 4; | |
16930 do | |
16931 { | |
16932 v82->AddVariable( | |
16933 (enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)), | |
16934 v80); | |
16935 ++v82; | |
16936 } | |
16937 while ( (signed int)v82 < (signed int)pParty->pHirelings ); | |
16938 LABEL_212: | |
16939 v83 = _evt->v5 + ((uint)_evt->v6 << 8); | |
16940 if ( v83 == 21 || v83 == 22 || v83 == 23 || v83 == 24 ) | |
16941 viewparams->bRedrawGameUI = 1; | |
16942 ++v122; | |
16943 //v4 = v124; | |
16944 //v5 = pSomeEVT; | |
16945 //v6 = v123; | |
16946 //v7 = ""; | |
16947 break; | |
16948 case EVENT_InputString: | |
16949 if ( !dword_597F18 ) | |
16950 { | |
16951 strcpy( | |
16952 GameUI_StatusBar_TimedString, | |
16953 &pLevelStr[pLevelStrOffsets[_evt->v5 | |
16954 + ((_evt->v6 | |
16955 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8)]]); | |
16956 v105 = v122; | |
16957 v121 = 26; | |
16958 LABEL_295: | |
16959 sub_4451A8_press_any_key(uEventID, v105, v121); | |
16960 LABEL_301: | |
16961 if ( v133 == 1 ) | |
16962 LABEL_302: | |
16963 OnMapLeave(); | |
16964 return; | |
16965 } | |
16966 v84 = _evt->v13 + ((_evt->v14 + ((_evt->v15 + ((uint)_evt->v16 << 8)) << 8)) << 8); | |
16967 if ( !_strcmpi( | |
16968 GameUI_StatusBar_TimedString, | |
16969 &pLevelStr[pLevelStrOffsets[_evt->v9 | |
16970 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8)]]) | |
16971 || !_strcmpi(GameUI_StatusBar_TimedString, &pLevelStr[pLevelStrOffsets[v84]]) ) | |
16972 { | |
16973 v11 = _evt->v17; | |
16974 LABEL_130: | |
16975 //v124 = -1; | |
16976 LABEL_131: | |
16977 v122 = v11 - 1; | |
16978 } | |
16979 ++v122; | |
16980 //v4 = v124; | |
16981 //v5 = pSomeEVT; | |
16982 //v6 = v123; | |
16983 //v7 = ""; | |
16984 break; | |
16985 case EVENT_RandomGoTo: | |
16986 //v124 = -1; | |
16987 v11 = (unsigned __int8)*(&_evt->v5 + rand() % ((_evt->v5 != 0) + (_evt->v6 != 0) + (_evt->v7 != 0) + (_evt->v8 != 0) + (_evt->v9 != 0) | |
16988 + (_evt->v10 != 0))); | |
16989 goto LABEL_131; | |
16990 case EVENT_ReceiveDamage: | |
16991 v85 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8); | |
16992 v86 = _evt->v5; | |
16993 if ( (unsigned __int8)v86 <= 3u ) | |
16994 { | |
16995 v119 = _evt->v6; | |
16996 v115 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8); | |
16997 v89 = (unsigned __int8)v86; | |
16998 goto LABEL_233; | |
16999 } | |
17000 if ( v86 == 4 ) | |
17001 { | |
17002 if ( !uActiveCharacter ) | |
17003 { | |
17004 ++v122; | |
17005 //v4 = v124; | |
17006 //v5 = pSomeEVT; | |
17007 //v6 = v123; | |
17008 //v7 = ""; | |
17009 break; | |
17010 } | |
17011 v119 = _evt->v6; | |
17012 v88 = pPlayers[uActiveCharacter]; | |
17013 v115 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8); | |
17014 goto LABEL_234; | |
17015 } | |
17016 if ( v86 != 5 ) | |
17017 { | |
17018 v119 = _evt->v6; | |
17019 v115 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v1 << 8)) << 8)) << 8); | |
17020 v89 = rand() % 4; | |
17021 LABEL_233: | |
17022 v88 = &pParty->pPlayers[v89]; | |
17023 LABEL_234: | |
17024 v88->ReceiveDamage(v115, v119); | |
17025 ++v122; | |
17026 //v4 = v124; | |
17027 //v5 = pSomeEVT; | |
17028 //v6 = v123; | |
17029 //v7 = ""; | |
17030 break; | |
17031 } | |
17032 v87 = pParty->pPlayers; | |
17033 do | |
17034 { | |
17035 v87->ReceiveDamage(v85, _evt->v6); | |
17036 ++v87; | |
17037 } | |
17038 while ( (signed int)v87 < (signed int)pParty->pHirelings ); | |
17039 ++v122; | |
17040 //v4 = v124; | |
17041 //v5 = pSomeEVT; | |
17042 //v6 = v123; | |
17043 //v7 = ""; | |
17044 break; | |
17045 case EVENT_ToggleIndoorLight: | |
17046 pIndoor->ToggleLight(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), _evt->v9); | |
17047 ++v122; | |
17048 //v4 = v124; | |
17049 //v5 = pSomeEVT; | |
17050 //v6 = v123; | |
17051 //v7 = ""; | |
17052 break; | |
17053 case EVENT_SetFacesBit: | |
17054 sub_44892E_set_faces_bit(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), | |
17055 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8), _evt->v13); | |
17056 ++v122; | |
17057 //v4 = v124; | |
17058 //v5 = pSomeEVT; | |
17059 //v6 = v123; | |
17060 //v7 = ""; | |
17061 break; | |
17062 case EVENT_ToggleChestFlag: | |
17063 Chest::ToggleFlag(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), | |
17064 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8), _evt->v13); | |
17065 ++v122; | |
17066 //v4 = v124; | |
17067 //v5 = pSomeEVT; | |
17068 //v6 = v123; | |
17069 //v7 = ""; | |
17070 break; | |
17071 case EVENT_ToggleActorFlag: | |
17072 Actor::ToggleFlag(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), | |
17073 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8), _evt->v13); | |
17074 ++v122; | |
17075 //v4 = v124; | |
17076 //v5 = pSomeEVT; | |
17077 //v6 = v123; | |
17078 //v7 = ""; | |
17079 break; | |
17080 case EVENT_ToggleActorGroupFlag: | |
17081 ToggleActorGroupFlag( | |
17082 _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), | |
17083 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8), | |
17084 _evt->v13); | |
17085 ++v122; | |
17086 //v4 = v124; | |
17087 //v5 = pSomeEVT; | |
17088 //v6 = v123; | |
17089 //v7 = ""; | |
17090 break; | |
17091 case EVENT_SetSnow: | |
17092 if ( !_evt->v5 ) | |
17093 pWeather->bRenderSnow = _evt->v6 != 0; | |
17094 ++v122; | |
17095 //v4 = v124; | |
17096 //v5 = pSomeEVT; | |
17097 //v6 = v123; | |
17098 //v7 = ""; | |
17099 break; | |
17100 case EVENT_StatusText: | |
17101 v90 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8); | |
17102 if ( _5C3420_pDecoration ) | |
17103 { | |
17104 if ( _5C3420_pDecoration == (LevelDecoration *)1 ) | |
17105 { | |
17106 ptr_F8B1E8 = pNPCTopics[v90-1].pText;//(&dword_721664)[8 * v90]; | |
17107 ++v122; | |
17108 //v4 = v124; | |
17109 //v5 = pSomeEVT; | |
17110 //v6 = v123; | |
17111 //v7 = ""; | |
17112 break; | |
17113 } | |
17114 if ( a3 == 1 ) | |
17115 { | |
17116 v91 = pNPCTopics[v90-1].pText;//(&dword_721664)[8 * v90]; | |
17117 //LABEL_248: | |
17118 ShowStatusBarString(v91, 2u); | |
17119 ++v122; | |
17120 //v4 = v124; | |
17121 //v5 = pSomeEVT; | |
17122 //v6 = v123; | |
17123 //v7 = ""; | |
17124 break; | |
17125 } | |
17126 } | |
17127 else | |
17128 { | |
17129 if ( a3 == 1 ) | |
17130 { | |
17131 v91 = &pLevelStr[pLevelStrOffsets[v90]]; | |
17132 ShowStatusBarString(v91, 2u); | |
17133 ++v122; | |
17134 //v4 = v124; | |
17135 //v5 = pSomeEVT; | |
17136 //v6 = v123; | |
17137 //v7 = ""; | |
17138 break; | |
17139 } | |
17140 } | |
17141 ++v122; | |
17142 //v4 = v124; | |
17143 //v5 = pSomeEVT; | |
17144 //v6 = v123; | |
17145 //v7 = ""; | |
17146 break; | |
17147 case EVENT_ShowMessage: | |
17148 v92 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8); | |
17149 if ( _5C3420_pDecoration ) | |
17150 { | |
17151 v93 = (char *)pNPCTopics[v92-1].pText;//(&dword_721664)[8 * v92]; | |
17152 byte_5B0938[0] = 0; | |
17153 ptr_F8B1E8 = v93; | |
17154 } | |
17155 else | |
17156 { | |
17157 strcpy(byte_5B0938, &pLevelStr[pLevelStrOffsets[v92]]); | |
17158 } | |
17159 ++v122; | |
17160 //v4 = v124; | |
17161 //v5 = pSomeEVT; | |
17162 //v6 = v123; | |
17163 //v7 = ""; | |
17164 break; | |
17165 case EVENT_CastSpell: | |
17166 sub_448DF8_cast_spell(_evt->v5, _evt->v6, _evt->v7, _evt->v8 + ((_evt->v9 + ((_evt->v10 + ((uint)_evt->v11 << 8)) << 8)) << 8), | |
17167 _evt->v12 + ((_evt->v13 + ((_evt->v14 + ((uint)_evt->v15 << 8)) << 8)) << 8), | |
17168 _evt->v16 + ((_evt->v17 + ((_evt->v18 + ((uint)_evt->v19 << 8)) << 8)) << 8), | |
17169 _evt->v20 + ((_evt->v21 + ((_evt->v22 + ((uint)_evt->v23 << 8)) << 8)) << 8), | |
17170 _evt->v24 + ((_evt->v25 + ((_evt->v26 + ((uint)_evt->v27 << 8)) << 8)) << 8), | |
17171 _evt->v28 + ((_evt->v29 + ((_evt->v30 + ((uint)_evt->v31 << 8)) << 8)) << 8)); | |
17172 ++v122; | |
17173 //v4 = v124; | |
17174 //v5 = pSomeEVT; | |
17175 //v6 = v123; | |
17176 //v7 = ""; | |
17177 break; | |
17178 case EVENT_SetTexture: | |
17179 sub_44861E_set_texture(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), (char *)&_evt->v9); | |
17180 ++v122; | |
17181 //v4 = v124; | |
17182 //v5 = pSomeEVT; | |
17183 //v6 = v123; | |
17184 //v7 = ""; | |
17185 break; | |
17186 case EVENT_SetSprite: | |
17187 SetDecorationSprite(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), _evt->v9, (char *)&_evt->v10); | |
17188 ++v122; | |
17189 //v4 = v124; | |
17190 //v5 = pSomeEVT; | |
17191 //v6 = v123; | |
17192 //v7 = ""; | |
17193 break; | |
17194 case EVENT_SummonMonsters: | |
17195 sub_448CF4_spawn_monsters(_evt->v5, _evt->v6, _evt->v7, | |
17196 _evt->v8 + ((_evt->v9 + ((_evt->v10 + ((uint)_evt->v11 << 8)) << 8)) << 8), | |
17197 _evt->v12 + ((_evt->v13 + ((_evt->v14 + ((uint)_evt->v15 << 8)) << 8)) << 8), | |
17198 _evt->v16 + ((_evt->v17 + ((_evt->v18 + ((uint)_evt->v19 << 8)) << 8)) << 8), | |
17199 _evt->v20 + ((_evt->v21 + ((_evt->v22 + ((uint)_evt->v23 << 8)) << 8)) << 8), | |
17200 _evt->v24 + ((_evt->v25 + ((_evt->v26 + ((uint)_evt->v27 << 8)) << 8)) << 8)); | |
17201 ++v122; | |
17202 //v4 = v124; | |
17203 //v5 = pSomeEVT; | |
17204 //v6 = v123; | |
17205 //v7 = ""; | |
17206 break; | |
17207 case EVENT_MouseOver: | |
17208 case EVENT_LocationName: | |
17209 --v122; | |
17210 ++v122; | |
17211 //v4 = v124; | |
17212 //v5 = pSomeEVT; | |
17213 //v6 = v123; | |
17214 //v7 = ""; | |
17215 break; | |
17216 case EVENT_ChangeDoorState: | |
17217 sub_449A49_door_switch_animation(_evt->v5, _evt->v6); | |
17218 ++v122; | |
17219 //v4 = v124; | |
17220 //v5 = pSomeEVT; | |
17221 //v6 = v123; | |
17222 //v7 = ""; | |
17223 break; | |
17224 case EVENT_OpenChest: | |
17225 if ( !Chest::Open(_evt->v5) ) | |
17226 goto LABEL_301; | |
17227 ++v122; | |
17228 //v4 = v124; | |
17229 //v5 = pSomeEVT; | |
17230 //v6 = v123; | |
17231 //v7 = ""; | |
17232 break; | |
17233 case EVENT_MoveToMap: | |
17234 v94 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8); | |
17235 v135 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8); | |
17236 v132 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8); | |
17237 v126 = _evt->v13 + ((_evt->v14 + ((_evt->v15 + ((uint)_evt->v16 << 8)) << 8)) << 8); | |
17238 v129 = _evt->v17 + ((_evt->v18 + ((_evt->v19 + ((uint)_evt->v20 << 8)) << 8)) << 8); | |
17239 v95 = _evt->v21 + ((_evt->v22 + ((_evt->v23 + ((uint)_evt->v24 << 8)) << 8)) << 8); | |
17240 v96 = _evt->v25; | |
17241 v97 = v96 + ((_evt->v26 + ((_evt->v27 + ((uint)_evt->v28 << 8)) << 8)) << 8); | |
17242 v134 = v96 + ((_evt->v26 + ((_evt->v27 + ((uint)_evt->v28 << 8)) << 8)) << 8); | |
17243 if ( _evt->v29 || _evt->v30 ) | |
17244 { | |
17245 if ( pRenderer->pRenderD3D && !pRenderer->bWindowMode ) | |
17246 pRenderer->_49FD3A(); | |
17247 sub_444839_move_map(_evt->v29, _evt->v30, v135, v132, v126, v129, v95, v134, (char *)&_evt->v31); | |
17248 dword_5C3418 = uEventID; | |
17249 dword_5C341C = v122 + 1; | |
17250 goto LABEL_301; | |
17251 } | |
17252 _5B65AC_npcdata_fame_or_other = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8); | |
17253 _5B65A8_npcdata_uflags_or_other = v94; | |
17254 _5B65B0_npcdata_rep_or_other = v126; | |
17255 if ( v129 == -1 ) | |
17256 { | |
17257 v98 = _5B65B4_npcdata_loword_house_or_other; | |
17258 } | |
17259 else | |
17260 { | |
17261 v98 = v129 & stru_5C6E00->uDoublePiMask; | |
17262 _5B65B4_npcdata_loword_house_or_other = v129 & stru_5C6E00->uDoublePiMask; | |
17263 } | |
17264 v99 = (char *)&_evt->v31; | |
17265 _5B65B8_npcdata_hiword_house_or_other = v95; | |
17266 dword_5B65BC = v97; | |
17267 v100 = v94 | v132 | v126 | v95 | v97 | v98; | |
17268 dword_5B65C0 = v100; | |
17269 if ( *v99 == 48 ) | |
17270 { | |
17271 if ( v100 ) | |
17272 { | |
17273 pParty->vPosition.x = v135; | |
17274 pParty->vPosition.y = v132; | |
17275 pParty->vPosition.z = v126; | |
17276 pParty->uFallStartY = v126; | |
17277 if ( _5B65B4_npcdata_loword_house_or_other != -1 ) | |
17278 pParty->sRotationY = _5B65B4_npcdata_loword_house_or_other; | |
17279 _5B65B4_npcdata_loword_house_or_other = -1; | |
17280 v120 = 0; | |
17281 v116 = 0; | |
17282 v111 = 0; | |
17283 v110 = 0; | |
17284 v109 = -1; | |
17285 v108 = 0; | |
17286 v107 = 0; | |
17287 pParty->sRotationX = v95; | |
17288 pParty->uFallSpeed = v134; | |
17289 dword_5B65C0 = 0; | |
17290 dword_5B65BC = 0; | |
17291 _5B65B8_npcdata_hiword_house_or_other = 0; | |
17292 _5B65B0_npcdata_rep_or_other = 0; | |
17293 _5B65AC_npcdata_fame_or_other = 0; | |
17294 _5B65A8_npcdata_uflags_or_other = 0; | |
17295 v106 = 232; | |
17296 LABEL_280: | |
17297 pAudioPlayer->PlaySound((SoundID)v106, v107, v108, v109, v110, v111, v116, v120); | |
17298 } | |
17299 } | |
17300 else | |
17301 { | |
17302 pGameLoadingUI_ProgressBar->uType = (GUIProgressBar::Type)((_5C3420_pDecoration == 0) + 1); | |
17303 sub_44987B(v99, 0); | |
17304 v133 = 1; | |
17305 if ( pCurrentScreen == SCREEN_HOUSE ) | |
17306 { | |
17307 if ( uGameState == 2 ) | |
17308 { | |
17309 pAudioPlayer->StopChannels(-1, -1); | |
17310 dword_F8B19C = 0; | |
17311 while ( sub_4BD8B5() ) | |
17312 ; | |
17313 pVideoPlayer->Unload(); | |
17314 ptr_507BC0->Release(); | |
17315 ptr_507BC0 = 0; | |
17316 if ( pMessageQueue_50CBD0->uNumMessages ) | |
17317 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
17318 pCurrentScreen = SCREEN_GAME; | |
17319 viewparams->bRedrawGameUI = 1; | |
17320 array_5913D8[6] = 0; | |
17321 pDialogueWindow->Release(); | |
17322 dword_F8B19C = 0; | |
17323 pDialogueWindow = 0; | |
17324 pIcons_LOD->_40F9C5(); | |
17325 } | |
17326 goto LABEL_302; | |
17327 } | |
17328 } | |
17329 ++v122; | |
17330 //v4 = v124; | |
17331 //v5 = pSomeEVT; | |
17332 //v6 = v123; | |
17333 //v7 = ""; | |
17334 break; | |
17335 case EVENT_PlaySound: | |
17336 v120 = 0; | |
17337 v116 = 0; | |
17338 v111 = 0; | |
17339 v110 = _evt->v13 + ((_evt->v14 + ((_evt->v15 + ((uint)_evt->v16 << 8)) << 8)) << 8); | |
17340 v109 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8); | |
17341 v108 = 0; | |
17342 v107 = 0; | |
17343 v106 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8); | |
17344 goto LABEL_280; | |
17345 case EVENT_GiveItem: | |
17346 item.Reset(); | |
17347 //v101 = &pSomeEVT[v9]; | |
17348 v102 = _evt->v7 | |
17349 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8); | |
17350 pItemsTable->GenerateItem(_evt->v5, _evt->v6, &item); | |
17351 if ( v102 ) | |
17352 item.uItemID = v102; | |
17353 pParty->SetHoldingItem(&item); | |
17354 ++v122; | |
17355 //v4 = v124; | |
17356 //v5 = pSomeEVT; | |
17357 //v6 = v123; | |
17358 //v7 = ""; | |
17359 break; | |
17360 case EVENT_SpeakInHouse: | |
17361 v103 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8); | |
17362 if ( EnterHouse((enum HOUSE_TYPE)(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8))) ) | |
17363 { | |
17364 if ( pRenderer->pRenderD3D && !pRenderer->bWindowMode ) | |
17365 pRenderer->_49FD3A(); | |
17366 pAudioPlayer->PlaySound((SoundID)0, 0, 0, -1, 0, 0, 0, 0); | |
17367 pAudioPlayer->PlaySound(SOUND_EnteringAHouse, 814, 0, -1, 0, 0, 0, 0); | |
17368 v104 = 187; | |
17369 if ( uCurrentHouse_Animation != 167 ) | |
17370 v104 = v103; | |
17371 ptr_507BC0 = GUIWindow::Create(0, 0, 640, 480, WINDOW_HouseInterior, v104, 0); | |
17372 ptr_507BC0->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 1u, 0x31u, "", 0); | |
17373 ptr_507BC0->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 2u, 0x32u, "", 0); | |
17374 ptr_507BC0->CreateButton(0x124u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 3u, 0x33u, "", 0); | |
17375 ptr_507BC0->CreateButton(0x197u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 4u, 0x34u, "", 0); | |
17376 ptr_507BC0->CreateButton(0, 0, 0, 0, 1, 0, 0xB0u, 0, 9u, "", 0); | |
17377 } | |
17378 ++v122; | |
17379 //v4 = v124; | |
17380 //v5 = pSomeEVT; | |
17381 //v6 = v123; | |
17382 //v7 = ""; | |
17383 break; | |
17384 case EVENT_PressAnyKey: | |
17385 v121 = 33; | |
17386 v105 = v122 + 1; | |
17387 goto LABEL_295; | |
17388 case EVENT_Exit: | |
17389 goto LABEL_301; | |
17390 default: | |
17391 ++v122; | |
17392 //v4 = v124; | |
17393 //v5 = pSomeEVT; | |
17394 //v6 = v123; | |
17395 //v7 = ""; | |
17396 break; | |
17397 } | |
17398 } | |
17399 //++v4; | |
17400 //v124 = v4; | |
17401 //if ( v4 >= (signed int)uSomeEVT_NumEvents ) | |
17402 //goto LABEL_301; | |
17403 //} | |
17404 } | |
17405 } | 15806 } |
17406 | 15807 |
17407 | 15808 |
17408 | 15809 |
17409 //----- (0044861E) -------------------------------------------------------- | 15810 //----- (0044861E) -------------------------------------------------------- |