elves.lua 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. function lottmobs.register_elf(n, hpmin, hpmax, textures, wv, rv, damg, arm, drops, price)
  2. mobs:register_mob("lottmobs:elf" .. n, {
  3. type = "npc",
  4. race = "GAMEelf",
  5. hp_min = hpmin,
  6. hp_max = hpmax,
  7. collisionbox = {-0.3,-1.1,-0.3, 0.3,0.91,0.3},
  8. textures = textures,
  9. visual = "mesh",
  10. visual_size = {x=0.95, y=1.15},
  11. mesh = "lottarmor_character.b3d",
  12. view_range = 20,
  13. makes_footstep_sound = true,
  14. walk_velocity = wv,
  15. run_velocity = rv,
  16. damage = damg,
  17. armor = arm,
  18. drops = drops,
  19. light_resistant = true,
  20. drawtype = "front",
  21. water_damage = 1,
  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 = 20,
  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. sounds = {
  39. war_cry = "mobs_die_yell",
  40. death = "default_death",
  41. attack = "mobs_slash_attack",
  42. },
  43. attacks_monsters = true,
  44. on_rightclick = function(self, clicker)
  45. lottmobs.guard(self, clicker, "default:gold_ingot", "Elf", "elf", price)
  46. end,
  47. do_custom = lottmobs.do_custom_guard,
  48. peaceful = true,
  49. group_attack = true,
  50. step = 1,
  51. on_die = lottmobs.guard_die,
  52. })
  53. mobs:register_spawn("lottmobs:elf" .. n, {"lottmapgen:lorien_grass"}, 20, 0, 18000, 3, 31000)
  54. lottmobs.register_guard_craftitem("lottmobs:elf"..n, "Elven Guard", "lottmobs_elven_guard"..n.."_inv.png")
  55. end
  56. --Basic elves
  57. local textures1 = {
  58. {"lottmobs_lorien_elf_1.png", "lottarmor_trans.png", "lottarmor_trans.png", "lottarmor_trans.png"},
  59. {"lottmobs_lorien_elf_2.png", "lottarmor_trans.png", "lottarmor_trans.png", "lottarmor_trans.png"},
  60. {"lottmobs_lorien_elf_3.png", "lottarmor_trans.png", "lottarmor_trans.png", "lottarmor_trans.png"},
  61. }
  62. local drops1 = {
  63. {name = "lottplants:mallornsapling",
  64. chance = 5,
  65. min = 1,
  66. max = 3,},
  67. {name = "lottplants:mallornwood",
  68. chance = 5,
  69. min = 1,
  70. max = 6,},
  71. {name = "lottores:silveringot",
  72. chance = 20,
  73. min = 1,
  74. max = 7},
  75. {name = "lottores:silversword",
  76. chance = 20,
  77. min = 1,
  78. max = 1},
  79. {name = "lottarmor:helmet_silver",
  80. chance = 30,
  81. min = 1,
  82. max = 1},
  83. {name = "lottarmor:chestplate_silver",
  84. chance = 30,
  85. min = 1,
  86. max = 1},
  87. {name = "lottweapons:silver_spear",
  88. chance = 25,
  89. min = 1,
  90. max = 1,},
  91. {name = "lottores:blue_gem",
  92. chance = 200,
  93. min = 1,
  94. max = 1,},
  95. {name = "lottplants:yavannamiresapling",
  96. chance = 250,
  97. min = 1,
  98. max = 1,},
  99. {name = "lottores:mithril_lump",
  100. chance = 100,
  101. min = 1,
  102. max = 2,},
  103. }
  104. lottmobs.register_elf("", 20, 35, textures1, 2.5, 5, 4, 200, drops1, 30)
  105. --Elves in full armor
  106. local textures2 = {
  107. {"lottmobs_lorien_elf_1.png", "lottarmor_chestplate_galvorn.png^lottarmor_leggings_galvorn.png^lottarmor_helmet_galvorn.png^lottarmor_boots_galvorn.png", "lottores_galvornsword.png", "lottarmor_trans.png"},
  108. {"lottmobs_lorien_elf_2.png", "lottarmor_chestplate_steel.png^lottarmor_leggings_steel.png^lottarmor_helmet_steel.png^lottarmor_boots_steel.png^lottarmor_shield_steel.png", "lottweapons_steel_battleaxe.png", "lottarmor_trans.png"},
  109. {"lottmobs_lorien_elf_3.png", "lottarmor_chestplate_silver.png^lottarmor_leggings_silver.png^lottarmor_helmet_silver.png^lottarmor_boots_silver.png^lottarmor_shield_silver.png", "lottores_silversword.png", "lottarmor_trans.png"},
  110. }
  111. local drops2 = {
  112. {name = "lottplants:mallornsapling",
  113. chance = 5,
  114. min = 1,
  115. max = 3,},
  116. {name = "lottplants:mallornwood",
  117. chance = 5,
  118. min = 1,
  119. max = 6,},
  120. {name = "lottores:silveringot",
  121. chance = 20,
  122. min = 1,
  123. max = 7},
  124. {name = "lottores:silversword",
  125. chance = 20,
  126. min = 1,
  127. max = 1},
  128. {name = "lottarmor:helmet_silver",
  129. chance = 30,
  130. min = 1,
  131. max = 1},
  132. {name = "lottarmor:chestplate_silver",
  133. chance = 30,
  134. min = 1,
  135. max = 1},
  136. {name = "lottweapons:silver_spear",
  137. chance = 25,
  138. min = 1,
  139. max = 1,},
  140. {name = "lottores:blue_gem",
  141. chance = 200,
  142. min = 1,
  143. max = 1,},
  144. {name = "lottplants:yavannamiresapling",
  145. chance = 250,
  146. min = 1,
  147. max = 1,},
  148. {name = "lottores:mithril_lump",
  149. chance = 100,
  150. min = 1,
  151. max = 2,},
  152. }
  153. lottmobs.register_elf(1, 20, 35, textures2, 2, 4.5, 6, 100, drops2, 50)
  154. --Elves with chestplates and powerful weapons!
  155. local textures3 = {
  156. {"lottmobs_lorien_elf_1.png", "lottarmor_chestplate_galvorn.png", "lottweapons_elven_sword.png", "lottarmor_trans.png"},
  157. {"lottmobs_lorien_elf_2.png", "lottarmor_chestplate_gold.png^lottarmor_shield_gold.png", "lottweapons_gold_spear.png", "lottarmor_trans.png"},
  158. {"lottmobs_lorien_elf_3.png", "lottarmor_shield_steel.png", "lottweapons_steel_warhammer.png", "lottarmor_trans.png"},
  159. }
  160. local drops3 = {
  161. {name = "lottplants:mallornsapling",
  162. chance = 5,
  163. min = 1,
  164. max = 3,},
  165. {name = "lottplants:mallornwood",
  166. chance = 5,
  167. min = 1,
  168. max = 6,},
  169. {name = "lottores:silveringot",
  170. chance = 20,
  171. min = 1,
  172. max = 7},
  173. {name = "lottores:silversword",
  174. chance = 20,
  175. min = 1,
  176. max = 1},
  177. {name = "lottarmor:helmet_silver",
  178. chance = 30,
  179. min = 1,
  180. max = 1},
  181. {name = "lottarmor:chestplate_silver",
  182. chance = 30,
  183. min = 1,
  184. max = 1},
  185. {name = "lottweapons:silver_spear",
  186. chance = 25,
  187. min = 1,
  188. max = 1,},
  189. {name = "lottores:blue_gem",
  190. chance = 200,
  191. min = 1,
  192. max = 1,},
  193. {name = "lottplants:yavannamiresapling",
  194. chance = 250,
  195. min = 1,
  196. max = 1,},
  197. {name = "lottores:mithril_lump",
  198. chance = 100,
  199. min = 1,
  200. max = 2,},
  201. }
  202. lottmobs.register_elf(2, 20, 35, textures3, 2.25, 4.75, 8, 150, drops3, 50)