• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action Unique Depot for Quest Items

Togu

Advanced OT User
Joined
Jun 22, 2018
Messages
308
Solutions
1
Reaction score
178
Location
Brazil
How it works:
You click on a chest of a quest and you reward will be sent to the depot you chose.

How to configure:
Click on the default chest quest (id's 1740, 1747, 1748, 1749) or on the container of the orc fortress quest (id 1738) or on the dead skeleton of the fire axe quest (id 3103) in your Remeres MapEditor and set action = 1000 or and unique id = item id (if its a one chest - one reward quest) or set a unique id > 30000 and configure the custom quest in the script following the given examples.

data/actions/actions.xml
XML:
<action actionid="1000" script="quests/allquests.lua" />/CODE]

data/actions/scripts/quest/allquests.lua
[CODE=lua]
function onUse(player, item, fromPosition, target, toPosition, isHotkey)

   local itemType = ItemType(item.uid)
   if itemType:getId() == 0 then
       return false
   end

   if player:getStorageValue(item.uid) == -1 then

       -- CUSTOM QUESTS
       if item.uid > 30000 then

           -- BEHE QUEST
           if item.uid == 30010 then
               player:addItem(item.uid, 1)
               player:getDepotChest(14, true):addItem(2171,1) -- platinum amulet
               player:getDepotChest(14, true):addItem(2168,1) -- life ring
               player:getDepotChest(14, true):addItem(2124,1) -- crystal ring
               player:getDepotChest(14, true):addItem(2145,3) -- 3 small diamonds
               player:getDepotChest(14, true):addItem(2146,4) -- 4 small sapphires
               player:setStorageValue(item.uid, 1)
               player:sendTextMessage(MESSAGE_INFO_DESCR, 'You have found a platinum amulet, a life ring, a crystal ring, 3 small diamonds and 4 small sapphires.')
               player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Items 'platinum amulet', 'life ring', 'crystal ring', '3 small diamonds' and '4 small sapphires' available in Quest Locker.")

           -- NECRO QUEST
           elseif item.uid == 30012 then
               player:addItem(item.uid, 1)
               player:getDepotChest(14, true):addItem(2656,1) -- blue robe
               player:getDepotChest(14, true):addItem(2436,1) -- skull staff
               player:setStorageValue(item.uid, 1)
               player:sendTextMessage(MESSAGE_INFO_DESCR, 'You have found a blue robe and a skull staff.')
               player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Items 'blue robe' and 'skull staff' available in Quest Locker.")

           -- FIRE AXE QUEST
           elseif item.uid == 30011 then
               player:addItem(item.uid, 1)
               player:getDepotChest(14, true):addItem(2145,7) -- small diamonds
               player:getDepotChest(14, true):addItem(2201,1) -- dragon necklace
               player:getDepotChest(14, true):addItem(2214,1) -- ring of healing
               player:setStorageValue(item.uid, 1)
               player:sendTextMessage(MESSAGE_INFO_DESCR, 'You have found 7 small diamonds, a dragon necklace and a ring of healing.')
               player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Items '7 small diamonds', 'dragon necklace' and 'ring of healing' available in Quest Locker.")
           end


       -- ONE REWARD PER CHEST QUESTS
       else
           if item.itemid == 1740 or item.itemid == 1747 or item.itemid == 1748 or item.itemid == 1749 or item.itemid == 1738 or item.itemid == 3103 then
               player:addItem(item.uid, 1)
               player:getDepotChest(14, true):addItem(item.uid,1)
               player:setStorageValue(item.uid, 1)
               player:sendTextMessage(MESSAGE_INFO_DESCR, 'You have found a ' .. itemType:getName() .. '.')
               player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Item '" ..itemType:getName() .. "' available in Quest Locker.")
           end
       end
   else
       player:sendTextMessage(MESSAGE_INFO_DESCR, "It is empty.")
   end
   return true
end
 
Forgot a [ before /code]
And i'd like to change the font to Arial Black
 
and remove "set action = 1000 or and unique id" the or
 
update:
Lua:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)

   local oneRewardContainers = {
       1740,    -- normal chest
       1747,    -- normal chest
       1748,    -- normal chest
       1749,    -- normal chest
       1738,    -- container box
       3103,    -- dead skeleton
    }

   local itemType = ItemType(item.uid)

   if player:getStorageValue(item.uid) == -1 then

       -- CUSTOM QUESTS
       if item.uid > 30000 then

           -- BEHE QUEST
           if item.uid == 30010 then
               player:addItem(item.uid, 1)
               player:getDepotChest(14, true):addItem(2171,1) -- platinum amulet
               player:getDepotChest(14, true):addItem(2168,1) -- life ring
               player:getDepotChest(14, true):addItem(2124,1) -- crystal ring
               player:getDepotChest(14, true):addItem(2145,3) -- 3 small diamonds
               player:getDepotChest(14, true):addItem(2146,4) -- 4 small sapphires
               player:setStorageValue(item.uid, 1)
               player:sendTextMessage(MESSAGE_INFO_DESCR, 'You have found a platinum amulet, a life ring, a crystal ring, 3 small diamonds and 4 small sapphires.')
               player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Items 'platinum amulet', 'life ring', 'crystal ring', '3 small diamonds' and '4 small sapphires' available in Quest Locker.")

           -- NECRO QUEST
           elseif item.uid == 30012 then --and item.itemid == 1410  and item.actionid == 1000 then
               player:addItem(item.uid, 1)
               player:getDepotChest(14, true):addItem(2656,1) -- blue robe
               player:getDepotChest(14, true):addItem(2436,1) -- skull staff
               player:setStorageValue(item.uid, 1)
               player:sendTextMessage(MESSAGE_INFO_DESCR, 'You have found a blue robe and a skull staff.')
               player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Items 'blue robe' and 'skull staff' available in Quest Locker.")

           -- FIRE AXE QUEST
           elseif item.uid == 30011 then
               player:addItem(item.uid, 1)
               player:getDepotChest(14, true):addItem(2145,7) -- small diamonds
               player:getDepotChest(14, true):addItem(2201,1) -- dragon necklace
               player:getDepotChest(14, true):addItem(2214,1) -- ring of healing
               player:setStorageValue(item.uid, 1)
               player:sendTextMessage(MESSAGE_INFO_DESCR, 'You have found 7 small diamonds, a dragon necklace and a ring of healing.')
               player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Items '7 small diamonds', 'dragon necklace' and 'ring of healing' available in Quest Locker.")
           end


       -- ONE REWARD PER CHEST QUESTS
       else
           if isInArray(oneRewardContainers, item.itemid) then
               player:addItem(item.uid, 1)
               player:getDepotChest(14, true):addItem(item.uid,1)
               player:setStorageValue(item.uid, 1)
               player:sendTextMessage(MESSAGE_INFO_DESCR, 'You have found a ' .. itemType:getName() .. '.')
               player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Item '" ..itemType:getName() .. "' available in Quest Locker.")
           end
       end
   else
       player:sendTextMessage(MESSAGE_INFO_DESCR, "It is empty.")
   end
   return true
end
 
Back
Top