data.lua 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546
  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 = {"whitestone:stone"},
  109. min_light = 0,
  110. max_light = 6,
  111. max_height = -25000,
  112. clearance = 3,
  113. })
  114. -- Caverealm griefer mob.
  115. -- Spawning behavior is similar to icemen on the surface.
  116. register({
  117. name = "griefer:griefer",
  118. nodes = {
  119. "cavestuff:dark_obsidian",
  120. "cavestuff:cobble_with_moss",
  121. "cavestuff:cobble_with_algae",
  122. },
  123. min_light = 0,
  124. max_light = 4,
  125. min_height = -31000,
  126. max_height = -5000,
  127. day_toggle = true,
  128. })
  129. register({
  130. name = "iceman:iceman",
  131. nodes = {
  132. -- Does not spawn on tree snow or ice.
  133. "default:snow",
  134. "snow:footprints",
  135. },
  136. min_light = 0,
  137. max_light = 4,
  138. mob_limit = 10,
  139. min_height = -21,
  140. max_height = 70,
  141. day_toggle = false,
  142. spawn_chance = 1,
  143. mob_range = 30,
  144. absolute_mob_limit = 20,
  145. player_min_range = 5,
  146. player_max_range = 20,
  147. spawn_radius = 20,
  148. node_skip = 4,
  149. node_jitter = 4,
  150. success_time_min = 1,
  151. success_time_max = 20,
  152. min_count = 1,
  153. max_count = 4,
  154. })
  155. register({
  156. name = "obsidianmonster:obsidianmonster",
  157. nodes = {"air"},
  158. min_light = 0,
  159. max_light = 0,
  160. max_height = -256,
  161. clearance = 2, -- Wants a 3x3x3 area.
  162. flyswim = "flyswim",
  163. noise_params = {
  164. offset = 0,
  165. scale = 1,
  166. spread = {x=512, y=512, z=512},
  167. seed = 2837189,
  168. octaves = 3,
  169. persist = 0.5,
  170. lacunarity = 1.5,
  171. flags = "",
  172. },
  173. noise_threshold = 0.3,
  174. })
  175. -- That flying thing.
  176. register({
  177. name = "oerkki:oerkki",
  178. nodes = {"air"},
  179. min_light = 0,
  180. max_light = 0,
  181. min_height = -31000,
  182. max_height = -10,
  183. clearance = 2, -- Wants a 3x3x3 area.
  184. flyswim = "flyswim",
  185. noise_params = {
  186. offset = 0,
  187. scale = 1,
  188. spread = {x=512, y=512, z=512},
  189. seed = 27192,
  190. octaves = 3,
  191. persist = 0.5,
  192. lacunarity = 1.5,
  193. flags = "",
  194. },
  195. noise_threshold = 0.3,
  196. })
  197. -- Night Master.
  198. register({
  199. name = "oerkki:night_master",
  200. nodes = {"air"},
  201. min_light = 0,
  202. max_light = 15,
  203. day_toggle = false,
  204. min_height = 3080,
  205. max_height = 3280,
  206. clearance = 3,
  207. flyswim = "flyswim",
  208. mob_limit = 1,
  209. absolute_mob_limit = 5,
  210. mob_range = 50,
  211. -- Never spawn more than 1 mob at a time.
  212. min_count = 1,
  213. max_count = 1,
  214. -- After a successful spawn, wait before spawning another one.
  215. success_time_min = 60*5,
  216. success_time_max = 60*10,
  217. -- Same as moonheron, with higher threshold.
  218. noise_params = {
  219. offset = 0,
  220. scale = 1,
  221. spread = {x=512, y=512, z=512},
  222. seed = 2852,
  223. octaves = 5,
  224. persist = 0.5,
  225. lacunarity = 1.5,
  226. flags = "",
  227. },
  228. noise_threshold = 0.8,
  229. })
  230. register({
  231. name = "nssm:moonheron",
  232. nodes = {"air"},
  233. min_light = 0,
  234. max_light = 15,
  235. day_toggle = false,
  236. min_height = 3060,
  237. max_height = 3280,
  238. clearance = 3,
  239. flyswim = "flyswim",
  240. mob_limit = 3,
  241. absolute_mob_limit = 5,
  242. mob_range = 50,
  243. -- Never spawn more than 1 mob at a time.
  244. min_count = 1,
  245. max_count = 1,
  246. -- Same as night master, with lower threshold.
  247. noise_params = {
  248. offset = 0,
  249. scale = 1,
  250. spread = {x=512, y=512, z=512},
  251. seed = 2852,
  252. octaves = 5,
  253. persist = 0.5,
  254. lacunarity = 1.5,
  255. flags = "",
  256. },
  257. noise_threshold = 0.7,
  258. })
  259. register({
  260. name = "rat:rat",
  261. nodes = {"default:stone"},
  262. min_light = 0,
  263. max_light = default.LIGHT_MAX,
  264. min_height = -128,
  265. max_height = 31000,
  266. clearance = 1,
  267. })
  268. register({
  269. name = "sheep:sheep",
  270. nodes = {"default:dirt_with_grass", "moregrass:darkgrass", "default:dirt_with_dry_grass"},
  271. min_light = 10,
  272. max_light = default.LIGHT_MAX,
  273. min_height = -30,
  274. max_height = 31000,
  275. day_toggle = nil, -- They spawn anytime.
  276. })
  277. register({
  278. name = "skeleton:skeleton",
  279. nodes = {
  280. "rackstone:rackstone",
  281. "rackstone:redrack",
  282. "rackstone:mg_rackstone",
  283. "rackstone:mg_redrack",
  284. },
  285. min_light = 0,
  286. max_light = 6,
  287. mob_limit = 10,
  288. max_height = -25000,
  289. clearance = 3,
  290. noise_params = {
  291. offset = 0,
  292. scale = 1,
  293. spread = {x=512, y=512, z=512},
  294. seed = 4817889,
  295. octaves = 3,
  296. persist = 0.5,
  297. lacunarity = 1.5,
  298. flags = "",
  299. },
  300. noise_threshold = 0.3,
  301. })
  302. register({
  303. name = "stoneman:stoneman",
  304. nodes = {"default:stone", "default:cobble"},
  305. min_light = 0,
  306. max_light = 1,
  307. mob_limit = 10,
  308. max_height = -128,
  309. })
  310. register({
  311. name = "warthog:warthog",
  312. nodes = {
  313. "rackstone:rackstone",
  314. "rackstone:redrack",
  315. "rackstone:mg_rackstone",
  316. "rackstone:mg_redrack",
  317. },
  318. min_light = 0,
  319. max_light = 3,
  320. mob_limit = 10,
  321. max_height = -25000,
  322. min_count = 7,
  323. max_count = 16,
  324. noise_params = {
  325. offset = 0,
  326. scale = 1,
  327. spread = {x=512, y=512, z=512},
  328. seed = 423821,
  329. octaves = 3,
  330. persist = 0.5,
  331. lacunarity = 1.5,
  332. flags = "",
  333. },
  334. noise_threshold = 0.3,
  335. })
  336. register({
  337. name = "sandman:sandman",
  338. nodes = {
  339. "default:desert_sand",
  340. },
  341. min_light = 0,
  342. max_light = 4,
  343. mob_limit = 10,
  344. min_height = 3700,
  345. max_height = 3800,
  346. day_toggle = false,
  347. spawn_chance = 1,
  348. mob_range = 30,
  349. absolute_mob_limit = 20,
  350. player_min_range = 5,
  351. player_max_range = 20,
  352. spawn_radius = 20,
  353. node_skip = 4,
  354. node_jitter = 4,
  355. success_time_min = 1,
  356. success_time_max = 20,
  357. min_count = 1,
  358. max_count = 4,
  359. })
  360. register({
  361. name = "sandman:stoneman",
  362. nodes = {"default:desert_stone"},
  363. min_light = 0,
  364. max_light = 4,
  365. mob_limit = 10,
  366. min_height = 3600,
  367. max_height = 3800,
  368. spawn_chance = 1,
  369. })
  370. register({
  371. name = "nssm:phoenix",
  372. nodes = {"air"},
  373. min_light = 12,
  374. max_light = 15,
  375. day_toggle = true,
  376. min_height = 3735,
  377. max_height = 3800,
  378. clearance = 3,
  379. flyswim = "flyswim",
  380. mob_limit = 1,
  381. absolute_mob_limit = 5,
  382. mob_range = 40,
  383. -- Never spawn more than 1 mob at a time.
  384. min_count = 1,
  385. max_count = 1,
  386. -- After a successful spawn, wait before spawning another one.
  387. success_time_min = 60*5,
  388. success_time_max = 60*10,
  389. -- Same as scrausics, but higher threshold.
  390. noise_params = {
  391. offset = 0,
  392. scale = 1,
  393. spread = {x=512, y=512, z=512},
  394. seed = 48727,
  395. octaves = 5,
  396. persist = 0.5,
  397. lacunarity = 1.5,
  398. flags = "",
  399. },
  400. noise_threshold = 0.9,
  401. })
  402. register({
  403. name = "nssm:scrausics",
  404. nodes = {"air"},
  405. min_light = 12,
  406. max_light = 15,
  407. day_toggle = true,
  408. min_height = 3735,
  409. max_height = 3800,
  410. clearance = 3,
  411. flyswim = "flyswim",
  412. mob_limit = 3,
  413. absolute_mob_limit = 5,
  414. mob_range = 40,
  415. -- Never spawn more than 1 mob at a time.
  416. min_count = 1,
  417. max_count = 2,
  418. -- Same as phoenix, but lower threshold.
  419. noise_params = {
  420. offset = 0,
  421. scale = 1,
  422. spread = {x=512, y=512, z=512},
  423. seed = 48727,
  424. octaves = 5,
  425. persist = 0.5,
  426. lacunarity = 1.5,
  427. flags = "",
  428. },
  429. noise_threshold = 0.8,
  430. })
  431. register({
  432. name = "animalworld:suboar",
  433. nodes = {"rackstone:cobble"},
  434. min_light = 0,
  435. max_light = 15,
  436. day_toggle = false,
  437. min_height = 4160,
  438. max_height = 4200,
  439. clearance = 2,
  440. mob_limit = 2,
  441. absolute_mob_limit = 6,
  442. mob_range = 40,
  443. realm_restriction = true,
  444. -- After a successful spawn, wait before spawning another one.
  445. success_time_min = 60*5,
  446. success_time_max = 60*10,
  447. -- Never spawn more than 1 mob at a time.
  448. min_count = 1,
  449. max_count = 1,
  450. })
  451. -- A very rare, very hard mob.
  452. register({
  453. name = "griefer:elite_griefer",
  454. nodes = {
  455. "bedrock:bedrock",
  456. "cavestuff:dark_obsidian",
  457. },
  458. min_height = -35000,
  459. max_height = 35000,
  460. clearance = 2,
  461. mob_limit = 2,
  462. absolute_mob_limit = 10,
  463. mob_range = 40,
  464. -- After a successful spawn, wait a lot of time before spawning another one.
  465. -- Between 1 and 4 hours.
  466. success_time_min = 60*60,
  467. success_time_max = 60*60*4,
  468. -- Min/max amount of mobs to spawn at one time.
  469. min_count = 1,
  470. max_count = 2,
  471. -- Because it is allowed to spawn in the Abyss, at the bedrock layer.
  472. realm_restriction = true,
  473. })
  474. -- Reinit per-player data.
  475. mob_spawn.players = {}
  476. local players = minetest.get_connected_players()
  477. for k, v in ipairs(players) do
  478. -- This is an indexed array.
  479. local pname = v:get_player_name()
  480. mob_spawn.reinit_player(pname)
  481. end