data.lua 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694
  1. -- Clear registration table afresh. Allows loading file multiple times.
  2. mob_spawn.registered = {}
  3. local register = mob_spawn.register_spawn
  4. -- This is not working, for some reason.
  5. -- Anyway, the wisp mob has special spawning code.
  6. --[[
  7. register({
  8. name = "pm:follower",
  9. nodes = {
  10. "basictrees:jungletree_leaves2",
  11. },
  12. min_height = 3111-16,
  13. max_height = 3115+16,
  14. clearance = 1,
  15. mob_limit = 1,
  16. absolute_mob_limit = 5,
  17. mob_range = 100,
  18. -- After a successful spawn, wait a lot of time before spawning another one.
  19. success_time_min = 60*5,
  20. success_time_max = 60*10,
  21. min_count = 1,
  22. max_count = 3,
  23. add_entity_func = function(...) pm.spawn_random_wisp(...) end,
  24. })
  25. --]]
  26. register({
  27. name = "nssm:white_werewolf",
  28. nodes = {
  29. "default:snow",
  30. "snow:footprints",
  31. },
  32. min_height = -10,
  33. max_height = 300,
  34. clearance = 3,
  35. mob_limit = 1,
  36. absolute_mob_limit = 100,
  37. mob_range = 100,
  38. -- After a successful spawn, wait a lot of time before spawning another one.
  39. success_time_min = 60*5,
  40. success_time_max = 60*10,
  41. -- Never spawn more than 1 mob at a time.
  42. min_count = 1,
  43. max_count = 1,
  44. -- Matches noise params for the ambiant wolf sound.
  45. noise_params = {
  46. offset = 0,
  47. scale = 1,
  48. spread = {x=256, y=256, z=256},
  49. seed = 381783,
  50. octaves = 2,
  51. persist = 0.5,
  52. lacunarity = 1.5,
  53. flags = "",
  54. },
  55. noise_threshold = 0.6, -- Higher than noise_threshold for ambiant sound.
  56. })
  57. register({
  58. name = "dm:dm",
  59. nodes = {
  60. "default:stone",
  61. "cavestuff:cobble_with_moss",
  62. "cavestuff:cobble_with_lichen",
  63. "cavestuff:cobble_with_algae",
  64. },
  65. min_light = 0,
  66. max_light = 2,
  67. min_height = -26000,
  68. max_height = -2048,
  69. clearance = 3,
  70. noise_params = {
  71. offset = 0,
  72. scale = 1,
  73. spread = {x=512, y=512, z=512},
  74. seed = 48912,
  75. octaves = 3,
  76. persist = 0.5,
  77. lacunarity = 1.5,
  78. flags = "",
  79. },
  80. noise_threshold = 0.5,
  81. })
  82. register({
  83. name = "dm:dm",
  84. nodes = {
  85. "rackstone:rackstone",
  86. "rackstone:redrack",
  87. "rackstone:mg_rackstone",
  88. "rackstone:mg_redrack",
  89. },
  90. min_light = 0,
  91. max_light = 4,
  92. max_height = -25000,
  93. clearance = 3,
  94. noise_params = {
  95. offset = 0,
  96. scale = 1,
  97. spread = {x=512, y=512, z=512},
  98. seed = 48912,
  99. octaves = 3,
  100. persist = 0.5,
  101. lacunarity = 1.5,
  102. flags = "",
  103. },
  104. noise_threshold = 0.3,
  105. })
  106. register({
  107. name = "golem:stone_golem",
  108. nodes = {"rackstone:rackstone"},
  109. min_light = 0,
  110. max_light = 6,
  111. max_height = -25000,
  112. clearance = 3,
  113. })
  114. -- Naraxen.
  115. register({
  116. name = "golem:stone_golem",
  117. nodes = {"darkage:basaltic_rubble", "darkage:basaltic"},
  118. min_light = 0,
  119. max_light = 6,
  120. min_height = 5150,
  121. max_height = 8150,
  122. clearance = 3,
  123. noise_params = {
  124. offset = 0,
  125. scale = 1,
  126. spread = {x=512, y=512, z=512},
  127. seed = 25206,
  128. octaves = 3,
  129. persist = 0.5,
  130. lacunarity = 1.5,
  131. flags = "",
  132. },
  133. noise_threshold = -0.3,
  134. })
  135. -- Caverealm griefer mob.
  136. -- Spawning behavior is similar to icemen on the surface.
  137. register({
  138. name = "griefer:griefer",
  139. nodes = {
  140. "cavestuff:dark_obsidian",
  141. "cavestuff:cobble_with_moss",
  142. "cavestuff:cobble_with_algae",
  143. },
  144. min_light = 0,
  145. max_light = 4,
  146. min_height = -31000,
  147. max_height = -5000,
  148. day_toggle = true,
  149. })
  150. register({
  151. name = "iceman:iceman",
  152. nodes = {
  153. -- Does not spawn on tree snow or ice.
  154. "default:snow",
  155. "snow:footprints",
  156. },
  157. min_light = 0,
  158. max_light = 4,
  159. mob_limit = 10,
  160. min_height = -21,
  161. max_height = 70,
  162. day_toggle = false,
  163. spawn_chance = 1,
  164. mob_range = 30,
  165. absolute_mob_limit = 20,
  166. player_min_range = 5,
  167. player_max_range = 20,
  168. spawn_radius = 20,
  169. node_skip = 4,
  170. node_jitter = 4,
  171. success_time_min = 1,
  172. success_time_max = 20,
  173. min_count = 1,
  174. max_count = 4,
  175. })
  176. register({
  177. name = "obsidianmonster:obsidianmonster",
  178. nodes = {"air"},
  179. min_light = 0,
  180. max_light = 0,
  181. max_height = -256,
  182. clearance = 2, -- Wants a 3x3x3 area.
  183. flyswim = "flyswim",
  184. noise_params = {
  185. offset = 0,
  186. scale = 1,
  187. spread = {x=512, y=512, z=512},
  188. seed = 2837189,
  189. octaves = 3,
  190. persist = 0.5,
  191. lacunarity = 1.5,
  192. flags = "",
  193. },
  194. noise_threshold = 0.3,
  195. })
  196. -- Naraxen.
  197. register({
  198. name = "obsidianmonster:obsidianmonster",
  199. nodes = {"air"},
  200. min_light = 0,
  201. max_light = 0,
  202. min_height = 5150,
  203. max_height = 8150,
  204. clearance = 2, -- Wants a 3x3x3 area.
  205. flyswim = "flyswim",
  206. noise_params = {
  207. offset = 0,
  208. scale = 1,
  209. spread = {x=512, y=512, z=512},
  210. seed = 25206,
  211. octaves = 3,
  212. persist = 0.5,
  213. lacunarity = 1.5,
  214. flags = "",
  215. },
  216. noise_threshold = -0.3,
  217. })
  218. -- That flying thing.
  219. register({
  220. name = "oerkki:oerkki",
  221. nodes = {"air"},
  222. min_light = 0,
  223. max_light = 0,
  224. min_height = -31000,
  225. max_height = -10,
  226. clearance = 2, -- Wants a 3x3x3 area.
  227. flyswim = "flyswim",
  228. noise_params = {
  229. offset = 0,
  230. scale = 1,
  231. spread = {x=512, y=512, z=512},
  232. seed = 27192,
  233. octaves = 3,
  234. persist = 0.5,
  235. lacunarity = 1.5,
  236. flags = "",
  237. },
  238. noise_threshold = 0.3,
  239. })
  240. -- Naraxen.
  241. register({
  242. name = "oerkki:oerkki",
  243. nodes = {"air"},
  244. min_light = 0,
  245. max_light = 0,
  246. min_height = 5150,
  247. max_height = 8150,
  248. clearance = 2, -- Wants a 3x3x3 area.
  249. flyswim = "flyswim",
  250. noise_params = {
  251. offset = 0,
  252. scale = 1,
  253. spread = {x=512, y=512, z=512},
  254. seed = 25206,
  255. octaves = 3,
  256. persist = 0.5,
  257. lacunarity = 1.5,
  258. flags = "",
  259. },
  260. noise_threshold = -0.3,
  261. })
  262. -- Night Master.
  263. register({
  264. name = "oerkki:night_master",
  265. nodes = {"air"},
  266. min_light = 0,
  267. max_light = 15,
  268. day_toggle = false,
  269. min_height = 3080,
  270. max_height = 3280,
  271. clearance = 3,
  272. flyswim = "flyswim",
  273. mob_limit = 1,
  274. absolute_mob_limit = 5,
  275. mob_range = 50,
  276. -- Never spawn more than 1 mob at a time.
  277. min_count = 1,
  278. max_count = 1,
  279. -- After a successful spawn, wait before spawning another one.
  280. success_time_min = 60*5,
  281. success_time_max = 60*10,
  282. -- Same as moonheron, with higher threshold.
  283. noise_params = {
  284. offset = 0,
  285. scale = 1,
  286. spread = {x=512, y=512, z=512},
  287. seed = 2852,
  288. octaves = 5,
  289. persist = 0.5,
  290. lacunarity = 1.5,
  291. flags = "",
  292. },
  293. noise_threshold = 0.8,
  294. })
  295. register({
  296. name = "nssm:moonheron",
  297. nodes = {"air"},
  298. min_light = 0,
  299. max_light = 15,
  300. day_toggle = false,
  301. min_height = 3060,
  302. max_height = 3280,
  303. clearance = 3,
  304. flyswim = "flyswim",
  305. mob_limit = 3,
  306. absolute_mob_limit = 5,
  307. mob_range = 50,
  308. -- Never spawn more than 1 mob at a time.
  309. min_count = 1,
  310. max_count = 1,
  311. -- Same as night master, with lower threshold.
  312. noise_params = {
  313. offset = 0,
  314. scale = 1,
  315. spread = {x=512, y=512, z=512},
  316. seed = 2852,
  317. octaves = 5,
  318. persist = 0.5,
  319. lacunarity = 1.5,
  320. flags = "",
  321. },
  322. noise_threshold = 0.7,
  323. })
  324. register({
  325. name = "rat:rat",
  326. nodes = {"default:stone"},
  327. min_light = 0,
  328. max_light = default.LIGHT_MAX,
  329. min_height = -128,
  330. max_height = 31000,
  331. clearance = 1,
  332. })
  333. register({
  334. name = "sheep:sheep",
  335. nodes = {"default:dirt_with_grass", "moregrass:darkgrass", "default:dirt_with_dry_grass"},
  336. min_light = 10,
  337. max_light = default.LIGHT_MAX,
  338. min_height = -30,
  339. max_height = 31000,
  340. day_toggle = nil, -- They spawn anytime.
  341. })
  342. register({
  343. name = "skeleton:skeleton",
  344. nodes = {
  345. "rackstone:rackstone",
  346. "rackstone:redrack",
  347. "rackstone:mg_rackstone",
  348. "rackstone:mg_redrack",
  349. },
  350. min_light = 0,
  351. max_light = 6,
  352. mob_limit = 10,
  353. max_height = -25000,
  354. clearance = 3,
  355. noise_params = {
  356. offset = 0,
  357. scale = 1,
  358. spread = {x=512, y=512, z=512},
  359. seed = 4817889,
  360. octaves = 3,
  361. persist = 0.5,
  362. lacunarity = 1.5,
  363. flags = "",
  364. },
  365. noise_threshold = 0.3,
  366. })
  367. -- Naraxen.
  368. register({
  369. name = "skeleton:skeleton",
  370. nodes = {"darkage:basaltic_rubble", "darkage:basaltic"},
  371. min_light = 0,
  372. max_light = 0,
  373. min_height = 5150,
  374. max_height = 8150,
  375. clearance = 3,
  376. noise_params = {
  377. offset = 0,
  378. scale = 1,
  379. spread = {x=512, y=512, z=512},
  380. seed = 25206,
  381. octaves = 3,
  382. persist = 0.5,
  383. lacunarity = 1.5,
  384. flags = "",
  385. },
  386. noise_threshold = -0.3,
  387. })
  388. register({
  389. name = "stoneman:stoneman",
  390. nodes = {"default:stone", "default:cobble"},
  391. min_light = 0,
  392. max_light = 1,
  393. mob_limit = 10,
  394. max_height = -128,
  395. })
  396. -- Naraxen.
  397. register({
  398. name = "stoneman:stoneman",
  399. nodes = {"darkage:basaltic_rubble", "darkage:basaltic"},
  400. min_light = 0,
  401. max_light = 1,
  402. min_height = 5150,
  403. max_height = 8150,
  404. clearance = 3,
  405. noise_params = {
  406. offset = 0,
  407. scale = 1,
  408. spread = {x=512, y=512, z=512},
  409. seed = 25206,
  410. octaves = 3,
  411. persist = 0.5,
  412. lacunarity = 1.5,
  413. flags = "",
  414. },
  415. noise_threshold = -0.3,
  416. })
  417. -- Naraxen.
  418. -- Disgusting eldritch.
  419. register({
  420. name = "nssm:morde",
  421. nodes = {"darkage:basaltic_rubble", "darkage:basaltic"},
  422. min_light = 0,
  423. max_light = 1,
  424. min_height = 5150,
  425. max_height = 8150,
  426. clearance = 3,
  427. mob_limit = 1,
  428. min_count = 1,
  429. max_count = 1,
  430. mob_range = 40,
  431. noise_params = {
  432. offset = 0,
  433. scale = 1,
  434. spread = {x=512, y=512, z=512},
  435. seed = 16804,
  436. octaves = 3,
  437. persist = 0.5,
  438. lacunarity = 1.5,
  439. flags = "",
  440. },
  441. noise_threshold = 0.3,
  442. })
  443. register({
  444. name = "warthog:warthog",
  445. nodes = {
  446. "rackstone:rackstone",
  447. "rackstone:redrack",
  448. "rackstone:mg_rackstone",
  449. "rackstone:mg_redrack",
  450. },
  451. min_light = 0,
  452. max_light = 3,
  453. mob_limit = 10,
  454. max_height = -25000,
  455. min_count = 7,
  456. max_count = 16,
  457. noise_params = {
  458. offset = 0,
  459. scale = 1,
  460. spread = {x=512, y=512, z=512},
  461. seed = 423821,
  462. octaves = 3,
  463. persist = 0.5,
  464. lacunarity = 1.5,
  465. flags = "",
  466. },
  467. noise_threshold = 0.3,
  468. })
  469. register({
  470. name = "sandman:sandman",
  471. nodes = {
  472. "default:desert_sand",
  473. },
  474. min_light = 0,
  475. max_light = 4,
  476. mob_limit = 10,
  477. min_height = 3700,
  478. max_height = 3800,
  479. day_toggle = false,
  480. spawn_chance = 1,
  481. mob_range = 30,
  482. absolute_mob_limit = 20,
  483. player_min_range = 5,
  484. player_max_range = 20,
  485. spawn_radius = 20,
  486. node_skip = 4,
  487. node_jitter = 4,
  488. success_time_min = 1,
  489. success_time_max = 20,
  490. min_count = 1,
  491. max_count = 4,
  492. })
  493. register({
  494. name = "sandman:stoneman",
  495. nodes = {"default:desert_stone"},
  496. min_light = 0,
  497. max_light = 4,
  498. mob_limit = 10,
  499. min_height = 3600,
  500. max_height = 3800,
  501. spawn_chance = 1,
  502. })
  503. register({
  504. name = "nssm:phoenix",
  505. nodes = {"air"},
  506. min_light = 12,
  507. max_light = 15,
  508. day_toggle = true,
  509. min_height = 3735,
  510. max_height = 3800,
  511. clearance = 3,
  512. flyswim = "flyswim",
  513. mob_limit = 1,
  514. absolute_mob_limit = 5,
  515. mob_range = 40,
  516. min_count = 1,
  517. max_count = 1,
  518. -- After a successful spawn, wait before spawning another one.
  519. success_time_min = 60*5,
  520. success_time_max = 60*10,
  521. noise_params = {
  522. offset = 0,
  523. scale = 1,
  524. spread = {x=512, y=512, z=512},
  525. seed = 10548,
  526. octaves = 5,
  527. persist = 0.5,
  528. lacunarity = 1.5,
  529. flags = "",
  530. },
  531. noise_threshold = 0.8,
  532. })
  533. register({
  534. name = "nssm:scrausics",
  535. nodes = {"air"},
  536. min_light = 12,
  537. max_light = 15,
  538. day_toggle = true,
  539. min_height = 3735,
  540. max_height = 3800,
  541. clearance = 3,
  542. flyswim = "flyswim",
  543. mob_limit = 3,
  544. absolute_mob_limit = 5,
  545. mob_range = 40,
  546. min_count = 1,
  547. max_count = 2,
  548. noise_params = {
  549. offset = 0,
  550. scale = 1,
  551. spread = {x=512, y=512, z=512},
  552. seed = 48727,
  553. octaves = 5,
  554. persist = 0.5,
  555. lacunarity = 1.5,
  556. flags = "",
  557. },
  558. noise_threshold = 0.8,
  559. })
  560. -- Pigs in the Outback.
  561. register({
  562. name = "animalworld:suboar",
  563. nodes = {"rackstone:cobble"},
  564. min_light = 0,
  565. max_light = 15,
  566. day_toggle = false,
  567. min_height = 4160+400,
  568. max_height = 4200+400,
  569. clearance = 2,
  570. mob_limit = 2,
  571. absolute_mob_limit = 6,
  572. mob_range = 40,
  573. realm_restriction = true,
  574. -- After a successful spawn, wait before spawning another one.
  575. success_time_min = 60*5,
  576. success_time_max = 60*10,
  577. -- Never spawn more than 1 mob at a time.
  578. min_count = 1,
  579. max_count = 1,
  580. })
  581. -- A very rare, very hard mob.
  582. register({
  583. name = "griefer:elite_griefer",
  584. nodes = {
  585. "bedrock:bedrock",
  586. "cavestuff:dark_obsidian",
  587. },
  588. min_height = -35000,
  589. max_height = 35000,
  590. clearance = 2,
  591. mob_limit = 2,
  592. absolute_mob_limit = 10,
  593. mob_range = 40,
  594. -- After a successful spawn, wait a lot of time before spawning another one.
  595. -- Between 1 and 4 hours.
  596. success_time_min = 60*60,
  597. success_time_max = 60*60*4,
  598. -- Min/max amount of mobs to spawn at one time.
  599. min_count = 1,
  600. max_count = 2,
  601. -- Because it is allowed to spawn in the Abyss, at the bedrock layer.
  602. realm_restriction = true,
  603. })
  604. -- Reinit per-player data.
  605. mob_spawn.players = {}
  606. local function re_init()
  607. local players = minetest.get_connected_players()
  608. for k, v in ipairs(players) do
  609. -- This is an indexed array.
  610. local pname = v:get_player_name()
  611. mob_spawn.reinit_player(pname)
  612. end
  613. end
  614. minetest.after(1, re_init)