Jump to content

Question

Posted

hi everyone 

can i request a simple script like this

an npc that gives u a quest to kill 5 different mobs with 1000 qty. item requirements. once done the npc will set @aura to a player 

20 answers to this question

Recommended Posts

  • 0
Posted
6 hours ago, sweetmole said:

hi everyone 

can i request a simple script like this

an npc that gives u a quest to kill 5 different mobs with 1000 qty. item requirements. once done the npc will set @aura to a player 

Hi...

prontera,152,166,5	script	Quest KMob	4_M_02,{
		
	if(QP_Act)
	{
		if(QT_MobKill < .mob_qt[QP_Val])
		{ mes "You have not completed the mission!","Kill: ["+QT_MobKill+"/"+.mob_qt[QP_Val]+"] "+strmobinfo(1,.mob_id[QP_Val])+""; close; }

		mes "Congratulations, you completed the quest!";
		atcommand "@aura 2";
		set QP_Act,0;
		set QT_MobKill,0;
		close;
	}

	mes "Hello, will I now ask you to kill some monsters for me ok?";
	if(select("Ok:I do not want...")==2){ close; }
	
	next;	
	
	set QP_Val,rand(1,getarraysize(.mob_id))-1;	//Get a random mob_id
	set QP_Act,1;
	
	mes "Okay, go and kill "+.mob_qt[QP_Val]+"x "+strmobinfo(1,.mob_id[QP_Val])+" !";
	close;
	
OnNPCKillEvent:

	if(QP_Act && killedrid == .mob_id[QP_Val]){ set QT_MobKill,QT_MobKill+1; }
	end;
	
OnInit:
	setarray .mob_id[0],1031,1002,1166,1784;	//Mob ID, limited (0,126) mobs_ids
	setarray .mob_qt[0],   1,   2,   3,   5;	//Qty kills, limited (0,126) mobs_qty
end;
}

 

  • MVP 1
  • 0
Posted
if(QP_Act && killedrid == .mob_id[QP_Val])

I'm sure this condition is wrong

if you use Comparisons conditions ( || == &&), it only return true(1) or false(0)

since you want to make the condition to be true that is in the .mob_id array, you have to loop it

  • 0
Posted (edited)
6 minutes ago, AnnieRuru said:

if(QP_Act && killedrid == .mob_id[QP_Val])

I'm sure this condition is wrong

if you use Comparisons conditions ( || == &&), it only return true(1) or false(0)

since you want to make the condition to be true that is in the .mob_id array, you have to loop it

It looks like in his example the NPC assigns one monster to kill at random from the list. Instead of looping through it which is what OP asked... In other words, @AnnieRuru, u right.

Also it's good to see you more active again and junk.

Edited by Skorm
  • Love 1
  • 0
Posted
29 minutes ago, AnnieRuru said:

if(QP_Act && killedrid == .mob_id[QP_Val])

I'm sure this condition is wrong

if you use Comparisons conditions ( || == &&), it only return true(1) or false(0)

since you want to make the condition to be true that is in the .mob_id array, you have to loop it

but the question is this, if QP_Act equals 0, so stop, and if 1 then it checks killedrid == .mob_id [QP_Val]

or should it be:

if(QP_Act)
{
	if(killedrid == .mob_id[QP_Val])
}

?

  • Like 1
  • 0
Posted

hmm ... perhaps I misunderstood your script ....

 

*test in my test server*

oops ~

you are right

 

ah ~ even I can make mistakes sometimes /oops

 

you directly set the condition into the array itself, and thus doesn't need to loop it

give you 2 reps ~

 

damn it ... now I recalled I used this trick before on my soul linker script ... how come I've forgotten

  • 0
Posted

My interpretation of OP's request is that you can kill any of the 5 monsters and it will count. Not just a single monster at a time which is what this script does. Also OP wanted item requirements.

  • 0
Posted

thank you everyone for giving time on this matter. 

 

On 4/9/2018 at 10:17 PM, Hyroshima said:

