As Chaosium mentioned, Raise Dead will probably be the best candidate for what you want.
Set following data of the spell like this:
- 'Data - Units Summoned (Type xyz)' fields to 0 to not summon anything
- 'Stats - Cast Time' to however long the spell should last
- 'Stats - Cast Range' to some low number like 20.0
This setup will cause the unit to run towards a corpse until it is within 20.0 range, then just stand nearby doing nothing and after X seconds of 'Cast Time', it will start the actual spell, summoning exactly 0 unit, so the corpse just disappears.
When testing this, the only downside was that the caster had to be within ~400.0 range of the corpse, otherwise the spell just wrote that there are no corpses nearby.
The rest will need to be triggered. You can use trigger like this to detect when unit starts the cast time:
-
Eat Corpse Start
-
Events
-
Unit - A unit Begins channeling an ability
-
Conditions
-
(Ability being cast) Equal to Eat Corpse
-
Actions
-
Animation - Add the channel animation tag to (Triggering unit)
In my test map, I had a ghoul, so this trigger just starts playing ghoul's eating animation. In your case, you should start some kind of timer that will periodically increase triggering unit's mana.
You can use this event to determine if unit successfully finished the spell (in other words, if it waited the entire duration set by 'Cast time'):
-
Unit - A unit Begins casting an ability
and also use this to determine when the spell stopped:
-
Unit - A unit Stops casting an ability
However note that the 'stop' event will fire when unit successfully finished the spell (but it will fire always after the 'Begins casting' event) AND if unit has been interrupted (i.e. stunned).