Jump to content
  • 0

Identifier & Repairman.


Mistique

Question


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  53
  • Reputation:   0
  • Joined:  09/15/12
  • Last Seen:  

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;
	}

 

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  22
  • Reputation:   5
  • Joined:  06/19/18
  • Last Seen:  

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

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.01
  • Content Count:  235
  • Reputation:   63
  • Joined:  04/29/19
  • Last Seen:  

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

  • 0

  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  1167
  • Reputation:   159
  • Joined:  06/12/12
  • Last Seen:  

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

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  53
  • Reputation:   0
  • Joined:  09/15/12
  • Last Seen:  

Thank you guys! Much appreciated! ?

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