Ir para conteúdo

Yan Oliveira

Moderador
  • Total de itens

    2187
  • Registro em

  • Última visita

  • Dias Ganhos

    57

Tudo que Yan Oliveira postou

  1. Para te ajudarmos, poste o código de forma organizada e dentro de CODES ou Spoiler para ficar mais fácil de visualizar e te ajudar, pois desse jeito está difícil visualizar.
  2. Tópico movido de Suporte > OTServ > Programação para Suporte > OTServ > Scripts. Fique atento às regras do fórum. Sobre suas dúvidas, para alterar a chance do catch de cada pokémon individual, tem que olhar na tabela dos pokémons no arquivo Data/Lib/configurations.lua e procure a tabela de pokémons que contém os campos chance e corpse: pokecatches = { ["Bulbasaur"] = {chance = 1, corpse = 5969}, ["Ivysaur"] = {chance = 800, corpse = 5982}, ["Venusaur"] = {chance = 1800, corpse = 5962}, Só alterar o valor no campo chance. E sobre a rate da exp, nesse mesmo arquivo configurations.lua, no começo do código, procure por: rateExp = 2.8 -- 6
  3. Tópico movido de Suporte > OTServ > Programação para Suporte > OTServ > Infraestrutura. Fique atento às regras do fórum.
  4. A questão neste tópico de suporte foi respondida e/ou o autor do tópico resolveu o problema. Este tópico está fechado e foi movido para Suporte - Resolvidos. Se você tiver outras dúvidas, crie um novo tópico.
  5. Troque o código por este: local storage_buff_catch = 3133586 -- STORAGE DO BONUS DE CATCH local minutes_buff = 5 -- MINUTOS PARA TER O BUFF DO CATCH local ballcatch = { --id normal, id da ball shiy [2394] = {cr = 1, on = 193, off = 192, ball = {11826}, send = 86, typeee = "poke", boost = "0"}, --alterado v1.9 \/ [2391] = {cr = 2, on = 198, off = 197, ball = {11832}, send = 87, typeee = "great", boost = "0"}, [2393] = {cr = 3, on = 202, off = 201, ball = {11835}, send = 88, typeee = "super", boost = "0"}, [2392] = {cr = 4, on = 200, off = 199, ball = {11829}, send = 89, typeee = "ultra", boost = "0"}, [12617] = {cr = 4, on = 204, off = 203, ball = {12621}, send = 84, typeee = "saffari", boost = "0"}, [12832] = {cr = 100000, on = 23, off = 24, ball = {12826}, send = 85, typeee = "master", boost = "50"}, [15677] = {cr = 6, on = 313, off = 314, ball = {16204}, send = 72, typeee = "magu", boost = "0", type = {"fire", "ground"}}, [15676] = {cr = 6, on = 316, off = 317, ball = {16205}, send = 73, typeee = "sora", boost = "0", type = {"water", "ice"}}, [15678] = {cr = 6, on = 319, off = 320, ball = {16206}, send = 74, typeee = "yume", boost = "0", type = {"fairy", "psychic"}}, [15680] = {cr = 6, on = 322, off = 323, ball = {16207}, send = 75, typeee = "dusk", boost = "0", type = {"ghost", "dark"}}, [15673] = {cr = 6, on = 331, off = 332, ball = {16210}, send = 78, typeee = "tale", boost = "0", type = {"dragon", "flying"}}, [15674] = {cr = 6, on = 334, off = 335, ball = {16211}, send = 79, typeee = "moon", boost = "0", type = {"fighting", "normal"}}, [15675] = {cr = 6, on = 337, off = 338, ball = {16212}, send = 80, typeee = "net", boost = "0", type = {"bug", "poison"}}, [15681] = {cr = 6, on = 346, off = 347, ball = {16215}, send = 83, typeee = "tinker", boost = "0", type = {"electric", "steel"}}, [15679] = {cr = 1, on = 343, off = 344, ball = {16214}, send = 82, typeee = "premier", boost = "0"}, [15682] = {cr = 6, on = 325, off = 326, ball = {16208}, send = 76, typeee = "fast", boost = "0", pokes = {"Pidgeot", "Kadabra", "Rapidash", "Scyther", "Electabuzz", "Manectric", "Persian", "Starmie", "Sneasel", "Dugtrio", "Alakazam", "Sceptile", "Swellow", "Jolteon", "Crobat", "Electrode", "Ninjask", "Raichu", "Dodrio", "Gengar", "Tauros", "Jumpluff", "Espeon", "Shiny Raichu", "Shiny Dodrio", "Shiny Tauros", "Shiny Gengar", "Shiny Espeon"}}, [15672] = {cr = 6, on = 328, off = 329, ball = {16209}, send = 77, typeee = "heavy", boost = "0", pokes = {"Golem", "Gyarados", "Snorlax", "Onix", "Tyranitar", "Metang", "Steelix", "Camerupt", "Lapras", "Mantine", "Hariyama", "Aggron", " Wailord", "Glalie", "Metagross", "Rhyperior", "Shiny Golem", "Shiny Gyarados", "Shiny Snorlax", "Shiny Onix", "Shiny Tyranitar", "Shiny Metang", "Shiny Steelix", "Shiny Camerupt", "Shiny Lapras", "Shiny Mantine", "Shiny Hariyama", "Shiny Aggron", "Shiny Wailord", "Shiny Glalie", "Shiny Metagross", "Shiny Rhyperior"}}, } function onUse(cid, item, frompos, item3, topos) local item2 = getTopCorpse(topos) if item2 == null then return true end if getPlayerStorageValue(cid, 55006) >= 1 then doPlayerSendCancel(cid, "Você não pode capturar nenhum pokémon enquanto está em duel.") return true end if getItemAttribute(item2.uid, "catching") == 1 then return true end local name = string.lower(getItemAttribute(item2.uid, "pokeName")) name = string.gsub(name, "fainted ", "") name = string.gsub(name, "defeated ", "") name = doCorrectPokemonName(name) local storage = newpokedex[name].stoCatch if type(getPlayerStorageValue(cid, storage)) ~= "string" or not string.find(getPlayerStorageValue(cid, storage), "magu") then --alterado v1.9 setPlayerStorageValue(cid, storage, "normal = 0, great = 0, super = 0, ultra = 0, saffari = 0, dark = 0, magu = 0, sora = 0, yume = 0, dusk = 0, tale = 0, moon = 0, net = 0, premier = 0, tinker = 0, fast = 0, heavy = 0;") --alterado v1.9 end local owner = getItemAttribute(item2.uid, "corpseowner") local pOwner = getPlayerByName(owner) local isInParyWithPlayer = false if isInParty(cid) and isInParty(pOwner) then isInParyWithPlayer = isPartyEquals(pOwner, cid) end if owner and isCreature(pOwner) and isPlayer(pOwner) and cid ~= pOwner and not isInParyWithPlayer then doPlayerSendCancel(cid, "Desculpa. Isso não é possivel.") return true end local newidd = isShinyName(name) and ballcatch[item.itemid].ball[2] or ballcatch[item.itemid].ball[1] or false --alterado v1.9 local typeee = ballcatch[item.itemid].typeee local boost = ballcatch[item.itemid].boost local catchBlocks = {"Kabuto", "Kabutops", "Omanyte", "Omastar","Shiny Vileplume", "Shiny Marowak", "Shiny Umbreon", "Shiny Fearow", "Shiny Espeon", "Shiny Flareon", "Shiny Jolteon", "Shiny Vaporeon", "Shiny Salamence", "Shiny Magmortar", "Shiny Electivire", "Shiny Scizor", "Moltres", "Articuno", "Zapdos", "Aerodactyl", "Hitmonlee", "Hitmonchan", "Hitmontop", "Raikou", "Entei", "Suicune", "Lugia", "Ho-oh"} if isInArray(catchBlocks, name) then doSendMsg(cid, "Você não pode capturar este pokemon.") return true end local catchCyber = {"Shiny Dodrio", "Shiny Magneton", "Shiny Espeon", "Shiny Umbreon", "Shiny Rhydon", "Shiny Ninetales", "Shiny Onix", "Shiny Ariados", "Shiny Stantler", "Shiny Politoed"} if isInArray(catchCyber, name) and getPlayerStorageValue(cid, 50926) ~= 1 then doSendMsg(cid, "Você não concluiu a Cyber Quest!") return true end if getPlayerStorageValue(cid, 1654987) >= 1 then doSendMsg(cid, "Você não pode capturar pokémons nesse local.") return true end if typeee == "master" and isShinyName(name) then doSendMsg(cid, "Você não pode capturar pokemon shiny com a master ball.") return true end -- // New's Bag \\ -- if typeee == "poke" then local valor = getPlayerStorageValue(cid, 233200) <= 0 and 1 or getPlayerStorageValue(cid, 233200) setPlayerStorageValue(cid, 233200, valor + 1) elseif typeee == "great" then local valor1 = getPlayerStorageValue(cid, 233201) <= 0 and 1 or getPlayerStorageValue(cid, 233201) setPlayerStorageValue(cid, 233201, valor1 + 1) elseif typeee == "super" then local valor2 = getPlayerStorageValue(cid, 233202) <= 0 and 1 or getPlayerStorageValue(cid, 233202) setPlayerStorageValue(cid, 233202, valor2 + 1) elseif typeee == "ultra" then local valor3= getPlayerStorageValue(cid, 233203) <= 0 and 1 or getPlayerStorageValue(cid, 233203) setPlayerStorageValue(cid, 233203, valor3 + 1) end if getPlayerStorageValue(cid, 233200) >= 100 and getPlayerStorageValue(cid, 232200) ~= 1 then doPlayerAddItem(cid, 12683, 1) setPlayerStorageValue(cid, 233200, 0) elseif getPlayerStorageValue(cid, 233201) >= 250 and getPlayerStorageValue(cid, 232201) ~= 1 then doPlayerAddItem(cid, 12682, 1) setPlayerStorageValue(cid, 233201, 0) elseif getPlayerStorageValue(cid, 233202) >= 500 and getPlayerStorageValue(cid, 232202) ~= 1 then doPlayerAddItem(cid, 12684, 1) setPlayerStorageValue(cid, 233202, 0) elseif getPlayerStorageValue(cid, 233203) >= 1000 and getPlayerStorageValue(cid, 232203) ~= 1 then doPlayerAddItem(cid, 12685, 1) setPlayerStorageValue(cid, 233203, 0) end if getPlayerStorageValue(cid, 244787) >= 1 and typeee ~= "saffari" then doPlayerSendCancel(cid, "Você não pode capturar esse pokémon com essa Pokébola.") return true end if getPlayerStorageValue(cid, 244787) >= 1 and getPlayerItemCount(cid, 12617) <= 1 then --alterado v1.9 setPlayerStorageValue(cid, 244787, -1) doTeleportThing(cid, {x = 925, y = 1535, z = 6}, false) doSendMagicEffect(getThingPos(cid), 21) doPlayerSendTextMessage(cid, 27, "Você não tem mais Saffari Ball!") end --[[ if getPlayerStorageValue(cid, 141416) >= 1 then return true end]]-- local catchinfo = {} if isShinyName(name) then catchinfo.rate = ballcatch[item.itemid].cr + getPlayerSorte() else catchinfo.rate = ballcatch[item.itemid].cr + getPlayerSorteInNormal() end catchinfo.catch = ballcatch[item.itemid].on catchinfo.fail = ballcatch[item.itemid].off catchinfo.newid = newidd catchinfo.name = doCorrectPokemonName(name) catchinfo.topos = topos --catchinfo.chance = x.chance doBrokesCount(cid, newpokedex[doCorrectPokemonName(name)].stoCatch , typeee) doSendDistanceShoot(getThingPos(cid), topos, ballcatch[item.itemid].send) doRemoveItem(item.uid, 1) ---- newsBalls if (ballcatch[item.itemid].type ~= nil or ballcatch[item.itemid].pokes ~= nil) then catchinfo.rate = getBallsRate(catchinfo.name, item.itemid) + getPlayerSorte() end if isGod(cid) or getPlayerStorageValue(cid, 394672) >= 1 then catchinfo.rate = 100000 end if getPlayerStorageValue(cid, storage_buff_catch) <= os.time() then if getPlayerStorageValue(cid, 121212) >= 1 then catchinfo.rate = 1000 setPlayerStorageValue(cid, storage_buff_catch, os.time() + (60 * minutes_buff)) end end local d = getDistanceBetween(getThingPos(cid), topos) setPlayerStorageValue(cid, 141416, 1) addEvent(setPlayerStorageValue, 725, cid, 141416, -1) doItemSetAttribute(item2.uid, "catching", 1) addEvent(doSendPokeBall, d * 70 + 100 - (d * 14) , cid, catchinfo, false, false, typeee, 1.5) addEvent(doSendMagicEffect, (d * 70 + 100 - (d * 14)) - 100, topos, 3) return true end function getPlayerSorte() if math.random(1, 200) >= 199 then ballS = math.random(250, 450) else ballS = math.random(1, 35) end return ballS end function getPlayerSorteInNormal() if math.random(1, 100) >= 95 then ballS = math.random(250, 450) else ballS = math.random(1, 35) end return ballS end function getBallsRate(name, id) if pokes[name] then if isInArray(ballcatch[id].type, pokes[name].type) or isInArray(ballcatch[id].type, pokes[name].type2) or isInArray(ballcatch[id].pokes, name) then return 6 end end return 4 end Nas duas primeiras linhas do código tem uma variável que armazena o valor da storage que irá guardar o tempo para usar o buff novamente e embaixo tem a variável que contém o tempo em minutos para usar o buff, só alterar o tempo, pois eu deixei 5 apenas como valor fictício. Teste e se der algum problema, me avise.
  6. Se entendi bem você quer que mostre a vida e mana drenada, para isso pode mostrar em um animated text: -- Código feito por Omega -- function getPlayerTopMeleeSkill(cid) skill = 0 value = 10 for i = 1, 4 do if getPlayerSkillLevel(cid, i) > value then value = getPlayerSkillLevel(cid, i) skill = i end end return { skill = i, value = value } end -- Porcentagem do dano que será healado pelo jogador local healPercent = 35 local effect = 8 --Distance effect. function onUseWeapon(cid, var) local target = getCreatureTarget(cid) if not target then return true end if getPlayerSlotItem(cid, CONST_SLOT_RIGHT).itemid == 8855 or getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid == 8855 then local skill, local attack, level = getPlayerTopMeleeSkill(cid).value, getItemInfo(getPlayerWeapon(cid).itemid).attack, getPlayerLevel(cid) -- Use skill (maior valor entre melee e distance), level e attack (ataque da arma) para configurar a fórmula do dano local formula = 0.5 * (skill * 3 + attack * 3 + level * 2) local dmg = math.random(8, 12) / 10 * formula * -1 doTargetCombatHealth(cid, target, COMBAT_LIFEDRAIN, dmg, dmg, CONST_ME_DRAWBLOOD) doSendDistanceShoot(getThingPos(cid), getThingPos(target), effect) local heal = math.ceil(- 1.0 * dmg * healPercent / 100) local healmana = math.ceil(- 1.0 * dmg * healPercent / 100) doCreatureAddHealth(cid, heal) doCreatureAddMana(cid, healmana) doSendAnimatedText(getThingPos(cid), "HEALTH\n" .. heal .. "\n\nMANA\n" .. healmana, math.random(1, 255)) return true end end Teste e veja se é assim que você quer.
  7. Tópico movido de Downloads > OTServ > OTServer Alternativo (ATS) para Suporte > OTServ > Programação. Fique atento às regras do fórum.
  8. Tópico movido de Scripting > Recursos > OTServ > Libs and Functions para Suporte > OTServ > Scripts. Fique atento às regras do fórum.
  9. Yan Oliveira

    [AJUDA] Pokedex

    Que bom que conseguiu resolver o problema! Mas, poste a solução para que futuramente outras pessoas com o mesmo problema consigam resolver o problema. Pode editar o post que criou o tópico mesmo para isso.
  10. Yan Oliveira

    Npc dando erro

    Que bom que conseguiu resolver! Entretanto, informe a solução para que futuramente outras pessoas com o mesmo problema consigam resolver o problema. Pode editar o post que criou o tópico mesmo.
  11. Yan Oliveira

    Pedido de Mapa

    Tópico movido de OTServ > OTServlist para Pedidos > OTServ > Mapping. Fique atento às regras do fórum.
  12. Você mudou para 10x a Exp via script (rate) ou mudando nas configurações?
  13. Yan Oliveira

    Revive Com Tempo

    Entendi, troque o código por esse: local level = 200 -- LEVEL MÍNIMO PARA USAR O REVIVE local storage_time = 68789 -- STORAGE PARA VERIFICAR O TEMPO PARA USAR O REVIVE local minutes = 10 -- MINUTOS PARA USAR O REVIVE local message_color = MESSAGE_STATUS_CONSOLE_BLUE -- COR DO TEXTO --------------- CÓDIGO --------------- function onUse(cid, item, frompos, item2, topos) if getPlayerLevel(cid) < level then doPlayerSendCancel(cid, "You need to be at least level " .. level .. " to use this revive.") return doPlayerSendTextMessage(cid, message_color, "You need to be at least level " .. level .. " to use this revive.") else if getPlayerStorageValue(cid, storage_time) <= os.time() then if getPlayerStorageValue(cid, 990) >= 1 then doPlayerSendCancel(cid, "You can't use revive during gym battles.") return true end if getPlayerStorageValue(cid, 52481) >= 1 then return doPlayerSendCancel(cid, "You can't do that while a duel.") --alterado v1.6 end -- if item2.itemid <= 0 or not isPokeball(item2.itemid) then doPlayerSendCancel(cid, "Please, use revive only on pokeballs.") return true end for a, b in pairs (pokeballs) do if item2.itemid == b.on or item2.itemid == b.off then doTransformItem(item2.uid, b.on) doSetItemAttribute(item2.uid, "hp", 1) for c = 1, 15 do local str = "move"..c setCD(item2.uid, str, 0) end setCD(item2.uid, "control", 0) setCD(item2.uid, "blink", 0) --alterado v1.6 doSendMagicEffect(getThingPos(cid), 13) doRemoveItem(item.uid, 1) doCureBallStatus(item2.uid, "all") cleanBuffs2(item2.uid) setPlayerStorageValue(cid, storage_time, os.time() + (60 * minutes)) return true end end else doPlayerSendCancel(cid, "You need to wait " .. minutes .. " minutes to use this revive.") return doPlayerSendTextMessage(cid, message_color, "You need to wait " .. minutes .. " minutes to use this revive.") end end return true end
  14. Yan Oliveira

    Revive Com Tempo

    Eu tinha baixado essa base em 2019, mas o arquivo do revive está bem diferente do que eu tenho aqui. Poste novamente o arquivo revive.lua, mas poste tudo, pois esse que colocou na criação do tópicos parece que faltou partes. Edita lá mesmo e coloca lá. Ai eu dou uma olhada melhor.
  15. Yan Oliveira

    Revive Com Tempo

    Qual a base do seu ot? É DXP?
  16. Yan Oliveira

    Revive Com Tempo

    Troque o código por esse: local level = 200 -- LEVEL MÍNIMO PARA USAR O REVIVE local storage_time = 68789 -- STORAGE PARA VERIFICAR O TEMPO PARA USAR O REVIVE local minutes = 10 -- MINUTOS PARA USAR O REVIVE local message_color = MESSAGE_STATUS_CONSOLE_BLUE -- COR DO TEXTO --------------- CÓDIGO --------------- function onUse(cid, item, frompos, item2, topos) if getPlayerLevel(cid) < level then doPlayerSendCancel(cid, "You need to be at least level " .. level .. " to use this revive.") return doPlayerSendTextMessage(cid, message_color, "You need to be at least level " .. level .. " to use this revive.") else if getPlayerStorageValue(cid, storage_time) <= os.time() then setPlayerStorageValue(cid, 8422, 0) setPlayerStorageValue(cid, 23254, 50) if isCreature(item2.uid) then return doPlayerSendCancel(cid, "You can only use revive in pokeballs!") end if isPlayer(item2.uid) then return doPlayerSendCancel(cid, "You cant use potions on wild pokemons.") end local x = pokeballs[getPokeballType(item2.itemid)] if not x or isInArray(x.use, item2.itemid) then return doPlayerSendCancel(cid, "Sorry, is not possible.") end if x.on or x.off then doSendMagicEffect(getThingPos(cid), 14) doRemoveItem(item.uid, 1) maxh = tonumber(getItemAttribute(item2.uid, "poke"):match("/(.+)]")) doItemSetAttribute(item2.uid, "poke", getItemAttribute(item2.uid, "poke"):sub(1, findLetter(getItemAttribute(item2.uid, "poke"), "[")) .. maxh .. getItemAttribute(item2.uid, "poke"):sub(findLetter(getItemAttribute(item2.uid, "poke"), "/"))) btype = getPokeballType(item2.itemid) ons = pokeballs[btype].on doTransformItem(item2.uid, ons) doCureAllStatus(item2.uid) setPlayerStorageValue(cid, storage_time, os.time() + (60 * minutes)) return true else doPlayerSendCancel(cid, "Sorry, is not possible.") return true end else doPlayerSendCancel(cid, "You need to wait " .. minutes .. " minutes to use this revive.") return doPlayerSendTextMessage(cid, message_color, "You need to wait " .. minutes .. " minutes to use this revive.") end end end
  17. Yan Oliveira

    Revive Com Tempo

    Sem spam, aguarde ser respondido. Quando for postar um código, poste ele inteiro, pois o que você colocou estava faltando parte (ou estava errado rsrs). Troque o código por esse: local level = 200 -- LEVEL MÍNIMO PARA USAR O REVIVE local storage_time = 68789 -- STORAGE PARA VERIFICAR O TEMPO PARA USAR O REVIVE local minutes = 10 -- MINUTOS PARA USAR O REVIVE local message_color = MESSAGE_STATUS_CONSOLE_BLUE -- COR DO TEXTO --------------- CÓDIGO --------------- function onUse(cid, item, frompos, item2, topos) if getPlayerLevel(cid) < level then doPlayerSendCancel(cid, "You need to be at least level " .. level .. " to use this revive.") return doPlayerSendTextMessage(cid, message_color, "You need to be at least level " .. level .. " to use this revive.") else if getPlayerStorageValue(cid, storage_time) <= os.time() then setPlayerStorageValue(cid, 8422, 0) setPlayerStorageValue(cid, 23254, 50) if isCreature(item2.uid) then return doPlayerSendCancel(cid, "You can only use revive in pokeballs!") end if isPlayer(item2.uid) then return doPlayerSendCancel(cid, "You cant use potions on wild pokemons.") end local x = pokeballs[getPokeballType(item2.itemid)] if not x or isInArray(x.use, item2.itemid) then return doPlayerSendCancel(cid, "Sorry, is not possible.") end if x.on or x.off then doSendMagicEffect(getThingPos(cid), 14) doRemoveItem(item.uid, 1) maxh = tonumber(getItemAttribute(item2.uid, "poke"):match("/(.+)]")) doItemSetAttribute(item2.uid, "poke", getItemAttribute(item2.uid, "poke"):sub(1, findLetter(getItemAttribute(item2.uid, "poke"), "[")) .. maxh .. getItemAttribute(item2.uid, "poke"):sub(findLetter(getItemAttribute(item2.uid, "poke"), "/"))) btype = getPokeballType(item2.itemid) ons = pokeballs[btype].on doTransformItem(item2.uid, ons) doCureAllStatus(item2.uid) setPlayerStorageValue(cid, storage_time, os.time() + (60 * minutes)) return true else doPlayerSendCancel(cid, "Sorry, is not possible.") return true end else return true end else doPlayerSendCancel(cid, "You need to wait " .. minutes .. " minutes to use this revive.") return doPlayerSendTextMessage(cid, message_color, "You need to wait " .. minutes .. " minutes to use this revive.") end end end
  18. De nada! Que bom que deu certo ?. ------------- EDIT ------------ @Sugismundo Eu editei o post que você marcou como melhor resposta, copia o código dele. Pois, do jeito que estava antes, se o player fosse usar a spell e não tivesse nenhum player disponível da party, ele ia considerar mesmo assim o cooldown de 5 minutos, mas agora arrumei para começar o cooldown assim que teleportar para o player.
  19. O problema está em uma verificação if que sua skill ou é menor que 0 (acho difícil) ou é maior que 6, então ele só seta o MagicLevel, mas estar resetando para level 10 eu não entendi. Tem que ver se não tem algum bloco no seu login.lua que está fazendo isso. Antes de colocar esse sistema estava normal?
  20. Sim, troque o código por esse: -- SCRIPT DE TELETRANSPORTE FEITO POR YAN18 -- local message_color = MESSAGE_STATUS_CONSOLE_BLUE -- COR DA MENSAGEM local effect = 36 -- EFEITO DO TELETRANSPORTE local mana = 150 -- TANTO DE MANA QUE VAI GASTAR PARA TELEPORTAR. SE QUISER SEM CUSTO, COLOQUE O VALOR 0 local storage_time = 55454 -- STORAGE PARA VERIFICAR SE PODE USAR A SPELL local minutes = 5 -- MINUTOS PARA USAR A SPELL NOVAMENTE -- FUNÇÃO LOCAL PARA TELETRANSPORTAR -- local function Teleportation(cid, index) if not cid then return true end if not isInParty(cid) then return doPlayerSendTextMessage(cid, message_color, "You need to be in a party to teleport. But if you are in a party, please report this problem.") end if index < 1 then return doPlayerSendTextMessage(cid, message_color, "There are not players available in your party for you teleport to him.") else local player = getPartyMembers(cid)[index] if getCreatureName(cid) ~= getCreatureName(player) then if string.lower(getCreatureName(player)) == string.lower(getCreatureName(player)) then if not getTileInfo(getThingPos(player)).house then doSendMagicEffect(getThingPos(cid), effect) doTeleportThing(cid, getThingPos(player)) doSendMagicEffect(getThingPos(cid), effect) doCreatureSay(cid, "TELEPORTATION!") doPlayerSendTextMessage(cid, message_color, "You had been teleportation to " .. getCreatureName(player) .. ".") setPlayerStorageValue(cid, storage_time, os.time() + (60 * minutes)) return true end end end addEvent(Teleportation, 10, cid, index - 1) end end --------------------- CÓDIGO --------------------- function onCastSpell(cid, var) if not cid then return true elseif not isInParty(cid) then return doPlayerSendTextMessage(cid, message_color, "You need to be in a party to teleport. But if you are in a party, please report this problem.") else if getPlayerStorageValue(cid, storage_time) <= os.time() then if getCreatureMana(cid) >= mana then Teleportation(cid, #getPartyMembers(cid)) return true else return doPlayerSendTextMessage(cid, message_color, "You need to have " .. mana .. " mana to use this ability.") end else return doPlayerSendTextMessage(cid, message_color, "You need to wait " .. minutes .. " minutes to use this ability again.") end end end
  21. Manda o link para mim dar uma olhada.
  22. Quando esse erro acontece? Ao puxar o pokémon quando está realizando a cura?
  23. Não entendi, como assim ficar sozinho não tem mensagem ao receber dano?
  24. Testa agora: local function HealPerTurn(cid, health, effect, time, seconds) local duration = seconds > 0 and math.floor(1000 * seconds) or math.floor(1000 * 1) -- EQUIVALENTE A 1 SEGUNDO (MILISSEGUNDOS) local storage_say = 78787 -- STORAGE PARA NÃO REPETIR A FALA local storage_life = 7777777 -- STORAGE QUE ARMAZENA LIFE PARA VERIFICAR SE SOFREU DANO local table_conditions = { CONDITION_POISON, CONDITION_FIRE, CONDITION_ENERGY, CONDITION_BLEEDING, CONDITION_HASTE, CONDITION_PARALYZE, CONDITION_INFIGHT, CONDITION_DRUNK, CONDITION_MUTED, CONDITION_FREEZING, CONDITION_DAZZLED, CONDITION_CURSED, CONDITION_HUNTING, } if not cid then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Potions can be used only in creatures.") return true end for _, condition in pairs(table_conditions) do if getCreatureCondition(cid, condition) then return true end end setPlayerStorageValue(cid, storage_life, 0) if time <= 0 then return true else if getCreatureHealth(cid) == getCreatureMaxHealth(cid) then return doPlayerSendCancel(cid, "Your health is full.") end if (getPlayerStorageValue(cid, storage_life) > 0) and (getPlayerStorageValue(cid, storage_life) ~= getCreatureHealth(cid)) then return doSendAnimatedText(getThingPos(cid), "LOST HEAL", getThingPos(cid)) end doCreatureAddHealth(cid, health > 0 and math.floor(health) or 1) doSendMagicEffect(getThingPos(cid), effect) setPlayerStorageValue(cid, storage_life, getCreatureHealth(cid)) if getPlayerStorageValue(cid, storage_say) < 1 then doSendAnimatedText(getThingPos(cid), "HEALING...", getThingPos(cid)) setPlayerStorageValue(cid, storage_say, 1) end addEvent(HealPerTurn, duration, cid, health, effect, time - 1, seconds) end end --- TABELA COM O ID DAS POTIONS, TANTO DE VIDA QUE CURA CADA UMA E EFEITO AO USAR A POÇÃO --- local potions = { [12347] = {health = 1000, effect = 13}, -- full restore [12348] = {health = 3500, effect = 13}, -- hyper potion [12346] = {health = 5000, effect = 13}, -- ultra potion [12345] = {health = 8000, effect = 13}, -- super potion } local vezes_repete = 10 -- QUANTAS VEZES VAI REPETIR O EFEITO local segundos = 1 -- TEMPO EM SEGUNDOS PARA REPETIR O EFEITO ---------------------------- CÓDIGO -------------------------------- function onUse(cid, item, toPos, itemEx, FromPos) local pokemon = getCreatureSummons(cid)[1] -- PEGA O PRIMEIRO SUMMON DO PLAYER (POKEMON) if not pokemon then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Potions can be used in a pokémon.") return true end if not isSummon(pokemon) or getCreatureMaster(pokemon) ~= cid then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can use potion only in your own pokémon.") return doPlayerSendCancel(cid, "You can use potion only in your pokémon.") end if getPlayerStorageValue(cid, 52481) >= 1 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can't do that while a duel.") return doPlayerSendCancel(cid, "You can't do that while a duel.") end if getPlayerStorageValue(cid, 990) >= 1 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can't use potion during gym battles.") return doPlayerSendCancel(cid, "You can't use potion during gym battles.") end HealPerTurn(pokemon, potions[item.itemid].health, potions[item.itemid].effect, vezes_repete, segundos) doRemoveItem(item.uid, 1) return true end
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...