• 0
Sign in to follow this  
Mistique

Identifier & Repairman.

Question

Hi community.

I've been going crazy over this script and decided to reach out for some assistance. The script I want is very basic (I think?)- an identifier and repair NPC combined. He would charge 3000z total for the choice they select in the menu (3000 total, not per unidentified/broken item).

As you can see I've messed around with the script in hope to achieve desired result but alas. Help would be greatly appreciated. Thank you. 🙂

[Header]
	mes "[Equip Assistant]";
	mes "Hello, do you need your help with your equipment?";
	menu "Identify - 3,000 Zeny",-,"Repair - 3,000 Zeny",L_Repair;

set [email protected], 3000;
getinventorylist;
for(set [email protected],0; [email protected]<@inventorylist_count; set [email protected],[email protected]+1) {
	if (@inventorylist_identify[[email protected]]) continue;
	if (Zeny < [email protected]) {
		dispbottom "It costs "[email protected]+" Zeny to identify an item."; break; }
	set Zeny, [email protected];
	delitem2 @inventorylist_id[[email protected]],1,0,0,0,0,0,0,0;
	getitem @inventorylist_id[[email protected]],1;
	setarray [email protected][0], [email protected][0]+1, [email protected][1][email protected]; }
if ([email protected][0]) {
	message strcharinfo(0),"No items identified."; end; }
specialeffect2 154;
message strcharinfo(0),"Identified "[email protected][0]+" items"+(([email protected][1])?" for "[email protected][1]+" Zeny":"")+".";
end;

L_Repair:
		if (Zeny < [email protected]) {
			dispbottom "It costs "[email protected]+" Zeny to repair your items.";
			close;
			}

if (getbrokenid(1) == 0){
	message strcharinfo(0),"No broken items detected.";
	 end;
	 }
	
while (getbrokenid(1)) {
	repair(1);

	}
	if ([email protected]) message strcharinfo(0),"Repaired "+ [email protected] + " items for "[email protected]+" Zeny."; // How to make this part show?
	set Zeny, [email protected];
	end;
	}

 

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0
Posted (edited)

I hope this helps.


	disable_items;
	set [email protected], 3000;
	mes "[Equip Assistant]";
	mes "Hello, do you need your help with your equipment?";
	switch(select("Repair Equipment","Identify Equipment")){
		case 1:
			if (Zeny < [email protected]) {
				dispbottom "It costs "[email protected]+" Zeny to repair your items.";
				end;
			}else {
				if( getbrokenid(1) ){
					repairall;
					set Zeny, Zeny- [email protected];
					dispbottom "Your items have been repaired.";
				} else {
					message strcharinfo(0),"No broken items detected.";
					 end;
				}
			}
		break;
		case 2:
			getinventorylist;
			for(set [email protected],0; [email protected]<@inventorylist_count; set [email protected],[email protected]+1) {
				if (@inventorylist_identify[[email protected]]) 
					continue;
				if (Zeny < [email protected]) {
					dispbottom "It costs "[email protected]+" zeny to identify an item.";
				}else {
					setarray [email protected][0], [email protected][0]+1, [email protected][1][email protected];
				}
			}
			if ([email protected][0]) {
				message strcharinfo(0),"No items where identified.";
				end;
			} else {
				set Zeny, [email protected];
				specialeffect2 154;
				atcommand "@identifyall";
				message strcharinfo(0),"Identified "[email protected][0]+" items"+(([email protected][1])?" for "[email protected][1]+" Zeny":"")+".";
				end;
			}
		break;
	}

 

Edited by Clark
  • Upvote 1

Share this post


Link to post
Share on other sites
  • 0
7 hours ago, Clark said:

I hope this helps.


	disable_items;
	set [email protected], 3000;
	mes "[Equip Assistant]";
	mes "Hello, do you need your help with your equipment?";
	switch(select("Repair Equipment","Identify Equipment")){
		case 1:
			if (Zeny < [email protected]) {
				dispbottom "It costs "[email protected]+" Zeny to repair your items.";
				end;
			}else {
				if( getbrokenid(1) ){
					repairall;
					set Zeny, Zeny- [email protected];
					dispbottom "Your items have been repaired.";
				} else {
					message strcharinfo(0),"No broken items detected.";
					 end;
				}
			}
		break;
		case 2:
			getinventorylist;
			for(set [email protected],0; [email protected]<@inventorylist_count; set [email protected],[email protected]+1) {
				if (@inventorylist_identify[[email protected]]) 
					continue;
				if (Zeny < [email protected]) {
					dispbottom "It costs "[email protected]+" zeny to identify an item.";
				}else {
					setarray [email protected][0], [email protected][0]+1, [email protected][1][email protected];
				}
			}
			if ([email protected][0]) {
				message strcharinfo(0),"No items where identified.";
				end;
			} else {
				set Zeny, [email protected];
				specialeffect2 154;
				atcommand "@identifyall";
				message strcharinfo(0),"Identified "[email protected][0]+" items"+(([email protected][1])?" for "[email protected][1]+" Zeny":"")+".";
				end;
			}
		break;
	}

 

use < "+strcharinfo(0)+" > in command 😄

		atcommand "@repairall "+strcharinfo(0)+"'";
		atcommand "@identifyall "+strcharinfo(0)+"'";

 

if you do not use, you can from the error in some situations.

  • Upvote 1

Share this post


Link to post
Share on other sites
  • 0
3 hours ago, Gladius said:

use < "+strcharinfo(0)+" > in command 😄

		atcommand "@repairall "+strcharinfo(0)+"'";
		atcommand "@identifyall "+strcharinfo(0)+"'";

 

if you do not use, you can from the error in some situations.

nope, my script not use < "+strcharinfo(0)+" >

and it's working 

identification.txt

But this only for identification, to get free identification must doing quest.

  • Upvote 2

Share this post


Link to post
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.

Loading...
Sign in to follow this