summaryrefslogtreecommitdiff
path: root/src/map/itemdb.c
AgeCommit message (Collapse)AuthorFilesLines
2017-04-29Fixes #994Jedzkie1-0/+3
2017-04-04Implementation of Item Options System.Smokexyz1-1/+155
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)
2016-12-03Clarify some Job Class vs MapID confusion (1/2)Haru1-8/+25
This commit ensures that `sd->status.class` and related variables only contain Job Classes (i.e. the client-compatible values, where High Novice 4001) and are never checked against the bitmask-based MapID values. As a rule of thumb, from now on, when a variable is named `class`, it is intended to contain a Job Class ID and not a MapID. The type of such variable shall be a signed `int16` or `int`. To ensure that related third party code is also verified when this commit is merged, the variable `struct mmo_charstatus::class_ (i.e. `sd->status.class_`) is renamed to `class`. Some issues in related lines are also fixed, including: - A wrong check in the char server would prevent the correct detection of babies in code related to the family exp sharing. - Baby Arch Bishops would not be affected by Eucharistica. - A wrong check would cause the `questinfo()` script command not to display its information for most classes (except 1-1 classes). - Map IDs and Job Classes were mixed up in `itemdb_jobid2mapid()` and `itemdb_jobmask2mapid()` for 1-1 classes (causing currently no harm, since they just happen to coincide). - The Baby Sura class would not cause parties to be marked as containing a monk type character (for SLS Team Up purposes). - Baby Geneticists would bypass the cart check when trying to equip ammunitions. - Baby Mechanics would bypass the Mado Gear check when trying to equip ammunitions. - Transcendent Shadow Chasers would lose the Stalkers' ability to clone transcendent skills. Signed-off-by: Haru <haru@dotalux.com>
2016-11-20Added validation for the AegisName while parsing the item dbHaru1-0/+24
Signed-off-by: Haru <haru@dotalux.com>
2016-10-22Added Summoner Class.Dastgir Pojee1-0/+5
(Only Placeholder, other things related to summoner will follow-up soon) Added SQL-Upgrade: Added `class` column in charlog
2016-09-30Add different fixes for gcc 7 warnings.Andrei Karas1-1/+1
Some possible buffer overflows. Add attribute for mark fallthrough cases. Skipped libconfig warnings.
2016-07-02Trivialities: indentation fixesHaru1-2/+2
Signed-off-by: Haru <haru@dotalux.com>
2016-03-20Dropped typedef from DBIteratorHaru1-2/+3
Signed-off-by: Haru <haru@dotalux.com>
2016-03-20Dropped typedefs from union DBKey and struct DBDataHaru1-6/+6
Signed-off-by: Haru <haru@dotalux.com>
2016-03-14Dont load roulette_db.conf if roulette disabled.Andrei Karas1-1/+1
2016-03-06Merge pull request #1189 from 4144/itemdbviewHaru1-0/+6
Check allowed range for "View" field in item_db for weapon items.
2016-03-06Check allowed range for "View" field in item_db for weapon items.Andrei Karas1-0/+6
Also fix some array sizes.
2016-03-06Fixes some issues while processing item db "Job" fieldsHaru1-5/+14
- In the numeric format, certain valid masks (greater than 0x7fffffff) could fail to process - In the textual format, masks having "All" in a position other than the first, would reset any preceding jobs. Signed-off-by: Haru <haru@dotalux.com>
2016-02-23Corrected some warnings in Visual StudioHaru1-94/+98
- Changed literal 1L values used in unit64 bit-shift operations to 1ULL. - Follow-up to f606519c3b611573ade246ec82db26437bf03668 (reported by zackdreaver) Signed-off-by: Haru <haru@dotalux.com>
2016-02-21Changing Job field to 'int64'Dastgir1-8/+8
Signed-off-by: Haru <haru@dotalux.com>
2016-02-21New format for Job field in job_db.confDastgir1-10/+160
2016-02-19Fix all known warnings from compiler flags -Wformat*Andrei Karas1-6/+6
Add all missing -Wformat flags into configure.
2016-02-17Removed unnecessary typedefs from libconfigHaru1-15/+15
Signed-off-by: Haru <haru@dotalux.com>
2016-02-17Renamed config->read_file to config->load_fileHaru1-11/+10
- The return value is now consistent with the libconfig standard (CONFIG_TRUE/CONFIG_FALSE). - Removed some redundant error messages. Signed-off-by: Haru <haru@dotalux.com>
2016-01-29Modified Mob DB loader to behave like the Item DB loaderHaru1-18/+18
- Separated load and validation logic. - The load/validation functions now return the loaded mob ID Signed-off-by: Haru <haru@dotalux.com>
2016-01-13Added support to mark constants in db/constants.conf as deprecatedHaru1-2/+2
Signed-off-by: Haru <haru@dotalux.com>
2016-01-09Corrected various zero-argument function definitionsHaru1-1/+2
- Functions should always specify their arguments, even if they take none. In C, not specifying arguments is different than specifying (void). Signed-off-by: Haru <haru@dotalux.com>
2016-01-06Replaced some explicit casts with BL_UCAST/BL_UCCASTHaru1-1/+1
- Replaced the map-iterator related casts. Signed-off-by: Haru <haru@dotalux.com>
2015-12-28Replaced some numeric mob IDs with the proper constants (MOBID_TREASURE_BOX*)Haru1-2/+2
Signed-off-by: Haru <haru@dotalux.com>
2015-12-15Added GPL-compliant header to all sources and build scriptsHaru1-4/+20
Signed-off-by: Haru <haru@dotalux.com>
2015-12-04Add missing checks into itemdb.cAndrei Karas1-2/+30
2015-10-22Removed support for the deprecated SQL item, mob, mob_skill databases.Haru1-163/+8
Follow-up to 84e02ac28fbb15c58d0a0f8a916b49663198b05b Signed-off-by: Haru <haru@dotalux.com>
2015-10-19rename malloc.c/h to memmgr.Andrei Karas1-1/+1
2015-10-11Cleanup of the HPluginData implementation (second part)Haru1-2/+1
- Changed the hplugin_data_store's array into a VECTOR. Signed-off-by: Haru <haru@dotalux.com>
2015-10-11Cleanup of the HPluginData implementation (First part)Haru1-11/+2
- Several explicit casts are removed, to have a slightly better type-checking at compile time. - A destructor function is provided, to remove code duplication. Signed-off-by: Haru <haru@dotalux.com>
2015-09-25More aggressive whitespace cleanup. Follow up to 51329e6Haru1-167/+142
Signed-off-by: Haru <haru@dotalux.com>
2015-09-18Clarified the intent of several assignments inside conditional expressionsHaru1-1/+1
Signed-off-by: Haru <haru@dotalux.com>
2015-08-15HPM compatibility improvementsHaru1-0/+1
Improved compatibility, portability and standards conformance. - Since it is not possible to portably and reliably re-use the core's symbols in plugins, symbols are no longer exported unless explicitly required, in the UNIX builds. This mimics the Windows behavior and adds HPM compatibility to OSes such as FreeBSD. Credits to Andrei Karas for making this possible. - For convenience, it is no longer necessary to call GET_SYMBOL, since the plugin will automatically import all the available symbols when it's loaded, depending on the included headers. - Plugins are now supposed to include the "common/hercules.h" header before including anything else. Incluing common/HPMi.h, common/cbasetypes.h or conf/core.h is no longer necessary, as those are guaranteed to be automatically included by hercules.h. - HPM API version bumped to 1.1. Signed-off-by: Haru <haru@dotalux.com>
2015-08-12Fixed some issues reported by CoverityHaru1-1/+1
Follow-up to 5090bdf750017f0d631401edd563c452bd10ec24, 84e02ac28fbb15c58d0a0f8a916b49663198b05b Signed-off-by: Haru <haru@dotalux.com>
2015-08-09Corrected search order in itemdb_searchnameMordekaiserGod1-1/+1
It’ll now return the first result, rather than the last due to item2 being overwritten as it searches through the array.
2015-08-07Update itemdb.cSmokexyz1-4/+4
This fixes the script loading issue mentioned here -> http://herc.ws/board/topic/10249-issue-with-item-db-after-update/
2015-07-08Update Unique ID system to match official now it cover all cash items ↵Ibrahim Hossam1-21/+43
include stackable ones. Implement ForceSerial option in Package Item Database to force serial for any item. Implement ForceSerial option in item database to force serial for any item. Implement Merge Client interface to merge stackable items with serial numbers ( check npc/other/item_merge.txt ).
2015-06-19Removed ".." from include directivesHaru1-15/+15
- Include directives are now directory-independent. - This will allow building plugins from other directories in future. Signed-off-by: Haru <haru@dotalux.com>
2015-01-22Removed name distinction between (sql) mob/item/mob_skill db and db_re variantsHaru1-4/+0
- Since there (currently and in future) is no difference between the table structure for renewal and pre-renewal databases, it makes no sense to have extra code that makes a distinction between their names. A server will always use either one or the other, never both at the same time. - If you have a mob_db_re, mob_skill_db_re and/or item_db_re table, please rename it to mob_db, mob_skill_db and/or item_db_re, respectively. - No upgrade script provided. I'd like to remind everyone that these tables are optional (and deprecated), and they are only offered for convenience for those who need them for web control panels and similar software. Signed-off-by: Haru <haru@dotalux.com>
2015-01-20Minor fixes and tweaks suggested by cppcheckHaru1-23/+20
- Variable scopes reduced - Parenthesized ambiguous expressions - Removed or added NULL checks where (un)necessary - Corrected format strings - Fixed typos potentially leading to bugs Signed-off-by: Haru <haru@dotalux.com>
2015-01-1727 Fixesshennetsind1-1/+1
Addressing out of bounds read/write, pointless null checks on already deferenced variables. Special Thanks to 4144 and Haruna! Signed-off-by: shennetsind <ind@henn.et>
2015-01-17Another ~10 Fixesshennetsind1-1/+1
Addressing out of bounds read/write. Special Thanks to 4144 and Haruna! Signed-off-by: shennetsind <ind@henn.et>
2014-12-31Remove useless checks.Andrei Karas1-1/+1
2014-12-31Add some missing null pointer checks after automatic checks.Andrei Karas1-36/+44
2014-12-23Allow use constants in item_db.conf for int fields.Andrei Karas1-18/+37
2014-12-21Add function for reading custom itemdb fields.Andrei Karas1-0/+7
This functions called after reading normal fields and after adding item to itemdb.
2014-12-19Remove plugin data in item_data destruction.Andrei Karas1-0/+10
2014-12-17Move check is item usable or not to separate method.Andrei Karas1-0/+9
New method: itemdb_is_item_usable Can be used as: itemdb->is_item_usable(item)
2014-12-02Add item attribute what prevent item removing on use.Andrei Karas1-1/+4
New item attribute: KeepAfterUse
2014-11-16Whitespace cleanup (no code changes)Haru1-26/+27
This includes, and is not limited to: mixed or wrong indentation, excess whitespace (horizontal and vertical), misalignment, trailing spaces. Signed-off-by: Haru <haru@dotalux.com>