Update 'npc.lua'

This commit is contained in:
thunderdog1138 2021-01-22 23:04:59 +00:00
parent cab784a615
commit e1dc0a9ae7
1 changed files with 16 additions and 106 deletions

122
npc.lua
View File

@ -8,111 +8,15 @@ mobs.npc_drops = {
"default:shovel_steel", "farming:bread", "bucket:bucket_water" "default:shovel_steel", "farming:bread", "bucket:bucket_water"
} }
human = { local skin_ran = math.random (1, 5) -- random number from 1 to 5
skins = {} local eyes_ran = math.random (1, 3)
} local shoes_ran = math.random (1, 2)
local pants_ran = math.random (1, 2)
local shirt_ran = math.random (1, 4)
local hair_ran = math.random (1, 4)
--Skin gen local human_male_skin="human_skin-"..skin_ran..".png"^"human_eyes_male-"..eyes_ran..".png"^"shoes-"..shoes_ran..".png"^"pants-"..pants_ran..".png"^"shirt_male-"..shirt_ran..".png"^"hair_male-"..hair_ran..".png"
local skin = { local human_female_skin="human_skin-"..skin_ran..".png"^"human_eyes_female-"..eyes_ran..".png"^"shoes-"..shoes_ran..".png"^"pants-"..pants_ran..".png"^"shirt_female-"..shirt_ran..".png"^"hair_female-"..hair_ran..".png"
base = {
'human_skin-1.png',
'human_skin-2.png',
'human_skin-3.png',
'human_skin-4.png',
'human_skin-5.png',
'human_skin-6.png'
},
hair = {
male ={
'hair_male1-brown.png',
'hair_male1-blonde.png',
'hair_male1-red.png',
'hair_male1-black.png'
},
female ={
'hair_female1-brown.png',
'hair_female1-blonde.png',
'hair_female1-red.png',
'hair_female1-black.png'
}
},
eyes = {
male = {
'human_eyes_male-1.png',
'human_eyes_male-2.png',
'human_eyes_male-3.png'
},
female = {
'human_eyes_female-1.png',
'human_eyes_female-2.png',
'human_eyes_female-3.png'
}
},
shirt = {
male = {
'shirt1-blue.png',
'shirt1-red.png',
'shirt1-orange.png',
'shirt1-green.png'
},
female = {
'shirt2-yellow.png',
'shirt2-teal.png',
'shirt2-purple.png',
'shirt2-grey.png'
}
},
pants = {
male = {
'pants1-blue.png',
'pants1-grey.png'
},
female = {
'pants1-blue.png',
'pants1-grey.png'
}
},
shoes = {
male = {
'shoes1-black.png',
'shoes1-brown.png'
},
female = {
'shoes1-black.png',
'shoes1-brown.png'
},
},
}
for i = 1, 100 do
table.insert(human_male, {
human_skin[math.random(6)] .. '^'
.. human_male_eyes[math.random(3)] .. '^'
.. male_shirt[math.random(4)] .. '^'
.. male_shoes[math.random(2)] .. '^'
.. male_pants[math.random(2)] .. '^'
.. human_male_hair[math.random(4)]
})
end
for i = 1, 100 do
table.insert(human_female, {
human_skin[math.random(6)] .. '^'
.. human_female_eyes[math.random(3)] .. '^'
.. female_shirt[math.random(4)] .. '^'
.. female_shoes[math.random(2)] .. '^'
.. female_pants[math.random(2)] .. '^'
.. human_female_hair[math.random(4)]
})
end
for i = 1, 100 do
table.insert(villager.skins, {
human[math.random(2)]
})
end
mobs:register_mob("mobs_npc:npc", { mobs:register_mob("mobs_npc:npc", {
type = "npc", type = "npc",
@ -130,8 +34,14 @@ mobs:register_mob("mobs_npc:npc", {
visual = "mesh", visual = "mesh",
mesh = "mobs_character.b3d", mesh = "mobs_character.b3d",
drawtype = "front", drawtype = "front",
textures = villager.skins, textures = {
child_texture = villager.skins, {human_male_skin},
{human_female_skin},
},
child_texture = {
{human_male_skin},
{human_female_skin},
},
makes_footstep_sound = true, makes_footstep_sound = true,
sounds = {}, sounds = {},
walk_velocity = 2, walk_velocity = 2,