LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local config = {
levelReq = 20000,
toLevel = 5000,
RebornItem = 2141,
playerVoc = getPlayerVocation(cid)
}
-- No more configurable (Exp, Health, and Mana calculated) --
if getPlayerStorageValue(cid, 15313) == -1 and getPlayerLevel(cid) == config.levelReq and getPlayerItemCount(cid, config.RebornItem) >= 1 then
if config.playerVoc == 1 then
doPlayerAddExperience(cid, -131212504250000)
doPlayerSendTextMessage(cid, 22, "You\'ve been reborn")
doPlayerRemoveItem(cid, config.RebornItem, 1)
setCreatureMaxHealth(cid, 25145)
setCreatureMaxMana(cid, 149795)
elseif config.playerVoc == 2 then
doPlayerAddExperience(cid, -131212504250000)
doPlayerSendTextMessage(cid, 22, "You\'ve been reborn")
doPlayerRemoveItem(cid, config.RebornItem, 1)
setCreatureMaxHealth(cid, 25145)
setCreatureMaxMana(cid, 149795)
elseif config.playerVoc == 3 then
doPlayerAddExperience(cid, -131212504250000)
doPlayerSendTextMessage(cid, 22, "You\'ve been reborn")
doPlayerRemoveItem(cid, config.RebornItem, 1)
setCreatureMaxHealth(cid, 50105)
setCreatureMaxMana(cid, 74915)
elseif config.playerVoc == 4 then
doPlayerAddExperience(cid, -131212504250000)
doPlayerSendTextMessage(cid, 22, "You\'ve been reborn")
doPlayerRemoveItem(cid, config.RebornItem, 1)
setCreatureMaxHealth(cid, 75065)
setCreatureMaxMana(cid, 24995)
else
doPlayerSendCancel(cid, "You don\'t have the required Vocation.")
end
setPlayerStorageValue(cid, 15313, 1)
else
doPlayerSendCancel(cid, "You\'re not ready to take your reborn or you\'re already reborned!")
return true
end
end
Last edited: