(
ti_on_agent_killed_or_wounded, 0, 0, [],
[
# 1. GATHER DATA
(store_trigger_param_1, ":dead_agent"),
(store_trigger_param_2, ":killer_agent"),
(agent_get_troop_id, ":dead_agent_trp", ":dead_agent"),
(neg|troop_is_hero, ":dead_agent_trp"),
(agent_get_wielded_item, ":killer_weap", ":killer_agent"),
(item_get_swing_damage_type, ":swing_type", ":killer_weap"),
(item_get_thrust_damage_type, ":thrust_type", ":killer_weap"),
# 2. KILL/WOUND CHANCE
# 2.1 BLUNT KILL CHANCE
(try_begin),
(this_or_next|eq, ":swing_type", 2), # 2 = blunt
(eq, ":thrust_type", 2), # 2 = blunt
(store_random_in_range, ":blunt_kill_chance", 1, 4),
(eq, ":blunt_kill_chance", 1), # 25% chance to kill
(set_trigger_result, 1), # 1 = force kill
# 2.2 CUT/PIERCE WOUND CHANCE
(else_try),
(this_or_next|neq, ":swing_type", 2), # NOT BLUNT
(neq, ":thrust_type", 2), # NOT BLUNT
(store_random_in_range, ":cut_pierce_wound_chance", 1, 8),
(eq, ":cut_pierce_wound_chance", 1), # 12.5% chance to wound
(set_trigger_result, 2), # 2 = force wounded
(end_try),
]),