123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963 |
- local time_limit = 120
- local posmorvalarblock = {x=827, y=-30094, z=-817}
- function respawn_block(self)
- --start a timer if it doesn't exist
- self.stop_timer = self.stop_timer or os.time()
- --create a variable to record the hp if it doesn't exist
- self.hp_record = self.hp_record or self.health
- if self.hp_record ~= self.health then
- self.stop_timer = os.time()
- self.hp_record = self.health
- else
- if os.time() - self.stop_timer > time_limit then
- minetest.chat_send_all("Time is over!")
- self.object:remove()
- minetest.set_node(posmorvalarblock, {name="nssb:morvalar_block"})
- end
- end
- end
- mobs:register_mob("nssm:morvalar", {
- type = "monster",
- hp_max = 100,
- hp_min = 100,
- collisionbox = {-0.4, -0.1, -0.4, 0.4, 1.8, 0.4},
- visual = "mesh",
- --rotate= 270,
- mesh = "morvalar.x",
- textures = {
- {"morvalar.png"}
- },
- visual_size = {x = 5, y = 5},
- makes_footstep_sound = true,
- view_range = 50,
- walk_velocity = 1.6,
- reach = 3,
- run_velocity = 3.2,
- damage = 8,
- runaway = true,
- jump = true,
- sounds = {
- random = "morvalar7",
- },
- armor = 50,
- drawtype = "front",
- water_damage = 0,
- fear_height = 4,
- floats = 1,
- lava_damage = 0,
- fire_damage = 0,
- blood_texture = "morparticle.png",
- blood_amount = 10,
- knock_back = 0,
- light_damage = 0,
- attack_type = "dogfight",
- animation = {
- speed_normal = 15,
- speed_run = 30,
- stand_start = 5,
- stand_end = 6,
- walk_start = 10,
- walk_end = 50,
- run_start = 10,
- run_end = 50,
- punch_start = 55,
- punch_end = 80,
- },
- do_custom = function(self)
- respawn_block(self)
- end,
- custom_attack = function (self)
- self.curr_attack = (self.curr_attack or self.attack)
- self.morvalar_timer = (self.morvalar_timer or os.time())
- self.dir = (self.dir or 0)
- if (os.time() - self.morvalar_timer) > 2 then
- local s = self.object:get_pos()
- local p = self.attack:get_pos()
- mobs:set_animation(self, "punch")
- local m = 1
- if self.attack:is_player() then
- if minetest.get_modpath("3d_armor") then
- local pname, player_inv, armor_inv, ppos = armor:get_valid_player(
- self.attack, "[set_player_armor]")
- local pname = self.attack:get_player_name()
- local player_inv = minetest.get_inventory({type='player', name = pname})
- if player_inv:is_empty('armor') then
- -- punch player if he doesn't own an armor
- self.attack:punch(self.object, 1.0, {
- full_punch_interval = 1.0,
- damage_groups = {fleshy = self.damage}
- }, nil)
- else
- local armor_elements = {}
- local armor_num = 0
- local steal_pos
- for i = 1, 6 do
- local armor_stack = player_inv:get_stack("armor", i)
- local armor_item = armor_stack:get_name()
- if armor_stack:get_count() > 0 then
- armor_elements[armor_num]={name=armor_item, pos=i}
- armor_num = armor_num + 1
- end
- end
- if armor_num > 0 then
- steal_pos = math.random(1,armor_num)
- steal_pos = steal_pos-1
- local cpos = string.find(armor_elements[steal_pos].name, ":")
- local mod_name = string.sub(armor_elements[steal_pos].name, 0, cpos - 1)
- local nname = string.sub(armor_elements[steal_pos].name, cpos + 1)
- if mod_name == "3d_armor" then
- nname = "3d_armor_inv_"..nname..".png"
- elseif mod_name == "nssm" then
- nname = "inv_"..nname..".png"
- else
- nname = "3d_armor_inv_chestplate_diamond.png"
- end
- minetest.add_particlespawner({
- amount = 1,
- time = 1,
- minpos = {x=p.x, y=p.y+1, z=p.z},
- maxpos = {x=p.x, y=p.y+1, z=p.z},
- minvel = {x=(s.x-p.x)*m, y=(s.y-p.y)*m, z=(s.z-p.z)*m},
- maxvel = {x=(s.x-p.x)*m, y=(s.y-p.y)*m, z=(s.z-p.z)*m},
- minacc = {x=s.x-p.x, y=s.y-p.y-1, z=s.z-p.z},
- maxacc = {x=s.x-p.x, y=s.y-p.y-1, z=s.z-p.z},
- minexptime = 0.5,
- maxexptime = 0.5,
- minsize = 10,
- maxsize = 10,
- collisiondetection = false,
- texture = nname
- })
- minetest.after(1, function (self)
- local armor_stack = player_inv:get_stack("armor", armor_elements[steal_pos].pos)
- armor_stack:take_item()
- player_inv:set_stack('armor', armor_elements[steal_pos].pos, armor_stack)
- armor_stack = armor_inv:get_stack("armor", armor_elements[steal_pos].pos)
- armor_stack:take_item()
- armor_inv:set_stack('armor', armor_elements[steal_pos].pos, armor_stack)
- armor:set_player_armor(self.attack, self.attack)
- armor:update_inventory(self.attack)
- end, self)
- end
- end
- else
- local s = self.object:get_pos()
- local p = self.attack:get_pos()
- mobs:set_animation(self, "punch")
- if minetest.line_of_sight(
- {x = p.x, y = p.y + 1.5, z = p.z},
- {x = s.x, y = s.y +1.5, z = s.z}) == true then
- -- play attack sound
- if self.sounds.attack then
- minetest.sound_play(self.sounds.attack, {
- object = self.object,
- max_hear_distance = self.sounds.distance
- })
- end
- -- punch player
- self.attack:punch(self.object, 1.0, {
- full_punch_interval = 1.0,
- damage_groups = {fleshy = self.damage}
- }, nil)
- end
- end
- end
- end
- end,
- on_die = function(self)
- local pos = self.object:get_pos()
- self.object:remove()
- add_entity_and_particles("nssm:morvalar6", pos, "morparticle.png", 10)
- end,
- })
- mobs:register_mob("nssm:morvalar6", {
- type = "monster",
- hp_max = 120,
- hp_min = 120,
- collisionbox = {-0.4, -0.1, -0.4, 0.4, 1.8, 0.4},
- visual = "mesh",
- --rotate= 270,
- mesh = "morvalar.x",
- textures = {
- {"morvalar.png"}
- },
- visual_size = {x = 5, y = 5},
- makes_footstep_sound = true,
- view_range = 50,
- walk_velocity = 1.6,
- reach =4,
- run_velocity = 3.2,
- damage = 8,
- runaway = true,
- jump = true,
- sounds = {
- random = "morvalar6",
- },
- armor = 50,
- drawtype = "front",
- water_damage = 0,
- fear_height = 4,
- floats = 1,
- lava_damage = 0,
- fire_damage = 0,
- light_damage = 0,
- blood_texture = "morparticle.png",
- blood_amount = 10,
- knock_back = 0,
- attack_type = "dogfight",
- animation = {
- speed_normal = 15,
- speed_run = 30,
- stand_start = 85,
- stand_end = 86,
- walk_start = 90,
- walk_end = 130,
- run_start = 90,
- run_end = 130,
- punch_start = 132,
- punch_end = 162,
- },
- do_custom = function(self)
- respawn_block(self)
- end,
- custom_attack = function (self)
- self.morvalar6_timer = (self.morvalar6_timer or os.time())
- self.dir = (self.dir or 0)
- if (os.time() - self.morvalar6_timer) > 1 then
- local s = self.object:get_pos()
- local p = self.attack:get_pos()
- mobs:set_animation(self, "punch")
- local m = 2
- minetest.after(1, function (self)
- if self.attack:is_player() then
- local pname = self.attack:get_player_name()
- local player_inv = minetest.get_inventory({type='player', name = pname})
- if player_inv:is_empty('main') then
- --minetest.chat_send_all("Inventory empty")
- else
- local imhungry = 0
- for i = 1, 32 do
- --minetest.chat_send_all("Inventory is not empty")
- local items = player_inv:get_stack('main', i)
- local n = items:get_name()
- if minetest.get_item_group(n, "eatable")==1 then
- imhungry = 1
- for t = 0,2 do
- items:take_item()
- end
- player_inv:set_stack('main', i, items)
- end
- end
- if imhungry == 0 then
- self.attack:punch(self.object, 1.0, {
- full_punch_interval = 1.0,
- damage_groups = {fleshy = self.damage}
- }, nil)
- else
- s.y = s.y+1.8
- minetest.add_particlespawner({
- amount = 1,
- time = 1,
- minpos = {x=p.x, y=p.y+1, z=p.z},
- maxpos = {x=p.x, y=p.y+1, z=p.z},
- minvel = {x=(s.x-p.x)*m, y=(s.y-p.y)*m, z=(s.z-p.z)*m},
- maxvel = {x=(s.x-p.x)*m, y=(s.y-p.y)*m, z=(s.z-p.z)*m},
- minacc = {x=s.x-p.x, y=s.y-p.y-1, z=s.z-p.z},
- maxacc = {x=s.x-p.x, y=s.y-p.y-1, z=s.z-p.z},
- minexptime = 0.5,
- maxexptime = 0.5,
- minsize = 10,
- maxsize = 10,
- collisiondetection = false,
- texture = "roasted_duck_legs.png"
- })
- end
- self.morvalar6_timer = os.time()
- end
- end
- end,self)
- end
- end,
- on_die = function(self)
- local pos = self.object:get_pos()
- self.object:remove()
- add_entity_and_particles("nssm:morvalar5", pos, "morparticle.png", 10)
- end,
- })
- mobs:register_mob("nssm:morvalar5", {
- type = "monster",
- hp_max = 130,
- hp_min = 130,
- collisionbox = {-0.4, -0.1, -0.4, 0.4, 1.8, 0.4},
- visual = "mesh",
- --rotate= 270,
- mesh = "morvalar.x",
- textures = {{"morvalar.png"}},
- visual_size = {x=5, y=5},
- makes_footstep_sound = true,
- view_range = 50,
- walk_velocity = 1.6,
- reach =6,
- run_velocity = 3.2,
- damage = 4,
- runaway = true,
- jump = true,
- sounds = {
- random = "morvalar5",
- },
- armor = 40,
- drawtype = "front",
- water_damage = 0,
- fear_height = 4,
- floats = 1,
- lava_damage = 0,
- fire_damage = 0,
- light_damage = 0,
- blood_texture="morparticle.png",
- blood_amount=10,
- knock_back=0,
- on_rightclick = nil,
- attack_type = "dogfight",
- animation = {
- speed_normal = 15,
- speed_run = 30,
- stand_start = 165,
- stand_end = 166,
- walk_start = 170,
- walk_end = 210,
- run_start = 170,
- run_end = 210,
- punch_start = 215,
- punch_end = 245,
- },
- do_custom = function(self)
- respawn_block(self)
- end,
- custom_attack = function (self)
- self.morvalar5_timer = (self.morvalar5_timer or os.time())
- self.dir = (self.dir or 0)
- if (os.time() - self.morvalar5_timer) > 2 then
- local s = self.object:get_pos()
- local p = self.attack:get_pos()
- minetest.after(2, function(self)
- mobs:set_animation(self, "punch")
- tnt_boom_nssm(p, {damage_radius=6,radius=5,ignore_protection=false})
- self.morvalar5_timer = os.time()
- end,self)
- end
- end,
- on_die = function(self)
- local pos = self.object:get_pos()
- self.object:remove()
- add_entity_and_particles("nssm:morvalar4", pos, "morparticle.png", 10)
- end,
- })
- mobs:register_mob("nssm:morvalar4", {
- type = "monster",
- hp_max = 100,
- hp_min = 100,
- collisionbox = {-0.4, -0.1, -0.4, 0.4, 1.8, 0.4},
- visual = "mesh",
- --rotate= 270,
- mesh = "morvalar.x",
- textures = {{"morvalar.png"}},
- visual_size = {x=5, y=5},
- makes_footstep_sound = true,
- view_range = 50,
- walk_velocity = 1.6,
- reach = 3,
- run_velocity = 3.2,
- damage = 4,
- runaway = true,
- jump = true,
- sounds = {
- random = "morvalar4",
- },
- armor = 30,
- drawtype = "front",
- water_damage = 0,
- fear_height = 4,
- floats = 1,
- lava_damage = 0,
- fire_damage = 0,
- light_damage = 0,
- blood_texture="morparticle.png",
- blood_amount=10,
- knock_back=0,
- on_rightclick = nil,
- attack_type = "dogfight",
- animation = {
- speed_normal = 15,
- speed_run = 30,
- stand_start = 250,
- stand_end = 251,
- walk_start = 255,
- walk_end = 295,
- run_start = 255,
- run_end = 295,
- punch_start = 300,
- punch_end = 320,
- },
- do_custom = function(self)
- respawn_block(self)
- end,
- custom_attack = function(self)
- self.morvalar4_timer = (self.morvalar4_timer or os.time())
- if (os.time() - self.morvalar4_timer) > 1 then
- self.morvalar4_timer = os.time()
- local s = self.object:get_pos()
- local p = self.attack:get_pos()
- mobs:set_animation(self, "punch")
- if minetest.line_of_sight({x = p.x, y = p.y +1.5, z = p.z}, {x = s.x, y = s.y +1.5, z = s.z}) == true then
- -- play attack sound
- if self.sounds.attack then
- minetest.sound_play(self.sounds.attack, {
- object = self.object,
- max_hear_distance = self.sounds.distance
- })
- end
- -- punch player
- self.attack:punch(self.object, 1.0, {
- full_punch_interval=1.0,
- damage_groups = {fleshy=self.damage}
- }, nil)
- end
- minetest.after(1.4, function()
- local ty = s.y
- local flag = 0
- local m = 3
- local v = {x=(p.x-s.x)*m, y = ty, z = (p.z-s.z)*m}
- local d = {x=s.x+v.x, y = ty, z = s.z+v.z}
- d.y = ty
- for j = -3,3 do
- ty = d.y + j
- local current = minetest.get_node({x = d.x, y = ty, z = d.z}).name
- local up = minetest.get_node({x = d.x, y = ty+1, z = d.z}).name
- if up == "air" and current ~= "air" then
- d.y = d.y + j+1.5
- flag = 1
- break
- end
- end
- while flag ~= 1 do
- d.x = p.x + math.random(-m,m)
- d.z = p.z + math.random(-m,m)
- d.y = p.y
- local dist = dist_pos(d, p)
- if dist>=2 then
- for j = -3,3 do
- ty = d.y + j
- local current = minetest.get_node({x = d.x, y = ty, z = d.z}).name
- local up = minetest.get_node({x = d.x, y = ty+1, z = d.z}).name
- if up == "air" and current ~= "air" then
- d.y = d.y + j+1.5
- flag = 1
- break
- end
- end
- end
- end
- self.object:set_pos(d)
- end)
- end
- end,
- on_die = function(self)
- local pos = self.object:get_pos()
- self.object:remove()
- add_entity_and_particles("nssm:morvalar3", pos, "morparticle.png", 10)
- end,
- })
- mobs:register_mob("nssm:morvalar3", {
- type = "monster",
- hp_max = 120,
- hp_min = 120,
- collisionbox = {-0.4, -0.1, -0.4, 0.4, 1.8, 0.4},
- visual = "mesh",
- --rotate= 270,
- mesh = "morvalar.x",
- textures = {{"morvalar.png"}},
- visual_size = {x=5, y=5},
- makes_footstep_sound = true,
- view_range = 50,
- walk_velocity = 1.6,
- reach = 3,
- run_velocity = 3.2,
- damage = 16,
- runaway = true,
- jump = true,
- sounds = {
- random = "morvalar3",
- },
- armor = 30,
- drawtype = "front",
- water_damage = 0,
- fear_height = 4,
- floats = 1,
- lava_damage = 0,
- fire_damage = 0,
- light_damage = 0,
- blood_texture="morparticle.png",
- blood_amount=10,
- knock_back=0,
- on_rightclick = nil,
- attack_type = "dogshoot",
- dogshoot_switch = true,
- arrow = "nssm:morarrow",
- shoot_interval = 2,
- shoot_offset = 0,
- animation = {
- speed_normal = 15,
- speed_run = 30,
- stand_start = 325,
- stand_end = 326,
- walk_start = 330,
- walk_end = 370,
- run_start = 330,
- run_end = 370,
- punch_start = 375,
- punch_end = 395,
- shoot_start = 400,
- shoot_end = 450,
- },
- do_custom = function(self)
- respawn_block(self)
- end,
- on_die = function(self)
- local pos = self.object:get_pos()
- self.object:remove()
- add_entity_and_particles("nssm:morvalar2", pos, "morparticle.png", 10)
- end,
- })
- mobs:register_mob("nssm:morvalar2", {
- type = "monster",
- hp_max = 90,
- hp_min = 90,
- collisionbox = {-0.4, -0.1, -0.4, 0.4, 1.8, 0.4},
- visual = "mesh",
- --rotate= 270,
- mesh = "morvalar.x",
- textures = {{"morvalar.png"}},
- visual_size = {x=5, y=5},
- makes_footstep_sound = true,
- view_range = 50,
- walk_velocity = 1.6,
- reach = 6,
- run_velocity = 3.2,
- damage = 4,
- runaway = true,
- jump = true,
- sounds = {
- random = "morvalar2",
- },
- armor = 50,
- drawtype = "front",
- water_damage = 0,
- fear_height = 4,
- floats = 1,
- lava_damage = 0,
- fire_damage = 0,
- light_damage = 0,
- blood_texture="morparticle.png",
- blood_amount=10,
- knock_back=0,
- on_rightclick = nil,
- attack_type = "dogfight",
- animation = {
- speed_normal = 15,
- speed_run = 30,
- stand_start = 455,
- stand_end = 456,
- walk_start = 460,
- walk_end = 500,
- run_start = 460,
- run_end = 500,
- punch_start = 505,
- punch_end = 545,
- },
- do_custom = function(self)
- respawn_block(self)
- end,
- custom_attack = function(self)
- self.morvalar2_timer = (self.morvalar2_timer or os.time())
- if (os.time() - self.morvalar2_timer) > 1 then
- self.morvalar2_timer = os.time()
- local s = self.object:get_pos()
- local p = self.attack:get_pos()
- local counter = 0
- local objects = minetest.get_objects_inside_radius(s, 7)
- for _,obj in ipairs(objects) do
- if obj:get_luaentity() then
- local name = obj:get_luaentity().name
- if (name == "nssm:mordain" or name == "nssm:morde" or name == "nssm:morgut" or name == "nssm:morgre" or name == "nssm:morlu" or name == "nssm:morwa" or name == "nssm:morvy") then
- counter = counter + 1
- end
- end
- end
- minetest.chat_send_all("Ne ho contati: "..counter)
- if counter < 2 then
- mobs:set_animation(self, "punch")
- local v = vector.subtract(p,s)
- --local v = {x = s.x-p.x, y = s.y-p.y , z= s.z-p.z}
- v = vector.normalize(v)
- local per = perpendicular_vector(v)
- local p1 = vector.add(s,v)
- p1 = vector.subtract(p1,vector.multiply(per,4))
- add_entity_and_particles("nssm:morwa", p1, "morparticle.png", 1)
- p1 = vector.add(p1,per)
- add_entity_and_particles("nssm:mordain", p1, "morparticle.png", 1)
- p1 = vector.add(p1,per)
- add_entity_and_particles("nssm:morgre", p1, "morparticle.png", 1)
- p1 = vector.add(p1,per)
- add_entity_and_particles("nssm:morlu", p1, "morparticle.png", 1)
- p1 = vector.add(p1,per)
- add_entity_and_particles("nssm:morgut", p1, "morparticle.png", 1)
- p1 = vector.add(p1,per)
- add_entity_and_particles("nssm:morde", p1, "morparticle.png", 1)
- p1 = vector.add(p1,per)
- add_entity_and_particles("nssm:morvy", p1, "morparticle.png", 1)
- p1 = vector.add(p1,per)
- end
- end
- end,
- on_die = function(self)
- local pos = self.object:get_pos()
- self.object:remove()
- add_entity_and_particles("nssm:morvalar1", pos, "morparticle.png", 10)
- end,
- })
- mobs:register_mob("nssm:morvalar1", {
- type = "monster",
- hp_max = 160,
- hp_min = 160,
- collisionbox = {-0.4, -0.1, -0.4, 0.4, 1.8, 0.4},
- visual = "mesh",
- --rotate= 270,
- mesh = "morvalar.x",
- textures = {{"morvalar.png"}},
- visual_size = {x=5, y=5},
- makes_footstep_sound = true,
- view_range = 50,
- walk_velocity = 1.6,
- reach = 6,
- run_velocity = 3.2,
- damage = 4,
- runaway = true,
- jump = true,
- sounds = {
- random = "morvalar1",
- },
- armor = 20,
- drawtype = "front",
- water_damage = 0,
- fear_height = 4,
- floats = 1,
- lava_damage = 0,
- fire_damage = 0,
- light_damage = 0,
- blood_texture="morparticle.png",
- blood_amount=10,
- knock_back=0,
- on_rightclick = nil,
- attack_type = "dogfight",
- animation = {
- speed_normal = 15,
- speed_run = 30,
- stand_start = 550,
- stand_end = 551,
- walk_start = 560,
- walk_end = 600,
- run_start = 560,
- run_end = 600,
- punch_start = 610,
- punch_end = 640,
- },
- do_custom = function(self)
- respawn_block(self)
- end,
- custom_attack = function (self)
- self.morvalar1_timer = (self.morvalar1_timer or os.time())
- if (os.time() - self.morvalar1_timer) > 3 then
- self.morvalar1_timer = os.time()
- local s = self.object:get_pos()
- local p = self.attack:get_pos()
- mobs:set_animation(self, "punch")
- local m = 3
- if minetest.line_of_sight({x = p.x, y = p.y +1.5, z = p.z}, {x = s.x, y = s.y +1.5, z = s.z}) == true then
- -- play attack sound
- if self.sounds.attack then
- minetest.sound_play(self.sounds.attack, {
- object = self.object,
- max_hear_distance = self.sounds.distance
- })
- end
- -- punch player
- self.health = self.health + (self.damage*3)
- self.attack:punch(self.object, 1.0, {
- full_punch_interval=1.0,
- damage_groups = {fleshy=self.damage}
- }, nil)
- end
- end
- end,
- on_die = function(self)
- local pos = self.object:get_pos()
- self.object:remove()
- add_entity_and_particles("nssm:morvalar0", pos, "morparticle.png", 10)
- end,
- })
- mobs:register_mob("nssm:morvalar0", {
- type = "monster",
- hp_max = 100,
- hp_min = 100,
- collisionbox = {-0.4, -0.1, -0.4, 0.4, 1.8, 0.4},
- visual = "mesh",
- --rotate= 270,
- mesh = "morvalar.x",
- textures = {{"morvalar.png"}},
- visual_size = {x=5, y=5},
- makes_footstep_sound = true,
- view_range = 50,
- walk_velocity = 1.6,
- reach = 16,
- run_velocity = 3.2,
- damage = 4,
- runaway = true,
- jump = true,
- sounds = {
- random = "kamehameha",
- },
- drops = {
- {name = "nssm:death_scythe",
- chance = 1,
- min = 1,
- max = 1,},
- },
- armor = 30,
- drawtype = "front",
- water_damage = 0,
- fear_height = 4,
- floats = 1,
- lava_damage = 0,
- fire_damage = 0,
- light_damage = 0,
- blood_texture="morparticle.png",
- blood_amount=10,
- knock_back=0,
- on_rightclick = nil,
- attack_type = "dogfight",
- animation = {
- speed_normal = 15,
- speed_run = 30,
- stand_start = 645,
- stand_end = 646,
- walk_start = 650,
- walk_end = 690,
- run_start = 650,
- run_end = 690,
- punch_start = 700,
- punch_end = 750,
- },
- do_custom = function(self)
- respawn_block(self)
- end,
- custom_attack = function (self)
- self.morvalar1_timer = (self.morvalar1_timer or os.time())
- if (os.time() - self.morvalar1_timer) > 1 then
- self.morvalar1_timer = os.time()
- local s = self.object:get_pos()
- local p = self.attack:get_pos()
- mobs:set_animation(self, "punch")
- local m = 5 --velocity of the kamehameha
- local obj = minetest.add_entity(s, "nssm:kamehameha_bad")
- s.y = s.y+0.5
- p.y = p.y+0.9
- local dir = {x=(p.x-s.x)*m, y=(p.y-s.y)*m, z=(p.z-s.z)*m} --direction of the kamehameha
- obj:set_velocity(dir)
- end
- end,
- on_die = function(self)
- local pos = self.object:get_pos()
- self.object:remove()
- minetest.add_particlespawner({
- amount = 500,
- time = 2,
- minpos = {x=pos.x-2, y=pos.y-1, z=pos.z-2},
- maxpos = {x=pos.x+2, y=pos.y+4, z=pos.z+2},
- minvel = {x=0, y=0, z=0},
- maxvel = {x=1, y=2, z=1},
- minacc = {x=-0.5,y=0.6,z=-0.5},
- maxacc = {x=0.5,y=0.7,z=0.5},
- minexptime = 2,
- maxexptime = 3,
- minsize = 3,
- maxsize = 5,
- collisiondetection = false,
- vertical = false,
- texture = "morparticle.png",
- })
- minetest.set_node(posmorvalarblock, {name="nssb:dis_morvalar_block"})
- --minetest.add_entity(pos, "nssm:morvalar3")
- end,
- })
- minetest.register_entity("nssm:kamehameha_bad", {
- textures = {"kamehameha.png"},
- on_step = function(self, dtime)
- local pos = self.object:get_pos();
- if self.timer == 0 then
- self.timer = os.time()
- end
- if os.time() - self.timer > self.life_time then
- self.object:remove()
- end
- local objects = minetest.get_objects_inside_radius(pos, 2)
- for _,obj in ipairs(objects) do
- if obj:is_player() then
- minetest.chat_send_all("Dentro il raggio grande")
- obj:set_hp(obj:get_hp()-5)
- end
- if obj:get_luaentity() then
- local name = obj:get_luaentity().name
- if name ~= "nssm:morvalar0" and name ~="nssm:kamehameha_bad" then
- obj:set_hp(obj:get_hp()-5)
- if (obj:get_hp() <= 0) then
- if (not obj:is_player()) then
- obj:remove()
- end
- end
- end
- end
- end
- local objects = minetest.get_objects_inside_radius(pos, 1)
- for _,obj in ipairs(objects) do
- if obj:is_player() then
- tnt_boom_nssm(pos, {damage_radius=6,radius=5,ignore_protection=false})
- self.object:remove()
- minetest.chat_send_all("Dentro il raggio piccolo")
- end
- if obj:get_luaentity() then
- local name = obj:get_luaentity().name
- if name ~= "nssm:morvalar0" and name ~="nssm:kamehameha_bad" then
- tnt_boom_nssm(pos, {damage_radius=6,radius=5,ignore_protection=false})
- self.object:remove()
- end
- end
- end
- local nodename = minetest.get_node(pos).name
- if nodename ~= "air" then
- explosion(pos, 5, 0, 1, true)
- self.object:remove()
- end
- end,
- life_time = 40,
- timer = 0,
- custom_timer = 0,
- })
- --[[
- 7 code: ruba l'armatura come il morlu, ma poi non scappa e ti attacca normalmente. O un po' un po' o prima ruba e poi ti ara e basta.
- 6 code: stand: 85-86 walk: 90-130 attack: 132-162
- Attacca come prima con 7 ma ruba il cibo come il morvalar6 al posto dell'armatura, e non scappa ma attacca.
- 5 code: stand: 165-166 walk: 170-210 attack: 215-245
- Fa esplodere un po' la sua coda come un Morgre fa esplodere se stesso.
- 4 code: stand: 250-251 walk: 255-295 attack: 300-320
- Attacca esattamente come un Mordain
- 3 code: stand: 325-326 walk: 330-370 attack: 375-395(punch) 400-450(shoot)
- Dogshoot con lo stesso intervel del Morwa, che mi pare sia 2.
- 2 code: stand: 455-456 walk: 460-500 attack: 505-545
- Evoca intorno a s� i 7 mostri del Morlendor contemporaneamente, non fa nulla fino a quando sono nel suo raggio visivo, quando muoiono ne evoca altri 7 e cos� via fino a che non lo abbatti, sei libero di reinterpretare questo attacco in base alle tue capacit�.
- 1 code: stand: 550-551 walk: 560-600 attack: 610-640
- Attacca assorbendo la vita come un morde, si ricarica in questo modo, ma di pi� del numero che assorbe.
- 0 code: stand: 645-646 walk: 650-690 attack: 700-750
- Shoota delle kamehameha
- ]]--
|