• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[TFS 1.2][NPC] Ship Captain

Kuzyn

Excellent OT User
Joined
Dec 19, 2009
Messages
1,732
Solutions
3
Reaction score
884
Location
pl?
Hey. I tried to use default TFS 1.2 travel system but it is ugly (not working darkblue colour for destinations) and I have tried ship captains from ORTS but NPCs says:
00:55 Ailein: Do you seek a ride to Lero for |TRAVELCOST|?
instead of e.g.: 50 gold.

So, I'm looking for Ship Captain that:
  • says hello and asks if player want to travel
  • on 'travel' he says all destinations (dark blue)
  • he says price in gold coins
  • he has some keywords (like 'name', 'job' etc.)

Cheers.
 
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Ailein" script="default.lua" walkinterval="2000" floorchange="0" walkradius="0" speechbubble="1">
    <health now="100" max="100" />
    <look type="160" head="19" body="113" legs="95" feet="115" addons="0" />
    <parameters>
    <parameter key="module_travel" value="1"/>
    <parameter key="message_greet" value="Hello |PLAYERNAME|. Do you want to {travel}?"/>
    <parameter key="travel_destinations" value="lero,4530,1530,7,500;ghost island,3266,2151,7,150;"/>
    </parameters>
</npc>
With this configuration it is normal blue text. When I put {lero} and {ghost island} it is in dark blue, but there is no reaction from NPC.
 
instead of using xml use .lua example :

PHP:
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

-- Travel
local function addTravelKeyword(keyword, cost, destination, action)
    local travelKeyword = keywordHandler:addKeyword({keyword}, StdModule.say, {npcHandler = npcHandler, text = 'Do you seek a seek a passage to ' .. keyword:titleCase() .. ' for |TRAVELCOST|?', cost = cost, discount = 'postman'})
        travelKeyword:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, cost = cost, discount = 'postman', destination = destination}, nil, action)
        travelKeyword:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, text = 'We would like to serve you some time.', reset = true})
end

addTravelKeyword('venore', 40, Position(32954, 32022, 6), function(player) if player:getStorageValue(Storage.postman.Mission01) == 3 then player:setStorageValue(Storage.postman.Mission01, 4) end end)
addTravelKeyword('thais', 160, Position(32310, 32210, 6))
addTravelKeyword('carlin', 110, Position(32387, 31820, 6))
addTravelKeyword('ab\'dendriel', 70, Position(32734, 31668, 6))
addTravelKeyword('gray island', 150, Position(33196, 31984, 7))
addTravelKeyword('port hope', 150, Position(32527, 32784, 6))
addTravelKeyword('liberty bay', 170, Position(32285, 32892, 6))
addTravelKeyword('ankrahmun', 160, Position(33092, 32883, 6))
addTravelKeyword('cormaya', 20, Position(33288, 31956, 6))

-- Kick
keywordHandler:addKeyword({'kick'}, StdModule.kick, {npcHandler = npcHandler, destination = {Position(33174, 31773, 6), Position(33175, 31771, 6), Position(33177, 31772, 6)}})

-- Basic
keywordHandler:addKeyword({'sail'}, StdModule.say, {npcHandler = npcHandler, text = 'Where do you want to go? To {Thais}, {Carlin}, {Ab\'Dendriel}, {Venore}, {Port Hope}, {Ankrahmun}, {Liberty Bay}, {Gray Island} or the isle {Cormaya}?'})
keywordHandler:addKeyword({'passage'}, StdModule.say, {npcHandler = npcHandler, text = 'Where do you want to go? To {Thais}, {Carlin}, {Ab\'Dendriel}, {Venore}, {Port Hope}, {Ankrahmun}, {Liberty Bay}, {Gray Island} or the isle {Cormaya}?'})
keywordHandler:addKeyword({'name'}, StdModule.say, {npcHandler = npcHandler, text = 'My name is Captain Seahorse from the Royal Tibia Line.'})
keywordHandler:addKeyword({'edron'}, StdModule.say, {npcHandler = npcHandler, text = 'This is Edron. Where do you want to go?'})
keywordHandler:addKeyword({'yalahar'}, StdModule.say, {npcHandler = npcHandler, text = 'I\'m sorry, but we don\'t serve this route. However, I heard that Wyrdin here in Edron is looking for adventurers to go on a trip to Yalahar for him.'})

npcHandler:setMessage(MESSAGE_GREET, 'Welcome on board, |PLAYERNAME|. Where may I {sail} you today?')
npcHandler:setMessage(MESSAGE_FAREWELL, 'Good bye. Recommend us if you were satisfied with our service.')
npcHandler:setMessage(MESSAGE_WALKAWAY, 'Good bye then.')

npcHandler:addModule(FocusModule:new())

Use :
PHP:
keywordHandler:addKeyword
for the Npc's to respond and describe the message u 're askin about
 
@Fencore Team
Do you read what I'm writing? :( I tried both, xml and lua. And still problem.
aq0zQd8.png
 
Add whole lib folder in npc folder
Replacing everything will not work, because more and more things are missing. This stupid thing still dont work, do you know how I can change that |TRAVELCOST| to another thing that works?
 
Back
Top