(This is to be taken semi-seriously... )
So, here I was yesterday, sitting at the computer with a mug of beer, and all of a sudden I got an awesome idea - make beer drinking be an option in Warband. Today I got to working on it and here's the product of about 10-20 minutes. Tested and working.
Why did I do it? Well, (almost) everyone loves beer, and an army of soldiers would perhaps also like to drink beer once in a while.
This code allows your army to drink up to 9 beers each every 18 hours. You have to go to any tavern and buy beers for your army. Each beer costs 7 denars. Each drinking of beers improves your party's morale by 2. You can easilty change all of these fixed values. It's a rather pathetic attempt in terms of making logical sense and being realistic in any way, shape, or form, but I still think it's a mildly amusing option to have. Feel free to tweak it around and make something more sensible!
The code: I wanted it to be clean and simple, and it is. (Well, it's also not very feature-rich, but I still think it's a fun addition.)
Enjoy, have fun and drink more of that wonderful liquid - the beer!
So, here I was yesterday, sitting at the computer with a mug of beer, and all of a sudden I got an awesome idea - make beer drinking be an option in Warband. Today I got to working on it and here's the product of about 10-20 minutes. Tested and working.
Why did I do it? Well, (almost) everyone loves beer, and an army of soldiers would perhaps also like to drink beer once in a while.
This code allows your army to drink up to 9 beers each every 18 hours. You have to go to any tavern and buy beers for your army. Each beer costs 7 denars. Each drinking of beers improves your party's morale by 2. You can easilty change all of these fixed values. It's a rather pathetic attempt in terms of making logical sense and being realistic in any way, shape, or form, but I still think it's a mildly amusing option to have. Feel free to tweak it around and make something more sensible!
The code: I wanted it to be clean and simple, and it is. (Well, it's also not very feature-rich, but I still think it's a fun addition.)
Code:
#-## TBS - Beer drinking
[anyone|plyr,"tavernkeeper_talk", [
(neq, "$sneaked_into_town", 1), # It'd be suspicious to order 200 or so beers while undercover
(neg|troop_slot_ge, "trp_player", slot_beers_for_the_day, 9), # Maximum of 9 beers per day
(store_party_size, reg1, "p_main_party"),
(store_mul, reg2, reg1, 7), # 7 denars per beer - making it more expensive to counter the big amount of morale possible to gain
], "I want {reg1} beers for my company. ({reg2} denars.)", "tavernkeeper_drink_beer",[]],
[anyone,"tavernkeeper_drink_beer",
[
(store_troop_gold, ":player_cash", "trp_player"),
(store_party_size, ":party_size", "p_main_party"),
(store_mul, ":beer_cost", ":party_size", 7),
(try_begin),
(ge, ":player_cash", ":beer_cost"),
(troop_remove_gold, "trp_player", ":beer_cost"),
(display_message, "@Your army's morale has improved!", 0x33ff33),
(call_script, "script_change_player_party_morale", 2),
(troop_get_slot, ":cur_beers", "trp_player", slot_beers_for_the_day),
(val_add, ":cur_beers", 1),
(troop_set_slot, "trp_player", slot_beers_for_the_day, ":cur_beers"),
(store_current_hours, ":cur_hrs"),
(troop_set_slot, "trp_player", slot_last_beers_time, ":cur_hrs"),
(str_store_string, s1, "@Of course, {sir/madam}. I shall have them delivered to your company as soon as possible."),
(else_try),
(str_store_string, s1, "@You don't have enough money, {mate/lass}..."),
(try_end),
], "{s1}", "close_window",[]],
#-## TBS - Beer drinking end
Code:
#-## TBS - Beer drinking
# These are troop slots, so check for conflicting numbers in your mod.
slot_beers_for_the_day = 420
slot_last_beers_time = 421
#-## TBS - Beer drinking end
Code:
#-## TBS - Beer drinking
(1, [
(troop_get_slot, ":last_beers_time", "trp_player", slot_last_beers_time),
(store_current_hours, ":cur_hrs"),
(val_sub, ":cur_hrs", ":last_beers_time"),
(ge, ":cur_hrs", 18), # If 18 hours have passed since you drank beers
(troop_set_slot, "trp_player", slot_beers_for_the_day, 0),
]),
#-## TBS - Beer drinking end
Enjoy, have fun and drink more of that wonderful liquid - the beer!