init.lua 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  1. if minetest.get_modpath("3d_armor") then
  2. armor:register_armor("skullkingsitems:helmet_skullking", {
  3. description = ("Skull King crown "),
  4. inventory_image = "skullkingsitems_inv_helmet_skullking.png",
  5. groups = {
  6. armor_head=1,
  7. armor_heal=14,
  8. armor_use=200,
  9. physics_speed=1,
  10. --armor_fire=1,
  11. },
  12. armor_groups = {fleshy=17},
  13. damage_groups = {cracky=2, snappy=1, level=4},
  14. })
  15. end
  16. -- HUMMER
  17. minetest.register_node("skullkingsitems:hammer", {
  18. description = "Skull Kings Hammer",
  19. drawtype = "mesh",
  20. mesh = "skull_king_deep_hummer.obj",
  21. tiles = {"skull_king_deep.png"} ,
  22. wield_scale = {x=2, y=2, z=2},
  23. --inventory_image = "skull_king_deep.png",
  24. tool_capabilities = {
  25. full_punch_interval = 0.5,
  26. max_drop_level=1,
  27. groupcaps={
  28. snappy={times={[1]=1.50, [2]=0.60, [3]=0.30}, uses=100, maxlevel=3},
  29. cracky = {times={[1]=1.90, [2]=0.90, [3]=0.40}, uses=100, maxlevel=3},
  30. },
  31. damage_groups = {fleshy=10},
  32. },
  33. sound = {breaks = "default_tool_breaks"},
  34. groups = {sword = 1,pickaxe = 1,dig_immediate=3},
  35. -- CAIXA DE COLISÃO :
  36. paramtype2 = "facedir",
  37. selection_box = {
  38. type = "fixed", -- fica no formato da caixa se ajustado
  39. fixed = {
  40. {-0.32, -0.5, -0.3, 0.95, 1.05, 0.3},
  41. },
  42. },
  43. })
  44. -- TROFEU : ----------------------------------------------------------------------------
  45. -- == MESE LORD ==
  46. minetest.register_node("skullkingsitems:meselord_trophy", {
  47. description = "Mese Lord Trophy",
  48. drawtype = "mesh",
  49. mesh = "mese_lord_tro.obj",
  50. tiles = {"mese_lord_tro.png"} ,
  51. wield_scale = {x=1, y=1, z=1},
  52. groups = {dig_immediate=3},
  53. -- CAIXA DE COLISÃO :
  54. paramtype2 = "facedir",
  55. selection_box = {
  56. type = "fixed", -- fica no formato da caixa se ajustado
  57. fixed = {
  58. {-0.5, -0.5, -0.25, 0.5, 0.5, 0.5},
  59. },
  60. },
  61. })
  62. -- === GOLEM ===
  63. minetest.register_node("skullkingsitems:golem_trophy", {
  64. description = "Golem Trophy",
  65. drawtype = "mesh",
  66. mesh = "golem_tro.obj",
  67. tiles = {"golem_tro.png"} ,
  68. wield_scale = {x=1, y=1, z=1},
  69. groups = {dig_immediate=3},
  70. -- CAIXA DE COLISÃO :
  71. paramtype2 = "facedir",
  72. selection_box = {
  73. type = "fixed", -- fica no formato da caixa se ajustado
  74. fixed = {
  75. {-0.5, -0.5, -0.25, 0.5, 0.5, 0.5},
  76. },
  77. },
  78. })
  79. -- === SKULL KING ===
  80. minetest.register_node("skullkingsitems:skullking_trophy", {
  81. description = "Skull King Trophy",
  82. drawtype = "mesh",
  83. mesh = "skull_king_deep_tro.obj",
  84. tiles = {"skull_king_deep_tro.png"} ,
  85. wield_scale = {x=1, y=1, z=1},
  86. groups = {dig_immediate=3},
  87. -- CAIXA DE COLISÃO :
  88. paramtype2 = "facedir",
  89. selection_box = {
  90. type = "fixed", -- fica no formato da caixa se ajustado
  91. fixed = {
  92. {-0.5, -0.5, -0.25, 0.5, 0.5, 0.5},
  93. },
  94. },
  95. })
  96. ---- ITENS ------------------------------------------------------------------------------
  97. minetest.register_craftitem("skullkingsitems:bone", {
  98. description = "Skull Bone",
  99. inventory_image = "bonex.png",
  100. })
  101. minetest.register_craft({
  102. type = "shapeless",
  103. output = "dye:white 3",
  104. recipe = {
  105. "skullkingsitems:bone",
  106. },
  107. })
  108. -- COMPATIBILIDADE COM BONEMEAL
  109. if minetest.get_modpath("bonemeal") then
  110. minetest.register_craft({
  111. type = "shapeless",
  112. output = "bonemeal:bonemeal",
  113. recipe = {
  114. "skulls:bone",
  115. },
  116. })
  117. end
  118. -- == CURA ==
  119. -- Sound : https://freesound.org/people/craigglenday/sounds/517173/
  120. minetest.register_craftitem("skullkingsitems:healing", {
  121. description = "Healing ",
  122. inventory_image = "elixi.png",
  123. groups = {vessel = 1},
  124. on_use = function(itemstack, user, pointed_thing,pos) -- função para recuperar vida simples
  125. local hp = user:get_hp() -- usuario consegue o valor atual de sua vida
  126. if hp ~= 20 then -- comparando vida
  127. user:set_hp(hp + 5) -- atribuindo mais 5 de vida
  128. --itemstack:take_item( )
  129. end
  130. minetest.sound_play("bebendo", {
  131. pos = pos,
  132. gain = 1.0,
  133. max_hear_distance = 5,
  134. })
  135. local pos = user:getpos()
  136. for i=1,30 do
  137. minetest.add_particle({
  138. pos = pos,
  139. acceleration = 0,
  140. velocity = {x =math.random(-3,3),y=math.random(-3,3),z=math.random(-3,3)},
  141. -- x ou y ,ou z = random (-3 right , 3 left )
  142. size = 2,
  143. expirationtime = 2.0,
  144. collisiondetection = false,
  145. vertical = false,
  146. texture = "cura.png",
  147. glow = 8,
  148. })
  149. end
  150. return "vessels:glass_bottle"
  151. end
  152. })
  153. minetest.register_craft({
  154. output = "skullkingsitems:healing",
  155. recipe = {
  156. {"", "default:mese_crystal_fragment", ""},
  157. {"hungry:hungry_sheet", "default:apple", "hungry:hungry_sheet"},
  158. {"", "vessels:glass_bottle", ""}
  159. }
  160. })
  161. -- == BLOCO ===
  162. -- BLOCO DE OSSO ( INUTIL XD )
  163. minetest.register_node("skullkingsitems:bone_block", {
  164. description = "Bone Block",
  165. tiles = {"osso_bloco.png"},
  166. groups = {cracky = 2},
  167. drop = "skulls:bone_block",
  168. sounds = default.node_sound_stone_defaults(),
  169. })
  170. minetest.register_craft({
  171. output = "skullkingsitems:bone_block",
  172. recipe = {
  173. {"skullkingsitems:bone", "skullkingsitems:bone", "skullkingsitems:bone"},
  174. {"skullkingsitems:bone", "skullkingsitems:bone", "skullkingsitems:bone"},
  175. {"skullkingsitems:bone", "skullkingsitems:bone", "skullkingsitems:bone"},
  176. }
  177. })
  178. -- CONQUISTAS :
  179. awards.register_award("first boss", {
  180. title = "First Boss , Mese Lord ",
  181. description = "Kill the first boss, get the trophy, and place it on your wall..",
  182. icon = "mese_lord_award.png",
  183. background = "awards_bg_mining.png",
  184. -- requires = {""},
  185. -- prizes = {""} ,
  186. trigger = {
  187. type = "place",
  188. node = "skullkingsitems:meselord_trophy",
  189. target = 1
  190. }
  191. })
  192. awards.register_award("boss 2", {
  193. title = "Golem Boss",
  194. description = "Defeat the Golem Boss, get the trophy, and place it on your wall...",
  195. icon = "golem_award.png",
  196. background = "awards_bg_mining.png",
  197. -- requires = {""},
  198. -- prizes = {""} ,
  199. trigger = {
  200. type = "place",
  201. node = "skullkingsitems:golem_trophy",
  202. target = 1
  203. }
  204. })
  205. awards.register_award("boss 3", {
  206. title = "Skull King Boss",
  207. description = "Defeat the Skull King Boss, get the trophy, and place it on your wall...",
  208. icon = "skullking_award.png",
  209. background = "awards_bg_mining.png",
  210. -- requires = {""},
  211. -- prizes = {""} ,
  212. trigger = {
  213. type = "place",
  214. node = "skullkingsitems:skullking_trophy",
  215. target = 1
  216. }
  217. })