Jump to content
  • 0

Question

Posted

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 .@Price, 3000;
getinventorylist;
for(set .@i,0; .@i<@inventorylist_count; set .@i,.@i+1) {
	if (@inventorylist_identify[.@i]) continue;
	if (Zeny < .@Price) {
		dispbottom "It costs "+.@Price+" Zeny to identify an item."; break; }
	set Zeny, Zeny-.@Price;
	delitem2 @inventorylist_id[.@i],1,0,0,0,0,0,0,0;
	getitem @inventorylist_id[.@i],1;
	setarray .@Total[0], .@Total[0]+1, .@Total[1]+.@Price; }
if (!.@Total[0]) {
	message strcharinfo(0),"No items identified."; end; }
specialeffect2 154;
message strcharinfo(0),"Identified "+.@Total[0]+" items"+((.@Total[1])?" for "+.@Total[1]+" Zeny":"")+".";
end;

L_Repair:
		if (Zeny < .@Price) {
			dispbottom "It costs "+.@Price+" Zeny to repair your items.";
			close;
			}

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

	}
	if (.@i) message strcharinfo(0),"Repaired "+ .@i + " items for "+.@Price+" Zeny."; // How to make this part show?
	set Zeny, Zeny-.@Price;
	end;
	}

 

4 answers to this question

Recommended Posts

  • 0
Posted (edited)

I hope this helps.


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

 

Edited by Clark
  • Upvote 1
  • 0
Posted
7 hours ago, Clark said:

I hope this helps.



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

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