Jump to content
  • 0

Help NPC script


Anatong123

Question


  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.01
  • Content Count:  22
  • Reputation:   0
  • Joined:  07/13/18
  • Last Seen:  

I made a NPC who can make omegabox

The box needs 10 of item id 42500 to 42504 and 50000 zeny

There is an error in it i dont know where and i cant talk to the NPC in the game

Pls help me

prontera,164,172,3	script	Edward Cane	86,{
	if (checkweight(1201,1) == 0) {
		mes "- Wait a moment! -";
		mes "- Currently you're carrying -";
		mes "- too many items with you. -";
		mes "- Please come back later -";
		mes "- after you put some items into kafra storage. -";
		close;
	}
	{	
		mes "[Boxmaker Edward Cane]";
		mes "Hello";
		mes "Do you want to make Omega Box";
		mes "There are many valuable things in it";
		next;
		switch(select("OK :Nope")) 
		{
		case 1:
			mes "[Boxmaker Edward Cane]";
			mes "What kind of box do you want to make";
			next;
			switch(select("Omega Box:Cancel")) {
			case 1:

				break;
			case 2:
				mes "[Merchant Marx Hansen]";
				mes "Well then...";
				mes "See you next time.";
				close;
			}
			if (countitem(42500) < 10 ||countitem(42501) < 10 ||countitem(42502) < 10 ||countitem(42503) < 10 ||countitem(42504) < 10 || countitem(42505) < 10 || Zeny < 50000) {
				mes "[Merchant Marx Hansen]";
				mes "Oh no...";
				mes "You don't have all the necessary materials.";
				next;
				mes "[Merchant Marx Hansen]";
				mes "When you have prepared everything, I will blend the fruit to give you delicious juice.";
				close;
			}

			mes "[Boxmaker Edward Cane]";
			mes "How many would you like?";
			next;
			switch(select("As many as possible : Specific amount : Cancel ")) {
			case 1:
				set .@make,countitem(42500);
				if (countitem(42500)//10 < .@make) set .@make, countitem(42500)/10;
				if (countitem(42501)//10 < .@make) set .@make, countitem(42501)/10;
				if (countitem(42502)//10 < .@make) set .@make, countitem(42502)/10;
				if (countitem(42503)//10 < .@make) set .@make, countitem(42503)/10;
				if (countitem(42504)//10 < .@make) set .@make, countitem(42504)/10;		
				if (countitem(42505)//10 < .@make) set .@make, countitem(42505)/10;
				if (Zeny//50000 < .@make) set .@make, Zeny/25000;
				break;
			case 2:
				mes "[Merchant Marx Hansen]";
				mes "Choose a number less than 100. If you don't want to, put '0'";
				next;
				while(1) {
					input .@input;
					if (.@input == 0) {
						mes "[Merchant Marx Hansen]";
						mes "Well then...";
						mes "Come again.";
						close;
					}
					else if (.@input > 100) {
						mes "[Merchant Marx Hansen]";
						mes "More than 100 bottles is impossible. Choose a different amount.";
						next;
					}
					else {
						break;
					}
				}
				set .@make,.@input;
				break;
			case 3:
				mes "[Boxmaker Edward Cane]";
				mes "Well then...";
				mes "Come again.";
				close;
			}

			set .@total_zeny,50000 * .@make;

			if (countitem(42500)//10 < .@make|| countitem(42501)//10 < .@make ||countitem(42502)//10 < .@make ||countitem(42503)//10 < .@make ||countitem(42504)//10 < .@make ||countitem(42505)//10 < .@make|| Zeny < .@total_zeny) {
				mes "[Merchant Marx Hansen]";
				mes "Oh no...";
				mes "You don't have all the necessary materials. I can't help a situation like this. I guess you collect what you need.";
				close;
			}
			delitem 42500,.@make*10;
			delitem 42501,.@make*10;
			delitem 42502,.@make*10;
			delitem 42503,.@make*10;			
			delitem 42504,.@make*10;
			delitem 42505,.@make*10;
			set Zeny, Zeny-.@total_zeny;
			getitem 60005,.@make;

			mes "[Boxmaker Edward Cane]";
			mes "Here";
			next;
			mes "[Boxmaker Edward Cane]";
			mes "See Ya later";
			close;
		
		case 2:
			mes "[Boxmaker Edward Cane]";
			mes "Hey!";
			mes "If you visit";
			mes "somebody, talk to them!";
			close;
		}
	}
	
}

 

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  143
  • Reputation:   30
  • Joined:  12/23/11
  • Last Seen:  

Why are you use // in

countitem(42500)//10

etc

Quote

Whenever '//' is encountered in a line upon reading, everything beyond this on
that line is considered to be a comment and is ignored. This works wherever you
place it.

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.01
  • Content Count:  22
  • Reputation:   0
  • Joined:  07/13/18
  • Last Seen:  

Ok i tried not using //  still doesn't work

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  143
  • Reputation:   30
  • Joined:  12/23/11
  • Last Seen:  

There are error messages at map_server?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.01
  • Content Count:  22
  • Reputation:   0
  • Joined:  07/13/18
  • Last Seen:  

I dont see any error message or do i need to recompile?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  143
  • Reputation:   30
  • Joined:  12/23/11
  • Last Seen:  

Restart server or @reloadnpcfile <file name>

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.01
  • Content Count:  22
  • Reputation:   0
  • Joined:  07/13/18
  • Last Seen:  

Here, this is the biggest window i can do sry

error boxmaker.png

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  143
  • Reputation:   30
  • Joined:  12/23/11
  • Last Seen:  

There is still '//' instead of '/' in division operation

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