• 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!

Request - Daily Task - Simple or Configurable TFS 1.3

Taurus

Texass
Joined
Jan 11, 2009
Messages
616
Solutions
2
Reaction score
30
Location
United States
I want to make my own dailys, I need a script that I can re-use multiple times. I have tried to create my own from the warzones because that is exactly what I want. I want to make my own warzones.

However, no matter how I try to use what is there it never works, not the movement, nothing.

Basically I need this:
1. A teleport that you can only go thru once a day. (timed storage)
2. A script for when they kill the boss set the storage where they can enter door or tp.

I'd really like it to be like the warzones, when you enter TP it should spawn the boss (it would be nice to spawn other monsters, too.) and after certain amount of time if it can kick them from the room, like the warzones that would be great.

Thank you to whoever can help me get this, or share their working scripts with me. I will be using it on a server that doesn't accept any donations, we are a npvp community that is growing. I really appreciate your contribution to our server.
 
I hope this code serves your teleport
data/moveevents/scripts/warzonetp.lua

Lua:
    local config = {
    timeWait = (60 * 60 * 20),
    nextWarZone = Position(0, 0, 0),
    storageTime = 25240 }

    function onStepIn(player, item, position, fromPosition)
    if player:getStorageValue(config.storageTime) <= os.time() then
    player:teleportTo(config.nextWarZone, false)
    player:setStorageValue(config.storageTime, (os.time() + config.timeWait))
    player:sendTextMessage(MESSAGE_STATUS_SMALL, 'Bienvenido a la war zone.')
    else
    player:teleportTo(fromPosition, false)
    player:sendTextMessage(MESSAGE_STATUS_SMALL, 'Aun no puedes entrar a la war zone, tienes que esperar al menos 20 horas.')
    end
    return true
    end
 
I hope this code serves your teleport
data/moveevents/scripts/warzonetp.lua

Lua:
    local config = {
    timeWait = (60 * 60 * 20),
    nextWarZone = Position(0, 0, 0),
    storageTime = 25240 }

    function onStepIn(player, item, position, fromPosition)
    if player:getStorageValue(config.storageTime) <= os.time() then
    player:teleportTo(config.nextWarZone, false)
    player:setStorageValue(config.storageTime, (os.time() + config.timeWait))
    player:sendTextMessage(MESSAGE_STATUS_SMALL, 'Bienvenido a la war zone.')
    else
    player:teleportTo(fromPosition, false)
    player:sendTextMessage(MESSAGE_STATUS_SMALL, 'Aun no puedes entrar a la war zone, tienes que esperar al menos 20 horas.')
    end
    return true
    end
I appreciate that, it's a start for sure. I'd still be down to see any scripts someone else could show that might actually spawn the boss as they step in.

Thanks very much.
 
1. A teleport that you can only go thru once a day. (timed storage)

Code:
  local config = {
    timeWait = (60 * 60 * 20), // time to next quest.
    QuestPos = Position(0, 0, 0), // the location of the quest.
    storageTime = 25240, // storage
    Boss = ferumbras } // name of boss.

    function onStepIn(player, item, position, fromPosition)
    if player:getStorageValue(config.storageTime) <= os.time() then
    player:teleportTo(config.QuestPos, false)
    player:setStorageValue(config.storageTime, (os.time() + config.timeWait))
    player:sendTextMessage(MESSAGE_STATUS_SMALL, 'Welcome to quest.')
    addEvent(function()
    Game.createMonster(config.Boss, config.QuestPoss)
            end, 30000)
    else
    player:teleportTo(fromPosition, false)
    player:sendTextMessage(MESSAGE_STATUS_SMALL, 'You have to wait 20 hours before enter this room again.')
    end
    return true
    end
 
2. A script for when they kill the boss set the storage where they can enter door or tp.

Code:
function onKill(creature, target)
    local targetMonster = target:getMonster()
    if not targetMonster then
        return true
    end

    for pid, _ in pairs(targetMonster:getDamageMap()) do
        local attackerPlayer = Player(pid)
        if attackerPlayer then
            if attackerPlayer:getStorageValue(7777) < 1
                attackerPlayer:setStorageValue(7777, 1)
            end
        end
    end
end
 
1. A teleport that you can only go thru once a day. (timed storage)

