Ir para conteúdo
  • Cadastre-se

Posts Recomendados

Aew galera do TK gostaria que o npc Grizzly Adams ( task ) entrega-se Holy Icon apos completar a task de Demons
E que o npc Oldrak troque o Holy icon por Hallowed Axe sem precisar dar a volta na demon Oak
TFS 1.0
-- Grizzly Adams --
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Grizzly Adams" script="data/npc/scripts/Grizzly Adams.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="144" head="97" body="97" legs="94" feet="97" addons="3"/>
</npc>
 
-- Script Grizzly Adams --
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
 
local choose = {}
local cancel = {}
local available = {}

local grizzlyAdamsConfig = {
                            ranks = {
                                    huntsMan_rank = {
                                                    {id=11208, buy=0, sell=50, name='antlers'},
                                                    {id=10549, buy=0, sell=100, name='bloody pincers'},
                                                    {id=11183, buy=0, sell=35, name='crab pincers'},
                                                    {id=10573, buy=0, sell=55, name='cyclops toe'},
                                                    {id=10564, buy=0, sell=30, name='frosty ear of a troll'},
                                                    {id=11193, buy=0, sell=600, name='hydra head'},
                                                    {id=11366, buy=0, sell=80, name='lancer beetle shell'},
                                                    {id=10578, buy=0, sell=420, name='mutated bat ear'},
                                                    {id=11222, buy=0, sell=400, name='sabretooth'},
                                                    {id=11367, buy=0, sell=20, name='sandcrawler shell'},
                                                    {id=10547, buy=0, sell=280, name='scarab pincers'},
                                                    {id=11365, buy=0, sell=60, name='terramite legs'},
                                                    {id=11363, buy=0, sell=170, name='terramite shell'},
                                                    {id=11184, buy=0, sell=30000, name='terrorbird beak'},
                                                    
                                                    {id=7398, buy=0, sell=500, name='cyclops trophy'},
                                                    {id=11315, buy=0, sell=15000, name='draken trophy'},
                                                    {id=11330, buy=0, sell=8000, name='lizard trophy'},
                                                    {id=7401, buy=0, sell=500, name='minotaur trophy'}
                                                    },

                                    bigGameHunter_rank = {
                                                    {id=7397, buy=0, sell=3000, name='deer trophy'},
                                                    {id=7400, buy=0, sell=3000, name='lion trophy'},
                                                    {id=7394, buy=0, sell=3000, name='wolf trophy'}
                                                    },

                                    trophyHunter_rank = {
                                                    {id=7393, buy=0, sell=40000, name='demon trophy'},
                                                    {id=7396, buy=0, sell=20000, name='behemoth trophy'},
                                                    {id=7399, buy=0, sell=10000, name='dragon lord trophy'},
                                                    
                                                    {id=10518, buy=1000, sell=0, name='demon backpack'},
                                                    },
                                    }
                            }

local Topic = {}
function greetCallback(cid)
    Topic[cid] = 0
    return true
end

local function setNewTradeTable(table)
local items = {}
for _, v in ipairs(table) do
    items[v.id] = {itemId = v.id, buyPrice = v.buy, sellPrice = v.sell, subType = 0, realName = v.name}
end
return items
end

local function setNewLineTable(oldTable, newTable)
for k, v in pairs(oldTable) do
    table.insert(newTable, k, v)
end
return true
end

function creatureSayCallback(cid, type, msg)
    local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_PRIVATE and 0 or cid
if (msgcontains(msg, "hi") or msgcontains(msg, "hello")) and (not npcHandler:isFocused(cid)) then
if (getPlayerStorageValue(cid, 100157) == -1) then
        npcHandler:say("Welcome "..getCreatureName(cid)..". Would you like to join the 'Paw and Fur - Hunting Elite'?", cid)
        npcHandler:addFocus(cid)
        talkState[talkUser] = 5
  else
        npcHandler:say("Welcome back old chap. What brings you here this time?", cid)
        npcHandler:addFocus(cid)
        talkState[talkUser] = 0
        end
        return true
    end
 
    if(not npcHandler:isFocused(cid)) then
        return false
    end
    
    if msgcontains(msg, "bye") or msgcontains(msg, "farewell") then
        selfSay("Happy hunting, old chap!", cid, TRUE)
        Topic[talkUser] = 0
        npcHandler:releaseFocus(cid)
        npcHandler:resetNpc(cid)
    end
    
    if (isInArray({"yes", "join"}, msg:lower()) and talkState[talkUser] == 5) then 
        setPlayerStorageValue(cid, 100157, 1)
        npcHandler:say("Great! A warm welcome to our newest member: "..getCreatureName(cid).."! Ask me for a {task} if you want to go on a hunt.", cid)
        talkState[talkUser] = 0
   elseif (msg:lower() == "no" and talkState[talkUser] == 5) then
        npcHandler:say("No problem old chap. Come back if you change your mind.", cid)  
   end

if (getPlayerStorageValue(cid, 100157) == -1) then
    npcHandler:say("You'll have to {join} us to get more information.",cid)
    return false
end
if isInArray({"offer", "trade"}, msg:lower()) then
if getPlayerRank(cid) >= 2 then 
        if getPlayerRank(cid) == 2 or getPlayerRank(cid) == 3 then
            tradeRank = grizzlyAdamsConfig.ranks.huntsMan_rank
        elseif getPlayerRank(cid) == 4 then
            tradeRank = grizzlyAdamsConfig.ranks.bigGameHunter_rank
            setNewLineTable(grizzlyAdamsConfig.ranks.huntsMan_rank, grizzlyAdamsConfig.ranks.bigGameHunter_rank)
        elseif getPlayerRank(cid) == 5 or getPlayerRank(cid) == 6 then
            tradeRank = grizzlyAdamsConfig.ranks.trophyHunter_rank
            setNewLineTable(grizzlyAdamsConfig.ranks.huntsMan_rank, grizzlyAdamsConfig.ranks.bigGameHunter_rank)
            setNewLineTable(grizzlyAdamsConfig.ranks.huntsMan_rank, grizzlyAdamsConfig.ranks.trophyHunter_rank)
        end
        local items = setNewTradeTable(tradeRank)
            local function onBuy(cid, item, subType, amount, ignoreCap, inBackpacks)
            if ignoreCap == false and (getPlayerFreeCap(cid) < getItemWeightById(items[item].itemId, amount) or inBackpacks and getPlayerFreeCap(cid) < (getItemWeightById(items[item].itemId, amount) + getItemWeightById(1988, 1))) then
                return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You don\'t have enough cap.')
            end
            if items[item].buyPrice then
                doPlayerRemoveMoney(cid, amount * items[item].buyPrice)
                for i = 1, amount do
                    if inBackpacks then
                        local backpack = doCreateItemEx(1988, 1)
                        doAddContainerItem(backpack, items[item].itemId, amount)
                    else
                        doPlayerAddItem(cid, items[item].itemId, amount, true)
                    end
                end
                return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You bought '..amount..'x '..items[item].realName..' for '..items[item].buyPrice * amount..' gold coins.')
            end
            return true
            end
             
            local function onSell(cid, item, subType, amount, ignoreCap, inBackpacks)
            if items[item].sellPrice then
                doPlayerAddMoney(cid, items[item].sellPrice * amount)
                doPlayerRemoveItem(cid, items[item].itemId, amount)
                return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You sold '..amount..'x '..items[item].realName..' for '..items[item].sellPrice * amount..' gold coins.')
            end
            return true
            end
        openShopWindow(cid, tradeRank, onBuy, onSell)
        return selfSay('It\'s my offer.', cid)
    else
        return selfSay('You don\'t have any rank.', cid)
        end
