Aberos 71 Postado Agosto 29, 2013 Share Postado Agosto 29, 2013 (editado) Galera do Xtibia queria saber se alguem tem um script de compra de outfit por talk para me disponibilizar ^^? Desde Ja Agradeço!! ^^EU USO PDA DO SLICER Editado Agosto 29, 2013 por Aberos Link para o comentário https://xtibia.com/forum/topic/220172-encerrado-comprar-outfit-por-talk/ Compartilhar em outros sites More sharing options...
Maenilse 86 Postado Agosto 29, 2013 Share Postado Agosto 29, 2013 (editado) data/talkactions/scripts copie qualquer arquivo e renomeie para buyaddon.lua e cole isso. function onSay(cid, words, param, channel) local cfg = { ["citizen"] = { outfit = { male = 128, female = 136, addon = 3, storage = 11001 }, items = { {2160,100} } }, ["hunter"] = { outfit = { male = 129, female = 137, addon = 3, storage = 11002 }, items = { {2160,100} } }, ["mage"] = { outfit = { male = 130, female = 138, addon = 3, storage = 11003 }, items = { {2160,100} } }, ["knight"] = { outfit = { male = 131, female = 139, addon = 3, storage = 11004 }, items = { {2160,100} } }, ["nobleman"] = { outfit = { male = 132, female = 140, addon = 3, storage = 11005 }, items = { {2160,100} } }, ["summoner"] = { outfit = { male = 133, female = 141, addon = 3, storage = 11006 }, items = { {2160,100} } }, ["warrior"] = { outfit = { male = 134, female = 142, addon = 3, storage = 11007 }, items = { {2160,100} } }, ["barbarian"] = { outfit = { male = 147, female = 143, addon = 3, storage = 11008 }, items = { {2160,100} } }, ["druid"] = { outfit = { male = 148, female = 144, addon = 3, storage = 11009 }, items = { {2160,100} } }, ["wizard"] = { outfit = { male = 149, female = 145, addon = 3, storage = 11010 }, items = { {2160,100} } }, ["oriental"] = { outfit = { male = 150, female = 146, addon = 3, storage = 11011 }, items = { {2160,100} } }, ["pirate"] = { outfit = { male = 151, female = 155, addon = 3, storage = 11012 }, items = { {2160,100} } }, ["assassin"] = { outfit = { male = 152, female = 156, addon = 3, storage = 11013 }, items = { {2160,100} } }, ["beggar"] = { outfit = { male = 153, female = 157, addon = 3, storage = 11014 }, items = { {2160,100} } }, ["shaman"] = { outfit = { male = 154, female = 158, addon = 3, storage = 11015 }, items = { {2160,100} } }, ["norseman"] = { outfit = { male = 251, female = 252, addon = 3, storage = 11016 }, items = { {2160,100} } }, ["nightmare"] = { outfit = { male = 268, female = 269, addon = 3, storage = 11017 }, items = { {2160,100} } }, ["jester"] = { outfit = { male = 273, female = 270, addon = 3, storage = 11018 }, items = { {2160,100} } }, ["brotherhood"] = { outfit = { male = 278, female = 279, addon = 3, storage = 11019 }, items = { {2160,100} } }, ["demon hunter"] = { outfit = { male = 289, female = 288, addon = 3, storage = 11020 }, items = { {2160,100} } }, ["yalaharian"] = { outfit = { male = 325, female = 324, addon = 3, storage = 11021 }, items = { {2160,100} } }, ["wayfarer"] = { outfit = { male = 366, female = 367, addon = 3, storage = 11023 }, items = { {2160,100} } }, ["Guerreiro"] = { outfit = { male = 254, female = 254, addon = 3, storage = 11022 }, items = { {2160,100} } } } local v, removeItems = cfg[param], 0, 0 if(param == "") then doPlayerSendCancel(cid, "Command requires param.") return true end if (not isPremium(cid)) then doPlayerSendCancel(cid, "Você nao tem premium account.") return true end if(getPlayerStorageValue(cid, v.outfit.storage) == -1) then for i = 1, #v.items do if(getPlayerItemCount(cid, v.items[i][1]) >= v.items[i][2]) then removeItems = removeItems+1 end end if(removeItems == #v.items) then if(getPlayerSex(cid) == 1) then doPlayerAddOutfit(cid, v.outfit.male, v.outfit.addon) elseif(getPlayerSex(cid) == 0) then doPlayerAddOutfit(cid, v.outfit.female, v.outfit.addon) end for i = 1, #v.items do doPlayerRemoveItem(cid, v.items[i][1], v.items[i][2]) end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você recebeu uma nova outfit!") doSendMagicEffect(getThingPos(cid), CONST_ME_FIREWORK_YELLOW) setPlayerStorageValue(cid, v.outfit.storage, 1) else for i = 1, #v.items do doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "você precisa " .. v.items[i][2] .. "x " .. getItemNameById(v.items[i][1]) .. " para comprar a outfit.") end end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Você ja tem está outfit.") end return true end em talkactions.xml registra a tag. <talkaction words="!buyaddon" script="buyaddon.lua"/> so editar essa parte do script. items = { {2160,100} Editado Agosto 29, 2013 por Maenilse Link para o comentário https://xtibia.com/forum/topic/220172-encerrado-comprar-outfit-por-talk/#findComment-1555343 Compartilhar em outros sites More sharing options...
Strogman 89 Postado Agosto 29, 2013 Share Postado Agosto 29, 2013 um pequeno erro ele quer que compre outfit nao addon isso é pra poketibia que ele quer nao pra tibia poketibia nao tem addon 1 2 3 etc so outfit Link para o comentário https://xtibia.com/forum/topic/220172-encerrado-comprar-outfit-por-talk/#findComment-1555349 Compartilhar em outros sites More sharing options...
Aberos 71 Postado Agosto 29, 2013 Autor Share Postado Agosto 29, 2013 @ Maenilse esse script seu nao add a outfit ao player Link para o comentário https://xtibia.com/forum/topic/220172-encerrado-comprar-outfit-por-talk/#findComment-1555394 Compartilhar em outros sites More sharing options...
Session Start 125 Postado Agosto 29, 2013 Share Postado Agosto 29, 2013 Primeiro mude em outfit.xml algumas coisas ( data/xml ) coloque a tag quest="valor da storage" ex: <outfit id="1" quest="123456789"> <list gender="0" lookType="136" name="Citizen"/> <list gender="1" lookType="128" name="Citizen"/> </outfit> <outfit id="2" quest="12345678910"> <list gender="0" lookType="137" name="Hunter"/> <list gender="1" lookType="129" name="Hunter"/> </outfit> <outfit id="3" quest="1234567891011"> <list gender="0" lookType="138" name="Mage"/> <list gender="1" lookType="130" name="Mage"/> </outfit> e a talkaction: function onSay(cid, words, param, channel) local cfg = { ["outfit1"] = { outfit = { storage = 123456789 }, items = { {2160,50} } }, ["outfit2"] = { outfit = { storage = 12345678910 }, items = { {2160,100} } } ["outfit3"] = { outfit = { storage = 1234567891011 }, items = { {2160,100} } } } local v, removeItems = cfg[param], 0, 0 if(param == "") then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Command requires param.") return TRUE end if (not cfg[param]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Esse outfit nao esta na lista!!") return TRUE end if (not isPremium(cid)) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Você nao tem premium account.") return TRUE end if(getPlayerStorageValue(cid, v.outfit.storage) == -1) then for i = 1, #v.items do if(getPlayerItemCount(cid, v.items[i][1]) >= v.items[i][2]) then removeItems = removeItems+1 end end if(removeItems == #v.items) then for i = 1, #v.items do doPlayerRemoveItem(cid, v.items[i][1], v.items[i][2]) end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce recebeu uma nova outfit!") doSendMagicEffect(getThingPos(cid), CONST_ME_FIREWORK_YELLOW) setPlayerStorageValue(cid, v.outfit.storage, 1) else for i = 1, #v.items do doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Voce precisa " .. v.items[i][2] .. "x " .. getItemNameById(v.items[i][1]) .. " para comprar a outfit.") end end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Voce ja tem esse outfit.") end return true end Maenilse ainda não aprendeu usar spoiler e que no pokemon os outfits são outros Link para o comentário https://xtibia.com/forum/topic/220172-encerrado-comprar-outfit-por-talk/#findComment-1555429 Compartilhar em outros sites More sharing options...
Aberos 71 Postado Agosto 29, 2013 Autor Share Postado Agosto 29, 2013 @ Cleberadm Muto Obrigado pela ajuda !!! Meu Problema foi Resolvido Link para o comentário https://xtibia.com/forum/topic/220172-encerrado-comprar-outfit-por-talk/#findComment-1555446 Compartilhar em outros sites More sharing options...
Beeki 284 Postado Agosto 29, 2013 Share Postado Agosto 29, 2013 Movido para a sessão correta, Link para o comentário https://xtibia.com/forum/topic/220172-encerrado-comprar-outfit-por-talk/#findComment-1555466 Compartilhar em outros sites More sharing options...
Stigal 584 Postado Abril 21, 2018 Share Postado Abril 21, 2018 A questão neste tópico de suporte foi encerrada por falta de respostas. Este tópico está fechado e foi movido para Suporte - Tópicos Sem Resposta. + Caso a dúvida não tenha sido resolvida você poderá criar outro tópico solicitando ajuda. * Lembre-se que é permitido dar UP no tópico a cada 24 horas para assim o destacar e manter movimentado. Link para o comentário https://xtibia.com/forum/topic/220172-encerrado-comprar-outfit-por-talk/#findComment-1735215 Compartilhar em outros sites More sharing options...
Posts Recomendados