dm.lua 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. mobs.register_mob("dm:dm", {
  2. description = "Dungeon Master",
  3. type = "monster",
  4. passive = false,
  5. damage = 4*500,
  6. damage_group = "crush",
  7. armor_level = 3,
  8. attack_type = "dogshoot",
  9. specific_allies = {
  10. ["griefer:griefer"] = true,
  11. ["griefer:elite_griefer"] = true,
  12. },
  13. dogshoot_switch = 1,
  14. dogshoot_count_max = 10,
  15. reach = 3,
  16. shoot_interval = 2.5,
  17. attack_animals = true,
  18. arrow = "dm:fireball",
  19. shoot_offset = 1,
  20. hp_min = 12*500,
  21. hp_max = 32*500,
  22. armor = 60,
  23. collisionbox = {-0.7, -1, -0.7, 0.7, 1.6, 0.7},
  24. visual = "mesh",
  25. mesh = "dm_dm.b3d",
  26. textures = {
  27. {"dm_dm1.png"},
  28. {"dm_dm2.png"},
  29. {"dm_dm3.png"},
  30. },
  31. makes_footstep_sound = true,
  32. sounds = {
  33. random = "dm_dm",
  34. shoot_attack = "dm_fireball",
  35. death = "dm_die",
  36. },
  37. walk_velocity = 1,
  38. run_velocity = 3,
  39. jump = true,
  40. view_range = 30,
  41. drops = {
  42. {name = "default:mese_crystal_fragment", chance = 1, min = 1, max = 5},
  43. {name = "default:diamond", chance = 5, min = 1, max = 5},
  44. {name = "default:mese_crystal", chance = 4, min = 1, max = 3},
  45. {name = "default:diamondblock", chance = 30, min = 1, max = 3},
  46. {name = "default:mese", chance = 30, min = 1, max = 4},
  47. },
  48. water_damage = 5*500,
  49. lava_damage = 1*500,
  50. light_damage = 0,
  51. fear_height = 3,
  52. animation = {
  53. stand_start = 0,
  54. stand_end = 19,
  55. walk_start = 20,
  56. walk_end = 35,
  57. punch_start = 36,
  58. punch_end = 48,
  59. shoot_start = 36,
  60. shoot_end = 48,
  61. speed_normal = 15,
  62. speed_run = 15,
  63. },
  64. makes_bones_in_lava = false,
  65. })
  66. mobs.register_arrow("dm:fireball", {
  67. visual = "sprite",
  68. visual_size = {x = 1, y = 1},
  69. textures = {"dm_fireball.png"},
  70. velocity = 8,
  71. -- Direct hit, no fire ... just plenty of pain.
  72. hit_player = function(self, player)
  73. armor.notify_punch_reason({reason="fireball"})
  74. player:punch(self.object, 1.0, {
  75. full_punch_interval = 1.0,
  76. damage_groups = {fireball = 8*500},
  77. }, nil)
  78. end,
  79. hit_mob = function(self, player)
  80. local puncher
  81. if self.owner_obj and self.owner_obj:get_pos() then
  82. puncher = self.owner_obj
  83. else
  84. puncher = self.object
  85. end
  86. player:punch(puncher, 1.0, {
  87. full_punch_interval = 1.0,
  88. damage_groups = {fireball = 8*500},
  89. }, nil)
  90. end,
  91. -- Node hit, bursts into flame.
  92. hit_node = function(self, pos, node)
  93. -- The tnt explosion function respects protection perfectly (MustTest).
  94. tnt.boom(pos, {
  95. radius = 2,
  96. ignore_protection = false,
  97. ignore_on_blast = false,
  98. damage_radius = 3,
  99. disable_drops = true,
  100. mob = "dm:dm", -- Launched by this mob type. Thus blast will not damage mobs of this type.
  101. })
  102. end
  103. })
  104. mobs.register_egg("dm:dm", "Dungeon Master", "fire_basic_flame.png", 1, true)
  105. mobs.alias_mob("mobs:dungeon_master", "dm:dm")
  106. mobs.alias_mob("mobs_monster:dungeon_master", "dm:dm")