Skip to content

Commit

Permalink
Updates Golden Thief Bug card behavior
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 Jan 26, 2022
1 parent 0fc05ce commit 4e9e597
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions db/re/skill_db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34211,6 +34211,8 @@ Body:
MaxLevel: 5
Type: Magic
TargetType: Attack
Flags:
IgnoreGtb: true
Range: 9
Hit: Single
HitCount: 1
Expand Down
1 change: 1 addition & 0 deletions src/map/script_constants.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8250,6 +8250,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
Original file line number Diff line number Diff line change
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: 6 additions & 2 deletions src/map/status.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10278,8 +10278,12 @@ 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)
return 0;
if (skill != nullptr && skill->skill_type == BF_MAGIC) {
if (skill->inf2[INF2_IGNOREGTB]) // Specific skill to bypass
;
else if ((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;
}

rate = cap_value(rate, 0, 10000);
Expand Down

0 comments on commit 4e9e597

Please sign in to comment.