Jump to content
  • 0

Unwanted Item Crafted


Dolphin86

Question


  • Group:  Members
  • Topic Count:  255
  • Topics Per Day:  0.06
  • Content Count:  706
  • Reputation:   16
  • Joined:  01/07/12
  • Last Seen:  

 

hye i was using this script here, but somehow the script end up with item which is not suppose to be crafted on the part i tagged, the unwanted item on the part is 40011 which is no where to be found on the part of the script i was testing..

4.png.8f4922683a239cde2227c109f8afde15.png

here is the part of the script, which should not produce 40011, but somehow it just did:

Spoiler
//======================================================================================================================
		if(rand(1, 100) <= 99){ // I was making this, somehow i got unwated item which is 40011 which is not in this script part
									delitem 40026, 1;
									getitem 40036, 1;
									setarray(getd("$wrkb_" + .@wrkb_id + "_products"), .@Meat[rand(getarraysize(.@Meat))], 1);
									goto OnCraftingStart;
									end;
									}
									
									delitem 40026, 1;
									setarray(getd("$wrkb_" + .@wrkb_id + "_products"), 40036, 1, 40010, 1);
									goto OnCraftingStart;
									end;
									//======================================================================================================================
							}

 

full script :

Spoiler
-	script	::Buther_Table	-1,{

	setarray .@Bone[0], 40101,40102,40103,40104,40105;
	setarray .@Meat[0], 40116,40117,40118,40119,40120;

	.@wrkb_id = atoi(strnpcinfo(2));

	if($wrkb_crafting_state[.@wrkb_id] == 1) {
		mes "Please wait until the process is finished. ";
		close;
	}

	if($wrkb_crafting_state[.@wrkb_id] == 2) {
		mes "Here are your crafted items.";
		for(.@i = 0; .@i < getarraysize(getd("$wrkb_" + .@wrkb_id + "_products")); .@i += 2)
			getitem(getd("$wrkb_" + .@wrkb_id + "_products[" + .@i + "]"), getd("$wrkb_" + .@wrkb_id + "_products[" + (.@i + 1) + "]"));

		delwaitingroom;
		$wrkb_crafting_state[.@wrkb_id] = 0;
		close;
	}
	
			mes "Select :-"; 
			next;
			switch(select("- Take Bone only:- Take Meat Only:- Take Monster Skin Only:- Cancel")) {
			
				case 1:// BONE
					mes "Take Bone";
					switch(select("- Use Stone Blade:- Use Make Shift Bone Blade:- Cancel")) {
					
						case 1:// Stone Blade
							if(countitem(40043) == 1){ //T1
								if(countitem(40026) < 1 || rentalcountitem(40024) < 1){
									mes "Require :";
									mes "[1] Monster Loot";
									mes "[1] Stone Blade";
									close3;
								}
									delitem 40026, 1;
									setarray(getd("$wrkb_" + .@wrkb_id + "_products"), 40036, 1, 40011, 1);
									goto OnCraftingStart;
									end;
							}
							
							if(countitem(40106) == 1){ //T2
								if(countitem(40026) < 1 || rentalcountitem(40024) < 1){
									mes "Require :";
									mes "[1] Monster Loot";
									mes "[1] Stone Blade";
									close3;
								}
									delitem 40026, 1;
									setarray(getd("$wrkb_" + .@wrkb_id + "_products"), 40036, 1, 40011, 1); 
									goto OnCraftingStart;
									end;
							}
						case 2:
							if(countitem(40043) == 1){ //T1
								if(countitem(40026) < 1 || rentalcountitem(40058) < 1){
									mes "Require :";
									mes "[1] Monster Loot";
									mes "[1] Make Shift Bone Blade";
									close3;
								}
									delitem 40026, 1;
									setarray(getd("$wrkb_" + .@wrkb_id + "_products"), 40036, 1, 40011, 1);
									goto OnCraftingStart;
									end;
							}
							// 
							if(countitem(40106) == 1){ //T2
								if(countitem(40026) < 1 || rentalcountitem(40058) < 1){
									mes "Require :";
									mes "[1] Monster Loot";
									mes "[1] Make Shift Bone Blade";
									close3;
										}
									
									if(rand(1, 100) <= 5){
									delitem 40026, 1;
									getitem 40036, 1;
									setarray(getd("$wrkb_" + .@wrkb_id + "_products"), .@Bone[rand(getarraysize(.@Bone))], 1);
									goto OnCraftingStart;
									end;
									}
									
									delitem 40026, 1;
									setarray(getd("$wrkb_" + .@wrkb_id + "_products"), 40036, 1, 40011, 1); 
									goto OnCraftingStart;
									end;
							}
							
						case 3:
							mes "Cancel";
							close3;
					}
				case 2://MEAT
					mes "Take Meat";
					switch(select("- Use Stone Blade:- Use Make Shift Bone Blade:- Cancel")) {
					
						case 1:// Stone Blade
							if(countitem(40043) == 1){ //T1
								if(countitem(40026) < 1 || rentalcountitem(40024) < 1){
									mes "Require :";
									mes "[1] Monster Loot";
									mes "[1] Stone Blade";
									close3;
								}
									delitem 40026, 1;
									setarray(getd("$wrkb_" + .@wrkb_id + "_products"), 40036, 1, 40010, 1);
									goto OnCraftingStart;
									end;
							}
							
							if(countitem(40106) == 1){ //T2
								if(countitem(40026) < 1 || rentalcountitem(40024) < 1){
									mes "Require :";
									mes "[1] Monster Loot";
									mes "[1] Stone Blade";
									close3;
								}
									delitem 40026, 1;
									setarray(getd("$wrkb_" + .@wrkb_id + "_products"), 40036, 1, 40010, 1);
									goto OnCraftingStart;
									end;
							}
						case 2:
							if(countitem(40043) == 1){ //T1
								if(countitem(40026) < 1 || rentalcountitem(40058) < 1){
									mes "Require :";
									mes "[1] Monster Loot";
									mes "[1] Make Shift Bone Blade";
									close3;
								}
									delitem 40026, 1;
									setarray(getd("$wrkb_" + .@wrkb_id + "_products"), 40036, 1, 40010, 1);
									goto OnCraftingStart;
									end;
							}
							// 
							if(countitem(40106) == 1){ //T2
								if(countitem(40026) < 1 || rentalcountitem(40058) < 1){
									mes "Require :";
									mes "[1] Monster Loot";
									mes "[1] Make Shift Bone Blade";
									close3;
										}
									//======================================================================================================================
									if(rand(1, 100) <= 99){ // I was making this, somehow i got unwated item which is 40011 which is not in this script part
									delitem 40026, 1;
									getitem 40036, 1;
									setarray(getd("$wrkb_" + .@wrkb_id + "_products"), .@Meat[rand(getarraysize(.@Meat))], 1);
									goto OnCraftingStart;
									end;
									}
									
									delitem 40026, 1;
									setarray(getd("$wrkb_" + .@wrkb_id + "_products"), 40036, 1, 40010, 1);
									goto OnCraftingStart;
									end;
									//======================================================================================================================
							}
							
						case 3:
							mes "Cancel";
							close3;
					}
				case 3://SKIN
						mes "WIP";
						close3;
				case 4:
						mes "Process Cancel";
						close3;
						}
	end;

	OnCraftingStart:
		$wrkb_crafting_state[.@wrkb_id] = 1;
		waitingroom("PROCESSING...", 0);
		initnpctimer;
		end;

	OnTimer6000:
		$wrkb_crafting_state[atoi(strnpcinfo(2))] = 2;
		delwaitingroom;
		waitingroom("COMPLETED!", 0);
		end;

	OnInit:
		.@wrkb_id = atoi(strnpcinfo(2));
		if(.@wrkb_id < 1) end;

		if($wrkb_crafting_state[.@wrkb_id] == 1) goto OnCraftingStart;
}
//Duplicate
//=====================================================
chry_fld,81,74,6	duplicate(Buther_Table)	Public Butcher Table#3001	665
ma_fild01,317,289,6	duplicate(Buther_Table)	Public Butcher Table#3002	665
ma_fild01,264,358,6	duplicate(Buther_Table)	Public Butcher Table#3003	665

ma_fild01,231,316,6	duplicate(Buther_Table)	Public Butcher Table#3004	665
ma_fild01,144,285,6	duplicate(Buther_Table)	Public Butcher Table#3005	665
ma_fild01,54,193,6	duplicate(Buther_Table)	Public Butcher Table#3006	665
ma_fild01,91,91,6	duplicate(Buther_Table)	Public Butcher Table#3007	665

ma_fild01,196,185,6	duplicate(Buther_Table)	Public Butcher Table#3008	665
ma_fild01,234,240,6	duplicate(Buther_Table)	Public Butcher Table#3009	665
ma_fild01,182,107,6	duplicate(Buther_Table)	Public Butcher Table#3010	665
ma_fild01,281,120,6	duplicate(Buther_Table)	Public Butcher Table#3011	665

new_1-3,87,137,6	duplicate(Buther_Table)	Public Butcher Table#3012	665
new_1-3,93,137,6	duplicate(Buther_Table)	Public Butcher Table#3013	665
new_1-3,99,137,6	duplicate(Buther_Table)	Public Butcher Table#3014	665

 

 

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