in module_skills, replace one of the reserved skills with this:
in module_simple_triggers:
in module_scripts:
in module_game_menus:
at module_constants:
obs: change the 46 to the first avaiable agent slot
at module_items:
obs: if you don't have this model, download FEMP or use another one
at module dialogs:
Credits to CromCrom/Cernunos for the idea xD
extra code:
in module_mission_templates:
obs: you have to change <first_music> and <last_music> for your musics in the module_sounds file
credits to Caba`drin for the help in that one
Code:
("entertain","Entertain",sf_base_att_cha|sf_effects_party,15,"Every hour you are resting, each hero with this skill increases the morale of the party. It also helps you while begging, performing or playing a music. (Personal skill)."),
in module_simple_triggers:
Code:
(3, [(ge, "$entertainement_on", 1),
(assign, ":hero_count", 0),
(assign, ":entertain_bonus", 0),
#companions
(try_for_range, ":hero", companions_begin, companions_end),
(main_party_has_troop,":hero"),
(val_add, ":hero_count", 1),
(store_skill_level,":skill","skl_entertain",":hero"),
(val_add, ":entertain_bonus", ":skill"),
(try_end),
#player troop
(val_add, ":hero_count", 1),
(store_skill_level,":skill","skl_entertain",0),
(val_add, ":entertain_bonus", ":skill"),
#now get the bonus
(val_add, ":hero_count", 5),
(val_div, ":entertain_bonus", ":hero_count"),
(val_mul, ":entertain_bonus", "$entertainement_on"),#normal kind is 1 but if it is an aewsome entertainement it will get a bonus (like playing lordly/royal musics)
(party_get_morale, ":morale", "p_main_party"),
(val_add, ":morale", ":entertain_bonus"),
#and apply it
(party_set_morale, "p_main_party", ":morale"),
]),
(24,[(store_div, ":reputation", "$bardic_reputation", 1000),
(val_min, ":reputation", 1),
(val_add, ":reputation", 1),
(troop_get_slot, ":old_reputation", 0, slot_troop_renown),
(store_mul, ":new_reputation", ":old_reputation", ":reputation"),
(troop_set_slot, 0, slot_troop_renown, ":new_reputation"),
(store_sub, ":reputation_change", ":new_reputation", ":old_reputation"),
(try_begin),
(gt, ":reputation_change", 0),
(display_message, "@You gained {reg12} renown for your bardic reputation.", 0x33ff33),
(else_try),
(lt, ":reputation_change", 0),
(display_message, "@You lose {reg12} renown for your bardic reputation.", 0xff3333),
(try_end),
]),
(1, [(ge, "$entertainement_on", 1),
(assign, ":income_rate", "$entertain_income_rate"),
(assign, ":income_type", "$entertain_income_type"),
(assign, ":income_type2", "$entertain_income_type2"),
(store_skill_level,":skill_lvl","skl_entertain",0),
(store_mul, ":max", ":income_rate", 1),
(store_mul, ":min", ":income_rate", -1),
(val_add, ":max", ":skill_lvl"),
(val_mul, ":max", "$entertainement_on"),
(val_div, ":min", 2),
(val_div, ":min", "$entertainement_on"),
(store_random_in_range, ":income", ":min", ":max"),
(store_div, ":reputation", "$bardic_reputation", 400),
(val_min, ":reputation", 1),
(val_add, ":reputation", 1),
(val_mul, ":income", ":reputation"),
(val_sub, ":income", ":reputation"),
(call_script, "script_entertain_income", ":income", ":income_type"),
(call_script, "script_entertain_income", ":income", ":income_type2"),
]),
in module_scripts:
search for:
obs: may be a little different than mine because I'm using Floris Expanded Mod PackCode:("game_get_skill_modifier_for_troop", [(store_script_param, ":troop_no", 1), (store_script_param, ":skill_no", 2), (assign, ":modifier_value", 0), (try_begin), (eq, ":skill_no", "skl_wound_treatment"), (call_script, "script_get_troop_item_amount", ":troop_no", "itm_book_wound_treatment_reference"), (gt, reg0, 0), (val_add, ":modifier_value", 1), (else_try), (eq, ":skill_no", "skl_trainer"), (call_script, "script_get_troop_item_amount", ":troop_no", "itm_book_training_reference"), (gt, reg0, 0), (val_add, ":modifier_value", 1), (else_try), (eq, ":skill_no", "skl_surgery"), (call_script, "script_get_troop_item_amount", ":troop_no", "itm_book_surgery_reference"), (gt, reg0, 0), (val_add, ":modifier_value", 1), ## CC (else_try), (eq, ":skill_no", "skl_pathfinding"), (call_script, "script_get_troop_item_amount", ":troop_no", "itm_book_pathfinding_reference"), (gt, reg0, 0), (val_add, ":modifier_value", 1), (else_try), (eq, ":skill_no", "skl_spotting"), (call_script, "script_get_troop_item_amount", ":troop_no", "itm_book_spotting_reference"), (gt, reg0, 0), (val_add, ":modifier_value", 1),
add this:
Code:(else_try), (eq, ":skill_no", "skl_entertain"), (try_for_range, ":instrument", instruments_begin, instruments_end), (call_script, "script_get_troop_item_amount", ":troop_no", ":instrument"), (gt, reg0, 0), (val_add, ":modifier_value", 1), (try_end),
add this new script:
Code:# script_entertain_income # input_1 = income # input_2 = income_type # used on playing a music or making a speech ("entertain_income", [(store_script_param, ":income", 1), (store_script_param, ":income_type", 2), (try_begin), ######### HONOR ######### (eq, ":income_type", income_honor), (val_div, ":income", 30), (val_add, "$player_honor", ":income"), (assign, reg12, ":income"), (assign, reg13, "$player_honor"), (try_begin), (gt, ":income", 0), (display_message, "@Your honor has been increased in {reg12} and it is {reg13} now.", 0x33ff33), (else_try), (lt, ":income", 0), (display_message, "@Your honor has been decreased in {reg12} and it is {reg13} now.", 0xff3333), (try_end), (else_try), ######### REPUTATION ######### (eq, ":income_type", income_reputation), (val_div, ":income", 30), (troop_get_slot, ":old_reputation", 0, slot_troop_renown), (store_add, ":new_reputation", ":old_reputation", ":income"), (troop_set_slot, 0, slot_troop_renown, ":new_reputation"), (assign, reg12, ":income"), (assign, reg13, ":new_reputation"), (try_begin), (gt, ":income", 0), (display_message, "@You gained {reg12} renown and it is {reg13} now.", 0x33ff33), (else_try), (lt, ":income", 0), (display_message, "@You lost {reg12} renown and it is {reg13} now.", 0xff3333), (try_end), (else_try), ######### RIGHT TO RULE ######### (eq, ":income_type", income_right_to_rule), (val_div, ":income", 30), (val_add, "$player_right_to_rule", ":income"), (assign, reg12, ":income"), (assign, reg13, "$player_right_to_rule"), (try_begin), (gt, ":income", 0), (display_message, "@You gained {reg12} right to rule and you have {reg13} now.", 0x33ff33), (else_try), (lt, ":income", 0), (display_message, "@You lost {reg12} right to rule and you have {reg13} now.", 0xff3333), (try_end), (else_try), ######### BARDIC REPUTATION ######### (eq, ":income_type", income_bard_reputation), (val_div, ":income", 2), (val_add, "$bardic_reputation", ":income"), (assign, reg12, ":income"), (assign, reg13, "$bardic_reputation"), (try_begin), (gt, ":income", 0), (display_message, "@You gained {reg12} bardic reputation and it is {reg13} now.", 0x33ff33), (else_try), (lt, ":income", 0), (display_message, "@You lost {reg12} bardic reputation and it is {reg13} now.", 0xff3333), (try_end), (else_try), ######### DENARS ######### (troop_add_gold,0,":income"), (store_troop_gold, reg13, 0), (try_begin), (gt, ":income", 0), (display_message, "@You got {reg12} denars and you have {reg13} now.", 0x33ff33), (else_try), (lt, ":income", 0), (display_message, "@You lost {reg12} denars and you have {reg13} now.", 0xff3333), (try_end), (try_end), ]),
in module_game_menus:
search for the "camp" menu and add at the operations block:
then in the "camp_wait_here" option, add at the consequences block:Code:(assign, "$entertainement_on", 0),
search for the "town" menu and add at the operations block:Code:(assign, "$entertainement_on", 1),
then in the "castle_wait" option, add at the consequences block:Code:(assign, "$entertainement_on", 0),
add a new option at the "town" menu:Code:(assign, "$entertainement_on", 1),
Code:("entertaiment", [(party_slot_eq,"$current_town",slot_party_type, spt_town), (this_or_next|eq,"$entry_to_town_forbidden",0), (eq, "$sneaked_into_town",1),], "Attempt to Play/Perform a music.", [(jump_to_menu, "mnu_choose_music"),]),
and then add this new menu:
Code:("choose_music",0,"What do you wanna do?", "none", [ (assign, "$entertainement_on", 0), ], [ ("simple",[(str_store_string, s1, "@play a"), (try_begin), (eq, "$entertain_income_rate", 7), (assign, "$entertain_income_rate", 0), (str_store_string, s1, "@play another"), (try_end),],"I want to {s1} simple music.(1 hour)", [(assign, "$entertainement_on", 1), (assign, "$entertain_income_rate", 7), (assign, "$entertain_income_type", income_denars), (assign, "$entertain_income_type2", income_bard_reputation), (assign, "$g_infinite_camping", 0), (assign, "$auto_enter_town", "$current_town"), (assign, "$g_town_visit_after_rest", 1), (assign, "$g_last_rest_center", "$current_town"), (rest_for_hours_interactive, 1, 1, 0), #rest 1 hour while not-attackable (change_screen_map),] ), ("medium",[(store_skill_level,":skill_lvl","skl_entertain",0), (ge, ":skill_lvl", 2), (ge, "$bardic_reputation", 130), (str_store_string, s1, "@play a"), (try_begin), (eq, "$entertain_income_rate", 15), (assign, "$entertain_income_rate", 0), (str_store_string, s1, "@play another"), (try_end),],"I want to {s1} medium music.(3 hours)", [(assign, "$entertainement_on", 1), (assign, "$entertain_income_rate", 15), (assign, "$entertain_income_type", income_denars), (assign, "$entertain_income_type2", income_bard_reputation), (assign, "$g_infinite_camping", 0), (assign, "$auto_enter_town", "$current_town"), (assign, "$g_town_visit_after_rest", 1), (assign, "$g_last_rest_center", "$current_town"), (rest_for_hours_interactive, 3, 1, 0), #rest 3 hours while not-attackable (change_screen_map),] ), ("complex",[(store_skill_level,":skill_lvl","skl_entertain",0), (ge, ":skill_lvl", 5), (ge, "$bardic_reputation", 470), (str_store_string, s1, "@play a"), (try_begin), (eq, "$entertain_income_rate", 50), (assign, "$entertain_income_rate", 0), (str_store_string, s1, "@play another"), (try_end),],"I want to {s1} complex music.(5 hours)", [(assign, "$entertainement_on", 1), (assign, "$entertain_income_rate", 50), (assign, "$entertain_income_type", income_denars), (assign, "$entertain_income_type2", income_bard_reputation), (assign, "$g_infinite_camping", 0), (assign, "$auto_enter_town", "$current_town"), (assign, "$g_town_visit_after_rest", 1), (assign, "$g_last_rest_center", "$current_town"), (rest_for_hours_interactive, 5, 3, 0), #rest 5 hours while not-attackable (change_screen_map),] ), ("lordly",[(store_skill_level,":skill_lvl","skl_entertain",0), (ge, ":skill_lvl", 9), (ge, "$bardic_reputation", 1150), (str_store_string, s1, "@play a"), (try_begin), (eq, "$entertain_income_rate", 90), (assign, "$entertain_income_rate", 0), (str_store_string, s1, "@play another"), (try_end),],"I want to {s1} Lordly music.(15 hours)", [(assign, "$entertainement_on", 2), (assign, "$entertain_income_rate", 90), (assign, "$entertain_income_type", income_denars), (assign, "$entertain_income_type2", income_bard_reputation), (assign, "$g_infinite_camping", 0), (assign, "$auto_enter_town", "$current_town"), (assign, "$g_town_visit_after_rest", 1), (assign, "$g_last_rest_center", "$current_town"), (rest_for_hours_interactive, 15, 5, 0), #rest 15 hours while not-attackable (change_screen_map),] ), ("royal",[(store_skill_level,":skill_lvl","skl_entertain",0), (ge, ":skill_lvl", 14), (ge, "$bardic_reputation", 3550), (str_store_string, s1, "@play a"), (try_begin), (eq, "$entertain_income_rate", 170), (assign, "$entertain_income_rate", 0), (str_store_string, s1, "@play another"), (try_end),],"I want to {s1} Royal music.(35 hours)", [(assign, "$entertainement_on", 3), (assign, "$entertain_income_rate", 170), (assign, "$entertain_income_type", income_denars), (assign, "$entertain_income_type2", income_bard_reputation), (assign, "$g_infinite_camping", 0), (assign, "$auto_enter_town", "$current_town"), (assign, "$g_town_visit_after_rest", 1), (assign, "$g_last_rest_center", "$current_town"), (rest_for_hours_interactive, 35, 6, 0), #rest 35 hours while not-attackable (change_screen_map),] ), ("speech",[(str_store_string, s1, "@a"), (try_begin), (eq, "$entertain_income_rate", 9), (assign, "$entertain_income_rate", 0), (str_store_string, s1, "@another"), (try_end),],"I want to make {s1} Speech.(3 hours)", [(assign, "$entertainement_on", 0), (assign, "$entertain_income_rate", 9), (assign, "$entertain_income_type", income_reputation), (assign, "$entertain_income_type2", income_right_to_rule), (assign, "$g_infinite_camping", 0), (assign, "$auto_enter_town", "$current_town"), (assign, "$g_town_visit_after_rest", 1), (assign, "$g_last_rest_center", "$current_town"), (rest_for_hours_interactive, 3, 1, 0), #rest 5 hours while not-attackable (change_screen_map),] ),
at module_constants:
Code:
instruments_begin = "itm_lyre"
instruments_end = "itm_instruments_end"
income_denars = 1
income_honor = 2
income_reputation = 3
income_right_to_rule = 4
income_bard_reputation = 5
slot_agent_already_begg = 46
at module_items:
Code:
["lyre", "Lyre", [("lyre",0)], itp_merchandise|itp_type_shield|itp_wooden_parry|itp_civilian, itcf_carry_bow_back, 118 , weight(2.5)|hit_points(480)|body_armor(1)|spd_rtng(82)|weapon_length(90),0 ],
["lute", "Lute", [("lute",0)], itp_merchandise|itp_type_shield|itp_wooden_parry|itp_civilian, itcf_carry_bow_back, 118 , weight(2.5)|hit_points(480)|body_armor(1)|spd_rtng(82)|weapon_length(90),0 ],
["instruments_end", "Instruments End", [("shield_round_a",0)], 0, 0, 1, 0, 0],
at module dialogs:
Code:
[anyone|plyr,"town_dweller_talk", [(neg|agent_slot_eq,"$g_talk_agent",slot_agent_already_begg,1),(troop_get_type, ":gender", "$g_talk_troop"),(val_mod, ":gender", 2),(assign, reg1, ":gender"),], "{reg1?My lord:My good lady}, could you give me a few coins?", "town_dweller_begging",[(store_random_in_range, reg2, 1,4),]],
[anyone,"town_dweller_begging", [(eq, reg2, 1),], "Take this, poor soul.", "close_window",[(agent_set_slot,"$g_talk_agent",slot_agent_already_begg,1),(store_random_in_range, ":gold", 0, 1000),(troop_add_gold,0,":gold"),(val_sub, "$player_right_to_rule", 30),(troop_get_slot, ":reputation", 0, slot_troop_renown),(val_add, ":reputation", 30),(troop_set_slot, 0, slot_troop_renown, ":reputation"),(val_sub, "$player_honor", 3)]],
[anyone,"town_dweller_begging", [(eq, reg2, 2),], "Here you are, now get out of my way!", "close_window",[(agent_set_slot,"$g_talk_agent",slot_agent_already_begg,1),(store_random_in_range, ":gold", 0, 1000),(troop_add_gold,0,":gold"),(val_sub, "$player_right_to_rule", 30),(troop_get_slot, ":reputation", 0, slot_troop_renown),(val_add, ":reputation", 30),(troop_set_slot, 0, slot_troop_renown, ":reputation"),(val_sub, "$player_honor", 3)]],
[anyone,"town_dweller_begging", [(eq, reg2, 3),], "GET OUT OF MY WAY!", "close_window",[(agent_set_slot,"$g_talk_agent",slot_agent_already_begg,1),(val_sub, "$player_right_to_rule", 30),(troop_get_slot, ":reputation", 0, slot_troop_renown),(val_add, ":reputation", 30),(troop_set_slot, 0, slot_troop_renown, ":reputation"),(val_sub, "$player_honor", 3)]],
Credits to CromCrom/Cernunos for the idea xD
extra code:
in module_mission_templates:
Code:
common_play_instrument = (0, 0, 2, [(game_key_clicked, gk_defend)],
[
(get_player_agent_no, ":player"),
(agent_get_wielded_item, ":shield", ":player", 1),
(is_between, ":shield", instruments_begin, instruments_end),
(store_random_in_range, ":music", "snd_<first_music>", "snd_<last_music>"),
(agent_play_sound, ":player", ":music"),
]),
credits to Caba`drin for the help in that one