- 好友
- 6
- 在线时间
- 0 小时
- 最后登录
- 2025-11-29
见习骑士

- UID
- 3199602
- 第纳尔
- 1152
- 精华
- 0
- 互助
- 36
- 荣誉
- 0
- 贡献
- 1
- 魅力
- 227
- 注册时间
- 2020-9-4
 鲜花( 64)  鸡蛋( 0)
|

楼主 |
发表于 2022-11-27 09:55:25
|
显示全部楼层
有个地方修改一下,script_inventory里有个"exchange_two_item"的触发器,整个改成
#small tool
#Exchange two item mesh and inventory slot when count no is insure.
("exchange_two_item",
[
(store_script_param, ":exchange_1", 1),
(store_script_param, ":exchange_troop_1", 2),
(store_script_param, ":exchange_2", 3),
(store_script_param, ":exchange_troop_2", 4),
(troop_get_slot, ":item_overlay_1", "trp_temp_array_b", ":exchange_1"),
(troop_get_slot, ":item_overlay_2", "trp_temp_array_b", ":exchange_2"),
(overlay_get_position, pos1, ":item_overlay_1"),
(overlay_get_position, pos2, ":item_overlay_2"),
(troop_set_slot, "trp_temp_array_b", ":exchange_1", ":item_overlay_2"),
(troop_set_slot, "trp_temp_array_b", ":exchange_2", ":item_overlay_1"),
(try_begin),
(ge, ":exchange_1", 24),
(ge, ":exchange_2", 24),
(call_script, "script_new_inventory_reorder", "$item_reorder_indication"),
(else_try),
(lt, ":exchange_1", 24),
(lt, ":exchange_2", 24),
(overlay_set_position, ":item_overlay_1", pos2),
(overlay_set_position, ":item_overlay_2", pos1),
(else_try),
(ge, ":exchange_1", 24),
(overlay_set_container_overlay, ":item_overlay_1", -1),
(overlay_set_position, ":item_overlay_1", pos2),
(overlay_set_container_overlay, ":item_overlay_2", "$g_presentation_container_1"),
(call_script, "script_new_inventory_reorder", ":exchange_2"),
(else_try),
(ge, ":exchange_2", 24),
(overlay_set_container_overlay, ":item_overlay_2", -1),
(overlay_set_position, ":item_overlay_2", pos1),
(overlay_set_container_overlay, ":item_overlay_1", "$g_presentation_container_1"),
(call_script, "script_new_inventory_reorder", ":exchange_1"),
(try_end),
(call_script, "script_troop_get_new_inventory_slot_modifier", ":exchange_troop_1", ":exchange_1"),
(assign, ":modifier_1", reg0),
(call_script, "script_troop_get_new_inventory_slot_modifier", ":exchange_troop_2", ":exchange_2"),
(assign, ":modifier_2", reg0),
(call_script, "script_player_get_new_inventory_slot_amount", ":exchange_1"),
(assign, ":item_amount_1", reg0),
(call_script, "script_player_get_new_inventory_slot_amount", ":exchange_2"),
(assign, ":item_amount_2", reg0),
(call_script, "script_player_get_new_inventory_slot", ":exchange_1"),
(assign, ":item_1", reg0),
(call_script, "script_player_get_new_inventory_slot", ":exchange_2"),
(assign, ":item_2", reg0),
(call_script, "script_player_set_new_inventory_slot", ":exchange_1", ":item_2"),
(call_script, "script_player_set_new_inventory_slot", ":exchange_2", ":item_1"),
(try_begin),
(gt, ":item_1", 0),
(item_get_type, ":item_type_1", ":item_1"),
(try_end),
(try_begin),
(gt, ":item_2", 0),
(item_get_type, ":item_type_2", ":item_2"),
(try_end),
(try_begin),
(gt, ":item_amount_2", 0),
(eq, ":item_type_2", itp_type_goods),
(call_script, "script_player_set_new_inventory_slot_amount", ":exchange_1", ":item_amount_2"),
(try_end),
(try_begin),
(gt, ":item_amount_2", 0),
(eq, ":item_type_1", itp_type_goods),
(call_script, "script_player_set_new_inventory_slot_amount", ":exchange_2", ":item_amount_1"),
(try_end),
(call_script, "script_troop_set_new_inventory_slot_modifier", ":exchange_troop_1", ":exchange_1", ":modifier_2"),
(call_script, "script_troop_set_new_inventory_slot_modifier", ":exchange_troop_2", ":exchange_2", ":modifier_1"),
(troop_get_slot, ":overlay_background", "trp_temp_array_a", ":exchange_1"),
(call_script, "script_lowlight_certain_block", ":overlay_background"),
(troop_get_slot, ":overlay_background", "trp_temp_array_a", ":exchange_2"),
(call_script, "script_lowlight_certain_block", ":overlay_background"),
]), |
|