56 lines
1.1 KiB
Lua
Executable File
56 lines
1.1 KiB
Lua
Executable File
-- Basic NPC
|
|
-- Wander around and says random things
|
|
|
|
-- Translator
|
|
local S = mobs.translator
|
|
|
|
|
|
-- Mod related infos
|
|
local modname = minetest.get_current_modname()
|
|
local modpath = minetest.get_modpath(modname)
|
|
|
|
mob_name="npc"
|
|
|
|
--
|
|
-- Specific mob informations
|
|
--
|
|
|
|
local mob_id = modname..':'..mob_name
|
|
|
|
-- Get base defintion
|
|
local mob_def = mobs.npcs.base_def
|
|
|
|
-- Get textures
|
|
local textures = mobs.npcs.get_textures_array("character_lambda_",modname)
|
|
if textures then mob_def.textures = textures end
|
|
|
|
-- Set specific interactions (say something)
|
|
|
|
-- Basic npc don't not fight
|
|
mob_def.runaway = true
|
|
|
|
--
|
|
-- Register Npc
|
|
--
|
|
mobs:register_mob(mob_id, mob_def)
|
|
|
|
--
|
|
-- Register Spawn condition and egg
|
|
--
|
|
|
|
-- Get base definition for spawn conditions
|
|
local mob_spawndef = mobs.npcs.base_spawndef
|
|
|
|
-- Add specific infos
|
|
mob_spawndef.name = mob_id
|
|
|
|
-- Regiser spawn
|
|
mobs:spawn(mob_spawndef)
|
|
|
|
-- Register egg
|
|
mobs:register_egg(mob_id, "npc", "character_lambda_inv.png", 0)
|
|
--~ mobs:doc_identifier_compat(mob_id, longdesc, usagehelp)
|
|
|
|
mobs:alias_mob("mobs:"..mob_name, mob_id) -- compatibility
|
|
|