Fixed Asprika damage reduction (#8173)

- Monster damage is now always reduced by items that reduce BF_WEAPON damage
- Monster damage is now never reduced by items that reduce BF_MAGIC damage
- Asprika now reduces all damage from monsters by 30%
- Asprika now reduces all physical damage from players by 30%
- Asprika now reduces damage regardless of range of the attack
- Shaman Hat will no longer reduce damage from monsters, but will still reduce magic damage from players
- This also affects all custom items using bonus3 bSubEle and bonus3 bSubRace
- Added a config to battle/items.conf to return to old behavior
- Fixes #8171
This commit is contained in:
Playtester 2024-03-24 21:32:49 +01:00 committed by GitHub
parent 34711b5307
commit dd663c7eb4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 16 additions and 10 deletions

View File

@ -134,3 +134,9 @@ min_shop_buy: 1
// Minimum sell price of items at a normal shop
// Officially items can be sold for 0 Zeny
min_shop_sell: 0
// Should items that reduce damage from element/race count all monster damage as physical? (Note 1)
// Officially "Asprika" (god item) reduces all monsters damage rather than just physical damage
// Shaman Hat on the other hand doesn't reduce monster damage at all (reduces magical damage in PVP)
// This only affects items with bonus3 bSubEle and bonus3 bSubRace.
cardfix_monster_physical: yes

View File

@ -20587,16 +20587,7 @@ Body:
EquipLevelMin: 94
Script: |
bonus bMdef,5;
bonus3 bSubEle,Ele_Neutral,30,BF_SHORT;
bonus3 bSubEle,Ele_Water,30,BF_SHORT;
bonus3 bSubEle,Ele_Earth,30,BF_SHORT;
bonus3 bSubEle,Ele_Fire,30,BF_SHORT;
bonus3 bSubEle,Ele_Wind,30,BF_SHORT;
bonus3 bSubEle,Ele_Poison,30,BF_SHORT;
bonus3 bSubEle,Ele_Holy,30,BF_SHORT;
bonus3 bSubEle,Ele_Dark,30,BF_SHORT;
bonus3 bSubEle,Ele_Ghost,30,BF_SHORT;
bonus3 bSubEle,Ele_Undead,30,BF_SHORT;
bonus3 bSubEle,Ele_All,30,BF_WEAPON;
bonus bFlee,30;
skill "AL_TELEPORT",1;
bonus bUnbreakableGarment;

View File

@ -689,6 +689,13 @@ int battle_calc_cardfix(int attack_type, struct block_list *src, struct block_li
t_race2 = status_get_race2(target);
s_defele = (tsd) ? (enum e_element)status_get_element(src) : ELE_NONE;
// When the attacker is a monster, then all bonuses on BF_WEAPON will work and no bonuses on BF_MAGIC
// Does not impact the attack type
if (src && src->type == BL_MOB && battle_config.cardfix_monster_physical) {
flag |= BF_WEAPON;
flag &= ~BF_MAGIC;
}
//Official servers apply the cardfix value on a base of 1000 and round down the reduction/increase
#define APPLY_CARDFIX(damage, fix) { (damage) = (damage) - (int64)(((damage) * (1000 - max(0, fix))) / 1000); }
@ -10569,6 +10576,7 @@ static const struct _battle_data {
{ "delay_dependon_agi", &battle_config.delay_dependon_agi, 0, 0, 1, },
{ "skill_delay_attack_enable", &battle_config.sdelay_attack_enable, 0, 0, 1, },
{ "left_cardfix_to_right", &battle_config.left_cardfix_to_right, 0, 0, 1, },
{ "cardfix_monster_physical", &battle_config.cardfix_monster_physical, 1, 0, 1, },
{ "skill_add_range", &battle_config.skill_add_range, 0, 0, INT_MAX, },
{ "skill_out_range_consume", &battle_config.skill_out_range_consume, 1, 0, 1, },
{ "skillrange_by_distance", &battle_config.skillrange_by_distance, ~BL_PC, BL_NUL, BL_ALL, },

View File

@ -150,6 +150,7 @@ struct Battle_Config
int delay_dependon_dex, delay_dependon_agi;
int sdelay_attack_enable;
int left_cardfix_to_right;
int cardfix_monster_physical;
int skill_add_range;
int skill_out_range_consume;
int skill_amotion_leniency;