Jump to content
  • 0

R>Exchange +9item to item


MyNoobScriptz

Question


  • Group:  Members
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  74
  • Reputation:   3
  • Joined:  05/01/15
  • Last Seen:  

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

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

help me or guide me plz..

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.01
  • Content Count:  24
  • Reputation:   3
  • Joined:  04/10/19
  • Last Seen:  

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
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  74
  • Reputation:   3
  • Joined:  05/01/15
  • Last Seen:  

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 

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