From 67d1ab678590efd07db091e1eff4df7d2d616fe6 Mon Sep 17 00:00:00 2001 From: "Guilherme G. Menaldo" Date: Sun, 16 Jul 2023 20:52:07 -0300 Subject: [PATCH 1/4] fix typo in sc_start rate description in script commands doc --- doc/script_commands.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/script_commands.txt b/doc/script_commands.txt index cefb6d58147..e525c10d311 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -6313,7 +6313,7 @@ Certain status changes take an additional parameter , which typically modifies player stats by the given number or percentage. This differs for each status, and is sometimes zero. -Optional value is the chance that the status will be invoked (10000 = 1%). +Optional value is the chance that the status will be invoked (100 = 1%). This is used primarily in item scripts. When used in an NPC script, a flag MUST be defined for the rate to work. From 6b233dcb7e45337c8454b51b6a77dd65dea9fa2a Mon Sep 17 00:00:00 2001 From: "Guilherme G. Menaldo" Date: Sun, 16 Jul 2023 21:41:52 -0300 Subject: [PATCH 2/4] remove duplicated reductions in Poisoning Weapon - the 2nd rate check that happens for Oblivion Curse was wrong in battle.c and it is also already performed in status.c, thus, having it in battle.c was both doing a wrong behavior and also reducing the chance more than it should have - the duration reduction based on targets vit and luk is already done in status.c, having it also performed in battle.c makes it reduce twice the time - this affects both SC_POISONINGWEAPON and skills that uses the poison effect added by it: Venom Pressure and Poison Smoke --- src/map/battle.c | 10 +++------- src/map/skill.c | 15 +++++---------- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/src/map/battle.c b/src/map/battle.c index c56d08c4f09..23219db0406 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -3534,13 +3534,9 @@ static int64 battle_calc_damage(struct block_list *src, struct block_list *bl, s } } } - if( s_sc->data[SC_POISONINGWEAPON] ) { - struct status_data *tstatus = status->get_status_data(bl); - if ( !(flag&BF_SKILL) && (flag&BF_WEAPON) && damage > 0 && rnd()%100 < s_sc->data[SC_POISONINGWEAPON]->val3 ) { - short rate = 100; - if ( s_sc->data[SC_POISONINGWEAPON]->val1 == 9 ) // Oblivion Curse gives a 2nd success chance after the 1st one passes which is reducible. [Rytech] - rate = 100 - tstatus->int_ * 4 / 5; - sc_start(src, bl, s_sc->data[SC_POISONINGWEAPON]->val2, rate, s_sc->data[SC_POISONINGWEAPON]->val1, skill->get_time2(GC_POISONINGWEAPON, 1) - (tstatus->vit + tstatus->luk) / 2 * 1000, GC_POISONINGWEAPON); + if (s_sc->data[SC_POISONINGWEAPON] != NULL) { + if (!(flag & BF_SKILL) && (flag & BF_WEAPON) && damage > 0 && rnd() % 100 < s_sc->data[SC_POISONINGWEAPON]->val3) { + sc_start(src, bl, s_sc->data[SC_POISONINGWEAPON]->val2, 100, s_sc->data[SC_POISONINGWEAPON]->val1, skill->get_time2(GC_POISONINGWEAPON, 1), GC_POISONINGWEAPON); } } if( s_sc->data[SC__DEADLYINFECT] && flag&BF_SHORT && damage > 0 && rnd()%100 < 30 + 10 * s_sc->data[SC__DEADLYINFECT]->val1 && !is_boss(src) ) diff --git a/src/map/skill.c b/src/map/skill.c index e57eb85fb16..eeb7c54d973 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -3878,11 +3878,8 @@ static int skill_attack(int attack_type, struct block_list *src, struct block_li case GC_VENOMPRESSURE: { struct status_change *ssc = status->get_sc(src); - if( ssc && ssc->data[SC_POISONINGWEAPON] && rnd()%100 < 70 + 5*skill_lv ) { - short rate = 100; - if ( ssc->data[SC_POISONINGWEAPON]->val1 == 9 )// Oblivion Curse gives a 2nd success chance after the 1st one passes which is reducible. [Rytech] - rate = 100 - tstatus->int_ * 4 / 5; - sc_start(src, bl, ssc->data[SC_POISONINGWEAPON]->val2, rate, ssc->data[SC_POISONINGWEAPON]->val1, skill->get_time2(GC_POISONINGWEAPON, 1) - (tstatus->vit + tstatus->luk) / 2 * 1000, skill_id); + if (ssc != NULL && ssc->data[SC_POISONINGWEAPON] != NULL && rnd() % 100 < 70 + 5 * skill_lv) { + sc_start(src, bl, ssc->data[SC_POISONINGWEAPON]->val2, 100, ssc->data[SC_POISONINGWEAPON]->val1, skill->get_time2(GC_POISONINGWEAPON, 1), skill_id); status_change_end(src, SC_POISONINGWEAPON, INVALID_TIMER); clif->skill_nodamage(src,bl,skill_id,skill_lv,1); } @@ -14426,11 +14423,9 @@ static int skill_unit_onplace_timer(struct skill_unit *src, struct block_list *b * 3rd stuff **/ case UNT_POISONSMOKE: - if( battle->check_target(ss,bl,BCT_ENEMY) > 0 && !(tsc && tsc->data[sg->val2]) && rnd()%100 < 50 ) { - short rate = 100; - if ( sg->val1 == 9 )//Oblivion Curse gives a 2nd success chance after the 1st one passes which is reducible. [Rytech] - rate = 100 - tstatus->int_ * 4 / 5 ; - sc_start(ss, bl, sg->val2, rate, sg->val1, skill->get_time2(GC_POISONINGWEAPON, 1) - (tstatus->vit + tstatus->luk) / 2 * 1000, skill_id); + if (battle->check_target(ss,bl,BCT_ENEMY) > 0 && !(tsc != NULL && tsc->data[sg->val2] != NULL) + && rnd() % 100 < 50) { + sc_start(ss, bl, sg->val2, 100, sg->val1, skill->get_time2(GC_POISONINGWEAPON, 1), skill_id); } break; From 7718e8905112545be663d9e0e435d42139b55dde Mon Sep 17 00:00:00 2001 From: "Guilherme G. Menaldo" Date: Sat, 29 Jul 2023 13:47:39 -0300 Subject: [PATCH 3/4] fix duration of Venom Bleed poison effect while other effects lasts for 5 minutes, Venom Bleed only lasts for 15 seconds --- db/pre-re/skill_db.conf | 7 ++++++- db/re/skill_db.conf | 7 ++++++- src/map/battle.c | 4 +++- src/map/skill.c | 11 +++++++---- 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/db/pre-re/skill_db.conf b/db/pre-re/skill_db.conf index 24992dfe8a4..e7975d4005b 100644 --- a/db/pre-re/skill_db.conf +++ b/db/pre-re/skill_db.conf @@ -19736,6 +19736,7 @@ skill_db: ( NoDamage: true } AfterCastActDelay: 1000 + // Duration of SC_POISONINGWEAPON in caster (in miliseconds) SkillData1: { Lv1: 60000 Lv2: 120000 @@ -19748,7 +19749,11 @@ skill_db: ( Lv9: 540000 Lv10: 600000 } - SkillData2: 300000 + // Duration of inflicted poison effect (in miliseconds) + SkillData2: { + Lv1: 15_000 // Venom Bleed + Lv2: 300_000 // Everything else + } CoolDown: 0 Requirements: { SPCost: { diff --git a/db/re/skill_db.conf b/db/re/skill_db.conf index 3606bf5f4a6..447c243c1f9 100644 --- a/db/re/skill_db.conf +++ b/db/re/skill_db.conf @@ -20226,6 +20226,7 @@ skill_db: ( NoDamage: true } AfterCastActDelay: 1000 + // Duration of SC_POISONINGWEAPON in caster (in miliseconds) SkillData1: { Lv1: 60000 Lv2: 120000 @@ -20238,7 +20239,11 @@ skill_db: ( Lv9: 540000 Lv10: 600000 } - SkillData2: 300000 + // Duration of inflicted poison effect (in miliseconds) + SkillData2: { + Lv1: 15_000 // Venom Bleed + Lv2: 300_000 // Everything else + } FixedCastTime: -1 Requirements: { SPCost: { diff --git a/src/map/battle.c b/src/map/battle.c index 23219db0406..2ec71d063d4 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -3536,7 +3536,9 @@ static int64 battle_calc_damage(struct block_list *src, struct block_list *bl, s } if (s_sc->data[SC_POISONINGWEAPON] != NULL) { if (!(flag & BF_SKILL) && (flag & BF_WEAPON) && damage > 0 && rnd() % 100 < s_sc->data[SC_POISONINGWEAPON]->val3) { - sc_start(src, bl, s_sc->data[SC_POISONINGWEAPON]->val2, 100, s_sc->data[SC_POISONINGWEAPON]->val1, skill->get_time2(GC_POISONINGWEAPON, 1), GC_POISONINGWEAPON); + sc_type poison_sc = s_sc->data[SC_POISONINGWEAPON]->val2; + int duration = skill->get_time2(GC_POISONINGWEAPON, (poison_sc == SC_VENOMBLEED ? 1 : 2)); + sc_start(src, bl, poison_sc, 100, s_sc->data[SC_POISONINGWEAPON]->val1, duration, GC_POISONINGWEAPON); } } if( s_sc->data[SC__DEADLYINFECT] && flag&BF_SHORT && damage > 0 && rnd()%100 < 30 + 10 * s_sc->data[SC__DEADLYINFECT]->val1 && !is_boss(src) ) diff --git a/src/map/skill.c b/src/map/skill.c index eeb7c54d973..122814f0032 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -3879,9 +3879,11 @@ static int skill_attack(int attack_type, struct block_list *src, struct block_li { struct status_change *ssc = status->get_sc(src); if (ssc != NULL && ssc->data[SC_POISONINGWEAPON] != NULL && rnd() % 100 < 70 + 5 * skill_lv) { - sc_start(src, bl, ssc->data[SC_POISONINGWEAPON]->val2, 100, ssc->data[SC_POISONINGWEAPON]->val1, skill->get_time2(GC_POISONINGWEAPON, 1), skill_id); + sc_type poison_sc = ssc->data[SC_POISONINGWEAPON]->val2; + int duration = skill->get_time2(GC_POISONINGWEAPON, (poison_sc == SC_VENOMBLEED ? 1 : 2)); + sc_start(src, bl, poison_sc, 100, ssc->data[SC_POISONINGWEAPON]->val1, duration, skill_id); status_change_end(src, SC_POISONINGWEAPON, INVALID_TIMER); - clif->skill_nodamage(src,bl,skill_id,skill_lv,1); + clif->skill_nodamage(src, bl, skill_id, skill_lv, 1); } } break; @@ -14423,9 +14425,10 @@ static int skill_unit_onplace_timer(struct skill_unit *src, struct block_list *b * 3rd stuff **/ case UNT_POISONSMOKE: - if (battle->check_target(ss,bl,BCT_ENEMY) > 0 && !(tsc != NULL && tsc->data[sg->val2] != NULL) + if (battle->check_target(ss, bl, BCT_ENEMY) > 0 && !(tsc != NULL && tsc->data[sg->val2] != NULL) && rnd() % 100 < 50) { - sc_start(ss, bl, sg->val2, 100, sg->val1, skill->get_time2(GC_POISONINGWEAPON, 1), skill_id); + int duration = skill->get_time2(GC_POISONINGWEAPON, (sg->val2 == SC_VENOMBLEED ? 1 : 2)); + sc_start(ss, bl, sg->val2, 100, sg->val1, duration, skill_id); } break; From bd81482fc9432d3a447c6b102862afa0a579012d Mon Sep 17 00:00:00 2001 From: "Guilherme G. Menaldo" Date: Sat, 29 Jul 2023 14:08:48 -0300 Subject: [PATCH 4/4] add result messages to poisoning weapon a message stating which poison was selected should be displayed after the player selects one --- src/map/skill.c | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/src/map/skill.c b/src/map/skill.c index 122814f0032..4d3bb0e176a 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -20323,19 +20323,20 @@ static int skill_poisoningweapon(struct map_session_data *sd, int nameid) clif->skill_fail(sd, GC_POISONINGWEAPON, USESKILL_FAIL_LEVEL, 0, 0); return 0; } - switch( nameid ) - { // t_lv used to take duration from skill->get_time2 - case ITEMID_POISON_PARALYSIS: type = SC_PARALYSE; break; - case ITEMID_POISON_FEVER: type = SC_PYREXIA; break; - case ITEMID_POISON_CONTAMINATION: type = SC_DEATHHURT; break; - case ITEMID_POISON_LEECH: type = SC_LEECHESEND; break; - case ITEMID_POISON_FATIGUE: type = SC_VENOMBLEED; break; - case ITEMID_POISON_NUMB: type = SC_TOXIN; break; - case ITEMID_POISON_LAUGHING: type = SC_MAGICMUSHROOM; break; - case ITEMID_POISON_OBLIVION: type = SC_OBLIVIONCURSE; break; - default: - clif->skill_fail(sd, GC_POISONINGWEAPON, USESKILL_FAIL_LEVEL, 0, 0); - return 0; + + int msg = 0; + switch (nameid) { + case ITEMID_POISON_PARALYSIS: msg = MSG_PARALYZE; type = SC_PARALYSE; break; + case ITEMID_POISON_FEVER: msg = MSG_PHYREXIA; type = SC_PYREXIA; break; + case ITEMID_POISON_CONTAMINATION: msg = MSG_DEATHHURT; type = SC_DEATHHURT; break; + case ITEMID_POISON_LEECH: msg = MSG_RICHEND; type = SC_LEECHESEND; break; + case ITEMID_POISON_FATIGUE: msg = MSG_VENOMBLEED; type = SC_VENOMBLEED; break; + case ITEMID_POISON_NUMB: msg = MSG_TOXIN; type = SC_TOXIN; break; + case ITEMID_POISON_LAUGHING: msg = MSG_MAGICMUSHROOM; type = SC_MAGICMUSHROOM; break; + case ITEMID_POISON_OBLIVION: msg = MSG_OBLIANCURSE; type = SC_OBLIVIONCURSE; break; + default: + clif->skill_fail(sd, GC_POISONINGWEAPON, USESKILL_FAIL_LEVEL, 0, 0); + return 0; } status_change_end(&sd->bl, SC_POISONINGWEAPON, INVALID_TIMER); // Status must be forced to end so that a new poison will be applied if a player decides to change poisons. [Rytech] @@ -20343,6 +20344,11 @@ static int skill_poisoningweapon(struct map_session_data *sd, int nameid) sc_start4(&sd->bl, &sd->bl, SC_POISONINGWEAPON, 100, pc->checkskill(sd, GC_RESEARCHNEWPOISON), //in Aegis it store the level of GC_RESEARCHNEWPOISON in val1 type, chance, 0, skill->get_time(GC_POISONINGWEAPON, sd->menuskill_val), GC_POISONINGWEAPON); +#if PACKETVER >= 20090304 + if (msg > 0) + clif->msgtable(sd, msg); +#endif + return 0; }