local EXPAURA = {
aura_effect = 11,
gain_effect = 14,
spawn_chance = 40,
use_specific_time = false -- Caso use, apenas adicione o tempo em segundos.
}
EXPAURA.doEvent = function(data)
if getThingPos(data.cid).x == data.pos.x and getThingPos(data.cid).y == data.pos.y and getThingPos(data.cid).z == data.pos.z then
doPlayerSendTextMessage(data.cid, 25, "You gain " .. data.exp .. " experience bonus.")
doSendMagicEffect(data.pos, EXPAURA.gain_effect)
return true
else
doSendMagicEffect(data.pos, EXPAURA.aura_effect)
doSendAnimatedText(data.pos, "+" .. data.exp .. " exp", TEXTCOLOR_GREEN)
if data.time > 0 then
data.time = data.time - 1
return addEvent(EXPAURA.doEvent, 1000, data)
end
end
end
function onKill(cid, target, lastHit)
if isMonster(target) and getMonsterInfo(getCreatureName(target)) and math.random(100) <= EXPAURA.spawn_chance then
EXPAURA.doEvent({
cid = cid,
pos = getThingPos(target),
exp = getMonsterInfo(getCreatureName(target)).experience,
time = (not EXPAURA.use_specific_time) and getItemInfo(getMonsterInfo(getCreatureName(target)).lookCorpse).decayTime or EXPAURA.use_specific_time
})
end
return true
end