Primero vai em data/npc e duplica um arquivo, nomeie para "NomeDoNpcQueQuiser" sem as aspas e nele cole:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="NomeDoNpcQueQuiser" script="questtp.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="128" head="17" body="54" legs="114" feet="0" addons="2"/>
<parameters>
<parameter key="message_greet" value="Ola |PLAYERNAME|, voce esta no caminho errado!"/>
</parameters>
</npc>
Agora em data/npc/scripts, duplica um arquivo e nomeia para "questtp" sem as aspas e nele cole:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
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
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
local steelboots = 1234 -- coloque o id da stell
local goldingot = 5678 -- coloque o id da gold
local teleport = {x=707, y=372, z=9} -- local que ira teleportar
if (msgcontains(msg, 'quest') and doPlayerRemoveItem(cid, steelboots, 1) and doPlayerRemoveItem(cid, goldingot, 1)) then
doTeleportThing(cid, teleport)
else
selfSay('Você esta no caminho errado!', cid)
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())