Jump to content
  • 0

Question

2 answers to this question

Recommended Posts

  • 0
Posted (edited)
On 4/27/2019 at 1:42 PM, rotloso said:

hi rathena! i need npc to exchange +9item & 20item & 10item = item

Ex this : +9Knife & 20Jellopy & 10Gold = Cotton shirt

help me or guide me plz..

Fresh script that i just coded, you may try it.

//===== rAthena Script =======================================
//= Exchange Shop
//===== By: ==================================================
//= KidoSang
//===== Current Version: =====================================
//= 1.0
//===== Compatible With: =====================================
//= rAthena Project
//===== Description: =========================================
//= Simple Exchange Shop.
//===== Additional Comments: =================================
//= 1.0 Initial script.
//============================================================
prontera,156,182,4	script	Exchange Shop	826,{
	set .RefineItem,1201;					//Refine item id
	set .RefineLevel,7;						//Refine value
	setarray .OtherItem[0],909,20,969,10;   //Adding other items for exchange
	set	.Reward,512;						//Reward
	
	mes "You need to give me";
	
	.@checking = 0;
	
	if (!countitem2(.RefineItem,1,7,0,0,0,0,0)) {
		.@checking = 1;
	}
	
	mes "+"+.RefineLevel+" "+getitemname(.RefineItem)+" "+countitem2(.RefineItem,1,7,0,0,0,0,0)+"/1";
		
	for(.@i=0; .@i < getarraysize(.OtherItem); set .@i,.@i+2){
		if(countitem(.OtherItem[.@i]) < .OtherItem[.@i+1]){
			.@checking = 1;
		}
		mes "~ "+.OtherItem[.@i+1]+" "+getitemname(.OtherItem[.@i])+" "+countitem(.OtherItem[.@i])+"/"+.OtherItem[.@i+1];		
	}
	
	mes "to exchange "+getitemname(.Reward);
	
	.@sel = select("Exchange Please!","No");
	
	if(.@sel){
		if(.@checking){
			next;
			mes "Sorry you are missing some items";
		}else{
			next;
			mes "Done!";
			delitem2(.RefineItem,1,1,7,0,0,0,0,0);
			for(.@i=0; .@i < getarraysize(.OtherItem); set .@i,.@i+2)
				delitem .OtherItem[.@i],.OtherItem[.@i+1];
			getitem .Reward,1;
		}
	}
	end;
}

 

Edited by KidoSang
Script have some issue so i change a new one
  • 0
Posted
2 hours ago, KidoSang said:

Fresh script that i just coded, you may try it.


//===== rAthena Script =======================================
//= Exchange Shop
//===== By: ==================================================
//= KidoSang
//===== Current Version: =====================================
//= 1.0
//===== Compatible With: =====================================
//= rAthena Project
//===== Description: =========================================
//= Simple Exchange Shop.
//===== Additional Comments: =================================
//= 1.0 Initial script.
//============================================================
prontera,156,182,4	script	Exchange Shop	826,{
	set .RefineItem,1201;					//Refine item id
	set .RefineLevel,7;						//Refine value
	setarray .OtherItem[0],909,20,969,10;   //Adding other items for exchange
	set	.Reward,512;						//Reward
	
	mes "You need to give me";
	
	.@checking = 0;
	
	if (!countitem2(.RefineItem,1,7,0,0,0,0,0)) {
		.@checking = 1;
	}
	
	mes "+"+.RefineLevel+" "+getitemname(.RefineItem)+" "+countitem2(.RefineItem,1,7,0,0,0,0,0)+"/1";
		
	for(.@i=0; .@i < getarraysize(.OtherItem); set .@i,.@i+2){
		if(countitem(.OtherItem[.@i]) < .OtherItem[.@i+1]){
			.@checking = 1;
		}
		mes "~ "+.OtherItem[.@i+1]+" "+getitemname(.OtherItem[.@i])+" "+countitem(.OtherItem[.@i])+"/"+.OtherItem[.@i+1];		
	}
	
	mes "to exchange "+getitemname(.Reward);
	
	.@sel = select("Exchange Please!","No");
	
	if(.@sel){
		if(.@checking){
			next;
			mes "Sorry you are missing some items";
		}else{
			next;
			mes "Done!";
			delitem2(.RefineItem,1,1,7,0,0,0,0,0);
			for(.@i=0; .@i < getarraysize(.OtherItem); set .@i,.@i+2)
				delitem .OtherItem[.@i],.OtherItem[.@i+1];
			getitem .Reward,1;
		}
	}
	end;
}

 

Thx @KidoSang 

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