forked from DFHack/scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresurrect-adv.lua
31 lines (23 loc) · 1.02 KB
/
resurrect-adv.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
-- Bring your adventurer back to life.
-- author: Atomic Chicken
-- essentially a wrapper for "full-heal.lua"
--[====[
resurrect-adv
=============
Brings a dead adventurer back to life, fully healing them
in the process.
This script only targets the current player character in
your party, and should be run after being presented with
the "You are deceased" message. It is not possible to
resurrect the adventurer after the game has been ended.
]====]
local fullHeal = reqscript('full-heal')
if df.global.gamemode ~= df.game_mode.ADVENTURE then
qerror("This script can only be used in adventure mode!")
end
local adventurer = df.nemesis_record.find(df.global.ui_advmode.player_id).unit
if not adventurer or not adventurer.flags2.killed then
qerror("Your adventurer hasn't died yet!")
end
fullHeal.heal(adventurer, true)
df.global.ui_advmode.player_control_state = 1 -- this ensures that the player will be able to regain control of their unit after resurrection if the script is run before hitting DONE at the "You are deceased" message