- 好友
- 16
- 在线时间
- 95 小时
- 最后登录
- 2024-12-18
见习骑士
- UID
- 2462463
- 第纳尔
- 1587
- 精华
- 0
- 互助
- 23
- 荣誉
- 0
- 贡献
- 0
- 魅力
- 83
- 注册时间
- 2015-3-3
鲜花( 58) 鸡蛋( 0)
|
本帖最后由 agjib 于 2023-8-27 08:23 编辑
代码环境1.171
【战团】阿格兰魔球修改器——合集https://bbs.mountblade.com.cn/thread-2097734-1-1.html
参考资料:R大的战后自动收俘虏及自动挑选高价值俘虏的代码https://bbs.mountblade.com.cn/thread-520832-1-1.html(考古)
奴隶买卖是个好生意。可是NPC领主不会,白白屯俘虏在城里,甚至后期俘虏几百几百的。现在玩家已经打通各地黑市,能帮NPC领主卖俘虏,收取手续费50%(太黑了)。另:释放俘虏增加繁荣度时都市谣言,游戏里没这个设定。
代码实际效果:当玩家身处城内时,使用该触发器会识别该城的国(阵营),卖掉该国所有城里的俘虏(按正常算,不是拉蒙的50一位),非本人的城收取手续费50%。同时会增加各个关俘虏城市的繁荣度(每卖出500,加1点繁荣)。左下角会提示是从谁那里收的钱,或者从自己哪个城收的钱。
注:
(1)Q为啥不用游戏菜单自己选?A全游戏这么多城、领主,菜单显示不了;且还要找找找conversation.txt里对话对象的代码修改;
(2)Q为啥部队里的不自动卖?A塞进自己城给你自己城加繁荣度啊
(3)没领主的城,这个收入直接给国王
(4)native里,领主平均初始资金3000;烧一个村给领主才加300。即,50%价格的奴隶买卖对NPC领主是个巨款。
代码使用方式:魔球触发器。随便选个武器,最右边触发器,右键新建触发器,触发选武器攻击。然后把下面的抄进去即可。不用新开档,直接能用。
txt码:
2133 2 1224979098644774912 0 2133 2 1224979098644774913 9999999 11 1 1224979098644774914 521 3 1224979098644774915 1224979098644774914 0 1073741855 2 1224979098644774915 3 31 2 1224979098644774915 2 2281 3 1224979098644774916 0 1224979098644774914 2147483678 2 1224979098644774916 1224979098644774913 2133 2 1224979098644774913 1224979098644774916 2133 2 1224979098644774912 1224979098644774914 3 0 2204 2 1224979098644774917 1224979098644774912 11 1 1224979098644774914 1073742365 3 1224979098644774914 0 3 541 3 1224979098644774914 0 2 2204 2 1224979098644774918 1224979098644774914 31 2 1224979098644774917 1224979098644774918 1651 2 1224979098644774919 1224979098644774914 2133 2 1224979098644774920 0 7 3 1224979098644774921 0 1224979098644774919 1656 3 1224979098644774922 1224979098644774914 1224979098644774921 2147485155 1 1224979098644774922 2171 2 1224979098644774923 1224979098644774922 2133 2 1224979098644774924 1224979098644774923 2105 2 1224979098644774924 10 2107 2 1224979098644774924 1224979098644774924 2108 2 1224979098644774924 6 1657 3 1224979098644774925 1224979098644774914 1224979098644774921 2107 2 1224979098644774924 1224979098644774925 2105 2 1224979098644774920 1224979098644774924 1616 3 1224979098644774914 1224979098644774922 1224979098644774925 3 0 32 2 1224979098644774920 0 521 3 1224979098644774926 1224979098644774914 50 2123 3 1224979098644774927 1224979098644774920 500 2105 2 1224979098644774926 1224979098644774927 501 3 1224979098644774914 50 1224979098644774926 521 3 1224979098644774928 1224979098644774914 7 4 0 31 2 1224979098644774928 360287970189639680 1528 2 360287970189639680 1224979098644774920 600 1 1152921504606846987 2330 2 50 1224979098644774914 2133 2 72057594037927937 1224979098644774920 2320 2 51 216172782113783817 1106 1 216172782113783818 5 0 4 0 2147483680 2 1224979098644774928 0 522 3 1224979098644774929 1224979098644774917 11 2133 2 1224979098644774928 1224979098644774929 3 0 2123 3 1224979098644774930 1224979098644774920 2 2111 2 1224979098644774930 1 1528 2 360287970189639680 1224979098644774930 600 1 1152921504606846987 2322 2 50 1224979098644774928 2133 2 72057594037927937 1224979098644774930 2320 2 51 216172782113783817 1106 1 216172782113783818 2123 3 1224979098644774931 1224979098644774920 2 2111 2 1224979098644774931 1 520 3 1224979098644774932 1224979098644774928 11 2105 2 1224979098644774932 1224979098644774931 500 3 1224979098644774928 11 1224979098644774932 3 0 3 0
py码:
用的R大里面的俘虏等级循环记录功能。其中(try_for_range, ":cur_stack", 0, ":num_stacks"),进游戏内会漏掉几个stack。。。自己改了(try_for_range_backwards, ":cur_stack", 0, ":num_stacks"),居然不会漏,不知道什么鬼。。。
#Agland
(assign, ":encount_party", 0),
(assign, ":min_distance", 9999999),
(try_for_parties,":center_no"),
(party_get_slot,":party_type",":center_no",0),
(this_or_next|eq, ":party_type", spt_town),
(eq, ":party_type", spt_castle),
(store_distance_to_party_from_party, ":party_distance", 0, ":center_no"),
(lt, ":party_distance", ":min_distance"),
(assign, ":min_distance", ":party_distance"),
(assign, ":encount_party", ":center_no"),
(try_end),
(store_faction_of_party, ":cur_faction", ":encount_party"),
#(this_or_next|party_slot_eq, "$g_encountered_party", slot_party_type, spt_town),
#(party_slot_eq, "$g_encountered_party", slot_party_type, spt_castle),
#(store_faction_of_party, ":cur_faction", "$g_encountered_party"),
(try_for_parties, ":center_no"),
(this_or_next|party_slot_eq, ":center_no", slot_party_type, spt_town),
(party_slot_eq, ":center_no", slot_party_type, spt_castle),
(store_faction_of_party, ":center_faction", ":center_no"),
(eq,":cur_faction", ":center_faction"),
#Count gold
(party_get_num_prisoner_stacks, ":num_stacks", ":center_no"),
(assign,":total_ransom",0),
(try_for_range_backwards, ":cur_stack", 0, ":num_stacks"),
(party_prisoner_stack_get_troop_id, ":prisoner_troop", ":center_no", ":cur_stack"),
(neg|troop_is_hero, ":prisoner_troop"),
(store_character_level, ":troop_level", ":prisoner_troop"),
(assign, ":ransom_amount", ":troop_level"),
(val_add, ":ransom_amount", 10),
(val_mul, ":ransom_amount", ":ransom_amount"),
(val_div, ":ransom_amount", 6),
(party_prisoner_stack_get_size, ":stack_size", ":center_no", ":cur_stack"),
(val_mul, ":ransom_amount", ":stack_size"),
(val_add,":total_ransom",":ransom_amount"),
(party_remove_prisoners,":center_no",":prisoner_troop",":stack_size"),
(try_end),
(gt,":total_ransom",0),
#Prosperity
(party_get_slot, ":prosperity", ":center_no", slot_town_prosperity),
(store_div,":ransom_prosperity",":total_ransom",500),
(val_add, ":prosperity", ":ransom_prosperity"),
(party_set_slot, ":center_no", slot_town_prosperity, ":prosperity"),
#Distribute gold
(party_get_slot, ":center_lord", ":center_no", slot_town_lord),
(try_begin),
(eq, ":center_lord", "trp_player"),
#(call_script, "script_troop_add_gold", "trp_player", 100),
(troop_add_gold, "trp_player", ":total_ransom"),
(play_sound, "snd_money_received"),
#message
(str_store_party_name, s50, ":center_no"),
(assign, reg1, ":total_ransom"),
(str_store_string, s51, "str_reg1"),
(display_message, "str_s50_comma_s51"),
(else_try),
(try_begin),
(le, ":center_lord", 0),
(faction_get_slot, ":cur_faction_king", ":cur_faction", slot_faction_leader),
(assign, ":center_lord", ":cur_faction_king"),
(try_end),
#1/2 for fee
(store_div, ":fee_gold", ":total_ransom",2),
(val_max,":fee_gold",1),
(troop_add_gold, "trp_player", ":fee_gold"),
(play_sound, "snd_money_received"),
(str_store_troop_name, s50, ":center_lord"),
(assign, reg1, ":fee_gold"),
(str_store_string, s51, "str_reg1"),
(display_message, "str_s50_comma_s51"),
#1/2 remaining
(store_div, ":remaining_ransom", ":total_ransom",2),
(val_max,":remaining_ransom",1),
(troop_get_slot, ":cur_wealth", ":center_lord", slot_troop_wealth),
(val_add, ":cur_wealth", ":remaining_ransom"),
(troop_set_slot, ":center_lord", slot_troop_wealth, ":cur_wealth"),
(try_end),
(try_end),
#Agland
|
评分
-
查看全部评分
鲜花鸡蛋ggfgfgf 在2023-6-30 23:48 送朵鲜花 并说:开源万岁
|