Bom galera, vi varios tutorial mais sem sucesso!
entao por favor me ajudem a criar um NPC BARCO 8.60 ( Q LEVA O PLAYER PRA TAL LUGA )
EXPLIQUEM PRA QUE EU POSSA ENTENDER
AGRADEÇO DESDE JAH!
Bom galera, vi varios tutorial mais sem sucesso!
entao por favor me ajudem a criar um NPC BARCO 8.60 ( Q LEVA O PLAYER PRA TAL LUGA )
EXPLIQUEM PRA QUE EU POSSA ENTENDER
AGRADEÇO DESDE JAH!
Tá, vai na pasta data/npc e cria um arquivo XML com o nome Captain
Dentro Coloca isso:
<npc name="Captain" script="data/npc/scripts/barco.lua" floorchange="0" access="5" level="1" maglevel="1"><health now="150" max="150"/>
<look type="129" head="114" body="119" legs="114" feet="114" corpse="2212"/>
<parameters>
<parameter key="message_greet" value="Ola |PLAYERNAME|. ! I can take you to {cidade} (100 gps), {cidade2} (100gps). Where do you want to go?" />
<parameter key="message_decline" value="Is |TOTALCOST| gold coins too much for you? Get out of here!"/>
</parameters>
</npc>
cidadeNome da cidade em que o player será transportado.100gps Preço da passagem.
Agora vai em scripts copie uma pasta tire o que esta dentro, renomeie para barco e coloque dentro isto:
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({'yalahar'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wish to travel to CIDADE1 for 100 gold coins?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 2, cost = 100, destination = {x=160, y=54, z=7} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'I wouldn\'t go there either.'})
keywordHandler:addKeyword({'destination'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to \'CIDADE1\' for just a small fee.'})
-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
local travelNode = keywordHandler:addKeyword({'ab'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wish to travel to CIDADE2 for 100 gold coins?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 2, cost = 100, destination = {x=1080, y=488, z=6} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'I wouldn\'t go there either.'})
keywordHandler:addKeyword({'destination'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to \'CIDADE2\' for just a small fee.'})
-- Makes sure the npc reacts when you say hi, bye etc.
npcHandler:addModule(FocusModule:new())
vermelho>Nome da cidade para onde o player será transportado.Laranja>Nome da Cidade 2 em que o player será transportado.
Coloque o nome da cidade 1 nos dois vermelhos e da cidade 2 nos dois laranjas
Azul>Local onde o player irá, posição do outro barco por exemplo.
Espero ter ajudado, se deu algo errado me aviso que eu corrijo.
@ DanielZiyak
vlw ae
vou testa aqui