Does anyone know if this code would work, so like i could buy a castle or town or village from a lord??
Plus has anyone got a tutorial on how to make kingdom management or kingdom name/colour changer menus in the module system
from module_dialogues.py
Plus has anyone got a tutorial on how to make kingdom management or kingdom name/colour changer menus in the module system
from module_dialogues.py
Code:
## [anyone,"lord_start", [(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
## (ge,"$g_talk_troop_faction_relation",0),
## (call_script, "script_get_number_of_unclaimed_centers_by_player"),
## (gt, reg1, 0),
## (assign, "$center_wanted_to_be_bought", reg1),
## (str_store_party_name, s4, "$center_wanted_to_be_bought"),
## (call_script, "script_get_number_of_hero_centers", "$g_talk_troop"),
## (assign, ":no_of_owned_centers", reg0),
## (neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
## (lt, ":no_of_owned_centers", 2),
## (troop_get_slot, ":wealth", "$g_talk_troop", slot_troop_wealth),
## (ge, ":wealth", 6000)],
## "I heard that your forces have taken {s4}. I applaud your victory {playername}, but you know as well as I do that\
## as a person of low rank and status you cannot be permitted to hold that castle for yourself.\
## It is to your benefit to sell it to a Lord like myself who can hold and protect the castle and the surrounding estates.\
## Anyway, I am ready to make you an offer of 5000 denars, should you decide to sell that castle.", "lord_buy_center", []],
##
##
## [anyone|plyr,"lord_buy_center", [],
## "I accept your offer sir. The castle is yours for 5000 denars.", "lord_buy_center_accept", []],
## [anyone|plyr,"lord_buy_center", [],
## "I am afraid I can't accept that offer.", "lord_buy_center_deny", []],
##
## [anyone,"lord_buy_center_accept", [],
## "Excellent, {playername}! You have decided wisely.\
## Why bother yourself with the necessities of keeping a castle while you can leave all those boring details to noble Lords like me?\
## I am sure money will be much more useful to you than a castle would.", "lord_buy_center_accept_2", []],
##
## [anyone|plyr,"lord_buy_center_accept_2", [],
## "One day sir, one day I'll have my own castle.", "lord_buy_center_accept_3", []],
## [anyone|plyr,"lord_buy_center_accept_2", [],
## "Everyone needs money sir. I can take another castle anytime.", "lord_buy_center_accept_3", []],
##
## [anyone,"lord_buy_center_accept_3", [],
## "Of course, of course, {playername}. Then let us conclude our deal. Here's the 5000 denars I offered you.\
## I'll have my clerk handle the necessary details.\
## I guess from now on, {s4} belongs to me. Well, that worked very well for both of us, I guess.", "lord_pretalk",
## [(troop_get_slot, ":wealth", "$g_talk_troop", slot_troop_wealth),
## (val_sub, ":wealth", 6000),
## (troop_set_slot, "$g_talk_troop", slot_troop_wealth, ":wealth"),
## (call_script, "script_troop_add_gold", "trp_player", 5000),
## (party_set_slot, "$center_wanted_to_be_bought", slot_town_lord, "$g_talk_troop"),
## #Changing center faction
## (party_set_faction, "$center_wanted_to_be_bought", "$g_talk_troop_faction"),
## (set_spawn_radius, 1),
## (spawn_around_party, "$center_wanted_to_be_bought", "pt_old_garrison"),
## (assign, ":new_party", reg0),
## (party_set_ai_behavior, ":new_party", ai_bhvr_attack_party),
## (party_set_ai_object, ":new_party", "p_main_party"),
## (party_set_flags, ":new_party", pf_default_behavior, 0),
## (call_script, "script_party_copy", ":new_party", "$center_wanted_to_be_bought"),
## (party_clear, "$center_wanted_to_be_bought"),
##
## (faction_get_slot, ":reinforcement_template_archers", "$g_talk_troop_faction", slot_faction_reinforcements_archers),
## (faction_get_slot, ":reinforcement_template_infantry", "$g_talk_troop_faction", slot_faction_reinforcements_infantry),
## (party_add_template, "$center_wanted_to_be_bought", ":reinforcement_template_archers"),
## (party_add_template, "$center_wanted_to_be_bought", ":reinforcement_template_infantry"),
## ]],
##
## [anyone,"lord_buy_center_deny", [],
## "As you wish {playername}. But don't forget, the great lords of the country won't like a low born {man/woman} like you holding such an estate without their consent.\
## It is the nature of this world {playername}. Everyone should know their place.", "lord_pretalk", []],