DMcain
Veteran

After getting fed up with 50d for whoever I sold to ransom broker, I did some poking in the module_scripts.py and noticed that by adding 1 line to script_game_get_prisoner_price, I could get the prices based on their level.
With this change I receive (default values in red):
I'm still tinkering with it so units over level 20 have an increased ransom, and those under lvl 10 have a decreased ransom. I may even decide to add a multiplier for mounted troops. I'm not a code guru, but I've accomplished what i set out to do here. Maybe someone will find it useful, maybe not.
插入代码块:
# script_game_get_prisoner_price
# This script is called from the game engine for calculating prisoner price
# Input:
# param1: troop_id,
# Output: reg0
("game_get_prisoner_price",
[
(store_script_param_1, ":troop_id"),
(assign, reg0, 50),
(try_begin),
(is_between, "$g_talk_troop", ransom_brokers_begin, ransom_brokers_end),
(store_character_level, ":troop_level", ":troop_id"),
(assign, ":ransom_amount", ":troop_level"),
(val_add, ":ransom_amount", 25), ## Default here is 10
(val_mul, ":ransom_amount", ":ransom_amount"),
(val_div, ":ransom_amount", 5), ## Default here is 6
(try_end),
(assign, reg0, ":ransom_amount"), ## I added this line
(set_trigger_result, reg0),
]),
With this change I receive (default values in red):
- Vaegir Knight - 480d (192d)
- Vaegir Veteran - 304d (96d)
- Vaegir Recruit - 168d (32d)
I'm still tinkering with it so units over level 20 have an increased ransom, and those under lvl 10 have a decreased ransom. I may even decide to add a multiplier for mounted troops. I'm not a code guru, but I've accomplished what i set out to do here. Maybe someone will find it useful, maybe not.
