Page 1 of 1

Scripting abilities to trigger on death

PostPosted: Sun May 21, 2023 4:18 pm
by Fungeon_Master
I'm looking to spice up the zombies and add the ability Undead Fortitude.

Undead Fortitude. If damage reduces the zombie to 0 hit points, it must make a Constitution saving throw with a DC of 5 + the damage taken, unless the damage is radiant or from a critical hit. On a success, the zombie drops to 1 hit point instead.

I realise that it may not be possible to script it exactly but I would like to be able to make the zombies at least have a chance to get back up with 1 hp.

Here's what I have so far:

Create variable   . Roll to Determine if Undead Fortitude Triggers   0
Assign die roll to variable   . Roll to Determine if Undead Fortitude Triggers  20
If variable   . Roll to Determine if Undead Fortitude Triggers  Is above or equal to the number  8
If character has condition    Test_Zombie_0001  Dead
Give condition   Remove from  Test_Zombie_0001  Dead  Rounds  0   0  0
End if 
Set HPs   Zombie_0001  1
End if
End script

Any help would be appreciated.

Re: Scripting abilities to trigger on death

PostPosted: Sat May 27, 2023 5:46 pm
by BlueSalamander
Hello Fungeon_Master :)

First off, zombies don't have a good constitution - traditionally they don't have a constitution score, but in the game all creatures have a constitution score, so I gave them a score of 10. So anyway, they wouldn't get any bonus on a fortitude save.

Now about your request, I think that something like that would have to be hard coded.

With a Wounded Script, you could do something like the following:

Code: Select all
If the creature's Hit Points are below 10
{
     Set in variable X the result of a Fortitude saving throw (or strength ability check)
     If variable X is above the difficulty class then
     {
           Set the creature's Hit Points to 10
     }
}

That means whenever its HP would drop to between 1 and 10, it will get a chance to immediately recover to 10 HPs.

BTW 'Remove Condition - Dead' is not how you bring creatures into combat (or resurrect them). You have to use the script command that adds a new combatant to the fight.

To resurrect a creature after combat, you can use the 'Apply Temple Healing' command to the creature.

Best regards 8-)