Epic/mods/epic/ocean_guard.lua

67 lines
1.6 KiB
Lua

mobs:register_mob('epic:ocean_guardian', {
type = 'monster',
passive = false,
attack_type = 'dogfight',
group_attack = true,
reach = 3,
damage = 16,
hp_min = 200,
hp_max = 300,
armor = 20,
view_range = 7,
stepheight = 0.2,
collisionbox = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
visual = 'mesh',
mesh = 'epic_guardians.b3d',
textures = {
{'epic_guardians.png'},
},
visual_size = {x=9, y=9},
walk_velocity = 1,
run_velocity = 3,
fly = true,
stand_chance = 0,
fly_in = 'default:water_source',
stay_near = {'ocean:sea_lantern', 10},
drops = {
{name = 'ocean:prismarine_crystals', chance = 10, min = 0, max = 3,},
{name = 'ocean:prismarine_shard', chance = 10, min = 0, max = 4,},
{name = 'epic:trident', chance = 200, min = 1, max = 1,}
},
immune_to = {{'epic:trident', 20},},
lava_damage = 15,
light_damage = 0,
fall_damage = 0,
fear_height = 5,
animation = {
speed_normal = 15,
speed_fly = 10,
stand_start = 0,
stand_end = 60,
fly_start = 0,
fly_end = 60,
punch_start = 65,
punch_end = 105,
},
do_custom = function(self, dtime)
self.dtime = (self.dtime or 0) + dtime
if self.dtime < 5 then
return
end
if self.standing_in ~= 'default:water_source' then
self.health = self.health - 10
end
self.dtime = 0
end,
})
mobs:spawn({
name = 'epic:ocean_guardian',
nodes = {'default:water_source', 'default:water_flowing'},
neighbors = {'ocean:sea_lantern', 'ocean:prismarine'},
min_height = -50,
max_height = 0,
interval = 10,
chance = 100,
})