Jump to content
  • 0

Equal Item Drop Chance for each member in a party


Question

Posted

Hi guys, so I'm looking for a script where each member in a party will have equal chance to get the items from a monster. For example, if a spore has a chance to drop strawberry by 60% and being killed by a member in the party, other members in the party will have 60% chance to get the same item.  I have looked into this script, but it only drops specific items (Ygg and OCA). So, to convert it to all the items for each monster, do I need to specify the items and the monsters one by one, or is there an easier way to do it? Thank you!

 

2 answers to this question

Recommended Posts

  • 0
Posted

Not tested

-	script	Sample	-1,{
	OnNPCKillEvent:
		if (!getcharid(1)) end;
		
		getmobdrops(killedrid);
		.@mc = $@MobDrop_count;
		copyarray .@mi, $@MobDrop_item, .@mc;
		copyarray .@mr, $@MobDrop_rate, .@mc;
		.@random = rand(10000);
		for (.@i = 0; .@i < .@mc; .@i++) {
			if (.@random < .@mr[.@i])
				.@items[getarraysize(.@items)] = .@mi[.@i];
		}
		
		.@d = getarraysize(.@items);
		
		if (.@d) {
			getmapxy(.@map$, .@x, .@y, BL_PC);
			getpartymember getcharid(1), 1;
			getpartymember getcharid(1), 2;
			.@cnt = $@partymembercount;
			
			for (.@i = 0; .@i < .@cnt; .@i++) {
				if (isloggedin($@partymemberaid[.@i], $@partymembercid[.@i])) {
					if (attachrid($@partymemberaid[.@i])) {
						getmapxy(@map$, @x, @y, BL_PC);
						if (@map$ == .@map$ && distance(.@x, .@y, @x, @y) < 15) {
							for (.@j = 0; .@j < .@d; .@j++)
								getitem .@items[.@j], 1;
						}
					}
				}
			}
		}
		end;
}

 

  • 0
Posted
On 7/3/2020 at 11:04 PM, Patskie said:

Not tested


-	script	Sample	-1,{
	OnNPCKillEvent:
		if (!getcharid(1)) end;
		
		getmobdrops(killedrid);
		.@mc = $@MobDrop_count;
		copyarray .@mi, $@MobDrop_item, .@mc;
		copyarray .@mr, $@MobDrop_rate, .@mc;
		.@random = rand(10000);
		for (.@i = 0; .@i < .@mc; .@i++) {
			if (.@random < .@mr[.@i])
				.@items[getarraysize(.@items)] = .@mi[.@i];
		}
		
		.@d = getarraysize(.@items);
		
		if (.@d) {
			getmapxy(.@map$, .@x, .@y, BL_PC);
			getpartymember getcharid(1), 1;
			getpartymember getcharid(1), 2;
			.@cnt = $@partymembercount;
			
			for (.@i = 0; .@i < .@cnt; .@i++) {
				if (isloggedin($@partymemberaid[.@i], $@partymembercid[.@i])) {
					if (attachrid($@partymemberaid[.@i])) {
						getmapxy(@map$, @x, @y, BL_PC);
						if (@map$ == .@map$ && distance(.@x, .@y, @x, @y) < 15) {
							for (.@j = 0; .@j < .@d; .@j++)
								getitem .@items[.@j], 1;
						}
					}
				}
			}
		}
		end;
}

 

its working ... but when you use @autoloot you got 2 items ... 

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