Code: (module_scripts) [Select]
#Ik-Dual Wield Begin
("ready_dual_wield",[
(get_player_agent_no,":player_agent"),
(try_begin),
(gt, ":player_agent", 0),
(agent_get_animation, ":anim", ":player_agent",0),
(agent_get_horse, ":my_horse", ":player_agent"),
(agent_get_wielded_item, ":left_hand_item", ":player_agent", 1),
(agent_get_wielded_item, ":right_hand_item", ":player_agent", 2),
(try_begin),
(is_between, ":anim","anim_ready_swingright_fist","anim_parried_overswing_onehanded"),
(neq, ":anim", "anim_dual_wield_strike"),
(neq, ":anim", "anim_dual_wield_ready"),
# (neq, ":anim", ""), #put here the anims you dont want to use Dual Wield. Example: release_swingright_fist and release_swingright_fist_continue
# (neq, ":anim", ""),#put here the anims you dont want to use Dual Wield. Example: release_swingright_fist and release_swingright_fist_continue
# (neq, ":anim", ""),#put here the anims you dont want to use Dual Wield. Example: release_swingright_fist and release_swingright_fist_continue
# (neq, ":anim", ""),#put here the anims you dont want to use Dual Wield. Example: release_swingright_fist and release_swingright_fist_continue
# ...
(eq, ":my_horse", -1),
(is_between, ":left_hand_item", dual_wield_begin, dual_wield_end),
(assign, ":continue", 1)
(try_begin),
(eq, ":right_hand_item", "itm_bastard_sword")
(eq, ":left_hand_item", "itm_dh_bastard_sword")
(assign, ":continue", 0)
# (else_try)
# (eq, ":right_hand_item", "itm_") #put here the items you don't want to use in the right hand while the item bellow is equiped
# (neq, ":left_hand_item", "itm_dh_") #put here the items you don't want to use in the left hand while the item above is equiped
# (assign, ":continue", 0)
# (else_try)
# (eq, ":right_hand_item", "itm_") #put here the items you don't want to use in the right hand while the item bellow is equiped
# (eq, ":left_hand_item", "itm_dh_") #put here the items you don't want to use in the left hand while the item above is equiped
# (assign, ":continue", 0)
# (else_try)
# (eq, ":right_hand_item", "itm_") #put here the items you don't want to use in the right hand while the item bellow is equiped
# (eq, ":left_hand_item", "itm_dh_") #put here the items you don't want to use in the left hand while the item above is equiped
# (assign, ":continue", 0)
# ...
(try_end)
(eq, ":continue", 1)
(agent_set_animation, ":player_agent","anim_dual_wield_ready"),
(try_end),
(try_end),
]),
("dual_wield_strike)",[
(agent_get_animation, ":anim", ":player_agent",0),
(eq, ":anim", "anim_dual_wield_ready"),
(agent_get_position, pos63,":player_agent"),
(position_move_y,pos63,75), #75 cm directly ahead, so it's not a cuboid space around player center
(agent_get_troop_id, ":troop", ":player_agent"),
(troop_get_type, ":type", ":troop"),
(val_mod, ":type", 2),
(try_begin),
(eq, ":type", tf_male),
(agent_play_sound, ":player_agent", "snd_man_yell"),
(else_try),
(agent_play_sound, ":player_agent", "snd_woman_yell"),
(try_end),
(try_for_agents,":agent"),
(gt, ":agent", 0),
(neg|agent_is_ally,":agent"),#don't atack allies
(agent_is_human, ":agent"),#stop if not human
(agent_is_active,":agent"),
(agent_is_alive,":agent"),
(try_begin),
(agent_get_position,pos62,":agent"),
(get_distance_between_positions,":dist",pos63,pos62),
(lt,":dist",100),#Set this to whatever you like- 1 meter radius clears a big section of crowd
(agent_get_horse, ":horse", ":agent"),
(eq, ":horse", -1),
(neq,":agent",":player_agent"),
(agent_deliver_damage_to_agent,":player_agent",":agent",0),#if it is less than or equal to 0 it uses weapon damage
(agent_play_sound, ":player_agent", "snd_metal_hit_low_armor_low_damage"),
(position_move_y,pos62,-25),
(agent_set_position, ":agent", pos62),
(try_end),
(try_end)
]),
#Ik-Dual Wield End
Code: (module_mission_templates (you obviously need to put it into specific mt's like other common_ scripts)) [Select]
common_dual_wield1 = (0,0,0,[(game_key_is_down, gk_attack),(game_key_is_down, gk_defend),(neg|main_hero_fallen),],
[(call_script, "script_ready_dual_wield")])
common_dual_wield2 = (0,0,0,[(game_key_is_down, gk_attack),(neg|game_key_is_down, gk_defend),(neg|game_key_clicked, gk_defend),(neg|main_hero_fallen),],
[(call_script, "script_dual_wield_strike")])
common_dual_wield3 = (0,0,0,[(game_key_is_down, gk_attack),(game_key_clicked, gk_defend),(neg|main_hero_fallen)],
[(call_script, "script_ready_dual_wield"),(call_script, "script_dual_wield_strike")])
Code: (module_animations (needs to do some and replace a free unused_human_anim of course)) [Select]
## dual_wield_ready
## dual_wield_strike
Code: (module_items) [Select]
add anywhere you want:
#Ik Dual Wielded Start
["dw_bastard_sword", "Bastard Sword", [("bastard_sword_a",0),("bastard_sword_a_scabbard", ixmesh_carry)], itp_type_shield|itp_merchandise, itcf_carry_sword_left_hip|itcf_show_holster_when_drawn, 264 , weight(2.0)|hit_points(7500)|body_armor(0)|spd_rtng(9
|weapon_length(1),imodbits_none ],
["dw_dagger", "Dagger", [("practice_dagger",0)], itp_type_shield|itp_merchandise, itcf_carry_dagger_front_left, 34 , weight(0.5)|hit_points(7500)|body_armor(0)|spd_rtng(110)|weapon_length(1),imodbits_none ],
["dw_end", "Dual Wield End", [(0,0)], 0, 0, 0, 0, 0],
#Ik Dual Wielded End
Code: (module_constants) [Select]
#Ik Dual Wielded Start
dual_wield_begin = "itm_dw_bastard_sword"
dual_wield_end = "itm_dw_end"
#Ik Dual Wielded End