Mercurial > mm7
diff Items.cpp @ 470:fcdaa804074f
Tables for shopgenerators
author | Gloval |
---|---|
date | Mon, 25 Feb 2013 17:58:00 +0400 |
parents | f7b91ef98ab2 |
children | 7f1b00901cf7 |
line wrap: on
line diff
--- a/Items.cpp Mon Feb 25 17:27:27 2013 +0600 +++ b/Items.cpp Mon Feb 25 17:58:00 2013 +0400 @@ -44,7 +44,7 @@ { 2, { 30, 26, 26, 26 }}, { 2, { 28, 25, 28, 29 }}}; -ITEM_VARIATION shopArmr_variation_ord[30] ={ +ITEM_VARIATION shopArmr_variation_ord[28] ={ { 1, { 35, 35, 38, 38 }}, { 1, { 31, 31, 31, 34 }}, { 1, { 35, 35, 38, 38 }}, @@ -77,28 +77,58 @@ unsigned __int16 shopMagic_treasure_lvl[14]= {0, 1, 1, 2, 2, 4, 4, 3, 2, 2, 2, 2, 2, 2}; -unsigned __int16 shopAlch_treasure_lvl[13]= {0, 1, 1, 2, 2, 3, 3, 4, 4, 2, 2, 2, 2}; +unsigned __int16 shopAlch_treasure_lvl[13] = {0, 1, 1, 2, 2, 3, 3, 4, 4, 2, 2, 2, 2}; ITEM_VARIATION shopWeap_variation_spc[15]={ { 0, { 0, 0, 0, 0 }}, -{ 2, { 25, 30, 20, 20}}, -{ 2, { 23, 24, 28, 20}}, -{ 3, { 23, 24, 25, 20}}, -{ 3, { 27, 27, 26, 26}}, -{ 5, { 23, 26, 28, 27}}, -{ 5, { 23, 26, 28, 27}}, -{ 4, { 30, 24, 20, 20}}, -{ 3, { 20, 20, 20, 20}}, -{ 4, { 27, 27, 26, 26}}, -{ 4, { 28, 28, 25, 25}}, -{ 4, { 23, 23, 24, 24}}, -{ 4, { 24, 24, 27, 20}}, -{ 4, { 30, 26, 26, 26}}, -{ 4, { 28, 25, 28, 29}}}; + { 2, { 25, 30, 20, 20}}, + { 2, { 23, 24, 28, 20}}, + { 3, { 23, 24, 25, 20}}, + { 3, { 27, 27, 26, 26}}, + { 5, { 23, 26, 28, 27}}, + { 5, { 23, 26, 28, 27}}, + { 4, { 30, 24, 20, 20}}, + { 3, { 20, 20, 20, 20}}, + { 4, { 27, 27, 26, 26}}, + { 4, { 28, 28, 25, 25}}, + { 4, { 23, 23, 24, 24}}, + { 4, { 24, 24, 27, 20}}, + { 4, { 30, 26, 26, 26}}, + { 4, { 28, 25, 28, 29}}}; - +ITEM_VARIATION shopArmr_variation_spc[28]={ + { 2, { 35, 35, 38, 38 }}, + { 2, { 31, 31, 31, 34 }}, + { 2, { 35, 35, 38, 38 }}, + { 2, { 31, 31, 32, 34 }}, + { 3, { 35, 35, 38, 38 }}, + { 3, { 31, 32, 32, 33 }}, + { 3, { 35, 35, 38, 38 }}, + { 3, { 31, 31, 32, 32 }}, + { 5, { 35, 35, 38, 38 }}, + { 5, { 31, 32, 33, 34 }}, + { 5, { 35, 35, 38, 38 }}, + { 5, { 31, 32, 33, 34 }}, + { 4, { 35, 35, 38, 38 }}, + { 4, { 31, 31, 31, 31 }}, + { 3, { 35, 35, 38, 38 }}, + { 3, { 31, 32, 34, 34 }}, + { 4, { 35, 35, 38, 38 }}, + { 4, { 31, 31, 32, 33 }}, + { 4, { 35, 35, 38, 38 }}, + { 4, { 32, 32, 33, 34 }}, + { 4, { 35, 35, 38, 38 }}, + { 4, { 31, 31, 31, 32 }}, + { 4, { 35, 35, 38, 38 }}, + { 4, { 32, 32, 32, 32 }}, + { 4, { 35, 35, 38, 38 }}, + { 4, { 34, 34, 34, 34 }}, + { 5, { 35, 35, 38, 38 }}, + { 5, { 33, 33, 33, 33 }} + }; -unsigned __int16 shopMagicSpc_treasure_lvl[14]= {0, 2, 2, 3, 3, 5, 5, 4, 3, 3, 3, 3, 3, 3}; +unsigned __int16 shopMagicSpc_treasure_lvl[14] = {0, 2, 2, 3, 3, 5, 5, 4, 3, 3, 3, 3, 3, 3}; +unsigned __int16 shopAlchSpc_treasure_lvl[13] = {0, 2, 2, 3, 3, 4, 4, 5, 5, 3, 2, 2, 2}; ItemGen *ptr_50C9A4; @@ -1960,20 +1990,6 @@ //----- (004B8F94) -------------------------------------------------------- void GenerateSpecialShopItems() { - /*GUIWindow *v0; // edi@1 - signed int v1; // ebp@1 - int v2; // ebx@1 - signed int v3; // esi@1 - int v4; // eax@3 - int v5; // ebx@3 - int v6; // ecx@3 - bool v7; // eax@5 - bool v8; // ST1C_4@5 - int v9; // eax@5 - int v10; // eax@10 - void *result; // eax@15 - signed int v12; // [sp-4h] [bp-18h]@7*/ - signed int item_count; signed int shop_index; int treasure_lvl; @@ -1995,8 +2011,8 @@ mdf =0; if (item_count > 3) ++mdf; - treasure_lvl = shopArmr_variation_ord[2*(shop_index-15)+mdf].treasure_level; - item_class =shopArmr_variation_ord[2*(shop_index-15)+mdf].item_class[rand() % 4]; + treasure_lvl = shopArmr_variation_spc[2*(shop_index-15)+mdf].treasure_level; + item_class =shopArmr_variation_spc[2*(shop_index-15)+mdf].item_class[rand() % 4]; } else if (shop_index<=41) //magic shop { @@ -2007,92 +2023,21 @@ { if (item_count<6) { - pParty->SpecialItemsInShop[shop_index][item_count].Reset(); - pParty->SpecialItemsInShop[shop_index][item_count].uItemID = rand() % 32 + 740; //mscrool + pParty->SpecialItemsInShops[shop_index][item_count].Reset(); + pParty->SpecialItemsInShops[shop_index][item_count].uItemID = rand() % 32 + 740; //mscrool continue; } else { - treasure_lvl = shopAlch_treasure_lvl[shop_index-41]; + treasure_lvl = shopAlchSpc_treasure_lvl[shop_index-41]; item_class = 44; //potion } } - pItemsTable->GenerateItem(treasure_lvl, item_class, &pParty->SpecialItemsInShop[shop_index][item_count]); - pParty->SpecialItemsInShop[shop_index][item_count].SetIdentified(); //identified + pItemsTable->GenerateItem(treasure_lvl, item_class, &pParty->SpecialItemsInShops[shop_index][item_count]); + pParty->SpecialItemsInShops[shop_index][item_count].SetIdentified(); //identified } } pParty->InTheShopFlags[shop_index] = 0; - - - -/* - - v0 = window_SpeakInHouse; - v1 = 0; - v2 = (int)&window_SpeakInHouse->ptr_1C; - v3 = (signed int)window_SpeakInHouse->ptr_1C; - //if ( _4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)ptr_507BC0->ptr_1C]] ) - if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType] ) - { - while ( v3 > 14 ) - { - if ( v3 <= 28 ) - { - v7 = v1 > 3; - v8 = v7; - v9 = 5 * (v7 + 2 * v3 - 30); - v3 = (signed int)v0->ptr_1C; - v5 = word_4F06D8[v9]; - v6 = word_4F05AE[5 * (v8 + 2 * v3) + rand() % 4]; - goto LABEL_13; - } - if ( v3 <= 41 ) - { - v5 = word_4F07B6[v3]; - v12 = 22; - goto LABEL_12; - } - if ( v3 <= 53 ) - { - if ( v1 >= 6 ) - { - v5 = word_4F07B6[v3 + 1]; - v12 = 44; -LABEL_12: - v6 = v12; -LABEL_13: - pItemsTable->GenerateItem(v5, v6,&pParty->SpecialItemsInShop[v3][v1]);//(ItemGen *)&pParty->field_C59C[9 * (v1 + 12 * v3) + 724]); - v0 = window_SpeakInHouse; - v2 = (int)&window_SpeakInHouse->ptr_1C; - // pParty->field_C59C[9 * (v1 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 729] = 1; - pParty->SpecialItemsInShop[(unsigned int)window_SpeakInHouse->ptr_1C][v1].uAttributes= 1; - goto LABEL_14; - } - // auto _a = (ItemGen *)&pParty->field_C59C[9 * (v1 + 12 * v3) + 724]; - auto _a =&pParty->SpecialItemsInShop[v3][v1]; - _a->Reset(); - // v2 = (int)&v0->ptr_1C; - //v10 = rand(); - // v0 = window_SpeakInHouse; - // pParty->field_C59C[9 * (v1 + 12 * *(int *)v2) + 724] = v10 % 32 + 740; - pParty->SpecialItemsInShop[(int)v0->ptr_1C][v1].uItemID= rand() % 32 + 740; - } -LABEL_14: - v3 = *(int *)v2; - ++v1; - //if ( v1 >= (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * *(int *)v2]] ) - if ( v1 >= (unsigned __int8)uItemsAmountPerShopType[p2DEvents[*(int *)v2 - 1].uType] ) - goto LABEL_15; - } - v4 = 5 * v3; - v3 = (signed int)v0->ptr_1C; - v5 = word_4F063E[v4]; - v6 = word_4F063E[5 * v3 + rand() % 4 + 1]; - goto LABEL_13; - } -LABEL_15: - result = v0->ptr_1C; - pParty->InTheShopFlags[(int)v0->ptr_1C] = 0;*/ }