Adding City to boat

Discussion in 'Support' started by Heroman, Jul 10, 2018.

  1. Heroman

    Heroman Member

    Joined:
    Oct 1, 2012
    Messages:
    58
    Likes Received:
    0
    Best Answers:
    0
    Well i want to add a city to npc at the boat to travel to it can any one help with that? ^_^
     
  2. clario

    clario OTS based on Heroes III Might and Magic

    Joined:
    Feb 4, 2018
    Messages:
    98
    Likes Received:
    5
    Best Answers:
    0
    Show scripr that you using
     
  3. Heroman

    Heroman Member

    Joined:
    Oct 1, 2012
    Messages:
    58
    Likes Received:
    0
    Best Answers:
    0
    which one??
     
  4. Heroman

    Heroman Member

    Joined:
    Oct 1, 2012
    Messages:
    58
    Likes Received:
    0
    Best Answers:
    0
    <?xml version="1.0" encoding="UTF-8"?>
    <npc name="Captain Bluebear" script="data/npc/scripts/Captain Bluebear.lua" walkinterval="2000" floorchange="0">
    <health now="100" max="100"/>
    <look type="129" head="19" body="69" legs="107" feet="50" addons="0"/>
    <voices>
    <voice text="Passages to Carlin, Ab'Dendriel, Edron, Venore, Port Hope, Liberty Bay, Yalahar and Svargrond." interval2="100" margin="1" yell="no"/>
    </voices>
    <parameters>
    <parameter key="message_farewell" value="Good bye. Recommend us if you were satisfied with our service." />
    <parameter key="message_walkaway" value="Good bye. Recommend us if you were satisfied with our service." />
    <parameter key="module_keywords" value="1" />
    <parameter key="keywords" value="name;thais;darashia;" />
    <parameter key="keyword_reply1" value="My name is Captain Bluebear from the Royal Tibia Line." />
    <parameter key="keyword_reply2" value="This is Thais. Where do you want to go?" />
    <parameter key="keyword_reply3" value="I'm not sailing there. This route is afflicted by a ghost ship! However, I heard that Captain Fearless sails there from Venore." />
    <parameter key="message_greet" value="Welcome on board, |PLAYERNAME|. Where may I sail you today?"/>
    </parameters>
    </npc>
     
  5. Stigma

    Stigma Support Team Support Team

    Joined:
    Feb 14, 2015
    Messages:
    4,323
    Likes Received:
    2,027
    Best Answers:
    351
    by script he means this
     
    bayview likes this.
  6. Heroman

    Heroman Member

    Joined:
    Oct 1, 2012
    Messages:
    58
    Likes Received:
    0
    Best Answers:
    0
    yea and how to make the player travel to that city??
     
  7. Stigma

    Stigma Support Team Support Team

    Joined:
    Feb 14, 2015
    Messages:
    4,323
    Likes Received:
    2,027
    Best Answers:
    351
    by posting the script
     
    bayview likes this.
  8. Heroman

    Heroman Member

    Joined:
    Oct 1, 2012
    Messages:
    58
    Likes Received:
    0
    Best Answers:
    0
    Yup where should i update the script or where should i post it? excuse me im not that good at scripting ^^
     
  9. Thanatos_

    Thanatos_ Programmer Premium User

    Joined:
    Jul 10, 2018
    Messages:
    39
    Likes Received:
    17
    Best Answers:
    2
    Find your npc related .xml file and post here. If it contains a script .lua attached to it, post it here too.
     
  10. Heroman

    Heroman Member

    Joined:
    Oct 1, 2012
    Messages:
    58
    Likes Received:
    0
    Best Answers:
    0
    this is the XML file

    <?xml version="1.0" encoding="UTF-8"?>
    <npc name="Captain Bluebear" script="data/npc/scripts/Captain Bluebear.lua" walkinterval="2000" floorchange="0">
    <health now="100" max="100"/>
    <look type="129" head="19" body="69" legs="107" feet="50" addons="0"/>
    <voices>
    <voice text="Passages to Carlin, Ab'Dendriel, Edron, Venore, Port Hope, Liberty Bay, Yalahar and Svargrond." interval2="100" margin="1" yell="no"/>
    </voices>
    <parameters>
    <parameter key="message_farewell" value="Good bye. Recommend us if you were satisfied with our service." />
    <parameter key="message_walkaway" value="Good bye. Recommend us if you were satisfied with our service." />
    <parameter key="module_keywords" value="1" />
    <parameter key="keywords" value="name;thais;darashia;" />
    <parameter key="keyword_reply1" value="My name is Captain Bluebear from the Royal Tibia Line." />
    <parameter key="keyword_reply2" value="This is Thais. Where do you want to go?" />
    <parameter key="keyword_reply3" value="I'm not sailing there. This route is afflicted by a ghost ship! However, I heard that Captain Fearless sails there from Venore." />
    <parameter key="message_greet" value="Welcome on board, |PLAYERNAME|. Where may I sail you today?"/>
    </parameters>
    </npc>
     
  11. Heroman

    Heroman Member

    Joined:
    Oct 1, 2012
    Messages:
    58
    Likes Received:
    0
    Best Answers:
    0
    THATS THE Lib


    local keywordHandler = KeywordHandler:new()
    local npcHandler = NpcHandler:new(keywordHandler)
    NpcSystem.parseParameters(npcHandler)



    -- OTServ event handling functions start
    function onCreatureAppear(cid) npcHandler:eek:nCreatureAppear(cid) end
    function onCreatureDisappear(cid) npcHandler:eek:nCreatureDisappear(cid) end
    function onCreatureSay(cid, type, msg) npcHandler:eek:nCreatureSay(cid, type, msg) end
    function onThink() npcHandler:eek:nThink() 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({'carlin'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Carlin for free?'})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32387, y=31820, z=6} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'})

    local travelNode = keywordHandler:addKeyword({'ab\'dendriel'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Ab\'dendriel for free?'})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32734, y=31668, z=6} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'})

    local travelNode = keywordHandler:addKeyword({'edron'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Edron for free?'})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=33173, y=31764, z=6} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'})

    local travelNode = keywordHandler:addKeyword({'venore'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Venore for free?'})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32954, y=32022, z=6} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'})

    local travelNode = keywordHandler:addKeyword({'port hope'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Port Hope for free?'})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32527, y=32784, z=6} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'})

    local travelNode = keywordHandler:addKeyword({'svargrond'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Svargrond for free?'})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32341, y=31108, z=6} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'})

    local travelNode = keywordHandler:addKeyword({'liberty bay'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Liberty Bay for free?'})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32285, y=32892, z=6} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'})

    local travelNode = keywordHandler:addKeyword({'yalahar'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Yalahar for free?'})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32816, y=31272, z=6} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'})

    local travelNode = keywordHandler:addKeyword({'darashia'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Darashia for free?'})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=33289, y=32480, z=6} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'})

    local travelNode = keywordHandler:addKeyword({'ankrahmun'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a passage to Ankrahmun free?'})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=33092, y=32883, z=6} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'})

    keywordHandler:addKeyword({'sail'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Where do you want to go? To Carlin, Ab\'Dendriel, Edron, Venore, Port Hope, Liberty Bay, Yalahar and Svargrond.'})
    keywordHandler:addKeyword({'job'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I am the captain of this ship.'})
    keywordHandler:addKeyword({'captain'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I am the captain of this ship.'})


    npcHandler:addModule(FocusModule:new())
     
  12. Thanatos_

    Thanatos_ Programmer Premium User

    Joined:
    Jul 10, 2018
    Messages:
    39
    Likes Received:
    17
    Best Answers:
    2
    You can just copy like
    Code (Lua):
    1.  
    2.  
    3. local travelNode = keywordHandler:addKeyword({'ankrahmun'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a passage to Ankrahmun free?'})
    4. travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=33092, y=32883, z=6} })
    5. travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'})
    6.  
    And paste under it, changing the name ankrahmun and the destination = {x=33092, y=32883, z=6} for the position that you want.
     
  13. Heroman

    Heroman Member

    Joined:
    Oct 1, 2012
    Messages:
    58
    Likes Received:
    0
    Best Answers:
    0

    did that still not working
     
  14. Thanatos_

    Thanatos_ Programmer Premium User

    Joined:
    Jul 10, 2018
    Messages:
    39
    Likes Received:
    17
    Best Answers:
    2
    Show me the code after your edit
     
  15. Heroman

    Heroman Member

    Joined:
    Oct 1, 2012
    Messages:
    58
    Likes Received:
    0
    Best Answers:
    0


    local travelNode = keywordHandler:addKeyword({'Gengia'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Gengia for free?'})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=31777, y=31917, z=6} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'})
     
  16. Thanatos_

    Thanatos_ Programmer Premium User

    Joined:
    Jul 10, 2018
    Messages:
    39
    Likes Received:
    17
    Best Answers:
    2
    Thats just one part of the Captain Bluebear.lua, right? The other citys are working? When you say Gengia he doesnt respond?
     
  17. Heroman

    Heroman Member

    Joined:
    Oct 1, 2012
    Messages:
    58
    Likes Received:
    0
    Best Answers:
    0
    Yeaa thats Truuee mate
     
  18. Thanatos_

    Thanatos_ Programmer Premium User

    Joined:
    Jul 10, 2018
    Messages:
    39
    Likes Received:
    17
    Best Answers:
    2
    Show me the full Captain Bluebear.lua with "Gengia", let me see if you missed something
     
  19. Heroman

    Heroman Member

    Joined:
    Oct 1, 2012
    Messages:
    58
    Likes Received:
    0
    Best Answers:
    0



    local keywordHandler = KeywordHandler:new()
    local npcHandler = NpcHandler:new(keywordHandler)
    NpcSystem.parseParameters(npcHandler)



    -- OTServ event handling functions start
    function onCreatureAppear(cid) npcHandler:eek:nCreatureAppear(cid) end
    function onCreatureDisappear(cid) npcHandler:eek:nCreatureDisappear(cid) end
    function onCreatureSay(cid, type, msg) npcHandler:eek:nCreatureSay(cid, type, msg) end
    function onThink() npcHandler:eek:nThink() 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({'carlin'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Carlin for free?'})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32387, y=31820, z=6} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'})

    local travelNode = keywordHandler:addKeyword({'ab\'dendriel'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Ab\'dendriel for free?'})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32734, y=31668, z=6} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'})

    local travelNode = keywordHandler:addKeyword({'edron'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Edron for free?'})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=33173, y=31764, z=6} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'})

    local travelNode = keywordHandler:addKeyword({'venore'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Venore for free?'})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32954, y=32022, z=6} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'})

    local travelNode = keywordHandler:addKeyword({'port hope'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Port Hope for free?'})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32527, y=32784, z=6} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'})

    local travelNode = keywordHandler:addKeyword({'svargrond'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Svargrond for free?'})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32341, y=31108, z=6} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'})

    local travelNode = keywordHandler:addKeyword({'liberty bay'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Liberty Bay for free?'})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32285, y=32892, z=6} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'})

    local travelNode = keywordHandler:addKeyword({'yalahar'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Yalahar for free?'})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32816, y=31272, z=6} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'})

    local travelNode = keywordHandler:addKeyword({'darashia'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Darashia for free?'})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=33289, y=32480, z=6} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'})

    local travelNode = keywordHandler:addKeyword({'Gengia'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Gengia for free?'})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=31777, y=31917, z=6} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'})

    local travelNode = keywordHandler:addKeyword({'ankrahmun'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a passage to Ankrahmun free?'})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=33092, y=32883, z=6} })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'})

    keywordHandler:addKeyword({'sail'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Where do you want to go? To Carlin, Ab\'Dendriel, Edron, Venore, Gengia, Port Hope, Liberty Bay, Yalahar and Svargrond.'})
    keywordHandler:addKeyword({'job'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I am the captain of this ship.'})
    keywordHandler:addKeyword({'captain'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I am the captain of this ship.'})


    npcHandler:addModule(FocusModule:new())
     
  20. Thanatos_

    Thanatos_ Programmer Premium User

    Joined:
    Jul 10, 2018
    Messages:
    39
    Likes Received:
    17
    Best Answers:
    2
    All the citys are in lower-case except Gengia, have you tried saying "Gengia" instead of "gengia" to the NPC? If it works, change "Gengia" to "gengia"
     

Share This Page

Loading...