Sakurai the Cursed
Member

Practical Applications Reader beware, math ahead! This section is purely for those interested and isn't necessarily required to understand the game, only to assist in mathematic comparisons and evaluations. Now that we've defined the parameters of all the various stats, let's detail how they interact and lay out some practical formulae you can use to determine actual damage and hit chance. First, damage: The flat damage received from Str, Dex or Int always rounds down, but the final stat damage after applying Str's percentage boost always rounds up, and this final stat damage is added to both your minimum and maximum weapon damage to provide the damage displayed on your character sheet (Dmg): Note: "ceiling()" and "floor()" mean to round the number inside of their parentheses up to the next highest whole number (for ceiling) or down to the next lowest whole number (for floor); for example, ceiling(12.1) = 13 and floor(72.9) = 72 Dmg = Weapon Damage + ceiling(floor(Str or Dex or Int / 10) * (1 + Str / 500)) So for example, using a Melee weapon with 75100 weapon damage and 109 STR, you'd have: 75100 + ceiling(floor((109 / 10)) * (1 + 109 / 500)) 75100 + ceiling(floor(10.9) * 1.218) 75100 + ceiling(10 * 1.218) 75100 + ceiling(12.18) 75100 + 13 = 88113 Note that pet/guest damage is much the same as your own damage, just using their own stats (listed on the item description for pets or the character sheet for guests) instead of yours, with the obvious exception of your Cha. The vast majority of pets simply do 100% damage per hit making the number of hits paramount for Cha builds, however there are exceptions and guests can be as variable as your own classes, so this all applies to them as well; just add in "+ floor(Your Cha / 10))" at the end. This base is then multiplied by the attack/skill used, any boost you may have, and your critical modifier if you land a critical hit. Additionally, from a gameplay perspective, every attack or effect in DragonFable will have an associated element to it; this can range from mundane materials like Metal or Stone, to traditional elemental archetypes like Fire or Light, moral concepts like Good or Fear or even the enigmatic "???". In fact, even the lack of an element is considered an element of its own, called simply "None". All of these are mitigated by their respective elemental resistance, though some don't have any sources of resistance for themselves in particular, but all are affected by the "All" resistance. And lastly, all final damage numbers are always rounded up (only relevant if a final damage value is not a whole number). So, taking these together, a simple formula for base damage would look like this: Base damage = ceiling(Dmg * Skill Multiplier * (1 + Boost / 100) * (100  Relevant Resistances) / 100) To use the aforementioned example of 88113 dmg, with a 200% skill multiplier and assuming the attack is of the Metal element with the enemy having 30 Metal Resistance but 10 All Resistance, we'd have: ceiling(88113 * 2 * (100  30  10) / 100) ceiling(176226 * (120) / 100) ceiling(176226 * 1.2) ceiling(211.2271.2) = 212272 damage Critical hits then multiply that damage by 175% plus any class or stat modifiers, however they do so before the final ceiling, so if the skill crits we'd use this: Crit damage = ceiling(Dmg * Skill Multiplier * (1 + Boost / 100) * (100  Relevant Resistances) / 100 * (1.75 + Class Crit Modifier + Int / 1,000)) Let's assume the Cryptic class which has +25% critical damage and 200 Int: ceiling(211.2271.2 * (1.75 + 0.25 + 200 / 1,000)) ceiling(211.2271.2 * (2 + 0.2)) ceiling(211.2271.2 * 2.2) ceiling(464.64596.64) = 465597 final damage If we want to find the average damage we should expect while ignoring chance to hit, for example if we know our hitrate will be the max anyway (and, to be honest, it generally is at higher levels, outside of challenge fights), we just need to take crit chance into account (note that we don't round up here because these aren't actual inflicted damages, just expected averages: Note: "median(x,y,z)" means to use whichever variable within the parentheses is the middle (median) value of the given options when arranged in numerical order from smallest to largest, or largest to smallest. So, for example, median(0, 1.5, 1) = 1, or median(0.1, 0.05, 0.9933) = 0.1 Average raw damage = Base damage * (1 + median(0, (Crit / 200), 1) * (0.75 + Class Crit Modifier + Int / 1,000)) So, continuing on from the previous examples and assuming 120 Crit for 60% critical chance, we'd have: 212272 * (1 + median(0, (120 / 200), 1) * (0.75 + 0.25 + 200 / 1,000)) 212272 * (1 + median(0, 0.6, 1) * 1.2) 212272 * (1 + 0.6 * 1.2) 212272 * 1.72 = 364.64467.84 damage on average, or to take it a step further, 416.24 average damage DoTs (Damage over Time...s) are effects inflicted on a target which deal damage to them at the start of each of their turns for a set number of turns; they're isolated and somewhat unique from other damage in that they can't crit or miss and are unaffected by any Boost you may have (though the hit that inflicts this effect on the enemy is treated as any normal skill), so the formula is rather unconnected to the rest. They're also rather unique in that, whereas almost all 'standard' skills have the same multipliers for both weapon damage and stat damage, DoTs in particular have a tendency to use differing percentages of the two, often only making use of weapon damage and ignoring stat damage entirely, other than Dex's secondary flat DoT damage bonus which is always applied the same way (except when it isn't applied at all, like with DoTs that deal damage based on your HP...). This does vary on a skill by skill basis, and is honestly not often documented in Encyclopedia entries either as nailing down the exact mechanics is difficult. When DoT effects do make use of stat damage, the stat damage is determined by the hit that inflicts the DoT, not the type (Melee, Pierce or Magic) of the DoT itself; if, for example, a DoT does Magic damage, but the hit that inflicts the DoT was Melee, the DoT will make use of your Str rather than your Int. So, while DoTs are very convoluted and not often fully documented, if you do know the details then you can make use of this formula for whatever ratio of weapon:stat damage that they may have: DoT damage = ceiling((Weapon Damage * Weapon Multiplier + floor(Str or Dex or Int / 10) * Stat Multiplier + ceiling(Dex / 10)) * (100  Relevant Resistances) / 100)) Using the previous stats; Metal Melee weapon with 75100 weapon damage and 109 Str, let's add in 250 Dex and assume a DoT effect that does 25% weapon damage and 0% stat damage, against 30 Metal but 10 All Resistance: ceiling((75100 * 0.25 + floor(109 / 10) * 0 + ceiling(250 / 10)) * (100  30  10) / 100)) ceiling((18.7525 + 0 + 25) * (120 / 100)) ceiling((18.7525 + 25) * 1.2) ceiling(43.7550 * 1.2) ceiling(52.560) = 5360 damage per turn Now of course, sometimes we're not trying to figure out damage inflicted in a particular situation but just want to do a comparison between two classes/skills and nothing else, so don't care about the enemy or our weapon or stats (though crit chance and crit damage still need to be taken into account since those things do vary between classes/skills); in that case, we'd use this: Average skill damage = Skill Multiplier * (1 + Boost / 100) * (1 + Crit / 200 * (0.75 + Class Crit Modifier + INT / 1,000)) So, assuming the same crit chance as before of 60% and 200 INT for crit damage, say we have a skill that does 150% damage, and the class has a 30% Boost buff and a +25% Crit Modifier, and we want to compare it to a skill that does 120% damage with +20% crit chance (+40 Crit) on a class that has a 50% Boost buff, but no bonus to critical damage: 1.5 * (1 + 30 / 100) * (1 + 120 / 200 * (0.75 + 0.25 + 200 / 1,000)_1.2 * (1 + 50 / 100) * (1 + 160 / 200 * (0.75 + 200 / 1,000) 1.5 * 1.3 * (1 + 0.6 * 1.2)1.2 * 1.5 * (1 + 0.8 * 0.95) 1.95 * 1.72 = 3.354, or 335.4% damage on average1.8 * 1.76 = 3.168, or 316.8% damage on average If we then wanted to tailor this to some particular situation, we just multiply our Dmg by this amount and any relevant resistances; the order doesn't matter since it's all just multiplication, so I don't think an equation is necessary for that. But of course, the damage inflicted on hits and crits is only part of the story; to find the real average damage we'd expect to do, we need to get into chance to hit. When determining chance to hit, there are 2 separate rolls involved; you roll a random number from 1150 and add your Bonus to that number, and if it's higher than your enemy's MPM then you pass that roll and do the same thing again vs BPD if applicable. In order to get a full hit you have to pass both rolls, but failing one or both can lead to differing outcomes: The MPM roll takes precedence over the BPD roll, in that if you fail the MPM roll, then it stops there and you can't get a glancing blow, you get a full miss. Likewise, Direct Hit and Critical Miss are done on the MPM roll, and if Direct Hit activates you skip everything else and get an automatic hit while if Critical Miss activates you get an automatic full miss. However, do keep in mind that, since they're done on the same roll and Direct Hit requires a maximum or nearmaximum roll, it has no effect on your MPM accuracy unless your chance to hit through MPM is lower than your Direct Hit chance; in other words, if your Direct hit is 15 for 10% chance, then it won't raise your chance to succeed at the MPM roll in any way until your accuracy against MPM falls below 10%, though the chance to skip BPD is always present; likewise, Critical Miss does nothing if you have a 1% or higher chance to miss already, since failing against MPM ends the hit check with a full miss regardless of whether it's a Critical Miss or not; the only function it actually has is to prevent you from reaching 100% hit chance. And of course, Critical Hits can't be glancing blows, so those bypass the BPD roll as well. So with all that in mind: Full hit chance = median(median(0, ((1 + Attacker's Luk / 25) / 150), 1), ((1  median(0, ((Defender's Melee or Pierce or Magic  Attacker's Bonus) / 150), 1)) * (1  median(0, ((Defender's Block or Parry or Dodge  Attacker's Bonus) / 150 * (1  median(0, (Attacker's Crit / 200), 1))), 1))), 0.993) So, say we've got an attacker with 60 Bonus, 120 Crit and 225 Luk going up against a defender who has 100 MPM and 130 BPD: median(median(0, ((1 + 225 / 25) / 150), 1), ((1  median(0, ((100  60) / 150), 1)) * (1  median(0, ((130  60) / 150 * (1  (0, (120 / 200), 1))), 1))), 0.993) median(median(0, ((1 + 9) / 150), 1), ((1  median(0, (40 / 150), 1)) * (1  median(0, (70 / 150 * (1  median(0, 0.6, 1))), 1))), 0.993) median(median(0, (10 / 150), 1), ((1  median(0, 0.267, 1)) * (1  median(0, (0.467 * (1  0.6)), 1))), 0.993) median(median(0, 0.067, 1), ((1  0.267) * (1  median(0, (0.467 * 0.4), 1))), 0.993) median(0.067, (0.733 * (1  median(0, 0.187, 1))), 0.993) median(0.067, (0.733 * (1  0.187)), 0.993) median(0.067, (0.733 * 0.813), 0.993) median(0.067, 0.596, 0.993) = 0.596, or a 59.6% chance to hit in total. Alright, so we've got damage and we've got overall hit rate, but there's one last factor that needs to be considered; the previous formula tells us how many full hits we can expect to land, for inflicting effects that require such a thing for example, and we know that the only way to get a Glancing Blow is if a hit: is not a Miss; is not a Crit; is not a Direct Hit; is not a Critical Miss; has passed the MPM roll; and finally fails the BPD roll. That's a lot of restrictions to limit the significance of these pseudohits, however they're still an important factor especially when shield skills that buff BPD come into play, so we need to know how to find their chance. We've already gone over all the necessary information, so it's just a matter of doing the math; to get your Glancing Blow chance, you multiply your chance to fail the Glancing Blow roll by your chance to succeed at the MPM roll. To be sure of your results, your final Glancing Blow chance + your independent chance to fail the MPM roll + your fullhit chance will always equal 1, as being a probability the sum of all options has to equal 100%: Note: "min(x,y)" and "max(x,y)" means to use whichever variable within the parentheses is the smallest (for min) or largest (for max). So, for example, min(0.2, 0.7) = 0.2, max(0.5, 0.6) = 0.6 Glancing blow chance = min(max((median(0, ((1 + Attacker's Luk / 25) / 150), 1)), (1  median(0, ((Defender's MPM  Attacker's Bonus) / 150), 1))), 0.993) * median(0, ((Defender's BPD  Attacker's Bonus) / 150 * (1  median(0, (Attacker's Crit / 200), 1))), 1) So, using the same numbers as for the full hitrate: min(max((median(0, ((1 + 225 / 25) / 150), 1)), (1  median(0, ((100  60) / 150), 1))), 0.993) * median(0, ((130  60) / 150 * (1  median(0, (120 / 200), 1))), 1) min(max((median(0, ((1 + 9) / 150), 1)), (1  median(0, (40 / 150), 1))), 0.993) * median(0, (70 / 150 * (1  median(0, 0.6, 1))), 1) min(max((median(0, (10 / 150), 1)), (1  median(0, 0.267, 1))), 0.993) * median(0, (0.467 * (1  0.6)), 1) min(max((median(0, 0.067, 1)), (1  0.267)), 0.993) * median(0, (0.467 * 0.4), 1) min(max(0.067, 0.733), 0.993) * median(0, 0.187, 1) min(0.733, 0.993) * 0.187 0.733 * 0.187 = 0.137, or a 13.7% chance of a glancing blow. So, now all that's left is to unify them to get a real expected damage value for any given situation. This is rarely  if ever  necessary, but it's fairly simple since we've already defined and solved almost all the necessary information  the only thing missing being the amount of damage the glancing blows will do, which as mentioned in the Secondary Stats section is 25% minus your Dex modifier. So with that in mind: Real average damage = Average raw damage * Full hit chance + Base damage * (0.25  Dex / 1,500) * Glancing blow chance So, using all previous example numbers: 364.64467.84 * 0.596 + 212272 * (0.25  250 / 1,500) * 0.137 217.33278.83 + 212272 * (0.25  0.167) * 0.137 217.33278.83 + 212272 * 0.083 * 0.137 217.33278.83 + 17.6022.58 * 0.137 217.33278.83 + 2.413.09 = 219.74281.92 And that's it! You now know the rules and quirks to calculate any combatrelated things you may desire. :) Acknowledgements Thanks to:  The DragonFable Encyclopedia and the contributors thereof for links and information.  Ashendal and Verlyrus for being awesome coders, giving the stats more meaning and being transparent in their exact effects.  dracojan, the previous owner.  All past, present and future DragonFable staff for creating this great game!  LouisCyphere and Solanaceae for helping me think through formulae quote:
dracojan's credits Thanks to the people who have helped on my guide: Sakurai the Cursed, ClashOfTheTitans57, Elicius, Epsilon2012, gold, Baron Dante, Lord Vrael, Peachii, Mordred, nightslayer321, Therril Oreb, HellsWolf666, Wyker, Watashig, Ash and everybody on the forums.
< Message edited by Karika  5/9/2019 11:27:09 >
