2014-10-28 18:01:32 +01:00
|
|
|
|
2015-03-18 21:28:40 +01:00
|
|
|
-- Dungeon Master by PilzAdam
|
2014-10-28 18:01:32 +01:00
|
|
|
|
2014-12-18 20:09:07 +01:00
|
|
|
-- Node which cannot be destroyed by DungeonMasters' fireballs
|
2015-03-24 16:19:07 +01:00
|
|
|
local excluded = {"nether:netherrack","default:obsidian_glass","default:obsidian", "default:obsidian_cooled", "default:bedrock", "doors:door_steel_b_1", "doors:door_steel_t_1", "doors:door_steel_b_2", "doors:door_steel_t_2","default:chest_locked"}
|
2014-12-18 20:09:07 +01:00
|
|
|
|
2014-10-28 18:01:32 +01:00
|
|
|
mobs:register_mob("mobs:dungeon_master", {
|
2015-03-18 21:28:40 +01:00
|
|
|
-- animal, monster, npc, barbarian
|
2014-10-28 18:01:32 +01:00
|
|
|
type = "monster",
|
2015-03-26 20:08:30 +01:00
|
|
|
-- aggressive, shoots fireballs at player, deal 13 damages
|
2015-03-18 21:28:40 +01:00
|
|
|
passive = false,
|
|
|
|
damage = 13,
|
|
|
|
attack_type = "shoot",
|
|
|
|
shoot_interval = 2.5,
|
|
|
|
arrow = "mobs:fireball",
|
|
|
|
shoot_offset = 0,
|
|
|
|
-- health & armor
|
|
|
|
hp_min = 50, hp_max = 60, armor = 60,
|
|
|
|
-- textures and model
|
2014-10-28 18:01:32 +01:00
|
|
|
collisionbox = {-0.7, -0.01, -0.7, 0.7, 2.6, 0.7},
|
|
|
|
visual = "mesh",
|
|
|
|
mesh = "mobs_dungeon_master.x",
|
2015-03-18 21:28:40 +01:00
|
|
|
drawtype = "front",
|
2014-12-09 14:09:14 +01:00
|
|
|
available_textures = {
|
|
|
|
total = 3,
|
|
|
|
texture_1 = {"mobs_dungeon_master.png"},
|
|
|
|
texture_2 = {"mobs_dungeon_master_cobblestone.png"},
|
|
|
|
texture_3 = {"mobs_dungeon_master_strangewhite.png"},
|
|
|
|
},
|
2014-10-28 18:01:32 +01:00
|
|
|
visual_size = {x=8, y=8},
|
2015-03-18 21:28:40 +01:00
|
|
|
blood_texture = "mobs_blood.png",
|
|
|
|
-- sounds
|
2014-10-28 18:01:32 +01:00
|
|
|
makes_footstep_sound = true,
|
2015-03-18 21:28:40 +01:00
|
|
|
sounds = {
|
|
|
|
random = "mobs_dungeonmaster",
|
|
|
|
attack = "mobs_fireball",
|
|
|
|
},
|
|
|
|
-- speed and jump
|
2014-10-28 18:01:32 +01:00
|
|
|
walk_velocity = 1,
|
2015-03-18 21:28:40 +01:00
|
|
|
run_velocity = 2,
|
2015-03-21 19:28:06 +01:00
|
|
|
jump = false,
|
2015-03-18 21:28:40 +01:00
|
|
|
view_range = 16,
|
|
|
|
-- drops mese or diamond when dead
|
2014-10-28 18:01:32 +01:00
|
|
|
drops = {
|
|
|
|
{name = "default:mese_crystal_fragment",
|
2015-03-18 21:28:40 +01:00
|
|
|
chance = 1, min = 1, max = 3,},
|
2014-10-28 18:01:32 +01:00
|
|
|
{name = "default:diamond",
|
2015-03-18 21:28:40 +01:00
|
|
|
chance = 5, min = 1, max = 3,},
|
2014-10-28 18:01:32 +01:00
|
|
|
{name = "default:mese_crystal",
|
2015-03-18 21:28:40 +01:00
|
|
|
chance = 2, min = 1, max = 3,},
|
2014-10-28 18:01:32 +01:00
|
|
|
{name = "default:diamond_block",
|
2015-03-18 21:28:40 +01:00
|
|
|
chance = 30, min = 1, max = 1,},
|
2014-11-22 01:47:41 +01:00
|
|
|
{name = "maptools:gold_coin",
|
2015-03-18 21:28:40 +01:00
|
|
|
chance = 15, min = 1, max = 2,},
|
2014-10-28 19:48:41 +01:00
|
|
|
{name = "maptools:silver_coin",
|
2015-03-18 21:28:40 +01:00
|
|
|
chance = 1, min = 2, max = 10,},
|
2014-10-28 18:01:32 +01:00
|
|
|
},
|
2015-03-18 21:28:40 +01:00
|
|
|
-- damaged by
|
2014-10-28 18:01:32 +01:00
|
|
|
water_damage = 1,
|
|
|
|
lava_damage = 1,
|
|
|
|
light_damage = 0,
|
2015-03-18 21:28:40 +01:00
|
|
|
-- model animation
|
2014-10-28 18:01:32 +01:00
|
|
|
animation = {
|
2015-03-18 21:28:40 +01:00
|
|
|
stand_start = 0, stand_end = 19,
|
|
|
|
walk_start = 20, walk_end = 35,
|
|
|
|
punch_start = 36, punch_end = 48,
|
|
|
|
speed_normal = 15, speed_run = 15,
|
2014-12-25 18:34:34 +01:00
|
|
|
},
|
2014-10-28 18:01:32 +01:00
|
|
|
})
|
2015-03-18 21:28:40 +01:00
|
|
|
-- spawn on stone between 20 and -1 light, 1 in 7000 chance, 1 dungeon master in area starting at -100 and below
|
2015-03-09 17:06:40 +01:00
|
|
|
mobs:register_spawn("mobs:dungeon_master", {"default:stone, nether:netherrack"}, 20, -1, 7000, 1, -100)
|
2015-03-18 21:28:40 +01:00
|
|
|
-- register spawn egg
|
2015-02-25 01:57:21 +01:00
|
|
|
mobs:register_egg("mobs:dungeon_master", "Dungeon Master", "fire_basic_flame.png", 1)
|
2014-10-28 18:01:32 +01:00
|
|
|
|
2015-03-18 21:28:40 +01:00
|
|
|
-- Fireball (dungeon masters weapon)
|
2014-10-28 18:01:32 +01:00
|
|
|
mobs:register_arrow("mobs:fireball", {
|
|
|
|
visual = "sprite",
|
|
|
|
visual_size = {x=1, y=1},
|
|
|
|
textures = {"mobs_fireball.png"},
|
|
|
|
velocity = 5,
|
|
|
|
|
|
|
|
-- direct hit, no fire... just plenty of pain
|
|
|
|
hit_player = function(self, player)
|
|
|
|
local s = self.object:getpos()
|
|
|
|
local p = player:getpos()
|
|
|
|
player:punch(self.object, 1.0, {
|
|
|
|
full_punch_interval=1.0,
|
2014-11-22 01:47:41 +01:00
|
|
|
damage_groups = {fleshy=13},
|
2015-03-18 21:28:40 +01:00
|
|
|
}, 0)
|
2014-10-28 18:01:32 +01:00
|
|
|
end,
|
|
|
|
|
2015-03-18 21:28:40 +01:00
|
|
|
-- node hit, bursts into flame (cannot blast through obsidian or protection redo mod items)
|
2014-10-28 18:01:32 +01:00
|
|
|
hit_node = function(self, pos, node)
|
|
|
|
for dx=-1,1 do
|
|
|
|
for dy=-1,1 do
|
|
|
|
for dz=-1,1 do
|
|
|
|
local p = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
|
2015-03-02 22:29:17 +01:00
|
|
|
local n = minetest.get_node(p).name
|
2015-03-24 15:50:53 +01:00
|
|
|
local excluding = minetest.get_item_group(n, "unbreakable") == 1
|
2014-12-18 20:13:33 +01:00
|
|
|
or n:split(":")[1] == "nether"
|
2015-03-23 21:15:56 +01:00
|
|
|
or next(areas:getAreasAtPos(p)) ~= nil
|
2014-12-18 20:09:07 +01:00
|
|
|
for _,i in ipairs(excluded) do
|
2015-03-23 21:15:56 +01:00
|
|
|
if i == n then excluding = true end
|
2014-12-18 20:09:07 +01:00
|
|
|
end
|
|
|
|
--if p.y < -19600 and including and n:split(":")[1] == "nether" then
|
2014-12-18 20:13:33 +01:00
|
|
|
if excluding then
|
2014-11-22 01:01:26 +01:00
|
|
|
return
|
|
|
|
end
|
2015-03-23 21:15:56 +01:00
|
|
|
if n == "default:chest" then
|
|
|
|
meta = minetest.get_meta(p)
|
|
|
|
inv = meta:get_inventory()
|
|
|
|
for i = 1,32 do
|
|
|
|
m_stack = inv:get_stack("main",i)
|
|
|
|
obj = minetest.add_item(pos,m_stack)
|
|
|
|
if obj then
|
|
|
|
obj:setvelocity({x=math.random(-2,1), y=7, z=math.random(-2,1)})
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2014-10-28 18:01:32 +01:00
|
|
|
if minetest.registered_nodes[n].groups.flammable or math.random(1, 100) <= 30 then
|
2015-03-02 22:29:17 +01:00
|
|
|
minetest.set_node(p, {name="fire:basic_flame"})
|
2014-10-28 18:01:32 +01:00
|
|
|
else
|
2015-03-02 22:29:17 +01:00
|
|
|
minetest.set_node(p, {name="air"})
|
2014-10-28 18:01:32 +01:00
|
|
|
end
|
2015-03-23 21:15:56 +01:00
|
|
|
if n == "doors:door_wood_b_1" then
|
|
|
|
minetest.remove_node({x=p.x,y=p.y+1,z=p.z})
|
|
|
|
elseif n == "doors:door_wood_t_1" then
|
|
|
|
minetest.remove_node({x=p.x,y=p.y-1,z=p.z})
|
2014-10-28 18:01:32 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
})
|