comparison mm7_2.cpp @ 472:7dfe960c323c

BLV_UpdateDoors
author Nomad
date Tue, 26 Feb 2013 05:00:40 +0200
parents c43f156a95c9
children 442afd6c34a4
comparison
equal deleted inserted replaced
471:c43f156a95c9 472:7dfe960c323c
7869 7869
7870 7870
7871 //----- (0044FFD8) -------------------------------------------------------- 7871 //----- (0044FFD8) --------------------------------------------------------
7872 int MapInfo::SpawnRandomTreasure(SpawnPointMM7 *a2) 7872 int MapInfo::SpawnRandomTreasure(SpawnPointMM7 *a2)
7873 { 7873 {
7874 MapInfo *v2; // ebx@1 7874 //MapInfo *v2; // ebx@1
7875 SpawnPointMM7 *v3; // esi@1 7875 //SpawnPointMM7 *v3; // esi@1
7876 int v4; // eax@1 7876 //int v4; // eax@1
7877 int v5; // edx@1 7877 int v5; // edx@1
7878 int v6; // eax@1 7878 int v6; // eax@1
7879 int v7; // ecx@1 7879 int v7; // ecx@1
7880 int v8; // ebx@1 7880 int v8; // ebx@1
7881 int v9; // eax@1 7881 int v9; // eax@1
7894 int v22; // eax@27 7894 int v22; // eax@27
7895 signed int v23; // ebx@29 7895 signed int v23; // ebx@29
7896 unsigned __int16 v24; // dx@29 7896 unsigned __int16 v24; // dx@29
7897 char *v25; // ecx@30 7897 char *v25; // ecx@30
7898 unsigned __int16 v26; // ax@33 7898 unsigned __int16 v26; // ax@33
7899 int v27; // ecx@35 7899 //int v27; // ecx@35
7900 int v28; // eax@35 7900 //int v28; // eax@35
7901 int v29; // esi@35 7901 //int v29; // esi@35
7902 __int16 v30; // ax@35 7902 //__int16 v30; // ax@35
7903 LayingItem a1a; // [sp+Ch] [bp-7Ch]@1 7903 LayingItem a1a; // [sp+Ch] [bp-7Ch]@1
7904 int v32; // [sp+7Ch] [bp-Ch]@1 7904 //int v32; // [sp+7Ch] [bp-Ch]@1
7905 int v33; // [sp+80h] [bp-8h]@1 7905 //int v33; // [sp+80h] [bp-8h]@1
7906 int v34; // [sp+84h] [bp-4h]@1 7906 int v34; // [sp+84h] [bp-4h]@1
7907 7907
7908 __debugbreak(); 7908 //auto a1 = this;
7909 7909 //v2 = a1;
7910 auto a1 = this; 7910 //v3 = a2;
7911 7911 //v4 = rand();
7912 v2 = a1;
7913 v3 = a2;
7914 v4 = rand();
7915 v34 = 0; 7912 v34 = 0;
7916 v5 = v4 % 100; 7913 v5 = rand() % 100;
7917 // v6 = 2 * (v2->Treasure_prob + 7 * v3->uIndex) - 14; 7914 // v6 = 2 * (v2->Treasure_prob + 7 * v3->uIndex) - 14;
7918 v7 = (unsigned __int8)byte_4E8168[v3->uIndex-1][2*v2->Treasure_prob]; 7915 v7 = (unsigned __int8)byte_4E8168[a2->uIndex - 1][2 * Treasure_prob];
7919 v8 = (unsigned __int8)byte_4E8168[v3->uIndex-1][2*v2->Treasure_prob+1]; 7916 v8 = (unsigned __int8)byte_4E8168[a2->uIndex - 1][2 * Treasure_prob + 1];
7920 v32 = v5; 7917 //v32 = v5;
7921 v33 = v7; 7918 //v33 = v7;
7922 v9 = rand(); 7919 v9 = rand();
7923 v10 = v8 - v33 + 1; 7920 v10 = v8 - v7 + 1;
7924 v12 = v9; 7921 v12 = v9;
7925 result = v9 / v10; 7922 result = v9 / v10;
7926 v13 = v33 + (unsigned __int64)(v12 % v10); 7923 v13 = v7 + (unsigned __int64)(v12 % v10);
7927 if ( v13 < 7 ) 7924 if ( v13 < 7 )
7928 { 7925 {
7929 if ( v32 < 20 ) 7926 if ( v5 < 20 )
7930 return result; 7927 return result;
7931 if ( v32 >= 60 ) 7928 if ( v5 >= 60 )
7932 { 7929 {
7933 v19 = v3->vPosition.z; 7930 v19 = a2->vPosition.z;
7934 v20 = v3->vPosition.y; 7931 v20 = a2->vPosition.y;
7935 v21 = v3->vPosition.x; 7932 v21 = a2->vPosition.x;
7936 v22 = rand(); 7933 v22 = rand();
7937 return sub_450521_ProllyDropItemAt(v13, v22 % 27 + 20, v21, v20, v19, 0); 7934 return sub_450521_ProllyDropItemAt(v13, v22 % 27 + 20, v21, v20, v19, 0);
7938 } 7935 }
7939 if ( v3->uIndex == 1 ) 7936 if ( a2->uIndex == 1 )
7940 { 7937 {
7941 v14 = rand() % 51 + 50; 7938 v14 = rand() % 51 + 50;
7942 } 7939 }
7943 else 7940 else
7944 { 7941 {
7945 if ( v3->uIndex != 2 ) 7942 if ( a2->uIndex != 2 )
7946 { 7943 {
7947 if ( v3->uIndex == 3 ) 7944 if ( a2->uIndex == 3 )
7948 { 7945 {
7949 v14 = rand() % 301 + 200; 7946 v14 = rand() % 301 + 200;
7950 } 7947 }
7951 else 7948 else
7952 { 7949 {
7953 if ( v3->uIndex != 4 ) 7950 if ( a2->uIndex != 4 )
7954 { 7951 {
7955 if ( v3->uIndex == 5 ) 7952 if ( a2->uIndex == 5 )
7956 { 7953 {
7957 v14 = rand() % 1001 + 1000; 7954 v14 = rand() % 1001 + 1000;
7958 } 7955 }
7959 else 7956 else
7960 { 7957 {
7961 if ( v3->uIndex != 6 ) 7958 if ( a2->uIndex != 6 )
7962 { 7959 {
7963 LABEL_20: 7960 LABEL_20:
7964 v15 = 0; 7961 v15 = 0;
7965 v16 = pItemsTable->pItems[a1a.stru_24.uItemID].uSpriteID; 7962 v16 = pItemsTable->pItems[a1a.stru_24.uItemID].uSpriteID;
7966 a1a.uItemType = pItemsTable->pItems[a1a.stru_24.uItemID].uSpriteID; 7963 a1a.uItemType = pItemsTable->pItems[a1a.stru_24.uItemID].uSpriteID;
8026 } 8023 }
8027 v26 = v23; 8024 v26 = v23;
8028 } 8025 }
8029 a1a.uObjectDescID = v26; 8026 a1a.uObjectDescID = v26;
8030 a1a.stru_24.Reset(); 8027 a1a.stru_24.Reset();
8028
8031 LABEL_35: 8029 LABEL_35:
8032 v27 = v3->vPosition.y; 8030 a1a.vPosition.y = a2->vPosition.y;
8033 v28 = v3->vPosition.x;
8034 v29 = v3->vPosition.z;
8035 a1a.vPosition.y = v27;
8036 a1a.uAttributes = 0; 8031 a1a.uAttributes = 0;
8037 a1a.uSoundID = 0; 8032 a1a.uSoundID = 0;
8038 a1a.uFacing = 0; 8033 a1a.uFacing = 0;
8039 a1a.vPosition.z = v29; 8034 a1a.vPosition.z = a2->vPosition.z;
8040 a1a.vPosition.x = v28; 8035 a1a.vPosition.x = a2->vPosition.x;
8041 a1a.field_50 = 0; 8036 a1a.field_50 = 0;
8042 a1a.field_4C = 0; 8037 a1a.field_4C = 0;
8043 a1a.field_48 = 0; 8038 a1a.field_48 = 0;
8044 v30 = pIndoor->GetSector(v28, v27, v29);
8045 a1a.field_5C = 0; 8039 a1a.field_5C = 0;
8046 a1a.field_58_pid = 0; 8040 a1a.field_58_pid = 0;
8047 a1a.uSpriteFrameID = 0; 8041 a1a.uSpriteFrameID = 0;
8048 a1a.uSectorID = v30; 8042 a1a.uSectorID = pIndoor->GetSector(a2->vPosition.x, a2->vPosition.y, a2->vPosition.z);;
8049 return a1a.Create(0, 0, 0, 0); 8043 return a1a.Create(0, 0, 0, 0);
8050 } 8044 }
8051 8045
8052 8046
8053 //----- (00450521) -------------------------------------------------------- 8047 //----- (00450521) --------------------------------------------------------
13366 AIL_redbook_play(pAudioPlayer->hAILRedbook, startms + 1, end_ms); 13360 AIL_redbook_play(pAudioPlayer->hAILRedbook, startms + 1, end_ms);
13367 } 13361 }
13368 } 13362 }
13369 } 13363 }
13370 else 13364 else
13371 Log::Warning(L"MM init: failed"); 13365 Log::Warning(L"MM init: failed");
13372 pGame->Deinitialize(); 13366 pGame->Deinitialize();
13373 } 13367 }
13374 13368
13375 13369
13376 13370