skyrim-multiplayer / skymp

Multiplayer Mod & TypeScript SDK for Skyrim Special Edition
Other
220 stars 74 forks source link

Take weapon damage components into account #457

Open Pospelove opened 3 years ago

Pospelove commented 3 years ago

See TODO in skymp/skymp5-server/cpp/server_guest_lib/formulas/TES5DamageFormula.cpp

Docs here https://en.uesp.net/wiki/Skyrim:Weapons, https://en.uesp.net/wiki/Skyrim:Matching_Set

For unimplemented features like perks leave another one TODO and use 0/1 constants.

displayed damage = Round[ (base damage + smithing increase) * (1 + skill/200) * (1 + perk effects) * (1 + item effects) * (1 + potion effect) * (1 + Seeker of Might bonus) ]

* Smithing Increase should use the unrounded value based on this formula.

* Perk Effects = .2 * Barbarian/Armsman/Overdraw rank level

* Blessing of Auriel is additive with item effects while Blessing of Boethiah is additive with potion effect

Damage = 
 ((Right Hand displayed Damage * (1 + Power Attack Bonus) *  (1 + Power Attack Perk) * (1 + Dual Power Attack perk)) * Dual Power Attack Mod) + ((Left Hand displayed Damage * (1 + Power Attack Bonus) *  (1 + Power Attack Perk) * (1 + Dual Power Attack perk)) * Dual Power Attack Mod)

* Power Attack Bonus = 1 if power attacking

* Power Attack Perk = 0.25 if power attacking and you have Savage Strike or Devastating Blow

* Dual Power Attack Perk = 0.5 if power attacking with two weapons and you have Dual Savagery

* Dual Power Attack Mod is 1.5 for the right (1xattack) and 3 (2xattack) for the left hand if dual power attacking (else 1)
Pospelove commented 1 year ago

upd: When AMMO present, take AMMO damage into account