骑马与砍杀中文站论坛

 找回密码
 注册(Register!)

QQ登录

只需一步,快速开始

搜索
购买CDKEY 小黑盒加速器
查看: 5242|回复: 3

[功能与代码] 【抛砖引玉】一个训练领主专属部队的任务对话

[复制链接]

10

主题

13

回帖

12

积分

随仆

Rank: 1

UID
3005850
第纳尔
256
精华
0
互助
1
荣誉
0
贡献
0
魅力
1
注册时间
2018-6-6
鲜花(5) 鸡蛋(0)
发表于 2020-10-11 18:14:28 | 显示全部楼层 |阅读模式
使用范围dialoag.py
效果为80好感以上可以与领主对话,获得精英部队任务训练,我在自己mod里设置为需要40个城镇中招募的高阶基础兵种和20000円才能与领主对话继续任务。
在引用时的需要调整的部分已经标出
  1. ####精英部队
  2.   [anyone,"lord_talk",
  3.   [
  4.         (neg|check_quest_active, "qst_extra_quest_train_soldier"),#是否激活精英部队任务
  5.         (troop_get_slot, ":sp_troop", "$g_talk_troop", slot_troop_custom_army),
  6.         (assign, ":result", 0),#检查好感
  7.     (call_script, "script_troop_get_relation_with_troop", "trp_player", "$g_talk_troop"),
  8.     (try_begin),
  9.         (eq, "$g_talk_troop_faction", "$players_kingdom"),
  10.         (ge, reg0, 1),
  11.         (assign, ":result", 1),
  12.     (try_end),
  13.     (eq, ":result", 1),

  14.   ],
  15.    "you solier is so great do you ?", "train_soldier_1_0",[]],
  16.   [anyone,"train_soldier_1_0", [],"I know what you are thinking about,what about making a deal?", "train_soldier_1_1",[]],
  17.   [anyone|plyr,"train_soldier_1_1", [],"What deal?", "train_soldier_1_2",[]],
  18.   [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",[]],
  19.   [anyone|plyr,"train_soldier_1_3", [],"Really?!", "train_soldier_1_4",[]],
  20.   [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),]],
  21.   [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",[]],
  22.   [anyone|plyr,"train_soldier_1_5", [],"Just tell me what you want.", "train_soldier_1_6",[]],
  23.   [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",[]],
  24.   [anyone|plyr,"train_soldier_1_7", [],"EM,OK.", "train_soldier_1_8",[]],
  25.   [anyone,"train_soldier_1_8", [],"And the training and equipment are all on your bills.", "train_soldier_1_9",[]],
  26.   [anyone|plyr,"train_soldier_1_9", [],"And then?", "train_soldier_1_10",[]],
  27.   [anyone,"train_soldier_1_10", [
  28.         (store_troop_faction, ":faction", "$g_talk_troop"),
  29.         (faction_get_slot, ":culture", ":faction", slot_faction_culture),
  30.         (faction_get_slot, ":quest_object_troop", ":culture", slot_faction_tier_nobe_troop),#nobe—troop为我mod中的贵族兵种,这部分调用时应该根据自身mod调整
  31.         (str_store_troop_name, s13, ":quest_object_troop"),#检查文化并锁定对应的基础部队
  32.   ],"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",[]],
  33.   [anyone|plyr,"train_soldier_1_11", [],"Sure!", "train_soldier_1_12",[]],
  34.   [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)]],
  35.   [anyone,"train_soldier_1_12",[],"Okay,spare me some time......", "train_soldier_1_13",[]],


  36. ####精英部队对话
复制代码

以上为在对话中加入任务发布
  1. ###军事进修
  2.   [anyone,"train_soldier_1_12", [],
  3. "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",
  4.   [
  5.         (str_store_troop_name_link, s10, "$g_talk_troop"),
  6.         (store_troop_faction, ":faction", "$g_talk_troop"),
  7.         (faction_get_slot, ":culture", ":faction", slot_faction_culture),
  8.         (faction_get_slot, ":quest_object_troop", ":culture", slot_faction_tier_nobe_troop),
  9.         (str_store_troop_name, s11, ":quest_object_troop"),
  10.         (str_store_string, s2, "str_extra_quest_message_6"),
  11.         (call_script,"script_start_quest","qst_extra_quest_train_soldier", "$g_talk_troop"),
  12.         (quest_set_slot, "qst_extra_quest_train_soldier", slot_quest_current_state, 1),
  13.         (quest_set_slot, "qst_extra_quest_train_soldier", slot_quest_giver_troop, "$g_talk_troop"),
  14.         (quest_set_slot, "qst_extra_quest_train_soldier", slot_quest_object_troop,":quest_object_troop"),
  15.         (quest_set_slot, "qst_extra_quest_train_soldier", slot_quest_expiration_days, 30),#任务现实
  16.         (eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1),
  17.   ]],
  18.   
  19.    [anyone|plyr,"lord_talk", [
  20.         (check_quest_active, "qst_extra_quest_train_soldier"),
  21.         (quest_slot_eq, "qst_extra_quest_train_soldier", slot_quest_current_state, 1),
  22.         (quest_slot_eq, "qst_extra_quest_train_soldier", slot_quest_giver_troop, "$g_talk_troop"),
  23.         (store_troop_gold, ":gold", "trp_player"),(ge, ":gold", 20000),#检查资金是否充足
  24.         (quest_get_slot, ":quest_object_troop", "qst_extra_quest_train_soldier", slot_quest_object_troop),
  25.         (party_count_members_of_type, ":num", "p_main_party", ":quest_object_troop"),
  26.         (ge, ":num", 40),#检查是否有40个城镇部队
  27.         (str_store_troop_name, s13, ":quest_object_troop"),
  28.     ],"I have 40 {13} and 20000 p here.", "train_soldier_1_13",[]],
  29.   [anyone|plyr,"train_soldier_1_13", [],"How long will it take?", "train_soldier_1_14",[]],
  30.   [anyone,"train_soldier_1_14",  [],"Em......it's done!", "train_soldier_1_15",[]],
  31.   [anyone|plyr,"train_soldier_1_15", [],"Ah?", "train_soldier_1_16",[]],
  32.   [anyone,"train_soldier_1_16", [],"Okay,here is your well trained elite troop.", "train_soldier_1_17",
  33.   [
  34.         (store_random_in_range, reg2, 5, 20),#随机提供5-20的随机数
  35.     (store_troop_gold, ":gold", "trp_player"), (ge, ":gold", 20000),
  36.     (store_troop_faction, ":faction", "$g_talk_troop"),
  37.         (troop_get_slot, ":sp_troop", "$g_talk_troop", slot_troop_custom_army),
  38.         (gt, ":sp_troop", 0),
  39.         (party_add_members, "p_main_party", ":sp_troop", reg2),
  40.         (check_quest_active, "qst_extra_quest_train_soldier"),
  41.         (call_script, "script_end_quest", "qst_extra_quest_train_soldier"),
  42.       (faction_get_slot, ":culture", ":faction", slot_faction_culture),
  43.       (faction_get_slot, ":quest_object_troop", ":culture", slot_faction_tier_nobe_troop),
  44.       (party_count_members_of_type, ":num", "p_main_party", ":quest_object_troop"),
  45.       (ge, ":num", 40),
  46.       (party_remove_members, "p_main_party", ":quest_object_troop", 40),#删兵
  47.       (troop_remove_gold, "trp_player", 20000),#扣钱
  48.         (quest_set_slot, "qst_extra_quest_train_soldier", slot_quest_current_state, 0),
  49. ]],
  50.   [anyone|plyr,"train_soldier_1_17", [],"Okay,I'll have it.", "close_window",  [(eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1),]],
  51.   [anyone|plyr,"train_soldier_1_17", [],"Why so soon?", "train_soldier_1_18",[]],
  52.   [anyone,"train_soldier_1_18", [],"I have special training methods.", "train_soldier_1_19",[]],
  53.   [anyone|plyr,"train_soldier_1_19", [],"Oh,okay,nothing more.", "close_window",
  54. [(eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1),]],
  55.   [anyone|plyr,"train_soldier_1_19", [],"I gave you 40 but why only {reg2} are back?", "train_soldier_1_20",[]],
  56.   [anyone,"train_soldier_1_20", [],"It’s because they failed when strengthening,so they vanished.", "train_soldier_1_21",[]],
  57.   [anyone|plyr,"train_soldier_1_21", [],"Poo!", "train_soldier_1_22",[]],
  58.   [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),]],

  59. ###军事进修
