From 5112f8e2d8a6eca1df88d1700de61f07e93de6f2 Mon Sep 17 00:00:00 2001 From: SeravySensei <47065845+SeravySensei@users.noreply.github.com> Date: Mon, 29 Jun 2020 21:03:24 +0200 Subject: [PATCH] Fix bonus damage (#4974) * Fixes #4972. * Fixes skill constant bonus damage. Thanks to @SeravySensei! Co-authored-by: Aleos --- src/map/battle.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/map/battle.cpp b/src/map/battle.cpp index b60955e6c2..8539406e6d 100644 --- a/src/map/battle.cpp +++ b/src/map/battle.cpp @@ -5726,10 +5726,9 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src, struct bl ATK_RATE(wd.damage, wd.damage2, ratio); RE_ALLATK_RATE(&wd, ratio); - ratio = battle_calc_skill_constant_addition(&wd, src, target, skill_id, skill_lv); // other skill bonuses + int64 bonus_damage = battle_calc_skill_constant_addition(&wd, src, target, skill_id, skill_lv); // other skill bonuses - ATK_ADD(wd.damage, wd.damage2, ratio); - RE_ALLATK_ADD(&wd, ratio); + ATK_ADD(wd.damage, wd.damage2, bonus_damage); #ifdef RENEWAL if(skill_id == HW_MAGICCRASHER) { // Add weapon attack for MATK onto Magic Crasher @@ -5765,8 +5764,8 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src, struct bl battle_attack_sc_bonus(&wd, src, target, skill_id, skill_lv); if (sd) { //monsters, homuns and pets have their damage computed directly - wd.damage = wd.statusAtk + wd.weaponAtk + wd.equipAtk + wd.masteryAtk; - wd.damage2 = wd.statusAtk2 + wd.weaponAtk2 + wd.equipAtk2 + wd.masteryAtk2; + wd.damage = wd.statusAtk + wd.weaponAtk + wd.equipAtk + wd.masteryAtk + bonus_damage; + wd.damage2 = wd.statusAtk2 + wd.weaponAtk2 + wd.equipAtk2 + wd.masteryAtk2 + bonus_damage; if (wd.flag & BF_SHORT) ATK_ADDRATE(wd.damage, wd.damage2, sd->bonus.short_attack_atk_rate); if(wd.flag&BF_LONG && (skill_id != RA_WUGBITE && skill_id != RA_WUGSTRIKE)) //Long damage rate addition doesn't use weapon + equip attack