Hola amigo, este script te puedo funcionar tal y como mencionas en tu post.
- Código:
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 misiones = {
{ name = "crystals", itemid = 2160, itemcount = 1, location = "Carlin" }
}
function creatureSayCallback(cid, type, msg)
if not npcHandler:isFocused(cid) then
return false
end
for index, info in pairs(misiones) do
if msgcontains(msg, info.name) then
if doPlayerRemoveItem(cid, info.itemid, info.itemcount) then
npcHandler:say(string.format("Correcto la ubicacion es en {%s}.", info.location), cid)
else
npcHandler:say(string.format("Si quieres saber la ruta del quest traeme {%u %s}.", info.itemcount, getItemInfo(info.itemid).name), cid)
end
break
end
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
solo añade nuevos lugares a la tabla de misiones
Última edición por [Adm] SevuOT el Jue Jun 06, 2019 10:23 pm, editado 1 vez