Jump to content
  • 0

Help with my script


Dori

Question


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  332
  • Reputation:   15
  • Joined:  12/11/11
  • Last Seen:  

I need help to modify this script.
 
After you talk to the npc and once you have accepted the quest, I don't want the npc to repeat everything from the beginning when you talk to it again.
Currently, even after you have accepted the quest the npc will repeat everything from the beginning and make you select the options again (Hold on: Yes).

Everything is working fine, but it is just unprofessional/annoying when the Npc repeats from the beginning although you have the quest accepted/or have the items.

How I want this script to be:
Once the quest is accepted and when the player talks to the npc, I want the npc to be like "Have you brought the items yet?" [option] Yes or No. If it's yes the npc will check if all the items are there and complete the quest and if not, the npc will give the list of items again and tell the player to hurry up and bring them.
 
Here is the script:

function	script	patienceTest	{
	setarray .@pt_4096[0], 606,100, 914,50; // Job_Baby_Rune
	setarray .@pt_4097[0], 606,100, 914,50; // Job_Baby_Warlock
	setarray .@pt_4098[0], 606,100, 914,50; // Job_Baby_Ranger
	setarray .@pt_4099[0], 606,100, 914,50; // Job_Baby_Bishop
	setarray .@pt_4100[0], 606,100, 914,50; // Job_Baby_Mechanic
	setarray .@pt_4101[0], 606,100, 914,50; // Job_Baby_Cross
	setarray .@pt_4102[0], 606,100, 914,50; // Job_Baby_Guard
	setarray .@pt_4103[0], 606,100, 914,50; // Job_Baby_Sorcerer
	setarray .@pt_4104[0], 606,100, 914,50; // Job_Baby_Minstrel
	setarray .@pt_4105[0], 606,100, 914,50; // Job_Baby_Wanderer
	setarray .@pt_4106[0], 606,100, 914,50; // Job_Baby_Sura
	setarray .@pt_4107[0], 606,100, 914,50; // Job_Baby_Genetic
	setarray .@pt_4108[0], 606,100, 914,50; // Job_Baby_Chaser

	set .@jobID, getarg(0);
	set .@npc$, getarg(1);
	set .@qID, (25000+.@jobID-4030);
	
	if(Class != .@jobID || checkquest(.@qID) == 2)
		return;
	
	mes .@npc$;
	mes "Good. We will start with the ^0042FFPatience Test^000000.";
	mes "You are still very young, which is why you must complete this task in order to prove me that you got what it takes to become one of us.";
	next;
	mes .@npc$;
	mes "Shall we begin then?";
	next;
	if(select("Hold on:Yes!") == 1) {
		mes .@npc$;
		mes "You must complete the ^0042FFPatience Test^000000 in order to change your job.";
		mes "Let me know when you are ready.";
		close;
	}
	mes .@npc$;
	set .@j3, roclass(eaclass()|EAJL_THIRD);
	if (checkquest(.@qID) == 1) {
		set .@invalid, 0;
		for(set .@i,0; .@i < getarraysize(getd(".@pt_"+ .@j3)); set .@i,.@i+2) {
			if(countitem(getd(".@pt_"+ .@j3 +"["+ .@i +"]")) < getd(".@pt_"+ .@j3 +"["+ (.@i+1) +"]")) {
				mes "- "+ getd(".@pt_"+ .@j3 +"["+ (.@i+1) +"]") +" "+ getitemname(getd(".@pt_"+ .@j3 +"["+ .@i +"]"));
				set .@invalid, 1;
			}
		}
		if(.@invalid) {
			mes "You are missing some items. Please come again when you have all the items I asked you to bring.";
			close;
		}
		mes "Congratulations~! You have completed the ^0042FFPatience Test^000000!";
		mes "Now we can get started.";
		for(set .@i,0; .@i < getarraysize(getd(".@pt_"+ .@j3)); set .@i,.@i+2)
			delitem getd(".@pt_"+ .@j3 +"["+ .@i +"]"), getd(".@pt_"+ .@j3 +"["+ (.@i+1) +"]");
		completequest .@qID;
		next;
	} else if (checkquest(.@qID) < 1) {
		mes "Your ^0042FFPatience Test^000000 is to bring me the following items:";
		for(set .@i,0; .@i < getarraysize(getd(".@pt_"+ .@j3)); set .@i,.@i+2)
			mes "- "+ getd(".@pt_"+ .@j3 +"["+ (.@i+1) +"]") +" "+ getitemname(getd(".@pt_"+ .@j3 +"["+ .@i +"]"));
		setquest .@qID;
		close;
	}
	return;
}

