Após muitas buscas, consegui finalmente fazer um NPC que reparasse a soft boots
----------------
Vamos ao que interesa:
1. Vá em data\npc;
2. Copie e cole um arquivo XML qualquer, renomeando-o para Soft Boots Repair
3. Abra o código fonte e insira
<?xml version="1.0" encoding="UTF-8"?> <npc name="Soft Boots Repair" script="data/npc/scripts/softbootsrepair.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="134" head="55" body="60" legs="50" feet="75" addons="3"/> </npc>
4. Vá em data\npc\scripts e crie ou copie um arquivo .lua com o nome de softbootsrepair
5. Abra o código fonte e insira, novamente
<?xml version="1.0" encoding="UTF-8"?> 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 function rechargesoftboots(cid, message, keywords, parameters, node) if(not npcHandler:isFocused(cid)) then return false end npcHandler:addModule(FocusModule:new()) local playermoney = getPlayerMoney(cid) if playermoney >= [color="#FF0000"]40000[/color] then if doPlayerRemoveItem(cid,6530,1) == 1 then doPlayerAddItem(cid, 6132, 1) doPlayerRemoveMoney(cid, [color="#FF0000"]40000[/color]) npcHandler:say("Here are your new soft boots!", cid) else npcHandler:say("You don't have worn soft boots.", cid) end else npcHandler:say("You don't have enough money.", cid) end keywordHandler:moveUp(1) return true end local node1 = keywordHandler:addKeyword({'soft boots'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to repair your soft boots for [color="#FF0000"]40000[/color] gold coins?'}) node1:addChildKeyword({'yes'}, rechargesoftboots, {blessing = 1}) node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Then not.'}) keywordHandler:addKeyword({'repair soft boots'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can repair a pair of worn {soft boots} for [color="#FF0000"]40000[/color] gold coins. For that say {soft boots}"}) keywordHandler:addKeyword({'help'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can repair a pair of worn {soft boots} for [color="#FF0000"]40000[/color] gold coins."}) npcHandler:addModule(FocusModule:new())>
todos os valores acima em vermelho podem ser trocados, indica a quantidade de dinheiro (em gold coins) que um player irá pagar pelo reparo da boots
6. Salve os arquivos e bom proveito... (Lembre-se que para dar respawn do NPC precisa editar o mapa editor)
-------------------------------------------------------
Editando mapa editor
1. Se seu mapa editor for o RME, vá em C:\Arquivos de programas\Remere's Map Editor\data\840
2. Abra o código fonte do arquivo CREATURES.XML
3. Vá a ultima linha, antes de </creatures>
4. La escreva
<creature name="Soft Boots Repair" type="npc" looktype="133" lookhead="39" lookbody="0" looklegs="19" lookfeet="20" />
ficando assim
<creature name="Mad Scientist" type="monster" looktype="133" lookhead="39" lookbody="0" looklegs="19" lookfeet="20" /> <creature name="Soft Boots Repair" type="npc" looktype="133" lookhead="39" lookbody="0" looklegs="19" lookfeet="20" /> </creatures>
Para selecionar o npc, vá em
4.1 Criature Pallete
4.2 NPCs
5. Crie respawn e salve.
Se seu mapa editor não for o RME, siga o seguinte prossedimento
1. Abra a pasta onde contem os arquivos do Mapa Editor
2. Faça os tópicos 2., 3., e 4,. ( NÃO FAÇA O 4.1 E O 4.2 )
3. Selecione a categoria NPC
4. Crie o respawn, salve.
Espero ter ajudado.
Qualquer duvida pm ou post aqui.
Créditos (75% Pessotto)
(25% Às fontes que procurei)
Att,
Pessotto