As with so well I do not know the procedure to write on the new lua I decided that it will write to you with a request to rewrite the script for the new version
@Limos @Printer Are you able to help?
Code:
Trans = {
{["voc"] = 1, ["newVoc"] = 2, ["level"] = 30, ["mananeed"] = 20, ["looktype"] = 45, ["addHp"] = 50, ["addMp"] = 100},
{["voc"] = 2, ["newVoc"] = 3, ["level"] = 50, ["mananeed"] = 20, ["looktype"] = 25, ["addHp"] = 100, ["addMp"] = 200}
}
function onCastSpell(cid, var)
for i = 1, #Trans do
if getPlayerVocation(cid) == Trans[i].voc then
if getPlayerLevel(cid) >= Trans[i].level then
if getPlayerMana(cid) >= Trans[i].mananeed then
if(Trans) then
doCreatureChangeOutfit(cid, {lookType=Trans[i].looktype})
else
doSetCreatureOutfit(cid, {lookType=Trans[i].looktype}, -1)
end
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + Trans[i].addHp)
setCreatureMaxMana(cid, getCreatureMaxMana(cid) + Trans[i].addMp)
doCreatureAddHealth(cid, Trans[i].addHp)
doCreatureAddMana(cid, Trans[i].addMp)
doPlayerSetVocation(cid,Trans[i].newVoc)
return true
else
doPlayerSendCancel(cid, "You need " .. Trans[i].mananeed .. " mana to transform!")
doSendMagicEffect(getCreaturePosition(cid), 2)
return true
end
else
doPlayerSendCancel(cid, "You need " .. Trans[i].level .. " level to transform!")
doSendMagicEffect(getCreaturePosition(cid), 2)
return true
end
end
end
doSendMagicEffect(getCreaturePosition(cid), 2)
return true
end