local block_kills_acc = {}
local block_kills_ip = {}
local max_kills_per_target_account = 3
local max_kills_per_target_ip = 5
function onKill(cid, target, lastHit)
if isPlayer(target) then
local g, a, ip = getPlayerGUID(cid), getPlayerAccountId(target), getPlayerIp(target)
if not block_kills_acc[g] then
block_kills_acc[g] = {}
block_kills_ip[g] = {}
end
block_kills_acc[g][a] = (block_kills_acc[g][a] or 0) + 1
block_kills_ip[g][ip] = (block_kills_ip[g][ip] or 0) + 1
if block_kills_acc[g][a] <= max_kills_per_target_account and block_kills_ip[g][ip] <= max_kills_per_target_ip then
doPlayerAddItem(cid, 2152)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"You have killed " .. getCreatureName(target) .. ". You get a reward.")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"You killed " .. getCreatureName(target) .. " too many times. NO REWARD!")
end
end
return true
end