34 lines
952 B
Lua
34 lines
952 B
Lua
|
function fl_brains.villager_brain(self)
|
||
|
if mobkit.timer(self,1) then fl_wildlife.node_dps_dmg(self) end --if in nodes with damage take damage
|
||
|
mobkit.vitals(self)
|
||
|
|
||
|
if self.hp <= 0 then --kill self if 0 hp
|
||
|
local item_drops = fl_wildlife.drops(self.drops)
|
||
|
if item_drops ~= nil then
|
||
|
for _, i in pairs(item_drops) do
|
||
|
minetest.add_item(mobkit.get_stand_pos(self), i)
|
||
|
end
|
||
|
end
|
||
|
|
||
|
mobkit.clear_queue_high(self)
|
||
|
fl_wildlife.hq_die(self)
|
||
|
return
|
||
|
end
|
||
|
|
||
|
if mobkit.timer(self,1) then
|
||
|
local prty = mobkit.get_queue_priority(self)
|
||
|
|
||
|
if prty < 20 and self.isinliquid then
|
||
|
mobkit.hq_liquid_recovery(self,20)
|
||
|
return
|
||
|
end
|
||
|
|
||
|
if mobkit.is_queue_empty_high(self) then
|
||
|
--mobkit.animate(self, "walk")
|
||
|
mobkit.hq_roam(self,0)
|
||
|
--fl_wildlife.hq_npc_roam(self, 0)
|
||
|
end
|
||
|
|
||
|
end
|
||
|
|
||
|
end
|