bpm91
Intermediate OT User
- Joined
- May 23, 2019
- Messages
- 931
- Solutions
- 7
- Reaction score
- 128
- Location
- Brazil
- YouTube
- caruniawikibr
After speaking zax, the NPC responds correctly, but I can't access the rest of the script. tfs 1.5
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
local function creatureSayCallback(cid, type, msg)
local player = Player(cid)
if not npcHandler:isFocused(cid) then
if msgcontains(msg, 'Zax') then
npcHandler:say('Kul\'nak fethrak sha, '..player:getName()..'? ', cid)
npcHandler:focus(cid)
return true
end
end
end
function helmet(cid, message, keywords, parameters, node)
local player = Player(cid)
if getPlayerItemCount(cid, 5704) >= 2 then
if doPlayerRemoveItem(cid, 5704, 2) then
npcHandler:say('MUAHAHAHAHA! Xoroth, fethrak!', cid)
doPlayerAddItem(cid, 2471, 1)
Npc():getPosition():sendMagicEffect(CONST_ME_YELLOW_RINGS)
player:getPosition():sendMagicEffect(CONST_ME_EXPLOSIONAREA)
end
else
npcHandler:say('Krathok xoroth, fethrak! Uxil zonaghtis!', cid)
end
local node1 = keywordHandler:addKeyword({'gor\'thakul'}, StdModule.say, {npcHandler = npcHandler, text = 'Uxor nokthagor krunoth kulgathrax xoroth, thrax gor\'thakul nuk urgor.'})
node1:addChildKeyword({'thrax'}, helmet, {npcHandler = npcHandler, reset = true})
node1:addChildKeyword({'nul'}, StdModule.say, {npcHandler = npcHandler, text = 'Kulgathis xoroth!', reset = true})
npcHandler:setMessage(MESSAGE_WALKAWAY, 'Krathok xoroth, fethrak!!')
npcHandler:setMessage(MESSAGE_FAREWELL, 'Krathok xoroth, fethrak!!')
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)