Hello! I would want to know if there exists a plugin or a script that allows to make a special state, in which a party member
can use an item from inventory without losing it. Something like:
- char is inflicted with {this state}
- char uses one of his 10 potions to heal
- restores hp
- still has 10 potions
Thank you on advance.
there are items that can lose items, but gain 1 item upon using it.
but it require YEP_BuffStateCore and a lunatic code.
while I use it for something, I need don't know much of it's coding.
but it very doable with that plugin.
otherwise, there should be a snipped on consume item, that check
the items ID or notetag to not lose items as long you have that state.
there are a few ways to accomplish this, but does using an item lose turns?
as I have consume item with eval, you can create an eval tag on it's state check.
when true, use 1 or do not (only I didn't test this though).
My javascript knowledge isn't good enough to pull this off without looking it up (which I will do after writing this reply, might edit this reply later) but you can use javascript in the items battle formula. Or in this case, healing formula. I mean, I know the steps, but not the code.
You make an if statement to check for the state, then if true, you add the item back into the inventory. Then you do ; and then the actual healing formula.
This will add the item silently, so the player would have no idea that it even left the inventory.
however.... I do not know if the item is removed before, or after the action is performed. If it is after, then there is one kickup: When 10 potions is the max, the item will not be added before it is removed, resulting in the player losing one item only when their inventory is maxed out.
This is set to 99 by befault, so might not be a huge problem, but it will be if the max is low like 10 or even 3, specially if you can only carry 1. (because then you'd lose your last item and it will never be replaced)
I assume the item will be removed first, and then the action is performed. And if that is indeed the case, there is no problem. But just in case, I would test this out before I would build a whole mechanic around it.