Ir para conteúdo

zipter98

Herói
  • Total de itens

    2553
  • Registro em

  • Última visita

  • Dias Ganhos

    73

Tudo que zipter98 postou

  1. Ops, código corrigido. @shept function isStone(itemid) local ids = {itemid, itemid, itemid, ...} --ID das stones. return isInArray(ids, itemid) end
  2. Deu erro no console? Se não, então já há tal função em seu servidor. Caso contrário, a procurarei aqui e lhe enviarei. Qualquer coisa, faço direto em C++.
  3. Não funcionou absolutamente nada? Você registrou o evento em login.lua? Se sim, use este código e informe o que for imprimido no console: local effect = 173 --by brun123 --alterado v2.9 \/ local function func(cid, position, corpseid, effect) print(1) if not isCreature(cid) then return true end local corpse = getTileItemById(position, corpseid).uid if corpse <= 1 then return end if not isContainer(corpse) then return true end for slot = 0, (getContainerSize(corpse)-1) do local item = getContainerItem(corpse, slot) if item.uid <= 1 then return end if isStone(item.itemid) then print(2) return doSendMagicEffect(position, effect) and doPlayerSendTextMessage(getCreatureMaster(cid), 27, "You found a "..getItemNameById(item.itemid).."!") end end end function onKill(cid, target, lastHit) print(0) if not ehMonstro(target) then return true end local corpse = getMonsterInfo(getCreatureName(target)).lookCorpse addEvent(func, 5, getCreatureSummons(cid)[1], getThingPos(target), corpse, effect) return true end
  4. Não sei se esta versão tem o creatureevent onPush, mas enfim, tente: function onPush(cid, target) if getTileInfo(getThingPos(cid)).protection or getTileInfo(getThingPos(target)).protection then return false end return true end Tag: <event type="push" name="antiPush" event="script" value="nome_do_arquivo.lua"/> Não se esqueça de registrar o evento em login.lua.
  5. local items = { {itemid, vocation_id}, --{ID_do_item, vocação}, {itemid, vocation_id}, {itemid, vocation_id}, --etc } function onLogin(cid) for _, item in pairs(items) do if getPlayerItemCount(cid, item[1]) > 0 then doPlayerRemoveItem(cid, item[1], 1) doPlayerSetVocation(cid, item[2]) break end end return true end
  6. Em pokemon moves.lua: elseif spell == "Air Vortex" then local config = { outfit = xxx, --Outfit. time = {xxx, xxx}, --{Duração da spell, intervalo entre cada "tick" de dano (em milésimos de segundos)}, storage = 93828, effects = { pullEffects = { distance = xxx, --Distance effect do efeito de puxar pokémons. effect = xxx, --Efeito de tornado. }, damageEffect = xxx, --Efeito do redemoinho que aplica dano. }, } local time = os.time() + config.time[1] function Pull(cid, ret) local pos = getPosfromArea(cid, pullArea) if pos and #pos > 0 then for i = 1, #pos do local c = getTopCreature(pos[i]).uid if c > 0 then if ehMonstro(c) then doTeleportThing(c, getClosestFreeTile(cid, getThingPos(cid))) doMoveDano2(cid, c, NORMALDAMAGE, 0, 0, ret, spell) elseif isSummon(c) then local master = getCreatureMaster(c) if isSummon(cid) then if getPlayerStorageValue(master, 52480) >= 1 and getPlayerStorageValue(master, 52481) >= 0 then local masterCid = getCreatureMaster(cid) if isDuelingAgainst(masterCid, master) then doTeleportThing(c, getClosestFreeTile(cid, getThingPos(cid))) doMoveDano2(cid, c, NORMALDAMAGE, 0, 0, ret, spell) end end else doTeleportThing(c, getClosestFreeTile(cid, getThingPos(cid))) doMoveDano2(cid, c, NORMALDAMAGE, 0, 0, ret, spell) end end end end end end function doSendTornado(cid, pos) if not isCreature(cid) then return true end if isWithFear(cid) and getPlayerStorageValue(cid, 3644587) >= 1 then return true end if isSleeping(cid) and getPlayerStorageValue(cid, 3644587) >= 1 then return true end doSendDistanceShoot(getThingPos(cid), pos, config.effects.pullEffects.distance) doSendMagicEffect(pos, config.effects.pullEffects.effect) end function vortexDamage(cid) if not isCreature(cid) then return true elseif time - os.time() < 0 then return true end doDanoWithProtect(cid, FLYINGDAMAGE, getThingPos(cid), damageArea, min, max, config.effects.damageEffect) addEvent(vortexDamage, config.time[2], cid) end local ret = {id = 0, cd = config.time[1], check = 0, cond = {"Silence", "Paralyze"}} for b = 1, 3 do for a = 1, 20 do local pos = {x = getThingPos(cid).x + math.random(-4, 4), y = getThingPos(cid).y + math.random(-3, 3), z = getThingPos(cid).z} addEvent(doSendTornado, a * 75, cid, pos) end end Pull(cid, ret) vortexDamage(cid) doCreatureSetNoMove(cid, true) doChangeSpeed(cid, -getCreatureSpeed(cid)) doSetCreatureOutfit(cid, {lookType = config.outfit}, config.time[1] * 1000) setPlayerStorageValue(cid, config.storage, time) addEvent(function() if isCreature(cid) then doCreatureSetNoMove(cid, false) doRegainSpeed(cid) end end, config.time[1] * 1000) Em areas.lua: damageArea = createCombatArea{ --Área do dano da spell + redemoinhos. {1, 1, 1}, {1, 2, 1}, {1, 1, 1}, } pullArea = { --Área onde os pokémons serão puxados. {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {0, 1, 1, 1, 1, 3, 1, 1, 1, 1, 0}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, } Em newStatusSyst.lua: Troque todos os: if ret and ret.cond then ret.id = pid ret.check = getPlayerStorageValue(pid, conds[ret.cond]) doCondition2(ret) end por: if ret and ret.cond then if type(ret.cond) == "table" then for i = 1, #ret.cond do ret.id = pid ret.check = getPlayerStorageValue(pid, conds[ret.cond[i]]) doCondition2(ret) end else ret.id = pid ret.check = getPlayerStorageValue(pid, conds[ret.cond]) doCondition2(ret) end end Depois, troque: if ret.cond and ret.cond == "Miss" then doMiss2(ret.id, ret.cd, ret.eff, ret.check, ret.spell) elseif ret.cond and ret.cond == "Silence" then doSilence2(ret.id, ret.cd, ret.eff, ret.check) elseif ret.cond and ret.cond == "Slow" then doSlow2(ret.id, ret.cd, ret.eff, ret.check, ret.first) elseif ret.cond and ret.cond == "Confusion" then doConfusion2(ret.id, ret.cd, ret.check) elseif ret.cond and ret.cond == "Burn" then doBurn2(ret.id, ret.cd, ret.check, ret.damage) elseif ret.cond and ret.cond == "Poison" then doPoison2(ret.id, ret.cd, ret.check, ret.damage) elseif ret.cond and ret.cond == "Fear" then doFear2(ret.id, ret.cd, ret.check, ret.skill) elseif ret.cond and ret.cond == "Stun" then doStun2(ret.id, ret.cd, ret.eff, ret.check, ret.spell) elseif ret.cond and ret.cond == "Paralyze" then doParalyze2(ret.id, ret.cd, ret.eff, ret.check, ret.first) elseif ret.cond and ret.cond == "Sleep" then doSleep2(ret.id, ret.cd, ret.check, ret.first) elseif ret.cond and ret.cond == "Leech" then doLeech2(ret.id, ret.attacker, ret.cd, ret.check, ret.damage) end por: if type(ret.cond) == "table" then for i = 1, #ret.cond do if ret.cond[i] and ret.cond[i] == "Miss" then doMiss2(ret.id, ret.cd, ret.eff, ret.check, ret.spell) elseif ret.cond[i] and ret.cond[i] == "Silence" then doSilence2(ret.id, ret.cd, ret.eff, ret.check) elseif ret.cond[i] and ret.cond[i] == "Slow" then doSlow2(ret.id, ret.cd, ret.eff, ret.check, ret.first) elseif ret.cond[i] and ret.cond[i] == "Confusion" then doConfusion2(ret.id, ret.cd, ret.check) elseif ret.cond[i] and ret.cond[i] == "Burn" then doBurn2(ret.id, ret.cd, ret.check, ret.damage) elseif ret.cond[i] and ret.cond[i] == "Poison" then doPoison2(ret.id, ret.cd, ret.check, ret.damage) elseif ret.cond[i] and ret.cond[i] == "Fear" then doFear2(ret.id, ret.cd, ret.check, ret.skill) elseif ret.cond[i] and ret.cond[i] == "Stun" then doStun2(ret.id, ret.cd, ret.eff, ret.check, ret.spell) elseif ret.cond[i] and ret.cond[i] == "Paralyze" then doParalyze2(ret.id, ret.cd, ret.eff, ret.check, ret.first) elseif ret.cond[i] and ret.cond[i] == "Sleep" then doSleep2(ret.id, ret.cd, ret.check, ret.first) elseif ret.cond[i] and ret.cond[i] == "Leech" then doLeech2(ret.id, ret.attacker, ret.cd, ret.check, ret.damage) end end else if ret.cond and ret.cond == "Miss" then doMiss2(ret.id, ret.cd, ret.eff, ret.check, ret.spell) elseif ret.cond and ret.cond == "Silence" then doSilence2(ret.id, ret.cd, ret.eff, ret.check) elseif ret.cond and ret.cond == "Slow" then doSlow2(ret.id, ret.cd, ret.eff, ret.check, ret.first) elseif ret.cond and ret.cond == "Confusion" then doConfusion2(ret.id, ret.cd, ret.check) elseif ret.cond and ret.cond == "Burn" then doBurn2(ret.id, ret.cd, ret.check, ret.damage) elseif ret.cond and ret.cond == "Poison" then doPoison2(ret.id, ret.cd, ret.check, ret.damage) elseif ret.cond and ret.cond == "Fear" then doFear2(ret.id, ret.cd, ret.check, ret.skill) elseif ret.cond and ret.cond == "Stun" then doStun2(ret.id, ret.cd, ret.eff, ret.check, ret.spell) elseif ret.cond and ret.cond == "Paralyze" then doParalyze2(ret.id, ret.cd, ret.eff, ret.check, ret.first) elseif ret.cond and ret.cond == "Sleep" then doSleep2(ret.id, ret.cd, ret.check, ret.first) elseif ret.cond and ret.cond == "Leech" then doLeech2(ret.id, ret.attacker, ret.cd, ret.check, ret.damage) end end Depois, em data/talkactions/scripts, move1.lua: Abaixo de: if isSleeping(mypoke) or isSilence(mypoke) then --alterado v1.5 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode fazer isso agora.") return 0 else newid = setCD(getPlayerSlotItem(cid, 8).uid, cdzin, move.cd) end coloque: if getPlayerStorageValue(mypoke, 93828) > os.time() then return doPlayerSendCancel(cid, "Your pokemon can't use moves right now.") end Outra hora escrevo o código do Unown Help e Unown Rush (vou sair daqui a pouco). Perguntas: Há uma quantia mínima de Unowns para usar o Unown Rush? O dano de tal spell aumenta de acordo com o número de Unowns summonados? Seria bem legal isso (ex.: cada Unown aumenta o dano da spell em 5%).
  7. @ricardoberg Seria possível fazer algo assim, porém com uma mensagem menor. Se conseguir pensar em outra (ex.: "Stone!"), avise que eu altero o código para você. @Zet0N0Murmurouu Por acaso seu servidor tem todas as funções utilizadas neste código?
  8. Claro. local effect = 169 --by brun123 --alterado v1.9 \/ local arrow = {effect, duration} --Respectivamente, efeito e duração (segundos). local items = {itemid, itemid, itemid, ...} --Tabela para configurar os items. function sendEffect(pos, time) if time < 0 then return true end doSendMagicEffect(pos, arrow[1]) addEvent(sendEffect, 1000, pos, time - 1) end local function func(cid, position, corpseid, effect) if not isCreature(cid) then return true end local corpse = getTileItemById(position, corpseid).uid if corpse <= 1 then return end if not isContainer(corpse) then return true end for slot = 0, (getContainerSize(corpse)-1) do local item = getContainerItem(corpse, slot) if item.uid <= 1 then return end if isInArray(items, item.itemid) then return doSendMagicEffect(getThingPos(cid), effect) and sendEffect(position, arrow[2]) end end end function onKill(cid, target, lastHit) if not isMonster(target) then return true end local corpse = getMonsterInfo(getCreatureName(target)).lookCorpse addEvent(func, 5, getCreatureSummons(cid)[1], getThingPos(target), corpse, effect) return true end Tag: <event type="kill" name="dropStone" script="nome_do_arquivo.lua"/> Não se esqueça de registrar o evento em login.lua.
  9. Qual a versão do seu TFS?
  10. Se fossemos seguir a lógica do League of Legends dos minions atacarem apenas criaturas do time inimigo, o código seria bem complexo (além de envolver C++ também). Porém, se fosse colocado para atacarem qualquer um que aparecesse, não faria muito sentido. Já a parte responsável pela movimentação deles, se fosse escrito puramente em Lua seria necessária uma bela gambiarra. Se houvessem alterações em C++, poderia ser instalada a função getCreaturePathTo (se não me engano, tem disponível aqui). Summonar um monstro a cada 30 segundos é algo bem simples. Por exemplo: function summonMonster() doCreateMonster("monster", position) addEvent(summonMonster, 30000) end
  11. Não há nenhuma função, pelo menos padrão no TFS, que execute uma action. Logo, seria de grande ajuda se você informasse o que o item deveria fazer.
  12. Você provavelmente se esqueceu de configurar a tabela arrow. @ricardoberg Desculpe, não conheço a estrutura dos códigos desta base, mas suponho que basta algumas alterações no script que enviei para que funcione.
  13. OK, já terminei o Air Vortex. No entanto, irei testá-lo amanhã, já que estou ocupado no momento. Logo após os testes, escreverei o código das spells restantes.
  14. @Flaah Wow, obrigado. @shept Difícil, suponho que não. Porém, infelizmente, não comecei a estudar as funções e métodos do TFS 1.x+. Tentarei, no entanto, adaptá-lo para você. Caso não obtenha sucesso, peço que algum scripter com conhecimento sobre tal versão, se possível, converta o código.
  15. local effect = 169 --by brun123 --alterado v1.9 \/ local arrow = {effect, duration} --Respectivamente, efeito e duração (segundos). function sendEffect(pos, time) if time < 0 then return true end doSendMagicEffect(pos, arrow[1]) addEvent(sendEffect, 1000, pos, time - 1) end local function func(cid, position, corpseid, effect) if not isCreature(cid) then return true end local corpse = getTileItemById(position, corpseid).uid if corpse <= 1 then return end if not isContainer(corpse) then return true end for slot = 0, (getContainerSize(corpse)-1) do local item = getContainerItem(corpse, slot) if item.uid <= 1 then return end if isStone(item.itemid) then return doSendMagicEffect(getThingPos(cid), effect) and sendEffect(position, arrow[2]) end end end function onKill(cid, target, lastHit) if not ehMonstro(target) then return true end local corpse = getMonsterInfo(getCreatureName(target)).lookCorpse addEvent(func, 5, getCreatureSummons(cid)[1], getThingPos(target), corpse, effect) return true end
  16. Estranho, aqui funcionou perfeitamente Mas enfim, fiz uma edição em ambos os códigos que enviei anteriormente para tentar corrigir seu erro. Peço que teste o que mais lhe agrada e informe o resultado.
  17. Não se preocupe em detalhar mais o código. Não é algo complexo, logo não sobrecarregaria tanto um scripter com, no mínimo, noções medianas de Lua.
  18. Ops, esqueci de mencionar que o evento também deve ser registrado no arquivo .XML do monstro: <script> <event name="advantageSystem"/> </script> Também fiz uma alteração no código. Se a cor do dano depender do elemento, use este código: local config = { combatTable = { --[elemento] = { --doubleDamage = {"nome_do_monstro", vocation_id, vocation_id, "nome_do_monstro", "nome_do_monstro", etc}, --Vocações e monstros que tomarão o dobro do dano do elemento. --halfDamage = {"nome_do_monstro", vocation_id, vocation_id, "nome_do_monstro", "nome_do_monstro", etc}, --Vocações e monstros que tomarão metade do dano do elemento. --nilDamage = {"nome_do_monstro", vocation_id, vocation_id, "nome_do_monstro", "nome_do_monstro", etc}, --Vocações e monstros que tomarão dano nulo do elemento. --}, [COMBAT_FIREDAMAGE] = { doubleDamage = {"Rat", "Morgaroth", 5}, halfDamage = {"Orshabaal", 3}, nilDamage = {}, }, }, colors = { --[combat] = cor, [COMBAT_FIREDAMAGE] = COLOR_RED, --etc, }, } function onStatsChange(cid, attacker, type, combat, value) local cTable = config.combatTable[combat] if cTable and type == STATSCHANGE_HEALTHLOSS then local d, h, n, check, newValue = cTable.doubleDamage, cTable.halfDamage, cTable.nilDamage, isPlayer(cid) and getPlayerVocation(cid) or getCreatureName(cid), 0 if isInArray(d, check) then newValue = math.floor(value * 2) elseif isInArray(h, check) then newValue = math.floor(value / 2) elseif isInArray(n, check) then return false end if newValue ~= 0 then doCreatureAddHealth(cid, -newValue) doSendAnimatedText(getThingPos(cid), newValue, config.colors[combat] or 215) return false end end return true end function onLogin(cid) registerCreatureEvent(cid, "advantageSystem") return true end
  19. Erros? Configurou o código corretamente?
  20. Eu havia deixado um exemplo no código: [COMBAT_FIREDAMAGE] = { doubleDamage = {"Rat", "Morgaroth", 5}, halfDamage = {"Orshabaal", 3}, nilDamage = {}, }, Esses "Rat", "Morgaroth" e "Orshabaal" seriam o "nome_do_monstro". Já 5 e 3, vocation_id. A ordem em que os elementos são colocados não afeta em nada na funcionalidade do sistema.
  21. zipter98

    NPC Apostador!

    Troque: if doPlayerRemoveMoney(cid, tab.aposta1[1]) then por: if doPlayerRemoveMoney(cid, valor) then
  22. Qual a base do seu servidor? Se for PDA, peço que poste seu dropStone.lua (creaturescripts).
  23. local combatTable = { --[elemento] = { --doubleDamage = {"nome_do_monstro", vocation_id, vocation_id, "nome_do_monstro", "nome_do_monstro", etc}, --Vocações e monstros que tomarão o dobro do dano do elemento. --halfDamage = {"nome_do_monstro", vocation_id, vocation_id, "nome_do_monstro", "nome_do_monstro", etc}, --Vocações e monstros que tomarão metade do dano do elemento. --nilDamage = {"nome_do_monstro", vocation_id, vocation_id, "nome_do_monstro", "nome_do_monstro", etc}, --Vocações e monstros que tomarão dano nulo do elemento. --}, [COMBAT_FIREDAMAGE] = { doubleDamage = {"Rat", "Morgaroth", 5}, halfDamage = {"Orshabaal", 3}, nilDamage = {}, }, } function onStatsChange(cid, attacker, type, combat, value) local cTable = combatTable[combat] if cTable and type == STATSCHANGE_HEALTHLOSS then local d, h, n, check, newValue = cTable.doubleDamage, cTable.halfDamage, cTable.nilDamage, isPlayer(cid) and getPlayerVocation(cid) or getCreatureName(cid), 0 if isInArray(d, check) then newValue = math.floor(value * 2) elseif isInArray(h, check) then newValue = math.floor(value / 2) return false elseif isInArray(n, check) then return false end if newValue ~= 0 then doCreatureAddHealth(cid, -newValue) doSendAnimatedText(getThingPos(cid), newValue, 215) return false end end return true end function onLogin(cid) registerCreatureEvent(cid, "advantageSystem") return true end Tags: <event type="login" name="advantageLogin" event="script" value="nome_do_arquivo.lua"/> <event type="statschange" name="advantageSystem" event="script" value="nome_do_arquivo.lua"/>
  24. Sobre o que eu disse da tabela, foi referente ao código do Bruno Minervino
  25. Reparei que na PxG este Air Vortex, além de impedir com que o pokémon usuário se mova ou use outras spells, aplica um efeito de silence. Você quer da mesma maneira? Se sim, todos os pokémons pegos pelo movimento teriam este debuff aplicado? Também reparei que, quando o Shiny Fearow usa esta magia, há efeitos de "redemoinho" em volta dele. Saberia dizer se isto é parte da outfit ou efeitos individuais? Já no Unown Help, estes Unowns possuem tempo de duração? E este ataque usado por eles que você mencionou, como funciona? No Unown Rush, reparei que o efeito do dano em área é lançado algumas vezes. Neste caso, cada "lance" aplica dano ou este é aplicado apenas uma vez? E estou enganado, ou ao final da execução do movimento o Unown Legion fica com o buff do Barrier? Você gostaria disso também na spell (apesar de eu achar absurdamente estranho lol)?
  • Quem Está Navegando   0 membros estão online

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