summaryrefslogtreecommitdiff
path: root/src/map/pc.c
AgeCommit message (Collapse)AuthorFilesLines
2017-04-21Added AB_HIGHNESSHEAL in skill_add_heal_rate configurationJedzkie1-9/+29
2017-04-20Fix showing NO_MSG messages when using below 20101123 clientsJedzkie1-9/+16
2017-04-21Update GX Poison itemsJedzkie1-6/+0
2017-04-21Update Rune Knight Runes & OresJedzkie1-5/+0
2017-04-21Removed hard coded checks for no use while sitting in Aloevera and Anodyne item.Jedzkie1-5/+1
2017-04-20Made prevent_logout effect on log-in optionalJedzkie1-2/+4
kRO does not prevent players from logging out after connecting to its zone servers. Credits to @secretdataz of rAthena
2017-04-16Code-styling fixes to pc_unequipitem() in pc.cSmokexyz1-50/+49
2017-04-16Fixes an issue where the unequipped items with options do not re-calculate ↵Smokexyz1-8/+19
status.
2017-04-08Merge pull request #1663 from Smokexyz/bow-unequip-fixHaru1-0/+5
Unequip arrows when a bow is unequipped. (RE only)
2017-04-04Unequip arrows when a bow is unequipped. (RE only)Smokexyz1-0/+5
Forces the unequipment of arrows when a bow is unequipped. Based on original PR by @Jedzkie in #1079
2017-03-11Remove a duplicate comment lineHaru1-1/+0
- follow-up to 0f5fdca8945ec3afd5ba2e67a9d414f1ef5565c3 Signed-off-by: Haru <haru@dotalux.com>
2016-12-03Remove the platform-dependent variables from struct status_dataHaru1-6/+6
`struct status_data::class_` was platform dependent since c30bb75ec50624429bff7b4106db4be0fda366d6 in order to silence some compile warnings (uint32 on 64 bit builds and uint16 on 32 bit builds). It's now been changed to the correct type, int32, on all platforms. Since the change has potential to silently break third party code, the variable was renamed to `class`. Signed-off-by: Haru <haru@dotalux.com>
2016-12-03Add function to retrieve the appropriate fame list type for a job mapidHaru1-7/+27
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-15/+33
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-13/+30
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-123/+156
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-103/+106
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-20Synchronized the AegisNames to the in-source ITEMID_ constantsHaru1-5/+5
Some missing items were copied to the pre-renewal database. In general, when an item ID is hardcoded in source, it's preferable that the item exists in both databases. Signed-off-by: Haru <haru@dotalux.com>
2016-10-22Implemented SC_BITESCAR:Dastgir Pojee1-0/+3
Cannot be reset by dispell. Cannot be healed by item/NPC once in BITESCAR. Heal Skill would end the BiteScar Effect.
2016-10-22Implemented SU_SPRITEMABLE Skill.Dastgir Pojee1-0/+6
MaxHP + 1000, MaxSP + 100. Show's Spirit of Sea, Land and Life around the sprite when skill is learned.
2016-10-22Implemented SU_HIDE Skill.Dastgir Pojee1-0/+1
Transforms into Bush.
2016-10-22Implemented SU_BASIC_SKILL Skill of SummonerDastgir Pojee1-1/+17
Added Function for Basic Skills check.
2016-10-22Added Summoner Class.Dastgir Pojee1-2/+9
(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-08-14Update pc_steal_coin parameterEmistry1-6/+7
Added skill_lv as parameter to *pc_steal_coin() Closes #1395 as merged Signed-off-by: Haru <haru@dotalux.com>
2016-07-25Added a missing entry into messages.conf and added some comments where ↵epuncker1-4/+4
missing, ref #1282
2016-07-14Merge pull request #1361 from HerculesWS/coverity-fixesAndrei Karas1-60/+59
Fixed various issues reported by coverity
2016-07-14Fixes warp facing direction.KirieZ1-0/+5
Fixes #1240 Closes #1353 as merged
2016-07-14Changed mmo_charstatus::status_point and mmo_charstatus::skill_point to intHaru1-6/+7
Fixes several -Wsign-compare issues Signed-off-by: Haru <haru@dotalux.com>
2016-07-14Changed map_session_data::change_level_2nd and ↵Haru1-22/+19
map_session_data::change_level_3rd to int 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-24/+24
Fixes several -Wsign-compare issues Signed-off-by: Haru <haru@dotalux.com>
2016-07-14Changed various functions to take a const sdHaru1-6/+6
- 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-11/+12
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-13/+13
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-07-02Trivialities: indentation fixesHaru1-4/+4
Signed-off-by: Haru <haru@dotalux.com>
2016-07-01Merge pull request #1328 from HerculesWS/exp_fixesHaru1-25/+61
Fix EXP modifiers to match aegis modifiers calclution.
2016-06-30Use item attribute as flags varible. Now only ATTR_BROKEN flag exists.Andrei Karas1-1/+1
2016-06-29Fix EXP modifiers to match aegis modifiers calclution.hemagx1-25/+61
- Now Renewal Level Penalty being calculated in pc_calcexp only - Now Guild Tax is being paid after experience modifiers and not before - Now Experience modifiers being calculated in right way as in aegis (Race modifiers -> PK modifiers -> Premium modifiers -> Buff modifiers)
2016-06-24Add missing checks in pc.cAndrei Karas1-9/+115
2016-05-08Fixed various issues pointed out by cppcheckHaru1-11/+12
Signed-off-by: Haru <haru@dotalux.com>
2016-04-30Corrected truncation of the last letter in whisper messagesHaru1-1/+1
- Follow-up to ccfd054 - Fixes #1275 Signed-off-by: Haru <haru@dotalux.com>
2016-04-23Corrected the type of the 'length' argument of other message-related functionsHaru1-1/+1
- Variable types were changed to int - Corrects several warnings in VS2015 - Affected functions: `clif->wis_message()`, `intif->wis_message()`, `intif->guild_change_gm()`. Signed-off-by: Haru <haru@dotalux.com>
2016-04-23Removed the 'len' argument from clif_disp_onlyself() and clif->disp_message()Haru1-6/+6
- The argument was redundant, since the passed value is always the same as the passed string's length (it doesn't make sense otherwise). The argument is implicit now. Less typing and less errors. Signed-off-by: Haru <haru@dotalux.com>
2016-04-23Corrected the type of the 'length' argument of various broadcast-related ↵Haru1-3/+3
functions - Variable types were changed to int - Corrects several warnings in VS2015 - Affected functions: `clif->broadcast()`, `clif->broadcast2()`, `intif->broadcast()`, `intif->broadcast2()` Signed-off-by: Haru <haru@dotalux.com>
2016-04-23Changed map_session_data::chatID to int (and renamed to chat_id)Haru1-2/+2
- 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/+31
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-0/+53
Signed-off-by: Haru <haru@dotalux.com>
2016-03-20Dropped typedefs from union DBKey and struct DBDataHaru1-4/+5
Signed-off-by: Haru <haru@dotalux.com>
2016-03-20Removed unnecessary typedefs from sql.hHaru1-0/+1
- 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-10Add new logging types.Andrei Karas1-8/+8