local scrolls = { ["Magic Level Scroll"] = {skill = SKILL__MAGLEVEL, duration = 7, multiplier = 1.5}, ["Fist Fighting Scroll"] = {skill = SKILL__FIST, duration = 7, multiplier = 1.5}, ["Club Fighting Scroll"] = {skill = SKILL__CLUB, duration = 7, multiplier = 1.5}, ["Sword Fighting Scroll"] = {skill = SKILL__SWORD, duration = 7, multiplier = 1.5}, ["Axe Fighting Scroll"] = {skill = SKILL__AXE, duration = 7, multiplier = 1.5}, ["Distance Fighting Scroll"] = {skill = SKILL__DISTANCE, duration = 7, multiplier = 1.5}, ["Shielding Scroll"] = {skill = SKILL__SHIELD, duration = 7, multiplier = 1.5} } function onUse(cid, item, fromPosition, itemEx, toPosition) local scroll = scrolls[itemEx.itemid] if scroll then if not doPlayerAddSkillTry(cid, scroll.skill, 0) then doPlayerSendCancel(cid, "You already have this skill at maximum.") return true end if doPlayerAddSkill(cid, scroll.skill, scroll.multiplier * getPlayerSkillLevel(cid, scroll.skill)) then doRemoveItem(item.uid) doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_BLUE) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have received a boost of " .. tostring(scroll.multiplier * 100) .. "% to your " .. getItemNameById(itemEx.itemid) .. " skill for 7 days.") setPlayerStorageValue(cid, 1000 + scroll.skill, 1) addEvent(function(cid, skill) if isPlayer(cid) then doPlayerRemoveSkill(cid, skill) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your boost to " .. getItemNameById(itemEx.itemid) .. " skill has worn off.") setPlayerStorageValue(cid, 1000 + skill, -1) end end, scroll.duration * 24 * 3600 * 1000, cid, scroll.skill) else doPlayerSendCancel(cid, "You cannot use this item right now.") end end return true end




info
Grupo: Campones
Registrado: 11/12/17
Posts: 24
Reputação: +1
Gênero: Masculino
Queria que o player ao usar o pergaminho ele ganhasse 50% de velocidade para upar as skill por 7 dias (item consumível).
Se possivel:
Pergaminho: Magic Leve
Pergaminho: Fist, Club, Sword, Axe, Distance
Pergaminho: Shielding