Add weighted weaponskill selection for trusts#9766
Add weighted weaponskill selection for trusts#9766lefneer311 wants to merge 2 commits intoLandSandBoat:basefrom
Conversation
Implements weighted weaponskill selection logic and integrates it into gambits and Lua bindings. Significantly expands Valaineral (trust) logic toward retail parity. Includes: - Weighted WS storage and selection in gambits container - Lua exposure via CBaseEntity and lua_baseentity - Updates to Valaineral behavior to use weighted WS - Updates to Valaineral behavior to include shield block, parry, traits, and mods - Updates to Valaineral behavior for special Uriel Blade usage - Supporting SQL updates for skill and spell lists
You're going to need to provide evidence of this. While I'm sure this is true, it isn't documented anywhere, so you'll need to be the one to provide the documentation.
Target selection and entity iteration cannot be done in Lua, the performance cost is too great and we should always be pushing this sort of thing down into C++. |
@zach2good - thank you for the response - I've had this (and the prior PR) pending for some time. Will you point me toward examples of sufficient evidence for how a trust behaves? I'll also work on moving that behavior to C++. To get it to work just right in Lua was challenging, though, and took 6 or 7 completely different approaches before I landed on this one that checked all the boxes. Before I spend more time on this, how likely is it to be merged? It may be that there's a more obvious way to accomplish this already in C++. If anyone has recommendations there, I'll certainly take them. |
I affirm:
What does this pull request do?
Implements weighted weaponskill selection logic and integrates it into gambits and Lua bindings. Significantly expands Valaineral (trust) logic toward retail parity.
Includes:
These changes were modified to work with PR #9718
Tested with a fresh pull of LSB\server:base on 20260411
Steps to test these changes
Valaineral is the best Trust to use for testing this PR.
Summon Valaineral and engage mob A until Valaineral engages mob A. Use an ability or spell to attract mob B; use several abilities to establish a decent amount of threat if you want to test Valaineral's Uriel Blade spamming a la retail. Bring mob B nearby Valaineral - as soon as it is in melee range of Valaineral, he should use Uriel Blade in an attempt to pull enmity on all nearby mobs. Notice that Valaineral's Uriel Blade damage behaves as if he has 1000TP when he triggers it under 1000TP, but acts normally above 1000TP.
For the WEIGHTED_WS testing - manipulate Valaineral's weighted weaponskill table. Engage mobs with Valaineral and notice his weaponskill choices align with the assigned weights. Change them to extremes, such as savage blade 99 and all others 1. This should result in almost exclusive use of savage blade. Then change savage blade to 1 and set sanguine blade to 99. Repeat testing.
Other changes to Valaineral will be noticeable throughout regular usage -
Uses Majesty before casting Protect or Cure spells if it is available
Uses Divine Emblem if it is available before casting flash (this isn't true when initially engaging a mob immediately after summoning)
Uses Protect, Cure, Phalanx, Reprisal, and Enlight
Uses Rampart in special circumstances (astral flow, chain spell, etc.)
Uses Sentinel and Palisade, but not together
Screenshots below are from tests performed against Wajaom Woodlands Lesser Colibri at level 75.