DU
dúvida

Adicionar nova cidade no npc travell

Por Duuhzinhow, 19 de mar. de 2014 em Scripts

quero
adicionar
nova
cidade
script
23
2.8k
DuuhzinhowD
19 de março de 2014 às 18:31

Galera, vou postar aqui o script do npc travell, e eu quero adicionar um novo local para ele teleportar, alguem me explica como?

 

 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
 
local travelNode = keywordHandler:addKeyword({'suna'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wanna go to Suna Gakure, are you sure?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler,  level = 25, cost = 0, destination = {x=564, y=1145, z=7} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Next time maybe.'})
 
local travelNode = keywordHandler:addKeyword({'mist'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Dou you wanna go to Mist Gakure, are you sure?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler,  level = 25, cost = 0, destination = {x=1149, y=1218, z=7} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Next time maybe.'})
 
local travelNode = keywordHandler:addKeyword({'konoha'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Dou you wanna go to Konoha Gakure, are you sure?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, level = 25, cost = 0, destination = {x=1015, y=906, z=7} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Next time maybe.'})
 
local travelNode = keywordHandler:addKeyword({'amegakure'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wanna go to Amekagure no Sato, are you sure?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, level = 300, cost = 0, destination = {x=400, y=789, z=7} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Next time maybe.'})
 
local travelNode = keywordHandler:addKeyword({'valley of the end'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Dou you wanna go to Valley of the End, are you sure?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, level = 120, cost = 0, destination = {x=965, y=830, z=7} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Next time maybe.'})
 
local travelNode = keywordHandler:addKeyword({'south florest'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Dou you wanna go to Souty Florest, are you sure?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 180, cost = 0, destination = {x=912, y=1179, z=7} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Next time maybe.'})
 
local travelNode = keywordHandler:addKeyword({'west desert'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wanna go to West Desert, are you sure?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, level = 100, cost = 0, destination = {x=1496, y=1053, z=7} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Next time maybe.'})
 
local travelNode = keywordHandler:addKeyword({'south island'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wanna go to Sounth Island, are you sure?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, level = 150, cost = 0, destination = {x=1084, y=1400, z=7} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Next time maybe.'})
 
local travelNode = keywordHandler:addKeyword({'ice island'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wanna go to Ice Island, are you sure?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 1, cost = 0, destination = {x=1997, y=1118, z=7} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Next time maybe.'})
 
        keywordHandler:addKeyword({'travel'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to Suna, Mist, Konoha, Amegakure, Valley of the End, South Florest, South Island, West Desert and ice islands.'})
        -- Makes sure the npc reacts when you say hi, bye etc.
        npcHandler:addModule(FocusModule:new()) 

Editado Março 19 por Duuhzinhow

19 de março de 2014 às 18:39

Adiciona isso:

 

local travelNode = keywordHandler:addKeyword({'Nova City'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wanna go to Ice Island, are you sure?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 1, cost = 0, destination = {x=1997, y=1118, z=7} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Next time maybe.'})

 

e mais isso aonde tem

 

I can take you to Suna, Mist, Konoha, Amegakure, Valley of the End, South Florest, South Island, West Desert and ice islands.'})

 

 

No caso ira ficar assim:

 

I can take you to Suna, Mist, Konoha, Amegakure, Valley of the End, South Florest, South Island, West Desert, ice islands and Nova City.'})
HeelNoxH
19 de março de 2014 às 18:47

Adiciona isso.

local travelNode = keywordHandler:addKeyword({'ice island'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wanna go to Ice Island, are you sure?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 1, cost = 0, destination = {x=1997, y=1118, z=7} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Next time maybe.'})

Configure aqui:

local travelNode = keywordHandler:addKeyword({'ice island'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wanna go to Ice Island, are you sure?'})

keywordHandler:addKeyword({'ice island'} = Oque o player vai precisar falar, para se teleportar.

text = 'Do you wanna go to Ice Island, are you sure?'}) = Oque o NPC ira falar antes de teleportar (ira perguntar se ele quer ira mesmo)

 

É Aqui e facíl.

{npcHandler = npcHandler, premium = true, level = 1, cost = 0, destination = {x=1997, y=1118, z=7} })

Premium = True ou False = True só para premium, False para todos.

Level = Level Necessário para dar travel

Cost = Dinheiro Necessário

Destination = {x=1997, y=1118, z=7} }) = Cordenadas

Editado Março 19 por DarkHeel

DuuhzinhowD
19 de março de 2014 às 19:16

Não funciona, quando voce fala o nome da cidade nova o npc nao responde nada.

19 de março de 2014 às 19:18

Vc tmb tem que editar essa linha como expliquei acima:

 

keywordHandler:addKeyword({'travel'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to Suna, Mist, Konoha, Amegakure, Valley of the End, South Florest, South Island, West Desert and ice islands.'})
DuuhzinhowD
19 de março de 2014 às 19:27

 

Vc tmb tem que editar essa linha como expliquei acima:

keywordHandler:addKeyword({'travel'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to Suna, Mist, Konoha, Amegakure, Valley of the End, South Florest, South Island, West Desert and ice islands.'})

Mesmo assim, quando eu falo o nome da cidade ele nao responde.

HeelNoxH
19 de março de 2014 às 21:21

Configurou essa parte?



local travelNode = keywordHandler:addKeyword({'ice island'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wanna go to Ice Island, are you sure?'})
DuuhzinhowD
19 de março de 2014 às 23:05

 

Configurou essa parte?

local travelNode = keywordHandler:addKeyword({'ice island'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wanna go to Ice Island, are you sure?'})

Claro. ....

19 de março de 2014 às 23:10

Diga o nome da nova city e cordenadas que vc quer, que eu adiciono para vc

DuuhzinhowD
19 de março de 2014 às 23:33

"Zetsu island"// coloca qualquer cordenada, depois eu ajeito, é que to sem elas aqui...

19 de março de 2014 às 23:40

Ta ai, e o ultimo:

 

 

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

local travelNode = keywordHandler:addKeyword({'suna'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wanna go to Suna Gakure, are you sure?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler,  level = 25, cost = 0, destination = {x=564, y=1145, z=7} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Next time maybe.'})

local travelNode = keywordHandler:addKeyword({'mist'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Dou you wanna go to Mist Gakure, are you sure?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler,  level = 25, cost = 0, destination = {x=1149, y=1218, z=7} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Next time maybe.'})

local travelNode = keywordHandler:addKeyword({'konoha'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Dou you wanna go to Konoha Gakure, are you sure?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, level = 25, cost = 0, destination = {x=1015, y=906, z=7} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Next time maybe.'})

local travelNode = keywordHandler:addKeyword({'amegakure'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wanna go to Amekagure no Sato, are you sure?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, level = 300, cost = 0, destination = {x=400, y=789, z=7} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Next time maybe.'})

local travelNode = keywordHandler:addKeyword({'valley of the end'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Dou you wanna go to Valley of the End, are you sure?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, level = 120, cost = 0, destination = {x=965, y=830, z=7} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Next time maybe.'})

local travelNode = keywordHandler:addKeyword({'south florest'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Dou you wanna go to Souty Florest, are you sure?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 180, cost = 0, destination = {x=912, y=1179, z=7} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Next time maybe.'})

local travelNode = keywordHandler:addKeyword({'west desert'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wanna go to West Desert, are you sure?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, level = 100, cost = 0, destination = {x=1496, y=1053, z=7} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Next time maybe.'})

local travelNode = keywordHandler:addKeyword({'south island'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wanna go to Sounth Island, are you sure?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, level = 150, cost = 0, destination = {x=1084, y=1400, z=7} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Next time maybe.'})

local travelNode = keywordHandler:addKeyword({'ice island'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wanna go to Ice Island, are you sure?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 1, cost = 0, destination = {x=1997, y=1118, z=7} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Next time maybe.'})
 
local travelNode = keywordHandler:addKeyword({'Zetsu island'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wanna go to Ice Island, are you sure?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 1, cost = 0, destination = {x=1997, y=1118, z=7} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Next time maybe.'})

        keywordHandler:addKeyword({'travel'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to Suna, Mist, Konoha, Amegakure, Valley of the End, South Florest, South Island, West Desert, ice islands and Zetsu island.'})
        -- Makes sure the npc reacts when you say hi, bye etc.
        npcHandler:addModule(FocusModule:new())
DuuhzinhowD
20 de março de 2014 às 13:11

Não funcionou, quando eu fala "zetsu island" o npc nao responde nada..

HeelNoxH
20 de março de 2014 às 13:19
Melhor resposta


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

 

local travelNode = keywordHandler:addKeyword({'suna'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wanna go to Suna Gakure, are you sure?'})

travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, level = 25, cost = 0, destination = {x=564, y=1145, z=7} })

travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Next time maybe.'})

 

local travelNode = keywordHandler:addKeyword({'mist'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Dou you wanna go to Mist Gakure, are you sure?'})

travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, level = 25, cost = 0, destination = {x=1149, y=1218, z=7} })

travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Next time maybe.'})

 

local travelNode = keywordHandler:addKeyword({'konoha'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Dou you wanna go to Konoha Gakure, are you sure?'})

travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, level = 25, cost = 0, destination = {x=1015, y=906, z=7} })

travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Next time maybe.'})

 

local travelNode = keywordHandler:addKeyword({'amegakure'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wanna go to Amekagure no Sato, are you sure?'})

travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, level = 300, cost = 0, destination = {x=400, y=789, z=7} })

travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Next time maybe.'})

 

local travelNode = keywordHandler:addKeyword({'valley of the end'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Dou you wanna go to Valley of the End, are you sure?'})

travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, level = 120, cost = 0, destination = {x=965, y=830, z=7} })

travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Next time maybe.'})

 

local travelNode = keywordHandler:addKeyword({'south florest'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Dou you wanna go to Souty Florest, are you sure?'})

travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 180, cost = 0, destination = {x=912, y=1179, z=7} })

travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Next time maybe.'})

 

local travelNode = keywordHandler:addKeyword({'west desert'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wanna go to West Desert, are you sure?'})

travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, level = 100, cost = 0, destination = {x=1496, y=1053, z=7} })

travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Next time maybe.'})

 

local travelNode = keywordHandler:addKeyword({'south island'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wanna go to Sounth Island, are you sure?'})

travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, level = 150, cost = 0, destination = {x=1084, y=1400, z=7} })

travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Next time maybe.'})

 

local travelNode = keywordHandler:addKeyword({'ice island'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wanna go to Ice Island, are you sure?'})

travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 1, cost = 0, destination = {x=1997, y=1118, z=7} })

travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Next time maybe.'})

 

local travelNode = keywordHandler:addKeyword({'zetsu island'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wanna go to zetsu Island, are you sure?'})

travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 1, cost = 0, destination = {x=1997, y=1118, z=7} })

travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Next time maybe.'})

 

keywordHandler:addKeyword({'travel'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to Suna, Mist, Konoha, Amegakure, Valley of the End, South Florest, South Island, West Desert, ice islands and Zetsu island.'})

-- Makes sure the npc reacts when you say hi, bye etc.

npcHandler:addModule(FocusModule:new())

 

Editado Março 20 por DarkHeel

DuuhzinhowD
20 de março de 2014 às 19:27

Caraaa ja disse, quando eu falo "zetsu island" o npc nao responde!!


Alguem ajuda ae :s

HeelNoxH
20 de março de 2014 às 19:35

Caraaa ja disse, quando eu falo "zetsu island" o npc nao responde!!

Alguem ajuda ae :s

 

 

Editei o meu tenta ai, o post acima.