Mercurial > mm7
diff Items.cpp @ 1920:05b433b8cb37
GuildDialog fix and cleared
author | Ritor1 |
---|---|
date | Wed, 23 Oct 2013 12:49:25 +0600 |
parents | dd9d4b7c1199 |
children | 5fcf6023f9c3 |
line wrap: on
line diff
--- a/Items.cpp Wed Oct 23 10:24:38 2013 +0600 +++ b/Items.cpp Wed Oct 23 12:49:25 2013 +0600 @@ -2428,109 +2428,109 @@ } //----- (004B8E3D) -------------------------------------------------------- void GenerateStandartShopItems() - { - signed int item_count; - signed int shop_index; - int treasure_lvl; - int item_class; - int mdf; +{ + signed int item_count; + signed int shop_index; + int treasure_lvl; + int item_class; + int mdf; - shop_index = (signed int)window_SpeakInHouse->ptr_1C; - if ( uItemsAmountPerShopType[p2DEvents[shop_index - 1].uType] ) - { - for (item_count=0; item_count<=uItemsAmountPerShopType[p2DEvents[shop_index - 1].uType]; ++item_count ) - { - if (shop_index<=14) //weapon shop - { - treasure_lvl = shopWeap_variation_ord[shop_index].treasure_level; - item_class =shopWeap_variation_ord[shop_index].item_class[rand() % 4]; - } - else if (shop_index<=28) //armor shop - { - mdf =0; - if (item_count > 3) - ++mdf;// rechek offsets - 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]; - } - else if (shop_index<=41) //magic shop - { - treasure_lvl = shopMagic_treasure_lvl[shop_index-28]; - item_class = 22; //misc - } - else if (shop_index<=53) //alchemist shop - { - if (item_count<6) - { - pParty->StandartItemsInShops[shop_index][item_count].Reset(); - pParty->StandartItemsInShops[shop_index][item_count].uItemID = 220; //potion bottle - continue; - } - else - { - treasure_lvl = shopAlch_treasure_lvl[shop_index-41]; - item_class = 45; //reagent - } - } - pItemsTable->GenerateItem(treasure_lvl, item_class, &pParty->StandartItemsInShops[shop_index][item_count]); - pParty->StandartItemsInShops[shop_index][item_count].SetIdentified(); //identified - } - } - pParty->InTheShopFlags[shop_index] = 0; - } + shop_index = (signed int)window_SpeakInHouse->ptr_1C; + if ( uItemsAmountPerShopType[p2DEvents[shop_index - 1].uType] ) + { + for (item_count = 0; item_count < uItemsAmountPerShopType[p2DEvents[shop_index - 1].uType]; ++item_count ) + { + if (shop_index <= 14) //weapon shop + { + treasure_lvl = shopWeap_variation_ord[shop_index].treasure_level; + item_class = shopWeap_variation_ord[shop_index].item_class[rand() % 4]; + } + else if (shop_index <= 28) //armor shop + { + mdf = 0; + if (item_count > 3) + ++mdf;// rechek offsets + 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]; + } + else if (shop_index <= 41) //magic shop + { + treasure_lvl = shopMagic_treasure_lvl[shop_index - 28]; + item_class = 22; //misc + } + else if (shop_index <= 53) //alchemist shop + { + if (item_count < 6) + { + pParty->StandartItemsInShops[shop_index][item_count].Reset(); + pParty->StandartItemsInShops[shop_index][item_count].uItemID = 220; //potion bottle + continue; + } + else + { + treasure_lvl = shopAlch_treasure_lvl[shop_index - 41]; + item_class = 45; //reagent + } + } + pItemsTable->GenerateItem(treasure_lvl, item_class, &pParty->StandartItemsInShops[shop_index][item_count]); + pParty->StandartItemsInShops[shop_index][item_count].SetIdentified(); //identified + } + } + pParty->InTheShopFlags[shop_index] = 0; +} //----- (004B8F94) -------------------------------------------------------- void GenerateSpecialShopItems() - { - signed int item_count; - signed int shop_index; - int treasure_lvl; - int item_class; - int mdf; +{ + signed int item_count; + signed int shop_index; + int treasure_lvl; + int item_class; + int mdf; - shop_index = (signed int)window_SpeakInHouse->ptr_1C; - if ( uItemsAmountPerShopType[p2DEvents[shop_index - 1].uType] ) - { - for (item_count=0; item_count<=uItemsAmountPerShopType[p2DEvents[shop_index - 1].uType]; ++item_count ) - { - if (shop_index<=14) //weapon shop - { - treasure_lvl = shopWeap_variation_spc[shop_index].treasure_level; - item_class = shopWeap_variation_spc[shop_index].item_class[rand() % 4]; - } - else if (shop_index<=28) //armor shop - { - mdf =0; - if (item_count > 3) - ++mdf; - 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 - { - treasure_lvl = shopMagicSpc_treasure_lvl[shop_index-28]; - item_class = 22; //misc - } - else if (shop_index<=53) //alchemist shop - { - if (item_count<6) - { - pParty->SpecialItemsInShops[shop_index][item_count].Reset(); - pParty->SpecialItemsInShops[shop_index][item_count].uItemID = rand() % 32 + 740; //mscrool - continue; - } - else - { - treasure_lvl = shopAlchSpc_treasure_lvl[shop_index-41]; - item_class = 44; //potion - } - } - 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; - } + shop_index = (signed int)window_SpeakInHouse->ptr_1C; + if ( uItemsAmountPerShopType[p2DEvents[shop_index - 1].uType] ) + { + for ( item_count = 0; item_count < uItemsAmountPerShopType[p2DEvents[shop_index - 1].uType]; ++item_count ) + { + if (shop_index <= 14) //weapon shop + { + treasure_lvl = shopWeap_variation_spc[shop_index].treasure_level; + item_class = shopWeap_variation_spc[shop_index].item_class[rand() % 4]; + } + else if (shop_index <= 28) //armor shop + { + mdf = 0; + if (item_count > 3) + ++mdf; + 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 + { + treasure_lvl = shopMagicSpc_treasure_lvl[shop_index - 28]; + item_class = 22; //misc + } + else if (shop_index <= 53) //alchemist shop + { + if (item_count < 6) + { + pParty->SpecialItemsInShops[shop_index][item_count].Reset(); + pParty->SpecialItemsInShops[shop_index][item_count].uItemID = rand() % 32 + 740; //mscrool + continue; + } + else + { + treasure_lvl = shopAlchSpc_treasure_lvl[shop_index - 41]; + item_class = 44; //potion + } + } + 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; +} //----- (00450218) --------------------------------------------------------