Pumpkin Lord
The following script introduces a good ol' combat mechanic, allowing to lure soldiers to yourself in a certain distance depending on your ironflesh skill.
In most of the RPG and action games, it is a common fact that there is needed a "tank" to take the aggro while others playing their own roles in the party. Well, it is one of those perks a tank needs most.
Basically, it works like...you cast the spell (Has a cooldown of 3 minutes.), runs a poor "skl_ironflesh" comparison to enhance the taunting range before actually firing and depends on the ironflesh skill you have, so will the range be wider and more mobs to lure at yourself.
mission_template code
There is one known issue with placement of lured troops really. I will fix that when I have the time. While at it, I will soon put up a gameplay video.
Enjoy.
In most of the RPG and action games, it is a common fact that there is needed a "tank" to take the aggro while others playing their own roles in the party. Well, it is one of those perks a tank needs most.
Basically, it works like...you cast the spell (Has a cooldown of 3 minutes.), runs a poor "skl_ironflesh" comparison to enhance the taunting range before actually firing and depends on the ironflesh skill you have, so will the range be wider and more mobs to lure at yourself.
mission_template code
Code:
#Taunting system
common_taunting_system = (
0, 0, 180, [(key_clicked, key_o),],
[
(get_player_agent_no, ":cool_man"),
(agent_get_troop_id, ":cool_trp", ":cool_man"),
(store_skill_level, ":i_skl_level", "skl_ironflesh", ":cool_trp"),
(agent_get_position, pos1, ":cool_man"),
(assign, ":t_value", 100),
(try_begin),
(eq, ":i_skl_level", 1),
(assign, ":t_value", 150),
(else_try),
(eq, ":i_skl_level", 2),
(assign, ":t_value", 200),
(else_try),
(eq, ":i_skl_level", 3),
(assign, ":t_value", 250),
(else_try),
(eq, ":i_skl_level", 4),
(assign, ":t_value", 300),
(else_try),
(eq, ":i_skl_level", 5),
(assign, ":t_value", 350),
(else_try),
(eq, ":i_skl_level", 6),
(assign, ":t_value", 400),
(else_try),
(eq, ":i_skl_level", 7),
(assign, ":t_value", 450),
(else_try),
(eq, ":i_skl_level", 8),
(assign, ":t_value", 500),
(else_try),
(eq, ":i_skl_level", 9),
(assign, ":t_value", 550),
(else_try),
(eq, ":i_skl_level", 10),
(assign, ":t_value", 600),
(try_end),
#(val_add, ":t_value", 3000), #DEBUG
(assign, reg0, ":t_value"),
(try_for_agents, ":taunted"),
(agent_get_position, pos2, ":taunted"),
(get_distance_between_positions, ":t_distance", pos1, pos2),
(le,":t_distance", ":t_value"),
(agent_is_alive, ":taunted"),
(neg|agent_is_ally, ":taunted"),
(agent_force_rethink, ":taunted"),
(agent_clear_relations_with_agents, ":taunted"),
(agent_set_is_alarmed, ":taunted", 0),
(agent_set_look_target_agent, ":taunted", ":cool_man"),
(try_begin),
(agent_is_alive, ":cool_man"),
(agent_add_relation_with_agent, ":taunted", ":cool_man", -1),
(agent_set_is_alarmed, ":taunted", 1),
(agent_set_scripted_destination, ":taunted", pos1),
(try_end),
(try_end),
#(agent_get_number_of_enemies_following, ":t_taunted", ":cool_man"),
#(assign, reg1, ":t_taunted"),
(display_message, "@ Taunt launched. {reg0} is the taunt range."),
])
There is one known issue with placement of lured troops really. I will fix that when I have the time. While at it, I will soon put up a gameplay video.
Enjoy.