Jump to content
  • 0

multiple mob with this script is possible


Giant Whisper

Question


  • Group:  Members
  • Topic Count:  55
  • Topics Per Day:  0.01
  • Content Count:  190
  • Reputation:   3
  • Joined:  04/11/12
  • Last Seen:  

it is possible to adapt this script to be a multiple mobs hunter

example: kill 10 poring, 5 lunatic, 3 desert wolf

//======Name========================================
// Daily Monster Hunt
//======Version=====================================
// 1.2
//======Author(s)===================================
// Sandbox
//======Comments====================================
// This NPC allows your player to hunt a random amount
// of a random monster
// *randomception!*
// If the player successfully hunts the monster
// he'll receive a reward!
//======Credits=====================================
// KeyWorld, nanakiwurtz, NeoMind, Kido
// Thanks for helping me out guize!
// Modified by Luciar for Yonko
//================================================== 
 
prontera,132,168,3	script	Branch Hunt Challenge	78,{

mes .Npc_Name$;
	if(Hunter) {
	mes "You have killed ^880000"+HuntCount+"^000000/^0000FF"+Amt
 
+"^000000 "+getmonsterinfo(Hunt,0)+"s, keep it up!";
	close;
	}
	if(gettimetick(2) < HuntDelay) {
		mes "You can only do this quest once every 4 hours!";
		mes "You have "+(((HuntDelay) - (gettimetick(2)))/60)+" minutes left until the next quest.";
		close;
	}
mes "Hello "+strcharinfo(0)+", do you want to take on the Branch Hunting Challenge?","If you manage to kill them, you'll receive a reward!"," "+.RewAmt+" x ^880000"+DispLink(.Reward)+"^000000";
if (.c_RewAmt > 0) {
mes "and a bonus of up to "+.c_RewAmt+" ^880000"+DispLink(.c_Reward)+"^000000 for every challenge."; 
} else if (.z_RewAmt > 0) { 
mes "and a bonus of up to "+callfunc( "F_InsertComma",.z_RewAmt)+"z."; 
} else {
mes "for every challenge."; 
}
next;
mes .Npc_Name$;
mes "Do not forget to loot all the monster drops, they are part of the ^880000Dead Branch Quest^000000.";
if(select("Bring it on!:How about no?")==2) {
	next;
	mes .Npc_Name$;
	mes "Fine!";
	close;
}
 
next;
mes .Npc_Name$;
	Hunt = .Mob_List[rand(getarraysize(.Mob_List))];
	Amt = rand (50,100); //Amount of mob to hunt
	atcommand "@alootid -7201";
	atcommand "@alootid -7189";
	atcommand "@alootid -1019";
	atcommand "@alootid -7222";
	
	atcommand "@alootid +7201";
	atcommand "@alootid +7189";
	atcommand "@alootid +1019";
	atcommand "@alootid +7222";
	Hunter++;
 
mes "You have to hunt ^0000FF"+Amt+" "+getmonsterinfo(Hunt,0)+"^000000!";
next;
mes .Npc_Name$;
mes "Go go go!";
close2;
HuntDelay = gettimetick(2)+1; //every 1 sec.
end;

 
//----------Config----------
 
OnInit:
	.Npc_Name$ = "[^0000FF Daily Hunt ^000000]";
	setarray .Mob_List[0],1497,1495,1880,1400,1151,1010,1277,1269,1503; //Mobs to hunt
	.Reward = 12103; //Reward ID
	.RewAmt = 10; //Reward Amount
	.c_Reward = 50000; //Reward ID
	.c_RewAmt = 0; //Reward Amount
	.z_RewAmt = 1000000; //Zeny Reward
	end;

OnNPCKillEvent:
	sleep2 200;
	if(Hunter > 0) {
		if(killedrid == Hunt) {
			HuntCount++;
			dispbottom "You have killed "+HuntCount+"/"+Amt+" "+getmonsterinfo(Hunt,0)+"s, keep it up!";
			if (rand(1,100) > rand(1,100)) {
			getitem 7850,1;
			}
			if(HuntCount >= Amt) {
				dispbottom strnpcinfo(1)+": Congratulations! You did it!";
				dispbottom strnpcinfo(1)+": "+getitemname(.Reward)+" x "+.RewAmt+"!";
				getitem .Reward,.RewAmt;
				if (.c_RewAmt > 0) {
				getitem .c_Reward,rand(1,.c_RewAmt); // Edit to the reward that you would be giving
				dispbottom strnpcinfo(1)+": "+getitemname(.c_Reward)+" x "+.c_RewAmt+"!";
				} 
				if (.z_RewAmt > 0) {
				Zeny = Zeny + .z_RewAmt; // Edit to the zeny that you would be giving
				dispbottom strnpcinfo(1)+": "+callfunc( "F_InsertComma",.z_RewAmt)+"z!";
				} 

				Hunt = 0;
				Hunter = 0;
				HuntCount = 0;
				Amt = 0;
			}
		}
	}
end;
}
Edited by Giant Whisper
Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

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

