Postado Maio 23, 2018 7 anos E ae Galera blz? Então, gostaria de saber se tem como configurar essas duas ultimas linhas dos NPC: Citar npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Pois essas ele buscam respostas automáticas, eu gostaria de poder colocar alguma mensagem de "ate logo" sem ser as que já existem no lib/npcsystem... Explicando: Gostaria de saber se teria como configurar manualmente a mensagem que o NPC diz depois que você fala "Bye" ou que você saia de perto dele. Desde já Grato!
Postado Maio 24, 2018 7 anos Solução @peterson18 existe sim a possibilidade de alterar essas falas. vá até a pasta data/npc/lib/npcsystem/ e abra o arquivo chamado npchandler.lua, você vai encontrar algo parecido com isso: [MESSAGE_GREET] = 'Welcome, |PLAYERNAME|! I have been expecting you.', [MESSAGE_FAREWELL] = 'Good bye, |PLAYERNAME|!', [MESSAGE_BUY] = 'Do you want to buy |ITEMCOUNT| |ITEMNAME| for |TOTALCOST| gold coins?', [MESSAGE_ONBUY] = 'It was a pleasure doing business with you.', [MESSAGE_BOUGHT] = 'Bought |ITEMCOUNT|x |ITEMNAME| for |TOTALCOST| gold.', [MESSAGE_SELL] = 'Do you want to sell |ITEMCOUNT| |ITEMNAME| for |TOTALCOST| gold coins?', [MESSAGE_ONSELL] = 'Thank you for this |ITEMNAME|, |PLAYERNAME| gold.', [MESSAGE_SOLD] = 'Sold |ITEMCOUNT|x |ITEMNAME| for |TOTALCOST| gold.', [MESSAGE_MISSINGMONEY] = 'Sorry, you don\'t have enough money.', [MESSAGE_NEEDMONEY] = 'You do not have enough money.', [MESSAGE_MISSINGITEM] = 'You don\'t even have that item, |PLAYERNAME|!', [MESSAGE_NEEDITEM] = 'You do not have this object.', [MESSAGE_NEEDSPACE] = 'You do not have enough capacity.', [MESSAGE_NEEDMORESPACE] = 'You do not have enough capacity for all items.', [MESSAGE_IDLETIMEOUT] = 'Next, please!', [MESSAGE_WALKAWAY] = 'How rude!', [MESSAGE_DECLINE] = 'Not good enough, is it... ?', [MESSAGE_SENDTRADE] = 'Here\'s my offer, |PLAYERNAME|. Don\'t you like it?', [MESSAGE_NOSHOP] = 'Sorry, I\'m not offering anything.', [MESSAGE_ONCLOSESHOP] = 'Thank you, come back when you want something more.', [MESSAGE_ALREADYFOCUSED]= '|PLAYERNAME|! I am already talking to you...', [MESSAGE_PLACEDINQUEUE] = '|PLAYERNAME|, please wait for your turn. There are |QUEUESIZE| customers before you.' Você pode alterar conforme seu gosto nesse arquivo (*vai afetar todos os npcs). Ou então alterar no próprio arquivo xml de cada NPC. exemplo: <?xml version="1.0" encoding="UTF-8"?> <npc name="Morgan" script="data/npc/scripts/vip/morgan.lua" walkinterval="2000"> <mana now="800" max="800"/> <health now="200" max="200"/> <look type="225" head="0" body="0" legs="0" feet="0" addons="0"/> <parameters> <parameter key="message_greet" value="Welcome, |PLAYERNAME|! I have been expecting you. Would like some {upgrades}? check {points}?" /> <parameter key="module_keywords" value="1" /> <parameter key="keywords" value="upgrades" /> <parameter key="keyword_reply1" value="I can sell for you.. {infinite potions} and upgrade spells for {sorcerer}, {druid}, {paladin} and {knight}. want to buy one?" /> </parameters> </npc> Dê uma certa atenção para a parte: <parameter key="message_greet" value="Welcome, |PLAYERNAME|! I have been expecting you. Would like some {upgrades}? check {points}?" /> você pode alterar o message_greet para uma das opções: MESSAGE_GREET MESSAGE_FAREWELL MESSAGE_BUY MESSAGE_ONBUY MESSAGE_BOUGHT MESSAGE_SELL MESSAGE_ONSELL MESSAGE_SOLD MESSAGE_MISSINGMONEY MESSAGE_NEEDMONEY MESSAGE_MISSINGITEM MESSAGE_NEEDITEM MESSAGE_NEEDSPACE MESSAGE_NEEDMORESPACE MESSAGE_IDLETIMEOUT MESSAGE_WALKAWAY MESSAGE_DECLINE MESSAGE_SENDTRADE MESSAGE_NOSHOP MESSAGE_ONCLOSESHOP MESSAGE_ALREADYFOCUSED MESSAGE_PLACEDINQUEUE Qualquer dúvida, volte a postar novamente ?
Postado Maio 24, 2018 7 anos Autor 20 horas atrás, Fabianuh disse: @peterson18 existe sim a possibilidade de alterar essas falas. vá até a pasta data/npc/lib/npcsystem/ e abra o arquivo chamado npchandler.lua, você vai encontrar algo parecido com isso: [MESSAGE_GREET] = 'Welcome, |PLAYERNAME|! I have been expecting you.', [MESSAGE_FAREWELL] = 'Good bye, |PLAYERNAME|!', [MESSAGE_BUY] = 'Do you want to buy |ITEMCOUNT| |ITEMNAME| for |TOTALCOST| gold coins?', [MESSAGE_ONBUY] = 'It was a pleasure doing business with you.', [MESSAGE_BOUGHT] = 'Bought |ITEMCOUNT|x |ITEMNAME| for |TOTALCOST| gold.', [MESSAGE_SELL] = 'Do you want to sell |ITEMCOUNT| |ITEMNAME| for |TOTALCOST| gold coins?', [MESSAGE_ONSELL] = 'Thank you for this |ITEMNAME|, |PLAYERNAME| gold.', [MESSAGE_SOLD] = 'Sold |ITEMCOUNT|x |ITEMNAME| for |TOTALCOST| gold.', [MESSAGE_MISSINGMONEY] = 'Sorry, you don\'t have enough money.', [MESSAGE_NEEDMONEY] = 'You do not have enough money.', [MESSAGE_MISSINGITEM] = 'You don\'t even have that item, |PLAYERNAME|!', [MESSAGE_NEEDITEM] = 'You do not have this object.', [MESSAGE_NEEDSPACE] = 'You do not have enough capacity.', [MESSAGE_NEEDMORESPACE] = 'You do not have enough capacity for all items.', [MESSAGE_IDLETIMEOUT] = 'Next, please!', [MESSAGE_WALKAWAY] = 'How rude!', [MESSAGE_DECLINE] = 'Not good enough, is it... ?', [MESSAGE_SENDTRADE] = 'Here\'s my offer, |PLAYERNAME|. Don\'t you like it?', [MESSAGE_NOSHOP] = 'Sorry, I\'m not offering anything.', [MESSAGE_ONCLOSESHOP] = 'Thank you, come back when you want something more.', [MESSAGE_ALREADYFOCUSED]= '|PLAYERNAME|! I am already talking to you...', [MESSAGE_PLACEDINQUEUE] = '|PLAYERNAME|, please wait for your turn. There are |QUEUESIZE| customers before you.' Você pode alterar conforme seu gosto nesse arquivo (*vai afetar todos os npcs). Ou então alterar no próprio arquivo xml de cada NPC. exemplo: <?xml version="1.0" encoding="UTF-8"?> <npc name="Morgan" script="data/npc/scripts/vip/morgan.lua" walkinterval="2000"> <mana now="800" max="800"/> <health now="200" max="200"/> <look type="225" head="0" body="0" legs="0" feet="0" addons="0"/> <parameters> <parameter key="message_greet" value="Welcome, |PLAYERNAME|! I have been expecting you. Would like some {upgrades}? check {points}?" /> <parameter key="module_keywords" value="1" /> <parameter key="keywords" value="upgrades" /> <parameter key="keyword_reply1" value="I can sell for you.. {infinite potions} and upgrade spells for {sorcerer}, {druid}, {paladin} and {knight}. want to buy one?" /> </parameters> </npc> Dê uma certa atenção para a parte: <parameter key="message_greet" value="Welcome, |PLAYERNAME|! I have been expecting you. Would like some {upgrades}? check {points}?" /> você pode alterar o message_greet para uma das opções: MESSAGE_GREET MESSAGE_FAREWELL MESSAGE_BUY MESSAGE_ONBUY MESSAGE_BOUGHT MESSAGE_SELL MESSAGE_ONSELL MESSAGE_SOLD MESSAGE_MISSINGMONEY MESSAGE_NEEDMONEY MESSAGE_MISSINGITEM MESSAGE_NEEDITEM MESSAGE_NEEDSPACE MESSAGE_NEEDMORESPACE MESSAGE_IDLETIMEOUT MESSAGE_WALKAWAY MESSAGE_DECLINE MESSAGE_SENDTRADE MESSAGE_NOSHOP MESSAGE_ONCLOSESHOP MESSAGE_ALREADYFOCUSED MESSAGE_PLACEDINQUEUE Qualquer dúvida, volte a postar novamente ? Bom acho que você não entendeu minha pergunta.... As mensagens pre-determinadas de quando você diz bye ou quando você sai de perto do NPC, eu sei configurar, mas eu queria que X NPC e apenas X NPC disse Y mensagens, quando eu disser bye ou quando eu sair de perto dele. Testei: Citar <parameter key="MESSAGE_FAREWELL" value="Mensagem"/> No XML do NPC mas ele não usa a mensagem que colo aqui...
Postado Maio 24, 2018 7 anos Autor 23 minutos atrás, FlavioHulk disse: poste seu script NPCHandler na pasta libs em Npc @edit Editado Maio 24, 2018 7 anos por peterson18 (veja o histórico de edições)
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.