Correctly factor in the damage modifier (mostly used by special attacks)

This commit is contained in:
vk 2021-11-17 11:04:58 -08:00 committed by ryannathans
parent 88c9c15a2c
commit 2cc2a497d4
3 changed files with 4 additions and 3 deletions

View file

@ -109,4 +109,5 @@
- Removed server monitor as it was blowing up in headless environments - ryannathans
< --- ABOVE Released January 11th, 2022 https://gitlab.com/2009scape/2009scape/-/tags/Jan-11-2022 ---- >
- Removed regular bones from wolf drop table - Lethimyr
- Fix Gertrude's Cat quest not completing - ryannathans
- Fix Gertrude's Cat quest not completing - ryannathans
- Fix missing special attack damage modifiers for range and melee attacks - vk

View file

@ -194,7 +194,7 @@ open class MeleeSwingHandler
/*val hit = (16 + cumulativeStr + bonus / 8 + cumulativeStr * bonus * 0.016865) * modifier
return (hit / 10).toInt() + 1*/
return (1.3 + (cumulativeStr / 10) + (bonus / 80) + ((cumulativeStr * bonus) / 640)).toInt()
return ((1.3 + (cumulativeStr / 10) + (bonus / 80) + ((cumulativeStr * bonus) / 640)) * modifier).toInt()
}
override fun calculateDefence(victim: Entity?, attacker: Entity?): Int {

View file

@ -222,7 +222,7 @@ open class RangeSwingHandler
}
cumulativeStr *= getSetMultiplier(entity, Skills.RANGE)
cumulativeStr *= (bonus + 64)
return floor(1.5 + (ceil(cumulativeStr) / 640.0)).toInt()
return floor((1.5 + (ceil(cumulativeStr) / 640.0)) * modifier).toInt()
//return ((14 + cumulativeStr + bonus / 8 + cumulativeStr * bonus * 0.016865) * modifier).toInt() / 10 + 1
}