• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Need Task Npc Scripts - OTHire 0.0.3 (7.72).

Eldran

New Member
Joined
Jul 13, 2009
Messages
85
Reaction score
1
Hi,

Could someone can share/create this scripts for me?

Thanks
 
You have two issues.
First, you've posted in support.
If your wanting to have someone create the script for you, you should post it over in requests.

The larger issue, and quite frankly the probable reason for no responses, is that you've given us zero information about what "Task Npc Scripts" entails.

Are you trying to make a simple quest? (Example: collect items, and bring back to npc for reward?)
Are you trying make the player talk to Npc_1 then talk to Npc_2 and continue the quest?
Are you trying to make an Npc for kill creature tasks?
For above, does the player have to choose which kill creature task is 'active', and be forced to complete that task before they can complete another one? Or can they have 1-30 tasks open at the same time?
et cetera, et cetera..

There's too many 'Task Npc Scripts' for us to know what your looking for.
You have to give us as much information as possible when posting.
You can't assume we know what your looking for.
Tell us exactly what you want, and how you want it.

If your posting in support, generally follow these guidelines.
If your posting in requests, generally follow these other guidelines.

As a community, we are here to help.
You, as part of the community, need to help as well.

When you are posting a new thread, your job is to give as much information as possible about your issue/request.
This helps us help you help us all. --Portal references are still hilarious years later.

