mobs_mc/zombiepig.lua

124 lines
3.1 KiB
Lua
Raw Normal View History

2017-05-25 20:39:12 -04:00
--MCmobs v0.4
--maikerumine
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
--dofile(minetest.get_modpath("mobs").."/api.lua")
--###################
--################### ZOMBIE PIGMAN
--###################
2017-06-08 19:16:13 -04:00
local pigman = {
--mobs:register_mob("mobs_mc:pigman", {
2017-06-14 19:47:33 -04:00
type = "npc",--made npc to simulate they only attack when attacked first.
2017-05-25 20:39:12 -04:00
hp_max = 60,
2017-06-14 19:47:33 -04:00
armor = 150,
collisionbox = {-0.35, -0.01, -0.35, 0.35, 2, 0.35},
2017-06-20 19:13:57 -04:00
rotate = -180,
2017-06-14 19:47:33 -04:00
visual = "mesh",
mesh = "zombie_pigman.b3d",
textures = {{"zombie_pigman.png"}},
2017-06-20 19:13:57 -04:00
visual_size = {x=3, y=3},
2017-06-14 19:47:33 -04:00
walk_velocity = 0.6,
run_velocity = 2,
jump = true,
hp_min = 20,
hp_max = 20,
2017-06-20 19:13:57 -04:00
--collisionbox = {-0.3, -1.0, -0.3, 0.3, 0.8, 0.3},
--visual = "mesh",
--mesh = "3d_armor_character.b3d",
--textures = {{"mobs_zombie_pigman.png",
-- "3d_armor_trans.png",
-- minetest.registered_items["default:sword_mese"].inventory_image,
-- }},
makes_footstep_sound = true,
walk_velocity = .8,
2016-05-24 22:17:04 -04:00
run_velocity = 2.6,
2017-06-14 19:47:33 -04:00
damage = 9,
2016-05-24 22:17:04 -04:00
armor = 80,
pathfinding = true,
group_attack = true,
2017-05-25 20:39:12 -04:00
passive = false,
maxdrops = 2,
drops = {
{name = mobs_mc.items.rotten_flesh,
chance = 1,
min = 1,
max = 1,},
{name = mobs_mc.items.gold_nugget,
chance = 13,
min = 0,
max = 2,},
{name = mobs_mc.items.gold_sword,
chance = 8,
min = 1,
max = 1,},
2016-07-19 21:21:47 -04:00
{name = "mobs_mc:zombiepig_head",
chance = 200,
2016-07-19 21:21:47 -04:00
min = 0,
max = 1,},
2017-05-25 20:39:12 -04:00
},
sounds = {
2017-05-25 20:39:12 -04:00
random = "Pig2",
death = "Pigdeath",
damage = "zombiehurt1",
attack = "default_punch3",
},
2017-06-08 19:16:13 -04:00
2016-05-24 22:17:04 -04:00
animation = {
speed_normal = 30, speed_run = 30,
stand_start = 0, stand_end = 79,
walk_start = 168, walk_end = 187,
run_start = 168, run_end = 187,
punch_start = 200, punch_end = 219,
},
drawtype = "front",
water_damage = 1,
lava_damage = 5,
light_damage = 0,
2016-05-24 22:17:04 -04:00
fear_height = 3,
2017-06-14 19:47:33 -04:00
view_range = 16,
attack_type = "dogfight",
2017-06-08 19:16:13 -04:00
}
mobs:register_mob("mobs_mc:pigman", pigman)
-- Baby pigman.
-- A smaller and more dangerous variant of the pigman
local baby_pigman = table.copy(pigman)
baby_pigman.collisionbox = {-0.25, -0.01, -0.25, 0.25, 0.94, 0.25}
baby_pigman.visual_size = {x=0.5, y=0.5}
baby_pigman.textures = {{"mobs_zombie_pigman.png"}}
baby_pigman.walk_velocity = 1.2
baby_pigman.run_velocity = 2.4
baby_pigman.light_damage = 0
mobs:register_mob("mobs_mc:baby_pigman", baby_pigman)
-- Baby zombie is 20 times less likely than regular zombies
mobs:register_spawn("mobs_mc:baby_pigman", {"default:rack", "default:portal"}, 7, -1, 100000, 4, 31000)
mobs:register_spawn("mobs_mc:pigman", {"default:rack"}, 17, -1, 1000, 3, -2000)
mobs:register_spawn("mobs_mc:pigman", {"default:portal"}, 15, -1, 500, 4, 31000)
2017-05-25 20:39:12 -04:00
--mobs:register_spawn("mobs_mc:pigman", {"default:obsidian"}, 17, -1, 1900, 1, 31000)
mobs:spawn_specific("mobs_mc:pigman", {"default:portal"},{"air"},0, 12, 20, 9000, 2, -31000, 31000)
-- compatibility
mobs:alias_mob("mobs:pigman", "mobs_mc:pigman")
-- spawn eggs
2017-05-23 19:03:37 -04:00
mobs:register_egg("mobs_mc:pigman", "Zombie Pigman", "zombie_pigman_inv.png", 0)
2017-06-21 00:20:06 -04:00
if minetest.settings:get_bool("log_mods") then
minetest.log("action", "MC Pigmen loaded")
2017-06-14 19:47:33 -04:00
end