我最近经大佬的思路启发,制作了一个魔球可用的包含从野怪攻城到城镇阵营转变的触发器代码。代码都是放到触发器结果上的。触发器条件全填0即可。
野怪攻城代码优化.改- (neg|eq,":var_3","fac_player_knights_1"),
- (store_random_in_range,":var_10",0,10),
- (try_begin),
- (store_faction_of_party,":var_12","p_town_7"),
- (neg|eq,":var_12","fac_player_knights_1"),
- (assign,"$var_1337","p_town_7"),
- (try_end),
- (store_faction_of_party,":var_11","$var_1337"),
- (store_random_party_of_template,":var_2","pt_snake_cult_warband_4"),
- (try_begin),
- (neg|eq,":var_11","fac_player_knights_1"),
- (try_begin),
- (gt,":var_10",5),
- (2281,":var_4","$var_1337",":var_2"),
- (try_begin),
- (ge,100,":var_4"),
- (party_set_ai_object,":var_2","$var_1337"),
- (party_set_ai_behavior,":var_2",ai_bhvr_attack_party),
- (else_try),
- (party_set_ai_object,":var_2","$var_1337"),
- (party_set_ai_behavior,":var_2",ai_bhvr_travel_to_party),
- (try_end),
- (else_try),
- (try_end),
- (else_try),
- (gt,":var_10",5),
- (store_add,":var_1","p_castle_40",1),
- (store_random_in_range,"$var_1337","p_town_1",":var_1"),
- (try_end),
- (try_begin),
- (party_get_num_companions,":var_13","$var_1337"),
- (ge,40,":var_13"),
- (party_set_faction,"$var_1337","fac_player_knights_1"),
复制代码 城村阵营绑定格式(附潘德g版绑定)
- (store_faction_of_party, <destination>, <party_id>), #城
- (party_set_faction,<destination>,<party_id>),#村(有几个套几个)
- #<destination>:变量 例:":var_0"
复制代码 潘德g版绑定
- (store_faction_of_party,":var_1","p_town_1"),
- (party_set_faction,"p_village_5",":var_1"),
- (party_set_faction,"p_village_75",":var_1"),
- (store_faction_of_party,":var_2","p_town_2"),
- (party_set_faction,"p_village_4",":var_2"),
- (party_set_faction,"p_village_63",":var_2"),
- (party_set_faction,"p_village_81",":var_2"),
- (party_set_faction,"p_village_35",":var_2"),
- (store_faction_of_party,":var_3","p_town_3"),
- (party_set_faction,"p_village_46",":var_3"),
- (party_set_faction,"p_village_73",":var_3"),
- (party_set_faction,"p_village_89",":var_3"),
- (party_set_faction,"p_village_40",":var_3"),
- (party_set_faction,"p_village_78",":var_3"),
- (party_set_faction,"p_village_47",":var_3"),
- (store_faction_of_party,":var_4","p_town_4"),
- (party_set_faction,"p_village_32",":var_4"),
- (party_set_faction,"p_village_71",":var_4"),
- (store_faction_of_party,":var_5","p_town_5"),
- (party_set_faction,"p_village_27",":var_5"),
- (party_set_faction,"p_village_84",":var_5"),
- (party_set_faction,"p_village_39",":var_5"),
- (party_set_faction,"p_village_70",":var_5"),
- (store_faction_of_party,":var_6","p_town_6"),
- (party_set_faction,"p_village_3",":var_6"),
- (party_set_faction,"p_village_1",":var_6"),
- (party_set_faction,"p_village_62",":var_6"),
- (store_faction_of_party,":var_7","p_town_7"),
- (party_set_faction,"p_village_7",":var_7"),
- (party_set_faction,"p_village_54",":var_7"),
- (store_faction_of_party,":var_8","p_town_8"),
- (party_set_faction,"p_village_14",":var_8"),
- (party_set_faction,"p_village_55",":var_8"),
- (store_faction_of_party,":var_9","p_town_9"),
- (party_set_faction,"p_village_85",":var_9"),
- (party_set_faction,"p_village_86",":var_9"),
- (store_faction_of_party,":var_10","p_town_10"),
- (party_set_faction,"p_village_79",":var_10"),
- (party_set_faction,"p_village_37",":var_10"),
- (party_set_faction,"p_village_83",":var_10"),
- (store_faction_of_party,":var_11","p_town_11"),
- (party_set_faction,"p_village_66",":var_11"),
- (party_set_faction,"p_village_21",":var_11"),
- (store_faction_of_party,":var_12","p_town_12"),
- (party_set_faction,"p_village_36",":var_12"),
- (party_set_faction,"p_village_87",":var_12"),
- (store_faction_of_party,":var_13","p_town_13"),
- (party_set_faction,"p_village_18",":var_13"),
- (store_faction_of_party,":var_14","p_town_14"),
- (party_set_faction,"p_village_59",":var_14"),
- (party_set_faction,"p_village_43",":var_14"),
- (store_faction_of_party,":var_15","p_town_15"),
- (party_set_faction,"p_village_24",":var_15"),
- (party_set_faction,"p_village_29",":var_15"),
- (party_set_faction,"p_village_64",":var_15"),
- (store_faction_of_party,":var_16","p_town_16"),
- (party_set_faction,"p_village_57",":var_16"),
- (party_set_faction,"p_village_13",":var_16"),
- (party_set_faction,"p_village_38",":var_16"),
- (store_faction_of_party,":var_17","p_town_17"),
- (party_set_faction,"p_village_44",":var_17"),
- (party_set_faction,"p_village_49",":var_17"),
- (store_faction_of_party,":var_18","p_town_18"),
- (party_set_faction,"p_village_42",":var_18"),
- (party_set_faction,"p_village_33",":var_18"),
- (party_set_faction,"p_village_23",":var_18"),
- (store_faction_of_party,":var_19","p_castle_1"),
- (party_set_faction,"p_village_45",":var_19"),
- (store_faction_of_party,":var_20","p_castle_2"),
- (party_set_faction,"p_village_52",":var_20"),
- (store_faction_of_party,":var_21","p_castle_3"),
- (party_set_faction,"p_village_22",":var_21"),
- (store_faction_of_party,":var_22","p_castle_4"),
- (party_set_faction,"p_village_53",":var_22"),
- (store_faction_of_party,":var_23","p_castle_5"),
- (party_set_faction,"p_village_31",":var_23"),
- (store_faction_of_party,":var_24","p_castle_6"),
- (party_set_faction,"p_village_67",":var_24"),
- (store_faction_of_party,":var_25","p_castle_7"),
- (party_set_faction,"p_village_8",":var_25"),
- (store_faction_of_party,":var_26","p_castle_8"),
- (party_set_faction,"p_village_10",":var_26"),
- (store_faction_of_party,":var_27","p_castle_9"),
- (party_set_faction,"p_village_90",":var_27"),
- (store_faction_of_party,":var_28","p_castle_10"),
- (party_set_faction,"p_village_30",":var_28"),
- (store_faction_of_party,":var_29","p_castle_11"),
- (party_set_faction,"p_village_61",":var_29"),
- (store_faction_of_party,":var_30","p_castle_12"),
- (party_set_faction,"p_village_80",":var_30"),
- (store_faction_of_party,":var_31","p_castle_13"),
- (party_set_faction,"p_village_65",":var_31"),
- (store_faction_of_party,":var_32","p_castle_14"),
- (party_set_faction,"p_village_26",":var_32"),
- (store_faction_of_party,":var_33","p_castle_15"),
- (party_set_faction,"p_village_6",":var_33"),
- (store_faction_of_party,":var_34","p_castle_16"),
- (party_set_faction,"p_village_9",":var_34"),
- (store_faction_of_party,":var_35","p_castle_17"),
- (party_set_faction,"p_village_11",":var_35"),
- (store_faction_of_party,":var_36","p_castle_18"),
- (party_set_faction,"p_village_41",":var_36"),
- (store_faction_of_party,":var_37","p_castle_19"),
- (party_set_faction,"p_village_20",":var_37"),
- (store_faction_of_party,":var_38","p_castle_20"),
- (party_set_faction,"p_village_74",":var_38"),
- (store_faction_of_party,":var_39","p_castle_21"),
- (party_set_faction,"p_village_48",":var_39"),
- (store_faction_of_party,":var_40","p_castle_22"),
- (party_set_faction,"p_village_72",":var_40"),
- (store_faction_of_party,":var_41","p_castle_23"),
- (party_set_faction,"p_village_34",":var_41"),
- (store_faction_of_party,":var_42","p_castle_24"),
- (party_set_faction,"p_village_25",":var_42"),
- (store_faction_of_party,":var_43","p_castle_25"),
- (party_set_faction,"p_village_15",":var_43"),
- (store_faction_of_party,":var_44","p_castle_26"),
- (party_set_faction,"p_village_69",":var_44"),
- (store_faction_of_party,":var_45","p_castle_27"),
- (party_set_faction,"p_village_2",":var_45"),
- (store_faction_of_party,":var_46","p_castle_28"),
- (party_set_faction,"p_village_56",":var_46"),
- (store_faction_of_party,":var_47","p_castle_29"),
- (party_set_faction,"p_village_50",":var_47"),
- (store_faction_of_party,":var_48","p_castle_30"),
- (party_set_faction,"p_village_88",":var_48"),
- (store_faction_of_party,":var_49","p_castle_31"),
- (party_set_faction,"p_village_76",":var_49"),
- (store_faction_of_party,":var_50","p_castle_32"),
- (party_set_faction,"p_village_82",":var_50"),
- (store_faction_of_party,":var_51","p_castle_33"),
- (party_set_faction,"p_village_12",":var_51"),
- (store_faction_of_party,":var_52","p_castle_34"),
- (party_set_faction,"p_village_77",":var_52"),
- (store_faction_of_party,":var_53","p_castle_35"),
- (party_set_faction,"p_village_60",":var_53"),
- (store_faction_of_party,":var_54","p_castle_36"),
- (party_set_faction,"p_village_51",":var_54"),
- (store_faction_of_party,":var_55","p_castle_37"),
- (party_set_faction,"p_village_58",":var_55"),
- (store_faction_of_party,":var_56","p_castle_38"),
- (party_set_faction,"p_village_68",":var_56"),
- (store_faction_of_party,":var_57","p_castle_39"),
- (party_set_faction,"p_village_17",":var_57"),
- (store_faction_of_party,":var_58","p_castle_40"),
- (party_set_faction,"p_village_28",":var_58"),
复制代码 附:大佬原代码
B站:杨浩瀚吹啊吹
顺序:
①创建野怪大军
②野怪大军巡逻
③随机对目标城堡/城镇/村子攻击
④若攻下该城堡,该城堡会自动招募野怪新兵进行驻守
⑤每隔一段时间城堡的野怪自动升级为更高级的兵种
⑥城堡被占领期间自动产生野怪城池护卫队进行巡逻
(1)重生部队代码
激发条件:
- (store_num_parties_of_template,reg2,"pt_looters_1"),
- (neg|ge,reg2,20),
复制代码 激发结果
- (set_spawn_radius,1),
- (store_add,":var_0","p_town_1",1),
- (store_random_in_range,":var_1","p_town_1",":var_0"),
- (spawn_around_party,":var_1","pt_looters_1"),
复制代码 (2)野怪攻城行为
激发条件空
激发结果
- (neg|eq,":var_3","fac_player_supporters_faction"),
- (store_random_in_range,":var_10",0,10),
- (try_begin),
- (gt,":var_10",5),
- (store_random_party_of_template,":var_0","pt_looters_1"),
- (store_add,":var_1","p_town_2",1),
- (store_random_in_range,":var_2","p_town_1",":var_1"),
- (party_set_ai_behavior,":var_0",ai_bhvr_attack_party),
- (party_set_ai_object,":var_0",":var_2"),
- (try_end),
复制代码 (3)攻下后驻兵-普通士兵模板和守城大将模板
激发条件为空
激发结果
- (try_for_range,":var_0","p_town_1","p_village_1"),
- (store_faction_of_party,":var_1",":var_0"),
- (party_count_members_of_type,":var_2",":var_0","trp_song_zhuangding"),
- (try_begin),
- (eq,":var_1","fac_player_supporters_faction"),
- (try_begin),
- (neg|ge,":var_2",300),
- (party_add_members,":var_0","trp_song_zhuangding",50),
- (try_end),
- (try_end),
- (try_end),
复制代码 (4)攻下后驻兵自动升级(这里没有上限,你可以用加大时间周期来限制)
激发条件:空
激发结果
- (try_for_range,":var_0","p_town_1","p_village_1"),
- (store_faction_of_party,":var_1",":var_0"),
- (try_for_range,":var_2","trp_veteran_fighter","trp_kidnapped_girl"),
- (party_count_companions_of_type,":var_3",":var_0",":var_2"),
- (try_begin),
- (eq,":var_1","fac_player_supporters_faction"),
- (try_begin),
- (ge,":var_3",1),
- (party_remove_members,":var_0",":var_2",":var_3"),
- (party_add_members,":var_0","trp_forest_bandit",":var_3"),
- (try_end),
- (try_end),
- (try_end),
- (try_end),
- (try_end),
复制代码 (5)野怪护城巡逻队
激发条件
- (store_num_parties_of_template,reg2,"pt_manhunters"),
- (neg|ge,reg2,4),
复制代码 激发结果
- (set_spawn_radius,1),
- (try_for_range,":var_3","p_town_1","p_castle_51"),
- (store_faction_of_party,":var_4",":var_3"),
- (try_begin),
- (eq,":var_4","fac_outlaws"),
- (spawn_around_party,":var_3","pt_taiga_bandits_22"),
- (assign,":var_5",reg0),
- (party_set_faction,":var_5",":var_4"),
- (party_set_ai_object,":var_5",":var_3"),
- (party_set_ai_behavior,":var_5",ai_bhvr_patrol_location),
- (party_set_ai_patrol_radius,":var_5",10),
- (try_end),
- (try_end),
复制代码
觉得很好用记得给大佬投币
大佬也做了一些魔球教程视频,欢迎支持
|