Ir para conteúdo
  • Cadastre-se

gabriel28

Membro
  • Total de itens

    558
  • Registro em

  • Última visita

  • Dias Ganhos

    6

Histórico de Curtidas

  1. Gostei
    gabriel28 recebeu reputação de Rogex Joyz em Stop Utamo Vita   
    local combat = createCombatObject()
    setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
    setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_MANASHIELD)
    setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
    setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)
     
    function onCastSpell(cid, var)
        return doCombat(cid, combat, var)
    end

    testa ai
  2. Curtir
    gabriel28 recebeu reputação de Lurk em Stop Utamo Vita   
    local combat = createCombatObject()
    setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
    setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_MANASHIELD)
    setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
    setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)
     
    function onCastSpell(cid, var)
        return doCombat(cid, combat, var)
    end

    testa ai
  3. Obrigado
    gabriel28 recebeu reputação de leozincorsair em Limitar número de acc logada por IP   
    @jakons 
    local config = { max = 3, -- numero de players permitido com o mesmo ip group_id = 1 -- kikar apenas player com o group id 1 } local accepted_ip_list = {} -- lista dos players permitidos a usar MC, exemplo: {"200.85.3.60", "201.36.5.222"} local function antiMC(p) if #getPlayersByIp(getPlayerIp(p.pid)) >= p.max then doRemoveCreature(p.pid) end return true end function onLogin(cid) if getPlayerGroupId(cid) <= config.group_id then if isInArray(accepted_ip_list,doConvertIntegerToIp(getPlayerIp(cid))) == false then addEvent(antiMC, 1000, {pid = cid, max = config.max+1}) end end return true end *script não é de minha autoria.
  4. Obrigado
    gabriel28 recebeu reputação de Belmont em Spell Mod God   
    @Phineasz Usa um desses scripts de buff e usa 'addOutfitCondition' pra mudar a outfit do player.
  5. Curtir
    gabriel28 deu reputação a luanluciano93 em [8.60] Sistema de Recompensa (reward chest)   
    Arquivo rewardchest_boss.lua atualizado devido ao seguinte erro:
     

    Fixado!
  6. Curtir
    gabriel28 deu reputação a DdJs em Merchant Island | 8.60   
    Merchant Island
    Version: 8.60
     

     
    Type: .Rar
    Size: 55KB
    Position(s): [X: 1074 Y: 1011 Z: 7]
    File password: tibiaking
     

     
    Images:
     
     
  7. Curtir
    gabriel28 deu reputação a 3visan em Aula [8] Loops: while e repeat   
    While & repeat
    Aula 8

    Primeiramente desculpe a demora por essa aula, ficou meio aquela de; ah faz você, não faz você, anem faz você; Mais em fim estamos de volta com uma coisa indispensável em scripting que são os loops. Antes de tudo devo avisa que loops são perigosos, você pode travar seu servidor inteiro usando errado um loop.
    Os loops são usados para inicialmente quando temos varias funções juntas iguais, por exemplo, fazendo um jogador falar oi 10 vezes. Sem os loops você faria assim:




    doPlayerSay(cid,'oi',1) doPlayerSay(cid,'oi',1) doPlayerSay(cid,'oi',1) doPlayerSay(cid,'oi',1) doPlayerSay(cid,'oi',1) doPlayerSay(cid,'oi',1) doPlayerSay(cid,'oi',1) doPlayerSay(cid,'oi',1) Com loops você resume isso a 4 linhas, e ainda pode fazer milhares de coisas com eles! While Sintaxe: while (sentença) do (bloco) end Traduzindo: enquanto (algo for verdadeiro) Fazer (coisas) fim Entao repare, enquanto algo for verdadeiro fazer... Ele vai executar o que estiver dentro do loop infinitas veses até que o ((sentença)) seja falso ou você mande ele parar. Veja um exemplo: while getPlayerLevel(cid) < 10 do --- Enquanto o level for menor que 10 doPlayerAddExp(cid,1000) adcionar 1k de exp por vez end Viram? enquanto o nível for menor que 10 ele vai adicionar 1k de exp. Ele ira verificar, se for false (maior que 10) ele pula tudo e vai para o que estiver depois do end, se for true (for menor que 10) ele ira adicionar 1k de exp e depois ira verificar dinovo, ele vai executar até que seje 10. Nessa hora que se tem que tomar cuidado, é na verificação. Se você colocar algo como: while 1 < 2 do, ele vai executar eternamente, até que vc encerre o programa forçadamente (ctrl-alt-del) ou reinicie o pc, ou entao fexe o programa no X Veja mais alguns exemplos: pos = {x=100,y=100,z=100,stackpos=0} local stack = 0 while stack < 255 do pos.stackpos = stack local item = getThingFromPos(pos) if item.itemid ~= 0 and isCreature(item.uid) == false then doRemoveItem(item.uid,item.type) end stack = stack+1 end player ou monster ele ira remover o item e no final adcionar +1 numero a nossa variavel stack, Nisso repare, ele ira executar 255 veze e ira deletar todos os items daquela posição imagina vc escrevendo isso 255 vezes sem o loop . Repeat Ao contrario do while ele é tudo ao contrario, a verificação é no fim e ele só repete se for false (contrario de while que é se for true) Sintaxe: repeat (bloco) until (sentença) Tradução: Repetir (coisas) até (bloco) Bem nao seria até seria até que nao, pois se você usar: until true ele vai parar, e se usar: until false ele vai continuar. è ao contrario especificando mais. Diferente do while, o repeat ele executa primeiro o bloco para depois verificar, a verificação é no final. Tambem perigoso pois se usado incorretamente vc vai travar seu server tambem. Mais nao ligue pra isso todos que começam a mexer com loops sempre travam seus servidores no começo é normal. Veja o repeat em uso: local n = 0 repeat n = n+1 print('ola pessoas este é o loop numero:'..n) until n == 10 Ele ira executar 10 vezes, ele ira parar quando n for 10. Agora veja o exemplo de limpar o char adaptado para o repeat e veja a diferença (repare nos sinais de > e< ) pos = {x=100,y=100,z=100,stackpos=0} local stack = 0 repeat pos.stackpos = stack local item = getThingFromPos(pos) if item.itemid ~= 0 and isCreature(item.uid) == false then doRemoveItem(item.uid,item.type) end stack = stack+1 until stack > 255 Viram? Ao invez da verificação ser no começo do loop ela é feita no final, entao ao final do lopp antes da verificação eu adciono +1 no valor da variavel stack, e ele so ira parar o loop assim que stack for maior que 255 (ou seja 256), entao assim que o script dentro do loop temrinar com o valor 256 ele ira parar o loop e prosseguir com o resto do script. break Antes de terminarmos irei falar rapidamente sobre o break. Ele é usado APENAS em loops e serve para "quebrar" o loop, acontece quando vc quer parar o loop sem a verificação, ou parar antes de algo. Veja: local parar = 0 while os.date('%S') == '45' do print('Verificando se agora são 45 segundos') if parar > 25 then break end print('Nem é agora são:'..os.date('%S')..' segundos') parar = para+1 end print('oi')



    Nesse caso criei um script para ver se agora são X horas X minutos e 45 segundos (não importa quantas horas e minutos só os segundos), e se depois de 25 verificações não for 45 segundos ele ira usar o break. Quando usado ele ira finalizar o loop e irar continuar a executar o script depois do loop, no caso o print('oi') ai e o resto do script (caso exista)




    Exercicios


    Faça seguinte:
    Crie um loop que execute enquanto o player estiver online, e enquanto ele estiver online colocar para kickar ele.
    Use o repeat para criar um script que solte 25 magic effects diferentes.
    Use qualquer loop para criar um scritp que mova um player por 5 sqm em direções aleatorias (o script deve parar com o break!)



    DESAFIO
    Crie um script que gere um loop infinite que so pare depois de 10 segundos de execução.




    Creditos:



    99% Mock



    1% Vittu

    Aula 9 Tabelas

  8. Gostei
    gabriel28 recebeu reputação de KR3 em Script Ajuda +REP   
    @KR3 
    Nessa parte do script:
     
    if msgcontains(msg, 'entrar na akatsuki') then if getPlayerVocation(cid) ~= config then Troca por:
     
    if msgcontains(msg, 'entrar na akatsuki') then if getPlayerStorageValue(cid, 159004) == 1 or getPlayerStorageValue(cid, 159005) == 1 or getPlayerStorageValue(cid, 159006) == 1 or getPlayerStorageValue(cid, 159007) == 1 then doPlayerSendTextMessage(cid, 25, "você não pode entrar nessa academia você ja faz parte de uma") npcHandler:resetNpc(cid) end if getPlayerVocation(cid) ~= config then  
  9. Gostei
    gabriel28 recebeu reputação de KR3 em Ajuda Editar Script Block Slot {ajuda}   
    @KR3 Testa ai:
    function onEquip(cid, item, slot) local it = {2354, 2134} --id dos itens if isInArray(it, itemid) then if (slot == 5) then return true else return false end end return true end Tag: 
    <!-- ITENS Shields -->
    <movevent type="Equip" slot="shield" level="1" event="script" value="item1.lua">
    </movevent>
  10. Obrigado
    gabriel28 recebeu reputação de LeoTK em AJUDA COM SCRIPT PARA MAGIA   
    @Kenpachi Br 
     
    local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, 10) setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY) setCombatParam(combat, COMBAT_PARAM_CREATEITEM, 1497) local arr = { { 1, 1, 1, 1, 1, 1. }, { 1, 0, 0, 0, 0, 1. }, { 1, 0, 0, 0, 0, 1, }, { 1, 0, 0, 2, 0, 1, }, { 1, 0, 0, 0, 0, 1, }, { 1, 0, 0, 0, 0, 1, }, { 1, 1, 1, 1, 1, 1, }, } local area = createCombatArea(arr) setCombatArea(combat, area) function onCastSpell(cid, var) local storage = 50054 -- nao mexer caso nao saiba do que se trata local waittime = 30 -- tempo em segundos ate poder usar de novo if exhaustion.check(cid, storage) then doPlayerSendCancel(cid, "Espere "..exhaustion.get(cid, storage).." para usar essa magia novamente.") return false end exhaustion.set(cid, storage, waittime) return doCombat(cid, combat, var) end  
  11. Obrigado
    gabriel28 recebeu reputação de Kenpachi Br em AJUDA COM SCRIPT PARA MAGIA   
    @Kenpachi Br 
     
    local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, 10) setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY) setCombatParam(combat, COMBAT_PARAM_CREATEITEM, 1497) local arr = { { 1, 1, 1, 1, 1, 1. }, { 1, 0, 0, 0, 0, 1. }, { 1, 0, 0, 0, 0, 1, }, { 1, 0, 0, 2, 0, 1, }, { 1, 0, 0, 0, 0, 1, }, { 1, 0, 0, 0, 0, 1, }, { 1, 1, 1, 1, 1, 1, }, } local area = createCombatArea(arr) setCombatArea(combat, area) function onCastSpell(cid, var) local storage = 50054 -- nao mexer caso nao saiba do que se trata local waittime = 30 -- tempo em segundos ate poder usar de novo if exhaustion.check(cid, storage) then doPlayerSendCancel(cid, "Espere "..exhaustion.get(cid, storage).." para usar essa magia novamente.") return false end exhaustion.set(cid, storage, waittime) return doCombat(cid, combat, var) end  
  12. Curtir
    gabriel28 deu reputação a Cat em Lista completa de Tibia Clients na versão 8.X   
    TIBIA CLIENT 8.x
     
    PRINCIPAIS
    tibia82.zip tibia821.zip tibia822.zip tibia831.zip tibia84.zip tibia842.zip tibia85.zip tibia852.zip tibia853.zip tibia854.zip tibia855.zip tibia857.zip tibia860.zip tibia87.zip tibia871.zip 
     
    OUTROS
    Tibia810.zip Tibia811.zip Tibia830.zip Tibia841.zip Tibia856.zip Tibia861.zip Tibia862.zip Tibia872.zip  Tibia873.zipTibia874.zip
     
    Sobre Updates do Tibia: https://www.tibiawiki.com.br/wiki/Updates_e_Patches
    About Tibia Updates: https://tibia.fandom.com/wiki/Updates
     
     
  13. Curtir
    gabriel28 deu reputação a Cat em Remover monstro automaticamente   
    Use esse script para remover criaturas de tempo em tempo em uma determinada área do mapa.
     
    -- -- --
     
    Em data/globalevents/cria um arquivo chamado removemonster.lua
    local config = { fromPos = {x=556,y=451,z=6}, -- posição superior esquerda do mapa, da area em que esta mapeado a area. toPos = {x=566,y=456,z=6}, -- posição inferior direita do mapa, da area em que esta mapeado a area. boss = "Nomedomonstroaqui" -- Aqui você bota o nome do monstro que você quer remover } function onTime() removeMonsterInArea(fromPos, toPos) return true end function removeMonsterInArea() local positionsCheck = {} for i = config.fromPos.x, config.toPos.x do positionsCheck[#positionsCheck+1] = {x=i, y = config.fromPos.y, z = config.fromPos.z, stackpos = 0} for j = config.fromPos.y+1, config.toPos.y do positionsCheck[#positionsCheck+1] = {x=i, y = j, z = config.fromPos.z, stackpos = 0} end end for j=1, #positionsCheck do for i = 0, 255 do positionsCheck[j].stackpos = i local tile = getTileThingByPos(positionsCheck[j]) if isMonster(tile.uid) then if getCreatureName(tile.uid) == config.boss then doRemoveCreature(tile.uid) end end end end end TAG:
    <globalevent name="removemonster" time="03:00" event="script" value="removemonster.lua"/> time="03:00"   representa 3horas AM
     
     
  14. Obrigado
    gabriel28 recebeu reputação de Reds em Utilizando o Visual Studio Code, Notepad++ nunca mais   
    Caramba, realmente é um programa que ajuda muito, principalmente essa parte de fazer buscas de palavras chaves.
    Só tô tendo problema em abrir a página deles, nesse momento de meu comentário. hahah
  15. Curtir
    gabriel28 deu reputação a Cat em Star System - Aegis, mate 3 receba o prêmio   
    Feito por: @Storm (testado em tfs 0.4 - firelement, funciona em 0.3)
     
    Quem jogou rozinx server provavelmente conheceu a febre do sistema de weapons por points e consecutivamente o sistema Aegis. Pra quem não conhece, no rozinx haviam vários baús e você podia comprar os itens usando pontos. Esses pontos eram obtidos donatando (por volta de 2007-2015), porém na nova geração (2018) foi introduzido o sistema Aegis, um monstro que após você matá-lo 3 vezes recebia 1 ponto vip, e podia então coletar esses pontos para obter as armas pagas de forma gratuita. Trago a vocês uma versão diferente do Aegis. O Star system.
     
    Gratidão ao @Storm por criar o script e refazê-lo quase um ano depois, após não reconhecer o próprio script ?
    Vc é fera! ?
     
    Como funciona:
    O star system funciona em conjunto com o Advanced Minin System (elements) (se você preferir), diferente do servidor Rozinx, que entrega pontos vip, o Star system entrega 1 dos 4 massive element substance aleatoriamente (as pedras mais raras e difíceis de obter no mining: Earth, Ice, Fire ou Energy) após você matar 3 estrelas.
     

     

     

     
     
    INSTALAÇÃO
     
    -- Código para entregar item após matar o monstro
    data/creaturescripts/scripts/star.lua:
    local config = { monster = { name = "star", count = 3, storage = 6665, storage2 = 7775 }, premio = {{8298, 1}, {8302, 1}, {8299, 1}, {8303, 1}} -- {item_id, count} } function onDeath(cid, corpse, deathList) local killer = deathList[1] local pos = getCreaturePosition(killer) if not isMonster(cid) or not isPlayer(killer) then return true end if getPlayerStorageValue(killer, config.monster.storage) == -1 then setPlayerStorageValue(killer, config.monster.storage, 0) end setPlayerStorageValue(killer, config.monster.storage, getPlayerStorageValue(killer, config.monster.storage) + 1) if getPlayerStorageValue(killer, config.monster.storage) == config.monster.count then doSendMagicEffect(pos, CONST_ME_MAGIC_BLUE) local item = config.premio[math.random(1, #config.premio)] doPlayerAddItem(killer, item[1], item[2]) if getPlayerStorageValue(killer, config.monster.storage2) == -1 then setPlayerStorageValue(killer, config.monster.storage2, 0) end setPlayerStorageValue(killer, config.monster.storage2, getPlayerStorageValue(killer, config.monster.storage2) + 1) setPlayerStorageValue(killer, config.monster.storage, 0) doPlayerSendTextMessage(killer, MESSAGE_STATUS_CONSOLE_RED, "You receive ".. item[2] .." ".. getItemNameById(item[1]) .." by kill ".. config.monster.count .."x the monster ".. config.monster.name ..".") return true else doPlayerSendTextMessage(killer, MESSAGE_STATUS_CONSOLE_BLUE, "You killed ".. getPlayerStorageValue(killer, config.monster.storage) .." of ".. config.monster.count .." ".. config.monster.name ..", There are still ".. config.monster.count - (getPlayerStorageValue(killer, config.monster.storage)) .." ".. config.monster.name .." left to receive the reward.") return true end return true end data/creaturescripts/creaturescripts.xml:
    <!-- star system --> <event type="death" name="Star" event="script" value="star.lua"/>  
    -- Código para checar monstros abatidos e recompensas obtidas
    data/talkactions/scripts/starcheck.lua:
    local config = { name = "star", count = 3, storage2 = 7775 } function onSay(cid, words, param, channel) doPlayerPopupFYI(cid, "--- ".. config.name .." Status ---\n\nKills = ".. config.count * getPlayerStorageValue(cid, config.storage2) .."\nRewards = ".. getPlayerStorageValue(cid, config.storage2) ..".") return true end data/talkactions/talkactions.xml:
    <talkaction log="yes" words="!starcheck" event="script" value="starcheck.lua" />  
    -- Código do monstro
    data/monster/star.lua:
    <?xml version="1.0" encoding="UTF-8"?> <monster name="Star" nameDescription="a star" race="blood" experience="10000" speed="500" manacost="200"> <health now="15000000" max="15000000"/> <look type="294" corpse="6324"/> <targetchange interval="2000" chance="0"/> <strategy attack="100" defense="0"/> <flags> <flag summonable="0"/> <flag attackable="1"/> <flag hostile="1"/> <flag illusionable="0"/> <flag convinceable="0"/> <flag pushable="0"/> <flag canpushitems="1"/> <flag canpushcreatures="1"/> <flag targetdistance="1"/> <flag staticattack="1"/> <flag runonhealth="0"/> </flags> <attacks> <attack name="melee" interval="2000" skill="1000" attack="1000"/> <attack name="holy" interval="1500" chance="1000" range="6" radius="7" target="0" min="-100" max="-500"> <attribute key="areaEffect" value="holydamage"/> </attack> <attack name="outfit" interval="150" chance="10000" range="6" monster="star" duration="1000"> <attribute key="areaEffect" value="holydamage"/> </attack> <attack name="energy" interval="2000" chance="1000" range="6" radius="6" target="0" min="-200" max="-300"> <attribute key="areaEffect" value="purpleenergy"/> </attack> <attack name="fire" interval="2000" chance="1000" range="6" radius="5" target="0" min="-100" max="-500"> <attribute key="areaEffect" value="holydamage"/> </attack> <attack name="physical" interval="2000" chance="1000" range="6" radius="4" target="0" min="-200" max="-300"> <attribute key="areaEffect" value="groundshaker"/> </attack> <attack name="death" interval="3000" chance="1000" range="6" radius="3" target="0" min="-200" max="-700"> <attribute key="areaEffect" value="holyarea"/> </attack> </attacks> <elements> <element energyPercent="20"/> <element holyPercent="40"/> <element icePercent="-40"/> <element firePercent="30"/> </elements> <script> <event name="Star"/> </script> <script> <event name="noattack"/> </script> </monster> data/monster/monster.xml:
    <monster name="star" file="star.xml"/>  
    -- Código para os monstros não se matarem com as magias
    data/creaturescripts/scripts/noattack.lua:
    function onStatsChange(cid, attacker, type, combat, value) -- This should block all damage monster cause on eachother expect player summons if isMonster(cid) and isMonster(attacker) then local master = getCreatureMaster(cid) if not master or not isPlayer(master) then return false end end return true end data/creaturescripts/creaturescripts.xml:
    <event type="statschange" name="noattack" event="script" value="noattack.lua"/>  
  16. Curtir
    gabriel28 deu reputação a Cat em Elements - Advanced Mining System (skills + coins + levels)   
    Trago a vocês esse sistema, originalmente produzido para um servidor custom 8.60. (testado em 0.4 - firelement). Acredito que será mais útil pra vocês do que pra mim nesse momento. Se alguém puder acrescentar informações a respeito do uso em diferentes tfs agradeço. ?
     
     
     
    INFORMAÇÕES
    P = Posso mineirar vários itens nesse sistema?
    R = Sim, existem quatro elementos e quatro categorias, possibilitando gerar até 16 produtos finais nas minas. Essa configuração pode ser editada facilmente. Caso queira usar da maneira como o script está feito, ao mineirar você poderá coletar as seguintes pedras:

     
     
    P = Mas as pedras caem aleatoriamente?
    R = Não, esse mining possui um SKILL, conforme você mineira o skill aumenta e consecutivamente o seu LEVEL. Inicia com pedras Light, depois pure, rare e massive. Você pode editar facilmente o modo como a exp sobe, os leveis necessários para executar cada ação e as pedras.
     
     
    P = Qual a utilidade das pedras elementares?
    R = Na ideia original, projetei o sistema para que as pedras fossem gastas ao comprar itens em baús, mas fica a seu critério como utilizá-las. Por exemplo, um colar de proteção earth/ice precisaria ser pago com pedras de earth e ice. Incluirei no tópico o script utilizado no baú e o script para trocar as pedras quando atingir 100 unidades cada. Veja o exemplo:
     

     
    INSTALAÇÃO
    Em data/actions/script crie um arquivo .lua chamado elementalmining e cole o código dentro:
    local config = { maxmininglevel = 100, storagemining = 10000, expperlevel = 1000, experiencemining = 10001 } local stone = { blue = {8637, 8633, 9798, 1354}, green = {8640, 8636, 9791, 1353}, lightblue = {8638, 8634, 9790, 12344}, red = {8639, 8635, 9788, 1355}, } local stones = { crystal = {stone.blue[1], stone.green[1], stone.lightblue[1], stone.red[1]}, lcrystal = {stone.blue[2], stone.green[2], stone.lightblue[2], stone.red[2]}, pcrystal = {stone.blue[3], stone.green[3], stone.lightblue[3], stone.red[3]}, scrystal = {stone.blue[4], stone.green[4], stone.lightblue[4], stone.red[4]}, } local ore = { blue = {2146, 7759, 5905, 8302}, green = {2149, 7761, 12396 ,8298}, lightblue = {2150, 7762, 12575, 8303}, red = {2147, 7760, 5906, 8299}, } local ores = { ore.blue[1], ore.blue[2], ore.blue[3], ore.blue[4], ore.green[1], ore.green[2], ore.green[3], ore.green[4], ore.lightblue[1], ore.lightblue[2], ore.lightblue[3], ore.lightblue[4], ore.red[1], ore.red[2], ore.red[3], ore.red[4]} local levels = { { level = {0,19}, stone = {stones.crystal[1], stones.crystal[2], stones.crystal[3], stones.crystal[4]}, items = {ores[1],ores[5], ores[9], ores[13]}, iselect = 0, bstart = 1, gstart = 2, lbstart = 3, rstart = 4, chance = 10, -- 30 qtdmax = 1, expgainmin = 1, --15 expgainmax = 1 --50 }, { level = {20,49}, stone = {stones.crystal[1], stones.crystal[2], stones.crystal[3], stones.crystal[4], stones.lcrystal[1], stones.lcrystal[2], stones.lcrystal[3], stones.lcrystal[4]}, items = {ores[1],ores[2], ores[5], ores[6], ores[9],ores[10], ores[13], ores[14]}, iselect = 1, bstart = 1, gstart = 3, lbstart = 5, rstart = 7, chance = 10, qtdmax = 1, expgainmin = 1, expgainmax = 1 }, { level = {50,69}, stone = {stones.crystal[1], stones.crystal[2], stones.crystal[3], stones.crystal[4], stones.lcrystal[1], stones.lcrystal[2], stones.lcrystal[3], stones.lcrystal[4], stones.pcrystal[1], stones.pcrystal[2], stones.pcrystal[3], stones.pcrystal[4]}, items = {ores[1],ores[2], ores[3], ores[5], ores[6], ores[7], ores[9],ores[10], ores[11], ores[13], ores[14], ores[15]}, iselect = 2, bstart = 1, gstart = 4, lbstart = 7, rstart = 10, chance = 10, qtdmax = 1, expgainmin = 1, expgainmax = 1 }, { level = {70,89}, stone = {stones.crystal[1], stones.crystal[2], stones.crystal[3], stones.crystal[4], stones.lcrystal[1], stones.lcrystal[2], stones.lcrystal[3], stones.lcrystal[4], stones.pcrystal[1], stones.pcrystal[2], stones.pcrystal[3], stones.pcrystal[4], stones.scrystal[1], stones.scrystal[2], stones.scrystal[3], stones.scrystal[4]}, items = {ores[1],ores[2], ores[3], ores[4], ores[5], ores[6], ores[7], ores[8], ores[9],ores[10], ores[11], ores[12], ores[13], ores[14], ores[15], ores[16]}, iselect = 3, bstart = 1, gstart = 5, lbstart = 9, rstart = 13, chance = 10, qtdmax = 1, expgainmin = 1, expgainmax = 1 }, { level = {90,100}, stone = {stones.crystal[1], stones.crystal[2], stones.crystal[3], stones.crystal[4], stones.lcrystal[1], stones.lcrystal[2], stones.lcrystal[3], stones.lcrystal[4], stones.pcrystal[1], stones.pcrystal[2], stones.pcrystal[3], stones.pcrystal[4], stones.scrystal[1], stones.scrystal[2], stones.scrystal[3], stones.scrystal[4]}, items = {ores[1],ores[2], ores[3], ores[4], ores[5], ores[6], ores[7], ores[8], ores[9],ores[10], ores[11], ores[12], ores[13], ores[14], ores[15], ores[16]}, iselect = 3, bstart = 1, gstart = 5, lbstart = 9, rstart = 13, chance = 10, qtdmax = 1, expgainmin = 1, expgainmax = 1 } } function onUse(cid, item, fromPosition, itemEx, toPosition) local getMiningLevel = getPlayerStorageValue(cid, config.storagemining) local getMiningExp = getPlayerStorageValue(cid, config.experiencemining) if getMiningLevel == -1 then setPlayerStorageValue(cid, config.storagemining, 0) end if getMiningExp < 0 then setPlayerStorageValue(cid, config.experiencemining, 0) end if (isInArray(stones.crystal, itemEx.itemid) or isInArray(stones.lcrystal, itemEx.itemid) or isInArray(stones.pcrystal, itemEx.itemid) or isInArray(stones.scrystal, itemEx.itemid)) then for a = 1, #levels do min = levels[a].level[1]; max = levels[a].level[2] if (getMiningLevel >= min and getMiningLevel <= max) then if isInArray(levels[a].stone, itemEx.itemid) then if (math.random(1, 100) <= levels[a].chance) then quantity = math.random(1, levels[a].qtdmax) experience = math.random(levels[a].expgainmin, levels[a].expgainmax) if isInArray(stone.blue, itemEx.itemid) then iselection = math.random(levels[a].bstart, levels[a].bstart + levels[a].iselect) collect = levels[a].items[iselection] end if isInArray(stone.green, itemEx.itemid) then iselection = math.random(levels[a].gstart, levels[a].gstart + levels[a].iselect) collect = levels[a].items[iselection] end if isInArray(stone.lightblue, itemEx.itemid) then iselection = math.random(levels[a].lbstart, levels[a].lbstart + levels[a].iselect) collect = levels[a].items[iselection] end if isInArray(stone.red, itemEx.itemid) then iselection = math.random(levels[a].rstart, levels[a].rstart + levels[a].iselect) collect = levels[a].items[iselection] end if getMiningLevel == 100 then doSendMagicEffect(toPosition, 9) doPlayerSendTextMessage(cid, 22, text) doPlayerAddItem(cid, collect, quantity) elseif getMiningLevel <= 99 then if getMiningExp >= config.expperlevel then doSendMagicEffect(getCreaturePosition(cid), 49) setPlayerStorageValue(cid, config.storagemining, getMiningLevel + 1) setPlayerStorageValue(cid, config.experiencemining, getMiningExp - config.expperlevel) text = "You collected " ..quantity.. " matter" ..(quantity > 1 and "s" or "").. ". \n You have gained " ..experience.. " experience points in Mining. \n You advanced from mining skill level " ..getMiningLevel.. " to mining skill level " ..(getMiningLevel + 1).. "." else setPlayerStorageValue(cid, config.experiencemining, getMiningExp + experience) text = "You collected " ..quantity.. " matter" ..(quantity > 1 and "s" or "").. ". \n You have gained " ..experience.. " experience points in Mining. \n" ..(config.expperlevel - getMiningExp - experience).. " experience points left to next level. \nCurrent Mining Skill: " ..getMiningLevel.. "." end doSendMagicEffect(toPosition, 9) doPlayerSendTextMessage(cid, 22, text) doPlayerAddItem(cid, collect, quantity) end else doSendMagicEffect(toPosition, 3) doSendAnimatedText(getCreaturePosition(cid), "Working!", COLOR_WHITE) end else doPlayerSendTextMessage(cid, 22, "You need to get better in Mining to mining this.") end end end else doSendMagicEffect(getCreaturePosition(cid), 2) doPlayerSendTextMessage(cid, 22, "You can't mining this.") end end  
    Em data/actions/actions.xml use: 
    <!-- MINING --> <action itemid="2553" event="script" value="elementalmining.lua"/>  
    Se tiver dúvidas a respeito de como configurar pergunte no tópico. As partes editáveis são: Local config, local Stone, local Ore, local Levels. Note que local Levels indica que algumas pedras só podeerão ser mineiradas ao ter mining level superior.
     
    Configurações das pedras:
    Em data/items/items.xml troque os nomes de cada pedra (os nomes ficam a seu critério ;p)
    <item id="2149" article="a" name="light earth substance" plural="light earth substance">         <attribute key="weight" value="1000" /> </item> <item id="2146" article="a" name="light ice substance" plural="light ice substance">         <attribute key="weight" value="1000" /> </item> <item id="2147" article="a" name="light fire substance" plural="light fire substance">         <attribute key="weight" value="1000" /> </item> <item id="2150" article="a" name="light energy substance" plural="light energy substance">         <attribute key="weight" value="1000" /> </item> <item id="7761" article="a" name="pure earth substance" plural="pure earth substance">         <attribute key="weight" value="1000" /> </item> <item id="7759" article="a" name="pure ice substance" plural="pure ice substance">         <attribute key="weight" value="1000" /> </item> <item id="7760" article="a" name="pure fire substance" plural="pure fire substance">         <attribute key="weight" value="1000" /> </item> <item id="7762" article="a" name="pure energy substance" plural="pure energy substance">         <attribute key="weight" value="1000" /> </item> <item id="12396" article="a" name="rare earth matter" plural="rare earth substance">         <attribute key="weight" value="1000" /> </item> <item id="6551" article="a" name="rare ice substance" plural="rare ice substance">         <attribute key="weight" value="1000" /> </item> <item id="6550" article="a" name="rare fire substance" plural="rare fire substance">         <attribute key="weight" value="1000" /> </item> <item id="12575" article="a" name="rare energy substance" plural="rare energy substance">         <attribute key="weight" value="1000" /> </item> <item id="8298" name="massive earth substance" plural="massive earth substance">         <attribute key="weight" value="1000" /> </item> item id="8302" name="massive ice substance" plural="massive ice substance">         <attribute key="weight" value="1000" /> </item> <item id="8303" name="massive energy substance" plural="massive energy substance">         <attribute key="weight" value="1000" /> </item> <item id="8299" name="massive fire substance" plural="massive fire substance">         <attribute key="weight" value="1000" /> </item> TRANSFORMAR PEDRAS EM MOEDAS
    Em data/actions/scripts/tools crie um arquivo .lua e nomeie como changecoin:
    local COINS = { LIGHT = { EARTH_SUBSTANCE = 2149, ICE_SUBSTANCE = 2146, ENERGY_SUBSTANCE = 2150, FIRE_SUBSTANCE = 2147 }, PURE = { EARTH_SUBSTANCE = 7761, ICE_SUBSTANCE = 7759, ENERGY_SUBSTANCE = 7762, FIRE_SUBSTANCE = 7760 }, RARE = { EARTH_SUBSTANCE = 12396, ICE_SUBSTANCE = 6551, ENERGY_SUBSTANCE = 12575, FIRE_SUBSTANCE = 6550 }, MASSIVE = { EARTH_SUBSTANCE = 8298, ICE_SUBSTANCE = 8302, ENERGY_SUBSTANCE = 8303, FIRE_SUBSTANCE = 8299 } } local TRANSFORM = { [COINS.LIGHT.EARTH_SUBSTANCE] = { TO = COINS.PURE.EARTH_SUBSTANCE }, [COINS.LIGHT.ICE_SUBSTANCE] = { TO = COINS.PURE.ICE_SUBSTANCE }, [COINS.LIGHT.ENERGY_SUBSTANCE] = { TO = COINS.PURE.ENERGY_SUBSTANCE }, [COINS.LIGHT.FIRE_SUBSTANCE] = { TO = COINS.PURE.FIRE_SUBSTANCE }, [COINS.PURE.EARTH_SUBSTANCE] = { FROM = COINS.LIGHT.EARTH_SUBSTANCE, TO = COINS.RARE.EARTH_SUBSTANCE }, [COINS.PURE.ICE_SUBSTANCE] = { FROM = COINS.LIGHT.ICE_SUBSTANCE, TO = COINS.RARE.ICE_SUBSTANCE }, [COINS.PURE.ENERGY_SUBSTANCE] = { FROM = COINS.LIGHT.ENERGY_SUBSTANCE, TO = COINS.RARE.ENERGY_SUBSTANCE }, [COINS.PURE.FIRE_SUBSTANCE] = { FROM = COINS.LIGHT.FIRE_SUBSTANCE, TO = COINS.RARE.FIRE_SUBSTANCE }, [COINS.RARE.EARTH_SUBSTANCE] = { FROM = COINS.PURE.EARTH_SUBSTANCE, TO = COINS.MASSIVE.EARTH_SUBSTANCE }, [COINS.RARE.ICE_SUBSTANCE] = { FROM = COINS.PURE.ICE_SUBSTANCE, TO = COINS.MASSIVE.ICE_SUBSTANCE }, [COINS.RARE.ENERGY_SUBSTANCE] = { FROM = COINS.PURE.ENERGY_SUBSTANCE, TO = COINS.MASSIVE.ENERGY_SUBSTANCE }, [COINS.RARE.FIRE_SUBSTANCE] = { FROM = COINS.PURE.FIRE_SUBSTANCE, TO = COINS.MASSIVE.FIRE_SUBSTANCE }, [COINS.MASSIVE.EARTH_SUBSTANCE] = { FROM = COINS.RARE.EARTH_SUBSTANCE }, [COINS.MASSIVE.ICE_SUBSTANCE] = { FROM = COINS.RARE.ICE_SUBSTANCE }, [COINS.MASSIVE.ENERGY_SUBSTANCE] = { FROM = COINS.RARE.ENERGY_SUBSTANCE }, [COINS.MASSIVE.FIRE_SUBSTANCE] = { FROM = COINS.RARE.FIRE_SUBSTANCE } } function onUse(cid, item, fromPosition, itemEx, toPosition) if(getPlayerFlagValue(cid, PLAYERFLAG_CANNOTPICKUPITEM)) then return false end local COIN = TRANSFORM[item.itemid] if(not COIN) then return false end if(COIN.TO ~= nil and item.type == ITEMCOUNT_MAX) then doChangeTypeItem(item.uid, item.type - item.type) doPlayerAddItem(cid, COIN.TO, 1) elseif(COIN.FROM ~= nil) then doChangeTypeItem(item.uid, item.type - 1) doPlayerAddItem(cid, COIN.FROM, ITEMCOUNT_MAX) end return true end  
    Em data/actions/actions.xml acrescente:
    <action itemid="2149" event="script" value="tools/changecoin.lua"/> <action itemid="2146" event="script" value="tools/changecoin.lua"/> <action itemid="2150" event="script" value="tools/changecoin.lua"/> <action itemid="2147" event="script" value="tools/changecoin.lua"/> <action itemid="7761" event="script" value="tools/changecoin.lua"/> <action itemid="7759" event="script" value="tools/changecoin.lua"/> <action itemid="7762" event="script" value="tools/changecoin.lua"/> <action itemid="7760" event="script" value="tools/changecoin.lua"/> <action itemid="12396" event="script" value="tools/changecoin.lua"/> <action itemid="6551" event="script" value="tools/changecoin.lua"/> <action itemid="12575" event="script" value="tools/changecoin.lua"/> <action itemid="6550" event="script" value="tools/changecoin.lua"/> <action itemid="8298" event="script" value="tools/changecoin.lua"/> <action itemid="8302" event="script" value="tools/changecoin.lua"/> <action itemid="8303" event="script" value="tools/changecoin.lua"/> <action itemid="8299" event="script" value="tools/changecoin.lua"/>  
    Script adicional:
    Bau/Chest - Comprar mesmo item com duas moedas diferentes  
    Isso é tudo, façam bom uso!
  17. Curtir
    gabriel28 deu reputação a Reds em Utilizando o Visual Studio Code, Notepad++ nunca mais   
    Fala galera, por muito tempo utilizei o notepad++ para desenvolver meus códigos em lua. Agora voltando a desenvolver meu servidor, utilizo o Visual Studio Code e digo que ajuda muito em relação ao notepad++.
     
    Vantagens:
    1) Você pode abrir a pasta de seu servidor, tendo uma estrutura semelhante a um projeto Java por exemplo, tudo isso de uma forma bem fácil. Se não me engano o notepad++ tem uma funcionalidade parecida, mas acredito que a maioria aqui não usa.
    Para fazer isso é só utilizar o atalho CTRL + K + O, ou file > Open Folder e selecionar a pasta de seu servidor.
     
    2) Diversos atalhos. Com o VS Code, você pode utilizar atalhos, como o CTRL + P, ao fazer isso ele abre um box no topo da IDE onde o desenvolvedor pode escrever o nome do arquivo e ele encontra dentro do projeto.
     
     
    Fazia mais de ano que eu não abria meu servidor, então eu não lembrava de diversas coisas, como os monstros que dropavam o item 10566, então com o Visual Studio Code, eu consegui descobrir que eu não tinha configurado nenhum monstro para dropar aquele item. Para fazer essa pesquisa utilizei o atalho CTRL + SHIFT + F, onde ele pesquisa alguma palavra em específica entre os arquivos do seu projeto. 
     
    E muitos outros, que você pode encontrar pesquisando pela internet.
     
    3) Diversas extensões. Com o VS Code você pode instalar diversas extensões que auxiliam no seu desenvolvimento, por enquanto adicionei a padrão de Lua. Com ela, ao escrever códigos Lua é utilizado intellisense, facilitando muito no desenvolvimento.
     
     
    4) Criação de snippets para utilização das funções do Tibia.
     
    5) Muito mais.. Utilizo há algum tempo o VS Code para desenvolvimento de front e sempre descubro coisas novas sobre ele..
     
    O VS Code esta disponível em: https://code.visualstudio.com/download.
     
  18. Obrigado
    gabriel28 recebeu reputação de KR3 em (Resolvido)Erro Na Sourcer OT Caindo [AJUDA]   
    @KR3 Quero itens VIP no teu server pra ajudar. UAShUAShU
    Brincadeira a parte, segue isso: (Lembrando que é pra TFS 0.4)
     
    Em game.cpp procure por:
    Party* party = player->getParty(); E adicione acima: 
    if (invitedPlayer == player) return false;
  19. Curtir
    gabriel28 deu reputação a Vodkart em Premium Gift By Account   
    Resumo: Código funciona para distribuir Premium Account para jogadores que recém criaram a conta, uma forma de beneficiar e usufruir das vantagens de serem Premium no seu servidor!
     
    Execute no seu banco de dados
     
    ALTER TABLE `accounts` ADD `premiumgift` INT NOT NULL DEFAULT '0'  
    e no seu script do onLogin use desta maneira:
     
    function onLogin(cid) local days = 3 if db.getResult("SELECT `premiumgift` FROM `accounts` WHERE `id` = "..getPlayerAccountId(cid)):getDataInt("premiumgift") <= 0 then doPlayerAddPremiumDays(cid, days) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sua account acabou de receber "..days.." dias de premium, boa diversão!") db.executeQuery("UPDATE `accounts` SET `premiumgift` = 1 WHERE `id` = "..getPlayerAccountId(cid)) end return true end  
     
  20. Curtir
    gabriel28 deu reputação a LeoTK em [Limite Skill] Colocar Limite em Skills   
    Salve galera bom demorou mas consegui trazer esse conteúdo para vocês com ajuda de diversos amigos créditos no final do tópico.
     
    Bom vamos lá é um conjunto de configurações + script que vai permitir todas as skills do servidor ficar limitada até 250
     
    Primeiramente vamos até o config.lua do servidor e deixa a Rate Magic em 0.01
    Ficando assim 
    rateMagic = 0.01 Logo depois disso vamos ao vocation.xml e procure por
    manamultiplier="1.2" Use o notepad++ Aperte ctrl + H para substituir todos os manamultiplier="1.2" por manamultiplier="1.0"
    manamultiplier="1.0" Essa modificação vai permitir a sua magic level chegar a 250
    Depois faça isso com as demais skills Club / Sword / Axe / Distance / Shield / Fishing - Mude todos para 1.0
     
    Depois disso agora vamos instalar os scripts para criar limites para as skills não bugarem e também vamos configurar a rate do magic level para não bugar também
     
    Vá em data/creaturescripts/creaturescripts.xml e adicione essas tags
    <!-- Skills Block / Stages Skills --> <event type="advance" name="skillblock" event="script" value="skillblock.lua"/> <event type="login" name="skillblock2" event="script" value="skillblock2.lua"/> <event type="death" name="skillblock3" event="script" value="skillblock3.lua"/> <event type="advance" name="skillblock4" event="script" value="skillblock4.lua"/> <event type="login" name="skillblock6" event="script" value="skillblock6.lua"/> Agora abra o login.lua e adicione isso
    registerCreatureEvent(cid, "skillblock") registerCreatureEvent(cid, "skillblock2") registerCreatureEvent(cid, "skillblock3") registerCreatureEvent(cid, "skillblock4")  
    Crie o arquivo skillblock.lua e adicione isso dentro
    Lembre-se coloque um numero anterior ao limite ou seja o limite de fist e 250 mas no maxLevel esta 254
     
     
    Crie o Arquivo skillblock2.lua e adicione isso dentro
     
     
    Crie o Arquivo skillblock3.lua e adicione isso dentro
     
     
    Crie o Arquivo skillblock4.lua e adicione isso dentro
     
     
    Crie o Arquivo skillblock5.lua e adicione isso dentro
     
     
    Crie um Arquivo skillblock6.lua e adicione isso dentro
     
     
    Algumas imagens mostrando funcionando no meu caso eu configurei para enviar a mensagem em uma channel caso se interessar nesse sistema basta seguir o link Clicando Aqui
     


     
    Créditos:
    @movie
    @Coltera
    @lordzetros
    @Yan Liima
    @aspira
    Night Wolf
  21. Curtir
    gabriel28 recebeu reputação de Pifafa em (Resolvido)Npc Bugando?   
    @Pifafa 
    Esse tipo de script precisa que o player tenha a moeda normal do jogo na bag pra poder realizar a compra.
    Por exemplo: Se tua moeda em game é a 2160 e tas usando esse NPC pra usar algum token de evento ou algo do tipo, tu vai precisar ter as moedas comuns (2160) dentro da BP pro sistema entender que tu tem dinheiro.
  22. Curtir
    gabriel28 recebeu reputação de joaovitorbk9 em COMO DAR DETERMINADA STORAGE PARA X VOCATION   
    @joaovitorbk9 
     
    if getPlayerVocation(cid, X) then setPlayerStorageValue(cid, YYYY, Z) end  
  23. Gostei
    gabriel28 recebeu reputação de leozincorsair em Corrigindo bugs relacionados a containers   
    Desculpem pelo título chamativo e/ou pela área está incorreta, mas enfim, lhes trago a solução definitiva pros problemas de bug relacionados a conteiners, como ficar comprando bp's infinitamente até crashar o server, stackar várias bps dentro de bps, jogar dentro da casa e usar o comando !leavehouse (ou algo do tipo) o que causa lag (talvez crash?) por conta da database ter que processar tantos itens saindo da house pro dp ou qualquer outra merda desse tipo.

    Vá em  ...\data\npc\lib\npcsystem procure por: -- Handles onBuy events. If you wish to handle this yourself, use the CALLBACK_ONBUY callback.

    Substitua toda a função por:
     

    Explicando: 
    Se o player tentar comprar mais de X itens de id Y, o npc não irá vender. Quando o player comprar uma quantidade menor que X, ganhará um cooldown de Z segundos até poder comprar novamente. Tudo isso configurável na tabela.
    Pra te prejudicar com esse tipo de bug agora, só se o "player" tiver com uma puta vontade de te foder.
    Testado e totalmente funcional em TFS 0.4 rev 3884, mas qualquer coisa é só adaptar pra outras versões que tenho certeza que funciona.

    EDIT: Não sei se já tem script similar por ai, mas esse ai é de minha autoria.
    Pra quem usa OTX, tem esse fix na source:
    https://github.com/mattyx14/otxserver/tree/otxserv2/path_8_6x
    Créditos ao Celulose que mandou.
  24. Obrigado
    gabriel28 recebeu reputação de Pedrok22 em (Resolvido)Ajuda Items com a restrição para todas as vocations   
    @Pedrok22 
    <movevent type="Equip" itemid="12649" slot="head" event="function" value="onEquipItem">
                <vocation id="3"/>
                <vocation id="7"/>
                <vocation id="11"/>
     </movevent>
     <movevent type="DeEquip" itemid="12649" slot="head" event="function" value="onDeEquipItem"/>

    O do Brunds deu erro porque ele fechou a tag no "Equip" dai fez com que o '</movevent>' fechasse o XML, o que fez ocorrer esse erro ai.
  25. Curtir
    gabriel28 deu reputação a Zwarttyp em (Resolvido)Vocation   
    @gabriel28 o script, ja era pra ir pra 3° voc... e muito obrigado de coração
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo