Damage in Sword of the New World is calculated using a few basic stats. There is a slight difference between physical and magical damage, so they will be separated out below.
Base attack is then multiplied by bonuses from beneficial stats. The primary stat for the stance used (Str for melee, Dex for ranged, Int for magic) gives a +20% attack bonus for every point above 5. For Agi, every point higher than 5 gives a +10% attack. A meleeing character with 6 Str and 7 Agi would thus receive a total multiplier of +40%.
After applying the stat multiplier, apply any attack multiplier mod from your weapon. (If using two weapons, use the average of the two attack bonuses.)
After that, apply any attack multiplier from buffs (eg: Insistendo).
So, a character with 6 Str and 7 agi, using a 200 attack weapon that has a +25% attack mod would have a total of 350 attack. Level 10 Insistendo (+15% attack) would raise that to 402.
The above character at level 80 with a 40 AR fighting a level 76 mob with a 38 DR would thus get an additional 20% bonus applied, giving a total effective attack of 483 (or 482, depending on whether/where decimals are kept).
Next we need to differentiate between physical and magical damage.
After that, apply bonuses or penalties for weapon type vs armor type. (need to determine this)
Then apply defense. (need to determine this)
The defense against magical attacks depends solely on the appropriate Resistance rating for the element in question. Fire, Ice and Lightning elemental magic is compared against those respective resistances, while a Wizard's magic is compared vs the Psychic Resistance of mobs, or the (mental/sonic)(?) resistance of players. (what does Lord of the Elements test against?)
Resistance is a direct percentile modifier. Assuming the use of fire magic, a Fire Resistance of 50 is a 50% reduction in damage. Resistance of 90 is 90% reduction in damage. (Need to confirm whether resistance can reach 100, and if there is a hard cap.) Conversely, a resistance of -50 means a 50% bonus to damage done. -80 would be an 80% bonus to damage.
So, for our base effective attack of 483, actual damage done vs varying resistance levels would be:
There is some minor random variance of a point or two in all damage done. Also, some tests indicate that the 90 resistance actually caps at about 88% reduction.