Jump to content
  • 0

NPC Script Not Detecting Equipped Item


Dolphin86

Question


  • Group:  Members
  • Topic Count:  255
  • Topics Per Day:  0.06
  • Content Count:  706
  • Reputation:   16
  • Joined:  01/07/12
  • Last Seen:  

As title, the script did not detect the item that is already equipped, 

its on line 170 if(!isequipped(40016))

here is the script:

Spoiler

new_1-3,105,59,6	script	Benimaru	483,{

	if(BeginnerQuest == 0) goto BeginnerQuest0;
	if(BeginnerQuest == 1) goto BeginnerQuest1;
	if(BeginnerQuest == 2) goto BeginnerQuest2;
	if(BeginnerQuest == 3) goto BeginnerQuest3;
	if(BeginnerQuest == 4) goto BeginnerQuest4;

BeginnerQuest0:
			cutin "3rd_sura_master.bmp",2;
			mes "=== ^ff9300 Benimaru ^000000 ===";
			mes "Welcome to Durengo Online";
			mes "my name is ^ff9300 Benimaru ^000000";
			next;
			mes "=== ^ff9300 Benimaru ^000000 ===";
			mes "Ok. let's get to the basic,";
			mes "your on Durengo Online,";
			mes "and this is no place for";
			mes "a new survivor like you";
			next;
			mes "=== ^ff9300 Benimaru ^000000 ===";
			mes "That is why i am here,";
			mes "to help you.";
			next;
			mes "=== ^ff9300 Benimaru ^000000 ===";
			mes "There is still a lot of work to do";
			mes "but lets begin with the basic stuff,";
			mes "now then, are you ready?";
			next;
				switch(select("- Yes! Please help me:- i need a minute")){
				
					case 1:
						mes "=== ^ff9300 Benimaru ^000000 ===";
						mes "Great, now in this world, you will have";
						mes "to gather materials for your tools and";
						mes "craft your own equipment.";
						next;
						mes "=== ^ff9300 Benimaru ^000000 ===";
						mes "Unless you are skilled blacksmith,";
						mes "you may craft a limited number of equipment";
						next;
						mes "=== ^ff9300 Benimaru ^000000 ===";
						mes "Also, monster will not";
						mes "drop any equipment, and npc do not";
						mes "sell any equipment as well..";
						next;
						mes "=== ^ff9300 Benimaru ^000000 ===";
						mes "We shall start with ^c90076 [ Stone Dagger ] ^000000";
						mes "a Stone Dagger is a gathering tools";
						next;
						mes "=== ^ff9300 Benimaru ^000000 ===";
						mes "Which allow you to gather Stalk, Meat";
						mes "and bone, which later can be craft to";
						mes "better gears or tools";
						next;
						mes "=== ^ff9300 Benimaru ^000000 ===";
						mes "Let's craft ^c90076 [ Stone Dagger ] ^000000";
						mes "now if you look around there should be";
						mes "^2986cc A Pile Of Rocks ^000000,";
						next;
						mes "=== ^ff9300 Benimaru ^000000 ===";
						mes "gather ^c90076 [4] Rocks ^000000";
						mes "and come back to me when u have them";
						set BeginnerQuest,1;
						cutin "",255;
						close;
					
					case 2:
						mes "=== ^ff9300 Benimaru ^000000 ===";
						mes "Come back when your ready";
						cutin "",255;
						close;
					}

BeginnerQuest1:
					cutin "3rd_sura_master.bmp",2;			
					if(countitem(40005) < 4 ) {
					mes "=== ^ff9300 Benimaru ^000000 ===";
					mes "I did say i need ^c90076 [4] Rocks ^000000";
					mes "look around there should be";
					mes "a ^2986cc Pile Of Rocks ^000000 nearby";
					next;
					mes "....";
					cutin "",255;
					close;
					} else {
					mes "=== ^ff9300 Benimaru ^000000 ===";
					mes "Good, now if you look around near me";
					mes "there should be a workbench,";
					mes "you can start working on crafting";
					mes "your own Stone Dagger there.";
					set BeginnerQuest,2;
					next;
					mes "....";
					cutin "",255;
					close;
					}
					
BeginnerQuest2:
			cutin "3rd_sura_master.bmp",2;
			if(!isequipped(40001)) {
			mes "=== ^ff9300 Benimaru ^000000 ===";
			mes "If you do have the Stone Dagger";
			mes "equip it.";
			mes "===================";
			mes "if you dont have it, go craft one"; 
			next;
			mes "=== ^ff9300 Benimaru ^000000 ===";
			cutin "",255;
			close;
			}
			mes "=== ^ff9300 Benimaru ^000000 ===";
			mes "Great now you have your first";
			mes "Stone Dagger";
			next;
			mes "=== ^ff9300 Benimaru ^000000 ===";
			mes "Now i will teach you how to craft";
			mes "a [Stone Axe].";
			next;
			mes "=== ^ff9300 Benimaru ^000000 ===";
			mes "With a [Stone Axe] you can gather logs";
			mes "and some other stuff,";
			mes "to make it we need ^c90076 [8] Stalk ^000000";
			mes "[1] rock chunk and a branch";
			next;
			mes "=== ^ff9300 Benimaru ^000000 ===";
			mes "from those [Stalk] you can make [2] ropes";
			mes "you can gather [Stalk] from those Tall Grass"; 
			next;
			mes "=== ^ff9300 Benimaru ^000000 ===";
			mes "To make a [Rock chunk] u gone need";
			mes "[4] Rocks, i assume you know where to find [Rock]?";
			next;
			mes "=== ^ff9300 Benimaru ^000000 ===";
			mes "And last item is a branch, u can get from a tree";
			mes "simple as that.";
			next;
			mes "=== ^ff9300 Benimaru ^000000 ===";
			mes "Remember";
			mes "[8] Stalk = [2] Ropes (workbench)";
			mes "[1] Rock Chunk = [4] Rock (workbench)";
			mes "[1] Branch";
			next;
			mes "=== ^ff9300 Benimaru ^000000 ===";
			mes "Come back to me when you have all of it";
			next;
			mes "....";
			cutin "",255;
			set BeginnerQuest,3;
			close;
				
BeginnerQuest3:
			if(countitem(40018) < 1 || countitem(40014) < 2 || countitem(40003) < 1) {	
			cutin "3rd_sura_master.bmp",2;
			mes".....";
			next;
			mes "=== ^ff9300 Benimaru ^000000 ===";
			mes "Its not enough kid..";
			mes "Remember";
			mes "[8] Stalk = [2] Ropes (workbench)";
			mes "[1] Rock Chunk = [4] Rock (workbench)";
			mes "[1] Branch";
			next;
			mes "....";
			cutin "",255;
			close;
			}else 
			
			if(!isequipped(40016)) { //======= This Line Script not detect even item is equipped
			mes "=== ^ff9300 Benimaru ^000000 ===";
			mes "Great work !";
			next;
			mes "....";
			cutin "",255;
			set BeginnerQuest,4;
			close;
			} else {
			
			mes "=== ^ff9300 Benimaru ^000000 ===";
			mes "If you have the [Stone Axe]";
			mes "equip it.";
			next;
			mes "....";
			cutin "",255;
			close;
			}


			
	OnInit:
    setunitdata (getnpcid(0), UNPC_GROUP_ID, 2);
    setunittitle(getnpcid(0), "Newbies Trainer");
    end;
}

 

Help please...

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • -1

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  232
  • Reputation:   86
  • Joined:  06/30/18
  • Last Seen:  

1 hour ago, Dolphin86 said:

@Winterfox

yeap still dont work, mybe the script reads different i meant it confused on reading my script ?

it keeps reading BeginnerQuest3 part not bypass it and read the other part which is this 

if(isequipped(40016)) { 
new_1-3,105,59,6	script	Benimaru	483,{
	switch(BeginnerQuest) {
		case 0:
			cutin "3rd_sura_master.bmp",2;
			mes "=== ^ff9300 Benimaru ^000000 ===";
			mes "Welcome to Durengo Online";
			mes "my name is ^ff9300 Benimaru ^000000.";
			next;
			mes "=== ^ff9300 Benimaru ^000000 ===";
			mes "Ok. let's get to the basics,";
			mes "of Durengo Online.";
			mes "This is no place for";
			mes "a new survivor like you.";
			next;
			mes "=== ^ff9300 Benimaru ^000000 ===";
			mes "That is why i am here,";
			mes "to help you.";
			next;
			mes "=== ^ff9300 Benimaru ^000000 ===";
			mes "There is still a lot of work to do, ";
			mes "but lets begin with the basic stuff,";
			mes "now then, are you ready?";
			next;
			if(select("- Yes, please help me!:- I need a minute..") == 2) {
				mes "=== ^ff9300 Benimaru ^000000 ===";
				mes "Come back when your ready";
				close3;
			}

			mes "=== ^ff9300 Benimaru ^000000 ===";
			mes "Great, now in this world, you will have";
			mes "to gather materials for your tools and";
			mes "craft your own equipment.";
			next;
			mes "=== ^ff9300 Benimaru ^000000 ===";
			mes "Unless you are skilled blacksmith,";
			mes "you may only craft a limited number of equipments.";
			next;
			mes "=== ^ff9300 Benimaru ^000000 ===";
			mes "Also, monsters will not";
			mes "drop any equipment, and npcs do not";
			mes "sell any equipment as well..";
			next;
			mes "=== ^ff9300 Benimaru ^000000 ===";
			mes "We shall start with ^c90076 [ Stone Dagger ] ^000000.";
			mes "A Stone Dagger is a gathering tool.";
			next;
			mes "=== ^ff9300 Benimaru ^000000 ===";
			mes "It allows you to gather ^c90076 [ Stalk ] ^000000, ^c90076 [ Meat ] ^000000";
			mes "and ^c90076 [ Bone ] ^000000, which later can be used to craft";
			mes "better gear and tools.";
			next;
			mes "=== ^ff9300 Benimaru ^000000 ===";
			mes "Let's craft ^c90076 [ Stone Dagger ] ^000000";
			mes "now. If you look around there should be";
			mes "^2986cc A Pile Of Rocks ^000000.";
			next;
			mes "=== ^ff9300 Benimaru ^000000 ===";
			mes "Gather ^c90076 4 x [ Rocks ] ^000000";
			mes "and come back to me when you have them.";
			BeginnerQuest = 1;
			close3;

		case 1:
			cutin "3rd_sura_master.bmp",2;			
			if(countitem(40005) < 4 ) {
				mes "=== ^ff9300 Benimaru ^000000 ===";
				mes "I did say you need ^c90076 4 x [ Rocks ] ^000000.";
				mes "Look around there should be";
				mes "a ^2986cc Pile Of Rocks ^000000 nearby.";
				close3;
			}
			
			mes "=== ^ff9300 Benimaru ^000000 ===";
			mes "Good, now if you take a look, next";
			mes "to me should be a workbench.";
			mes "You can start working on crafting";
			mes "your own ^c90076 [ Stone Dagger ] ^000000 there.";
			BeginnerQuest = 2;
			close3;
							
		case 2:
			cutin "3rd_sura_master.bmp",2;
			if(!isequipped(40001)) {
				mes "=== ^ff9300 Benimaru ^000000 ===";
				mes "If you do have a ^c90076 [ Stone Dagger ] ^000000";
				mes "equip it.";
				mes "If you don't, go craft one."; 
x				next;
				mes "=== ^ff9300 Benimaru ^000000 ===";
				mes "Remember you need the following to craft one:";
				mes "^c90076 4 x [ Rocks ] ^000000";
				close3;
			}

			mes "=== ^ff9300 Benimaru ^000000 ===";
			mes "Great now you have your first";
			mes "^c90076 [ Stone Dagger ] ^000000.";
			next;
			mes "=== ^ff9300 Benimaru ^000000 ===";
			mes "Now i will teach you how to craft";
			mes "a ^c90076 [ Stone Axe ] ^000000.";
			next;
			mes "=== ^ff9300 Benimaru ^000000 ===";
			mes "With a ^c90076 [ Stone Axe ] ^000000 you can gather logs";
			mes "and some other stuff.";
			mes "To make one we need ^c90076 8 x [ Stalk ] ^000000";
			mes "^c90076 1 x [ Rock Chunk ] ^000000 and a ^c90076 [ Branch ] ^000000";
			next;
			mes "=== ^ff9300 Benimaru ^000000 ===";
			mes "Out of the ^c90076 8 x [ Stalk ] ^000000 you can make ^c90076 2 x [ Ropes ] ^000000.";
			mes "You can gather ^c90076 [ Stalk ] ^000000 from ^2986cc Tall Grass ^000000."; 
			next;
			mes "=== ^ff9300 Benimaru ^000000 ===";
			mes "To make a ^c90076 [ Rock Chunk ]  ^000000 you need";
			mes "^c90076 4 x [ Rocks ] ^000000, i assume you know where to find the ^c90076 [ Rocks ] ^000000?";
			next;
			mes "=== ^ff9300 Benimaru ^000000 ===";
			mes "The last item is a ^c90076 [ Branch ] ^000000, you can get from a ^2986cc Tree ^000000.";
			mes "It is as simple as that.";
			next;
			mes "=== ^ff9300 Benimaru ^000000 ===";
			mes "Remember you need the following to craft a ^c90076 [ Stone Axe ] ^000000:";
			mes "^c90076 8 x [ Stalk ] ^000000 = ^c90076 2 x [ Ropes ] ^000000 (workbench)";
			mes "^c90076 1 x [ Rock Chunk ] ^000000 = ^c90076 4 x [ Rock ] ^000000 (workbench)";
			mes "^c90076 1 x [ Branch] ^000000";
			next;
			mes "=== ^ff9300 Benimaru ^000000 ===";
			mes "Come back to me when you have crafted one.";
			BeginnerQuest = 3;
			close3;

		case 3:
			cutin "3rd_sura_master.bmp",2;
			if(!isequipped(40016)) {
				mes "=== ^ff9300 Benimaru ^000000 ===";
				mes "If you do have the Stone Axe";
				mes "equip it.";
				mes "===================";
				mes "if you dont have it, go craft one"; 
				next;
				mes "=== ^ff9300 Benimaru ^000000 ===";
				mes "Remember you need the following to craft one:";
				mes "^c90076 8 x [ Stalk ] ^000000 = ^c90076 2 x [ Ropes ] ^000000 (workbench)";
				mes "^c90076 1 x [ Rock Chunk ] ^000000 = ^c90076 4 x [ Rock ] ^000000 (workbench)";
				mes "^c90076 1 x [ Branch] ^000000";
				close3;
			}

			mes "=== ^ff9300 Benimaru ^000000 ===";
			mes "Great work !";
			next;
			mes "....";
			BeginnerQuest = 4;
			close3;

		case 4:
			cutin "3rd_sura_master.bmp",2;
			mes "=== ^ff9300 Benimaru ^000000 ===";
			mes "Still needs to be implemented.."
			close3;
	}
	end;

	OnInit:
		setunitdata(getnpcid(0), UNPC_GROUP_ID, 2);
		setunittitle(getnpcid(0), "Newbies Trainer");
}

 

Edited by Winterfox
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  232
  • Reputation:   86
  • Joined:  06/30/18
  • Last Seen:  

if(!isequipped(40016)) { 

Doesn't work because the ! negates the result of isequipped. Which means if something is equipped which results in true the ! turns it into false and vice versa.
So to fix your problem, you just need to remove the !.

if(isequipped(40016)) { 

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  255
  • Topics Per Day:  0.06
  • Content Count:  706
  • Reputation:   16
  • Joined:  01/07/12
  • Last Seen:  

10 hours ago, Winterfox said:
if(!isequipped(40016)) { 

Doesn't work because the ! negates the result of isequipped. Which means if something is equipped which results in true the ! turns it into false and vice versa.
So to fix your problem, you just need to remove the !.

if(isequipped(40016)) { 

 

@Winterfox

yeap still dont work, mybe the script reads different i meant it confused on reading my script ?

it keeps reading BeginnerQuest3 part not bypass it,

 

Edit: i have change how the system read my script, yet still same result..

BeginnerQuest3:
			if(isequipped(40016)) goto GotNotEnough3;
			if(!isequipped(40016)) goto WhereAxe;
			if(countitem(40018) < 1 || countitem(40014) < 2 || countitem(40003) < 1) goto NotEnough3;
			
		NotEnough3:
			cutin "3rd_sura_master.bmp",2;
			mes".....";
			next;
			mes "=== ^ff9300 Benimaru ^000000 ===";
			mes "Its not enough kid..";
			mes "Remember";
			mes "[8] Stalk = [2] Ropes (workbench)";
			mes "[1] Rock Chunk = [4] Rock (workbench)";
			mes "[1] Branch";
			next;
			mes "....";
			cutin "",255;
			close;
			
		GotNotEnough3:	
			mes "=== ^ff9300 Benimaru ^000000 ===";
			mes "Great Work! Now go make your";
			mes "[Stone Axe].";
			set BeginnerQuest,4;
			next;
			mes "....";
			cutin "",255;
			close;
			
		WhereAxe:
			mes "=== ^ff9300 Benimaru ^000000 ===";
			mes "If you have the [Stone Axe]";
			mes "please equip it.";
			next;
			mes "....";
			cutin "",255;
			close;

 

Edited by Dolphin86
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...