Jump to content
  • 0

How To Make My Custom Quest As Individual Quest


Dolphin86

Question


  • Group:  Members
  • Topic Count:  280
  • Topics Per Day:  0.06
  • Content Count:  757
  • Reputation:   17
  • Joined:  01/07/12
  • Last Seen:  

When i finish 1 quest, the script reads as a whole, which means i cant take quest 2 or quest 3, even i have never done quest 2 or quest 3, i have only done quest 1,

so how to make each quest individual? and if anymore can make this script more simplify and cleaner, i would be very much appricate it, please send help thanks for your time helping me.

Spoiler

moc_para01,39,36,5	script	Quest Manager	732,{

	if(countitem(40056) < 1) {
	soundeffect "menu.wav",0;
	mes "[^FF7700Quest Manager^000000]";
	mes "Oh hello, im sorry,";
	mes "it seems you are not yet a register";
	mes "as a guild member, kindly register yourself";
	mes "at front desk to start accepting quest.";
	close;
	}
	
	soundeffect "menu.wav",0;
	mes "[^FF7700Quest Manager^000000]";
	mes "Hello, Please Select Quest";
	menu	" ~ Hunting Quest",HQ,
			" ~ Collecting Quest",CQ;
			end;
	HQ:
		clear;
		soundeffect "menu.wav",0;
		mes "[^FF7700Quest Manager^000000]";
		mes "Please select a quest";
		menu	" ~ Prontera Field 01",PF01,
				" ~ Prontera Field 02",PF02;
			end;
	PF01:
		clear;
		soundeffect "menu.wav",0;
		mes "[^FF7700Quest Manager^000000]";
		mes "Please hunt and kill the following";
		mes "-300 Poring";
		mes "-300 Fabre";
		mes "-300 Pupa";
		next;
		clear;
		soundeffect "menu.wav",0;
		mes "[^FF7700Quest Manager^000000]";
		mes "Reward:";
		mes "2100 base exp";
		mes "2100 job exp";
		mes "1 GMC";
		mes "1 Supply Box";
			switch(select("- Take Quest:- Submit Completed Quest:- Cancel")){
				case 1:
					if (BaseLevel > 21) {
						goto highlvl;
					}
					if (#EXCOOLDOWN > gettimetick(2)){
						goto wait24hour;
					}
					if (checkquest(120000) == -1) {
					clear;
					soundeffect "menu.wav",0;
					mes "[^FF7700Quest Manager^000000]";
					mes "You have taken this quest, good luck !";
					setquest 120000;
					} else {
						goto havetaken;
					}
					break;
				case 2:
					if (checkquest(120000) == 0 || checkquest(120000) == 1) {
					clear;
					soundeffect "menu.wav",0;
					mes "[^FF7700Quest Manager^000000]";
					mes "Well done!";
					mes "here is your rewards";
					getitem 40221,1;
					getitem 40222,1;
					getexp 2100,2100;
					erasequest 120000;
					#EXCOOLDOWN = gettimetick(2) + 86400;
					}
					else if (checkquest(120000) == -1) {
						goto nottaken;
					}
					break;
				case 3:
					end;
				}
				
	PF02:
		clear;
		soundeffect "menu.wav",0;
		mes "[^FF7700Quest Manager^000000]";
		mes "Please hunt and kill the following";
		mes "-300 Lunatic";
		mes "-300 Drops";
		mes "-300 Poporing";
		next;
		clear;
		soundeffect "menu.wav",0;
		mes "[^FF7700Quest Manager^000000]";
		mes "Reward:";
		mes "27300 base exp";
		mes "14700 job exp";
		mes "1 GMC";
		mes "1 Supply Box";
			switch(select("- Take Quest:- Submit Completed Quest:- Cancel")){
				case 1:
					if (BaseLevel > 51) {
					goto highlvl;
					}
					if (#EXCOOLDOWN > gettimetick(2)){
					goto wait24hour;
					}
					if (checkquest(120001) == -1) {
					clear;
					soundeffect "menu.wav",0;
					mes "[^FF7700Quest Manager^000000]";
					mes "You have taken this quest, good luck !";
					setquest 120001;
					} else {
					goto havetaken;
					}
					break;
				case 2:
					if (checkquest(120001) == 0 || checkquest(120001) == 1) {
					clear;
					soundeffect "menu.wav",0;
					mes "[^FF7700Quest Manager^000000]";
					mes "Well done!";
					mes "here is your rewards";
					getitem 40221,1;
					getitem 40222,1;
					getexp 27300,14700;
					erasequest 120001;
					#EXCOOLDOWN = gettimetick(2) + 86400;
					}
					else if (checkquest(120001) == -1) {
					goto nottaken;
					}
					break;
				case 3:
					end;
				}
	CQ:
		clear;
		soundeffect "menu.wav",0;
		mes "[^FF7700Quest Manager^000000]";
		mes "WIP";
		close;
		
	highlvl:
		clear;
		soundeffect "menu.wav",0;
		mes "[^FF7700Quest Manager^000000]";
		mes "Sorry your level is above the quest requirement.";
		close;
	
	wait24hour:
		clear;
		soundeffect "menu.wav",0;
		mes "[^FF7700Quest Manager^000000]";
		mes "Sorry you have to wait 24 Hours until you can do the Quest again!";
		close;
		
	havetaken:
		clear;
		soundeffect "menu.wav",0;
		mes "[^FF7700Quest Manager^000000]";
		mes "Sorry, but you already have this quest.";
		close;
		
	nottaken:
		clear;
		soundeffect "menu.wav",0;
		mes "[^FF7700Quest Manager^000000]";
		mes "It's look like you have not take the quest";
		close;
}

 

 

Edited by Dolphin86
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  49
  • Topics Per Day:  0.01
  • Content Count:  1826
  • Reputation:   288
  • Joined:  08/03/12
  • Last Seen:  

14 hours ago, Dolphin86 said:

When i finish 1 quest, the script reads as a whole, which means i cant take quest 2 or quest 3, even i have never done quest 2 or quest 3, i have only done quest 1,

so how to make each quest individual? and if anymore can make this script more simplify and cleaner, i would be very much appricate it, please send help thanks for your time helping me.

  Hide contents

moc_para01,39,36,5	script	Quest Manager	732,{

	if(countitem(40056) < 1) {
	soundeffect "menu.wav",0;
	mes "[^FF7700Quest Manager^000000]";
	mes "Oh hello, im sorry,";
	mes "it seems you are not yet a register";
	mes "as a guild member, kindly register yourself";
	mes "at front desk to start accepting quest.";
	close;
	}
	
	soundeffect "menu.wav",0;
	mes "[^FF7700Quest Manager^000000]";
	mes "Hello, Please Select Quest";
	menu	" ~ Hunting Quest",HQ,
			" ~ Collecting Quest",CQ;
			end;
	HQ:
		clear;
		soundeffect "menu.wav",0;
		mes "[^FF7700Quest Manager^000000]";
		mes "Please select a quest";
		menu	" ~ Prontera Field 01",PF01,
				" ~ Prontera Field 02",PF02;
			end;
	PF01:
		clear;
		soundeffect "menu.wav",0;
		mes "[^FF7700Quest Manager^000000]";
		mes "Please hunt and kill the following";
		mes "-300 Poring";
		mes "-300 Fabre";
		mes "-300 Pupa";
		next;
		clear;
		soundeffect "menu.wav",0;
		mes "[^FF7700Quest Manager^000000]";
		mes "Reward:";
		mes "2100 base exp";
		mes "2100 job exp";
		mes "1 GMC";
		mes "1 Supply Box";
			switch(select("- Take Quest:- Submit Completed Quest:- Cancel")){
				case 1:
					if (BaseLevel > 21) {
						goto highlvl;
					}
					if (#EXCOOLDOWN > gettimetick(2)){
						goto wait24hour;
					}
					if (checkquest(120000) == -1) {
					clear;
					soundeffect "menu.wav",0;
					mes "[^FF7700Quest Manager^000000]";
					mes "You have taken this quest, good luck !";
					setquest 120000;
					} else {
						goto havetaken;
					}
					break;
				case 2:
					if (checkquest(120000) == 0 || checkquest(120000) == 1) {
					clear;
					soundeffect "menu.wav",0;
					mes "[^FF7700Quest Manager^000000]";
					mes "Well done!";
					mes "here is your rewards";
					getitem 40221,1;
					getitem 40222,1;
					getexp 2100,2100;
					erasequest 120000;
					#EXCOOLDOWN = gettimetick(2) + 86400;
					}
					else if (checkquest(120000) == -1) {
						goto nottaken;
					}
					break;
				case 3:
					end;
				}
				
	PF02:
		clear;
		soundeffect "menu.wav",0;
		mes "[^FF7700Quest Manager^000000]";
		mes "Please hunt and kill the following";
		mes "-300 Lunatic";
		mes "-300 Drops";
		mes "-300 Poporing";
		next;
		clear;
		soundeffect "menu.wav",0;
		mes "[^FF7700Quest Manager^000000]";
		mes "Reward:";
		mes "27300 base exp";
		mes "14700 job exp";
		mes "1 GMC";
		mes "1 Supply Box";
			switch(select("- Take Quest:- Submit Completed Quest:- Cancel")){
				case 1:
					if (BaseLevel > 51) {
					goto highlvl;
					}
					if (#EXCOOLDOWN > gettimetick(2)){
					goto wait24hour;
					}
					if (checkquest(120001) == -1) {
					clear;
					soundeffect "menu.wav",0;
					mes "[^FF7700Quest Manager^000000]";
					mes "You have taken this quest, good luck !";
					setquest 120001;
					} else {
					goto havetaken;
					}
					break;
				case 2:
					if (checkquest(120001) == 0 || checkquest(120001) == 1) {
					clear;
					soundeffect "menu.wav",0;
					mes "[^FF7700Quest Manager^000000]";
					mes "Well done!";
					mes "here is your rewards";
					getitem 40221,1;
					getitem 40222,1;
					getexp 27300,14700;
					erasequest 120001;
					#EXCOOLDOWN = gettimetick(2) + 86400;
					}
					else if (checkquest(120001) == -1) {
					goto nottaken;
					}
					break;
				case 3:
					end;
				}
	CQ:
		clear;
		soundeffect "menu.wav",0;
		mes "[^FF7700Quest Manager^000000]";
		mes "WIP";
		close;
		
	highlvl:
		clear;
		soundeffect "menu.wav",0;
		mes "[^FF7700Quest Manager^000000]";
		mes "Sorry your level is above the quest requirement.";
		close;
	
	wait24hour:
		clear;
		soundeffect "menu.wav",0;
		mes "[^FF7700Quest Manager^000000]";
		mes "Sorry you have to wait 24 Hours until you can do the Quest again!";
		close;
		
	havetaken:
		clear;
		soundeffect "menu.wav",0;
		mes "[^FF7700Quest Manager^000000]";
		mes "Sorry, but you already have this quest.";
		close;
		
	nottaken:
		clear;
		soundeffect "menu.wav",0;
		mes "[^FF7700Quest Manager^000000]";
		mes "It's look like you have not take the quest";
		close;
}

 

 

