Jump to content
  • 0

Mob kill reward in certain maps


Question

Posted (edited)

As title says, can someone make a script where it gives random items to players who kills monster only in a certain map like prt_fild08 with a chance of 20%. sample items 607 608 609 610. Thanks

 

 

EDIT:

I ended up making it myself, how is this? Not tested because im currently not home.

-	script	test	-1,{
OnNPCKillEvent:
	getmapxy (.@map$, .@x, .@y, 0);
	set .@t_maps$[0],"prt_fild08","prt_fild09";
	set .@t_reward$[0],607,608;
	  for (set .@a, 0; .@a < getarraysize(.@t_maps$); set .@a, .@a + 1) {
		if( .@map$ == .@t_maps$[.@a]) {
		   getitem getarraysize(.@t_reward$),1;
		   end;
		}
	  }
}
Edited by MrVandalBus

2 answers to this question

Recommended Posts

Posted

change this line

getitem getarraysize(.@t_reward$),1;

to

getitem .@t_reward$[rand(getarraysize(.@t_reward$)],1;

 

remove this line

getmapxy (.@map$, .@x, .@y, 0);

 

then change 

if( .@map$ == .@t_maps$[.@a])

to

if(strcharinfo(3) == .@t_maps$[.@a] && rand(5) < 2)

to add 20% chance only

 

Kindly test it too xD

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