Restles
fallen human nature
hello, i need up this to new version, is possible?
LUA:
local profesions = {
{vocid=1, newvoc=2, mana=11, looktype=8, backhp=451, backmp=523},
}
local value = {}
function onThink(cid, interval)
for i=1, #profesions do
value = profesions[i]
if(getPlayerVocation(cid) == value.vocid) then
if(getCreatureMana(cid) >= value.mana) then
if(getPlayerStorageValue(cid, 504205) <= os.time()) then
setPlayerStorageValue(cid, 504205, os.time() + 2)
doCreatureAddMana(cid, -value.mana)
end
else
local outfit = getCreatureOutfit(cid)
outfit.lookType = value.looktype
doCreatureChangeOutfit(cid, outfit)
doPlayerSetVocation(cid, value.newvoc)
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)-value.backhp)
doCreatureAddHealth(cid, -value.backhp)
setCreatureMaxMana(cid, getCreatureMaxMana(cid)-value.backmp)
doCreatureAddMana(cid, -value.backmp)
end
end
end
return true
end