Jump to content
  • 0

Learning to script [Question for Quest]


ToiletMaster

Question


  • Group:  Members
  • Topic Count:  76
  • Topics Per Day:  0.02
  • Content Count:  276
  • Reputation:   7
  • Joined:  08/11/12
  • Last Seen:  

Hi guys, currently i'm creating a quest for my server,

and it seems that i'm facing a small issue at the moment as i'm not really that clear of certain commands of questing.

I've read up on the script commands on the doc in the trunk, however it still doesn't fix this problem for it.

Currently, i've added up an example quest ID 80000 on my db and displayquestid.

it works without any problem. Alt+U shows everything i need it to show,

however, let's say for this example script that i've taken from basic scripting and editing just for fun /heh

setquest 80000;
mes "[^FF0000Mysterious Old Man^000000]";
mes "H...H......E...L..P M.......e.........";
mes "*COUGH COUGH COUGH*";
mes " ";
mes " ";
mes "^FF0000Beware What you choose....^000000";
next;
menu "Ignore and leave him away",-,"Help the dying man out.",help;
mes "^FF0000You've left him there to slowly rot....^000000";
atcommand "@nuke " + strcharinfo(0);
close;

help:
mes "You've decided to help the mysterious old man out.";
next;
mes "[^FF0000Mysterious Old Man^000000]";
mes "urgh..... what..? where am i?... ouch ouch ouch! *Screams in pain";
emotion e_omg;
next;
mes "[^FF0000Mysterious Old Man^000000]";
mes "Did.. you by any chance help me?";
next;
menu "Yeah, it was me, My name is...",L_zeny,"Nope it wasn't me! It was a ghost!",ghost;
close;

L_Zeny:
mes "[^FF0000Mysterious Old Man^000000]";
mes "Wait! Dont speak! I know you....";
mes "Your voice.. Your face... it sounds like... you're...";
next;
mes "[^FF0000Mysterious Old Man^000000]";
mes strcharinfo(0) + ", Are you not?";
if (Zeny > 10000) goto toomuch;
mes "You have 10,000 zeny or less, I see.";
set Zeny,Zeny+10000;
next;
mes "Hope you feel better!";
close;

Ghost:
mes "[^FF0000Mysterious Old Man^000000]";
mes "OMG LOL WTF";
emotion e_omg;
atcommand "@monster thanatos";
close;

toomuch:
mes "You have over 10,000 zeny, you must feel really good about yourself!";
close;
completequest 80000;
}

current issue is, my map server keeps saying my character has the quest added in already

[Error]: quest_add: Character 150000 already has quest 80000.

and i cant complete the quest 80000.

Another thing i wanna add would be not repeating the quest if it's possible /ok

Thanks!

Regards,

ToiletMaster

Edited by ToiletMaster
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:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

what you mean here ? what problem you are facing ??

if you are refering why you cant finish the quest....it's because of this..

close;
completequest 80000;

anything command that after the Close command will not be executed.

you have to change it to Close2 or put the upcoming command before the Close command is executed.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  76
  • Topics Per Day:  0.02
  • Content Count:  276
  • Reputation:   7
  • Joined:  08/11/12
  • Last Seen:  

Thanks emistry! it work flawlessly!

However, since the quest is done already and to prevent any further

quest_update_status: character 150000 doesn't have quest 80000,

i should make the npc respond different by adding in an if command am i right? seeing from other scripts on how they're being handled.

i believe it should be,

   if(questcomplete,80000) {
       mes "Stop talking to me anymore";
       close;
}    
   mes "[^FF0000Mysterious Old Man^000000]";
   mes "H...H......E...L..P M.......e.........";
   mes "*COUGH COUGH COUGH*";
   mes " ";
   mes " ";
   mes "^FF0000Beware What you choose....^000000";
   next;
   menu "Ignore and leave him away",-,"Help the dying man out.",help;
   mes "^FF0000You've left him there to slowly rot....^000000";
   atcommand "@nuke " + strcharinfo(0);
   close;

(just copied the top part of the script)

Following the http://rathena.org/wiki/If

