Releasing Prisoner Lords (script, read through)

Users who are viewing this thread

I want to release some prisoner lords, but ransoms aren't that frequent, and I would like to do it now, possibly with a relation boost of 1 for letting them out.

Unless someone already has the script to do this, how could I go about adding into the prisoner chat dialogue the option to let them go? I might look around a bit, but I don't know what script should be called to let the go.

Anyways, any help would be great. Thanks!
 

Somebody

Code Pope
Baron
WBWF&S
The following is modified from Custom Commander, originally intended for lords that are already in dungeons.
Code:
   [anyone|plyr,"prisoner_chat",
     [
       (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
       (troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
     ], "You are free to go.", "prisoner_chat_let_go",
     [
       (call_script, "script_remove_troop_from_prison", "$g_talk_troop"),
       (troop_set_slot, "$g_talk_troop", slot_troop_leaded_party, -1),
       (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 1),
       (call_script, "script_add_log_entry", logent_lord_defeated_but_let_go_by_player, "trp_player",  -1, "$g_talk_troop", "$g_talk_troop_faction"),
     ]],
   [anyone,"prisoner_chat_let_go", [],
  "{s43}", "close_window", [
   (call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_prisoner_released_default"),
   (party_remove_prisoners, "p_main_party", "$g_talk_troop",1),
      ]],

  [anyone|plyr,"prisoner_chat", [], "Do not try running away or trying something stupid. I will be watching you.", "prisoner_chat_2",[]],
  [anyone,"prisoner_chat_2", [], "No, I swear I won't.", "close_window",[]],
 
Nice. I just came on to post what I've come up with so far for a script, and I had
(call_script, "script_remove_troop_from_prison", "$g_talk_troop"),
but I guess I didn't identify who I was talking to in it.
 
I've been trying to get your script to work, but with no success.
First, I tried changing what was said, and where it was to blend with my thing, but then I just pasted your script over mine, so it's only what you put in the post.
Still, he just says don' t try running away, blah blah blah.
 

Somebody

Code Pope
Baron
WBWF&S
Well, here's pretty much the same thing from WFaS - hopefully it should work better. Note the initialization of $g_talk_troop with store_conversation_troop
Code:
  [anyone|plyr,"prisoner_chat", [
	#saving vars
	(store_conversation_troop, "$g_talk_troop"),
    (store_troop_faction, "$g_talk_troop_faction", "$g_talk_troop"),
  ], "Don't even try to run from me!", "prisoner_chat_oim",[]],
  [anyone,"prisoner_chat_oim", [], "And what do you want?", "prisoner_chat_oim_2",[]],
  [anyone|plyr,"prisoner_chat_oim_2", [
	(is_between, "$g_talk_troop", kingdom_heroes_begin, kingdom_heroes_end),
#	(neq, "$g_talk_troop", "trp_kingdom_2_lord"), 	
#	(neg|quest_slot_eq, "qst_oim_getman_capture_tatarin", slot_quest_target_troop, "$g_talk_troop"), 
#	(neq,  "trp_knight_2_16", 1),
#	#(neq, "$g_talk_troop", "trp_knight_2_14"),
  ], "I think you should be set free...", "prisoner_chat_oim_3",[]],
  [anyone|plyr,"prisoner_chat_oim_2", [], "Never mind.", "close_window",[]],
  [anyone,"prisoner_chat_oim_3", [], "And what is it you want?", "prisoner_chat_oim_5",[]],
  [anyone|plyr,"prisoner_chat_oim_5", [], "Release for ransom...", "prisoner_chat_oim_5_money",[]],
	[anyone,"prisoner_chat_oim_5_money", [
			#code calculate prise
			(call_script, "script_calculate_ransom_amount_for_troop", "$g_talk_troop"),
			(assign, reg12, reg0),
			(val_mul, reg12, 3), 
			(val_div, reg12, 5), 
			(assign, reg0, reg12),
			(assign, "$temp", reg12),
		], "I can pay {reg0} thaler for my freedom.", "prisoner_chat_oim_5_money_goon",[]],
		[anyone|plyr,"prisoner_chat_oim_5_money_goon", [], "Well then, you are free.", "close_window",[
			#code
			(call_script, "script_troop_add_gold", "trp_player", "$temp"), 
	        (party_remove_prisoners, "p_main_party", "$g_talk_troop", 1),
			(call_script, "script_remove_troop_from_prison", "$g_talk_troop"),
		]],
		[anyone|plyr,"prisoner_chat_oim_5_money_goon", [], "Your offer is not good enough for me.", "close_window",[]],
  [anyone|plyr,"prisoner_chat_oim_5", [], "Free the prisoner unconditionally...", "prisoner_chat_oim_5_honor1",[]],
	[anyone,"prisoner_chat_oim_5_honor1", [], "Well, if you would let me go for free, then you are truly a friend to our people.", "prisoner_chat_oim_5_honor",[]],
	[anyone|plyr,"prisoner_chat_oim_5_honor", [], "Well then, you are free.", "prisoner_chat_oim_5_honor_goon",[]],
		[anyone,"prisoner_chat_oim_5_honor_goon", [], "You are a {man/woman} of honor. You have my gratitude.", "close_window",[
			(party_remove_prisoners, "p_main_party", "$g_talk_troop", 1),
			(call_script, "script_remove_troop_from_prison", "$g_talk_troop"),
			(call_script, "script_change_player_honor", 1),
			(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 20),
			(call_script, "script_change_player_relation_with_faction_ex", "$g_talk_troop_faction", 10),
		]],
	[anyone|plyr,"prisoner_chat_oim_5_honor", [], "Never mind.", "close_window",[]],
  [anyone|plyr,"prisoner_chat_oim_5", [], "I'll be watching you.", "close_window",[]],
 
I'm getting an error "NameError: name 'kingdom_heroes_begin' is not defined"

Edit: Ok, I've looked at your Custom Commander script more.
When the script looks like this
Code:
  [anyone|plyr,"prisoner_chat",  [], "I have to decided release you. You are free to go where ever you want.", "prisoner_chat_3",
     [
       (call_script, "script_remove_troop_from_prison", "$g_talk_troop"),
       (troop_set_slot, "$g_talk_troop", slot_troop_leaded_party, -1),
       (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 1),
       (call_script, "script_add_log_entry", logent_lord_defeated_but_let_go_by_player, "trp_player",  -1, "$g_talk_troop", "$g_talk_troop_faction"),
     ]],
when I talk to a prisoner lord, I have the option of saying "don't run" and "you are free". When I pick "you are free", my relation with him improves by 1, and he doesn't leave the party.
When my script looks like this
Code:
  [anyone|plyr,"prisoner_chat",
     [
       (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
       (troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
     ], "I have to decided release you. You are free to go where ever you want.", "prisoner_chat_3",
     [
       (call_script, "script_remove_troop_from_prison", "$g_talk_troop"),
       (troop_set_slot, "$g_talk_troop", slot_troop_leaded_party, -1),
       (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 1),
       (call_script, "script_add_log_entry", logent_lord_defeated_but_let_go_by_player, "trp_player",  -1, "$g_talk_troop", "$g_talk_troop_faction"),
     ]],
then I don't have the option to say anything, it automatically goes to "don't run" and "no, I won't". Plus the relation with him doesn't change.
 
I tried this earlier, but do you know how I can add lord_talk_ask_location to the prisoner chat? I tried before, but with a lot of errors.
I thought it would be cool to force information out of them, so you could find out what their kingdom is doing.
(BTW, if you could ask a prisoner lord info about where a lord is, would they give up-to-date info, or just what they knew before capture? It would seem like cheat if they could say they are besieging a city when they would have no way of knowing.)

I'm working on a different dialog for regular troops and need to disable it for lords, and I just wanted to ask if
Code:
(neg|is_between, "$g_talk_troop", heroes_begin, heroes_end),
would work.

Edit: Second thing, if the prisoner is a faction troop, would
Code:
(call_script, "script_change_player_relation_with_faction_ex", "$g_talk_troop_faction", -2),
lower your relation with that faction?
 
Top Bottom