Jump to content
  • 0

Unjail Npc


xJohn

Question


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.01
  • Content Count:  19
  • Reputation:   4
  • Joined:  04/18/23
  • Last Seen:  

Hi guys.. I would like to ask for some help...
Could you provide me with an NPC?

Type: When a player goes to jail .. inside the jail he would have a npc where he can pay (x) Zeny to get out of jail or even another character could pay the bail for the player to get out ...

Note: if you can add a command: bindatcmd "bail" to be able to access the npc.. and also "duplicate Npc Bail" ...

Very grateful for everyone's attention! :')

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  232
  • Reputation:   86
  • Joined:  06/30/18
  • Last Seen:  

Hello,

how about this?

-	script	JailSystem#proto	FAKE_NPC,{
	OnBail:
		.@charCount = getareaunits(BL_PC, "sec_pri", 14, 85, 59, 65, .@charNames$);
		mes "[Guard]";
		if(.@charCount == 0) {
			mes "There is no one in jail.";
			close;
		}

		mes "Who do you want to bail out?";
		next;
		select(implode(.@charNames$, ":"));

		mes "[Guard]";
		mes "The fee is " + callfunc("F_InsertComma", .bailOutPrice) + "z. Do you want to pay that?";
		next;
		if (select("Yes:No" ) == 1) {
			mes "[Guard]";
			if(Zeny < .bailOutPrice) {
				mes "It seems you don't have enough money, come back when you have enough.";
				close;
			}

			Zeny -= .bailOutPrice;

			.@addressation$ = (strcharinfo(0) == .@charNames$[@menu - 1]) ? "you" : .@charNames$[@menu - 1];
			mes "Alright, i'll let " + .@addressation$ + " go for now.";
			
			close2;
			atcommand("@unjail " + .@charNames$[@menu - 1]);
			end;
		}
		
		mes "[Guard]";
		mes "You can come back when you change your mind.";
		close;
		end;

	OnInit:
		.bailOutPrice = 10000;
}

-	script	BAIL_ATCOMMAND	FAKE_NPC,{
	OnInit:
		bindatcmd("bail", "Guard#proto::OnBail");
}

prontera, 159, 190, 4	duplicate(JailSystem#proto)	Prison Warden#sec_pri01	4_M_YOUNGKNIGHT
sec_pri, 18, 63, 4	duplicate(JailSystem#proto)	Jail Guard#sec_pri02	4_M_EDEN_GUARDER
sec_pri, 45, 63, 4	duplicate(JailSystem#proto)	Jail Guard#sec_pri03	4_M_LGTGUARD

Β 

  • Love 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.01
  • Content Count:  19
  • Reputation:   4
  • Joined:  04/18/23
  • Last Seen:  

I got this error:

[Error]: Β Loading NPC file: npc/custom/JailSystem.txt
script error on npc/custom/JailSystem.txt line 3
Β  Β  parse_line: expect command, missing function name or calling undeclared function
Β  Β  Β 1 : {
Β  Β  Β 2 : Β  Β  Β  Β OnBail:
* Β  Β 3 : Β  Β  Β  Β  Β  Β  Β  Β .@charCount = getareaunits('B'L_PC, "sec_pri", 14, 85, 59, 65, .@charNames$);
Β  Β  Β 4 : Β  Β  Β  Β  Β  Β  Β  Β mes "[Guard]";
Β  Β  Β 5 : Β  Β  Β  Β  Β  Β  Β  Β if(.@charCount == 0) {
Β  Β  Β 6 : Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β mes "There is no one in jail.";
Β  Β  Β 7 : Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β close;
Β  Β  Β 8 : Β  Β  Β  Β  Β  Β  Β  Β }

image.png.1fb1dbfe5f01a45e5ae2b27d2042be74.png

can you help me?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  232
  • Reputation:   86
  • Joined:  06/30/18
  • Last Seen:  

Hello,

I tested it on my server and I can't reproduce your error. It works fine for me.
Which rAthena version are you using? It seems like your rAthena doesn't know theΒ getareaunits command.

Edited by Winterfox
Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

there exists a default script for unjail if you are interested with it

npc/custom/etc/penal_servitude.txt

  • Like 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.01
  • Content Count:  19
  • Reputation:   4
  • Joined:  04/18/23
  • Last Seen:  

6 hours ago, Winterfox said:

Hello,

I tested it on my server and I can't reproduce your error. It works fine for me.
Which rAthena version are you using? It seems like your rAthena doesn't know theΒ getareaunits command.

I use this patch version: @Winterfox
#ifndef PACKETVER
#define PACKETVER 20151104
//#define PACKETVER 20120410

But I don't know how to check the rAthena version.. ''/

Β 

4 hours ago, Emistry said:

there exists a default script for unjail if you are interested with it

npc/custom/etc/penal_servitude.txt

I didn't test the sling but can a player who is not arrested pay the bail of someone who is arrested? @Emistry

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  232
  • Reputation:   86
  • Joined:  06/30/18
  • Last Seen:  

Based on your packet version, your rAthena is pretty old. The current packt version isΒ 20211103.
The included script doesn't allow others to bail someone out. You can only bail yourself out via payment or labor.

It also seems like it doesn't work anymore, since it doesn't really unjail you, but tries to warp you out of jail and change your savepoint which fails.
But it might be that on your server version it still works.

Edited by Winterfox
  • Like 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.01
  • Content Count:  19
  • Reputation:   4
  • Joined:  04/18/23
  • Last Seen:  

Thank you very much for your attention... and for wanting to help me... I thank you from the bottom of my heart for your help!

@WinterfoxΒ / @Emistry
πŸ’™πŸ’™πŸ’™πŸ’™πŸ’™πŸ’™πŸ’™πŸ’™

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Γ—
Γ—
  • Create New...