Ir para conteúdo

Posts Recomendados

Olha so isso:

14:05 Capitao Mathemas: Hello GOD Skapul, sou Capitao Mathemas, posso leva-lo ate as cidades comuns Fire Fortress, Ice City, Jungle City e Slayer City.

14:05 GOD Skapul [20]: jungle city

14:06 GOD Skapul [20]: Jungle Cit

14:06 GOD Skapul [20]: Jungle City

14:06 GOD Skapul [20]: Jungle City

14:06 GOD Skapul [20]: Jungle City

14:07 Capitao Mathemas: Good bye, GOD Skapul!

 

Por que esta acontecendo isso,todas as cidades assim?

 

Olha o Script ae:

Esse é o Xml

 

<npc name="Capitao Mathemas" script="data/npc/scripts/barco.lua" walkinterval="450" 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="Hello |PLAYERNAME|, sou Capitao Mathemas, posso leva-lo ate as cidades comuns {Fire Fortress}, {Ice City}, {Jungle City} e {Slayer City}." />

<parameter key="message_decline" value="Posso te levar por |TOTALCOST| gold coins."/>

</parameters>

</npc>

 

Agora o Lua

 

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

 

 

 

-- 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({'Slayer City'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer viajar para Slayer city por 100 gold coins?'})

travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 2, cost = 100, destination = {x=128, y=38, 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 = 'posso leva-lo até {Slayer} city, {Jungle} city, {Fire Fortress} city e {Ice} city.'})

 

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

local travelNode = keywordHandler:addKeyword({'flower'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer viajar para Ice por 200 gold coins?'})

travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 2, cost = 200, destination = {x=435, y=204, 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 = 'posso leva-lo até {Slayer} city, {Jungle} city, {Fire Fortress} city e {Ice} city.'})

 

 

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

local travelNode = keywordHandler:addKeyword({'thist'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer viajar para Jungle por 150 gold coins?'})

travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 2, cost = 150, destination = {x=132, y=174, 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 = 'posso leva-lo até {Slayer} city, {Jungle} city, {Fire Fortress} city e {Ice} city.'})

 

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

local travelNode = keywordHandler:addKeyword({'skoegul'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer viajar para Fire Fortress por 170 gold coins?'})

travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 2, cost = 170, destination = {x=52, y=376, 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 = 'posso leva-lo até {Slayer} city, {Jungle} city, {Fire Fortress} city e {Ice} city.'})

 

 

 

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

npcHandler:addModule(FocusModule:new())

 

 

 

Valeu :positive:

Editado por mathemas
Link para o comentário
https://xtibia.com/forum/topic/123255-ajuda-aki-rapidinho/
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...