• 0
Sign in to follow this  
IsabelaFernandez

help with NPC, multiple options dialog

Question

Hello everyone, I would like to add options to this script. Currently it is only used to craft a single item, I would like to add others.
prontera,155,181,5	script	Sample	757,{
for( [email protected] = 0; [email protected] < .item_id_size; [email protected]++ ){
	mes .item_amount[[email protected]]+" x "+getitemname( .item_id[[email protected]] );
	if( countitem( .item_id[[email protected]] ) < .item_amount[[email protected]] ) [email protected] = 1;
}
if( [email protected] ){
	mes "Please wait...";
	progressbar "FFFFFF",10;
	for( [email protected] = 0; [email protected] < .item_id_size; [email protected]++ )
		delitem .item_id[[email protected]],.item_amount[[email protected]];
	if( rand( 100 ) < .craft_rate ){
		mes "Gained 1 items.";
		getnameditem( .craft_gain,strcharinfo(0) );
	}else{
		mes "Failed";
	}
}
close;

OnInit:
// craft settings
.craft_rate = 50;
setarray .item_id,607,608;
setarray .item_amount,1,2;
.item_id_size = getarraysize( .item_id );

// item gain
.craft_gain = 5518;
end;
}
In this part I would like to add the option to choose between ID 5518 (current) and below the item ID 5374 as the desired item to create.

Share this post


Link to post
Share on other sites

12 answers to this question

Recommended Posts

  • 0
Quote

switch(select("Option Item 1:Option Item 2:Option Item 3")){

Case 1:
mes "Process item 1";
close;
    
Case 2:
mes "Process item 2";
close;

Case 3:
mes "Process item 3";
close;

}

 

 

  • Upvote 1

Share this post


Link to post
Share on other sites
  • 0
6 hours ago, Disabled LOOLP said:

 

 

opened some options, but how do I associate the option with the desired ID? Example: Option 1 = ID 5518 option 2 = ID 5374 thanks for helping

Share this post


Link to post
Share on other sites
  • 0
On 11/8/2019 at 2:44 AM, IsabelaFernandez said:
Hello everyone, I would like to add options to this script. Currently it is only used to craft a single item, I would like to add others.
prontera,155,181,5	script	Sample	757,{
for( [email protected] = 0; [email protected] < .item_id_size; [email protected]++ ){
	mes .item_amount[[email protected]]+" x "+getitemname( .item_id[[email protected]] );
	if( countitem( .item_id[[email protected]] ) < .item_amount[[email protected]] ) [email protected] = 1;
}
if( [email protected] ){
	mes "Please wait...";
	progressbar "FFFFFF",10;
	for( [email protected] = 0; [email protected] < .item_id_size; [email protected]++ )
		delitem .item_id[[email protected]],.item_amount[[email protected]];
	if( rand( 100 ) < .craft_rate ){
		mes "Gained 1 items.";
		getnameditem( .craft_gain,strcharinfo(0) );
	}else{
		mes "Failed";
	}
}
close;

OnInit:
// craft settings
.craft_rate = 50;
setarray .item_id,607,608;
setarray .item_amount,1,2;
.item_id_size = getarraysize( .item_id );

// item gain
.craft_gain = 5518;
end;
}
In this part I would like to add the option to choose between ID 5518 (current) and below the item ID 5374 as the desired item to create.

Just use Euphy quest script, and add a chance to fail.

  • Upvote 1

Share this post


Link to post
Share on other sites
  • 0
2 hours ago, Disabled LOOLP said:

@IsabelaFernandez  

When I help, I only feel motivated to help again, when I get a reputat in the form of thanks.

 

I always appreciate the knowledge sharing, but thanks anyway! 😁

11 minutes ago, OppaiDragon said:

Just use Euphy quest script, and add a chance to fail.

 

I will research and give feedback on your suggestion, thanks

Edited by IsabelaFernandez

Share this post


Link to post
Share on other sites
  • 0

@IsabelaFernandez You can use this, I think it has what you need.

prontera,150,150,4	script	Quest NPC	1_M_MERCHANT,{
	mes "[Quest NPC]";
	mes "I have an awesome item list here, you want to take a simple quest?.";
next;
	menu "Nope i dont want!",-, "Yes show me the list.",M_DO;
	mes "[Quest NPC]";
	mes "Ok bye..";
emotion ET_HAH;
close;

M_DO:			
	mes "[Quest NPC]";
	mes "You can select one from the following...";
next;
menu "ITEM1",A_ITEM1,"ITEM2",A_ITEM2,"ITEM3",A_ITEM3,"ITEM4",A_ITEM4,"ITEM5",A_ITEM5,"ITEM6",A_ITEM6;

A_ITEM1:
	mes "[Quest NPC]";
	mes "You want this gear?";
	mes "You need this items before you have mine.";
	mes "Poring Coins [300 ea]";
	mes "Mithril Coins [500 ea]";
	mes "Ghostring Card [1 ea]";
next;
if(select("Get It:Cancel")==2) goto M_END;
if(countitem(7539) < 300 || countitem(674) < 500 || countitem(4047) < 1) {
mes "[Quest NPC]";
mes "Not enough coins";
close;
} else {
mes "[Quest NPC]";
mes "Here you go!";
	delitem 7539,300;
	delitem 674,500;
	delitem 4047,1;
	progressbar "FFFFFF",3;
	getitem 999,1; // Item ID Number
close;
}

A_ITEM2:
	mes "[Quest NPC]";
	mes "You want this gear?";
	mes "You need this items before you have mine.";
	mes "Poring Coins [300 ea]";
	mes "Mithril Coins [500 ea]";
	mes "Ghostring Card [1 ea]";
next;
if(select("Get It:Cancel")==2) goto M_END;
if(countitem(7539) < 300 || countitem(674) < 500 || countitem(4047) < 1) {
	mes "[Quest NPC]";
	mes "Not enough coins";
close;
} else {
mes "[Quest NPC]";
mes "Here you go!";
	delitem 7539,300;
	delitem 674,500;
	delitem 4047,1;
	progressbar "FFFFFF",3;
	getitem 999,1; // Item ID Number
close;
}

A_ITEM3:
	mes "[Quest NPC]";
	mes "You want this gear?";
	mes "You need this items before you have mine.";
	mes "Poring Coins [300 ea]";
	mes "Mithril Coins [500 ea]";
	mes "Ghostring Card [1 ea]";
next;
if(select("Get It:Cancel")==2) goto M_END;
if(countitem(7539) < 300 || countitem(674) < 500 || countitem(4047) < 1) {
	mes "[Quest NPC]";
	mes "Not enough coins";
close;
} else {
mes "[Quest NPC]";
mes "Here you go!";
	delitem 7539,300;
	delitem 674,500;
	delitem 4047,1;
	progressbar "FFFFFF",3;
	getitem 999,1; // Item ID Number
close;
}

A_ITEM4:
	mes "[Quest NPC]";
	mes "You want this gear?";
	mes "You need this items before you have mine.";
	mes "Poring Coins [300 ea]";
	mes "Mithril Coins [500 ea]";
	mes "Ghostring Card [1 ea]";
	next;
if(select("Get It:Cancel")==2) goto M_END;
if(countitem(7539) < 300 || countitem(674) < 500 || countitem(4047) < 1) {
	mes "[Quest NPC]";
	mes "Not enough coins";
close;
} else {
	mes "[Quest NPC]";
	mes "Here you go!";
	delitem 7539,300;
	delitem 674,500;
	delitem 4047,1;
	progressbar "FFFFFF",3;
	getitem 999,1; // Item ID Number
close;
}

A_ITEM5:
	mes "[Quest NPC]";
	mes "You want this gear?";
	mes "You need this items before you have mine.";
	mes "Poring Coins [300 ea]";
	mes "Mithril Coins [500 ea]";
	mes "Ghostring Card [1 ea]";
next;
if(select("Get It:Cancel")==2) goto M_END;
if(countitem(7539) < 300 || countitem(674) < 500 || countitem(4047) < 1) {
	mes "[Quest NPC]";
	mes "Not enough coins";
close;
} else {
	mes "[Quest NPC]";
	mes "Here you go!";
	delitem 7539,300;
	delitem 674,500;
	delitem 4047,1;
	progressbar "FFFFFF",3;
	getitem 999,1; // Item ID Number
close;
}

A_ITEM6:
	mes "[Quest NPC]";
	mes "You want this gear?";
	mes "You need this items before you have mine.";
	mes "Poring Coins [300 ea]";
	mes "Mithril Coins [500 ea]";
	mes "Ghostring Card [1 ea]";
next;
if(select("Get It:Cancel")==2) goto M_END;
if(countitem(7539) < 300 || countitem(674) < 500 || countitem(4047) < 1) {
	mes "[Quest NPC]";
	mes "Not enough coins";
close;
} else {
mes "[Quest NPC]";
mes "Here you go!";
	delitem 7539,300;
	delitem 674,500;
	delitem 4047,1;
	progressbar "FFFFFF",3;
	getitem 999,1; // Item ID Number
close;
}

M_END:
	mes "[Quest NPC]";
	mes "See you...";
	emotion ET_SLEEPY;
close;

}

 

Edited by Gdevien
better a code box
  • Like 2

Share this post


Link to post
Share on other sites
  • 0
2 hours ago, Gdevien said:

@IsabelaFernandez You can use this, I think it has what you need.

sample.cs 3.88 kB · 2 downloads

 

thanks for your time and the script you created (well done by the way), this NPC is a good base of what i was needing but i wanted to implement the craft system (.craft_rate = x;), is it possible to make this junction in this script?

Share this post


Link to post
Share on other sites
  • 0
7 hours ago, IsabelaFernandez said:

 

thanks for your time and the script you created (well done by the way), this NPC is a good base of what i was needing but i wanted to implement the craft system (.craft_rate = x;), is it possible to make this junction in this script?

prontera,150,150,4	script	Quest NPC	1_M_MERCHANT,{
	mes "[Quest NPC]";
	mes "I have an awesome item list here, you want to take a simple quest?.";
next;
	menu "Nope i dont want!",-, "Yes show me the list.",M_DO;
	mes "[Quest NPC]";
	mes "Ok bye..";
emotion ET_HAH;
close;

M_DO:			
	mes "[Quest NPC]";
	mes "You can select one from the following...";
next;
menu "ITEM1",A_ITEM1,"ITEM2",A_ITEM2,"ITEM3",A_ITEM3,"ITEM4",A_ITEM4,"ITEM5",A_ITEM5,"ITEM6",A_ITEM6;

// --------------------------------------------------------
A_ITEM1:
	mes "[Quest NPC]";
	mes "You want this gear?";
	mes "You need this items before you have mine.";
	mes "Poring Coins [300 ea]";
	mes "Mithril Coins [500 ea]";
	mes "Ghostring Card [1 ea]";
next;
if(select("Get It:Cancel")==2) goto M_END;
if(countitem(7539) < 300 || countitem(674) < 500 || countitem(4047) < 1) {
mes "[Quest NPC]";
mes "Not enough coins";
close;
} else {
mes "[Quest NPC]";
	delitem 7539,300;
	delitem 674,500;
	delitem 4047,1;
	progressbar "FFFFFF",2;
	if ( rand(100) < 50 ) { // 50% chance to get the item
	specialeffect2 610;
	mes "Success !";
	getitem 999,1; // Item ID Number
	close;
} else {
	specialeffect2 611;
	mes "Failed";
	close;
}
// --------------------------------------------------------
A_ITEM2:
	mes "[Quest NPC]";
	mes "You want this gear?";
	mes "You need this items before you have mine.";
	mes "Poring Coins [300 ea]";
	mes "Mithril Coins [500 ea]";
	mes "Ghostring Card [1 ea]";
next;
if(select("Get It:Cancel")==2) goto M_END;
if(countitem(7539) < 300 || countitem(674) < 500 || countitem(4047) < 1) {
	mes "[Quest NPC]";
	mes "Not enough coins";
close;
} else {
mes "[Quest NPC]";
	delitem 7539,300;
	delitem 674,500;
	delitem 4047,1;
	progressbar "FFFFFF",2;
	if ( rand(100) < 50 ) { // 50% chance to get the item
	specialeffect2 610;
	mes "Success !";
	getitem 999,1; // Item ID Number
	close;
} else {
	specialeffect2 611;
	mes "Failed";
	close;
}
// --------------------------------------------------------
A_ITEM3:
	mes "[Quest NPC]";
	mes "You want this gear?";
	mes "You need this items before you have mine.";
	mes "Poring Coins [300 ea]";
	mes "Mithril Coins [500 ea]";
	mes "Ghostring Card [1 ea]";
next;
if(select("Get It:Cancel")==2) goto M_END;
if(countitem(7539) < 300 || countitem(674) < 500 || countitem(4047) < 1) {
	mes "[Quest NPC]";
	mes "Not enough coins";
close;
} else {
mes "[Quest NPC]";
	delitem 7539,300;
	delitem 674,500;
	delitem 4047,1;
	progressbar "FFFFFF",2;
	if ( rand(100) < 50 ) { // 50% chance to get the item
	specialeffect2 610;
	mes "Success !";
	getitem 999,1; // Item ID Number
	close;
} else {
	specialeffect2 611;
	mes "Failed";
	close;
}
// --------------------------------------------------------
A_ITEM4:
	mes "[Quest NPC]";
	mes "You want this gear?";
	mes "You need this items before you have mine.";
	mes "Poring Coins [300 ea]";
	mes "Mithril Coins [500 ea]";
	mes "Ghostring Card [1 ea]";
	next;
if(select("Get It:Cancel")==2) goto M_END;
if(countitem(7539) < 300 || countitem(674) < 500 || countitem(4047) < 1) {
	mes "[Quest NPC]";
	mes "Not enough coins";
close;
} else {
mes "[Quest NPC]";
	delitem 7539,300;
	delitem 674,500;
	delitem 4047,1;
	progressbar "FFFFFF",2;
	if ( rand(100) < 50 ) { // 50% chance to get the item
	specialeffect2 610;
	mes "Success !";
	getitem 999,1; // Item ID Number
	close;
} else {
	specialeffect2 611;
	mes "Failed";
	close;
}
// --------------------------------------------------------
A_ITEM5:
	mes "[Quest NPC]";
	mes "You want this gear?";
	mes "You need this items before you have mine.";
	mes "Poring Coins [300 ea]";
	mes "Mithril Coins [500 ea]";
	mes "Ghostring Card [1 ea]";
next;
if(select("Get It:Cancel")==2) goto M_END;
if(countitem(7539) < 300 || countitem(674) < 500 || countitem(4047) < 1) {
	mes "[Quest NPC]";
	mes "Not enough coins";
close;
} else {
mes "[Quest NPC]";
	delitem 7539,300;
	delitem 674,500;
	delitem 4047,1;
	progressbar "FFFFFF",2;
	if ( rand(100) < 50 ) { // 50% chance to get the item
	specialeffect2 610;
	mes "Success !";
	getitem 999,1; // Item ID Number
	close;
} else {
	specialeffect2 611;
	mes "Failed";
	close;
}
// --------------------------------------------------------
A_ITEM6:
	mes "[Quest NPC]";
	mes "You want this gear?";
	mes "You need this items before you have mine.";
	mes "Poring Coins [300 ea]";
	mes "Mithril Coins [500 ea]";
	mes "Ghostring Card [1 ea]";
next;
if(select("Get It:Cancel")==2) goto M_END;
if(countitem(7539) < 300 || countitem(674) < 500 || countitem(4047) < 1) {
	mes "[Quest NPC]";
	mes "Not enough coins";
close;
} else {
mes "[Quest NPC]";
	delitem 7539,300;
	delitem 674,500;
	delitem 4047,1;
	progressbar "FFFFFF",2;
	if ( rand(100) < 50 ) { // 50% chance to get the item
	specialeffect2 610;
	mes "Success !";
	getitem 999,1; // Item ID Number
	close;
} else {
	specialeffect2 611;
	mes "Failed";
	close;
}

M_END:
	mes "[Quest NPC]";
	mes "See you...";
	emotion ET_SLEEPY;
close;
}
}
}
}
}
}
}

 

  • Love 1
  • MVP 1

Share this post


Link to post
Share on other sites
  • 0
20 hours ago, Gdevien said:

@IsabelaFernandez You can use this, I think it has what you need.

prontera,150,150,4	script	Quest NPC	1_M_MERCHANT,{
	mes "[Quest NPC]";
	mes "I have an awesome item list here, you want to take a simple quest?.";
next;
	menu "Nope i dont want!",-, "Yes show me the list.",M_DO;
	mes "[Quest NPC]";
	mes "Ok bye..";
emotion ET_HAH;
close;

M_DO:			
	mes "[Quest NPC]";
	mes "You can select one from the following...";
next;
menu "ITEM1",A_ITEM1,"ITEM2",A_ITEM2,"ITEM3",A_ITEM3,"ITEM4",A_ITEM4,"ITEM5",A_ITEM5,"ITEM6",A_ITEM6;

A_ITEM1:
	mes "[Quest NPC]";
	mes "You want this gear?";
	mes "You need this items before you have mine.";
	mes "Poring Coins [300 ea]";
	mes "Mithril Coins [500 ea]";
	mes "Ghostring Card [1 ea]";
next;
if(select("Get It:Cancel")==2) goto M_END;
if(countitem(7539) < 300 || countitem(674) < 500 || countitem(4047) < 1) {
mes "[Quest NPC]";
mes "Not enough coins";
close;
} else {
mes "[Quest NPC]";
mes "Here you go!";
	delitem 7539,300;
	delitem 674,500;
	delitem 4047,1;
	progressbar "FFFFFF",3;
	getitem 999,1; // Item ID Number
close;
}

A_ITEM2:
	mes "[Quest NPC]";
	mes "You want this gear?";
	mes "You need this items before you have mine.";
	mes "Poring Coins [300 ea]";
	mes "Mithril Coins [500 ea]";
	mes "Ghostring Card [1 ea]";
next;
if(select("Get It:Cancel")==2) goto M_END;
if(countitem(7539) < 300 || countitem(674) < 500 || countitem(4047) < 1) {
	mes "[Quest NPC]";
	mes "Not enough coins";
close;
} else {
mes "[Quest NPC]";
mes "Here you go!";
	delitem 7539,300;
	delitem 674,500;
	delitem 4047,1;
	progressbar "FFFFFF",3;
	getitem 999,1; // Item ID Number
close;
}

A_ITEM3:
	mes "[Quest NPC]";
	mes "You want this gear?";
	mes "You need this items before you have mine.";
	mes "Poring Coins [300 ea]";
	mes "Mithril Coins [500 ea]";
	mes "Ghostring Card [1 ea]";
next;
if(select("Get It:Cancel")==2) goto M_END;
if(countitem(7539) < 300 || countitem(674) < 500 || countitem(4047) < 1) {
	mes "[Quest NPC]";
	mes "Not enough coins";
close;
} else {
mes "[Quest NPC]";
mes "Here you go!";
	delitem 7539,300;
	delitem 674,500;
	delitem 4047,1;
	progressbar "FFFFFF",3;
	getitem 999,1; // Item ID Number
close;
}

A_ITEM4:
	mes "[Quest NPC]";
	mes "You want this gear?";
	mes "You need this items before you have mine.";
	mes "Poring Coins [300 ea]";
	mes "Mithril Coins [500 ea]";
	mes "Ghostring Card [1 ea]";
	next;
if(select("Get It:Cancel")==2) goto M_END;
if(countitem(7539) < 300 || countitem(674) < 500 || countitem(4047) < 1) {
	mes "[Quest NPC]";
	mes "Not enough coins";
close;
} else {
	mes "[Quest NPC]";
	mes "Here you go!";
	delitem 7539,300;
	delitem 674,500;
	delitem 4047,1;
	progressbar "FFFFFF",3;
	getitem 999,1; // Item ID Number
close;
}

A_ITEM5:
	mes "[Quest NPC]";
	mes "You want this gear?";
	mes "You need this items before you have mine.";
	mes "Poring Coins [300 ea]";
	mes "Mithril Coins [500 ea]";
	mes "Ghostring Card [1 ea]";
next;
if(select("Get It:Cancel")==2) goto M_END;
if(countitem(7539) < 300 || countitem(674) < 500 || countitem(4047) < 1) {
	mes "[Quest NPC]";
	mes "Not enough coins";
close;
} else {
	mes "[Quest NPC]";
	mes "Here you go!";
	delitem 7539,300;
	delitem 674,500;
	delitem 4047,1;
	progressbar "FFFFFF",3;
	getitem 999,1; // Item ID Number
close;
}

A_ITEM6:
	mes "[Quest NPC]";
	mes "You want this gear?";
	mes "You need this items before you have mine.";
	mes "Poring Coins [300 ea]";
	mes "Mithril Coins [500 ea]";
	mes "Ghostring Card [1 ea]";
next;
if(select("Get It:Cancel")==2) goto M_END;
if(countitem(7539) < 300 || countitem(674) < 500 || countitem(4047) < 1) {
	mes "[Quest NPC]";
	mes "Not enough coins";
close;
} else {
mes "[Quest NPC]";
mes "Here you go!";
	delitem 7539,300;
	delitem 674,500;
	delitem 4047,1;
	progressbar "FFFFFF",3;
	getitem 999,1; // Item ID Number
close;
}

M_END:
	mes "[Quest NPC]";
	mes "See you...";
	emotion ET_SLEEPY;
close;

}

 

