Ir para conteúdo

GiovaniRodrigo

Membro
  • Registro em

  • Última visita

Tudo que GiovaniRodrigo postou

  1. @ADM Mayk on BaiakME Parece estar tudo certo no seu XML
  2. @ADM Mayk on BaiakME estranho, pois eu testei o script com as outfits oficiais do Tibia e tudo funcionou perfeitamente. Pode ser algum problema na configuração das novas outfits.
  3. @Kevin Araujo Isso é configurações do bless de perdas, etc... Essa configuração que eu tenho é padrão do meu TFS 0.4. Tente testá-las e diga como foi.
  4. @Brunds Realmente, não tinha pensado nisso, tinha até esquecido do método onEquipe e onDeEquip.
  5. @Brunds Quebrei um pouco a cabeça, mas está ai. Pode parecer um pouco confuso, pois a muito tempo não faço scripts. Crie um arquivo na pasta data/creaturescripts/scripts com o nome fullSet.lua e coloque isso: local config = { tableSlot = { {slot = CONST_SLOT_HEAD, id = 2461}, -- Helmet {slot = CONST_SLOT_ARMOR, id = 2467}, -- Armor {slot = CONST_SLOT_LEGS, id = 2649}, -- Legs {slot = CONST_SLOT_LEFT, id = 2382}, -- Arma ou Shield {slot = CONST_SLOT_RIGHT, id = 2512}, -- Shield ou Arma {slot = CONST_SLOT_FEET, id = 2643}, -- Boots }, message = "Full Set", -- Mensagem que irá aparecer interval = 3 -- Tempo que a mensagem aparecerá em segundos } function sendMessageFullSet(cid) if(not isPlayer(cid)) then return true end local i = config.tableSlot if(getPlayerSlotItem(cid, i[1].slot).itemid == i[1].id and getPlayerSlotItem(cid, i[2].slot).itemid == i[2].id and getPlayerSlotItem(cid, i[3].slot).itemid == i[3].id and getPlayerSlotItem(cid, i[6].slot).itemid == i[6].id) then if(getPlayerSlotItem(cid, i[4].slot).itemid == i[4].id or getPlayerSlotItem(cid, i[4].slot).itemid == i[5].id) then if(getPlayerSlotItem(cid, i[5].slot).itemid == i[5].id or getPlayerSlotItem(cid, i[5].slot).itemid == i[4].id) then doSendAnimatedText(getCreaturePosition(cid), config.message, math.random(1, 255)) addEvent(sendMessageFullSet, config.interval * 1000, cid) end end end end function onLogin(cid) sendMessageFullSet(cid) return true end Adicione no arquivo creaturescripts.xml a seguinte tag: <event type="login" name="FullSet" event="script" value="fullSet.lua"/> TESTADO TFS 0.4 - SCRIPT FUNCIONAL
  6. @Brunds addEvent
  7. @Brunds Eu faria em creturescripts, e usaria AnimatedText assim como o usuário deseja.
  8. @poko360 Globalevents não sei se seria essencial para esse script, pois imagina uma verificação a cada 10 segundos em um OT com 200 pessoas online. Com certeza causaria freeze no server.
  9. Verifique se seu bless se encontra dessa maneira no config.lua blessings = true blessingReductionBase = 30 blessingReductionDecrement = 5 eachBlessReduction = 8
  10. @Mazarati Sempre que precisar, estaremos aqui para ajudar.
  11. @ADM Mayk on BaiakME Bug corrigido, re-copie o código e teste novamente.
  12. @Jinx Qual ID será equipado em tal slot? Ex: ID: a HEAD, ID: b ARMOR, ID: c LEGS, ID: d FEET(BOOTS) Me diga também se tem escudo e arma e qual o ID deles.
  13. @Brunds Não sei se existe diferença entre o dois, testa e vê se retorna algum erro. Se retornar, poste aqui.
  14. Tente isso: .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 markTable = { -- {markPos = Coordenadas da marcação, markType = Tipo de marcação, markDescription = Descrição da marcação} {markPos = {x = 150, y = 150, z = 7}, markType = MAPMARK_TICK, markDescription = "Tick"}, {markPos = {x = 155, y = 150, z = 7}, markType = MAPMARK_QUESTION, markDescription = "Question"}, {markPos = {x = 160, y = 150, z = 7}, markType = MAPMARK_EXCLAMATION, markDescription = "Exclamation"}, {markPos = {x = 165, y = 150, z = 7}, markType = MAPMARK_STAR, markDescription = "Star"}, {markPos = {x = 170, y = 150, z = 7}, markType = MAPMARK_CROSS, markDescription = "Cross"}, {markPos = {x = 175, y = 150, z = 7}, markType = MAPMARK_TEMPLE, markDescription = "Temple"}, {markPos = {x = 180, y = 150, z = 7}, markType = MAPMARK_KISS, markDescription = "Kiss"}, {markPos = {x = 185, y = 150, z = 7}, markType = MAPMARK_SHOVEL, markDescription = "Shovel"}, {markPos = {x = 190, y = 150, z = 7}, markType = MAPMARK_SWORD, markDescription = "Sword"}, {markPos = {x = 195, y = 150, z = 7}, markType = MAPMARK_FLAG, markDescription = "Flag"}, {markPos = {x = 200, y = 150, z = 7}, markType = MAPMARK_LOCK, markDescription = "Lock"}, {markPos = {x = 205, y = 150, z = 7}, markType = MAPMARK_BAG, markDescription = "Bag"}, {markPos = {x = 210, y = 150, z = 7}, markType = MAPMARK_SKULL, markDescription = "Skull"}, {markPos = {x = 215, y = 150, z = 7}, markType = MAPMARK_DOLLAR, markDescription = "Dollar"}, {markPos = {x = 220, y = 150, z = 7}, markType = MAPMARK_REDNORTH, markDescription = "Red North"}, {markPos = {x = 225, y = 150, z = 7}, markType = MAPMARK_REDSOUTH, markDescription = "Red South"}, {markPos = {x = 230, y = 150, z = 7}, markType = MAPMARK_REDEAST, markDescription = "Red East"}, {markPos = {x = 235, y = 150, z = 7}, markType = MAPMARK_REDWEST, markDescription = "Red West"}, {markPos = {x = 240, y = 150, z = 7}, markType = MAPMARK_GREENNORTH, markDescription = "Green North"}, {markPos = {x = 245, y = 150, z = 7}, markType = MAPMARK_GREENSOUTH, markDescription = "Green South"} } function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local func_addMark = doPlayerAddMapMark if(not func_addMark) then func_addMark = doAddMapMark end if(msgcontains(msg, "locais")) then for mark, x in pairs(markTable) do func_addMark(cid, x.markPos, x.markType, x.markDescription ~= nil and x.markDescription or "") end selfSay("Oh, the locals, right?! Well, I marked some on your minimap", cid) end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) TESTADO TFS 0.4 FUNCIONAL
  15. Crie um arquivo na pasta data/creaturescripts/scripts chamado premium.lua e coloque isso: local storage = 130820182010 function onLogin(cid) if(isPremium(cid) and getPlayerStorageValue(cid, storage) <= 0) then setPlayerStorageValue(cid, storage, 1) end if(not isPremium(cid) and getPlayerStorageValue(cid, storage) == 1) then if(getPlayerVocation(cid) == 0) then local templeRook = getTownTemplePosition(6) doTeleportThing(cid, templeRook) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT) setPlayerStorageValue(cid, storage, -1) else local templeMain = getTownTemplePosition(4) doTeleportThing(cid, templeMain) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT) setPlayerStorageValue(cid, storage, -1) end end return true end No arquivo creaturescripts.xml adicione a seguinte tag: <event type="login" name="CheckPremium" event="script" value="premium.lua"/> TESTADO TFS 0.4 - SCRIPT FUNCIONAL
  16. Tente isso: local config = { interval = 3, -- Tempo em segundos que a mensagem irá aparecer message = "Set Full!" -- Mensagem que irá dizer } function AURA(cid) if getPlayerStorageValue(cid, 554466) == 1 then doSendAnimatedText(getCreaturePosition(cid), config.message, math.random(1, 255)) addEvent(AURA, config.inverval*1000, cid) end end function onEquip (cid, item, slot) setPlayerStorageValue(cid, 554466, 1) AURA(cid) return true end function onDeEquip(cid, item, slot) setPlayerStorageValue(cid, 554466, -1) return true end NÃO TESTADO
  17. GiovaniRodrigo postou uma resposta no tópico em Suporte Tibia OTServer
    Serve o NPC de travel? Todo servidor tem um.
  18. @ADM Mayk on BaiakME Você precisa ser mais direto no seus tópicos amigo, já que são 4 itens, já envie todos os IDs para que possamos fazer seu script e deixar 100% para você instalá-lo. Qual a sua preferência? NPC ou usar o item? Com as informações que eu tenho, consegui fazer para dar use em determinado item e ele dar a vocação. Crie um arquivo chamado addVoc.lua na pasta data/actions/scripts e coloque esse script: local config = { tableVoc = { -- [ID da vocação antiga] = {newVoc = ID da nova vocação, id = ID do item, magicEffect = Efeito no jogador} [5] = {newVoc = 9, id = 2190, magicEffect = CONST_ME_FIREATTACK}, [6] = {newVoc = 10, id = 2182, magicEffect = CONST_ME_ICEATTACK}, [7] = {newVoc = 11, id = 2456, magicEffect = CONST_ME_HOLYDAMAGE}, [8] = {newVoc = 12, id = 2403, magicEffect = CONST_ME_BLOCKHIT} }, premium = true, -- true = Premium Account / false = Free Account needLevel = true, -- true = Precisa de level / false = Não precisa de level level = 20 -- Nível necessário para adquirir a promoção } function onUse(cid, item, fromPosition, itemEx, toPosition) for voc, x in pairs(config.tableVoc) do if(item.itemid == x.id) then if(getPlayerVocation(cid) == x.newVoc) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "You already belong to the family of "..getVocationInfo(x.newVoc).name..".") -- Mensagem de erro caso já tenha recebido a promotion elseif(getPlayerVocation(cid) ~= voc) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "You do not belong to the family of "..getVocationInfo(voc).name..".") -- Mensagem de erro caso não sejá da mesma classe elseif(config.premium == true and not isPremium(cid)) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "You must be premium to receive this promotion.") -- Mensagem de erro caso não tenha Premium Time elseif(config.needLevel == true and getPlayerLevel(cid) < config.level) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "You need to reach level "..config.level.." first.") -- Mensagem de erro caso não tenha nível necessário elseif(doRemoveItem(item.uid, 1)) then doPlayerSetVocation(cid, x.newVoc) doSendMagicEffect(fromPosition , CONST_ME_POFF) doSendMagicEffect(getCreaturePosition(cid), x.magicEffect) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have been promoted to "..getVocationInfo(x.newVoc).name..".") -- Mensagem de sucesso caso seja promovido end end end return true end Agora no arquivo actions.xml adicione a seguinte tag: <action itemid="2190;2182;2456;2403" event="script" value="addVoc.lua"/> Na tag em itemid adicione os IDs dos itens configurados no addVoc.lua TESTADO NO TFS 0.4, PORÉM MEU TFS DEVE ESTAR BUGADO, ELE DA A VOCAÇÃO, MAS AO DESLOGAR RETORNA A VOCAÇÃO ANTIGA. TESTE E ME RETORNE O QUE ACONTECEU.
  19. @ADM Mayk on BaiakME Eu alterei o código, poderia testar por favor? A questão do QuestLog, preciso que me esclareça como é ganhado o item que dará o outfit. Quest, drop, compra?
  20. @Ajuda o Chupeta Todos os itens estarão equipados no corpo? Ou terá itens dentro de BP?
  21. Crie um arquivo com o nome itemEquip.lua na pasta data/creaturescripts/scripts e cole isso local config = { slot = CONST_SLOT_FEET, -- Slot que o item está equipado itemID = 2195, -- Item BOH message = "You are fast?", -- Mensagem que aparecerá delay = 10 -- Tempo que a mensagem aparecerá em segundos } function sendMessageItem(cid) if(not isPlayer(cid)) then return true end if(getPlayerSlotItem(cid, config.slot).itemid == config.itemID) then doCreatureSay(cid, config.message, TALKTYPE_MONSTER) addEvent(sendMessageItem, config.delay * 1000, cid) end end function onLogin(cid) sendMessageItem(cid) return true end Coloque este código no arquivo login.lua que está na pasta data/creaturescripts/scripts registerCreatureEvent(cid, "ItemEquip") Coloque essa tag no arquivo creaturescripts.xml <event type="login" name="ItemEquip" event="script" value="itemEquip.lua"/> A configuração está bem simples pois está tudo comentado, vou apenas colocar os nomes de cada slot do personagem. CONST_SLOT_HEAD = Capacete CONST_SLOT_NECKLACE = Colar CONST_SLOT_BACKPACK = Bolsa CONST_SLOT_ARMOR = Peitoral CONST_SLOT_RIGHT = Mão Direita CONST_SLOT_LEFT = Mão Esquerda CONST_SLOT_LEGS = Calça CONST_SLOT_FEET = Bota CONST_SLOT_RING = Anel CONST_SLOT_AMMO = Flechas TESTADO NO TFS 0.4 - FUNCIONAL
  22. Ele funciona da seguinte maneira, o jogador usa o item de ID X para ganhar a OUTFIT X. Esse item só pode ser usado uma vez por jogador. Na pasta data/actions/scripts crie um arquivo itemOutfit.lua e coloque esse código: local config = { tableItem = { -- [Id do item] = {storage = Não mexa, outfitFemale = lookType do outfit feminino, outfitMale = lookType do outfit masculino} [2018] = {storage = 200201, outfitFemale = 371, outfitMale = 370}, [2019] = {storage = 200202, outfitFemale = 373, outfitMale = 372}, [2020] = {storage = 200203, outfitFemale = 375, outfitMale = 374}, [2021] = {storage = 200204, outfitFemale = 377, outfitMale = 376}, [2022] = {storage = 200205, outfitFemale = 379, outfitMale = 378}, [2024] = {storage = 200206, outfitFemale = 381, outfitMale = 380}, [2025] = {storage = 200207, outfitFemale = 383, outfitMale = 382} }, addons = 3, -- 0 = Sem Addon / 1 = First Addon / 2 = Second Addon/ 3 = Full Addon needPZ = true, -- true = Precisa estar na protect zone / false = Não precisa estar na protect zone message = "You received a new outfit.", messagePZ = "You need to be in a protect zone.", -- Mensagem se o player não estiver na protect zone messageError = "You already have this outfit." -- Mensagem se o player já tem o addon } function onUse(cid, item, fromPosition, itemEx, toPosition) for id, x in pairs(config.tableItem) do if(item.itemid == id) then if(getPlayerStorageValue(cid, x.storage) > 0) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, config.messageError) elseif(needPZ == true and not getTilePzInfo(getCreaturePosition(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, config.messagePZ) elseif(doRemoveItem(item.uid, 1)) then if(getPlayerSex(cid) == 0) then doSendMagicEffect(fromPosition , CONST_ME_POFF) -- Efeito quando o item for usado e desaparecer doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT) doPlayerAddOutfit(cid, x.outfitFemale, config.addons) setPlayerStorageValue(cid, x.storage, 1) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, config.message) else doSendMagicEffect(fromPosition , CONST_ME_POFF) -- Efeito quando o item for usado e desaparecer doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT) doPlayerAddOutfit(cid, x.outfitMale, config.addons) setPlayerStorageValue(cid, x.storage, 1) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, config.message) end end end end return true end No arquivo actions.xml coloque essa tag: <action itemid="2018;2019;2020;2021;2022;2024;2025" event="script" value="itemOutfit.lua"/> Altere o itemid da tag que você colocou no actions.xml de acordo com os ID dos itens que você configurou no script itemOutfit.lua TESTADO TFS 0.4 - SCRIPT FUNCIONAL Log: Acrescentado: needPZ = true, -- true = Precisa estar na protect zone / false = Não precisa estar na protect zone message = "You received a new outfit.", -- Mensagem quando ganha o outfit -- Efeito doSendMagicEffect(fromPosition , CONST_ME_POFF) -- Efeito quando o item for usado e desaparecer Bug corrigido: (LuaInterface::luaDoRemoveItem) Item not found
  23. Encontre esse diretório no seu servidor data/lib e poste todo o script do arquivo 000-constant.lua nesse tópico.
  24. @Vodkart, obrigado príncipe encantado ❤️

Informação Importante

Confirmação de Termo