Ir para conteúdo

Featured Replies

Postado
  • Autor

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

  • Respostas 18
  • Visualizações 1.7k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

Postado

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)

 

Postado
  • Autor

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)

Postado
  • Autor
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)

Postado

É 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())

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

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo