Jump to content
  • 0

Question

Posted

Hello,

I use this script and I try to modify the zeny requested by war badges.

Thank you in advance ?

 

Quote

z_agit,16,108,6    script    Claw Machine    563,{

.@npcName$ = "[" + strnpcinfo(1) + "]";

mes .@npcName$;
mes "Hello, for 75 War Badge you have a chance to obtain one of these items :";
for (.@i = 0; .@i < getarraysize(.items); .@i++) {
        mes "^008000~ " + getitemname(.items[.@i]) + "^000000";
}
next;

switch(select("Gamble!:Leave")) {
        case 1:
                if (Zeny < 1000000) {
                        mes .@npcName$;
                        mes "I'm afraid you don't have enough to gamble.";
                        close;
                }

                Zeny -= 1000000;
                .@rand = rand(1,100);
                for (.@i = 0 ; .@i < getarraysize(.items) ; .@i++) {
                        if (.@rand <= .percents[.@i]) { getitem .items[.@i],1 ; dispbottom "Congrats! You won 1 "+getitemname(.items[.@i])+" !"  ; .@won = 1; }
                }
                if (!.@won) dispbottom "You lost !";
                mes .@npcName$;
                mes "There you go!";
                break;
        case 2:
                break;
}

close;
OnInit:
setarray .items,7773,671;
setarray .percents,50,20;
end;
}

 

2 answers to this question

Recommended Posts

  • 0
Posted
z_agit,16,108,6    script    Claw Machine    563,{

.@npcName$ = "[" + strnpcinfo(1) + "]";

mes .@npcName$;
mes "Hello, for 75 War Badge you have a chance to obtain one of these items :";
for (.@i = 0; .@i < getarraysize(.items); .@i++) {
        mes "^008000~ " + getitemname(.items[.@i]) + "^000000";
}
next;

switch(select("Gamble!:Leave")) {
        case 1:
                if (Zeny < .zenyCost) {
                        mes .@npcName$;
                        mes "I'm afraid you don't have enough to gamble.";
                        close;
                }

                Zeny -= .zenyCost;
                .@rand = rand(1,100);
                for (.@i = 0 ; .@i < getarraysize(.items) ; .@i++) {
                        if (.@rand <= .percents[.@i]) { getitem .items[.@i],1 ; dispbottom "Congrats! You won 1 "+getitemname(.items[.@i])+" !"  ; .@won = 1; }
                }
                if (!.@won) dispbottom "You lost !";
                mes .@npcName$;
                mes "There you go!";
                break;
        case 2:
                break;
}

close;
OnInit:
	.zenyCost = 1000000;	// Change to what you want the zeny cost to be
	setarray .items,7773,671;
	setarray .percents,50,20;
	end;
}

 

You just want the zeny cost to be different? Try this.

Modify the integer after .zenyCost in the OnInit section and it will change.

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...