Hopefully this helps clarify your statement,
No one can help with this? :(:(:(

Cheers,

Xikini

---------------

Maybe this is what your looking for.
https://otland.net/threads/234306/page-14#post-2330703
 
Last edited:
Xikini

I did not know where to post. I apologize for the inconvenience. I'm looking for an NPC look likes NPC Grizzly Adams - Killing in the name. I've researched information on and found some topics, but no one of the scripts are compatible with the server I'm testing, which is Legacy Server using the OTHire 0.0.3 distribution. I do not have the experience to reprogram these script.

Hopefully this helps clarify your statement
Sorry but i've maked one question, not statement.

Thank you for trying to help me.

greetings
 
If you don't know much about programming , I thnik that some destribution of TheForgottenServer would be the best choice for you to work with.
You can try this script , it works at tfs 0.3.6 , I don't know whether it is gonna work for you.
Lua:
local STORAGE = 18008

local TALKSTATE_PICK = 1
local TALKSTATE_RESET = 2
local TALKSTATE_COMPLETE = 3

local TASKSTATE_COMPLETED = 1
local TASKSTATE_BOSS = 2
local TASKSTATE_FINALIZED = 3

local tasks = {
    ['minotaurs'] = {storage = 18009, kills = 5000, experience = 0, once = false, items = {}},
    ['pirates'] = {storage = 18010, kills = 3000, experience = 10000, once = false, items = {{2152, 50}}},
    ['sea serpents'] = {storage = 18011, kills = 2000, experience = 0, once = false, items = {}},
    ['serpent spawns'] = {storage = 18012, kills = 1500, experience = 0, once = false, items = {}},
    ['demons'] = {storage = 18013, kills = 6666, experience = 2000000, once = true, items = {}},
    ['behemoths'] = {storage = 18014, kills = 2000, experience = 0, once = false, items = {}},   
    ['hydras'] = {storage = 18015, kills = 2000, experience = 0, once = false, items = {}},
    ['dragons'] = {storage = 18016, kills = 10000, experience = 1000000, once = false, items = {}},
    ['necromancers'] = {storage = 18017, kills = 4000, experience = 400000, once = false, items = {}},
    ['giant spiders'] = {storage = 18018, kills = 5000, experience = 50000, once = false, items = {}},
    ['juggernaut'] = {storage = 18019, kills = 500, experience = 5000000, once = true, items = {}},
    ['hands'] = {storage = 18020, kills = 500, experience = 500000, once = true, items = {}},
    ['dark torturers'] = {storage = 18021, kills = 2000, experience = 500000, once = ftrue, items = {}},
    ['phantasms'] = {storage = 18022, kills = 2000, experience = 500000, once = true, items = {}},
    ['warlocks'] = {storage = 18023, kills = 2000, experience = 500000, once = false, items = {}},
    ['grim reapers'] = {storage = 18024, kills = 2000, experience = 500000, once = false, items = {}}
}

function listTasks()
    local output, list = '', {}

    for k, v in ipairs(tasks) do
        table.insert(list, k)
    end

    for k, v in ipairs(list) do
        if k == 1 then
            output = '{'.. v .. '}'
        elseif k == #list then
            output = output .. ' and {'.. v ..'}'
        else
            output = output ..', {'.. v ..'}'
        end
    end

    return output
end

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState, turned = {}

function onCreatureAppear(cid)
    npcHandler:onCreatureAppear(cid)
end

function onCreatureDisappear(cid)
    npcHandler:onCreatureDisappear(cid)

    if talkState[cid] then
        talkState[cid] = nil
    end
end

function onCreatureSay(cid, type, msg)
    npcHandler:onCreatureSay(cid, type, msg)
end

function onThink()
    if not turned then
        selfTurn(SOUTH)
        turned = true
    end

    npcHandler:onThink()
end

local shop = ShopModule:new()
npcHandler:addModule(shop)

shop:addBuyableItem({'demon backpack'}, 10518, 1000, 1, 'Demon Backpack')

shop:addSellableItem({'hydra head'}, 11199, 600, 'Hydra Head')
shop:addSellableItem({'cyclops trophy'}, 7398, 500, 'Cyclops Trophy')
shop:addSellableItem({'minotaur trophy'}, 7401, 500, 'Minotaur Trophy')
shop:addSellableItem({'deer trophy'}, 7397, 1000, 'Deer Trophy')
shop:addSellableItem({'lion trophy'}, 7400, 1000, 'Lion Trophy')
shop:addSellableItem({'wolf trophy'}, 7394, 1000, 'Wolf Trophy')
shop:addSellableItem({'behemoth trophy'}, 7396, 20000, 'Behemoth Trophy')
shop:addSellableItem({'demon trophy'}, 7393, 40000, 'Demon Trophy')
shop:addSellableItem({'dragon lord trophy'}, 7399, 10000, 'Dragon Lord Trophy')

function creatureSayCallback(cid, type, msg)
    if not npcHandler:isFocused(cid) then
        return false
    end

    if msgcontains(msg, 'task') then
        if getCreatureStorage(cid, STORAGE) == EMPTY_STORAGE then
            local list = listTasks()
            selfSay('You can start one of the following tasks: {Minotaurs}, {Pirates}, {Sea Serpents}, {Serpent Spawns}, {Demons}, {Behemoths}, {Hydras}, {Dragons}, {Necromancers}, {Giant Spiders}, {Warlocks} and {Grim Reapers}.', cid)
            selfSay('You can also make these: {Juggernauts}, {Hands}, {Dark Torturers} and {Phantasms}. But you can make them only once.', cid)
            selfSay('To start a task, simply type one of highlighted keywords, and remember - you can\'t start more than one task at same time.', cid)
            talkState[cid] = TALKSTATE_PICK
        else
            selfSay('You are currently assigned a task. Would you like to dismiss your current task and begin another one?', cid)
            talkState[cid] = TALKSTATE_RESET
        end
    elseif talkState[cid] == TALKSTATE_RESET then
        if msgcontains(msg, 'yes') then
            doCreatureSetStorage(cid, STORAGE, EMPTY_STORAGE)

            for _, v in ipairs(tasks) do
                doCreatureSetStorage(cid, v.storage, EMPTY_STORAGE)
            end

            selfSay('Your current task has been restarted, now you can choose another one, please say {task} to see list of available tasks.', cid)
        else
            selfSay('No then...', cid)
        end

        talkState[cid] = nil
    elseif talkState[cid] == TALKSTATE_PICK then
        local task = tasks[msg:lower()]

        if task then
            if getCreatureStorage(cid, task.storage) == task.kills + TASKSTATE_FINALIZED then
                selfSay('This task has been already finalized and you can\'t pick it anymore.', cid)
            else
                doCreatureSetStorage(cid, STORAGE, 1)
                doCreatureSetStorage(cid, task.storage, 0)
                selfSay('You just started the {'.. msg:lower():gsub('%a', string.upper, 1) ..'} task. You have to kill '.. task.kills ..' of '.. msg:lower() ..'. Come back and ask about {complete} when you are done.', cid)
            end
        else
            selfSay('It does seem like you don\'t understand me, I told you to pick task from list.', cid)
        end

        talkState[cid] = nil
    elseif msgcontains(msg, 'complete') then
        if getCreatureStorage(cid, STORAGE) == EMPTY_STORAGE then
            selfSay('You aren\'t doing any task at the moment, if you would like to start one - type {task}.', cid)
        else
            selfSay(' I forgot, which task did you just complete?', cid)
            talkState[cid] = TALKSTATE_COMPLETE
        end
    elseif talkState[cid] == TALKSTATE_COMPLETE then
        local task = tasks[msg:lower()]

        if task then
            local kills = getCreatureStorage(cid, task.storage)

            if kills <= task.kills then
                selfSay('You have to kill '.. task.kills ..' '.. msg:lower() ..' in order to complete the {'.. msg:lower() ..'} task, you have killed '.. kills ..' '.. msg:lower():gsub('%a', string.upper, 1) ..'.', cid)
            elseif kills == task.kills + TASKSTATE_COMPLETED then
                local msg = 'Congratulations! You have completed the {'.. msg:lower():gsub('%a', string.upper, 1) ..'} task. You receive {access to magic forcefield}'

                if task.experience > 0 then
                    doPlayerAddExperience(cid, task.experience)
                    msg = msg .. ' and {'.. task.experience ..' experience points}'
                end

                if #task.items > 0 then
                    msg = msg ..' and following items'

                    for k, v in ipairs(task.items) do
                        doPlayerAddItem(cid, v[1], v[2])
                        if k == 1 then
                            msg = msg ..' {'.. getItemInfo(v[1]).name ..'}'
                        else
                            msg = msg ..', {'.. getItemInfo(v[1]).name ..'}'
                        end
                    end
                end

                msg = msg ..' as a reward!'

                doCreatureSetStorage(cid, task.storage, task.kills + TASKSTATE_BOSS)
                doSendMagicEffect(getThingPosition(cid), CONST_ME_GIFT_WRAPS)
                selfSay(msg, cid)

                talkState[cid] = nil

                if not __achv.check(cid, 8) then
                    __achv.set(cid, 8, 1)
                end
            elseif kills == task.kills + TASKSTATE_BOSS then
                selfSay('You have already reported in about that task and received access to magic forcefield, go and kill boss.', cid)
            elseif kills == task.kills + TASKSTATE_FINALIZED then
                selfSay('This task has been already finalized and you can\'t pick it anymore.', cid)
            end
        else
            selfSay('There\'s no task named {'.. msg:lower() ..'}, please remind yourself what task you have started before or type {task} to see list of available tasks.', cid)
        end

        talkState[cid] = nil
    end

    return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:setMessage(MESSAGE_GREET, 'Hello, |PLAYERNAME|! I need someone to fufill a special {task} for me. If you have completed a task, please say {complete}, then the name of the task.')
npcHandler:addModule(FocusModule:new())
 
Sorry but i've maked one question, not statement.
Thank you so much for pointing out the difference between a statement and a question.
I'll make sure to differentiate between the two in the future.

Good luck finding a working script.
 
@Apoccalypse

I have already tested many Grizzly Adams scripts including the TFS distribution version and no one of them worked, so I am here asking for your help. I have a server 8.6 that I use TFS, however, I met this game in version 7.2 and would like to have a server of this version. It's just a distant wish to have a Task NPC running on this new project.

@Xikini
Thank you mate
 
Back
Top