summaryrefslogtreecommitdiff
path: root/src/char/char.c
AgeCommit message (Collapse)AuthorFilesLines
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)
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>
2016-08-19Ported socket.conf (was packet.conf) to libconfigHaru1-0/+1
Ported to modern Hercules and cleaned up from Panikon's commits: b10f2a88073882bea812c6278fdec7848102ab87, bc5007299a92898ea4630f2a977d9a1b42b6c145 Signed-off-by: Haru <haru@dotalux.com>
2016-08-19Ported inter-server.conf to libconfigHaru1-99/+180
Ported to modern Hercules and cleaned up from Panikon's commits: 40f9ec33868e2240cab013308897898ed252b3e0, a9d646da19e25ab6fcf44dbd1ae7d90c30f6686c, 1aa8581a0aecbfd53e877686c399ffb731dcd75e, 72c645b015ae6130ca7d4309d0fb1413340e7f23, f8c906a0496b9acdae1d8244b1544fa03592061e, 51d88a58983c9552dfd1a0f059e5a031742aed61, 443684b3c77f4c32fe7877a7f8d62debf73b1e93, cf93eafef1f322cd1583226272b7d4008f562da4 Signed-off-by: Haru <haru@dotalux.com>
2016-08-19Ported char-server.conf to libconfigHaru1-206/+541
Fixed issue: 8115, now start items can be equipped as well Ported to modern Hercules and cleaned up from Panikon's commits: c6482e9870645ffe59a6a059b819574d4ac79fd9, 832fb27d4f767e4bc8b68c432d0da00b7cb7a4f9, f81b579899e3a15bd472ca8c6a6e0116c43bec92, e23723725499b617def03d05661eca637edaeabd, 0b783a83d82e588efd760f7f4baec0c8074a6fd1, 1b7de91308a57ea07b158ed95a2515a3c8cc36bd, 677d3430cbda0962b320a60cf499e9dadf637d00 Signed-off-by: Haru <haru@dotalux.com>
2016-08-19Renamed some char and inter server variablesHaru1-41/+39
- `int save_log` -> `bool chr->show_save_log` - `bool char_new` -> `bool enable_char_creation` - `int log_char` -> `bool chr->enable_logs` - `int log_inter` -> `bool inter->enable_logs` - `int chr->new_display` -> `int16 chr->new_display` - `int char_aegis_delete` -> `bool char_aegis_delete` Split and improved from Panikon's commit 832fb27d4f767e4bc8b68c432d0da00b7cb7a4f9 Signed-off-by: Haru <haru@dotalux.com>
2016-08-16Add missing quote chars in char.cAndrei Karas1-1/+1
2016-08-10Fix login and char servers null pointer access if packet handler in plugin ↵Andrei Karas1-1/+4
initiate server termination.
2016-07-14Changed mmo_charstatus::status_point and mmo_charstatus::skill_point to intHaru1-5/+5
Fixes several -Wsign-compare issues Signed-off-by: Haru <haru@dotalux.com>
2016-07-14Changed mmo_charstatus::base_level and mmo_charstatus::job_level to intHaru1-9/+9
Fixes several -Wsign-compare issues Signed-off-by: Haru <haru@dotalux.com>
2016-07-03Add into travis configure option --enable-buildbot.Andrei Karas1-0/+2
Also disable all known default warnings if build bot option enabled.
2016-07-03Add --run-once flag into char server.Andrei Karas1-0/+14
2016-05-08Fixed various issues pointed out by cppcheckHaru1-1/+1
Signed-off-by: Haru <haru@dotalux.com>
2016-04-25Reduced the MAX_MAP_SERVERS setting to 1hemagx1-0/+8
Multi-zone support is deprecated and should not be used on a production server.
2016-03-20Dropped typedef from DBMapHaru1-1/+1
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-20Changed buffer argument of SQL->StmtBindParam() to constHaru1-2/+2
Parameters are supposed to be read-only Signed-off-by: Haru <haru@dotalux.com>
2016-03-20Removed unnecessary typedefs from sql.hHaru1-5/+5
- Sql -> struct Sql - SqlStmt -> struct SqlStmt - SqlDataType -> enum SqlDataType This is expected to improve compile time, by removing #include cycles (and forward declaring instead) Signed-off-by: Haru <haru@dotalux.com>
2016-03-09Corrected some issues in the item data saving functionHaru1-187/+60
- Unique ID could get duplicated (resulting in an apparent item duplication, while it's only unique ID corruption). Fixes #1191 - Removed duplicated code (char_inventory_to_sql, being an almost exact clone of char_memitemdata_to_sql) Signed-off-by: Haru <haru@dotalux.com>
2016-02-27Corrected wrong variable type of struct status_change_data::tickHaru1-4/+6
- The variable should be signed, since it uses the value -1 to indicate infinite duration (and it's stored as signed in the database). - Added #define for the special value -1 (INFINITE_DURATION). - This fixes an issue causing status changes to fail being saved to database (thanks to Michi for reporting it). - Related to commit 8dc75721. Signed-off-by: Haru <haru@dotalux.com>
2016-02-24Removed several unnecessary explicit casts of the WFIFOP resultHaru1-8/+8
Signed-off-by: Haru <haru@dotalux.com>
2016-02-24Removed unnecessary explicit casts of the value of WBUFPHaru1-1/+1
- WBUFP now returns a pointer to void, which automatically casts to any non-const or const pointer. Signed-off-by: Haru <haru@dotalux.com>
2016-02-24Removed several unnecessary RFIFOP typecastsHaru1-13/+12
- While this is arguable, those explicit typecasts are potentially dangerous/misleading (for example, a const specifier might get accidentally dropped without even generating a compiler warning, or a variable type might change during code changes, and any related warning would get silenced by the explicit typecast). - As a reminder Hercules is written in C, and not in C++ (and there's no such thing as "compiling in C++ mode" - they're two different languages.) As such, it is legal to let the compiler automatically promote void* from/to any non-const pointer type, as well as const void* from/to any const pointer type. Signed-off-by: Haru <haru@dotalux.com>
2016-02-24Added const qualifier to several variable/argument pointersHaru1-7/+7
- This is necessary for compatibility with a const RFIFOP. Signed-off-by: Haru <haru@dotalux.com>
2016-02-19Fix all known warnings from compiler flags -Wformat*Andrei Karas1-12/+12
Add all missing -Wformat flags into configure.
2016-02-15Replaced a call to sleep() with HSleep()Haru1-8/+1
Signed-off-by: Haru <haru@dotalux.com>
2016-01-25Fix packet id being sent encrypted to Hercules Plugin Manager.hemagx1-12/+13
Now packet id will be passed to Hercules Plugin Manager instead of let it figure it on itself
2016-01-05Added Support for BodyStyleDastgir1-46/+48
Closes #974 as merged
2015-12-24Change packet 0x82d to not send billing slots.hemagx1-1/+1
currently billing slots is not supported and sending the premium slots twice cause client to bug. Fixes #1017
2015-12-15Added GPL-compliant header to all sources and build scriptsHaru1-4/+20
Signed-off-by: Haru <haru@dotalux.com>
2015-12-15Added GPL information on interactive server startupHaru1-0/+1
2015-12-13Renaming 'start_point' to 'start_point_re'Jedzkie1-5/+5
2015-10-22Removed support for the deprecated SQL item, mob, mob_skill databases.Haru1-4/+0
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-11Changed chr->server[].maps to a VECTORHaru1-31/+29
Signed-off-by: Haru <haru@dotalux.com>
2015-10-11Changed HPM->packets[] into an array of VECTORHaru1-14/+18
Signed-off-by: Haru <haru@dotalux.com>
2015-09-25More aggressive whitespace cleanup. Follow up to 51329e6Haru1-4/+4
Signed-off-by: Haru <haru@dotalux.com>
2015-09-05Added RE/Pre-RE start_point ability.Taylor Locke1-13/+38
2015-08-27Hotkey Rotate Packet ImplementedDastgir1-3/+6
2015-08-15Automatic HPM symbol sharingHaru1-21/+0
Signed-off-by: Haru <haru@dotalux.com>
2015-08-15Moved sql_handle into the HPMi interfaceHaru1-1/+0
Signed-off-by: Haru <haru@dotalux.com>