Jump to content
  • 0

a deffect somewhere in the script


Sunset

Question


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  89
  • Reputation:   3
  • Joined:  05/05/13
  • Last Seen:  

Hello my dear community!

I'm working on a lucky machince script, and its working "good".

Also the way the people gets the item is working, but somehow, from the switch( rand(1,MAX)) not only one item will be selected, and i get more reward than one. 

May you check it, where is the deffect? i cant find it. I attach a screenshot about the reward.

As you can see on the picture, i got 4 times the .@x reward, and im supposed to get it only once

I've marked the questionable part of the script with yellow.

Thanks in Advice a lot !

Spoiler

geffenia_in,359,231,4    script    Luck Machine    563,{
mes "the npc is on holidays";
close;}
//-----Core--------/
Start:
mes "[^1020FCLuck Machine^000000]";
mes "How are you today?";
mes "Would like to try your luck?";
    switch(select("Spin!:A speaking machine?!:Not today")){
        Case 1:{
            next;
                mes "[^1020FCLuck Machine^000000]";
                mes "Please place bid";
                mes "^FF0000Note:^000000 Bid cant be higher than 3m zeny!";
                        input .@zeny;
                        if (Zeny <= .@zeny) goto nozeny1;
                        if (.@zeny > 3000000) goto nozeny2;
                        if (.@zeny < 500000 && Zeny >=.@zeny) goto Bid1;
                        if (.@zeny >= 500000 && .@zeny <=999999 && Zeny >= .@zeny) goto Bid2;
                        if (.@zeny >= 1000000 && .@zeny <=3000000 && Zeny >= .@zeny) goto Bid3;
                                Bid1:{
                                    next;
                                    mes "bid1";
                                    mes "Your bid is "+.@zeny+"";
                                    switch (rand(1,14)) {
                                            if ( .@zeny >= 440000){ set .@highchance,1; set .@midchance,0; set .@lowchance,0;}
                                            if ( .@zeny < 440000 && .@zeny > 150000){ set .@midchance,1; set .@highchance,0; set .@lowchance,0;}
                                            if ( .@zeny <= 150000){ set .@lowchance,1; set .@highchance,0; set.@midchance,0;}
                                        case 1: set .@x,909;break;
                                        case 2: set .@x,7711;break;
                                        case 3: set .@x,604;break;
                                        case 4: set .@x,909;break;
                                        case 5: set .@x,909;break;
                                        case 6: set .@x,7711;break;
                                        case 7: set .@x,12910;break;
                                        case 8: set .@y,603;break;
                                        case 9: set .@y,969;break;
                                        case 10: set .@y,678;break;
                                        case 11: set .@z,12103;break;
                                        case 12: set .@z,616;break;
                                        case 13: set .@z,12259;break;
                                        case 14: set .@z,12883;break;
                                        } 
                                        if (.@lowchance == 1){
                                                    switch (rand(1,6)){
                                                        case 1: getitem .@x,50;
                                                        case 2: getitem .@x,50;
                                                        case 3: getitem .@x,50;
                                                        case 4: getitem .@x,50;
                                                        case 5: getitem .@y,10;
                                                        case 6: getitem .@z,1;
                                                    }}
                                        if (.@midchance == 1){
                                                    switch (rand(1,6)){
                                                        case 1: getitem .@x,50;
                                                        case 2: getitem .@x,50;
                                                        case 3: getitem .@y,10;
                                                        case 4: getitem .@z,1;
                                                    }}
                                        if (.@highchance == 1){
                                                    switch (rand(1,6)){
                                                        case 1: getitem .@x,50;
                                                        case 2: getitem .@y,10;
                                                        case 3: getitem .@z,1;
                                                    }}
                                    mes "blabla";
                                    next;
                                    goto Start;
                                    close;}
                                Bid2:
                                    next;
                                    mes "bid2";
                                    mes "Your bid is "+.@zeny+"";
                                close;
                                Bid3:
                                    next;
                                    mes "bid3";
                                    mes "Your bid is "+.@zeny+"";

                                close;
                    nozeny1:
                    next;
                            mes "You dont have that much zeny!";}
                        close;
                    nozeny2:
                    next;
                            mes "You placed too high bid!";
                            mes "Maximum ammount is 3m zeny!";
                        close;
        Case 2:{
            close;}
        Case 3:{
            close;}
        }
}

 

baaaaaaaaaaa.PNG

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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