Jump to content
  • 0

Killing MOB A, everyone in the map gets item


Question

Posted (edited)

Hi guys,

Sorry to bother again, but I've some idea that I would like to share if someone knows how to create this script.

How do we create a script like this?
If MOB A was killed by any player in Prontera, everyone in the map will be rewarded these item direct into their inventory.

-20% chance they will get 1 apple
-15% chance they will get 2 jellopy
-10% chance they will get 3 oridecon

Basically, my idea is something like when we spawn a mob in a map and if it's was killed everyone will get few item from the mob with some percentage on each item.

Thanks ^_^

Edited by cmsm94
  • Upvote 1

1 answer to this question

Recommended Posts

  • 0
Posted
-	script	sample	-1,{
	
	OnInit:
		.map$ = "prontera";
		monster .map$,0,0,"--ja--",1002,1, strnpcinfo(3)+"::OnKill";
		end;
		
	OnKill:
		addrid(5, 0, .map$);
		.@rate = rand(100);
		if (.@rate < 20) { // 20%
			getitem 512, 1;
		}
		else if (.@rate < 35) { // 15%
			getitem 909, 2;
		}
		else if (.@rate < 45) { // 10%
			getitem 985, 3;
		}
		end;
}

 

  • Upvote 1

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