• 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!

[NPC Script] Ship Captain or Carpetman (TFS 0.3.1 CryingDamson)

Pentagratta

ancientwars.servegame.com
Joined
Mar 15, 2009
Messages
76
Reaction score
0
Location
São Paulo - Brazil
HAS BEEN RESOLVED!!!


Greetings,

Im here to ask if someone have a script of a NPC Ship Captain (or Carpetman) which works in The Forgotten Server - Version 0.3.1 (Crying Damson) ...
Ill be glad if you can share it with me, i really need it! :)

Of course ill rep+! :wub:
- srry for bad english -



Regards,
Pentagratta.
 
Last edited:
PHP:
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


-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
local travelNode = keywordHandler:addKeyword({'example'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wish to travel to example?'})
	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 0, destination = {x=1, y=1, z=7} })
	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'You should visit it some time.'})

keywordHandler:addKeyword({'trips'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you example.'})

keywordHandler:addKeyword({'cities'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to example'})

-- Makes sure the npc reacts when you say hi, bye etc.
npcHandler:addModule(FocusModule:new())
 
@justin234
Well dude i only ask what I REALLY dont know how to do, example..
Always be4 to post i try find out looking in others sections (of course) and downloading others servers edited to find what im wanting, but i know only edit scripts i dont know how make/create one :|...
And i post only if i dont find them know?
- srry for bad english i hope you understand what i mean -

@GBR Jessica
An error happend :|
I dont know if i did it right, take a look HERE please!
Thank you.
 
PHP:
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


-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
local travelNode = keywordHandler:addKeyword({'depot'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wish to travel to Iteos depot?'})
	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 0, destination = {x=1799, y=2039, z=7} })
	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'You should visit it some time.'})

local travelNode = keywordHandler:addKeyword({'toren'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wish to travel to Toren?'})
	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 0, destination = {x=780, y=678, z=8} })
	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'You should visit it some time.'})

local travelNode = keywordHandler:addKeyword({'temple'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wish to travel to Iteos Temple?'})
	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 0, destination = {x=1738, y=2070, z=8} })
	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'You should visit it some time.'})

local travelNode = keywordHandler:addKeyword({'iteos depot'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wish to travel to Iteos Depot?'})
	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 0, destination = {x=1763, y=2035, z=8} })
	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'You should visit it some time.'})

local travelNode = keywordHandler:addKeyword({'depot'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wish to travel to Iteos Depot?'})
	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 0, destination = {x=1763, y=2035, z=8} })
	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'You should visit it some time.'})

local travelNode = keywordHandler:addKeyword({'iteos temple'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wish to travel to Iteos Temple?'})
	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 0, destination = {x=1738, y=2070, z=8} })
	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'You should visit it some time.'})

local travelNode = keywordHandler:addKeyword({'monster tele'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wish to travel to the monster teleportals?'})
	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 0, destination = {x=403, y=599, z=7} })
	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'You should visit it some time.'})

keywordHandler:addKeyword({'trips'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to Cities, Premium Places, The Monster Teleportals.'})

keywordHandler:addKeyword({'cities'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to Iteos'})

-- Makes sure the npc reacts when you say hi, bye etc.
npcHandler:addModule(FocusModule:new())
This is the script i use change it to fit your thing
 
PHP:
<npc name="Merlin" script="data/npc/scripts/travel.lua" walkinterval="0" floorchange="0" access="5" level="1" maglevel="1">
	<health now="150" max="150"/>
	<look type="130" head="0" body="88" legs="114" feet="57" addons="1"/>
	<parameters>
	<parameter key="message_greet" value="Welcome |PLAYERNAME| I can take you to many places. Say 'trips' to find out where." />
	</parameters>
</npc>
the npc i use
 
Back
Top