Jump to content
  • 0

request script


sweetmole

Question


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  26
  • Reputation:   3
  • Joined:  02/25/13
  • Last Seen:  

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 

Link to comment
Share on other sites

20 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  159
  • Reputation:   58
  • Joined:  07/11/14
  • Last Seen:  

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
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

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

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

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
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  159
  • Reputation:   58
  • Joined:  07/11/14
  • Last Seen:  

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
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

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

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

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.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  26
  • Reputation:   3
  • Joined:  02/25/13
  • Last Seen:  

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

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  159
  • Reputation:   58
  • Joined:  07/11/14
  • Last Seen:  

@sweetmole

Sorry, I just realized... the way I did this is random, I tried to do the same for 5 but it did not work very well, i can do it for 5 mobs but it will be fixed and not random, can it be? 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  26
  • Reputation:   3
  • Joined:  02/25/13
  • Last Seen:  

sure @Hyroshima thanks a lot my friend. ang btw im looking also for a item requirements. 

give items to npc before doing killing monster. if it is hard just stick with the killing function :D

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  159
  • Reputation:   58
  • Joined:  07/11/14
  • Last Seen:  

@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
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

@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
Link to comment
Share on other sites

  • 0

  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

@AnnieRuru I believe that the player can't finish the quest if the owner raise .questsize value ;)

Edited by Capuche
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

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
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  26
  • Reputation:   3
  • Joined:  02/25/13
  • Last Seen:  

hello masters,

 

Can possible add a item requirements before killing monster?? :D

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  26
  • Reputation:   3
  • Joined:  02/25/13
  • Last Seen:  

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

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  159
  • Reputation:   58
  • Joined:  07/11/14
  • Last Seen:  

@AnnieRuru

hoho, I have to stop using alt + c & alt + v kk.

I work on a very complete quest script and I think the excess complexity is leaving me with the lack of attention kk

 

@sweetmole

wait for him to answer his code is impeccél! rsrs

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

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
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  26
  • Reputation:   3
  • Joined:  02/25/13
  • Last Seen:  

@AnnieRuru thanks a lot. there is a certain item requirements like 20 different items...

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  26
  • Reputation:   3
  • Joined:  02/25/13
  • Last Seen:  

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

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

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