Jump to content
  • 0

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


Question

Posted
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

2 answers to this question

Recommended Posts

  • 0
Posted
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

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...