dwarves.lua 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. function lottmobs.register_dwarf(n, hpmin, hpmax, textures, wv, rv, damg, arm, drops, price)
  2. mobs:register_mob("lottmobs:dwarf" .. n, {
  3. type = "npc",
  4. race = "GAMEdwarf",
  5. hp_min = hpmin,
  6. hp_max = hpmax,
  7. collisionbox = {-0.3,-.85,-0.3, 0.3,0.68,0.3},
  8. textures = textures,
  9. visual = "mesh",
  10. visual_size = {x=1.1, y=0.85},
  11. mesh = "lottarmor_character.b3d",
  12. view_range = 12,
  13. makes_footstep_sound = true,
  14. walk_velocity = wv,
  15. run_velocity = rv,
  16. armor = arm,
  17. damage = damg,
  18. drops = drops,
  19. light_resistant = true,
  20. drawtype = "front",
  21. water_damage = 0,
  22. lava_damage = 10,
  23. light_damage = 0,
  24. attack_type = "dogfight",
  25. follow = "lottother:narya",
  26. animation = {
  27. speed_normal = 15,
  28. speed_run = 15,
  29. stand_start = 0,
  30. stand_end = 79,
  31. walk_start = 168,
  32. walk_end = 187,
  33. run_start = 168,
  34. run_end = 187,
  35. punch_start = 189,
  36. punch_end = 198,
  37. },
  38. jump = true,
  39. sounds = {
  40. war_cry = "mobs_die_yell",
  41. death = "default_death",
  42. attack = "default_punch2",
  43. },
  44. attacks_monsters = true,
  45. on_rightclick = function(self, clicker)
  46. lottmobs.guard(self, clicker, "default:gold_ingot", "Dwarf", "dwarf", price)
  47. end,
  48. do_custom = lottmobs.do_custom_guard,
  49. peaceful = true,
  50. group_attack = true,
  51. step = 1,
  52. on_die = lottmobs.guard_die,
  53. })
  54. mobs:register_spawn("lottmobs:dwarf" .. n, {"default:stone_with_iron"}, 15, -1, 24000, 3, -10)
  55. mobs:register_spawn("lottmobs:dwarf" .. n, {"default:stone_with_coal"}, 15, -1, 24000, 3, -10)
  56. mobs:register_spawn("lottmobs:dwarf" .. n, {"lottmapgen:ironhill_grass"}, 20, -1, 18000, 3, 31000)
  57. lottmobs.register_guard_craftitem("lottmobs:dwarf"..n, "Dwarf Guard", "lottmobs_dwarf_guard"..n.."_inv.png")
  58. end
  59. --Normal Dwarves
  60. local textures1 = {
  61. {"lottmobs_dwarf_1.png", "lottarmor_trans.png", "lottarmor_trans.png", "lottarmor_trans.png", "lottarmor_trans.png"},
  62. {"lottmobs_dwarf_2.png", "lottarmor_trans.png", "lottarmor_trans.png", "lottarmor_trans.png", "lottarmor_trans.png"},
  63. {"lottmobs_dwarf_3.png", "lottarmor_trans.png", "lottarmor_trans.png", "lottarmor_trans.png", "lottarmor_trans.png"},
  64. }
  65. local drops1 = {
  66. {name = "default:iron_lump",
  67. chance = 3,
  68. min = 1,
  69. max = 7,},
  70. {name = "default:copper_lump",
  71. chance = 4,
  72. min = 1,
  73. max = 4,},
  74. {name = "default:iron_ingot",
  75. chance = 3,
  76. min = 1,
  77. max = 7,},
  78. {name = "lottores:tin_lump",
  79. chance = 8,
  80. min = 1,
  81. max = 2,},
  82. {name = "default:copper_lump",
  83. chance = 8,
  84. min = 1,
  85. max = 2,},
  86. {name = "default:bronze_ingot",
  87. chance = 5,
  88. min = 1,
  89. max = 6,},
  90. {name = "lottores:mithril_lump",
  91. chance = 50,
  92. min = 1,
  93. max = 3,},
  94. }
  95. lottmobs.register_dwarf("", 20, 30, textures1, 2, 4, 5, 175, drops1, 30)
  96. --Dwarves with mithril armor & warhammers.
  97. local textures2 = {
  98. {"lottmobs_dwarf_1.png", "lottarmor_helmet_mithril.png^lottarmor_chestplate_mithril.png^lottarmor_leggings_mithril.png^lottarmor_boots_mithril.png^lottarmor_shield_mithril.png", "lottweapons_mithril_warhammer.png", "lottarmor_trans.png"},
  99. {"lottmobs_dwarf_2.png", "lottarmor_helmet_mithril.png^lottarmor_chestplate_mithril.png^lottarmor_leggings_mithril.png^lottarmor_boots_mithril.png^lottarmor_shield_mithril.png", "lottweapons_mithril_warhammer.png", "lottarmor_trans.png"},
  100. {"lottmobs_dwarf_3.png", "lottarmor_helmet_mithril.png^lottarmor_chestplate_mithril.png^lottarmor_leggings_mithril.png^lottarmor_boots_mithril.png^lottarmor_shield_mithril.png", "lottweapons_mithril_warhammer.png", "lottarmor_trans.png"},
  101. }
  102. local drops2 = {
  103. {name = "default:iron_lump",
  104. chance = 3,
  105. min = 1,
  106. max = 7,},
  107. {name = "default:copper_lump",
  108. chance = 4,
  109. min = 1,
  110. max = 4,},
  111. {name = "default:iron_ingot",
  112. chance = 3,
  113. min = 1,
  114. max = 7,},
  115. {name = "lottores:tin_lump",
  116. chance = 8,
  117. min = 1,
  118. max = 2,},
  119. {name = "default:copper_lump",
  120. chance = 8,
  121. min = 1,
  122. max = 2,},
  123. {name = "default:bronze_ingot",
  124. chance = 5,
  125. min = 1,
  126. max = 6,},
  127. {name = "lottores:mithril_lump",
  128. chance = 50,
  129. min = 1,
  130. max = 3,},
  131. }
  132. lottmobs.register_dwarf("1", 30, 40, textures2, 2.75, 3.5, 13, 75, drops2, 60)
  133. --Dwarves with steel armor & swords.
  134. local textures3 = {
  135. {"lottmobs_dwarf_1.png", "lottarmor_helmet_steel.png^lottarmor_chestplate_steel.png^lottarmor_leggings_steel.png^lottarmor_boots_steel.png^lottarmor_shield_steel.png", "default_tool_steelsword.png", "lottarmor_trans.png"},
  136. {"lottmobs_dwarf_2.png", "lottarmor_helmet_steel.png^lottarmor_chestplate_steel.png^lottarmor_leggings_steel.png^lottarmor_boots_steel.png^lottarmor_shield_steel.png", "default_tool_steelsword.png", "lottarmor_trans.png"},
  137. {"lottmobs_dwarf_3.png", "lottarmor_helmet_steel.png^lottarmor_chestplate_steel.png^lottarmor_leggings_steel.png^lottarmor_boots_steel.png^lottarmor_shield_steel.png", "default_tool_steelsword.png", "lottarmor_trans.png"},
  138. }
  139. local drops3 = {
  140. {name = "default:iron_lump",
  141. chance = 3,
  142. min = 1,
  143. max = 7,},
  144. {name = "default:copper_lump",
  145. chance = 4,
  146. min = 1,
  147. max = 4,},
  148. {name = "default:iron_ingot",
  149. chance = 3,
  150. min = 1,
  151. max = 7,},
  152. {name = "lottores:tin_lump",
  153. chance = 8,
  154. min = 1,
  155. max = 2,},
  156. {name = "default:copper_lump",
  157. chance = 8,
  158. min = 1,
  159. max = 2,},
  160. {name = "default:bronze_ingot",
  161. chance = 5,
  162. min = 1,
  163. max = 6,},
  164. {name = "lottores:mithril_lump",
  165. chance = 50,
  166. min = 1,
  167. max = 3,},
  168. }
  169. lottmobs.register_dwarf("2", 25, 25, textures3, 2.5, 3.5, 7, 100, drops3, 50)