Player skills no longer proc equip break on mobs (#7005)

* Fixes #5906.
* Player skills and items that have the ability to break a target's equipment will no longer "break" a non-player's equipment.
* WS_MELTDOWN (Shattering Strike) is able to bypass the non-player check as it does affect all target types.
* Adds a battle config to toggle the behavior.
Thanks to @Tydus1, @Xelliekins, @Atemo, @Daegaladh, and @Lemongrass3110!
This commit is contained in:
Aleos 2022-06-06 10:42:42 -04:00 committed by GitHub
parent 479954af30
commit 038c1778e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 0 deletions

View File

@ -167,3 +167,9 @@ warg_can_falcon: no
// Should the target be able of dodging damage by snapping away to the edge of the screen?
// Official behavior is "no"
snap_dodge: no
// Grant player skills/items the ability to "break" non-player equipment. (Note 1)
// This will effectively apply the strip equip effect to the non-player target.
// NOTE: WS_MELTDOWN is exempt from this check when disabled.
// Official: no
break_mob_equip: no

View File

@ -10126,6 +10126,7 @@ static const struct _battle_data {
{ "feature.barter", &battle_config.feature_barter, 1, 0, 1, },
{ "feature.barter_extended", &battle_config.feature_barter_extended, 1, 0, 1, },
{ "break_mob_equip", &battle_config.break_mob_equip, 0, 0, 1, },
#include "../custom/battle_config_init.inc"
};

View File

@ -710,6 +710,7 @@ struct Battle_Config
int feature_barter;
int feature_barter_extended;
int break_mob_equip;
#include "../custom/battle_config_struct.inc"
};

View File

@ -2697,6 +2697,13 @@ int skill_counter_additional_effect (struct block_list* src, struct block_list *
--------------------------------------------------------------------------*/
int skill_break_equip(struct block_list *src, struct block_list *bl, unsigned short where, int rate, int flag)
{
status_change *src_sc = status_get_sc(src);
// Grant player skills/items the ability to "break" non-player equipment.
// WS_MELTDOWN is exempt from this check.
if (!battle_config.break_mob_equip && bl->type != BL_PC && !(src_sc && src_sc->data[SC_MELTDOWN]))
return 0;
const int where_list[6] = { EQP_WEAPON, EQP_ARMOR, EQP_SHIELD, EQP_HELM, EQP_ACC, EQP_SHADOW_GEAR };
const enum sc_type scatk[6] = { SC_STRIPWEAPON, SC_STRIPARMOR, SC_STRIPSHIELD, SC_STRIPHELM, SC__STRIPACCESSORY, SC_SHADOW_STRIP };
const enum sc_type scdef[6] = { SC_CP_WEAPON, SC_CP_ARMOR, SC_CP_SHIELD, SC_CP_HELM, SC_NONE, SC_PROTECTSHADOWEQUIP };