Advertisement
ereinion

Familiar equipment

Nov 16th, 2016
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int get_price(item it, float max_age) {
  2.     return ((historical_age(it) > max_age)? mall_price(it) : historical_price(it));
  3. }
  4.  
  5. boolean get_item(item it) {
  6.     string satisfy_with_mall;
  7.     boolean item_gotten = false;
  8.    
  9.     satisfy_with_mall = get_property("autoSatisfyWithMall");
  10.     set_property("autoSatisfyWithMall", "false");
  11.     if (have_equipped(it)) {
  12.         item_gotten = true;
  13.     } else if (retrieve_item(1, it)) {
  14.         item_gotten = true;
  15.     } else if (get_price(it, 0.5) < to_int(get_property("autoBuyPriceLimit"))) {
  16.         if (buy (1, it, get_price(it, 0.5)*1.2) > 0) {
  17.             item_gotten = true;
  18.         }
  19.     }
  20.     set_property("autoSatisfyWithMall", satisfy_with_mall);
  21.     return item_gotten;
  22. }
  23.  
  24. boolean main() {
  25.     item[13] priority_of_fam_eq;
  26.     item chosen_item;
  27.     boolean found = false;
  28.    
  29.     if (my_familiar()  == $familiar[Li'l Xenomorph]) {  // '
  30.         chosen_item = $item[tiny top hat and cane];
  31.         found = get_item(chosen_item);
  32.     }
  33.    
  34.     if (!found) {
  35.         if (item_amount($item[snow suit]) > 0 &&  to_int(get_property("_snowSuitCount")) < 3) {
  36.             chosen_item = $item[snow suit];
  37.         } else {
  38.             priority_of_fam_eq[0] = $item[Mayflower bouquet];
  39.             priority_of_fam_eq[1] = $item[flaming familiar doppelg&auml;nger];
  40.             priority_of_fam_eq[2] = $item[miniature gravy-covered maypole];
  41.             priority_of_fam_eq[3] = $item[ittah bittah hookah];
  42.             priority_of_fam_eq[4] = $item[astral pet sweater];
  43.             priority_of_fam_eq[5] = $item[moveable feast];
  44.             priority_of_fam_eq[6] = $item[little box of fireworks];
  45.             priority_of_fam_eq[7] = $item[plastic pumpkin bucket];
  46.             priority_of_fam_eq[8] = $item[Li'l Businessman Kit];        // '
  47.             priority_of_fam_eq[9] = familiar_equipment(my_familiar());
  48.             priority_of_fam_eq[10] = $item[lucky Tam O'Shanter];    // '
  49.             priority_of_fam_eq[11] = $item[lucky Tam O'Shatner];    // '
  50.             priority_of_fam_eq[12] = $item[lead necklace];
  51.            
  52.             for i from 0 to 11 {
  53.                 chosen_item = priority_of_fam_eq[i];
  54.                 if (get_item(chosen_item)) {
  55.                     break;
  56.                 }
  57.             }
  58.         }
  59.     }
  60.    
  61.     if (chosen_item == $item[none]) {
  62.         return false;
  63.     } else {
  64.         return equip($slot[familiar], chosen_item);
  65.     }
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement