From 138e949fef1b68ae79485f82cba5d814a36f333c Mon Sep 17 00:00:00 2001 From: "Guilherme G. Menaldo" Date: Thu, 22 Aug 2024 22:00:57 -0300 Subject: [PATCH 1/5] Remove some FALLTHROUGH to simplify code no reason to FALLTHROUGH + if a lot of code just to save one line of code --- src/map/battle.c | 51 ++++++++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 23 deletions(-) diff --git a/src/map/battle.c b/src/map/battle.c index f2ede54dce1..895e2baa049 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -5532,36 +5532,41 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src, struct bl if ( sd && s_ele != sd->bonus.arrow_ele ) s_ele = sd->bonus.arrow_ele; break; + case NJ_TATAMIGAESHI: - ATK_RATE(200); - /* Fall through */ + ATK_RATE(200); + ATK_RATE(battle->calc_skillratio(BF_WEAPON, src, target, skill_id, skill_lv, skillratio, wflag)); + break; + case LK_SPIRALPIERCE: - case ML_SPIRALPIERCE: // [malufett] - if( skill_id != NJ_TATAMIGAESHI ){ - short index = sd?sd->equip_index[EQI_HAND_R]:0; - GET_NORMAL_ATTACK( (sc && sc->data[SC_MAXIMIZEPOWER]?1:0)|(sc && sc->data[SC_WEAPONPERFECT]?8:0), 0); - wd.damage = wd.damage * 70 / 100; - //n_ele = true; // FIXME: This is has no effect if it's after GET_NORMAL_ATTACK (was this intended, or was it supposed to be put above?) - - if (sd && index >= 0 && - sd->inventory_data[index] && - sd->inventory_data[index]->type == IT_WEAPON) - ATK_ADD(sd->inventory_data[index]->weight * 7 / 100); + case ML_SPIRALPIERCE: { // [malufett] + short index = sd?sd->equip_index[EQI_HAND_R]:0; + GET_NORMAL_ATTACK( (sc && sc->data[SC_MAXIMIZEPOWER]?1:0)|(sc && sc->data[SC_WEAPONPERFECT]?8:0), 0); + wd.damage = wd.damage * 70 / 100; + //n_ele = true; // FIXME: This is has no effect if it's after GET_NORMAL_ATTACK (was this intended, or was it supposed to be put above?) - switch (tstatus->size) { - case SZ_SMALL: //Small: 115% - ATK_RATE(115); - break; - case SZ_BIG: //Large: 85% - ATK_RATE(85); - } - wd.damage = battle->calc_masteryfix(src, target, skill_id, skill_lv, wd.damage, wd.div_, 0, flag.weapon); - wd.damage = battle->calc_cardfix2(src, target, wd.damage, s_ele, nk, wd.flag); + if (sd && index >= 0 && + sd->inventory_data[index] && + sd->inventory_data[index]->type == IT_WEAPON) + ATK_ADD(sd->inventory_data[index]->weight * 7 / 100); + + switch (tstatus->size) { + case SZ_SMALL: //Small: 115% + ATK_RATE(115); + break; + case SZ_BIG: //Large: 85% + ATK_RATE(85); } - FALLTHROUGH + wd.damage = battle->calc_masteryfix(src, target, skill_id, skill_lv, wd.damage, wd.div_, 0, flag.weapon); + wd.damage = battle->calc_cardfix2(src, target, wd.damage, s_ele, nk, wd.flag); + ATK_RATE(battle->calc_skillratio(BF_WEAPON, src, target, skill_id, skill_lv, skillratio, wflag)); + } + break; + #endif default: ATK_RATE(battle->calc_skillratio(BF_WEAPON, src, target, skill_id, skill_lv, skillratio, wflag)); + break; } //Constant/misc additions from skills From 42c75f6e6ef284d08612aa726b9df13a4c52ccec Mon Sep 17 00:00:00 2001 From: gbasso666 Date: Sun, 18 Aug 2024 18:15:52 -0300 Subject: [PATCH 2/5] Rebalance of LK_SPIRALPIERCE (Spiral Pierce) (RE) - Changed variable cast time* - Before: 150/250/350/450/500 - After: 250ms in all skill levels - Changed fixed cast time* - Before: 150/250/350/450/500 - After: 300ms in all skill levels - Changed global delay - Before: 1200/1400/1600/1800/2000 - After: 1sec in all skill levels - Changed damage formula - BaseATK increased by 50% - Old: 150/200/250/300/350 - New: 200/250/300/350/400 - Size modifier changed - Small: 125% -> 130% - Medium: 100% -> 115% - Large: 75% -> 100% - Now deals more damage depending on user's base level Note 1: Cast time update is a somewhat a guess. Patch notes (iRO / kRO) "variable cast time reduced from 0.5s to 0.25s at level 5" iRO wiki and bRO wiki says "variable cast time is 0.25s on all skill levels" we are following wikis here. Note 2: Just like cast time, fixed cast time is also somewhat a guess. Patch notes (iRO / kRO) "Fixed casting time reduced to 0.3 second (previously 0.5 seconds) starting at Level 5" While iRO wiki and bRO wiki says "0.3 seconds in all skills levels" we are following wikis here. From 1st/2nd/Transclass rebalance (2018.11.28) Co-authored-by: Guilherme G. M. --- db/re/skill_db.conf | 39 +++------------------------------------ src/map/battle.c | 11 +++++++---- 2 files changed, 10 insertions(+), 40 deletions(-) diff --git a/db/re/skill_db.conf b/db/re/skill_db.conf index aa3bc9bd56e..e171fe2095f 100644 --- a/db/re/skill_db.conf +++ b/db/re/skill_db.conf @@ -12349,43 +12349,10 @@ skill_db: ( AttackType: "Weapon" Element: "Ele_Weapon" NumberOfHits: 5 - CastTime: { - Lv1: 150 - Lv2: 250 - Lv3: 350 - Lv4: 450 - Lv5: 500 - Lv6: 500 - Lv7: 500 - Lv8: 500 - Lv9: 500 - Lv10: 500 - } - AfterCastActDelay: { - Lv1: 1200 - Lv2: 1400 - Lv3: 1600 - Lv4: 1800 - Lv5: 2000 - Lv6: 2200 - Lv7: 2400 - Lv8: 2600 - Lv9: 2800 - Lv10: 3000 - } + CastTime: 250 + AfterCastActDelay: 1_000 SkillData2: 1000 - FixedCastTime: { - Lv1: 150 - Lv2: 250 - Lv3: 350 - Lv4: 450 - Lv5: 500 - Lv6: 500 - Lv7: 500 - Lv8: 500 - Lv9: 500 - Lv10: 500 - } + FixedCastTime: 300 Requirements: { SPCost: { Lv1: 18 diff --git a/src/map/battle.c b/src/map/battle.c index 895e2baa049..7794a699a2d 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -2318,7 +2318,8 @@ static int battle_calc_skillratio(int attack_type, struct block_list *src, struc #else case LK_SPIRALPIERCE: case ML_SPIRALPIERCE: - skillratio += 50 * skill_lv; + skillratio += -100 + 150 + 50 * skill_lv; + RE_LVL_DMOD(100); #endif break; case PA_SACRIFICE: @@ -5551,11 +5552,13 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src, struct bl ATK_ADD(sd->inventory_data[index]->weight * 7 / 100); switch (tstatus->size) { - case SZ_SMALL: //Small: 115% + case SZ_SMALL: // Small: 130% + ATK_RATE(130); + break; + + case SZ_MEDIUM: // Medium: 115% ATK_RATE(115); break; - case SZ_BIG: //Large: 85% - ATK_RATE(85); } wd.damage = battle->calc_masteryfix(src, target, skill_id, skill_lv, wd.damage, wd.div_, 0, flag.weapon); wd.damage = battle->calc_cardfix2(src, target, wd.damage, s_ele, nk, wd.flag); From ace449df96928098f900d4867d0cb54f2fe2bbe2 Mon Sep 17 00:00:00 2001 From: gbasso666 Date: Sun, 1 Sep 2024 10:37:21 -0300 Subject: [PATCH 3/5] Rebalance of LK_AURABLADE (Aura Blade) - Changed damage bonus formula - Old: SkillLv x 20 - New: BaseLv x (SkillLv + 3) From 1st/2nd/Transclass rebalance (2018.10) --- src/map/battle.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/map/battle.c b/src/map/battle.c index 7794a699a2d..e855f09b43d 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -5871,9 +5871,13 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src, struct bl ){ int lv = sc->data[SC_AURABLADE]->val1; #ifdef RENEWAL - lv *= ((skill_id == LK_SPIRALPIERCE || skill_id == ML_SPIRALPIERCE)?wd.div_:1); // +100 per hit in lv 5 -#endif + if (skill_id == LK_SPIRALPIERCE || skill_id == ML_SPIRALPIERCE) + lv *= wd.div_; // +100 per hit in lv 5 + + ATK_ADD(sd->status.base_level * (lv + 3)); +#else ATK_ADD(20*lv); +#endif } if( !skill_id ) { From 8ba876b09b682c46e260995db435aed1f38fab26 Mon Sep 17 00:00:00 2001 From: "Guilherme G. Menaldo" Date: Sun, 24 Nov 2024 18:32:53 -0300 Subject: [PATCH 4/5] Rebalance of LK_CONCENTRATION (Concentration) - ATK Bonus changed - Old: (SkillLv x 5) % flat - New: (5 + SkillLv x 2) % ATK % - Def reduction % changed - Old: (SkillLv x 5) % - New: (5 + SkillLv x 2) % - Duration changed to 60s at all skill levels - The effect no longer gets removed when changing/removing weapon From 1st/2nd/Transclass rebalance (2018.10) --- db/re/sc_config.conf | 4 ++-- db/re/skill_db.conf | 13 +------------ src/map/battle.c | 2 ++ src/map/pc.c | 1 - src/map/status.c | 21 +++++++++++++++++---- 5 files changed, 22 insertions(+), 19 deletions(-) diff --git a/db/re/sc_config.conf b/db/re/sc_config.conf index 07275e9a184..501c6ccd949 100644 --- a/db/re/sc_config.conf +++ b/db/re/sc_config.conf @@ -773,7 +773,7 @@ SC_LKCONCENTRATION: { } CalcFlags: { Hit: true - AtkPerc: true + Watk: true DefPerc: true } Icon: "SI_LKCONCENTRATION" @@ -5988,7 +5988,7 @@ SC_FALLEN_ANGEL: { SC_HEAT_BARREL: { Flags: { Buff: true - } + } CalcFlags: { Hit: true Aspd: true diff --git a/db/re/skill_db.conf b/db/re/skill_db.conf index e171fe2095f..cdb76505e85 100644 --- a/db/re/skill_db.conf +++ b/db/re/skill_db.conf @@ -11040,18 +11040,7 @@ skill_db: ( DamageType: { NoDamage: true } - SkillData1: { - Lv1: 25000 - Lv2: 30000 - Lv3: 35000 - Lv4: 40000 - Lv5: 45000 - Lv6: 50000 - Lv7: 55000 - Lv8: 60000 - Lv9: 65000 - Lv10: 70000 - } + SkillData1: 60_000 // Duration of SC_LKCONCENTRATION (in milliseconds) FixedCastTime: 0 Requirements: { SPCost: { diff --git a/src/map/battle.c b/src/map/battle.c index e855f09b43d..d801375981a 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -2991,8 +2991,10 @@ static int battle_calc_skillratio(int attack_type, struct block_list *src, struc skillratio += 200; if( sc->data[SC_TRUESIGHT] ) skillratio += 2*sc->data[SC_TRUESIGHT]->val1; +#ifndef RENEWAL if( sc->data[SC_LKCONCENTRATION] ) skillratio += sc->data[SC_LKCONCENTRATION]->val2; +#endif if (sd != NULL && sd->weapontype == W_KATAR && (i=pc->checkskill(sd,ASC_KATAR)) > 0) skillratio += skillratio * (10 + 2 * i) / 100; #endif diff --git a/src/map/pc.c b/src/map/pc.c index 48e8a3927c6..0ca5690032f 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -6311,7 +6311,6 @@ static int pc_checkallowskill(struct map_session_data *sd) SC_DANCING, SC_GS_GATLINGFEVER, #ifdef RENEWAL - SC_LKCONCENTRATION, SC_EDP, #endif SC_FEARBREEZE, diff --git a/src/map/status.c b/src/map/status.c index 8bcb2d5bb94..c66a8060ff7 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -4341,8 +4341,10 @@ static int status_calc_atk_percent(struct block_list *bl, struct status_change * if (sc->data[SC_PROVOKE] != NULL) atk_percent += sc->data[SC_PROVOKE]->val3; +#ifndef RENEWAL if (sc->data[SC_LKCONCENTRATION] != NULL) atk_percent += sc->data[SC_LKCONCENTRATION]->val2; +#endif if (sc->data[SC_HAMI_BLOODLUST] != NULL) atk_percent += sc->data[SC_HAMI_BLOODLUST]->val2; @@ -4560,12 +4562,12 @@ static int status_calc_batk(struct block_list *bl, struct status_change *sc, int /** * Calculates bl's Extra ATK gains from Buffs. - * + * * These are very specific bonus from SCs where: * - They show in status window ATK right side (after the + sign) * - They are given by SCs, but they work like equipment's ATK bonus * - They are not linked to the weapon attack value - * + * * @param bl unit whose status is being calculated * @param sc unit's SC list * @returns Value of Extra ATK conceded by buffs @@ -4602,6 +4604,12 @@ static int status_calc_watk(struct block_list *bl, struct status_change *sc, int watk -= sc->data[SC_WATER_BARRIER]->val3; if(sc->data[SC_GENTLETOUCH_CHANGE] && sc->data[SC_GENTLETOUCH_CHANGE]->val2) watk += sc->data[SC_GENTLETOUCH_CHANGE]->val2; + +#ifdef RENEWAL + if (sc->data[SC_LKCONCENTRATION] != NULL) + watk += watk * sc->data[SC_LKCONCENTRATION]->val2 / 100; +#endif + return cap_value(watk, battle_config.watk_min, battle_config.watk_max); } #ifndef RENEWAL @@ -8374,7 +8382,7 @@ static int status_change_start_sub(struct block_list *src, struct block_list *bl } else { val2 = 0; //0 means that STR, DEX and INT should be halved } - + val1 += bonus; // Officially, val1 is incremented (for us, this doesn't make a difference) break; } @@ -8430,9 +8438,14 @@ static int status_change_start_sub(struct block_list *src, struct block_list *bl total_tick += total_tick / 10; break; case SC_LKCONCENTRATION: - val2 = 5 * val1; // ATK% Increase val3 = 10*val1; //Hit Increase +#ifdef RENEWAL + val2 = 5 + 2 * val1; // ATK% increase + val4 = 5 + 2 * val1; // Def% reduction +#else + val2 = 5 * val1; // ATK% Increase val4 = 5 * val1; // Def% reduction +#endif sc_start(src, bl, SC_ENDURE, 100, 1, total_tick, skill_id); // Endure effect break; case SC_ANGELUS: From 9bb00b5ece9e16eaabd09d0bedf3ef0aa878a299 Mon Sep 17 00:00:00 2001 From: gbasso666 Date: Sun, 24 Nov 2024 17:39:44 -0300 Subject: [PATCH 5/5] Fix damage increase by STR of KN_BRANDISHSPEAR (RE) it should increase the ration by 5 for each STR point, not 1 From massive skills rebalance (1st/2nd/transclass) (2018.10.31) --- src/map/battle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/map/battle.c b/src/map/battle.c index d801375981a..5e7946bb25c 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -2106,7 +2106,7 @@ static int battle_calc_skillratio(int attack_type, struct block_list *src, struc break; #ifdef RENEWAL case KN_BRANDISHSPEAR: - skillratio += 300 + 100 * skill_lv + status_get_str(src); + skillratio += 300 + 100 * skill_lv + status_get_str(src) * 5; break; #else case KN_BRANDISHSPEAR: