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

Solved Ferumbras' amulet remove storage at home.

Majster12

Member
Joined
Feb 20, 2009
Messages
134
Solutions
1
Reaction score
16
Use of this amulet gives random 1000 Hit Points or 1000 Mana Points. It has 1h cooldown. Note: You have to be online and have equipped the amulet. Also it recharges if you leave at home

I'ts even possible to remove storage when you leave item at home?
Also no errors in console but don't work as it should.

Code:
local config = {
    time = 1,
    storage = 200011
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if player:getStorageValue(config.storage) >= os.time() then
        player:sendTextMessage(MESSAGE_INFO_DESCR, "You need to wait 1 more hour before using it.")
        return true
    end
    player:setStorageValue(config.storage, os.time() + config.time * 3600)
if getPlayerSlotItem(cid, CONST_SLOT_AMULET).itemid == 25423 then
                local chance = math.random(1, 2)
                if chance == 1 then
                doCreatureAddHealth(cid, 1000)
                item:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED)
                else
                doCreatureAddMana(cid, 1000)
                item:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
            end
    return true
end
end
 
Check:
Code:
local config = {
    time = 1,
    storage = 200011
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local playerPos = player:getPosition()
    local chance = math.random(1, 2)
 
    if player:getStorageValue(config.storage) >= os.time() then
        return player:sendTextMessage(MESSAGE_INFO_DESCR, "You need to wait 1 more hour before using it.")
    end
 
    local amulet = player:getSlotItem(CONST_SLOT_NECKLACE)
    if amulet and amulet.itemid == 25423 then
        if chance == 1 then
            player:addHealth(1000)
            playerPos:sendMagicEffect(CONST_ME_MAGIC_RED)
        else
            player:addMana(1000)
            playerPos:sendMagicEffect(CONST_ME_MAGIC_BLUE)
        end
           player:setStorageValue(config.storage, os.time() + 60 * 60)
    end
    return false
end
 
Last edited:
Check:
Code:
local config = {
    time = 1,
    storage = 200011
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local playerPos = player:getPosition()
    local chance = math.random(1, 2)
 
    if player:getStorageValue(config.storage) >= os.time() then
        return player:sendTextMessage(MESSAGE_INFO_DESCR, "You need to wait 1 more hour before using it.")
    end
  
    local amulet = player:getSlotItem(CONST_SLOT_NECKLACE)
    if amulet and amulet.itemid == 25423 then
        if chance == 1 then
            player:addHealth(1000)
            playerPos:sendMagicEffect(CONST_ME_MAGIC_RED)
        else
            player:addMana(1000)
            playerPos:sendMagicEffect(CONST_ME_MAGIC_BLUE)
            player:setStorageValue(config.storage, os.time() + 60 * 60)
        end
    end
    return false
end

Code:
local config = {
    time = 1,
    storage = 200011
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local playerPos = player:getPosition()
    local chance = math.random(1, 2)
 
    if player:getStorageValue(config.storage) >= os.time() then
        return player:sendTextMessage(MESSAGE_INFO_DESCR, "You need to wait 1 more hour before using it.")
    end
  
    local amulet = player:getSlotItem(CONST_SLOT_NECKLACE)
    if amulet and amulet.itemid == 25423 then
        if chance == 1 then
            player:addHealth(1000)
            playerPos:sendMagicEffect(CONST_ME_MAGIC_RED)
            player:setStorageValue(config.storage, os.time() + 60 * 60)
        else
            player:addMana(1000)
            playerPos:sendMagicEffect(CONST_ME_MAGIC_BLUE)
            player:setStorageValue(config.storage, os.time() + 60 * 60)
        end
    end
    return false
end

Thanks! Working as it should.
You have any idea how to remove storage at house?
 
Check:
Code:
local config = {
    time = 1,
    storage = 200011
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local playerPos = player:getPosition()
    local chance = math.random(1, 2)
 
    if player:getStorageValue(config.storage) >= os.time() then
        return player:sendTextMessage(MESSAGE_INFO_DESCR, "You need to wait 1 more hour before using it.")
    end
  
    local amulet = player:getSlotItem(CONST_SLOT_NECKLACE)
    if amulet and amulet.itemid == 25423 then
        if chance == 1 then
            player:addHealth(1000)
            playerPos:sendMagicEffect(CONST_ME_MAGIC_RED)
        else
            player:addMana(1000)
            playerPos:sendMagicEffect(CONST_ME_MAGIC_BLUE)
            player:setStorageValue(config.storage, os.time() + 60 * 60)
        end
    end
    return false
end
player:setStorageValue(config.storage, os.time() + 60 * 60) that should be outside
 
Back
Top Bottom