How do I make an NPC hurt the hero?

From OHRRPGCE-Wiki
Jump to: navigation, search

Set the NPC activation to "Touch" and set it to run a script like this one:

plotscript, hurt me 20, begin
  tweak palette (20, 0, 0) #he's been hurt, so flash the screen red to show that
  update palette
  wait (2)
  set hero stat(me, stat:HP, get hero stat(me, stat:HP, current stat) -- 20, current stat) #this sets the HP

  reset palette
  update palette
end

This example decreases the hero HP by 20. Don't forgot to change stat:HP if you've renamed the HP stat.

Also, you don't necessarily need to hurt the lead hero (me); you can hurt another hero by specifying their place in the party instead of me.

If you want to hurt everyone in the party, you can copy and paste the set hero stat line four times, once for each party member. (Or, you could use a loop. But, that's beyond the scope of this article.)