poison1 = (
ti_on_agent_spawn, 0, 0, [],
[
(store_trigger_param_1,":victim"),
(agent_set_slot,":victim",agent_poisoned,0),
(agent_set_slot,":victim",agent_poison_damage,0),
(agent_set_slot,":victim",agent_poison_wear_off,0),
])
poison2 = (
ti_on_agent_hit, 0, 0, [],
[
(store_trigger_param_1,":victim"),
(store_trigger_param_2,":attacker"),
(assign, ":attacker_item", reg0),
(agent_get_team, ":enemy_team", ":attacker"),
(agent_get_team, ":team", ":victim"),
(neq,":team", ":enemy_team"),
(is_between, ":attacker_item", "itm_assassin_bow_weakest", "itm_assassin_archer_basic_armor"),
## (store_random_in_range, ":poison_timing", 2, 3),
## (agent_set_slot,":victim",agent_poisoned,":poison_timing"),
(agent_set_slot,":victim",agent_poisoned,3),
(store_random_in_range, ":poison_wear_off", 12, 15),
(agent_set_slot,":victim",agent_poison_wear_off,":poison_wear_off"),
(agent_get_slot, ":poison_damage", ":victim", agent_poison_damage),
(val_add, ":poison_damage", 3),
(val_max, ":poison_damage", 12),
(agent_set_slot,":victim",agent_poison_damage,":poison_damage"),
])
poison3 = (
0.25, 0, 0, [],
[
(try_for_agents, ":cur_agent"),
(agent_is_human, ":cur_agent"),
(agent_is_alive, ":cur_agent"),
(agent_get_slot, ":poisoned", ":cur_agent", agent_poisoned),
(agent_get_slot, ":poison_duration", ":cur_agent", agent_poison_wear_off),
(try_begin),
(gt, ":poison_duration", 0),
(val_sub, ":poisoned", 1),
(agent_set_slot,":cur_agent",agent_poisoned,":poisoned"),
(val_sub, ":poison_duration", 1),
(agent_set_slot,":cur_agent",agent_poison_wear_off,":poison_duration"),
(else_try),
(agent_set_slot,":cur_agent",agent_poisoned,0),
(agent_set_slot,":cur_agent",agent_poison_wear_off,0),
(agent_set_slot,":cur_agent",agent_poison_damage,0),
(try_end),
(gt, ":poison_duration", 0),
(assign, reg1, ":poison_duration"),
(display_message, "@poison_wear_off: {reg1}"),
(assign, reg2, ":poisoned"),
(display_message, "@poison_timer: {reg2}"),
(try_begin),
(eq, ":poisoned", 1),
#begin to damage troop
(store_agent_hit_points, ":hp", ":cur_agent", 0), #percent
(agent_get_slot, ":poison_damage", ":cur_agent", agent_poison_damage),
(val_sub, ":hp", ":poison_damage"),
(agent_set_hit_points, ":cur_agent", ":hp", 0), #again, 0 param = relative
(try_begin),
(lt, ":hp", 2),
(agent_deliver_damage_to_agent,":cur_agent",":cur_agent"),
(try_end),
(agent_get_position, pos1, ":cur_agent"),
(position_move_z, pos1, 85), #makes the blood higher, otherwise it's on ground level
(position_move_x, pos1, -32), #makes the blood out from the torso towards the arm stump
(position_move_y, pos1, 16), #makes the blood come out severed stump
(position_rotate_x, pos1, -70), #makes the blood spurt downwards
(particle_system_burst, "psys_game_blood_2", pos1, 80), #100 as power.
(store_random_in_range, ":poison_timing", 4, 6),
(agent_set_slot,":cur_agent",agent_poisoned,":poison_timing"),
(display_message, "@poison deals damage"),
(agent_get_horse, ":horse", ":cur_agent"),
(eq, ":horse", -1), #No horse.
(agent_set_animation, ":cur_agent", "anim_handchop"),
(try_end),
(try_end),
])