Aqui ta o script do NPC:
-- Script por Killua, antigo Amoeba13 --
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
for varm, tasks in pairs(amoebaTask) do
local msg = string.lower(msg)
if tasks.nome == msg then
if getPlayerStorageValue(cid, tasks.storage) == -1 then
if getPlayerStorageValue(cid, tasks.storagecount) == tasks.count then
local esperiencia = tasks.exp > 0 and "" ..tasks.exp.. " exp e " or ""
local dineiro = tasks.money > 0 and "" .. tasks.money .. " gold coins e " or ""
selfSay("Voce conseguiu completar a task de ".. tasks.nome .. ", parabens! Eu vou te dar " .. esperiencia .. "" .. dineiro .."alguns itens como recompensa.", cid)
doPlayerAddExperience(cid, tasks.exp)
doPlayerAddMoney(cid, tasks.money)
doPlayerSetStorageValue(cid, tasks.storage, 1)
for juba, prize in pairs(tasks.premios) do
doPlayerAddItem(cid, prize[1], prize[2])
end
else
selfSay("Desculpe, mas voce ainda nao matou todos os " .. tasks.nome .. "s. Voce so matou " .. taskKills(cid, tasks.storagecount) .. " de " .. tasks.count .. " " .. tasks.nome .. "s.", cid)
break
end
else
selfSay("Voce so pode recber uma vez o premio de cada task.", cid)
end
end
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Data/Lib:
-- Script feito por Killua, antigo amoeba13 --
amoebaTask = {
{nome = "Jabuti", creatures = {"Jabuti","Jabuti Hatchling"}, storage = 2312112, storagecount = 890120, count = 300, exp = 0, money = 0, premios = {{6527, 10},{10133, 1}}},
{nome = "Thenebreus", creatures = {"Thenebreus"}, storage = 2312113, storagecount = 890121, count = 250, exp = 0, money = 0, premios = {{6527, 4},{10134, 1}}},
{nome = "Demon", creatures = {"Demon"}, storage = 2312114, storagecount = 890122, count = 5, exp = 0, money = 0, premios = {{6527, 4},{10134, 1}}}
}
function taskKills(cid, storage)
kills = getPlayerStorageValue(cid, storage)
if kills < 0 then
kills = 0
end
return kills
end









info
Grupo: Conde
Registrado: 29/04/09
Posts: 904
Reputação: +389
Char no Tibia: Jabuti Selvagem
Mostre pra mim como está seu npc e sua lib.