Hey guys!
I've got this NPC script:
Please add there a function (after "yes" on NPC question 'Have you got a stone?') which will check that player got specific item, than remove it from player and give another one. And after player's 'yes' the NPC will say 'Are you ready for a tournament?' if player say 'yes' the NPC will teleport player to specific position. Thanks guys!
I've got this NPC script:
LUA:
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
--Na Facc
local travelNode = keywordHandler:addKeyword({'stone'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Have you got a stone?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 1, cost = 0, destination = {x=921, y=92, z=7}})
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Tell me when you will be ready.'})
Please add there a function (after "yes" on NPC question 'Have you got a stone?') which will check that player got specific item, than remove it from player and give another one. And after player's 'yes' the NPC will say 'Are you ready for a tournament?' if player say 'yes' the NPC will teleport player to specific position. Thanks guys!