mob_spawners.lua 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. -- Mobs spawners for buildings
  2. -- Mordor
  3. minetest.register_node("lottother:mordorms", {
  4. description = "Mordor Mob Spawner",
  5. drawtype = "glasslike",
  6. tiles = {"lottother_air.png"},
  7. drop = '',
  8. paramtype = "light",
  9. sunlight_propagates = true,
  10. is_ground_content = false,
  11. walkable = false,
  12. buildable_to = true,
  13. pointable = false,
  14. on_construct = function(pos, node)
  15. if math.random(1, 4) == 2 then
  16. minetest.add_entity({x = pos.x, y = pos.y+1, z = pos.z}, "lottmobs:orc")
  17. elseif math.random(1, 5) == 3 then
  18. minetest.add_entity({x = pos.x, y = pos.y+1, z = pos.z}, "lottmobs:uruk_hai")
  19. elseif math.random(1, 11) == 4 then
  20. minetest.add_entity({x = pos.x, y = pos.y+1, z = pos.z}, "lottmobs:battle_troll")
  21. end
  22. minetest.remove_node(pos)
  23. end,
  24. groups = {not_in_creative_inventory=1,dig_immediate=3},
  25. })
  26. -- Rohan
  27. minetest.register_node("lottother:rohanms", {
  28. description = "Rohan Mob Spawner",
  29. drawtype = "glasslike",
  30. tiles = {"lottother_air.png"},
  31. drop = '',
  32. paramtype = "light",
  33. sunlight_propagates = true,
  34. is_ground_content = false,
  35. walkable = false,
  36. buildable_to = true,
  37. pointable = false,
  38. on_construct = function(pos, node)
  39. if math.random(1, 3) == 2 then
  40. minetest.add_entity({x = pos.x, y = pos.y+1, z = pos.z}, "lottmobs:rohan_guard")
  41. end
  42. minetest.remove_node(pos)
  43. end,
  44. groups = {not_in_creative_inventory=1,dig_immediate=3},
  45. })
  46. -- Elf
  47. minetest.register_node("lottother:elfms", {
  48. description = "Elf Mob Spawner",
  49. drawtype = "glasslike",
  50. tiles = {"lottother_air.png"},
  51. drop = '',
  52. paramtype = "light",
  53. sunlight_propagates = true,
  54. is_ground_content = false,
  55. walkable = false,
  56. buildable_to = true,
  57. pointable = false,
  58. on_construct = function(pos, node)
  59. if math.random(1, 2) == 2 then
  60. minetest.add_entity({x = pos.x, y = pos.y+1, z = pos.z}, "lottmobs:elf")
  61. end
  62. minetest.remove_node(pos)
  63. end,
  64. groups = {not_in_creative_inventory=1,dig_immediate=3},
  65. })
  66. --Hobbit
  67. minetest.register_node("lottother:hobbitms", {
  68. description = "Hobbit Mob Spawner",
  69. drawtype = "glasslike",
  70. tiles = {"lottother_air.png"},
  71. drop = '',
  72. paramtype = "light",
  73. sunlight_propagates = true,
  74. is_ground_content = false,
  75. walkable = false,
  76. buildable_to = true,
  77. pointable = false,
  78. on_construct = function(pos, node)
  79. if math.random(1, 2) == 2 then
  80. minetest.add_entity({x = pos.x, y = pos.y+1, z = pos.z}, "lottmobs:hobbit")
  81. end
  82. minetest.remove_node(pos)
  83. end,
  84. groups = {not_in_creative_inventory=1,dig_immediate=3},
  85. })
  86. --Gondor
  87. minetest.register_node("lottother:gondorms", {
  88. description = "Gondor Mob Spawner",
  89. drawtype = "glasslike",
  90. tiles = {"lottother_air.png"},
  91. drop = '',
  92. paramtype = "light",
  93. sunlight_propagates = true,
  94. is_ground_content = false,
  95. walkable = false,
  96. buildable_to = true,
  97. pointable = false,
  98. on_construct = function(pos, node)
  99. if math.random(1, 3) == 2 then
  100. minetest.add_entity({x = pos.x, y = pos.y+1, z = pos.z}, "lottmobs:gondor_guard")
  101. end
  102. minetest.remove_node(pos)
  103. end,
  104. groups = {not_in_creative_inventory=1,dig_immediate=3},
  105. })
  106. --Angmar
  107. minetest.register_node("lottother:angmarms", {
  108. description = "Angmar Mob Spawner",
  109. drawtype = "glasslike",
  110. tiles = {"lottother_air.png"},
  111. drop = '',
  112. paramtype = "light",
  113. sunlight_propagates = true,
  114. is_ground_content = false,
  115. walkable = false,
  116. buildable_to = true,
  117. pointable = false,
  118. on_construct = function(pos, node)
  119. if math.random(1, 2) == 2 then
  120. minetest.add_entity({x = pos.x, y = pos.y+1, z = pos.z}, "lottmobs:half_troll")
  121. end
  122. minetest.remove_node(pos)
  123. end,
  124. groups = {not_in_creative_inventory=1,dig_immediate=3},
  125. })
  126. --Dwarf
  127. minetest.register_node("lottother:dwarfms", {
  128. description = "Dwarf Mob Spawner",
  129. drawtype = "glasslike",
  130. tiles = {"lottother_air.png"},
  131. drop = '',
  132. paramtype = "light",
  133. sunlight_propagates = true,
  134. is_ground_content = false,
  135. walkable = false,
  136. buildable_to = true,
  137. pointable = false,
  138. on_construct = function(pos, node)
  139. if math.random(1, 2) == 2 then
  140. minetest.add_entity({x = pos.x, y = pos.y+1, z = pos.z}, "lottmobs:dwarf")
  141. end
  142. minetest.remove_node(pos)
  143. end,
  144. groups = {not_in_creative_inventory=1,dig_immediate=3},
  145. })
  146. minetest.register_alias("lottother:gondorms_on", "lottother:gondorms")
  147. minetest.register_alias("lottother:gondorms_off", "lottother:gondorms")
  148. minetest.register_alias("lottother:rohanms_on", "lottother:rohanms")
  149. minetest.register_alias("lottother:rohanms_off", "lottother:rohanms")
  150. minetest.register_alias("lottother:angmarms_on", "lottother:angmarms")
  151. minetest.register_alias("lottother:angmarms_off", "lottother:angmarms")
  152. minetest.register_alias("lottother:hobbitms_on", "lottother:hobbitms")
  153. minetest.register_alias("lottother:hobbitms_off", "lottother:hobbitms")
  154. minetest.register_alias("lottother:elfms_on", "lottother:elfms")
  155. minetest.register_alias("lottother:elfms_off", "lottother:elfms")
  156. minetest.register_alias("lottother:mordorms_on", "lottother:mordorms")
  157. minetest.register_alias("lottother:mordorms_off", "lottother:mordorms")