EDIT: hmm this is a completed script lol wrong forum

Soul Breaker
Tsukihime

Introduction

Want zombies? Spirits? Maybe you can use a state.

By default, when your HP goes down to 0, you die.
This script makes it so that you have the possibility of going into "soul" state. Zombie mode?

When you're in this state, you cannot be killed (because you are already "dead"), but after a certain amount of time, the effect will wear off and you will fully recover.

However, if soul state is broken (eg: removed) before it expires, you will really die.
This means that if you attacked someone for large amounts of damage with soul-break effect, they will die because the attack will kill them, and the soulbreak effect will occur because they will go into soul state.

Usage

This script requires some manual set up on the database side

-create a new state. Call it "soul" or something.
-For every enemy/actor that should go into soul state when HP is 0, type <soul_type=soul> into the notebox
-For each item/skill that you want to have "soul breaker" effect, add "remove soul state" effect

Now go to the script and configure "Soul_State_Id" to point to the appropriate state, by ID.

For the notebox, if you don't want to use the name "soul" you can change it to something else as well, but you still need to type <soul_type=...>

Script

Script: http://db.tt/AVM8qHST
Demo: http://db.tt/oa9biWpA

Bugs

-When "soul break" is performed, the state removal message is still executed, even if it doesn't make sense.

Compatibility

I override one method that monitors the player's HP and sets the state accordingly (add death, remove death).
Everything else is aliased.