Jump to content

Question

Posted

Hello maxcheaters.

Got a question: Is it possible to make items like Blue Eva or Golden Dragon etc etc to be dropped at all players in the party, if its random, for example if 3 members in the party and the blue eva are 3 then everyone will get from 1 and not someone will get all the 3?

Thx in advance!

2 answers to this question

Recommended Posts

  • 0
Posted

write a script...

... or split them in more categories with every cat having 100% drop chance. this way no one will get all of them but its possible for someone to get more than one, or nothing...

  • 0
Posted (edited)

You just have to calculate item count / players.

 

If you are using acis :

Take a look in method distributeItem in Party.java and then check distributeAdena method.

 

public void distributeAdena(Player player, int adena, Creature target)
{
	 // We will hold here the players that will be rewarded
	List<Player> toReward = new ArrayList<>(_members.size());
	
	// We are looping each player in the party
	for (Player member : _members) 
	{
		// Checking the maximum range that allowed and the player's adena 
		if (!MathUtil.checkIfInRange(Config.PARTY_RANGE, target, member, true) || member.getAdena() == Integer.MAX_VALUE)
			continue;
		
		// Pass the check so will be rewarded.
		toReward.add(member);
	}
	
	// After all playes checked we got them in the list
	// Avoid divisions by 0. so checking for atleast 1 member
	if (toReward.isEmpty())
		return;
	
	//lets say we got 4 people that must be rewarded
	
	// Calculation for drop  in example of 1kk adena's. 1kk / 4 = 250k
	final int count = adena / toReward.size(); //250k
	
	// Adding 250k for each player
	for (Player member : toReward)
		member.addAdena("Party", count, player, true);
}

 

You can actually c/p that and create your own method. just change this

member.getAdena() == Integer.MAX_VALUE

and this

member.addAdena("Party", count, player, true);

with the proper methods.

 

How and where you have to put your new custom method?

 

Party.java method distributeItem.

 

if (item.getId() == 57)
{
	distributeAdena(player, item.getValue(), target);
	return;
}

add your own after that something like

 

if (item.getId() == XX)
{
	distributeCustomItem(player, item.getValue(), target);
	return;
}

 

Edited by melron
  • 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.
Note: Your post will require moderator approval before it will be visible.

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

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock