jpkulik
New Member
- Joined
- Mar 15, 2008
- Messages
- 208
- Reaction score
- 2
Hello!
This is my contribution for the OTland Community..I Hope everbody like it, and if you wanna Post this scripts ElseWhere, please, put my Credits on it!
This post contain The NPCs.xml, Boat.lua and a Tutorial.
Captain Bluebear - Thais
NPC.xml
PHP:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Captain Bluebear" script="data\npc\scripts\Boat.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="129" head="19" body="69" legs="107" feet="50" addons="0"/>
</npc>
Captain Breezelda - Svargrond
NPC.xml
PHP:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Captain Breezelda" script="data\npc\scripts\Boat.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="142" head="97" body="23" legs="28" feet="76" addons="2"/>
</npc>
-----------------------------------------------------
Captain Fearless - Venore
NPC.xml
PHP:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Captain Fearless" script="data\npc\scripts\Boat.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="129" head="19" body="113" legs="95" feet="115" addons="0"/>
</npc>
Captain Greyhound - Carlin
NPC.xml
PHP:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Captain Greyhound" script="data\npc\scripts\Boat.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="129" head="96" body="113" legs="95" feet="115" addons="0"/>
</npc>
-----------------------------------------------------
Captain Max - Liberty Bay
NPC.xml
PHP:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Captain Max" script="data\npc\scripts\Boat.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="134" head="95" body="10" legs="56" feet="77" addons="0"/>
</npc>
-----------------------------------------------------
Captain Seagull - Ab'Dendriel
NPC.xml
PHP:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Captain Seagull" script="data\npc\scripts\Boat.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="129" head="60" body="113" legs="95" feet="115" addons="0"/>
</npc>
-----------------------------------------------------
Captain Seahorse - Edron
NPC.xml
PHP:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Captain Seahorse" script="data\npc\scripts\Boat.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="129" head="19" body="113" legs="95" feet="115" addons="0"/>
</npc>
-----------------------------------------------------
Captain Sinbeard - Ankrahmun
NPC.xml
PHP:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Captain Sinbeard" script="data\npc\scripts\Boat.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="134" head="95" body="10" legs="56" feet="77" addons="0"/>
</npc>
-----------------------------------------------------
Petros - Darashia
NPC.xml
PHP:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Petros" script="data\npc\scripts\Boat.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="128" head="79" body="10" legs="127" feet="127" addons="0"/>
</npc>
-----------------------------------------------------
Gurbasch - Kazordoon
NPC.xml
PHP:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Gurbasch" script="data\npc\scripts\Boat.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="66" head="0" body="0" legs="0" feet="0" addons="0"/>
</npc>
Now the Boat.LUA
PHP:
--------------------By Jpkulik!----------------------------
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
-- Set the greeting message.
npcHandler:setMessage(MESSAGE_GREET, HelloText)
function onThink() npcHandler:onThink() end
-- OTServ event handling functions end
---------------------------------------MENSAGES CONFIG--------------------------------------------
local HelloText = 'Hello |PLAYERNAME|. Welcome to my Boat!'
local HelpText = 'Do you need help?I can tell you some {destinations}.'
local DestinationText = 'I can take you to {Carlin}, {Ab Dendriel}, {Kazordoon}, {Thais}, {Venore}, {Edron}, {Darashia}, {Ankrahmun}, {Libery Bay}, {Port Hope} and {Svargrond}.'
local CitysText = 'I can take you to {Carlin}, {Ab Dendriel}, {Kazordoon}, {Thais}, {Venore}, {Edron}, {Darashia}, {Ankrahmun}, {Libery Bay}, {Port Hope} and {Svargrond}.'
local JobText = 'Im an Captain, and this is my Boat.'
---------------------------------------END MENSAGES CONFIG----------------------------------------
---------------------------------------CARLIN CONFIG----------------------------------------------
local CarlinPosition = {x=32388, y=31821, z=6} ----> Destination from Carlin Boat <----
local CarlinCost = 10 ----> Cost to Travel for Carlin <----
carlin = true ---->TRUE:Working/FALSE:Not Working<----
---------------------------------------END CARLIN CONFIG------------------------------------------
---------------------------------------AB'DENDRIEL CONFIG-----------------------------------------
local AbDendrielPosition = {x=32734, y=31669, z=6} ----> Destination from Ab'Dendriel Boat <----
local AbDendrielCost = 10 ----> Cost to Travel for Ab'Dendriel <----
AbDendriel = true ----> TRUE:Working/FALSE:Not Working <----
---------------------------------------END AB'DENDRIEL CONFIG-------------------------------------
---------------------------------------VENORE CONFIG----------------------------------------------
local VenorePosition = {x=32954, y=32022, z=6} ----> Destination from Venore Boat <----
local VenoreCost = 10 ----> Cost to Travel for Venore <----
Venore = true ----> TRUE:Working/FALSE:Not Working<---
---------------------------------------END VENORE CONFIG------------------------------------------
---------------------------------------THAIS CONFIG-----------------------------------------------
local ThaisPosition = {x=32310, y=32210, z=6} ----> Destination from Thais Boat <----
local ThaisCost = 10 ----> Cost to Travel for Thais <----
Thais = true ---->TRUE:Working/FALSE:Not Working<---
---------------------------------------END THAIS CONFIG-------------------------------------------
---------------------------------------KAZORDOON CONFIG-------------------------------------------
local KazordoonPosition = {x=32660, y=31957, z=15} ----> Destination from Kazordoon Boat <----
local KazordoonCost = 10 ----> Cost to Travel for Kazordoon <----
Kazordoon = true ----> TRUE:Working/FALSE:Not Working <----
---------------------------------------END KAZORDOON CONFIG---------------------------------------
---------------------------------------EDRON CONFIG-----------------------------------------------
local EdronPosition = {x=33176, y=31764, z=6} ----> Destination from Edron Boat <----
local EdronCost = 10 ----> Cost to Travel for Edron <----
Edron = true ----> TRUE:Working/FALSE:Not Working<--
---------------------------------------END EDRON CONFIG-------------------------------------------
---------------------------------------DARASHIA CONFIG--------------------------------------------
local DarashiaPosition = {x=33290, y=32481, z=6} ----> Destination from Darashia Boat <----
local DarashiaKazordoonCost = 10 ----> Cost to Travel for Darashia <----
Darashia = true ----> TRUE:Working/FALSE:Not Working <----
---------------------------------------END DARASHIA CONFIG----------------------------------------
---------------------------------------LIBERTY BAY CONFIG-----------------------------------------
local LibertyBayPosition = {x=32285, y=32892, z=6} ----> Destination from Liberty Bay Boat <----
local LibertyBayCost = 10 ----> Cost to Travel for Liberty Bay <----
LibertyBay = true ----> TRUE:Working/FALSE:Not Working <----
---------------------------------------END LIBERTY BAY CONFIG-------------------------------------
---------------------------------------PORT HOPE CONFIG-------------------------------------------
local PortHopePosition = {x=32530, y=32784, z=6} ----> Destination from Port Hope Boat <----
local PortHopeCost = 10 ----> Cost to Travel for Port Hope <----
PortHope = true ----> TRUE:Working/FALSE:Not Working <----
---------------------------------------END PORT HOPE CONFIG---------------------------------------
---------------------------------------SVARGROND CONFIG-------------------------------------------
local SvargrondPosition = {x=32341, y=31108, z=6} ----> Destination from Svargrond Boat <----
local SvargrondCost = 10 ----> Cost to Travel for Svargrond <----
Svargrond = true ----> TRUE:Working/FALSE:Not Working <----
---------------------------------------END SVARGROND CONFIG---------------------------------------
---------------------------------------ANKRAHMUN CONFIG-------------------------------------------
local AnkPosition = {x=33092, y=32884, z=6} ----> Destination from Ankrahmun Boat <----
local AnkCost = 10 ----> Cost to Travel for Ankrahmun <----
Ank = true ----> TRUE:Working/FALSE:Not Working <----
---------------------------------------END ANKRAHMUN CONFIG---------------------------------------
---CARLIN-----------------------------------------------------------------------------------------------------------------------------------------
local CarlinText = 'Do you want to Travel to Carlin for 10 gold coins?'
local CarlinTextNo = 'Ok, come back when you want then!'
local NoTravel = 'Sorry, i do not travel to this city..'
local CarlinLvl = 8
local CarlinPremium = false --True/false
--Carlin--
if carlin == true then
local travelNode = keywordHandler:addKeyword({'carlin'},
StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = CarlinText })
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = CarlinPremium, level = CarlinLvl, cost = CarlinCost, destination = CarlinPosition })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = CarlinTextNo })
else
local travelNode = keywordHandler:addKeyword({'carlin'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = NoTravel })
end
--End Carlin--
---------------------------------------------------------------------------------------------------------------------------------------------------
---Venore-----------------------------------------------------------------------------------------------------------------------------------------
local VenoreText = 'Do you want to Travel to Venore for 10 gold coins?'
local VenoreTextNo = 'Ok, come back when you want then!'
local NoTravel = 'Sorry, i do not travel to this city..'
local VenoreLvl = 8
local VenorePremium = false --True/false
--Venore--
if Venore == true then
local travelNode = keywordHandler:addKeyword({'venore'},
StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = VenoreText })
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = VenorePremium, level = VenoreLvl, cost = VenoreCost, destination = VenorePosition })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = VenoreTextNo })
else
local travelNode = keywordHandler:addKeyword({'venore'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = NoTravel })
end
--End Venore--
---------------------------------------------------------------------------------------------------------------------------------------------------
---Kazordoon-----------------------------------------------------------------------------------------------------------------------------------------
local KazordoonText = 'Do you want to Travel to Kazordoon for 10 gold coins?'
local KazordoonTextNo = 'Ok, come back when you want then!'
local NoTravel = 'Sorry, i do not travel to this city..'
local KazordoonLvl = 8
local KazordoonPremium = false --True/false
--Kazordoon--
if Kazordoon == true then
local travelNode = keywordHandler:addKeyword({'kazordoon'},
StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = KazordoonText })
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = KazordoonPremium, level = KazordoonLvl, cost = KazordoonCost, destination = KazordoonPosition })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = KazordoonTextNo })
else
local travelNode = keywordHandler:addKeyword({'venore'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = NoTravel })
end
--End Venore--
---------------------------------------------------------------------------------------------------------------------------------------------------
---Thais-----------------------------------------------------------------------------------------------------------------------------------------
local ThaisText = 'Do you want to Travel to Kazordoon for 10 gold coins?'
local ThaisTextNo = 'Ok, come back when you want then!'
local NoTravel = 'Sorry, i do not travel to this city..'
local ThaisLvl = 8
local ThaisPremium = false --True/false
--Thais--
if Thais == true then
local travelNode = keywordHandler:addKeyword({'thais'},
StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = ThaisText })
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = ThaisPremium, level = ThaisLvl, cost = ThaisCost, destination = ThaisPosition })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = ThaisTextNo })
else
local travelNode = keywordHandler:addKeyword({'thais'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = NoTravel })
end
--End Thais--
---------------------------------------------------------------------------------------------------------------------------------------------------
---AbDendriel-----------------------------------------------------------------------------------------------------------------------------------------
local AbDendrielText = 'Do you want to Travel to AbDendriel for 10 gold coins?'
local AbDendrielTextNo = 'Ok, come back when you want then!'
local NoTravel = 'Sorry, i do not travel to this city..'
local AbDendrielLvl = 8
local AbDendrielPremium = false --True/false
--AbDendriel--
if AbDendriel == true then
local travelNode = keywordHandler:addKeyword({'ab dendriel'},
StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = AbDendrielText })
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = AbDendrielPremium, level = AbDendrielLvl, cost = AbDendrielCost, destination = AbDendrielPosition })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = AbDendrielTextNo })
else
local travelNode = keywordHandler:addKeyword({'ab dendriel'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = NoTravel })
end
--End AbDendriel--
---------------------------------------------------------------------------------------------------------------------------------------------------
---Edron-----------------------------------------------------------------------------------------------------------------------------------------
local EdronText = 'Do you want to Travel to Edron for 10 gold coins?'
local EdronTextNo = 'Ok, come back when you want then!'
local NoTravel = 'Sorry, i do not travel to this city..'
local EdronLvl = 8
local EdronPremium = true --True/false
--Edron--
if Edron == true then
local travelNode = keywordHandler:addKeyword({'edron'},
StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = EdronText })
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = EdronPremium, level = EdronLvl, cost = EdronCost, destination = EdronPosition })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = EdronTextNo })
else
local travelNode = keywordHandler:addKeyword({'edron'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = NoTravel })
end
--End AbDendriel--
---------------------------------------------------------------------------------------------------------------------------------------------------
---Darashia-----------------------------------------------------------------------------------------------------------------------------------------
local DarashiaText = 'Do you want to Travel to Darashia for 10 gold coins?'
local DarashiaTextNo = 'Ok, come back when you want then!'
local NoTravel = 'Sorry, i do not travel to this city..'
local DarashiaLvl = 8
local DarashiaPremium = true --True/false
--Darashia--
if Darashia == true then
local travelNode = keywordHandler:addKeyword({'darashia'},
StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = DarashiaText })
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = DarashiaPremium, level = DarashiaLvl, cost = DarashiaCost, destination = DarashiaPosition })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = DarashiaTextNo })
else
local travelNode = keywordHandler:addKeyword({'darashia'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = NoTravel })
end
--End Darashia--
---------------------------------------------------------------------------------------------------------------------------------------------------
---Port Hope-----------------------------------------------------------------------------------------------------------------------------------------
local PortHopeText = 'Do you want to Travel to Port Hope for 10 gold coins?'
local PortHopeTextNo = 'Ok, come back when you want then!'
local NoTravel = 'Sorry, i do not travel to this city..'
local PortHopeLvl = 8
local PortHopePremium = true --True/false
--Port Hope--
if PortHope == true then
local travelNode = keywordHandler:addKeyword({'port hope'},
StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = PortHopeText })
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = PortHopePremium, level = PortHopeLvl, cost = PortHopeCost, destination = PortHopePosition })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = PortHopeTextNo })
else
local travelNode = keywordHandler:addKeyword({'port hope'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = NoTravel })
end
--End Port Hope--
---------------------------------------------------------------------------------------------------------------------------------------------------
---Liberty Bay-----------------------------------------------------------------------------------------------------------------------------------------
local LibertyBayText = 'Do you want to Travel to Liberty Bay for 10 gold coins?'
local LibertyBayTextNo = 'Ok, come back when you want then!'
local NoTravel = 'Sorry, i do not travel to this city..'
local LibertyBayLvl = 8
local LibertyBayPremium = true --True/false
--Liberty Bay--
if LibertyBay == true then
local travelNode = keywordHandler:addKeyword({'liberty bay'},
StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = LibertyBayText })
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = LibertyBayPremium, level = LibertyBayLvl, cost = LibertyBayCost, destination = LibertyBayPosition })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = LibertyBayTextNo })
else
local travelNode = keywordHandler:addKeyword({'liberty bay'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = NoTravel })
end
--End Liberty Bay--
---------------------------------------------------------------------------------------------------------------------------------------------------
---Ankrahmun-----------------------------------------------------------------------------------------------------------------------------------------
local AnkText = 'Do you want to Travel to Ankrahmun for 10 gold coins?'
local AnkTextNo = 'Ok, come back when you want then!'
local NoTravel = 'Sorry, i do not travel to this city..'
local AnkLvl = 8
local AnkPremium = true --True/false
--Ankrahmun--
if Ank == true then
local travelNode = keywordHandler:addKeyword({'ankrahmun'},
StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = AnkText })
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = AnkPremium, level = AnkLvl, cost = AnkCost, destination = AnkPosition })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = AnkTextNo })
else
local travelNode = keywordHandler:addKeyword({'ankrahmun'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = NoTravel })
end
--End Ankrahmun--
---------------------------------------------------------------------------------------------------------------------------------------------------
---Svargrond-----------------------------------------------------------------------------------------------------------------------------------------
local SvargrondText = 'Do you want to Travel to Svargrond for 10 gold coins?'
local SvargrondTextNo = 'Ok, come back when you want then!'
local NoTravel = 'Sorry, i do not travel to this city..'
local SvargrondCost = 10
local SvargrondPremium = true --True/false
--Svargrond--
if Svargrond == true then
local travelNode = keywordHandler:addKeyword({'svargrond'},
StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = SvargrondText })
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = SvargrondPremium, level = SvargrondLvl, cost = SvargrondCost, destination = SvargrondPosition })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = SvargrondTextNo })
else
local travelNode = keywordHandler:addKeyword({'svargrond'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = NoTravel })
end
--End AbDendriel--
---------------------------------------------------------------------------------------------------------------------------------------------------
keywordHandler:addKeyword({'destination'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = DestinationText })
keywordHandler:addKeyword({'job'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = JobText })
keywordHandler:addKeyword({'citys'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = CityText })
keywordHandler:addKeyword({'help'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = HelpText })
-- Makes sure the npc reacts when you say hi, bye etc.
npcHandler:addModule(FocusModule:new())
Mini-Tutorial ->
The Script, is configurated to go to ALL the Citys..
Editing a City..
In this example i will Edit CARLIN..
Script:
PHP:
---------------------------------------CARLIN CONFIG----------------------------------------------
local CarlinPosition = {x=32388, y=31821, z=6} ----> Destination from Carlin Boat <----
local CarlinCost = 10 ----> Cost to Travel for Carlin <----
carlin = true ---->TRUE:Working/FALSE:Not Working<----
---------------------------------------END CARLIN CONFIG------------------------------------------
Example:
IF Carlin = True:
Code:
Player: Hi.
NPC: Hello |PLAYERNAME|!
Player: Carlin
[B]NPC: Do you want to go to Carlin for 10 Gold Coins?[/B]
Now, if you set Carlin = FALSE:
IF Carlin =False:
Code:
Player: Hi.
NPC: Hello |PLAYERNAME|!
Player: Carlin
[B]NPC: Sorry, i do not travel to this city..[/B]
I've Tested in TFS 8.3 and i've got no problems..
Download:
Size:5.78 KB
Type: .ZIP
--> Speedy Share
--> Mega Upload
--> Rapid Share
--> Turbo Upload
--> Media Fire
--> Giga Size
Scan -> Here!
Can someone FIX my Post?
Cya!! :thumbup: