local kstreak = {
[COLOR=Red][1] =[/COLOR] {kills = 2, msg = "Double Kill!"},
[COLOR=Red][2] =[/COLOR] {kills = 3, msg = "Triple Kill!"},
[COLOR=Red][4] =[/COLOR] {kills = 4, msg = "Quad Kill!"},
[COLOR=Red][5] =[/COLOR] {kills = 5, msg = "M-M-M-Monster Kill!!"},
[COLOR=Red][6] =[/COLOR] {kills = 6, msg = "BLOODBATH!"},
[COLOR=Red][7] =[/COLOR] {kills = 7, msg = "UNSTOPPABLE!"},
[COLOR=Red] [8] =[/COLOR] {kills = 8, msg = "GODLIKE!!"}} -- Will be sent if you got this much kills or more.
local dstreak = {
[COLOR=Red] [1] [/COLOR]= {deaths = 2, msg = "on a death streak of 2 deaths in a row!"},
[COLOR=Red] [2][/COLOR] = {deaths = 3, msg = "on a death streak of 3 deaths in a row!"},
[COLOR=Red] [3][/COLOR] = {deaths = 4, msg = "on a death streak of 4 deaths in a row!"},
[COLOR=Red] [4][/COLOR] = {deaths = 5, msg = "on a death streak of 5 deaths in a row!"},
[COLOR=Red] [5][/COLOR] = {deaths = 6, msg = "on a death streak of 6 or more deaths in a row!"}} -- Will be sent when you got this much deaths or more.
function onKill(cid, target, lastHit)
-- for k = kstreak[1], kstreak[math.max(1, #kstreak)] do
-- for d = dstreak[1], dstreak[math.max(1, #dstreak)] do
[COLOR=Red]for k = kstreak[1], kstreak[#kstreak] do
for d = dstreak[1], dstreak[#dstreak] do[/COLOR]
local vk = kstreak[#kstreak]
local vd = dstreak[#dstreak]
if getPlayerStorageValue(cid, cfg.kills) == vk.kills then
for _, tid in ipairs(getOnlinePlayers()) do
doPlayerSendChannelMessage(tid, "Streaks", getPlayerName(cid) .. " - " .. vk.msg, TALKTYPE_CHANNEL_O, cfg.channel)
end
elseif getPlayerStorageValue(cid, cfg.kills) > k.kills then
for _, tid in ipairs(getOnlinePlayers()) do
doPlayerSendChannelMessage(tid, "Streaks", getPlayerName(cid) .. " - " .. k.msg, TALKTYPE_CHANNEL_O, cfg.channel)
end
end
if getPlayerStorageValue(target, cfg.deaths) == vd.deaths then
for _, tid in ipairs(getOnlinePlayers()) do
doPlayerSendChannelMessage(tid, "Streaks", getPlayerName(target) .. " - " .. vd.msg, TALKTYPE_CHANNEL_O, cfg.channel)
end
elseif getPlayerStorageValue(target, cfg.deaths) > d.deaths then
for _, tid in ipairs(getOnlinePlayers()) do
doPlayerSendChannelMessage(tid, "Streaks", getPlayerName(target) .. " - " .. d.msg, TALKTYPE_CHANNEL_O, cfg.channel)
end
end
--end
--end
if isPlayer(cid) then
setPlayerStorageValue(cid, cfg.kills, getPlayerStorageValue(cid, cfg.kills)+1)
setPlayerStorageValue(cid, cfg.deaths, 0) -- reseting death streak because you killed someone.
if cfg.useReplenish then
if getPlayerStorageValue(cid, cfg.kills) >= cfg.replenish_reqKills and getPlayerStorageValue(cid, cfg.replenish_alreadyGiven) ~= 1 then
setPlayerStorageValue(cid, cfg.replenish_chargeStorage, cfg.replenish_charges)
setPlayerStorageValue(cid, cfg.replenish_alreadyGiven, 1)
end
end
if cfg.useImmortality then
if getPlayerStorageValue(cid, cfg.kills) >= cfg.immortal_reqKills and getPlayerStorageValue(cid, cfg.immortal_alreadyGiven) ~= 1 then
setPlayerStorageValue(cid, cfg.immortal_chargeStorage, cfg.immortal_charges)
setPlayerStorageValue(cid, cfg.immortal_alreadyGiven, 1)
end
end
if cfg.useInvisibility then
if getPlayerStorageValue(cid, cfg.kills) >= cfg.invisible_reqKills and getPlayerStorageValue(cid, cfg.invisible_alreadyGiven) ~= 1 then
setPlayerStorageValue(cid, cfg.invisible_cargeStorage, cfg.invisible_charges)
setPlayerStorageValue(cid, cfg.invisible_alreadyGiven, 1)
end
end
end
if isPlayer(target) then
if cfg.useExplodeOnDeath and getPlayerStorageValue(target, cfg.kills) >= cfg.killsToExplode then
local fromPos = {getPlayerPosition(target).x-cfg.bomb_area[1], getPlayerPosition(target).y-cfg.bomb_area[2], getPlayerPosition(target).z}
local toPos = {getPlayerPosition(target).x+cfg.bomb_area[1], getPlayerPosition(target).y+cfg.bomb_area[2], getPlayerPosition(target).z}
for x = fromPos[1], toPos[1] do
for y = fromPos[2], toPos[2] do
for z = fromPos[3], toPos[3] do
local explode = {x=x, y=y, z=z, stackPos=253}
local getCreatures = getTopCreature(explode).uid
setPlayerStorageValue(target, cfg.deaths, getPlayerStorageValue(target, cfg.deaths)+1)
setPlayerStorageValue(target, cfg.kills, 0) -- reseting kill streak because you died.
doSendMagicEffect(explode, cfg.explodeEffect)
if isCreature(getCreatures) then
doCreatureAddHealth(getCreatures, -cfg.explodeDamage)
end
end
end
end
else
setPlayerStorageValue(target, cfg.deaths, getPlayerStorageValue(target, cfg.deaths)+1)
setPlayerStorageValue(target, cfg.kills, 0) -- reseting kill streak because you died.
end
end
return true
end