Turn armor into a percent with a max threshold of 1000 armor (I personally don't think anyone should have over 1,000 armor or resist, and if they do the formula can be adjusted), then multiply our damage by that percent to get a percent of our damage. Then we minus that percent of our damage from our original damage. If you go over 1,000 armor or resist, the calculation will break. It can be easily fixed though. Ill post the formula here, but I've also piggy backed off of Joyce spread sheet to show you what is actually going on with the calculations.
<?xml version="1.0" encoding="utf-8"?>
<!--formulas.xml generated automatically by Intersect Server.
Here you can modify formulas used in the Intersect Engine. The three main formulas are for calculating Physical, Magical, and True Damage.
The following functions can be used:
Random(min,max): Returns an integer value between min and max.
The following variables can be used:
BaseDamage: Base damage of weapon or spell used.
ScalingStat: Value of stat that was selected in the item/spell editor to scale with the attack.
ScaleFactor: Value set in editors for how spell/weapon should scale off of the scaling stat.
CritFactor: Value to multiply potential damage by if the attack is a critical strike. (Server provides 0 is not a crit, and 2 if it is a crit)
A_Attack: Attackers attack stat.
A_Defense: Attackers defense stat.
A_Speed: Attackers speed stat.
A_AbilityPwr Attackers ability power stat.
A_MagicResist: Attackers magic resist stat.
V_Attack: Victims attack stat.
V_Defense: Victims defense stat.
V_Speed: Victims speed stat.
V_AbilityPwr Victims ability power stat.
V_MagicResist: Victims magic resist stat.
-->
<Formulas>
<!-- Old Formulas
<PhysicalDamage>Random(((BaseDamage + (ScalingStat * ScaleFactor))) * CritFactor * .975, ((BaseDamage + (ScalingStat * ScaleFactor))) * CritFactor * 1.025) * (100 / (100 + V_Defense))</PhysicalDamage>
<MagicDamage>Random(((BaseDamage + (ScalingStat * ScaleFactor))) * CritFactor * .975, ((BaseDamage + (ScalingStat * ScaleFactor))) * CritFactor * 1.025) * (100 / (100 + V_MagicResist))</MagicDamage>
<TrueDamage>Random(((BaseDamage + (ScalingStat * ScaleFactor))) * CritFactor * .975, ((BaseDamage + (ScalingStat * ScaleFactor))) * CritFactor * 1.025)</TrueDamage>
End Old Formulas-->
<!-- New Formulas!
We turn our armor/resist into % damage reduction, by turning armor/resist into a %.
Then multiplying our damage by that to get that % of our damage, and we subtract from our original damage
to get the mitigated amount.-->
<PhysicalDamage>Random((BaseDamage + ScalingStat * ScaleFactor * CritFactor) - (BaseDamage + ScalingStat * ScaleFactor * CritFactor) * (V_Defense * 0.001), (BaseDamage + ScalingStat * ScaleFactor * CritFactor * 1.2) - (BaseDamage + ScalingStat * ScaleFactor * CritFactor) * (V_Defense * 0.001))</PhysicalDamage>
<MagicDamage>Random((BaseDamage + ScalingStat * ScaleFactor * CritFactor) - (BaseDamage + ScalingStat * ScaleFactor * CritFactor) * (V_MagicResist * 0.001), (BaseDamage + ScalingStat * ScaleFactor * CritFactor * 1.2) - (BaseDamage + ScalingStat * ScaleFactor * CritFactor) * (V_MagicResist * 0.001))</MagicDamage>
<TrueDamage>Random((BaseDamage + ScalingStat * ScaleFactor * CritFactor) - (BaseDamage + ScalingStat * ScaleFactor * CritFactor) * (0.001), (BaseDamage + ScalingStat * ScaleFactor * CritFactor * 1.5) - (BaseDamage + ScalingStat * ScaleFactor * CritFactor) * (0.001))</TrueDamage>
</Formulas>
I have confirmed it works accurately from spreadsheet to actual game play, also in the spreadsheet you will see tags with <--EDIT ME: for ease of use, anything else isn't used in the calculations currently. ScalingStat was left out of physical and magical calculations in the spreadsheet since it cant represent both in the math, with the way Intersect's formulas work. So I just used A_Attack, and A_AbilityPwr instead, just to get a representation in the sheet. True damage calculation does use it, to give you an idea of how its going to be calculated though. The maximum damage may be adjusted to fit your needs by editing the '1.2' after CritFactor in the formula to something like 1.1 or 1.5, as a side note.
New Combat Formulas.xlsx