How to auto-heal with spells inbetween combat?

This is probably a pretty basic question. I apologize if it is dumb.

So, I love my stocking mimic. With it, I always have tons of mana available. Bittersweet tarts give me stat boosts, polka boosts itemfind. Its great for a relatively new player.

The question is: How can I 'top off' my health if it is below 90% by casting Disco Nap? (NOT doing the automatic rest but by napping)

Most of the restore options are centered around items and I wouldnt wanna use my brand new VIP key to restore only a few HPs.

So ideally, inbetween combat, it would decide if I am between 50% and 90% of health, I would use Power Nap (in a loop) if I have enough mana.
If under 50%, I'd use the Hot Tub.

If I was writing an ash script to adventure in a specific location, I could do this no problem. Ive already done similar stuff with under the sea scripts and a basic slime script.
However, I want this to be kind of a basic setting for general mafia usage for the next 10 days or so.

Can I set up a mood or two to do this? Moods seem to be based on Conditions as triggers, so I wouldnt know how to check for a HP level.

Is there some kind of inbetween battle script I could use to do this (kinda like Bale's) and set mafia to use my script inbetween fights?


Thanks!
 

slyz

Developer
You can write a recovery script. Check Bale's Universal Recovery to see how a recovery ash script is called in mafia.

You would then simply need to check if you are under 50% of your max HP or not, check if you have enough mana to cast Disco Power Naps or use the hot tub.

Mafia will call the script when it needs to recover HP or MP. If you only want to take care of the HP part and let mafia handle the MP part, it's possible too (check this thread for an example of this).
 

Bale

Minion
I'm attaching a recovery script that will do exactly what you want. Consider it a thanks for creating the noob guide.

Put it in your /script directory, then download Universal_recovery and put it in your /script directory also, since it is imported as a library of recovery functions.

Code:
set recoveryScript = SinginSally_recovery

Actually I think that Universal_recovery alone will probably meet your needs just by setting recovery target at 90% and recovering if less than that, but this will do exactly what you requested.
 
Last edited:
Thanks Bale! Yer my hero. :)

I actually didn't realize that the Mafia built-in recovery would also CAST Disco Nap as well as do the 'free' rest aspect of the skill. So I just had to set the HP recovery to abort on fail, and cast Disco at 90% and recover to 95% (to prevent casting to heal 1 HP).

Of course, YOUR version is tons better in that I can make better use of my Hot Tub. Also, I can add a check for Beaten Up or Poisoned without having to set up a bunch of Moods to handle it. That way I can properly uneffect these conditions or abort.
 

slyz

Developer
Universal Recovery already the poison and beaten up check. Since the script Bale posted for you already imports UR, you can add unpoison() and
Code:
if(have_effect($effect[Beaten Up])>0)
	cure_beatenup(amount);
in the main()
( although cure_beatenup() will use the hot tub! )
 
Last edited:

Bale

Minion
Actually, that function requires that other functions be called which made me notice that my original version of this script has a bug. Here's the fixed version for you which will also take care of poisoning and Beaten Up.

( although cure_beatenup() will use the hot tub! )

Since 0% HP is less than 50% I don't consider that to be a problem. :)
 

Attachments

  • SinginSally_recovery.ash
    1.7 KB · Views: 35

Bale

Minion
Okay, there are a few ways to get Beaten Up without reaching 0 HP...

I guess slyz belongs in the corner with Baby.
 
Top