Ir para conteúdo

Lyu

Membro
  • Registro em

  • Última visita

Tudo que Lyu postou

  1. Execute isso em sua database! CREATE TABLE IF NOT EXISTS `players_online` ( `player_id` int(11) NOT NULL, PRIMARY KEY (`player_id`) ) ENGINE=MEMORY;
  2. Lyu postou uma resposta no tópico em Suporte Tibia OTServer
    Se sua source for 0.3.7 ou 0.4 talvez eu possa lhe ajudar.
  3. Lyu postou uma resposta no tópico em Suporte Tibia OTServer
    em config.lua, procure por classicEquipmentSlots e mude para false.
  4. Utilize a Interface Raid, é exatamente o que você precisa. Talvez você encontre exemplos de como fazer em data/raids.
  5. Clique aqui e veja se isso lhe ajuda!
  6. Na datapack dos TFS atuais, em compat.lua, tem funções para trabalhar com TFS antigos, veja um exemplo : function getCreatureName(cid) local c = Creature(cid) return c ~= nil and c:getName() or false end Nesse caso, pode até rodar se o script for simples, mas o recomendado é fazer a conversão aplicando metamethods para rodar 100%.
  7. @KotZletY Ele já conseguiu o conteúdo pelo Discord, @VitorSubhi ajudou ele, acho que já podes considerar o tópico como resolvido. Para os que veio aqui atrás do mesmo conteúdo, irei deixar uma versão minha abaixo para TFS 0.3.7/0.4. data/npc/Neil.xml <?xml version="1.0" encoding="UTF-8"?> <npc name="Neil" script="neil.lua" walkinterval="2000" skull="green" floorchange="0"> <health now="100" max="100"/> <look type="128" head="0" body="105" legs="105" feet="0" addons="0"/> <parameters> <parameter key="message_greet" value="Olá |PLAYERNAME|. Eu vendo itens por pontos de doação, diga {trade}."/> </parameters> </npc> data/npc/scripts/neil.lua local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end local items = { {id = 2352, subType = 0, buy = 50, sell = 0, name = 'crystal arrow'}, {id = 8858, subType = 0, buy = 35, sell = 0, name = 'crossbow'} } local onBuy = function(cid, item, subType, amount) local price = 0 for _, v in ipairs(items) do if item == v.id then price = v.buy end end if not doPlayerRemoveMoney(cid, price) then selfSay(('Você não possui {%d pontos}.'):format(price), cid) else doPlayerAddItem(cid, item, amount) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, ('Você recebeu %d %s.'):format(amount, getItemInfo(item).name)) closeShopWindow(cid) end return npcHandler:releaseFocus(cid) end function creatureSayCallback(cid, type, msg) if msg:lower() == 'trade' then openShopWindow(cid, items, onBuy, onSell) end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) para configurar os itens a serem negociados por pontos, é em neil.lua na tabela items : local items = { {id = 2352, subType = 0, buy = 50, sell = 0, name = 'crystal arroww'}, {id = 8858, subType = 0, buy = 35, sell = 0, name = 'ice crossbow'} } Para trocar o tipo de moeda (pontos), edite a linha 21 em : if not doPlayerRemoveMoney(cid, price) then Troque pela função de remover pontos. Abraços.
  8. Lyu postou uma resposta no tópico em Suporte Tibia OTServer
    Testa ai function onLook(cid, thing, position, lookDistance) if isPlayer(thing.uid) then local k = getPlayerMarriage(getPlayerGUID(thing.uid)) if k then doPlayerSetSpecialDescription(thing.uid, (cid and "yourself" or getCreatureName(thing)) .. "[".. getPlayerLevel(thing) .."]. " .. (thing.uid == cid and "You are" or (getPlayerSex(thing.uid) == 0 and "She" or "He") .. " is") .. " Casado com [" .. getPlayerNameByGUID(k) .."]") end end return true end
  9. tem que ver se o player não possui a storage referente, senão ele não recebe. Porque reparei aqui que está bloqueado para receber as skulls somente uma vez (storage), a não ser que, esteja manipulando essa storage a partir de outro script.
  10. Procurei a função aqui, não testei, mas adicione-a em data/lib/050-function.lua e veja se resolve o seu problema. function getPlayerFrags(cid) local time = os.time() local times = {today = (time - 86400), week = (time - (7 * 86400))} local contents, result = {day = {}, week = {}, month = {}}, db.getResult("SELECT `pd`.`date`, `pd`.`level`, `p`.`name` FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `pk`.`player_id` = " .. getPlayerGUID(cid) .. " AND `k`.`unjustified` = 1 AND `pd`.`date` >= " .. (time - (30 * 86400)) .. " ORDER BY `pd`.`date` DESC") if(result:getID() ~= -1) then repeat local content = {date = result:getDataInt("date")} if(content.date > times.today) then table.insert(contents.day, content) elseif(content.date > times.week) then table.insert(contents.week, content) else table.insert(contents.month, content) end until not result:next() result:free() end local size = { day = table.maxn(contents.day), week = table.maxn(contents.week), month = table.maxn(contents.month) } return size.day + size.week + size.month end
  11. Está faltando a função getPlayerFrags.
  12. Lyu postou uma resposta no tópico em Suporte Tibia OTServer
    sim, é possível! Da pra fazer uma tag pro XML na source. Edit : outra forma mais fácil segue abaixo.. data/spells/scripts/support/challenge.lua : local list = {'Dragon', 'Dragon Lord'} local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED) local area = createCombatArea(AREA_SQUARE1X1) setCombatArea(combat, area) function onTarget(cid, target) for k, v in ipairs(list) do if getCreatureName(target) == v then return end end return doChallengeCreature(cid, target) end setCombatCallback(combat, CALLBACK_PARAM_TARGETCREATURE, "onTarget") function onCastSpell(cid, var) return doCombat(cid, combat, var) end em list, você lista os monstros a serem imunes ao exeta res. Abraços!
  13. se quiser que eu dê uma olhada mais de perto, me adiciona no Discord (ta no meu perfil) que lhe ajudo mais tarde. Deve ser algo que vc esteja errando. *Edit: Resolvido, o código está 100%!
  14. Estranho ter bugado, olha o meu resultado :
  15. Quanto tá o seu CASTEXP_PERCENT lá em data/lib/lib-castexp.lua?
  16. @Jobs que estranho! Coloquei o código sem os bugs no pastebin talvez funcione dessa vez, copie e cole la no seu arquivo : https://pastebin.com/gVn7BtzV
  17. Agora provavelmente é um bug no código, vi aqui é no último end. Apague o end e escreva novamente. *edit : no começo abaixo de function também te um bugzinho, apaga tb. *edit2: pra aparecer esses simbolos, só mudar a encoding para ANSI no Notepad++
  18. esse é o onGainExperience completo? Se sim, tenta assim : function Player:onGainExperience(source, exp, rawExp) if not source or source:isPlayer() then return exp end if CASTEXP[self:getName()] then if CASTEXP[self:getName()] <= os.time() then exp = (exp * CASTEXP_PERCENT) + exp self:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'Voce recebeu mais experiencia por manter o cast aberto.') end end return exp end
  19. Da uma olhadinha em data/events/events.xml e veja se o evento onGainExperience está ativado. <event class="Player" method="onGainExperience" enabled="1" /> Testei com o protocolo 8.60 e funcionou direitinho aqui rs
  20. Opa, olha eu aqui de novo xD testa ai: local walls = {1058, 9119, 10180, 1039} function onUse(cid, item, _, itemEx) local tmp = {} for _, v in ipairs(walls) do tmp[v] = #walls == _ and '_last' or walls[_ + 1] end local wall = tmp[itemEx.itemid] if not wall then return false end if wall == '_last' then doRemoveItem(itemEx.uid, 1) else doTransformItem(itemEx.uid, tmp[itemEx.itemid]) end return doRemoveItem(item.uid, 1) end
  21. O problema do cast é porque não está recebendo broadcast, por isso fica congelado.
  22. https://github.com/mattyx14/otxserver/tree/otxserv2 https://github.com/mattyx14/otxserver/tree/otxserv3
  23. OTX é bacana! otxserver2 baseado em TFS 0.3.7 otxserver3 baseado em TFS 1.3
  24. Vamos lá irmão, preciso que você faça os testes e me informe se ocorrerá tudo bem. primeiramente vamos criar uma lib em data/libs com o nome lib-castexp.lua. data/lib/lib-castexp.lua : CASTEXP = {} CASTEXP_PERCENT = 0.5 CASTEXP_NEEDTIME = 20 -- seconds agora precisamos carregar essa biblioteca a partir do arquivo lib.lua que é carregado por global.lua. data/lib/lib.lua : dofile('data/lib/lib-castexp.lua') sabe as talkactions !cast e !stopcast? Então, iremos dar uma mexidinha nas mesmas. Irei disponibilizar ambos já mexidos porque acho que é o mesmo que o seu. data/talkactions/scripts/start_cast.lua : function onSay(player, words, param) if (param == "on") then param = nil end if player:startLiveCast(param) then player:sendTextMessage(MESSAGE_INFO_DESCR, "You have started casting your gameplay.") CASTEXP[player:getName()] = os.time() + CASTEXP_NEEDTIME else player:sendCancelMessage("You're already casting your gameplay.") end return false end data/talkactions/scripts/stop_cast.lua : function onSay(player, words, param) if player:stopLiveCast(param) then player:sendTextMessage(MESSAGE_INFO_DESCR, "You have stopped casting your gameplay.") CASTEXP[player:getName()] = nil else player:sendCancelMessage("You're not casting your gameplay.") end return false end Vamos então mexer no evento onGainExperience que é encontrado em data/events/scripts/player.lua. CTRL + F, procure por onGainExperience e no final antes do return exp, adicione isso : if CASTEXP[self:getName()] then if CASTEXP[self:getName()] <= os.time() then exp = (exp * CASTEXP_PERCENT) + exp self:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'Voce recebeu mais experiencia por manter o cast aberto.') end end E pra finalizar, vamos anular o valor da chave caso o player deslogue. data/creaturescripts/scripts/logout.lua (Adicionar no final antes do return true) : CASTEXP[player:getName()] = nil Lembrando que o CASTEXP_NEEDTIME é em segundos, então caso queira 30 minutos, põe 1800. Lembre-se também de me manter informado caso haja bugs. Um forte abraço!
  25. Permito sim mano, obrigado!

Informação Importante

Confirmação de Termo