comparison mm7_2.cpp @ 470:fcdaa804074f

Tables for shopgenerators
author Gloval
date Mon, 25 Feb 2013 17:58:00 +0400
parents 0dbf780e247f
children c43f156a95c9
comparison
equal deleted inserted replaced
469:0dbf780e247f 470:fcdaa804074f
1438 v109 = 0; 1438 v109 = 0;
1439 v108 = 0; 1439 v108 = 0;
1440 do 1440 do
1441 { 1441 {
1442 // if ( pParty->field_C59C[9 * (int)&v109[3 * (unsigned int)window_SpeakInHouse->ptr_1C] + 724] ) 1442 // if ( pParty->field_C59C[9 * (int)&v109[3 * (unsigned int)window_SpeakInHouse->ptr_1C] + 724] )
1443 if (pParty->SpecialItemsInShop[(unsigned int)window_SpeakInHouse->ptr_1C][(signed int)v109].uItemID) 1443 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(signed int)v109].uItemID)
1444 { 1444 {
1445 v52 = word_F8B158[(signed int)v109] + 30; 1445 v52 = word_F8B158[(signed int)v109] + 30;
1446 v53 = dword_F8B168[(signed int)v109]; 1446 v53 = dword_F8B168[(signed int)v109];
1447 v54 = 60 - ((signed int)v53->uTextureWidth >> 1); 1447 v54 = 60 - ((signed int)v53->uTextureWidth >> 1);
1448 pRenderer->DrawTextureTransparent(v54 + v108, word_F8B158[(signed int)v109] + 30, v53); 1448 pRenderer->DrawTextureTransparent(v54 + v108, word_F8B158[(signed int)v109] + 30, v53);
1475 else 1475 else
1476 { 1476 {
1477 do 1477 do
1478 { 1478 {
1479 // if ( pParty->field_C59C[9 * (v55 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] ) 1479 // if ( pParty->field_C59C[9 * (v55 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
1480 if (pParty->SpecialItemsInShop[(unsigned int)window_SpeakInHouse->ptr_1C][v55].uItemID) 1480 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v55].uItemID)
1481 ++v106.x; 1481 ++v106.x;
1482 ++v55; 1482 ++v55;
1483 } 1483 }
1484 while ( v55 < 6 ); 1484 while ( v55 < 6 );
1485 } 1485 }
1507 v106.x = v60; 1507 v106.x = v60;
1508 v61 = (int)window_SpeakInHouse->ptr_1C; 1508 v61 = (int)window_SpeakInHouse->ptr_1C;
1509 // v62 = 9 * (v60 + 12 * v61); 1509 // v62 = 9 * (v60 + 12 * v61);
1510 v63 = (ItemGen *)&pParty->StandartItemsInShops[(int)v61][v60]; 1510 v63 = (ItemGen *)&pParty->StandartItemsInShops[(int)v61][v60];
1511 if ( dword_F8B19C != 2 ) 1511 if ( dword_F8B19C != 2 )
1512 v63 = &pParty->SpecialItemsInShop[(int)v61][v60];//v63 = (ItemGen *)&pParty->field_C59C[v62 + 724]; 1512 v63 = &pParty->SpecialItemsInShops[(int)v61][v60];//v63 = (ItemGen *)&pParty->field_C59C[v62 + 724];
1513 if ( !v56 || !Str ) 1513 if ( !v56 || !Str )
1514 { 1514 {
1515 v85 = 0; 1515 v85 = 0;
1516 v83 = 2; 1516 v83 = 2;
1517 v81 = window_SpeakInHouse->ptr_1C; 1517 v81 = window_SpeakInHouse->ptr_1C;
2017 else 2017 else
2018 { 2018 {
2019 do 2019 do
2020 { 2020 {
2021 //if ( pParty->field_C59C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] ) 2021 //if ( pParty->field_C59C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
2022 if (pParty->SpecialItemsInShop[(unsigned int)window_SpeakInHouse->ptr_1C][v114].uItemID) 2022 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v114].uItemID)
2023 { 2023 {
2024 v54 = dword_F8B168[v114]; 2024 v54 = dword_F8B168[v114];
2025 v55 = 152 - v54->uTextureHeight; 2025 v55 = 152 - v54->uTextureHeight;
2026 if ( (signed int)v55 < 1 ) 2026 if ( (signed int)v55 < 1 )
2027 v55 = 0; 2027 v55 = 0;
2048 while ( v114 < 6 ); 2048 while ( v114 < 6 );
2049 v114 = 0; 2049 v114 = 0;
2050 do 2050 do
2051 { 2051 {
2052 // if ( pParty->field_C59C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 778] ) //weak 2052 // if ( pParty->field_C59C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 778] ) //weak
2053 if (pParty->SpecialItemsInShop[(unsigned int)window_SpeakInHouse->ptr_1C][(signed int)v114].uItemID) //not itemid 2053 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(signed int)v114].uItemID) //not itemid
2054 { 2054 {
2055 v58 = dword_F8B168[v114 + 6]; 2055 v58 = dword_F8B168[v114 + 6];
2056 v59 = 308 - v58->uTextureHeight; 2056 v59 = 308 - v58->uTextureHeight;
2057 if ( (signed int)v59 < 1 ) 2057 if ( (signed int)v59 < 1 )
2058 v59 = 0; 2058 v59 = 0;
2097 else 2097 else
2098 { 2098 {
2099 do 2099 do
2100 { 2100 {
2101 //if ( pParty->field_C59C[9 * (v62 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] ) 2101 //if ( pParty->field_C59C[9 * (v62 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
2102 if (pParty->SpecialItemsInShop[(unsigned int)window_SpeakInHouse->ptr_1C][v62].uItemID) 2102 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v62].uItemID)
2103 ++v109; 2103 ++v109;
2104 ++v62; 2104 ++v62;
2105 } 2105 }
2106 while ( v62 < 12 ); 2106 while ( v62 < 12 );
2107 } 2107 }
2133 v109 = v67; 2133 v109 = v67;
2134 v68 = (int)window_SpeakInHouse->ptr_1C; 2134 v68 = (int)window_SpeakInHouse->ptr_1C;
2135 // v69 = 9 * (v67 + 12 * v68); 2135 // v69 = 9 * (v67 + 12 * v68);
2136 v70 = (ItemGen *)&pParty->StandartItemsInShops[v68][v67]; 2136 v70 = (ItemGen *)&pParty->StandartItemsInShops[v68][v67];
2137 if ( dword_F8B19C != 2 ) 2137 if ( dword_F8B19C != 2 )
2138 v70 = &pParty->SpecialItemsInShop[(int)v68][v67];//v70 = (ItemGen *)&pParty->field_C59C[v69 + 724]; 2138 v70 = &pParty->SpecialItemsInShops[(int)v68][v67];//v70 = (ItemGen *)&pParty->field_C59C[v69 + 724];
2139 if ( !v63 || !Str ) 2139 if ( !v63 || !Str )
2140 { 2140 {
2141 v93 = 0; 2141 v93 = 0;
2142 v91 = 2; 2142 v91 = 2;
2143 v89 = window_SpeakInHouse->ptr_1C; 2143 v89 = window_SpeakInHouse->ptr_1C;
2338 v149 = 0; 2338 v149 = 0;
2339 v93 = 0; 2339 v93 = 0;
2340 do 2340 do
2341 { 2341 {
2342 // if ( pParty->field_C59C[9 * (v93 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] ) 2342 // if ( pParty->field_C59C[9 * (v93 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
2343 if (pParty->SpecialItemsInShop[(unsigned int)window_SpeakInHouse->ptr_1C][v93].uItemID) 2343 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v93].uItemID)
2344 ++v149; 2344 ++v149;
2345 ++v93; 2345 ++v93;
2346 } 2346 }
2347 while ( v93 < 8 ); 2347 while ( v93 < 8 );
2348 if ( v149 ) 2348 if ( v149 )
2355 --v149; 2355 --v149;
2356 v96 = window_SpeakInHouse->ptr_1C; 2356 v96 = window_SpeakInHouse->ptr_1C;
2357 v97 = uActiveCharacter - 1; 2357 v97 = uActiveCharacter - 1;
2358 // v98 = (ItemGen *)&pParty->field_C59C[9 * (v95 - 1 + 12 * (int)v96) + 724]; 2358 // v98 = (ItemGen *)&pParty->field_C59C[9 * (v95 - 1 + 12 * (int)v96) + 724];
2359 v99 = _this->_490EEE( 2359 v99 = _this->_490EEE(
2360 &pParty->SpecialItemsInShop[(int)v96][v95-1],// (ItemGen *)&pParty->field_C59C[9 * (v95 - 1 + 12 * (int)v96) + 724], 2360 &pParty->SpecialItemsInShops[(int)v96][v95-1],// (ItemGen *)&pParty->field_C59C[9 * (v95 - 1 + 12 * (int)v96) + 724],
2361 2, 2361 2,
2362 (int)window_SpeakInHouse->ptr_1C, 2362 (int)window_SpeakInHouse->ptr_1C,
2363 2); 2363 2);
2364 v100 = BuilDialogueString((char *)pMerchantsBuyPhrases[v99], v97, v98, (char *)v96, 2, 0); 2364 v100 = BuilDialogueString((char *)pMerchantsBuyPhrases[v99], v97, v98, (char *)v96, 2, 0);
2365 v101 = v100; 2365 v101 = v100;
2370 v104 = 0; 2370 v104 = 0;
2371 v153 = 0; 2371 v153 = 0;
2372 do 2372 do
2373 { 2373 {
2374 //if ( pParty->field_C59C[9 * (v104 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] ) 2374 //if ( pParty->field_C59C[9 * (v104 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
2375 if (pParty->SpecialItemsInShop[(unsigned int)window_SpeakInHouse->ptr_1C][v104].uItemID) 2375 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v104].uItemID)
2376 { 2376 {
2377 v105 = dword_F8B168[v104]; 2377 v105 = dword_F8B168[v104];
2378 if ( v104 >= 4 ) 2378 if ( v104 >= 4 )
2379 { 2379 {
2380 v110 = 90 - ((signed int)v105->uTextureWidth >> 1); 2380 v110 = 90 - ((signed int)v105->uTextureWidth >> 1);
2593 v61 = 0; 2593 v61 = 0;
2594 v153 = 0; 2594 v153 = 0;
2595 do 2595 do
2596 { 2596 {
2597 // if ( (char *)pParty->field_C59C[9 * (v61 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] != v11 ) 2597 // if ( (char *)pParty->field_C59C[9 * (v61 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] != v11 )
2598 if (pParty->SpecialItemsInShop[(unsigned int)window_SpeakInHouse->ptr_1C][v61].uItemID) 2598 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v61].uItemID)
2599 { 2599 {
2600 v62 = dword_F8B168[v61]; 2600 v62 = dword_F8B168[v61];
2601 if ( v61 >= 4 ) 2601 if ( v61 >= 4 )
2602 { 2602 {
2603 v67 = 90 - ((signed int)v62->uTextureWidth >> 1); 2603 v67 = 90 - ((signed int)v62->uTextureWidth >> 1);
2641 else 2641 else
2642 { 2642 {
2643 do 2643 do
2644 { 2644 {
2645 // if ( (char *)pParty->field_C59C[9 * (v68 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] != v11 ) 2645 // if ( (char *)pParty->field_C59C[9 * (v68 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] != v11 )
2646 if (pParty->SpecialItemsInShop[(unsigned int)window_SpeakInHouse->ptr_1C][(signed int)v68].uItemID) 2646 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(signed int)v68].uItemID)
2647 ++v149; 2647 ++v149;
2648 ++v68; 2648 ++v68;
2649 } 2649 }
2650 while ( v68 < 6 ); 2650 while ( v68 < 6 );
2651 } 2651 }
2673 v75 = (int)window_SpeakInHouse->ptr_1C; 2673 v75 = (int)window_SpeakInHouse->ptr_1C;
2674 v76 = 9 * (v74 - 1 + 12 * v75); 2674 v76 = 9 * (v74 - 1 + 12 * v75);
2675 if ( dword_F8B19C == 2 ) 2675 if ( dword_F8B19C == 2 )
2676 v77 = (ItemGen *)&pParty->StandartItemsInShops[v76]; 2676 v77 = (ItemGen *)&pParty->StandartItemsInShops[v76];
2677 else 2677 else
2678 v77 = &pParty->SpecialItemsInShop[(int)75][v74-1];//(ItemGen *)&pParty->field_C59C[v76 + 724]; 2678 v77 = &pParty->SpecialItemsInShops[(int)75][v74-1];//(ItemGen *)&pParty->field_C59C[v76 + 724];
2679 if ( v69 == (short)v11 || Str == v11 ) 2679 if ( v69 == (short)v11 || Str == v11 )
2680 { 2680 {
2681 v124 = (__int64 *)v11; 2681 v124 = (__int64 *)v11;
2682 v122 = 2; 2682 v122 = 2;
2683 v120 = window_SpeakInHouse->ptr_1C; 2683 v120 = window_SpeakInHouse->ptr_1C;
4195 if ( uItemsAmountPerShopType[v44] ) 4195 if ( uItemsAmountPerShopType[v44] )
4196 { 4196 {
4197 do 4197 do
4198 { 4198 {
4199 //v50 = pParty->field_C59C[9 * (v43 + 12 * (int)v42) + 724]; 4199 //v50 = pParty->field_C59C[9 * (v43 + 12 * (int)v42) + 724];
4200 v50=pParty->SpecialItemsInShop[(unsigned int)v42][(signed int)v43].uItemID; 4200 v50=pParty->SpecialItemsInShops[(unsigned int)v42][(signed int)v43].uItemID;
4201 if ( v50 ) 4201 if ( v50 )
4202 { 4202 {
4203 v51 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v50].pIconName, TEXTURE_16BIT_PALETTE); 4203 v51 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v50].pIconName, TEXTURE_16BIT_PALETTE);
4204 //v3 = dword_F8B198; 4204 //v3 = dword_F8B198;
4205 v8 = window_SpeakInHouse; 4205 v8 = window_SpeakInHouse;
4219 if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] ) 4219 if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] )
4220 { 4220 {
4221 do 4221 do
4222 { 4222 {
4223 // if ( pParty->field_C59C[9 * (v53 + 12 * (int)v52) + 724] ) 4223 // if ( pParty->field_C59C[9 * (v53 + 12 * (int)v52) + 724] )
4224 if (pParty->SpecialItemsInShop[(unsigned int)v52][v53].uItemID) 4224 if (pParty->SpecialItemsInShops[(unsigned int)v52][v53].uItemID)
4225 { 4225 {
4226 v54 = rand(); 4226 v54 = rand();
4227 v8 = window_SpeakInHouse; 4227 v8 = window_SpeakInHouse;
4228 word_F8B158[v53] = v54 % (300 - dword_F8B168[v53]->uTextureHeight); 4228 word_F8B158[v53] = v54 % (300 - dword_F8B168[v53]->uTextureHeight);
4229 } 4229 }
4537 v32 = (ItemGen *)&pParty->StandartItemsInShops[(int)v30][v29]; 4537 v32 = (ItemGen *)&pParty->StandartItemsInShops[(int)v30][v29];
4538 _this = (ItemGen *)&pParty->StandartItemsInShops[(int)v30][v29]; 4538 _this = (ItemGen *)&pParty->StandartItemsInShops[(int)v30][v29];
4539 } 4539 }
4540 else 4540 else
4541 { 4541 {
4542 _this =&pParty->SpecialItemsInShop[(int)v30][v29-1]; //(ItemGen *)&pParty->field_C59C[v31 + 724]; 4542 _this =&pParty->SpecialItemsInShops[(int)v30][v29-1]; //(ItemGen *)&pParty->field_C59C[v31 + 724];
4543 v32 = &pParty->SpecialItemsInShop[(int)v30][v29-1];//(ItemGen *)&pParty->field_C59C[v31 + 724]; 4543 v32 = &pParty->SpecialItemsInShops[(int)v30][v29-1];//(ItemGen *)&pParty->field_C59C[v31 + 724];
4544 } 4544 }
4545 //v33 = p2DEvents_minus1__20[13 * (signed int)v30]; 4545 //v33 = p2DEvents_minus1__20[13 * (signed int)v30];
4546 v33 = p2DEvents[(signed int)v30 - 1].fPriceMultiplier; 4546 v33 = p2DEvents[(signed int)v30 - 1].fPriceMultiplier;
4547 v34 = v32->GetValue(); 4547 v34 = v32->GetValue();
4548 v80 = v0->_4B8142(v34, v33); 4548 v80 = v0->_4B8142(v34, v33);