hobbits.lua 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. function lottmobs.register_hobbit(n, hpmin, hpmax, textures, wv, rv, damg, arm, drops, price)
  2. mobs:register_mob("lottmobs:hobbit"..n, {
  3. type = "npc",
  4. race = "GAMEhobbit",
  5. hp_min = hpmin,
  6. hp_max = hpmax,
  7. collisionbox = {-0.3,-0.75,-0.3, 0.3,0.7,0.3},
  8. textures = textures,
  9. visual = "mesh",
  10. mesh = "lottarmor_character.b3d",
  11. view_range = 12,
  12. visual_size = {x=1, y=0.75},
  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 = 1,
  22. lava_damage = 5,
  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", "Hobbit", "hobbit", 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:hobbit"..n, {"lottmapgen:shire_grass"}, 20, -1, 6000, 3, 31000)
  55. lottmobs.register_guard_craftitem("lottmobs:hobbit"..n, "Hobbit Guard", "lottmobs_hobbit_guard"..n.."_inv.png")
  56. end
  57. local drops = {
  58. {name = "lottfarming:pipeweed_cooked",
  59. chance = 5,
  60. min = 1,
  61. max = 5,},
  62. {name = "lottfarming:pipe",
  63. chance = 20,
  64. min = 1,
  65. max = 1,},
  66. {name = "lottweapons:steel_dagger",
  67. chance = 100,
  68. min = 1,
  69. max = 1,},
  70. }
  71. --Normal Hobbits
  72. local textures1 = {
  73. {"lottmobs_hobbit_1.png", "lottarmor_trans.png", "lottarmor_trans.png", "lottarmor_trans.png", "lottarmor_trans.png"},
  74. {"lottmobs_hobbit_2.png", "lottarmor_trans.png", "lottarmor_trans.png", "lottarmor_trans.png", "lottarmor_trans.png"},
  75. {"lottmobs_hobbit_3.png", "lottarmor_trans.png", "lottarmor_trans.png", "lottarmor_trans.png", "lottarmor_trans.png"},
  76. }
  77. lottmobs.register_hobbit("", 20, 30, textures1, 2, 4, 5, 175, drops, 20)
  78. --Hobbits with mithril or galvorn armor and mithril daggers.
  79. local textures2 = {
  80. {"lottmobs_hobbit_1.png", "lottarmor_chestplate_galvorn.png", "lottweapons_mithril_dagger.png", "lottarmor_trans.png"},
  81. {"lottmobs_hobbit_2.png", "lottarmor_chestplate_mithril.png", "lottweapons_mithril_dagger.png", "lottarmor_trans.png"},
  82. {"lottmobs_hobbit_3.png", "lottarmor_chestplate_mithril.png^lottarmor_shield_galvorn.png", "lottweapons_mithril_dagger.png", "lottarmor_trans.png"},
  83. }
  84. lottmobs.register_hobbit("1", 30, 40, textures2, 2.75, 3.5, 9, 75, drops, 60)
  85. --Hobbits with steel armor & swords.
  86. local textures3 = {
  87. {"lottmobs_hobbit_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"},
  88. {"lottmobs_hobbit_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"},
  89. {"lottmobs_hobbit_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"},
  90. }
  91. lottmobs.register_hobbit("2", 25, 25, textures3, 2.5, 3.5, 7, 100, drops, 50)