Skip to content

Commit

Permalink
Updates Golden Thief Bug card behavior (#6562)
Browse files Browse the repository at this point in the history
* 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!
  • Loading branch information
aleos89 committed Feb 1, 2022
1 parent 181bc0e commit 3deb3e2
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 2 deletions.
2 changes: 2 additions & 0 deletions db/re/skill_db.yml
Expand Up @@ -34208,6 +34208,8 @@ Body:
MaxLevel: 5
Type: Magic
TargetType: Attack
Flags:
IgnoreGtb: true
Range: 9
Hit: Single
HitCount: 1
Expand Down
3 changes: 2 additions & 1 deletion doc/skill_db.txt
Expand Up @@ -3,7 +3,7 @@
//===== By: ==================================================
//= rAthena Dev Team
//===== Last Updated: ========================================
//= 20200324
//= 20220126
//===== Description: =========================================
//= Explanation of the skill_db.yml file and structure.
//============================================================
Expand Down Expand Up @@ -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.

---------------------------------------

Expand Down
1 change: 1 addition & 0 deletions src/map/script_constants.hpp
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions src/map/skill.hpp
Expand Up @@ -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,
};

Expand Down
8 changes: 7 additions & 1 deletion src/map/status.cpp
Expand Up @@ -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<s_skill_db> 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;
}

Expand Down

0 comments on commit 3deb3e2

Please sign in to comment.