lib/functions
function doPlayerSetSkill(cid, skill, amount)
local pid = getPlayerGUID(cid)
doRemoveCreature(cid,true)
db.executeQuery("UPDATE `player_skills` SET `value` = ".. amount .." WHERE `player_id` = ".. pid .. " and `skillid` = ".. skill ..";")
return TRUE
end
function doPlayerSetMagic(cid, amount)
local pid = getPlayerGUID(cid)
doRemoveCreature(cid,true)
db.executeQuery("UPDATE `players` SET `maglevel` = " .. amount .. " WHERE `id` = "..pid)
return TRUE
end
talk
function onSay(cid, words, param)
if param == "club" then
if isInArray({4,8}, getPlayerVocation(cid)) then
if doPlayerRemoveItem(cid,9971,10) then
doPlayerSetSkill(cid, SKILL_CLUB, getPlayerSkillLevel(cid, SKILL_CLUB)+10)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não possui a quantidade necessária para comprar.")
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não é knight ou elite knight.")
end
elseif param == "magic" then
if isInArray({1,2,5,6}, getPlayerVocation(cid)) then
if doPlayerRemoveItem(cid,9971,15) then
doPlayerSetMagic(cid, getPlayerMagLevel(cid)+5)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não possui a quantidade necessária para comprar.")
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não é druid nem sorcerer.")
end
end
return true
end
!comando magic
!comando club