I've been combing through the scripts and figured I might get what I'm looking for much quicker here.

I want to find where the base damage calculation math lives.

What function actually applied damage at the end of the day and where does it live?

Also, is anyone able to walk me through the path the code takes to calculate say, a player hitting a monster with a sword. Where does the calculation begin and what path/functions does it go through up until the point of applying damage?



Why I'm asking?

I want to revamp the combat in UO. I want to make gear progression and pve overall more interesting.


I want to uncap the resists and change the formula. NPCs will retain their capped resists 1-70. Players will have a totally uncapped resist but instead of a flat % reduction it will look like this:

Creatures have a damage intensity. Player's have resists. Let's say my mob does 10 damage per hit with an intensity of 20. First I check to see if the Intensity is > or < the resist. If the intensity is = or within a range of 5 either direction the player simply takes 100% of the creature damage. Now, if a player had a resist of ANYTHING above creature intensity + 10 they would take 75% creature damage. This is to allow top tier gear the ability to go toe to toe with strong monsters without making any monster trivial. But, if player resist is lower than creature intensity the damage mod goes up. 10 less 200, 20 less 300, and so on. Essentially requiring your gear to be tailored to the creatures you plan on fighting, allowing some progression without making lower level mobs harmless. This also means someone pvping in a dungeon without the proper pve gear is in danger of being one shot by a mob, where-as someone in the proper gear is enjoying 300% less damage taken. These values have no effect on player to player damage. It creates another layer of risk versus reward. In order to challenge player's pveing you must risk the same level of gear.
 
Start in BaseWeapon.OnHit(Mobile attacker, IDamageable damageable, double damageBonus)
BaseRange.OnHit is For Bows
 
Thanks. That helps, but it looks like there is some stuff I can't find or missing. I see aosattributes class, and that has a baseattributes class that it looks like a lot of damage calculation is using but I can't find the baseattribute class that aosattribute is inheriting from. The entire set up is a little confusing to be honest.

It looks like OnHit calls a getdamage function(forget exact name) which then references aosattributes, which references baseattributes that I can't find.
 
Back