function onKill(cid, target)
local lvl = getPlayerLevel(cid) --players level
local nlvl = getPlayerLevel(cid) + 5 -- add 5 levels
local config = {
useExpStages = true,
stages = {
[1] = {min = 150, max = 180, rate = 10},
[2] = {min = 181, max = 200, rate = 5},
[3] = {min = 200, max = false, rate = 1}
}
}
local exprate = 1
stg = config.stages
for x=1,table.maxn(config.stages) do
if lvl >= stg[x].min then
if stg[x].max == false or stg[x].max <= lvl then
exprate = stg[x].rate
break
end
end
end
if isPlayer(target) == TRUE then
if getPlayerIp(cid) ~= getPlayerIp(target) then
local exp = (50 * (lvl) * (lvl) * (lvl) - 150 * (lvl) * (lvl) + 400 * (lvl)) / 5
local nexp = (50 * (nlvl) * (nlvl) * (nlvl) - 150 * (nlvl) * (nlvl) + 400 * (nlvl)) / 5
local newexp = nexp - exp
doPlayerAddExp(cid, config.useExpStages and newexp*exprate or newexp)
doSendAnimatedText(getPlayerPosition(cid), "+EXP!", 198)
else
doPlayerAddExperience(cid, -50000)
doSendAnimatedText(getPlayerPosition(cid), "-EXP!", 198)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You have been punished for killing a player of the same IP.")
end
end
return TRUE
end
Nao testei.


info
Grupo: Campones
Registrado: 08/10/11
Posts: 17
Reputação: +9
Char no Tibia: umdoistresindiosinhos
Bom, estou fazendo um OT de war. mais não está subindo experiencia para os players quando se matam... quero uma tipo stage ex: (level 150 ganha 10 de xp) 180 (5 de xp) 200 (1 de xp)
SÓ UM EXEMPLO...
creio eu que seja nessa config:
end