From bec43c8e1e2f0e9401761607623ba6d848c3ab5c Mon Sep 17 00:00:00 2001 From: "Guilherme G. Menaldo" Date: Wed, 16 Aug 2023 21:57:50 -0300 Subject: [PATCH 1/7] Rebalance of SA_VOLCANO (Volcano) - Requirement changed: Yellow Gemstone -> Blue Gemstone - Effect changed: - Old: ATK +(SkillLevel x 10) - New: ATK/MATK +(5 + (Skill Level x 5)) From massive skills rebalance (1st/2nd/transclass) (2018.10.31) --- db/pre-re/skill_db.conf | 2 +- db/re/sc_config.conf | 1 + db/re/skill_db.conf | 4 ++-- src/map/status.c | 12 +++++++++--- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/db/pre-re/skill_db.conf b/db/pre-re/skill_db.conf index be95667f2f1..0fed4f6a9b8 100644 --- a/db/pre-re/skill_db.conf +++ b/db/pre-re/skill_db.conf @@ -8559,7 +8559,7 @@ skill_db: ( } InterruptCast: true CastTime: 5000 - SkillData1: { + SkillData1: { // Ground skill unit duration (in milliseconds) Lv1: 60000 Lv2: 120000 Lv3: 180000 diff --git a/db/re/sc_config.conf b/db/re/sc_config.conf index 07275e9a184..48d356ace21 100644 --- a/db/re/sc_config.conf +++ b/db/re/sc_config.conf @@ -871,6 +871,7 @@ SC_VOLCANO: { } CalcFlags: { Watk: true + Matk: true } Icon: "SI_GROUNDMAGIC" Skill: "SA_VOLCANO" diff --git a/db/re/skill_db.conf b/db/re/skill_db.conf index aa3bc9bd56e..ecf95e6191f 100644 --- a/db/re/skill_db.conf +++ b/db/re/skill_db.conf @@ -8784,7 +8784,7 @@ skill_db: ( } InterruptCast: true CastTime: 4000 - SkillData1: { + SkillData1: { // Ground skill unit duration (in milliseconds) Lv1: 60000 Lv2: 120000 Lv3: 180000 @@ -8811,7 +8811,7 @@ skill_db: ( Lv10: 30 } Items: { - Yellow_Gemstone: 1 + Blue_Gemstone: 1 } } Unit: { diff --git a/src/map/status.c b/src/map/status.c index 8bcb2d5bb94..8f9f3092ae0 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -4743,6 +4743,9 @@ static int status_calc_matk(struct block_list *bl, struct status_change *sc, int #else // RENEWAL if (sc->data[SC_IMPOSITIO]) matk += sc->data[SC_IMPOSITIO]->val2; + // FIXME: This (and SC_IMPOSITIO) should have their effects shown in status window. + if (sc->data[SC_VOLCANO] != NULL) + matk += sc->data[SC_VOLCANO]->val2; #endif if (sc->data[SC_ZANGETSU]) matk += sc->data[SC_ZANGETSU]->val3; @@ -7868,11 +7871,14 @@ static int status_change_start_sub(struct block_list *src, struct block_list *bl val4 = 5 + val1*2; //Chance of casting break; case SC_VOLCANO: - val2 = val1*10; //Watk increase - #ifndef RENEWAL +#ifndef RENEWAL + val2 = val1 * 10; // Watk increase + if (st->def_ele != ELE_FIRE) val2 = 0; - #endif +#else + val2 = 5 + val1 * 5; // Watk/Matk increase +#endif break; case SC_VIOLENTGALE: val2 = val1*3; //Flee increase From 51ff0c890cc1b315ce8683039fa41edc2df6dd1f Mon Sep 17 00:00:00 2001 From: "Guilherme G. Menaldo" Date: Wed, 16 Aug 2023 21:58:57 -0300 Subject: [PATCH 2/7] Rebalance of SA_DELUGE (Deluge) and SA_VIOLENTGALE (Whirlwind) - Requirement changed: Yellow Gemstone -> Blue Gemstone From massive skills rebalance (1st/2nd/transclass) (2018.10.31) --- db/pre-re/skill_db.conf | 4 ++-- db/re/skill_db.conf | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/db/pre-re/skill_db.conf b/db/pre-re/skill_db.conf index 0fed4f6a9b8..7954fce1327 100644 --- a/db/pre-re/skill_db.conf +++ b/db/pre-re/skill_db.conf @@ -8620,7 +8620,7 @@ skill_db: ( } InterruptCast: true CastTime: 5000 - SkillData1: { + SkillData1: { // Ground skill unit duration (in milliseconds) Lv1: 60000 Lv2: 120000 Lv3: 180000 @@ -8681,7 +8681,7 @@ skill_db: ( } InterruptCast: true CastTime: 5000 - SkillData1: { + SkillData1: { // Ground skill unit duration (in milliseconds) Lv1: 60000 Lv2: 120000 Lv3: 180000 diff --git a/db/re/skill_db.conf b/db/re/skill_db.conf index ecf95e6191f..1562e0bf647 100644 --- a/db/re/skill_db.conf +++ b/db/re/skill_db.conf @@ -8845,7 +8845,7 @@ skill_db: ( } InterruptCast: true CastTime: 4000 - SkillData1: { + SkillData1: { // Ground skill unit duration (in milliseconds) Lv1: 60000 Lv2: 120000 Lv3: 180000 @@ -8872,7 +8872,7 @@ skill_db: ( Lv10: 30 } Items: { - Yellow_Gemstone: 1 + Blue_Gemstone: 1 } } Unit: { @@ -8906,7 +8906,7 @@ skill_db: ( } InterruptCast: true CastTime: 4000 - SkillData1: { + SkillData1: { // Ground skill unit duration (in milliseconds) Lv1: 60000 Lv2: 120000 Lv3: 180000 @@ -8933,7 +8933,7 @@ skill_db: ( Lv10: 30 } Items: { - Yellow_Gemstone: 1 + Blue_Gemstone: 1 } } Unit: { From b0f296ae0955a75f2a3f2f0ca21e1102a145e4f8 Mon Sep 17 00:00:00 2001 From: "Guilherme G. Menaldo" Date: Wed, 16 Aug 2023 22:36:19 -0300 Subject: [PATCH 3/7] Rebalance of Sage's Endow skills - Fixed casting time reduced: 3s -> 1s - Variable casting time added: 1s - Requirement changed to Indigo Point/Yellow Wish Point/Lime Green Point/Scarlet Point (based on skill element) - Now increase correspond element magical damage by 1% per skill level - Removes skill failure - Changes duration - Old: 20 minutes (Level 1 ~ 4), 30 minutes (Level 5) - New: 5 x (Skill Level + 1) minutes From massive skills rebalance (1st/2nd/transclass) (2018.10.31) --- db/pre-re/skill_db.conf | 8 +-- db/re/sc_config.conf | 8 +-- db/re/skill_db.conf | 108 +++++++++++++++++++++------------------- src/map/battle.c | 1 + src/map/skill.c | 17 +++++-- src/map/status.c | 11 ++++ 6 files changed, 89 insertions(+), 64 deletions(-) diff --git a/db/pre-re/skill_db.conf b/db/pre-re/skill_db.conf index 7954fce1327..b5b820b654f 100644 --- a/db/pre-re/skill_db.conf +++ b/db/pre-re/skill_db.conf @@ -8381,7 +8381,7 @@ skill_db: ( } InterruptCast: true CastTime: 3000 - SkillData1: { + SkillData1: { // Endow (SC) duration (in milliseconds) Lv1: 1200000 Lv2: 1200000 Lv3: 1200000 @@ -8424,7 +8424,7 @@ skill_db: ( } InterruptCast: true CastTime: 3000 - SkillData1: { + SkillData1: { // Endow (SC) duration (in milliseconds) Lv1: 1200000 Lv2: 1200000 Lv3: 1200000 @@ -8467,7 +8467,7 @@ skill_db: ( } InterruptCast: true CastTime: 3000 - SkillData1: { + SkillData1: { // Endow (SC) duration (in milliseconds) Lv1: 1200000 Lv2: 1200000 Lv3: 1200000 @@ -8510,7 +8510,7 @@ skill_db: ( } InterruptCast: true CastTime: 3000 - SkillData1: { + SkillData1: { // Endow (SC) duration (in milliseconds) Lv1: 1200000 Lv2: 1200000 Lv3: 1200000 diff --git a/db/re/sc_config.conf b/db/re/sc_config.conf index 48d356ace21..e94552d3fc1 100644 --- a/db/re/sc_config.conf +++ b/db/re/sc_config.conf @@ -681,7 +681,7 @@ SC_PROPERTYFIRE: { Buff: true } CalcFlags: { - Atk_Ele: true + All: true } Icon: "SI_PROPERTYFIRE" Skill: "SA_FLAMELAUNCHER" @@ -695,7 +695,7 @@ SC_PROPERTYWATER: { Buff: true } CalcFlags: { - Atk_Ele: true + All: true } Icon: "SI_PROPERTYWATER" Skill: "SA_FROSTWEAPON" @@ -709,7 +709,7 @@ SC_PROPERTYWIND: { Buff: true } CalcFlags: { - Atk_Ele: true + All: true } Icon: "SI_PROPERTYWIND" Skill: "SA_LIGHTNINGLOADER" @@ -723,7 +723,7 @@ SC_PROPERTYGROUND: { Buff: true } CalcFlags: { - Atk_Ele: true + All: true } Icon: "SI_PROPERTYGROUND" Skill: "SA_SEISMICWEAPON" diff --git a/db/re/skill_db.conf b/db/re/skill_db.conf index 1562e0bf647..431e19a72e2 100644 --- a/db/re/skill_db.conf +++ b/db/re/skill_db.conf @@ -8609,23 +8609,24 @@ skill_db: ( NoDamage: true } InterruptCast: true - SkillData1: { - Lv1: 1200000 - Lv2: 1200000 - Lv3: 1200000 - Lv4: 1200000 - Lv5: 1800000 - Lv6: 1800000 - Lv7: 1800000 - Lv8: 1800000 - Lv9: 1800000 - Lv10: 1800000 + SkillData1: { // Endow (SC) duration (in milliseconds) + Lv1: 600_000 + Lv2: 900_000 + Lv3: 1_200_000 + Lv4: 1_500_000 + Lv5: 1_800_000 + Lv6: 1_800_000 + Lv7: 1_800_000 + Lv8: 1_800_000 + Lv9: 1_800_000 + Lv10: 1_800_000 } - FixedCastTime: 3000 + FixedCastTime: 1_000 + CastTime: 1_000 Requirements: { SPCost: 40 Items: { - Boody_Red: 1 + Scarlet_Pts: 1 } } }, @@ -8651,23 +8652,24 @@ skill_db: ( NoDamage: true } InterruptCast: true - SkillData1: { - Lv1: 1200000 - Lv2: 1200000 - Lv3: 1200000 - Lv4: 1200000 - Lv5: 1800000 - Lv6: 1800000 - Lv7: 1800000 - Lv8: 1800000 - Lv9: 1800000 - Lv10: 1800000 + SkillData1: { // Endow (SC) duration (in milliseconds) + Lv1: 600_000 + Lv2: 900_000 + Lv3: 1_200_000 + Lv4: 1_500_000 + Lv5: 1_800_000 + Lv6: 1_800_000 + Lv7: 1_800_000 + Lv8: 1_800_000 + Lv9: 1_800_000 + Lv10: 1_800_000 } - FixedCastTime: 3000 + FixedCastTime: 1_000 + CastTime: 1_000 Requirements: { SPCost: 40 Items: { - Crystal_Blue: 1 + Indigo_Pts: 1 } } }, @@ -8693,23 +8695,24 @@ skill_db: ( NoDamage: true } InterruptCast: true - SkillData1: { - Lv1: 1200000 - Lv2: 1200000 - Lv3: 1200000 - Lv4: 1200000 - Lv5: 1800000 - Lv6: 1800000 - Lv7: 1800000 - Lv8: 1800000 - Lv9: 1800000 - Lv10: 1800000 + SkillData1: { // Endow (SC) duration (in milliseconds) + Lv1: 600_000 + Lv2: 900_000 + Lv3: 1_200_000 + Lv4: 1_500_000 + Lv5: 1_800_000 + Lv6: 1_800_000 + Lv7: 1_800_000 + Lv8: 1_800_000 + Lv9: 1_800_000 + Lv10: 1_800_000 } - FixedCastTime: 3000 + FixedCastTime: 1_000 + CastTime: 1_000 Requirements: { SPCost: 40 Items: { - Wind_Of_Verdure: 1 + Yellow_Wish_Pts: 1 } } }, @@ -8735,23 +8738,24 @@ skill_db: ( NoDamage: true } InterruptCast: true - SkillData1: { - Lv1: 1200000 - Lv2: 1200000 - Lv3: 1200000 - Lv4: 1200000 - Lv5: 1800000 - Lv6: 1800000 - Lv7: 1800000 - Lv8: 1800000 - Lv9: 1800000 - Lv10: 1800000 + SkillData1: { // Endow (SC) duration (in milliseconds) + Lv1: 600_000 + Lv2: 900_000 + Lv3: 1_200_000 + Lv4: 1_500_000 + Lv5: 1_800_000 + Lv6: 1_800_000 + Lv7: 1_800_000 + Lv8: 1_800_000 + Lv9: 1_800_000 + Lv10: 1_800_000 } - FixedCastTime: 3000 + FixedCastTime: 1_000 + CastTime: 1_000 Requirements: { SPCost: 40 Items: { - Yellow_Live: 1 + Lime_Green_Pts: 1 } } }, diff --git a/src/map/battle.c b/src/map/battle.c index f2ede54dce1..0839d5bd195 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -4093,6 +4093,7 @@ static struct Damage battle_calc_magic_attack(struct block_list *src, struct blo } } } + #ifndef HMAP_ZONE_DAMAGE_CAP_TYPE if (skill_id) { for(i = 0; i < map->list[target->m].zone->capped_skills_count; i++) { diff --git a/src/map/skill.c b/src/map/skill.c index 03d93c7b5af..72f77078058 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -7289,7 +7289,7 @@ static int skill_castend_nodamage_id(struct block_list *src, struct block_list * case SA_FLAMELAUNCHER: // added failure chance and chance to break weapon if turned on [Valaris] case SA_FROSTWEAPON: case SA_LIGHTNINGLOADER: - case SA_SEISMICWEAPON: + case SA_SEISMICWEAPON: { if (dstsd) { if (dstsd->weapontype == W_FIST || (dstsd->sc.count && !dstsd->sc.data[type] && @@ -7308,13 +7308,22 @@ static int skill_castend_nodamage_id(struct block_list *src, struct block_list * break; } } +#ifndef RENEWAL // 100% success rate at lv4 & 5, but lasts longer at lv5 - if (!clif->skill_nodamage(src, bl, skill_id, skill_lv, sc_start(src, bl, type, (60 + skill_lv * 10), skill_lv, skill->get_time(skill_id, skill_lv), skill_id))) { - if (sd) + int sc_chance = (60 + skill_lv * 10); +#else + int sc_chance = 100; +#endif + int sc_result = sc_start(src, bl, type, sc_chance, skill_lv, skill->get_time(skill_id, skill_lv), skill_id); + if (clif->skill_nodamage(src, bl, skill_id, skill_lv, sc_result) == 0) { + if (sd != NULL) clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); - if (skill->break_equip(bl, EQP_WEAPON, 10000, BCT_PARTY) && sd && sd != dstsd) +#ifndef RENEWAL + if (skill->break_equip(bl, EQP_WEAPON, 10000, BCT_PARTY) != 0 && sd != NULL && sd != dstsd) clif->message(sd->fd, msg_sd(sd, MSGTBL_BROKEN_TARGET_WEAPON)); // "You broke the target's weapon." +#endif } + } break; case PR_ASPERSIO: diff --git a/src/map/status.c b/src/map/status.c index 8f9f3092ae0..a1ac8735620 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -2329,6 +2329,17 @@ static int status_calc_pc_(struct map_session_data *sd, enum e_status_calc_opt o if (sc->data[SC_EARTH_INSIGNIA] && sc->data[SC_EARTH_INSIGNIA]->val1 == 3) sd->magic_addele[ELE_EARTH] += 25; +#ifdef RENEWAL + if (sc->data[SC_PROPERTYFIRE] != NULL) + sd->magic_atk_ele[ELE_FIRE] += sc->data[SC_PROPERTYFIRE]->val1; + if (sc->data[SC_PROPERTYWATER] != NULL) + sd->magic_atk_ele[ELE_WATER] += sc->data[SC_PROPERTYWATER]->val1; + if (sc->data[SC_PROPERTYWIND] != NULL) + sd->magic_atk_ele[ELE_WIND] += sc->data[SC_PROPERTYWIND]->val1; + if (sc->data[SC_PROPERTYGROUND] != NULL) + sd->magic_atk_ele[ELE_EARTH] += sc->data[SC_PROPERTYGROUND]->val1; +#endif + // Geffen Scrolls if (sc->data[SC_SKELSCROLL]) { #ifdef RENEWAL From 8f1f23b8cb40faa65ade1b3f618f016dc940be4e Mon Sep 17 00:00:00 2001 From: "Guilherme G. Menaldo" Date: Fri, 18 Aug 2023 08:28:01 -0300 Subject: [PATCH 4/7] Rebalance of SA_AUTOSPELL (Hindsight) - Autocast level changed - Old: The Bolt skills will vary in level from level 1 to 3 The level 1 version will occur 50% of the time, level 2 35%, and level 3 at 15% - New: Levels of autocasted spells is the half of Hindsight level. If autocasted spells has lower level than half of Hindsight levels, actual skill level will be autocasted instead. - Autocast chance changed - Old: 7% - 25% - New: (Skill Level x 2)% - Usable skills changed - Old: Napalm Beat, Fire Bolt, Cold Bolt, Lightning Bolt, Soul Strike, Fire Ball, Frost Diver - New: Fire Bolt, Cold Bolt, Lightning Bolt, Soul Strike, Fire Ball, Earth Spike, Frost Diver, Thunderstorm, Heaven's Drive From massive skills rebalance (1st/2nd/transclass) (2018.10.31) --- db/pre-re/autospell_db.conf | 1 + db/re/autospell_db.conf | 104 ++++++++++++++++++------------------ src/map/battle.c | 19 +++++-- src/map/script.c | 3 ++ src/map/skill.c | 27 ++++++++-- src/map/skill.h | 7 ++- src/map/status.c | 8 ++- 7 files changed, 102 insertions(+), 67 deletions(-) diff --git a/db/pre-re/autospell_db.conf b/db/pre-re/autospell_db.conf index 05d3b4377a9..c3aae1911ef 100644 --- a/db/pre-re/autospell_db.conf +++ b/db/pre-re/autospell_db.conf @@ -44,6 +44,7 @@ autospell_db: ( SkillId: Skill ID/Name (constant string or int) SkillLevel: Highest usable level (int, defaults to 0) (can be grouped by AutoSpell Levels) (Level 0 would mean not usable in this AutoSpell level) + (Level "HALF_AUTOSPELL_LEVEL" uses half of casted autospell level) SpiritBoost: Use max level when under Sage Spirit? (boolean, defaults to false) }, **************************************************************************/ diff --git a/db/re/autospell_db.conf b/db/re/autospell_db.conf index 05d3b4377a9..9730a25e91b 100644 --- a/db/re/autospell_db.conf +++ b/db/re/autospell_db.conf @@ -44,91 +44,89 @@ autospell_db: ( SkillId: Skill ID/Name (constant string or int) SkillLevel: Highest usable level (int, defaults to 0) (can be grouped by AutoSpell Levels) (Level 0 would mean not usable in this AutoSpell level) + (Level "HALF_AUTOSPELL_LEVEL" uses half of casted autospell level) SpiritBoost: Use max level when under Sage Spirit? (boolean, defaults to false) }, **************************************************************************/ -{ - SkillId: "MG_NAPALMBEAT" - SkillLevel: 3 - SpiritBoost: false -}, { SkillId: "MG_COLDBOLT" - SkillLevel: { - // Lv1: 0 - Lv2: 1 - Lv3: 2 - Lv4: 3 - Lv5: 3 - Lv6: 3 - Lv7: 3 - Lv8: 3 - Lv9: 3 - Lv10: 3 - } + SkillLevel: "HALF_AUTOSPELL_LEVEL" SpiritBoost: true }, { SkillId: "MG_FIREBOLT" - SkillLevel: { - // Lv1: 0 - Lv2: 1 - Lv3: 2 - Lv4: 3 - Lv5: 3 - Lv6: 3 - Lv7: 3 - Lv8: 3 - Lv9: 3 - Lv10: 3 - } + SkillLevel: "HALF_AUTOSPELL_LEVEL" SpiritBoost: true }, { SkillId: "MG_LIGHTNINGBOLT" - SkillLevel: { - // Lv1: 0 - Lv2: 1 - Lv3: 2 - Lv4: 3 - Lv5: 3 - Lv6: 3 - Lv7: 3 - Lv8: 3 - Lv9: 3 - Lv10: 3 - } + SkillLevel: "HALF_AUTOSPELL_LEVEL" SpiritBoost: true }, { SkillId: "MG_SOULSTRIKE" SkillLevel: { - // Lv1 .. Lv4: 0 - Lv5: 1 - Lv6: 2 - Lv7: 3 - Lv8: 3 - Lv9: 3 - Lv10: 3 + // Lv1 .. Lv3: 0 + Lv4: "HALF_AUTOSPELL_LEVEL" + Lv5: "HALF_AUTOSPELL_LEVEL" + Lv6: "HALF_AUTOSPELL_LEVEL" + Lv7: "HALF_AUTOSPELL_LEVEL" + Lv8: "HALF_AUTOSPELL_LEVEL" + Lv9: "HALF_AUTOSPELL_LEVEL" + Lv10: "HALF_AUTOSPELL_LEVEL" } SpiritBoost: false }, { SkillId: "MG_FIREBALL" SkillLevel: { - // Lv1 .. Lv7: 0 - Lv8: 1 - Lv9: 2 - Lv10: 2 + // Lv1 .. Lv3: 0 + Lv4: "HALF_AUTOSPELL_LEVEL" + Lv5: "HALF_AUTOSPELL_LEVEL" + Lv6: "HALF_AUTOSPELL_LEVEL" + Lv7: "HALF_AUTOSPELL_LEVEL" + Lv8: "HALF_AUTOSPELL_LEVEL" + Lv9: "HALF_AUTOSPELL_LEVEL" + Lv10: "HALF_AUTOSPELL_LEVEL" + } + SpiritBoost: false +}, +{ + SkillId: "WZ_EARTHSPIKE" + SkillLevel: { + // Lv1 .. Lv6: 0 + Lv7: "HALF_AUTOSPELL_LEVEL" + Lv8: "HALF_AUTOSPELL_LEVEL" + Lv9: "HALF_AUTOSPELL_LEVEL" + Lv10: "HALF_AUTOSPELL_LEVEL" } SpiritBoost: false }, { SkillId: "MG_FROSTDIVER" + SkillLevel: { + // Lv1 .. Lv6: 0 + Lv7: "HALF_AUTOSPELL_LEVEL" + Lv8: "HALF_AUTOSPELL_LEVEL" + Lv9: "HALF_AUTOSPELL_LEVEL" + Lv10: "HALF_AUTOSPELL_LEVEL" + } + SpiritBoost: false +}, +{ + SkillId: "MG_THUNDERSTORM" + SkillLevel: { + // Lv1 .. Lv9: 0 + Lv10: "HALF_AUTOSPELL_LEVEL" + } + SpiritBoost: false +}, +{ + SkillId: "WZ_HEAVENDRIVE" SkillLevel: { // Lv1 .. Lv9: 0 - Lv10: 1 + Lv10: "HALF_AUTOSPELL_LEVEL" } SpiritBoost: false }, diff --git a/src/map/battle.c b/src/map/battle.c index 0839d5bd195..c09d2fef8e0 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -6867,12 +6867,21 @@ static enum damage_lv battle_weapon_attack(struct block_list *src, struct block_ int sp = 0; uint16 skill_id = sc->data[SC_AUTOSPELL]->val2; uint16 skill_lv = sc->data[SC_AUTOSPELL]->val3; - int i = rnd()%100; - if (sc->data[SC_SOULLINK] && sc->data[SC_SOULLINK]->val2 == SL_SAGE) +#ifndef RENEWAL + int i = rnd() % 100; + if (sc->data[SC_SOULLINK] != NULL && sc->data[SC_SOULLINK]->val2 == SL_SAGE) i = 0; //Max chance, no skill_lv reduction. [Skotlex] - if (i >= 50) skill_lv -= 2; - else if (i >= 15) skill_lv--; - if (skill_lv < 1) skill_lv = 1; + + if (i >= 50) + skill_lv -= 2; + else if (i >= 15) + skill_lv--; + if (skill_lv < 1) + skill_lv = 1; +#else + if (sd != NULL && skill_lv > pc->checkskill(sd, skill_id)) + skill_lv = pc->checkskill(sd, skill_id); +#endif sp = skill->get_sp(skill_id,skill_lv) * 2 / 3; if (status->charge(src, 0, sp)) { diff --git a/src/map/script.c b/src/map/script.c index 9f04bf934fb..d72268764c1 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -30282,6 +30282,9 @@ static void script_hardcoded_constants(void) script->set_constant("HOMINFO_RENAME", HOMINFO_RENAME, false, false); script->set_constant("HOMINFO_LEVEL", HOMINFO_LEVEL, false, false); + script->constdb_comment("autospell db constants"); + script->set_constant2("HALF_AUTOSPELL_LEVEL", HALF_AUTOSPELL_LEVEL, false, false); + script->constdb_comment("Renewal"); #ifdef RENEWAL script->set_constant("RENEWAL", 1, false, false); diff --git a/src/map/skill.c b/src/map/skill.c index 72f77078058..80f6b495116 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -18003,8 +18003,17 @@ static void skill_autospell_select_spell(struct block_list *bl, int skill_lv) if ((upper_idx - lower_idx) > 1) skill_idx += rnd() % (upper_idx - lower_idx); + // @TODO: Is this how AutoSpell works for non-players after rebalance? I made it the same as the player one... const struct s_autospell_db *sk = &skill->dbs->autospell_db[skill_idx]; - sc_start4(bl, bl, SC_AUTOSPELL, 100, skill_lv, sk->skill_id, sk->skill_lv[skill_lv - 1], 0, + int spell_level = sk->skill_lv[skill_lv - 1]; + if (spell_level == HALF_AUTOSPELL_LEVEL) { + spell_level = skill_lv / 2; + + if (spell_level == 0) + spell_level = 1; + } + + sc_start4(bl, bl, SC_AUTOSPELL, 100, skill_lv, sk->skill_id, spell_level, 0, skill->get_time(SA_AUTOSPELL, skill_lv), SA_AUTOSPELL); } @@ -18036,6 +18045,14 @@ static int skill_autospell_spell_selected(struct map_session_data *sd, uint16 sk return 0; // Don't have enough level to use int max_lv = sk->skill_lv[autospell_lv - 1]; + + if (max_lv == HALF_AUTOSPELL_LEVEL) { + max_lv = autospell_lv / 2; + + if (max_lv == 0) + max_lv = 1; + } + if (sk->spirit_boost && sd->sc.data[SC_SOULLINK] != NULL && sd->sc.data[SC_SOULLINK]->val2 == SL_SAGE) max_lv = skill->dbs->db[skill->get_index(skill_id)].max; // Soul Linker bonus. [Skotlex] @@ -24963,8 +24980,8 @@ static void skill_read_autospell_skill_level(struct config_setting_t *conf, stru snprintf(lv, sizeof(lv), "Lv%d", i + 1); int level; - if (libconfig->setting_lookup_int(t, lv, &level) == CONFIG_TRUE) { - if (level >= 0 && level <= MAX_SKILL_LEVEL) + if (map->setting_lookup_const(t, lv, &level) == CONFIG_TRUE) { + if ((level >= 0 && level <= MAX_SKILL_LEVEL) || level == HALF_AUTOSPELL_LEVEL) sk->skill_lv[i] = level; else ShowWarning("%s: Invalid SkillLevel %d specified in level %d for skill ID %d in %s! Minimum is 0, maximum is %d. Defaulting to 0...\n", @@ -24976,8 +24993,8 @@ static void skill_read_autospell_skill_level(struct config_setting_t *conf, stru } int level; - if (libconfig->setting_lookup_int(conf, "SkillLevel", &level) == CONFIG_TRUE) { - if (level >= 0 && level <= MAX_SKILL_LEVEL) + if (map->setting_lookup_const(conf, "SkillLevel", &level) == CONFIG_TRUE) { + if ((level >= 0 && level <= MAX_SKILL_LEVEL) || level == HALF_AUTOSPELL_LEVEL) skill->level_set_value(sk->skill_lv, level); else ShowWarning("%s: Invalid SkillLevel %d specified for skill ID %d in %s! Minimum is 0, maximum is %d. Defaulting to 0...\n", diff --git a/src/map/skill.h b/src/map/skill.h index bbf8bc69d10..df88d518fa8 100644 --- a/src/map/skill.h +++ b/src/map/skill.h @@ -77,7 +77,7 @@ struct status_change_entry; #define MAX_SKILL_SPELLBOOK_DB 17 #define MAX_SKILL_MAGICMUSHROOM_DB 23 -#define MAX_AUTOSPELL_DB 7 +#define MAX_AUTOSPELL_DB 9 //Walk intervals at which chase-skills are attempted to be triggered. #define WALK_SKILL_INTERVAL 5 @@ -85,6 +85,9 @@ struct status_change_entry; // Max Crimson Marker targets (RL_C_MARKER) #define MAX_SKILL_CRIMSON_MARKER 3 +// Autospell db special level/constant for "use half of casted level" +#define HALF_AUTOSPELL_LEVEL -1 + /** * Enumerations **/ @@ -1815,7 +1818,7 @@ enum skill_enabled_npc_flags { struct s_autospell_db { int autospell_level; //< Minimum AutoSpell level to show this skill int skill_id; //< Skill Id - int skill_lv[MAX_SKILL_LEVEL]; //< Maximum usable skill level at each AutoSpell level + int skill_lv[MAX_SKILL_LEVEL]; //< Maximum usable skill level at each AutoSpell level (also accepts HALF_AUTOSPELL_LEVEL as level) bool spirit_boost; //< Whether Sage's Spirit boosts this skill to maximum level }; diff --git a/src/map/status.c b/src/map/status.c index a1ac8735620..64c920f58d8 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -7878,8 +7878,12 @@ static int status_change_start_sub(struct block_list *src, struct block_list *bl case SC_AUTOSPELL: //Val1 Skill LV of Autospell //Val2 Skill ID to cast - //Val3 Max Lv to cast - val4 = 5 + val1*2; //Chance of casting + //Val3 Max Lv to cast (pre-re) / Lv to cast (zero) +#ifndef RENEWAL + val4 = 5 + val1 * 2; // Chance of casting +#else + val4 = 2 * val1; // Chance of casting +#endif break; case SC_VOLCANO: #ifndef RENEWAL From fa0fb5790a9dbd039368c9a90d6bca010946f3fa Mon Sep 17 00:00:00 2001 From: "Guilherme G. Menaldo" Date: Sat, 19 Aug 2023 21:13:00 -0300 Subject: [PATCH 5/7] Add alternative list of skills for Auto Spell this loads pre-re autospell_db even on RENEWAL, and is offered as an alternative for RE servers that doesn't support more than 7 skills at once. --- src/config/classes/general.h | 13 +++++++++++++ src/map/skill.c | 8 ++++++++ 2 files changed, 21 insertions(+) diff --git a/src/config/classes/general.h b/src/config/classes/general.h index f76fb958a37..a1d72c9c79f 100644 --- a/src/config/classes/general.h +++ b/src/config/classes/general.h @@ -64,6 +64,19 @@ **/ //#define DEVOTION_REFLECT_DAMAGE +/** + * When enabled, RENEWAL servers loads db/pre-re/autospell_db.conf instead of db/re/autospell_db.conf. + * + * This makes the autospell skill list and used levels follow Pre-RE version, but every other effect stays as renewal. + * + * More details: + * - Maximum used level of a skill will follow Pre-RE, instead of the half autospell level of RE + * - Bolt skills will stay at the maximum "enabled" level instead of random levels + * + * You may want to enable this if you have a client that can't support the list with more than 7 skills. + */ +//#define CLASSIC_AUTOSPELL_LIST + /** * No settings past this point **/ diff --git a/src/map/skill.c b/src/map/skill.c index 80f6b495116..8642fe9e269 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -25127,6 +25127,9 @@ static bool skill_read_autospell_db(const char *filename) if (count > 7) { ShowWarning("%s: Your current packet version only supports up to 7 autospell skills, but your autospell db contains \"%d\" skills. Some skills may not be shown.\n", __func__, count); ShowWarning("%s: Update your packet version or reduce the number of skills to fix this warning.\n", __func__); +#ifdef RENEWAL + ShowWarning("%s: You may also enable CLASSIC_AUTOSPELL_LIST in general.h for an alternative skill list (Read the comment on it for details!!)\n", __func__); +#endif } #endif @@ -25206,7 +25209,12 @@ static void skill_readdb(bool minimal) sv->readdb(map->db_path, "magicmushroom_db.txt", ',', 1, 1, MAX_SKILL_MAGICMUSHROOM_DB, skill->parse_row_magicmushroomdb); sv->readdb(map->db_path, "skill_improvise_db.txt", ',', 2, 2, MAX_SKILL_IMPROVISE_DB, skill->parse_row_improvisedb); sv->readdb(map->db_path, "skill_changematerial_db.txt", ',', 4, 4+2*5, MAX_SKILL_PRODUCE_DB, skill->parse_row_changematerialdb); +#ifdef CLASSIC_AUTOSPELL_LIST // Force usage of pre-re autospell_db + skill->read_autospell_db(DBPATH_PRE "autospell_db.conf"); +#else skill->read_autospell_db(DBPATH "autospell_db.conf"); +#endif + } static void skill_reload(void) From e273be2d24f75619c894aebd6cce502e9d6ca33a Mon Sep 17 00:00:00 2001 From: "Guilherme G. Menaldo" Date: Fri, 27 Oct 2023 19:39:05 -0300 Subject: [PATCH 6/7] Make CI use classic autospell list for old clients --- .github/workflows/clang15_test.yml | 9 ++++++++- .github/workflows/gcc_test.yml | 9 ++++++++- .github/workflows/gccold1.yml | 5 ++++- .github/workflows/gccold2.yml | 5 ++++- .github/workflows/gccold3.yml | 5 ++++- .github/workflows/gccsnapshot_test.yml | 9 ++++++++- .github/workflows/macos_latest.yml | 10 +++++++++- .github/workflows/macos_m1.yml | 10 +++++++++- 8 files changed, 54 insertions(+), 8 deletions(-) diff --git a/.github/workflows/clang15_test.yml b/.github/workflows/clang15_test.yml index 2d1591a49c0..b0808c64090 100644 --- a/.github/workflows/clang15_test.yml +++ b/.github/workflows/clang15_test.yml @@ -21,6 +21,13 @@ jobs: HTTPLIB: ["", "--with-http_parser=llhttp"] SANITIZER: ["--disable-manager", "--disable-manager --enable-sanitize=full"] PACKET_VERSION: ["--enable-packetver=20221024", "--enable-packetver=20130724"] + include: + # Empty CLASSIC_AUTOSPELL_LIST for every other flow + - CLASSIC_AUTOSPELL_LIST: "" + # Use "-DCLASSIC_AUTOSPELL_LIST" for 20130724 RE or we will get warnings due to the list being too small + - PACKET_VERSION: "--enable-packetver=20130724" + RENEWAL: "" + CLASSIC_AUTOSPELL_LIST: "-DCLASSIC_AUTOSPELL_LIST" exclude: - PACKET_VERSION: "--enable-packetver=20130724" CLIENT_TYPE: "--enable-packetver-zero" @@ -52,7 +59,7 @@ jobs: INSTALL_PACKAGES: ${{ matrix.CC }} mariadb-client libmariadbclient-dev-compat SQLHOST: mariadb CC: ${{ matrix.CC }} - CONFIGURE_FLAGS: CC=${{ matrix.CC }} --enable-debug --enable-Werror --enable-buildbot ${{ matrix.RENEWAL }} ${{ matrix.HTTPLIB }} ${{ matrix.CLIENT_TYPE }} ${{ matrix.SANITIZER }} ${{ matrix.PACKET_VERSION }} + CONFIGURE_FLAGS: CC=${{ matrix.CC }} --enable-debug --enable-Werror --enable-buildbot ${{ matrix.RENEWAL }} ${{ matrix.HTTPLIB }} ${{ matrix.CLIENT_TYPE }} ${{ matrix.SANITIZER }} ${{ matrix.PACKET_VERSION }} CPPFLAGS=${{ matrix.CLASSIC_AUTOSPELL_LIST }} PACKET_VERSION: ${{ matrix.PACKET_VERSION }} steps: - uses: actions/checkout@v1 diff --git a/.github/workflows/gcc_test.yml b/.github/workflows/gcc_test.yml index 857c8a3d123..326fc9535c7 100644 --- a/.github/workflows/gcc_test.yml +++ b/.github/workflows/gcc_test.yml @@ -21,6 +21,13 @@ jobs: HTTPLIB: ["", "--with-http_parser=llhttp"] SANITIZER: ["--disable-manager", "--disable-manager --enable-sanitize=full"] PACKET_VERSION: ["--enable-packetver=20221024", "--enable-packetver=20130724"] + include: + # Empty CLASSIC_AUTOSPELL_LIST for every other flow + - CLASSIC_AUTOSPELL_LIST: "" + # Use "-DCLASSIC_AUTOSPELL_LIST" for 20130724 RE or we will get warnings due to the list being too small + - PACKET_VERSION: "--enable-packetver=20130724" + RENEWAL: "" + CLASSIC_AUTOSPELL_LIST: "-DCLASSIC_AUTOSPELL_LIST" exclude: - PACKET_VERSION: "--enable-packetver=20130724" CLIENT_TYPE: "--enable-packetver-zero" @@ -52,7 +59,7 @@ jobs: INSTALL_PACKAGES: ${{ matrix.CC }} mariadb-client libmariadbclient-dev-compat SQLHOST: mariadb CC: ${{ matrix.CC }} - CONFIGURE_FLAGS: CC=${{ matrix.CC }} --enable-debug --enable-Werror --enable-buildbot ${{ matrix.RENEWAL }} ${{ matrix.HTTPLIB }} ${{ matrix.CLIENT_TYPE }} ${{ matrix.SANITIZER }} ${{ matrix.PACKET_VERSION }} --enable-lto + CONFIGURE_FLAGS: CC=${{ matrix.CC }} --enable-debug --enable-Werror --enable-buildbot ${{ matrix.RENEWAL }} ${{ matrix.HTTPLIB }} ${{ matrix.CLIENT_TYPE }} ${{ matrix.SANITIZER }} ${{ matrix.PACKET_VERSION }} --enable-lto CPPFLAGS=${{ matrix.CLASSIC_AUTOSPELL_LIST }} PACKET_VERSION: ${{ matrix.PACKET_VERSION }} steps: - uses: actions/checkout@v1 diff --git a/.github/workflows/gccold1.yml b/.github/workflows/gccold1.yml index 9501ed00159..6dd3e6455e2 100644 --- a/.github/workflows/gccold1.yml +++ b/.github/workflows/gccold1.yml @@ -22,6 +22,9 @@ jobs: SANITIZER: ["--disable-manager --enable-sanitize=full"] PACKET_VERSION: ["--enable-packetver=20100105", "--enable-packetver=20171018"] LTO: [""] + include: + # Use "-DCLASSIC_AUTOSPELL_LIST" for all packetver or we will get warnings due to the list being too small (since they are old) + - CLASSIC_AUTOSPELL_LIST: "-DCLASSIC_AUTOSPELL_LIST" exclude: - PACKET_VERSION: "--enable-packetver=20100105" CLIENT_TYPE: "--enable-packetver-zero" @@ -53,7 +56,7 @@ jobs: INSTALL_PACKAGES: ${{ matrix.CC }} mariadb-client libmariadbclient-dev-compat SQLHOST: mariadb CC: ${{ matrix.CC }} - CONFIGURE_FLAGS: CC=${{ matrix.CC }} --enable-debug --enable-Werror --enable-buildbot ${{ matrix.RENEWAL }} ${{ matrix.HTTPLIB }} ${{ matrix.CLIENT_TYPE }} ${{ matrix.SANITIZER }} ${{ matrix.PACKET_VERSION }} --enable-epoll + CONFIGURE_FLAGS: CC=${{ matrix.CC }} --enable-debug --enable-Werror --enable-buildbot ${{ matrix.RENEWAL }} ${{ matrix.HTTPLIB }} ${{ matrix.CLIENT_TYPE }} ${{ matrix.SANITIZER }} ${{ matrix.PACKET_VERSION }} --enable-epoll CPPFLAGS=${{ matrix.CLASSIC_AUTOSPELL_LIST }} steps: - uses: actions/checkout@v1 with: diff --git a/.github/workflows/gccold2.yml b/.github/workflows/gccold2.yml index c8cb601c8d1..3a1f096dd5c 100644 --- a/.github/workflows/gccold2.yml +++ b/.github/workflows/gccold2.yml @@ -22,6 +22,9 @@ jobs: SANITIZER: ["--disable-manager --enable-sanitize=full"] PACKET_VERSION: ["--enable-packetver=20100105", "--enable-packetver=20171018"] LTO: [""] + include: + # Use "-DCLASSIC_AUTOSPELL_LIST" for all packetver or we will get warnings due to the list being too small (since they are old) + - CLASSIC_AUTOSPELL_LIST: "-DCLASSIC_AUTOSPELL_LIST" exclude: - PACKET_VERSION: "--enable-packetver=20100105" CLIENT_TYPE: "--enable-packetver-zero" @@ -53,7 +56,7 @@ jobs: INSTALL_PACKAGES: ${{ matrix.CC }} mariadb-client libmariadbclient-dev-compat SQLHOST: mariadb CC: ${{ matrix.CC }} - CONFIGURE_FLAGS: CC=${{ matrix.CC }} --enable-debug --enable-Werror --enable-buildbot ${{ matrix.RENEWAL }} ${{ matrix.HTTPLIB }} ${{ matrix.CLIENT_TYPE }} ${{ matrix.SANITIZER }} ${{ matrix.PACKET_VERSION }} --enable-epoll + CONFIGURE_FLAGS: CC=${{ matrix.CC }} --enable-debug --enable-Werror --enable-buildbot ${{ matrix.RENEWAL }} ${{ matrix.HTTPLIB }} ${{ matrix.CLIENT_TYPE }} ${{ matrix.SANITIZER }} ${{ matrix.PACKET_VERSION }} --enable-epoll CPPFLAGS=${{ matrix.CLASSIC_AUTOSPELL_LIST }} steps: - uses: actions/checkout@v1 with: diff --git a/.github/workflows/gccold3.yml b/.github/workflows/gccold3.yml index 07cd76ce035..c5a17e4373e 100644 --- a/.github/workflows/gccold3.yml +++ b/.github/workflows/gccold3.yml @@ -23,6 +23,9 @@ jobs: SANITIZER: ["--disable-manager --enable-sanitize=full"] PACKET_VERSION: ["--enable-packetver=20100105", "--enable-packetver=20171018"] LTO: [""] + include: + # Use "-DCLASSIC_AUTOSPELL_LIST" for all packetver or we will get warnings due to the list being too small (since they are old) + - CLASSIC_AUTOSPELL_LIST: "-DCLASSIC_AUTOSPELL_LIST" exclude: - PACKET_VERSION: "--enable-packetver=20100105" CLIENT_TYPE: "--enable-packetver-zero" @@ -54,7 +57,7 @@ jobs: INSTALL_PACKAGES: ${{ matrix.CC }} mariadb-client libmariadbclient-dev-compat SQLHOST: mariadb CC: ${{ matrix.CC }} - CONFIGURE_FLAGS: CC=${{ matrix.CC }} --enable-debug --enable-Werror --enable-buildbot ${{ matrix.RENEWAL }} ${{ matrix.HTTPLIB }} ${{ matrix.CLIENT_TYPE }} ${{ matrix.SANITIZER }} ${{ matrix.PACKET_VERSION }} --enable-epoll + CONFIGURE_FLAGS: CC=${{ matrix.CC }} --enable-debug --enable-Werror --enable-buildbot ${{ matrix.RENEWAL }} ${{ matrix.HTTPLIB }} ${{ matrix.CLIENT_TYPE }} ${{ matrix.SANITIZER }} ${{ matrix.PACKET_VERSION }} --enable-epoll CPPFLAGS=${{ matrix.CLASSIC_AUTOSPELL_LIST }} steps: - uses: actions/checkout@v1 with: diff --git a/.github/workflows/gccsnapshot_test.yml b/.github/workflows/gccsnapshot_test.yml index f25e938d1b4..a35573e242b 100644 --- a/.github/workflows/gccsnapshot_test.yml +++ b/.github/workflows/gccsnapshot_test.yml @@ -21,6 +21,13 @@ jobs: HTTPLIB: ["", "--with-http_parser=llhttp"] SANITIZER: ["--disable-manager", "--disable-manager --enable-sanitize=full"] PACKET_VERSION: ["--enable-packetver=20221024", "--enable-packetver=20130724"] + include: + # Empty CLASSIC_AUTOSPELL_LIST for every other flow + - CLASSIC_AUTOSPELL_LIST: "" + # Use "-DCLASSIC_AUTOSPELL_LIST" for 20130724 RE or we will get warnings due to the list being too small + - PACKET_VERSION: "--enable-packetver=20130724" + RENEWAL: "" + CLASSIC_AUTOSPELL_LIST: "-DCLASSIC_AUTOSPELL_LIST" exclude: - PACKET_VERSION: "--enable-packetver=20130724" CLIENT_TYPE: "--enable-packetver-zero" @@ -52,7 +59,7 @@ jobs: INSTALL_PACKAGES: ${{ matrix.CC }} mariadb-client libmariadbclient-dev-compat SQLHOST: mariadb CC: ${{ matrix.CC }} - CONFIGURE_FLAGS: CC=${{ matrix.CC }} --enable-debug --enable-Werror --enable-buildbot ${{ matrix.RENEWAL }} ${{ matrix.HTTPLIB }} ${{ matrix.CLIENT_TYPE }} ${{ matrix.SANITIZER }} ${{ matrix.PACKET_VERSION }} --enable-lto + CONFIGURE_FLAGS: CC=${{ matrix.CC }} --enable-debug --enable-Werror --enable-buildbot ${{ matrix.RENEWAL }} ${{ matrix.HTTPLIB }} ${{ matrix.CLIENT_TYPE }} ${{ matrix.SANITIZER }} ${{ matrix.PACKET_VERSION }} --enable-lto CPPFLAGS=${{ matrix.CLASSIC_AUTOSPELL_LIST }} PACKET_VERSION: ${{ matrix.PACKET_VERSION }} steps: - uses: actions/checkout@v1 diff --git a/.github/workflows/macos_latest.yml b/.github/workflows/macos_latest.yml index 02e2a86734d..005b731ad44 100644 --- a/.github/workflows/macos_latest.yml +++ b/.github/workflows/macos_latest.yml @@ -22,6 +22,13 @@ jobs: HTTPLIB: ["", "--with-http_parser=llhttp"] SANITIZER: ["--disable-manager", "--disable-manager --enable-sanitize=full"] PACKET_VERSION: ["--enable-packetver=20221024", "--enable-packetver=20130724"] + include: + # Empty CLASSIC_AUTOSPELL_LIST for every other flow + - CLASSIC_AUTOSPELL_LIST: "" + # Use "-DCLASSIC_AUTOSPELL_LIST" for 20130724 RE or we will get warnings due to the list being too small + - PACKET_VERSION: "--enable-packetver=20130724" + RENEWAL: "" + CLASSIC_AUTOSPELL_LIST: "-DCLASSIC_AUTOSPELL_LIST" exclude: - PACKET_VERSION: "--enable-packetver=20130724" CLIENT_TYPE: "--enable-packetver-zero" @@ -36,6 +43,7 @@ jobs: CC: ${{ matrix.CC }} CONFIGURE_FLAGS: CC=${{ matrix.CC }} --enable-debug --enable-Werror --enable-buildbot ${{ matrix.RENEWAL }} ${{ matrix.HTTPLIB }} ${{ matrix.CLIENT_TYPE }} ${{ matrix.SANITIZER }} ${{ matrix.PACKET_VERSION }} PACKET_VERSION: ${{ matrix.PACKET_VERSION }} + CLASSIC_AUTOSPELL_LIST: ${{ matrix.CLASSIC_AUTOSPELL_LIST }} steps: - uses: actions/checkout@v4 with: @@ -47,7 +55,7 @@ jobs: - name: prepare the build environment run: | - echo "CPPFLAGS=-I$(brew --prefix)/include" >> $GITHUB_ENV + echo "CPPFLAGS=-I$(brew --prefix)/include $CLASSIC_AUTOSPELL_LIST" >> $GITHUB_ENV echo "LDFLAGS=-L$(brew --prefix)/lib" >> $GITHUB_ENV - name: install packages diff --git a/.github/workflows/macos_m1.yml b/.github/workflows/macos_m1.yml index f4dbfa29454..ae57bbc05ac 100644 --- a/.github/workflows/macos_m1.yml +++ b/.github/workflows/macos_m1.yml @@ -22,6 +22,13 @@ jobs: HTTPLIB: ["", "--with-http_parser=llhttp"] SANITIZER: ["--disable-manager", "--disable-manager --enable-sanitize=full"] PACKET_VERSION: ["--enable-packetver=20221024", "--enable-packetver=20130724"] + include: + # Empty CLASSIC_AUTOSPELL_LIST for every other flow + - CLASSIC_AUTOSPELL_LIST: "" + # Use "-DCLASSIC_AUTOSPELL_LIST" for 20130724 RE or we will get warnings due to the list being too small + - PACKET_VERSION: "--enable-packetver=20130724" + RENEWAL: "" + CLASSIC_AUTOSPELL_LIST: "-DCLASSIC_AUTOSPELL_LIST" exclude: - PACKET_VERSION: "--enable-packetver=20130724" CLIENT_TYPE: "--enable-packetver-zero" @@ -36,6 +43,7 @@ jobs: CC: ${{ matrix.CC }} CONFIGURE_FLAGS: CC=${{ matrix.CC }} --enable-debug --enable-Werror --enable-buildbot ${{ matrix.RENEWAL }} ${{ matrix.HTTPLIB }} ${{ matrix.CLIENT_TYPE }} ${{ matrix.SANITIZER }} ${{ matrix.PACKET_VERSION }} PACKET_VERSION: ${{ matrix.PACKET_VERSION }} + CLASSIC_AUTOSPELL_LIST: ${{ matrix.CLASSIC_AUTOSPELL_LIST }} steps: - uses: actions/checkout@v4 with: @@ -47,7 +55,7 @@ jobs: - name: prepare the build environment run: | - echo "CPPFLAGS=-I$(brew --prefix)/include" >> $GITHUB_ENV + echo "CPPFLAGS=-I$(brew --prefix)/include $CLASSIC_AUTOSPELL_LIST" >> $GITHUB_ENV echo "LDFLAGS=-L$(brew --prefix)/lib" >> $GITHUB_ENV - name: install packages From 852ee9ea655aa1c73374c0990ec1c4df69f4657a Mon Sep 17 00:00:00 2001 From: "Guilherme G. Menaldo" Date: Sat, 28 Oct 2023 15:27:44 -0300 Subject: [PATCH 7/7] Add missing zero packetver for AUTOSPELL_LIST2 packet --- src/map/clif.c | 4 ++-- src/map/packets_struct.h | 2 +- src/map/skill.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/map/clif.c b/src/map/clif.c index 1e189c1f0b7..c0bcaf1c986 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -8026,7 +8026,7 @@ static void clif_autospell(struct map_session_data *sd, uint16 skill_lv, int *sk #if PACKETVER_MAIN_NUM >= 20090406 || defined(PACKETVER_RE) || defined(PACKETVER_ZERO) || PACKETVER_SAK_NUM >= 20080618 nullpo_retv(sd); -#if PACKETVER_MAIN_NUM >= 20181128 || PACKETVER_RE_NUM >= 20181031 +#if PACKETVER_MAIN_NUM >= 20181128 || PACKETVER_RE_NUM >= 20181031 || PACKETVER_ZERO_NUM >= 20180523 const int len = sizeof(struct PACKET_ZC_AUTOSPELLLIST) + sizeof(int) * list_len; #else const int len = sizeof(struct PACKET_ZC_AUTOSPELLLIST); @@ -8043,7 +8043,7 @@ static void clif_autospell(struct map_session_data *sd, uint16 skill_lv, int *sk memset(p, 0, sizeof(struct PACKET_ZC_AUTOSPELLLIST)); p->packetType = HEADER_ZC_AUTOSPELLLIST; -#if PACKETVER_MAIN_NUM >= 20181128 || PACKETVER_RE_NUM >= 20181031 +#if PACKETVER_MAIN_NUM >= 20181128 || PACKETVER_RE_NUM >= 20181031 || PACKETVER_ZERO_NUM >= 20180523 p->packetLength = len; #endif memcpy(p->skills, skill_ids_list, sizeof(int) * list_len); diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index 698401d6da7..60761d42bb8 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -3722,7 +3722,7 @@ struct PACKET_CZ_VIEW_CAMERAINFO { DEFINE_PACKET_HEADER(CZ_VIEW_CAMERAINFO, 0x0a77); #endif -#if PACKETVER_MAIN_NUM >= 20181128 || PACKETVER_RE_NUM >= 20181031 +#if PACKETVER_MAIN_NUM >= 20181128 || PACKETVER_RE_NUM >= 20181031 || PACKETVER_ZERO_NUM >= 20180523 // PACKET_ZC_AUTOSPELLLIST2 struct PACKET_ZC_AUTOSPELLLIST { int16 packetType; diff --git a/src/map/skill.c b/src/map/skill.c index 8642fe9e269..ca9466300c5 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -25123,7 +25123,7 @@ static bool skill_read_autospell_db(const char *filename) count++; } -#if PACKETVER_MAIN_NUM < 20181128 && PACKETVER_RE_NUM < 20181031 +#if PACKETVER_MAIN_NUM < 20181128 && PACKETVER_RE_NUM < 20181031 && PACKETVER_ZERO_NUM < 20180523 if (count > 7) { ShowWarning("%s: Your current packet version only supports up to 7 autospell skills, but your autospell db contains \"%d\" skills. Some skills may not be shown.\n", __func__, count); ShowWarning("%s: Update your packet version or reduce the number of skills to fix this warning.\n", __func__);