data.lua 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352
  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. register({
  198. name = "rat:rat",
  199. nodes = {"default:stone"},
  200. min_light = 0,
  201. max_light = default.LIGHT_MAX,
  202. min_height = -128,
  203. max_height = 31000,
  204. clearance = 1,
  205. })
  206. register({
  207. name = "sheep:sheep",
  208. nodes = {"default:dirt_with_grass", "moregrass:darkgrass", "default:dirt_with_dry_grass"},
  209. min_light = 10,
  210. max_light = default.LIGHT_MAX,
  211. min_height = -30,
  212. max_height = 31000,
  213. day_toggle = nil, -- They spawn anytime.
  214. })
  215. register({
  216. name = "skeleton:skeleton",
  217. nodes = {
  218. "rackstone:rackstone",
  219. "rackstone:redrack",
  220. "rackstone:mg_rackstone",
  221. "rackstone:mg_redrack",
  222. },
  223. min_light = 0,
  224. max_light = 6,
  225. mob_limit = 10,
  226. max_height = -25000,
  227. clearance = 3,
  228. noise_params = {
  229. offset = 0,
  230. scale = 1,
  231. spread = {x=512, y=512, z=512},
  232. seed = 4817889,
  233. octaves = 3,
  234. persist = 0.5,
  235. lacunarity = 1.5,
  236. flags = "",
  237. },
  238. noise_threshold = 0.3,
  239. })
  240. register({
  241. name = "stoneman:stoneman",
  242. nodes = {"default:stone", "default:cobble"},
  243. min_light = 0,
  244. max_light = 1,
  245. mob_limit = 10,
  246. max_height = -128,
  247. })
  248. register({
  249. name = "warthog:warthog",
  250. nodes = {
  251. "rackstone:rackstone",
  252. "rackstone:redrack",
  253. "rackstone:mg_rackstone",
  254. "rackstone:mg_redrack",
  255. },
  256. min_light = 0,
  257. max_light = 3,
  258. mob_limit = 10,
  259. max_height = -25000,
  260. min_count = 7,
  261. max_count = 16,
  262. noise_params = {
  263. offset = 0,
  264. scale = 1,
  265. spread = {x=512, y=512, z=512},
  266. seed = 423821,
  267. octaves = 3,
  268. persist = 0.5,
  269. lacunarity = 1.5,
  270. flags = "",
  271. },
  272. noise_threshold = 0.3,
  273. })
  274. register({
  275. name = "sandman:sandman",
  276. nodes = {
  277. "default:desert_sand",
  278. },
  279. min_light = 0,
  280. max_light = 4,
  281. mob_limit = 10,
  282. min_height = 3700,
  283. max_height = 3800,
  284. day_toggle = false,
  285. spawn_chance = 1,
  286. mob_range = 30,
  287. absolute_mob_limit = 20,
  288. player_min_range = 5,
  289. player_max_range = 20,
  290. spawn_radius = 20,
  291. node_skip = 4,
  292. node_jitter = 4,
  293. success_time_min = 1,
  294. success_time_max = 20,
  295. min_count = 1,
  296. max_count = 4,
  297. })
  298. register({
  299. name = "sandman:stoneman",
  300. nodes = {"default:desert_stone"},
  301. min_light = 0,
  302. max_light = 4,
  303. mob_limit = 10,
  304. min_height = 3600,
  305. max_height = 3800,
  306. spawn_chance = 1,
  307. })
  308. -- Reinit per-player data.
  309. mob_spawn.players = {}
  310. local players = minetest.get_connected_players()
  311. for k, v in ipairs(players) do
  312. -- This is an indexed array.
  313. local pname = v:get_player_name()
  314. mob_spawn.reinit_player(pname)
  315. end