summaryrefslogtreecommitdiff
path: root/src/char/char.c
AgeCommit message (Collapse)AuthorFilesLines
2018-07-24Implemented Title System.Dastgir1-4/+9
2018-07-24Implementation of the official Achievement System.smokexyz1-2/+12
Source: http://ro.gnjoy.com/news/update/View.asp?seq=163&curpage=1 Script Commands - ``` achievement_progress(<ach_id>,<obj_idx>,<progress>,<incremental?>{,<char_id>}); ``` Includes an achievement_db.conf generator that reads from the item_db, mob_db (server side) and achievement_list.lub files to determine valid achievement entries based on item/monster availability. Achievements containing unsupported entries are commented out. This feature, although renewal-only in official servers, is capable of being used in pre-renewal mode on Hercules. Does not include the title system yet. A big thanks to - @MishimaHaruna for constantly reviewing. @4144 for all the support. @Asheraf for a lot of official information. Co-authored-by: "Dastgir" <dastgirp@gmail.com>
2018-07-17Replace item id shorts to int in char server.Andrei Karas1-17/+17
2018-07-12Remove useless code from char_send_map_info.Andrei Karas1-3/+1
2018-07-01Change functions to static where possible (Part 3 - char)Haru1-214/+233
This fixes issues with plugins defining symbols with the same names Signed-off-by: Haru <haru@dotalux.com>
2018-06-30Move some non-mapif functionality from the mapif interface to the inter/char ↵Haru1-29/+66
interfaces Signed-off-by: Haru <haru@dotalux.com>
2018-06-30Move some non-mapif functionality from the mapif interface to the ↵Haru1-1/+1
inter_homunculus interface Signed-off-by: Haru <haru@dotalux.com>
2018-06-30Move some non-mapif functionality from the mapif interface to the ↵Haru1-2/+2
inter_guild interface Signed-off-by: Haru <haru@dotalux.com>
2018-06-30Move some non-mapif functions from the mapif interface to the ↵Haru1-1/+1
inter_elemental interface Signed-off-by: Haru <haru@dotalux.com>
2018-06-30Move mapif functions from char.c to mapif.cHaru1-149/+0
Signed-off-by: Haru <haru@dotalux.com>
2018-06-29Add new field into packet char_send_map_info.Andrei Karas1-2/+11
But unused for now.
2018-06-13Fix job field size in function char_parse_char_create_new_char.Andrei Karas1-1/+1
2018-04-22Remove the stat-reporting mechanismHaru1-45/+1
Signed-off-by: Haru <haru@dotalux.com>
2018-04-22Merge pull request #2007 from Jedzkie/PincodeUpdateHaru1-1/+3
Pincode Update
2018-04-07Implementation of Attendance systemAsheraf1-4/+7
2018-04-06Add support for packet 0xaf7 in zero clients.Andrei Karas1-1/+1
2018-04-02Pincode UpdateJedzkie1-1/+3
- Added blacklist feature - Added official message when successfully create a pincode / successfully change a pincode
2018-03-29Simplify version checks with new packet version defines.Andrei Karas1-1/+1
2018-03-11Fix packet character name request reply for 20180221 clients.Andrei Karas1-0/+5
2018-02-10Clean up trailing whitespace and non-indent tabsHaru1-1/+1
Signed-off-by: Haru <haru@dotalux.com>
2018-01-25Implementation of Official Clan SystemMurilo Pereti Tavares1-4/+9
All official features work including the autokick for inactive members And the system is completely customizable.
2017-11-25correct wrong conf file path in showerrorAsheraf1-1/+1
2017-11-18Pass the correct types and sizes to the StmtBind functionsHaru1-147/+152
Fixes #1531 (and other similar issues) Signed-off-by: Haru <haru@dotalux.com>
2017-11-05Reduce confusion between skill IDs and skill DB indexes (part 2)Haru1-5/+5
Remove MAX_SKILL in favor of MAX_SKILL_DB, when referring to the maximum skill DB index. This is opposed to MAX_SKILL_ID, the maximum skill ID. Signed-off-by: Haru <haru@dotalux.com>
2017-09-21Change char server packets for 20170830 and newer clients.Andrei Karas1-7/+20
2017-09-19remove trailing whitespaces from sourcegumi1-1/+1
2017-09-17Move other view-related variables to `sd->status.look`Haru1-17/+17
The following variables are now moved to `sd->status.look` (from `sd->status`): `head_top`, `head_mid`, `head_bottom`, `robe` Signed-off-by: Haru <haru@dotalux.com>
2017-09-17Differentiate variables that hold a ViewSprite and a Subtype (part 2)Haru1-5/+5
`sd->status.shield` is renamed to `sd->status.look.shield` and only holds ViewSprite IDs. Its previous other meaning is now transferred to `sd->has_shield`, of boolean type (to detect the presence of a shield) Signed-off-by: Haru <haru@dotalux.com>
2017-09-17Differentiate variables that hold a ViewSprite and a weapon SubtypeHaru1-5/+5
`sd->status.weapon` is renamed to `sd->status.look.weapon` and only holds ViewSprite IDs. Its previous other meaning is now transferred to `sd->weapontype` (holding the currently equipped weapon type, considering both hands at once) Signed-off-by: Haru <haru@dotalux.com>
2017-07-30Implementation of RoDEXKirieZ1-0/+4
2017-07-17Merge pull request #1760 from Smokexyz/memitemtosql-fixHaru1-223/+240
Optimisation of char_memitemdata_to_sql()
2017-07-05Optimisation of char_memitemdata_to_sql()smokexyz1-223/+240
Implements the storage saving algorithm for inventory, cart and guild storage tables. Total queries to a table in any call would be no more than 4 per call, replacing the original algorithm that could make a lot more through single update queries per call. This significantly reduces the run time speed for saving/loading of item data from the game server.
2017-06-03Add packet 0xac5 for clients >= 20170329.Andrei Karas1-7/+14
2017-05-31Fix a race condition when saving the storage on logoutHaru1-4/+0
The storage data is no longer cached in the char server. This removal doesn't cause any performance loss, since the cached data was refreshed (loaded from the database) after every save operation. This commit moves the load at the beginning of the save rather than at the end, and discars the cached copy after the save is completed. Related to #1754 Signed-off-by: Haru <haru@dotalux.com>
2017-05-29Fix memory leak in storage item vector (Fixes #1751)Andrei Karas1-1/+1
2017-05-22Add storage_data reception, parsing and sending to/from the map-server.Smokexyz1-13/+7
Remove loading and saving of storage_data through char.c Re-declaration of structure storage_data as a vector. Re-code of portions in the map-server using storage_data. A new approach is taken by saving the loaded storage data from sql into memory for the duration of the session, thereby removing the need of querying the database to re-load all items everytime a storage save routine is issued from the map-server. Saving of storage items is done through a new function that significantly reduces the number of queries compared to char_memitemdata_tosql(), and therefore run-time speed. This method potentially reduces the number of update and delete queries from MAX_STORAGE (which could be >= 600) times to literally 1. Storage items are stored in a dynamically allocated array and handled accordingly. struct mmo_charstatus size reduces by 34,800 bytes. Update pc_checkitem() with masks for item checks. `sd->state.itemcheck` has been changed to `sd->itemcheck` of type `enum pc_checkitem_types` `battle/items.conf` has been updated to reflect configuration changes. Further updates to assert a successful reception of storage data in related functions.
2017-04-14Fix compilation warning in char.cAndrei Karas1-1/+3
2017-04-09Merge pull request #1598 from Smokexyz/IROHaru1-9/+42
Implementation of Item Options System.
2017-04-04Implementation of Item Options System.Smokexyz1-9/+42
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)
2017-03-21Add support for sex based character creation for 2015-10+ clients.Dastgir1-16/+28
Allow select for new char gender and human or doram class. Doram starting point not implimented. Based on ragemu commit: commit 5d618a64b041341a48ce24a92633a6a2dcf5af4f Author: Dastgir <dastgirp@gmail.com> Date: Sun Jun 12 22:11:51 2016 +0530 Added Support for Sex Based Character Creation for 2015-10+ clients.
2016-12-03Clarify some Job Class vs MapID confusion (1/2)Haru1-34/+34
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-19Add fixed-size versions of the _int64 libconfig getters/settersHaru1-1/+1
As we use int64 (instead of long long int) through the code, it's preferable if our libconfig interface does the same, avoiding us to create temporary interchange variables for that purpose. Signed-off-by: Haru <haru@dotalux.com>
2016-10-22Fix incorrect coding style used in char/char.c and map/skill.cDastgir Pojee1-2/+2
2016-10-22Added Summoner Class.Dastgir Pojee1-4/+4
(Only Placeholder, other things related to summoner will follow-up soon) Added SQL-Upgrade: Added `class` column in charlog
2016-10-22Added Packets for Several Clients: 2015-10-01, 2015-10-29, 2015-11-04 andDastgir Pojee1-19/+36
2015-12-16 Added New Char Creation Packet(0xa39). Added Placeholder of JOB_SUMMONER
2016-10-16Dont send packets for known unsupported client versions.Andrei Karas1-1/+5
Fixed packets between 20111005 to 20141022. As reference was used client packet logs from https://gitlab.com/4144/servergreps/tree/master/peek_all/packets
2016-08-22Corrected an issue that caused the setting ↵Haru1-1/+6
char_configuration/permission/display_new to be ignored Fixes #1407 Signed-off-by: Haru <haru@dotalux.com>
2016-08-22Temporary quick-fix for a warning in the linux buildsHaru1-1/+1
- libconfig uses 'long long' for its 64 bit lookup/set/get functions, rather than a well-defined size integer (such as int64_t). GCC doesn't like the use of an int64_t* where a long long* is required, especially on linux x86_64, where int64_t is typedeffed as long int - In future, the function signature will be changed, so we can use int64 normally. Signed-off-by: Haru <haru@dotalux.com>
2016-08-21Corrected some issues reported by coverityHaru1-4/+7
- Incorrect sizeof expression in char_config_set_ip() - Invalid comparison (when MAX_ZENY == MAX_INT) in char_config_read_player_new() Signed-off-by: Haru <haru@dotalux.com>
2016-08-20Re-added HPM support for configuration settingsHaru1-2/+4
Plugin settings should be relative to the the libconfig file root. For example, a configuration setting of type HPCT_CHAR will be relative to the root of conf/char/char-server.conf. In order to add a configuration entry inside the char_configuration block, the full configuration path (slash-delimited) should be passed to addCharConf(), as in the following example: `addCharConf("char_configuration/my_setting", my_parser_function);` Signed-off-by: Haru <haru@dotalux.com>