1.) Download the 'on_use_item.lua' I wrote. Look at the bottom of his post. Copy it into your Resource/Script folder.
2.) Open it in your favorite text editor. Inside you will find:
3.) To add new functions, there are two things you gotta do. First, you'll have to know the ID of the item you are trying to modify. Then find that item inside this table: [Arcadia].[dbo].[ItemResource]
The last column is named 'script_text'. There you have to insert 'on_use_item' (without the quotes).
Second, you need to let the server know what to do. Inside the above posted lua-file look for
The X represent the item functions. To add a new one insert
just before the last 'end' in the lua-file. The Ys represent the ID of the item you want to add a new function. The Zs are the new function. I may make a list of what you can do later, but for now look inside other threads, they are the same as for login buffs or item insertions.
4.) Save the file and restart your server. Whenever you use the item the function you entered will be called.
Example:
I adjusted the Red Potion Lv1 inside the database to call the script with
The ID is 602001. Then I added a function. Whenever a Red Potion Lv1 is used it will insert another Red Potion Lv1. This is the complete on_use_item.lua for that, with out any other modifications:
WARNING
I wrote that lua-script myself based on my findings in the database.
I am not sure if the original script (that is stored away inside the server files) does anything else. I just added the items that already had that fuction build in, namely "Scroll of Storing", "Scroll of Bidding" and "Scroll of Boosting", which can be bought in the hidden village. If you use this there might be complications with unknown functions, but I am pretty sure, that those three are the only items/object calling that script.
WARNING 2
You cannot add such a function to an equippable item. I tested the three scrolls and the Red Potion. It seems it works just fine with any consumable item.
Have fun.
Edit: Creating the basic lua-file:
I cannot add lua-files, so make a new text-file and enter
Save it as on_use_item.lua
Alternately download
Mirror 1:

Mirror 2:






