Skip to content

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

Open
lefneer311 wants to merge 1 commit intoLandSandBoat:basefrom
lefneer311:base
Open

[lua, sql, cpp] Add weighted weaponskill for trusts, useWeaponSkill on entity, and Valaineral updates#9708
lefneer311 wants to merge 1 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

Implements weighted TP skill selection and integrates it into
gambits and Lua bindings.  Significantly expands Valaineral (trust) logic toward retail parity.

- Adds weighted WS storage and selection logic
- Exposes weighted WS handling to Lua
- Updates Valaineral to use weighted WS behavior
- Includes supporting SQL changes for skills and spells
@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) 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
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