Em (data/NPC) você copia um script e troca de nome depois você adiciona o seguinte codigo...
<?xml version="1.0" encoding="UTF-8"?> <npc name="Captain" script="data/npc/scripts/boat10.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="129" head="19" body="69" legs="107" feet="50" addons="0"/> <parameters> <parameter key="message_greet" value="Welcome on board, Sir |PLAYERNAME|. Where can I sail you today?"/> <parameter key="message_farewell" value="Good bye. Recommend us if you were satisfied with our service."/> </parameters> </npc>
Depois va em (data/NPC/scripts) e adicione um arquivo chamado "boat10.lua" e adicione o seguinte código...
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
-- OTServ event handling functions start
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
-- OTServ event handling functions end
-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
local travelNode = keywordHandler:addKeyword({'cidade'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Cidade for 100 gold coins?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 100, destination = {x=32734, y=31668, z=6} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'})
keywordHandler:addKeyword({'sail'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to Cidade.'})
keywordHandler:addKeyword({'job'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I am the captain of this ship.'})
keywordHandler:addKeyword({'travel'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can only take you to Cidade.'})
-- Makes sure the npc reacts when you say hi, bye etc.
npcHandler:addModule(FocusModule:new())
Apenas mude a fala, dinheiro, e posição p/ onde deseja ir...
Creditos: lucasbro
Te Ajudei, +REP







info
Grupo: Cavaleiro
Registrado: 13/06/11
Posts: 172
Reputação: +6
Seguinte Pessoal To Fazendo Um ot Exp 200 Queria o Script De um Npc De Barco Que teleportasse o Player para Tal City xD. REP + Pra Quem Ajuda
Editado Agosto 21 por neero102