- ("cf_agent_set_firearrow",
- [
- (store_script_param_1, ":agent"),
- (store_script_param_2, ":action"),
-
- (agent_get_horse, reg0, ":agent"),
- (le, reg0, 0),
- (agent_get_wielded_item, ":bow", ":agent"),
- (gt, ":bow", itm_no_item),
- (item_get_type, reg0, ":bow"),
- (eq, reg0, itp_type_bow),
- (agent_get_ammo, reg0, ":agent", 1),
- (gt, reg0, 0),
- (agent_get_wielded_item_slot_no, ":ek_slot", ":agent"),
- (try_begin),
- (eq, ":action", begin),
- #(agent_set_item_slot, ":agent", ":ek_slot", ":bow", imod_bent), #decrease speed of bow for fire arrows
- (agent_set_item_slot_modifier, ":agent", ":ek_slot", imod_bent),##Wuan
- (else_try),
- (agent_get_troop_id, ":troop", ":agent"),
- (troop_is_hero, ":troop"),
- (troop_has_item_equipped, ":troop", ":bow"),
- (assign, reg0, -1),
- (try_for_range, ":i", 0, ek_head),
- (troop_get_inventory_slot, reg0, ":troop", ":i"),
- (eq, reg0, ":bow"),
- (troop_get_inventory_slot_modifier, reg0, ":troop", ":i"),
- (break_loop),
- (try_end),
- (neq, reg0, -1),
- #(agent_set_item_slot, ":agent", ":ek_slot", ":bow", reg0), #return to normal
- (agent_set_item_slot_modifier, ":agent", ":ek_slot", reg0),##Wuan
- (else_try), #not hero
- #(agent_set_item_slot, ":agent", ":ek_slot", ":bow", 0), #return to no modifier
- (agent_set_item_slot_modifier, ":agent", ":ek_slot", 0),##Wuan
- (try_end),
- (try_for_range, ":ek_slot", 0, ek_head),
- (agent_get_item_slot, ":arrows", ":agent", ":ek_slot"),
- (gt, ":arrows", itm_no_item),
- (item_get_type, reg0, ":arrows"),
- (eq, reg0, itp_type_arrows),
-
- (try_begin),
- (eq, ":action", begin),
- (store_sub, reg0, ":arrows", arrows_begin),
- (store_add, ":new_arrows", reg0, firearrows_begin),
- (else_try),
- (store_sub, reg0, ":arrows", firearrows_begin),
- (store_add, ":new_arrows", reg0, arrows_begin),
- (try_end),
- (agent_get_item_slot_modifier, ":imod", ":agent", ":ek_slot"),
- ##Wuan Fix
- #(agent_get_item_slot_ammo, ":amount", ":agent", ":ek_slot"),
- #(agent_set_item_slot, ":agent", ":ek_slot", ":new_arrows", ":imod"),
- (agent_get_ammo_for_slot, ":amount", ":agent", ":ek_slot"),
- (agent_unequip_item, ":agent", ":arrows", ":ek_slot"),
- (agent_equip_item, ":agent", ":new_arrows", ":ek_slot", ":imod"),
- ##Wuan Fix
- (agent_set_item_slot_ammo, ":agent", ":ek_slot", ":amount"),#WSE
- (try_end),
- ]),
复制代码 |