prontera,132,168,3	script	Branch Hunt Challenge	78,{

	mes .Npc_Name$;
	if (Hunter) {
		for (.@i = 0; .@i < 3; .@i++)
			mes "You have killed ^880000"+HuntCount[.@i]+"^000000/^0000FF"+Amt[.@i]+"^000000 "+getmonsterinfo(Hunt[.@i],0)+"s, keep it up!";
		close;
	}
	if(gettimetick(2) < HuntDelay) {
		mes "You can only do this quest once every 4 hours!";
		mes "You have "+(((HuntDelay) - (gettimetick(2)))/60)+" minutes left until the next quest.";
		close;
	}
	mes "Hello "+strcharinfo(0)+", do you want to take on the Branch Hunting Challenge?","If you manage to kill them, you'll receive a reward!"," "+.RewAmt+" x ^880000"+DispLink(.Reward)+"^000000";
	if (.c_RewAmt > 0) {
		mes "and a bonus of up to "+.c_RewAmt+" ^880000"+DispLink(.c_Reward)+"^000000 for every challenge."; 
	} else if (.z_RewAmt > 0) { 
		mes "and a bonus of up to "+callfunc( "F_InsertComma",.z_RewAmt)+"z."; 
	} else {
		mes "for every challenge."; 
	}
	next;
	mes .Npc_Name$;
	mes "Do not forget to loot all the monster drops, they are part of the ^880000Dead Branch Quest^000000.";
	if(select("Bring it on!:How about no?")==2) {
		next;
		mes .Npc_Name$;
		mes "Fine!";
		close;
	}
	 
	next;
	mes .Npc_Name$;
	.@size = getarraysize(.Mob_List);
	deletearray Hunt;
	deletearray HuntCount;
	deletearray Amt;
	for (.@i = 0; .@i < 3; .@i++) {
		do {
			.@mob = .Mob_List[rand(.@size)];
		} while (inarray(Hunt, .@mob) != -1);
		Hunt[.@i] = .@mob;
		Amt[.@i] = rand (50,100); //Amount of mob to hunt
		
		mes "You have to hunt ^0000FF"+Amt[.@i]+" "+getmonsterinfo(Hunt[.@i],0)+"^000000!";
	}
	atcommand "@alootid -7201";
	atcommand "@alootid -7189";
	atcommand "@alootid -1019";
	atcommand "@alootid -7222";

	atcommand "@alootid +7201";
	atcommand "@alootid +7189";
	atcommand "@alootid +1019";
	atcommand "@alootid +7222";
	Hunter++;
	 
	next;
	mes .Npc_Name$;
	mes "Go go go!";
	close2;
	HuntDelay = gettimetick(2)+1; //every 1 sec.
	end;

 
//----------Config----------
 
OnInit:
	.Npc_Name$ = "[^0000FF Daily Hunt ^000000]";
	setarray .Mob_List[0],1497,1495,1880,1400,1151,1010,1277,1269,1503; //Mobs to hunt
	.Reward = 12103; //Reward ID
	.RewAmt = 10; //Reward Amount
	.c_Reward = 50000; //Reward ID
	.c_RewAmt = 0; //Reward Amount
	.z_RewAmt = 1000000; //Zeny Reward
	end;

OnNPCKillEvent:
	sleep2 200;
	if(Hunter > 0) {
		.@index = inarray(Hunt, killedrid);
		if(.@index != -1) {
			HuntCount[.@index]++;
			dispbottom "You have killed "+HuntCount[.@index]+"/"+Amt[.@index]+" "+getmonsterinfo(Hunt[.@index],0)+"s, keep it up!";
			if (rand(1,100) > rand(1,100)) {
				getitem 7850,1;
			}
			for (.@i = 0; .@i < 3; .@i++) {
				if(HuntCount[.@i] >= Amt[.@i])
					.@completed++;
			}
			if(.@completed >= 3) {
				dispbottom strnpcinfo(1)+": Congratulations! You did it!";
				dispbottom strnpcinfo(1)+": "+getitemname(.Reward)+" x "+.RewAmt+"!";
				getitem .Reward,.RewAmt;
				if (.c_RewAmt > 0) {
					getitem .c_Reward,rand(1,.c_RewAmt); // Edit to the reward that you would be giving
					dispbottom strnpcinfo(1)+": "+getitemname(.c_Reward)+" x "+.c_RewAmt+"!";
				} 
				if (.z_RewAmt > 0) {
					Zeny = Zeny + .z_RewAmt; // Edit to the zeny that you would be giving
					dispbottom strnpcinfo(1)+": "+callfunc( "F_InsertComma",.z_RewAmt)+"z!";
				} 
				Hunter = 0;
				deletearray Hunt;
				deletearray HuntCount;
				deletearray Amt;
			}
		}
	}
end;
}

this should give you 3 random monster to hunt per quests.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  55
  • Topics Per Day:  0.01
  • Content Count:  190
  • Reputation:   3
  • Joined:  04/11/12
  • Last Seen:  

Hello Emistry, thank you very much for your help. I get error line 14 parse_line: expected ';'

* 14 : month "Hello "+strcharinfo(0)+", do you want to take on the Branch Hunting Challenge?","If you manage to kill them, you'll receive a reward!"," "+.RewAmt+ " x ^880000"+DispLink'('.Reward)+"^000000";

Link to comment
Share on other sites

  • 0

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

On 12/1/2022 at 6:18 PM, Giant Whisper said:

Hello Emistry, thank you very much for your help. I get error line 14 parse_line: expected ';'

* 14 : month "Hello "+strcharinfo(0)+", do you want to take on the Branch Hunting Challenge?","If you manage to kill them, you'll receive a reward!"," "+.RewAmt+ " x ^880000"+DispLink'('.Reward)+"^000000";

Hi. Add this function above the NPC:

function	script	DispLink	{
	.@id = getarg(0);
	.@showslot = getarg(1,0);
	.@slot = getitemslots(.@id);
	return "<ITEM>"+(.@slot&&.@showslot?getitemname(.@id)+" ["+.@slot+"]":getitemname(.@id))+"<INFO>"+.@id+"</INFO></ITEM>";
}

 

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