Skip to content

Conversation

@thefatcode
Copy link
Owner

Summary

Prevents weapon-based skills from being cast without a weapon equipped.

Problem

Players could exploit weapon skills (like Twisting Slash) by casting them without a weapon, potentially causing unexpected behavior or exploits.

Solution

Added a check in AreaSkillAttackAction.PerformAutomaticHitsAsync() that validates weapon presence for skills with MovesToTarget = true.

Changes

  • Uses skill.MovesToTarget property instead of hardcoding skill number 41
  • This covers all weapon-based melee skills (Twisting Slash, Death Stab, etc.)
  • More maintainable and data-driven approach

Code Change

// Before (hardcoded)
if (skill.Number == 41 && player.Inventory?.GetItem(InventoryConstants.RightHandSlot) is null)

// After (data-driven)
if (skill.MovesToTarget && player.Inventory?.GetItem(InventoryConstants.RightHandSlot) is null)

@thefatcode thefatcode merged commit 32a93dd into master Jan 16, 2026
1 check passed
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.

2 participants