Jump to content
  • 0

Help> BULK POTION BREWER


ShiroNaito

Question


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.02
  • Content Count:  65
  • Reputation:   1
  • Joined:  04/04/19
  • Last Seen:  

Good evening ! Im trying to create a BULK BREWER like I want to brew 100 GRENADES and 100 ACID Bottles

but the thing is ,If I input a quantity of 5 ,It will succeed or fail ...My problem here is ,how can I make it succeed or fail for every quantity ? for example I input 10 ,3 will fail but 7 will successfully brewed . 

 

 

Heres my Script Please Help me Thankyou

Quote

prontera,164,171,4    script    Potion Brewer    893,{
    mes "[Potion Brewer Alisa]";
    mes "Hello, "+strcharinfo(0)+"!";
    mes "How may I help you?";
    next;
    
    switch (select("Brew Grenade:Brew Acid:")) {
    
    case 1:    
            input .@quantity;
            next;
            if (countitem(713) < 1 * .@quantity || countitem(970) < 1 * .@quantity || countitem(1059) < 1 * .@quantity ) {
                mes "You're lacking of requirements.";
                close;
            }
            else {
                set @brewchance,rand(1,5);
                if(@brewchance == 3) {
                //progressbar "ffff00",1;
                delitem 713,1 * .@quantity;
                delitem 970,1 * .@quantity;
                delitem 1059,1 * .@quantity;
                getitem 7135,1 * .@quantity;
                end;
                }
            else {
            misceffect 306;
                delitem 713,1 * .@quantity;
                delitem 970,1 * .@quantity;
                delitem 1059,1 * .@quantity;    
            //goto Lfail;
            end;
    }
        }
    
    
    
    }
    
    

}

 

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

  • Group:  Content Moderator
  • Topic Count:  55
  • Topics Per Day:  0.02
  • Content Count:  1676
  • Reputation:   703
  • Joined:  12/21/14
  • Last Seen:  

the chance logic was incorrect btw

if(rand(1,5) == 3) // this mean the chance is 1/5

if(rand(1,5) <= 3) // this mean the chance is 3/5

 

leave the mac quantity 250 or add sleep in the loop if you know what i mean

 

prontera,164,171,4	script	Potion Brewer	893,{
	mes "[Potion Brewer Alisa]";
	mes "Hello, "+strcharinfo(0)+"!";
	mes "How may I help you?";
	next;

	switch (select("Brew Grenade:Brew Acid:")) {
		case 1:    
			input .@quantity;
			if(.@quantity > 250){
				mes "the max quantity you can do at once is 250";
				end;
			}
			clear;
			if (countitem(713) < .@quantity || countitem(970) < .@quantity || countitem(1059) < .@quantity ) {
				mes "You're lacking of requirements.";
				close;
			}
			for(.@i=0;.@i<.@quantity;.@i++){
				if(rand(1,5) <= 3) {
					.@count++;
				}
			}
			delitem 713,.@quantity;
			delitem 970,.@quantity;
			delitem 1059,.@quantity;
			getitem 7135,.@count;
			end;
	}
end;
}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.02
  • Content Count:  65
  • Reputation:   1
  • Joined:  04/04/19
  • Last Seen:  

4 hours ago, sader1992 said:

the chance logic was incorrect btw

if(rand(1,5) == 3) // this mean the chance is 1/5

if(rand(1,5) <= 3) // this mean the chance is 3/5

 

leave the mac quantity 250 or add sleep in the loop if you know what i mean

 


