chests.lua 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634
  1. minetest.register_node("lottmapgen:hobbit_chest_spawner", {
  2. description = "HCS",
  3. tiles = {"lottother_air.png"},
  4. drop = "",
  5. drawtype = "airlike",
  6. groups = {not_in_creative_inventory=1},
  7. })
  8. minetest.register_node("lottmapgen:gondor_chest_spawner", {
  9. description = "GCS",
  10. tiles = {"lottother_air.png"},
  11. drop = "",
  12. drawtype = "airlike",
  13. groups = {not_in_creative_inventory=1},
  14. })
  15. minetest.register_node("lottmapgen:rohan_chest_spawner", {
  16. description = "RCS",
  17. tiles = {"lottother_air.png"},
  18. drop = "",
  19. drawtype = "airlike",
  20. groups = {not_in_creative_inventory=1},
  21. })
  22. minetest.register_node("lottmapgen:elfloth_chest_spawner", {
  23. description = "ELCS",
  24. tiles = {"lottother_air.png"},
  25. drop = "",
  26. drawtype = "airlike",
  27. groups = {not_in_creative_inventory=1},
  28. })
  29. minetest.register_node("lottmapgen:elfmirk_chest_spawner", {
  30. description = "EMCS",
  31. tiles = {"lottother_air.png"},
  32. drop = "",
  33. drawtype = "airlike",
  34. groups = {not_in_creative_inventory=1},
  35. })
  36. minetest.register_node("lottmapgen:mordor_chest_spawner", {
  37. description = "MCS",
  38. tiles = {"lottother_air.png"},
  39. drop = "",
  40. drawtype = "airlike",
  41. groups = {not_in_creative_inventory=1},
  42. })
  43. minetest.register_node("lottmapgen:angmar_chest_spawner", {
  44. description = "ACS",
  45. tiles = {"lottother_air.png"},
  46. drop = "",
  47. drawtype = "airlike",
  48. groups = {not_in_creative_inventory=1},
  49. })
  50. minetest.register_node("lottmapgen:dwarf_chest_spawner", {
  51. description = "DCS",
  52. tiles = {"lottother_air.png"},
  53. drop = "",
  54. drawtype = "airlike",
  55. groups = {not_in_creative_inventory=1},
  56. })
  57. minetest.register_node("lottmapgen:furnace_spawner", {
  58. description = "FURNS",
  59. tiles = {"lottother_air.png"},
  60. drop = "",
  61. drawtype = "airlike",
  62. groups = {not_in_creative_inventory = 1},
  63. })
  64. minetest.register_node("lottmapgen:dual_furnace_spawner", {
  65. description = "DFURNS",
  66. tiles = {"lottother_air.png"},
  67. drop = "",
  68. drawtype = "airlike",
  69. groups = {not_in_creative_inventory = 1},
  70. })
  71. minetest.register_node("lottmapgen:ringsilver_furnace_spawner", {
  72. description = "RSFURNS",
  73. tiles = {"lottother_air.png"},
  74. drop = "",
  75. drawtype = "airlike",
  76. groups = {not_in_creative_inventory = 1},
  77. })
  78. minetest.register_node("lottmapgen:ring_chest_spawner", {
  79. description = "RCS",
  80. tiles = {"lottother_air.png"},
  81. drop = "",
  82. drawtype = "airlike",
  83. groups = {not_in_creative_inventory=1},
  84. })
  85. local r = math.random
  86. minetest.register_abm({
  87. nodenames = {"lottmapgen:hobbit_chest_spawner"},
  88. interval = 9,
  89. chance = 1,
  90. action = function(pos, node, active_object_count, active_object_count_wider)
  91. minetest.set_node(pos, {name="lottblocks:hobbit_chest", param2 = node.param2})
  92. local item_count = r(2, 13)
  93. local items_available = {
  94. [0] = "lottfarming:barley_seed 2",
  95. [1] = "lottfarming:barley_cooked",
  96. [2] = "lottfarming:berries_seed",
  97. [3] = "lottfarming:berries 3",
  98. [4] = "lottfarming:brown_mushroom_spore 3",
  99. [5] = "lottfarming:brown_mushroom 6",
  100. [6] = "lottfarming:corn_seed 4",
  101. [7] = "lottfarming:corn 4",
  102. [8] = "lottfarming:pipeweed_seed 2",
  103. [9] = "lottfarming:pipeweed 5",
  104. [10] = "lottfarming:pipeweed_cooked 5",
  105. [11] = "lottfarming:pipe",
  106. [12] = "lottfarming:potato_seed 2",
  107. [13] = "lottfarming:potato",
  108. [14] = "lottfarming:potato_cooked 7",
  109. [15] = "lottfarming:turnips_seed 3",
  110. [16] = "lottfarming:turnips",
  111. [17] = "lottfarming:turnips_cooked 7",
  112. [18] = "lottplants:plum",
  113. [19] = "lottweapons:bronze_dagger",
  114. [20] = "lottweapons:steel_dagger",
  115. [21] = "lottweapons:copper_spear",
  116. [22] = "lottweapons:tin_battleaxe",
  117. [23] = "vessels:glass_bottle 3",
  118. [24] = "farming:hoe_steel",
  119. [25] = "lottblocks:farmer_handbook",
  120. [26] = "lottblocks:farmer_handbook_2",
  121. [27] = "lottblocks:brewing_guide",
  122. [28] = "lottblocks:explorer_guide",
  123. [29] = "lottblocks:explorer_guide_2",
  124. [30] = "lottblocks:explorer_guide_3"
  125. }
  126. local meta = minetest.get_meta(pos)
  127. local inv = meta:get_inventory()
  128. for i = 0, item_count do
  129. local stack = r(0, 36)
  130. local item = items_available[r(0, 36)]
  131. if inv:get_stack("main", stack) ~= "" then
  132. stack = stack + 1
  133. end
  134. if item ~= nil then
  135. inv:set_stack("main", stack, item)
  136. end
  137. end
  138. end,
  139. })
  140. minetest.register_abm({
  141. nodenames = {"lottmapgen:gondor_chest_spawner"},
  142. interval = 9,
  143. chance = 1,
  144. action = function(pos, node, active_object_count, active_object_count_wider)
  145. minetest.set_node(pos, {name="lottblocks:gondor_chest", param2 = node.param2})
  146. local item_count = r(2,13)
  147. local items_available = {
  148. [0] = "lottores:marble 6",
  149. [1] = "lottblocks:marble_brick 10",
  150. [2] = "lottarmor:helmet_silver",
  151. [3] = "lottarmor:chestplate_steel",
  152. [4] = "lottarmor:leggings_tin",
  153. [5] = "lottarmor:boots_bronze",
  154. [10] = "lottarmor:shield_copper",
  155. [11] = "lottores:goldsword",
  156. [12] = "default:sword_bronze",
  157. [13] = "farming:bread 5",
  158. [14] = "lottmobs:meat 2",
  159. [15] = "lottfarming:potato_cooked 4",
  160. [16] = "lottfarming:melon 3",
  161. [17] = "lottfarming:tomatoes_cooked 2",
  162. [18] = "lottfarming:corn 6",
  163. [19] = "lottfarming:turnips_cooked 3",
  164. [20] = "lottweapons:bronze_warhammer",
  165. [21] = "lottweapons:gold_spear",
  166. [22] = "lottweapons:copper_battleaxe",
  167. [23] = "lottweapons:galvorn_dagger",
  168. [24] = "lottpotion:beer 10",
  169. [25] = "lottpotion:cider 10",
  170. [26] = "lottpotion:wine 5",
  171. [27] = "lottpotion:wine 2",
  172. [29] = "lottthrowing:bow_wood_alder",
  173. [30] = "lottblocks:explorer_guide",
  174. [31] = "lottblocks:explorer_guide_2",
  175. [32] = "lottblocks:explorer_guide_3",
  176. [33] = "lottblocks:farmer_handbook",
  177. [34] = "lottblocks:farmer_handbook_2",
  178. [35] = "lottblocks:brewing_guide"
  179. }
  180. local meta = minetest.get_meta(pos)
  181. local inv = meta:get_inventory()
  182. for i = 0, item_count do
  183. local stack = r(0, 36)
  184. local item = items_available[r(0, 36)]
  185. if inv:get_stack("main", stack) ~= "" then
  186. stack = stack + 1
  187. end
  188. if item ~= nil then
  189. inv:set_stack("main", stack, item)
  190. end
  191. end
  192. end,
  193. })
  194. minetest.register_abm({
  195. nodenames = {"lottmapgen:rohan_chest_spawner"},
  196. interval = 9,
  197. chance = 1,
  198. action = function(pos, node, active_object_count, active_object_count_wider)
  199. minetest.set_node(pos, {name="lottblocks:rohan_chest", param2 = node.param2})
  200. local item_count = r(2,13)
  201. local items_available = {
  202. [0] = "lottores:lead_block",
  203. [1] = "lottores:pearl 3",
  204. [2]="lottarmor:helmet_tin",
  205. [3]="lottarmor:chestplate_copper",
  206. [4]="lottarmor:leggings_bronze",
  207. [5]="lottarmor:boots_steel",
  208. [10]="lottarmor:shield_silver",
  209. [11]="lottores:silversword",
  210. [12]="lottweapons:bronze_spear",
  211. [13]="farming:bread 4",
  212. [14]="lottmobs:meat 6",
  213. [15]="lottfarming:potato_cooked 2",
  214. [16]="lottfarming:brown_mushroom 4",
  215. [17]="lottfarming:red_mushroom 3",
  216. [18]="lottfarming:corn 7",
  217. [19]="lottweapons:gold_spear",
  218. [20]="lottweapons:bronze_battleaxe",
  219. [21]="lottweapons:tin_spear",
  220. [22]="lottweapons:steel_spear",
  221. [23]="lottweapons:tin_dagger",
  222. [24]="lottpotion:ale 7",
  223. [25]="lottpotion:mead 7",
  224. [26]="lottpotion:wine 5",
  225. [27]="lottpotion:cider 2",
  226. [29]="lottmobs:horseh1",
  227. [30]="lottmobs:horsepegh1",
  228. [31]="lottmobs:horsepegh1",
  229. [32]="lottthrowing:crossbow_tin",
  230. [33]="lottthrowing:bolt 5",
  231. [34] = "lottblocks:explorer_guide",
  232. [35] = "lottblocks:explorer_guide_2",
  233. [36] = "lottblocks:explorer_guide_3"
  234. }
  235. local meta = minetest.get_meta(pos)
  236. local inv = meta:get_inventory()
  237. for i = 0, item_count do
  238. local stack = r(0, 36)
  239. local item = items_available[r(0, 36)]
  240. if inv:get_stack("main", stack) ~= "" then
  241. stack = stack + 1
  242. end
  243. if item ~= nil then
  244. inv:set_stack("main", stack, item)
  245. end
  246. end
  247. end,
  248. })
  249. minetest.register_abm({
  250. nodenames = {"lottmapgen:elfloth_chest_spawner"},
  251. interval = 9,
  252. chance = 1,
  253. action = function(pos, node, active_object_count, active_object_count_wider)
  254. minetest.set_node(pos, {name="lottblocks:elfloth_chest", param2 = node.param2})
  255. local item_count = r(2,13)
  256. local items_available = {
  257. [0] = "lottores:mithril_ingot",
  258. [1] = "default:gold_ingot 3",
  259. [2]="lottweapons:elven_sword",
  260. [3]="lottblocks:door_mallorn",
  261. [4]="lottblocks:bed_blue",
  262. [5]="lottblocks:fence_mallorn 3",
  263. [6]="lottblocks:mallorn_table",
  264. [9]="lottarmor:helmet_gold",
  265. [10]="lottblocks:mallorn_chair",
  266. [11]="lottores:silversword",
  267. [12]="lottweapons:silver_spear",
  268. [13]="lottweapons:silver_dagger",
  269. [14]="lottweapons:silver_warhammer",
  270. [15]="lottweapons:silver_battleaxe",
  271. [16]="lottores:silveraxe",
  272. [17]="lottores:silverpick",
  273. [18]="lottores:silvershovel",
  274. [19]="lottfarming:tomato_soup",
  275. [20]="lottfarming:mushroom_soup",
  276. [21]="lottfarming:salad",
  277. [22]="lottfarming:athelas_seed",
  278. [23]="lottfarming:athelas",
  279. [24]="lottplants:mallornsapling",
  280. [25]="lottpotion:mead 6",
  281. [26]="lottplants:honey 5",
  282. [27]="lottpotion:athelasbrew_power1",
  283. [29]="lottmobs:horsepegh1",
  284. [30]="lottpotion:athelasbrew_power1",
  285. [31]="lottthrowing:bow_wood_mallorn",
  286. [32]="lottthrowing:arrow 20",
  287. [34]="lottthrowing:arrow_fire_blue",
  288. [35]="lottthrowing:arrow_fire 3",
  289. [36]="lottblocks:elf_torch 10",
  290. [37]="lottores:white_gem",
  291. [38]="lottblocks:elven_rope " .. r(10, 40),
  292. [39]="lottblocks:brewing_guide_2",
  293. [40] = "lottblocks:explorer_guide",
  294. [41] = "lottblocks:explorer_guide_2",
  295. [42] = "lottblocks:explorer_guide_3"
  296. }
  297. local meta = minetest.get_meta(pos)
  298. local inv = meta:get_inventory()
  299. for i = 0, item_count do
  300. local stack = r(0, 36)
  301. local item = items_available[r(0, 50)]
  302. if inv:get_stack("main", stack) ~= "" then
  303. stack = stack + 1
  304. end
  305. if item ~= nil then
  306. inv:set_stack("main", stack, item)
  307. end
  308. end
  309. end,
  310. })
  311. minetest.register_abm({
  312. nodenames = {"lottmapgen:elfmirk_chest_spawner"},
  313. interval = 9,
  314. chance = 1,
  315. action = function(pos, node, active_object_count, active_object_count_wider)
  316. minetest.set_node(pos, {name="lottblocks:elfmirk_chest", param2 = node.param2})
  317. local item_count = r(2,13)
  318. local items_available = {
  319. [0] = "lottores:galvorn_ingot 3",
  320. [1] = "lottores:tin_ingot 5",
  321. [2] = "lottweapons:elven_sword",
  322. [3] = "lottblocks:door_alder",
  323. [4] = "lottblocks:bed_green",
  324. [5] = "lottblocks:fence_alder 5",
  325. [6] = "lottblocks:lebethron_table",
  326. [7] = "lottarmor:helmet_gold",
  327. [8] = "lottblocks:lebethron_chair",
  328. [9] = "lottores:galvornsword",
  329. [10] = "lottweapons:galvorn_spear",
  330. [11] = "lottweapons:galvorn_dagger",
  331. [12] = "bucket:bucket_water",
  332. [14] = "lottfarming:tomatoes_seed 3",
  333. [15] = "lottfarming:barley_seed 2",
  334. [16] = "lottfarming:berries_seed 6",
  335. [17] = "lottfarming:cabbage_seed 4",
  336. [18] = "lottfarming:mushroom_soup",
  337. [19] = "lottfarming:salad",
  338. [20] = "lottfarming:corn_seed",
  339. [21] = "lottfarming:melon_seed 2",
  340. [22] = "lottfarming:potato_seed 4",
  341. [23] = "lottfarming:turnips_seed 2",
  342. [24] = "lottfarming:blue_mushroom_spore 5",
  343. [27] = "lottfarming:brown_mushroom_spore 5",
  344. [29] = "lottmobs:horseh1",
  345. [30] = "lottfarming:green_mushroom_spore",
  346. [31] = "lottfarming:red_mushroom_spore",
  347. [32] = "lottthrowing:arrow 7",
  348. [34] = "lottthrowing:arrow_fire_blue",
  349. [35] = "lottthrowing:arrow_fire 3",
  350. [36] = "lottthrowing:bow_wood_lebethron",
  351. [37] = "lottores:blue_gem",
  352. [38] = "farming:hoe_bronze",
  353. [39] = "lottblocks:elven_rope " .. r(10, 40),
  354. [40]="lottblocks:brewing_guide_2"
  355. }
  356. local meta = minetest.get_meta(pos)
  357. local inv = meta:get_inventory()
  358. for i = 0, item_count do
  359. local stack = r(0, 36)
  360. local item = items_available[r(0, 50)]
  361. if inv:get_stack("main", stack) ~= "" then
  362. stack = stack + 1
  363. end
  364. if item ~= nil then
  365. inv:set_stack("main", stack, item)
  366. end
  367. end
  368. end,
  369. })
  370. minetest.register_abm({
  371. nodenames = {"lottmapgen:mordor_chest_spawner"},
  372. interval = 9,
  373. chance = 1,
  374. action = function(pos, node, active_object_count, active_object_count_wider)
  375. minetest.set_node(pos, {name="lottblocks:mordor_chest", param2 = node.param2})
  376. local item_count = r(2,13)
  377. local items_available = {
  378. [0] = "lottmapgen:mordor_stone 6",
  379. [1] = "lottblocks:orc_brick 7",
  380. [2] = "lottblocks:orc_torch 4",
  381. [3] = "lottmobs:meat 5",
  382. [4] = "lottfarming:blue_mushroom",
  383. [5] = "lottfarming:green_mushroom",
  384. [6] = "lottthrowing:crossbow_steel",
  385. [7] = "lottthrowing:bolt 15",
  386. [8] = "lottthrowing:bolt_fire 2",
  387. [11] = "lottpotion:wine",
  388. [12] = "lottpotion:orcdraught_power1 2",
  389. [13] = "lottpotion:orcdraught_power2",
  390. [14] = "lottweapons:orc_sword",
  391. [15] = "bones:bone 3",
  392. [16] = "lottarmor:helmet_bronze",
  393. [17] = "lottarmor:chestplate_bronze",
  394. [18] = "lottarmor:leggings_bronze",
  395. [19] = "lottarmor:boots_bronze",
  396. [20] = "lottpotion:beer",
  397. [21] = "lottmobs:meat_raw",
  398. [22] = "bones:skeleton_body",
  399. [23] = "lottweapons:steel_warhammer",
  400. [24] = "lottfarming:blue_mushroom_spore 2",
  401. [25] = "lottmobs:horsearah1",
  402. [26] = "lottores:red_gem",
  403. [27] = "lottfarming:orc_food 4",
  404. [28] = "lottfarming:orc_medicine 2"
  405. }
  406. local meta = minetest.get_meta(pos)
  407. local inv = meta:get_inventory()
  408. for i = 0, item_count do
  409. local stack = r(0, 36)
  410. local item = items_available[r(0, 36)]
  411. if inv:get_stack("main", stack) ~= "" then
  412. stack = stack + 1
  413. end
  414. if item ~= nil then
  415. inv:set_stack("main", stack, item)
  416. end
  417. end
  418. end,
  419. })
  420. minetest.register_abm({
  421. nodenames = {"lottmapgen:angmar_chest_spawner"},
  422. interval = 9,
  423. chance = 1,
  424. action = function(pos, node, active_object_count, active_object_count_wider)
  425. minetest.set_node(pos, {name="lottblocks:angmar_chest", param2 = node.param2})
  426. local item_count = r(2, 13)
  427. local items_available = {
  428. [0] = "lottmapgen:angsnowblock 3",
  429. [1] = "lottblocks:orc_brick 7",
  430. [2] = "lottblocks:orc_torch 4",
  431. [3] = "lottmobs:meat 5",
  432. [4] = "lottfarming:blue_mushroom",
  433. [5] = "lottfarming:green_mushroom",
  434. [6] = "lottthrowing:bow_wood_birch",
  435. [7] = "lottthrowing:arrow 15",
  436. [8] = "lottthrowing:arrow_fire 2",
  437. [10] = "lottweapons:steel_battleaxe",
  438. [11] = "lottpotion:wine",
  439. [12] = "lottpotion:orcdraught_power1 2",
  440. [13] = "lottweapons:steel_battleaxe",
  441. [14] = "lottweapons:orc_sword",
  442. [15] = "bones:bone 3",
  443. [16] = "lottarmor:helmet_steel",
  444. [17] = "lottarmor:chestplate_steel",
  445. [18] = "lottarmor:leggings_steel",
  446. [19] = "lottarmor:boots_steel",
  447. [20] = "lottpotion:beer",
  448. [21] = "lottmobs:meat_raw",
  449. [22] = "bones:skeleton_body",
  450. [23] = "lottweapons:steel_warhammer",
  451. [24] = "default:sword_steel",
  452. [25] = "lottmobs:horsepegh1",
  453. [26] = "bones:bones",
  454. [27] = "lottfarming:orc_food 4",
  455. [28] = "lottfarming:orc_medicine 2",
  456. [28] = "lottblocks:deep_depths"
  457. }
  458. local meta = minetest.get_meta(pos)
  459. local inv = meta:get_inventory()
  460. for i = 0, item_count do
  461. local stack = r(0, 36)
  462. local item = items_available[r(0, 36)]
  463. if inv:get_stack("main", stack) ~= "" then
  464. stack = stack + 1
  465. end
  466. if item ~= nil then
  467. inv:set_stack("main", stack, item)
  468. end
  469. end
  470. end,
  471. })
  472. minetest.register_abm({
  473. nodenames = {"lottmapgen:dwarf_chest_spawner"},
  474. interval = 9,
  475. chance = 1,
  476. action = function(pos, node, active_object_count, active_object_count_wider)
  477. minetest.set_node(pos, {name="lottblocks:dwarf_chest", param2 = node.param2})
  478. local item_count = r(1,9)
  479. local items_available = {
  480. [0] = "lottpotion:beer " .. r(1,10),
  481. [1] = "lottpotion:wine " .. r(2,6),
  482. [2] = "lottpotion:mead " .. r(2, 4),
  483. [3] = "lottpotion:ale " .. r(1, 15),
  484. [4] = "lottores:mithril_lump 2",
  485. [5] = "lottores:galvorn_ingot 3",
  486. [6] = "default:iron_lump " .. r(10, 20),
  487. [7] = "default:steel_ingot " .. r(5, 15),
  488. [8] = "lottores:tin_lump " .. r(5, 10),
  489. [9] = "default:copper_lump " .. r(5, 10),
  490. [10] = "lottplants:alderwood 13",
  491. [11] = "lottores:ithildin_stone_1 4",
  492. [12] = "lottores:ithildin_stonelamp_1 6",
  493. [13] = "lottthrowing:axe_dwarf " .. r(1, 4),
  494. [14] = "lottthrowing:axe_steel " .. r(1, 6),
  495. [15] = "lottthrowing:bow_wood_alder",
  496. [16] = "lottthrowing:arrow " .. r(5, 20),
  497. [17] = "lottores:goldsword",
  498. [18] = "lottweapons:gold_spear",
  499. [19] = "lottarmor:chestplate_gold",
  500. [20] = "lottarmor:helmet_gold",
  501. [21] = "lottarmor:leggings_gold",
  502. [22] = "lottarmor:boots_gold",
  503. [23] = "lottarmor:shield_gold",
  504. [24] = "default:gold_lump " .. r(6, 16),
  505. [25] = "default:gold_ingot " .. r(3, 9),
  506. [26] = "lottthrowing:crossbow_gold",
  507. [27] = "lottthrowing:bolt " .. r(5, 20),
  508. [28] = "lottblocks:dwarfstone_black " .. r(10, 20),
  509. [29] = "lottblocks:dwarfstone_white " .. r(10, 20),
  510. [30] = "lottmobs:meat " .. r(1, 7),
  511. [31] = "farming:bread " .. r(2, 10),
  512. [32] = "lottblocks:deep_depths",
  513. [33] = "lottblocks:miner_handbook",
  514. [34] = "lottblocks:miner_handbook_2",
  515. [35] = "lottblocks:miner_handbook_3"
  516. }
  517. local meta = minetest.get_meta(pos)
  518. local inv = meta:get_inventory()
  519. for i = 0, item_count do
  520. local stack = r(0, 36)
  521. local item = items_available[r(0, 36)]
  522. if inv:get_stack("main", stack) ~= "" then
  523. stack = stack + 1
  524. end
  525. if item ~= nil then
  526. inv:set_stack("main", stack, item)
  527. end
  528. end
  529. end,
  530. })
  531. minetest.register_abm({
  532. nodenames = {"lottmapgen:ring_chest_spawner"},
  533. interval = 9,
  534. chance = 1,
  535. action = function(pos, node, active_object_count, active_object_count_wider)
  536. minetest.set_node(pos, {name="lottblocks:elfloth_chest", param2 = node.param2})
  537. local item_count = r(1,7)
  538. local items_available = {
  539. [0] = "default:gold_ingot " .. r(1, 10),
  540. [1] = "lottores:silver_ingot " .. r(1, 10),
  541. [2] = "lottother:pure_gold " .. r(1, 8),
  542. [3] = "lottother:pure_silver " .. r(1, 8),
  543. [4] = "lottother:goldsilver " .. r(1, 7),
  544. [5] = "lottores:rough_rock_lump " .. r(1, 8),
  545. [6] = "lottores:mithril_ingot " .. r(1, 5),
  546. [7] = "default:gold_lump " .. r(3, 7),
  547. [8] = "lottores:silver_lump " .. r(3, 7),
  548. [9] = "default:coalblock " .. r(1, 3),
  549. [10] = "lottother:ringsilver " .. r(1, 4),
  550. [11] = "lottother:stony_red_gem " .. r(1, 3),
  551. [12] = "lottother:stony_blue_gem " .. r(1, 3),
  552. [13] = "lottother:stony_white_gem " .. r(1, 3),
  553. [14] = "lottother:stony_purple_gem " .. r(1, 3),
  554. [15] = "lottother:unpolished_blue_gem",
  555. [16] = "lottother:unpolished_purple_gem",
  556. [17] = "lottother:uncut_red_gem",
  557. [18] = "lottother:uncut_white_gem",
  558. [19] = "lottother:quarter_ring " .. r(1, 4),
  559. [20] = "lottother:half_ring " .. r(1, 2),
  560. [21] = "lottother:ring",
  561. [22] = "lottother:pin " .. r(2, 10),
  562. [23] = "lottother:prepared_ring",
  563. [24] = "lottother:ring_furnace_inactive",
  564. [25] = "lottother:ringsilver_furnace_inactive",
  565. [26] = "lottfarming:corn " .. r(2, 10),
  566. [27] = "lottblocks:ring_guide_2"
  567. }
  568. local meta = minetest.get_meta(pos)
  569. local inv = meta:get_inventory()
  570. inv:set_stack("main", 1, "lottblocks:ring_guide")
  571. for i = 0, item_count do
  572. local stack = r(0, 36)
  573. local item = items_available[r(0, 36)]
  574. if inv:get_stack("main", stack) ~= "" then
  575. stack = stack + 1
  576. end
  577. if item ~= nil then
  578. inv:set_stack("main", stack, item)
  579. end
  580. end
  581. end,
  582. })
  583. minetest.register_abm({
  584. nodenames = {"lottmapgen:furnace_spawner"},
  585. interval = 9,
  586. chance = 1,
  587. action = function(pos)
  588. local p2 = minetest.get_node(pos).param2
  589. minetest.set_node(pos, {name = "default:furnace", param2 = p2})
  590. end
  591. })
  592. minetest.register_abm({
  593. nodenames = {"lottmapgen:dual_furnace_spawner"},
  594. interval = 9,
  595. chance = 1,
  596. action = function(pos)
  597. local p2 = minetest.get_node(pos).param2
  598. minetest.set_node(pos, {name = "lottblocks:dual_furnace_inactive", param2 = p2})
  599. end
  600. })
  601. minetest.register_abm({
  602. nodenames = {"lottmapgen:ringsilver_furnace_spawner"},
  603. interval = 9,
  604. chance = 1,
  605. action = function(pos)
  606. local p2 = minetest.get_node(pos).param2
  607. minetest.set_node(pos, {name = "lottother:ringsilver_furnace_inactive", param2 = p2})
  608. end
  609. })