Jump to content
  • 0

help How to set erasequest?


Meister

Question


  • Group:  Members
  • Topic Count:  280
  • Topics Per Day:  0.06
  • Content Count:  841
  • Reputation:   17
  • Joined:  04/16/12
  • Last Seen:  

This script sets a 23 hour cooldown after taking 1 quest at any category. Now the problem is. After setting the quest of the 23 hour cooldown. After 23 hours. The npc won't let me get any quest..

where did I put the 23 hour cooldown?

at L_Quest1 to L_Quest4 .. particularly setquest 19950 - 19953 .. this particular quest id sets a 23 hour cooldown for the player..

entry for quest_db

19950,82800,0,0,0,0,0,0,"Unrefined Energy Crystal Effect"
19951,82800,0,0,0,0,0,0,"Refined Energy Crystal Effect"
19952,82800,0,0,0,0,0,0,"Pure Energy Crystal Effect"
19953,82800,0,0,0,0,0,0,"Pure Energy Crystal Effect"

now.. with this line posted below..

  	 if (checkquest(19950,HUNTING) == 2) {
	mes "[ Scientist Que ]";
	mes "Please wait 23 hours before taking";
	mes "the Unrefined Energy Crystal";
	mes "quest again! Thanks!";
	close;
	}

this checks the 23 hour cooldown.. so what am I going to do here to set erasequest command if the 19950-19953 cooldown expires?

Thanks!

Full script below..

//Energy Crystal Quest

