config.lua 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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. -- Nodes dungeons are made out of.
  17. dungeon_loot.DUNGEON_NODES = {
  18. "default:stone",
  19. "default:cobble",
  20. "default:mossycobble",
  21. "default:desert_stone",
  22. "rackstone:brick",
  23. "rackstone:mg_redrack",
  24. "rackstone:redrack",
  25. "rackstone:rackstone",
  26. "rackstone:mg_rackstone",
  27. }
  28. dungeon_loot.CHEST_NODES = {
  29. "chests:chest_public_closed",
  30. "morechests:woodchest_public_closed",
  31. "morechests:ironchest_public_closed",
  32. }
  33. -- The master list of loot types
  34. -- Note that tools and weapons should always have max_amount = 1.
  35. -- Chance is a probability between 0 (practically never) and 1 (always),
  36. -- so change a chance to 0 if you don't want a type (eg. weapons) included
  37. -- in your game (or -0.001 if you want to be REALLY sure).
  38. dungeon_loot.loot_types = {
  39. {name="treasure", max_amount = 10, chance = 0.7, type = "depth_cutoff"},
  40. {name="tools", max_amount = 1, chance = 0.5, type = "depth_cutoff"},
  41. {name="weapons", max_amount = 1, chance = 0.1, type = "depth_cutoff"},
  42. {name="bows", max_amount = 1, chance = 0.1, type = "depth_cutoff"},
  43. {name="consumables", max_amount = 80, chance = 0.9, type = "basic_list"},
  44. {name="seedlings", max_amount = 5, chance = 0.3, type = "basic_list"},
  45. {name="metals", max_amount = 20, chance = 0.3, type = "basic_list"},
  46. {name="supplies", max_amount = 20, chance = 0.3, type = "basic_list"},
  47. }
  48. -- Loot type lists; these names MUST be exactly of the format:
  49. -- "dungeon_loot.name_list" where "name" is in the above list
  50. -- Depth cutoff lists
  51. -- These must be in order of increasing depth (but can include the same item
  52. -- more than once). Method: a random number between 1 and chest depth is
  53. -- chosen, and the item in that range is added to the loot. Then, there's
  54. -- a chance additional items of the same type are added to stack; if the
  55. -- random number is much greater than the item's min_depth, the amount
  56. -- can grow pretty big.
  57. dungeon_loot.treasure_list = {
  58. {name="default:steel_ingot", min_depth = 0},
  59. {name="default:bronze_ingot", min_depth = 20},
  60. {name="default:gold_ingot", min_depth = 45},
  61. {name="default:mese_crystal", min_depth = 50},
  62. {name="default:diamond", min_depth = 150},
  63. {name="default:goldblock", min_depth = 777},
  64. {name="default:mese", min_depth = 800},
  65. {name="default:diamondblock", min_depth = 1800},
  66. {name="default:mese", min_depth = 2000},
  67. }
  68. dungeon_loot.tools_list = {
  69. {name="default:pick_steel", min_depth = 0},
  70. {name="default:shovel_diamond", min_depth = 38},
  71. {name="default:pick_bronze", min_depth = 40},
  72. {name="default:axe_diamond", min_depth = 95},
  73. {name="default:pick_diamond", min_depth = 100},
  74. {name="bucket:bucket_water", min_depth = 100},
  75. }
  76. dungeon_loot.weapons_list = {
  77. {name="default:sword_steel", min_depth = 0},
  78. {name="default:sword_bronze", min_depth = 50},
  79. {name="default:sword_mese", min_depth = 150},
  80. {name="default:sword_diamond", min_depth = 250}
  81. }
  82. dungeon_loot.bows_list = {
  83. {name="throwing:bow_wood", min_depth = 0},
  84. {name="throwing:longbow", min_depth = 50},
  85. {name="throwing:bow_composite", min_depth = 150},
  86. {name="throwing:bow_steel", min_depth = 250},
  87. {name="throwing:crossbow", min_depth = 500},
  88. {name="throwing:arbalest", min_depth = 1500},
  89. {name="throwing:bow_royal", min_depth = 25000},
  90. }
  91. -- Basic lists
  92. -- These can be of two types, either with combined chance and amount,
  93. -- or with the two variables separated. "chance" means each item has a
  94. -- N/M chance of being chosen, where N is it's own chance and M is the
  95. -- total sum of chances on the list. "amount" is the maximum amount of
  96. -- items given at the middle depth range.
  97. dungeon_loot.consumables_list = {
  98. {name="basictrees:tree_apple", chance_and_amount = 20},
  99. {name="default:torch", chance_and_amount = 30},
  100. {name="default:stick", chance_and_amount = 10},
  101. {name="mobs:meat_raw", chance_and_amount = 10},
  102. {name="mobs:meat_raw_mutton", chance_and_amount = 10},
  103. }
  104. dungeon_loot.seedlings_list = {
  105. {name="basictrees:tree_sapling", chance = 5, amount = 2},
  106. {name="basictrees:pine_sapling", chance = 10, amount = 2},
  107. {name="basictrees:jungletree_sapling", chance = 15, amount = 2},
  108. {name="basictrees:acacia_sapling", chance = 15, amount = 2}
  109. }
  110. dungeon_loot.metals_list = {
  111. {name="default:steel_ingot", chance = 10, amount = 10},
  112. {name="zinc:ingot", chance = 5, amount = 10},
  113. {name="chromium:ingot", chance = 5, amount = 10},
  114. {name="default:copper_ingot", chance = 5, amount = 10},
  115. {name="titanium:crystal", chance = 5, amount = 10},
  116. }
  117. dungeon_loot.supplies_list = {
  118. {name="mobs:leather", chance = 5, amount = 10},
  119. {name="mobs:leather_padding", chance = 5, amount = 3},
  120. {name="farming:string", chance = 5, amount = 10},
  121. {name="mobs:flame_bolt", chance = 5, amount = 10},
  122. {name="tnt:gunpowder", chance = 5, amount = 10},
  123. }
  124. -- Add items from other mods here inside the appropriate
  125. -- "if ... then ... end" test
  126. -- For basic lists, just using insert without a value works fine.
  127. -- For depth cutoff lists, you can use insert with a table index, eg.
  128. -- table.insert(dungeon_loot.treasure_list, 5, {name="your_mod:platinum_ingot", min_depth = 120}
  129. -- The above would add a new item to the treasure list as the 5th item,
  130. -- moving diamond and all below it one down in the list. Just make sure
  131. -- that the increasing min_depth order is kept.
  132. -- Tips: With multiple insertions in a depth cutoff list, start from the
  133. -- last item and work towards the beginning, then you don't have to calculate
  134. -- your number of additions. Also, trying to make sure too many different
  135. -- mods work together in a single list will probably give you a headache;
  136. -- just create a new list (or two) for mods with lots of additions.
  137. if minetest.get_modpath("farming") then
  138. table.insert(dungeon_loot.consumables_list, {name="farming:bread", chance_and_amount = 10})
  139. table.insert(dungeon_loot.seedlings_list, {name="farming:seed_wheat", chance = 1, amount = 10})
  140. table.insert(dungeon_loot.seedlings_list, {name="farming:seed_cotton", chance = 20, amount = 5})
  141. end