dofile("./config.lua")
local function addSkill(cid, vocationFactor, skillid, skillAmount)
for i = 1, skillAmount do
[COLOR="#B22222"]local triesToNextAdvance = (50*math.pow(vocationFactor, (getPlayerSkill(cid, skillid)-10))) / rateSkill[/COLOR]
doPlayerAddSkillTry(cid, skillid, triesToNextAdvance)
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have gained " .. skillAmount .. " fist fighting skills!")
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
local voc = getPlayerVocation(cid)
if voc == 1 or voc == 5 or voc == 0 then -- sorc or rookgaardians
addSkill(cid, 1.5, SKILL_FIST, 1)
elseif voc == 2 or voc == 6 then -- druid
addSkill(cid, 1.5, SKILL_FIST, 1)
elseif voc == 3 or voc == 7 then -- paladin
addSkill(cid, 1.2, SKILL_FIST, 1)
elseif voc == 4 or voc == 8 then -- knight
addSkill(cid, 1.1, SKILL_FIST, 1)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, you are not ready to use this item yet.")
end
return TRUE
end