#EXCOOLDOWN = gettimetick(2) + 86400

I just skimmed the script, and saw both quest are using the same variable, any quest finished will have the same cooldown for both since both are using the same variable cooldown.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  212
  • Reputation:   94
  • Joined:  06/02/12
  • Last Seen:  

Like Chaos mentioned, each quest need it's own variable to register each cooldown time.
Try using tr0n's Questboard, it does what you want and it is easy to add/edit quests.

Spoiler
//===== rAthena Script =======================================
//= tr0n's Questboard
//===== By: ==================================================
//= tr0n
//===== Current Version: =====================================
//= 1.6.6
//===== Description: =========================================
//= Easily add collection and hunting quests.
//===== Changelogs: ==========================================
// 1.0.0 Release
// 1.1.0 Added zeny reward
// 1.2.0 Rewrote checkmob and killcounter
// 1.3.1 Added level restriction
// 1.3.4 Added Reward Item Amount
// 1.4.4 Added Quest delay
// 1.5.4 Added repeatable Quests
// 1.6.4 Added party support
// 1.6.5 Bug fixes for party support
// 1.6.6 Bug fixes for delay time does not appear [mazvi]
//============================================================

moc_para01,39,36,5	script	Quest Manager#2024	732,{
	soundeffect "menu.wav",0;
	mes "[^FF7700Quest Manager^000000]";
	
	if (countitem(40056) < 1) {
		mes "Oh hello, im sorry,";
		mes "it seems you are not yet a register";
		mes "as a guild member, kindly register yourself";
		mes "at front desk to start accepting quest.";
		close;
	}

	mes "Hello, Please Select Quest";
	while (true) {
		switch(select((.hunting)?" ~ Hunting Quest":"",
					  (.collection)?" ~ Collecting Quest":"")) {
		soundeffect "menu.wav",0;
		case 1:
			set .@huntmenu$, "";
			for( set .@i,0; .@i < .huntingquestcount; set .@i,.@i+1){
				if (.@i) set .@huntmenu$,.@huntmenu$ + ":";
				if (gettimetick(2) < getd((.@i+1) + "_hunting_delay"))
					.@c$ = "^808080";
				else
					.@c$ = "^000000";
				set .@huntmenu$, .@huntmenu$ + .@c$ + "[Lv " + getd("." +(.@i+1)+"_huntingmin") + "-" + getd("." +(.@i+1)+"_huntingmax") + "] " + getd("." + (.@i+1) + "_huntingname$");
			}
			set @selection,select(.@huntmenu$);
			soundeffect "menu.wav",0;
			clear;
			if(.quest_repeat == true){
				if(gettimetick(2) < getd(@selection + "_hunting_delay")){
					mes "[^FF7700Quest Manager^000000]";
					mes "Sorry you have to wait 24 Hours until you can do the Quest again!";
					mes "Please wait more ^0000FF"+Time2Str(getd(@selection + "_hunting_delay"))+"^000000.";
					close;
				}
			}
			else {
				if(getd(@selection + "_hunting_repeat") == true){
					mes "[^FF7700Quest Manager^000000]";
					mes "You already did this quest.";
					mes "Please choose another one.";
					close;
				}
			}
			mes "[^FF7700Quest Manager^000000]";
			mes "Please hunt and kill the following";
			set .@size, getarraysize(getd("."+ @selection + "_huntingmob"));
			for( set .@j, 0; .@j < .@size; set .@j,.@j+2){
				mes "- ^FF0000"+getd("."+@selection+"_huntingmob["+(.@j+1)+"]")+ " " + strmobinfo(1,getd("."+@selection+"_huntingmob["+.@j+"]"))+"^000000";
			}
			next;
			mes "[^FF7700Quest Manager^000000]";
			mes "Reward:";
			if (getd("." +@selection+"_huntingexp["+0+"]"))
				mes "^0000FF"+getd("." +@selection+"_huntingexp["+0+"]")+" Base EXP^000000";
			if (getd("." +@selection+"_huntingexp["+1+"]"))
				mes "^0000FF"+getd("." +@selection+"_huntingexp["+1+"]")+" Job EXP^000000";
			if (getd("." +@selection+"_huntingzeny"))
				mes "Zeny: ^0000FF"+getd("." +@selection+"_huntingzeny")+"^000000";
			if (getd("." +@selection+"_huntingprize[0]")) {
				for(.@i = 0; .@i < getarraysize(getd("." +@selection+"_huntingprize")); .@i++)
					mes getd("." +@selection+"_huntingamount") + " " + mesitemlink((getd("." +@selection+"_huntingprize["+.@i+"]")));
			}
			switch(select("- Take Quest", "- Submit Completed Quest", "- Cancel")) {
			soundeffect "menu.wav",0;
			case 1:
				clear;
				if (isbegin_quest(getd("." + @selection+"_huntingid")))
					goto havetaken;
				if (BaseLevel >= getd("." +@selection+"_huntingmin") && BaseLevel <= getd("." +@selection+"_huntingmax")){
					mes "[^FF7700Quest Manager^000000]";
					mes "Quest accepted.";
					set h_run, true;
					set currentquest$, @selection;
					setquest getd("." + @selection+"_huntingid");
					close;
				}
				else{
					mes "[^FF7700Quest Manager^000000]";
					mes "You don't have the required";
					mes "level to do this quest.";
					close;
				}
			case 2:
				clear;
				switch(checkquest(getd("." +@selection+"_huntingid"),HUNTING)) {
				soundeffect "menu.wav",0;
				case -1:
					goto nottaken;
				case 2:
					mes "[^FF7700Quest Manager^000000]";
					mes "Well done!";
					mes "here is your rewards";
					if(getd("." +@selection+"_huntingprize[0]")) {
						for(.@i = 0; .@i < getarraysize(getd("." +@selection+"_huntingprize")); .@i++)
							getitem(getd("." +@selection+"_huntingprize["+.@i+"]"),getd("." +@selection+"_huntingamount"));
					}
					set Zeny, Zeny+getd("." +@selection+"_huntingzeny");
					getexp getd("." +@selection+"_huntingexp["+0+"]"),getd("." +@selection+"_huntingexp["+1+"]");
					erasequest getd("." +@selection+"_huntingid");
					setd(@selection + "_hunting_delay"),gettimetick(2)+.quest_delay;
					setd(@selection + "_hunting_repeat"),true;
					set @selection, "";
					set h_run, false;
					end;
				default:
					mes "[^FF7700Quest Manager^000000]";
					mes "You didn't kill everything.";
					close;
				}

			case 3:
				end;
			}

		case 2:
			clear;
			mes "[^FF7700Quest Manager^000000]";
			mes "The Guild is always in need of more resources.";
			mes "Please select the area you would like to help today.";
			set .@collectmenu$, "";
			for( set .@i,0; .@i < .collectionquestcount; set .@i,.@i+1){
				if (.@i) set .@collectmenu$,.@collectmenu$ + ":";
				if (gettimetick(2) < getd((.@i+1) + "_collection_delay"))
					.@c$ = "^808080";
				else
					.@c$ = "^000000";
				set .@collectmenu$, .@collectmenu$ + .@c$ + "[Lv " + getd("." +(.@i+1)+"_collectionmin") + "-" + getd("." +(.@i+1)+"_collectionmax") + "] " + getd("." + (.@i+1) + "_collectionname$");
			}
			set @selection,select(.@collectmenu$);
			soundeffect "menu.wav",0;
			clear;		
			if(.quest_repeat == true){
				if(gettimetick(2) < getd(@selection + "_collection_delay")){
					mes "[^FF7700Quest Manager^000000]";
					mes "Sorry you have to wait 24 Hours until you can do the Quest again!";
					mes "Please wait more ^0000FF"+Time2Str(getd(@selection + "_collection_delay"))+"^000000.";
					close;
				}
			}
			else{
				if(getd(@selection + "_collection_repeat") == true){
					mes "[^FF7700Quest Manager^000000]";
					mes "You already did this quest.";
					mes "Please choose another one.";
					close;
				}
			}
			mes "[^FF7700Quest Manager^000000]";
			mes "We need the following:";
			set .@size, getarraysize(getd("."+ @selection + "_collectionitem"));
			for( set .@j, 0; .@j < .@size; set .@j,.@j+2){
				.@a = countitem(getd("."+@selection+"_collectionitem["+.@j+"]"));
				if (.@a < getd("."+@selection+"_collectionitem["+(.@j+1)+"]"))
					.@c$ = "^FF0000";
				else .@c$ = "";
				//mes "^FF0000"+getitemname(getd("."+@selection+"_collectionitem["+.@j+"]"))+" - "+getd("."+@selection+"_collectionitem["+(.@j+1)+"]")+" ea.^000000";
				mes .@c$ + getd("."+@selection+"_collectionitem["+(.@j+1)+"]") + " " + mesitemlink(getd("."+@selection+"_collectionitem["+.@j+"]")) + ": " + "(" + .@a + "/"+getd("."+@selection+"_collectionitem["+(.@j+1)+"]") + ")^000000";
			}
			next;
			mes "[^FF7700Quest Manager^000000]";
			mes "Reward:";
			if (getd("." +@selection+"_collectionexp["+0+"]"))
				mes "^0000FF"+getd("." +@selection+"_collectionexp["+0+"]")+" Base EXP^000000";
			if (getd("." +@selection+"_collectionexp["+1+"]"))
				mes "^0000FF"+getd("." +@selection+"_collectionexp["+1+"]")+" Job EXP^000000";
			if (getd("." +@selection+"_collectionzeny"))
				mes "Zeny: ^0000FF"+getd("." +@selection+"_collectionzeny")+"^000000";
			if (getd("." +@selection+"_collectionprize[0]")) {
				for(.@i = 0; .@i < getarraysize(getd("." +@selection+"_collectionprize")); .@i++)
					mes getd("." +@selection+"_collectionamount") + " " + mesitemlink((getd("." +@selection+"_collectionprize["+.@i+"]")));
			}

			if (BaseLevel < getd("." +@selection+"_collectionmin") || BaseLevel > getd("." +@selection+"_collectionmax")) {
				next;
				soundeffect "menu.wav",0;
				mes "[^FF7700Quest Manager^000000]";
				mes "You don't have the required level to do this quest.";
			}
			else {
				if(select("- Deliver items", "- Return") == 1) {
					soundeffect "menu.wav",0;
					clear;
					set .@size, getarraysize(getd("."+@selection + "_collectionitem"));
					for( set .@k,0; .@k < .@size; set .@k,.@k+2) {
						if(countitem(getd("."+@selection+"_collectionitem["+.@k+"]"))>=getd("."+@selection+"_collectionitem["+(.@k+1)+"]")){
							set .@checkitem,.@checkitem+2;
						}
					}
					if(.@checkitem<.@size){
						mes "[^FF7700Quest Manager^000000]";
						mes "You don't have everything.";
						mes F_Rand("Did you forget the item at the storage?","Maybe try looking for other quests.","");
						break;
					}
					for( set .@delcount,0; .@delcount < .@size; set .@delcount,.@delcount+2){
						delitem getd("."+@selection+"_collectionitem["+.@delcount+"]"),getd("."+@selection+"_collectionitem["+(.@delcount+1)+"]");
					}
					mes "[^FF7700Quest Manager^000000]";
					mes "Well done!";
					mes "here is your rewards";
					if(getd("." +@selection+"_collectionprize[0]")) {
						for(.@i = 0; .@i < getarraysize(getd("." +@selection+"_collectionprize")); .@i++)
							getitem(getd("." +@selection+"_collectionprize["+.@i+"]"),getd("." +@selection+"_collectionamount"));
					}
					set Zeny,Zeny+getd("." +@selection+"_collectionzeny");
					getexp getd("." +@selection+"_collectionexp["+0+"]"),getd("." +@selection+"_collectionexp["+1+"]");
					setd(@selection + "_collection_delay"),gettimetick(2)+.quest_delay;
					setd(@selection + "_collection_repeat"),true;
					set @selection, "";
					close;
				}
				else {
					soundeffect "menu.wav",0;
					clear;
					mes "[^FF7700Quest Manager^000000]";
					mes F_Rand("Not to your liking?","Are you here just to look?","Let's find the right quest for you!");
				}
			}
			break;

		case 3:
			close;
		}
		if (rand(3) == 1)
			mes "How about some " + F_Rand("hunting","gathering","looting","adventure","helping hand") + " today?";
	}

OnInit:

	function AddCollect;
	function AddHunting;
	questinfo QTYPE_DAILYQUEST, QMARK_NONE, "countitem(40056)";

	//Activate/Deactivate quest categories (true/1 - activated, false/0 - deactivated)
	set .collection, true;
	set .hunting, true;

	//Quest Delay (seconds)
	//24 hours = 86400 seconds
	set .quest_delay, 86400;

	//Activate/Deactivate repeatable quests (true/1 - activated, false/0 - deactivated)
	set .quest_repeat, true;

	//Activate/Deactivate party support (true/1 - activated, false/0 - deactivated)
	set .party_support, true;

	//Max range for party support (+- x & y coordinations)
	set .party_range, 25;

	//Checks if quests are loaded (prevents out of index)
	if(.questsloaded==true) end;
	set .questsloaded, true;


	//Add Hunting Quests here (You can add as many required mobs as you want)
	//AddHunting("<Quest Name>",<Quest ID>,<Min Lvl>,<Max Lvl>,<Reward|Item ID>,<Reward|Item Amount>,<Zeny Reward>,<Base EXP>,<Job EXP>,<Monster ID>,<Monster Amount>,...);
	AddHunting("Prontera Field 01",120000,1,21,"40221|40222",1,0,2100,2100,1002,300,1007,300,1008,300);
	AddHunting("Prontera Field 02",120001,1,51,"40221|40222",1,0,27300,14700,1063,300,1113,300,1031,300);
	
	//Add Collection Quests here (You can add as many required items as you want)
	//AddCollect("<Quest Name>",<Min Lvl>,<Max Lvl>,<Reward|Item ID>,<Reward|Item Amount>,<Zeny Reward>,<Base EXP>,<Job EXP>,<Item ID>,<Item Amount>,...);
	AddCollect("Foliage Gathering",1,11,"40221",1,0,2100,2100,705,10,707,10,7100,10,706,1);
	AddCollect("Herb Gathering",1,21,"40222",1,0,2100,2100,507,8,508,8,509,8,510,8,511,8,621,3);
	AddCollect("Flower Gathering",1,31,"40221|40222",1,0,2100,2100,704,10,708,10,703,10,709,10);
	AddCollect("Vegetable Gathering",1,41,"40221|40222",1,0,2100,2100,515,10,516,10,535,10);
	AddCollect("Animal Gathering",1,51,"40221|40222",1,0,2100,2100,519,10,574,10,518,10);
	AddCollect("Forage Gathering",1,61,"40221|40222",2,0,2100,2100,1026,10,581,10,577,3);
	AddCollect("Fruit Gathering",1,71,"40221|40222",2,0,2100,2100,512,10,513,10,582,10,568,10,514,10);
	AddCollect("River Fishing",1,81,"40221|40222",1,0,2100,2100,567,3,964,3,579,3);
	AddCollect("Sea Fishing",30,91,"40221|40222",2,0,2100,2100,966,3,6049,3,6771,3,6773,3,6775,3);
	AddCollect("Rare Fruit Gathering",30,MAX_LEVEL,"40221|40222",3,0,2100,2100,578,10,11515,5,11516,5,6237,5,607,1);
	AddCollect("Rare Sea Fishing",50,MAX_LEVEL,"40221|40222",4,0,2100,2100,6770,1,6772,1,6774,1);

	end;


	function AddCollect{
		set .collectionquestcount,.collectionquestcount+1;
		setd ("." +.collectionquestcount+"_collectionname$", getarg(0));
		setd ("." +.collectionquestcount+"_collectionmin", getarg(1));
		setd ("." +.collectionquestcount+"_collectionmax", getarg(2));

		explode(getd(".@" +.collectionquestcount+"_collectionprize$"), getarg(3), "|");
		for(.@i = 0; .@i < getarraysize(getd(".@" +.collectionquestcount+"_collectionprize$")); .@i++)
			setd ("."+.collectionquestcount+"_collectionprize["+.@i+"]",getd(".@" +.collectionquestcount+"_collectionprize$["+.@i+"]"));
		setd ("." +.collectionquestcount+"_collectionamount", getarg(4));
		setd ("." +.collectionquestcount+"_collectionzeny", getarg(5));
		set .@argcount, 6;
		set .@size, getarraysize(getd("."+ .collectionquestcount + "_collectionexp"));
		setd ("." +.collectionquestcount+"_collectionexp["+.@size+"]",getarg(.@argcount)); 
		setd ("." +.collectionquestcount+"_collectionexp["+(.@size+1)+"]",getarg(.@argcount+1)); 
		set .@argcount, .@argcount+2;
		set .@size, getarraysize(getd("."+ .collectionquestcount + "_collectionitem"));
		while(getarg(.@argcount,-1)!=-1 && getarg(.@argcount+1,-1)!=-1){
			setd ("."+.collectionquestcount+"_collectionitem["+.@size+"]",getarg(.@argcount)); 
			setd ("."+.collectionquestcount+"_collectionitem["+(.@size+1)+"]",getarg(.@argcount+1));
			set .@argcount,.@argcount+2;
			set .@size, .@size+2;
		}
		return;
	}

	function AddHunting{
		set .huntingquestcount,.huntingquestcount+1;
		setd ("." +.huntingquestcount+"_huntingname$", getarg(0));
		setd ("." +.huntingquestcount+"_huntingid", getarg(1));
		setd ("." +.huntingquestcount+"_huntingmin", getarg(2));
		setd ("." +.huntingquestcount+"_huntingmax", getarg(3));
		
		explode(getd(".@" +.huntingquestcount+"_huntingprize$"), getarg(4), "|");
		for(.@i = 0; .@i < getarraysize(getd(".@" +.huntingquestcount+"_huntingprize$")); .@i++)
			setd ("."+.huntingquestcount+"_huntingprize["+.@i+"]",getd(".@" +.huntingquestcount+"_huntingprize$["+.@i+"]"));

		setd ("." +.huntingquestcount+"_huntingamount", getarg(5));
		setd ("." +.huntingquestcount+"_huntingzeny", getarg(6));
		set .@size, getarraysize(getd("."+ .huntingquestcount + "_huntingexp"));
		set .@argcount, 7;
		setd ("." +.huntingquestcount+"_huntingexp["+.@size+"]",getarg(.@argcount));
		setd ("." +.huntingquestcount+"_huntingexp["+(.@size+1)+"]",getarg(.@argcount+1)); 
		set .@argcount, .@argcount+2;
		set .@size, getarraysize(getd("."+ .huntingquestcount + "_huntingmob"));
		while(getarg(.@argcount,-1)!=-1 && getarg(.@argcount+1,-1)!=-1){
			setd ("."+.huntingquestcount+"_huntingmob["+.@size+"]",getarg(.@argcount)); 
			setd ("."+.huntingquestcount+"_huntingmob["+(.@size+1)+"]",getarg(.@argcount+1));
			set .@argcount, .@argcount+2;
			set .@size, .@size+2;
		}
		return;
	}

havetaken:
	clear;
	soundeffect "menu.wav",0;
	mes "[^FF7700Quest Manager^000000]";
	mes "Sorry, but you already have this quest.";
	close;
	
nottaken:
	clear;
	soundeffect "menu.wav",0;
	mes "[^FF7700Quest Manager^000000]";
	mes "It's look like you have not take the quest";
	close;
}

 

Find these lines to see the examples:

AddHunting("Prontera Field 01",11340,1,21,"40221|40222",1,0,2100,2100,1002,300,1007,300,1008,300);
AddCollect("Foliage Gathering",1,11,"40221",1,0,2100,2100,705,10,707,10,7100,10,706,1);	

 

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