Yagababa
Regular
Hey all,
I'm trying to make a 'cursed doubloon' item--when you receive a fatal blow, it gets removed from your inventory, you're restored to full hp and become a skeleton. It all works great except for that last bit, I'm having a hard time figuring out how to switch out armor via a script. Here's what I have:
Is there a different way to force an armor change mid-fight?
I'm trying to make a 'cursed doubloon' item--when you receive a fatal blow, it gets removed from your inventory, you're restored to full hp and become a skeleton. It all works great except for that last bit, I'm having a hard time figuring out how to switch out armor via a script. Here's what I have:
Code:
# Cursed Doubloon Check
(try_for_range, ":i", ek_item_0, ek_head),
(agent_get_item_slot, ":item", ":agent_no", ":i"),
(eq, ":item", "itm_cursed_doubloon"),
(try_begin),
(store_agent_hit_points, ":hp", ":agent_no", 1),
(gt, ":damage", ":hp"),
(agent_set_hit_points, ":agent_no", 100, 0),
(agent_unequip_item, ":agent_no", "itm_cursed_doubloon"),
# Problem Area
(agent_get_item_slot, ":agent_helmet", ":agent_no", 4),
(agent_get_item_slot, ":agent_armor", ":agent_no", 5),
(agent_get_item_slot, ":agent_boots", ":agent_no", 6),
(agent_get_item_slot, ":agent_gauntlets", ":agent_no", 7),
(agent_unequip_item, ":agent_no", ":agent_helmet"),
(agent_unequip_item, ":agent_no", ":agent_armor"),
(agent_unequip_item, ":agent_no", ":agent_boots"),
(agent_unequip_item, ":agent_no", ":agent_gauntlets"),
(agent_equip_item, ":agent_no", "itm_skeleton_skull"),
(agent_equip_item, ":agent_no", "itm_skeleton_body"),
(agent_equip_item, ":agent_no", "itm_skeleton_feet"),
(agent_equip_item, ":agent_no", "itm_skeleton_hands"),
# End Problem Area
(set_trigger_result, 0),
(try_end),
(try_end),
Is there a different way to force an armor change mid-fight?