From f85ca8106695fa7001710059132d42fbb14d8088 Mon Sep 17 00:00:00 2001 From: Playtester <3785983+Playtester@users.noreply.github.com> Date: Sat, 11 May 2024 08:52:39 +0200 Subject: [PATCH] Fixed Magic vs. Plant Damage (#8323) - Fixed magic damage on plants always being 0 - Follow-up to 2963e52 --- src/map/battle.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/map/battle.cpp b/src/map/battle.cpp index 8435552c7d..41a9d98e10 100644 --- a/src/map/battle.cpp +++ b/src/map/battle.cpp @@ -7716,8 +7716,9 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list nullpo_info(NLP_MARK); return ad; } - //Initial Values - ad.damage = 0; + // Initial Values + // Set to 1 because magic damage on plants is 1 per hit; if target is not a plant this gets reinitialized to 0 later + ad.damage = 1; ad.div_ = skill_get_num(skill_id,skill_lv); ad.amotion = (skill_get_inf(skill_id)&INF_GROUND_SKILL ? 0 : sstatus->amotion); //Amotion should be 0 for ground skills. ad.dmotion = tstatus->dmotion; @@ -7798,9 +7799,8 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list if (!flag.infdef) { //No need to do the math for plants unsigned int skillratio = 100; //Skill dmg modifiers. -#ifdef RENEWAL - ad.damage = 0; //reinitialize.. -#endif + //Damage was set to 1 to simulate plant damage; if not plant, need to reinitialize damage with 0 + ad.damage = 0; //MATK_RATE scales the damage. 100 = no change. 50 is halved, 200 is doubled, etc #define MATK_RATE(a) { ad.damage = ad.damage * (a) / 100; } //Adds dmg%. 100 = +100% (double) damage. 10 = +10% damage