Postado Agosto 9, 2018 6 anos SE PUDEREM ME AJUDAR AGRADEÇO Família do TK tfs 0.4 server 8.6 exemplo ao da use no item de ID:2018 o player ganha x outfit se o player for male ganha o outfit male se o player for female ganha o outfit female SÓ PODE DA USE NO ITEM SE O PLAYER ESTIVER EM PZ o item tem que sumir é o outfit ficar no char pra sempre MEUS OUTFITS XML Citar </outfit> <outfit id="25" quest="15000"> <list gender="0" lookType="371" name="OldCitizen"/> <list gender="1" lookType="370" name="OldCitizen"/> </outfit> <outfit id="26" quest="16000"> <list gender="0" lookType="373" name="OldHunter"/> <list gender="1" lookType="372" name="OldHunter"/> </outfit> <outfit id="27" quest="17000"> <list gender="0" lookType="375" name="OldMage"/> <list gender="1" lookType="374" name="OldMage"/> </outfit> <outfit id="28" quest="18000"> <list gender="0" lookType="381" name="OldKnight"/> <list gender="1" lookType="380" name="OldKnight"/> </outfit> <outfit id="29" quest="19000"> <list gender="0" lookType="377" name="OldNobleman"/> <list gender="1" lookType="376" name="OldNobleman"/> </outfit> <outfit id="30" quest="20000"> <list gender="0" lookType="379" name="OldSummoner"/> <list gender="1" lookType="378" name="OldSummoner"/> </outfit> <outfit id="31" quest="21000"> <list gender="0" lookType="383" name="OldWarrior"/> <list gender="1" lookType="382" name="OldWarrior"/> </outfit> se puderem por pra quando ganha os outfits aparecer no quest log aqui esta QUESTS.XML Citar <?xml version="1.0" encoding="UTF-8"?> <quests> <quest name="Example Quest I" startstorageid="30031" startstoragevalue="1"> <mission name="The head of Kiper" storageid="1001" startvalue="1" endvalue="3"> <missionstate id="1" description="Kill Kiper!"/> <missionstate id="2" description="Give his head to Talaturen!"/> <missionstate id="3" description="Take the medal you got from Talaturen to Ruly!"/> </mission> <mission name="Ruly's Revenge" storageid="30031" startvalue="4" endvalue="6"> <missionstate id="4" description="You received a document with instructions from Ruly, follow them."/> <missionstate id="5" description="Go back to Ruly and tell him that you followed his instructions to the end."/> <missionstate id="6" description="You got a reward from Ruly, he was very thankful with that you helped him to take his revenge."/> </mission> </quest> </quests> 758x426.bmp
Postado Agosto 9, 2018 6 anos Solução 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 Editado Agosto 13, 2018 6 anos por GiovaniRodrigo (veja o histórico de edições) Spoiler local config = { delrey = getPlayerCarValue(cid, DELREY), cigarro = getPlayerCancer(cid, DERBY), prostituta = getPlayerAIDS(cid, cracuda), tresOitao = getPlayerRevorvi(cid, 38) } if(delrey == "Ligado" and cigarro == "Aceso" and prostituta == "No Colo" and tresOitao == "Carregado") then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Começou o fim de semana. #PAS") end
Postado Agosto 9, 2018 6 anos Autor 1 hora atrás, GiovaniRodrigo disse: É um item com porcentagem de cair qualquer uma dessas outfit de acordo com o sexo do jogador? Só pode ser usado uma vez? Você deixou algumas dúvidas em relação ao seu pedido. Apesar de algumas dúvidas, está ai o script. Ele funciona da seguinte maneira, o jogador usa o item e em uma ordem aleatória o script escolhe uma outfit e dá ao jogador. Esse item só pode ser usado uma vez por jogador. local config = { item = 2018, -- ID do item outfitMale = {370, 372, 374, 376, 378, 380, 382}, -- Outfit masculina outfitFemale = {371, 373, 375, 377, 379, 381, 383}, -- Outfit feminina addons = 3, -- 0 = Sem Addon / 1 = First Addon / 2 = Second Addon/ 3 = Full Addon messagePZ = "You need to be in a protect zone.", -- Mensagem se o player não estiver no PZ messageError = "You have already used this item." -- Mensagem se o player já utilizou o item } function onUse(cid, item, fromPosition, itemEx, toPosition) math.randomseed(os.time()) if(item.itemid == config.item) then if(getPlayerStorageValue(cid, 2333080818) <= 0) then if(getTilePzInfo(getCreaturePosition(cid))) then if(doPlayerRemoveItem(cid, config.item, 1)) then if(getPlayerSex(cid) == 0) then local randomOutfitFemale = config.outfitFemale[math.random(1, #config.outfitFemale)] doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT) doPlayerAddOutfit(cid, randomOutfitFemale, config.addons) setPlayerStorageValue(cid, 2333080818, 1) else local randomOutfitMale = config.outfitMale[math.random(1, #config.outfitMale)] doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT) doPlayerAddOutfit(cid, randomOutfitMale, config.addons) setPlayerStorageValue(cid, 2333080818, 1) end end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, config.messagePZ) end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, config.messageError) end end return true end A parte do QuestLog você teria que me explicar melhor, pois no QuestLog aparece quando se inicia a quest e depois aparece finalizada quando a quest é terminada. Quero saber se quer apenas que apareça no QuestLog quando for usado o item, ou se tem algum inicio antes de usar o item. SCRIPT NÃO TESTADO malz ai na real cada outfit tem seu próprio item, sim só pode ser usado uma vez .... quero que ao da use no item apareça no QuestLog é ao usar pela a primeira vez a outfit finalizada a quest..... 758x426.bmp
Postado Agosto 11, 2018 6 anos Aqui no TibiaKing mensagens como UP e BUMP são proibidas, utilize o botão subir este tópico. Esta é uma mensagem automática!Pedimos que leia as regras do fórum! Spoiler Here in TibiaKing messages like UP and BUMP are prohibited, use the button raise this topic. This is an automated message!Please read the forum rules.
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.