Postado Dezembro 11, 2014 10 anos Bom dia meus amigos do TK, Gostaria de pedir a ajuda de vocês com meu npc, eu utilizo um PDA PokexCyan para aprender algumas coisas e gostaria de saber como configuro meu npc mark (que vende potions e pokeballs) pra vender pokemons, na verdade eu gostaria de cloná-lo e criar um npc próprio para a venda de pokemons cobrando por diamonds (ou qualquer outro item) que não seja dollar. Lembrando que gostaria de manter esse novo esquema de Shop que o mark possui (de falar trade e abrir a janelinha com as opções) Vou postar os scripts se puderem me ajudar eu agradeço muito! Mark: <?xml version="1.0" encoding="UTF-8"?> <npc name="Mark" script="default.lua" walkinterval="0" floorchange="0" speed="0"> <health now="150" max="150"/> <look type="606" head="91" body="114" legs="86" feet="0"/> <parameters> <parameter key="message_greet" value="Olá amigo consumidor, eu tenho artigos para lhe ajudar em sua jornada, diga {trade} para ver as ofertas, ou {sell mais nome do item} para me vender algum loot!!"/> <parameter key="message_farewell" value="Good bye!"/> <parameter key="message_idletimeout" value="Good bye!"/> <parameter key="message_walkaway" value="Good bye!"/> <parameter key="module_shop" value="1"/> <parameter key="shop_buyable" value= "poke ball,2394,500; great ball,2391,2000; super ball,2393,5000; ultra ball,2392,13000; small potion,12347,500; great potion,12348,1000; ultra potion,12346,2200; hyper potion,12345,5000; full restore,12343,10000; heart backpack,11115,500; fur backpack,7342,500; beach backpack,5949,500; pirate backpack,5926,500; camouflage backpack,3940,500; revive,12344,25000; mechanical fishing rod,10223,1000000; medicine,12349,1000;"/> <parameter key="shop_sellable" value= "electric box,12176,2000; sandbag,12177,10000; comb,12179,50000; fur,12181,33000; ruby,12188,80000; essence of fire,12162,5000; small stone,12337,5000; pot of moss bug,12171,10000; screw,12164,5000; straw,2694,5000; water gems,12161,5000; remains of magikarp,12334,10000; teeth,12175,1000; bottle of poison,12165,5000; water pendant,12170,10000; feather,12200,10000; seed,12163,5000; pair of leaves,12155,10000; apple bite,12173,10000; bat wing,12182,10000; pot of lava,12152,10000; fire pendant,12286,10000; bug venom,12185,10000; bug antenna,12184,10000; venom pendant,12282,10000; pot of venom,12288,10000; iron bracelet,12192,5000; ice orb,12201,10000; gosme,12202,10000; darkness gem,12745,5000; bug gosme,13783,5000; enchanted gem,13785,5000; horn,13789,10000; snowball,13794,5000; venom piece,13795,10000;"/> </parameters> </npc> No script diz que ele se refere ao default.lua, então: 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 npcHandler:addModule(FocusModule:new()) e na minha pasta lib (dentro da pasta npc) tem o arquivo npc system.lua: -- Advanced NPC System (Created by Jiddo), -- Modified by Talaturen. if(NpcSystem == nil) then -- Loads the underlying classes of the npcsystem. dofile(getDataDir() .. 'npc/lib/npcsystem/keywordhandler.lua') dofile(getDataDir() .. 'npc/lib/npcsystem/queue.lua') dofile(getDataDir() .. 'npc/lib/npcsystem/npchandler.lua') dofile(getDataDir() .. 'npc/lib/npcsystem/modules.lua') -- Global npc constants: -- Keyword nestling behavior. For more information look at the top of keywordhandler.lua KEYWORD_BEHAVIOR = BEHAVIOR_NORMAL_EXTENDED -- Greeting and unGreeting keywords. For more information look at the top of modules.lua FOCUS_GREETWORDS = {'hi', 'hello', 'hey'} FOCUS_FAREWELLWORDS = {'bye', 'farewell', 'cya'} -- The word for requesting trade window. For more information look at the top of modules.lua SHOP_TRADEREQUEST = {'offer', 'trade'} -- The word for accepting/declining an offer. CAN ONLY CONTAIN ONE FIELD! For more information look at the top of modules.lua SHOP_YESWORD = {'yes'} SHOP_NOWORD = {'no'} -- Pattern used to get the amount of an item a player wants to buy/sell. PATTERN_COUNT = '%d+' -- Talkdelay behavior. For more information, look at the top of npchandler.lua. NPCHANDLER_TALKDELAY = TALKDELAY_ONTHINK -- Conversation behavior. For more information, look at the top of npchandler.lua. NPCHANDLER_CONVBEHAVIOR = CONVERSATION_DEFAULT -- Constant strings defining the keywords to replace in the default messages. -- For more information, look at the top of npchandler.lua... TAG_PLAYERNAME = '|PLAYERNAME|' TAG_ITEMCOUNT = '|ITEMCOUNT|' TAG_TOTALCOST = '|TOTALCOST|' TAG_ITEMNAME = '|ITEMNAME|' TAG_QUEUESIZE = '|QUEUESIZE|' NpcSystem = {} -- Gets an npcparameter with the specified key. Returns nil if no such parameter is found. function NpcSystem.getParameter(key) local ret = getNpcParameter(tostring(key)) if((type(ret) == 'number' and ret == 0) or ret == nil) then return nil else return ret end end -- Parses all known parameters for the npc. Also parses parseable modules. function NpcSystem.parseParameters(npcHandler) local ret = NpcSystem.getParameter('idletime') if(ret ~= nil) then npcHandler.idleTime = tonumber(ret) end local ret = NpcSystem.getParameter('talkradius') if(ret ~= nil) then npcHandler.talkRadius = tonumber(ret) end local ret = NpcSystem.getParameter('message_greet') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_GREET, ret) end local ret = NpcSystem.getParameter('message_farewell') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_FAREWELL, ret) end local ret = NpcSystem.getParameter('message_decline') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_DECLINE, ret) end local ret = NpcSystem.getParameter('message_needmorespace') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_NEEDMORESPACE, ret) end local ret = NpcSystem.getParameter('message_needspace') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_NEEDSPACE, ret) end local ret = NpcSystem.getParameter('message_sendtrade') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_SENDTRADE, ret) end local ret = NpcSystem.getParameter('message_noshop') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_NOSHOP, ret) end local ret = NpcSystem.getParameter('message_oncloseshop') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_ONCLOSESHOP, ret) end local ret = NpcSystem.getParameter('message_onbuy') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_ONBUY, ret) end local ret = NpcSystem.getParameter('message_onsell') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_ONSELL, ret) end local ret = NpcSystem.getParameter('message_missingmoney') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_MISSINGMONEY, ret) end local ret = NpcSystem.getParameter('message_needmoney') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_NEEDMONEY, ret) end local ret = NpcSystem.getParameter('message_missingitem') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_MISSINGITEM, ret) end local ret = NpcSystem.getParameter('message_needitem') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_NEEDITEM, ret) end local ret = NpcSystem.getParameter('message_idletimeout') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_IDLETIMEOUT, ret) end local ret = NpcSystem.getParameter('message_walkaway') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_WALKAWAY, ret) end local ret = NpcSystem.getParameter('message_alreadyfocused') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_ALREADYFOCUSED, ret) end local ret = NpcSystem.getParameter('message_placedinqueue') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_PLACEDINQUEUE, ret) end local ret = NpcSystem.getParameter('message_buy') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_BUY, ret) end local ret = NpcSystem.getParameter('message_sell') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_SELL, ret) end local ret = NpcSystem.getParameter('message_bought') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_BOUGHT, ret) end local ret = NpcSystem.getParameter('message_sold') if(ret ~= nil) then npcHandler:setMessage(MESSAGE_SOLD, ret) end -- Parse modules. for parameter, module in pairs(Modules.parseableModules) do local ret = NpcSystem.getParameter(parameter) if(ret ~= nil) then local number = tonumber(ret) if(number ~= nil and number ~= 0) then npcHandler:addModule(module:new()) end end end end end Gostaria de saber como fazer com que esse npc ao invés de cobrar dollar pelos itens, cobrasse outro item (diamonds ou qualquer outra coisa) REP+ pra TODOS que tentarem ajudar Muito Obrigado amigos! "A coisa mais indispensável a um homem é reconhecer o uso que deve fazer do seu próprio conhecimento." Ajudei? Reputar não vai te matar E Ainda me incentiva muito a continuar ajudando a todos! Meus trabalhos: [TUTORIAL] Quando preocupar-se com as cores? - Spriting [TUTORIAL] Pedras e Rochas - Spriting [APOSTILAS] Cores e sua parte Teórica - Spriting [TUTORIAL] Entendendo o Básico sobre cores - Spriting [TUTORIAL] Spriting, por onde começar? [TUTORIAL] Coisas para evitar - Spriting [TUTORIAL] Usando e Escolhendo Cores - Spriting [TUTORIAL] Pensando em Cores - Spriting [TUTORIAL] Adicionando novos Pokémons em seu PDA com e sem Icon System [TUTORIAL] [OLD/OTC] Criando link de Download Direto para seu cliente! Meu Show-off Thayam's Show Off
Postado Dezembro 11, 2014 10 anos Não tem como usar a janela de Trade do Tibia sem ser com dinheiro, tem até como só que e meio difícil fazer isso, o npc não pode ser pelo nome do Pokemon ? hi, trading, blastoise, yes ? Servidor do WONO 1.2 Pra Download
Postado Dezembro 12, 2014 10 anos Autor Pode sim sem problemas, teria como fazer isso mas ao invés de dollar ele pedir um item? exemplo diamond id 2254? up up "A coisa mais indispensável a um homem é reconhecer o uso que deve fazer do seu próprio conhecimento." Ajudei? Reputar não vai te matar E Ainda me incentiva muito a continuar ajudando a todos! Meus trabalhos: [TUTORIAL] Quando preocupar-se com as cores? - Spriting [TUTORIAL] Pedras e Rochas - Spriting [APOSTILAS] Cores e sua parte Teórica - Spriting [TUTORIAL] Entendendo o Básico sobre cores - Spriting [TUTORIAL] Spriting, por onde começar? [TUTORIAL] Coisas para evitar - Spriting [TUTORIAL] Usando e Escolhendo Cores - Spriting [TUTORIAL] Pensando em Cores - Spriting [TUTORIAL] Adicionando novos Pokémons em seu PDA com e sem Icon System [TUTORIAL] [OLD/OTC] Criando link de Download Direto para seu cliente! Meu Show-off Thayam's Show Off
Postado Dezembro 13, 2014 10 anos Autor up "A coisa mais indispensável a um homem é reconhecer o uso que deve fazer do seu próprio conhecimento." Ajudei? Reputar não vai te matar E Ainda me incentiva muito a continuar ajudando a todos! Meus trabalhos: [TUTORIAL] Quando preocupar-se com as cores? - Spriting [TUTORIAL] Pedras e Rochas - Spriting [APOSTILAS] Cores e sua parte Teórica - Spriting [TUTORIAL] Entendendo o Básico sobre cores - Spriting [TUTORIAL] Spriting, por onde começar? [TUTORIAL] Coisas para evitar - Spriting [TUTORIAL] Usando e Escolhendo Cores - Spriting [TUTORIAL] Pensando em Cores - Spriting [TUTORIAL] Adicionando novos Pokémons em seu PDA com e sem Icon System [TUTORIAL] [OLD/OTC] Criando link de Download Direto para seu cliente! Meu Show-off Thayam's Show Off
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.