Mercurial > mm7
diff Events.cpp @ 310:4c2cdda88562
m
author | Gloval |
---|---|
date | Wed, 20 Feb 2013 01:40:18 +0400 |
parents | 72faa54ff319 |
children | ea55d6414029 |
line wrap: on
line diff
--- a/Events.cpp Wed Feb 20 00:28:52 2013 +0400 +++ b/Events.cpp Wed Feb 20 01:40:18 2013 +0400 @@ -261,7 +261,7 @@ int v119; // [sp-4h] [bp-4ACh]@231 int v120; // [sp-4h] [bp-4ACh]@278 int v121; // [sp-4h] [bp-4ACh]@294 - int v122; // [sp+10h] [bp-498h]@4 + int curr_seq_num; // [sp+10h] [bp-498h]@4 //char *v123; // [sp+14h] [bp-494h]@0 //signed int v124; // [sp+18h] [bp-490h]@7 signed int v125; // [sp+1Ch] [bp-48Ch]@155 @@ -294,8 +294,8 @@ ShowStatusBarString(pGlobalTXT_LocalizationStrings[521], 2u);// Nothing here return; } - v127 = 2 * (uActiveCharacter == 0) + 4; - v122 = dword_597F18; + v127 = 2 * (uActiveCharacter == 0) + 4; //4 and 6 + curr_seq_num = dword_597F18; if ( _5C3420_pDecoration ) { uSomeEVT_NumEvents = uGlobalEVT_NumEvents; @@ -322,18 +322,18 @@ if ( dword_5B65C4 ) goto LABEL_301; //v8 = v4; - if ( pSomeEVT_Events[i/*v4*/].uEventID == uEventID && pSomeEVT_Events[i/*v4*/].event_sequence_num == v122 ) + if ( pSomeEVT_Events[i/*v4*/].uEventID == uEventID && pSomeEVT_Events[i/*v4*/].event_sequence_num == curr_seq_num ) { //v9 = pSomeEVT_Events[v8].uEventOffsetInEVT; //v10 = (ByteArray *)&v5[v9]; auto _evt = (_evt_raw *)(pSomeEVT + pSomeEVT_Events[i/*v4*/].uEventOffsetInEVT); - switch (_evt->v4) + switch (_evt->_e_type) { case EVENT_CheckSeason: if ( !sub_4465DF_check_season(_evt->v5) ) { - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -379,7 +379,7 @@ } if (pAsyncMouse) pAsyncMouse->Resume(); - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -402,7 +402,7 @@ } if (pAsyncMouse) pAsyncMouse->Resume(); - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -426,7 +426,7 @@ } if (pAsyncMouse) pAsyncMouse->Resume(); - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -466,7 +466,7 @@ ++v20; if ( v20 >= 4 ) { - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -491,7 +491,7 @@ v11 = _evt->v11; goto LABEL_130; } - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -516,7 +516,7 @@ bDialogueUI_InitializeActor_NPC_ID = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((unsigned int)_evt->v8 << 8)) << 8)) << 8); } - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -534,7 +534,7 @@ stru_5E4C90._decor_events[_5C3420_pDecoration->_idx_in_stru123 - 75] = 0; LOBYTE(v26->field_2) |= 0x20u; } - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -545,13 +545,15 @@ v28 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8); pNPCStats->pNewNPCData[v27].uFlags &= 0xFFFFFFFCu; pNPCStats->pNewNPCData[v27].greet = v28; - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; //v7 = ""; break; case EVENT_SetNPCTopic: + { + 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); @@ -618,7 +620,8 @@ } } } - ++v122; + ++curr_seq_num; + } //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -627,7 +630,7 @@ case EVENT_NPCSetItem: sub_448518_npc_set_item(_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); - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -636,7 +639,7 @@ case EVENT_SetActorItem: Actor::GiveItem(_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); - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -644,7 +647,7 @@ break; case EVENT_SetNPCGroupNews: pNPCStats->pGroups_copy[_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8)] = _evt->v9 + ((uint)_evt->v10 << 8); - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -653,7 +656,7 @@ case EVENT_SetActorGroup: __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); - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -676,7 +679,7 @@ } while ( v40 ); } - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -699,13 +702,15 @@ } while ( v44 ); } - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; //v7 = ""; break; case EVENT_MoveNPC: + { + 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); if ( ptr_507BC0 ) { @@ -745,7 +750,8 @@ pVideoPlayer->bLoopPlaying = 0; } } - ++v122; + ++curr_seq_num; + } //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -753,8 +759,8 @@ break; case EVENT_Jmp: //v124 = -1; - v122 = _evt->v5 - 1; - ++v122; + curr_seq_num = _evt->v5 - 1; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -769,7 +775,7 @@ v53 = (unsigned __int8)v50; v52 = &pParty->pPlayers[v53]; v52->PlayEmotion((CHARACTER_EXPRESSION_ID)v113, v117); - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -782,7 +788,7 @@ v113 = _evt->v6; v52 = pPlayers[uActiveCharacter]; v52->PlayEmotion((CHARACTER_EXPRESSION_ID)v113, v117); - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -796,7 +802,7 @@ v53 = rand() % 4; v52 = &pParty->pPlayers[v53]; v52->PlayEmotion((CHARACTER_EXPRESSION_ID)v113, v117); - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -811,7 +817,7 @@ } while ( (signed int)v51 < (signed int)pParty->pHirelings ); //LABEL_291: - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -842,7 +848,7 @@ v56 = &pParty->pPlayers[v57]; LABEL_120: v56->PlaySound((PlayerSpeech)v114, v118); - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -856,7 +862,7 @@ ++v55; } //while ( (signed int)v55 < (signed int)pParty->pHirelings ); - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -864,7 +870,7 @@ break; case EVENT_ForPartyMember: v127 = _evt->v5; - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -877,7 +883,7 @@ _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); - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -898,7 +904,7 @@ ++v59; if ( (signed int)v59 >= (signed int)pParty->pHirelings ) { - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -941,7 +947,7 @@ LABEL_140: if ( v62 ) goto LABEL_129; - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -961,7 +967,7 @@ if ( (void *)pParty->pPickedItem.uItemID == v63 ) { pMouse->RemoveHoldingItem(); - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -976,7 +982,7 @@ if ( *(void **)&v66->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v67 + 5] == v63 ) { v66->RemoveItemAtInventoryIndex(v65); - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -994,7 +1000,7 @@ if ( *(int *)v69 && *(void **)&v66->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v69 + 5] == v63 ) { *(&v66->pEquipment.uOffHand + v68) = 0; - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -1042,7 +1048,7 @@ v125 += 4; if ( v125 > (signed int)&pPlayers[4] ) { - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -1064,7 +1070,7 @@ goto LABEL_180; LABEL_183: ((Player *)v6)->SubtractVariable((enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)), v63); - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -1095,7 +1101,7 @@ ++v76; } while ( (signed int)v76 < (signed int)pParty->pHirelings ); - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -1116,7 +1122,7 @@ goto LABEL_194; LABEL_197: ((Player *)v6)->SetVariable((enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)), v77); - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -1147,7 +1153,7 @@ ++v79; } while ( (signed int)v79 < (signed int)pParty->pHirelings ); - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -1200,7 +1206,7 @@ v83 = _evt->v5 + ((uint)_evt->v6 << 8); if ( v83 == 21 || v83 == 22 || v83 == 23 || v83 == 24 ) viewparams->bRedrawGameUI = 1; - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -1214,7 +1220,7 @@ &pLevelStr[pLevelStrOffsets[_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8)]]); - v105 = v122; + v105 = curr_seq_num; v121 = 26; LABEL_295: sub_4451A8_press_any_key(uEventID, v105, v121); @@ -1235,9 +1241,9 @@ LABEL_130: //v124 = -1; LABEL_131: - v122 = v11 - 1; + curr_seq_num = v11 - 1; } - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -1262,7 +1268,7 @@ { if ( !uActiveCharacter ) { - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -1277,13 +1283,13 @@ if ( v86 != 5 ) { v119 = _evt->v6; - v115 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v1 << 8)) << 8)) << 8); + v115 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10<< 8)) << 8)) << 8); v89 = rand() % 4; LABEL_233: v88 = &pParty->pPlayers[v89]; LABEL_234: v88->ReceiveDamage(v115, v119); - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -1297,7 +1303,7 @@ ++v87; } while ( (signed int)v87 < (signed int)pParty->pHirelings ); - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -1305,7 +1311,7 @@ break; case EVENT_ToggleIndoorLight: pIndoor->ToggleLight(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), _evt->v9); - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -1314,7 +1320,7 @@ case EVENT_SetFacesBit: sub_44892E_set_faces_bit(_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); - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -1323,7 +1329,7 @@ case EVENT_ToggleChestFlag: Chest::ToggleFlag(_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); - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -1332,7 +1338,7 @@ case EVENT_ToggleActorFlag: Actor::ToggleFlag(_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); - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -1343,7 +1349,7 @@ _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); - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -1352,7 +1358,7 @@ case EVENT_SetSnow: if ( !_evt->v5 ) pWeather->bRenderSnow = _evt->v6 != 0; - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -1365,7 +1371,7 @@ if ( _5C3420_pDecoration == (LevelDecoration *)1 ) { ptr_F8B1E8 = pNPCTopics[v90-1].pText;//(&dword_721664)[8 * v90]; - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -1377,7 +1383,7 @@ v91 = pNPCTopics[v90-1].pText;//(&dword_721664)[8 * v90]; //LABEL_248: ShowStatusBarString(v91, 2u); - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -1391,7 +1397,7 @@ { v91 = &pLevelStr[pLevelStrOffsets[v90]]; ShowStatusBarString(v91, 2u); - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -1399,7 +1405,7 @@ break; } } - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -1417,7 +1423,7 @@ { strcpy(byte_5B0938, &pLevelStr[pLevelStrOffsets[v92]]); } - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -1430,7 +1436,7 @@ _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)); - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -1438,7 +1444,7 @@ break; case EVENT_SetTexture: sub_44861E_set_texture(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), (char *)&_evt->v9); - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -1446,7 +1452,7 @@ break; case EVENT_SetSprite: SetDecorationSprite(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), _evt->v9, (char *)&_evt->v10); - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -1459,7 +1465,7 @@ _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)); - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -1467,8 +1473,8 @@ break; case EVENT_MouseOver: case EVENT_LocationName: - --v122; - ++v122; + --curr_seq_num; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -1476,7 +1482,7 @@ break; case EVENT_ChangeDoorState: sub_449A49_door_switch_animation(_evt->v5, _evt->v6); - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -1485,7 +1491,7 @@ case EVENT_OpenChest: if ( !Chest::Open(_evt->v5) ) goto LABEL_301; - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -1507,7 +1513,7 @@ pRenderer->_49FD3A(); sub_444839_move_map(_evt->v29, _evt->v30, v135, v132, v126, v129, v95, v134, (char *)&_evt->v31); dword_5C3418 = uEventID; - dword_5C341C = v122 + 1; + dword_5C341C = curr_seq_num + 1; goto LABEL_301; } _5B65AC_npcdata_fame_or_other = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8); @@ -1587,7 +1593,7 @@ goto LABEL_302; } } - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -1612,7 +1618,7 @@ if ( v102 ) item.uItemID = v102; pParty->SetHoldingItem(&item); - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -1636,7 +1642,7 @@ 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); } - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123; @@ -1644,12 +1650,12 @@ break; case EVENT_PressAnyKey: v121 = 33; - v105 = v122 + 1; + v105 = curr_seq_num + 1; goto LABEL_295; case EVENT_Exit: goto LABEL_301; default: - ++v122; + ++curr_seq_num; //v4 = v124; //v5 = pSomeEVT; //v6 = v123;