config.lua 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. -- "Dungeon Loot" [dungeon_loot]
  2. -- Original by BlockMen, this entire file by Amoeba
  3. --
  4. -- config.lua
  5. --
  6. -- Note: All positive heights (above water level) are treated as depth 0.
  7. -- Also, no comma after the item of a list.
  8. -- Minimum number of rooms a dungeon should have for a chest to be generated
  9. dungeon_loot.min_num_of_rooms = 4
  10. -- Items on basic lists have three depth ranges for their listed amount
  11. -- maximums; they get max/2 before first increase point (minimum of 1 if
  12. -- amount is >0), the given max between the 1st and 2nd increase point,
  13. -- and max*2 after the 2nd.
  14. dungeon_loot.depth_first_basic_increase = 200
  15. dungeon_loot.depth_second_basic_increase = 2000
  16. -- The master list of loot types
  17. -- Note that tools and weapons should always have max_amount = 1.
  18. -- Chance is a probability between 0 (practically never) and 1 (always),
  19. -- so change a chance to 0 if you don't want a type (eg. weapons) included
  20. -- in your game (or -0.001 if you want to be REALLY sure).
  21. dungeon_loot.loot_types = {
  22. {name="treasure", max_amount = 10, chance = 0.7, type = "depth_cutoff"},
  23. {name="tools", max_amount = 1, chance = 0.5, type = "depth_cutoff"},
  24. {name="weapons", max_amount = 1, chance = 0.1, type = "depth_cutoff"},
  25. {name="consumables", max_amount = 80, chance = 0.9, type = "basic_list"},
  26. {name="seedlings", max_amount = 5, chance = 0.3, type = "basic_list"}
  27. }
  28. -- Loot type lists; these names MUST be exactly of the format:
  29. -- "dungeon_loot.name_list" where "name" is in the above list
  30. -- Depth cutoff lists
  31. -- These must be in order of increasing depth (but can include the same item
  32. -- more than once). Method: a random number between 1 and chest depth is
  33. -- chosen, and the item in that range is added to the loot. Then, there's
  34. -- a chance additional items of the same type are added to stack; if the
  35. -- random number is much greater than the item's min_depth, the amount
  36. -- can grow pretty big.
  37. dungeon_loot.treasure_list = {
  38. {name="default:steel_ingot", min_depth = 0},
  39. {name="default:bronze_ingot", min_depth = 20},
  40. {name="default:gold_ingot", min_depth = 45},
  41. {name="default:mese_crystal", min_depth = 50},
  42. {name="default:diamond", min_depth = 150},
  43. {name="default:goldblock", min_depth = 777},
  44. {name="default:mese", min_depth = 800},
  45. {name="default:diamondblock", min_depth = 1800},
  46. {name="default:mese", min_depth = 2000}
  47. }
  48. dungeon_loot.tools_list = {
  49. {name="default:pick_steel", min_depth = 0},
  50. {name="default:shovel_diamond", min_depth = 38},
  51. {name="default:pick_bronze", min_depth = 40},
  52. {name="default:axe_diamond", min_depth = 95},
  53. {name="default:pick_diamond", min_depth = 100}
  54. }
  55. dungeon_loot.weapons_list = {
  56. {name="default:sword_steel", min_depth = 0},
  57. {name="default:sword_bronze", min_depth = 50},
  58. {name="default:sword_mese", min_depth = 150},
  59. {name="default:sword_diamond", min_depth = 250}
  60. }
  61. -- Basic lists
  62. -- These can be of two types, either with combined chance and amount,
  63. -- or with the two variables separated. "chance" means each item has a
  64. -- N/M chance of being chosen, where N is it's own chance and M is the
  65. -- total sum of chances on the list. "amount" is the maximum amount of
  66. -- items given at the middle depth range.
  67. dungeon_loot.consumables_list = {
  68. {name="basictrees:tree_apple", chance_and_amount = 20},
  69. {name="default:torch", chance_and_amount = 30},
  70. {name="default:stick", chance_and_amount = 10}
  71. }
  72. dungeon_loot.seedlings_list = {
  73. {name="basictrees:tree_sapling", chance = 5, amount = 2},
  74. {name="basictrees:pine_sapling", chance = 10, amount = 2},
  75. {name="basictrees:jungletree_sapling", chance = 15, amount = 2},
  76. {name="basictrees:acacia_sapling", chance = 15, amount = 2}
  77. }
  78. -- Add items from other mods here inside the appropriate
  79. -- "if ... then ... end" test
  80. -- For basic lists, just using insert without a value works fine.
  81. -- For depth cutoff lists, you can use insert with a table index, eg.
  82. -- table.insert(dungeon_loot.treasure_list, 5, {name="your_mod:platinum_ingot", min_depth = 120}
  83. -- The above would add a new item to the treasure list as the 5th item,
  84. -- moving diamond and all below it one down in the list. Just make sure
  85. -- that the increasing min_depth order is kept.
  86. -- Tips: With multiple insertions in a depth cutoff list, start from the
  87. -- last item and work towards the beginning, then you don't have to calculate
  88. -- your number of additions. Also, trying to make sure too many different
  89. -- mods work together in a single list will probably give you a headache;
  90. -- just create a new list (or two) for mods with lots of additions.
  91. if minetest.get_modpath("farming") then
  92. table.insert(dungeon_loot.consumables_list, {name="farming:bread", chance_and_amount = 10})
  93. table.insert(dungeon_loot.seedlings_list, {name="farming:seed_wheat", chance = 1, amount = 10})
  94. table.insert(dungeon_loot.seedlings_list, {name="farming:seed_cotton", chance = 20, amount = 5})
  95. end