Any help would be greatly appreciated~ Thank you!

Edited by Phenex
Link to comment
Share on other sites

4 answers to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

Like this?

 

function	script	patienceTest	{
	setarray .@pt_4096[0], 606,100, 914,50; // Job_Baby_Rune
	setarray .@pt_4097[0], 606,100, 914,50; // Job_Baby_Warlock
	setarray .@pt_4098[0], 606,100, 914,50; // Job_Baby_Ranger
	setarray .@pt_4099[0], 606,100, 914,50; // Job_Baby_Bishop
	setarray .@pt_4100[0], 606,100, 914,50; // Job_Baby_Mechanic
	setarray .@pt_4101[0], 606,100, 914,50; // Job_Baby_Cross
	setarray .@pt_4102[0], 606,100, 914,50; // Job_Baby_Guard
	setarray .@pt_4103[0], 606,100, 914,50; // Job_Baby_Sorcerer
	setarray .@pt_4104[0], 606,100, 914,50; // Job_Baby_Minstrel
	setarray .@pt_4105[0], 606,100, 914,50; // Job_Baby_Wanderer
	setarray .@pt_4106[0], 606,100, 914,50; // Job_Baby_Sura
	setarray .@pt_4107[0], 606,100, 914,50; // Job_Baby_Genetic
	setarray .@pt_4108[0], 606,100, 914,50; // Job_Baby_Chaser

	set .@jobID, getarg(0);
	set .@npc$, getarg(1);
	set .@qID, (25000+.@jobID-4030);
	
	if(Class != .@jobID || checkquest(.@qID) == 2)
		return;
	
	mes .@npc$;
	set .@j3, roclass(eaclass()|EAJL_THIRD);
	if (checkquest(.@qID) == 1) {
		mes "Have you brought the items yet?"; next;
		if(select("Yes:No")-1) { mes "Alright comeback when you have!"; close; }
		set .@invalid, 0;
		for(set .@i,0; .@i < getarraysize(getd(".@pt_"+ .@j3)); set .@i,.@i+2) {
			if(countitem(getd(".@pt_"+ .@j3 +"["+ .@i +"]")) < getd(".@pt_"+ .@j3 +"["+ (.@i+1) +"]")) {
				mes "- "+ getd(".@pt_"+ .@j3 +"["+ (.@i+1) +"]") +" "+ getitemname(getd(".@pt_"+ .@j3 +"["+ .@i +"]"));
				set .@invalid, 1;
			}
		}
		if(.@invalid) {
			mes .@npc$;
			mes "You are missing some items. Please come again when you have all the items I asked you to bring.";
			close;
		}
		mes .@npc$;
		mes "Congratulations~! You have completed the ^0042FFPatience Test^000000!";
		mes "Now we can get started.";
		for(set .@i,0; .@i < getarraysize(getd(".@pt_"+ .@j3)); set .@i,.@i+2)
			delitem getd(".@pt_"+ .@j3 +"["+ .@i +"]"), getd(".@pt_"+ .@j3 +"["+ (.@i+1) +"]");
		completequest .@qID;
		next;
	} else if (checkquest(.@qID) < 1) {
		mes "Good. We will start with the ^0042FFPatience Test^000000.";
		mes "You are still very young, which is why you must complete this task in order to prove me that you got what it takes to become one of us.";
		next;
		mes .@npc$;
		mes "Shall we begin then?";
		next;
		if(select("Hold on:Yes!") == 1) {
			mes .@npc$;
			mes "You must complete the ^0042FFPatience Test^000000 in order to change your job.";
			mes "Let me know when you are ready.";
			close;
		}
		mes "Your ^0042FFPatience Test^000000 is to bring me the following items:";
		for(set .@i,0; .@i < getarraysize(getd(".@pt_"+ .@j3)); set .@i,.@i+2)
			mes "- "+ getd(".@pt_"+ .@j3 +"["+ (.@i+1) +"]") +" "+ getitemname(getd(".@pt_"+ .@j3 +"["+ .@i +"]"));
		setquest .@qID;
		close;
	}
	return;
}
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  332
  • Reputation:   15
  • Joined:  12/11/11
  • Last Seen:  

