Jump to content

Search the Community

Showing results for tags 'corte de len'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • xTibia - Notícias e Suporte
    • Regras
    • Noticias
    • Soluções
    • Projetos Patrocinados
    • Tutoriais para Iniciantes
    • Imprensa
  • OTServ
    • Notícias e Debates
    • OTServlist
    • Downloads
    • Recursos
    • Suporte
    • Pedidos
    • Show-Off
    • Tutoriais
  • OFF-Topic
    • Barzinho do Éks
    • Design
    • Informática

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Sou

Found 1 result

  1. Eae pessoal do Xtibia entao, eu vi um sistema de corte de lenha igual o pxg que muda de outfit e queria tirar a parte que muda de outfit e colocar em outro script. Sistema Pxg que troca outfit function onUse(cid, item, frompos, item2, topos) local chance = 3 -- chance de cortarlocal madeiras = {12782} -- item que o player irá ganharlocal premio = madeiras[math.random(1, #madeiras)]local transformItem = 12791local level = 30,local skill = SKILL_AXE,local skillReq = 10,local texts = {"Toc"} -- texto que irá aparecer quando usar o itemlocal random = texts[math.random(1,#texts)]local time = 1 -- Minutos para crescer novamente local outfit = 368 -- ID da Outfit Male.local outfit2 = 369 -- ID da Outfit Female. if getPlayerSex(cid) == 1 then doSetCreatureOutfit(cid, {lookType = outfit}, 5000) -- Tempo em que a outfit estará trocada. else doSetCreatureOutfit(cid, {lookType = outfit2}, 5000) -- Tempo em que a outfit estará trocada.enddoCreatureSetNoMove(cid, true)addEvent(function() if not isPlayer(cid) then return true end doCreatureSetNoMove(cid, false)end, 5000) if item2.itemid == 12788 thenif math.random(1,100) >= chance thenaddEvent(doPlayerAddItem, time*10*100, cid, premio, math.random(2, 10))doTransformItem(item2.uid, transformItem)addEvent(doPlayerSendTextMessage, time*10*100, cid, 22, "Voce coletou algumas madeiras.")doDecayItem(item2.uid)addEvent(doCreateItem, time*60*5000, item2.uid, item2.itemid, 1, getThingPos(item2.uid))elsedoSendAnimatedText(topos, ""..random.."", TEXTCOLOR_GREEN)addEvent(doPlayerSendTextMessage, time*10*100, cid,22,"Voce nao conseguiu cortar.")endendreturn trueend E o sistema que eu quero colocar a troca de outfit local multi = 10 -- multiplicador de tries pra ganhar no skill (2x + rapido de upar)cortar = {} -- players que estao no evento de cortar arvore continuamente local tree = { [187] = {itemid = 187, dead = 189, level = 00, logs = 2111, minlog = 03, maxlog = 05, hard = 1.0, regmin = 050, regmax = 080}, -- cedar [188] = {itemid = 188, dead = 190, level = 05, logs = 2111, minlog = 05, maxlog = 07, hard = 1.0, regmin = 080, regmax = 105}, -- cedar [191] = {itemid = 191, dead = 193, level = 20, logs = 2680, minlog = 03, maxlog = 05, hard = 1.6, regmin = 100, regmax = 160}, -- oak [192] = {itemid = 192, dead = 195, level = 25, logs = 2680, minlog = 05, maxlog = 07, hard = 1.6, regmin = 130, regmax = 190}, -- oak [196] = {itemid = 196, dead = 198, level = 35, logs = 2674, minlog = 03, maxlog = 05, hard = 1.9, regmin = 270, regmax = 350}, -- teak [197] = {itemid = 197, dead = 199, level = 40, logs = 2674, minlog = 05, maxlog = 07, hard = 1.9, regmin = 300, regmax = 380}, -- teak }local breac = { -- machados [2430] = {skill = 00, soul = 1, breakchance = 00250, bonus = 1.0}, [2428] = {skill = 15, soul = 1, breakchance = 00600, bonus = 1.2}, [2427] = {skill = 30, soul = 1, breakchance = 01500, bonus = 1.6}, [2431] = {skill = 45, soul = 1, breakchance = 03000, bonus = 1.8}, [2432] = {skill = 60, soul = 1, breakchance = 06000, bonus = 2.2}, } if not WoodcuttingSkill then WoodcuttingSkill = SKILLClass:new(SKILL_CONST.IDS.WOODCUTTING)endfunction onUse(cid, item, fromPosition, itemEx, toPosition) WoodcuttingSkill:update(cid) if not tree[itemEx.itemid] then ---- I N V A L I D A X E return doPlayerSendCancel(cid, "You cannot use the axe here.") elseif tree[itemEx.itemid].level > WoodcuttingSkill:getLevel(cid) then return doPlayerSendCancel(cid, "You need skill " .. tree[itemEx.itemid].level .. " to cut this tree.") end if not breac[item.itemid] then ---- I N V A L I D A X E doPlayerSendTextMessage(cid, 22, "Fail - invalid axe") print("[sKILL ERROR] - actions\script\woodcut.lua") return false elseif WoodcuttingSkill:getLevel(cid) < breac[item.itemid].skill then return doPlayerSendCancel(cid, "You need at least skill " .. breac[item.itemid].skill .. " to use this axe.") elseif breac[item.itemid].soul > getPlayerSoul(cid) then return doPlayerSendTextMessage(cid, 25, "You need " .. breac[item.itemid].soul .. " fatigue to woodcut with this axe.") end local chance = breac[item.itemid].bonus -- quanto maior mais facil -------------------------------------------------------------------------------- if not cortar[cid] then cortar[cid] = 0 -- inicializa end if cortar[cid] == 0 then doPlayerAddSoul(cid, - breac[item.itemid].soul) cortar[cid] = 1 getAtributo(itemEx.uid, "hp", true, math.random(tree[itemEx.itemid].minlog, tree[itemEx.itemid].maxlog)) -- pra resetar o atributo caso nao tenha continue_cut({cid=cid, item = item.itemid, pos = getPlayerPosition(cid), place = toPosition, chance = chance, name = getPlayerName(cid)}, tree[itemEx.itemid], breac[item.itemid].breakchance) else -- parar de cortar doPlayerSendCancel(cid, "You stopped cutting the tree.") stopEvent(cortar[cid]) cortar[cid] = 0 -- reseta end return true endlocal function retornat(p, tree) local arvore = getTileItemById(p.place, tree.dead) if arvore.uid > 0 then doItemSetAttribute(arvore.uid, "hp", math.random(tree.minlog, tree.maxlog)) doTransformItem( arvore.uid, tree.itemid) doSendMagicEffect(p.place, 3) endend function continue_cut(p, tree, break_chance) -- continua cortando continuamente local arvore = getTileItemById(p.place, tree.itemid) if arvore.uid > 0 then if isCreature(p.cid) and isCreature(getTopCreature(p.pos).uid) then -- as 4 condicoes necessarias sempre if p.name == getPlayerName( getTopCreature(p.pos).uid ) then if getPlayerItemCount(p.cid, p.item) > 0 then local hp = getAtributo(arvore.uid, "hp").value doSendDistanceShoot(p.pos, p.place, 39) --print("> Hp " .. hp ) if hp <= 0 then -- quebrar arvores doSendMagicEffect(p.place, 3) if getTileItemById(p.place, tree.itemid).uid > 0 then -- evitar conflitos doTransformItem(arvore.uid, tree.dead) addEvent(retornat, 1000 * math.random(tree.regmin, tree.regmax), p, tree) end elseif (math.random(1,1000) * p.chance / tree.hard) + (WoodcuttingSkill:getLevel(p.cid) * 10) >= 900 then -- GANHAR LOGS local bonus = math.random(1,10) == 10 and 2 or 1 -- 1 ou 2 doPlayerAddItem(p.cid, tree.logs, bonus) WoodcuttingSkill:addExp(p.cid, math.floor(bonus * multi * tree.hard)) ACHIEVEMENT.add(p.cid, 'skill_wc_1', bonus) ACHIEVEMENT.add(p.cid, 'skill_wc_2', bonus) ACHIEVEMENT.add(p.cid, 'skill_wc_3', bonus) doSendMagicEffect(p.place, 9) doItemSetAttribute(arvore.uid, "hp", hp - 1) elseif math.random(1,1000) >= 875 * p.chance then -- TOMAR DANO local dano = (math.random(10, 25)) --doCreatureAddHealth(p.cid, -dano) --doSendAnimatedText(p.pos, dano, 129) doSendMagicEffect(p.place, 2) -- era efeito 0(sangue) troquei pro 2 else -- NADA ACONTECEU doSendMagicEffect(p.place, 2) end if math.random(1, break_chance) == 1 then -- Q U E B R O U O A X E doPlayerSendTextMessage(p.cid, 22, "Your woodcutting axe has broken.") doSendMagicEffect(getPlayerPosition(p.cid), 3) doPlayerRemoveItem(p.cid, p.item, 1) return true end if hp > 0 then cortar[p.cid] = addEvent(continue_cut, 2500, p, tree, break_chance) return true end end end end end cortar[p.cid] = 0 -- como ele parou de bater na arvore, ele agora carrega o valor 0 pra poder voltar end Obrigado.
×
×
  • Create New...