Attack damage for high-attack rifles is significantly less than calculated values
Summary
Observed attack damage with high-attack rifles is markedly lower than rocalc, wushuang calc, my own attempt to model
Steps to Reproduce
- Click attack Poring with Jungle Carbine
- Compare result to rocalc, wushuang calc, iro classic wiki damage formula
Actual result
Observed damage from Jungle Carbine is 20% lower than rocalc, wushuang calc, and my attempt to model the formula available on iro classic wiki. Performed same process with Stiletto, Hunter Bow, Crimson Bolt, Branch (low-attack rifle) and results were much closer to expected. Also tested the Black Rose shotgun and it performed as expected.
Additional Information
A spreadsheet with my findings can be found here: https://docs.google.com/spreadsheets/d/1L6p01oH-1HUf1t9GTK9YANIU7nsirYGnQetiYuF4bXU/edit?usp=sharing An Excel version of the same sheet is attached. The model is based on information from https://irowiki.org/classic/Attacks. I am not sure that I modeled it correctly. I also modeled the damage on wushuang calc and rocalc. All of the weapons I modeled had only very small discrepancies between oRo observed damage and modeled damage predictions, EXCEPT the Jungle Carbine and other high attack rifles, where observed damage was significantly lower than the model anticipated.
UPDATE:
Thanks to Zulf who helped me and also advised to look at the Hercules code repository, I think I may have maybe possibly found a relevant area in the code from battle.c lines 612-615:
I don't have any coding background but based on the notes it looks like battle_calc_base_damage2 is indeed for pre-renewal, and this section of the code is for calculating the weapon damage which is added onto the base damage to calculate your attack.
Again based on my interpretation:
Line 600: Max damage is set to weapon attack.
Line 604: Min damage is set to dex
Lines 606-607: If some conditions apply, which iro wiki indicates is always when a weapon is equipped because this formula appears in both melee and missile weapons, set min damage to dex*[0.8 + 0.2 * weaponLvl]
Lines 609 and 610: min damage is lowered to max damage (which is same as weapon attack), if applicable. Because dex was just used to determine min damage, it is more likely for a dex character to be affected by this.
Lines 612 to 615: This is for arrow attacks only. A dex character may now have a min damage equal to their max damage, it sets a new minimum damage equal to atkmin * atkmax / 100. Note that if the weapon damage (max damage) is less than 100, the new min damage will be lower than before. However if the weapon damage is higher than 100, this creates a possibility for increasing the maximum damage via line 615.
The question becomes are rifles melee weapons or missile weapons? Are they triggering lines 612-615? It looks to me like Pistols do trigger it because I seem to have a large variability in damage with Crimson Bolt (45 attack, 226-254 dmg on 0 def mobs) but I can't say for sure. Shotgun appears to trigger those lines. However observed oRo Jungle Carbine damage appears to be consistent with rifles NOT triggering lines 612-615. Hunter Bow appears to trigger these lines. Lines 532-538 in battle.c seem to indicate that guns should count as arrow attacks. rocalc and wushuang calc outputs appear to use lines 612-615 for rifles although curiously, critical damage appears irregularly low in both calcs: