1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-11-15 23:10:31 +01:00

Sent death messages through IRC

- Added @paly2 's concept of using the IRC bot in order to send death message in IRC
 - Chmod-ed files
 - Added a fake init.lua to make 'sounds' look like a mod
This commit is contained in:
LeMagnesium 2015-06-19 20:33:47 +02:00
parent af4ff618bb
commit 037ed16c87
4 changed files with 19 additions and 8 deletions

View File

@ -0,0 +1,3 @@
-- I'm adding this file, just to pretend to do something in order to make
-- Minetest think this is a mod and make my local server start..
-- Sincerly, Mg

View File

@ -94,25 +94,33 @@ if RANDOM_MESSAGES == true then
if minetest.is_singleplayer() then if minetest.is_singleplayer() then
player_name = "You" player_name = "You"
end end
local death_message = ""
-- Death by lava -- Death by lava
if node.groups.lava ~= nil then if node.groups.lava ~= nil then
minetest.chat_send_all(player_name .. messages.lava[math.random(1,#messages.lava)] ) death_message = player_name .. messages.lava[math.random(1,#messages.lava)]
-- Death by acid -- Death by acid
elseif node.groups.acid ~= nil then elseif node.groups.acid ~= nil then
minetest.chat_send_all(player_name .. messages.acid[math.random(1,#messages.acid)] ) death_message = player_name .. messages.acid[math.random(1,#messages.acid)]
-- Death by drowning -- Death by drowning
elseif player:get_breath() == 0 and node.groups.water then elseif player:get_breath() == 0 and node.groups.water then
minetest.chat_send_all(player_name .. messages.water[math.random(1,#messages.water)] ) death_message = player_name .. messages.water[math.random(1,#messages.water)]
-- Death by fire -- Death by fire
elseif node.name == "fire:basic_flame" then elseif node.name == "fire:basic_flame" then
minetest.chat_send_all(player_name .. messages.fire[math.random(1,#messages.fire)] ) death_message = player_name .. messages.fire[math.random(1,#messages.fire)]
-- Death in quicksand -- Death in quicksand
elseif player:get_breath() == 0 and node.name == "default:sand_source" or node.name == "default:sand_flowing" then elseif player:get_breath() == 0 and node.name == "default:sand_source" or node.name == "default:sand_flowing" then
minetest.chat_send_all(player_name .. messages.sand[math.random(1,#messages.sand)] ) death_message = player_name .. messages.sand[math.random(1,#messages.sand)]
-- Death by something else -- Death by something else
else else
minetest.chat_send_all(player_name .. messages.other[math.random(1,#messages.other)] ) death_message = player_name .. messages.other[math.random(1,#messages.other)]
end end
-- Actually tell something
minetest.chat_send_all(death_message)
irc:say(death_message)
minetest.sound_play(sounds[math.random(1,#sounds)],{to_player=player:get_player_name(),gain=0.5*soundset.get_gain(player:get_player_name(),"other")}) minetest.sound_play(sounds[math.random(1,#sounds)],{to_player=player:get_player_name(),gain=0.5*soundset.get_gain(player:get_player_name(),"other")})
sound_play_all(player:get_player_name()) sound_play_all(player:get_player_name())
end) end)

0
mods/mobs/dog.lua Normal file → Executable file
View File