LandSandBoat / server

:sailboat: LandSandBoat - a server emulator for Final Fantasy XI
https://landsandboat.github.io/server/
GNU General Public License v3.0
301 stars 607 forks source link

🐛 Trust cure logic #5145

Open noisiver opened 9 months ago

noisiver commented 9 months ago

I affirm:

Describe the feature

Healer-specific trusts, such as Mihli Aliapoh, should use their cures with some logic to it. Instead of always using the highest possible tier of cure it should be based on missing health of whoever they're casting it on. If the one they deem the most viable isn't ready I'm not sure what the logic would be but a guess would be to go up in ranks.

To show a little bit of what I mean, check out how Mihli Aliapoh does her heals during the fight with Dynamis Lord - the video is not mine but it illustrates my point.

https://www.youtube.com/watch?v=_HrgdeqRLYg

During the entire fight, looking only at the spells Mihli is using, it goes Cure IV -> IV -> V -> VI.

I can't be certain but I imagine most, if not all, trusts who cast cures should use this kind of logic when doing so.

I'm honestly not sure if this should be a feature request or a bug report, the trusts work but could use some AI additions, but since it's essentially a "they're not working as they should" I changed it to a bug report.

zach2good commented 9 months ago

So, the way these were implemented was "by feel", rather than by comparing to exactly how each trust acts on retail.

https://github.com/LandSandBoat/server/blob/b51a503ebd83a2b42468fd88091fc323b2649d33/scripts/actions/spells/trust/mihli_aliapoh.lua#L35

It's a difficult problem to solve, because the spells that are available for a trust to use change as they level, and as their MP changes. Interestingly, "by how much health is missing" is how Monberaux operates with his special healing skill/items:

https://github.com/LandSandBoat/server/blob/b51a503ebd83a2b42468fd88091fc323b2649d33/scripts/actions/spells/trust/monberaux.lua#L31-L34

I think it HAS been observed that certain trusts demonstrate an awareness of being MP-efficient and not heal-bombing their targets, but we don't have that sort of thing programmed in yet.

noisiver commented 9 months ago

I assumed the current system makes it hard to implement this kind of thing, at least easily.

I couldn't find anyone mentioning this as an issue so I figured I'd bring up anyway. It's not a major issue, more like a suggestion for improvements on the current way they function. They just waste a whole load of mana but it's not hard to plan accordingly for the time being. Sacrifice some damage output for extra refresh and ballad.

I did look into implementing it myself, hopefully to be able to submit a PR for it, but I hit a brick wall. I don't fully understand how it all works yet and my skill in C++ isn't good enough to easily learn it.

I was playing around with multiple gambits for percentages of health too, like with monberaux, but the major downside to that is that it won't work with cures on cooldown and could also have other issues. It would also have to be tested if it's percentage or actual health that determines the spell used. A Galka PLD would obviously be missing a bunch more health at 75% than say a Tarutaru BLM.

Barthandalus commented 8 months ago

I assumed the current system makes it hard to implement this kind of thing, at least easily.

I couldn't find anyone mentioning this as an issue so I figured I'd bring up anyway. It's not a major issue, more like a suggestion for improvements on the current way they function. They just waste a whole load of mana but it's not hard to plan accordingly for the time being. Sacrifice some damage output for extra refresh and ballad.

I did look into implementing it myself, hopefully to be able to submit a PR for it, but I hit a brick wall. I don't fully understand how it all works yet and my skill in C++ isn't good enough to easily learn it.

I was playing around with multiple gambits for percentages of health too, like with monberaux, but the major downside to that is that it won't work with cures on cooldown and could also have other issues. It would also have to be tested if it's percentage or actual health that determines the spell used. A Galka PLD would obviously be missing a bunch more health at 75% than say a Tarutaru BLM.

So, I put this together. at 99 mihli was started curing around 75-80% hp. at level 1 she cured around 70% so its pretty average to the 75% HP_LT thats in there now. put this into a module for your WHMs and they will use more efficient midrange cures.

This is a band-aid until someone grabs this and reworks the core for similar gains.

Basically, at 99 they won't use a cure 6 unless the total Hp loss is more than 798.

Tried to hit the middle of the HP floor in the Cure formula.

https://www.bg-wiki.com/ffxi/Cure_Formula

image


    local mLvl    = mob:getMainLvl()
    local cureMod = mLvl * 2
    mob:addSimpleGambit(ai.t.PARTY, ai.c.HP_MISSING, 600 + cureMod, ai.r.MA, ai.s.SPECIFIC, xi.magic.spell.CURE_VI)
    mob:addSimpleGambit(ai.t.PARTY, ai.c.HP_MISSING, 450 + cureMod, ai.r.MA, ai.s.SPECIFIC, xi.magic.spell.CURE_V)
    mob:addSimpleGambit(ai.t.PARTY, ai.c.HP_MISSING, 270 + cureMod, ai.r.MA, ai.s.SPECIFIC, xi.magic.spell.CURE_IV)
    mob:addSimpleGambit(ai.t.PARTY, ai.c.HP_MISSING, 130 + cureMod, ai.r.MA, ai.s.SPECIFIC, xi.magic.spell.CURE_III)
    mob:addSimpleGambit(ai.t.PARTY, ai.c.HP_MISSING, 60 + cureMod, ai.r.MA, ai.s.SPECIFIC, xi.magic.spell.CURE_II)
    mob:addSimpleGambit(ai.t.PARTY, ai.c.HP_MISSING, 10 + cureMod, ai.r.MA, ai.s.SPECIFIC, xi.magic.spell.CURE)
    --mob:addSimpleGambit(ai.t.PARTY, ai.c.HPP_LT, 50, ai.r.MA, ai.s.HIGHEST, xi.magic.spellFamily.CURE)