comparison Items.cpp @ 1920:05b433b8cb37

GuildDialog fix and cleared
author Ritor1
date Wed, 23 Oct 2013 12:49:25 +0600
parents dd9d4b7c1199
children 5fcf6023f9c3
comparison
equal deleted inserted replaced
1919:140ca8123384 1920:05b433b8cb37
2426 { 2426 {
2427 return pItemsTable->pItems[this->uItemID].uDamageMod; 2427 return pItemsTable->pItems[this->uItemID].uDamageMod;
2428 } 2428 }
2429 //----- (004B8E3D) -------------------------------------------------------- 2429 //----- (004B8E3D) --------------------------------------------------------
2430 void GenerateStandartShopItems() 2430 void GenerateStandartShopItems()
2431 { 2431 {
2432 signed int item_count; 2432 signed int item_count;
2433 signed int shop_index; 2433 signed int shop_index;
2434 int treasure_lvl; 2434 int treasure_lvl;
2435 int item_class; 2435 int item_class;
2436 int mdf; 2436 int mdf;
2437 2437
2438 shop_index = (signed int)window_SpeakInHouse->ptr_1C; 2438 shop_index = (signed int)window_SpeakInHouse->ptr_1C;
2439 if ( uItemsAmountPerShopType[p2DEvents[shop_index - 1].uType] ) 2439 if ( uItemsAmountPerShopType[p2DEvents[shop_index - 1].uType] )
2440 { 2440 {
2441 for (item_count=0; item_count<=uItemsAmountPerShopType[p2DEvents[shop_index - 1].uType]; ++item_count ) 2441 for (item_count = 0; item_count < uItemsAmountPerShopType[p2DEvents[shop_index - 1].uType]; ++item_count )
2442 { 2442 {
2443 if (shop_index<=14) //weapon shop 2443 if (shop_index <= 14) //weapon shop
2444 { 2444 {
2445 treasure_lvl = shopWeap_variation_ord[shop_index].treasure_level; 2445 treasure_lvl = shopWeap_variation_ord[shop_index].treasure_level;
2446 item_class =shopWeap_variation_ord[shop_index].item_class[rand() % 4]; 2446 item_class = shopWeap_variation_ord[shop_index].item_class[rand() % 4];
2447 } 2447 }
2448 else if (shop_index<=28) //armor shop 2448 else if (shop_index <= 28) //armor shop
2449 { 2449 {
2450 mdf =0; 2450 mdf = 0;
2451 if (item_count > 3) 2451 if (item_count > 3)
2452 ++mdf;// rechek offsets 2452 ++mdf;// rechek offsets
2453 treasure_lvl = shopArmr_variation_ord[2*(shop_index-15)+mdf].treasure_level; 2453 treasure_lvl = shopArmr_variation_ord[2*(shop_index - 15) + mdf].treasure_level;
2454 item_class =shopArmr_variation_ord[2*(shop_index-15)+mdf].item_class[rand() % 4]; 2454 item_class = shopArmr_variation_ord[2*(shop_index - 15) + mdf].item_class[rand() % 4];
2455 } 2455 }
2456 else if (shop_index<=41) //magic shop 2456 else if (shop_index <= 41) //magic shop
2457 { 2457 {
2458 treasure_lvl = shopMagic_treasure_lvl[shop_index-28]; 2458 treasure_lvl = shopMagic_treasure_lvl[shop_index - 28];
2459 item_class = 22; //misc 2459 item_class = 22; //misc
2460 } 2460 }
2461 else if (shop_index<=53) //alchemist shop 2461 else if (shop_index <= 53) //alchemist shop
2462 { 2462 {
2463 if (item_count<6) 2463 if (item_count < 6)
2464 { 2464 {
2465 pParty->StandartItemsInShops[shop_index][item_count].Reset(); 2465 pParty->StandartItemsInShops[shop_index][item_count].Reset();
2466 pParty->StandartItemsInShops[shop_index][item_count].uItemID = 220; //potion bottle 2466 pParty->StandartItemsInShops[shop_index][item_count].uItemID = 220; //potion bottle
2467 continue; 2467 continue;
2468 } 2468 }
2469 else 2469 else
2470 { 2470 {
2471 treasure_lvl = shopAlch_treasure_lvl[shop_index-41]; 2471 treasure_lvl = shopAlch_treasure_lvl[shop_index - 41];
2472 item_class = 45; //reagent 2472 item_class = 45; //reagent
2473 } 2473 }
2474 } 2474 }
2475 pItemsTable->GenerateItem(treasure_lvl, item_class, &pParty->StandartItemsInShops[shop_index][item_count]); 2475 pItemsTable->GenerateItem(treasure_lvl, item_class, &pParty->StandartItemsInShops[shop_index][item_count]);
2476 pParty->StandartItemsInShops[shop_index][item_count].SetIdentified(); //identified 2476 pParty->StandartItemsInShops[shop_index][item_count].SetIdentified(); //identified
2477 } 2477 }
2478 } 2478 }
2479 pParty->InTheShopFlags[shop_index] = 0; 2479 pParty->InTheShopFlags[shop_index] = 0;
2480 } 2480 }
2481 2481
2482 //----- (004B8F94) -------------------------------------------------------- 2482 //----- (004B8F94) --------------------------------------------------------
2483 void GenerateSpecialShopItems() 2483 void GenerateSpecialShopItems()
2484 { 2484 {
2485 signed int item_count; 2485 signed int item_count;
2486 signed int shop_index; 2486 signed int shop_index;
2487 int treasure_lvl; 2487 int treasure_lvl;
2488 int item_class; 2488 int item_class;
2489 int mdf; 2489 int mdf;
2490 2490
2491 shop_index = (signed int)window_SpeakInHouse->ptr_1C; 2491 shop_index = (signed int)window_SpeakInHouse->ptr_1C;
2492 if ( uItemsAmountPerShopType[p2DEvents[shop_index - 1].uType] ) 2492 if ( uItemsAmountPerShopType[p2DEvents[shop_index - 1].uType] )
2493 { 2493 {
2494 for (item_count=0; item_count<=uItemsAmountPerShopType[p2DEvents[shop_index - 1].uType]; ++item_count ) 2494 for ( item_count = 0; item_count < uItemsAmountPerShopType[p2DEvents[shop_index - 1].uType]; ++item_count )
2495 { 2495 {
2496 if (shop_index<=14) //weapon shop 2496 if (shop_index <= 14) //weapon shop
2497 { 2497 {
2498 treasure_lvl = shopWeap_variation_spc[shop_index].treasure_level; 2498 treasure_lvl = shopWeap_variation_spc[shop_index].treasure_level;
2499 item_class = shopWeap_variation_spc[shop_index].item_class[rand() % 4]; 2499 item_class = shopWeap_variation_spc[shop_index].item_class[rand() % 4];
2500 } 2500 }
2501 else if (shop_index<=28) //armor shop 2501 else if (shop_index <= 28) //armor shop
2502 { 2502 {
2503 mdf =0; 2503 mdf = 0;
2504 if (item_count > 3) 2504 if (item_count > 3)
2505 ++mdf; 2505 ++mdf;
2506 treasure_lvl = shopArmr_variation_spc[2*(shop_index-15)+mdf].treasure_level; 2506 treasure_lvl = shopArmr_variation_spc[2*(shop_index - 15) + mdf].treasure_level;
2507 item_class =shopArmr_variation_spc[2*(shop_index-15)+mdf].item_class[rand() % 4]; 2507 item_class = shopArmr_variation_spc[2*(shop_index - 15) + mdf].item_class[rand() % 4];
2508 } 2508 }
2509 else if (shop_index<=41) //magic shop 2509 else if (shop_index <= 41) //magic shop
2510 { 2510 {
2511 treasure_lvl = shopMagicSpc_treasure_lvl[shop_index-28]; 2511 treasure_lvl = shopMagicSpc_treasure_lvl[shop_index - 28];
2512 item_class = 22; //misc 2512 item_class = 22; //misc
2513 } 2513 }
2514 else if (shop_index<=53) //alchemist shop 2514 else if (shop_index <= 53) //alchemist shop
2515 { 2515 {
2516 if (item_count<6) 2516 if (item_count < 6)
2517 { 2517 {
2518 pParty->SpecialItemsInShops[shop_index][item_count].Reset(); 2518 pParty->SpecialItemsInShops[shop_index][item_count].Reset();
2519 pParty->SpecialItemsInShops[shop_index][item_count].uItemID = rand() % 32 + 740; //mscrool 2519 pParty->SpecialItemsInShops[shop_index][item_count].uItemID = rand() % 32 + 740; //mscrool
2520 continue; 2520 continue;
2521 } 2521 }
2522 else 2522 else
2523 { 2523 {
2524 treasure_lvl = shopAlchSpc_treasure_lvl[shop_index-41]; 2524 treasure_lvl = shopAlchSpc_treasure_lvl[shop_index - 41];
2525 item_class = 44; //potion 2525 item_class = 44; //potion
2526 } 2526 }
2527 } 2527 }
2528 pItemsTable->GenerateItem(treasure_lvl, item_class, &pParty->SpecialItemsInShops[shop_index][item_count]); 2528 pItemsTable->GenerateItem(treasure_lvl, item_class, &pParty->SpecialItemsInShops[shop_index][item_count]);
2529 pParty->SpecialItemsInShops[shop_index][item_count].SetIdentified(); //identified 2529 pParty->SpecialItemsInShops[shop_index][item_count].SetIdentified(); //identified
2530 } 2530 }
2531 } 2531 }
2532 pParty->InTheShopFlags[shop_index] = 0; 2532 pParty->InTheShopFlags[shop_index] = 0;
2533 } 2533 }
2534 2534
2535 2535
2536 //----- (00450218) -------------------------------------------------------- 2536 //----- (00450218) --------------------------------------------------------
2537 void GenerateItemsInChest() 2537 void GenerateItemsInChest()
2538 { 2538 {