[NPC] - [TFS 1.2] - [Client 8.0] - Quest

alekzg

Well-Known Member
Joined
Jul 20, 2010
Messages
10
Reaction score
0
Hello,

I need some help. I would like to create an NPC Traveler where you must first make a mission (e.g bring first some items. 5 Dragon Leathers and 10 Mino Leathers) to swim to other cities. (sorry for my english).

Captain Jack.xml
Code:
<npc name="Captain Jack" script="Captain Jack.lua" floorchange="0" walkinterval="3000" >

    <health now="100" max="100"/>

    <look type="132" head="19" body="70" legs="95" feet="115"/>

    <parameters>

<parameter key="message_greet" value="Ahoy, |PLAYERNAME|. I can travel to [town]."/>

<parameter key="message_placedinqueue" value="One moment please."/>

<parameter key="message_walkaway" value="Good bye. You are welcome."/>

<parameter key="message_farewell" value="Good bye. You are welcome."/>

<parameter key="message_idletimeout" value="Good bye. You are welcome."/>

    </parameters>

</npc>

Captain Jack.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

keywordHandler:addKeyword({'name'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I'm m ol' Captain Jack."})


local travelNode = keywordHandler:addKeyword({'town'}, StdModule.say, {npcHandler = npcHandler, text = 'Do you seek a passage back to Town for free?'})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 0, destination = Position(1084, 1058, 6) })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, reset = true, text = 'We would like to serve you some time.'})

npcHandler:addModule(FocusModule:new())
 
Top