Jump to content
  • 0

Basic Hunting Quest NPC


Diconfrost VaNz

Question


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  974
  • Reputation:   41
  • Joined:  11/13/11
  • Last Seen:  

I'm just wondering how the hunting quest script looks like, and i want to learn how to make it.

 

 

I've already learned some of the script, but i think this one is not on my knowledge right now.

 

 

 

Please help, even it's a basic script. As long as it can work.

 

 

 

 

 

 

 

 

 

 

 

 

 

PS: Hunting Quest is like the quest will require you to kill certain number of mobs and when you completed it, you will come back to the npc to claim your reward or it will be automatically given to you.

Link to comment
Share on other sites

20 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  754
  • Reputation:   186
  • Joined:  05/22/12
  • Last Seen:  

OnNPCKillEvent:
if( killedrid == 1002 ){
    poring_count++;
    dispbottom "You killed "+poring_count+" Poring.";
}
if( poring_count >=5 ){ //This part checks if you have met the requirements.(auto-prize)
	dispbottom "You have killed the required number of porings!";
	getitem 501,1; // give prize?
	poring_count = 0; //reset/delete char variable
}
end;

 

Here's how you can check how many poring are killed, and give a prize if condition was met.

 

 

If you want the prize to be claimed from a separate NPC..

 

prontera,167,177,5    script    Pudge    1107,{
if( poring_count >=5 ){
    mes "You have killed the required number of porings!";
    getitem 501,1; // give prize?
    poring_count = 0; //reset/delete char variable
}
else
   mes "Errr.. Please kill 5 Porings for me!";
close;
}

 

 

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:  

only npc..

trunk/npc/custom/quests/hunting_missions.txt

 

npc + quest db / clientside

trunk/npc/pre-re/quests/collection/

 

 

and script release section also got a fews....

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  974
  • Reputation:   41
  • Joined:  11/13/11
  • Last Seen:  

Hunting missions was like, it was optimized and i can't get a clue how it was made. I just need a simple/basic one for me to study how it is done.



help? :D

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  81
  • Topics Per Day:  0.02
  • Content Count:  1654
  • Reputation:   583
  • Joined:  08/09/12
  • Last Seen:  

Or the Questboard at trunk\npc\custom\quests\questboard.txt

To add your own quest (mission) just open the script and scroll down until you see

"//Add Collection Quests here" or "//Add Hunting Quests here" ;)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  974
  • Reputation:   41
  • Joined:  11/13/11
  • Last Seen:  

i said, i want a basic/simple one. Not something that has been made then optimized. I just need the basic mechanics of that script.

 

On how it works, how it stores the data when you killed the mobs and etc.



it's because i'll be making my story-lined quests. And i will include a script on it on hunting some mobs.

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:  


OnNPCKillEvent:

if( killedrid == 1002 ){

poring_count++;

dispbottom "You killed "+poring_count+" Poring.";

}

end;

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  974
  • Reputation:   41
  • Joined:  11/13/11
  • Last Seen:  

so it means i will also use "poring_count" as the counter of the # of mobs? i can use that on the npc script, right? :D



as long as i use "++;" i can change the name before it to my liking, right? :D

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  754
  • Reputation:   186
  • Joined:  05/22/12
  • Last Seen:  

Yes.

 

poring_count++ is how you increment the character variable 'poring_count' by 1.

 

It is the same as

 

set poring_count, poring_count + 1;

or

poring_count += 1;
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  974
  • Reputation:   41
  • Joined:  11/13/11
  • Last Seen:  

so if i'm going to make a hunting quest and i want them to hunt 5 porings 

 

i will place this as one of the script

 

 

  1. OnNPCKillEvent:
  2. if( killedrid == 1002 ){
  3.     poring_count++;
  4.     dispbottom "You killed "+poring_count+" Poring.";
  5. }
  6. end;

 

and in the npc main script will be 

 

if (poring_count = 5) { <script> }

 

 

is this right?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  974
  • Reputation:   41
  • Joined:  11/13/11
  • Last Seen:  

by the way, how about if i want multiple mobs?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  592
  • Reputation:   31
  • Joined:  11/14/11
  • Last Seen:  

setarray .@MobID[0], xxxx,xxxx,xxxx; // Monsters ID

 

 

if (killedrid == .@MobID[0]){

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  974
  • Reputation:   41
  • Joined:  11/13/11
  • Last Seen:  

how to set into different mob numbers?

 

for example is

 

5 porings, 10 poporings and 2 pupa?

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:  

you can try something like this..

OnInit:
// monster list
setarray .mob_list,1002,1004,1005;
// amount need to kill
setarray .mob_amount,10,20,30;

// ignore these part
.mob_size = getarraysize( .mob_list );
for( .@i = 0; .@i < .mob_size; .@i++ )
	setd( ".mob_"+.mob_list[.@i] ),.mob_amount[.@i];
end;

OnNPCKillEvent:
// if monster are listed..
if( getd( ".mob_"+killedrid ) ){
	// increase count....
	setd( "kill_count_"+killedrid ),( getd( "kill_count_"+killedrid ) + 1 );
	dispbottom "You killed "+getd( "kill_count_"+killedrid )+" / "+getd( ".mob_"+killedrid )+" "+getmonsterinfo( killedrid,MOB_NAME );
}
end; 

i didnt test it....but should be look something like this...

i remember last time in rA got a few topic discussed the same things too for mob hunting quests...

try search for it...

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  974
  • Reputation:   41
  • Joined:  11/13/11
  • Last Seen:  

/omg i can't understand that Emistry at all /heh but i recognize those script commands. They're the same with functions in C++, right?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  81
  • Topics Per Day:  0.02
  • Content Count:  1654
  • Reputation:   583
  • Joined:  08/09/12
  • Last Seen:  

It's like reinventing the wheels...

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:  

Here's how i do my quest scripts and an example xD

 

quest_db

// Quest Database
//
// Structure of Database:
// Quest ID,Time Limit,Target1,Val1,Target2,Val2,Target3,Val3,Quest Title
81000,0,1002,10,0,0,0,0,"Hunting Porings";

 

(This will give a small notification each time you kill a poring xD to know how many you've killed so far. (Not sure if it works for all client, i'm using 2012-04-10))

 

NPC side

-Usual header-
 
if (checkquest (81000,HUNTING) == 2) {
mes "[ToiletMaster]";
mes "You've done it! Congratulations!";
mes "Here's a great reward for you!";
next;
mes "[ToiletMaster]";
mes "Just Kidding! :D";
close; }
 
 
mes "[ToiletMaster]";
mes "I want you to kill 10 PORINGS!
setquest 80010;
close;
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  974
  • Reputation:   41
  • Joined:  11/13/11
  • Last Seen:  

oh that's the purpose of quest_db.txt /omg

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:  

oh that's the purpose of quest_db.txt /omg

yup hahaha, i'm using quest_db quite often for my quests xD.

adding a time limit would be easier from there also in my opinion xD

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  974
  • Reputation:   41
  • Joined:  11/13/11
  • Last Seen:  

/omg/heh



if (checkquest (81000,HUNTING) == 2) <<<here, why "2" not "1"??? xD

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  754
  • Reputation:   186
  • Joined:  05/22/12
  • Last Seen:  

*checkquest(<ID>{,PLAYTIME|HUNTING})

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

 

ref: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk/doc/script_commands.txt

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