Mercurial > might-and-magic-trilogy
diff mm7_3.cpp @ 86:c83d06692295
Слияние
author | Ritor1 |
---|---|
date | Mon, 22 Oct 2012 09:20:49 +0600 |
parents | f4450ff595fe |
children | 916bec351934 bcc051713d20 |
line wrap: on
line diff
--- a/mm7_3.cpp Mon Oct 22 09:18:21 2012 +0600 +++ b/mm7_3.cpp Mon Oct 22 09:20:49 2012 +0600 @@ -5862,156 +5862,182 @@ } //----- (0047730C) -------------------------------------------------------- -signed int __stdcall const_1(int a1) +int __fastcall const_1(int a1, int) { return 1; } // 47730C: using guessed type int __stdcall const_1(int); //----- (0047732C) -------------------------------------------------------- -int NPCStats::InitializeAdditionalNPCs(NPCData *a2, int a3, int a4, int a5) -{ - NPCStats *v5; // ebx@1 +bool NPCStats::InitializeAdditionalNPCs(NPCData *a2, int a3, int a4, int a5) +{ + //NPCStats *v5; // ebx@1 signed __int64 v6; // qax@1 int v7; // esi@1 int v8; // edx@1 - int v9; // eax@1 - unsigned int v10; // ecx@23 - int v11; // edx@28 - int v12; // esi@37 - int v13; // edx@37 - int v14; // ecx@37 - int v15; // eax@37 - int v16; // edx@37 + NPCData *v9; // edi@1 + int v10; // eax@1 + //int v11; // eax@23 + int v12; // ecx@23 + int v13; // edx@28 + int v14; // esi@37 + int v15; // edx@37 + int v16; // ecx@37 + int v17; // eax@37 + int v18; // edx@37 signed int result; // eax@39 - int v18; // [sp+Ch] [bp-Ch]@1 - signed int v19; // [sp+10h] [bp-8h]@1 - signed int v20; // [sp+14h] [bp-4h]@1 - int v21; // [sp+24h] [bp+Ch]@1 - - v21 = a3 - 1; - v5 = this; - v6 = (signed __int64)((double)v21 * -0.33333334); - v7 = *((char *)&unk_4E83B0 - v6); - v18 = *((char *)&unk_4E8408 - v6); - v8 = rand() % (signed int)this->uNumNPCNames[v7]; + int v20; // [sp+Ch] [bp-Ch]@1 + signed int v21; // [sp+10h] [bp-8h]@1 + signed int v22; // [sp+14h] [bp-4h]@1 + int v23; // [sp+24h] [bp+Ch]@1 + + + v23 = a3 - 1; + //v5 = this; + v6 = (signed __int64)((double)v23 * -0.33333334); + v7 = (unsigned __int8)byte_4E8394[-(_DWORD)v6 + 28]; + v20 = (unsigned __int8)byte_4E8394[-(_DWORD)v6 + 116]; + v8 = rand() % uNumNPCNames[v7]; + v9 = a2; a2->uSex = v7; - a2->pName = (char *)*((int *)&v5->pNPCData[0].pName + v7 + 2 * v8 + 19038); - v9 = 0; - v20 = 0; - v19 = 0; + a2->pName = pNPCNames[v8][v7]; + v10 = 0; + v22 = 0; + v21 = 0; + while ( 1 ) { - if ( v18 == v9 ) - { - if ( v7 == v9 ) - { - v21 = 2; - } - else - { - if ( v7 - v9 == 1 ) - v21 = 201; - } - } - else - { - switch ( v18 - v9 ) + if ( v20 == v10 ) + { + if ( v7 == v10 ) + { + v23 = 2; + a2 = (NPCData *)100; + } + else + { + if ( v7 - v10 == 1 ) + { + v23 = 201; + a2 = (NPCData *)250; + } + } + } + else + { + switch ( v20 - v10 ) { case 1: - if ( v7 == v9 ) - { - v21 = 400; + if ( v7 == v10 ) + { + v23 = 400; + a2 = (NPCData *)430; } else { - if ( v7 - v9 == 1 ) - v21 = 460; + if ( v7 - v10 == 1 ) + { + v23 = 460; + a2 = (NPCData *)490; + } } break; case 2: - if ( v7 == v9 ) - { - v21 = 500; + if ( v7 == v10 ) + { + v23 = 500; + a2 = (NPCData *)520; } else { - if ( v7 - v9 == 1 ) - v21 = 530; + if ( v7 - v10 == 1 ) + { + v23 = 530; + a2 = (NPCData *)550; + } } break; case 3: - if ( v7 == v9 ) - { - v21 = 300; + if ( v7 == v10 ) + { + v23 = 300; + a2 = (NPCData *)330; } else { - if ( v7 - v9 == 1 ) - v21 = 360; + if ( v7 - v10 == 1 ) + { + v23 = 360; + a2 = (NPCData *)387; + } } break; } } - rand(); - if ( const_1(v18) == 1 ) - v19 = 1; - ++v20; - if ( v20 >= 4 ) - { - v10 = v21; - v19 = 1; - } - if ( v19 ) + v12 = v23 + rand() % ((int)a2 - v23 + 1); + if ( const_1(v12, v7) == 1 ) + v21 = 1; + ++v22; + if ( v22 >= 4 ) + { + v12 = v23; + v21 = 1; + } + if ( v21 ) break; - v9 = 0; - } - a2->uPortraitID = v10; - a2->uFlags = 0; - a2->fame = 0; - v11 = rand() % 100 + 1; - if ( v11 >= 60 ) - { - if ( v11 >= 90 ) - { - if ( v11 >= 95 ) - { - if ( v11 >= 98 ) - a2->rep = -600; + v10 = 0; + } + + v9->uPortraitID = v12; + v9->uFlags = 0; + v9->fame = 0; + v13 = rand() % 100 + 1; + + if ( v13 >= 60 ) + { + if ( v13 >= 90 ) + { + if ( v13 >= 95 ) + { + if ( v13 >= 98 ) + v9->rep = -600; else - a2->rep = 400; - } - else - { - a2->rep = -300; - } - } - else - { - a2->rep = 200; - } - } - else - { - a2->rep = 0; - } - v12 = (int)((char *)v5 + 64 * a5); - v13 = rand() % *(int *)(v12 + 91460); - v14 = 0; - v15 = 0; - v16 = v13 + 1; - if ( v16 > 0 ) - { - do - v14 += *(char *)(v12 + v15++ + 91464); - while ( v14 < v16 ); - } - a2->uProfession = v15 - 1; - a2->house = a4; - result = 1; - a2->field_24 = 1; - a2->joins = 1; - return result; + v9->rep = 400; + } + else + { + v9->rep = -300; + } + } + else + { + v9->rep = 200; + } + } + else + { + v9->rep = 0; + } + + //v14 = (int)((char *)v5 + 64 * a5); + //v15 = rand() % *(_DWORD *)(v14 + 91460); + v15 = rand() % array_16544[a5].field_0; + v16 = 0; + v17 = 0; + v18 = v15 + 1; + + if ( v18 > 0 ) + { + do + //v14 += *(char *)(v14 + v17++ + 0x16548); + v16 += array_16544[a5].field_4[v17++]; + while ( v16 < v18 ); + } + v9->uProfession = v17 - 1; + v9->house = a4; + v9->field_24 = 1; + v9->joins = 1; + return true; } // 47730C: using guessed type int __stdcall const_1(int); @@ -15422,19 +15448,15 @@ while ( v0 < (signed int)uLevelEVT_NumEvents ); } } -// 597F18: using guessed type int dword_597F18; + //----- (00443FDC) -------------------------------------------------------- void OnMapLoad() { - signed __int64 v0; // qax@0 - int v1; // esi@1 - Event *v2; // ebx@2 stru176 *v3; // esi@7 __int16 v4; // cx@9 __int16 v5; // di@9 int v6; // eax@9 - int v7; // ecx@13 signed __int64 v8; // qax@26 unsigned int v9; // ecx@26 signed __int64 v10; // qax@26 @@ -15448,9 +15470,7 @@ unsigned __int64 v18; // [sp+Ch] [bp-44h]@12 signed __int64 v19; // [sp+14h] [bp-3Ch]@26 unsigned __int64 v20; // [sp+1Ch] [bp-34h]@7 - Event *v21; // [sp+28h] [bp-28h]@2 int v22; // [sp+2Ch] [bp-24h]@26 - signed int v23; // [sp+30h] [bp-20h]@1 int v24; // [sp+34h] [bp-1Ch]@26 int v25; // [sp+38h] [bp-18h]@26 int v26; // [sp+3Ch] [bp-14h]@15 @@ -15462,164 +15482,144 @@ __int16 v32; // [sp+4Ch] [bp-4h]@9 __int16 v33; // [sp+4Eh] [bp-2h]@9 - v1 = 0; - v23 = 0; - if ( (signed int)uLevelEVT_NumEvents > 0 ) - { - v2 = pLevelEVT_Events; - v21 = pLevelEVT_Events; - while ( 1 ) - { - LODWORD(v0) = LOWORD(v2->uEventOffsetInEVT); - if ( (unsigned __int8)pLevelEVT[(int)v0 + 4] == 3 ) - { - pSoundList->_4A9A67( - (unsigned __int8)pLevelEVT[(int)v0 + 5] - + (((unsigned __int8)pLevelEVT[(int)v0 + 6] - + (((unsigned __int8)pLevelEVT[(int)v0 + 7] + ((unsigned __int8)pLevelEVT[(int)v0 + 8] << 8)) << 8)) << 8), - v1); - goto LABEL_36; - } - if ( (unsigned __int8)pLevelEVT[(int)v0 + 4] == 31 ) - break; - if ( (unsigned __int8)pLevelEVT[(int)v0 + 4] == 37 ) - { - v7 = v2->uEventID; - dword_597F18 = v2->field_4; - EventProcessor(v7, 0, v1); - dword_597F18 = v1; - } - else - { - if ( (unsigned __int8)pLevelEVT[(int)v0 + 4] == 38 ) - break; - } -LABEL_36: - ++v23; - ++v2; - v21 = v2; - if ( v23 >= (signed int)uLevelEVT_NumEvents ) - return; - } - v20 = pOutdoor->uLastVisitDay; - v3 = &array_5B5928[dword_5B65C8]; - if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) - v20 = pIndoor->stru1.uLastVisitDay; - v4 = (unsigned __int8)pLevelEVT[(int)v0 + 4]; - WORD2(v0) = LOWORD(v2->uEventID); - *(short *)&v3->field_18[4] = v4; - v3->field_8 = WORD2(v0); - v3->field_A = LOWORD(v2->field_4); - v33 = (unsigned __int8)pLevelEVT[(int)v0 + 6]; - v3->field_12 = v33; - v32 = (unsigned __int8)pLevelEVT[(int)v0 + 7]; - v3->field_14 = v32; - v31 = (unsigned __int8)pLevelEVT[(int)v0 + 8]; - v3->field_16 = v31; - v5 = (unsigned __int8)pLevelEVT[(int)v0 + 5]; - v30 = (unsigned __int8)pLevelEVT[(int)v0 + 9]; - *(short *)&v3->field_18[0] = v30; - v29 = (unsigned __int8)pLevelEVT[(int)v0 + 10]; - *(short *)&v3->field_18[2] = v29; - WORD2(v0) = (unsigned __int8)pLevelEVT[(int)v0 + 12]; - LOWORD(v0) = (unsigned __int8)pLevelEVT[(int)v0 + 11]; - v6 = (HIDWORD(v0) << 8) + v0; - v3->field_10 = v5; - v3->field_C = v6; - v3->field_E = v6; - if ( v4 == 38 && !(short)v6 ) - { - if ( v20 ) - v18 = pParty->uTimePlayed - v20; - else - v18 = 0i64; - v26 = (signed int)(signed __int64)((double)(signed __int64)v18 * 0.234375) / 60 / 60 / 24; - HIDWORD(v0) = v26 / 7 / 4 % 12; - if ( v26 / 7 / 4 / 12 ) - { - LODWORD(v0) = 0; - if ( v5 ) - { -LABEL_25: - v3->field_4 = v0; -LABEL_34: + for (uint i = 0; i < uLevelEVT_NumEvents; ++i) + { + auto pEvent = pLevelEVT_Events + i; + + auto _evt = (_evt_raw *)(pLevelEVT + pEvent->uEventOffsetInEVT); + + if (_evt->v4 == 3) + { + pSoundList->_4A9A67( + _evt->v5 + + ((_evt->v6 + ((_evt->v7 + ((unsigned int)_evt->v8 << 8)) << 8)) << 8), + 0); + } + else if (_evt->v4 == 37) + { + dword_597F18 = pEvent->field_4; + EventProcessor(pEvent->uEventID, 0, 0); + dword_597F18 = 0; + } + else if (_evt->v4 == 31 || _evt->v4 == 38) + { + v3 = &array_5B5928[dword_5B65C8]; + v20 = pOutdoor->uLastVisitDay; + if (uCurrentlyLoadedLevelType == LEVEL_Indoor) + v20 = pIndoor->stru1.uLastVisitDay; + + v4 = _evt->v4; + v3->field_1C = v4; + v3->field_8 = pEvent->uEventID; + v3->field_A = pEvent->field_4; + v33 = _evt->v6; + v3->field_12 = v33; + v32 = _evt->v7; + v3->field_14 = v32; + v31 = _evt->v8; + v3->field_16 = v31; + v5 = _evt->v5; + v30 = _evt->v9; + v3->field_18 = v30; + v29 = _evt->v10; + v3->field_1A = v29; + + v6 = ((unsigned short)_evt->v12 << 8) + _evt->v11; + v3->field_10 = v5; + v3->field_C = v6; + v3->field_E = v6; + if ( v4 == 38 && !(short)v6 ) + { + if ( v20 ) + v18 = pParty->uTimePlayed - v20; + else + v18 = 0i64; + v26 = (signed int)(signed __int64)((double)(signed __int64)v18 * 0.234375) / 60 / 60 / 24; + + if ( v26 / 7 / 4 / 12 ) + { + if ( v5 ) + { + v3->field_4 = 0; + ++dword_5B65C8; + v3->field_0 = 0; + continue; + } + } + if (v26 / 7 / 4 != 0 && v33 != 0 || + v26 / 7 != 0 && v32 != 0 || + v26 != 0 || !v20) + { + v3->field_4 = 0; ++dword_5B65C8; - v3->field_0 = v0; - v1 = 0; - goto LABEL_36; - } - } - else - { - LODWORD(v0) = 0; - } - if ( v26 / 7 / 4 != (int)v0 && v33 != (short)v0 - || v26 / 7 != (int)v0 && v32 != (short)v0 - || v26 != (int)v0 - || !v20 ) - goto LABEL_25; - } - v8 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375); - v9 = v8; - v10 = (signed int)v8 / 60; - v22 = v10 % 60; - v11 = (signed int)(v10 / 60); - v12 = v11 % 24; - v13 = (signed int)(v11 / 24); - v27 = v13 % 7; - v14 = (signed int)(v13 / 7); - v15 = v14 % 4; - v16 = (signed int)(v14 / 4); - v24 = v16 / 12; - - auto _1 = (unsigned __int64)((double)pParty->uTimePlayed * 0.234375) >> 32; - auto _2 = ((__int64)v9 << 32) | _1; - v19 = _2 % 60; - //v19 = (signed __int64)__PAIR__((unsigned __int64)(signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) >> 32, - // v9) - // % 60; - v17 = v12; - v25 = v15; - v28 = v16 % 12; - if ( v5 ) - { - ++v24; - } - else - { - if ( v33 ) - { - ++v28; - } - else - { - if ( v32 ) - { - ++v25; + v3->field_0 = 0; + continue; + } + } + + v8 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375); + v9 = v8; + v10 = (signed int)v8 / 60; + v22 = v10 % 60; + v11 = (signed int)(v10 / 60); + v12 = v11 % 24; + v13 = (signed int)(v11 / 24); + v27 = v13 % 7; + v14 = (signed int)(v13 / 7); + v15 = v14 % 4; + v16 = (signed int)(v14 / 4); + v24 = v16 / 12; + + auto _1 = (unsigned __int64)((double)pParty->uTimePlayed * 0.234375) >> 32; + auto _2 = ((__int64)v9 << 32) | _1; + + v19 = _2 % 60; + //v19 = (signed __int64)__PAIR__((unsigned __int64)(signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) >> 32, + // v9) + // % 60; + + v17 = v12; + v25 = v15; + v28 = v16 % 12; + if ( v5 ) + { + ++v24; + } + else + { + if ( v33 ) + { + ++v28; } else { - ++v27; - v22 = v30; - v17 = v31; - v19 = v29; - } - } - } - v0 = (signed __int64)((double)((v19 - + 0x3C * v22 - + 0xE10 * v17 - + 0x93A80 * v25 - + 0x15180 * v27 - + 0x24EA00 * (v28 + 12i64 * v24)) << 7) - * 0.033333335); - v2 = v21; - v3->field_4 = HIDWORD(v0); - goto LABEL_34; - } -} -// 597F18: using guessed type int dword_597F18; -// 5B65C8: using guessed type int dword_5B65C8; + if ( v32 ) + { + ++v25; + } + else + { + ++v27; + v22 = v30; + v17 = v31; + v19 = v29; + } + } + } + auto v0 = (signed __int64)((double)((v19 + + 0x3C * v22 + + 0xE10 * v17 + + 0x93A80 * v25 + + 0x15180 * v27 + + 0x24EA00 * (v28 + 12i64 * v24)) << 7) + * 0.033333335); + v3->field_4 = HIDWORD(v0); + + ++dword_5B65C8; + v3->field_0 = v0; + } + } +} //----- (00444360) -------------------------------------------------------- void __thiscall Level_LoadEvtAndStr(const char *pLevelName) @@ -16824,22 +16824,22 @@ //----- (004465DF) -------------------------------------------------------- -signed int __thiscall sub_4465DF_check_season(void *_this) +int sub_4465DF_check_season(int a1) { unsigned int v1; // eax@1 unsigned int v2; // edx@1 - char *v3; // ecx@2 + int v3; // ecx@2 int v4; // ecx@3 char v6; // zf@9 v1 = pParty->uCurrentMonth + 1; v2 = pParty->uDaysPlayed + 1; - if ( _this ) - { - v3 = (char *)_this - 1; + if ( a1 ) + { + v3 = a1 - 1; if ( v3 ) { - v4 = (int)(v3 - 1); + v4 = v3 - 1; if ( v4 ) { if ( v4 != 1 ) @@ -17032,19 +17032,19 @@ //----- (0044684A) -------------------------------------------------------- -void __fastcall EventProcessor(int a1, int a2, int a3) +void __fastcall EventProcessor(int uEventID, int a2, int a3) { unsigned int v3; // eax@5 - signed int v4; // esi@7 - char *v5; // eax@8 - char *v6; // ecx@8 - char *v7; // ebp@8 - signed int v8; // edx@10 - int v9; // edi@12 - ByteArray *v10; // esi@12 + //signed int v4; // esi@7 + //char *v5; // eax@8 + Player *v6; // ecx@8 + //char *v7; // ebp@8 + //signed int v8; // edx@10 + //int v9; // edi@12 + //ByteArray *v10; // esi@12 int v11; // eax@14 char *v12; // eax@15 - char *v13; // edi@21 + //char *v13; // edi@21 int v14; // ebp@21 int v15; // edi@21 const char *v16; // esi@21 @@ -17132,7 +17132,7 @@ unsigned int v98; // edx@265 const char *v99; // esi@267 int v100; // edx@267 - char *v101; // edi@281 + //char *v101; // edi@281 unsigned int v102; // esi@281 int v103; // edi@284 int v104; // eax@288 @@ -17154,15 +17154,15 @@ int v120; // [sp-4h] [bp-4ACh]@278 int v121; // [sp-4h] [bp-4ACh]@294 int v122; // [sp+10h] [bp-498h]@4 - char *v123; // [sp+14h] [bp-494h]@0 - signed int v124; // [sp+18h] [bp-490h]@7 + //char *v123; // [sp+14h] [bp-494h]@0 + //signed int v124; // [sp+18h] [bp-490h]@7 signed int v125; // [sp+1Ch] [bp-48Ch]@155 int v126; // [sp+1Ch] [bp-48Ch]@262 int v127; // [sp+20h] [bp-488h]@4 int v128; // [sp+24h] [bp-484h]@21 int v129; // [sp+24h] [bp-484h]@262 signed int v130; // [sp+28h] [bp-480h]@0 - int v131; // [sp+2Ch] [bp-47Ch]@1 + //int v131; // [sp+2Ch] [bp-47Ch]@1 int v132; // [sp+30h] [bp-478h]@262 signed int v133; // [sp+34h] [bp-474h]@1 int v134; // [sp+38h] [bp-470h]@262 @@ -17176,7 +17176,7 @@ char Str[120]; // [sp+ECh] [bp-3BCh]@21 Actor Dst; // [sp+164h] [bp-344h]@53 - v131 = a1; + //v131 = uEventID; v133 = 0; dword_5B5920 = a2; dword_5B65C4 = 0; @@ -17202,31 +17202,33 @@ } uSomeEVT_NumEvents = v3; memcpy(pSomeEVT_Events, v112, 0xCE40u); - v4 = 0; - v124 = 0; - if ( (signed int)uSomeEVT_NumEvents > 0 ) - { - v5 = pSomeEVT; - v6 = v123; - v7 = nullstring; - while ( 1 ) - { + //v4 = 0; + //v124 = 0; + for (uint i = 0; i < uSomeEVT_NumEvents; ++i) + { + //v5 = pSomeEVT; + //v6 = v123; + //v7 = nullstring; + //while ( 1 ) + //{ if ( dword_5B65C4 ) goto LABEL_301; - v8 = v4; - if ( pSomeEVT_Events[v4].uEventID == v131 && pSomeEVT_Events[v8].field_4 == v122 ) - { - v9 = pSomeEVT_Events[v8].uEventOffsetInEVT; - v10 = (ByteArray *)&v5[v9]; - switch ( v5[v9 + 4] ) + //v8 = v4; + if ( pSomeEVT_Events[i/*v4*/].uEventID == uEventID && pSomeEVT_Events[i/*v4*/].field_4 == v122 ) + { + //v9 = pSomeEVT_Events[v8].uEventOffsetInEVT; + //v10 = (ByteArray *)&v5[v9]; + auto _evt = (_evt_raw *)(pSomeEVT + pSomeEVT_Events[i/*v4*/].uEventOffsetInEVT); + + switch (_evt->v4) { case EVENT_CheckSeason: - if ( !sub_4465DF_check_season((void *)v10->f[5]) ) + if ( !sub_4465DF_check_season(_evt->v5) ) goto LABEL_291; - v11 = v10->f[6]; + v11 = _evt->v6; goto LABEL_130; case EVENT_ShowMovie: - strcpy(Source, &v10->f[7]); + strcpy(Source, (char *)&_evt->v7); v12 = (char *)&item.uExpireTime + strlen(Source) + 7; if ( *v12 == 32 ) *v12 = 0; @@ -17237,9 +17239,11 @@ if (pAsyncMouse) pAsyncMouse->Suspend(); v128 = uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions; - v13 = &pSomeEVT[v9]; - v14 = (unsigned __int8)v13[5]; - v15 = (unsigned __int8)v13[6]; + //v13 = &pSomeEVT[v9]; + //v14 = (unsigned __int8)v13[5]; + //v15 = (unsigned __int8)v13[6]; + v14 = _evt->v5; + v15 = _evt->v6; strcpy(Str, Source); v16 = RemoveQuotes(Str); VideoPlayer::MovieLoop(v16, 0, v14, 1); @@ -17277,25 +17281,25 @@ pAsyncMouse->Resume(); goto LABEL_291; case EVENT_CheckSkill: - v19 = v10->f[7] + ((v10->f[8] + ((v10->f[9] + (v10->f[10] << 8)) << 8)) << 8); + v19 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((unsigned int)_evt->v10 << 8)) << 8)) << 8); if ( v127 < 0 ) goto LABEL_47; if ( v127 <= 3 ) { - v24 = pParty->pPlayers[0].pActiveSkills[3486 * v127 + v10->f[5]]; + v24 = pParty->pPlayers[0].pActiveSkills[3486 * v127 + _evt->v5]; } else { if ( v127 == 4 ) { - v24 = pPlayers[uActiveCharacter]->pActiveSkills[v10->f[5]]; + v24 = pPlayers[uActiveCharacter]->pActiveSkills[_evt->v5]; } else { if ( v127 == 5 ) { v20 = 0; - v21 = 3486 * v130 + v10->f[5]; + v21 = 3486 * v130 + _evt->v5; v136 = 1; LOWORD(v21) = pParty->pPlayers[0].pActiveSkills[v21]; v137 = v21 & 0x40; @@ -17303,26 +17307,26 @@ v22 = v21 & 0x100; v23 = v21 & 0x3F; v139 = v22; - while ( v23 < v19 || !*(&v136 + v10->f[6]) ) + while ( v23 < v19 || !*(&v136 + _evt->v6) ) { ++v20; if ( v20 >= 4 ) goto LABEL_291; } LABEL_50: - v11 = v10->f[11]; + v11 = _evt->v11; goto LABEL_130; } LABEL_47: - v10 = (ByteArray *)&v5[v9]; - v24 = pParty->pPlayers[0].pActiveSkills[(unsigned __int8)v5[v9 + 5] + 3486 * rand() % 4]; + //v10 = (ByteArray *)&v5[v9]; + v24 = pParty->pPlayers[0].pActiveSkills[_evt->v5 + 3486 * rand() % 4]; } } v136 = 1; v137 = v24 & 0x40; v138 = v24 & 0x80; v139 = v24 & 0x100; - if ( (v24 & 0x3F) >= v19 && *(&v136 + v10->f[6]) ) + if ( (v24 & 0x3F) >= v19 && *(&v136 + _evt->v6) ) goto LABEL_50; goto LABEL_291; case EVENT_SpeakNPC: @@ -17330,24 +17334,24 @@ { //Actor::Actor(&Dst); memset(&Dst, 0, 0x344u); - dword_5B65D0_dialogue_actor_npc_id = (unsigned __int8)pSomeEVT[v9 + 5] - + (((unsigned __int8)pSomeEVT[v9 + 6] - + (((unsigned __int8)pSomeEVT[v9 + 7] - + ((unsigned __int8)pSomeEVT[v9 + 8] << 8)) << 8)) << 8); + dword_5B65D0_dialogue_actor_npc_id = _evt->v5 + + ((_evt->v6 + + ((_evt->v7 + + ((unsigned int)_evt->v8 << 8)) << 8)) << 8); Dst.uNPC_ID = dword_5B65D0_dialogue_actor_npc_id; Dst.InitializeDialogue(0); } else { - bDialogueUI_InitializeActor_NPC_ID = v10->f[5] - + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8); + bDialogueUI_InitializeActor_NPC_ID = _evt->v5 + + ((_evt->v6 + ((_evt->v7 + ((unsigned int)_evt->v8 << 8)) << 8)) << 8); } goto LABEL_291; case EVENT_ChangeEvent: - v25 = v10->f[5] + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8); + v25 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((unsigned int)_evt->v8 << 8)) << 8)) << 8); if ( v25 ) { - stru_5E4C90.field_0[_5C3420_pDecoration->field_1C] = v10->f[5] - 124; + stru_5E4C90.field_0[_5C3420_pDecoration->field_1C] = _evt->v5 - 124; } else { @@ -17357,16 +17361,16 @@ } goto LABEL_291; case EVENT_SetNPCGreeting: - v27 = v10->f[5] + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8); - v28 = v10->f[9] + ((v10->f[10] + ((v10->f[11] + (v10->f[12] << 8)) << 8)) << 8); + v27 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8); + v28 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8); pNPCStats->pNewNPCData[v27].uFlags &= 0xFFFFFFFCu; pNPCStats->pNewNPCData[v27].greet = v28; goto LABEL_291; case EVENT_SetNPCTopic: - v29 = v10->f[5] + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8); - v30 = v10->f[10] + ((v10->f[11] + ((v10->f[12] + (v10->f[13] << 8)) << 8)) << 8); - v31 = v10->f[5] + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8); - v32 = v10->f[9]; + v29 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8); + v30 = _evt->v10 + ((_evt->v11 + ((_evt->v12 + ((uint)_evt->v13 << 8)) << 8)) << 8); + v31 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8); + v32 = _evt->v9; v33 = &pNPCStats->pNewNPCData[v31]; if ( v32 ) { @@ -17420,11 +17424,11 @@ { pAudioPlayer->StopChannels(-1, -1); ptr_507BC0 = GUIWindow::Create(0, 0, 640, 480, WINDOW_HouseInterior, 170, 0); - ptr_507BC0->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 1u, 0x31u, v7, 0); - ptr_507BC0->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 2u, 0x32u, v7, 0); - ptr_507BC0->CreateButton(0x124u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 3u, 0x33u, v7, 0); - ptr_507BC0->CreateButton(0x197u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 4u, 0x34u, v7, 0); - ptr_507BC0->CreateButton(0, 0, 0, 0, 1, 0, 0xB0u, 0, 9u, v7, 0); + ptr_507BC0->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 1u, 0x31u, "", 0); + ptr_507BC0->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 2u, 0x32u, "", 0); + ptr_507BC0->CreateButton(0x124u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 3u, 0x33u, "", 0); + ptr_507BC0->CreateButton(0x197u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 4u, 0x34u, "", 0); + ptr_507BC0->CreateButton(0, 0, 0, 0, 1, 0, 0xB0u, 0, 9u, "", 0); ptr_F8B1E8 = pNPCTopics[90].pText; } } @@ -17432,26 +17436,28 @@ goto LABEL_291; case EVENT_NPCSetItem: sub_448518_npc_set_item( - v10->f[5] + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8), - v10->f[9] + ((v10->f[10] + ((v10->f[11] + (v10->f[12] << 8)) << 8)) << 8), - v10->f[13]); + _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), + _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8), + _evt->v13); goto LABEL_291; case EVENT_SetActorItem: Actor::GiveItem( - v10->f[5] + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8), - v10->f[9] + ((v10->f[10] + ((v10->f[11] + (v10->f[12] << 8)) << 8)) << 8), - v10->f[13]); + _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), + _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8), + _evt->v13); goto LABEL_291; case EVENT_SetNPCGroupNews: - pNPCStats->pGroups_copy[v10->f[5] + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8)] = v10->f[9] + (v10->f[10] << 8); + pNPCStats->pGroups_copy[_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8)] = _evt->v9 + ((uint)_evt->v10 << 8); goto LABEL_291; case EVENT_SetActorGroup: - *(&pActors[0].uGroup + 285212672 * v10->f[8] + 209 * (v10->f[5] + ((v10->f[6] + (v10->f[7] << 8)) << 8))) = v10->f[9] + ((v10->f[10] + ((v10->f[11] + (v10->f[12] << 8)) << 8)) << 8); + __debugbreak(); + *(&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); goto LABEL_291; case EVENT_ChangeGroup: - v38 = v10->f[5] + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8); - v39 = v10->f[9] + ((v10->f[10] + ((v10->f[11] + (v10->f[12] << 8)) << 8)) << 8); + v38 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8); + v39 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8); v40 = uNumActors; + __debugbreak(); if ( (signed int)uNumActors > 0 ) { v41 = (char *)&pActors[0].uGroup; @@ -17466,9 +17472,10 @@ } goto LABEL_291; case EVENT_ChangeGroupAlly: - v42 = v10->f[5] + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8); - v43 = v10->f[9] + ((v10->f[10] + ((v10->f[11] + (v10->f[12] << 8)) << 8)) << 8); + v42 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8); + v43 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8); v44 = uNumActors; + __debugbreak(); if ( (signed int)uNumActors > 0 ) { v45 = (char *)&pActors[0].uAlly; @@ -17483,7 +17490,7 @@ } goto LABEL_291; case EVENT_MoveNPC: - pNPCStats->pNewNPCData[v10->f[5] + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8)].house = v10->f[9] + ((v10->f[10] + ((v10->f[11] + (v10->f[12] << 8)) << 8)) << 8); + pNPCStats->pNewNPCData[_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8)].house = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8); if ( ptr_507BC0 ) { v46 = ptr_507BC0->ptr_1C; @@ -17524,29 +17531,29 @@ } goto LABEL_291; case EVENT_Jmp: - v124 = -1; - v122 = v10->f[5] - 1; + //v124 = -1; + v122 = _evt->v5 - 1; goto LABEL_291; case EVENT_ShowFace: - v50 = v10->f[5]; + v50 = _evt->v5; if ( (unsigned __int8)v50 <= 3u ) { v117 = 0; - v113 = v10->f[6]; + v113 = _evt->v6; v53 = (unsigned __int8)v50; goto LABEL_108; } if ( v50 == 4 ) { v117 = 0; - v113 = v10->f[6]; + v113 = _evt->v6; v52 = pPlayers[uActiveCharacter]; goto LABEL_109; } if ( v50 != 5 ) { v117 = 0; - v113 = v10->f[6]; + v113 = _evt->v6; v53 = rand() % 4; LABEL_108: v52 = &pParty->pPlayers[v53]; @@ -17557,37 +17564,37 @@ v51 = pParty->pPlayers; do { - v51->PlayEmotion((unsigned __int8)pSomeEVT[v9 + 6], 0); + v51->PlayEmotion(_evt->v6, 0); ++v51; } while ( (signed int)v51 < (signed int)pParty->pHirelings ); LABEL_291: ++v122; - v4 = v124; - v5 = pSomeEVT; - v6 = v123; - v7 = nullstring; + //v4 = v124; + //v5 = pSomeEVT; + //v6 = v123; + //v7 = nullstring; break; case EVENT_CharacterAnimation: - v54 = v10->f[5]; + v54 = _evt->v5; if ( (unsigned __int8)v54 <= 3u ) { v118 = 0; - v114 = v10->f[6]; + v114 = _evt->v6; v57 = (unsigned __int8)v54; goto LABEL_119; } if ( v54 == 4 ) { v118 = 0; - v114 = v10->f[6]; + v114 = _evt->v6; v56 = pPlayers[uActiveCharacter]; goto LABEL_120; } if ( v54 != 5 ) { v118 = 0; - v114 = v10->f[6]; + v114 = _evt->v6; v57 = rand() % 4; LABEL_119: v56 = &pParty->pPlayers[v57]; @@ -17598,28 +17605,28 @@ v55 = pParty->pPlayers; do { - v55->PlaySound((unsigned __int8)pSomeEVT[v9 + 6], 0); + v55->PlaySound(_evt->v6, 0); ++v55; } while ( (signed int)v55 < (signed int)pParty->pHirelings ); goto LABEL_291; case EVENT_ForPartyMember: - v127 = v10->f[5]; + v127 = _evt->v5; goto LABEL_291; case EVENT_SummonItem: sub_42F7EB_DropItemAt( - v10->f[5] + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8), - v10->f[9] + ((v10->f[10] + ((v10->f[11] + (v10->f[12] << 8)) << 8)) << 8), - v10->f[13] + ((v10->f[14] + ((v10->f[15] + (v10->f[16] << 8)) << 8)) << 8), - v10->f[17] + ((v10->f[18] + ((v10->f[19] + (v10->f[20] << 8)) << 8)) << 8), - v10->f[21] + ((v10->f[22] + ((v10->f[23] + (v10->f[24] << 8)) << 8)) << 8), - v10->f[25], - v10->f[26], + _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), + _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8), + _evt->v13 + ((_evt->v14 + ((_evt->v15 + ((uint)_evt->v16 << 8)) << 8)) << 8), + _evt->v17 + ((_evt->v18 + ((_evt->v19 + ((uint)_evt->v20 << 8)) << 8)) << 8), + _evt->v21 + ((_evt->v22 + ((_evt->v23 + ((uint)_evt->v24 << 8)) << 8)) << 8), + _evt->v25, + _evt->v26, 0, 0); goto LABEL_291; case EVENT_Compare: - v58 = v10->f[7] + ((v10->f[8] + ((v10->f[9] + (v10->f[10] << 8)) << 8)) << 8); + v58 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8); if ( v127 == 5 ) { v130 = 0; @@ -17627,8 +17634,8 @@ while ( 1 ) { LOBYTE(v60) = v59->CompareVariable( - (enum VariableType)((unsigned __int8)pSomeEVT[v9 + 5] - + ((unsigned __int8)pSomeEVT[v9 + 6] << 8)), + (enum VariableType)(_evt->v5 + + ((uint)_evt->v6 << 8)), v58); if ( v60 ) break; @@ -17638,7 +17645,7 @@ goto LABEL_291; } LABEL_129: - v11 = (unsigned __int8)pSomeEVT[v9 + 11]; + v11 = _evt->v11; goto LABEL_130; } if ( v127 < 0 ) @@ -17650,7 +17657,7 @@ { if ( uActiveCharacter ) { - v6 = (char *)pPlayers[uActiveCharacter]; + v6 = pPlayers[uActiveCharacter]; goto LABEL_138; } } @@ -17660,14 +17667,14 @@ goto LABEL_139; } v61 = rand() % 4; - v5 = pSomeEVT; + //v5 = pSomeEVT; LABEL_137: - v6 = (char *)&pParty->pPlayers[v61]; + v6 = &pParty->pPlayers[v61]; LABEL_138: - v123 = v6; + //v123 = v6; LABEL_139: LOBYTE(v62) = ((Player *)v6)->CompareVariable( - (enum VariableType)((unsigned __int8)v5[v9 + 5] + ((unsigned __int8)v5[v9 + 6] << 8)), + (enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)), v58); LABEL_140: if ( v62 ) @@ -17675,13 +17682,13 @@ goto LABEL_291; case EVENT_IsActorAlive: v62 = IsActorAlive( - v10->f[5], - v10->f[6] + ((v10->f[7] + ((v10->f[8] + (v10->f[9] << 8)) << 8)) << 8), - v10->f[10]); + _evt->v5, + _evt->v6 + ((_evt->v7 + ((_evt->v8 + ((uint)_evt->v9 << 8)) << 8)) << 8), + _evt->v10); goto LABEL_140; case EVENT_Substract: - v63 = (void *)(v10->f[7] + ((v10->f[8] + ((v10->f[9] + (v10->f[10] << 8)) << 8)) << 8)); - if ( v10->f[5] + (v10->f[6] << 8) == VAR_PlayerItemInHands ) + v63 = (void *)(_evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8)); + if ( _evt->v5 + ((uint)_evt->v6 << 8) == VAR_PlayerItemInHands ) { v64 = 0; if ( (void *)pParty->pPickedItem.uItemID == v63 ) @@ -17768,22 +17775,22 @@ goto LABEL_180; LABEL_183: ((Player *)v6)->SubtractVariable( - (enum VariableType)((unsigned __int8)v5[v9 + 5] + ((unsigned __int8)v5[v9 + 6] << 8)), + (enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)), v63); goto LABEL_291; } if ( uActiveCharacter ) { - v6 = (char *)pPlayers[uActiveCharacter]; + v6 = pPlayers[uActiveCharacter]; goto LABEL_182; } LABEL_180: v75 = rand() % 4; - v5 = pSomeEVT; - } - v6 = (char *)&pParty->pPlayers[v75]; + //v5 = pSomeEVT; + } + v6 = &pParty->pPlayers[v75]; LABEL_182: - v123 = v6; + //v123 = v6; goto LABEL_183; } v76 = pParty->pPlayers; @@ -17791,14 +17798,14 @@ do { v76->SubtractVariable( - (enum VariableType)((unsigned __int8)pSomeEVT[v9 + 5] + ((unsigned __int8)pSomeEVT[v9 + 6] << 8)), + (enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)), v63); ++v76; } while ( (signed int)v76 < (signed int)pParty->pHirelings ); goto LABEL_291; case EVENT_Set: - v77 = v10->f[7] + ((v10->f[8] + ((v10->f[9] + (v10->f[10] << 8)) << 8)) << 8); + v77 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8); v78 = v127; if ( v127 != 5 ) { @@ -17812,22 +17819,22 @@ goto LABEL_194; LABEL_197: ((Player *)v6)->SetVariable( - (enum VariableType)((unsigned __int8)v5[v9 + 5] + ((unsigned __int8)v5[v9 + 6] << 8)), + (enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)), v77); goto LABEL_291; } if ( uActiveCharacter ) { - v6 = (char *)pPlayers[uActiveCharacter]; + v6 = pPlayers[uActiveCharacter]; goto LABEL_196; } LABEL_194: v78 = rand() % 4; - v5 = pSomeEVT; - } - v6 = (char *)&pParty->pPlayers[v78]; + //v5 = pSomeEVT; + } + v6 = &pParty->pPlayers[v78]; LABEL_196: - v123 = v6; + //v123 = v6; goto LABEL_197; } v79 = pParty->pPlayers; @@ -17835,14 +17842,14 @@ do { v79->SetVariable( - (enum VariableType)((unsigned __int8)pSomeEVT[v9 + 5] + ((unsigned __int8)pSomeEVT[v9 + 6] << 8)), + (enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)), v77); ++v79; } while ( (signed int)v79 < (signed int)pParty->pHirelings ); goto LABEL_291; case EVENT_Add: - v80 = v10->f[7] + ((v10->f[8] + ((v10->f[9] + (v10->f[10] << 8)) << 8)) << 8); + v80 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8); v81 = v127; if ( v127 != 5 ) { @@ -17856,22 +17863,22 @@ goto LABEL_208; LABEL_211: ((Player *)v6)->AddVariable( - (enum VariableType)((unsigned __int8)v5[v9 + 5] + ((unsigned __int8)v5[v9 + 6] << 8)), + (enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)), v80); goto LABEL_212; } if ( uActiveCharacter ) { - v6 = (char *)pPlayers[uActiveCharacter]; + v6 = pPlayers[uActiveCharacter]; goto LABEL_210; } LABEL_208: v81 = rand() % 4; - v5 = pSomeEVT; - } - v6 = (char *)&pParty->pPlayers[v81]; + //v5 = pSomeEVT; + } + v6 = &pParty->pPlayers[v81]; LABEL_210: - v123 = v6; + //v123 = v6; goto LABEL_211; } v82 = pParty->pPlayers; @@ -17879,13 +17886,13 @@ do { v82->AddVariable( - (enum VariableType)((unsigned __int8)pSomeEVT[v9 + 5] + ((unsigned __int8)pSomeEVT[v9 + 6] << 8)), + (enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)), v80); ++v82; } while ( (signed int)v82 < (signed int)pParty->pHirelings ); LABEL_212: - v83 = (unsigned __int8)pSomeEVT[v9 + 5] + ((unsigned __int8)pSomeEVT[v9 + 6] << 8); + v83 = _evt->v5 + ((uint)_evt->v6 << 8); if ( v83 == 21 || v83 == 22 || v83 == 23 || v83 == 24 ) viewparams->bRedrawGameUI = 1; goto LABEL_291; @@ -17894,51 +17901,51 @@ { strcpy( GameUI_StatusBar_TimedString, - &pLevelStr[pLevelStrOffsets[(unsigned __int8)v5[v9 + 5] - + (((unsigned __int8)v5[v9 + 6] - + (((unsigned __int8)v5[v9 + 7] + ((unsigned __int8)v5[v9 + 8] << 8)) << 8)) << 8)]]); + &pLevelStr[pLevelStrOffsets[_evt->v5 + + ((_evt->v6 + + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8)]]); v105 = v122; v121 = 26; LABEL_295: - sub_4451A8_press_any_key(v131, v105, v121); + sub_4451A8_press_any_key(uEventID, v105, v121); LABEL_301: if ( v133 == 1 ) LABEL_302: OnMapLeave(); return; } - v84 = v10->f[13] + ((v10->f[14] + ((v10->f[15] + (v10->f[16] << 8)) << 8)) << 8); + v84 = _evt->v13 + ((_evt->v14 + ((_evt->v15 + ((uint)_evt->v16 << 8)) << 8)) << 8); if ( !_strcmpi( GameUI_StatusBar_TimedString, - &pLevelStr[pLevelStrOffsets[v10->f[9] - + ((v10->f[10] + ((v10->f[11] + (v10->f[12] << 8)) << 8)) << 8)]]) + &pLevelStr[pLevelStrOffsets[_evt->v9 + + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8)]]) || !_strcmpi(GameUI_StatusBar_TimedString, &pLevelStr[pLevelStrOffsets[v84]]) ) { - v11 = (unsigned __int8)pSomeEVT[v9 + 17]; + v11 = _evt->v17; LABEL_130: - v124 = -1; + //v124 = -1; LABEL_131: v122 = v11 - 1; } goto LABEL_291; case EVENT_RandomGoTo: - v124 = -1; - v11 = (unsigned __int8)*(&pSomeEVT[v9 + 5] + //v124 = -1; + v11 = (unsigned __int8)*(&_evt->v5 + rand() - % ((v10->f[5] != 0) - + (v10->f[6] != 0) - + (v10->f[7] != 0) - + (v10->f[8] != 0) - + (v10->f[9] != 0) - + (v10->f[10] != 0))); + % ((_evt->v5 != 0) + + (_evt->v6 != 0) + + (_evt->v7 != 0) + + (_evt->v8 != 0) + + (_evt->v9 != 0) + + (_evt->v10 != 0))); goto LABEL_131; case EVENT_ReceiveDamage: - v85 = v10->f[7] + ((v10->f[8] + ((v10->f[9] + (v10->f[10] << 8)) << 8)) << 8); - v86 = v10->f[5]; + v85 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8); + v86 = _evt->v5; if ( (unsigned __int8)v86 <= 3u ) { - v119 = v10->f[6]; - v115 = v10->f[7] + ((v10->f[8] + ((v10->f[9] + (v10->f[10] << 8)) << 8)) << 8); + v119 = _evt->v6; + v115 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8); v89 = (unsigned __int8)v86; goto LABEL_233; } @@ -17946,15 +17953,15 @@ { if ( !uActiveCharacter ) goto LABEL_291; - v119 = v10->f[6]; + v119 = _evt->v6; v88 = pPlayers[uActiveCharacter]; - v115 = v10->f[7] + ((v10->f[8] + ((v10->f[9] + (v10->f[10] << 8)) << 8)) << 8); + v115 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8); goto LABEL_234; } if ( v86 != 5 ) { - v119 = v10->f[6]; - v115 = v10->f[7] + ((v10->f[8] + ((v10->f[9] + (v10->f[10] << 8)) << 8)) << 8); + v119 = _evt->v6; + v115 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v1 << 8)) << 8)) << 8); v89 = rand() % 4; LABEL_233: v88 = &pParty->pPlayers[v89]; @@ -17965,44 +17972,44 @@ v87 = pParty->pPlayers; do { - v87->ReceiveDamage(v85, (unsigned __int8)pSomeEVT[v9 + 6]); + v87->ReceiveDamage(v85, _evt->v6); ++v87; } while ( (signed int)v87 < (signed int)pParty->pHirelings ); goto LABEL_291; case EVENT_ToggleIndoorLight: - pIndoor->ToggleLight(v10->f[5] + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8), v10->f[9]); + pIndoor->ToggleLight(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), _evt->v9); goto LABEL_291; case EVENT_SetFacesBit: sub_44892E_set_faces_bit( - v10->f[5] + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8), - v10->f[9] + ((v10->f[10] + ((v10->f[11] + (v10->f[12] << 8)) << 8)) << 8), - v10->f[13]); + _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), + _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8), + _evt->v13); goto LABEL_291; case EVENT_ToggleChestFlag: Chest::ToggleFlag( - v10->f[5] + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8), - v10->f[9] + ((v10->f[10] + ((v10->f[11] + (v10->f[12] << 8)) << 8)) << 8), - v10->f[13]); + _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), + _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8), + _evt->v13); goto LABEL_291; case EVENT_ToggleActorFlag: Actor::ToggleFlag( - v10->f[5] + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8), - v10->f[9] + ((v10->f[10] + ((v10->f[11] + (v10->f[12] << 8)) << 8)) << 8), - v10->f[13]); + _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), + _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8), + _evt->v13); goto LABEL_291; case EVENT_ToggleActorGroupFlag: ToggleActorGroupFlag( - v10->f[5] + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8), - v10->f[9] + ((v10->f[10] + ((v10->f[11] + (v10->f[12] << 8)) << 8)) << 8), - v10->f[13]); + _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), + _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8), + _evt->v13); goto LABEL_291; case EVENT_SetSnow: - if ( !v10->f[5] ) - pWeather->bRenderSnow = v10->f[6] != 0; + if ( !_evt->v5 ) + pWeather->bRenderSnow = _evt->v6 != 0; goto LABEL_291; case EVENT_StatusText: - v90 = v10->f[5] + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8); + v90 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8); if ( _5C3420_pDecoration ) { if ( _5C3420_pDecoration == (LevelDecoration *)1 ) @@ -18028,7 +18035,7 @@ } goto LABEL_291; case EVENT_ShowMessage: - v92 = v10->f[5] + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8); + v92 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8); if ( _5C3420_pDecoration ) { v93 = (&dword_721664)[8 * v92]; @@ -18042,76 +18049,76 @@ goto LABEL_291; case EVENT_CastSpell: sub_448DF8_cast_spell( - v10->f[5], - v10->f[6], - v10->f[7], - v10->f[8] + ((v10->f[9] + ((v10->f[10] + (v10->f[11] << 8)) << 8)) << 8), - v10->f[12] + ((v10->f[13] + ((v10->f[14] + (v10->f[15] << 8)) << 8)) << 8), - v10->f[16] + ((v10->f[17] + ((v10->f[18] + (v10->f[19] << 8)) << 8)) << 8), - v10->f[20] + ((v10->f[21] + ((v10->f[22] + (v10->f[23] << 8)) << 8)) << 8), - v10->f[24] + ((v10->f[25] + ((v10->f[26] + (v10->f[27] << 8)) << 8)) << 8), - v10->f[28] + ((v10->f[29] + ((v10->f[30] + (v10->f[31] << 8)) << 8)) << 8)); + _evt->v5, + _evt->v6, + _evt->v7, + _evt->v8 + ((_evt->v9 + ((_evt->v10 + ((uint)_evt->v11 << 8)) << 8)) << 8), + _evt->v12 + ((_evt->v13 + ((_evt->v14 + ((uint)_evt->v15 << 8)) << 8)) << 8), + _evt->v16 + ((_evt->v17 + ((_evt->v18 + ((uint)_evt->v19 << 8)) << 8)) << 8), + _evt->v20 + ((_evt->v21 + ((_evt->v22 + ((uint)_evt->v23 << 8)) << 8)) << 8), + _evt->v24 + ((_evt->v25 + ((_evt->v26 + ((uint)_evt->v27 << 8)) << 8)) << 8), + _evt->v28 + ((_evt->v29 + ((_evt->v30 + ((uint)_evt->v31 << 8)) << 8)) << 8)); goto LABEL_291; case EVENT_SetTexture: - sub_44861E_set_texture(v10->f[5] + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8), &v10->f[9]); + sub_44861E_set_texture(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), (char *)&_evt->v9); goto LABEL_291; case EVENT_SetSprite: SetDecorationSprite( - v10->f[5] + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8), - v10->f[9], - &v10->f[10]); + _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), + _evt->v9, + (char *)&_evt->v10); goto LABEL_291; case EVENT_SummonMonsters: sub_448CF4_spawn_monsters( - v10->f[5], - v10->f[6], - v10->f[7], - v10->f[8] + ((v10->f[9] + ((v10->f[10] + (v10->f[11] << 8)) << 8)) << 8), - v10->f[12] + ((v10->f[13] + ((v10->f[14] + (v10->f[15] << 8)) << 8)) << 8), - v10->f[16] + ((v10->f[17] + ((v10->f[18] + (v10->f[19] << 8)) << 8)) << 8), - v10->f[20] + ((v10->f[21] + ((v10->f[22] + (v10->f[23] << 8)) << 8)) << 8), - v10->f[24] + ((v10->f[25] + ((v10->f[26] + (v10->f[27] << 8)) << 8)) << 8)); + _evt->v5, + _evt->v6, + _evt->v7, + _evt->v8 + ((_evt->v9 + ((_evt->v10 + ((uint)_evt->v11 << 8)) << 8)) << 8), + _evt->v12 + ((_evt->v13 + ((_evt->v14 + ((uint)_evt->v15 << 8)) << 8)) << 8), + _evt->v16 + ((_evt->v17 + ((_evt->v18 + ((uint)_evt->v19 << 8)) << 8)) << 8), + _evt->v20 + ((_evt->v21 + ((_evt->v22 + ((uint)_evt->v23 << 8)) << 8)) << 8), + _evt->v24 + ((_evt->v25 + ((_evt->v26 + ((uint)_evt->v27 << 8)) << 8)) << 8)); goto LABEL_291; case EVENT_MouseOver: case EVENT_LocationName: --v122; goto LABEL_291; case EVENT_ChangeDoorState: - sub_449A49_door_switch_animation(v10->f[5], v10->f[6]); + sub_449A49_door_switch_animation(_evt->v5, _evt->v6); goto LABEL_291; case EVENT_OpenChest: - if ( !Chest::Open(v10->f[5]) ) + if ( !Chest::Open(_evt->v5) ) goto LABEL_301; goto LABEL_291; case EVENT_MoveToMap: - v94 = v10->f[5] + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8); - v135 = v10->f[5] + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8); - v132 = v10->f[9] + ((v10->f[10] + ((v10->f[11] + (v10->f[12] << 8)) << 8)) << 8); - v126 = v10->f[13] + ((v10->f[14] + ((v10->f[15] + (v10->f[16] << 8)) << 8)) << 8); - v129 = v10->f[17] + ((v10->f[18] + ((v10->f[19] + (v10->f[20] << 8)) << 8)) << 8); - v95 = v10->f[21] + ((v10->f[22] + ((v10->f[23] + (v10->f[24] << 8)) << 8)) << 8); - v96 = v10->f[25]; - v97 = v96 + ((v10->f[26] + ((v10->f[27] + (v10->f[28] << 8)) << 8)) << 8); - v134 = v96 + ((v10->f[26] + ((v10->f[27] + (v10->f[28] << 8)) << 8)) << 8); - if ( v10->f[29] || v10->f[30] ) + v94 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8); + v135 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8); + v132 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8); + v126 = _evt->v13 + ((_evt->v14 + ((_evt->v15 + ((uint)_evt->v16 << 8)) << 8)) << 8); + v129 = _evt->v17 + ((_evt->v18 + ((_evt->v19 + ((uint)_evt->v20 << 8)) << 8)) << 8); + v95 = _evt->v21 + ((_evt->v22 + ((_evt->v23 + ((uint)_evt->v24 << 8)) << 8)) << 8); + v96 = _evt->v25; + v97 = v96 + ((_evt->v26 + ((_evt->v27 + ((uint)_evt->v28 << 8)) << 8)) << 8); + v134 = v96 + ((_evt->v26 + ((_evt->v27 + ((uint)_evt->v28 << 8)) << 8)) << 8); + if ( _evt->v29 || _evt->v30 ) { if ( pRenderer->pRenderD3D && !pRenderer->bWindowMode ) pRenderer->_49FD3A(); sub_444839_move_map( - (unsigned __int8)pSomeEVT[v9 + 29], - (unsigned __int8)pSomeEVT[v9 + 30], + _evt->v29, + _evt->v30, v135, v132, v126, v129, v95, v134, - &pSomeEVT[v9 + 31]); - dword_5C3418 = v131; + (char *)&_evt->v31); + dword_5C3418 = uEventID; dword_5C341C = v122 + 1; goto LABEL_301; } - _5B65AC_npcdata_fame_or_other = v10->f[9] + ((v10->f[10] + ((v10->f[11] + (v10->f[12] << 8)) << 8)) << 8); + _5B65AC_npcdata_fame_or_other = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8); _5B65A8_npcdata_uflags_or_other = v94; _5B65B0_npcdata_rep_or_other = v126; if ( v129 == -1 ) @@ -18123,7 +18130,7 @@ v98 = v129 & stru_5C6E00->uDoublePiMask; _5B65B4_npcdata_loword_house_or_other = v129 & stru_5C6E00->uDoublePiMask; } - v99 = &v10->f[31]; + v99 = (char *)&_evt->v31; _5B65B8_npcdata_hiword_house_or_other = v95; dword_5B65BC = v97; v100 = v94 | v132 | v126 | v95 | v97 | v98; @@ -18193,25 +18200,25 @@ v120 = 0; v116 = 0; v111 = 0; - v110 = v10->f[13] + ((v10->f[14] + ((v10->f[15] + (v10->f[16] << 8)) << 8)) << 8); - v109 = v10->f[9] + ((v10->f[10] + ((v10->f[11] + (v10->f[12] << 8)) << 8)) << 8); + v110 = _evt->v13 + ((_evt->v14 + ((_evt->v15 + ((uint)_evt->v16 << 8)) << 8)) << 8); + v109 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8); v108 = 0; v107 = 0; - v106 = v10->f[5] + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8); + v106 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8); goto LABEL_280; case EVENT_GiveItem: item.Reset(); - v101 = &pSomeEVT[v9]; - v102 = (unsigned __int8)v101[7] - + (((unsigned __int8)v101[8] + (((unsigned __int8)v101[9] + ((unsigned __int8)v101[10] << 8)) << 8)) << 8); - pItemsTable->GenerateItem((unsigned __int8)v101[5], (unsigned __int8)v101[6], &item); + //v101 = &pSomeEVT[v9]; + v102 = _evt->v7 + + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8); + pItemsTable->GenerateItem(_evt->v5, _evt->v6, &item); if ( v102 ) item.uItemID = v102; pParty->SetHoldingItem(&item); goto LABEL_291; case EVENT_SpeakInHouse: - v103 = v10->f[5] + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8); - if ( EnterHouse((enum HOUSE_TYPE)(v10->f[5] + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8))) ) + v103 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8); + if ( EnterHouse((enum HOUSE_TYPE)(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8))) ) { if ( pRenderer->pRenderD3D && !pRenderer->bWindowMode ) pRenderer->_49FD3A(); @@ -18221,11 +18228,11 @@ if ( uCurrentHouse_Animation != 167 ) v104 = v103; ptr_507BC0 = GUIWindow::Create(0, 0, 640, 480, WINDOW_HouseInterior, v104, 0); - ptr_507BC0->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 1u, 0x31u, v7, 0); - ptr_507BC0->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 2u, 0x32u, v7, 0); - ptr_507BC0->CreateButton(0x124u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 3u, 0x33u, v7, 0); - ptr_507BC0->CreateButton(0x197u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 4u, 0x34u, v7, 0); - ptr_507BC0->CreateButton(0, 0, 0, 0, 1, 0, 0xB0u, 0, 9u, v7, 0); + ptr_507BC0->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 1u, 0x31u, "", 0); + ptr_507BC0->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 2u, 0x32u, "", 0); + ptr_507BC0->CreateButton(0x124u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 3u, 0x33u, "", 0); + ptr_507BC0->CreateButton(0x197u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 4u, 0x34u, "", 0); + ptr_507BC0->CreateButton(0, 0, 0, 0, 1, 0, 0xB0u, 0, 9u, "", 0); } goto LABEL_291; default: @@ -18238,11 +18245,11 @@ goto LABEL_301; } } - ++v4; - v124 = v4; - if ( v4 >= (signed int)uSomeEVT_NumEvents ) - goto LABEL_301; - } + //++v4; + //v124 = v4; + //if ( v4 >= (signed int)uSomeEVT_NumEvents ) + //goto LABEL_301; + //} } }