Advertisement
kolpastebin

Machine elves.ash

Jul 10th, 2016
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. boolean item_is_pvp_stealable(item it)
  2. {
  3. if (it == $item[amulet of yendor])
  4. return true;
  5. if (!it.tradeable)
  6. return false;
  7. if (!it.discardable)
  8. return false;
  9. if (it.quest)
  10. return false;
  11. if (it.gift)
  12. return false;
  13. return true;
  14. }
  15.  
  16. effect to_effect(item it)
  17. {
  18. return effect_modifier(it, "effect");
  19. }
  20.  
  21. boolean isMachineElfable(item it)
  22. {
  23. if (!it.item_is_pvp_stealable())
  24. return false;
  25. if (it.fullness > 0 || it.inebriety > 0 || it.spleen > 0)
  26. return true;
  27. if (it.to_effect() != $effect[none])
  28. return true;
  29. if ($items[oil of oiliness,half-baked potion] contains it) //these are copyable due to reasons
  30. return true;
  31. return false;
  32. }
  33.  
  34. void main()
  35. {
  36.  
  37. item [int] pvpable_items;
  38. int maximum_item_id = 0;
  39. foreach it in $items[]
  40. {
  41. maximum_item_id = MAX(maximum_item_id, it.to_int());
  42. }
  43.  
  44. foreach it in $items[]
  45. {
  46. if (!it.isMachineElfable())
  47. continue;
  48. pvpable_items[pvpable_items.count()] = it;
  49.  
  50. float age_lookup_cutoff = 30.0;
  51. if (it.historical_price() >= 10000)
  52. age_lookup_cutoff = 15.0;
  53. if (it.to_int() >= maximum_item_id - 500)
  54. age_lookup_cutoff = 1;
  55. int price = it.historical_price();
  56. if (price <= 0 || it.historical_age() >= age_lookup_cutoff)
  57. price = it.mall_price();
  58. }
  59. sort pvpable_items by -value.historical_price();
  60. foreach key, it in pvpable_items
  61. {
  62. if (it.historical_price() >= 25000)
  63. print_html(it + ": " + it.historical_price() + " meat");
  64. }
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement