Jump to content
  • 0

Change zeny with an item


legtoleg

Question


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  21
  • Reputation:   0
  • Joined:  02/11/19
  • Last Seen:  

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;
}

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  18
  • Reputation:   12
  • Joined:  04/10/20
  • Last Seen:  

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.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  21
  • Reputation:   0
  • Joined:  02/11/19
  • Last Seen:  


 

 

Hello !

no, I want war badges (id 7773) but not zeny 

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