end
 
    if isInArray({"tasks", "task", "mission"}, msg:lower()) then
        local can = getTasksByPlayer(cid)
        if (getPlayerStorageValue(cid, 100157) == -1) then
             return (npcHandler:say("You'll have to {join}, to get any {tasks}.",cid))
        end
        if #can > 0 then
            local text = ""
            local sep = ", "
            table.sort(can, (function(a, b) return (a < b) end))
            local t = 0
            for _, id in ipairs(can) do
                t = t + 1
                if t == #can - 1 then
                    sep = " and "
                elseif t == #can then
                    sep = "."
                end
                text = text .. "{" .. (tasks[id].name or tasks[id].raceName) .. "}" .. sep
            end
            selfSay("The current task" .. (#can > 1 and "s" or "") .. " that you can choose " .. (#can > 1 and "are" or "is") .. " " .. text, cid)
            talkState[talkUser] = 0
        else
            selfSay("I don't have any task for you right now.", cid)
        end
    elseif msg ~= "" and canStartTask(cid, msg) then
        if #getPlayerStartedTasks(cid) >= tasksByPlayer then
            selfSay("Sorry, but you already started " .. tasksByPlayer .. " tasks. You can check their {status} or {cancel} a task.", cid)
            return true
        end
        local task = getTaskByName(msg)
        if task and getCreatureStorage(cid, QUESTSTORAGE_BASE + task) > 0 then  
            return false
        end
        selfSay("In this task you must defeat " .. tasks[task].killsRequired .. " " .. tasks[task].raceName .. ". Are you sure that you want to start this task?", cid)
        choose[cid] = task
        talkState[talkUser] = 1
    elseif msg:lower() == "yes" and talkState[talkUser] == 1 then
        doCreatureSetStorage(cid, QUESTSTORAGE_BASE + choose[cid], 1)
        selfSay("Excellent! You can check the {status} of your task saying {report} to me. Also you can {cancel} tasks to.", cid)
        choose[cid] = nil
        talkState[talkUser] = 0    
    elseif (msg:lower() == "report" or msg:lower() == "status") then
        local started = getPlayerStartedTasks(cid)
        local finishedAtLeastOne = false
        local finished = 0
        if started and #started > 0 then
            for _, id in ipairs(started) do
                if getCreatureStorage(cid, KILLSSTORAGE_BASE + id) >= tasks[id].killsRequired then
                    for _, reward in ipairs(tasks[id].rewards) do
                        local deny = false
                        if reward.storage then
                            if getCreatureStorage(cid, reward.storage[1]) >= reward.storage[2] then
                                deny = true
                            end
                        end
                        if isInArray({REWARD_MONEY, "money"}, reward.type:lower()) and not deny then
                            doPlayerAddMoney(cid, reward.value[1])
                        elseif isInArray({REWARD_EXP, "exp", "experience"}, reward.type:lower()) and not deny then
                            doPlayerAddExperience(cid, reward.value[1])
                            doPlayerSendDefaultCancel(cid, "You gained " .. reward.value[1] .. " experience points.")
                        elseif isInArray({REWARD_ACHIEVEMENT, "achievement", "ach"}, reward.type:lower()) and not deny then
                            if doPlayerAddAchievement then
                                doPlayerAddAchievement(cid, reward.value[1], true)
                            end
                        elseif isInArray({REWARD_STORAGE, "storage", "stor"}, reward.type:lower()) and not deny then
                            doCreatureSetStorage(cid, reward.value[1], reward.value[2])
                        elseif isInArray({REWARD_POINT, "points", "point"}, reward.type:lower()) and not deny then
                            doCreatureSetStorage(cid, POINTSSTORAGE, getCreatureStorage(cid, POINTSSTORAGE) + reward.value[1])
                        elseif isInArray({REWARD_ITEM, "item", "items", "object"}, reward.type:lower()) and not deny then
                            doPlayerAddItem(cid, reward.value[1], reward.value[2])
                        end
 
                        if reward.storage then
                            doCreatureSetStorage(cid, reward.storage[1], reward.storage[2])
                        end
                    end
 
                    if tasks[id].norepeatable then
                        doCreatureSetStorage(cid, QUESTSTORAGE_BASE + id, 2)
                    else
                        doCreatureSetStorage(cid, QUESTSTORAGE_BASE + id, 0)
                    end
                    doCreatureSetStorage(cid, KILLSSTORAGE_BASE + id, 0)
                    if getCreatureStorage(cid, REPEATSTORAGE_BASE + id) < 1 then
                        doCreatureSetStorage(cid, REPEATSTORAGE_BASE + id, 0)
                    end
                    doCreatureSetStorage(cid, REPEATSTORAGE_BASE + id, getCreatureStorage(cid, REPEATSTORAGE_BASE + id) + 1)
                    finishedAtLeastOne = true
                    finished = finished + 1
                end
            end
 
            if not finishedAtLeastOne then
         local started = getPlayerStartedTasks(cid)
        if started and #started > 0 then
            local text = ""
            local sep = ", "
            table.sort(started, (function(a, b) return (a < b) end))
            local t = 0
            for _, id in ipairs(started) do
                t = t + 1
                if t == #started - 1 then
                    sep = " and "
                elseif t == #started then
                    sep = "."
                end
                text = text .. "{" .. (tasks[id].name or tasks[id].raceName) .. "}" .. sep
            end
                selfSay("The current task" .. (#started > 1 and "s" or "") .. " that you started " .. (#started > 1 and "are" or "is") .. " " .. text, cid)
                Topic[cid] = 1
            else
                selfSay("Awesome! you finished " .. (finished > 1 and "various" or "a") .. " task" .. (finished > 1 and "s" or "") .. ". Talk to me again if you want to start a {task}.", cid)
            end
        else
            selfSay("You haven't started any task yet.", cid)
        end
        end
    elseif msg:lower() == "started" then
        local started = getPlayerStartedTasks(cid)
        if started and #started > 0 then
            local text = ""
            local sep = ", "
            table.sort(started, (function(a, b) return (a < b) end))
            local t = 0
            for _, id in ipairs(started) do
                t = t + 1
                if t == #started - 1 then
                    sep = " and "
                elseif t == #started then
                    sep = "."
                end
                text = text .. "{" .. (tasks[id].name or tasks[id].raceName) .. "}" .. sep
            end
 
            selfSay("The current task" .. (#started > 1 and "s" or "") .. " that you started " .. (#started > 1 and "are" or "is") .. " " .. text, cid)
        else
            selfSay("You haven't started any task yet.", cid)
        end
    elseif msg:lower() == "cancel" then
        local started = getPlayerStartedTasks(cid)
        local task = getTaskByName(msg)
        local text = ""
            local sep = ", "
            table.sort(started, (function(a, b) return (a < b) end))
            local t = 0
            for _, id in ipairs(started) do
                t = t + 1
                if t == #started - 1 then
                    sep = " or "
                elseif t == #started then
                    sep = "?"
                end
                text = text .. "{" .. (tasks[id].name or tasks[id].raceName) .. "}" .. sep
            end
        if started and #started > 0 then
            selfSay("Cancelling a task will make the counter restart. Which of these tasks you want cancel?" .. (#started > 1 and "" or "") .. " " .. text, cid)
            talkState[talkUser] = 2
        else
            selfSay("You haven't started any task yet.", cid)
        end
    elseif getTaskByName(msg) and talkState[talkUser] == 2 and isInArray(getPlayerStartedTasks(cid), getTaskByName(msg)) then
        local task = getTaskByName(msg)
        if getCreatureStorage(cid, KILLSSTORAGE_BASE + task) > 0 then
            selfSay("You currently killed " .. getCreatureStorage(cid, KILLSSTORAGE_BASE + task) .. "/" .. tasks[task].killsRequired .. " " .. tasks[task].raceName .. ". Cancelling this task will restart the count. Are you sure you want to cancel this task?", cid)
        else
            selfSay("Are you sure you want to cancel this task?", cid)
        end
        talkState[talkUser] = 3
        cancel[cid] = task
    elseif getTaskByName(msg) and Topic[cid] == 1 and isInArray(getPlayerStartedTasks(cid), getTaskByName(msg)) then
        local task = getTaskByName(msg)
        if getCreatureStorage(cid, KILLSSTORAGE_BASE + task) > 0 then
            selfSay("You currently killed " .. getCreatureStorage(cid, KILLSSTORAGE_BASE + task) .. "/" .. tasks[task].killsRequired .. " " .. tasks[task].raceName .. ".", cid)
            Topic[cid] = 0
        else
            selfSay("You haven't started any task yet.", cid)
        end
    elseif msg:lower() == "yes" and talkState[talkUser] == 3 then
        doCreatureSetStorage(cid, QUESTSTORAGE_BASE + cancel[cid], -1)
        doCreatureSetStorage(cid, KILLSSTORAGE_BASE + cancel[cid], -1)
        selfSay("You have cancelled the task " .. (tasks[cancel[cid]].name or tasks[cancel[cid]].raceName) .. ".", cid)
        talkState[talkUser] = 0
    elseif isInArray({"points", "rank"}, msg:lower()) then
        if getCreatureStorage(cid, POINTSSTORAGE) < 1 then
        selfSay("At this time, you have 0 Paw & Fur points. You " .. (getPlayerRank(cid) == 6 and "are an Elite Hunter" or getPlayerRank(cid) == 5 and "are a Trophy Hunter" or getPlayerRank(cid) == 4 and "are a Big Game Hunter" or getPlayerRank(cid) == 3 and "are a Ranger" or getPlayerRank(cid) == 2 and "are a Huntsman" or getPlayerRank(cid) == 1 and "are a Member"  or "haven't been ranked yet") .. ".", cid)
        elseif getCreatureStorage(cid, POINTSSTORAGE) >= 1 then 
        selfSay("At this time, you have " .. getCreatureStorage(cid, POINTSSTORAGE) .. " Paw & Fur points. You " .. (getPlayerRank(cid) == 6 and "are an Elite Hunter" or getPlayerRank(cid) == 5 and "are a Trophy Hunter" or getPlayerRank(cid) == 4 and "are a Big Game Hunter" or getPlayerRank(cid) == 3 and "are a Ranger" or getPlayerRank(cid) == 2 and "are a Huntsman" or getPlayerRank(cid) == 1 and "are a Member"  or "haven't been ranked yet") .. ".", cid)
        end
        talkState[talkUser] = 0
    end
end
 
npcHandler:setMessage(MESSAGE_FAREWELL, "Happy hunting, old chap!")
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
-- Lib --
-- 104-KillingInTheNameOf --
RANK_NONE = 0
RANK_JOIN = 1
RANK_HUNTSMAN = 2
RANK_RANGER = 3
RANK_BIGGAMEHUNTER = 4
RANK_TROPHYHUNTER = 5
RANK_ELITEHUNTER = 6
 
REWARD_MONEY = 1
REWARD_EXP = 2
REWARD_ACHIEVEMENT = 3
REWARD_STORAGE = 4
REWARD_POINT = 5
REWARD_ITEM = 6
 
QUESTSTORAGE_BASE = 1500
JOIN_STOR = 100157
KILLSSTORAGE_BASE = 65000
REPEATSTORAGE_BASE = 48950
POINTSSTORAGE = 2500
tasks =
{
    --Tasks for level 6 to 49.
    [1] = {killsRequired = 100, raceName = "Trolls", level = {6, 19}, premium = true, creatures = {"troll", "troll champion", "island troll", "swamp troll"}, rewards = {
                                                                                                                                        {type = "exp", value = {200}},
                                                                                                                                        {type = "money", value = {200}}
                                                                                                                                    }},
    [2] = {killsRequired = 150, raceName = "Goblins", level = {6, 19}, premium = true, creatures = {"goblin", "goblin assassin", "goblin leader"}, rewards = {
                                                                                                                                        {type = "exp", value = {300}},
                                                                                                                                        {type = "money", value = {250}}
                                                                                                                                    }},
    [3] = {killsRequired = 300, raceName = "Crocodiles", level = {6, 49}, premium = true, creatures = {"crocodile"}, rewards = {
                                                                                                                                        {type = "exp", value = {800}},
                                                                                                                                        {type = "achievement", value = {"Blood-Red Snapper"}},
                                                                                                                                        {type = "storage", value = {35000, 1}},
                                                                                                                                        {type = "points", value = {1}}
                                                                                                                                    }},
    [4] = {killsRequired = 300, raceName = "Badgers", level = {6, 49}, premium = true, creatures = {"badger"}, rewards = {
                                                                                                                                        {type = "exp", value = {500}},
                                                                                                                                        {type = "points", value = {1}}
                                                                                                                                    }},
    [5] = {killsRequired = 300, raceName = "Tarantulas", level = {6, 49}, premium = true, creatures = {"tarantula"}, rewards = {
                                                                                                                                        {type = "exp", value = {1500}},
                                                                                                                                        {type = "achievement", value = {"No More Hiding"}},
                                                                                                                                        {type = "storage", value = {35001, 1}},
                                                                                                                                        {type = "points", value = {2}}
                                                                                                                                    }},
    [6] = {killsRequired = 150, raceName = "Carniphilas", level = {6, 49}, premium = true, creatures = {"carniphila"}, rewards = {
                                                                                                                                        {type = "exp", value = {2500}},
                                                                                                                                        {type = "achievement", value = {"Rootless Behaviour"}},
                                                                                                                                        {type = "storage", value = {35002, 1}},
                                                                                                                                        {type = "points", value = {3}}
                                                                                                                                    }},
    [7] = {killsRequired = 200, raceName = "Stone Golems", level = {6, 49}, premium = true, creatures = {"stone golem"}, rewards = {
                                                                                                                                        {type = "exp", value = {2000}},
                                                                                                                                        {type = "points", value = {3}}
                                                                                                                                    }},
    [8] = {killsRequired = 300, raceName = "Mammoths", level = {6, 49}, premium = true, creatures = {"mammoth"}, rewards = {
                                                                                                                                        {type = "exp", value = {4000}},
                                                                                                                                        {type = "achievement", value = {"Meat Skewer"}},
                                                                                                                                        {type = "storage", value = {35003, 1}},
                                                                                                                                        {type = "points", value = {3}}
                                                                                                                                    }},
    [9] = {killsRequired = 300, raceName = "Gnarlhounds", level = {6, 49}, premium = true, creatures = {"gnarlhound"}, rewards = {
                                                                                                                                        {type = "exp", value = {1000}},
                                                                                                                                        {type = "points", value = {2}}
                                                                                                                                    }},
    [10] = {killsRequired = 300, raceName = "Terramites", level = {6, 49}, premium = true, creatures = {"terramite"}, rewards = {
                                                                                                                                        {type = "exp", value = {1000}},
                                                                                                                                        {type = "points", value = {2}}
                                                                                                                                    }},
    [11] = {killsRequired = 300, raceName = "Apes", level = {6, 49}, premium = true, creatures = {"kongra", "sibang", "merklin"}, rewards = {
                                                                                                                                        {type = "exp", value = {1000}},
                                                                                                                                        {type = "points", value = {2}}
                                                                                                                                    }},
    [12] = {killsRequired = 300, raceName = "Thornback Tortoises", level = {6, 49}, premium = true, creatures = {"thornback tortoise"}, rewards = {
                                                                                                                                        {type = "exp", value = {1500}},
                                                                                                                                        {type = "points", value = {2}}
                                                                                                                                    }},
    [13] = {killsRequired = 300, raceName = "Gargoyles", level = {6, 49}, premium = true, creatures = {"gargoyle"}, rewards = {
                                                                                                                                        {type = "exp", value = {1500}}
                                                                                                                                    }},
 
    --Tasks for level 50 to 79.
 
    [14] = {killsRequired = 300, raceName = "Ice Golems", level = {50, 79}, premium = true, creatures = {"ice golem"}, rewards = {
                                                                                                                                        {type = "exp", value = {12000}},
                                                                                                                                        {type = "achievement", value = {"Breaking The Ice"}},
                                                                                                                                        {type = "storage", value = {35004, 1}},
                                                                                                                                        {type = "points", value = {2}}
                                                                                                                                    }},
    [15] = {killsRequired = 400, raceName = "Quara Scouts", level = {50, 79}, premium = true, creatures = {"quara pincher scout", "quara predator scout", "quara hydromancer scout", "quara constrictor scout", "quara mantassin scout"}, rewards = {
                                                                                                                                        {type = "exp", value = {10000}},
                                                                                                                                        {type = "points", value = {2}}
                                                                                                                                    }},
    [16] = {killsRequired = 400, raceName = "Mutated Rats", level = {50, 79}, premium = true, creatures = {"mutated rat"}, rewards = {
                                                                                                                                        {type = "exp", value = {10000}},
                                                                                                                                        {type = "achievement", value = {"Twisted Mutation"}},
                                                                                                                                        {type = "storage", value = {35005, 1}},
                                                                                                                                        {type = "points", value = {2}}
                                                                                                                                    }},                                                                                                
    [17] = {killsRequired = 250, raceName = "Ancient Scarabs", level = {50, 79}, premium = true, creatures = {"ancient scarab"}, rewards = {
                                                                                                                                        {type = "exp", value = {15000}},
                                                                                                                                        {type = "achievement", value = {"Crawling Death"}},
                                                                                                                                        {type = "storage", value = {35006, 1}},
                                                                                                                                        {type = "points", value = {2}}
                                                                                                                                    }},    
    [18] = {killsRequired = 300, raceName = "Wyverns", level = {50, 79}, premium = true, creatures = {"wyvern"}, rewards = {
                                                                                                                                        {type = "exp", value = {12000}},
                                                                                                                                        {type = "points", value = {2}}
                                                                                                                                    }},                                                                                                        
    [19] = {killsRequired = 300, raceName = "Lancer Beetles", level = {50, 79}, premium = true, creatures = {"lancer beetle"}, rewards = {
                                                                                                                                        {type = "exp", value = {8000}},
                                                                                                                                        {type = "points", value = {2}}
                                                                                                                                    }},                                                                                                        
    [20] = {killsRequired = 400, raceName = "Wailing Widows", level = {50, 79}, premium = true, creatures = {"wailing widow"}, rewards = {
                                                                                                                                        {type = "exp", value = {12000}},
                                                                                                                                        {type = "points", value = {3}}
                                                                                                                                    }},                                                                                                        
    [21] = {killsRequired = 250, raceName = "Killer Caimans", level = {50, 79}, premium = true, creatures = {"killer caiman"}, rewards = {
                                                                                                                                        {type = "exp", value = {10000}},
                                                                                                                                        {type = "points", value = {2}}
                                                                                                                                    }},                                                                                                        
    [22] = {killsRequired = 300, raceName = "Bonebeasts", level = {50, 79}, premium = true, creatures = {"bonebeast"}, rewards = {
                                                                                                                                        {type = "exp", value = {12000}},
                                                                                                                                        {type = "achievement", value = {"Spareribs for Dinner"}},
                                                                                                                                        {type = "storage", value = {35007, 1}},
                                                                                                                                        {type = "points", value = {2}}
                                                                                                                                    }},    
    [23] = {killsRequired = 300, raceName = "Crystal Spiders", level = {50, 79}, creatures = {"crystal spider"}, premium = true, rewards = {
                                                                                                                                        {type = "exp", value = {15000}},
                                                                                                                                        {type = "achievement", value = {"Arachnoise"}},
                                                                                                                                        {type = "storage", value = {35008, 1}},
                                                                                                                                        {type = "points", value = {3}}
                                                                                                                                    }},    
    [24] = {killsRequired = 300, raceName = "Mutated Tigers", level = {50, 79}, premium = true, creatures = {"mutated tiger"}, rewards = {
                                                                                                                                        {type = "exp", value = {12000}},
                                                                                                                                        {type = "points", value = {2}}
                                                                                                                                    }},    
 
    --Taks for level 80 to 129.
 
    [25] = {killsRequired = 600, raceName = "Underwater Quara", level = {80, 129}, premium = true, creatures = {"quara hydromancer", "quara predator", "quara constrictor", "quara mantassin", "quara pincher"}, rewards = {
                                                                                                                                        {type = "exp", value = {15000}},
                                                                                                                                        {type = "achievement", value = {"Back into the Abyss"}},
                                                                                                                                        {type = "storage", value = {35009, 1}},
                                                                                                                                        {type = "points", value = {3}}
                                                                                                                                    }},    
 
    [26] = {killsRequired = 500, raceName = "Giant Spiders", level = {80, 129}, premium = true, creatures = {"giant spider"}, rewards = {
                                                                                                                                        {type = "exp", value = {20000}},
                                                                                                                                        {type = "achievement", value = {"Choking on Her Venom"}},
                                                                                                                                        {type = "storage", value = {35010, 1}},
                                                                                                                                        {type = "points", value = {3}}
                                                                                                                                    }},    
 
    [27] = {killsRequired = 300, raceName = "Werewolves", level = {80, 129}, premium = true, creatures = {"werewolf"}, rewards = {
                                                                                                                                        {type = "exp", value = {30000}},
                                                                                                                                        {type = "achievement", value = {"Howly Silence"}},
                                                                                                                                        {type = "storage", value = {35011, 1}},
                                                                                                                                        {type = "points", value = {4}}
                                                                                                                                    }},
 
    [28] = {killsRequired = 400, raceName = "Nightmares", level = {80, 129}, premium = true, creatures = {"nightmare", "nightmare scion"}, rewards = {
                                                                                                                                        {type = "exp", value = {25000}},
                                                                                                                                        {type = "achievement", value = {"Dream is Over"}},
                                                                                                                                        {type = "storage", value = {35012, 1}},
                                                                                                                                        {type = "points", value = {3}}
                                                                                                                                    }},        
 
    [29] = {killsRequired = 600, raceName = "Hellspawns", level = {80, 129}, premium = true, creatures = {"hellspawn"}, rewards = {
                                                                                                                                        {type = "exp", value = {25000}},
                                                                                                                                        {type = "achievement", value = {"Scorched Flames"}},
                                                                                                                                        {type = "storage", value = {35013, 1}}
                                                                                                                                    }},
 
    [30] = {killsRequired = 800, raceName = "High Class Lizards", level = {80, 129}, premium = true, creatures = {"lizard chosen", "lizard dragon priest", "lizard high guard", "lizard legionnaire"}, rewards = {
                                                                                                                                        {type = "exp", value = {30000}},
                                                                                                                                        {type = "achievement", value = {"Zzztill Zzztanding!"}},
                                                                                                                                        {type = "storage", value = {35014, 1}},
                                                                                                                                        {type = "points", value = {3}}
                                                                                                                                    }},
 
    [31] = {killsRequired = 600, raceName = "Stampors", level = {80, 129}, premium = true, creatures = {"stampor"}, rewards = {
                                                                                                                                        {type = "exp", value = {20000}},
                                                                                                                                        {type = "achievement", value = {"Stepped on a Big Toe"}},
                                                                                                                                        {type = "storage", value = {35015, 1}},
                                                                                                                                        {type = "points", value = {3}}
                                                                                                                                    }},        
 
    [32] = {killsRequired = 500, raceName = "Brimstone Bugs", level = {80, 129}, premium = true, creatures = {"brimstone bug"}, rewards = {
                                                                                                                                        {type = "exp", value = {15000}},
                                                                                                                                        {type = "achievement", value = {"Something Smells"}},
                                                                                                                                        {type = "storage", value = {35016, 1}},
                                                                                                                                        {type = "points", value = {3}}
                                                                                                                                    }},    
 
    [33] = {killsRequired = 400, raceName = "Mutated Bats", level = {80, 129}, premium = true, creatures = {"mutated bat"}, rewards = {
                                                                                                                                        {type = "exp", value = {20000}},
                                                                                                                                        {type = "achievement", value = {"Kapow!"}},
                                                                                                                                        {type = "storage", value = {35017, 1}},
                                                                                                                                        {type = "points", value = {2}}
                                                                                                                                    }},        
 
    --Tasks for level 130+                                                                                                    
    [34] = {killsRequired = 650, raceName = "Hydras", level = {130, 9999}, premium = true, creatures = {"hydra"}, rewards = {
                                                                                                                                        {type = "exp", value = {30000}},
                                                                                                                                        {type = "achievement", value = {"One Less"}},
                                                                                                                                        {type = "storage", value = {35018, 1}},
                                                                                                                                        {type = "points", value = {3}}
                                                                                                                                    }},    
 
    [35] = {killsRequired = 800, raceName = "Serpent Spawns", level = {130, 9999}, premium = true, creatures = {"serpent spawn"}, rewards = {
                                                                                                                                        {type = "exp", value = {30000}},
                                                                                                                                        {type = "achievement", value = {"Hissing Downfall"}},
                                                                                                                                        {type = "storage", value = {35019, 1}},
                                                                                                                                        {type = "points", value = {4}}
                                                                                                                                    }},        
 
    [36] = {killsRequired = 500, raceName = "Medusa", level = {130, 9999}, premium = true, creatures = {"medusa"}, rewards = {
                                                                                                                                        {type = "exp", value = {40000}},
                                                                                                                                        {type = "achievement", value = {"The Serpent's Bride"}},
                                                                                                                                        {type = "storage", value = {35020, 1}},
                                                                                                                                        {type = "points", value = {5}}
                                                                                                                                    }},    
 
    [37] = {killsRequired = 700, raceName = "Behemoths", level = {130, 9999}, premium = true, creatures = {"behemoth"}, rewards = {
                                                                                                                                        {type = "exp", value = {30000}},
                                                                                                                                        {type = "achievement", value = {"Just Cracked Me Up!"}},
                                                                                                                                        {type = "storage", value = {35021, 1}},
                                                                                                                                        {type = "points", value = {4}}
                                                                                                                                    }},    
 
    [38] = {killsRequired = 900, raceName = "Sea Serpents and Young Sea Serpents", level = {130, 9999}, premium = true, creatures = {"sea serpent", "young sea serpent"}, rewards = {
                                                                                                                                        {type = "exp", value = {30000}},
                                                                                                                                        {type = "achievement", value = {"The Drowned Sea God"}},
                                                                                                                                        {type = "storage", value = {35022, 1}},
                                                                                                                                        {type = "points", value = {4}}
                                                                                                                                    }},        
 
    [39] = {killsRequired = 250, raceName = "Hellhounds", level = {130, 9999}, premium = true, creatures = {"hellhound"}, rewards = {
                                                                                                                                        {type = "exp", value = {40000}},
                                                                                                                                        {type = "achievement", value = {"The Gates of Hell"}},
                                                                                                                                        {type = "storage", value = {35023, 1}},
                                                                                                                                        {type = "points", value = {5}}
                                                                                                                                    }},        
 
    [40] = {killsRequired = 500, raceName = "Ghastly Dragons", level = {130, 9999}, premium = true, creatures = {"ghastly dragon"}, rewards = {
                                                                                                                                        {type = "exp", value = {30000}},
                                                                                                                                        {type = "achievement", value = {"Beautiful Agony"}},
                                                                                                                                        {type = "storage", value = {35024, 1}},
                                                                                                                                        {type = "points", value = {5}}
                                                                                                                                    }},        
 
    [41] = {killsRequired = 900, raceName = "Drakens", level = {130, 9999}, premium = true, creatures = {"draken spellweaver", "draken warmaster", "draken abomination", "draken elite"} , rewards = {
                                                                                                                                        {type = "exp", value = {30000}},
                                                                                                                                        {type = "achievement", value = {"Enter zze Draken!"}},
                                                                                                                                        {type = "storage", value = {35025, 1}},
                                                                                                                                        {type = "points", value = {3}}
                                                                                                                                    }},    
 
    [42] = {killsRequired = 650, raceName = "Destroyers", level = {130, 9999}, premium = true, creatures = {"destroyer"}, rewards = {
                                                                                                                                        {type = "exp", value = {30000}},
                                                                                                                                        {type = "achievement", value = {"Best there was!"}},
                                                                                                                                        {type = "storage", value = {35026, 1}},
                                                                                                                                        {type = "points", value = {4}}
                                                                                                                                    }},            
 
    [43] = {killsRequired = 400, raceName = "Undead Dragons", level = {130, 9999}, premium = true, creatures = {"undead dragon"}, rewards = {
                                                                                                                                        {type = "exp", value = {50000}},
                                                                                                                                        {type = "achievement", value = {"Back from the Dead"}},
                                                                                                                                        {type = "storage", value = {35027, 1}},
                                                                                                                                        {type = "points", value = {6}}
                                                                                                                                    }},    
 
    --Special tasks.
 
    [44] = {killsRequired = 6666, raceName = "Demons", level = {130, 9999}, rank = RANK_ELITEHUNTER, premium = true, creatures = {"demon"}, rewards = {
                                                                                                                                        {type = "storage", value = {41300, 1}} --Storage that let's you to start Demon Oak
                                                                                                                                    }},
 
    [45] = {killsRequired = 500, raceName = "Green Djinns or Efreets", level = {1, 9999}, storage = {12500, 1}, premium = true, creatures = {"green djinn", "efreet"}, rewards = { --Requires an storage (Gained on The Djinn War - Marid Faction)
                                                                                                                                        {type = "exp", value = {10000}},
                                                                                                                                        {type = "money", value = {5000}},
                                                                                                                                        {type = "storage", value = {35028, 1}}
                                                                                                                                    }},
 
    [46] = {killsRequired = 500, raceName = "Blue Djinns or Marids", level = {1, 9999}, storage = {12501, 1}, premium = true, creatures = {"blue djinn", "marid"}, rewards = { --Requires an storage (Gained on The Djinn War - Efreet Faction)
                                                                                                                                        {type = "exp", value = {10000}},
                                                                                                                                        {type = "money", value = {5000}},
                                                                                                                                        {type = "storage", value = {35029, 1}}
                                                                                                                                    }},        
 
    [47] = {killsRequired = 3000, raceName = "Pirates", level = {1, 9999}, storage = {12600, 1}, premium = true, creatures = {"pirate ghost", "pirate marauder", "pirate cutthroad", "pirate buccaneer", "pirate corsair", "pirate skeleton"}, rewards = { --Requires an storage (Gained on The Shattered Isles Quest)
                                                                                                                                        {type = "exp", value = {10000}},
                                                                                                                                        {type = "money", value = {5000}},
                                                                                                                                        {type = "storage", value = {35030, 1}}
                                                                                                                                    }},    
 
    [48] = {killsRequired = 3000, raceName = "Pirates second task", level = {1, 9999}, storage = {REPEATSTORAGE_BASE + 47, 3}, norepeatable = true, premium = true, creatures = {"pirate ghost", "pirate marauder", "pirate cutthroad", "pirate buccaneer", "pirate corsair", "pirate skeleton"}, rewards = { --Requires an storage (Gained completing Raymond Striker's first task three times.) NOTE: The required storage to start this task is: base + first pirate task id (47)
                                                                                                                                        {type = "exp", value = {10000}},
                                                                                                                                        {type = "money", value = {5000}},
                                                                                                                                        {type = "storage", value = {35031, 1}}
                                                                                                                                    }},    
 
    [49] = {killsRequired = 5000, raceName = "Minotaurs", level = {1, 40}, storage = {12700, 1}, norepeatable = true, premium = false, creatures = {"minotaur", "minotaur mage", "minotaur archer"}, rewards = { --Requires an storage (Gained on To Outfox a Fox Quest)
                                                                                                                                        {type = "storage", value = {35032, 1}}
                                                                                                                                    }},
 
    [50] = {killsRequired = 4000, raceName = "Necromancers and Priestess", level = {60, 9999}, norepeatable = true, premium = true, creatures = {"necromancer", "priestess"}, rewards = { --Requires an storage (Gained on To Outfox a Fox Quest)
                                                                                                                                        {type = "storage", value = {35033, 1}},
                                                                                                                                        {type = "storage", value = {12800, 1}} --storage to stark the second Necromancers and Priestess task.
                                                                                                                                    }},    
 
    [49] = {killsRequired = 1000, name = "Necromancers and Priestess second task", raceName = "Necromancers and Priestess", level = {60, 9999}, storage = {12800, 1}, norepeatable = true, premium = true, creatures = {"necromancer", "priestess"}, rewards = { --Requires an storage (Gained on To Outfox a Fox Quest)
                                                                                                                                        {type = "exp", value = {40000}},
                                                                                                                                        {type = "storage", value = {35033, 1}}
                                                                                                                                    }},                                                                                                                                        
}
 
tasksByPlayer = 3
repeatTimes = 3
 
function getPlayerRank(cid)
    return (getPlayerStorageValue(cid, POINTSSTORAGE) >= 100 and RANK_ELITEHUNTER or getPlayerStorageValue(cid, POINTSSTORAGE) >= 70 and RANK_TROPHYHUNTER or getPlayerStorageValue(cid, POINTSSTORAGE) >= 40 and RANK_BIGGAMEHUNTER or getPlayerStorageValue(cid, POINTSSTORAGE) >= 20 and RANK_RANGER or getPlayerStorageValue(cid, POINTSSTORAGE) >= 10 and RANK_HUNTSMAN or getPlayerStorageValue(cid, JOIN_STOR) == 1 and RANK_JOIN or RANK_NONE)
end
 
function getTaskByName(name, table)
    local t = (table and table or tasks)
    for k, v in pairs(t) do
        if v.name then
            if v.name:lower() == name:lower() then
                return k
            end
        else
            if v.raceName:lower() == name:lower() then
                return k
            end
        end
    end
    return false
end
 
function getTasksByPlayer(cid)
    local canmake = {}
    local able = {}
    for k, v in pairs(tasks) do
        if getCreatureStorage(cid, QUESTSTORAGE_BASE + k) < 1 and getCreatureStorage(cid, REPEATSTORAGE_BASE + k) < repeatTimes then
            able[k] = true
            if getPlayerLevel(cid) < v.level[1] or getPlayerLevel(cid) > v.level[2] then
                able[k] = false
            end
            if v.storage and getCreatureStorage(cid, v.storage[1]) < v.storage[2] then
                able[k] = false
            end
 
            if v.rank then
                if getPlayerRank(cid) < v.rank then
                    able[k] = false
                end
            end
 
            if v.premium then
                if not isPremium(cid) then
                    able[k] = false
                end
            end
 
            if able[k] then
                table.insert(canmake, k)
            end
        end
    end
    return canmake
end
 
 
function canStartTask(cid, name, table)
    local v = ""
    local id = 0
    local t = (table and table or tasks)
    for k, i in pairs(t) do
        if i.name then
            if i.name:lower() == name:lower() then
                v = i
                id = k
                break
            end
        else
            if i.raceName:lower() == name:lower() then
                v = i
                id = k
                break
            end
        end
    end
    if v == "" then
        return false
    end
    if getCreatureStorage(cid, QUESTSTORAGE_BASE + id) > 0 then
        return false
    end
    if (getCreatureStorage(cid, REPEATSTORAGE_BASE +  id) >= repeatTimes) or (v.norepeatable and getCreatureStorage(cid, REPEATSTORAGE_BASE +  id) > 0) then
        return false
    end
    if getPlayerLevel(cid) >= v.level[1] and getPlayerLevel(cid) <= v.level[2] then
        if v.premium then
            if isPremium(cid) then
                if v.rank then
                    if getPlayerRank(cid) >= v.rank then
                        if v.storage then 
                            if getCreatureStorage(cid, v.storage[1]) >= v.storage[2] then
                                return true
                            end
                        else
                            return true
                        end
                    end
                else
                    return true
                end
            end
        else
            return true
        end
    end
    return false
end
 
function getPlayerStartedTasks(cid)
 
    local tmp = {}
    for k, v in pairs(tasks) do
        if getCreatureStorage(cid, QUESTSTORAGE_BASE + k) > 0 and getCreatureStorage(cid, QUESTSTORAGE_BASE + k) < 2 then
            table.insert(tmp, k) 
        end
    end
    return tmp
end
 
function isSummon(cid)
    return getCreatureMaster(cid) ~= nil or false
end
 -- Oldrak --
<npc name="Oldrak" script="data/npc/scripts/Oldrak.lua" walkinterval="2000" floorchange="0" access="3">
    <health now="150" max="150"/>
    <look type="57" head="115" body="113" legs="31" feet="38" addons="3"/>
    <parameters>
<parameter key="message_greet" value="Welcome |PLAYERNAME|! Rarely I can welcome visitors in these days."/>
<parameter key="message_placedinqueue" value="Please wait a minute, |PLAYERNAME|."/>
<parameter key="message_walkaway" value="Take care, it's dangerous out there."/>
<parameter key="message_farewell" value="Good bye, |PLAYERNAME|!"/>
<parameter key="message_idletimeout" value="Good bye, |PLAYERNAME|!"/>
    </parameters>
</npc>
-- Script Oldrak --

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
 
local Topic = {}
local storage = 100077
 
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

keywordHandler:addKeyword({'job'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I guard this humble temple as a monument for the order of the nightmare knights."})
keywordHandler:addKeyword({'name'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "My name is Oldrak."})
keywordHandler:addKeyword({'monster'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "These plains are not safe for ordinary travellers. It will take heroes to survive here."})
keywordHandler:addKeyword({'help'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can't help you, sorry!"})
keywordHandler:addKeyword({'goshnar'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "The greatest necromant who ever cursed our land with the steps of his feet. He was defeated by the nightmare knights."})
keywordHandler:addKeyword({'nightmare'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "This ancient order was created by a circle of wise humans who were called 'the dreamers'. The order became extinct a long time ago."})
keywordHandler:addKeyword({'extinct'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Many perished in their battles against evil, some went mad, not able to stand their nightmares any longer. Others were seduced by the darkness."})
keywordHandler:addKeyword({'dreamers'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "They learned the ancient art of dreamwalking from some elves they befriended."})
keywordHandler:addKeyword({'dreamwalking'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "While the dreamwalkers of the elves experienenced the brightest dreams of pleasure, the humans strangely had dreams of dark omen."})
keywordHandler:addKeyword({'omen'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "They dreamed of doom, destruction, talked to dead, tormented souls, and gained unwanted insight into the schemes of darkness."})
keywordHandler:addKeyword({'schemes'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "They figured out how to interpret their dark dreams and so could foresee the plans of the dark gods and their minions."})
keywordHandler:addKeyword({'plan'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Using this knowledge they formed an order to thwart these plans, and because they battled their nightmares as brave as knights, they named their order accordingly."})
keywordHandler:addKeyword({'necromant'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "It is rumoured to open the entrance to the pits of inferno, also called the nightmare pits. Even if I knew about this secret I wouldn't tell you."})
keywordHandler:addKeyword({'havok'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Before the battles raged across them, they were called the fair plains."})
keywordHandler:addKeyword({'tibia'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "That's where we are. The world of Tibia."})
keywordHandler:addKeyword({'god'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "They created Tibia and all life on it ... and unlife, too."})
keywordHandler:addKeyword({'unlife'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Beware the foul undead!"})
keywordHandler:addKeyword({'undead'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Beware the foul undead!"})
keywordHandler:addKeyword({'excalibug'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "A weapon of myth and legend. It was lost in ancient times ... perhaps lost forever."})
keywordHandler:addKeyword({'hugo'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Ah, the bane of the Plains of Havoc, the hidden beast, the unbeatable foe. I live here for years and I am sure it's only a myth."})
keywordHandler:addKeyword({'yenny'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Yenny, known as the Gentle, was one of most powerfull magicwielders in ancient times and known throughout the world for her mercy and kindness."})
keywordHandler:addKeyword({'offer'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can offer you the holy tible for a small fee."})
keywordHandler:addKeyword({'trade'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can offer you the holy tible for a small fee."})
keywordHandler:addKeyword({'sell'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can offer you the holy tible for a small fee."})
keywordHandler:addKeyword({'buy'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can offer you the holy tible for a small fee."})
keywordHandler:addKeyword({'have'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can offer you the holy tible for a small fee."})
keywordHandler:addKeyword({'have'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can offer you the holy tible for a small fee."})
keywordHandler:addKeyword({'time'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Now, it is "..getWorldTime().."."})
 
function greetCallback(cid)
    Topic[cid] = 0
    return true
end
 
function creatureSayCallback(cid, type, msg)
   local v = getPlayerStorageValue(cid, storage)
   if not npcHandler:isFocused(cid) then return false end
    if msgcontains(msg, 'no') and Topic[cid] == 1 then
        npcHandler:say("What a pity! Let me know when you managed to get in there. Maybe I can help you when we know what we are dealing with.",cid)
        Topic[cid] = 0
    elseif msgcontains(msg, 'no') and Topic[cid] == 2 then
        npcHandler:say("Not then.",cid)
        Topic[cid] = 0
    end 
    if  (msgcontains(msg, 'mission') or msgcontains(msg, 'demon oak')) and getPlayerStorageValue(cid, storage) == -1 then
        npcHandler:say("How do you know? Did you go into the infested area?", cid)
        Topic[cid] = 1
    elseif Topic[cid] == 1 then
        if msgcontains(msg, 'yes') then
        if getPlayerStorageValue(cid, 100076) == 1 and getPlayerStorageValue(cid, storage) == -1 then
           npcHandler:say("A demon oak?!? <mumbles some blessings> May the gods be on our side. You'll need a {hallowed axe} to harm that tree. Bring me a simple {axe} and I'll prepare it for you.",cid)
           setPlayerStorageValue(cid, storage, 1)
           setPlayerStorageValue(cid, 100072, 2)
           setPlayerStorageValue(cid, 100076, 2) 
       else
           npcHandler:say("I don't believe a word of it! How rude to lie to a monk!",cid)
           end
           Topic[cid] = 0
        end
    elseif msgcontains(msg, 'axe') or msgcontains(msg, 'hallowed axe') then
        if v == 1 then
        if getPlayerItemCount(cid,2386) >= 1 then  
           npcHandler:say("Ahh, you've got an axe. Very good. I can make a hallowed axe out of it. It will cost you... er... a donation of 1,000 gold. Alright?",cid)
           Topic[cid] = 2
        else
           npcHandler:say("There is no axe with you.",cid)
       end 
    end
    elseif (msgcontains(msg, 'mission') or msgcontains(msg, 'demon oak')) then
        if (v == 1 or v == 2) then
        if getPlayerStorageValue(cid,100070) == 1 then
            npcHandler:say("You chopped down the demon oak?!? Unbelievable!! Let's hope it doesn't come back. As long as evil is still existent in the soil of the plains, it won't be over. Still, the demons suffered a setback, that's for sure. ...",cid)
            npcHandler:say("For your brave action, I tell you a secret which has been kept for many many years. There is an old house south of the location where you found the demon oak. There should be a grave with the name 'Yesim Adeit' somewhere close by. ...",cid, 4000)
            npcHandler:say("It belongs to a Daramian nobleman named 'Teme Saiyid'. I knew him well and he told me -almost augured- that someone will come who is worthy to obtain his treasure. I'm sure this 'someone' is you. Good luck in finding it!",cid, 8000)
            setPlayerStorageValue(cid,100070, 2)
            setPlayerStorageValue(cid,storage, 3)
        setPlayerStorageValue(cid, 100072, 4)
        else
            npcHandler:say("You better don't return here until you've finished your {mission}.", cid)
        end
        elseif v == 3 and getPlayerStorageValue(cid,100070) == 2  then
           npcHandler:say("I'm really thankful for your help and so should be every citizen of Tibia.",cid)
        end
    elseif Topic[cid] == 2 then
    if msgcontains(msg, 'yes') then
    if getPlayerItemCount(cid,2386) >= 1 then
    if doPlayerRemoveMoney(cid,1000) then
            npcHandler:say("Let's see....<mumbles a prayer>....here we go. The blessing on this axe will be absorbed by all the demonic energy around here. I presume it will not last very long, so better hurry. Actually, I can refresh the blessing as often as you like.",cid)
        doPlayerAddItem(cid,8293,1)
        doPlayerRemoveItem(cid, 2386, 1)
    else
        npcHandler:say("It costs 1000 gold coins.",cid)
        end
        else
            npcHandler:say("There is no axe with you.",cid)
            end
        end
        Topic[cid] = 0
        end
    return true
end
 
npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())


Irei dar REP+ pra quem me ajudar

:D Mesmo assim obrigado a todos! :D
 
Estou fazendo um projeto otserv e preciso de todo tipo de ajuda!
Editado por compp (veja o histórico de edições)

Rosario__Vampire_Cast400x226.jpg

                   rosario_vampire_girl_bat_moon_25562_2560

Link para o post
Compartilhar em outros sites
Script do old
 
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
 
local Topic = {}
local storage = 100077
 
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

keywordHandler:addKeyword({'job'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I guard this humble temple as a monument for the order of the nightmare knights."})
keywordHandler:addKeyword({'name'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "My name is Oldrak."})
keywordHandler:addKeyword({'monster'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "These plains are not safe for ordinary travellers. It will take heroes to survive here."})
keywordHandler:addKeyword({'help'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can't help you, sorry!"})
keywordHandler:addKeyword({'goshnar'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "The greatest necromant who ever cursed our land with the steps of his feet. He was defeated by the nightmare knights."})
keywordHandler:addKeyword({'nightmare'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "This ancient order was created by a circle of wise humans who were called 'the dreamers'. The order became extinct a long time ago."})
keywordHandler:addKeyword({'extinct'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Many perished in their battles against evil, some went mad, not able to stand their nightmares any longer. Others were seduced by the darkness."})
keywordHandler:addKeyword({'dreamers'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "They learned the ancient art of dreamwalking from some elves they befriended."})
keywordHandler:addKeyword({'dreamwalking'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "While the dreamwalkers of the elves experienenced the brightest dreams of pleasure, the humans strangely had dreams of dark omen."})
keywordHandler:addKeyword({'omen'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "They dreamed of doom, destruction, talked to dead, tormented souls, and gained unwanted insight into the schemes of darkness."})
keywordHandler:addKeyword({'schemes'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "They figured out how to interpret their dark dreams and so could foresee the plans of the dark gods and their minions."})
keywordHandler:addKeyword({'plan'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Using this knowledge they formed an order to thwart these plans, and because they battled their nightmares as brave as knights, they named their order accordingly."})
keywordHandler:addKeyword({'necromant'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "It is rumoured to open the entrance to the pits of inferno, also called the nightmare pits. Even if I knew about this secret I wouldn't tell you."})
keywordHandler:addKeyword({'havok'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Before the battles raged across them, they were called the fair plains."})
keywordHandler:addKeyword({'tibia'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "That's where we are. The world of Tibia."})
keywordHandler:addKeyword({'god'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "They created Tibia and all life on it ... and unlife, too."})
keywordHandler:addKeyword({'unlife'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Beware the foul undead!"})
keywordHandler:addKeyword({'undead'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Beware the foul undead!"})
keywordHandler:addKeyword({'excalibug'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "A weapon of myth and legend. It was lost in ancient times ... perhaps lost forever."})
keywordHandler:addKeyword({'hugo'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Ah, the bane of the Plains of Havoc, the hidden beast, the unbeatable foe. I live here for years and I am sure it's only a myth."})
keywordHandler:addKeyword({'yenny'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Yenny, known as the Gentle, was one of most powerfull magicwielders in ancient times and known throughout the world for her mercy and kindness."})
keywordHandler:addKeyword({'offer'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can offer you the holy tible for a small fee."})
keywordHandler:addKeyword({'trade'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can offer you the holy tible for a small fee."})
keywordHandler:addKeyword({'sell'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can offer you the holy tible for a small fee."})
keywordHandler:addKeyword({'buy'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can offer you the holy tible for a small fee."})
keywordHandler:addKeyword({'have'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can offer you the holy tible for a small fee."})
keywordHandler:addKeyword({'have'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can offer you the holy tible for a small fee."})
keywordHandler:addKeyword({'time'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Now, it is "..getWorldTime().."."})
 
function greetCallback(cid)
    Topic[cid] = 0
    return true
end
 
function creatureSayCallback(cid, type, msg)
   local v = getPlayerStorageValue(cid, storage)
   if not npcHandler:isFocused(cid) then return false end
    if msgcontains(msg, 'no') and Topic[cid] == 1 then
        npcHandler:say("What a pity! Let me know when you managed to get in there. Maybe I can help you when we know what we are dealing with.",cid)
        Topic[cid] = 0
    elseif msgcontains(msg, 'no') and Topic[cid] == 2 then
        npcHandler:say("Not then.",cid)
        Topic[cid] = 0
    end 
    if  (msgcontains(msg, 'mission') or msgcontains(msg, 'demon oak'))  then
        npcHandler:say("How do you know? Did you go into the infested area?", cid)
        Topic[cid] = 1
    elseif Topic[cid] == 1 then
        if msgcontains(msg, 'yes') then
        if getPlayerStorageValue(cid, 100076) == 1 then
           npcHandler:say("A demon oak?!? <mumbles some blessings> May the gods be on our side. You'll need a {hallowed axe} to harm that tree. Bring me a simple {axe} and I'll prepare it for you.",cid)
           setPlayerStorageValue(cid, storage, 1)
           setPlayerStorageValue(cid, 100072, 2)
           setPlayerStorageValue(cid, 100076, 2) 
       else
           npcHandler:say("I don't believe a word of it! How rude to lie to a monk!",cid)
           end
           Topic[cid] = 0
        end
    elseif msgcontains(msg, 'axe') or msgcontains(msg, 'hallowed axe') then
        if v == 1 then
        if getPlayerItemCount(cid,2386) >= 1 then  
           npcHandler:say("Ahh, you've got an axe. Very good. I can make a hallowed axe out of it. It will cost you... er... a donation of 1,000 gold. Alright?",cid)
           Topic[cid] = 2
        else
           npcHandler:say("There is no axe with you.",cid)
       end 
    end
    elseif (msgcontains(msg, 'mission') or msgcontains(msg, 'demon oak')) then
        if (v == 1 or v == 2) then
        if getPlayerStorageValue(cid,100070) == 1 then
            npcHandler:say("You chopped down the demon oak?!? Unbelievable!! Let's hope it doesn't come back. As long as evil is still existent in the soil of the plains, it won't be over. Still, the demons suffered a setback, that's for sure. ...",cid)
            npcHandler:say("For your brave action, I tell you a secret which has been kept for many many years. There is an old house south of the location where you found the demon oak. There should be a grave with the name 'Yesim Adeit' somewhere close by. ...",cid, 4000)
            npcHandler:say("It belongs to a Daramian nobleman named 'Teme Saiyid'. I knew him well and he told me -almost augured- that someone will come who is worthy to obtain his treasure. I'm sure this 'someone' is you. Good luck in finding it!",cid, 8000)
            setPlayerStorageValue(cid,100070, 2)
            setPlayerStorageValue(cid,storage, 3)
        setPlayerStorageValue(cid, 100072, 4)
        else
            npcHandler:say("You better don't return here until you've finished your {mission}.", cid)
        end
        elseif v == 3 and getPlayerStorageValue(cid,100070) == 2  then
           npcHandler:say("I'm really thankful for your help and so should be every citizen of Tibia.",cid)
        end
    elseif Topic[cid] == 2 then
    if msgcontains(msg, 'yes') then
    if getPlayerItemCount(cid,2386) >= 1 then
    if doPlayerRemoveMoney(cid,1000) then
            npcHandler:say("Let's see....<mumbles a prayer>....here we go. The blessing on this axe will be absorbed by all the demonic energy around here. I presume it will not last very long, so better hurry. Actually, I can refresh the blessing as often as you like.",cid)
        doPlayerAddItem(cid,8293,1)
        doPlayerRemoveItem(cid, 2386, 1)
    else
        npcHandler:say("It costs 1000 gold coins.",cid)
        end
        else
            npcHandler:say("There is no axe with you.",cid)
            end
        end
        Topic[cid] = 0
        end
    return true
end

Script do grizzly

Só pra explicar:
Na linha 110
getPlayerStorageValue(cid, 43312) ~= 1)
Você põe uma storage que não ta sendo usada, pro jogador não conseguir pegar a holy mais de uma vez,, é só isso, testa e qualquer erro me manda aqui.
 
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
 
local choose = {}
local cancel = {}
local available = {}

local grizzlyAdamsConfig = {
                            ranks = {
                                    huntsMan_rank = {
                                                    {id=11208, buy=0, sell=50, name='antlers'},
                                                    {id=10549, buy=0, sell=100, name='bloody pincers'},
                                                    {id=11183, buy=0, sell=35, name='crab pincers'},
                                                    {id=10573, buy=0, sell=55, name='cyclops toe'},
                                                    {id=10564, buy=0, sell=30, name='frosty ear of a troll'},
                                                    {id=11193, buy=0, sell=600, name='hydra head'},
                                                    {id=11366, buy=0, sell=80, name='lancer beetle shell'},
                                                    {id=10578, buy=0, sell=420, name='mutated bat ear'},
                                                    {id=11222, buy=0, sell=400, name='sabretooth'},
                                                    {id=11367, buy=0, sell=20, name='sandcrawler shell'},
                                                    {id=10547, buy=0, sell=280, name='scarab pincers'},
                                                    {id=11365, buy=0, sell=60, name='terramite legs'},
                                                    {id=11363, buy=0, sell=170, name='terramite shell'},
                                                    {id=11184, buy=0, sell=30000, name='terrorbird beak'},
                                                    
                                                    {id=7398, buy=0, sell=500, name='cyclops trophy'},
                                                    {id=11315, buy=0, sell=15000, name='draken trophy'},
                                                    {id=11330, buy=0, sell=8000, name='lizard trophy'},
                                                    {id=7401, buy=0, sell=500, name='minotaur trophy'}
                                                    },

                                    bigGameHunter_rank = {
                                                    {id=7397, buy=0, sell=3000, name='deer trophy'},
                                                    {id=7400, buy=0, sell=3000, name='lion trophy'},
                                                    {id=7394, buy=0, sell=3000, name='wolf trophy'}
                                                    },

                                    trophyHunter_rank = {
                                                    {id=7393, buy=0, sell=40000, name='demon trophy'},
                                                    {id=7396, buy=0, sell=20000, name='behemoth trophy'},
                                                    {id=7399, buy=0, sell=10000, name='dragon lord trophy'},
                                                    
                                                    {id=10518, buy=1000, sell=0, name='demon backpack'},
                                                    },
                                    }
                            }

local Topic = {}
function greetCallback(cid)
    Topic[cid] = 0
    return true
end

local function setNewTradeTable(table)
local items = {}
for _, v in ipairs(table) do
    items[v.id] = {itemId = v.id, buyPrice = v.buy, sellPrice = v.sell, subType = 0, realName = v.name}
end
return items
end

local function setNewLineTable(oldTable, newTable)
for k, v in pairs(oldTable) do
    table.insert(newTable, k, v)
end
return true
end

function creatureSayCallback(cid, type, msg)
    local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_PRIVATE and 0 or cid
if (msgcontains(msg, "hi") or msgcontains(msg, "hello")) and (not npcHandler:isFocused(cid)) then

if (getPlayerStorageValue(cid, 41300) == 1 and getPlayerStorageValue(cid, 43312) ~= 1) then
        npcHandler:say("Welcome! You can take your holy icon now!", cid)
		npcHandler:addFocus(cid)
        talkState[talkUser] = 0
        end
		
if (getPlayerStorageValue(cid, 100157) == -1) then
        npcHandler:say("Welcome "..getCreatureName(cid)..". Would you like to join the 'Paw and Fur - Hunting Elite'?", cid)
        npcHandler:addFocus(cid)
        talkState[talkUser] = 5
  else
        npcHandler:say("Welcome back old chap. What brings you here this time?", cid)
        npcHandler:addFocus(cid)
        talkState[talkUser] = 0
        end
        return true
    end
 
    if(not npcHandler:isFocused(cid)) then
        return false
    end
    
    if msgcontains(msg, "bye") or msgcontains(msg, "farewell") then
        selfSay("Happy hunting, old chap!", cid, TRUE)
        Topic[talkUser] = 0
        npcHandler:releaseFocus(cid)
        npcHandler:resetNpc(cid)
    end
    
	if (msgcontains(msg, "holy icon") or msgcontains(msg, "holyicon")) then
if (getPlayerStorageValue(cid, 41300) == 1 and getPlayerStorageValue(cid, 43312) ~= 1) then
        npcHandler:say("Here, take your holy icon!", cid)
		setPlayerStorageValue(cid, 43312, 1)
		doPlayerAddItem(cid, 10305, 1)
        npcHandler:addFocus(cid)
        talkState[talkUser] = 0
  else
        npcHandler:say("You need to complete the demon task.", cid)
        npcHandler:addFocus(cid)
        talkState[talkUser] = 0
        end
        return true
    end
	
	
    if (isInArray({"yes", "join"}, msg:lower()) and talkState[talkUser] == 5) then 
        setPlayerStorageValue(cid, 100157, 1)
        npcHandler:say("Great! A warm welcome to our newest member: "..getCreatureName(cid).."! Ask me for a {task} if you want to go on a hunt.", cid)
        talkState[talkUser] = 0
   elseif (msg:lower() == "no" and talkState[talkUser] == 5) then
        npcHandler:say("No problem old chap. Come back if you change your mind.", cid)  
   end

if (getPlayerStorageValue(cid, 100157) == -1) then
    npcHandler:say("You'll have to {join} us to get more information.",cid)
    return false
end
if isInArray({"offer", "trade"}, msg:lower()) then
if getPlayerRank(cid) >= 2 then 
        if getPlayerRank(cid) == 2 or getPlayerRank(cid) == 3 then
            tradeRank = grizzlyAdamsConfig.ranks.huntsMan_rank
        elseif getPlayerRank(cid) == 4 then
            tradeRank = grizzlyAdamsConfig.ranks.bigGameHunter_rank
            setNewLineTable(grizzlyAdamsConfig.ranks.huntsMan_rank, grizzlyAdamsConfig.ranks.bigGameHunter_rank)
        elseif getPlayerRank(cid) == 5 or getPlayerRank(cid) == 6 then
            tradeRank = grizzlyAdamsConfig.ranks.trophyHunter_rank
            setNewLineTable(grizzlyAdamsConfig.ranks.huntsMan_rank, grizzlyAdamsConfig.ranks.bigGameHunter_rank)
            setNewLineTable(grizzlyAdamsConfig.ranks.huntsMan_rank, grizzlyAdamsConfig.ranks.trophyHunter_rank)
        end
        local items = setNewTradeTable(tradeRank)
            local function onBuy(cid, item, subType, amount, ignoreCap, inBackpacks)
            if ignoreCap == false and (getPlayerFreeCap(cid) < getItemWeightById(items[item].itemId, amount) or inBackpacks and getPlayerFreeCap(cid) < (getItemWeightById(items[item].itemId, amount) + getItemWeightById(1988, 1))) then
                return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You don\'t have enough cap.')
            end
            if items[item].buyPrice then
                doPlayerRemoveMoney(cid, amount * items[item].buyPrice)
                for i = 1, amount do
                    if inBackpacks then
                        local backpack = doCreateItemEx(1988, 1)
                        doAddContainerItem(backpack, items[item].itemId, amount)
                    else
                        doPlayerAddItem(cid, items[item].itemId, amount, true)
                    end
                end
                return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You bought '..amount..'x '..items[item].realName..' for '..items[item].buyPrice * amount..' gold coins.')
            end
            return true
            end
             
            local function onSell(cid, item, subType, amount, ignoreCap, inBackpacks)
            if items[item].sellPrice then
                doPlayerAddMoney(cid, items[item].sellPrice * amount)
                doPlayerRemoveItem(cid, items[item].itemId, amount)
                return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You sold '..amount..'x '..items[item].realName..' for '..items[item].sellPrice * amount..' gold coins.')
            end
            return true
            end
        openShopWindow(cid, tradeRank, onBuy, onSell)
        return selfSay('It\'s my offer.', cid)
    else
        return selfSay('You don\'t have any rank.', cid)
        end
end
 
    if isInArray({"tasks", "task", "mission"}, msg:lower()) then
        local can = getTasksByPlayer(cid)
        if (getPlayerStorageValue(cid, 100157) == -1) then
             return (npcHandler:say("You'll have to {join}, to get any {tasks}.",cid))
        end
        if #can > 0 then
            local text = ""
            local sep = ", "
            table.sort(can, (function(a, b) return (a < b) end))
            local t = 0
            for _, id in ipairs(can) do
                t = t + 1
                if t == #can - 1 then
                    sep = " and "
                elseif t == #can then
                    sep = "."
                end
                text = text .. "{" .. (tasks[id].name or tasks[id].raceName) .. "}" .. sep
            end
            selfSay("The current task" .. (#can > 1 and "s" or "") .. " that you can choose " .. (#can > 1 and "are" or "is") .. " " .. text, cid)
            talkState[talkUser] = 0
        else
            selfSay("I don't have any task for you right now.", cid)
        end
    elseif msg ~= "" and canStartTask(cid, msg) then
        if #getPlayerStartedTasks(cid) >= tasksByPlayer then
            selfSay("Sorry, but you already started " .. tasksByPlayer .. " tasks. You can check their {status} or {cancel} a task.", cid)
            return true
        end
        local task = getTaskByName(msg)
        if task and getCreatureStorage(cid, QUESTSTORAGE_BASE + task) > 0 then  
            return false
        end
        selfSay("In this task you must defeat " .. tasks[task].killsRequired .. " " .. tasks[task].raceName .. ". Are you sure that you want to start this task?", cid)
        choose[cid] = task
        talkState[talkUser] = 1
    elseif msg:lower() == "yes" and talkState[talkUser] == 1 then
        doCreatureSetStorage(cid, QUESTSTORAGE_BASE + choose[cid], 1)
        selfSay("Excellent! You can check the {status} of your task saying {report} to me. Also you can {cancel} tasks to.", cid)
        choose[cid] = nil
        talkState[talkUser] = 0    
    elseif (msg:lower() == "report" or msg:lower() == "status") then
        local started = getPlayerStartedTasks(cid)
        local finishedAtLeastOne = false
        local finished = 0
        if started and #started > 0 then
            for _, id in ipairs(started) do
                if getCreatureStorage(cid, KILLSSTORAGE_BASE + id) >= tasks[id].killsRequired then
                    for _, reward in ipairs(tasks[id].rewards) do
                        local deny = false
                        if reward.storage then
                            if getCreatureStorage(cid, reward.storage[1]) >= reward.storage[2] then
                                deny = true
                            end
                        end
                        if isInArray({REWARD_MONEY, "money"}, reward.type:lower()) and not deny then
                            doPlayerAddMoney(cid, reward.value[1])
                        elseif isInArray({REWARD_EXP, "exp", "experience"}, reward.type:lower()) and not deny then
                            doPlayerAddExperience(cid, reward.value[1])
                            doPlayerSendDefaultCancel(cid, "You gained " .. reward.value[1] .. " experience points.")
                        elseif isInArray({REWARD_ACHIEVEMENT, "achievement", "ach"}, reward.type:lower()) and not deny then
                            if doPlayerAddAchievement then
                                doPlayerAddAchievement(cid, reward.value[1], true)
                            end
                        elseif isInArray({REWARD_STORAGE, "storage", "stor"}, reward.type:lower()) and not deny then
                            doCreatureSetStorage(cid, reward.value[1], reward.value[2])
                        elseif isInArray({REWARD_POINT, "points", "point"}, reward.type:lower()) and not deny then
                            doCreatureSetStorage(cid, POINTSSTORAGE, getCreatureStorage(cid, POINTSSTORAGE) + reward.value[1])
                        elseif isInArray({REWARD_ITEM, "item", "items", "object"}, reward.type:lower()) and not deny then
                            doPlayerAddItem(cid, reward.value[1], reward.value[2])
                        end
 
                        if reward.storage then
                            doCreatureSetStorage(cid, reward.storage[1], reward.storage[2])
                        end
                    end
 
                    if tasks[id].norepeatable then
                        doCreatureSetStorage(cid, QUESTSTORAGE_BASE + id, 2)
                    else
                        doCreatureSetStorage(cid, QUESTSTORAGE_BASE + id, 0)
                    end
                    doCreatureSetStorage(cid, KILLSSTORAGE_BASE + id, 0)
                    if getCreatureStorage(cid, REPEATSTORAGE_BASE + id) < 1 then
                        doCreatureSetStorage(cid, REPEATSTORAGE_BASE + id, 0)
                    end
                    doCreatureSetStorage(cid, REPEATSTORAGE_BASE + id, getCreatureStorage(cid, REPEATSTORAGE_BASE + id) + 1)
                    finishedAtLeastOne = true
                    finished = finished + 1
                end
            end
 
            if not finishedAtLeastOne then
         local started = getPlayerStartedTasks(cid)
        if started and #started > 0 then
            local text = ""
            local sep = ", "
            table.sort(started, (function(a, b) return (a < b) end))
            local t = 0
            for _, id in ipairs(started) do
                t = t + 1
                if t == #started - 1 then
                    sep = " and "
                elseif t == #started then
                    sep = "."
                end
                text = text .. "{" .. (tasks[id].name or tasks[id].raceName) .. "}" .. sep
            end
                selfSay("The current task" .. (#started > 1 and "s" or "") .. " that you started " .. (#started > 1 and "are" or "is") .. " " .. text, cid)
                Topic[cid] = 1
            else
                selfSay("Awesome! you finished " .. (finished > 1 and "various" or "a") .. " task" .. (finished > 1 and "s" or "") .. ". Talk to me again if you want to start a {task}.", cid)
            end
        else
            selfSay("You haven't started any task yet.", cid)
        end
        end
    elseif msg:lower() == "started" then
        local started = getPlayerStartedTasks(cid)
        if started and #started > 0 then
            local text = ""
            local sep = ", "
            table.sort(started, (function(a, b) return (a < b) end))
            local t = 0
            for _, id in ipairs(started) do
                t = t + 1
                if t == #started - 1 then
                    sep = " and "
                elseif t == #started then
                    sep = "."
                end
                text = text .. "{" .. (tasks[id].name or tasks[id].raceName) .. "}" .. sep
            end
 
            selfSay("The current task" .. (#started > 1 and "s" or "") .. " that you started " .. (#started > 1 and "are" or "is") .. " " .. text, cid)
        else
            selfSay("You haven't started any task yet.", cid)
        end
    elseif msg:lower() == "cancel" then
        local started = getPlayerStartedTasks(cid)
        local task = getTaskByName(msg)
        local text = ""
            local sep = ", "
            table.sort(started, (function(a, b) return (a < b) end))
            local t = 0
            for _, id in ipairs(started) do
                t = t + 1
                if t == #started - 1 then
                    sep = " or "
                elseif t == #started then
                    sep = "?"
                end
                text = text .. "{" .. (tasks[id].name or tasks[id].raceName) .. "}" .. sep
            end
        if started and #started > 0 then
            selfSay("Cancelling a task will make the counter restart. Which of these tasks you want cancel?" .. (#started > 1 and "" or "") .. " " .. text, cid)
            talkState[talkUser] = 2
        else
            selfSay("You haven't started any task yet.", cid)
        end
    elseif getTaskByName(msg) and talkState[talkUser] == 2 and isInArray(getPlayerStartedTasks(cid), getTaskByName(msg)) then
        local task = getTaskByName(msg)
        if getCreatureStorage(cid, KILLSSTORAGE_BASE + task) > 0 then
            selfSay("You currently killed " .. getCreatureStorage(cid, KILLSSTORAGE_BASE + task) .. "/" .. tasks[task].killsRequired .. " " .. tasks[task].raceName .. ". Cancelling this task will restart the count. Are you sure you want to cancel this task?", cid)
        else
            selfSay("Are you sure you want to cancel this task?", cid)
        end
        talkState[talkUser] = 3
        cancel[cid] = task
    elseif getTaskByName(msg) and Topic[cid] == 1 and isInArray(getPlayerStartedTasks(cid), getTaskByName(msg)) then
        local task = getTaskByName(msg)
        if getCreatureStorage(cid, KILLSSTORAGE_BASE + task) > 0 then
            selfSay("You currently killed " .. getCreatureStorage(cid, KILLSSTORAGE_BASE + task) .. "/" .. tasks[task].killsRequired .. " " .. tasks[task].raceName .. ".", cid)
            Topic[cid] = 0
        else
            selfSay("You haven't started any task yet.", cid)
        end
    elseif msg:lower() == "yes" and talkState[talkUser] == 3 then
        doCreatureSetStorage(cid, QUESTSTORAGE_BASE + cancel[cid], -1)
        doCreatureSetStorage(cid, KILLSSTORAGE_BASE + cancel[cid], -1)
        selfSay("You have cancelled the task " .. (tasks[cancel[cid]].name or tasks[cancel[cid]].raceName) .. ".", cid)
        talkState[talkUser] = 0
    elseif isInArray({"points", "rank"}, msg:lower()) then
        if getCreatureStorage(cid, POINTSSTORAGE) < 1 then
        selfSay("At this time, you have 0 Paw & Fur points. You " .. (getPlayerRank(cid) == 6 and "are an Elite Hunter" or getPlayerRank(cid) == 5 and "are a Trophy Hunter" or getPlayerRank(cid) == 4 and "are a Big Game Hunter" or getPlayerRank(cid) == 3 and "are a Ranger" or getPlayerRank(cid) == 2 and "are a Huntsman" or getPlayerRank(cid) == 1 and "are a Member"  or "haven't been ranked yet") .. ".", cid)
        elseif getCreatureStorage(cid, POINTSSTORAGE) >= 1 then 
        selfSay("At this time, you have " .. getCreatureStorage(cid, POINTSSTORAGE) .. " Paw & Fur points. You " .. (getPlayerRank(cid) == 6 and "are an Elite Hunter" or getPlayerRank(cid) == 5 and "are a Trophy Hunter" or getPlayerRank(cid) == 4 and "are a Big Game Hunter" or getPlayerRank(cid) == 3 and "are a Ranger" or getPlayerRank(cid) == 2 and "are a Huntsman" or getPlayerRank(cid) == 1 and "are a Member"  or "haven't been ranked yet") .. ".", cid)
        end
        talkState[talkUser] = 0
    end
end
 
npcHandler:setMessage(MESSAGE_FAREWELL, "Happy hunting, old chap!")
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

 

Life is so meaningless, there is nothing worth a smile
So goodbye, I'll miss you

 

 

sugestões?

 

 

Link para o post
Compartilhar em outros sites
Para carregar não da nenhum erro! - Perfeito
é posivel pegar a task de demons com o
Grizzly Adams, porem não é possível faze-la
você mata o demon mais a task não completa
 não sei se deu pra entender 

E o Oldrak apos dizer hi ele não responde nada! 

Ps: não editei nada, testei como você postou!

 
Editado por compp (veja o histórico de edições)

Rosario__Vampire_Cast400x226.jpg

                   rosario_vampire_girl_bat_moon_25562_2560

Link para o post
Compartilhar em outros sites

Bem, acho que vou precisar de um script que creio que fica em movements, é algum relacionado a demon oak, pra pegar a storage e arrumar o old, ele não funciona pois não carregou, era pra ter dado algum erro na parte de npcs.

Na dos demons, você alterou a linha
 [44] = {killsRequired = 6666, raceName = "Demons", level = {130, 9999}, rank = RANK_ELITEHUNTER, premium = true, creatures = {"demon"}, rewards 
Pra
 [44] = {killsRequired = 1, raceName = "Demons", level = {130, 9999}, rank = RANK_ELITEHUNTER, premium = true, creatures = {"demon"}, rewards 
Na hora de testar?

Life is so meaningless, there is nothing worth a smile
So goodbye, I'll miss you

 

 

sugestões?

 

 

Link para o post
Compartilhar em outros sites
Tenho isso relacionado a demon oak que creio de grande importância
102-demonOak.lua - lib

--PLEASE SPECIFY HERE WHAT DISTRO VERSION YOU ARE USING. IF YOU ARE USING (0.40/0.4.0)DEV SPECIFY IT AS 040
--IF YOU ARE USING 0.3.7/0.3.7PL1/0.3.6/0.3.5.... OR ANY OTHER VERSION OF 0.3, SPECIFY IT AS 037/036/035, ETC...
--THE IDEA IS TO SPECIFY IT WITHOUT ANY STRING CHARACTER, JUST NUMBERS
--MUST SPECIFY THIS PROPERLY TO MAKE SCRIPT WORKS CORRECTLY
DISTRO_VERSION = 040
--END
 
_INFO =
{
    UPDATED = "June 26 2012",
    VERSION = "0.70",
    REV = 1,
    AUTHOR = "Darkhaos",
    CONTACT = "http://otland.net/members/darkhaos/"
}
 
if getStorage(0x65535) < 1 then
    doSetStorage(0x65536, os.clock())
    print("\n>> Loading Demon Oak Lib V" .. (_INFO.VERSION or "?") .. " REV: " .. (_INFO.REV or "?") .. " (" .. (_INFO.UPDATED or "?") .. ") By " .. (_INFO.AUTHOR or "?") .. " (Contact: " .. (_INFO.CONTACT or "?") .. ")")
    doSetStorage(0x65535, 1)
end
 
ITEM_DEADTREE = 2709
 
HALLOWEDAXE_PRICE = 1000
 
ERROR_NOERROR = 0
ERROR_TREEPOSITION = 1
ERROR_NOTENOUGHLEVEL = 2
ERROR_ALREADYDONE = 3
ERROR_ALREADYCUT = 4
ERROR_PLAYERINAREA = 5
ERROR_MISSINGINFO = 6
 
TYPE_PLAYER = 1
TYPE_MONSTER = 2
TYPE_NPC = 3
TYPE_ALL = 4
 
GET_COUNT = 1
GET_UID = 2
 
STORAGE_LIB = 100075
STORAGE_OAKTHINK = 100074
 
oneInArea = true
killAllBeforeCut = false
 
logEnabled = true
 
level = 120
waves = 0
positions =
{
    kick = { x = 32713, y = 32339, z = 7 },
    summon =
    {
        {x = 104, y = 83, z = 7}
    },
    rewardRoom = {x=32713, y = 32399, z = 8},
    demonOak = {x = 32716, y = 32352, z = 7}
}
 
summons =
{
    [1] = {"Rat"},
}
 
questAreaPosition =
{
        {x=32710, y=32346, z=7, stackpos = 255},
        {x=32722, y=32356, z=7, stackpos = 255}
}
 
demonOak = {8288, 8289, 8290, 8291}
 
storages =
{
    done = 35712,
    treeCut = 38551
}
 
blockingTree =
{
    [ITEM_DEADTREE] = {32193, 3614}
}
 
floorDamage =
{
    min = 270,
    max = 310,
    type = COMBAT_EARTHDAMAGE,
    effect = CONST_ME_BIGPLANTS
}
 
rewards =
{
    [12901] = {done = 12900, reward = 2495, count = 1},
    [12902] = {done = 12900, reward = 8905, count = 1},
    [12903] = {done = 12900, reward = 8918, count = 1},
    [12904] = {done = 12900, reward = 8851, count = 1}
}
 
sounds =
{
    [1] = --Messages shown when you wlak on special tiles
    {
        "Release me and you will be rewarded greatefully!",
        "What is this? Demon Legs lying here? Someone might have lost them!",
        "I'm trapped, come here and free me fast!!",
        "I can bring your beloved back from the dead, just release me!",
        "What a nice shiny golden armor. Come to me and you can have it!",
        "Find a way in here and release me! Pleeeease hurry!",
        "You can have my demon set, if you help me get out of here!"
    },
    [2] = --Messages shown when you use axe on Demon Oak
    {
        "MY ROOTS ARE SHARP AS A SCYTHE! FEEL IT?!?",
        "CURSE YOU!",
        "RISE, MINIONS, RISE FROM THE DEAD!!!!",
        "AHHHH! YOUR BLOOD MAKES ME STRONG!",
        "GET THE BONES, HELLHOUND! GET THEM!!",
        "GET THERE WHERE I CAN REACH YOU!!!",
        "ETERNAL PAIN AWAITS YOU! NICE REWARD, HUH?!?!",
        "YOU ARE GOING TO PAY FOR EACH HIT WITH DECADES OF TORTURE!!",
        "ARGG! TORTURE IT!! KILL IT SLOWLY MY MINION!!"
    }
}
 
function canEnter(cid, tree)
    if type(questAreaPosition) == "table" and type(questAreaPosition[1]) == "table" and type(questAreaPosition[2]) == "table" and level and type(storages) == "table" then
        if getPlayerLevel(cid) < level then
            return ERROR_NOTENOUGHLEVEL
        elseif getCreatureStorage(cid, storages.done) > 0 then
            return ERROR_ALREADYDONE
        elseif oneInArea then
        local monsters = {}
        local  from = {x=32707, y=32345, z=7}
        local to = {x=32725, y=32357, z=7}
            for z = from.z, to.z do
                for y = from.y, to.y do
                    for x = from.x, to.x do
                        local v = getTopCreature({x=x, y=y, z=z})
                        if isPlayer(v.uid) and (cid ~= v.uid) then
                        return ERROR_PLAYERINAREA
                        end
                    end
                end
            end
        end
    else
        return ERROR_MISSINGINFO
    end
    return ERROR_NOERROR
end
 
 
function getError(data, tree)
    if data == ERROR_TREEPOSITION then
        return print("[!] --> [Warning - Action::Demon Oak Script] Dead tree position is inside the quest area positions.\nDead tree position: (x: " .. tree.x .. ", y: " .. tree.y .. ", z: " .. tree.z .. ")\nNorth-West area position (x: " .. questAreaPosition[1].x .. ", y: " .. questAreaPosition[1].y .. ", z: " .. questAreaPosition[1].z .. ")\nSouth-West area position (x: " .. questAreaPosition[2].x .. ", y: " .. questAreaPosition[2].y .. ", z: " .. questAreaPosition[2].z .. ")\nScript will not work correctly, please fix it.") and "Something is wrong, please contact a staff member."
    elseif data == ERROR_NOTENOUGHLEVEL then
        return "You need level " .. level .. " or higher to enter to the quest area."
    elseif data == ERROR_ALREADYDONE then
        return "You already done this quest."
    elseif data == ERROR_ALREADYCUT then
        return "You can not leave the quest area by here."
    elseif data == ERROR_PLAYERINAREA then
        return "Wait until the player inside the quest area finishes the quest."
    elseif data == ERROR_MISSINGINFO then
        return "Sorry, not possible."
    end
    return ""
end
 
function getCreaturesInQuestArea(type, fromPos, toPos, get, countSummon)
 
    local types = 
    {
        [TYPE_PLAYER] = isPlayer,
        [TYPE_MONSTER] = isMonster,
        [TYPE_NPC] = isNpc,
        [TYPE_ALL] = isCreature
    }
 
    local tmp = {}
    local t = types[type]
    if not t then
        return print("[!] --> [Warning - Function::getCreaturesInQuestArea] Unknow type " .. (type or "(nil value)"))
    end
 
    local thing
    local pos
    for x = fromPos.x, toPos.x do
        for y = fromPos.y, toPos.y do
            for z = fromPos.z, toPos.z do
                pos = {x = x, y = y, z = z}
                thing = getTopCreature(pos)
                if t(thing.uid) then
                    table.insert(tmp, thing.uid)
                    if not countSummon and isSummon(thing.uid) then
                        for i = 1, #tmp do
                            if tmp == thing.uid then
                                table.remove(tmp, i)
                                break
                            end
                        end
                    end
                end
            end
        end
    end
    return (get == GET_COUNT and #tmp or get == GET_UID and tmp or print("[Warning - Function::getCreaturesInQuestArea] Unknow type to get " .. (get or "(nil value)")))
end
 
function monsterExists(name)
 
    local file = "data/monster/monsters.xml"
    local openFile = io.open(file, "r")
    local m_name, getName, getFile, m_file = 0, 0, 0, 0
    local monsterExists, fileExists = false, false
    if openFile ~= nil then
        for line in io.lines(file) do
            if line:find('name=".*".*') and line:find('file=".*".*') then
                getName = string.match(line, 'name=".*".*')
                getFile = string.match(line, 'file=".*".*')
                if getName and getFile then
                    m_name = string.sub(getName, string.find(getName, '="') + 2, (string.find(getName, '" ') or string.find(getName, '"f') or 1) - 1)
                    m_file = string.sub(getFile, string.find(getFile, '="') + 2, (string.find(getFile, '"/') or string.find(getFile, '" ') or 1) - 1)
                    if m_name:lower() == name:lower() then
                        monsterExists = true
                        mfile = io.open("data/monster/" .. m_file, "r")
                        if mfile ~= nil then
                            fileExists = true
                            mfile:close()
                        end
                    end
                end
            end
        end
        openFile:close()
    end
    return monsterExists and fileExists or false
end
 
function isSummon(cid)
    if DISTRO_VERSION < 040 then
        return getCreatureMaster(cid) ~= cid or false
    else
        return getCreatureMaster(cid) ~= nil or false
    end
end
 
function isLastCut(cid)
    local k, s = 0, 0
    if not demonOak or type(demonOak) ~= "table" then
        return false
    end
    for i = demonOak[1], demonOak[#demonOak] do
        if getCreatureStorage(cid, i) == #summons + 1 then
            k = k + 1
        end
        if getCreatureStorage(cid, i) == #summons then
            s = s + 1
        end
    end
    return (k == 3 and s == 1 and true or false)
end
function checkLib()
 
    local final = "[" .. os.date() .. "]\n"
    print("\n[!] -> Checking demon oak lib...")
    local start = os.clock()
    local r = 0
    if not ITEM_DEADTREE or type(ITEM_DEADTREE) ~= "number" then
        print("[!] --> [Warning - Lib::DemonOak] Cannot load dead tree id (number expected, got " .. (type(ITEM_DEADTREE) or "nil") .. ")")
        final = final .. "    [Warning - Lib::DemonOak] Cannot load dead tree id (number expected, got " .. (type(ITEM_DEADTREE) or "nil") .. ")\n"
        r = r + 1
    end
    if not HALLOWEDAXE_PRICE or type(HALLOWEDAXE_PRICE) ~= "number" then
        print("[!] --> [Warning - Lib::DemonOak] Cannot load hallowed axe price (number expected, got " .. (type(HALLOWEDAXE_PRICE) or "nil") .. ")")
        final = final .. "    [Warning - Lib::DemonOak] Cannot load hallowed axe price (number expected, got " .. (type(HALLOWEDAXE_PRICE) or "nil") .. ")\n"
        r = r + 1
    end
    if not ERROR_NOERROR or type(ERROR_NOERROR) ~= "number" or not ERROR_TREEPOSITION or type(ERROR_TREEPOSITION) ~= "number"
    or not ERROR_NOTENOUGHLEVEL or type(ERROR_NOTENOUGHLEVEL) ~= "number" or not ERROR_ALREADYDONE or type(ERROR_ALREADYDONE) ~= "number"
    or not ERROR_ALREADYCUT or type(ERROR_ALREADYCUT) ~= "number" or not ERROR_PLAYERINAREA or type(ERROR_PLAYERINAREA) ~= "number"
    or not ERROR_MISSINGINFO or type(ERROR_MISSINGINFO) ~= "number" then
        print("[!] --> [Warning - Lib::DemonOak] Cannot load variables for function 'getError'")
        final = final .. "    [Warning - Lib::DemonOak] Cannot load variables for function 'getError'\n"
        r = r + 1
    end
    if not TYPE_PLAYER or type(TYPE_PLAYER) ~= "number" or not TYPE_MONSTER or type(TYPE_MONSTER) ~= "number"
    or not TYPE_NPC or type(TYPE_NPC) ~= "number" or not TYPE_ALL or type(TYPE_ALL) ~= "number" 
    or not GET_COUNT or type(GET_COUNT) ~= "number" or not GET_UID or type(GET_UID) ~= "number" then
        print("[!] --> [Warning - Lib::DemonOak] Cannot load variables for function 'getCreaturesInQuestArea'")
        final = final .. "    [Warning - Lib::DemonOak] Cannot load variables for function 'getCreaturesInQuestArea'\n"
        r = r + 1
    end
    if not STORAGE_LIB or not isInArray({"number", "string"}, type(STORAGE_LIB)) then
        print("[!] --> [Warning - Lib::DemonOak] Cannot load storage lib, lib will be checked more than once.")
        final = final .. "    [Warning - Lib::DemonOak] Cannot storage lib, lib will be checked more than once.\n"
        r = r + 1
    end
    if type(summons) == "table" then
        for k, v in pairs(summons) do
            if v and type(v) == "table" then
                for _, s in ipairs(v) do
                    if not monsterExists(s) then
                        print("[!] --> [Warning - Lib::DemonOak] Table: summons, Id: " .. k .. ", Monster " .. s .. " does not exists. Check if it is well writen in monsters.xml and also check if the file really exists.")
                        final = final .. "    [Warning - Lib::DemonOak] Table: summons, Id: " .. k .. ", Monster " .. s .. " does not exists. Check if it is well writen in monsters.xml and also check if the file really exists.\n"
                        r = r + 1
                    end
                end
            else
                print("[!] --> [Warning - Lib::DemonOak] Table: summons, Id: " .. k .. ", cannot load summons (table expected, got " .. (type(v) or "nil") .. ")")
                final = final .. "    [Warning - Lib::DemonOak] Table: summons, Id: " .. k .. ", cannot load summons (table expected, got " .. (type(v) or "nil") .. ")\n"
                r = r + 1
            end
        end
    else
        print("[!] --> [Warning - Lib::DemonOak] Cannot load summons (table expected, got " .. (type(summons) or "nil") .. ")")
        final = final .. "    [Warning - Lib::DemonOak] Cannot load summons (table expected, got " .. (type(summons) or "nil") .. ")\n"
        r = r + 1
    end
    if type(positions) == "table" then
        if type(positions.kick) ~= "table" then
            print("[!] --> [Warning - Lib::DemonOak] Invalid position for kick (table expected, got " .. (type(positions.kick) or "nil") .. ")")
            final = final .. "    [Warning - Lib::DemonOak] Invalid position for kick (table expected, got " .. (type(positions.kick) or "nil") .. ")\n"
            r = r + 1
        elseif type(positions.rewardRoom) ~= "table" then
            print("[!] --> [Warning - Lib::DemonOak] Invalid position for reward room (table expected, got " .. (type(positions.rewardRoom) or "nil") .. ")")
            final = final .. "    [Warning - Lib::DemonOak] Invalid position for reward room (table expected, got " .. (type(positions.rewardRoom) or "nil") .. ")\n"
            r = r + 1
        elseif type(positions.demonOak) ~= "table" then
            print("[!] --> [Warning - Lib::DemonOak] Cannot load demonOak position, scripts will use player position.")
            final = final .. "    [Warning - Lib::DemonOak] Cannot load demonOak position, scripts will use player position.\n"
            r = r + 1
        end
        if type(positions.summon) == "table" then
            for i = 1, #positions.summon do
                if type(positions.summon) ~= "table" then
                    print("[!] --> [Warning - Lib::DemonOak] Invalid summon position on index " .. i .. " (table expected, got " .. (type(positions.summon) or "nil") .. ")")
                    final = final .. "    [Warning - Lib::DemonOak] Invalid summon position on index " .. i .. " (table expected, got " .. (type(positions.summon) or "nil") .. ")\n"
                    r = r + 1
                end
            end
        else
            print("[!] --> [Warning - Lib::DemonOak] Cannot load summons position (table expected, got " .. (type(positions.summon) or "nil") .. ")")
            final = final .. "    [Warning - Lib::DemonOak] Cannot load summons position (table expected, got " .. (type(positions.summon) or "nil") .. ")\n"
            r = r + 1
        end
    else
        print("[!] --> [Warning - Lib::DemonOak] Cannot load positions (table expected, got " .. (type(positions) or "nil") .. ")")
        final = final .. "    [Warning - Lib::DemonOak] Cannot load positions (table expected, got " .. (type(positions) or "nil") .. ")\n"
        r = r + 1
    end
    if not questAreaPosition or type(questAreaPosition[1]) ~= "table" or type(questAreaPosition[2]) ~= "table" then
        print("[!] --> [Warning - Lib::DemonOak] Invalid area positions!")
        final = final .. "    [Warning - Lib::DemonOak] Invalid area positions!\n"
        r = r + 1
    end
    if type(demonOak) ~= "table" then
        print("[!] --> [Warning - Lib::DemonOak] Cannot load 'demonOak' ids (table expected, got " .. (type(demonOak) or "nil") .. ")")
        final = final .. "    [Warning - Lib::DemonOak] Cannot load 'demonOak' ids (table expected, got " .. (type(demonOak) or "nil") .. ")\n"
        demonOak = {8288, 8289, 8290, 8291}
        r = r + 1
    end
    if storages and storages.done and storages.treeCut then
        if storages.done == storages.treeCut then 
            print("[!] --> [Warning - Lib::DemonOak] Storage for dead tree (" .. storages.cutTree .. ") and storage to check if demonOak is finished (" .. storages.done .. ") are the same, change it or script will not work correctly.")
            final = final .. "    [Warning - Lib::DemonOak] Storage for dead tree (" .. storages.cutTree .. ") and storage to check if demonOak is finished (" .. storages.done .. ") are the same, change it or script will not work correctly.\n"
            r = r + 1
        end
    else
        print("[!] --> [Warning - Lib::Demon Oak] Cannot load storages (table expected, got " .. (type(storages) or "nil") .. ")")
        final = final .. "    [Warning - Lib::DemonOak] Cannot load storages (table expected, got " .. (type(storages) or "nil") .. ")\n"
        r = r + 1
    end
    if type(blockingTree) == "table" then
        for k, v in pairs(blockingTree) do
            if type(v) ~= "table" then
                print("[!] --> [Warning - Lib::DemonOak] Cannot load info about dead tree id: " .. k .. " (table expected, got " .. (type(v) or "nil") .. ")")
                final = final .. "    [Warning - Lib::DemonOak] Cannot load info about dead tree id: " .. k .. " (table expected, got " .. (type(v) or "nil") .. ")\n"
                r = r + 1
            end
        end
    else
        print("[!] --> [Warning - Lib::DemonOak] Cannot load info about dead tree (table expected, got " .. (type(blockingTree) or "nil") .. ")")
        final = final .. "    [Warning - Lib::DemonOak] Cannot load info about dead tree (table expected, got " .. (type(blockingTree) or "nil") .. ")\n"
        r = r + 1
    end
    if type(rewards) == "table" then
        for k, v in pairs(rewards) do
            if type(v) ~= "table" or not v.done or not v.reward or not v.count then
                print("[!] --> [Warning - Lib::DemonOak] Cannot load reward id " .. k .. "!")
                final = final .. "    [Warning - Lib::DemonOak] Cannot load reward id " .. k .. "!\n"
                r = r + 1
            end
        end
    else
        print("[!] --> [Warning - Lib::DemonOak] Cannot load rewards (table expected, got " .. (type(rewards) or "nil") .. ")")
        final = final .. "    [Warning - Lib::DemonOak] Cannot load rewards (table expected, got " .. (type(rewards) or "nil") .. ")\n"
        r = r + 1
    end
    if type(sounds) == "table" then
        for k, v in pairs(sounds) do
            if type(v) ~= "table" then
                print("[!] --> [Warning - Lib::DemonOak] Cannot load sounds on index " .. k .. " (table expected, got " .. (type(v) or "nil") .. ")")
                final = final .. "    [Warning - Lib::DemonOak] Cannot load sounds on index " .. k .. " (table expected, got " .. (type(v) or "nil") .. ")\n"
                r = r + 1
            end
        end
    else
        print("[!] --> [Warning - Lib::DemonOak] Cannot load sounds (table expected, got " .. (type(sounds) or "nil") .. ")")
        final = final .. "    [Warning - Lib::DemonOak] Cannot load sounds (table expected, got " .. (type(sounds) or "nil") .. ")\n"
        r = r + 1
    end
 
    print("[!] ->  " .. r .. " problems loaded in " .. os.clock() - start .. " seconds.\n")
    local logFile = "data/logs/demonOak.txt"
    local f = io.open(logFile, "a+")
    if logEnabled then
        if f ~= nil then
            f:write((r > 0 and final .. "\n\n" or ""))
            f:close()
        end
    end
end
 
if getStorage(STORAGE_LIB) < 1 then
    checkLib()
    doSetStorage(STORAGE_LIB, 1)
end
 
if getStorage(0x65537) < 1 then
    print("[!] ->  Demon Oak Lib loaded in " .. os.clock() - getStorage(0x65536) .. " seconds.\n")
    doSetStorage(0x65537, 1)
end 

E o que você pediu
-- movements --

<!-- Demon Oak Quest -->
     <movevent type="StepOut" uniqueid="32193" event="script" value="doq/demonOakTree.lua" />
    <movevent type="StepIn" itemid="8292" event="script" value="doq/demonOakArea.lua" />
    <movevent type="StepIn" uniqueid="13005-13009" event="script" value="doq/demonOakSquares.lua" />
    <movevent type="StepIn" uniqueid="9191" event="script" value="doq/kickoak.lua" />
    <movevent type="StepIn" uniqueid="9494" event="script" value="doq/fleeoak.lua" />
 
demonOakTree
function onStepOut(cid, item, position, fromPosition)
 
    return doTransformItem(item.uid, ITEM_DEADTREE)
end
demonOakArea
function onStepIn(cid, item, position, fromPosition)
 
    if isPlayer(cid) and math.random(100) <= 15 then
        doTargetCombatHealth(0, cid, floorDamage.type, -floorDamage.min, -floorDamage.max, floorDamage.effect)
    end
    return true
end
demonOakSquares
function onStepIn(cid, item, position, fromPos, fromPosition)
    local storage = 100069
    if isPlayer(cid) then
    if item.uid == 13005 and getPlayerStorageValue(cid, storage) == -1 then
        setPlayerStorageValue(cid,storage, 1)
        doCreatureSay(cid, sounds[1][math.random(1, #sounds[1])], TALKTYPE_MONSTER_YELL, false, cid, (positions.demonOak or getCreaturePosition(cid)))
    elseif item.uid == 13006 and getPlayerStorageValue(cid, storage) == 1 then
        setPlayerStorageValue(cid,storage, 2)
        doCreatureSay(cid, sounds[1][math.random(1, #sounds[1])], TALKTYPE_MONSTER_YELL, false, cid, (positions.demonOak or getCreaturePosition(cid)))
    elseif item.uid == 13007  and getPlayerStorageValue(cid, storage) == 2 then
        setPlayerStorageValue(cid,storage, 3)
        doCreatureSay(cid, sounds[1][math.random(1, #sounds[1])], TALKTYPE_MONSTER_YELL, false, cid, (positions.demonOak or getCreaturePosition(cid)))
    elseif item.uid == 13008  and getPlayerStorageValue(cid, storage) == 3 then
        setPlayerStorageValue(cid,storage, 4) 
        doCreatureSay(cid, sounds[1][math.random(1, #sounds[1])], TALKTYPE_MONSTER_YELL, false, cid, (positions.demonOak or getCreaturePosition(cid)))
    elseif item.uid == 13009 and getPlayerStorageValue(cid, storage) == 4 then
        setPlayerStorageValue(cid,storage, 5) 
        doCreatureSay(cid, sounds[1][math.random(1, #sounds[1])], TALKTYPE_MONSTER_YELL, false, cid, (positions.demonOak or getCreaturePosition(cid)))
        end
    end
    return true
end
kickoak
function onStepIn(cid, item, position, fromPosition)
    local newPosition = {x=32716, y=32347, z=7}
    local noPosition = {x=32716, y=32340, z=7}
    local tree = getThingPos(cid)
    if isPlayer(cid) then
    if getPlayerStorageValue(cid, 100069) == 5 and getPlayerStorageValue(cid, 100070) == -1  then
        if getPlayerLevel(cid) < 120 then
           doCreatureSay(cid, "LEAVE LITTLE FISH, YOU ARE NOT WORTH IT!", TALKTYPE_MONSTER_YELL, false, cid, (positions.demonOak or getCreaturePosition(cid)))
           doTeleportThing(cid, noPosition, TRUE)
           doSendMagicEffect(noPosition, CONST_ME_TELEPORT)
           return true
            end
            if canEnter(cid, tree) ~= ERROR_NOERROR then
                doPlayerSendCancel(cid, getError(canEnter(cid, tree), tree))
                doSendMagicEffect(tree, CONST_ME_TELEPORT) 
                doTeleportThing(cid, noPosition, TRUE)
                return true
            end
            if getPlayerStorageValue(cid, 100072) == -1 then
                setPlayerStorageValue(cid, 100072, 1)
            end    
            doTeleportThing(cid, newPosition, TRUE)
            doSendMagicEffect(fromPosition, CONST_ME_BIGPLANTS)
            doSendMagicEffect(newPosition, CONST_ME_TELEPORT)
                doCreatureSetStorage(cid, 100065, 1)
                doCreatureSetStorage(cid, 100066, 1)
                    doCreatureSetStorage(cid, 100067, 1)
                   doCreatureSetStorage(cid, 100068, 1)
            doCreatureSetStorage(cid, 100071, 0)
            doCreatureSetStorage(cid, 100076, 1)
            doCreatureSay(cid, "I AWAITED YOU! COME HERE AND GET YOUR REWARD!", TALKTYPE_MONSTER_YELL, false, cid, (positions.demonOak or getCreaturePosition(cid)))
        else
            doTeleportThing(cid, noPosition, TRUE)
            doSendMagicEffect(noPosition, CONST_ME_TELEPORT)
            end
        end
    return true
end
fleeoak
function onStepIn(cid, item, position, fromPosition)
    local fleePosition = {x=32716, y=32340, z=7}

    if isPlayer(cid) and getPlayerStorageValue(cid, 100070) == 1 then 
        doTeleportThing(cid, fleePosition, TRUE)
        doSendMagicEffect(fleePosition, CONST_ME_TELEPORT) 
    return true
    end
    if isPlayer(cid) then
        doTeleportThing(cid, fleePosition, TRUE)
        doSendMagicEffect(fleePosition, CONST_ME_TELEPORT)
        doCreatureSetStorage(cid, 100065, 1)
        doCreatureSetStorage(cid, 100066, 1)
        doCreatureSetStorage(cid, 100067, 1)
        doCreatureSetStorage(cid, 100068, 1)
        doCreatureSetStorage(cid, 100071, 0)
        checkAreaM(cid, {x=32707,y=32345,z=7},{x=32725,y=32357,z=7})
    end
    return true
end
 
Postei a pasta movements da oak toda caso alguém esteja com problema nessa parte e acabe vendo esse topico
    
Sim modifiquei os 6666 demons para 10 e olhei varias vezes pra ter certeza que não fiz nada de errado quando modifiquei
 
Editado por compp (veja o histórico de edições)

Rosario__Vampire_Cast400x226.jpg

                   rosario_vampire_girl_bat_moon_25562_2560

Link para o post
Compartilhar em outros sites

A task do Demons contava antes de eu alterar? E o Oldrak funcionava? Só pra mim limitar aonde ta o erro, pois são muitos scripts.

Life is so meaningless, there is nothing worth a smile
So goodbye, I'll miss you

 

 

sugestões?

 

 

Link para o post
Compartilhar em outros sites
Sim antes dava pra terminar a task dos demons
E o oldrak so ficava pedindo para dar a volta na oak

Acredito que pra fazer a oak gritar ao dar a volta nela e o oldrak encantar o axe seria muito trabalhoso por isso queria que ele encanta-se o axe com holy icon sem dar a volta na quest
Editado por compp (veja o histórico de edições)

Rosario__Vampire_Cast400x226.jpg

                   rosario_vampire_girl_bat_moon_25562_2560

Link para o post
Compartilhar em outros sites

O Oldrak pede pra dar a volta toda vez que o axe tem que ser encantado? Não é mais fácil só aumentar a duração do axe?

Life is so meaningless, there is nothing worth a smile
So goodbye, I'll miss you

 

 

sugestões?

 

 

Link para o post
Compartilhar em outros sites

O Oldrak pede pra dar a volta toda vez que o axe tem que ser encantado? Não é mais fácil só aumentar a duração do axe?

O axe não acaba nunca!

é que ele pede pra dar a volta na oak pra encantar o axe porem essa parte não funciona direito
E eu queria que o npc de task entrega-se holy icon igual global pra encantar o axe com o oldrak
mais sem que o player de a volta na demon oak pra conseguir encantar o axe!
caso não sejá muito trabalho pra você e você consiga fazer o oldrak encantar o axe com o holy icon e dando a volta na oak te agradeço muito

Rosario__Vampire_Cast400x226.jpg

                   rosario_vampire_girl_bat_moon_25562_2560

Link para o post
Compartilhar em outros sites

oldrak

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
 
local Topic = {}
local storage = 100077
 
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

keywordHandler:addKeyword({'job'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I guard this humble temple as a monument for the order of the nightmare knights."})
keywordHandler:addKeyword({'name'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "My name is Oldrak."})
keywordHandler:addKeyword({'monster'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "These plains are not safe for ordinary travellers. It will take heroes to survive here."})
keywordHandler:addKeyword({'help'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can't help you, sorry!"})
keywordHandler:addKeyword({'goshnar'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "The greatest necromant who ever cursed our land with the steps of his feet. He was defeated by the nightmare knights."})
keywordHandler:addKeyword({'nightmare'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "This ancient order was created by a circle of wise humans who were called 'the dreamers'. The order became extinct a long time ago."})
keywordHandler:addKeyword({'extinct'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Many perished in their battles against evil, some went mad, not able to stand their nightmares any longer. Others were seduced by the darkness."})
keywordHandler:addKeyword({'dreamers'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "They learned the ancient art of dreamwalking from some elves they befriended."})
keywordHandler:addKeyword({'dreamwalking'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "While the dreamwalkers of the elves experienenced the brightest dreams of pleasure, the humans strangely had dreams of dark omen."})
keywordHandler:addKeyword({'omen'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "They dreamed of doom, destruction, talked to dead, tormented souls, and gained unwanted insight into the schemes of darkness."})
keywordHandler:addKeyword({'schemes'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "They figured out how to interpret their dark dreams and so could foresee the plans of the dark gods and their minions."})
keywordHandler:addKeyword({'plan'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Using this knowledge they formed an order to thwart these plans, and because they battled their nightmares as brave as knights, they named their order accordingly."})
keywordHandler:addKeyword({'necromant'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "It is rumoured to open the entrance to the pits of inferno, also called the nightmare pits. Even if I knew about this secret I wouldn't tell you."})
keywordHandler:addKeyword({'havok'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Before the battles raged across them, they were called the fair plains."})
keywordHandler:addKeyword({'tibia'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "That's where we are. The world of Tibia."})
keywordHandler:addKeyword({'god'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "They created Tibia and all life on it ... and unlife, too."})
keywordHandler:addKeyword({'unlife'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Beware the foul undead!"})
keywordHandler:addKeyword({'undead'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Beware the foul undead!"})
keywordHandler:addKeyword({'excalibug'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "A weapon of myth and legend. It was lost in ancient times ... perhaps lost forever."})
keywordHandler:addKeyword({'hugo'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Ah, the bane of the Plains of Havoc, the hidden beast, the unbeatable foe. I live here for years and I am sure it's only a myth."})
keywordHandler:addKeyword({'yenny'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Yenny, known as the Gentle, was one of most powerfull magicwielders in ancient times and known throughout the world for her mercy and kindness."})
keywordHandler:addKeyword({'offer'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can offer you the holy tible for a small fee."})
keywordHandler:addKeyword({'trade'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can offer you the holy tible for a small fee."})
keywordHandler:addKeyword({'sell'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can offer you the holy tible for a small fee."})
keywordHandler:addKeyword({'buy'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can offer you the holy tible for a small fee."})
keywordHandler:addKeyword({'have'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can offer you the holy tible for a small fee."})
keywordHandler:addKeyword({'have'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can offer you the holy tible for a small fee."})
keywordHandler:addKeyword({'time'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Now, it is "..getWorldTime().."."})
 
function greetCallback(cid)
    Topic[cid] = 0
    return true
end
 
function creatureSayCallback(cid, type, msg)
   local v = getPlayerStorageValue(cid, storage)
   if not npcHandler:isFocused(cid) then return false end
    if msgcontains(msg, 'no') and Topic[cid] == 1 then
        npcHandler:say("What a pity! Let me know when you managed to get in there. Maybe I can help you when we know what we are dealing with.",cid)
        Topic[cid] = 0
    elseif msgcontains(msg, 'no') and Topic[cid] == 2 then
        npcHandler:say("Not then.",cid)
        Topic[cid] = 0
    end 
    if  (msgcontains(msg, 'mission') or msgcontains(msg, 'demon oak')) and getPlayerStorageValue(cid, 41300) == 1 then
        npcHandler:say("How do you know? Did you go into the infested area?", cid)
        Topic[cid] = 1
    elseif Topic[cid] == 1 then
        if msgcontains(msg, 'yes') then
        if getPlayerStorageValue(cid, 41300) == 1 then
           npcHandler:say("A demon oak?!? <mumbles some blessings> May the gods be on our side. You'll need a {hallowed axe} to harm that tree. Bring me a simple {axe} and I'll prepare it for you.",cid)
           setPlayerStorageValue(cid, storage, 1)
           setPlayerStorageValue(cid, 100072, 2)
           setPlayerStorageValue(cid, 100076, 2) 
       else
           npcHandler:say("I don't believe a word of it! How rude to lie to a monk!",cid)
           end
           Topic[cid] = 0
        end
    elseif msgcontains(msg, 'axe') or msgcontains(msg, 'hallowed axe') then
        if v == 1 then
        if getPlayerItemCount(cid,2386) >= 1 then  
           npcHandler:say("Ahh, you've got an axe. Very good. I can make a hallowed axe out of it. It will cost you... er... a donation of 1,000 gold. Alright?",cid)
           Topic[cid] = 2
        else
           npcHandler:say("There is no axe with you.",cid)
       end 
	   end
	   
    end
    elseif (msgcontains(msg, 'mission') or msgcontains(msg, 'demon oak')) then
        if (v == 1 or v == 2) then
        if getPlayerStorageValue(cid,100070) == 1 then
            npcHandler:say("You chopped down the demon oak?!? Unbelievable!! Let's hope it doesn't come back. As long as evil is still existent in the soil of the plains, it won't be over. Still, the demons suffered a setback, that's for sure. ...",cid)
            npcHandler:say("For your brave action, I tell you a secret which has been kept for many many years. There is an old house south of the location where you found the demon oak. There should be a grave with the name 'Yesim Adeit' somewhere close by. ...",cid, 4000)
            npcHandler:say("It belongs to a Daramian nobleman named 'Teme Saiyid'. I knew him well and he told me -almost augured- that someone will come who is worthy to obtain his treasure. I'm sure this 'someone' is you. Good luck in finding it!",cid, 8000)
            setPlayerStorageValue(cid,100070, 2)
            setPlayerStorageValue(cid,storage, 3)
        setPlayerStorageValue(cid, 100072, 4)
        else
            npcHandler:say("You better don't return here until you've finished your {mission}.", cid)
        end
        elseif v == 3 and getPlayerStorageValue(cid,100070) == 2  then
           npcHandler:say("I'm really thankful for your help and so should be every citizen of Tibia.",cid)
        end
    elseif Topic[cid] == 2 then
    if msgcontains(msg, 'yes') then
    if getPlayerItemCount(cid,2386) >= 1 then
    if doPlayerRemoveMoney(cid,1000) then
            npcHandler:say("Let's see....<mumbles a prayer>....here we go. The blessing on this axe will be absorbed by all the demonic energy around here. I presume it will not last very long, so better hurry. Actually, I can refresh the blessing as often as you like.",cid)
        doPlayerAddItem(cid,8293,1)
        doPlayerRemoveItem(cid, 2386, 1)
    else
        npcHandler:say("It costs 1000 gold coins.",cid)
        end
        else
            npcHandler:say("There is no axe with you.",cid)
            end
        end
        Topic[cid] = 0
        end
    return true
end
 
npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

script do grizzly
 
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
 
local choose = {}
local cancel = {}
local available = {}

local grizzlyAdamsConfig = {
                            ranks = {
                                    huntsMan_rank = {
                                                    {id=11208, buy=0, sell=50, name='antlers'},
                                                    {id=10549, buy=0, sell=100, name='bloody pincers'},
                                                    {id=11183, buy=0, sell=35, name='crab pincers'},
                                                    {id=10573, buy=0, sell=55, name='cyclops toe'},
                                                    {id=10564, buy=0, sell=30, name='frosty ear of a troll'},
                                                    {id=11193, buy=0, sell=600, name='hydra head'},
                                                    {id=11366, buy=0, sell=80, name='lancer beetle shell'},
                                                    {id=10578, buy=0, sell=420, name='mutated bat ear'},
                                                    {id=11222, buy=0, sell=400, name='sabretooth'},
                                                    {id=11367, buy=0, sell=20, name='sandcrawler shell'},
                                                    {id=10547, buy=0, sell=280, name='scarab pincers'},
                                                    {id=11365, buy=0, sell=60, name='terramite legs'},
                                                    {id=11363, buy=0, sell=170, name='terramite shell'},
                                                    {id=11184, buy=0, sell=30000, name='terrorbird beak'},
                                                    
                                                    {id=7398, buy=0, sell=500, name='cyclops trophy'},
                                                    {id=11315, buy=0, sell=15000, name='draken trophy'},
                                                    {id=11330, buy=0, sell=8000, name='lizard trophy'},
                                                    {id=7401, buy=0, sell=500, name='minotaur trophy'}
                                                    },

                                    bigGameHunter_rank = {
                                                    {id=7397, buy=0, sell=3000, name='deer trophy'},
                                                    {id=7400, buy=0, sell=3000, name='lion trophy'},
                                                    {id=7394, buy=0, sell=3000, name='wolf trophy'}
                                                    },

                                    trophyHunter_rank = {
                                                    {id=7393, buy=0, sell=40000, name='demon trophy'},
                                                    {id=7396, buy=0, sell=20000, name='behemoth trophy'},
                                                    {id=7399, buy=0, sell=10000, name='dragon lord trophy'},
                                                    
                                                    {id=10518, buy=1000, sell=0, name='demon backpack'},
                                                    },
                                    }
                            }

local Topic = {}
function greetCallback(cid)
    Topic[cid] = 0
    return true
end

local function setNewTradeTable(table)
local items = {}
for _, v in ipairs(table) do
    items[v.id] = {itemId = v.id, buyPrice = v.buy, sellPrice = v.sell, subType = 0, realName = v.name}
end
return items
end

local function setNewLineTable(oldTable, newTable)
for k, v in pairs(oldTable) do
    table.insert(newTable, k, v)
end
return true
end

function creatureSayCallback(cid, type, msg)
    local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_PRIVATE and 0 or cid
if (msgcontains(msg, "hi") or msgcontains(msg, "hello")) and (not npcHandler:isFocused(cid)) then
if (getPlayerStorageValue(cid, 100157) == -1) then
        npcHandler:say("Welcome "..getCreatureName(cid)..". Would you like to join the 'Paw and Fur - Hunting Elite'?", cid)
		if getPlayerStorageValue(cid, 41300) == 1 and getPlayerStorageValue(cid, 42296) ~= 1 then
        npcHandler:say("You got a holy icon for completing demons task.", cid)
		setPlayerStorageValue(cid, 42296, 1)
        end
	
        npcHandler:addFocus(cid)		
        talkState[talkUser] = 5
  else
        npcHandler:say("Welcome back old chap. What brings you here this time?", cid)
        npcHandler:addFocus(cid)
        talkState[talkUser] = 0
        end
        return true
    end
 
 
 
    if(not npcHandler:isFocused(cid)) then
        return false
    end
    
    if msgcontains(msg, "bye") or msgcontains(msg, "farewell") then
        selfSay("Happy hunting, old chap!", cid, TRUE)
        Topic[talkUser] = 0
        npcHandler:releaseFocus(cid)
        npcHandler:resetNpc(cid)
    end
    
    if (isInArray({"yes", "join"}, msg:lower()) and talkState[talkUser] == 5) then 
        setPlayerStorageValue(cid, 100157, 1)
        npcHandler:say("Great! A warm welcome to our newest member: "..getCreatureName(cid).."! Ask me for a {task} if you want to go on a hunt.", cid)
        talkState[talkUser] = 0
   elseif (msg:lower() == "no" and talkState[talkUser] == 5) then
        npcHandler:say("No problem old chap. Come back if you change your mind.", cid)  
   end

if (getPlayerStorageValue(cid, 100157) == -1) then
    npcHandler:say("You'll have to {join} us to get more information.",cid)
    return false
end
if isInArray({"offer", "trade"}, msg:lower()) then
if getPlayerRank(cid) >= 2 then 
        if getPlayerRank(cid) == 2 or getPlayerRank(cid) == 3 then
            tradeRank = grizzlyAdamsConfig.ranks.huntsMan_rank
        elseif getPlayerRank(cid) == 4 then
            tradeRank = grizzlyAdamsConfig.ranks.bigGameHunter_rank
            setNewLineTable(grizzlyAdamsConfig.ranks.huntsMan_rank, grizzlyAdamsConfig.ranks.bigGameHunter_rank)
        elseif getPlayerRank(cid) == 5 or getPlayerRank(cid) == 6 then
            tradeRank = grizzlyAdamsConfig.ranks.trophyHunter_rank
            setNewLineTable(grizzlyAdamsConfig.ranks.huntsMan_rank, grizzlyAdamsConfig.ranks.bigGameHunter_rank)
            setNewLineTable(grizzlyAdamsConfig.ranks.huntsMan_rank, grizzlyAdamsConfig.ranks.trophyHunter_rank)
        end
        local items = setNewTradeTable(tradeRank)
            local function onBuy(cid, item, subType, amount, ignoreCap, inBackpacks)
            if ignoreCap == false and (getPlayerFreeCap(cid) < getItemWeightById(items[item].itemId, amount) or inBackpacks and getPlayerFreeCap(cid) < (getItemWeightById(items[item].itemId, amount) + getItemWeightById(1988, 1))) then
                return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You don\'t have enough cap.')
            end
            if items[item].buyPrice then
                doPlayerRemoveMoney(cid, amount * items[item].buyPrice)
                for i = 1, amount do
                    if inBackpacks then
                        local backpack = doCreateItemEx(1988, 1)
                        doAddContainerItem(backpack, items[item].itemId, amount)
                    else
                        doPlayerAddItem(cid, items[item].itemId, amount, true)
                    end
                end
                return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You bought '..amount..'x '..items[item].realName..' for '..items[item].buyPrice * amount..' gold coins.')
            end
            return true
            end
             
            local function onSell(cid, item, subType, amount, ignoreCap, inBackpacks)
            if items[item].sellPrice then
                doPlayerAddMoney(cid, items[item].sellPrice * amount)
                doPlayerRemoveItem(cid, items[item].itemId, amount)
                return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You sold '..amount..'x '..items[item].realName..' for '..items[item].sellPrice * amount..' gold coins.')
            end
            return true
            end
        openShopWindow(cid, tradeRank, onBuy, onSell)
        return selfSay('It\'s my offer.', cid)
    else
        return selfSay('You don\'t have any rank.', cid)
        end
end
 
    if isInArray({"tasks", "task", "mission"}, msg:lower()) then
        local can = getTasksByPlayer(cid)
        if (getPlayerStorageValue(cid, 100157) == -1) then
             return (npcHandler:say("You'll have to {join}, to get any {tasks}.",cid))
        end
        if #can > 0 then
            local text = ""
            local sep = ", "
            table.sort(can, (function(a, b) return (a < b) end))
            local t = 0
            for _, id in ipairs(can) do
                t = t + 1
                if t == #can - 1 then
                    sep = " and "
                elseif t == #can then
                    sep = "."
                end
                text = text .. "{" .. (tasks[id].name or tasks[id].raceName) .. "}" .. sep
            end
            selfSay("The current task" .. (#can > 1 and "s" or "") .. " that you can choose " .. (#can > 1 and "are" or "is") .. " " .. text, cid)
            talkState[talkUser] = 0
        else
            selfSay("I don't have any task for you right now.", cid)
        end
    elseif msg ~= "" and canStartTask(cid, msg) then
        if #getPlayerStartedTasks(cid) >= tasksByPlayer then
            selfSay("Sorry, but you already started " .. tasksByPlayer .. " tasks. You can check their {status} or {cancel} a task.", cid)
            return true
        end
        local task = getTaskByName(msg)
        if task and getCreatureStorage(cid, QUESTSTORAGE_BASE + task) > 0 then  
            return false
        end
        selfSay("In this task you must defeat " .. tasks[task].killsRequired .. " " .. tasks[task].raceName .. ". Are you sure that you want to start this task?", cid)
        choose[cid] = task
        talkState[talkUser] = 1
    elseif msg:lower() == "yes" and talkState[talkUser] == 1 then
        doCreatureSetStorage(cid, QUESTSTORAGE_BASE + choose[cid], 1)
        selfSay("Excellent! You can check the {status} of your task saying {report} to me. Also you can {cancel} tasks to.", cid)
        choose[cid] = nil
        talkState[talkUser] = 0    
    elseif (msg:lower() == "report" or msg:lower() == "status") then
        local started = getPlayerStartedTasks(cid)
        local finishedAtLeastOne = false
        local finished = 0
        if started and #started > 0 then
            for _, id in ipairs(started) do
                if getCreatureStorage(cid, KILLSSTORAGE_BASE + id) >= tasks[id].killsRequired then
                    for _, reward in ipairs(tasks[id].rewards) do
                        local deny = false
                        if reward.storage then
                            if getCreatureStorage(cid, reward.storage[1]) >= reward.storage[2] then
                                deny = true
                            end
                        end
                        if isInArray({REWARD_MONEY, "money"}, reward.type:lower()) and not deny then
                            doPlayerAddMoney(cid, reward.value[1])
                        elseif isInArray({REWARD_EXP, "exp", "experience"}, reward.type:lower()) and not deny then
                            doPlayerAddExperience(cid, reward.value[1])
                            doPlayerSendDefaultCancel(cid, "You gained " .. reward.value[1] .. " experience points.")
                        elseif isInArray({REWARD_ACHIEVEMENT, "achievement", "ach"}, reward.type:lower()) and not deny then
                            if doPlayerAddAchievement then
                                doPlayerAddAchievement(cid, reward.value[1], true)
                            end
                        elseif isInArray({REWARD_STORAGE, "storage", "stor"}, reward.type:lower()) and not deny then
                            doCreatureSetStorage(cid, reward.value[1], reward.value[2])
                        elseif isInArray({REWARD_POINT, "points", "point"}, reward.type:lower()) and not deny then
                            doCreatureSetStorage(cid, POINTSSTORAGE, getCreatureStorage(cid, POINTSSTORAGE) + reward.value[1])
                        elseif isInArray({REWARD_ITEM, "item", "items", "object"}, reward.type:lower()) and not deny then
                            doPlayerAddItem(cid, reward.value[1], reward.value[2])
                        end
 
                        if reward.storage then
                            doCreatureSetStorage(cid, reward.storage[1], reward.storage[2])
                        end
                    end
 
                    if tasks[id].norepeatable then
                        doCreatureSetStorage(cid, QUESTSTORAGE_BASE + id, 2)
                    else
                        doCreatureSetStorage(cid, QUESTSTORAGE_BASE + id, 0)
                    end
                    doCreatureSetStorage(cid, KILLSSTORAGE_BASE + id, 0)
                    if getCreatureStorage(cid, REPEATSTORAGE_BASE + id) < 1 then
                        doCreatureSetStorage(cid, REPEATSTORAGE_BASE + id, 0)
                    end
                    doCreatureSetStorage(cid, REPEATSTORAGE_BASE + id, getCreatureStorage(cid, REPEATSTORAGE_BASE + id) + 1)
                    finishedAtLeastOne = true
                    finished = finished + 1
                end
            end
 
            if not finishedAtLeastOne then
         local started = getPlayerStartedTasks(cid)
        if started and #started > 0 then
            local text = ""
            local sep = ", "
            table.sort(started, (function(a, b) return (a < b) end))
            local t = 0
            for _, id in ipairs(started) do
                t = t + 1
                if t == #started - 1 then
                    sep = " and "
                elseif t == #started then
                    sep = "."
                end
                text = text .. "{" .. (tasks[id].name or tasks[id].raceName) .. "}" .. sep
            end
                selfSay("The current task" .. (#started > 1 and "s" or "") .. " that you started " .. (#started > 1 and "are" or "is") .. " " .. text, cid)
                Topic[cid] = 1
            else
                selfSay("Awesome! you finished " .. (finished > 1 and "various" or "a") .. " task" .. (finished > 1 and "s" or "") .. ". Talk to me again if you want to start a {task}.", cid)
            end
        else
            selfSay("You haven't started any task yet.", cid)
        end
        end
    elseif msg:lower() == "started" then
        local started = getPlayerStartedTasks(cid)
        if started and #started > 0 then
            local text = ""
            local sep = ", "
            table.sort(started, (function(a, b) return (a < b) end))
            local t = 0
            for _, id in ipairs(started) do
                t = t + 1
                if t == #started - 1 then
                    sep = " and "
                elseif t == #started then
                    sep = "."
                end
                text = text .. "{" .. (tasks[id].name or tasks[id].raceName) .. "}" .. sep
            end
 
            selfSay("The current task" .. (#started > 1 and "s" or "") .. " that you started " .. (#started > 1 and "are" or "is") .. " " .. text, cid)
        else
            selfSay("You haven't started any task yet.", cid)
        end
    elseif msg:lower() == "cancel" then
        local started = getPlayerStartedTasks(cid)
        local task = getTaskByName(msg)
        local text = ""
            local sep = ", "
            table.sort(started, (function(a, b) return (a < b) end))
            local t = 0
            for _, id in ipairs(started) do
                t = t + 1
                if t == #started - 1 then
                    sep = " or "
                elseif t == #started then
                    sep = "?"
                end
                text = text .. "{" .. (tasks[id].name or tasks[id].raceName) .. "}" .. sep
            end
        if started and #started > 0 then
            selfSay("Cancelling a task will make the counter restart. Which of these tasks you want cancel?" .. (#started > 1 and "" or "") .. " " .. text, cid)
            talkState[talkUser] = 2
        else
            selfSay("You haven't started any task yet.", cid)
        end
    elseif getTaskByName(msg) and talkState[talkUser] == 2 and isInArray(getPlayerStartedTasks(cid), getTaskByName(msg)) then
        local task = getTaskByName(msg)
        if getCreatureStorage(cid, KILLSSTORAGE_BASE + task) > 0 then
            selfSay("You currently killed " .. getCreatureStorage(cid, KILLSSTORAGE_BASE + task) .. "/" .. tasks[task].killsRequired .. " " .. tasks[task].raceName .. ". Cancelling this task will restart the count. Are you sure you want to cancel this task?", cid)
        else
            selfSay("Are you sure you want to cancel this task?", cid)
        end
        talkState[talkUser] = 3
        cancel[cid] = task
    elseif getTaskByName(msg) and Topic[cid] == 1 and isInArray(getPlayerStartedTasks(cid), getTaskByName(msg)) then
        local task = getTaskByName(msg)
        if getCreatureStorage(cid, KILLSSTORAGE_BASE + task) > 0 then
            selfSay("You currently killed " .. getCreatureStorage(cid, KILLSSTORAGE_BASE + task) .. "/" .. tasks[task].killsRequired .. " " .. tasks[task].raceName .. ".", cid)
            Topic[cid] = 0
        else
            selfSay("You haven't started any task yet.", cid)
        end
    elseif msg:lower() == "yes" and talkState[talkUser] == 3 then
        doCreatureSetStorage(cid, QUESTSTORAGE_BASE + cancel[cid], -1)
        doCreatureSetStorage(cid, KILLSSTORAGE_BASE + cancel[cid], -1)
        selfSay("You have cancelled the task " .. (tasks[cancel[cid]].name or tasks[cancel[cid]].raceName) .. ".", cid)
        talkState[talkUser] = 0
    elseif isInArray({"points", "rank"}, msg:lower()) then
        if getCreatureStorage(cid, POINTSSTORAGE) < 1 then
        selfSay("At this time, you have 0 Paw & Fur points. You " .. (getPlayerRank(cid) == 6 and "are an Elite Hunter" or getPlayerRank(cid) == 5 and "are a Trophy Hunter" or getPlayerRank(cid) == 4 and "are a Big Game Hunter" or getPlayerRank(cid) == 3 and "are a Ranger" or getPlayerRank(cid) == 2 and "are a Huntsman" or getPlayerRank(cid) == 1 and "are a Member"  or "haven't been ranked yet") .. ".", cid)
        elseif getCreatureStorage(cid, POINTSSTORAGE) >= 1 then 
        selfSay("At this time, you have " .. getCreatureStorage(cid, POINTSSTORAGE) .. " Paw & Fur points. You " .. (getPlayerRank(cid) == 6 and "are an Elite Hunter" or getPlayerRank(cid) == 5 and "are a Trophy Hunter" or getPlayerRank(cid) == 4 and "are a Big Game Hunter" or getPlayerRank(cid) == 3 and "are a Ranger" or getPlayerRank(cid) == 2 and "are a Huntsman" or getPlayerRank(cid) == 1 and "are a Member"  or "haven't been ranked yet") .. ".", cid)
        end
        talkState[talkUser] = 0
    end
end
 
npcHandler:setMessage(MESSAGE_FAREWELL, "Happy hunting, old chap!")
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

 

Life is so meaningless, there is nothing worth a smile
So goodbye, I'll miss you

 

 

sugestões?

 

 

Link para o post
Compartilhar em outros sites

Aew rogaroryn2 sou muito grato a você por todo esse empenho em me ajudar!
não sei como você meche com essas coisas tão rapido assim fiquei 3h aqui mechendo nesses arquivos
que você me passou ate conseguir o que eu realmente queria!
Estou te dando Rep+ por sua colaboração irie colocar as modificações logo a baixo!

scripts
Oldrak

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
 
local Topic = {}
local storage = 100077
 
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

keywordHandler:addKeyword({'job'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I guard this humble temple as a monument for the order of the nightmare knights."})
keywordHandler:addKeyword({'name'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "My name is Oldrak."})
keywordHandler:addKeyword({'monster'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "These plains are not safe for ordinary travellers. It will take heroes to survive here."})
keywordHandler:addKeyword({'help'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can't help you, sorry!"})
keywordHandler:addKeyword({'goshnar'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "The greatest necromant who ever cursed our land with the steps of his feet. He was defeated by the nightmare knights."})
keywordHandler:addKeyword({'nightmare'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "This ancient order was created by a circle of wise humans who were called 'the dreamers'. The order became extinct a long time ago."})
keywordHandler:addKeyword({'extinct'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Many perished in their battles against evil, some went mad, not able to stand their nightmares any longer. Others were seduced by the darkness."})
keywordHandler:addKeyword({'dreamers'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "They learned the ancient art of dreamwalking from some elves they befriended."})
keywordHandler:addKeyword({'dreamwalking'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "While the dreamwalkers of the elves experienenced the brightest dreams of pleasure, the humans strangely had dreams of dark omen."})
keywordHandler:addKeyword({'omen'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "They dreamed of doom, destruction, talked to dead, tormented souls, and gained unwanted insight into the schemes of darkness."})
keywordHandler:addKeyword({'schemes'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "They figured out how to interpret their dark dreams and so could foresee the plans of the dark gods and their minions."})
keywordHandler:addKeyword({'plan'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Using this knowledge they formed an order to thwart these plans, and because they battled their nightmares as brave as knights, they named their order accordingly."})
keywordHandler:addKeyword({'necromant'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "It is rumoured to open the entrance to the pits of inferno, also called the nightmare pits. Even if I knew about this secret I wouldn't tell you."})
keywordHandler:addKeyword({'havok'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Before the battles raged across them, they were called the fair plains."})
keywordHandler:addKeyword({'tibia'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "That's where we are. The world of Tibia."})
keywordHandler:addKeyword({'god'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "They created Tibia and all life on it ... and unlife, too."})
keywordHandler:addKeyword({'unlife'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Beware the foul undead!"})
keywordHandler:addKeyword({'undead'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Beware the foul undead!"})
keywordHandler:addKeyword({'excalibug'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "A weapon of myth and legend. It was lost in ancient times ... perhaps lost forever."})
keywordHandler:addKeyword({'hugo'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Ah, the bane of the Plains of Havoc, the hidden beast, the unbeatable foe. I live here for years and I am sure it's only a myth."})
keywordHandler:addKeyword({'yenny'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Yenny, known as the Gentle, was one of most powerfull magicwielders in ancient times and known throughout the world for her mercy and kindness."})
keywordHandler:addKeyword({'offer'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can offer you the holy tible for a small fee."})
keywordHandler:addKeyword({'trade'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can offer you the holy tible for a small fee."})
keywordHandler:addKeyword({'sell'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can offer you the holy tible for a small fee."})
keywordHandler:addKeyword({'buy'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can offer you the holy tible for a small fee."})
keywordHandler:addKeyword({'have'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can offer you the holy tible for a small fee."})
keywordHandler:addKeyword({'have'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can offer you the holy tible for a small fee."})
keywordHandler:addKeyword({'time'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Now, it is "..getWorldTime().."."})
 
function greetCallback(cid)
    Topic[cid] = 0
    return true
end
 
function creatureSayCallback(cid, type, msg)
   local v = getPlayerStorageValue(cid, storage)
   if not npcHandler:isFocused(cid) then return false end
    if msgcontains(msg, 'no') and Topic[cid] == 1 then
        npcHandler:say("What a pity! Let me know when you managed to get in there. Maybe I can help you when we know what we are dealing with.",cid)
        Topic[cid] = 0
    elseif msgcontains(msg, 'no') and Topic[cid] == 2 then
        npcHandler:say("Not then.",cid)
        Topic[cid] = 0
    end 
    if  (msgcontains(msg, 'mission') or msgcontains(msg, 'demon oak')) and getPlayerStorageValue(cid, storage) == -1 then
        npcHandler:say("How do you know? Did you go into the infested area?", cid)
        Topic[cid] = 1
    elseif Topic[cid] == 1 then
        if msgcontains(msg, 'yes') then
        if getPlayerStorageValue(cid, 41300) == 1 and getPlayerStorageValue(cid, storage) == -1 then
           npcHandler:say("A demon oak?!? <mumbles some blessings> May the gods be on our side. You'll need a {hallowed axe} to harm that tree. Bring me a simple {axe} and I'll prepare it for you.",cid)
           setPlayerStorageValue(cid, storage, 1)
           setPlayerStorageValue(cid, 100072, 2)
           setPlayerStorageValue(cid, 41300, 2) 
       else
           npcHandler:say("I don't believe a word of it! How rude to lie to a monk!",cid)
           end
           Topic[cid] = 0
        end
    elseif msgcontains(msg, 'axe') or msgcontains(msg, 'hallowed axe') then
        if v == 1 then
        if getPlayerItemCount(cid,2386) >= 1 then  
           npcHandler:say("Ahh, you've got an axe. Very good. I can make a hallowed axe out of it. It will cost you... er... a donation of 1,000 gold. Alright?",cid)
           Topic[cid] = 2
        else
           npcHandler:say("There is no axe with you.",cid)
       end 
    end
    elseif (msgcontains(msg, 'mission') or msgcontains(msg, 'demon oak')) then
        if (v == 1 or v == 2) then
        if getPlayerStorageValue(cid,100070) == 1 then
            npcHandler:say("You chopped down the demon oak?!? Unbelievable!! Let's hope it doesn't come back. As long as evil is still existent in the soil of the plains, it won't be over. Still, the demons suffered a setback, that's for sure. ...",cid)
            npcHandler:say("For your brave action, I tell you a secret which has been kept for many many years. There is an old house south of the location where you found the demon oak. There should be a grave with the name 'Yesim Adeit' somewhere close by. ...",cid, 4000)
            npcHandler:say("It belongs to a Daramian nobleman named 'Teme Saiyid'. I knew him well and he told me -almost augured- that someone will come who is worthy to obtain his treasure. I'm sure this 'someone' is you. Good luck in finding it!",cid, 8000)
            setPlayerStorageValue(cid,100070, 2)
            setPlayerStorageValue(cid,storage, 3)
        setPlayerStorageValue(cid, 100072, 4)
        else
            npcHandler:say("You better don't return here until you've finished your {mission}.", cid)
        end
        elseif v == 3 and getPlayerStorageValue(cid,100070) == 2  then
           npcHandler:say("I'm really thankful for your help and so should be every citizen of Tibia.",cid)
        end
    elseif Topic[cid] == 2 then
    if msgcontains(msg, 'yes') then
    if getPlayerItemCount(cid,2386) >= 1 then
    if doPlayerRemoveMoney(cid,1000) then
            npcHandler:say("Let's see....<mumbles a prayer>....here we go. The blessing on this axe will be absorbed by all the demonic energy around here. I presume it will not last very long, so better hurry. Actually, I can refresh the blessing as often as you like.",cid)
        doPlayerAddItem(cid,8293,1)
        doPlayerRemoveItem(cid, 2386, 1)
        doPlayerRemoveItem(cid, 10305, 1)
        end
        else
            npcHandler:say("There is no axe with you.",cid)
            end
        end
        Topic[cid] = 0
        end
    return true
end
 
npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Oque modifiquei em oldrak?
acrescentei essa linha

        doPlayerRemoveItem(cid, 10305, 1)

scripts
Grizzly Adams

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
 
local choose = {}
local cancel = {}
local available = {}

local grizzlyAdamsConfig = {
                            ranks = {
                                    huntsMan_rank = {
                                                    {id=11208, buy=0, sell=50, name='antlers'},
                                                    {id=10549, buy=0, sell=100, name='bloody pincers'},
                                                    {id=11183, buy=0, sell=35, name='crab pincers'},
                                                    {id=10573, buy=0, sell=55, name='cyclops toe'},
                                                    {id=10564, buy=0, sell=30, name='frosty ear of a troll'},
                                                    {id=11193, buy=0, sell=600, name='hydra head'},
                                                    {id=11366, buy=0, sell=80, name='lancer beetle shell'},
                                                    {id=10578, buy=0, sell=420, name='mutated bat ear'},
                                                    {id=11222, buy=0, sell=400, name='sabretooth'},
                                                    {id=11367, buy=0, sell=20, name='sandcrawler shell'},
                                                    {id=10547, buy=0, sell=280, name='scarab pincers'},
                                                    {id=11365, buy=0, sell=60, name='terramite legs'},
                                                    {id=11363, buy=0, sell=170, name='terramite shell'},
                                                    {id=11184, buy=0, sell=30000, name='terrorbird beak'},
                                                    
                                                    {id=7398, buy=0, sell=500, name='cyclops trophy'},
                                                    {id=11315, buy=0, sell=15000, name='draken trophy'},
                                                    {id=11330, buy=0, sell=8000, name='lizard trophy'},
                                                    {id=7401, buy=0, sell=500, name='minotaur trophy'}
                                                    },

                                    bigGameHunter_rank = {
                                                    {id=7397, buy=0, sell=3000, name='deer trophy'},
                                                    {id=7400, buy=0, sell=3000, name='lion trophy'},
                                                    {id=7394, buy=0, sell=3000, name='wolf trophy'}
                                                    },

                                    trophyHunter_rank = {
                                                    {id=7393, buy=0, sell=40000, name='demon trophy'},
                                                    {id=7396, buy=0, sell=20000, name='behemoth trophy'},
                                                    {id=7399, buy=0, sell=10000, name='dragon lord trophy'},
                                                    
                                                    {id=10518, buy=1000, sell=0, name='demon backpack'},
                                                    },
                                    }
                            }

local Topic = {}
function greetCallback(cid)
    Topic[cid] = 0
    return true
end

local function setNewTradeTable(table)
local items = {}
for _, v in ipairs(table) do
    items[v.id] = {itemId = v.id, buyPrice = v.buy, sellPrice = v.sell, subType = 0, realName = v.name}
end
return items
end

local function setNewLineTable(oldTable, newTable)
for k, v in pairs(oldTable) do
    table.insert(newTable, k, v)
end
return true
end

function creatureSayCallback(cid, type, msg)
    local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_PRIVATE and 0 or cid
if (msgcontains(msg, "hi") or msgcontains(msg, "hello")) and (not npcHandler:isFocused(cid)) then
if (getPlayerStorageValue(cid, 100157) == -1) then
        npcHandler:say("Welcome "..getCreatureName(cid)..". Would you like to join the 'Paw and Fur - Hunting Elite'?", cid)
        npcHandler:addFocus(cid)
        talkState[talkUser] = 5
  else
        npcHandler:say("Welcome back old chap. What brings you here this time?", cid)
        npcHandler:addFocus(cid)
        talkState[talkUser] = 0
        end
        return true
    end
 
    if(not npcHandler:isFocused(cid)) then
        return false
    end
    
    if msgcontains(msg, "bye") or msgcontains(msg, "farewell") then
        selfSay("Happy hunting, old chap!", cid, TRUE)
        Topic[talkUser] = 0
        npcHandler:releaseFocus(cid)
        npcHandler:resetNpc(cid)
    end
    
    if (isInArray({"yes", "join"}, msg:lower()) and talkState[talkUser] == 5) then 
        setPlayerStorageValue(cid, 100157, 1)
        npcHandler:say("Great! A warm welcome to our newest member: "..getCreatureName(cid).."! Ask me for a {task} if you want to go on a hunt.", cid)
        talkState[talkUser] = 0
   elseif (msg:lower() == "no" and talkState[talkUser] == 5) then
        npcHandler:say("No problem old chap. Come back if you change your mind.", cid)  
   end

if (getPlayerStorageValue(cid, 100157) == -1) then
    npcHandler:say("You'll have to {join} us to get more information.",cid)
    return false
end
if isInArray({"offer", "trade"}, msg:lower()) then
if getPlayerRank(cid) >= 2 then 
        if getPlayerRank(cid) == 2 or getPlayerRank(cid) == 3 then
            tradeRank = grizzlyAdamsConfig.ranks.huntsMan_rank
        elseif getPlayerRank(cid) == 4 then
            tradeRank = grizzlyAdamsConfig.ranks.bigGameHunter_rank
            setNewLineTable(grizzlyAdamsConfig.ranks.huntsMan_rank, grizzlyAdamsConfig.ranks.bigGameHunter_rank)
        elseif getPlayerRank(cid) == 5 or getPlayerRank(cid) == 6 then
            tradeRank = grizzlyAdamsConfig.ranks.trophyHunter_rank
            setNewLineTable(grizzlyAdamsConfig.ranks.huntsMan_rank, grizzlyAdamsConfig.ranks.bigGameHunter_rank)
            setNewLineTable(grizzlyAdamsConfig.ranks.huntsMan_rank, grizzlyAdamsConfig.ranks.trophyHunter_rank)
        end
        local items = setNewTradeTable(tradeRank)
            local function onBuy(cid, item, subType, amount, ignoreCap, inBackpacks)
            if ignoreCap == false and (getPlayerFreeCap(cid) < getItemWeightById(items[item].itemId, amount) or inBackpacks and getPlayerFreeCap(cid) < (getItemWeightById(items[item].itemId, amount) + getItemWeightById(1988, 1))) then
                return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You don\'t have enough cap.')
            end
            if items[item].buyPrice then
                doPlayerRemoveMoney(cid, amount * items[item].buyPrice)
                for i = 1, amount do
                    if inBackpacks then
                        local backpack = doCreateItemEx(1988, 1)
                        doAddContainerItem(backpack, items[item].itemId, amount)
                    else
                        doPlayerAddItem(cid, items[item].itemId, amount, true)
                    end
                end
                return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You bought '..amount..'x '..items[item].realName..' for '..items[item].buyPrice * amount..' gold coins.')
            end
            return true
            end
             
            local function onSell(cid, item, subType, amount, ignoreCap, inBackpacks)
            if items[item].sellPrice then
                doPlayerAddMoney(cid, items[item].sellPrice * amount)
                doPlayerRemoveItem(cid, items[item].itemId, amount)
                return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You sold '..amount..'x '..items[item].realName..' for '..items[item].sellPrice * amount..' gold coins.')
            end
            return true
            end
        openShopWindow(cid, tradeRank, onBuy, onSell)
        return selfSay('It\'s my offer.', cid)
    else
        return selfSay('You don\'t have any rank.', cid)
        end
end
 
    if isInArray({"tasks", "task", "mission"}, msg:lower()) then
        local can = getTasksByPlayer(cid)
        if (getPlayerStorageValue(cid, 100157) == -1) then
             return (npcHandler:say("You'll have to {join}, to get any {tasks}.",cid))
        end
        if #can > 0 then
            local text = ""
            local sep = ", "
            table.sort(can, (function(a, b) return (a < b) end))
            local t = 0
            for _, id in ipairs(can) do
                t = t + 1
                if t == #can - 1 then
                    sep = " and "
                elseif t == #can then
                    sep = "."
                end
                text = text .. "{" .. (tasks[id].name or tasks[id].raceName) .. "}" .. sep
            end
            selfSay("The current task" .. (#can > 1 and "s" or "") .. " that you can choose " .. (#can > 1 and "are" or "is") .. " " .. text, cid)
            talkState[talkUser] = 0
        else
            selfSay("I don't have any task for you right now.", cid)
        end
    elseif msg ~= "" and canStartTask(cid, msg) then
        if #getPlayerStartedTasks(cid) >= tasksByPlayer then
            selfSay("Sorry, but you already started " .. tasksByPlayer .. " tasks. You can check their {status} or {cancel} a task.", cid)
            return true
        end
        local task = getTaskByName(msg)
        if task and getCreatureStorage(cid, QUESTSTORAGE_BASE + task) > 0 then  
            return false
        end
        selfSay("In this task you must defeat " .. tasks[task].killsRequired .. " " .. tasks[task].raceName .. ". Are you sure that you want to start this task?", cid)
        choose[cid] = task
        talkState[talkUser] = 1
    elseif msg:lower() == "yes" and talkState[talkUser] == 1 then
        doCreatureSetStorage(cid, QUESTSTORAGE_BASE + choose[cid], 1)
        selfSay("Excellent! You can check the {status} of your task saying {report} to me. Also you can {cancel} tasks to.", cid)
        choose[cid] = nil
        talkState[talkUser] = 0    
    elseif (msg:lower() == "report" or msg:lower() == "status") then
        local started = getPlayerStartedTasks(cid)
        local finishedAtLeastOne = false
        local finished = 0
        if started and #started > 0 then
            for _, id in ipairs(started) do
                if getCreatureStorage(cid, KILLSSTORAGE_BASE + id) >= tasks[id].killsRequired then
                    for _, reward in ipairs(tasks[id].rewards) do
                        local deny = false
                        if reward.storage then
                            if getCreatureStorage(cid, reward.storage[1]) >= reward.storage[2] then
                                deny = true
                            end
                        end
                        if isInArray({REWARD_MONEY, "money"}, reward.type:lower()) and not deny then
                            doPlayerAddMoney(cid, reward.value[1])
                        elseif isInArray({REWARD_EXP, "exp", "experience"}, reward.type:lower()) and not deny then
                            doPlayerAddExperience(cid, reward.value[1])
                            doPlayerSendDefaultCancel(cid, "You gained " .. reward.value[1] .. " experience points.")
                        elseif isInArray({REWARD_ACHIEVEMENT, "achievement", "ach"}, reward.type:lower()) and not deny then
                            if doPlayerAddAchievement then
                                doPlayerAddAchievement(cid, reward.value[1], true)
                            end
                        elseif isInArray({REWARD_STORAGE, "storage", "stor"}, reward.type:lower()) and not deny then
                            doCreatureSetStorage(cid, reward.value[1], reward.value[2])
                        elseif isInArray({REWARD_POINT, "points", "point"}, reward.type:lower()) and not deny then
                            doCreatureSetStorage(cid, POINTSSTORAGE, getCreatureStorage(cid, POINTSSTORAGE) + reward.value[1])
                        elseif isInArray({REWARD_ITEM, "item", "items", "object"}, reward.type:lower()) and not deny then
                            doPlayerAddItem(cid, reward.value[1], reward.value[2])
                        end
 
                        if reward.storage then
                            doCreatureSetStorage(cid, reward.storage[1], reward.storage[2])
                        end
                    end
 
                    if tasks[id].norepeatable then
                        doCreatureSetStorage(cid, QUESTSTORAGE_BASE + id, 2)
                    else
                        doCreatureSetStorage(cid, QUESTSTORAGE_BASE + id, 0)
                    end
                    doCreatureSetStorage(cid, KILLSSTORAGE_BASE + id, 0)
                    if getCreatureStorage(cid, REPEATSTORAGE_BASE + id) < 1 then
                        doCreatureSetStorage(cid, REPEATSTORAGE_BASE + id, 0)
                    end
                    doCreatureSetStorage(cid, REPEATSTORAGE_BASE + id, getCreatureStorage(cid, REPEATSTORAGE_BASE + id) + 1)
                    finishedAtLeastOne = true
                    finished = finished + 1
                end
            end
 
            if not finishedAtLeastOne then
         local started = getPlayerStartedTasks(cid)
        if started and #started > 0 then
            local text = ""
            local sep = ", "
            table.sort(started, (function(a, b) return (a < b) end))
            local t = 0
            for _, id in ipairs(started) do
                t = t + 1
                if t == #started - 1 then
                    sep = " and "
                elseif t == #started then
                    sep = "."
                end
                text = text .. "{" .. (tasks[id].name or tasks[id].raceName) .. "}" .. sep
            end
                selfSay("The current task" .. (#started > 1 and "s" or "") .. " that you started " .. (#started > 1 and "are" or "is") .. " " .. text, cid)
                Topic[cid] = 1
            else
                selfSay("Awesome! you finished " .. (finished > 1 and "various" or "a") .. " task" .. (finished > 1 and "s" or "") .. ". Talk to me again if you want to start a {task}.", cid)
            end
        else
            selfSay("You haven't started any task yet.", cid)
        end
        end
    elseif msg:lower() == "started" then
        local started = getPlayerStartedTasks(cid)
        if started and #started > 0 then
            local text = ""
            local sep = ", "
            table.sort(started, (function(a, b) return (a < b) end))
            local t = 0
            for _, id in ipairs(started) do
                t = t + 1
                if t == #started - 1 then
                    sep = " and "
                elseif t == #started then
                    sep = "."
                end
                text = text .. "{" .. (tasks[id].name or tasks[id].raceName) .. "}" .. sep
            end
 
            selfSay("The current task" .. (#started > 1 and "s" or "") .. " that you started " .. (#started > 1 and "are" or "is") .. " " .. text, cid)
        else
            selfSay("You haven't started any task yet.", cid)
        end
    elseif msg:lower() == "cancel" then
        local started = getPlayerStartedTasks(cid)
        local task = getTaskByName(msg)
        local text = ""
            local sep = ", "
            table.sort(started, (function(a, b) return (a < b) end))
            local t = 0
            for _, id in ipairs(started) do
                t = t + 1
                if t == #started - 1 then
                    sep = " or "
                elseif t == #started then
                    sep = "?"
                end
                text = text .. "{" .. (tasks[id].name or tasks[id].raceName) .. "}" .. sep
            end
        if started and #started > 0 then
            selfSay("Cancelling a task will make the counter restart. Which of these tasks you want cancel?" .. (#started > 1 and "" or "") .. " " .. text, cid)
            talkState[talkUser] = 2
        else
            selfSay("You haven't started any task yet.", cid)
        end
    elseif getTaskByName(msg) and talkState[talkUser] == 2 and isInArray(getPlayerStartedTasks(cid), getTaskByName(msg)) then
        local task = getTaskByName(msg)
        if getCreatureStorage(cid, KILLSSTORAGE_BASE + task) > 0 then
            selfSay("You currently killed " .. getCreatureStorage(cid, KILLSSTORAGE_BASE + task) .. "/" .. tasks[task].killsRequired .. " " .. tasks[task].raceName .. ". Cancelling this task will restart the count. Are you sure you want to cancel this task?", cid)
        else
            selfSay("Are you sure you want to cancel this task?", cid)
        end
        talkState[talkUser] = 3
        cancel[cid] = task
    elseif getTaskByName(msg) and Topic[cid] == 1 and isInArray(getPlayerStartedTasks(cid), getTaskByName(msg)) then
        local task = getTaskByName(msg)
        if getCreatureStorage(cid, KILLSSTORAGE_BASE + task) > 0 then
            selfSay("You currently killed " .. getCreatureStorage(cid, KILLSSTORAGE_BASE + task) .. "/" .. tasks[task].killsRequired .. " " .. tasks[task].raceName .. ".", cid)
            Topic[cid] = 0
        else
            selfSay("You haven't started any task yet.", cid)
        end
    elseif msg:lower() == "yes" and talkState[talkUser] == 3 then
        doCreatureSetStorage(cid, QUESTSTORAGE_BASE + cancel[cid], -1)
        doCreatureSetStorage(cid, KILLSSTORAGE_BASE + cancel[cid], -1)
        selfSay("You have cancelled the task " .. (tasks[cancel[cid]].name or tasks[cancel[cid]].raceName) .. ".", cid)
        talkState[talkUser] = 0
    elseif isInArray({"points", "rank"}, msg:lower()) then
        if getCreatureStorage(cid, POINTSSTORAGE) < 1 then
        selfSay("At this time, you have 0 Paw & Fur points. You " .. (getPlayerRank(cid) == 6 and "are an Elite Hunter" or getPlayerRank(cid) == 5 and "are a Trophy Hunter" or getPlayerRank(cid) == 4 and "are a Big Game Hunter" or getPlayerRank(cid) == 3 and "are a Ranger" or getPlayerRank(cid) == 2 and "are a Huntsman" or getPlayerRank(cid) == 1 and "are a Member"  or "haven't been ranked yet") .. ".", cid)
        elseif getCreatureStorage(cid, POINTSSTORAGE) >= 1 then 
        selfSay("At this time, you have " .. getCreatureStorage(cid, POINTSSTORAGE) .. " Paw & Fur points. You " .. (getPlayerRank(cid) == 6 and "are an Elite Hunter" or getPlayerRank(cid) == 5 and "are a Trophy Hunter" or getPlayerRank(cid) == 4 and "are a Big Game Hunter" or getPlayerRank(cid) == 3 and "are a Ranger" or getPlayerRank(cid) == 2 and "are a Huntsman" or getPlayerRank(cid) == 1 and "are a Member"  or "haven't been ranked yet") .. ".", cid)
        end
        talkState[talkUser] = 0
    end
end
 
npcHandler:setMessage(MESSAGE_FAREWELL, "Happy hunting, old chap!")
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

Oque modifiquei?
Retirei a parte onde fala Holy icon apos reporta a task e adquirir o holy icon

E adicionei isso em lib/104-KillingInTheNameOf

    [44] = {killsRequired = 6666, raceName = "Demons", level = {130, 9999}, premium = true, creatures = {"Demon"}, rewards = {                            
    {type = "item", value = {10305}},
    {type = "storage", value = {41300, 1}}                                                                                                        }},    


PS removi o rank pra ser mais fácil de começar a task
Em outras palavras não precisa de rank elite pra começar a task de demon

vlw msm pela ajuda rogaforyn2 Editado por compp (veja o histórico de edições)

Rosario__Vampire_Cast400x226.jpg

                   rosario_vampire_girl_bat_moon_25562_2560

Link para o post
Compartilhar em outros sites
rogaroryn2 ou qualquer outra alma boa poderia me ajudar??

O npc Oldrak ta retirando a holy icon da bp de boa certinho!
Mas... ele transforma o axe em  
Hallowed Axe mesmo se a holy icon não estiver na bp.
Poderia me ajudar?


Oldrak - Scripts
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
 
local Topic = {}
local storage = 100077
 
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

keywordHandler:addKeyword({'job'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I guard this humble temple as a monument for the order of the nightmare knights."})
keywordHandler:addKeyword({'name'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "My name is Oldrak."})
keywordHandler:addKeyword({'monster'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "These plains are not safe for ordinary travellers. It will take heroes to survive here."})
keywordHandler:addKeyword({'help'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can't help you, sorry!"})
keywordHandler:addKeyword({'goshnar'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "The greatest necromant who ever cursed our land with the steps of his feet. He was defeated by the nightmare knights."})
keywordHandler:addKeyword({'nightmare'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "This ancient order was created by a circle of wise humans who were called 'the dreamers'. The order became extinct a long time ago."})
keywordHandler:addKeyword({'extinct'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Many perished in their battles against evil, some went mad, not able to stand their nightmares any longer. Others were seduced by the darkness."})
keywordHandler:addKeyword({'dreamers'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "They learned the ancient art of dreamwalking from some elves they befriended."})
keywordHandler:addKeyword({'dreamwalking'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "While the dreamwalkers of the elves experienenced the brightest dreams of pleasure, the humans strangely had dreams of dark omen."})
keywordHandler:addKeyword({'omen'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "They dreamed of doom, destruction, talked to dead, tormented souls, and gained unwanted insight into the schemes of darkness."})
keywordHandler:addKeyword({'schemes'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "They figured out how to interpret their dark dreams and so could foresee the plans of the dark gods and their minions."})
keywordHandler:addKeyword({'plan'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Using this knowledge they formed an order to thwart these plans, and because they battled their nightmares as brave as knights, they named their order accordingly."})
keywordHandler:addKeyword({'necromant'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "It is rumoured to open the entrance to the pits of inferno, also called the nightmare pits. Even if I knew about this secret I wouldn't tell you."})
keywordHandler:addKeyword({'havok'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Before the battles raged across them, they were called the fair plains."})
keywordHandler:addKeyword({'tibia'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "That's where we are. The world of Tibia."})
keywordHandler:addKeyword({'god'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "They created Tibia and all life on it ... and unlife, too."})
keywordHandler:addKeyword({'unlife'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Beware the foul undead!"})
keywordHandler:addKeyword({'undead'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Beware the foul undead!"})
keywordHandler:addKeyword({'excalibug'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "A weapon of myth and legend. It was lost in ancient times ... perhaps lost forever."})
keywordHandler:addKeyword({'hugo'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Ah, the bane of the Plains of Havoc, the hidden beast, the unbeatable foe. I live here for years and I am sure it's only a myth."})
keywordHandler:addKeyword({'yenny'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Yenny, known as the Gentle, was one of most powerfull magicwielders in ancient times and known throughout the world for her mercy and kindness."})
keywordHandler:addKeyword({'offer'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can offer you the holy tible for a small fee."})
keywordHandler:addKeyword({'trade'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can offer you the holy tible for a small fee."})
keywordHandler:addKeyword({'sell'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can offer you the holy tible for a small fee."})
keywordHandler:addKeyword({'buy'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can offer you the holy tible for a small fee."})
keywordHandler:addKeyword({'have'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can offer you the holy tible for a small fee."})
keywordHandler:addKeyword({'have'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can offer you the holy tible for a small fee."})
keywordHandler:addKeyword({'time'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Now, it is "..getWorldTime().."."})
 
function greetCallback(cid)
    Topic[cid] = 0
    return true
end
 
function creatureSayCallback(cid, type, msg)
   local v = getPlayerStorageValue(cid, storage)
   if not npcHandler:isFocused(cid) then return false end
    if msgcontains(msg, 'no') and Topic[cid] == 1 then
        npcHandler:say("What a pity! Let me know when you managed to get in there. Maybe I can help you when we know what we are dealing with.",cid)
        Topic[cid] = 0
    elseif msgcontains(msg, 'no') and Topic[cid] == 2 then
        npcHandler:say("Not then.",cid)
        Topic[cid] = 0
    end 
    if  (msgcontains(msg, 'mission') or msgcontains(msg, 'demon oak')) and getPlayerStorageValue(cid, storage) == -1 then
        npcHandler:say("How do you know? Did you go into the infested area?", cid)
        Topic[cid] = 1
    elseif Topic[cid] == 1 then
        if msgcontains(msg, 'yes') then
        if getPlayerStorageValue(cid, 100076) == 1 and getPlayerStorageValue(cid, storage) == -1 then
           npcHandler:say("A demon oak?!? <mumbles some blessings> May the gods be on our side. You'll need a {hallowed axe} to harm that tree. Bring me a simple {axe} and I'll prepare it for you.",cid)
           setPlayerStorageValue(cid, storage, 1)
           setPlayerStorageValue(cid, 100072, 2)
       else
           npcHandler:say("I don't believe a word of it! How rude to lie to a monk!",cid)
           end
           Topic[cid] = 0
        end
    elseif msgcontains(msg, 'axe') or msgcontains(msg, 'hallowed axe') then
        if v == 2 then
        if getPlayerItemCount(cid,2386) >= 1 then 
           npcHandler:say("Ahh, you've got an axe. Very good. I can make a hallowed axe out of it. It will cost you... er... a donation of 1,000 gold. Alright?",cid)
           Topic[cid] = 2
        else
           npcHandler:say("There is no axe with you.",cid)
       end 
    end
    elseif (msgcontains(msg, 'mission') or msgcontains(msg, 'demon oak')) then
        if (v == 1 or v == 2) then
        if getPlayerStorageValue(cid,100070) == 1 then
            npcHandler:say("You chopped down the demon oak?!? Unbelievable!! Let's hope it doesn't come back. As long as evil is still existent in the soil of the plains, it won't be over. Still, the demons suffered a setback, that's for sure. ...",cid)
            npcHandler:say("For your brave action, I tell you a secret which has been kept for many many years. There is an old house south of the location where you found the demon oak. There should be a grave with the name 'Yesim Adeit' somewhere close by. ...",cid, 4000)
            npcHandler:say("It belongs to a Daramian nobleman named 'Teme Saiyid'. I knew him well and he told me -almost augured- that someone will come who is worthy to obtain his treasure. I'm sure this 'someone' is you. Good luck in finding it!",cid, 8000)
            setPlayerStorageValue(cid,100070, 2)
            setPlayerStorageValue(cid,storage, 3)
        setPlayerStorageValue(cid, 100072, 4)
        else
            npcHandler:say("You better don't return here until you've finished your {mission}.", cid)
        end
        elseif v == 3 and getPlayerStorageValue(cid,100070) == 2  then
           npcHandler:say("I'm really thankful for your help and so should be every citizen of Tibia.",cid)
        end
    elseif Topic[cid] == 2 then
    if msgcontains(msg, 'yes') then
    if getPlayerItemCount(cid,2386) >= 1 then
    if doPlayerRemoveMoney(cid,1000) then
            npcHandler:say("Let's see....<mumbles a prayer>....here we go. The blessing on this axe will be absorbed by all the demonic energy around here. I presume it will not last very long, so better hurry. Actually, I can refresh the blessing as often as you like.",cid)
        doPlayerAddItem(cid,8293,1)
        doPlayerRemoveItem(cid, 2386, 1)
        doPlayerRemoveItem(cid, 10305, 1)
        end
        else
            npcHandler:say("There is no axe with you.",cid)
            end
        end
        Topic[cid] = 0
        end
    return true
end
 
npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Irei dar rep+ novamente por me ajudar!
Editado por compp (veja o histórico de edições)

Rosario__Vampire_Cast400x226.jpg

                   rosario_vampire_girl_bat_moon_25562_2560

Link para o post
Compartilhar em outros sites

É porque ele não remove mesmo, a intenção da holy icon é ser um enfeite, o que vale é a storage que vem junto com ela, mas se quiser fazer isso:

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
 
local Topic = {}
local storage = 100077
 
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

keywordHandler:addKeyword({'job'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I guard this humble temple as a monument for the order of the nightmare knights."})
keywordHandler:addKeyword({'name'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "My name is Oldrak."})
keywordHandler:addKeyword({'monster'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "These plains are not safe for ordinary travellers. It will take heroes to survive here."})
keywordHandler:addKeyword({'help'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can't help you, sorry!"})
keywordHandler:addKeyword({'goshnar'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "The greatest necromant who ever cursed our land with the steps of his feet. He was defeated by the nightmare knights."})
keywordHandler:addKeyword({'nightmare'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "This ancient order was created by a circle of wise humans who were called 'the dreamers'. The order became extinct a long time ago."})
keywordHandler:addKeyword({'extinct'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Many perished in their battles against evil, some went mad, not able to stand their nightmares any longer. Others were seduced by the darkness."})
keywordHandler:addKeyword({'dreamers'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "They learned the ancient art of dreamwalking from some elves they befriended."})
keywordHandler:addKeyword({'dreamwalking'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "While the dreamwalkers of the elves experienenced the brightest dreams of pleasure, the humans strangely had dreams of dark omen."})
keywordHandler:addKeyword({'omen'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "They dreamed of doom, destruction, talked to dead, tormented souls, and gained unwanted insight into the schemes of darkness."})
keywordHandler:addKeyword({'schemes'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "They figured out how to interpret their dark dreams and so could foresee the plans of the dark gods and their minions."})
keywordHandler:addKeyword({'plan'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Using this knowledge they formed an order to thwart these plans, and because they battled their nightmares as brave as knights, they named their order accordingly."})
keywordHandler:addKeyword({'necromant'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "It is rumoured to open the entrance to the pits of inferno, also called the nightmare pits. Even if I knew about this secret I wouldn't tell you."})
keywordHandler:addKeyword({'havok'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Before the battles raged across them, they were called the fair plains."})
keywordHandler:addKeyword({'tibia'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "That's where we are. The world of Tibia."})
keywordHandler:addKeyword({'god'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "They created Tibia and all life on it ... and unlife, too."})
keywordHandler:addKeyword({'unlife'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Beware the foul undead!"})
keywordHandler:addKeyword({'undead'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Beware the foul undead!"})
keywordHandler:addKeyword({'excalibug'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "A weapon of myth and legend. It was lost in ancient times ... perhaps lost forever."})
keywordHandler:addKeyword({'hugo'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Ah, the bane of the Plains of Havoc, the hidden beast, the unbeatable foe. I live here for years and I am sure it's only a myth."})
keywordHandler:addKeyword({'yenny'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Yenny, known as the Gentle, was one of most powerfull magicwielders in ancient times and known throughout the world for her mercy and kindness."})
keywordHandler:addKeyword({'offer'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can offer you the holy tible for a small fee."})
keywordHandler:addKeyword({'trade'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can offer you the holy tible for a small fee."})
keywordHandler:addKeyword({'sell'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can offer you the holy tible for a small fee."})
keywordHandler:addKeyword({'buy'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can offer you the holy tible for a small fee."})
keywordHandler:addKeyword({'have'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can offer you the holy tible for a small fee."})
keywordHandler:addKeyword({'have'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can offer you the holy tible for a small fee."})
keywordHandler:addKeyword({'time'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Now, it is "..getWorldTime().."."})
 
function greetCallback(cid)
    Topic[cid] = 0
    return true
end
 
function creatureSayCallback(cid, type, msg)
   local v = getPlayerStorageValue(cid, storage)
   if not npcHandler:isFocused(cid) then return false end
    if msgcontains(msg, 'no') and Topic[cid] == 1 then
        npcHandler:say("What a pity! Let me know when you managed to get in there. Maybe I can help you when we know what we are dealing with.",cid)
        Topic[cid] = 0
    elseif msgcontains(msg, 'no') and Topic[cid] == 2 then
        npcHandler:say("Not then.",cid)
        Topic[cid] = 0
    end 
    if  (msgcontains(msg, 'mission') or msgcontains(msg, 'demon oak')) and getPlayerStorageValue(cid, storage) == -1 then
        npcHandler:say("How do you know? Did you go into the infested area?", cid)
        Topic[cid] = 1
    elseif Topic[cid] == 1 then
        if msgcontains(msg, 'yes') then
        if getPlayerStorageValue(cid, 100076) == 1 and getPlayerStorageValue(cid, storage) == -1 then
           npcHandler:say("A demon oak?!? <mumbles some blessings> May the gods be on our side. You'll need a {hallowed axe} to harm that tree. Bring me a simple {axe} and I'll prepare it for you.",cid)
           setPlayerStorageValue(cid, storage, 1)
           setPlayerStorageValue(cid, 100072, 2)
       else
           npcHandler:say("I don't believe a word of it! How rude to lie to a monk!",cid)
           end
           Topic[cid] = 0
        end
    elseif msgcontains(msg, 'axe') or msgcontains(msg, 'hallowed axe') then
        if v == 2 then
        if getPlayerItemCount(cid,2386) >= 1 then 
           npcHandler:say("Ahh, you've got an axe. Very good. I can make a hallowed axe out of it. It will cost you... er... a donation of 1,000 gold. Alright?",cid)
           Topic[cid] = 2
        else
           npcHandler:say("There is no axe with you.",cid)
       end 
    end
    elseif (msgcontains(msg, 'mission') or msgcontains(msg, 'demon oak')) then
        if (v == 1 or v == 2) then
        if getPlayerStorageValue(cid,100070) == 1 then
            npcHandler:say("You chopped down the demon oak?!? Unbelievable!! Let's hope it doesn't come back. As long as evil is still existent in the soil of the plains, it won't be over. Still, the demons suffered a setback, that's for sure. ...",cid)
            npcHandler:say("For your brave action, I tell you a secret which has been kept for many many years. There is an old house south of the location where you found the demon oak. There should be a grave with the name 'Yesim Adeit' somewhere close by. ...",cid, 4000)
            npcHandler:say("It belongs to a Daramian nobleman named 'Teme Saiyid'. I knew him well and he told me -almost augured- that someone will come who is worthy to obtain his treasure. I'm sure this 'someone' is you. Good luck in finding it!",cid, 8000)
            setPlayerStorageValue(cid,100070, 2)
            setPlayerStorageValue(cid,storage, 3)
        setPlayerStorageValue(cid, 100072, 4)
        else
            npcHandler:say("You better don't return here until you've finished your {mission}.", cid)
        end
        elseif v == 3 and getPlayerStorageValue(cid,100070) == 2  then
           npcHandler:say("I'm really thankful for your help and so should be every citizen of Tibia.",cid)
        end
    elseif Topic[cid] == 2 then
    if msgcontains(msg, 'yes') then
	  if getPlayerItemCount(cid,10305) >= 1 then
    if getPlayerItemCount(cid,2386) >= 1 then
    if doPlayerRemoveMoney(cid,1000) then
            npcHandler:say("Let's see....<mumbles a prayer>....here we go. The blessing on this axe will be absorbed by all the demonic energy around here. I presume it will not last very long, so better hurry. Actually, I can refresh the blessing as often as you like.",cid)
        doPlayerAddItem(cid,8293,1)
        doPlayerRemoveItem(cid, 2386, 1)
        doPlayerRemoveItem(cid, 10305, 1)
        end
        else
            npcHandler:say("There is no axe with you.",cid)
            end
			 else
            npcHandler:say("There is no holy icon with you.",cid)
            end
        end
        Topic[cid] = 0
        end
    return true
end
 
npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Life is so meaningless, there is nothing worth a smile
So goodbye, I'll miss you

 

 

sugestões?

 

 

Link para o post
Compartilhar em outros sites
Ele manda dar a volta na demon oak - Ok perfeito ate ai
apos dizer "axe" ou "hallowed axe" ele não responde e nem encanta o axe
Apenas manda atacar a oak 

Rosario__Vampire_Cast400x226.jpg

                   rosario_vampire_girl_bat_moon_25562_2560

Link para o post
Compartilhar em outros sites

tenta assim

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
 
local Topic = {}
local storage = 100077
 
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

keywordHandler:addKeyword({'job'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I guard this humble temple as a monument for the order of the nightmare knights."})
keywordHandler:addKeyword({'name'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "My name is Oldrak."})
keywordHandler:addKeyword({'monster'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "These plains are not safe for ordinary travellers. It will take heroes to survive here."})
keywordHandler:addKeyword({'help'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can't help you, sorry!"})
keywordHandler:addKeyword({'goshnar'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "The greatest necromant who ever cursed our land with the steps of his feet. He was defeated by the nightmare knights."})
keywordHandler:addKeyword({'nightmare'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "This ancient order was created by a circle of wise humans who were called 'the dreamers'. The order became extinct a long time ago."})
keywordHandler:addKeyword({'extinct'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Many perished in their battles against evil, some went mad, not able to stand their nightmares any longer. Others were seduced by the darkness."})
keywordHandler:addKeyword({'dreamers'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "They learned the ancient art of dreamwalking from some elves they befriended."})
keywordHandler:addKeyword({'dreamwalking'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "While the dreamwalkers of the elves experienenced the brightest dreams of pleasure, the humans strangely had dreams of dark omen."})
keywordHandler:addKeyword({'omen'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "They dreamed of doom, destruction, talked to dead, tormented souls, and gained unwanted insight into the schemes of darkness."})
keywordHandler:addKeyword({'schemes'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "They figured out how to interpret their dark dreams and so could foresee the plans of the dark gods and their minions."})
keywordHandler:addKeyword({'plan'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Using this knowledge they formed an order to thwart these plans, and because they battled their nightmares as brave as knights, they named their order accordingly."})
keywordHandler:addKeyword({'necromant'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "It is rumoured to open the entrance to the pits of inferno, also called the nightmare pits. Even if I knew about this secret I wouldn't tell you."})
keywordHandler:addKeyword({'havok'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Before the battles raged across them, they were called the fair plains."})
keywordHandler:addKeyword({'tibia'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "That's where we are. The world of Tibia."})
keywordHandler:addKeyword({'god'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "They created Tibia and all life on it ... and unlife, too."})
keywordHandler:addKeyword({'unlife'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Beware the foul undead!"})
keywordHandler:addKeyword({'undead'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Beware the foul undead!"})
keywordHandler:addKeyword({'excalibug'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "A weapon of myth and legend. It was lost in ancient times ... perhaps lost forever."})
keywordHandler:addKeyword({'hugo'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Ah, the bane of the Plains of Havoc, the hidden beast, the unbeatable foe. I live here for years and I am sure it's only a myth."})
keywordHandler:addKeyword({'yenny'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Yenny, known as the Gentle, was one of most powerfull magicwielders in ancient times and known throughout the world for her mercy and kindness."})
keywordHandler:addKeyword({'offer'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can offer you the holy tible for a small fee."})
keywordHandler:addKeyword({'trade'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can offer you the holy tible for a small fee."})
keywordHandler:addKeyword({'sell'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can offer you the holy tible for a small fee."})
keywordHandler:addKeyword({'buy'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can offer you the holy tible for a small fee."})
keywordHandler:addKeyword({'have'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can offer you the holy tible for a small fee."})
keywordHandler:addKeyword({'have'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can offer you the holy tible for a small fee."})
keywordHandler:addKeyword({'time'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Now, it is "..getWorldTime().."."})
 
function greetCallback(cid)
    Topic[cid] = 0
    return true
end
 
function creatureSayCallback(cid, type, msg)
   local v = getPlayerStorageValue(cid, storage)
   if not npcHandler:isFocused(cid) then return false end
    if msgcontains(msg, 'no') and Topic[cid] == 1 then
        npcHandler:say("What a pity! Let me know when you managed to get in there. Maybe I can help you when we know what we are dealing with.",cid)
        Topic[cid] = 0
    elseif msgcontains(msg, 'no') and Topic[cid] == 2 then
        npcHandler:say("Not then.",cid)
        Topic[cid] = 0
    end 
    if  (msgcontains(msg, 'mission') or msgcontains(msg, 'demon oak')) and getPlayerStorageValue(cid, storage) == -1 then
        npcHandler:say("How do you know? Did you go into the infested area?", cid)
        Topic[cid] = 1
    elseif Topic[cid] == 1 then
        if msgcontains(msg, 'yes') then
        if getPlayerStorageValue(cid, 100076) == 1 and getPlayerStorageValue(cid, storage) == -1 then
           npcHandler:say("A demon oak?!? <mumbles some blessings> May the gods be on our side. You'll need a {hallowed axe} to harm that tree. Bring me a simple {axe} and I'll prepare it for you.",cid)
           setPlayerStorageValue(cid, storage, 1)
           setPlayerStorageValue(cid, 100072, 2)
       else
           npcHandler:say("I don't believe a word of it! How rude to lie to a monk!",cid)
           end
           Topic[cid] = 0
        end
    elseif msgcontains(msg, 'axe') or msgcontains(msg, 'hallowed axe') then
        if v == 2 then
		if getPlayerItemCount(cid,10305) >= 1 then
        if getPlayerItemCount(cid,2386) >= 1 then 
           npcHandler:say("Ahh, you've got an axe. Very good. I can make a hallowed axe out of it. It will cost you... er... a donation of 1,000 gold. Alright?",cid)
           Topic[cid] = 2
        else
           npcHandler:say("There is no axe with you.",cid)
       end 
	 else
            npcHandler:say("There is no holy icon with you.",cid)
            end
    end
    elseif (msgcontains(msg, 'mission') or msgcontains(msg, 'demon oak')) then
        if (v == 1 or v == 2) then
        if getPlayerStorageValue(cid,100070) == 1 then
            npcHandler:say("You chopped down the demon oak?!? Unbelievable!! Let's hope it doesn't come back. As long as evil is still existent in the soil of the plains, it won't be over. Still, the demons suffered a setback, that's for sure. ...",cid)
            npcHandler:say("For your brave action, I tell you a secret which has been kept for many many years. There is an old house south of the location where you found the demon oak. There should be a grave with the name 'Yesim Adeit' somewhere close by. ...",cid, 4000)
            npcHandler:say("It belongs to a Daramian nobleman named 'Teme Saiyid'. I knew him well and he told me -almost augured- that someone will come who is worthy to obtain his treasure. I'm sure this 'someone' is you. Good luck in finding it!",cid, 8000)
            setPlayerStorageValue(cid,100070, 2)
            setPlayerStorageValue(cid,storage, 3)
        setPlayerStorageValue(cid, 100072, 4)
        else
            npcHandler:say("You better don't return here until you've finished your {mission}.", cid)
        end
        elseif v == 3 and getPlayerStorageValue(cid,100070) == 2  then
           npcHandler:say("I'm really thankful for your help and so should be every citizen of Tibia.",cid)
        end
    elseif Topic[cid] == 2 then
    if msgcontains(msg, 'yes') then
	  
	  
    if getPlayerItemCount(cid,2386) >= 1 then
    if doPlayerRemoveMoney(cid,1000) then
            npcHandler:say("Let's see....<mumbles a prayer>....here we go. The blessing on this axe will be absorbed by all the demonic energy around here. I presume it will not last very long, so better hurry. Actually, I can refresh the blessing as often as you like.",cid)
        doPlayerAddItem(cid,8293,1)
        doPlayerRemoveItem(cid, 2386, 1)
        doPlayerRemoveItem(cid, 10305, 1)
        end
        else
            npcHandler:say("There is no axe with you.",cid)
            end

        end
        Topic[cid] = 0
        end
    return true
end
 
npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Life is so meaningless, there is nothing worth a smile
So goodbye, I'll miss you

 

 

sugestões?

 

 

Link para o post
Compartilhar em outros sites
Vlw depois eu vejo qualquer coisa comento aqui em baixo novamente :D

Rosario__Vampire_Cast400x226.jpg

                   rosario_vampire_girl_bat_moon_25562_2560

Link para o post
Compartilhar em outros sites

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

  • Conteúdo Similar

    • Por ambrozii0
      Gostaria de fazer um pedido de um NPC de Task progressiva,

      Ele iniciaria dando missões para level 8 para caçar Troll, Rotworm e Ghoul.
       
      No level 30 liberaria: Cyclops, Dragon e Wyrm... e assim em diante se puder deixar comentado eu faço as criaturas na sequencia dos leveis seguintes.
       
      O jogador pode fazer as tasks dos leveis anteriores mesmo que já tenha ultrapassado o level do próximo nível de task.
       
      E o jogador ao terminar a missão poderia escolher a recompensa em gold ou experiência. As tasks podem se repetir sem problema, mas apenas pode pegar uma de cada vez.
       
      Ao finalizar todas as tasks o jogador ganha uma montaria.
       
      Minha versão de cliente é 12.91
      Versão da Canary 2.6.1
      Não sei qual o TFS do meu servidor.
    • Por ILex WilL
      Olá, Alguém poderia me ajudar com uns Scripts? nem que seja cobrando, dependendo eu pago para me ajudar...
    • Por Kill of sumoners
      Boa noite, estou com um erro ao atacar um player em meu sv eu nao pego pk, nem sai magia, aparece a mensagem "voce so pode usar isso em criaturas"
      obs: magia em area acerta e pega pk, apenas as targets ou hits de arma nao vao 
    • Por Jpminatel
      Estou com os seguintes erros ; e procuro quem poça ajudar ai a eliminar esses 3 erros , erro 1 e 2 acontece qnd um pokemon usa ps   e o erro 3 é nas potions 
      [Error - TalkAction Interface] 
      [30/01/2022 17:04:25] data/talkactions/scripts/move1.lua:onSay
      [30/01/2022 17:04:25] Description: 
      [30/01/2022 17:04:25] data/lib/some functions.lua:338: attempt to call global 'hasTile' (a nil value)
      [30/01/2022 17:04:25] stack traceback:
      [30/01/2022 17:04:25]     data/lib/some functions.lua:338: in function 'getThingFromPosWithProtect'
      Erro 2 ;
      [30/01/2022 18:08:53] [Error - Spell Interface] 
      [30/01/2022 18:08:53] In a timer event called from: 
      [30/01/2022 18:08:53] data/spells/scripts/ps/Earthquake.lua:onCastSpell
      [30/01/2022 18:08:53] Description: 
      [30/01/2022 18:08:53] data/lib/some functions.lua:338: attempt to call global 'hasTile' (a nil value)
      [30/01/2022 18:08:53] stack traceback:
      [30/01/2022 18:08:53]     data/lib/some functions.lua:338: in function 'getThingFromPosWithProtect'
      [30/01/2022 18:08:53]     data/lib/newStatusSyst.lua:844: in function 'doMoveInArea2'
      [30/01/2022 18:08:53]     data/lib/pokemon moves.lua:1355: in function <data/lib/pokemon moves.lua:1351>
      [30/01/2022 18:08:54] [Error - Spell Interface] 
      [30/01/2022 18:08:54] In a timer event called from: 
      [30/01/2022 18:08:54] data/spells/scripts/ps/Earthquake.lua:onCastSpell
      [30/01/2022 18:08:54] Description: 
      [30/01/2022 18:08:54] data/lib/some functions.lua:338: attempt to call global 'hasTile' (a nil value)
      [30/01/2022 18:08:54] stack traceback:
      [30/01/2022 18:08:54]     data/lib/some functions.lua:338: in function 'getThingFromPosWithProtect'
      [30/01/2022 18:08:54]     data/lib/newStatusSyst.lua:844: in function 'doMoveInArea2'
      [30/01/2022 18:08:54]     data/lib/pokemon moves.lua:1355: in function <data/lib/pokemon moves.lua:1351>
      [30/01/2022 18:18:20] [Error - TalkAction Interface] 
      [30/01/2022 18:18:20] data/talkactions/scripts/move1.lua:onSay
      [30/01/2022 18:18:20] Description: 
      [30/01/2022 18:18:20] data/lib/some functions.lua:338: attempt to call global 'hasTile' (a nil value)
      [30/01/2022 18:18:20] stack traceback:
      [30/01/2022 18:18:20]     data/lib/some functions.lua:338: in function 'getThingFromPosWithProtect'
      [30/01/2022 18:18:20]     data/lib/newStatusSyst.lua:1119: in function 'doMoveInAreaMulti'
      [30/01/2022 18:18:20]     data/lib/pokemon moves.lua:458: in function 'docastspell'
      [30/01/2022 18:18:20]     data/talkactions/scripts/move1.lua:173: in function <data/talkactions/scripts/move1.lua:20>
      Erro 3 ; 
      erro potion 
      [30/01/2022 18:48:35] [Error - Action Interface] 
      [30/01/2022 18:48:35] data/actions/scripts/potion.lua:onUse
      [30/01/2022 18:48:35] Description: 
      [30/01/2022 18:48:35] data/lib/some functions.lua:338: attempt to call global 'hasTile' (a nil value)
      [30/01/2022 18:48:35] stack traceback:
      [30/01/2022 18:48:35]     data/lib/some functions.lua:338: in function 'getThingFromPosWithProtect'
      [30/01/2022 18:48:35]     data/actions/scripts/potion.lua:45: in function <data/actions/scripts/potion.lua:43>
      [30/01/2022 18:48:39] [Error - Action Interface] 
      [30/01/2022 18:48:39] data/actions/scripts/potion.lua:onUse
      [30/01/2022 18:48:39] Description: 
      [30/01/2022 18:48:39] data/lib/some functions.lua:338: attempt to call global 'hasTile' (a nil value)
      [30/01/2022 18:48:39] stack traceback:
      [30/01/2022 18:48:39]     data/lib/some functions.lua:338: in function 'getThingFromPosWithProtect'
      [30/01/2022 18:48:39]     data/actions/scripts/potion.lua:45: in function <data/actions/scripts/potion.lua:43>
       
    • Por Barca Furada
      Boa noite meus caros colegas!
      Preciso de um Help!
       
       
      Quando eu coloco meu itens editados no meu xml e otb, acontece isso com os teleportes, perde todas as propriedades:
       
      No lado direito é sem meu Itemxml
      No lado Esquerdo é com meu Itemxml
       
      Como vcs pode vem ele perde a propriedade de destino!
       
      O arquivo Check File Signatures está desativados!
       
      Quando eu entro no REM com meu Itemxml, ele da essas mensagem de erro:
       
       
       
      Antes de fazer tudo isso eu No item editor, todos itens estava com essa borda vermelha, eu tinha dado reload em todos itens para o cliente OTCv8 conseguir visualizar, no primeiro momento achei que era isso que tinha acontecido para bugar meus teleportes, então eu dei reload em todos itens um por um e deixei o teleport sem dar reload, para ver se era esses o bug! e deu na mesma , quando edito o mapa para colocar novas hunt e cidade ele buga todos teleportes!
       
       
       
       
      No itemxml o teleport está com mesmo id!
       
      alguma alma bondosa para ajudar um colega?
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo