Quest NPC with Item check.

karazu

New member
Messages
1,115
Points
0
How to make a quest NPC that will only Talk to you if u have this certain ITEM.


For Example:

If you dont have TCG

He will only say Welcome.


but if u have

HE will tell you about the quest.



 

 
you can do something like :

Code:
if ( countitem(7227) > 0 ) // if he have TCG{NPC Code here.}else{mes "Hi";}
 
try this
default_biggrin.png
 Quest Generator

and I generate a sample script

Code:
/ / =============================================/ / == Cronus Tools :: Generator's Quest =======/ / == Version: ==================================/ / == 1.0/ / == Author: ===================================/ / == RoM/ / =============================================prontera, 153,160,4 script Quester 4_M_KHKYEL, {	mes "[Quester]";	mes "Hello" + strcharinfo (0) + "";	mes "I have some interesting items here, want to take a look?";	next;	if (select ("Sure: Maybe later ...") == 2)	{		mes "[Quester]";		mes "Alright, I'll be here if you change your mind.";		close;	}	mes "[Quester]";	mes "Well, these are the items that I have ...";	mes "About which of them will want to know more?";	next;	switch (select ("Weapon: None"))	{	case 1:		mes "[Weapon]";		mes "reward";		mes "1x" + getitemname (1201);		mes "";		mes "Required item";		mes "1x" + getitemname (512);		mes "1x" + getitemname (582);		mes "1x" + getitemname (514);		next;		mes "[Quester]";		mes "Would you do this quest?";		next;		if (select ("Yes: Not now ...") == 2)		{			mes "[Quester]";			mes "Okay ... So long!";			close;		}		if (countitem (512)> = 1 && countitem (582)> = 1 && countitem (514)> = 1)		{			delitem 512.1;			delitem 582.1;			delitem 514.1;			getitem 1201,1;			mes "[Quester]";			mes "Here's Congratulations!";			close;		}		break;	case 2:		mes "[Quester]";		mes "Alright, I'll be here if you change your mind.";		close;	}	mes "[Quester]";	mes "I'm sorry, but you do not have all items needed for this quest.";	mes "Come back when you have all the items";	close;}
 
Last edited by a moderator:
Code:
prontera,150,150,0	script	Sample	123,{	// requirements	setarray .id[0],2729,2375;	.size = getarraysize(.id);	.prize = 7227;		mes "Hi, you have requirements?";	next;	if (select("Yes:No")-1) close;	for ( .@i = 0; .@i < .size; .@i++ ) {		if (!countitem(.id[.@i])) {			mes "I need the following : ";			for ( .@i = 0; .@i < .size; .@i++ )				mes "1x " +getitemname(.id[.@i]);			close;		}	}	for ( .@i = 0; .@i < .size; .@i++ )		delitem .id[.@i], 1;	getitem .prize, 1;	mes "Nice!";	close;}
 
prontera,150,150,0 script Sample 123,{ // requirements setarray .id[0],2729,2375; .size = getarraysize(.id); .prize = 7227; mes "Hi, you have requirements?"; next; if (select("Yes:No")-1) close; for ( .@i = 0; .@i < .size; .@i++ ) { if (!countitem(.id[.@i])) { mes "I need the following : "; for ( .@i = 0; .@i < .size; .@i++ ) mes "1x " +getitemname(.id[.@i]); close; } } for ( .@i = 0; .@i < .size; .@i++ ) delitem .id[.@i], 1; getitem .prize, 1; mes "Nice!"; close;}
Where can i PUT how many items is needed?

can you add this up please?

How to make a quest NPC that will only Talk to you if u have this certain ITEM.
For Example:

If you dont have TCG

He will only say Good day
 
Code:
if (!countitem(7227))		mes "Good day!";else	mes "You have " +countitem(7227)+ " " +getitemname(7227);
 
Back
Top