[OSP] Camel Kit!
Скрипт, задающий верблюдам способность пугать лошадей. Приятное дополнение к этому верблюду - CAMEL MODEL.
Добавьте это к самому верху module_mission_templates:
Код:
from header_skills import *
from module_skills import *
Добавьте этот кусочек в начало module_mission_templates, выше check_belfy_movement... Тут 2 версии кусочка:
Старая версия, все лошади пугаются верблюдов:
Код:
horses_spook = (
2, 0, 0, [],#Every six seconds
[
(try_for_agents, ":cur_agent"),
(try_begin),
(neg|agent_is_human,":cur_agent"),
(agent_is_alive,":cur_agent"),
(agent_get_item_id,":horse_type", ":cur_agent"),
(try_for_range,":camel",camels_begin,camels_end),
(eq,":horse_type",":camel"),#If this horse is a camel
(agent_get_position,pos2,":cur_agent"),
(try_for_agents,":enemy_horse"),
(assign,":canspook",1),
(neg|agent_is_human,":enemy_horse"),#See if its a horse
(agent_is_alive,":enemy_horse"),#Make sure he's not dead
(agent_get_item_id,":enemy_horse_type",":enemy_horse"),
(try_for_range,":camel",camels_begin,camels_end),
(eq,":enemy_horse_type",":camel"),#Can't scare other camels
(assign,":canspook",0),
(try_end),
(store_random_in_range,":chance",1,11),
(agent_get_rider,":enemy_rider",":enemy_horse"),
(agent_get_troop_id,":ridertroop",":enemy_rider"),
(store_skill_level,":riding",skl_riding,":ridertroop"),
(val_add,":chance",":riding"),
(try_begin),
(ge,":chance",10),
(assign,":canspook",0),
(end_try),
(try_begin),
(eq,":canspook",1),
(agent_get_position,pos1,":enemy_horse"),
(get_distance_between_positions,":dist",pos1,pos2),#In CM
(try_begin),
(le,":dist",3500),#Within 35m
(agent_set_animation,":enemy_horse","anim_horse_rear"),
(try_end),
(try_end),
(try_end),
(try_end),
(try_end),
(try_end)])
Новая версия. Союзные с верблюдами лошади не пугаются:
Код:
horses_spook = (
6, 0, 0, [],#Every six seconds
[
(try_for_agents,":cur_horse"),
(agent_is_alive,":cur_horse"),
(agent_get_item_id,":horse_type",":cur_horse"),
(is_between,":horse_type",camels_begin,camels_end),
(agent_get_position,pos2,":cur_horse"),
(agent_get_rider,":cur_rider",":cur_horse"),# Store rider info from camel
(gt, ":cur_rider", -1),# Camel has rider (greater thn -1)
(agent_get_team,":agent_team",":cur_rider"),# Store camel rider info, what team is he?
(try_for_agents,":enemy_horse"),# Then check enemy horse
(agent_is_alive,":enemy_horse"),#Make sure he's not dead
(neg|agent_is_human, ":enemy_horse"),
(agent_get_item_id,":enemy_horse_type",":enemy_horse"),
(neg|is_between, ":enemy_horse_type", camels_begin,camels_end),
(agent_get_position, pos1,":enemy_horse"),
(get_distance_between_positions,":dist",pos1,pos2),#In CM
(le,":dist",3500),#Within 35m
(store_random_in_range,":chance",1,11),
(try_begin),# Check if opposing team, apply horse spook. If not, don't
(agent_get_rider,":enemy_rider",":enemy_horse"),
(gt, ":enemy_rider", -1),
(agent_get_team,":enemy_team",":enemy_rider"),
(try_begin),
(teams_are_enemies,":agent_team",":enemy_team"),
(agent_get_troop_id,":enemy_rider",":enemy_rider"),
(store_skill_level,":riding","skl_riding",":enemy_rider"),
(else_try),
(assign,":riding", 99),
(try_end),
(val_add,":chance",":riding"),
(try_end),
(lt, ":chance", 10),
(agent_play_sound, ":enemy_horse", "snd_horse_low_whinny"),# gives sound
(agent_set_animation,":enemy_horse","anim_horse_rear"),
(try_end),# try_for_agents enemy_horse
(try_end),
]
)
Затем вызывайте horses_spook в каждом типе миссии, в котором вы хотите, чтобы это произошло. Очевидно, во время осады в этом скрипте нет необходимости.
Затем добавьте это где-нибудь в module_constants:
Код:
camels_begin = "itm_pack_camel"
camels_end = "itm_arrows"
А вот и типы предметов.
Код:
##CAMELS!!
##Bactrian Camels
["pack_camel","Pack Camel", [("sumpter_horse",0)], itp_merchandise|itp_type_horse, 0, 134,abundance(90)|hit_points(120)|body_armor(14)|difficulty(2)|horse_speed(27)|horse_maneuver(42)|horse_charge(11)|horse_scale(120),imodbits_horse_basic],
##Dromedary
["riding_camel","Riding Camel", [("sumpter_horse",0)], itp_merchandise|itp_type_horse, 0, 487,abundance(90)|hit_points(120)|body_armor(14)|difficulty(4)|horse_speed(32)|horse_maneuver(45)|horse_charge(14)|horse_scale(123),imodbits_horse_basic],
##Noble's Camel - Bred for speed
["nobles_camel","Noble's Camel", [("sumpter_horse",0)], itp_merchandise|itp_type_horse, 0, 1011,abundance(90)|hit_points(133)|body_armor(14)|difficulty(4)|horse_speed(39)|horse_maneuver(44)|horse_charge(14)|horse_scale(125),imodbits_horse_basic],
##Highly Trained - Camelphracts - Able to carry loads better than horses, so has heavier armor
["war_camel","War Camel", [("sumpter_horse",0)], itp_merchandise|itp_type_horse, 0, 1555,abundance(90)|hit_points(180)|body_armor(45)|difficulty(4)|horse_speed(28)|horse_maneuver(38)|horse_charge(25)|horse_scale(127),imodbits_horse_basic],
Комментариев 8
Посетители, находящиеся в группе Гости, не могут оставлять комментарии к данной публикации.