Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onKill(cid, target)
- local ringId = 8302
- local percent = 0.25 -- 25%
- local maxExp = 150000 -- quando ele checar a isso de exp o ring é deletado
- local exp = getExperienceStage(getPlayerLevel(cid), getVocationInfo(getPlayerVocation(cid)).experienceMultiplier)
- local count = math.floor(((getMonsterInfo(string.lower(getCreatureName(target))).experience * exp) * percent))
- if(getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid == ringId) then
- if(getPlayerStorageValue(cid, 738921) < maxExp) then
- doPlayerAddExperience(cid, count)
- doSendAnimatedText(getThingPosition(cid), "+ " .. count, math.random(50, 60))
- setPlayerStorageValue(cid, 738921, getPlayerStorageValue(cid, 738921) + count)
- else
- doPlayerSendTextMessage(cid, 27, "Você já chegou ao máximo permitido, compre um anel novo.")
- doRemoveItem(getPlayerSlotItem(cid, CONST_SLOT_AMMO).uid)
- setPlayerStorageValue(cid, 738921, 0)
- end
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment