本帖最后由 b1ink 于 2024-4-16 23:24 编辑
## 自定义兵种工资
修改位置 **scripts.txt** 定义的函数`game_get_troop_wage`中
我们拉出来看看:
```python
(store_script_param_1, ":var_0"),
(store_script_param_2, ":var_1"),
(assign, ":var_2", 0),
(try_begin),
(this_or_next|eq, ":var_0", "trp_player"),
(eq, ":var_0", "trp_kidnapped_girl"),
(else_try),
(is_between, ":var_0", "trp_kingdom_1_pretender", "trp_knight_1_1_wife"),
(else_try),
(store_character_level, ":var_3", ":var_0"),
(assign, ":var_2", ":var_3"),
(val_add, ":var_2", 3),
(val_mul, ":var_2", ":var_2"),
(val_div, ":var_2", 25),
(try_end),
(try_begin),
(neg|is_between, ":var_0", "trp_npc1", "trp_kingdom_1_lord"),
(troop_is_mounted, ":var_0"),
(val_mul, ":var_2", 5),
(val_div, ":var_2", 3),
(try_end),
(try_begin),
(is_between, ":var_0", "trp_watchman", "trp_mercenaries_end"),
(val_mul, ":var_2", 3),
(val_div, ":var_2", 2),
(try_end),
(try_begin),
(is_between, ":var_0", "trp_npc1", "trp_kingdom_1_lord"),
(val_mul, ":var_2", 2),
(try_end),
(store_skill_level, ":var_4", "skl_leadership", "trp_player"),
(store_mul, ":var_5", 5, ":var_4"),
(store_sub, ":var_6", 100, ":var_5"),
(val_mul, ":var_2", ":var_6"),
(val_div, ":var_2", 100),
(try_begin),
(neg|eq, ":var_0", "trp_player"),
(neg|eq, ":var_0", "trp_kidnapped_girl"),
(neg|is_between, ":var_0", "trp_kingdom_1_pretender", "trp_knight_1_1_wife"),
(val_max, ":var_2", 1),
(try_end),
(assign, reg0, ":var_2"),
#-------可以看出reg0就是输出的工资---------
#
#
#
#
#-------那么我们只要在这里添加代码就可以了---
(set_trigger_result, reg0),
```
例如我想工资减少十倍,在指定位置加一句:
`(val_mul,reg0,10),`
就可以了
那么如果我们想指定某个兵种的工资呢:
例如指定 **诺 德 资 深 弓 箭 手** 的工资为 **233** 第纳尔
```python
(try_begin),
(eq,":var_0","trp_nord_veteran_archer"),
(assign,reg0,233),
(try_end),
```
其他任何兵种的工资都可以像上述一样设定.
你也可以将设置工资的代码封装成函数,以便多次调用.(虽然也就4句)
如果还不会 **函数的封装与调用(scripts.txt)** 请看下面的帖子:
https://bbs.mountblade.com.cn/thread-2104999-1-1.html
***
附一个网址(若打不开请用chrome或用steam++等加速github):
https://b1inkie.github.io/b1note.github.io/
装备某件物品时增加属性点;添加书籍;全自动武器;自爆步兵;光环:移速BUFF(光写了 没测);散弹 但是每一个弹头都是自瞄;自定义战利品等等功能都可以在这里找到.
若依旧有疑问或需要视频讲解,可以加下面群:
附加半个交流群: 855512521
|