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

TFS 1.2 (Task and Exp Share)

bobxM

Nostalrius Team
Joined
Jul 12, 2012
Messages
137
Reaction score
9
Location
Brazil
Hello guys,

Today if you make a group to hunt in the experience sharing mode, only one player will get the task in each monster dead. How I can change it in the TFS source to the entire group get the task in each monster dead ?

Thank you in advanced.
 
Use Creature:getDamageMap() to give all the players that gave damage to the monster the storage value.
 
hi, how can I use this damage map on this script @WibbenZ
Lua:
function onKill(player, target)
    if target:isPlayer()  or target:getMaster() then
        return true
    end

    local mon_name = target:getName():lower()

    local ret_t = getTaskInfos(player)
    if ret_t then
        if mon_name == ret_t.name or isInArray(ret_t.mons_list, mon_name) then
        local sto_value = player:getStorageValue(ret_t.storage)
            if sto_value < ret_t.amount then
                sto_value = sto_value + 1
                player:setStorageValue(ret_t.storage, sto_value)
                if sto_value < ret_t.amount then
                    player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, 'You have killed '..(sto_value)..' of '..ret_t.amount..' '..mon_name..'s.')
                else
                    player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, 'You finished your task.')
                end
            end
        end
    end

    local ret_td = getTaskDailyInfo(player)
    if ret_td then
        if mon_name == ret_td.name or isInArray(ret_td.mons_list, mon_name) then
            local sto_value = player:getStorageValue(ret_td.storage)
            if sto_value < ret_td.amount then
                sto_value = sto_value + 1
                player:setStorageValue(ret_td.storage, sto_value)
                if sto_value < ret_td.amount then
                    player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, 'You have killed '..(sto_value)..' of '..ret_td.amount..' '..mon_name..'s.')
                else
                    player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, 'You finished your task.')
                end
            end
        end
    end

    return true
end
 
hi, how can I use this damage map on this script @WibbenZ
Lua:
function onKill(player, target)
    if target:isPlayer()  or target:getMaster() then
        return true
    end

    local mon_name = target:getName():lower()

    local ret_t = getTaskInfos(player)
    if ret_t then
        if mon_name == ret_t.name or isInArray(ret_t.mons_list, mon_name) then
        local sto_value = player:getStorageValue(ret_t.storage)
            if sto_value < ret_t.amount then
                sto_value = sto_value + 1
                player:setStorageValue(ret_t.storage, sto_value)
                if sto_value < ret_t.amount then
                    player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, 'You have killed '..(sto_value)..' of '..ret_t.amount..' '..mon_name..'s.')
                else
                    player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, 'You finished your task.')
                end
            end
        end
    end

    local ret_td = getTaskDailyInfo(player)
    if ret_td then
        if mon_name == ret_td.name or isInArray(ret_td.mons_list, mon_name) then
            local sto_value = player:getStorageValue(ret_td.storage)
            if sto_value < ret_td.amount then
                sto_value = sto_value + 1
                player:setStorageValue(ret_td.storage, sto_value)
                if sto_value < ret_td.amount then
                    player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, 'You have killed '..(sto_value)..' of '..ret_td.amount..' '..mon_name..'s.')
                else
                    player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, 'You finished your task.')
                end
            end
        end
    end

    return true
end

This is an example of how you can use this function; orts/server (https://github.com/orts/server/blob/390edf6921500180ab3a51d27396ed17ebf57676/data/creaturescripts/scripts/quests/bigfoot%20burden/WarzoneKill.lua#L18-L27)
 
Back
Top