Is working, but it has a 100% chance of success, I would like to put a success rate like 40% ~ 50% success to create or fail

Thank you my friend!

Share this post


Link to post
Share on other sites
  • 0
1 minute ago, IsabelaFernandez said:
Is working, but it has a 100% chance of success, I would like to put a success rate like 40% ~ 50% success to create or fail

Thank you my friend!

I do not know what you're talking about 🙃 i think you're not following the modified script.

if you want to choose a rate% just modify this:

if ( rand(100) < 50 ) { // 50% chance to get the item

 

  • Upvote 2

Share this post


Link to post
Share on other sites
  • 0

@IsabelaFernandez

 

Euphy's original quest shop. I modified it for you and added success rates. 

quest_shop_modified.txt

I added SuccessRate option if you want to disable or enable the system easily.

// -----------------------------------------------------------
//  Basic shop settings.
// -----------------------------------------------------------

	set .Announce,1;	// Announce quest completion? (1: yes / 0: no)
	set .ShowSlot,1;	// Show item slots? (2: all equipment / 1: if slots > 0 / 0: never)
	set .ShowID,0;  	// Show item IDs? (1: yes / 0: no)
	set .ShowZeny,0;	// Show Zeny cost, if any? (1: yes / 0: no)
	set .MaxStack,100;	// Max number of quest items purchased at one time.
	set .SuccessRate,1;	// Enable Success Rates? ( 1: yes / 0: no)

Edit :

Fixed not reading the success rate

Edited by Mabuhay
  • Love 1

Share this post


Link to post
Share on other sites
  • 0
17 hours ago, Gdevien said:
prontera,150,150,4	script	Quest NPC	1_M_MERCHANT,{
	mes "[Quest NPC]";
	mes "I have an awesome item list here, you want to take a simple quest?.";
next;
	menu "Nope i dont want!",-, "Yes show me the list.",M_DO;
	mes "[Quest NPC]";
	mes "Ok bye..";
emotion ET_HAH;
close;

M_DO:			
	mes "[Quest NPC]";
	mes "You can select one from the following...";
next;
menu "ITEM1",A_ITEM1,"ITEM2",A_ITEM2,"ITEM3",A_ITEM3,"ITEM4",A_ITEM4,"ITEM5",A_ITEM5,"ITEM6",A_ITEM6;

// --------------------------------------------------------
A_ITEM1:
	mes "[Quest NPC]";
	mes "You want this gear?";
	mes "You need this items before you have mine.";
	mes "Poring Coins [300 ea]";
	mes "Mithril Coins [500 ea]";
	mes "Ghostring Card [1 ea]";
next;
if(select("Get It:Cancel")==2) goto M_END;
if(countitem(7539) < 300 || countitem(674) < 500 || countitem(4047) < 1) {
mes "[Quest NPC]";
mes "Not enough coins";
close;
} else {
mes "[Quest NPC]";
	delitem 7539,300;
	delitem 674,500;
	delitem 4047,1;
	progressbar "FFFFFF",2;
	if ( rand(100) < 50 ) { // 50% chance to get the item
	specialeffect2 610;
	mes "Success !";
	getitem 999,1; // Item ID Number
	close;
} else {
	specialeffect2 611;
	mes "Failed";
	close;
}
// --------------------------------------------------------
A_ITEM2:
	mes "[Quest NPC]";
	mes "You want this gear?";
	mes "You need this items before you have mine.";
	mes "Poring Coins [300 ea]";
	mes "Mithril Coins [500 ea]";
	mes "Ghostring Card [1 ea]";
next;
if(select("Get It:Cancel")==2) goto M_END;
if(countitem(7539) < 300 || countitem(674) < 500 || countitem(4047) < 1) {
	mes "[Quest NPC]";
	mes "Not enough coins";
close;
} else {
mes "[Quest NPC]";
	delitem 7539,300;
	delitem 674,500;
	delitem 4047,1;
	progressbar "FFFFFF",2;
	if ( rand(100) < 50 ) { // 50% chance to get the item
	specialeffect2 610;
	mes "Success !";
	getitem 999,1; // Item ID Number
	close;
} else {
	specialeffect2 611;
	mes "Failed";
	close;
}
// --------------------------------------------------------
A_ITEM3:
	mes "[Quest NPC]";
	mes "You want this gear?";
	mes "You need this items before you have mine.";
	mes "Poring Coins [300 ea]";
	mes "Mithril Coins [500 ea]";
	mes "Ghostring Card [1 ea]";
next;
if(select("Get It:Cancel")==2) goto M_END;
if(countitem(7539) < 300 || countitem(674) < 500 || countitem(4047) < 1) {
	mes "[Quest NPC]";
	mes "Not enough coins";
close;
} else {
mes "[Quest NPC]";
	delitem 7539,300;
	delitem 674,500;
	delitem 4047,1;
	progressbar "FFFFFF",2;
	if ( rand(100) < 50 ) { // 50% chance to get the item
	specialeffect2 610;
	mes "Success !";
	getitem 999,1; // Item ID Number
	close;
} else {
	specialeffect2 611;
	mes "Failed";
	close;
}
// --------------------------------------------------------
A_ITEM4:
	mes "[Quest NPC]";
	mes "You want this gear?";
	mes "You need this items before you have mine.";
	mes "Poring Coins [300 ea]";
	mes "Mithril Coins [500 ea]";
	mes "Ghostring Card [1 ea]";
	next;
if(select("Get It:Cancel")==2) goto M_END;
if(countitem(7539) < 300 || countitem(674) < 500 || countitem(4047) < 1) {
	mes "[Quest NPC]";
	mes "Not enough coins";
close;
} else {
mes "[Quest NPC]";
	delitem 7539,300;
	delitem 674,500;
	delitem 4047,1;
	progressbar "FFFFFF",2;
	if ( rand(100) < 50 ) { // 50% chance to get the item
	specialeffect2 610;
	mes "Success !";
	getitem 999,1; // Item ID Number
	close;
} else {
	specialeffect2 611;
	mes "Failed";
	close;
}
// --------------------------------------------------------
A_ITEM5:
	mes "[Quest NPC]";
	mes "You want this gear?";
	mes "You need this items before you have mine.";
	mes "Poring Coins [300 ea]";
	mes "Mithril Coins [500 ea]";
	mes "Ghostring Card [1 ea]";
next;
if(select("Get It:Cancel")==2) goto M_END;
if(countitem(7539) < 300 || countitem(674) < 500 || countitem(4047) < 1) {
	mes "[Quest NPC]";
	mes "Not enough coins";
close;
} else {
mes "[Quest NPC]";
	delitem 7539,300;
	delitem 674,500;
	delitem 4047,1;
	progressbar "FFFFFF",2;
	if ( rand(100) < 50 ) { // 50% chance to get the item
	specialeffect2 610;
	mes "Success !";
	getitem 999,1; // Item ID Number
	close;
} else {
	specialeffect2 611;
	mes "Failed";
	close;
}
// --------------------------------------------------------
A_ITEM6:
	mes "[Quest NPC]";
	mes "You want this gear?";
	mes "You need this items before you have mine.";
	mes "Poring Coins [300 ea]";
	mes "Mithril Coins [500 ea]";
	mes "Ghostring Card [1 ea]";
next;
if(select("Get It:Cancel")==2) goto M_END;
if(countitem(7539) < 300 || countitem(674) < 500 || countitem(4047) < 1) {
	mes "[Quest NPC]";
	mes "Not enough coins";
close;
} else {
mes "[Quest NPC]";
	delitem 7539,300;
	delitem 674,500;
	delitem 4047,1;
	progressbar "FFFFFF",2;
	if ( rand(100) < 50 ) { // 50% chance to get the item
	specialeffect2 610;
	mes "Success !";
	getitem 999,1; // Item ID Number
	close;
} else {
	specialeffect2 611;
	mes "Failed";
	close;
}

M_END:
	mes "[Quest NPC]";
	mes "See you...";
	emotion ET_SLEEPY;
close;
}
}
}
}
}
}
}

 

 

6 hours ago, Mabuhay said:

@IsabelaFernandez

 

Euphy's original quest shop. I modified it for you and added success rates. 

quest_shop_modified.txt 9.88 kB · 1 download

I added SuccessRate option if you want to disable or enable the system easily.

// -----------------------------------------------------------
//  Basic shop settings.
// -----------------------------------------------------------

	set .Announce,1;	// Announce quest completion? (1: yes / 0: no)
	set .ShowSlot,1;	// Show item slots? (2: all equipment / 1: if slots > 0 / 0: never)
	set .ShowID,0;  	// Show item IDs? (1: yes / 0: no)
	set .ShowZeny,0;	// Show Zeny cost, if any? (1: yes / 0: no)
	set .MaxStack,100;	// Max number of quest items purchased at one time.
	set .SuccessRate,1;	// Enable Success Rates? ( 1: yes / 0: no)

Edit :

Fixed not reading the success rate

 

both are exactly as I wanted, I don't have enough words, just thank you very much both of you 🥰

Share this post


Link to post
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.

Loading...
Sign in to follow this