- # 马匹提升生命值,骑术等级*20点生命值加成
- # (玩家铁骨等级*10生命加成) 太强 去掉
- # 跑动等级*2%百分比移动速度加成
- # 骑射等级*10%远程伤害加成
- # (三远程熟练度之和/30)%远程伤害加成 太强 去掉
- # (三远程熟练度之和/30)%远程装载弹药速度加成 太强 去掉
- # 武器掌握等级*2%射击精度加成
- (ti_after_mission_start, 0, 0, [],
- [
- (try_for_agents, ":var_0"),
- (agent_is_alive, ":var_0"),
- # (get_player_agent_no, ":player_no"), #仅玩家有效
- (try_begin),
- # (eq, ":var_0", ":player_no"), #仅玩家有效
- (agent_is_ally, ":var_0"), #友军有效
- (agent_is_human, ":var_0"),
- (agent_get_troop_id, ":var_3", ":var_0"),
- (troop_is_hero, ":var_3"), # 友军npc有效
- # (this_or_next|is_between, ":var_3", trp_npc_adonja, trp_kingdom_1_lord),
- # (eq, ":var_3", trp_player),
- # (store_skill_level, ":var_1", skl_ironflesh, ":var_3"),#铁骨加战场血量最大值
- # (store_agent_hit_points, ":var_2", ":var_0", 1),
- # (val_mul, ":var_1", 10),
- # (val_add, ":var_2", ":var_1"),
- # (agent_set_max_hit_points, ":var_0", ":var_2", 1),
- # (agent_set_hit_points, ":var_0", ":var_2", 1),
- (store_skill_level, ":var_11", skl_athletics, ":var_3"),
- (val_mul, ":var_11", 2),
- (val_add, ":var_11", 100),
- (agent_set_speed_modifier, ":var_0", ":var_11"),
- (store_skill_level, ":var_12", skl_horse_archery, ":var_3"),
- # (store_proficiency_level, ":val_4", ":var_3", wpt_archery),
- # (store_proficiency_level, ":val_5", ":var_3", wpt_crossbow),
- # (store_proficiency_level, ":val_6", ":var_3", wpt_throwing),
- # (val_add, ":val_4", ":val_5"),
- # (val_add, ":val_4", ":val_6"),
- # (val_div, ":val_4", 30),
- (val_mul, ":var_12", 10),
- # (val_add, ":var_12", ":val_4"),
- (val_add, ":var_12", 100),
- (agent_set_ranged_damage_modifier, ":var_0", ":var_12"),
- # (val_add, ":val_4", 100),
- # (agent_set_reload_speed_modifier, ":var_0", ":val_4"),
- (store_skill_level, ":var_13", skl_weapon_master, ":var_3"),
- (val_mul, ":var_13", 2),
- (val_add, ":var_13", 100),
- (agent_set_accuracy_modifier, ":var_0", ":var_13"),
- (agent_get_horse, ":var_1", ":var_0"),
- (ge, ":var_1", 0),
- (try_begin),
- (store_skill_level, ":var_19", skl_riding, ":var_3"),
- (store_agent_hit_points, ":var_20", ":var_1", 1),
- (val_mul, ":var_19", 20),
- (val_add, ":var_19", ":var_20"),
- (agent_set_max_hit_points, ":var_1", ":var_19", 1),
- (agent_set_hit_points, ":var_1", ":var_19", 1),
- # (assign, reg0, ":var_20"),
- # (assign, reg1, ":var_19"),
- # (display_message, "@{reg0}, {reg1},"),
- (try_end),
- (try_end),
- (try_end),
- ]),
- # 90秒回复友军npc弹药
- (90, 0, 0, [],
- [
- (try_for_agents, ":npc"),
- (agent_is_alive, ":npc"),
- (agent_is_ally, ":npc"),#仅友军有效
- # (agent_get_troop_id, ":ally", ":npc"),#仅NPC有效
- # (troop_is_hero, ":ally"), #仅NPC有效
- (agent_refill_ammo, ":npc"),
- (try_end),
- # (display_message, "@弹 药 补 给", 0xFFFF00FF),
- ]),
- #60秒回复友军npc百分比血量
- (60, 0, 0, [],
- [
- # (get_player_agent_no, ":player_no"),
- (try_for_agents, ":npc"),
- (agent_is_alive, ":npc"),
- (agent_is_ally, ":npc"),#仅友军有效
- (agent_is_human, ":npc"),
- (agent_get_troop_id, ":ally", ":npc"),#仅NPC有效
- (troop_is_hero, ":ally"),#仅NPC有效
- # (this_or_next|is_between, ":ally", trp_npc_adonja, trp_kingdom_1_lord),
- # (eq, ":ally", trp_player),
- (store_skill_level, ":npc_skl",skl_ironflesh, ":ally"),
- (assign, ":hps", ":npc_skl"),
- # (assign, reg0, ":hps"),
- (try_begin),
- (store_agent_hit_points, ":npc_hps", ":npc"),#获取血量百分比,":npc", 1)后面加1表示获取血量点数
- (lt, ":npc_hps", 100),
- (val_add, ":hps", ":npc_hps"),#铁骨等级百分比回血,若上方后面加1,则回复铁骨等级点数血量
- (agent_set_hit_points, ":npc", ":hps"),
- # (eq, ":npc", ":player_no"),
- # (display_message, "@铁 骨 回 血 {reg0}%", 0xFFFF0000),
- (try_end),
- (try_end),
- ]),
- # 每级铁骨8%减伤,1~4级半血伤害减半,5~10级伤害大于10点伤害减半(半血伤害再减半)
- # 跑动每级5%闪避伤害几率
- #(统御每级5%友军士兵减伤)太强 去掉
- # 友军npc,玩家,每级武器掌握技能,获得5%概率增加所持武器1点熟练度
- # 强击每级5%概率造成额外10%暴击伤害,(半血状态双倍暴击,1/4血状态3倍暴击)
- (ti_on_agent_hit, 0, 0, [],
- [
- (store_trigger_param_1, ":bgjz"),
- (store_trigger_param_2, ":gjz"),
- (store_trigger_param_3, ":damage"),
- # (get_player_agent_no, ":player_no"),
- (try_begin),
- (agent_is_ally, ":bgjz"),#玩家,友军npc
- (neg|agent_is_ally, ":gjz"),
- (try_begin),
- # (neg|eq, ":bgjz", ":player_no"),#友军npc效果
- (agent_get_troop_id, ":ally", ":bgjz"),
- (troop_is_hero, ":ally"),
- # (this_or_next|is_between, ":ally", trp_npc_adonja, trp_kingdom_1_lord),
- # (eq, ":ally", trp_player),
- (store_skill_level, ":npc_skl",skl_ironflesh, ":ally"),
- (store_skill_level, ":player_foot", skl_athletics, ":ally"),
- (assign, ":bone", ":npc_skl"),
- (try_begin),
- (val_sub, ":damage", ":bone"),
- (val_mul, ":bone", -8),#减伤8%*铁骨等级
- (val_add, ":bone", 100),
- (val_mul, ":damage", ":bone"),
- (val_div, ":damage", 100),
- (assign, ":damage_iron", ":damage"),
- (try_begin),
- (is_between, ":npc_skl", 1, 5), #铁骨1~4级,半血以下伤害减半
- (store_agent_hit_points, ":hps", ":bgjz"),
- (le, ":hps", 50),
- (val_div, ":damage", 2),#血量低于50% 伤害在原有基础上再减伤2分之一
- (set_trigger_result, ":damage"),
- (else_try),
- (is_between, ":npc_skl", 5, 11), #铁骨5~10级
- (ge, ":damage_iron", 10), #铁骨8%减伤后,伤害大于10点,减半
- (val_div, ":damage", 2),
- (store_agent_hit_points, ":hps", ":bgjz"),
- (le, ":hps", 50),
- (val_div, ":damage", 2),#血量低于50% 伤害在原有基础上再减伤2分之一
- (set_trigger_result, ":damage"),
- (set_trigger_result, ":damage"),
- (set_trigger_result, ":damage"),
- (try_end),
- (gt, ":player_foot", 0), #跑动增加伤害闪避效果
- (try_begin),
- (val_mul, ":player_foot", 5), #每级跑动增加5%闪避概率
- (store_random_in_range, ":random_f", 0, 100), #循环100
- (is_between, ":random_f", 0, ":player_foot"), #概率数字范围
- (val_mul, ":damage", 0),
- (set_trigger_result, ":damage"),
- (set_trigger_result, ":damage"),
- (try_end),
- (set_trigger_result, ":damage"),
- (try_end),
- (set_trigger_result, ":damage"),
- (try_end),
- (set_trigger_result, ":damage"),
- # (agent_get_troop_id, ":allyer", ":bgjz"),
- # (neg|troop_is_hero, ":allyer"),
- # (agent_get_troop_id, ":playarmy", ":player_no"),
- # (store_skill_level, ":player_army", skl_leadership, ":playarmy"),
- # (assign, ":army", ":player_army"),
- # (gt, ":army", 0),
- # (val_mul, ":army", -5),
- # (val_add, ":army", 100),
- # (val_mul, ":damage", ":army"),#减伤damage * (1-统御等级*5%)
- # (val_div, ":damage", 100),
- # (set_trigger_result, ":damage"),
- # (try_end),
- # (else_try),
- (else_try),
- (neg|agent_is_ally, ":bgjz"),#友军npc,玩家,每级武器掌握技能获得5%概率增加所持武器1点熟练度
- (agent_is_ally, ":gjz"),
- (agent_get_troop_id, ":ally_npc", ":gjz"),
- (troop_is_hero, ":ally_npc"),
- # (this_or_next|is_between, ":ally_npc", trp_npc_adonja, trp_kingdom_1_lord),
- # (eq, ":ally_npc", trp_player),
- (try_begin),
- (store_skill_level, ":npc_wm", skl_weapon_master, ":ally_npc"),
- (agent_get_wielded_item, ":item_no", ":gjz", 0),
- (gt, ":item_no", 0),
- (item_get_type, ":type", ":item_no"),
- (gt, ":npc_wm", 0),
- (val_mul, ":npc_wm", 5), #每级武器掌握技能获得5%概率
- (store_random_in_range, ":random", 0, 100), #循环100个数字
- (is_between, ":random", 0, ":npc_wm"), #概率数字范围
- (store_random_in_range, ":random_p", 1, 2), #1点熟练度
- (try_begin),
- (eq, ":type", itp_type_one_handed_wpn),
- (troop_raise_proficiency_linear, ":ally_npc", wpt_one_handed_weapon, ":random_p"),
- # (eq, ":gjz", ":player_no"),
- # (display_message, "@额 外 获 得 单 手 武 器 熟 练 度 1~3点 ", 0xFF00FF00),
- (else_try),
- (eq, ":type", itp_type_two_handed_wpn),
- (troop_raise_proficiency_linear, ":ally_npc", wpt_two_handed_weapon, ":random_p"),
- # (eq, ":gjz", ":player_no"),
- # (display_message, "@额 外 获 得 双 手 武 器 熟 练 度 1~3点 ", 0xFF00FF00),
- (else_try),
- (eq, ":type", itp_type_polearm),
- (troop_raise_proficiency_linear, ":ally_npc", wpt_polearm, ":random_p"),
- # (eq, ":gjz", ":player_no"),
- # (display_message, "@额 外 获 得 长 杆 武 器 熟 练 度 1~3点 ", 0xFF00FF00),
- (else_try),
- (eq, ":type", itp_type_bow),
- (troop_raise_proficiency_linear, ":ally_npc", wpt_archery, ":random_p"),
- # (eq, ":gjz", ":player_no"),
- # (display_message, "@额 外 获 得 弓 熟 练 度 1~3点 ", 0xFF00FF00),
- (else_try),
- (eq, ":type", itp_type_crossbow),
- (troop_raise_proficiency_linear, ":ally_npc", wpt_crossbow, ":random_p"),
- # (eq, ":gjz", ":player_no"),
- # (display_message, "@额 外 获 得 弩 熟 练 度 1~3点 ", 0xFF00FF00),
- (else_try),
- (eq, ":type", itp_type_thrown),
- (troop_raise_proficiency_linear, ":ally_npc", wpt_throwing, ":random_p"),
- # (eq, ":gjz", ":player_no"),
- # (display_message, "@额 外 获 得 投 掷 熟 练 度 1~3点 ", 0xFF00FF00),
- (try_end),
- (set_trigger_result, ":damage"),
- (set_trigger_result, ":damage"),
- (else_try),
- (store_skill_level, ":npc_ps", skl_power_strike, ":ally_npc"), #强击增加暴击伤害
- (store_agent_hit_points, ":g_hps", ":gjz"),
- (assign, ":power_dam", ":npc_ps"),
- (gt, ":npc_ps", 0),
- (try_begin),
- (val_mul, ":npc_ps", 5), #每级强击增加5%暴击几率
- (store_random_in_range, ":random_pd", 0, 100), #循环100个数字
- (is_between, ":random_pd", 0, ":npc_ps"), #随机数字范围
- (val_mul, ":power_dam", 10),
- (val_add, ":power_dam", 100),
- (val_mul, ":damage", ":power_dam"), #每级额外10%暴击伤害
- (val_div, ":damage", 100),
- (try_begin),
- (is_between, ":g_hps", 25, 50), #半血下暴击伤害*2
- (val_mul, ":damage", 2),
- (set_trigger_result, ":damage"),
- (set_trigger_result, ":damage"),
- (else_try),
- (is_between, ":g_hps", 1, 25), #1/4血量暴击伤害*3
- (val_mul, ":damage", 3),
- (set_trigger_result, ":damage"),
- (set_trigger_result, ":damage"),
- (try_end),
- (set_trigger_result, ":damage"),
- (set_trigger_result, ":damage"),
- (try_end),
- (set_trigger_result, ":damage"),
- (try_end),
- (set_trigger_result, ":damage"),
- (try_end),
-
- ]),
-
-
- # 预瞄AI
- (0.5, 0, 0, [],
- [
- (try_for_agents, ":ags"),
- (agent_is_non_player, ":ags"),
- (agent_is_active, ":ags"),
- (agent_is_alive, ":ags"),
- (agent_is_human, ":ags"),
- (agent_is_ally, ":ags"),
- #仅NPC有效↓
- (agent_get_troop_id, ":troop_no", ":ags"),
- (troop_is_hero, ":troop_no"),
- #仅NPC有效↑
- (agent_slot_eq, ":ags", slot_agent_is_running_away, 0), #isnt fleeing
- (agent_get_combat_state, ":state", ":ags"),
- (eq, ":state", 3),
- (agent_get_attack_action, ":action", ":ags"),
- (neq, ":action", 5), #reloading = 5,
- (agent_get_team, ":ags_team", ":ags"),
- (assign, ":is_shooting", 0),
- (assign, ":speed", 0),
- (try_for_range, ":hand_no", 0, 2),
- (agent_get_wielded_item, ":item_no", ":ags", ":hand_no"),
- (neq, ":item_no", -1),
- (item_get_type, ":type", ":item_no"),
- (this_or_next|eq, ":type", itp_type_bow),
- (this_or_next|eq, ":type", itp_type_crossbow),
- (this_or_next|eq, ":type", itp_type_thrown),
- (eq, ":type", itp_type_pistol),
- (assign, ":is_shooting", 1),
- (item_get_missile_speed, ":speed", ":type"),
- (try_end),
- (eq, ":is_shooting", 1),
- (agent_ai_get_look_target,":possible",":ags"),
- (gt,":possible",0), #there is at least someone
- (agent_is_active, ":possible"),
- (agent_is_alive, ":possible"),
- (agent_is_human, ":possible"),
- (agent_get_team, ":possible_team", ":possible"),
- (neq, ":possible_team", ":ags_team"), #unfriendly teams
- (agent_get_position, pos11, ":possible"),
- (agent_get_position, pos12, ":ags"),
- (neg|position_is_behind_position, pos11, pos12), #agents are not behind each other
- (get_distance_between_positions, ":dist", pos11, pos12),
- (agent_get_speed, pos5, ":possible"),
- (position_get_x, reg41, pos5),
- (position_get_y, reg42, pos5),
- (assign,":continue",1),
- (try_for_range,":target_bone", 0, 9),
- (eq,":continue",1),
- (le, ":dist", 1000),#
- (le, reg41, 1),
- (le, reg42, 1),#not moving and not far away
- (try_begin),
- (this_or_next|eq,":target_bone", 2),
- (this_or_next|eq,":target_bone", 3),
- (this_or_next|eq,":target_bone", 5),
- (eq,":target_bone", 6),
- (assign,":target_bone", 0),
- (try_end),
- (agent_get_bone_position, pos21, ":possible", ":target_bone", 1), # pos21 = target BONE pos
- (position_has_line_of_sight_to_position, pos21,pos12),
- (store_random_in_range,":dice",-20,1),
- (gt,":dice",-5),
- (position_get_rotation_around_z, ":value", pos21),
- (val_mul, ":value", -1),
- (position_rotate_z,pos21, ":value"),
- (position_move_z, pos21,":dice",1),
- (agent_set_look_target_position, ":ags", pos21),
- (agent_set_attack_action, ":ags", 3, 0), # enforce shooting
- (assign,":continue",0),
- (try_end),
- (eq,":continue",1),
- (gt, ":dist", 400),#
- (gt, ":speed", 0),#
- (store_div, ":fix", ":dist", ":speed"),#\
- # (assign,reg51, reg41),#copy
- # (assign,reg52, reg42),
- # (display_message,"@X: {reg45},Y: {reg46},"),
- #(display_message,"@X: {reg41},Y: {reg42},Speed"),
- (val_mul,reg41,":fix"),
- (val_mul,reg42,":fix"),
- (val_mul, reg41,7),
- (val_div, reg41,100),
- (val_mul, reg42,7),
- (val_div, reg42,100),
- (agent_get_bone_position, pos21, ":possible", 0, 1), # pos21 = target BONE pos
-
- #same rotation to use speed.
- (position_get_rotation_around_x, ":value", pos21),
- (position_get_rotation_around_x, ":value_local", pos11),
- (val_mul, ":value", -1),
- (position_rotate_x,pos21, ":value"),
- (position_rotate_x,pos21, ":value_local"),
- (position_get_rotation_around_y, ":value", pos21),
- (position_get_rotation_around_y, ":value_local", pos11),
- (val_mul, ":value", -1),
- (position_rotate_y,pos21, ":value"),
- (position_rotate_y,pos21, ":value_local"),
-
- (position_get_rotation_around_z, ":value", pos21),
- (position_get_rotation_around_z, ":value_local", pos11),
- (val_mul, ":value", -1),
- (position_rotate_z,pos21, ":value"),
- (position_rotate_z,pos21, ":value_local"),
-
- (val_mul, ":fix",13),
- (val_div, ":fix",9),
- (val_sub,":fix",40),
- (store_random_in_range,":random_offset",-10,11),
- (val_add,":fix",":random_offset"),
- (position_move_z, pos21,":fix",1),
- (position_move_z, pos12,50,1),
- (try_begin),
- (position_has_line_of_sight_to_position,pos21,pos12),
- # (store_random_in_range,":random_offset",-10,11),
- # (val_add,reg41,":random_offset"),
- (position_move_x,pos21,reg41,0),
- # (store_random_in_range,":random_offset",-10,11),
- # (val_add,reg42,":random_offset"),
- (position_move_y,pos21,reg42,0),
- (agent_set_look_target_position, ":ags", pos21),
- (agent_set_attack_action, ":ags", 3, 0), # enforce shooting
- (try_end),
- (try_end),
- ]),
复制代码
|