Code:
  local config = {
    timeWait = (60 * 60 * 20), // time to next quest.
    QuestPos = Position(0, 0, 0), // the location of the quest.
    storageTime = 25240, // storage
    Boss = ferumbras } // name of boss.

    function onStepIn(player, item, position, fromPosition)
    if player:getStorageValue(config.storageTime) <= os.time() then
    player:teleportTo(config.QuestPos, false)
    player:setStorageValue(config.storageTime, (os.time() + config.timeWait))
    player:sendTextMessage(MESSAGE_STATUS_SMALL, 'Welcome to quest.')
    addEvent(function()
    Game.createMonster(config.Boss, config.QuestPoss)
            end, 30000)
    else
    player:teleportTo(fromPosition, false)
    player:sendTextMessage(MESSAGE_STATUS_SMALL, 'You have to wait 20 hours before enter this room again.')
    end
    return true
    end
2. A script for when they kill the boss set the storage where they can enter door or tp.

Code:
function onKill(creature, target)
    local targetMonster = target:getMonster()
    if not targetMonster then
        return true
    end

    for pid, _ in pairs(targetMonster:getDamageMap()) do
        local attackerPlayer = Player(pid)
        if attackerPlayer then
            if attackerPlayer:getStorageValue(7777) < 1
                attackerPlayer:setStorageValue(7777, 1)
            end
        end
    end
end
They both work. I do need to make it where a team can enter the tp without spawning multiple bosses. I'm going to continue working with these as well. Thanks for contributing them because they are very basic scripts that I can learn a lot from.

Cheers to anyone who can make this work for a team, because that's what we do on CCOT. :)
 
Last edited:
Well, then you want that when you go through the portal automatically several creatures appear inside the war zone?
omgosh I just saw your post. Yes, that would be fantastic. And is it possible to make it where it doesn't continue to spawn monsters for each player that enters? :p (like the warzones)

Thanks so much to all for helping!
 
post your current script to see what i can aport
Lua:
if not warzoneConfig then
    warzoneConfig = {
        -- Warzone
        [45700] = {  -- action do movement
            center = Position(33117, 31956, 11),   -- centro da room do boss
            rangeX = 27, rangeY = 25,

            boss = "Gnomevil",   -- nome do boss
            teleportTo = Position(33106, 31955, 11),   -- Local onde o player será teleportado dentro da room
            locked = false,

            storage = 790014,    -- storage
            interval = 10 * 60 * 60,

            exit = Position(33001, 31900, 9)   -- Exit padrão
        },
     
     
        -- Warzone
        [45702] = {  -- action do movement
            center = Position(33110, 31965, 10), -- centro da room do boss
            rangeX = 26, rangeY = 25,

            boss = "Deathstrike",   -- nome do boss
            teleportTo = Position(33096, 31955, 10),   -- Local onde o player será teleportado dentro da room
            locked = false,

            storage = 790015,    -- storage
            interval = 10 * 60 * 60,

            exit = Position(33001, 31900, 9)   -- Exit padrão
        },
     
        -- Warzone
        [45701] = {  -- action do movement
            center = Position(33090, 31910, 12),
            rangeX = 20, rangeY = 20,

            boss = "Abyssador",   -- nome do boss
            teleportTo = Position(33083, 31904, 12),  -- Local onde o player será teleportado dentro da room
            locked = false,

            storage = 790016,    -- storage
            interval = 10 * 60 * 60,

            exit = Position(33001, 31900, 9)   -- Exit padrão
        }
     
     
    }

    warzoneConfig.findByName = function(name, last)
        local i, v = next(warzoneConfig, last)
        if type(v) == 'table' and v.boss == name then
            return v
        elseif not i then
            return nil
        end
        return warzoneConfig.findByName(name, i)
    end
end

local function filter(list, f, i)
    if i < #list then
        if f(list[i]) then
            return list[i], filter(list, f, i + 1)
        else
            return filter(list, f, i + 1)
        end
    elseif list[i] and f(list[i]) then
        return list[i]
    end
end

function onStepIn(creature, item, pos, fromPosition)
    if not creature:isPlayer() then
        creature:teleportTo(fromPosition)
        return false
    end

    local info = warzoneConfig[item:getActionId()]
    if not info then
        return false
    end

    if  creature:getStorageValue(info.storage) > os.time() then
        creature:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You have already cleared this warzone in the last ten hours.")
        creature:teleportTo(fromPosition)
        return false
    end

    if info.locked then
        creature:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Please, wait a minute until the room is cleared.")
        creature:teleportTo(fromPosition)
        return false
    end

    creature:teleportTo(info.teleportTo)
    local spectators = Game.getSpectators(info.center, false, false, 0, info.rangeX, 0, info.rangeY)
    if not filter(spectators, function(c) return c:isMonster() end, 1) then
        local boss = Game.createMonster(info.boss, info.center)
        boss:registerEvent('WarzoneBossDeath')
    end

    return true