izlude,150,205,4	script	Scientist Que	402,{
if( BaseLevel > 70 ) {
mes "[ Scientist Que ]";
mes "Hi "+ strcharinfo(0) +"!";
mes "..I've never thought";
mes "I could create a";
mes "perfect energy crystal...";
next;
mes "[ Scientist Que ]";
mes "It was just a dream for me!";
mes "But I can give it you..";
mes "YOU need to hunt 100 monster!";
next;
mes "[ Scientist Que ]";
mes "Do you want it?";
next;
switch(select("Yes:No")){
case 1:
mes "[ Scientist Que ]";
mes "Well then choose what";
mes "Energy Crystal you want!";
next;
switch(select("Unrefined Energy Crystal:Refined Energy Crystal:Pure Energy Crystal - 5:Pure Energy Crystal - 10")) {
case 1:
	for(set .@u,0; .@u<2; set .@u,.@u+1)
	if (checkquest(19900+.@u,HUNTING) == 1) {
	mes "[ Scientist Que ]";
	mes "Quest currently in progress";
	close;
	}
	if (checkquest(19950,HUNTING) == 2) {
	mes "[ Scientist Que ]";
	mes "Please wait 23 hours before taking";
	mes "the Unrefined Energy Crystal";
	mes "quest again! Thanks!";
	close;
	}
	switch(select("Requiem:Bathory:Spring Rabbit:Sleeper:Evil Druid:Petite:Clock")) {
		case 1: callsub L_Quest1,19900,"Requiem",90000;
		case 2: callsub L_Quest1,19901,"Bathory",94000;
		case 3: callsub L_Quest1,19902,"Spring Rabbit",114000;
		case 4: callsub L_Quest1,19903,"Sleeper",96000;
		case 5: callsub L_Quest1,19904,"Evil Druid",96000;
		case 6: callsub L_Quest1,19905,"Petite",146000;
		case 7: callsub L_Quest1,19906,"Clock",96000;
	}
case 2:
	for(set .@j,0; .@j<2; set .@j,.@j+1)
	if (checkquest(19907+.@j,HUNTING) == 1) {
	mes "Quest currently in progress";
	close;
	}
	if (checkquest(19951,HUNTING) ==2) {
	mes "[ Scientist Que ]";
	mes "Please wait 23 hours before taking";
	mes "the Refined Energy Crystal";
	mes "quest again! Thanks!";
	close;
	}
	switch(select("Siroma:Dark Priest:Stapo:Solider")) {
		case 1: callsub L_Quest2,19907,"Siroma",102000;
		case 2: callsub L_Quest2,19908,"Dark Priest",102000;
		case 3: callsub L_Quest2,19909,"Stapo",110000;
		case 4: callsub L_Quest2,19910,"Solider",108000;
	}
case 3:
	for(set .@k,0; .@k<2; set .@k,.@k+1)
	if (checkquest(19911+.@k,HUNTING) == 1) {
	mes "Quest currently in progress";
	close;
	}
	if (checkquest(19952,HUNTING) ==2) {
	mes "[ Scientist Que ]";
	mes "Please wait 23 hours before taking";
	mes "the Pure Energy Crystal - 5";
	mes "quest again! Thanks!";
	close;
	}
	switch(select("Desert Wolf:Medusa:Pinguicula:Majoruros")) {
		case 1: callsub L_Quest3,19911,"Desert Wolf",110000;
		case 2: callsub L_Quest3,19912,"Medusa",138000;
		case 3: callsub L_Quest3,19913,"Pinguicula",118000;
		case 4: callsub L_Quest3,19914,"Majoruros",96000;
	}
case 4:
	for(set .@l,0; .@l<2; set .@l,.@l+1)
	if (checkquest(19915+.@l,HUNTING) == 1) {
	mes "Quest currently in progress";
	close;
	}
	if (checkquest(19953,HUNTING) ==2) {
	mes "[ Scientist Que ]";
	mes "Please wait 23 hours before taking";
	mes "the Pure Energy Crystal - 10";
	mes "quest again! Thanks!";
	close;
	}
	switch(select("Raydric:Naga:Ancient Mummy:Ancient Mimic")) {
		case 1: callsub L_Quest4,19915,"Raydric",134000;
		case 2: callsub L_Quest4,19916,"Naga",134000;
		case 3: callsub L_Quest4,19917,"Ancient Mummy",134000;
		case 4: callsub L_Quest4,19918,"Ancient Mimic",134000;
	}
}
case 2:
mes "[ Scientist Que ]";
mes "Okay then, you may leave now!";
close;
}
end;
L_Quest1:
if (checkquest(getarg(0),HUNTING) == 2) {
	mes "[ Scientist Que ]";
	mes "Wow! You're amazing!";
	mes "You hunted all 100 "+getarg(1)+".";
	mes "Thank you very much.";
	next;
	mes "[ Scientist Que ]";
	mes "As a promise, I'll give you your";
	mes "10 Unrefined Energy Crystal!";
	next;
	erasequest getarg(0);
	getexp getarg(2),311000;
	getitem 6623,10;
	setquest 19950;
	mes "[ Scientist Que ]";
	mes "Use it wisely!";
	mes "Good luck.";
	close;
}
if (checkquest(getarg(0)) == -1) {
	setquest getarg(0);
	mes "Please hunt 100 "+getarg(1)+" and return here.";
	close;
}
mes "Umm? You didn't hunt";
mes "all 100 "+getarg(1)+" yet...";
mes "Will you check again?";
close;
L_Quest2:
if (checkquest(getarg(0),HUNTING) == 2) {
	mes "[ Scientist Que ]";
	mes "Wow! You're amazing!";
	mes "You hunted all 100 "+getarg(1)+".";
	mes "Thank you very much.";
	next;
	mes "[ Scientist Que ]";
	mes "As a promise, I'll give you your";
	mes "10 Refined Energy Crystal!";
	next;
	erasequest getarg(0);
	getexp getarg(2),311000;
	getitem 6624,10;
	setquest 19951;
	mes "[ Scientist Que ]";
	mes "Use it wisely!";
	mes "Good luck.";
	close;
}
if (checkquest(getarg(0)) == -1) {
	setquest getarg(0);
	mes "Please hunt 100 "+getarg(1)+" and return here.";
	close;
}
mes "Umm? You didn't hunt";
mes "all 100 "+getarg(1)+" yet...";
mes "Will you check again?";
close;
L_Quest3:
if (checkquest(getarg(0),HUNTING) == 2) {
	mes "[ Scientist Que ]";
	mes "Wow! You're amazing!";
	mes "You hunted all 100 "+getarg(1)+".";
	mes "Thank you very much.";
	next;
	mes "[ Scientist Que ]";
	mes "As a promise, I'll give you your";
	mes "5 Pure Energy Crystal!";
	next;
	erasequest getarg(0);
	getexp getarg(2),311000;
	getitem 6625,5;
	setquest 19952;
	mes "[ Scientist Que ]";
	mes "Use it wisely!";
	mes "Good luck.";
	close;
}
if (checkquest(getarg(0)) == -1) {
	setquest getarg(0);
	mes "Please hunt 100 "+getarg(1)+" and return here.";
	close;
}
mes "Umm? You didn't hunt";
mes "all 100 "+getarg(1)+" yet...";
mes "Will you check again?";
close;
L_Quest4:
if (checkquest(getarg(0),HUNTING) == 2) {
	mes "[ Scientist Que ]";
	mes "Wow! You're amazing!";
	mes "You hunted all 100 "+getarg(1)+".";
	mes "Thank you very much.";
	next;
	mes "[ Scientist Que ]";
	mes "As a promise, I'll give you your";
	mes "10 Pure Energy Crystal!";
	next;
	erasequest getarg(0);
	getexp getarg(2),311000;
	getitem 6625,10;
	setquest 19953;
	mes "[ Scientist Que ]";
	mes "Use it wisely!";
	mes "Good luck.";
	close;
}
if (checkquest(getarg(0)) == -1) {
	setquest getarg(0);
	mes "Please hunt 100 "+getarg(1)+" and return here.";
	close;
}
mes "Umm? You didn't hunt";
mes "all 100 "+getarg(1)+" yet...";
mes "Will you check again?";
close;
}else{
mes "Not enough level";
close;
}
}

