Jump to content
  • 0

only getting the first item


xienne15

Question


  • Group:  Members
  • Topic Count:  44
  • Topics Per Day:  0.01
  • Content Count:  226
  • Reputation:   11
  • Joined:  01/09/12
  • Last Seen:  

bif_fild01,163,61,4	script	MINING SPOT	66,{
			if (countitem(558) > 1) goto OnMine;
			mes "A big rock.";
			close;

OnMine:
	setarray .@array,	26106, 10,
				26107, 10,
				640, 15,
				714, 15,
				715, 60,
				716, 60,
				717, 60,
				718, 20,
				719, 20,
				720, 20,
				721, 20,
				722, 20,
				723, 20,
				724, 20,
				725, 20,
				726, 20,
				727, 20,
				728, 20,
				729, 20,
				730, 16,
				731, 14,
				732, 12,
				733, 50,
				6077, 20,
				7300, 20,
				756, 20,
				757, 20,
				2794, 5,
				7049, 70,
				6078, 70,
				7067, 70 ;
	set .@len, getarraysize(.@array);
	delitem 26105,1;
	if(rand(2)-1)
		while(set(.@i,.@i+2)-2<=.@len)
			if(rand(100)<=.@array[.@i]) {
				set .@item, .@array[.@i]-1;
		misceffect 795;
		soundeffect "mining.wav",0;
				progressbar "brown",2;
		misceffect 795;
				specialeffect2 610;
				getitem(.@item,1);
				mes "You successfully mined a "+getitemname(.@item)+".";
				close;
			}
		misceffect 795;
		soundeffect "mining.wav",0;
				progressbar "brown",2;
		misceffect 795;
	mes "You failed to mine.";
	specialeffect2 611;
	close;
}

i am only getting the 26106 in the arrray. How to fix this?

Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

i am only getting the 26106 in the arrray. How to fix this?

 

 

If you're getting help on a topic don't make another topic about the same thing... This forums has enough post.

 

bif_fild01,163,61,4	script	MINING SPOT	66,{
			if (countitem(558) > 1) goto OnMine;
			mes "A big rock.";
			close;

OnMine:
	setarray .@array,	26106, 10,
				26107,10, 640,15, 714,15 , 715,60 , 716,60 ,
				717,60  , 718,20, 719,20 , 720,20 , 721,20 ,
				722,20  , 723,20, 724,20 , 725,20 , 726,20 ,
				727,20  , 728,20, 729,20 , 730,16 , 731,14 ,
				732,12  , 733,50, 6077,20, 7300,20, 756,20 ,
				757,20  , 2794,5, 7049,70, 6078,70, 7067,70;
	set .@len, getarraysize(.@array);
	delitem 26105,1;
	if(rand(2)-1) {
		while(set(.@i,.@i+2)-2<.@len)
			if(rand(100)<=.@array[.@i-1]) {
				set .@item, .@array[.@i-2];
				misceffect 795;
				soundeffect "mining.wav",0;
				progressbar "brown",2;
				misceffect 795;
				specialeffect2 610;
				getitem(.@item,1);
				mes "You successfully mined a "+getitemname(.@item)+".";
			}
	} else {
		misceffect 795;
		soundeffect "mining.wav",0;
		progressbar "brown",2;
		misceffect 795;
		mes "You failed to mine.";
		specialeffect2 611;
	} close;
}
Edited by Skorm
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

			if(rand(100)<=.@array[.@i]) {
				set .@item, .@array[.@i]-1;

change to

			if(rand(100)<=.@array[.@i+1]) {
				set .@item, .@array[.@i];
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

			if(rand(100)<=.@array[.@i]) {
				set .@item, .@array[.@i]-1;

change to

			if(rand(100)<=.@array[.@i+1]) {
				set .@item, .@array[.@i];

 

Actually it should be:

 

		while(set(.@i,.@i+2)-2<.@len)
			if(rand(100)<=.@array[.@i-1]) {
				set .@item, .@array[.@i-2];

 

Good spot though I put this one together in under 5 minutes and somethings slipped my mind.

Edited by Skorm
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...