diff options
author | Kenpachi Developer <Kenpachi.Developer@gmx.de> | 2020-01-20 09:49:23 +0100 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2020-02-09 23:46:56 +0100 |
commit | 1098b588625774ca2cf4e05527b00fd4d0187919 (patch) | |
tree | 8acbfabdcbbf2cd7188ea02ff5ef084a6c022052 /src/map/pc.h | |
parent | e164b55dbb908c0006f0ca4e2e74e9995f318d57 (diff) | |
download | hercules-1098b588625774ca2cf4e05527b00fd4d0187919.tar.gz hercules-1098b588625774ca2cf4e05527b00fd4d0187919.tar.bz2 hercules-1098b588625774ca2cf4e05527b00fd4d0187919.tar.xz hercules-1098b588625774ca2cf4e05527b00fd4d0187919.zip |
Fixed skill conditions check and <flag> parameter in itemskill() script command.
* itemskill() script command should check for the skill's conditions and also consumes them. SP are not consumed.
* The same applies to Hocus-pocus skill. Conditions should be checked and consumed, SP are not consumed.
* This was bugged for more than 6 years now. See linked bug report and commits.
Related bug:
* https://herc.ws/oldboard/tracker/issue-7210-itemskill-command-does-not-check-for-required-items/
Related commits:
* https://github.com/HerculesWS/Hercules/commit/b864056b8d088660fca9129bddad477732ed8df9
* https://github.com/HerculesWS/Hercules/commit/07272f7a16db87970583286db03167ca79604a69
Diffstat (limited to 'src/map/pc.h')
-rw-r--r-- | src/map/pc.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/map/pc.h b/src/map/pc.h index a3a3ee48d..4d7a7eef0 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -240,6 +240,8 @@ struct map_session_data { unsigned int refine_ui : 1; unsigned int npc_unloaded : 1; ///< The player is talking with an unloaded NPCs (respawned tombstones) unsigned int lapine_ui : 1; + unsigned int itemskill_conditions_checked : 1; // Used by itemskill() script command, to prevent second check of conditions after target was selected. + unsigned int itemskill_no_conditions : 1; // Used by itemskill() script command, to ignore skill conditions and don't consume them. } state; struct { unsigned char no_weapon_damage, no_magic_damage, no_misc_damage; @@ -643,6 +645,15 @@ END_ZEROED_BLOCK; bool achievements_received; // Title VECTOR_DECL(int) title_ids; + + /* + * itemskill_conditions_checked/itemskill_no_conditions abuse prevention. + * If a skill, casted by itemskill() script command, is aborted while target selection, + * the map server gets no notification where these states could be unset. + * Thus we need this helper variables to prevent abusing these states for next skill cast. + */ + int itemskill_id; + int itemskill_lv; }; #define EQP_WEAPON EQP_HAND_R |