• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Boat-Npc

bomba

Member
Joined
Feb 26, 2008
Messages
635
Reaction score
7
Location
Brazil
I'm pk and I can use the boat:
Code:
 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 
---
npcHandler:setMessage(MESSAGE_GREET, 'Hello |PLAYERNAME|. Welcome to my Boat!') 
function onThink()                         npcHandler:onThink() end 
---
enable = TRUE
---
	if enable == TRUE then
 local eremborPos = {x=1682, y=1688, z=7}
 local travelNode = keywordHandler:addKeyword({'erembor'},  
	   StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to Travel to Erembor for 70 gold coins?' }) 
	   travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = FALSE, level = 1, cost = 110, destination = eremborPos }) 
	   travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Ok, come back when you want then!' }) 
    else 
 local travelNode = keywordHandler:addKeyword({'vengor'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Sorry, I do not travel to this city..' }) 
end
---
keywordHandler:addKeyword({'destination'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to {Erembor}.' }) 
keywordHandler:addKeyword({'job'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Im an Captain, and this is my Boat.' }) 
keywordHandler:addKeyword({'citys'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to {Erembor}.' }) 
keywordHandler:addKeyword({'help'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you need help? I can tell you some {destination}.' }) 
---
npcHandler:addModule(FocusModule:new())

Please help-me...
 
data/npc/lib/npcsystem/modules.lua;

find:
Code:
		if(isPlayerPremiumCallback(cid) or not(parameters.premium)) then
			if(parameters.level ~= nil and getPlayerLevel(cid) < parameters.level) then
				npcHandler:say('You must reach level ' .. parameters.level .. ' before I can let you go there.', cid)
			elseif(doPlayerRemoveMoney(cid, parameters.cost) ~= TRUE) then
				npcHandler:say('You do not have enough money!', cid)
			else
				doTeleportThing(cid, parameters.destination, 0)
				doSendMagicEffect(parameters.destination, 10)
			end
		else
			npcHandler:say('I can only allow premium players to travel with me.', cid)
		end

Replace with:

Code:
		if(isPlayerPremiumCallback(cid) or not(parameters.premium)) then
			if(parameters.level ~= nil and getPlayerLevel(cid) < parameters.level) then
				npcHandler:say('You must reach level ' .. parameters.level .. ' before I can let you go there.', cid)
			elseif(doPlayerRemoveMoney(cid, parameters.cost) ~= TRUE) then
				npcHandler:say('You do not have enough money!', cid)
			elseif(isPlayerPzLocked(cid) ~= FALSE then
				npcHandler:say('No blood on my ship!', cid)
			else
				doTeleportThing(cid, parameters.destination, 0)
				doSendMagicEffect(parameters.destination, 10)
			end
		else
			npcHandler:say('I can only allow premium players to travel with me.', cid)
		end
 
I have edited to:
Code:
 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 
---
npcHandler:setMessage(MESSAGE_GREET, 'Hello |PLAYERNAME|. Welcome to my Boat!') 
function onThink()                         npcHandler:onThink() end 
---
	if isPlayerPzLocked(cid) == FALSE then
 local eremborPos = {x=1682, y=1688, z=7}
 local travelNode = keywordHandler:addKeyword({'erembor'},  
	   StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to Travel to Erembor for 70 gold coins?' }) 
	   travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = FALSE, level = 1, cost = 110, destination = eremborPos }) 
	   travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Ok, come back when you want then!' }) 
    else 
 local travelNode = keywordHandler:addKeyword({'vengor'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Sorry, I do not travel to this city..' }) 
end
---
keywordHandler:addKeyword({'destination'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to {Erembor}.' }) 
keywordHandler:addKeyword({'job'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Im an Captain, and this is my Boat.' }) 
keywordHandler:addKeyword({'citys'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to {Erembor}.' }) 
keywordHandler:addKeyword({'help'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you need help? I can tell you some {destination}.' }) 
---
npcHandler:addModule(FocusModule:new())
Can work(?):
if isPlayerPzLocked(cid) == FALSE then
 
In my new script have an error: player not found()
Code:
 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 

npcHandler:setMessage(MESSAGE_GREET, 'Hello |PLAYERNAME|. Welcome to my Boat!') 
function onThink()                         npcHandler:onThink() end 

	if getCreatureCondition(cid, CONDITION_INFIGHT) == FALSE then
 local vengorPos = {x=1880, y=2155, z=7}
 local travelNode = keywordHandler:addKeyword({'vengor'},  
	   StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to Travel to Vengor for 110 gold coins?' }) 
	   travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = FALSE, level = 1, cost = 110, destination = vengorPos }) 
	   travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Ok, come back when you want then!' })
    else
	   selfSay('Sorry you are in battle.', cid)
end

keywordHandler:addKeyword({'destination'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to {Vengor}.' }) 
keywordHandler:addKeyword({'job'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Im an Captain, and this is my Boat.' }) 
keywordHandler:addKeyword({'citys'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to {Vengor}.' }) 
keywordHandler:addKeyword({'help'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you need help? I can tell you some {destination}.' }) 

npcHandler:addModule(FocusModule:new())
 
Back
Top