Mercurial > mm7
comparison Items.cpp @ 477:35c0595ed61c
Слияние
author | Ritor1 |
---|---|
date | Tue, 26 Feb 2013 07:59:16 +0600 |
parents | fcdaa804074f |
children | 7f1b00901cf7 |
comparison
equal
deleted
inserted
replaced
476:9fc37a2778d3 | 477:35c0595ed61c |
---|---|
42 { 2, { 23, 23, 24, 24 }}, | 42 { 2, { 23, 23, 24, 24 }}, |
43 { 3, { 23, 23, 26, 26 }}, | 43 { 3, { 23, 23, 26, 26 }}, |
44 { 2, { 30, 26, 26, 26 }}, | 44 { 2, { 30, 26, 26, 26 }}, |
45 { 2, { 28, 25, 28, 29 }}}; | 45 { 2, { 28, 25, 28, 29 }}}; |
46 | 46 |
47 ITEM_VARIATION shopArmr_variation_ord[30] ={ | 47 ITEM_VARIATION shopArmr_variation_ord[28] ={ |
48 { 1, { 35, 35, 38, 38 }}, | 48 { 1, { 35, 35, 38, 38 }}, |
49 { 1, { 31, 31, 31, 34 }}, | 49 { 1, { 31, 31, 31, 34 }}, |
50 { 1, { 35, 35, 38, 38 }}, | 50 { 1, { 35, 35, 38, 38 }}, |
51 { 1, { 31, 31, 32, 34 }}, | 51 { 1, { 31, 31, 32, 34 }}, |
52 { 2, { 35, 35, 38, 38 }}, | 52 { 2, { 35, 35, 38, 38 }}, |
75 { 4, { 33, 31, 32, 34 }}}; | 75 { 4, { 33, 31, 32, 34 }}}; |
76 | 76 |
77 | 77 |
78 | 78 |
79 unsigned __int16 shopMagic_treasure_lvl[14]= {0, 1, 1, 2, 2, 4, 4, 3, 2, 2, 2, 2, 2, 2}; | 79 unsigned __int16 shopMagic_treasure_lvl[14]= {0, 1, 1, 2, 2, 4, 4, 3, 2, 2, 2, 2, 2, 2}; |
80 unsigned __int16 shopAlch_treasure_lvl[13]= {0, 1, 1, 2, 2, 3, 3, 4, 4, 2, 2, 2, 2}; | 80 unsigned __int16 shopAlch_treasure_lvl[13] = {0, 1, 1, 2, 2, 3, 3, 4, 4, 2, 2, 2, 2}; |
81 | 81 |
82 ITEM_VARIATION shopWeap_variation_spc[15]={ | 82 ITEM_VARIATION shopWeap_variation_spc[15]={ |
83 { 0, { 0, 0, 0, 0 }}, | 83 { 0, { 0, 0, 0, 0 }}, |
84 { 2, { 25, 30, 20, 20}}, | 84 { 2, { 25, 30, 20, 20}}, |
85 { 2, { 23, 24, 28, 20}}, | 85 { 2, { 23, 24, 28, 20}}, |
86 { 3, { 23, 24, 25, 20}}, | 86 { 3, { 23, 24, 25, 20}}, |
87 { 3, { 27, 27, 26, 26}}, | 87 { 3, { 27, 27, 26, 26}}, |
88 { 5, { 23, 26, 28, 27}}, | 88 { 5, { 23, 26, 28, 27}}, |
89 { 5, { 23, 26, 28, 27}}, | 89 { 5, { 23, 26, 28, 27}}, |
90 { 4, { 30, 24, 20, 20}}, | 90 { 4, { 30, 24, 20, 20}}, |
91 { 3, { 20, 20, 20, 20}}, | 91 { 3, { 20, 20, 20, 20}}, |
92 { 4, { 27, 27, 26, 26}}, | 92 { 4, { 27, 27, 26, 26}}, |
93 { 4, { 28, 28, 25, 25}}, | 93 { 4, { 28, 28, 25, 25}}, |
94 { 4, { 23, 23, 24, 24}}, | 94 { 4, { 23, 23, 24, 24}}, |
95 { 4, { 24, 24, 27, 20}}, | 95 { 4, { 24, 24, 27, 20}}, |
96 { 4, { 30, 26, 26, 26}}, | 96 { 4, { 30, 26, 26, 26}}, |
97 { 4, { 28, 25, 28, 29}}}; | 97 { 4, { 28, 25, 28, 29}}}; |
98 | 98 |
99 | 99 ITEM_VARIATION shopArmr_variation_spc[28]={ |
100 | 100 { 2, { 35, 35, 38, 38 }}, |
101 unsigned __int16 shopMagicSpc_treasure_lvl[14]= {0, 2, 2, 3, 3, 5, 5, 4, 3, 3, 3, 3, 3, 3}; | 101 { 2, { 31, 31, 31, 34 }}, |
102 { 2, { 35, 35, 38, 38 }}, | |
103 { 2, { 31, 31, 32, 34 }}, | |
104 { 3, { 35, 35, 38, 38 }}, | |
105 { 3, { 31, 32, 32, 33 }}, | |
106 { 3, { 35, 35, 38, 38 }}, | |
107 { 3, { 31, 31, 32, 32 }}, | |
108 { 5, { 35, 35, 38, 38 }}, | |
109 { 5, { 31, 32, 33, 34 }}, | |
110 { 5, { 35, 35, 38, 38 }}, | |
111 { 5, { 31, 32, 33, 34 }}, | |
112 { 4, { 35, 35, 38, 38 }}, | |
113 { 4, { 31, 31, 31, 31 }}, | |
114 { 3, { 35, 35, 38, 38 }}, | |
115 { 3, { 31, 32, 34, 34 }}, | |
116 { 4, { 35, 35, 38, 38 }}, | |
117 { 4, { 31, 31, 32, 33 }}, | |
118 { 4, { 35, 35, 38, 38 }}, | |
119 { 4, { 32, 32, 33, 34 }}, | |
120 { 4, { 35, 35, 38, 38 }}, | |
121 { 4, { 31, 31, 31, 32 }}, | |
122 { 4, { 35, 35, 38, 38 }}, | |
123 { 4, { 32, 32, 32, 32 }}, | |
124 { 4, { 35, 35, 38, 38 }}, | |
125 { 4, { 34, 34, 34, 34 }}, | |
126 { 5, { 35, 35, 38, 38 }}, | |
127 { 5, { 33, 33, 33, 33 }} | |
128 }; | |
129 | |
130 unsigned __int16 shopMagicSpc_treasure_lvl[14] = {0, 2, 2, 3, 3, 5, 5, 4, 3, 3, 3, 3, 3, 3}; | |
131 unsigned __int16 shopAlchSpc_treasure_lvl[13] = {0, 2, 2, 3, 3, 4, 4, 5, 5, 3, 2, 2, 2}; | |
102 | 132 |
103 | 133 |
104 ItemGen *ptr_50C9A4; | 134 ItemGen *ptr_50C9A4; |
105 | 135 |
106 struct ItemsTable *pItemsTable; // 005D29E0 | 136 struct ItemsTable *pItemsTable; // 005D29E0 |
1958 } | 1988 } |
1959 | 1989 |
1960 //----- (004B8F94) -------------------------------------------------------- | 1990 //----- (004B8F94) -------------------------------------------------------- |
1961 void GenerateSpecialShopItems() | 1991 void GenerateSpecialShopItems() |
1962 { | 1992 { |
1963 /*GUIWindow *v0; // edi@1 | |
1964 signed int v1; // ebp@1 | |
1965 int v2; // ebx@1 | |
1966 signed int v3; // esi@1 | |
1967 int v4; // eax@3 | |
1968 int v5; // ebx@3 | |
1969 int v6; // ecx@3 | |
1970 bool v7; // eax@5 | |
1971 bool v8; // ST1C_4@5 | |
1972 int v9; // eax@5 | |
1973 int v10; // eax@10 | |
1974 void *result; // eax@15 | |
1975 signed int v12; // [sp-4h] [bp-18h]@7*/ | |
1976 | |
1977 signed int item_count; | 1993 signed int item_count; |
1978 signed int shop_index; | 1994 signed int shop_index; |
1979 int treasure_lvl; | 1995 int treasure_lvl; |
1980 int item_class; | 1996 int item_class; |
1981 int mdf; | 1997 int mdf; |
1993 else if (shop_index<=28) //armor shop | 2009 else if (shop_index<=28) //armor shop |
1994 { | 2010 { |
1995 mdf =0; | 2011 mdf =0; |
1996 if (item_count > 3) | 2012 if (item_count > 3) |
1997 ++mdf; | 2013 ++mdf; |
1998 treasure_lvl = shopArmr_variation_ord[2*(shop_index-15)+mdf].treasure_level; | 2014 treasure_lvl = shopArmr_variation_spc[2*(shop_index-15)+mdf].treasure_level; |
1999 item_class =shopArmr_variation_ord[2*(shop_index-15)+mdf].item_class[rand() % 4]; | 2015 item_class =shopArmr_variation_spc[2*(shop_index-15)+mdf].item_class[rand() % 4]; |
2000 } | 2016 } |
2001 else if (shop_index<=41) //magic shop | 2017 else if (shop_index<=41) //magic shop |
2002 { | 2018 { |
2003 treasure_lvl = shopMagicSpc_treasure_lvl[shop_index-28]; | 2019 treasure_lvl = shopMagicSpc_treasure_lvl[shop_index-28]; |
2004 item_class = 22; //misc | 2020 item_class = 22; //misc |
2005 } | 2021 } |
2006 else if (shop_index<=53) //alchemist shop | 2022 else if (shop_index<=53) //alchemist shop |
2007 { | 2023 { |
2008 if (item_count<6) | 2024 if (item_count<6) |
2009 { | 2025 { |
2010 pParty->SpecialItemsInShop[shop_index][item_count].Reset(); | 2026 pParty->SpecialItemsInShops[shop_index][item_count].Reset(); |
2011 pParty->SpecialItemsInShop[shop_index][item_count].uItemID = rand() % 32 + 740; //mscrool | 2027 pParty->SpecialItemsInShops[shop_index][item_count].uItemID = rand() % 32 + 740; //mscrool |
2012 continue; | 2028 continue; |
2013 } | 2029 } |
2014 else | 2030 else |
2015 { | 2031 { |
2016 treasure_lvl = shopAlch_treasure_lvl[shop_index-41]; | 2032 treasure_lvl = shopAlchSpc_treasure_lvl[shop_index-41]; |
2017 item_class = 44; //potion | 2033 item_class = 44; //potion |
2018 } | 2034 } |
2019 } | 2035 } |
2020 pItemsTable->GenerateItem(treasure_lvl, item_class, &pParty->SpecialItemsInShop[shop_index][item_count]); | 2036 pItemsTable->GenerateItem(treasure_lvl, item_class, &pParty->SpecialItemsInShops[shop_index][item_count]); |
2021 pParty->SpecialItemsInShop[shop_index][item_count].SetIdentified(); //identified | 2037 pParty->SpecialItemsInShops[shop_index][item_count].SetIdentified(); //identified |
2022 } | 2038 } |
2023 } | 2039 } |
2024 pParty->InTheShopFlags[shop_index] = 0; | 2040 pParty->InTheShopFlags[shop_index] = 0; |
2025 | |
2026 | |
2027 | |
2028 /* | |
2029 | |
2030 v0 = window_SpeakInHouse; | |
2031 v1 = 0; | |
2032 v2 = (int)&window_SpeakInHouse->ptr_1C; | |
2033 v3 = (signed int)window_SpeakInHouse->ptr_1C; | |
2034 //if ( _4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)ptr_507BC0->ptr_1C]] ) | |
2035 if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType] ) | |
2036 { | |
2037 while ( v3 > 14 ) | |
2038 { | |
2039 if ( v3 <= 28 ) | |
2040 { | |
2041 v7 = v1 > 3; | |
2042 v8 = v7; | |
2043 v9 = 5 * (v7 + 2 * v3 - 30); | |
2044 v3 = (signed int)v0->ptr_1C; | |
2045 v5 = word_4F06D8[v9]; | |
2046 v6 = word_4F05AE[5 * (v8 + 2 * v3) + rand() % 4]; | |
2047 goto LABEL_13; | |
2048 } | |
2049 if ( v3 <= 41 ) | |
2050 { | |
2051 v5 = word_4F07B6[v3]; | |
2052 v12 = 22; | |
2053 goto LABEL_12; | |
2054 } | |
2055 if ( v3 <= 53 ) | |
2056 { | |
2057 if ( v1 >= 6 ) | |
2058 { | |
2059 v5 = word_4F07B6[v3 + 1]; | |
2060 v12 = 44; | |
2061 LABEL_12: | |
2062 v6 = v12; | |
2063 LABEL_13: | |
2064 pItemsTable->GenerateItem(v5, v6,&pParty->SpecialItemsInShop[v3][v1]);//(ItemGen *)&pParty->field_C59C[9 * (v1 + 12 * v3) + 724]); | |
2065 v0 = window_SpeakInHouse; | |
2066 v2 = (int)&window_SpeakInHouse->ptr_1C; | |
2067 // pParty->field_C59C[9 * (v1 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 729] = 1; | |
2068 pParty->SpecialItemsInShop[(unsigned int)window_SpeakInHouse->ptr_1C][v1].uAttributes= 1; | |
2069 goto LABEL_14; | |
2070 } | |
2071 // auto _a = (ItemGen *)&pParty->field_C59C[9 * (v1 + 12 * v3) + 724]; | |
2072 auto _a =&pParty->SpecialItemsInShop[v3][v1]; | |
2073 _a->Reset(); | |
2074 // v2 = (int)&v0->ptr_1C; | |
2075 //v10 = rand(); | |
2076 // v0 = window_SpeakInHouse; | |
2077 // pParty->field_C59C[9 * (v1 + 12 * *(int *)v2) + 724] = v10 % 32 + 740; | |
2078 pParty->SpecialItemsInShop[(int)v0->ptr_1C][v1].uItemID= rand() % 32 + 740; | |
2079 } | |
2080 LABEL_14: | |
2081 v3 = *(int *)v2; | |
2082 ++v1; | |
2083 //if ( v1 >= (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * *(int *)v2]] ) | |
2084 if ( v1 >= (unsigned __int8)uItemsAmountPerShopType[p2DEvents[*(int *)v2 - 1].uType] ) | |
2085 goto LABEL_15; | |
2086 } | |
2087 v4 = 5 * v3; | |
2088 v3 = (signed int)v0->ptr_1C; | |
2089 v5 = word_4F063E[v4]; | |
2090 v6 = word_4F063E[5 * v3 + rand() % 4 + 1]; | |
2091 goto LABEL_13; | |
2092 } | |
2093 LABEL_15: | |
2094 result = v0->ptr_1C; | |
2095 pParty->InTheShopFlags[(int)v0->ptr_1C] = 0;*/ | |
2096 } | 2041 } |
2097 | 2042 |
2098 | 2043 |
2099 //----- (00450218) -------------------------------------------------------- | 2044 //----- (00450218) -------------------------------------------------------- |
2100 void __cdecl sub_450218_prolly_generate_chests_loot() | 2045 void __cdecl sub_450218_prolly_generate_chests_loot() |