summaryrefslogtreecommitdiff
path: root/src/map/pc.h
AgeCommit message (Collapse)AuthorFilesLines
2017-09-17Differentiate variables that hold a ViewSprite and a Subtype (part 2)Haru1-0/+1
`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-3/+10
`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/+9
2017-06-25Add packet 0xabd for send job and base levels to party members.Andrei Karas1-0/+1
Also improve packets send on base level change. Based on commit from rathena: commit 816d8ab2d0934f823a1d26f7fcac244f8245f14b Author: Lemongrass3110 <lemongrass@kstp.at> Date: Mon Jun 5 23:07:09 2017 +0200 Fixed party window for 2017 clients Thanks to @mrdiablo for his help again!
2017-06-25Fix vending list packet for 2016 clients. Based on rathena commit:Andrei Karas1-0/+1
commit 9716233c842f731df3fed5281370e324b5f5f024 Author: Lemongrass3110 <lemongrass@kstp.at> Date: Mon May 8 23:40:05 2017 +0200 Introducing the equip preview window Fixes some bugs for 2016-09-21 onward, where you can preview how a item would like if you put it on. This works on other people's vending and on your own inventory. Thanks to @Rytech2 and @hazimjauhari90
2017-05-22Add storage_data reception, parsing and sending to/from the map-server.Smokexyz1-2/+11
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-20Made prevent_logout effect on log-in optionalJedzkie1-0/+8
kRO does not prevent players from logging out after connecting to its zone servers. Credits to @secretdataz of rAthena
2016-12-03Add function to retrieve the appropriate fame list type for a job mapidHaru1-0/+1
This commit adds the function `pc->famelist_type()` to retrieve the appropriate fame list for a given job (common operation). When the given job ID doesn't have an appropriate fame list, the newly introduced value RANKTYPE_UNKNOWN is returned. Signed-off-by: Haru <haru@dotalux.com>
2016-12-03Change the argument to pc->famerank() to a rank type (instead of job mapid)Haru1-1/+1
For consistency with `pc->addfame()`, the argument to pc->famerank() is now an enum fame_list_type. The function was renamed to `pc->fame_rank()` to avoid silently compiling old non-compliant code. Signed-off-by: Haru <haru@dotalux.com>
2016-12-03Ensure that pc->addfame() increments the correct fame pointsHaru1-1/+1
The function now takes the rank type as argument, rather than guessing it from the character's class. If the wrong fame point type for the current character is requested, the request is ignored. This fixes some (unofficial) edge cases where a Taekwon or an Alchemist refined a signed item, they could obtain rank points. Signed-off-by: Haru <haru@dotalux.com>
2016-12-03Clarify some Job Class vs MapID confusion (2/2)Haru1-9/+9
This commit ensures that `sd->job` and related variables only contain MapIDs (i.e. the serverside optimized values, where High Novice is MAPID_NOVICE | JOBL_UPPER) and are never checked against the client-based Job Class values. As a rule of thumb, from now on, when a variable is named `job` or `jobid`, it is intended to contain a MapID and not a Job Class ID. The type of such variable shall be an unsigned `uint16` or `uint32`. To ensure that related third party code is also verified when this commit is merged, the variable `struct map_session_data::class_ (i.e. `sd->class_`) is renamed to `job`. Some issues in related lines are also fixed, including: - The atcommand `@mount` would not check properly that the requesting character is a 2nd class Swordsman type. - `pc->addfame()` would silently accept invalid MapIDs, sending unknown values to the client (more on this in a subsequent commit). - `pc->famerank()` would not use the passed job as a bitmask, causing the caller to have to mask it beforehand (more on this in a subsequent commit). - The Soul Linker check in TK_JUMPKICK wasn't future-proof (no harm caused currently). - Gunslingers would be able to be targeted by Spiritual Bestowment (`MO_KITRANSLATION`) and Spiritual Sphere Absorption (`MO_ABSORBSPIRITS`) due to a faulty check introduced when the Rebellion class was implemented (causing unintended interaction with Coins). Signed-off-by: Haru <haru@dotalux.com>
2016-12-03Clarify some Job Class vs MapID confusion (1/2)Haru1-6/+6
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-10-22Added max_summoner_parameter:Dastgir Pojee1-0/+1
Default max parameter for summoner is 120.
2016-10-22Implemented SU_BASIC_SKILL Skill of SummonerDastgir Pojee1-0/+1
Added Function for Basic Skills check.
2016-08-14Update pc_steal_coin parameterEmistry1-1/+1
Added skill_lv as parameter to *pc_steal_coin() Closes #1395 as merged Signed-off-by: Haru <haru@dotalux.com>
2016-07-14Changed map_session_data::change_level_2nd and ↵Haru1-3/+3
map_session_data::change_level_3rd to int Fixes several -Wsign-compare issues Signed-off-by: Haru <haru@dotalux.com>
2016-07-14Changed various functions to take a const sdHaru1-5/+5
- Affected functions: pc->nextbaseex(), pc->nextjobexp(), pc->thisbaseexp(), pc->thisjobexp(), pc->readparam() - Fixes an accidental '+=' in pc->readparam() due to copy-paste failure, detected thanks to the const enforcement (luckily it had no current ill effects, since the value was 0) Signed-off-by: Haru <haru@dotalux.com>
2016-07-14Changed pc->maxbaselv() and pc->maxjoblv() to return signed int and take ↵Haru1-2/+2
const sd Removes some FIXME (and continues a chain reaction) Fixes some of the many -Wsign-compare warnings Signed-off-by: Haru <haru@dotalux.com>
2016-07-14Fixed Coverity CID 150315: Integer overflowed argumentHaru1-1/+1
Fixes a possible unsigned underflow (and changes the type of some unnecessarily unsigned variables to signed, such as pc->max_level[][]) Signed-off-by: Haru <haru@dotalux.com>
2016-04-23Changed map_session_data::chatID to int (and renamed to chat_id)Haru1-4/+4
- Chat IDs are signed integers. - Resolves various warnings, depending on the compiler settings. Signed-off-by: Haru <haru@dotalux.com>
2016-04-23Removed some code duplication in chat processing functionsHaru1-0/+1
Moved non-clif code that handles chat delay, atcommand detection, idle timers to pc.c Signed-off-by: Haru <haru@dotalux.com>
2016-04-23Split supernovice angel call message detection to its own functionHaru1-1/+3
Signed-off-by: Haru <haru@dotalux.com>
2016-04-19Corrected type for sd->fontcolor_tidHaru1-1/+1
A timer ID should always be a signed int. Signed-off-by: Haru <haru@dotalux.com>
2016-03-20Dropped typedef from DBMapHaru1-2/+2
Signed-off-by: Haru <haru@dotalux.com>
2016-03-20Dropped typedefs from union DBKey and struct DBDataHaru1-2/+3
Signed-off-by: Haru <haru@dotalux.com>
2016-03-16Fixes HerculesWS/Hercules#1198 and fixes HerculesWS/Hercules#1194 introduced ↵Kolkka1-1/+1
in pull request #1189 Changed other instances of MAX_WEAPON_TYPE to MAX_SINGLE_WEAPON_TYPE.
2016-03-06Check allowed range for "View" field in item_db for weapon items.Andrei Karas1-2/+2
Also fix some array sizes.
2016-02-28Changed mob mode field to 32 bit, for future expansionHaru1-1/+1
Signed-off-by: Haru <haru@dotalux.com>
2016-02-24Added const qualifier to several variable/argument pointersHaru1-1/+1
- This is necessary for compatibility with a const RFIFOP. Signed-off-by: Haru <haru@dotalux.com>
2016-01-16Added OneClickIdentify packetDastgir1-0/+2
2016-01-03Rewritten skill_tree parser in a more robust wayHaru1-7/+9
- Fixes an issue that prevented skills with more than 4 pre-requisites or more than 3 pre-requisites and a minimum level from being parsed correctly (and without any warning or error messages). - Removes the limit on 5 pre-requisites (replaced a fixed size array with a VECTOR) - Reduces memory usage of skill_tree from 794kB to 440kB (32 bit) or 523kB (64 bit). - Fixes an issue that prevented multiple inheritance from working correctly in rare cases (incorrect definition order), without any warning or error messages. Now a warning is displayed if a job is inherited before being defined. - Fixes an issue that prevented skills inherited from being correctly merged with the skills defined for the current job. - Prevents a job from inheriting itself by accident. - Correctly detects skills defined twice for the same job. Signed-off-by: Haru <haru@dotalux.com>
2015-12-24Item Update:Jedzkie1-0/+2
- Fix items that uses SPVanishRate bonus are not working properly. - Fix Velum Katzbalger item effect. - Added HPVanishRate bonus.
2015-12-17Change all chat mute checks to use pc->can_talk instead of direct check.hemagx1-0/+1
Put new macro pc_ismuted and change all other kind of mutes to use it Closes #937 as merged 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-04Merge pull request #910 from dastgir/idleAndrei Karas1-0/+1
Added a function to update idle time
2015-12-04Added a function to update idle timeDastgir1-0/+1
2015-11-14Changed struct map_session_data::queues into a VECTOR and renamed to ↵Haru1-2/+1
::script_queues Signed-off-by: Haru <haru@dotalux.com>
2015-10-11Cleanup of the HPluginData implementation (second part)Haru1-5/+2
- 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-4/+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-1/+1
Signed-off-by: Haru <haru@dotalux.com>
2015-09-09Autotrade Struct to HPMdastgir1-0/+4
2015-08-15HPM compatibility improvementsHaru1-5/+3
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-11Add n parameter to function pc_equipitem_pos.Andrei Karas1-1/+1
2015-08-05Add optional parameter to warp script command for prevent stoping npc ↵Andrei Karas1-0/+1
scripts after warp.
2015-07-18Move check cards related code into separate functions.Andrei Karas1-0/+2
This remove code duplicates and improve a bit code.
2015-06-19Removed ".." from include directivesHaru1-17/+17
- Include directives are now directory-independent. - This will allow building plugins from other directories in future. Signed-off-by: Haru <haru@dotalux.com>
2015-06-01Replaced some of the hardcoded values with constants (map)Haru1-6/+31
- Replaced several hardcoded values with the appropriate enums. - Added documentation for some hardcoded values that haven't been replaced by enums (yet) - Minor code legibility improvements. Signed-off-by: Haru <haru@dotalux.com>
2015-05-31Fixed Bug#8673malufett1-0/+1
-http://hercules.ws/board/tracker/issue-8673-gt-energy-gain/?gopid=25265#entry25265 -Fixed some skills related to spiritball, should now work like official. Signed-off-by: malufett <malufett.eat.my.binaries@gmail.com>
2015-05-19Fixed some issues reported by coverity scan [3/3]Haru1-14/+14
- Automatically zeroed variables are now zeroed in the correct size, regardless of padding. - Special thanks to Ind. Signed-off-by: Haru <haru@dotalux.com>
2015-05-17Added bonus4 variant of bAddEff to specify a durationHaru1-4/+8
- When a duration value is specified, the effect will have a fixed, non-reducible duration, as required by item scripts. - Special thanks to Michieru Signed-off-by: Haru <haru@dotalux.com>