Code: Select all
r_item_use_new_status 1 $STATUS_HEALTH -0.2 1
This line is incorrect, this command is meant to refer to a statusgroup, not a status effect itself.
The full prototype of that command is "START(new_status, "iif", (int *st, int *el, float *m),". That means in order, it takes 3 arguments which are "statusgroup," "element" and "multiplier".
You're halfway there, to making the best potions you can at the moment.
First, you'll need to create a new ammotype, which contains only that item.
then, you will need to make the "spell" expend one (aka, _cost 1) and use this ammotype.
In the end result, you should be able to equip a potion, which you can use on yourself.
Doing so grants you the healing (or whatever) effect of the potion and removes one instance from your inventory.
Unless the only copy you have is equipped.
That should do it, though you may want to change the associated skill to SKILL_NONE, unless you intend a person's magical affinity to play a major role in your game (eg Arcanum).
I think resistance/threshold only applies to effects deemed hostile, I'm not too sure right now. Just in case you may want to use the element, ATTACK_NONE so it doesn't get filtered.