init.lua 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. --- MESE LORD ( BOSS 1 ) ------------------------------------------
  2. -- sound : https://freesound.org/people/BrainClaim/sounds/267638/
  3. mobs:register_mob("meselord:meselord", {
  4. nametag = "Mese Lord Boss" ,
  5. type = "monster",
  6. passive = false,
  7. attack_npcs = false,
  8. attack_type = "shoot",
  9. shoot_interval = 0.3,
  10. shoot_offset = 1.5,
  11. arrow = "meselord:meselord_arrow",
  12. pathfinding = true,
  13. reach = 4,
  14. damage = 4,
  15. hp_min = 300,
  16. hp_max = 300,
  17. armor = 80,
  18. visual_size = {x = 3, y = 3},
  19. collisionbox = {-1.0, -0.7, -1.0, 1.0, 1.0, 1.0},
  20. visual = "mesh",
  21. mesh = "mese_lord.b3d",
  22. rotate = 180,
  23. textures = {
  24. {"mese_lord.png"},
  25. },
  26. glow = 8,
  27. blood_texture = "default_mese_crystal_fragment.png",
  28. makes_footstep_sound = true,
  29. sounds = {
  30. random = "mese_lord",
  31. },
  32. fly = true ,
  33. fly_in = "air",
  34. walk_velocity = 3,
  35. run_velocity = 5,
  36. jump_height = 4,
  37. stepheight = 3,
  38. floats = 0,
  39. view_range = 40,
  40. drops = {
  41. {name = "default:mese", chance = 2, min = 1, max = 2},
  42. {name = "skullkingsitems:meselord_trophy", chance = 1, min = 1, max = 1},
  43. },
  44. water_damage = 0,
  45. lava_damage = 0,
  46. light_damage = 0,
  47. animation = {
  48. speed_run = 15,
  49. stand_start = 0,
  50. stand_end = 0,
  51. walk_start = 15,
  52. walk_end = 33,
  53. run_start = 35,
  54. run_end = 53,
  55. shoot_start = 55,
  56. shoot_end = 84,
  57. },
  58. on_spawn = function ()
  59. minetest.chat_send_all ("Mese Lord has been awakened..")
  60. end
  61. })
  62. mobs:spawn({
  63. name = "meselord:meselord",
  64. nodes = {"air"},
  65. max_light = 7,
  66. chance = 9000,
  67. max_height = -400,
  68. min_height = -600,
  69. })
  70. -- ARROW -----------------------------------------------------------
  71. mobs:register_arrow("meselord:meselord_arrow", {
  72. visual = "sprite",
  73. visual_size = {x = 0.5, y = 0.5},
  74. textures = {"default_mese_crystal.png"},
  75. collisionbox = {-0.1, -0.1, -0.1, 0.1, 0.1, 0.1},
  76. velocity = 16,
  77. tail = 1,
  78. tail_texture = "default_mese_crystal.png",
  79. tail_size = 10,
  80. glow = 5,
  81. expire = 0.1,
  82. on_activate = function(self, staticdata, dtime_s)
  83. self.object:set_armor_groups({immortal = 1, fleshy = 100})
  84. end,
  85. on_punch = function(self, hitter, tflp, tool_capabilities, dir)
  86. if hitter and hitter:is_player() and tool_capabilities and dir then
  87. local damage = tool_capabilities.damage_groups and
  88. tool_capabilities.damage_groups.fleshy or 1
  89. local tmp = tflp / (tool_capabilities.full_punch_interval or 1.4)
  90. if damage > 6 and tmp < 4 then
  91. self.object:set_velocity({
  92. x = dir.x * self.velocity,
  93. y = dir.y * self.velocity,
  94. z = dir.z * self.velocity,
  95. })
  96. end
  97. end
  98. end,
  99. hit_player = function(self, player)
  100. player:punch(self.object, 1.0, {
  101. full_punch_interval = 0.5,
  102. damage_groups = {fleshy = 7},
  103. }, nil)
  104. end,
  105. hit_mob = function(self, player)
  106. player:punch(self.object, 1.0, {
  107. full_punch_interval = 1.0,
  108. damage_groups = {fleshy = 7},
  109. }, nil)
  110. end,
  111. on_spawn = function ()
  112. minetest.chat_send_all ("Mese Lord has been awakened...")
  113. end,
  114. hit_node = function(self, pos, node)
  115. end,
  116. })
  117. mobs:register_egg("meselord:meselord", "Mese Lord", "default_mese_block.png", 1)
  118. --core.register_alias("meselord:meselord", "spawneggs:spectrum")