Função para mudar a quantidade de skills ou magic level do jogador.
lib/050-function
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
exemplo de uso
function onSay(cid, words, param) return doPlayerSetMagic(cid, 100) -- mudara o magic level do jogador para 100 end
vocês também podem fazer calculo para adicionar por exemplo +10 de magic level ou skills,muito facil
function onSay(cid, words, param) local add = 10 -- quanto vc quer adicionar de magic level doPlayerSetMagic(cid, getPlayerMagLevel(cid)+add) return TRUE end
agora a função para skill:
lista:
SKILL_FIST (0) = Fist Fighting
SKILL_CLUB (1) = Club Fighting
SKILL_SWORD (2) = Sword Fighting
SKILL_AXE (3) = Axe Fighting
SKILL_DISTANCE (4) = Distance Fighting
SKILL_SHIELD (5) = Shielding
SKILL_FISHING (6) = Fishing
ex:
function onSay(cid, words, param) return doPlayerSetSkill(cid, 2, 50) -- mudei a skill de sword do jogador para 50 end
ou add + x de skill...
ex adicionando + 5 de skill sword
function onSay(cid, words, param) return doPlayerSetSkill(cid, SKILL_SWORD, getPlayerSkillLevel(cid, SKILL_SWORD)+5) -- adicionei 5 de skill de sword end