From 3deb3e204852f169c84e5ea9399e8a1e5129a71e Mon Sep 17 00:00:00 2001 From: Aleos Date: Tue, 1 Feb 2022 15:53:27 -0500 Subject: [PATCH] Updates Golden Thief Bug card behavior (#6562) * Fixes #5918. * Target magic skills should get blocked even when cast on self. * Self magic skills should get blocked on all targets except self. * Adds an IgnoreGtb skill flag to explicitly allow a skill to bypass these checks. Thanks to @Playtester! --- db/re/skill_db.yml | 2 ++ doc/skill_db.txt | 3 ++- src/map/script_constants.hpp | 1 + src/map/skill.hpp | 1 + src/map/status.cpp | 8 +++++++- 5 files changed, 13 insertions(+), 2 deletions(-) diff --git a/db/re/skill_db.yml b/db/re/skill_db.yml index 735a39b70b..341b7af560 100644 --- a/db/re/skill_db.yml +++ b/db/re/skill_db.yml @@ -34208,6 +34208,8 @@ Body: MaxLevel: 5 Type: Magic TargetType: Attack + Flags: + IgnoreGtb: true Range: 9 Hit: Single HitCount: 1 diff --git a/doc/skill_db.txt b/doc/skill_db.txt index e24cec7e74..02e6902c4d 100644 --- a/doc/skill_db.txt +++ b/doc/skill_db.txt @@ -3,7 +3,7 @@ //===== By: ================================================== //= rAthena Dev Team //===== Last Updated: ======================================== -//= 20200324 +//= 20220126 //===== Description: ========================================= //= Explanation of the skill_db.yml file and structure. //============================================================ @@ -102,6 +102,7 @@ IgnoreWugBite - Ignore RA_WUGBITE. IgnoreAutoGuard - Not blocked by SC_AUTOGUARD (When TargetType is Weapon only). IgnoreCicada - Not blocked by SC_UTSUSEMI or SC_BUNSINJYUTSU (When TargetType is Weapon only). ShowScale - Shows AoE area while casting +IgnoreGtb - Not blocked by Golden Thief Bug card. --------------------------------------- diff --git a/src/map/script_constants.hpp b/src/map/script_constants.hpp index d886714215..8749f16b42 100644 --- a/src/map/script_constants.hpp +++ b/src/map/script_constants.hpp @@ -8251,6 +8251,7 @@ export_constant(INF2_IGNOREAUTOGUARD); export_constant(INF2_IGNORECICADA); export_constant(INF2_SHOWSCALE); + export_constant(INF2_IGNOREGTB); /* skill no near npc flags */ export_constant(SKILL_NONEAR_WARPPORTAL); diff --git a/src/map/skill.hpp b/src/map/skill.hpp index 2353b3fe06..a8f94af15c 100644 --- a/src/map/skill.hpp +++ b/src/map/skill.hpp @@ -107,6 +107,7 @@ enum e_skill_inf2 : uint8 { INF2_IGNOREAUTOGUARD , // Skill is not blocked by SC_AUTOGUARD (physical-skill only) INF2_IGNORECICADA, // Skill is not blocked by SC_UTSUSEMI or SC_BUNSINJYUTSU (physical-skill only) INF2_SHOWSCALE, // Skill shows AoE area while casting + INF2_IGNOREGTB, // Skill ignores effect of GTB INF2_MAX, }; diff --git a/src/map/status.cpp b/src/map/status.cpp index d865db696b..7309acaf92 100644 --- a/src/map/status.cpp +++ b/src/map/status.cpp @@ -10278,7 +10278,13 @@ t_tick status_get_sc_def(struct block_list *src, struct block_list *bl, enum sc_ if (status_isimmune(bl)) { std::shared_ptr skill = skill_db.find(battle_getcurrentskill(src)); - if (skill != nullptr && skill->nameid != AG_DEADLY_PROJECTION && skill->skill_type == BF_MAGIC) + if (skill == nullptr) // Check for ground-type skills using the status when a player moves through units + skill = skill_db.find(status_sc2skill(type)); + + if (skill != nullptr && skill->skill_type == BF_MAGIC && // Basic magic skill + !skill->inf2[INF2_IGNOREGTB] && // Specific skill to bypass + ((skill->inf == INF_ATTACK_SKILL || skill->inf == INF_GROUND_SKILL || skill->inf == INF_SUPPORT_SKILL) || // Target skills should get blocked even when cast on self + (skill->inf == INF_SELF_SKILL && src != bl))) // Self skills should get blocked on all targets except self return 0; }