local cfg = {
level = 200,
item = xxx,
itemName = "item",
startHp = 150,
startMana = 0,
}
local attr = {
sor ={mana = 30,
health = 5,
},
dru ={mana = 30,
health = 5,
},
pal ={
mana = 15,
health = 10,
},
kni ={
mana = 5,
health = 15,
},
}
function onSay(cid, words, param)
local pos = getPlayerPosition(cid),
local voc = getPlayerVocation(cid),
local pLevel = getPlayerLevel(cid)
if not getPlayerItemCount(cid, item) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need "..itemName.." to use this command.")
return false
end
if pLevel < cfg.level then
doSendMagicEffect(pos, 2)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your level is too low. Require level is " ..cfg.level.. "")
return false
end
if param = "" then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This command require vocation in param.")
return false
elseif param = "knight" then
hp = (pLevel - 1)*attr.kni.health
mp = (pLevel - 1)*attr.kni.mana
setCreatureMaxHealth(cid, hp)
setCreatureMaxMana(cid, mp)
doCreatureAddHealth(cid, hp)
doCreatureAddMana(cid, mp)
doPlayerSetVocation(cid, 4)
elseif param = "paladin" then
hp = (pLevel - 1)*attr.pal.health
mp = (pLevel - 1)*attr.pal.mana
setCreatureMaxHealth(cid, hp)
setCreatureMaxMana(cid, mp)
doCreatureAddHealth(cid, hp)
doCreatureAddMana(cid, mp)
doPlayerSetVocation(cid, 3)
elseif param = "druid" then
hp = (pLevel - 1)*attr.dru.health
mp = (pLevel - 1)*attr.dru.mana
setCreatureMaxHealth(cid, hp)
setCreatureMaxMana(cid, mp)
doCreatureAddHealth(cid, hp)
doCreatureAddMana(cid, mp)
doPlayerSetVocation(cid, 2)
elseif param = "mag" then
hp = (pLevel - 1)*attr.mag.health
mp = (pLevel - 1)*attr.mag.mana
setCreatureMaxHealth(cid, hp)
setCreatureMaxMana(cid, mp)
doCreatureAddHealth(cid, hp)
doCreatureAddMana(cid, mp)
doPlayerSetVocation(cid, 1)
end
return true
end