Ir para conteúdo

[Monster] Dúvida Sobre Npcs...


DemonKorg

Posts Recomendados

Bem, no servfull eu ponho uns npc que vejo aqui no fórum e eles nao funcionam, e eu gostaria de saber porque..

 

Eles tem uma base diferente, acho, e gostaria de saber como mudar isso e/ou como funciona.

 

Esse script, por exemplo, nao funciona no ot:

 

local focus = 0

local talk_start = 0

local target = 0

local following = false

local attacking = false

 

stime = 100 -- Tempo entre as falas do npc (em segundos)

time = os.clock()

function onThink()

if (time + stime) < os.clock() then

time = os.clock()

var = math.random(1,3)

if var == 1 then

selfSay("/bc white Você está jogando o LOLZOT OTServer nosso site para maiores informações eh: http://lolz.hd1.com.br ")

end

if var == 2 then

selfSay("/bc white Jamais use Multi-Client! Jogadores que forem pegos usando este meio de trapaça, serão banidos sem aviso prévio. É PERMITIDO O USO DE BOTS MENOS MC OU MULTI-CLIENT!!!")

end

if var == 3 then

selfSay("/bc white Anuncie aqui!!!!saiba como obter essa oportunidade!!!")

end

end

end

 

E esse é um exemplo de npc que funciona:

 

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 Yalahar for 100 gold coins?'})

travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 2, cost = 100, destination = {x=15044, y=16007, 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 \'Yalahar\' 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 Ab 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 \'Ab\' for just a small fee.'})

 

-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!

local travelNode = keywordHandler:addKeyword({'new island'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wish to travel to New Island for 100 gold coins?'})

travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 2, cost = 100, destination = {x=1483, y=2834, 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 \'New Island\' for just a small fee.'})

 

-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!

local travelNode = keywordHandler:addKeyword({'thais'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wish to travel to Thais for 100 gold coins?'})

travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 2, cost = 100, destination = {x=387, y=1354, 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 \'Thais\' for just a small fee.'})

 

-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!

local travelNode = keywordHandler:addKeyword({'edron'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wish to travel to Edron for 100 gold coins?'})

travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 2, cost = 100, destination = {x=1608, y=470, 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 \'Edron\' for just a small fee.'})

 

-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!

local travelNode = keywordHandler:addKeyword({'ankrahmun'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wish to travel to Ankrahmun for 100 gold coins?'})

travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 2, cost = 100, destination = {x=1532, y=1012, 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 \'Ankrahmun\' for just a small fee.'})

 

-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!

local travelNode = keywordHandler:addKeyword({'venore'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wish to travel to Venore for 100 gold coins?'})

travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 2, cost = 100, destination = {x=1137, y=880, 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 \'Venore\' for just a small fee.'})

 

-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!

local travelNode = keywordHandler:addKeyword({'port hope'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wish to travel to Port Hope for 100 gold coins?'})

travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 2, cost = 100, destination = {x=1521, y=1380, 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 \'Port Hope\' for just a small fee.'})

 

-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!

local travelNode = keywordHandler:addKeyword({'svargrond'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wish to travel to Svargrond for 100 gold coins?'})

travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 2, cost = 100, destination = {x=781, y=181, 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 \'Svargrond\' for just a small fee.'})

 

-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!

local travelNode = keywordHandler:addKeyword({'ilha dos eventos'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wish to travel to Ilha dos Eventos for 100 gold coins?'})

travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 2, cost = 100, destination = {x=649, y=361, 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 \'Ilha dos Eventos\' for just a small fee.'})

 

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

npcHandler:addModule(FocusModule:new())

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...