复制代码

以下为script中调用部分
  1. ("end_quest",
  2.     [
  3.       (store_script_param, ":quest_no", 1),
  4.       (str_clear, s1),
  5.       (add_quest_note_from_sreg, ":quest_no", 0, s1, 0),
  6.       (add_quest_note_from_sreg, ":quest_no", 1, s1, 0),
  7.       (add_quest_note_from_sreg, ":quest_no", 2, s1, 0),
  8.       (add_quest_note_from_sreg, ":quest_no", 3, s1, 0),
  9.       (add_quest_note_from_sreg, ":quest_no", 4, s1, 0),
  10.       (add_quest_note_from_sreg, ":quest_no", 5, s1, 0),
  11.       (add_quest_note_from_sreg, ":quest_no", 6, s1, 0),
  12.       (add_quest_note_from_sreg, ":quest_no", 7, s1, 0),
  13.       (try_begin),
  14.         (neg|check_quest_failed, ":quest_no"),
  15.         (val_add, "$g_total_quests_completed", 1),
  16.       (try_end),
  17.       (try_begin),
  18.         (eq, ":quest_no", "qst_consult_with_minister"),
  19.         (assign, "$g_minister_notification_quest", 0),
  20.       (try_end),
  21.       (complete_quest, ":quest_no"),
  22.       (try_begin),
  23.         (is_between, ":quest_no", mayor_quests_begin, mayor_quests_end),
  24.         (assign, "$merchant_quest_last_offerer", -1),
  25.         (assign, "$merchant_offered_quest", -1),
  26.       (try_end),
  27.     ]),
复制代码

以下为quest中添加任务栏
("extra_quest_train_soldier", "train_soldier", 0, "{!}train_soldier"),

评分

参与人数 1第纳尔 +10 互助 +1 收起 理由
Aomine Daiki + 10 + 1 文章不错,继续努力!

查看全部评分

13

主题

82

回帖

29

积分

扈从

Rank: 2Rank: 2

UID
3118799
第纳尔
340
精华
0
互助
0
荣誉
0
贡献
0
魅力
0
注册时间
2019-11-21
鲜花(2) 鸡蛋(0)
发表于 2020-12-31 20:18:50 | 显示全部楼层
感谢分享,收藏了

54

主题

899

回帖

341

积分

见习骑士

游骑士战队[YQS]
联机ID:Apple_PAI

Rank: 3

UID
3218444
第纳尔
106
精华
0
互助
11
荣誉
0
贡献
0
魅力
26
注册时间
2021-1-30

战团正版勋章2022国庆青训杯冠军勋章第一届拿破仑中国刺刀联赛近卫勋章霸主正版勋章拿破仑正版勋章

鲜花(110) 鸡蛋(0)
发表于 2021-12-10 20:05:31 | 显示全部楼层
怎么没人呢
苹果派真好吃嘿嘿嘿

33

主题

180

回帖

64

积分

扈从

Rank: 2Rank: 2

UID
3256923
第纳尔
746
精华
0
互助
0
荣誉
0
贡献
0
魅力
0
注册时间
2021-7-30
鲜花(5) 鸡蛋(0)
发表于 2023-1-6 11:21:58 来自手机 | 显示全部楼层
好东西啊         来自: Android客户端
您需要登录后才可以回帖 登录 | 注册(Register!)

本版积分规则

Archiver|手机版|小黑屋|骑马与砍杀中文站

GMT+8, 2024-11-19 12:19 , Processed in 0.130487 second(s), 25 queries , Gzip On, MemCached On.

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表