Skip to content

Conversation

@Birthright50
Copy link
Contributor

This PR fixes PvP/PvE damage ratio handling by applying caps to aggregated attack and defense ratios instead of individual stats.

On retail, PvP/PvE attack and defense ratios (base + physical/magical modifiers) are capped only after aggregation.
Using per-stat lower/upper cap helpers would incorrectly clamp individual components and break valid mixed-stat configurations.

The final damage multiplier is additionally clamped to prevent negative or zero damage values, while upper bounds remain governed by stat caps.

lowerCapFor / upperCapFor functions operate on individual stats,
while PvP/PvE ratio limits on retail apply to the final aggregated value
(base + physical/magical modifiers).
Using per-stat caps would change valid configurations and result in incorrect behavior.

PvP Caps

PVP_ATTACK_RATIO + PVP_ATTACK_RATIO_PHYSICAL | PVP_ATTACK_RATIO_MAGICAL
∈ [-900 … 1000]   // -90% … +100%

PVP_DEFEND_RATIO + PVP_DEFEND_RATIO_PHYSICAL | PVP_DEFEND_RATIO_MAGICAL
∈ [-1000 … 900]   // -100% … +90%

PvE caps:

PVE_ATTACK_RATIO + PVE_ATTACK_RATIO_PHYSICAL | PVE_ATTACK_RATIO_MAGICAL
∈ [-900 … 5000]   // -90% … +500%

PVE_DEFEND_RATIO+ PVE_DEFEND_RATIO_PHYSICAL | PVE_DEFEND_RATIO_MAGICAL
∈ [-5000 … 900]   // -500% … +90%

Final Damage Multiplier:

multiplier = 1 + (attackRatio - defenseRatio) / 1000
multiplier >= 0.1

For example:
PvEDamageRatio + PvEDamageRatio_magical cap = 5000

PvPDamageRation min and max cap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant