From 974222a8d3f189083205bf5d330de04a43226ad3 Mon Sep 17 00:00:00 2001 From: Smokexyz Date: Thu, 2 Mar 2017 19:24:48 +0800 Subject: Implementation of Item Options System. Allows the infusing of equipments with bonus item options. This feature is constrained to clients of packet versions greater than or equal to `20150226`. Item Options and their effects are defined server-side in `db/item_options.conf` and client side in `data/luafiles514/lua files/datainfo/addrandomoptionnametable.lub` The ID of the option must tally with the correct index of the description provided in the client side lua file to avoid bugs. IT_OPT_* keys and MAX_ITEM_OPTIONS macro are also exported from the source as constants. An additional flag `disable_options` has been added to sql, and as `DisableOptions: true/false (boolean, defaults to false !!for equipments only!!)` to item_db.conf files. Script commands documentation is also included. SQL file updates are included. Credits: [Smokexyz](https://github.com/Smokexyz) Style and Script Fixes by [Asheraf](https://github.com/Asheraf) Initial design Idea by [secretdataz](https://github.com/secretdataz) --- doc/script_commands.txt | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'doc') diff --git a/doc/script_commands.txt b/doc/script_commands.txt index a0e3a783d..0efe238c4 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -3133,6 +3133,50 @@ Check sample in doc/sample/getiteminfo.txt --------------------------------------- +*getequipisenableopt() + +This function checks if the equipped item allows the use of bonus options. + +Returns 1 if allowed, 0 if not. + +--------------------------------------- + +*getequippedoptioninfo(); + +This function is to be used with the scripts of contents listed in +db/item_options.conf only. + +Returns the value of the current equipment being parsed. +If the equip was not found or the type is invalid, -1 is returned. + +--------------------------------------- + +*getequipoptioninfo(,,); + +Gets the option information of an equipment. + + For a list of equipment indexes see getequipid(). + can range from 1 to MAX_ITEM_OPTIONS + can be IT_OPT_INDEX (the ID of the option bonus, @see "Id" or "Name" in db/item_options.conf) + or IT_OPT_VALUE (the value of the bonus script of the equipment, @see "Script" in db_item_options.conf). + +returns the value of the slot if exists or -1 for invalid slot, type or slots. + +--------------------------------------- + +*setequipoption(,,,); + +Set an equipment's option index or value for the specified option slot. + + For a list of equipment indexes see getequipid(). + can range from 1 to MAX_ITEM_OPTIONS + can be IT_OPT_INDEX (the ID of the option bonus, @see "Id" or "Name" in db/item_options.conf) + The value of the type to be set. + +returns 0 if value couldn't be set, 1 on success. + +--------------------------------------- + *getequipcardid(, ) Returns value for equipped item slot in the indicated slot (0, 1, 2, or 3). -- cgit v1.2.3-70-g09d2