murdertusk.lua 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. local function murdertusk_despawn(self)
  2. local pos = vector.round(self.object:get_pos())
  3. local nodeabove = minetest.get_node_or_nil(pos)
  4. local nodeunder = minetest.get_node_or_nil(vector.offset(pos, 0, -1, 0))
  5. if nodeabove and nodeunder then
  6. if nodeabove.name == "air" and nodeunder.name ~= "air" then
  7. minetest.set_node(pos, {name="default:dry_grass_" .. math.random(1, 5), param2=2})
  8. minetest.check_for_falling(pos)
  9. end
  10. end
  11. -- Mark object for removal by the mob API.
  12. self.mkrm = true
  13. end
  14. -- Warthog by KrupnoPavel. Modified for Enyekala by MustTest.
  15. mobs.register_mob("animalworld:murdertusk", {
  16. stepheight = 2,
  17. type = "animal",
  18. description = "Murdertusk",
  19. passive = false,
  20. attack_type = "dogfight",
  21. group_attack = true,
  22. attack_players = true,
  23. attack_npcs = false,
  24. pathfinding = 1,
  25. reach = 2,
  26. damage = 10*500,
  27. damage_group = "snappy",
  28. hp_min = 20*500,
  29. hp_max = 40*500,
  30. armor = 50,
  31. collisionbox = {-0.5, -0.01, -0.5, 0.5, 0.95, 0.5},
  32. visual = "mesh",
  33. mesh = "mobs_pumba.b3d",
  34. visual_size = {x = 1.2, y = 1.2},
  35. textures = {
  36. {"animalworld_suboar2.png"},
  37. },
  38. sounds = {
  39. random = "animalworld_suboar",
  40. attack = "animalworld_suboar",
  41. },
  42. makes_footstep_sound = true,
  43. walk_velocity = 1.5,
  44. run_velocity = 3.5,
  45. jump = true,
  46. drops = {
  47. {name = "mobs:meat_raw_pork", chance = 2, min = 1, max = 1},
  48. {name = "mobs:leather", chance = 10, min = 1, max = 1},
  49. },
  50. water_damage = 0,
  51. lava_damage = 4*500,
  52. light_damage = 0,
  53. fear_height = 3,
  54. animation = {
  55. speed_normal = 15,
  56. stand_start = 25,
  57. stand_end = 55,
  58. walk_start = 70,
  59. walk_end = 100,
  60. run_start = 70,
  61. run_end = 100,
  62. run_speed = 30,
  63. punch_start = 70,
  64. punch_end = 100,
  65. },
  66. view_range = 50,
  67. makes_bones_in_lava = true,
  68. daytime_despawn = true,
  69. on_despawn = murdertusk_despawn,
  70. })
  71. mobs.register_egg("animalworld:murdertusk", "Murdertusk", "default_dirt.png", 1)