Skip to content

Commit

Permalink
Rebalance of RG_BACKSTAP (Back Stab)
Browse files Browse the repository at this point in the history
- Skill mechanics changed
  - No longer needs to be behind the target to use skill
  - No longer ignores accuracy check
  - No longer usable from Hiding state
  - Now increases skill Hit by 4 per skill level
  - Number of hits changed:
    - Old: 1 hit
    - New: 2 hits with Dagger, 1 hit with other weapons
- SP cost reduced: 16 -> 12
- Cooldown added: 0.5s
- Number of hits changed

From massive skills rebalance (1st/2nd/transclass) (2018.10.31)
  • Loading branch information
guilherme-gm committed May 1, 2024
1 parent edd9f85 commit 80af93b
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 7 deletions.
10 changes: 4 additions & 6 deletions db/re/skill_db.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6625,7 +6625,7 @@ skill_db: (
StatusChange: "SC_STUN"
Description: "Back Stab"
MaxLevel: 10
Range: -1
Range: 1
Hit: "BDT_SKILL"
SkillType: {
Enemy: true
Expand All @@ -6636,14 +6636,12 @@ skill_db: (
}
AttackType: "Weapon"
Element: "Ele_Weapon"
DamageType: {
IgnoreFlee: true
}
AfterCastActDelay: 500
SkillData1: 5000
SkillData1: 5_000 // Stun duration (in miliseconds)
CoolDown: 500
FixedCastTime: 0
Requirements: {
SPCost: 16
SPCost: 12
}
},
{
Expand Down
10 changes: 10 additions & 0 deletions src/map/battle.c
Original file line number Diff line number Diff line change
Expand Up @@ -4799,6 +4799,11 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src, struct bl
break;

#ifdef RENEWAL
case RG_BACKSTAP:
if (sd != NULL && sd->weapontype == W_DAGGER)
wd.div_ = 2;
break;

case KN_BOWLINGBASH:
wd.div_ = 2;

Expand Down Expand Up @@ -5167,6 +5172,11 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src, struct bl
if (sd != NULL && pc->checkskill(sd, AS_SONICACCEL) > 0)
hitpercbonus += 50;
break;
#ifdef RENEWAL
case RG_BACKSTAP:
hitrate += 4 * skill_lv;
break;
#endif
case MC_CARTREVOLUTION:
case GN_CART_TORNADO:
case GN_CARTCANNON:
Expand Down
28 changes: 27 additions & 1 deletion src/map/skill.c
Original file line number Diff line number Diff line change
Expand Up @@ -4996,6 +4996,7 @@ static int skill_castend_damage_id(struct block_list *src, struct block_list *bl
status_change_end(src, SC_BLADESTOP, INVALID_TIMER);
break;

#ifndef RENEWAL
case RG_BACKSTAP:
{
enum unit_dir dir = map->calc_dir(src, bl->x, bl->y);
Expand All @@ -5010,6 +5011,29 @@ static int skill_castend_damage_id(struct block_list *src, struct block_list *bl
clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0);
}
break;
#else
case RG_BACKSTAP: {
// Finds out where the unit will be after using the skill
enum unit_dir dir = map->calc_dir(src, bl->x, bl->y);
if (Assert_chk(dir >= UNIT_DIR_FIRST && dir < UNIT_DIR_MAX)) {
map->freeblock_unlock(); // unblock before assert-returning
return 0;
}

short x = bl->x + dirx[dir];
short y = bl->y + diry[dir];
if (unit->move_pos(src, x, y, 1, true) != 0) {
clif->skill_fail(sd, skill_id, USESKILL_FAIL_POS, 0, 0);
break;
}

clif->slide(src, x, y);
clif->fixpos(src);

skill->attack(BF_WEAPON, src, src, bl, skill_id, skill_lv, tick, flag);
}
break;
#endif

case MO_FINGEROFFENSIVE:
skill->attack(BF_WEAPON,src,src,bl,skill_id,skill_lv,tick,flag);
Expand Down Expand Up @@ -6407,13 +6431,15 @@ static int skill_castend_id(int tid, int64 tick, int id, intptr_t data)
break;
}

if(ud->skill_id == RG_BACKSTAP) {
#ifndef RENEWAL
if (ud->skill_id == RG_BACKSTAP) {
enum unit_dir dir = map->calc_dir(src, target->x, target->y);
enum unit_dir t_dir = unit->getdir(target);
if (check_distance_bl(src, target, 0) || map->check_dir(dir, t_dir) != 0) {
break;
}
}
#endif

if( ud->skill_id == PR_TURNUNDEAD ) {
struct status_data *tstatus = status->get_status_data(target);
Expand Down
2 changes: 2 additions & 0 deletions src/map/status.c
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,9 @@ static int status_check_skilluse(struct block_list *src, struct block_list *targ
switch (skill_id) { //Usable skills while hiding.
case TF_HIDING:
case AS_GRIMTOOTH:
#ifndef RENEWAL
case RG_BACKSTAP:
#endif
case RG_RAID:
case NJ_SHADOWJUMP:
case NJ_KIRIKAGE:
Expand Down

0 comments on commit 80af93b

Please sign in to comment.