init.lua 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. -- sound : https://freesound.org/people/Legnalegna55/sounds/547558/
  2. mobs:register_mob("spectrum:spectrum", {
  3. --nametag = "Spectrum" ,
  4. type = "monster",
  5. passive = false,
  6. attack_npcs = false,
  7. attack_type = "shoot",
  8. shoot_interval = 2.0,
  9. shoot_offset = 1.5,
  10. arrow = "spectrum:spectrum_arrow",
  11. pathfinding = true,
  12. reach = 3,
  13. damage = 6,
  14. hp_min = 80,
  15. hp_max = 80,
  16. armor = 80,
  17. collisionbox = {-0.4, -1, -0.4, 0.4, 0.9, 0.4},
  18. visual = "mesh",
  19. mesh = "spectrum.b3d",
  20. rotate = 180,
  21. textures = {
  22. {"spectrum.png"},
  23. },
  24. glow = 8,
  25. blood_texture = "blood_spectrum.png",
  26. makes_footstep_sound = true,
  27. sounds = {
  28. random = "spectrum",
  29. },
  30. fly = true ,
  31. fly_in = "air",
  32. walk_velocity = 1,
  33. run_velocity = 5,
  34. jump_height = 1,
  35. stepheight = 1.1,
  36. floats = 0,
  37. view_range = 25,
  38. drops = {
  39. {name = "spectrum:spectrum_orb", chance = 2, min = 1, max =1},
  40. },
  41. water_damage = 0,
  42. lava_damage = 0,
  43. light_damage = 0,
  44. animation = {
  45. speed_run = 15,
  46. stand_start = 0,
  47. stand_end = 0,
  48. walk_start = 15,
  49. walk_end = 33,
  50. run_start = 35,
  51. run_end = 53,
  52. shoot_start = 55,
  53. shoot_end = 84,
  54. },
  55. -- ESSA PARTE FOI RETIRADA DO MOD DE ENDERMAN DO MOBS MINECLONE :)
  56. do_custom = function(self, dtime)
  57. -- PARTICLE BEHAVIOUR HERE.
  58. local specpos = self.object:get_pos()
  59. local chanceOfParticle = math.random(0, 1)
  60. if chanceOfParticle == 1 then
  61. minetest.add_particle({
  62. pos = {x=specpos.x+math.random(-1,1)*math.random()/2,y=specpos.y+math.random(0,3),z=specpos.z+math.random(-1,1)*math.random()/2},
  63. velocity = {x=math.random(-.25,.25), y=math.random(-.25,.25), z=math.random(-.25,.25)},
  64. acceleration = {x=math.random(-.5,.5), y=math.random(-.5,.5), z=math.random(-.5,.5)},
  65. expirationtime = math.random(),
  66. size = math.random(),
  67. collisiondetection = true,
  68. vertical = false,
  69. texture = "pectrum_arrow.png",
  70. })
  71. end
  72. end,
  73. })
  74. mobs:spawn({
  75. name = "spectrum:spectrum",
  76. nodes = {"air"},
  77. max_light = 7,
  78. chance = 9000,
  79. max_height = 200,
  80. })
  81. -- ARROW -----------------------------------------------------------
  82. mobs:register_arrow("spectrum:spectrum_arrow", {
  83. visual = "sprite",
  84. visual_size = {x = 0.5, y = 0.5},
  85. textures = {"pectrum_arrow.png"},
  86. velocity = 18,
  87. glow = 5,
  88. hit_player = function(self, player)
  89. player:punch(self.object, 1.0, {
  90. full_punch_interval = 1.0,
  91. damage_groups = {fleshy = 8},
  92. }, nil)
  93. end,
  94. hit_mob = function(self, player)
  95. player:punch(self.object,1.0, {
  96. full_punch_interval = 1.0,
  97. damage_groups = {fleshy = 8},
  98. }, nil)
  99. end,
  100. hit_node = function(self, pos, node)
  101. end
  102. })
  103. mobs:register_egg("spectrum:spectrum", "Spectrum", "eggspec.png", 1)
  104. core.register_alias("spectrum:spectrum", "spawneggs:spectrum")
  105. -- SPECTRUM ORB
  106. minetest.register_craftitem("spectrum:spectrum_orb", {
  107. description = "Spectrum Orb",
  108. inventory_image = "spectrum_orb.png",
  109. light_source = 3,
  110. })
  111. -- SPECTRUM ORB BLOCK :
  112. minetest.register_node("spectrum:spectrum_orb_block", {
  113. description = "Spectrum Orb Block",
  114. groups = {cracky = 2},
  115. drop = "spectrum:spectrum_orb_block",
  116. light_source = 6,
  117. sounds = default.node_sound_stone_defaults(),
  118. tiles = {{
  119. name = "anim_orb_block.png",
  120. animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 2}
  121. },
  122. },
  123. })
  124. minetest.register_craft({
  125. output = "spectrum:spectrum_orb_block",
  126. recipe = {
  127. {"spectrum:spectrum_orb", "spectrum:spectrum_orb", "spectrum:spectrum_orb"},
  128. {"spectrum:spectrum_orb", "spectrum:spectrum_orb", "spectrum:spectrum_orb"},
  129. {"spectrum:spectrum_orb", "spectrum:spectrum_orb", "spectrum:spectrum_orb"},
  130. }
  131. })
  132. -- COMPATIBILIDADE COM : Mirror of Returning (BY : Wuzzy )
  133. if minetest.get_modpath("returnmirror") then
  134. minetest.register_craft({
  135. output = "returnmirror:mirror_inactive ",
  136. recipe = {
  137. {"default:gold_ingot", "spectrum:spectrum_orb", "default:gold_ingot"},
  138. {"spectrum:spectrum_orb", "default:glass", "spectrum:spectrum_orb"},
  139. {"", "spectrum:spectrum_orb", ""},
  140. },
  141. })
  142. end