olha gente hj eu tava dando uma olhada no xtibia ai encontrei esse script q o npc conta historia e teleporta
mais o problema éke n sei registra ele o cara só mando essa parte eu keria sabe como é a otra :*
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 msgCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid
if(msgcontains(msg, 'contar')) then
npcHandler:say("Há muitos anos vim para esse lugar...", cid)
addEvent(selfSay, 2000, "*Aquele anjo maldito ainda me paga*", cid)
addEvent(selfSay, 4000, "A cada dia ele manda um para este horrível lugar...", cid)
addEvent(selfSay, 8000, "Vejo um ódio em seu coração, estou {certo}?", cid)
talkState[talkUser] = 1
end
if(msgcontains(msg, 'certo') and talkState[talkUser] == 1) then
npcHandler:say("Você pode me {ajudar} a me vingar e libertar todos desse maldito lugar?", cid)
talkState[talkUser] = 2
end
if(msgcontains(msg, 'ajudar') and talkState[talkUser] == 2) then
npcHandler:say("Boatos dizem que esse Querubim aparece raramente nas redondezas de Sorlavin.\nSe você matar esse anjo, todos do inferno poderão voltar a vida e você ganhará uma recompensa por matar-lo, aceita a missão?", cid)
talkState[talkUser] = 3
end
if(msgcontains(msg, 'yes') and talkState[talkUser] == 3) then
npcHandler:say("Lembre-se, ele é uma criatura muito forte!", cid)
addEvent(doTeleportThing, 1000, cid, {x=1031, y=1022, z=7})
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, msgCallback)
npcHandler:setMessage(MESSAGE_GREET, "CALE-SE mortal! Eu dou as ordens aqui, quer ouvir o que eu tenho para te {contar}?")
npcHandler:addModule(FocusModule:new())