Jump to content

Question

Posted

i want a bet npc

the npc is

i want the person when he talk to the npc

the npc ask him first yes or no for betting

the betting is

only for 40m Zeny

70% lose them

30% be 80m Zemy

5 answers to this question

Recommended Posts

Posted


prontera,150,150,0    script    Gambler    100,{

    set .@npc$,"[ " +strnpcinfo(1)+ " ]";

    set .@chance,30; // 30% chance

    set .@zeny,40000000;

    mes .@npc$;

    mes "Bet with me " +strcharinfo(0);

    if ( select("Yes:No") - 1 || Zeny < .@zeny ) end;

if ( rand(100) < .@chance )

        set Zeny, Zeny + ( .@zeny * 2 );

    else

   set Zeny, Zeny - .@zeny;

}

Posted

Try this:

prontera,150,150,0	script	Gambler	100,{
	set .@npc$," [ " +strnpcinfo(1)+ " ]";
	set .@chance, 30; // 30% chance
	set .@zeny, 40000000;

	mes .@npc$;
	mes "Bet with me, " + strcharinfo(0) + "!";
	if (2 == select("Yes:No")) {
		next;
		mes .@npc$;
		mes "Okay, maybe next time.";
		close;
	}
	if (.@zeny > Zeny) {
		next;
		mes .@npc$;
		mes "I'm sorry, but you don't have enough Zeny. You need " + .@zeny + " to bet.";
		close;
	}
	next;
	if (rand(100) < .@chance) {
		mes .@npc$;
		mes "Hooray, you won!";
		set Zeny, Zeny + ( .@zeny * 2 );
		close;
	} else {
		mes .@npc$;
		mes "Too bad, you lost!";
		set Zeny, Zeny - .@zeny;
		close;
	}
}

 

The same as Patskie's, but with more detailed output for the user.

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...