local t = {
SKULL_WHITE,
SKULL_RED,
SKULL_BLACK
}
local default_loss_items = getPlayerLossPercent(cid, PLAYERLOSS_ITEMS)
local default_loss_exp = getPlayerLossPercent(cid, PLAYERLOSS_EXPERIENCE)
local default_loss_skills = getPlayerLossPercent(cid, PLAYERLOSS_SKILLS)
local default_loss_containers = getPlayerLossPercent(cid, PLAYERLOSS_CONTAINER)
local default_loss_mana = getPlayerLossPercent(cid, PLAYERLOSS_MANA)
function onDeath(cid, mostDamageKiller)
if isPlayer(mostDamageKiller) == TRUE then
if isInArray(t, getCreatureSkullType(cid)) == FALSE then
lvl = getPlayerLevel(cid)
lvl_killer = getPlayerLevel(mostDamageKiller)
if lvl >= (lvl_killer*0.2) then
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, default_loss_exp * 0.4)
doPlayerSetLossPercent(cid, PLAYERLOSS_MANA, default_loss_mana * 0.4)
doPlayerSetLossPercent(cid, PLAYERLOSS_SKILLS, default_loss_skills * 0.4)
doPlayerSetLossPercent(cid, PLAYERLOSS_CONTAINER, default_loss_containers * 0.4)
doPlayerSetLossPercent(cid, PLAYERLOSS_ITEMS, default_loss_items * 0.4)
setPlayerStorageValue(cid, 58401, 1)
elseif lvl >= (lvl_killer*0.4) then
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, default_loss_exp * 0.6)
doPlayerSetLossPercent(cid, PLAYERLOSS_MANA, default_loss_mana * 0.6)
doPlayerSetLossPercent(cid, PLAYERLOSS_SKILLS, default_loss_skills * 0.6)
doPlayerSetLossPercent(cid, PLAYERLOSS_CONTAINER, default_loss_containers * 0.6)
doPlayerSetLossPercent(cid, PLAYERLOSS_ITEMS, default_loss_items * 0.6)
setPlayerStorageValue(cid, 58402, 1)
elseif lvl >= (lvl_killer*0.6) then
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, default_loss_exp * 0.8)
doPlayerSetLossPercent(cid, PLAYERLOSS_MANA, default_loss_mana * 0.8)
doPlayerSetLossPercent(cid, PLAYERLOSS_SKILLS, default_loss_skills * 0.8)
doPlayerSetLossPercent(cid, PLAYERLOSS_CONTAINER, default_loss_containers * 0.8)
doPlayerSetLossPercent(cid, PLAYERLOSS_ITEMS, default_loss_items * 0.8)
setPlayerStorageValue(cid, 58403, 1)
else
return TRUE
end
end
end
end