Skip to content

[lua, sql, cpp] Add weighted weaponskill for trusts, useWeaponSkill on entity, and Valaineral updates#9708

Closed
lefneer311 wants to merge 0 commit intoLandSandBoat:basefrom
lefneer311:base
Closed

[lua, sql, cpp] Add weighted weaponskill for trusts, useWeaponSkill on entity, and Valaineral updates#9708
lefneer311 wants to merge 0 commit intoLandSandBoat:basefrom
lefneer311:base

Conversation

@lefneer311
Copy link
Copy Markdown
Contributor

I affirm:

  • I understand that if I do not agree to the following points by completing the checkboxes my PR will be ignored.
  • I understand I should leave resolving conversations to the LandSandBoat team so that reviewers won't miss what was said.
  • I have read and understood the Contributing Guide and the Code of Conduct.
  • I have tested my code and the things my code has changed since the last commit in the PR and will test after any later commits.

What does this pull request do?

This pull request does the following:

  1. Adds the ability to call entity:useWeaponSkill() to force the use of a weaponskill; prior to this only useMobAbility() was exposed, which has bugs for weaponskill abilities above id 255
  2. Adds the ability to assign weights to weaponskills for entities like Trusts; these weights will default to 1 unless specifically assigned in the mob object upon spawning. This is currently handled via lua. See the included Valaineral.lua for an example.
  3. When the weighted_ws option is used, the entity will prefer weaponskills that are available in their weighted table that will result in the strongest possible skillchain. Not all Trusts behave this way, but this provides the wiring to implement this behavior for those that do.
  4. Provides a significant overhaul of the Valaineral trust; adds retail modifiers to stats, missing gambits, spells, and the special behavior surrounding use conditions and tp modifier for Uriel Blade. Also adds a commented-out effect that restores Valaineral's additional effect light damage for those who want to enable it. This was very potent prior to the enlight days, and may be useful for 75 cap / era custom content.

My changes were tested against a fresh Release x64 build pulled and compiled on 2026-03-31.

Steps to test these changes

For the weighted_ws modifications, you can modify any trust you like to include a weighted_ws table, and a gambit to make use of ai.s.WEIGHTED_WS, launch the server, summon that trust, and observe their weaponskill behavior. Reference Valaineral.lua for an example of how to add weights.

For the useWeaponSkill(), this is best demonstrated with Valaineral. Summon Valaineral, engage a mob and swing so Valaineral engages. Unlock from your target and use a spell or job ability (or another means of engaging) another mob. Bring that mob near Valaineral and watch him use Uriel Blade. The logic follows retail as closely as I'm aware of at this time.

Screenshots below are from tests performed against Wajaom Woodlands Lesser Colibri at level 75.

image image image image

@lefneer311 lefneer311 changed the title Fix Trust WS and Valaineral [lua, sql, cpp] Add weighted weaponskill for trusts, useWeaponSkill on entity, and Valaineral updates Apr 4, 2026
@Xaver-DaRed Xaver-DaRed added squash Reminder to squash commits before/on merge (you can do this, or maintainers will do this for you) hold On hold, pending further action/info and removed squash Reminder to squash commits before/on merge (you can do this, or maintainers will do this for you) labels Apr 5, 2026
@lefneer311
Copy link
Copy Markdown
Contributor Author

@Xaver-DaRed - are there any adjustments needed on this one?

@sruon
Copy link
Copy Markdown
Contributor

sruon commented Apr 8, 2026

@Xaver-DaRed - are there any adjustments needed on this one?

CI is failing due to duplicate spells and certain clang-tidy issues. I suggest you click on the failed checks at the bottom of the PR page and review the logs carefully.

@lefneer311
Copy link
Copy Markdown
Contributor Author

@Xaver-DaRed - are there any adjustments needed on this one?

CI is failing due to duplicate spells and certain clang-tidy issues. I suggest you click on the failed checks at the bottom of the PR page and review the logs carefully.

Ah! I see what happened. Thank you for the gentle pointer toward the obvious.

@lefneer311 lefneer311 force-pushed the base branch 2 times, most recently from d7f1581 to 9e922dd Compare April 10, 2026 17:51
@lefneer311
Copy link
Copy Markdown
Contributor Author

Prior to my force-push today, I pulled a fresh copy of LSB/server:base and made the same edits I had staged in my development fork (including those called out by clang), recompiled, and re-tested to confirm they were still valid. Everything tested successfully locally with a 20260410 pull.

@lefneer311
Copy link
Copy Markdown
Contributor Author

PR #9718 ironically modified several of the same files in a similar fashion. Converting to draft to review and resolve conflicts.

@lefneer311 lefneer311 marked this pull request as draft April 11, 2026 21:30
@lefneer311 lefneer311 closed this Apr 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hold On hold, pending further action/info

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants