44 Hunter
New Member
- Joined
- Dec 14, 2017
- Messages
- 18
- Reaction score
- 4
Full Boat NPC for Old Tibia, TFS 1.5 (Nekiro Downgrade)
Hello, if anyone can help me with this question I would be very grateful. It is worth remembering that all those who have servers in version 7x and 8x will be pleased with this script, because at the time it worked in the way that I will describe in detail.
1- The NPC must teleport the players to the same coordinates defined in the script, however, they must do it automatically when the player says "bring me to [city]", and must charge the same amount they would charge if it were done the traditional way by saying hi > [city] > yes
It must count a variable to define a delay time, so that players are not jumping from city to city so quickly
2- When the player says "kick me out" he should be automatically teleported to a defined position, without charging any cost.
3- Both for the traditional method and for the "bring me to" method, the NPC must apply a 10gps discount (not a percentage, but 10gps), for those who have Storage 30050.
Hello, if anyone can help me with this question I would be very grateful. It is worth remembering that all those who have servers in version 7x and 8x will be pleased with this script, because at the time it worked in the way that I will describe in detail.
1- The NPC must teleport the players to the same coordinates defined in the script, however, they must do it automatically when the player says "bring me to [city]", and must charge the same amount they would charge if it were done the traditional way by saying hi > [city] > yes
It must count a variable to define a delay time, so that players are not jumping from city to city so quickly
2- When the player says "kick me out" he should be automatically teleported to a defined position, without charging any cost.
3- Both for the traditional method and for the "bring me to" method, the NPC must apply a 10gps discount (not a percentage, but 10gps), for those who have Storage 30050.
Lua:
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
keywordHandler:addKeyword({'captain'}, StdModule.say, {npcHandler = npcHandler, text = 'I am the captain of this sailing-ship.'})
keywordHandler:addKeyword({'trip'}, StdModule.say, {npcHandler = npcHandler, text = 'Where do you want to go? To Trekolt, Rhyves, Varak or Saund?'})
keywordHandler:addKeyword({'ice'}, StdModule.say, {npcHandler = npcHandler, text = 'I\'m sorry, but we don\'t serve the routes to the Ice Islands.'})
local node1 = keywordHandler:addKeyword({'trekolt'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a passage to Trekolt for 100 gold?'})
node1:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, cost = 100, destination = math.random(10) == 1 and Position(489, 384, 4) or Position(95 ,117, 7)})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'})
local node2 = keywordHandler:addKeyword({'rhyves'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a passage to Rhyves for 120 gold?'})
node2:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, cost = 120, destination = Position(139, 337, 6)})
node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'})
local node3 = keywordHandler:addKeyword({'varak'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a passage to Varak for 150 gold?'})
node3:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, cost = 160, destination = Position(271, 516, 11)})
node3:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'})
local node4 = keywordHandler:addKeyword({'saund'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a passage to Saund for 150 gold?'})
node4:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, cost = 150, destination = Position(258, 602, 7)})
node4:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'})
npcHandler:addModule(FocusModule:new())