Skip to content

Item Durability Logic Refactor - #966

Draft
ze-dom wants to merge 10 commits into
MUnique:masterfrom
ze-dom:item_durability_refactor
Draft

ze-dom wants to merge 10 commits into
MUnique:masterfrom
ze-dom:item_durability_refactor

Conversation

@ze-dom

@ze-dom ze-dom commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

To-do

  • Comment changes with source references
  • UpdatePlugin(s)

Developments

  • Added durability thresholds, past which some of the item power-ups decrease by a certain factor
  • Added DurabilityDecayPlugIn.cs, for jewelry and wings durability decrease
  • Reworked durability reduction calculations to reflect original values while keeping it configurable

Bugfixes

  • Possible durability reduction target items after dealing and receiving damage
  • Master tree logic and values for skills DurabilityReduction1, DurabilityReduction2, DurabilityReduction3, PetDurabilityStr, DurabilityReduction1FistMaster, DurabilityReduction2FistMaster, DurabilityReduction3FistMaster
  • Repairing items now raises the event EquippedItemsChanged. Previously repaired items w/ durability = 0 were not reinstating their power-ups.

Comment thread src/GameLogic/Player.cs
Comment on lines +737 to +739
bool isPvpDamage = attacker is Player or IPlayerSurrogate;
float damage = isPvpDamage ? hitInfo.TotalDamage : attacker.Attributes[Stats.MinimumPhysBaseDmg];
await this.DecreaseItemDurabilityAfterHitAsync(damage, isPvpDamage, skill).ConfigureAwait(false);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (attacker is Player player)
{
await player.AfterHitTargetAsync().ConfigureAwait(false);
await player.AfterHitTargetAsync(this.Attributes[Stats.DefensePvm], skill?.Skill?.DamageType).ConfigureAwait(false);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (attacker as IPlayerSurrogate is { } playerSurrogate)
{
await playerSurrogate.Owner.AfterHitTargetAsync().ConfigureAwait(false);
await playerSurrogate.Owner.DecreaseRavenDurabilityAfterHitAsync(hitInfo.TotalDamage).ConfigureAwait(false);

@ze-dom ze-dom Sep 22, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

zTeamS6.3, emu

Unfortunately Dark Raven durability decrease is originally calculated in the middle of damage calcs...

This branch has not been deployed

No deployments
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