- 好友
- 2
- 在线时间
- 27 小时
- 最后登录
- 2024-11-18
见习骑士
- UID
- 3048044
- 第纳尔
- 2061
- 精华
- 0
- 互助
- 18
- 荣誉
- 2
- 贡献
- 20
- 魅力
- 289
- 注册时间
- 2018-12-15
鲜花( 34) 鸡蛋( 0)
|
本帖最后由 黑暗路西法 于 2023-11-18 22:47 编辑
晚上没事写了个脚本写着玩
这个代码的效果是,每隔一段时间在所有城市刷新最多10队雇佣兵(不一定非要10队,可以自己改),接下来玩家招募时将根据排序依次招募,这个代码的优点是不会被玩家的实时sl影响,而且理论上可以整出很多活(比如随机数判定里嵌随机数,或者random in range)
constant里准备好n个party slot,如果用我这个小改一下就能跑的话就用
slot_town_mercenary_1 = 390
slot_town_mercenary_2 = 391
slot_town_mercenary_3 = 392
slot_town_mercenary_4 = 393
slot_town_mercenary_5 = 394
slot_town_mercenary_6 = 395
slot_town_mercenary_7 = 396
slot_town_mercenary_8 = 397
slot_town_mercenary_9 = 398
slot_town_mercenary_10 = 399
slot_town_mercenary_end = 400
主打一个能跑就行
- ("random_mercenary_team",
- [
- (try_for_range,":town",towns_begin,towns_end),#巡一遍城市
- (try_for_range,":team",0,10),
- (store_add,":slot",slot_town_mercenary_1,":team"),#0到9,slot_town_mercenary_1到slot_town_mercenary_10一共十个槽,0到9各加一次就有了
- (store_random_in_range,"rand",0,10),
- (try_begin),
- (ge,"rand",8),##20%的概率不刷雇佣兵队伍
- (assign,":msn_pt",0),
- (else_try),
- (ge,"rand",7),##10%的概率刷人上人雇佣兵队伍
- (assign,":msn_pt","pt_人上人"),
- (else_try),
- (ge,"rand",4),##30%的概率刷普通雇佣兵队伍
- (assign,":msn_pt","pt_一般的"),
- (else_try),
- ##40%的概率刷低级雇佣兵队伍
- (assign,":msn_pt","pt_贵物"),
- (try_end),
- (party_set_slot,":town",":slot",":msn_pt"),
- (try_end),
- #现在十个槽都设置好了,开始去重
- (try_for_range,":slot",slot_town_mercenary_1,slot_town_mercenary_end), #end是slot_town_mercenary_10后面那个
- (party_get_slot,":msn_team",":town",":slot"),
- (gt,":msn_team",0), #槽有东西
- (assign, ":end_cond", 1), #准备无限循环
- (gt,":slot",slot_town_mercenary_1), #不是一号槽
- (store_sub,":slot_2",":slot",1), #准备slot2和3
- (assign,":slot_3",":slot"),
- (try_for_range, ":unused", 0, ":end_cond"),
- (party_slot_eq,":town",":slot_2",0),
- (party_set_slot,":town",":slot_2",":msn_team"),
- (party_set_slot,":town",":slot_3",0),
- (val_add, ":end_cond", 1),
- (val_sub,":slot_2",1),
- (gt,":slot_2",slot_town_mercenary_1),
- (val_sub,":slot_3",1),
- (else_try), # once more
- (assign, ":end_cond", 0),
- (try_end),
- (try_end),
- #现在所有城市都有十个槽的雇佣兵,但不一定有十队
- (try_end),
- ]),
复制代码 然后做个simple trigger定时跑这个代码
城镇联动的话随便做个选项
招募佣兵只需要读一下"$g_encountered_party"的slot_town_mercenary_1 就可以了
然后用(party_add_template, <party_id>, <party_template_id>),把部队模板塞main party里之后再跑一遍去重代码即可
- (try_for_range,":slot",slot_town_mercenary_1,slot_town_mercenary_end), #end是slot_town_mercenary_10后面那个
- (party_get_slot,":msn_team","$g_encountered_party",":slot"),
- (gt,":msn_team",0), #槽有东西
- (assign, ":end_cond", 1), #准备无限循环
- (gt,":slot",slot_town_mercenary_1), #不是一号槽
- (store_sub,":slot_2",":slot",1), #准备slot2和3
- (assign,":slot_3",":slot"),
- (try_for_range, ":unused", 0, ":end_cond"),
- (party_slot_eq,"$g_encountered_party",":slot_2",0),
- (party_set_slot,"$g_encountered_party",":slot_2",":msn_team"),
- (party_set_slot,"$g_encountered_party",":slot_3",0),
- (val_add, ":end_cond", 1),
- (val_sub,":slot_2",1),
- (gt,":slot_2",slot_town_mercenary_1),
- (val_sub,":slot_3",1),
- (else_try), # once more
- (assign, ":end_cond", 0),
- (try_end),
- (try_end),
复制代码 ↑写完了招募之后在执行下面加这个
不知道具体结构的看我第一个招募帖子
主攻一个能干大事,不吃sl,可以高效率折腾玩家,若是在刷新的simpletrigger里添加随机因素,更给玩家带来意外惊喜呀
|
鲜花鸡蛋杰喵喵 在2023-11-20 09:13 送朵鲜花 并说:我非常同意你的观点,送朵鲜花鼓励一下 杰喵喵 在2023-11-20 09:13 送朵鲜花 并说:我非常同意你的观点,送朵鲜花鼓励一下
|