使用范围dialoag.py
效果为80好感以上可以与领主对话,获得精英部队任务训练,我在自己mod里设置为需要40个城镇中招募的高阶基础兵种和20000円才能与领主对话继续任务。
在引用时的需要调整的部分已经标出
- ####精英部队
- [anyone,"lord_talk",
- [
- (neg|check_quest_active, "qst_extra_quest_train_soldier"),#是否激活精英部队任务
- (troop_get_slot, ":sp_troop", "$g_talk_troop", slot_troop_custom_army),
- (assign, ":result", 0),#检查好感
- (call_script, "script_troop_get_relation_with_troop", "trp_player", "$g_talk_troop"),
- (try_begin),
- (eq, "$g_talk_troop_faction", "$players_kingdom"),
- (ge, reg0, 1),
- (assign, ":result", 1),
- (try_end),
- (eq, ":result", 1),
- ],
- "you solier is so great do you ?", "train_soldier_1_0",[]],
- [anyone,"train_soldier_1_0", [],"I know what you are thinking about,what about making a deal?", "train_soldier_1_1",[]],
- [anyone|plyr,"train_soldier_1_1", [],"What deal?", "train_soldier_1_2",[]],
- [anyone,"train_soldier_1_2", [],"I have already known that you have thoughts in the elite troops in my country early enough.I suppose,I can organize you a elite troop if you are willing to,how do you think?", "train_soldier_1_3",[]],
- [anyone|plyr,"train_soldier_1_3", [],"Really?!", "train_soldier_1_4",[]],
- [anyone|plyr,"train_soldier_1_4", [],"No,I don't need anymore,there are all elites in my troop.", "close_window",[(eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1),]],
- [anyone,"train_soldier_1_4", [],"Surely,but this is never free to you,and it require some kinds of payment.Do you understand my shallow hints?", "train_soldier_1_5",[]],
- [anyone|plyr,"train_soldier_1_5", [],"Just tell me what you want.", "train_soldier_1_6",[]],
- [anyone,"train_soldier_1_6", [],"I can have you a troop of elite soldiers,but you need to select your best soldiers to send to my troop first.", "train_soldier_1_7",[]],
- [anyone|plyr,"train_soldier_1_7", [],"EM,OK.", "train_soldier_1_8",[]],
- [anyone,"train_soldier_1_8", [],"And the training and equipment are all on your bills.", "train_soldier_1_9",[]],
- [anyone|plyr,"train_soldier_1_9", [],"And then?", "train_soldier_1_10",[]],
- [anyone,"train_soldier_1_10", [
- (store_troop_faction, ":faction", "$g_talk_troop"),
- (faction_get_slot, ":culture", ":faction", slot_faction_culture),
- (faction_get_slot, ":quest_object_troop", ":culture", slot_faction_tier_nobe_troop),#nobe—troop为我mod中的贵族兵种,这部分调用时应该根据自身mod调整
- (str_store_troop_name, s13, ":quest_object_troop"),#检查文化并锁定对应的基础部队
- ],"Give me 40 {s13} in ten days and give me 20000 dinoar,I can send you a troop of elites.Is that alright for you?", "train_soldier_1_11",[]],
- [anyone|plyr,"train_soldier_1_11", [],"Sure!", "train_soldier_1_12",[]],
- [anyone|plyr,"train_soldier_1_12", [],"Too expensive,I can have train a battalion out of these P-points.", "close_window",[(eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1)]],
- [anyone,"train_soldier_1_12",[],"Okay,spare me some time......", "train_soldier_1_13",[]],
- ####精英部队对话
复制代码
以上为在对话中加入任务发布
- ###军事进修
- [anyone,"train_soldier_1_12", [],
- "Okay,but you are not prepared for it now,get the soldiers I needed and the fund all in place first and then come to me.", "close_window",
- [
- (str_store_troop_name_link, s10, "$g_talk_troop"),
- (store_troop_faction, ":faction", "$g_talk_troop"),
- (faction_get_slot, ":culture", ":faction", slot_faction_culture),
- (faction_get_slot, ":quest_object_troop", ":culture", slot_faction_tier_nobe_troop),
- (str_store_troop_name, s11, ":quest_object_troop"),
- (str_store_string, s2, "str_extra_quest_message_6"),
- (call_script,"script_start_quest","qst_extra_quest_train_soldier", "$g_talk_troop"),
- (quest_set_slot, "qst_extra_quest_train_soldier", slot_quest_current_state, 1),
- (quest_set_slot, "qst_extra_quest_train_soldier", slot_quest_giver_troop, "$g_talk_troop"),
- (quest_set_slot, "qst_extra_quest_train_soldier", slot_quest_object_troop,":quest_object_troop"),
- (quest_set_slot, "qst_extra_quest_train_soldier", slot_quest_expiration_days, 30),#任务现实
- (eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1),
- ]],
-
- [anyone|plyr,"lord_talk", [
- (check_quest_active, "qst_extra_quest_train_soldier"),
- (quest_slot_eq, "qst_extra_quest_train_soldier", slot_quest_current_state, 1),
- (quest_slot_eq, "qst_extra_quest_train_soldier", slot_quest_giver_troop, "$g_talk_troop"),
- (store_troop_gold, ":gold", "trp_player"),(ge, ":gold", 20000),#检查资金是否充足
- (quest_get_slot, ":quest_object_troop", "qst_extra_quest_train_soldier", slot_quest_object_troop),
- (party_count_members_of_type, ":num", "p_main_party", ":quest_object_troop"),
- (ge, ":num", 40),#检查是否有40个城镇部队
- (str_store_troop_name, s13, ":quest_object_troop"),
- ],"I have 40 {13} and 20000 p here.", "train_soldier_1_13",[]],
- [anyone|plyr,"train_soldier_1_13", [],"How long will it take?", "train_soldier_1_14",[]],
- [anyone,"train_soldier_1_14", [],"Em......it's done!", "train_soldier_1_15",[]],
- [anyone|plyr,"train_soldier_1_15", [],"Ah?", "train_soldier_1_16",[]],
- [anyone,"train_soldier_1_16", [],"Okay,here is your well trained elite troop.", "train_soldier_1_17",
- [
- (store_random_in_range, reg2, 5, 20),#随机提供5-20的随机数
- (store_troop_gold, ":gold", "trp_player"), (ge, ":gold", 20000),
- (store_troop_faction, ":faction", "$g_talk_troop"),
- (troop_get_slot, ":sp_troop", "$g_talk_troop", slot_troop_custom_army),
- (gt, ":sp_troop", 0),
- (party_add_members, "p_main_party", ":sp_troop", reg2),
- (check_quest_active, "qst_extra_quest_train_soldier"),
- (call_script, "script_end_quest", "qst_extra_quest_train_soldier"),
- (faction_get_slot, ":culture", ":faction", slot_faction_culture),
- (faction_get_slot, ":quest_object_troop", ":culture", slot_faction_tier_nobe_troop),
- (party_count_members_of_type, ":num", "p_main_party", ":quest_object_troop"),
- (ge, ":num", 40),
- (party_remove_members, "p_main_party", ":quest_object_troop", 40),#删兵
- (troop_remove_gold, "trp_player", 20000),#扣钱
- (quest_set_slot, "qst_extra_quest_train_soldier", slot_quest_current_state, 0),
- ]],
- [anyone|plyr,"train_soldier_1_17", [],"Okay,I'll have it.", "close_window", [(eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1),]],
- [anyone|plyr,"train_soldier_1_17", [],"Why so soon?", "train_soldier_1_18",[]],
- [anyone,"train_soldier_1_18", [],"I have special training methods.", "train_soldier_1_19",[]],
- [anyone|plyr,"train_soldier_1_19", [],"Oh,okay,nothing more.", "close_window",
- [(eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1),]],
- [anyone|plyr,"train_soldier_1_19", [],"I gave you 40 but why only {reg2} are back?", "train_soldier_1_20",[]],
- [anyone,"train_soldier_1_20", [],"It’s because they failed when strengthening,so they vanished.", "train_soldier_1_21",[]],
- [anyone|plyr,"train_soldier_1_21", [],"Poo!", "train_soldier_1_22",[]],
- [anyone,"train_soldier_1_22", [],"Just a joke!Ha ha ha!It's they can't stand high-intensity training so they got angry and left.Look at your weird face!Ha ha ha ha!", "close_window",[(call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_talk_troop", 3),]],
- ###军事进修
复制代码
以下为script中调用部分
- ("end_quest",
- [
- (store_script_param, ":quest_no", 1),
- (str_clear, s1),
- (add_quest_note_from_sreg, ":quest_no", 0, s1, 0),
- (add_quest_note_from_sreg, ":quest_no", 1, s1, 0),
- (add_quest_note_from_sreg, ":quest_no", 2, s1, 0),
- (add_quest_note_from_sreg, ":quest_no", 3, s1, 0),
- (add_quest_note_from_sreg, ":quest_no", 4, s1, 0),
- (add_quest_note_from_sreg, ":quest_no", 5, s1, 0),
- (add_quest_note_from_sreg, ":quest_no", 6, s1, 0),
- (add_quest_note_from_sreg, ":quest_no", 7, s1, 0),
- (try_begin),
- (neg|check_quest_failed, ":quest_no"),
- (val_add, "$g_total_quests_completed", 1),
- (try_end),
- (try_begin),
- (eq, ":quest_no", "qst_consult_with_minister"),
- (assign, "$g_minister_notification_quest", 0),
- (try_end),
- (complete_quest, ":quest_no"),
- (try_begin),
- (is_between, ":quest_no", mayor_quests_begin, mayor_quests_end),
- (assign, "$merchant_quest_last_offerer", -1),
- (assign, "$merchant_offered_quest", -1),
- (try_end),
- ]),
复制代码
以下为quest中添加任务栏
("extra_quest_train_soldier", "train_soldier", 0, "{!}train_soldier"),
|