Ir para conteúdo

Diego Rulez

Membro
  • Registro em

  • Última visita

  1. thepops reagiu a uma resposta no tópico: Google Cloud Plataform
  2. m.araujo2k21 começou a seguir Diego Rulez
  3. Diego Rulez começou a seguir Coltera
  4. Diego Rulez respondeu ao post em um tópico de bernasch em Suporte Tibia OTServer
    Aproveite que não tem noção nenhuma e já inicie com o Linux. É mais fácil alguém que nunca mexeu com nenhum dos dois aprender a instalar tudo no Linux, do que aprender em Windows pra depois aprender Linux. E acredite, vai precisar de Linux queira ou não. Boa Sorte.
  5. Vodkart reagiu a uma resposta no tópico: Alavanca que compra itens
  6. batzsouza reagiu a uma resposta no tópico: Alavanca que compra itens
  7. Leandro Vidal Martins reagiu a uma resposta no tópico: Google Cloud Plataform
  8. @luanluciano93 Realmente faltava a lib, mas o @Breno Alves me ajudou no Discord, então vou deixar aqui a explicação. O que acontece é que para funcionar é preciso adicionar o seguinte código no arquivo global.lua actionIds = { citizenship = 30020, -- citizenship teleport citizenshipLast = 30050, -- citizenship teleport last } No RME, é preciso setar o actionID: 30021 - town 1 30022 - town 2 30022 - town 3 E assim por diante. Já o script citizen.lua, recomendo usar o script abaixo. Foram adicionadas algumas funcionalidades como: - Não permite que o player que já é cidadão entre no teleport referente a cidade dele, somente a outras, impede de entrar e exibe uma mensagem - Seta a direção do player ao virar cidadão local towns = { [1] = SOUTH, [2] = NORTH, } function onStepIn(creature, item, position, fromPosition) if item.actionid > actionIds.citizenship and item.actionid < actionIds.citizenshipLast then if not creature:isPlayer() then return false end local town = Town(item.actionid - actionIds.citizenship) if not town then return false end if creature:getTown():getId() == town:getId() then creature:teleportTo(fromPosition, true) creature:sendTextMessage(MESSAGE_STATUS_SMALL, "You are already a citizen of " .. town:getName() .. ".") return false end creature:setTown(town) creature:sendTextMessage(MESSAGE_STATUS_SMALL, "You are now a citizen of " .. town:getName() .. ".") creature:teleportTo(town:getTemplePosition()) creature:getPosition():sendMagicEffect(CONST_ME_TELEPORT) creature:setDirection(towns[creature:getTown():getId()]) end return true end
  9. Olá, dando seguimento a um outro tópico que postei agora pouco sobre o sistema de virar morador, acredito ser nescessário um "complemento". O complemento seria que ao logar, deve haver uma verificação para ver se o player ainda tem dias/tempo/etcs de Premium Account, e caso não tenha, ele seja teleportado para uma "town" definida, que no caso seria uma cidade free account. Caso tenha, loga normalmente e nada acontece.
  10. Existe um script, no próprio repositório oficial da TFS que, pelos meus testes, não funciona. O script em questão é o que faz um player virar morador de uma cidade caso entre no teleport, porém, seguindo uma linha lógica de raciocinio, toda cidade tem (ou deveria ter), um teleport que faça essa função. Gostaria de ajuda em relação a isso. Em data/movements/movements.xml temos a seguinte tag: <movevent event="StepIn" itemid="1387" script="citizen.lua" /> Ao meu ver, isso está errado, então fiz testes também utilizando da seguinte forma: <movevent event="StepIn" actionid="1387" script="citizen.lua" /> Porém, mesmo assim, ainda estaria errado, porque isso iria atribuir somente um teleport para uma cidade, a questão aqui também é funcionar em mais de uma cidade. https://github.com/otland/forgottenserver/blob/master/data/movements/movements.xml Obviamente, que eu coloquei a actionId no teleport, mas segue o script: function onStepIn(creature, item, position, fromPosition) if item.actionid > actionIds.citizenship and item.actionid < actionIds.citizenshipLast then if not creature:isPlayer() then return false end local town = Town(item.actionid - actionIds.citizenship) if not town then return false end creature:setTown(town) creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You are now a citizen of " .. town:getName() .. ".") end return true end https://github.com/otland/forgottenserver/blob/master/data/movements/scripts/citizen.lua Fico no aguardo.
  11. Hoje estarei postando 3 scripts diferentes onde ao clicar na alavanca o player pode comprar itens. Antes que perguntem são 3 scripts porque o funcionamento é diferente, andei pesquisando bastante e perguntando a alguns no TibiaKing e vi que muitos disseram que era fácil, mas apenas dois conseguiram me ajudar. Um foi o @Lyu que explicou um detalhe de como "puxar" a charges para o item do items.xml ao invés de configurar no próprio script. Já o restante dos scripts foram desenvolvidos pelo @luanluciano93 Neste primeiro script é possível comprar uma quantidade de itens (count), que vão vir dentro de um container (containerId) e caso eles tenham "charges", a carga que o item virá é a que está configurada no items.xml local items = { [1520] = {containerId = 2003, itemId = 2197, count = 20, price = 100000}, -- stone skin amulet [1521] = {containerId = 1992, itemId = 2164, count = 8, price = 40000}, -- might ring [1522] = {containerId = 1996, itemId = 2169, count = 8, price = 16000}, -- time ring [1523] = {containerId = 1991, itemId = 2167, count = 8, price = 16000}, -- energy ring [1524] = {containerId = 1993, itemId = 2214, count = 8, price = 16000} -- ring of healing } function onUse(player, item, fromPosition, target, toPosition, isHotkey) local tabela = items[item.actionid] if not tabela then return false end local itemTypeContainer = ItemType(tabela.containerId) local itemTypeItem = ItemType(tabela.itemId) local containerWeight = itemTypeContainer:getWeight() local itemWeight = itemTypeItem:getWeight() local playerCap = player:getFreeCapacity() local totalWeight = (containerWeight + (itemWeight * tabela.count)) if playerCap < totalWeight then itemWeight = itemWeight / 100 player:sendTextMessage(MESSAGE_STATUS_CONSOLE_RED, "You have found a " .. itemTypeContainer:getName() .. " with " .. tabela.count .. " " .. itemTypeItem:getName() .. " weighing " .. totalWeight .. " oz it's too heavy.") player:getPosition():sendMagicEffect(CONST_ME_POFF) return false end local backpack = player:getSlotItem(CONST_SLOT_BACKPACK) if not backpack or backpack:getEmptySlots(false) < 1 then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_RED, "Your main backpack is full. You need to free up 1 available slots.") player:getPosition():sendMagicEffect(CONST_ME_POFF) return false end local container = Game.createItem(tabela.containerId) if not container then return false end for i = 1, tabela.count do local itemContainer = Game.createItem(tabela.itemId) if itemTypeItem:getCharges() > 0 then itemContainer:setAttribute(ITEM_ATTRIBUTE_CHARGES, itemTypeItem:getCharges()) end container:addItemEx(itemContainer) end if not container then return false end if player:getTotalMoney() > tabela.price then if player:removeTotalMoney(tabela.price) and player:addItemEx(container) then player:getPosition():sendMagicEffect(CONST_ME_DRAWBLOOD) end else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_RED, "You don't have ".. tabela.price .." gold coins to buy a ".. itemTypeContainer:getName() .." with ".. tabela.count .." ".. itemTypeItem:getName() ..".") player:getPosition():sendMagicEffect(CONST_ME_POFF) end item:transform(item.itemid == 1945 and 1946 or 1945) return true end Nesse segundo script, é possível comprar itens soltos (sem estar dentro de containers) mas que podem ser agrupados, como por exemplo, potions local potions = { [1515] = {id = 7620, charges = 100, value = 5600}, -- mana potion [1516] = {id = 7589, charges = 100, value = 9300}, -- strong mana potion [1517] = {id = 7590, charges = 100, value = 14400}, -- great mana potion [1518] = {id = 8472, charges = 100, value = 22800}, -- spirit potion [1519] = {id = 8473, charges = 100, value = 37900}, -- ultimate health potion } function onUse(player, item, fromPosition, target, toPosition, isHotkey) local potion = potions[item.actionid] if not potion then return false end local potionId = ItemType(potion.id) local itemWeight = potionId:getWeight() * potion.charges if player:getFreeCapacity() >= itemWeight then if not player:removeMoney(potion.value) then player:sendCancelMessage("You don't have ".. potion.value .." gold coins to buy ".. potion.charges .." ".. potionId:getName() ..".") else player:getPosition():sendMagicEffect(CONST_ME_DRAWBLOOD) player:addItem(potion.id, potion.charges) end else player:sendCancelMessage("You don't have capacity.") player:getPosition():sendMagicEffect(CONST_ME_POFF) end item:transform(item.itemid == 1945 and 1946 or 1945) return true end Nesse terceiro script, é possivel comprar apenas um item solto, não estacavel e sem charges, como uma wand, axe, etcs.. local items = { [2378] = {itemId = 2197, price = 100000}, -- battle axe } function onUse(player, item, fromPosition, target, toPosition, isHotkey) local tabela = items[item.actionid] if not tabela then return false end local itemTypeItem = ItemType(tabela.itemId) local itemWeight = itemTypeItem:getWeight() local playerCap = player:getFreeCapacity() if playerCap < itemWeight then itemWeight = itemWeight / 100 player:sendTextMessage(MESSAGE_STATUS_CONSOLE_RED, "You have found a " .. itemTypeItem:getName() .. " weighing " .. itemWeight .. " oz it's too heavy.") player:getPosition():sendMagicEffect(CONST_ME_POFF) return false end local backpack = player:getSlotItem(CONST_SLOT_BACKPACK) if not backpack or backpack:getEmptySlots(false) < 1 then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_RED, "Your main backpack is full. You need to free up 1 available slots.") player:getPosition():sendMagicEffect(CONST_ME_POFF) return false end local itemAdd = Game.createItem(tabela.itemId) if not itemAdd then return false end if player:getTotalMoney() > tabela.price then if player:removeTotalMoney(tabela.price) and player:addItemEx(itemAdd) then player:getPosition():sendMagicEffect(CONST_ME_DRAWBLOOD) end else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_RED, "You don't have ".. tabela.price .." gold coins to buy a ".. itemTypeItem:getName() ..".") player:getPosition():sendMagicEffect(CONST_ME_POFF) end item:transform(item.itemid == 1945 and 1946 or 1945) return true end
  12. Diego Rulez começou a seguir luanluciano93
  13. @Cjaker E pra quem usa a TFS 1,3, como faz? https://github.com/nekiro/forgottenserver/tree/8.6-downgrade
  14. Diego Rulez respondeu ao post em um tópico de Cjaker em Ferramentas OpenTibia
    @Cjaker como já te falei, o map tracker que tinha era todo em polonês, meio bugado, e na versão 8,54,,, Obrigado mesmo por me ajudar nessa, fico te devendo uma.
  15. @Mathias Kenfi ótimo conteúdo, como sempre.. Agora solta uma versão pra TFS 1.3 pra nóis.. VLW
  16. Boa @LeoTK agora converte pra 1x pra nois. Vlw flw ?
  17. Mapa 1 disparamente o melhor. kk
  18. @KauanS Atualizei o tópico principal com a resolução desse problema. No meu último post antes desse eu expliquei pra outro usuário o porque disso acontecer.
  19. @Yurotsz É porque depois que eu fiz o tutorial, acabou tendo uma mudança, vou corrigir o tutorial agora, mas vou te explicar. Na parte de criar o acesso, repare que não contem um # (sinal de jogo da velha) no começo e no seu vai ter. Você precisa simplesmente apagar o # que tem no começo das duas linhas e salvar. ERRADO CORRETO
  20. Na primeira tentativa, eu removi o IF que fala sobre level: if(it.runeLevel > 0) { begin = false; s << " with level " << it.runeLevel; } Na segunda eu só removi o 'and' na seguinte linha s << " " << (begin ? "with" : "and") << " magic level " << it.runeMagLevel;
  21. @elitehox É no arquivo item.cpp Procura essa parte aqui: bool dot = true; if(it.isRune()) { if(!it.runeSpellName.empty()) s << "(\"" << it.runeSpellName << "\")"; if(it.runeLevel > 0 || it.runeMagLevel > 0 || (it.vocationString != "" && it.wieldInfo == 0)) { s << "." << std::endl << "It can only be used"; if(it.vocationString != "" && it.wieldInfo == 0) s << " by " << it.vocationString; bool begin = true; if(it.runeLevel > 0) { begin = false; s << " with level " << it.runeLevel; } if(it.runeMagLevel > 0) { begin = false; s << " " << (begin ? "with" : "and") << " magic level " << it.runeMagLevel; } if(!begin) s << " or higher"; } } Acredito que se você trocar pelo código abaixo, funcione: bool dot = true; if(it.isRune()) { if(!it.runeSpellName.empty()) s << "(\"" << it.runeSpellName << "\")"; if(it.runeLevel > 0 || it.runeMagLevel > 0 || (it.vocationString != "" && it.wieldInfo == 0)) { s << "." << std::endl << "It can only be used"; if(it.vocationString != "" && it.wieldInfo == 0) s << " by " << it.vocationString; bool begin = true; if(it.runeMagLevel > 0) { begin = false; s << " " << (begin ? "with" : "and") << " magic level " << it.runeMagLevel; } if(!begin) s << " or higher"; } } Se não funcionar, tenta o seguinte: bool dot = true; if(it.isRune()) { if(!it.runeSpellName.empty()) s << "(\"" << it.runeSpellName << "\")"; if(it.runeLevel > 0 || it.runeMagLevel > 0 || (it.vocationString != "" && it.wieldInfo == 0)) { s << "." << std::endl << "It can only be used"; if(it.vocationString != "" && it.wieldInfo == 0) s << " by " << it.vocationString; bool begin = true; if(it.runeLevel > 0) { begin = false; s << " with level " << it.runeLevel; } if(it.runeMagLevel > 0) { begin = false; s << " " << (begin ? "with") << " magic level " << it.runeMagLevel; } if(!begin) s << " or higher"; } } Se resolver, procura dar um REP+ ai e marcar a melhor resposta.
  22. @elitehox Se possível me envia o link ai da source completa.. Eu achei que seria no spells.cpp mas pelo visto não é. Pra não ficar pedindo vários arquivos, me manda completo, que ai já te falo onde altera.

Informação Importante

Confirmação de Termo