Hi...


prontera,152,166,5	script	Quest KMob	4_M_02,{
		
	if(QP_Act)
	{
		if(QT_MobKill < .mob_qt[QP_Val])
		{ mes "You have not completed the mission!","Kill: ["+QT_MobKill+"/"+.mob_qt[QP_Val]+"] "+strmobinfo(1,.mob_id[QP_Val])+""; close; }

		mes "Congratulations, you completed the quest!";
		atcommand "@aura 2";
		set QP_Act,0;
		set QT_MobKill,0;
		close;
	}

	mes "Hello, will I now ask you to kill some monsters for me ok?";
	if(select("Ok:I do not want...")==2){ close; }
	
	next;	
	
	set QP_Val,rand(1,getarraysize(.mob_id))-1;	//Get a random mob_id
	set QP_Act,1;
	
	mes "Okay, go and kill "+.mob_qt[QP_Val]+"x "+strmobinfo(1,.mob_id[QP_Val])+" !";
	close;
	
OnNPCKillEvent:

	if(QP_Act && killedrid == .mob_id[QP_Val]){ set QT_MobKill,QT_MobKill+1; }
	end;
	
OnInit:
	setarray .mob_id[0],1031,1002,1166,1784;	//Mob ID, limited (0,126) mobs_ids
	setarray .mob_qt[0],   1,   2,   3,   5;	//Qty kills, limited (0,126) mobs_qty
end;
}

the script working perfectly, but sir this npc let me to kill only savage mob. i want it to be 4 different mos

 

  • 0
Posted

@sweetmole

rdy:

prontera,152,166,5	script	Quest KMob	4_M_02,{

	if(mob_qt1)
	{
		if(QT_MobKill1 < mob_qt1 || QT_MobKill2 < mob_qt2 || QT_MobKill3 < mob_qt3 || QT_MobKill4 < mob_qt4 || QT_MobKill5 < mob_qt5)
		{
			mes "You have not completed the mission!";
			mes "Kill: ["+QT_MobKill1+"/"+mob_qt1+"] "+strmobinfo(1,mob_id1)+"";
			if(mob_qt2) mes "Kill: ["+QT_MobKill2+"/"+mob_qt2+"] "+strmobinfo(1,mob_id2)+"";
			if(mob_qt3) mes "Kill: ["+QT_MobKill3+"/"+mob_qt3+"] "+strmobinfo(1,mob_id3)+"";
			if(mob_qt4) mes "Kill: ["+QT_MobKill4+"/"+mob_qt4+"] "+strmobinfo(1,mob_id4)+"";
			if(mob_qt5) mes "Kill: ["+QT_MobKill5+"/"+mob_qt5+"] "+strmobinfo(1,mob_id5)+"";
			close;
		}

			mes "Congratulations, you completed the quest!";
			atcommand "@aura 2";
			set mob_id1,0;
			set mob_qt1,0;
			set mob_id2,0;
			set mob_qt2,0;
			set mob_id3,0;
			set mob_qt3,0;
			set mob_id4,0;
			set mob_qt4,0;
			set mob_id5,0;
			set mob_qt5,0;
			close;
	}

	mes "Hello, will I now ask you to kill some monsters for me ok?";
	if(select("Ok:I do not want...")==2){ close; }
	
	next;	
	
	set mob_id1,1031;	//mob_id
	set mob_qt1,50;		//Qty
	set mob_id2,1002;	//mob_id
	set mob_qt2,150;	//Qty
	set mob_id3,1166;	//mob_id
	set mob_qt3,200;	//Qty
	set mob_id4,1784;	//mob_id
	set mob_qt4,250;	//Qty
	set mob_id5,1095;	//mob_id
	set mob_qt5,300;	//Qty
	
	mes "Okay, go and kill:",
	""+mob_qt1+"x "+strmobinfo(1,mob_id1)+"",
	""+mob_qt2+"x "+strmobinfo(1,mob_id2)+"",
	""+mob_qt3+"x "+strmobinfo(1,mob_id3)+"",
	""+mob_qt4+"x "+strmobinfo(1,mob_id4)+"",
	""+mob_qt5+"x "+strmobinfo(1,mob_id5)+"";
	close;
	
OnNPCKillEvent:

	if(killedrid == mob_id1){ set QT_MobKill1,QT_MobKill1+1; dispbottom "["+QT_MobKill1+"/"+mob_qt1+"] "+strmobinfo(1,mob_qt1)+""; }
	if(killedrid == mob_id2){ set QT_MobKill2,QT_MobKill2+1; dispbottom "["+QT_MobKill2+"/"+mob_qt2+"] "+strmobinfo(1,mob_qt2)+""; }
	if(killedrid == mob_id3){ set QT_MobKill3,QT_MobKill3+1; dispbottom "["+QT_MobKill3+"/"+mob_qt3+"] "+strmobinfo(1,mob_qt3)+""; }
	if(killedrid == mob_id4){ set QT_MobKill4,QT_MobKill4+1; dispbottom "["+QT_MobKill4+"/"+mob_qt4+"] "+strmobinfo(1,mob_qt4)+""; }
	if(killedrid == mob_id5){ set QT_MobKill5,QT_MobKill5+1; dispbottom "["+QT_MobKill5+"/"+mob_qt5+"] "+strmobinfo(1,mob_qt5)+""; }
end;
}

 

  • Love 1
  • 0
Posted

@Hyroshima

after I review your script, reminds me of my mission board script, I'm so glad I made that script XD

I think your script has a bug, after the player completed the objective and receive the @aura, they can do the quest again :ani_swt3:

also also

OnNPCKillEvent:

    if(killedrid == mob_id1){ set QT_MobKill1,QT_MobKill1+1; dispbottom "["+QT_MobKill1+"/"+mob_qt1+"] "+strmobinfo(1,mob_qt1)+""; }
    if(killedrid == mob_id2){ set QT_MobKill2,QT_MobKill2+1; dispbottom "["+QT_MobKill2+"/"+mob_qt2+"] "+strmobinfo(1,mob_qt2)+""; }
    if(killedrid == mob_id3){ set QT_MobKill3,QT_MobKill3+1; dispbottom "["+QT_MobKill3+"/"+mob_qt3+"] "+strmobinfo(1,mob_qt3)+""; }
    if(killedrid == mob_id4){ set QT_MobKill4,QT_MobKill4+1; dispbottom "["+QT_MobKill4+"/"+mob_qt4+"] "+strmobinfo(1,mob_qt4)+""; }
    if(killedrid == mob_id5){ set QT_MobKill5,QT_MobKill5+1; dispbottom "["+QT_MobKill5+"/"+mob_qt5+"] "+strmobinfo(1,mob_qt5)+""; }

I believe that part should be mob_id1-5 ?

 

erm ... I believe I make simple script complicated again XD

http://upaste.me/b10549617c6f2d960

  • Love 1
  • 0
Posted (edited)

yeah, isn't that's the reason I've also put "I give up ... its too hard" option in the script if the server owner mess up the script ?

 

I saw a typo in the script ... hmm ... maybe that's the one you refer to ?

aura_quest$ += "0#0#0#0#0";

change to for-loop

Edited by AnnieRuru
  • 0
Posted

I just modify existing paste then

http://upaste.me/b10549617c6f2d960

curious ... do you want to randomize the item requirement too ?

 

I don't really understand what you say

16 hours ago, sweetmole said:

and also cannot be loop. npc will say " you already have aura or something like that " thanks

I just do it with different aura then

  • Love 1
  • Like 1
  • 0
Posted

@AnnieRuru hi annie i tried the script. working perfectly. thank you for that!!

one last request please??

when the player finished the quest. it doesnt need to pick one of those aura options. should be @aura 1 only

 

after the quest is done, this npc will ask you to quest again if they want to change their auras to @aura 2 

same thing. kill mobs and item requirements..

 

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...