prontera,164,171,4	script	Potion Brewer	893,{
	mes "[Potion Brewer Alisa]";
	mes "Hello, "+strcharinfo(0)+"!";
	mes "How may I help you?";
	next;

	switch (select("Brew Grenade:Brew Acid:")) {
		case 1:    
			input .@quantity;
			if(.@quantity > 250){
				mes "the max quantity you can do at once is 250";
				end;
			}
			clear;
			if (countitem(713) < .@quantity || countitem(970) < .@quantity || countitem(1059) < .@quantity ) {
				mes "You're lacking of requirements.";
				close;
			}
			for(.@i=0;.@i<.@quantity;.@i++){
				if(rand(1,5) <= 3) {
					.@count++;
				}
			}
			delitem 713,.@quantity;
			delitem 970,.@quantity;
			delitem 1059,.@quantity;
			getitem 7135,.@count;
			end;
	}
end;
}

 

Good day sir sadders .. I tried the script but it didnt work ...Can you help me with this one ? 

Link to comment
Share on other sites

  • 0

  • Group:  Content Moderator
  • Topic Count:  55
  • Topics Per Day:  0.02
  • Content Count:  1676
  • Reputation:   703
  • Joined:  12/21/14
  • Last Seen:  

the script work for me , you should be more specific

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.02
  • Content Count:  65
  • Reputation:   1
  • Joined:  04/04/19
  • Last Seen:  

Ahm okay sorry bad english master sader

 

 

 

Lets say I talk to NPC and I want to brew grenade bottle in bulk 

 

In my inventory I have 713 x250 , 970 x250 and 1059 x259 (item id)

 

I'll input 250x grenade bottles 

 

The npc will now brew but not it will read chances for every item ..

 

Because in my script when NPC ALISA FAILES all 250 items will be lost , no success items ..

Hope you understand -_- 

 

Im using rathena 2018

Edited by ShiroNaito
Link to comment
Share on other sites

  • 0

  • Group:  Content Moderator
  • Topic Count:  55
  • Topics Per Day:  0.02
  • Content Count:  1676
  • Reputation:   703
  • Joined:  12/21/14
  • Last Seen:  

38 minutes ago, ShiroNaito said:

Ahm okay sorry bad english master sader

 

 

 

Lets say I talk to NPC and I want to brew grenade bottle in bulk 

 

In my inventory I have 713 x250 , 970 x250 and 1059 x259 (item id)

 

I'll input 250x grenade bottles 

 

The npc will now brew but not it will read chances for every item ..

 

Because in my script when NPC ALISA FAILES all 250 items will be lost , no success items ..

Hope you understand -_- 

 

Im using rathena 2018

with the script i posted above

it's impossible to fail with all the 250

you will get some and loss some

make sure you are using the new script , maybe you didn't save the script or didn't reload the script

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.02
  • Content Count:  65
  • Reputation:   1
  • Joined:  04/04/19
  • Last Seen:  

On 6/29/2019 at 12:28 PM, sader1992 said:

with the script i posted above

it's impossible to fail with all the 250

you will get some and loss some

make sure you are using the new script , maybe you didn't save the script or didn't reload the script

I'm getting this kind of error sir 

Quote

script error on npc/custom/test_npc.txt line 10
    script:add_word: invalid word. A word consists of undercores and/or alphanumeric characters, and valid variable prefixes/postfixes.
     5 :        next;
     6 :
     7 :        switch (select("Brew Grenade:Brew Acid:")) {
     8 :                case 1:
     9 :                        input .@quantity;
*   10 :                        if(.@quantity > 250){'∩'╗┐
    11 :                                mes "the max quantity you can do at once is 250";∩╗┐∩╗┐
    12 :                                end;∩╗┐
    13 :                        }∩╗┐∩╗┐∩╗┐∩╗┐
    14 :                        clear;
    15 :                        if (countitem(713) < .@quantity || countitem(970) < .@quantity || countitem(1059) < .@quantity ) {
[Error]: npc_parsesrcfile: Unknown syntax in file 'npc/custom/test_npc.txt', line '31'. Stopping...
 * w1=∩╗┐
 * w2=
 * w3=
 * w4=

I fixed it sir @sader1992 Thankyou .its just on my notepad can I direct message you ? I have a question hmm

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