From 80af93b67781912b88a199d93e9d21733ac6c567 Mon Sep 17 00:00:00 2001 From: "Guilherme G. Menaldo" Date: Sun, 13 Aug 2023 22:54:46 -0300 Subject: [PATCH] Rebalance of RG_BACKSTAP (Back Stab) - 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) --- db/re/skill_db.conf | 10 ++++------ src/map/battle.c | 10 ++++++++++ src/map/skill.c | 28 +++++++++++++++++++++++++++- src/map/status.c | 2 ++ 4 files changed, 43 insertions(+), 7 deletions(-) diff --git a/db/re/skill_db.conf b/db/re/skill_db.conf index 8c98e119a4e..e1b08470a92 100644 --- a/db/re/skill_db.conf +++ b/db/re/skill_db.conf @@ -6625,7 +6625,7 @@ skill_db: ( StatusChange: "SC_STUN" Description: "Back Stab" MaxLevel: 10 - Range: -1 + Range: 1 Hit: "BDT_SKILL" SkillType: { Enemy: true @@ -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 } }, { diff --git a/src/map/battle.c b/src/map/battle.c index ab790362be7..78529ee0510 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -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; @@ -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: diff --git a/src/map/skill.c b/src/map/skill.c index 9e7d9cb21d9..ccd36c3fd3f 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -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); @@ -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); @@ -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); diff --git a/src/map/status.c b/src/map/status.c index a0bb1f0cd5a..835a5219ce9 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -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: