function onKill(cid, target, damage, flags)
local totalFragStorage = 30001 -- storage value to count total frags
local currentFragStorage = 30002 -- storage value to count current frags
local percent = 7
if(isPlayer(cid) and isPlayer(target)) then
local expgain = (getPlayerExperience(target) / 100) * percent
local t_lvl = getPlayerLevel(target)
if getPlayerIp(cid) == getPlayerIp(target) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You killed your friend! No reward for you!")
else
-- Give exp and gold coin
doPlayerAddExp(cid, expgain)
doPlayerAddItem(cid, 2148, t_lvl)
-- And if he is the main killer, give a talon
if(flags % 2 == 1) then
doPlayerAddItem(cid, 2151, 1)
setPlayerStorageValue(cid, totalFragStorage, (getPlayerStorageValue(cid, totalFragStorage) + 1))
setPlayerStorageValue(cid, currentFragStorage, (getPlayerStorageValue(cid, currentFragStorage) + 1))
if getPlayerStorageValue(cid, totalFragStorage) < 1 and getPlayerStorageValue(cid, currentFragStorage) < 1 then -- Incase its their first frag, default is -1 so it needs an additional point to sum up.
setPlayerStorageValue(cid, totalFragStorage, (getPlayerStorageValue(cid, totalFragStorage) + 1))
setPlayerStorageValue(cid, currentFragStorage, (getPlayerStorageValue(cid, currentFragStorage) + 1))
end
-- Reset current frags for the victim
setPlayerStorageValue(target, currentFragStorage, 0)
-- Frag announcer
if getPlayerStorageValue(cid, currentFragStorage) == 1 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"First Blood! "..getPlayerStorageValue(cid, currentFragStorage).." frags!")
doCreatureSay(cid, "First Blood!", TALKTYPE_ORANGE_1)
elseif getPlayerStorageValue(cid, currentFragStorage) == 2 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Double Kill!! "..getPlayerStorageValue(cid, currentFragStorage).." frags!")
doCreatureSay(cid, "Double Kill!!", TALKTYPE_ORANGE_1)
elseif getPlayerStorageValue(cid, currentFragStorage) == 3 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Triple Kill!!! "..getPlayerStorageValue(cid, currentFragStorage).." frags!")
doCreatureSay(cid, "Triple Kill!!!", TALKTYPE_ORANGE_1)
elseif getPlayerStorageValue(cid, currentFragStorage) == 4 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"MULTI KILL! "..getPlayerStorageValue(cid, currentFragStorage).." frags!")
doCreatureSay(cid, "MULTI KILL!", TALKTYPE_ORANGE_1)
elseif getPlayerStorageValue(cid, currentFragStorage) == 5 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"ULTRA KILL!! "..getPlayerStorageValue(cid, currentFragStorage).." frags!")
doCreatureSay(cid, "ULTRA KILL!!", TALKTYPE_ORANGE_1)
elseif getPlayerStorageValue(cid, currentFragStorage) == 5 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"MONSTER KILL!!! "..getPlayerStorageValue(cid, currentFragStorage).." frags!")
doCreatureSay(cid, "MONSTER KILL!!!", TALKTYPE_ORANGE_1)
elseif getPlayerStorageValue(cid, currentFragStorage) >= 7 and getPlayerStorageValue(cid, currentFragStorage) < 9 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Another One...! INSANE! "..getPlayerStorageValue(cid, currentFragStorage).." frags!")
doCreatureSay(cid, "Another One...! INSANE!", TALKTYPE_ORANGE_1)
elseif getPlayerStorageValue(cid, currentFragStorage) == 10 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"UNSTOPABLE! "..getPlayerStorageValue(cid, currentFragStorage).." frags!")
doCreatureSay(cid, "UNSTOPABLE!", TALKTYPE_ORANGE_1)
elseif getPlayerStorageValue(cid, currentFragStorage) >= 11 and getPlayerStorageValue(cid, currentFragStorage) < 19 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"MWUAHAHA! OWNAGE! "..getPlayerStorageValue(cid, currentFragStorage).." frags!")
doCreatureSay(cid, "MWUAHAHA! OWNAGE!", TALKTYPE_ORANGE_1)
elseif getPlayerStorageValue(cid, currentFragStorage) == 20 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"GODLIKE! "..getPlayerStorageValue(cid, currentFragStorage).." frags!")
doCreatureSay(cid, "GODLIKE!", TALKTYPE_ORANGE_1)
elseif getPlayerStorageValue(cid, currentFragStorage) >= 21 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You are the chosen one. "..getPlayerStorageValue(cid, currentFragStorage).." frags!")
doCreatureSay(cid, "Im the chosen one!", TALKTYPE_ORANGE_1)
end
-- Broadcast
if getPlayerStorageValue(cid, currentFragStorage) == 10 then
broadcastMessage(getCreatureName(cid).." is UNSTOPABLE!!")
elseif getPlayerStorageValue(cid, currentFragStorage) == 20 then
broadcastMessage(getCreatureName(cid).." is GODLIKE!!")
end
end
end
end
return true
end
-- function onDeath(cid, corpse, deathList)
-- local cidpos = getPlayerPosition(deathList[1])