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

Action Xikini's "Easy Chest System" for 0.3.7 (most likely works on 0.3.6 & 0.4 as well.)

Xikini

I whore myself out for likes
Senator
Premium User
Joined
Nov 17, 2010
Messages
6,798
Solutions
581
Reaction score
5,361
I was constantly creating quest chest/items/altars/whatever.. and always had to create a new script for each one.
This was getting annoying, and tedious, so I took 3-4 days and created this "Easy Chest System", so I would never have to make a small tedious script again.
I like to give back to the community, and this is by far the hardest script I have completed to date.
There is most likely room for improvement inside the script itself, but I have finished it to the best of my ability, and have fully tested the system for 0.3.7

Although you can place aid's on anything, such as a tree/rock/door/wall, throughout my explanations I will simply say 'chest', to make it easier to understand.

In order to use this system effectively, you will require (at the minimum) an intermediate grasp on tables, and how to troubleshoot table error's.

With this system you will be able to do the following,

  • Timed Quest -> (aka: Daily Quests) A chest that can be re-used after x amount of time.
  • Simple Chests -> Give a single item.
  • Multi-Item Chests -> Give a container with multiple items inside.
  • Multi-Multi-Item Chests -> Give a container, with multiple items inside, which also contains another container, which also contains multiple items.
    • (For example: A backpack, filled with backpacks, filled with sd's. (400 sd's)
  • Simple keys -> Give a key with an aid attached to it.
  • Simple Quest items -> Give an item with an uid attached to it.
  • flavourText any item -> Adds a description to the bottom of an item.
  • Simple Books -> Write your own books, and hand em out like yesterday's hotdogs.
  • Random items -> Give a random item from a list of items.
  • Random amount of items -> Give 1-4 cookies, for example.
  • Vocational Quest Chest -> Only the specified vocation can open the chest.
  • Anni-Style quests -> can only use 1 out of 4 chests for a reward.
  • And most importantly, almost everything can be used in conjunction with one another.
And here is a picture, because we all love pictures.
Shows chests 1-13 from the example chests.

yJ3drq5.png


How to use?

Everything is explained in green-text within the script itself.
It is very thorough, and there are 20+ example chests, to show you almost every (if not all) ways to use the system.

How to install?


data/actions/actions.xml
Code:
<action actionid="45801-45802" event="script" value="Xikini_Easy_Chest_System.lua"/>
<action actionid="45804"       event="script" value="Xikini_Easy_Chest_System.lua"/>
<action actionid="45807-45811" event="script" value="Xikini_Easy_Chest_System.lua"/>
<action actionid="45815-45816" event="script" value="Xikini_Easy_Chest_System.lua"/>
<action actionid="45818"       event="script" value="Xikini_Easy_Chest_System.lua"/>
<action actionid="45820"       event="script" value="Xikini_Easy_Chest_System.lua"/>
<action actionid="45822-45823" event="script" value="Xikini_Easy_Chest_System.lua"/>
<action actionid="45827"       event="script" value="Xikini_Easy_Chest_System.lua"/>
<action actionid="45831"       event="script" value="Xikini_Easy_Chest_System.lua"/>
<action actionid="45835"       event="script" value="Xikini_Easy_Chest_System.lua"/>
Provided below are a couple of links to download / view the code.

Download the file directly from OtLand Cloud.

. . . . . . . . . OR
View the code directly from Pastbin.com.


Simple and easy.

Enjoy!

Xikini
 
Last edited:
Reserving for a FAQ.
 
Last edited:
I was constantly creating quest chest/items/altars/whatever.. and always had to create a new script for each one.
This was getting annoying, and tedious, so I took 3-4 days and created this "Easy Chest System", so I would never have to make a small tedious script again.
next step is that, EVERY onUse scripts gets tedious, And eventually you only use 1 script.
 
Looks good, only issue im getting is
Code:
Description:
[23/03/2016 03:20:32] data/lib/034-exhaustion.lua:28: field 'day' missing in date table
[23/03/2016 03:20:32] stack traceback:
[23/03/2016 03:20:32]    [C]: in function 'time'
[23/03/2016 03:20:32]    data/lib/034-exhaustion.lua:28: in function 'set'
[23/03/2016 03:20:32]    data/actions/scripts/Xikini_Easy_Chest_System.lua:337: in function <data/actions/scripts/Xikini_Easy_Chest_System.lua:1>
 
Looks good, only issue im getting is
Code:
Description:
[23/03/2016 03:20:32] data/lib/034-exhaustion.lua:28: field 'day' missing in date table
[23/03/2016 03:20:32] stack traceback:
[23/03/2016 03:20:32]    [C]: in function 'time'
[23/03/2016 03:20:32]    data/lib/034-exhaustion.lua:28: in function 'set'
[23/03/2016 03:20:32]    data/actions/scripts/Xikini_Easy_Chest_System.lua:337: in function <data/actions/scripts/Xikini_Easy_Chest_System.lua:1>
exhaustion.set(cid, exstorage,1) -- set's exhaust to true, for 1 second.
Exhaustion only returns true/false.. so I'm not sure what it means by field 'day' to be missing.
try changing this line?
Code:
if exhaustion.check(cid, exstorage) then
Code:
if exhaustion.check(cid, exstorage) == true then
or
if exhaustion.check(cid, exstorage) == 1 then
 
It seems like I am missing a part of my exhaustion code.
Code:
[Error - Action Interface]
[23/03/2016 05:18:17] data/actions/scripts/Xikini_Easy_Chest_System.lua:onUse
[23/03/2016 05:18:17] Description:
[23/03/2016 05:18:17] data/lib/034-exhaustion.lua:28: field 'day' missing in date table
[23/03/2016 05:18:17] stack traceback:
[23/03/2016 05:18:17]    [C]: in function 'time'
[23/03/2016 05:18:17]    data/lib/034-exhaustion.lua:28: in function 'set'
[23/03/2016 05:18:17]    data/actions/scripts/Xikini_Easy_Chest_System.lua:337: in function <data/actions/scripts/Xikini_Easy_Chest_System.lua:1>
 
Well here's mine.. but make a back-up of yours before trying it.
Code:
exhaustion =
{
   check = function (cid, storage)
     if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
       return false
     end

     return getPlayerStorageValue(cid, storage) >= os.time()
   end,

   get = function (cid, storage)
     if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
       return false
     end

     local exhaust = getPlayerStorageValue(cid, storage)
     if(exhaust > 0) then
       local left = exhaust - os.time()
       if(left >= 0) then
         return left
       end
     end

     return false
   end,

   set = function (cid, storage, time)
     setPlayerStorageValue(cid, storage, os.time() + time)
   end,

   make = function (cid, storage, time)
     local exhaust = exhaustion.get(cid, storage)
     if(not exhaust) then
       exhaustion.set(cid, storage, time)
       return true
     end

     return false
   end
}
 
Bumping, most likely a final bump.
 
Why bump this?
Its just a release, not an advertisement...
 
Bumping this thread will not benefit people, they will still ask for x script to be made, people need to learn to use the search box on this site or a search engine.
 
Hey, i got a question because when i start server it doesn't show any console errors, and when i log into the game i try using the chests with set AID but i dont get any message or items I only get the Exhaustion poof on my char, what could be the problem? Also im using TFS 0.4 3884
 
Sir, excuse me, this post is old but im interested lol.
i am facing something... weird
i installed (succesfully i think) your system, and tried with the most simple
aid 45801, but when i use the object (chest in this case), it does not do nothing. no error in console nor even a "you cant use this object"...

im using tfs 0.4
 
Back
Top