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

Soulwar quest chest

delikerem

Member
Joined
Jan 9, 2020
Messages
91
Solutions
1
Reaction score
13
Hello,

Could anyone help me with a quest chest that works just like soulwar chest?

The player that clicks on The chest will just get one item out of let say 5 and an outfit but this will be a one time thing.

Thanks for The help in advance.
 
Solution
Hello,

Could anyone help me with a quest chest that works just like soulwar chest?

The player that clicks on The chest will just get one item out of let say 5 and an outfit but this will be a one time thing.

Thanks for The help in advance.
Lua:
local rewards = {
    { id = 38917, name = "Soulcutter" },
    { id = 38918, name = "Soulshredder" },
    { id = 38919, name = "Soulbiter" },
    { id = 38920, name = "Souleater" },
    { id = 38921, name = "Soulcrusher" },
    { id = 38922, name = "Soulmaimer" },
    { id = 38923, name = "Soulbleeder" },
    { id = 38924, name = "Soulpiercer" },
    { id = 38925, name = "Soultainter" },
    { id = 38926, name = "Soulhexer" },
    { id = 38927, name = "Soulshanks" },
    { id = 38928...
Hello,

Could anyone help me with a quest chest that works just like soulwar chest?

The player that clicks on The chest will just get one item out of let say 5 and an outfit but this will be a one time thing.

Thanks for The help in advance.
Lua:
local rewards = {
    { id = 38917, name = "Soulcutter" },
    { id = 38918, name = "Soulshredder" },
    { id = 38919, name = "Soulbiter" },
    { id = 38920, name = "Souleater" },
    { id = 38921, name = "Soulcrusher" },
    { id = 38922, name = "Soulmaimer" },
    { id = 38923, name = "Soulbleeder" },
    { id = 38924, name = "Soulpiercer" },
    { id = 38925, name = "Soultainter" },
    { id = 38926, name = "Soulhexer" },
    { id = 38927, name = "Soulshanks" },
    { id = 38928, name = "Soulstrider" },
    { id = 38929, name = "Soulshell" },
    { id = 38930, name = "Soulmantel" },
    { id = 38931, name = "Soulshroud" },
    { id = 38932, name = "Pair of Soulwalkers" },
    { id = 38933, name = "Pair of Soulstalkers" },
    { id = 38934, name = "Soulbastion" }
}


local inSoulWarReward = Action()
function inSoulWarReward.onUse(player, item, fromPosition, target, toPosition, isHotkey)

    if(player:getStorageValue(1029) == 1) then
    
        local randId = math.random(1, #rewards)
        local rewardItem = rewards[randId]
        player:addItem(rewardItem.id, 1)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You received a ' .. rewardItem.name .. '.')
        player:setStorageValue(1029,2)
    
        player:addOutfitAddon(1323, 2)
        player:addOutfitAddon(1323, 1)
        player:addOutfitAddon(1322, 1)
        player:addOutfitAddon(1322, 2)

    else       
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Ja pegou o item")
        player:addOutfitAddon(1323, 2)
        player:addOutfitAddon(1323, 1)
        player:addOutfitAddon(1322, 1)
        player:addOutfitAddon(1322, 2)
    end   

    return true
end   

inSoulWarReward:uid(60116)
inSoulWarReward:register()
 
Solution
local rewards = {
{ id = 38917, name = "Soulcutter" },
{ id = 38918, name = "Soulshredder" },
{ id = 38919, name = "Soulbiter" },
{ id = 38920, name = "Souleater" },
{ id = 38921, name = "Soulcrusher" },
{ id = 38922, name = "Soulmaimer" },
{ id = 38923, name = "Soulbleeder" },
{ id = 38924, name = "Soulpiercer" },
{ id = 38925, name = "Soultainter" },
{ id = 38926, name = "Soulhexer" },
{ id = 38927, name = "Soulshanks" },
{ id = 38928, name = "Soulstrider" },
{ id = 38929, name = "Soulshell" },
{ id = 38930, name = "Soulmantel" },
{ id = 38931, name = "Soulshroud" },
{ id = 38932, name = "Pair of Soulwalkers" },
{ id = 38933, name = "Pair of Soulstalkers" },
{ id = 38934, name = "Soulbastion" }
}

local inSoulWarReward = Action()

function inSoulWarReward.onUse(player, item, fromPosition, target, toPosition, isHotkey)

if(player:getStorageValue(1029) == 1) then
local randId = math.random(1, #rewards)
local rewardItem = rewards[randId]
player:addItem(rewardItem.id, 1)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You received a ' .. rewardItem.name .. '.')
player:setStorageValue(1029,2)

player:addOutfitAddon(1323, 2)
player:addOutfitAddon(1323, 1)
player:addOutfitAddon(1322, 1)
player:addOutfitAddon(1322, 2)
else
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Ja pegou o item")

player:addOutfitAddon(1323, 2)
player:addOutfitAddon(1323, 1)
player:addOutfitAddon(1322, 1)
player:addOutfitAddon(1322, 2)

end

return true
end

inSoulWarReward:uid(60116)
inSoulWarReward:register()
Hey thx for The help but i forgot to write If it works with tfx 1.4?
 
it says its empty, maybe because i havent done the quest or got the storage from the quest but is there a way to remove it so i can just put it in the end of a custom quest and let the players get a random item without getting the storage?
 
it says its empty, maybe because i havent done the quest or got the storage from the quest but is there a way to remove it so i can just put it in the end of a custom quest and let the players get a random item without getting the storage?
Lua:
local rewards = {
{ id = 38917, name = "Soulcutter" },
{ id = 38918, name = "Soulshredder" },
{ id = 38919, name = "Soulbiter" },
{ id = 38920, name = "Souleater" },
{ id = 38921, name = "Soulcrusher" },
{ id = 38922, name = "Soulmaimer" },
{ id = 38923, name = "Soulbleeder" },
{ id = 38924, name = "Soulpiercer" },
{ id = 38925, name = "Soultainter" },
{ id = 38926, name = "Soulhexer" },
{ id = 38927, name = "Soulshanks" },
{ id = 38928, name = "Soulstrider" },
{ id = 38929, name = "Soulshell" },
{ id = 38930, name = "Soulmantel" },
{ id = 38931, name = "Soulshroud" },
{ id = 38932, name = "Pair of Soulwalkers" },
{ id = 38933, name = "Pair of Soulstalkers" },
{ id = 38934, name = "Soulbastion" }
}

local inSoulWarReward = Action()

function inSoulWarReward.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local randId = math.random(1, #rewards)
    local rewardItem = rewards[randId]
    player:addItem(rewardItem.id, 1)
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You received a ' .. rewardItem.name .. '.')

    player:addOutfitAddon(1323, 2)
    player:addOutfitAddon(1323, 1)
    player:addOutfitAddon(1322, 1)
    player:addOutfitAddon(1322, 2)

    return true
end

inSoulWarReward:uid(60116)
inSoulWarReward:register()
 
Lua:
local rewards = {
{ id = 38917, name = "Soulcutter" },
{ id = 38918, name = "Soulshredder" },
{ id = 38919, name = "Soulbiter" },
{ id = 38920, name = "Souleater" },
{ id = 38921, name = "Soulcrusher" },
{ id = 38922, name = "Soulmaimer" },
{ id = 38923, name = "Soulbleeder" },
{ id = 38924, name = "Soulpiercer" },
{ id = 38925, name = "Soultainter" },
{ id = 38926, name = "Soulhexer" },
{ id = 38927, name = "Soulshanks" },
{ id = 38928, name = "Soulstrider" },
{ id = 38929, name = "Soulshell" },
{ id = 38930, name = "Soulmantel" },
{ id = 38931, name = "Soulshroud" },
{ id = 38932, name = "Pair of Soulwalkers" },
{ id = 38933, name = "Pair of Soulstalkers" },
{ id = 38934, name = "Soulbastion" }
}

local inSoulWarReward = Action()

function inSoulWarReward.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local randId = math.random(1, #rewards)
    local rewardItem = rewards[randId]
    player:addItem(rewardItem.id, 1)
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You received a ' .. rewardItem.name .. '.')

    player:addOutfitAddon(1323, 2)
    player:addOutfitAddon(1323, 1)
    player:addOutfitAddon(1322, 1)
    player:addOutfitAddon(1322, 2)

    return true
end

inSoulWarReward:uid(60116)
inSoulWarReward:register()
Thx i will try it
 
Lua:
local rewards = {
{ id = 38917, name = "Soulcutter" },
{ id = 38918, name = "Soulshredder" },
{ id = 38919, name = "Soulbiter" },
{ id = 38920, name = "Souleater" },
{ id = 38921, name = "Soulcrusher" },
{ id = 38922, name = "Soulmaimer" },
{ id = 38923, name = "Soulbleeder" },
{ id = 38924, name = "Soulpiercer" },
{ id = 38925, name = "Soultainter" },
{ id = 38926, name = "Soulhexer" },
{ id = 38927, name = "Soulshanks" },
{ id = 38928, name = "Soulstrider" },
{ id = 38929, name = "Soulshell" },
{ id = 38930, name = "Soulmantel" },
{ id = 38931, name = "Soulshroud" },
{ id = 38932, name = "Pair of Soulwalkers" },
{ id = 38933, name = "Pair of Soulstalkers" },
{ id = 38934, name = "Soulbastion" }
}

local inSoulWarReward = Action()

function inSoulWarReward.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local randId = math.random(1, #rewards)
    local rewardItem = rewards[randId]
    player:addItem(rewardItem.id, 1)
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You received a ' .. rewardItem.name .. '.')

    player:addOutfitAddon(1323, 2)
    player:addOutfitAddon(1323, 1)
    player:addOutfitAddon(1322, 1)
    player:addOutfitAddon(1322, 2)

    return true
end

inSoulWarReward:uid(60116)
inSoulWarReward:register()
from this script i keep getting an item (random) but it should be only 1 time thing like the real quest
 
from this script i keep getting an item (random) but it should be only 1 time thing like the real quest
That's where the storage comes into play, so you can track whether or not someone has completed this action before.

Set 45001 to any storage you've never used before.
Lua:
function inSoulWarReward.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if player:getStorageValue(45001) == 1 then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'It is empty.')
        return false
    end
    player:setStorageValue(45001, 1)

    local randId = math.random(1, #rewards)
    local rewardItem = rewards[randId]
    player:addItem(rewardItem.id, 1, true) -- added true, so that it will drop on floor if no space or cap
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You received a ' .. rewardItem.name .. '.')

    player:addOutfitAddon(1323, 2)
    player:addOutfitAddon(1323, 1)
    player:addOutfitAddon(1322, 1)
    player:addOutfitAddon(1322, 2)

    return true
end
 
That's where the storage comes into play, so you can track whether or not someone has completed this action before.

Set 45001 to any storage you've never used before.
Lua:
function inSoulWarReward.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if player:getStorageValue(45001) == 1 then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'It is empty.')
        return false
    end
    player:setStorageValue(45001, 1)

    local randId = math.random(1, #rewards)
    local rewardItem = rewards[randId]
    player:addItem(rewardItem.id, 1, true) -- added true, so that it will drop on floor if no space or cap
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You received a ' .. rewardItem.name .. '.')

    player:addOutfitAddon(1323, 2)
    player:addOutfitAddon(1323, 1)
    player:addOutfitAddon(1322, 1)
    player:addOutfitAddon(1322, 2)

    return true
end
could you paste it in the full code please?
 
Lua:
local rewards = {
    { id = 38917, name = "Soulcutter" },
    { id = 38918, name = "Soulshredder" },
    { id = 38919, name = "Soulbiter" },
    { id = 38920, name = "Souleater" },
    { id = 38921, name = "Soulcrusher" },
    { id = 38922, name = "Soulmaimer" },
    { id = 38923, name = "Soulbleeder" },
    { id = 38924, name = "Soulpiercer" },
    { id = 38925, name = "Soultainter" },
    { id = 38926, name = "Soulhexer" },
    { id = 38927, name = "Soulshanks" },
    { id = 38928, name = "Soulstrider" },
    { id = 38929, name = "Soulshell" },
    { id = 38930, name = "Soulmantel" },
    { id = 38931, name = "Soulshroud" },
    { id = 38932, name = "Pair of Soulwalkers" },
    { id = 38933, name = "Pair of Soulstalkers" },
    { id = 38934, name = "Soulbastion" }
}

local inSoulWarReward = Action()

function inSoulWarReward.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if player:getStorageValue(45001) == 1 then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'It is empty.')
        return false
    end

    player:setStorageValue(45001, 1)

    local randId = math.random(1, #rewards)
    local rewardItem = rewards[randId]

    player:addItem(rewardItem.id, 1, true) -- added true, so that it will drop on floor if no space or cap
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You received a ' .. rewardItem.name .. '.')

    player:addOutfitAddon(1323, 2)
    player:addOutfitAddon(1323, 1)
    player:addOutfitAddon(1322, 1)
    player:addOutfitAddon(1322, 2)

    return true
end

inSoulWarReward:uid(60116)
inSoulWarReward:register()
 
Back
Top