46 lines
1.6 KiB
Lua
46 lines
1.6 KiB
Lua
|
|
npc_talk.enable_talk_to_animals = function()
|
|
|
|
-- the following information is needed in order to handle skin changes
|
|
yl_speak_up.mesh_data["mobs_sheep.b3d"] = {
|
|
texture_index = 1,
|
|
animation = {
|
|
-- {x = start_frame, y = end_frame, collisionbox}
|
|
stand_still = {x = 0, y = 0},
|
|
stand = {x = 0, y = 79},
|
|
walk = {x = 81, y = 100},
|
|
},
|
|
}
|
|
yl_speak_up.mesh_data["mobs_cow.b3d"] = {
|
|
texture_index = 1,
|
|
animation = {
|
|
-- {x = start_frame, y = end_frame, collisionbox}
|
|
stand_still = {x = 0, y = 0},
|
|
stand = {x = 0, y = 30},
|
|
stand1 = {x = 35, y = 75},
|
|
walk = {x = 85, y = 114},
|
|
run = {x = 120, y = 140},
|
|
punch = {x = 145, y = 160},
|
|
die = {x = 165, y = 185},
|
|
},
|
|
}
|
|
|
|
yl_speak_up.mob_skins["mobs_animal:sheep_white"] = {
|
|
"mobs_sheep_base.png^(mobs_sheep_wool.png^[multiply:#ffffffc0)"}
|
|
yl_speak_up.mob_skins["mobs_animal:sheep_red"] = {
|
|
"mobs_sheep_base.png^(mobs_sheep_wool.png^[multiply:#ff0000a0)"}
|
|
yl_speak_up.mob_skins["mobs_animal:cow"] = {
|
|
"mobs_cow.png", "mobs_cow2.png"}
|
|
|
|
table.insert(yl_speak_up.emulate_orders_on_rightclick, "mobs_animal:sheep_white")
|
|
table.insert(yl_speak_up.emulate_orders_on_rightclick, "mobs_animal:sheep_red")
|
|
table.insert(yl_speak_up.emulate_orders_on_rightclick, "mobs_animal:cow")
|
|
end
|
|
|
|
|
|
if(minetest.get_modpath("mobs_animal")) then
|
|
-- make sure it gets called once now and in the future whenever yl_speak_up is reloaded
|
|
-- (via /npc_talk_reload)
|
|
yl_speak_up.register_on_reload(npc_talk.enable_talk_to_animals, "npc_talk.enable_talk_to_animals()")
|
|
end
|