Jump to content
  • 0

can anyone edit this to put how many they need to craft


AinsLord

Question


  • Group:  Members
  • Topic Count:  257
  • Topics Per Day:  0.08
  • Content Count:  737
  • Reputation:   18
  • Joined:  11/21/15
  • Last Seen:  

prontera,155,181,5	script	YmirCoin	757,{

	mes "[Ymir Coin Exchanger]";
	mes "Just give me the required items and ill give you Coin of Ymir";
 	next;

// What Item you want to Make ?
set .GiveItem,7539;
// Item Requirements + Amounts
setarray .Item[0],
  607,1,
  608,1,
  512,1;

for( set .@i,0; .@i < getarraysize( .Item ) - 1; set .@i,.@i + 2 )
if( countitem( .Item[.@i] ) < .Item[.@i + 1] ){
 for( set .@i,0; .@i < getarraysize( .Item ) - 1; set .@i,.@i + 2 )
  mes "Need "+.Item[.@i + 1]+" x "+getitemname( .Item[.@i] );
 close;
}
if( select("Make ^FF0000"+getitemname( .GiveItem )+"^000000:Cancel") == 2 ) close;
for( set .@i,0; .@i < getarraysize( .Item ) - 1; set .@i,.@i + 2 )
delitem .Item[ .@i ],.Item[ .@i + 1 ];
getitem .GiveItem,1;
mes "You have Make ^FF0000"+getitemname( .GiveItem )+"^000000";
announce "["+strcharinfo(0)+"] has made ["+getitemname( .GiveItem )+"]",0;
close;
}

its like need to set how many to craft coz this one is crafted 1 by 1

#TIA

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  477
  • Reputation:   269
  • Joined:  06/13/17
  • Last Seen:  

prontera,155,181,5	script	YmirCoin	757,{

	mes "[Ymir Coin Exchanger]";
	mes "Just give me the required items and ill give you Coin of Ymir.";
	mes "Required Mats per ^FF0000"+getitemname(.GiveItem)+"^000000:";
	for( set .@i,0; .@i < getarraysize( .Item ) - 1; set .@i,.@i + 2 )
		mes "- ^FF0000"+.Item[.@i+1]+" "+getitemname(.Item[.@i]);
	next;
	if( select("Make ^FF0000"+getitemname( .GiveItem )+"^000000:Cancel") == 2 ) end;
	mes "[Ymir Coin Exchanger]";
	mes "How many would you like to make?";
	next;
	input .@amount,1,999;
	mes "[Ymir Coin Exchanger]";
	mes .@amount+"x ^FF0000"+getitemname(.GiveItem)+"^000000, is this correct?";
	next;
	if( select("Yes, Make ^FF0000"+.@amount+" "+getitemname( .GiveItem )+"^000000:Cancel") == 2 ) end;
	for( set .@i,0; .@i < getarraysize( .Item ) - 1; set .@i,.@i + 2 )
		if( countitem( .Item[.@i] ) < .Item[.@i+1]*.@amount ){
			mes "[Ymir Coin Exchanger]";
			mes "Insufficient Materials";
			for( set .@i,0; .@i < getarraysize( .Item ) - 1; set .@i,.@i + 2 )
				mes "- Need ( "+countitem(.Item[.@i])+"/"+.Item[.@i + 1]*.@amount+" ) "+getitemname( .Item[.@i] );
			end;
		}
	if(!checkweight(.GiveItem,.@amount)){
		mes "Insufficient inventory space or weight.";
		end;
	}
	for( set .@i,0; .@i < getarraysize( .Item ) - 1; set .@i,.@i + 2 )
		delitem .Item[ .@i ],.Item[ .@i + 1 ]*.@amount;
	getitem .GiveItem,.@amount;
	mes "[Ymir Coin Exchanger]";
	mes "You have Made ^FF0000"+.@amount+"x "+getitemname( .GiveItem )+"^000000";
	announce "["+strcharinfo(0)+"] has made "+.@amount+"x ["+getitemname( .GiveItem )+"]",0;
close;

OnInit:
	// What Item you want to Make ?
	set .GiveItem,7539;
	// Item Requirements + Amounts
	setarray .Item[0],
	607,1,
	608,1,
	512,1;
end;
}

It's much better to check the requirement before giving the item, instead of before selecting MAKE. also added checkweight if ever that the given item is heavier than required materials.

  • MVP 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  257
  • Topics Per Day:  0.08
  • Content Count:  737
  • Reputation:   18
  • Joined:  11/21/15
  • Last Seen:  

Thnx a lot ❤️❤️ 

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