本帖最后由 乌木护手骑士团 于 2020-8-21 12:29 编辑
这只是一个简单的功能,在各位前辈面前献丑了,大概是这样:
玩家可以在营地菜单雇佣一支车队(也可以加在城镇菜单等等,根据情况变化),分 普通车队、中型车队、大型车队,车队的大小决定可携带的辎重的多少,车队可跟随玩家以及在原地等候(可额外添加其他功能,比如前往XXX城镇,为车队加入士兵等等),每两天付一次工资,没钱付工资车队会消失。(车队图标可换为商队图标)
功能较简单,多用大地图触发器,某些繁琐的地方可以修改到Scripts,请自行修改,中文提示处如果不好写汉化可以用此语句:(display_message,"str_h_town_1",0xFFFFAAAA),。实现,不做过多赘述。
-首先请在文件最上边加上这一句
-module_troops.py- ["xiangzi_xiao","xiangzi_xiao","xiangzi_xiao",tf_hero|tf_inactive, 0,reserved, fac_neutral,
- [],
- def_attrib|level(18),wp(60),knows_inventory_management_5, 0], #小箱子
- ["xiangzi_zhong","xiangzi_zhong","xiangzi_zhong",tf_hero|tf_inactive, 0,reserved, fac_neutral,
- [],
- def_attrib|level(18),wp(60),knows_inventory_management_7, 0], #中箱子
- ["xiangzi_da","xiangzi_da","xiangzi_da",tf_hero|tf_inactive, 0,reserved, fac_neutral,
- [],
- def_attrib|level(18),wp(60),knows_inventory_management_10, 0], #大箱子
-
- ["chefu","chefu","chefu",tf_guarantee_armor,0,0,fac_kingdom_1,[itm_scythe,itm_hatchet,itm_pickaxe,itm_club,itm_stones,itm_tab_shield_heater_a,itm_leather_cap,itm_felt_hat,itm_felt_hat,itm_shirt,itm_coarse_tunic,itm_leather_apron,itm_nomad_boots,itm_wrapping_boots],def_attrib|level(4),wp(60),knows_common,swadian_face_younger_1,swadian_face_middle_2], #车夫
复制代码
-module_game_menus.py这一句加在营地菜单:
- ("guyong_chedui",
- [(ge,"$chedui_daditu",0),
- ],"雇 用 车 队 " ,
- [(jump_to_menu, "chedui_zhaomu"),
- ]
- ),
复制代码 这一段加在最后面:
- #加在菜单最后
- ("chedui_zhaomu",menu_text_color(0xFF000000)|mnf_disable_all_keys,
- "您 可 以 在 此 雇 佣 一 队 车 队 , 他 将 跟 随 与 您 , 但 是 需 要 注 意 的 是 , 您 需 要 两 天 付 清 一 次 账 款 "
- "none",
- [],
- [
- ("chedui_xiao",[
- (store_troop_gold,":gold","trp_player"),
- (ge,":gold",500),
- ],"雇 用 一 支 小 型 车 队 " ,
- [(assign, "$chedui_fu", 1),
- ]
- ),
-
- ("chedui_zhong",[
- (store_troop_gold,":gold","trp_player"),
- (ge,":gold",100),
- ],"雇 用 一 支 中 型 车 队 " ,
- [(assign, "$chedui_fu", 2),
- ]
- ),
-
- ("chedui_daxing",[
- (store_troop_gold,":gold","trp_player"),
- (ge,":gold",1500),
- ],"雇 用 一 支 大 型 车 队 " ,
- [(assign, "$chedui_fu", 3),
- ]
- ),
-
- ("go_back",[],"返 回 ",
- [(change_screen_map),
- ]),
-
- ]
- ),
- #车队查看菜单
- ("chedui_zhaomu",menu_text_color(0xFF000000)|mnf_disable_all_keys,
- "您 的 辎 重 如 下 "
- "none",
- [],
- [
- ("chedui_xiao",[
- (eq, "$chedui_cun",tp_chedui_xiao),
- ],"打 开 辎 重 " ,
- [(change_screen_loot, "trp_xiangzi_xiao),
- ]
- ),
-
- ("chedui_xiao",[
- (eq, "$chedui_cun",tp_chedui_zhong),
- ],"打 开 辎 重 " ,
- [(change_screen_loot, "trp_xiangzi_zhong),
- ]
- ),
-
- ("chedui_xiao",[
- (eq, "$chedui_cun",tp_chedui_da),
- ],"打 开 辎 重 " ,
- [ (change_screen_loot, "trp_xiangzi_da"),
- ]
- ),
- ]
- ),
- #菜单结束
复制代码
-game_simple_triggers.py
- #刷出车队
- (1,
- [
- (try_begin), #(尝试开始)
- (eq, "$g_player_icon_state", pis_normal),
- (try_begin), #(尝试开始)
- (eq, "$chedui_fu",1),
- (assign, "$chedui_daditu", 1),
- (party_relocate_near_party, "pt_chedui_xiao", "p_main_party", 3),
- (display_log_message, "@你 雇 佣 了 一 直 车 队 "),
- (assign, "$chedui_ai", 1),
- (assign, "$chedui_cun", "pt_chedui_xiao"),
- (else_try), #(否则)
- (assign,"$chedui_fu",0),
- (try_end), #(尝试结束)
- (else_try), #(其他尝试)
- (eq, "$chedui_fu",2),
- (assign, "$chedui_daditu", 1),
- (party_relocate_near_party, "pt_chedui_zhong", "p_main_party", 3),
- (display_log_message, "@你 雇 佣 了 一 直 车 队 "),
- (assign, "$chedui_ai", 2),
- (assign, "$chedui_cun", "pt_chedui_zhong"),
- (else_try),
- (assign,"$chedui_fu",0),
- (try_end), #(尝试结束)
- (else_try), #(其他尝试)
- (eq, "$chedui_fu",3),
- (assign, "$chedui_daditu", 1),
- (party_relocate_near_party, "pt_chedui_da", "p_main_party", 3),
- (display_log_message, "@你 雇 佣 了 一 直 车 队 "),
- (assign, "$chedui_ai", 3),
- (assign, "$chedui_cun", "pt_chedui_da"),
- (else_try),
- (assign,"$chedui_fu",0),
- (try_end), #(尝试结束)
- ]),
复制代码- (1,
- [
- (store_num_parties_of_template,reg2,"pt_chedui_xiao"),
- (lt, reg2, 1) ],
- (assign,"$chedui_fu","0"),
- ]),
-
- (1,
- [
- (store_num_parties_of_template,reg2,"trp_chedui_xiao"),
- (lt, reg2, 1) ],
- (troop_clear_inventory,"trp_chedui_xiao"),
- ]),
-
- (1,
- [
- (store_num_parties_of_template,reg2,"trp_chedui_zhong"),
- (lt, reg2, 1) ],
- (troop_clear_inventory,"trp_chedui_zhong"),
- ]),
-
- (1,
- [
- (store_num_parties_of_template,reg2,"trp_chedui_da"),
- (lt, reg2, 1) ],
- (troop_clear_inventory,"trp_chedui_da"),
- ]),
- #结束
复制代码
-game_triggers.py
- #车队ai跟随开始
- (0.1, 0.0, 0.1, [(eq,"$chedui_ai", 1),
- ],
- [
- (try_begin), #判断开始
- (party_is_active, ":chedui_cun"),
- (party_set_ai_behavior, ":chedui_cun", ai_bhvr_hold),
- (party_set_flags, ":chedui_cun", pf_default_behavior, 0),
- (party_set_ai_object,":chedui_cun","p_main_party"),
- (try_end),
- ]),
- #ai跟随结束
- #ai停在原地
- (0.1, 0.0, 0.1, [
- (eq, "$chedui_ai", 0)
- ],
- [
- (try_begin),
- (party_is_active, ":chedui_cun"),
- (party_set_ai_behavior, ":chedui_cun", ai_bhvr_hold),
- (party_set_flags, ":chedui_cun", pf_default_behavior, 0),
- (try_end),
- ]),
- #ai停止结束
复制代码- #工资
- (48,0.0,0.1,[(try_for_parties,":party"),
- (store_num_parties_of_template,reg2,":chedui_cun"),
- (lt, reg2, 1) ],
- [
- (try_begin),
- (store_troop_gold, ":gold", "trp_player"),
- (ge,":gold","20"),
- (troop_remove_gold,"trp_player","20"),
- (display_log_message, "@你 支 付 了 车 队 的 工 资 "),
- (else_try),
- (lt,":gold","20"),
- (party_detach,":chedui_cun"),
- (display_log_message, "@你 无 法 支 付 工 资 , 车 队 已 解 散 "),
- (try_end),
- ],
-
- (48,0.0,0.1,[(try_for_parties,":party"),
- (store_num_parties_of_template,reg2,":chedui_cun"),
- (lt, reg2, 1) ],
- [
- (try_begin),
- (store_troop_gold, ":gold", "trp_player"),
- (ge,":gold","50"),
- (troop_remove_gold,"trp_player","50"),
- (display_log_message, "@你 支 付 了 车 队 的 工 资 "),
- (else_try),
- (lt,":gold","50"),
- (party_detach,":chedui_cun"),
- (display_log_message, "@你 无 法 支 付 工 资 , 车 队 已 解 散 "),
- (try_end),
- ],
-
- (48,0.0,0.1,[(try_for_parties,":party"),
- (store_num_parties_of_template,reg2,":chedui_cun"),
- (lt, reg2, 1) ],
- [
- (try_begin),
- (store_troop_gold, ":gold", "trp_player"),
- (ge,":gold","100"),
- (troop_remove_gold,"trp_player","100"),
- (display_log_message, "@你 支 付 了 车 队 的 工 资 "),
- (else_try),
- (lt,":gold","100"),
- (party_detach,":chedui_cun"),
- (display_log_message, "@你 无 法 支 付 工 资 , 车 队 已 解 散 "),
- (try_end),
- ],
- #工资结束
复制代码
module_party_templates.py
- ("chedui_xiao","chedui_xiao",icon_gray_knight|pf_show_faction|pf_default_behavior,0,fac_commoners,soldier_personality,[(trp_chefu,1,1)]), #车队1
- ("chedui_zhong","chedui_zhong",icon_gray_knight|pf_show_faction|pf_default_behavior,0,fac_commoners,soldier_personality,[(trp_chefu,2,2)]), #车队2
- ("chedui_da","chedui_da",icon_gray_knight|pf_show_faction|pf_default_behavior,0,fac_commoners,soldier_personality,[(trp_chefu,3,3)]), #车队3
复制代码
-module_dialogs.py- #对话
- [party_tpl|pt_chedui_xiao,"start", [(quest_get_slot, ":chedui_cun", "qst_escort_merchant_caravan", slot_quest_target_party),
- (eq, "$g_encountered_party", ":chedui_cun"),
- ],
- "您 有 什 么 特 殊 安 排 吗 ? ", "chedui_talk_1",[]],
- [anyone|plyr,"chedui_talk_1", [], "跟 着 我 ", "chedui_talk_2",[]],
- [anyone,"chedui_talk_2", [],"听 您 的 , 大 人 。", "close_window",[(assign, "$chedui_ai", 1),]],
- [anyone|plyr,"chedui_talk_3", [], "留 着 这 里 , 直 到 我 来 找 你 。 ", "chedui_talk_4",[]],
- [anyone,"chedui_talk_4", [], "我 会 寸 步不 离 , 直 到 您 找 我 。 ", "close_window",[(assign, "$chedui_ai", 0),]],
- [anyone|plyr,"chedui_talk_5", [], "打 开 我 的 辎 重 , 让 我 看 一 下 。 ", "chedui_talk_6",[]],
- [anyone,"chedui_talk_6", [], "没 问 题 , 请 过 目 。 ", "close_window",[(jump_to_menu, "chedui_chakan"), ]],
-
- [party_tpl|pt_chedui_zhong,"start", [(quest_get_slot, ":chedui_cun", "qst_escort_merchant_caravan", slot_quest_target_party),
- (eq, "$g_encountered_party", ":chedui_cun"),
- ],
- "您 有 什 么 特 殊 安 排 吗 ? ", "chedui_talk_1",[]],
- [anyone|plyr,"chedui_talk_1", [], "跟 着 我 ", "chedui_talk_2",[]],
- [anyone,"chedui_talk_2", [],"听 您 的 , 大 人 。", "close_window",[(assign, "$chedui_ai", 1),]],
- [anyone|plyr,"chedui_talk_3", [], "留 着 这 里 , 直 到 我 来 找 你 。 ", "chedui_talk_4",[]],
- [anyone,"chedui_talk_4", [], "我 会 寸 步不 离 , 直 到 您 找 我 。 ", "close_window",[(assign, "$chedui_ai", 0),]],
- [anyone|plyr,"chedui_talk_5", [], "打 开 我 的 辎 重 , 让 我 看 一 下 。 ", "chedui_talk_6",[]],
- [anyone,"chedui_talk_6", [], "没 问 题 , 请 过 目 。 ", "close_window",[(jump_to_menu, "chedui_chakan"), ]],
-
- [party_tpl|pt_chedui_da,"start", [(quest_get_slot, ":chedui_cun", "qst_escort_merchant_caravan", slot_quest_target_party),
- (eq, "$g_encountered_party", ":chedui_cun"),
- ],
- "您 有 什 么 特 殊 安 排 吗 ? ", "chedui_talk_1",[]],
- [anyone|plyr,"chedui_talk_1", [], "跟 着 我 ", "chedui_talk_2",[]],
- [anyone,"chedui_talk_2", [],"听 您 的 , 大 人 。", "close_window",[(assign, "$chedui_ai", 1),]],
- [anyone|plyr,"chedui_talk_3", [], "留 着 这 里 , 直 到 我 来 找 你 。 ", "chedui_talk_4",[]],
- [anyone,"chedui_talk_4", [], "我 会 寸 步不 离 , 直 到 您 找 我 。 ", "close_window",[(assign, "$chedui_ai", 0),]],
- [anyone|plyr,"chedui_talk_5", [], "打 开 我 的 辎 重 , 让 我 看 一 下 。 ", "chedui_talk_6",[]],
- [anyone,"chedui_talk_6", [], "没 问 题 , 请 过 目 。 ", "close_window",[(jump_to_menu, "chedui_chakan"), ]],
-
-
复制代码
至此,一切结束。格式有错误,我把整合好的ms传一下
(之前上传的txt有错误已删除,请下载Ms整合版)
|