loot.lua 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. -- Register farming items as dungeon loot
  2. if minetest.global_exists("dungeon_loot") then
  3. dungeon_loot.register({
  4. {name = "farming:string", chance = 0.5, count = {1, 8}},
  5. {name = "farming:wheat", chance = 0.5, count = {2, 5}},
  6. {name = "farming:seed_cotton", chance = 0.4, count = {1, 4},
  7. types = {"normal"}},
  8. {name = "farming:seed_ananas", chance = 0.4, count = {1, 4}},
  9. {name = "farming:seed_bean", chance = 0.4, count = {1, 4}},
  10. {name = "farming:seed_beetroot", chance = 0.4, count = {1, 4}},
  11. {name = "farming:seed_blueberry", chance = 0.4, count = {1, 4}},
  12. {name = "farming:seed_carrot", chance = 0.4, count = {1, 4}},
  13. {name = "farming:seed_chili", chance = 0.4, count = {1, 4}},
  14. {name = "farming:seed_cocoa", chance = 0.4, count = {1, 4}},
  15. {name = "farming:seed_corn", chance = 0.4, count = {1, 4}},
  16. {name = "farming:seed_cucumber", chance = 0.4, count = {1, 4}},
  17. {name = "farming:seed_garlic", chance = 0.4, count = {1, 4}},
  18. {name = "farming:seed_grape", chance = 0.4, count = {1, 4}},
  19. {name = "farming:seed_hemp", chance = 0.4, count = {1, 4}},
  20. {name = "farming:seed_lettuce", chance = 0.4, count = {1, 4}},
  21. {name = "farming:seed_onion", chance = 0.4, count = {1, 4}},
  22. {name = "farming:seed_pea", chance = 0.4, count = {1, 4}},
  23. {name = "farming:seed_potato", chance = 0.4, count = {1, 4}},
  24. {name = "farming:seed_raspberry", chance = 0.4, count = {1, 4}},
  25. {name = "farming:seed_rice", chance = 0.4, count = {1, 4}},
  26. {name = "farming:seed_strawberry", chance = 0.4, count = {1, 4}},
  27. {name = "farming:seed_tomato", chance = 0.4, count = {1, 4}}
  28. })
  29. end
  30. -- Register seeds
  31. -- seeds from dirt
  32. table.insert(minetest.registered_items["default:dirt_with_grass"].drop.items, { rarity = 20, items = {"farming:potato"} })
  33. table.insert(minetest.registered_items["default:dirt_with_grass"].drop.items, { rarity = 20, items = {"farming:peanut"} })
  34. --seeds from grass
  35. for i=1,5 do
  36. table.insert(minetest.registered_items["default:grass_" .. i].drop.items, { rarity = 20, items = {"farming:seed_blueberry"} })
  37. table.insert(minetest.registered_items["default:grass_" .. i].drop.items, { rarity = 20, items = {"farming:seed_carrot"} })
  38. table.insert(minetest.registered_items["default:grass_" .. i].drop.items, { rarity = 20, items = {"farming:seed_cucumber"} })
  39. table.insert(minetest.registered_items["default:grass_" .. i].drop.items, { rarity = 20, items = {"farming:seed_grape"} })
  40. table.insert(minetest.registered_items["default:grass_" .. i].drop.items, { rarity = 20, items = {"farming:seed_lettuce"} })
  41. table.insert(minetest.registered_items["default:grass_" .. i].drop.items, { rarity = 20, items = {"farming:seed_strawberry"} })
  42. table.insert(minetest.registered_items["default:grass_" .. i].drop.items, { rarity = 20, items = {"farming:seed_tomato"} })
  43. table.insert(minetest.registered_items["default:grass_" .. i].drop.items, { rarity = 20, items = {"farming:seed_wheat"} })
  44. end
  45. -- Grows in the savanna (dry dirt, acatia tree)
  46. for i=1,5 do
  47. table.insert(minetest.registered_items["default:dry_grass_" .. i].drop.items, { rarity = 20, items = {"farming:seed_corn"} })
  48. table.insert(minetest.registered_items["default:dry_grass_" .. i].drop.items, { rarity = 20, items = {"farming:seed_potato"} })
  49. table.insert(minetest.registered_items["default:dry_grass_" .. i].drop.items, { rarity = 20, items = {"farming:seed_garlic"} })
  50. table.insert(minetest.registered_items["default:dry_grass_" .. i].drop.items, { rarity = 20, items = {"farming:seed_onion"} })
  51. table.insert(minetest.registered_items["default:dry_grass_" .. i].drop.items, { rarity = 20, items = {"farming:seed_rice"} })
  52. end
  53. -- Grows in jungle
  54. table.insert(minetest.registered_items["default:junglegrass"].drop.items, { rarity = 20, items = {"farming:seed_ananas"} })
  55. table.insert(minetest.registered_items["default:junglegrass"].drop.items, { rarity = 20, items = {"farming:seed_chili"} })
  56. table.insert(minetest.registered_items["default:junglegrass"].drop.items, { rarity = 20, items = {"farming:seed_cotton"} })
  57. table.insert(minetest.registered_items["default:junglegrass"].drop.items, { rarity = 20, items = {"farming:seed_cocoa"} })
  58. table.insert(minetest.registered_items["default:junglegrass"].drop.items, { rarity = 20, items = {"farming:seed_rice"} })
  59. -- Grows on sand (anywhere)
  60. for i=1,3 do
  61. table.insert(minetest.registered_items["default:marram_grass_" .. i].drop.items, { rarity = 20, items = {"farming:seed_bean"} })
  62. table.insert(minetest.registered_items["default:marram_grass_" .. i].drop.items, { rarity = 20, items = {"farming:seed_hemp"} })
  63. table.insert(minetest.registered_items["default:marram_grass_" .. i].drop.items, { rarity = 20, items = {"farming:seed_huckleberry"} })
  64. end
  65. -- Grows in warm pine forests
  66. for i=1,3 do
  67. table.insert(minetest.registered_items["default:fern_" .. i].drop.items, { rarity = 20, items = {"farming:seed_beetroot"} })
  68. table.insert(minetest.registered_items["default:fern_" .. i].drop.items, { rarity = 20, items = {"farming:seed_pea"} })
  69. table.insert(minetest.registered_items["default:fern_" .. i].drop.items, { rarity = 20, items = {"farming:seed_raspberry"} })
  70. end