I made an Item that is supposed to permanently alter stats, but every time I use a recovery item it gets undone, why?

From OHRRPGCE-Wiki
Jump to navigationJump to search

This is a vague question because there are several way to make an item that changes a stat.

If you make an attack that alters a stat, and attach that attack to an item, you can change the target's stat by using the item on them.

Inside Battle[edit]

If the item is used inside battle, the effect will always be temporary. There is no way to make permanent stat alterations in battle.

Outside Battle[edit]

If you make the item usable outside of battle, the effect will be permanent.

With a plotscript[edit]

The last argument of the set hero stat command tells whether to change the current stat or the maximum stat. For the purposes of a script that changes a stat, you probably want to do both

variable(who)
who := find hero (hero:Bob)
variable(old stat)
old stat := get hero stat(who, stat:strength, maximum stat)
set hero stat(who, stat:strength, old stat + 10, maximum stat)
set hero stat(who, stat:strength, old stat + 10, current stat)

See Also[edit]