Edited by emong
Link to comment
Share on other sites

6 answers to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10018
  • Reputation:   2369
  • Joined:  10/28/11
  • Last Seen:  

if( checkquest( <questID> ) == 1 ){
   erasequest <questID>;
}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  280
  • Topics Per Day:  0.06
  • Content Count:  841
  • Reputation:   17
  • Joined:  04/16/12
  • Last Seen:  

if( checkquest( <questID> ) == 1 ){
erasequest <questID>;
}

@emistry: Where shall I put it?

before the case right? example..

if( checkquest( 19950 ) == 1 ){
erasequest 19950;
}
for(set .@u,0; .@u<2; set .@u,.@u+1)
	if (checkquest(19900+.@u,HUNTING) == 1) {
	mes "[ Scientist Que ]";
	mes "Quest currently in progress";
	close;
	}
	if (checkquest(19950,HUNTING) == 2) {
	mes "[ Scientist Que ]";
	mes "Please wait 23 hours before taking";
	mes "the Unrefined Energy Crystal";
	mes "quest again! Thanks!";
	close;
	}
	switch(select("Requiem:Bathory:Spring Rabbit:Sleeper:Evil Druid:Petite:Clock")) {
		case 1: callsub L_Quest1,19900,"Requiem",90000;
		case 2: callsub L_Quest1,19901,"Bathory",94000;
		case 3: callsub L_Quest1,19902,"Spring Rabbit",114000;
		case 4: callsub L_Quest1,19903,"Sleeper",96000;
		case 5: callsub L_Quest1,19904,"Evil Druid",96000;
		case 6: callsub L_Quest1,19905,"Petite",146000;
		case 7: callsub L_Quest1,19906,"Clock",96000;
	}

is this correct?

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10018
  • Reputation:   2369
  • Joined:  10/28/11
  • Last Seen:  

L_Quest1:
..............<code>,.................

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  280
  • Topics Per Day:  0.06
  • Content Count:  841
  • Reputation:   17
  • Joined:  04/16/12
  • Last Seen:  

L_Quest1:
..............<code>,.................

Done. added the code

if( checkquest( <questID> ) == 1 ){
erasequest <questID>;
}


Still the quest isn't erased. I checked upon quest_db and set the cooldown to minute but nothing happens..

but I tried this code

if(checkquest(19950,PLAYTIME) == 2 ) {

erasequest 19950

mes blah blah

}

it worked! Now I have a question..

what's the difference between HUNTING, And PLAYTIME?

Does PLAYTIME, only counts the hours/minutes when the player is online?

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10018
  • Reputation:   2369
  • Joined:  10/28/11
  • Last Seen:  

If no additional argument supplied, return the state of the quest:
-1 = Quest not started (not in quest log)
0  = Quest has been given, but the state is "inactive"
1  = Quest has been given, and the state is "active"
2  = Quest completed

If parameter "PLAYTIME" is supplied:
-1 = Quest not started (not in quest log)
0  = the time limit has not yet been reached
1  = the time limit has not been reached but the quest is marked as complete
2  = the time limit has been reached

If parameter "HUNTING" is supplied:
-1 = Quest not started (not in quest log)
0  = you haven't killed all of the target monsters and the time limit has not been reached.
1  = you haven't killed all of the target monsters but the time limit has been reached.
2  = you've killed all of the target monsters

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  280
  • Topics Per Day:  0.06
  • Content Count:  841
  • Reputation:   17
  • Joined:  04/16/12
  • Last Seen:  

I know that cause I've already read it.. But how come that when I used HUNTING the erasequest doesn't work but for PLAYTIME it works.. :(

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