2013-07-27 11:24:03 -04:00
|
|
|
function OnKilling(Victim, Killer)
|
|
|
|
if Victim:IsPlayer() then
|
|
|
|
SetBackCoordinates( Victim )
|
|
|
|
Server = cRoot:Get():GetServer()
|
|
|
|
if Killer == nil then
|
2013-08-02 02:48:47 -04:00
|
|
|
if Victim:GetWorld():GetBlock(Victim:GetPosX(), Victim:GetPosY(), Victim:GetPosZ()) == 10 or Victim:GetWorld():GetBlock(Victim:GetPosX(), Victim:GetPosY(), Victim:GetPosZ()) == 11 then
|
2013-07-31 12:10:59 -04:00
|
|
|
Server:SendMessage( cChatColor.Red .. "[FATALITY] " .. cChatColor.White .. Victim:GetName() .. " tried to swim in lava (and failed)" )
|
2013-07-27 11:24:03 -04:00
|
|
|
CheckHardcore(Victim)
|
|
|
|
return false
|
|
|
|
end
|
2013-07-31 12:10:59 -04:00
|
|
|
if Victim:IsOnFire() then
|
|
|
|
Server:SendMessage( cChatColor.Red .. "[FATALITY] " .. cChatColor.White .. Victim:GetName() .. " was burnt to a cinder" )
|
2013-07-27 11:24:03 -04:00
|
|
|
CheckHardcore(Victim)
|
|
|
|
return false
|
|
|
|
end
|
|
|
|
else
|
|
|
|
if Killer:IsPlayer() then
|
2013-07-31 12:10:59 -04:00
|
|
|
Server:SendMessage( cChatColor.Red .. "[FATALITY] " .. cChatColor.White .. Victim:GetName() .. " was terminated by " .. Killer:GetName() )
|
2013-07-27 11:24:03 -04:00
|
|
|
CheckHardcore(Victim)
|
|
|
|
return false
|
|
|
|
elseif Killer:IsMob() then
|
|
|
|
if Killer:IsA("cZombie") then
|
2013-07-31 12:10:59 -04:00
|
|
|
Server:SendMessage( cChatColor.Red .. "[FATALITY] " .. cChatColor.White .. Victim:GetName() .. " was eaten by a zombie")
|
2013-07-27 11:24:03 -04:00
|
|
|
elseif Killer:IsA("cSkeleton") then
|
2013-07-31 12:10:59 -04:00
|
|
|
Server:SendMessage( cChatColor.Red .. "[FATALITY] " .. cChatColor.White .. Victim:GetName() .. " was shot by a skeleton" )
|
2013-07-27 11:24:03 -04:00
|
|
|
elseif Killer:IsA("cCreeper") then
|
2013-07-31 12:10:59 -04:00
|
|
|
Server:SendMessage( cChatColor.Red .. "[FATALITY] " .. cChatColor.White .. Victim:GetName() .. " was blown up by a creeper")
|
2013-07-27 11:24:03 -04:00
|
|
|
elseif Killer:IsA("cSpider") then
|
2013-07-31 12:10:59 -04:00
|
|
|
Server:SendMessage( cChatColor.Red .. "[FATALITY] " .. cChatColor.White .. Victim:GetName() .. " was ripped apart by a giant spider")
|
2013-07-27 11:24:03 -04:00
|
|
|
elseif Killer:IsA("cCaveSpider") then
|
2013-07-31 12:10:59 -04:00
|
|
|
Server:SendMessage( cChatColor.Red .. "[FATALITY] " .. cChatColor.White .. Victim:GetName() .. " was poisoned by a giant cave spider")
|
2013-07-27 11:24:03 -04:00
|
|
|
elseif Killer:IsA("cBlaze") then
|
2013-07-31 12:10:59 -04:00
|
|
|
Server:SendMessage( cChatColor.Red .. "[FATALITY] " .. cChatColor.White .. Victim:GetName() .. " was flamed by a blaze")
|
2013-07-27 11:24:03 -04:00
|
|
|
elseif Killer:IsA("cEnderman") then
|
2013-07-31 12:10:59 -04:00
|
|
|
Server:SendMessage( cChatColor.Red .. "[FATALITY] " .. cChatColor.White .. Victim:GetName() .. " was " .. cChatColor.Random .. " by an enderman")
|
2013-07-27 11:24:03 -04:00
|
|
|
elseif Killer:IsA("cSilverfish") then
|
2013-07-31 12:10:59 -04:00
|
|
|
Server:SendMessage( cChatColor.Red .. "[FATALITY] " .. cChatColor.White .. Victim:GetName() .. " encountered an unexpectedly fatal silverfish attack")
|
2013-07-27 11:24:03 -04:00
|
|
|
elseif Killer:IsA("cSlime") then
|
2013-07-31 12:10:59 -04:00
|
|
|
Server:SendMessage( cChatColor.Red .. "[FATALITY] " .. cChatColor.White .. Victim:GetName() .. " was absorbed and digested by a slime")
|
2013-07-27 11:24:03 -04:00
|
|
|
elseif Killer:IsA("cWitch") then
|
2013-07-31 12:10:59 -04:00
|
|
|
Server:SendMessage( cChatColor.Red .. "[FATALITY] " .. cChatColor.White .. Victim:GetName() .. " was enchanted (to death) by a witch")
|
2013-07-27 11:24:03 -04:00
|
|
|
elseif Killer:IsA("cZombiepigman") then
|
2013-07-31 12:10:59 -04:00
|
|
|
Server:SendMessage( cChatColor.Red .. "[FATALITY] " .. cChatColor.White .. Victim:GetName() .. " was slain by a zombie pigman")
|
2013-07-27 11:24:03 -04:00
|
|
|
elseif Killer:IsA("cMagmacube") then
|
2013-07-31 12:10:59 -04:00
|
|
|
Server:SendMessage( cChatColor.Red .. "[FATALITY] " .. cChatColor.White .. Victim:GetName() .. " was incinerated by a magmacube")
|
2013-07-27 11:24:03 -04:00
|
|
|
elseif Killer:IsA("cWolf") then
|
2013-07-31 12:10:59 -04:00
|
|
|
Server:SendMessage( cChatColor.Red .. "[FATALITY] " .. cChatColor.White .. Victim:GetName() .. " was savaged by a wolf")
|
2013-07-27 11:24:03 -04:00
|
|
|
end
|
|
|
|
CheckHardcore(Victim)
|
|
|
|
return false
|
|
|
|
end
|
|
|
|
end
|
2013-07-31 12:10:59 -04:00
|
|
|
Server:SendMessage( cChatColor.Red .. "[FATALITY] " .. cChatColor.White .. Victim:GetName() .. " died of mysterious circumstances")
|
2013-07-27 11:24:03 -04:00
|
|
|
CheckHardcore(Victim)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
function CheckHardcore(Victim)
|
|
|
|
if HardCore == "true" then
|
|
|
|
if Victim:IsPlayer() == true then
|
|
|
|
local KilledPlayer = tolua.cast(Victim, "cPlayer")
|
|
|
|
BanPlayer(KilledPlayer:GetName(), "You died, haha. Good game, bro.")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|