Theoris
And pos0 instead of pos1, yeah.
Star Wars Conquest is a singleplayer mod, though.. if he's working on that.
Star Wars Conquest is a singleplayer mod, though.. if he's working on that.
#Minimum damage for horse tramples
(try_begin),
(eq, reg0, -1),
(troop_get_inventory_slot,":horse",":attacker_troop",ek_horse),
(gt, ":horse", 0),
(troop_has_item_equipped,":attacker_troop",":horse"),
(try_begin),
(is_between, ":horse", "itm_light_horse_start", "itm_light_horse_end"),#special def in Blood and Steel source
(val_max, ":damage", 25),
(else_try),
(is_between, ":horse", "itm_medium_horse_start", "itm_medium_horse_end"),#special def in Blood and Steel source
(val_max, ":damage", 45),
(else_try),
(val_max, ":damage", 65),#Pretty much insta-kill
(try_end),
(try_end),
Apparently, yeah. Horses that don't have riders don't- they're apparently Agents armed with... themselvesSo, even when the horse charge calls the trigger, it marks the human agent as the "attacker"/"damager" ?
What if a mounted knight gets dismounted and punches someone? Wouldn't the above code execute (agent being dismounted doesn't change troop item slots)?xenoargh said:Here's the horse code.
Code:#Minimum damage for horse tramples (try_begin), (eq, reg0, -1), (troop_get_inventory_slot,":horse",":attacker_troop",ek_horse), (gt, ":horse", 0), (troop_has_item_equipped,":attacker_troop",":horse"), (try_begin), (is_between, ":horse", "itm_light_horse_start", "itm_light_horse_end"),#special def in Blood and Steel source (val_max, ":damage", 25), (else_try), (is_between, ":horse", "itm_medium_horse_start", "itm_medium_horse_end"),#special def in Blood and Steel source (val_max, ":damage", 45), (else_try), (val_max, ":damage", 65),#Pretty much insta-kill (try_end), (try_end),
(agent_get_horse, ":horse_agent", ":attacker"),
(ge, ":horse_agent", 0),
(agent_get_item_id, ":horse_item", ":horse_agent"),
The code executes, but I was testing a split for fist weapons / katars, using that to branch with. I guess I can just do a check on wielding 0 instead. Your rewrite may be a smarter way to go on that, I'll check and make sure it still works.What if a mounted knight gets dismounted and punches someone? Wouldn't the above code execute?
I think you mean the defender successfully blocks.....SonKidd said:if the attacker successfully blocks the attack, the on_agent_hit trigger isn't triggered right?
xenoargh said:Apparently, yeah. Horses that don't have riders don't- they're apparently Agents armed with... themselvesSo, even when the horse charge calls the trigger, it marks the human agent as the "attacker"/"damager" ?
(neg|agent_is_human, ":attacker"),
(eq, reg0, -1),
(agent_get_item_id, ":horse", ":attacker"),
(ge, ":horse", 0),
#Wrestling Skill
(store_skill_level, ":wrestling", "skl_power_strike", ":attacker_troop"),#Temporarily serving as Wrestling
(agent_get_wielded_item, ":wielded_weapon", ":attacker", 0),
(try_begin),
(eq, ":wielded_weapon",-1),#I assume this is unarmed
(val_mul,":wrestling",3),#Each point is +3 unarmed damage
(val_add,":damage",":wrestling"),
(val_div,":wrestling",3),
(val_mul,":wrestling",10),#Each point in Wrestling gives 10% chance to throw down
(store_random_in_range, ":random_no", 1, 100),
(try_begin),
(le, ":random_no", ":wrestling"),
(agent_is_human,":agent"),
(agent_set_animation, ":agent","anim_rider_fall_roll",0),#Guy that got hit falls to ground
(try_begin),
(eq, ":troop", "trp_player"),
(display_message, "@You got thrown down!"),
(else_try),
(eq, ":attacker_troop", "trp_player"),
(display_message, "@Enemy got thrown down!"),
(try_end),
(try_end),
Theoris said:Hmm. I modified the code a bit.
Code:theoris_decapitation = ( ti_on_agent_hit, 0, 0, [], [ (store_trigger_param_1, ":agent"), (agent_is_human, ":agent"), (store_trigger_param_3, ":damage"), (ge, ":damage", 30), #strong blow (store_agent_hit_points, ":hp", ":agent", 1), (val_sub, ":hp", 5), (ge, ":damage", ":hp"), (agent_get_position, pos1, ":agent"), (get_distance_between_positions, ":distance", pos1, pos0), (is_between, ":distance", 160, 176), # *zing* (agent_get_item_slot, ":item", ":agent", 4), #head slot (try_begin), (ge, ":item", 1), (agent_unequip_item, ":agent", ":item"), (try_end), (agent_equip_item, ":agent", "itm_invisible_head"), (particle_system_burst, "psys_game_blood_2", pos1, 125), #Yeah.. #(set_spawn_position, pos1), #(spawn_scene_prop, "spr_physics_head"), ]),
SonKidd said:you need 'neck shots'.
you can try to increase the range and test it again.
(is_between, ":distance", 140, 185),
If it works, it means your coding is OK, then you can reduce the values again. If it still doesn't work then it's something else.
common_battle_mission_start = (
ti_before_mission_start, 0, 0, [],
[
(team_set_relation, 0, 2, 1),
(team_set_relation, 1, 3, 1),
(call_script, "script_change_banners_and_chest"),
])
theoris_decapitation = (
ti_on_agent_hit, 0, 0, [],
[
(store_trigger_param_1, ":agent"),
(agent_is_human, ":agent"),
(store_trigger_param_3, ":damage"),
(ge, ":damage", 30), #strong blow
(store_agent_hit_points, ":hp", ":agent", 1),
(val_sub, ":hp", 5),
(ge, ":damage", ":hp"),
(agent_get_position, pos1, ":agent"),
(get_distance_between_positions, ":distance", pos1, pos0),
(is_between, ":distance", 90, 185), # *zing*
(agent_get_item_slot, ":item", ":agent", 4), #head slot
(try_begin),
(ge, ":item", 1),
(agent_unequip_item, ":agent", ":item"),
(try_end),
(agent_equip_item, ":agent", "itm_invisible_head"),
(particle_system_burst, "psys_game_blood_2", pos0, 125), #Yeah..
#(set_spawn_position, pos1),
#(spawn_scene_prop, "spr_physics_head"),
]),
common_battle_tab_press = (
ti_tab_pressed, 0, 0, [],
[
(try_begin),
(eq, "$g_battle_won", 1),
(call_script, "script_count_mission_casualties_from_agents"),
(finish_mission,0),
(else_try),
(call_script, "script_cf_check_enemies_nearby"),
(question_box,"str_do_you_want_to_retreat"),
(else_try),
(display_message,"str_can_not_retreat"),
(try_end),
])