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

Boat-Npc-Help

Damon

Check my status to contact me :)
Joined
Mar 26, 2011
Messages
6,219
Solutions
1
Reaction score
2,039
Location
Germany
hello, can someone please create a boat npc for me?
this ar ethe locations where to travel:

Pronta= x999 y1000 z7 (0gold)
old pronta=x1116 y1010 z7 (50 gold)
Atron=x1200 y920 z7 (80gold)
Karsmalla= x1148,y634 z7(30 gold)
Mayak= x265 y1865 z7(75gold)
Premia=x1300 y850 z7(120gold)

Kind Regards,
Damon
 
Code:
 <?xml version="1.0" encoding="UTF-8"?>
<npc name="Captain Haba" script="data/npc/scripts/[COLOR="#FF0000"][B][SIZE=5]NAME OF YOUR.lua[/SIZE][/B][/COLOR]" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="98" head="0" body="0" legs="0" feet="0" addons="3"/>
<parameters>
<parameter key="message_farewell" value="Bye." />
<parameter key="message_walkaway" value="Bye." />
 <parameter key="message_greet" value="Harrr, landlubber wha'd ya want?"/>
</parameters>
</npc>


\data\npc\scripts\NAME OF YOUR.lua

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
        function onThink() 						npcHandler:onThink() end
        
        
        local travelNode = keywordHandler:addKeyword({'[COLOR="#FF0000"][SIZE=5][B]YOUR TOWN NAME[/B][/SIZE][/COLOR]'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = '[COLOR="#FF0000"][B][SIZE=5]ANSWER:[/SIZE] Yee, do you want to go to BLASONASPFA[/B][/COLOR]'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, [COLOR="#FF0000"][SIZE=5][B]cost = 0[/B][/SIZE][/COLOR], [SIZE=5][COLOR="#FF0000"][B]destination = {x=31942, y=31043, z=6} })[/B][/COLOR][/SIZE]
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then not!'})
			
[COLOR="#008080"][I]        local travelNode = keywordHandler:addKeyword({'[COLOR="#FF0000"][SIZE=5][B]YOUR TOWN NAME #2[/B][/SIZE][/COLOR]'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = '[COLOR="#FF0000"][B][SIZE=5]ANSWER:[/SIZE]Yee, do you want to go to BLASONASPFA?[/B][/COLOR]'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, [COLOR="#FF0000"][SIZE=5][B]cost = 0[/B][/SIZE][/COLOR], [SIZE=5][COLOR="#FF0000"][B]destination = {x=31942, y=31043, z=6}[/B][/COLOR][/SIZE] })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then not!'})
     
[/I][/COLOR]

[B][SIZE=3]--If you need more destinations only copi and paste the text with [I][COLOR="#008080"]blue color[/COLOR][/I] and change the destinations, the names and the cost here.[/SIZE][/B]

        npcHandler:addModule(FocusModule:new())

Rep + If I Helped you​
 
Last edited:
Go to data/npcs and create a file "Captain Leo.xml" , then paste this in it:
(just change the "name,x,y,z,price;" to your parameters)

Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Captain Leo" script="default.lua" walkinterval="0" floorchange="0">
	<health now="150" max="150"/>
	<look type="129" head="114" body="119" legs="114" feet="114" corpse="2212"/>
    <parameters>
        <parameter key="module_travel" value="1"/>
		<parameter key="message_greet" value="Hello |PLAYERNAME|. I can sail you over the sea. To see all destinations say {travel}."/>
        <parameter key="travel_destinations" value="
name,x,y,z,price;
name,x,y,z,price;
name,x,y,z,price;
name,x,y,z,price;
name,x,y,z,price;
name,x,y,z,price;
"/>
    </parameters>
</npc>
 
Back
Top