From 6cd0f084a8fa46685cb00866738311991fa4db11 Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Sat, 8 Oct 2016 21:58:27 +0100 Subject: [PATCH] Added Igor npc for halloween (with 8 textures) --- igor.lua | 116 ++++++++++++++++++++++++++++++++++++++++ init.lua | 1 + textures/mobs_igor.png | Bin 0 -> 222 bytes textures/mobs_igor2.png | Bin 0 -> 924 bytes textures/mobs_igor3.png | Bin 0 -> 1109 bytes textures/mobs_igor4.png | Bin 0 -> 544 bytes textures/mobs_igor5.png | Bin 0 -> 848 bytes textures/mobs_igor6.png | Bin 0 -> 816 bytes textures/mobs_igor7.png | Bin 0 -> 799 bytes textures/mobs_igor8.png | Bin 0 -> 792 bytes 10 files changed, 117 insertions(+) create mode 100644 igor.lua create mode 100644 textures/mobs_igor.png create mode 100644 textures/mobs_igor2.png create mode 100644 textures/mobs_igor3.png create mode 100644 textures/mobs_igor4.png create mode 100644 textures/mobs_igor5.png create mode 100644 textures/mobs_igor6.png create mode 100644 textures/mobs_igor7.png create mode 100644 textures/mobs_igor8.png diff --git a/igor.lua b/igor.lua new file mode 100644 index 0000000..dbdecb7 --- /dev/null +++ b/igor.lua @@ -0,0 +1,116 @@ + +local S = mobs.intllib + +-- Igor by TenPlus1 + +mobs.igor_drops = { + "vessels:glass_bottle", "mobs:meat_raw", "default:sword_steel", + "farming:bread", "bucket:bucket_water" +} + +mobs:register_mob("mobs_npc:igor", { + type = "npc", + passive = false, + damage = 5, + attack_type = "dogfight", + pathfinding = true, + reach = 2, + attacks_monsters = true, + hp_min = 20, + hp_max = 30, + armor = 100, + collisionbox = {-0.35,-1.0,-0.35, 0.35,0.8,0.35}, + visual = "mesh", + mesh = "character.b3d", + textures = { + {"mobs_igor.png"}, -- skin by ruby32199 + {"mobs_igor2.png"}, + {"mobs_igor3.png"}, + {"mobs_igor4.png"}, + {"mobs_igor5.png"}, + {"mobs_igor6.png"}, + {"mobs_igor7.png"}, + {"mobs_igor8.png"}, + }, + makes_footstep_sound = true, + sounds = {}, + walk_velocity = 1, + run_velocity = 2, + stepheight = 1.1, + fear_height = 2, + jump = true, + drops = { + {name = "mobs:meat_raw", chance = 1, min = 1, max = 2}, + {name = "default:gold_lump", chance = 3, min = 1, max = 1}, + }, + water_damage = 1, + lava_damage = 3, + light_damage = 0, + follow = {"mobs:meat_raw", "default:diamond"}, + view_range = 15, + owner = "", + order = "follow", + -- model animation + 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, + }, + -- right clicking with raw meat will give Igor more health + on_rightclick = function(self, clicker) + + -- feed to heal npc + if mobs:feed_tame(self, clicker, 8, false, true) then + return + end + + local item = clicker:get_wielded_item() + local name = clicker:get_player_name() + + -- right clicking with gold lump drops random item from mobs.npc_drops + if item:get_name() == "default:gold_lump" then + + if not minetest.setting_getbool("creative_mode") then + item:take_item() + clicker:set_wielded_item(item) + end + + local pos = self.object:getpos() + pos.y = pos.y + 0.5 + + minetest.add_item(pos, { + name = mobs.igor_drops[math.random(1, #mobs.igor_drops)] + }) + + minetest.chat_send_player(name, S("NPC dropped you an item for gold!")) + + return + end + + -- if owner switch between follow and stand + if self.owner and self.owner == name then + + if self.order == "follow" then + self.order = "stand" + minetest.chat_send_player(name, S("NPC stands still.")) + else + self.order = "follow" + minetest.chat_send_player(name, S("NPC will follow you.")) + end + end + + mobs:capture_mob(self, clicker, 0, 5, 80, false, nil) + end, +}) +-- register spawn egg +mobs:register_egg("mobs_npc:igor", S("Igor"), "mobs_meat_raw.png", 1) + +-- compatibility +mobs:alias_mob("mobs:igor", "mobs_npc:igor") diff --git a/init.lua b/init.lua index 7b46eeb..341a6a2 100644 --- a/init.lua +++ b/init.lua @@ -26,5 +26,6 @@ mobs.intllib = S -- NPC dofile(path .. "/npc.lua") -- TenPlus1 dofile(path .. "/trader.lua") +dofile(path .. "/igor.lua") print (S("[MOD] Mobs Redo 'NPCs' loaded")) diff --git a/textures/mobs_igor.png b/textures/mobs_igor.png new file mode 100644 index 0000000000000000000000000000000000000000..0d9f9c0114a4b9d69b0028b6454d2d96b012b34a GIT binary patch literal 222 zcmeAS@N?(olHy`uVBq!ia0vp^4nVBH!VDw>HYaZfQgQ)4A+A6g2t)-~q@<*-vh%!O zSMz>H&!-bh|6gAB|Nnn2rN6U)(u^fRe!&b5&u*jvIeDHgjv*GOlM^IZ7c;POaA|2a zW;i=KDhP?Vh&cx<=yZfLhRAJaN_-Q>p~RdhGEZR^Q({SF3G1=8V{H|pE#2KqAB8GJ z#?5OBcdT;#>GFq*h4tg?31Kgq?(-&Qu3T6ln!vPyNmavPT0^JcQU(S-Ce>(P#S;Y} OXL`E&xvX}cAAM9kRb*a&Z70EA zH=uA|VTp35fk(iCXo8=F+LdExA#0gFq)vb2#|CIM6pjNx>yR;urF()}E z2`!2|v~k`$qidy&(W)*kWB#J~Yc75puye3i0tm1d*Yj{%ei)nQ8VIm|iC{b}Ka9;Y z8579$JbIda{2d^976d|I*YkxCd|dtjAkRWD4bZusdmzBx{|ayyJnkeU3HtJaTVh-s zrHhjF3h;P5guvw8&<&mY!IO)gU=6KL0jj#}1~K2i<+l)+?z0@al1QYw2;YXa>0xfJ z+^BIY<+xQr5;2u<@p`EWTdjx$PVMp8yA6JKZLHZPnXpvVHX@1vIH60Bga5 zswcw#?em5&Vn8uvJ*cb*z-UdskBfyYfY7!r4v;1MYRNIVZYh00-~`0T86sIvm5~ps zs^SP}-?S7E>>DoV1V9PqtU%V&eUT5+Ws2It9`W=TZBwO|FlM1Xa{1B~=NpR;qSthx z=i-sf2=-DjEv;eCkw$U`3m^SC0`F32*uY6|Z=V=9+t*A>DLl^aZ6dm>1_%u=0~ux9 z_DBPg(6>wr^t4eN=^>)IY9RPp2QrIjr;m@xCJ|E_qh{Z`i2AGnM*t150hp{P4Sicl zoe*eJ?0XkcJ@oYKi{~y*Vjm@S(lkB;0bQ+n0 yexks592)-D$cL($q(M_r1i7V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hyW@gL) zsP^Fj0OseJn%SM9vs2>)hZRF=|0Si>9unUG#|-9ypC&tu!K*I@Br7wwFFPYb+O!l)Q-C85CHWe>3f8Va} zDuSk!it64(-w_;@0OCB(Nc{EVxB2taLCJZvM@F>*h6Wi&op@Bl*y3 z>mvZ!wgt4d+csZzzNGE8tt@R?ZMSU|;LrdxTV2)r7x&g~bxUh=O|G@Kx>A5+wSdxP z>HgBIYpp8XjdXIk#T5&1&;@K4&~3Lsx3)-=-XsWsW6c8W+RqioU{4jtV9!VH5BCST dKji)Z_y-x5q>D}$FggGL002ovPDHLkV1l1-RXhLy literal 0 HcmV?d00001 diff --git a/textures/mobs_igor8.png b/textures/mobs_igor8.png new file mode 100644 index 0000000000000000000000000000000000000000..b30259f63fb3b256daf06e27ad8f0e49bfecdae3 GIT binary patch literal 792 zcmV+z1LypSP)4FEMaG`bf6!xacdNJUIeOYU<3xsPGYk8b{u z0G*$l|DZ3;sea?ChP1Y`@4J-g%%t(mrqtHc^Vz-V>gW0H&Hei7{{Q?X7)s~>0004W zQchC_#U_%sgclqdI)gjlK~T#Q)_G2#agXJE$>Y3>_3aDQvt805F7zC0{Ug{5undr z;P@y7cR4^ZR5>93ei-_mCFBqsr+8f?gaQDxDj}pQAYk}Djz0!lE1(xKHIf5Y-vo+c8)fI0+TmJp!L01V-0Z!eVs2ILS51$6XMBjExlN#d{G{{EwL4kjrh zJ{L+NA@9 W8X_;vXP$uo0000`~YN literal 0 HcmV?d00001