Jump to content
  • 0

Equal Item Drop Chance for each member in a party


Vinisk

Question


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  5
  • Reputation:   0
  • Joined:  04/21/20
  • Last Seen:  

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!

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

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;
}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  8
  • Reputation:   0
  • Joined:  05/18/20
  • Last Seen:  

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

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