Thank you so much. I have one more question.
When I put this in to the actual job quest script, i want to put a check in the script so the npc checks if the patience quest is started.
 

Edited by Phenex
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

I think it would be like this.

 

if (checkquest(25000+Job_Baby_Knight-4030) == 1)  {
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  332
  • Reputation:   15
  • Joined:  12/11/11
  • Last Seen:  

Thank you so much Skorm :)


ok so this is what the npc says when a you talk to it first.

if ((BaseLevel == 99) && (JobLevel > 49)) {
if (job_arch == 0) {
if (SkillPoint) {
mes "[Praying Minister]";
mes "You can't change jobs without using all your skill points. Please use all of your skill points before applying to change jobs~";
close;
}
if (checkquest(25000+Job_Baby_Priest-4030) == 1) {
callfunc "patienceTest", Job_Baby_Priest, "[Praying Minister]";
}
mes "[Praying Minister]";
mes "In front of the Almighty God Odin,";
mes "there shall be no person smarter than him,";
mes "and there will be no person more merciful than him.";
next;
mes "[Praying Minister]";
mes "All ministers of Odin should be diligent. They should never be too lazy to serve Odin.";
next;
mes "[Praying Minister]";
mes (Sex?"Brother":"Sister")+", how has your life been? Have you lived it to its fullest?";
mes "Have you served your life in the light of Odin?";
next;
mes "[Praying Minister]";
mes "We are ministers and our behavior is seen as acts of the Gods.";
mes "We should always be mindful of this.";
next;
mes "[Praying Minister]";
mes "We should always tell the truth.";
mes "We should not fall prey to lies and deceit.";
next;
mes "[Praying Minister]";
mes (Sex?"Brother":"Sister")+"...";
mes "Even though we serve Odin, we are normal people.";
mes "We can be degraded in spite of ourselves and we must realize that.";
next;
mes "[Praying Minister]";
mes "We always try to keep our original intention in mind and spread Odin's rule.";
next;
select("How do I become like that?");
mes "[Praying Minister]";
mes "That's a good question.";
mes "We have lots of methods.";
mes "But, I recommend this.";
next;
mes "[Praying Minister]";
mes "Have you ever heard of a ^3131FFHoly Pilgrimage^000000?";
mes "A Holy Pilgrimage means going to a holy place to pray to the God Odin for protection and grace.";
next;
mes "[Praying Minister]";
mes "When you pray to Odin in the holy place, you will feel that you are born again.";
next;
mes "[Praying Minister]";
mes "What do you think?";
mes "Would you like to do a Holy Pilgrimage?";
next;
switch(select("Yes I want to.:I'll think about it.")) {


And then my quest begins here.


 

switch(select("Yes I want to.:I'll think about it.")) {
case 1:
callfunc "patienceTest", Job_Baby_Priest, "[Praying Minister]";
mes "[Praying Minister]";
mes "That's the correct attitude.";
mes "A person who lives in one's mundane life would better have a new mind and body and evolve to the way of a true minister of Odin.";
next;

 




then after I complete the quest the npc would say everything it had told me before. I don't want it to do that. instead i want it to continue from here after i'm done my special quest.

mes "[Praying Minister]";
mes "That's the correct attitude.";
mes "A person who lives in one's mundane life would better have a new mind and body and evolve to the way of a true minister of Odin.";
next;
mes "[Praying Minister]";
mes "There is a small village named Umbala far from here.";
mes "That village is a where a tribe lives in harmony with nature.";
next;
mes "[Praying Minister]";
mes "Go there and find Priest Dayan.";
mes "Tell him exactly,";
mes "'^3131FFI'm here for the Holy Pilgrimage.^000000'";
next;
mes "[Praying Minister]";
mes "He's very old so he is hard of hearing.";
mes "You have to speak loud and clearly. You got it?";
mes "I hope that this paves the way for you to live in the light of Odin.";
set job_arch,1;
setquest 2187;
close;

 




like, everything is working well, i mean after the special quest is done the player is able to continue with the actual quest. It's just, i don't want the npc to tell what he had said earlier twise.

Edited by Capuche
BBCode
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...