end


The kill event:
Lua:
local function resetWarzone(info)
    info.locked = false
    local spectators = Game.getSpectators(info.center, false, true, 0, info.rangeX, 0, info.rangeY)
    for i = 1, #spectators do
        spectators[i]:teleportTo(info.exit)
    end
end

function onDeath(creature, corpse, lasthitkiller, mostdamagekiller, lasthitunjustified, mostdamageunjustified)
    local info = warzoneConfig.findByName(creature:getName())
    if not info then
        return true
    end

    info.locked = true
    local spectators = Game.getSpectators(info.center, false, true, 0, info.rangeX, 0, info.rangeY)
    for i = 1, #spectators do
        spectators[i]:setStorageValue(info.storage, os.time() + info.interval)
        spectators[i]:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You have one minute to loot the boss and leave the room.")
    end

    addEvent(resetWarzone, 60 * 1000, info)

    return true
end

And the reward:
Lua:
local rewards = {
    [3148] = {
        storage = Storage.BigfootBurden.Warzone1Reward,
        bossName = 'Deathstrike',
        items = {
            {rand = true, itemId = {18396, 18501, 18502, 18503}},
            {itemId = 18402, count = 750},
            {itemId = 18396},
            {itemId = 2160, count = 3},
            {itemId = 18415, count = 7},
            {itemId = 18423, count = 2}
        },
        achievement = {'Final Strike', 'Death on Strike'}
    },
    [3149] = {
        storage = Storage.BigfootBurden.Warzone2Reward,
        bossName = 'Gnomevil',
        items = {
            {rand = true, itemId = {18505, 18506, 18507}},
            {itemId = 18407, count = 750},
            {itemId = 18396},
            {itemId = 2160, count = 4},
            {itemId = 18413, count = 10},
            {itemId = 18423, count = 2}
        },
        miniatureHouse = true,
        achievement = {'Gnomebane\'s Bane', 'Fall of the Fallen'}
    },
    [3150] = {
        storage = Storage.BigfootBurden.Warzone3Reward,
        bossName = 'Abyssador',
        items = {
            {rand = true, itemId = {18497, 18498, 18499}},
            {itemId = 18408},
            {itemId = 18396},
            {itemId = 2160, count = 5},
            {itemId = 18414, count = 12},
            {itemId = 18423, count = 2}
        },
        achievement = {'Death from Below', 'Diplomatic Immunity'}
    }
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if item.uid == 3147 then
        if player:getStorageValue(Storage.BigfootBurden.WarzoneStatus) == 4 then
            player:setStorageValue(Storage.BigfootBurden.WarzoneStatus, 5)
            player:addItem(2137, 1)
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have found some golden fruits.')
        else
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'The chest is empty.')
        end
    elseif item.uid > 3147 and item.uid < 3151 then
        local reward = rewards[item.uid]
        if not reward then
            return true
        end

        if player:getStorageValue(reward.storage) ~= 1 then
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, reward.bossName .. ' defends his belongings and will not let you open his chest.')
            return true
        end

        local backpack = player:getSlotItem(CONST_SLOT_BACKPACK)
        if backpack and backpack:getEmptySlots(false) < 5
                or player:getFreeCapacity() < 100 then
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'Please make sure that you have at least 5 free inventory slots and that you can carry on additional 100 oz.')
            return true
        end

        for i = 1, #reward.items do
            local items = reward.items[i]
            if items.rand then
                if math.random(10) == 1 then
                    player:addItem(items.itemId[math.random(#items.itemId)], 1)
                end
            else
                player:addItem(items.itemId, items.count or 1)
            end
        end

        if reward.miniatureHouse then
            if math.random(25) == 1 then
                player:addItem(16619, 1)
            end
        end

        player:setStorageValue(reward.storage, 0)
        player:addAchievement(reward.achievement[1])
        player:addAchievementProgress(reward.achievement[2], 50)
    end
    return true
end

This is the warzone script from my distro. I have tried to change the values and call it from another actionid but it wouldn't do anything. I can't tell what I missed.

Can you show me how to alter this so I can re-use it?
 
Last edited:
you wan tsomething like the wz's, enter a teleport, wait 30 seconds, summon boss, all the "attackers" get a reward?
give me all the parameters to do it.
how manny players can enter?
how manny time can be killed this boss?
rewards? etc
 
Back
Top