init.lua 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. -- SOUNDS LINK :
  2. -- Bones : https://freesound.org/people/spookymodem/sounds/202091/
  3. -- Arrow hit : retirado do mod x-Bows
  4. -- Arrow texture : retirado do x-Bows
  5. local skullnods = {
  6. "default:dirt",
  7. "default:dirt_with_rainforest",
  8. "default:dirt_with_grass",
  9. "default:dirt_with_dry_grass",
  10. "default:dry_dirt_with_dry_grass",
  11. "default:dirt_with_coniferous_litter",
  12. "default:stone",
  13. "default:ice",
  14. "default:snowblock",
  15. "default:dirt_with_snow",
  16. "default:sand",
  17. "default:desert_sand",
  18. "default:desert_stone",
  19. "default:stone",
  20. "default:desert_stone",
  21. --"default:cobble",
  22. "default:mossycobble",
  23. "default:chest",
  24. "default:ice",
  25. }
  26. mobs:register_mob("skullarchers:sarchers", {
  27. --nametag = "skull archers" ,
  28. type = "monster",
  29. passive = false,
  30. attack_type = "shoot",
  31. arrow = "skullarchers:sarchers_arrow",
  32. shoot_interval = 2.0,
  33. shoot_offset = 1.5,
  34. pathfinding = true,
  35. reach = 20,
  36. damage = math.random(3,5),
  37. hp_min = 25,
  38. hp_max = 25,
  39. armor = 100,
  40. collisionbox = {-0.4, -1.0, -0.4, 0.4, 0.9, 0.4},
  41. visual = "mesh",
  42. mesh = "skull_archers.b3d",
  43. rotate = 180,
  44. textures = {
  45. {"archers.png"},
  46. },
  47. --glow = 4,
  48. blood_texture = "bonex.png",
  49. makes_footstep_sound = true,
  50. sounds = {
  51. death = "falling_bones",
  52. },
  53. walk_velocity = 2,
  54. run_velocity = 5,
  55. jump_height = 2,
  56. stepheight = 1.1,
  57. floats = 0,
  58. view_range = 20,
  59. drops = {
  60. {name = "skullkingsitems:bone", chance = 2, min = 1, max = 1,},
  61. {name = "x_bows:arrow_stone", chance = 3, min = 1, max = 1},
  62. {name = "x_bows:bow_wood", chance = 5, min = 1, max = 1},
  63. },
  64. water_damage = 0,
  65. lava_damage = 1,
  66. light_damage = 0,
  67. animation = {
  68. speed_normal = 15,
  69. speed_run = 15,
  70. stand_start = 0,
  71. stand_end = 0,
  72. walk_start = 15,
  73. walk_end = 33,
  74. run_start = 35,
  75. run_end = 53,
  76. --shoot_start = 55,
  77. --shoot_end = 55,
  78. },
  79. })
  80. -- spawn 1
  81. mobs:spawn({
  82. name = "skullarchers:sarchers",
  83. nodes =skullnods,
  84. min_light = 0,
  85. max_light = 14,
  86. chance = 6000,
  87. --min_height = 0,
  88. --max_height = 200,
  89. max_height = 200,
  90. })
  91. mobs:register_arrow("skullarchers:sarchers_arrow", { --arrow
  92. visual = "wielditem",
  93. visual_size = {x=0.3, y=0.3},
  94. velocity = 12,
  95. textures = {"skullarchers:skull_arrow"}, -- posso criar um bloco, ou flecha 3d
  96. tail = 1,
  97. tail_texture = "particules_arrow.png",
  98. tail_size = 2.0,
  99. rotate = 90,
  100. hit_player = function(self, player)
  101. player:punch(self.object, 1.0, {
  102. full_punch_interval = 1.0,
  103. damage_groups = {fleshy = 3},
  104. minetest.sound_play("x_bows_arrow_hit_1", {
  105. pos = pos,
  106. gain = 1.0,
  107. max_hear_distance = 5,
  108. })
  109. }, nil)
  110. end,
  111. hit_mob = function(self, player)
  112. player:punch(self.object,1.0, {
  113. full_punch_interval = 1.0,
  114. damage_groups = {fleshy = 3},
  115. minetest.sound_play("arrow_hit_1", {
  116. pos = pos,
  117. gain = 1.0,
  118. max_hear_distance = 5,
  119. })
  120. }, nil)
  121. end,
  122. hit_node = function(self, pos, node)
  123. end
  124. })
  125. mobs:register_egg("skullarchers:sarchers", "skull Archers", "eggsarc.png", 1)
  126. core.register_alias("skullarchers:sarchers", "spawneggs:sarchers")
  127. --ARROW :
  128. -- Textura do Arrow , retirado do mod X-Bows
  129. minetest.register_node("skullarchers:skull_arrow", {
  130. --description = "Skull Arrow",
  131. drawtype = "mesh",
  132. mesh = "skullarc_arrow.obj",
  133. tiles = {"x_bows_arrow_stone.png"} ,
  134. --wield_scale = {x=1, y=1, z=1},
  135. --inventory_image = "skull_king_deep.png",
  136. tool_capabilities = {
  137. full_punch_interval = 0.5,
  138. max_drop_level=1,
  139. groupcaps={
  140. snappy={times={[1]=1.50, [2]=0.60, [3]=0.30}, uses=100, maxlevel=3},
  141. cracky = {times={[1]=1.90, [2]=0.90, [3]=0.40}, uses=100, maxlevel=3},
  142. },
  143. damage_groups = {fleshy=10},
  144. },
  145. sound = {breaks = "default_tool_breaks"},
  146. groups = {dig_immediate=3},
  147. -- CAIXA DE COLISÃO :
  148. paramtype2 = "facedir",
  149. selection_box = {
  150. type = "fixed", -- fica no formato da caixa se ajustado
  151. fixed = {
  152. {-0.4, -0.4, -0.4, 0.4, 0.4, 0.4},
  153. },
  154. },
  155. })