2017-05-25 20:39:12 -04:00
|
|
|
--MCmobs v0.4
|
2016-05-19 19:24:06 -04:00
|
|
|
--maikerumine
|
|
|
|
--made for MC like Survival game
|
|
|
|
--License for code WTFPL and otherwise stated in readmes
|
|
|
|
|
|
|
|
|
|
|
|
--dofile(minetest.get_modpath("mobs").."/api.lua")
|
2017-05-22 22:27:00 -04:00
|
|
|
--###################
|
|
|
|
--################### ZOMBIE PIGMAN
|
|
|
|
--###################
|
|
|
|
|
2016-05-19 19:24:06 -04:00
|
|
|
|
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,
|
|
|
|
-- }},
|
2016-05-19 19:24:06 -04:00
|
|
|
|
|
|
|
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,
|
2016-05-19 19:24:06 -04:00
|
|
|
drops = {
|
2017-06-23 18:26:00 +02:00
|
|
|
{name = mobs_mc.items.rotten_flesh,
|
2016-05-19 19:24:06 -04:00
|
|
|
chance = 1,
|
|
|
|
min = 1,
|
|
|
|
max = 1,},
|
2017-06-23 18:26:00 +02:00
|
|
|
{name = mobs_mc.items.gold_nugget,
|
2016-05-19 19:24:06 -04:00
|
|
|
chance = 13,
|
|
|
|
min = 0,
|
|
|
|
max = 2,},
|
2017-06-23 18:26:00 +02:00
|
|
|
{name = mobs_mc.items.gold_sword,
|
2016-05-19 19:24:06 -04:00
|
|
|
chance = 8,
|
|
|
|
min = 1,
|
|
|
|
max = 1,},
|
2016-07-19 21:21:47 -04:00
|
|
|
{name = "mobs_mc:zombiepig_head",
|
2017-06-23 18:26:00 +02:00
|
|
|
chance = 200,
|
2016-07-19 21:21:47 -04:00
|
|
|
min = 0,
|
|
|
|
max = 1,},
|
2017-05-25 20:39:12 -04:00
|
|
|
},
|
2016-05-19 19:24:06 -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,
|
|
|
|
},
|
2016-05-19 19:24:06 -04:00
|
|
|
drawtype = "front",
|
|
|
|
water_damage = 1,
|
|
|
|
lava_damage = 5,
|
2017-05-22 22:27:00 -04:00
|
|
|
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,
|
2016-05-19 19:24:06 -04:00
|
|
|
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
|
2017-06-24 17:39:36 +02:00
|
|
|
mobs:register_spawn("mobs_mc:baby_pigman", mobs_mc.spawn.nether, minetest.LIGHT_MAX, 0, 100000, 4, 31000)
|
2016-05-19 19:24:06 -04:00
|
|
|
|
2017-06-24 17:39:36 +02:00
|
|
|
mobs:register_spawn("mobs_mc:pigman", mobs_mc.spawn.nether, minetest.LIGHT_MAX, 0, 1000, 3, -2000)
|
|
|
|
mobs:register_spawn("mobs_mc:pigman", mobs_mc.spawn.nether_portal, minetest.LIGHT_MAX, 0, 500, 4, 31000)
|
|
|
|
mobs:spawn_specific("mobs_mc:pigman", mobs_mc.spawn.nether_portal, {"air"},0, minetest.LIGHT_MAX, 20, 9000, 2, -31000, 31000)
|
2016-05-19 19:24:06 -04:00
|
|
|
|
|
|
|
-- 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)
|
2016-05-19 19:24:06 -04:00
|
|
|
|
2017-06-21 00:20:06 -04:00
|
|
|
if minetest.settings:get_bool("log_mods") then
|
2016-05-19 19:24:06 -04:00
|
|
|
minetest.log("action", "MC Pigmen loaded")
|
2017-06-14 19:47:33 -04:00
|
|
|
end
|