However, it doesn't work after i add that in, any news on that?

Thanks again!

Link to comment
Share on other sites


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

it's Completequest

and...to check the quest is completed or not...use this

Checkquest

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  76
  • Topics Per Day:  0.02
  • Content Count:  276
  • Reputation:   7
  • Joined:  08/11/12
  • Last Seen:  

Thanks for the reply emistry, however i seem to still face a problem. (Felt like i'm missing out something)

Cause what i would like to do is, if he's finished the quest, he cant repeat the quest anymore and he'll say something different once the setquest 80000 starts.

Meaning,

Before setquest 80000, it'll start at H...E..L..P.... so on till the end.

however if let's say the quest starts, and he you talk to him the second time, it'll be dont talk to me anymore.

right now it goes immediately stop talking to me anymore even though i haven't started the quest.

if (checkquest(80000) == -1) ;{
	mes "Stop talking to me anymore";
	close;}
mes "[^FF0000Mysterious Old Man^000000]";
mes "H...H......E...L..P M.......e.........";
mes "*COUGH COUGH COUGH*";
mes " ";
mes " ";
mes "^FF0000Beware What you choose....^000000";
next;
menu "Ignore and leave him away",-,"Help the dying man out.",help;
mes "^FF0000You've left him there to slowly rot....^000000";
atcommand "@nuke " + strcharinfo(0);
close;

help:
setquest 80000;
mes "You've decided to help the mysterious old man out.";
next;
mes "[^FF0000Mysterious Old Man^000000]";
mes "urgh..... what..? where am i?... ouch ouch ouch! *Screams in pain";
emotion e_omg;
next;
mes "[^FF0000Mysterious Old Man^000000]";
mes "Did.. you by any chance help me?";
next;
menu "Yeah, it was me, My name is...",L_zeny,"Nope it wasn't me! It was a ghost!",ghost;
close;

L_Zeny:
mes "[^FF0000Mysterious Old Man^000000]";
mes "Wait! Dont speak! I know you....";
mes "Your voice.. Your face... it sounds like... you're...";
next;
mes "[^FF0000Mysterious Old Man^000000]";
mes strcharinfo(0) + ", Are you not?";
if (Zeny > 10000) goto toomuch;
mes "You have 10,000 zeny or less, I see.";
set Zeny,Zeny+10000;
next;
mes "Hope you feel better!";
close;

Ghost:
mes "[^FF0000Mysterious Old Man^000000]";
mes "HOLY SHIT WTF";
emotion e_omg;
atcommand "@monster thanatos";
close;

toomuch:
mes "You have over 10,000 zeny, you must feel really good about yourself!";
completequest 80000;
close;	
}

I noticed how slotted sunglasses used (svn revision 16809)

set SG_QUEST1,1;

and i do believe i can incorporate it into my script but, what does the 1,1; mean?

my bad i was stupid on this lol, dint see the quest name was SG_QUEST1,1 <-- 1 = active and 0 is inactive i guess.

the code that i was actually finding for was set quest,1

and the if command for if (quest == 1)

what would happen.

Thanks again for making it happen!

However just wanna ask one more question,

How do i set where the person cant do the quest multiple times?

Edited by ToiletMaster
Link to comment
Share on other sites


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

set a variable on the player upon finished the quest and check for the variable next time.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  76
  • Topics Per Day:  0.02
  • Content Count:  276
  • Reputation:   7
  • Joined:  08/11/12
  • Last Seen:  

set a variable on the player upon finished the quest and check for the variable next time.

not sure if what you meant what was i did but it did solve the trick hahaha, instead of starting the quest 80000,

i used set lol1,1 <--- my temporary quest name for that script i guess?

command instead. however would be good if i use quest 80000 so that people can refer to which quest they are up for.

and another question is, how can i add in quest for hunting? i tried referring to other scripts. but they all have their individual quest assigned to them.

How can i make this possible? Thanks for the assistance again! rAthena wiki doesn't seem to have this information >_>, it would be great if i stopped pestering you in my trivial questions as well /sob

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