115 lines
3.1 KiB
Lua
Executable File
115 lines
3.1 KiB
Lua
Executable File
--
|
|
-- This file contains base définition used to most npcs
|
|
--
|
|
|
|
-- Translator
|
|
local S = mobs.translator
|
|
|
|
local modname = minetest.get_current_modname()
|
|
local modpath = minetest.get_modpath(modname)
|
|
|
|
if not mobs.npcs then mobs.npcs = {} end
|
|
|
|
mobs.npcs.base_def = {
|
|
|
|
-- Base NPC looks like players
|
|
-- -- Most values are from player api
|
|
type = "npc",
|
|
visual = "mesh",
|
|
mesh = "character.b3d",
|
|
textures = {"character.png", },
|
|
collisionbox = {-0.3, 0.0, -0.3, 0.3, 1.7, 0.3},
|
|
|
|
animation = {
|
|
|
|
speed_normal = 20, speed_run = 32, run_speed = 32,
|
|
stand_start = 0, stand_end = 79,
|
|
sit_start = 81, sit_end = 160,
|
|
-- stand2_start = 81, stand2_end = 160, -- sit
|
|
lay_start = 162, lay_end = 166,
|
|
walk_start = 168, walk_end = 187,
|
|
mine_start = 189, mine_end = 198,
|
|
walk_mine_start = 200, walk_mine__end = 119,
|
|
punch_start = 200, punch_end = 119, -- walk_mine
|
|
-- punch2_start = 200, punch2_end = 119, -- walk_mine
|
|
-- shoot_start = 200, shoot_end = 119, -- walk_mine
|
|
run_start = 221, run_end = 241, -- ??
|
|
|
|
die_start = 162, die_end = 166, -- lay
|
|
die_loop = true, die_speed = 28,
|
|
},
|
|
|
|
makes_footstep_sound = true,
|
|
--~ sounds = {
|
|
--~ -- random = "mobs_zombie.1",
|
|
--~ -- war_cry = "mobs_zombie.3",
|
|
--~ -- attack = "mobs_zombie.2",
|
|
--~ -- damage = "mobs_zombie_hit",
|
|
--~ -- death = "mobs_zombie_death",
|
|
--~ },
|
|
|
|
-- NPC aren't made to be fighters
|
|
-- killing them should be either very discouraged or very boring
|
|
hp_min = 12,
|
|
hp_max = 35,
|
|
armor = 200,
|
|
knock_back = 1,
|
|
lava_damage = 10,
|
|
damage = 4,
|
|
reach = 1,
|
|
attack_type = "dogfight",
|
|
group_attack = true,
|
|
view_range = 10,
|
|
-- stand_chance = 14,
|
|
walk_chance = 74,
|
|
walk_velocity = 1,
|
|
run_velocity = 2.2,
|
|
fear_height = 3,
|
|
jump = true,
|
|
stepheight = 1.3,
|
|
jump_height = 1.1,
|
|
-- fly_in = {"default:water_source", "default:water_flowing", "default:river_water_source", "default:river_water_flowing"},
|
|
-- floats = 0,
|
|
--~ drops = {
|
|
--~ {name = "mobs:rotten_flesh", chance = 6, min = 1, max = 3,}
|
|
--~ },
|
|
lifetimer = 180, -- 3 minutes
|
|
shoot_interval = 135, -- (lifetimer - (lifetimer / 4)), borrowed from do_custom time
|
|
|
|
-- Default right click is to look at player and says something
|
|
on_rightclick = function(self, clicker)
|
|
-- Look at the player
|
|
mobs.npcs.turn_to_player( self, clicker )
|
|
-- Say something
|
|
local mobname = mobs.npcs.get_mobname(self)
|
|
local clickername = clicker:get_player_name()
|
|
local msg = mobs.npcs.messages.get_random()
|
|
mobs.npcs.send_chat_message(clickername,msg,mobname)
|
|
end
|
|
}
|
|
|
|
-- Spawning
|
|
-- -- This should be improved
|
|
-- -- Poeples are a bit like sheeps, you can find them were there is sun and grass or trees
|
|
|
|
local spawn_on = {"default:dirt_with_grass", "default:dirt_with_rainforest_litter",
|
|
"default:dirt_with_coniferous_litter", "ethereal:bamboo_dirt"}
|
|
-- local spawn_on = {"group:soil"}
|
|
|
|
mobs.npcs.base_spawndef = {
|
|
nodes = spawn_on,
|
|
neighbors = {"air"},
|
|
min_light = 2,
|
|
max_light = 10,
|
|
interval = 250,
|
|
chance = 20000,
|
|
active_object_count = 2,
|
|
min_height = 0,
|
|
max_height = 50,
|
|
day_toggle = true,
|
|
}
|
|
|
|
|
|
|
|
|