Postado Janeiro 26, 2017 8 anos 22 minutos atrás, Vodkart disse: acho que vc ta usando o ID errado da master ball no npc Não é vodkart, eu baixei o servidor e testei com umas pokeball e nada do NPC vender 56 minutos atrás, matheus9712 disse: me passa o script q vc usou pfv data/npcs/scripts crie um arquivo chamado Vendedor.lua e adicione isso dentro: 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 -- Config -- local configs = { FirstItemId = 2160, FirstItemCount = 1, SecondItemId = 13258, SecondItemCount = 1, isQuest = "false", questStorage = 17890, msgMeet = 'Você deseja trocar '..FirstItemCount .. ' '.. getItemName(FirstItemId) ..' por '.. SecondItemCount ..' '.. getItemName(SecondItemId) ..'?', msgQuestCompleted = "Você já fez essa quest.", msgQuestNotItem = "Voce não tem o dinheiro necessario.", } function npcTroca(cid, message, keywords, parameters, node) if(not npcHandler:isFocused(cid)) then return false end if (configs.isQuest == "true") then if (getPlayerStorageValue(configs.questStorage) <= 0) then if (getItemCount(cid, configs.FirstItemId) == configs.FirstItemCount) then doRemoveItem(configs.FirstItemId, config.FirstItemCount) doPlayerAddItem(cid, configs.SecondItemId, configs.SecondItemCount) else return doPlayerSendTextMessage(cid, 27, configs.msgQuestNotItem) end else return doPlayerSendTextMessage(cid, 27, configs.msgQuestCompleted) end else if (getItemCount(cid, configs.FirstItemId) == configs.FirstItemCount) then doRemoveItem(configs.FirstItemId, config.FirstItemCount) doPlayerAddItem(cid, configs.SecondItemId, configs.SecondItemCount) else return doPlayerSendTextMessage(cid, 27, configs.msgQuestNotItem) end end end itemTrade = keywordHandler:addKeyword({'offer'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = configs.msgMeet}) itemTrade:addChildKeyword({'yes'}, npcTroca, {}) itemTrade:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then.', reset = true}) npcHandler:addModule(FocusModule:new()) data/npcs crie um arquivo chamado Vendedor.xml e adicione: <?xml version="1.0" encoding="UTF-8"?> <npc name="Vendedor" script="Vendedor.lua" walkinterval="350000" floorchange="0" speed="0"> <health now="150" max="150"/> <look type="510" head="91" body="114" legs="86" feet="0"/> <parameters> <parameter key="message_greet" value="Hello dear customer! Are you here to see my offers? Come on, lets {trade}!"/> <parameter key="message_farewell" value="Good bye!"/> <parameter key="message_idletimeout" value="Good bye!"/> <parameter key="message_walkaway" value="Good bye!"/> </parameters> </npc>
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.