Jump to content
  • 0
WhiteEagle

Changing autoloot to work only 1% or above

Question

Can someone please set this up so that autoloot only works on items from 100% to 1% and everything below 1% is dropped?

Many thanks in advance

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0
Quote

 

@autoloot {<%>}

Enables or disables autolooting items from killed mobs.
If a percentage is given, only items dropped at that rate and below will be autolooted.

 

 

If you want to force players to cap % > Use bindatcommand to trigger autoloot again and don't allow player to use normal autoloot.

Link to comment
Share on other sites

  • 0

No that's not what I want.
Autoloot works atm like: @autoloot 1% and all items are automatically lootet with a drop chance 1% or below. 
I want a change that @autoloot 1% loot all items with a drop chance 1% and ABOVE. All items less then 1% drop change are droped.

Link to comment
Share on other sites

  • 0

Change this 

 

From

&& (drop_rate <= sd->state.autoloot || pc_isautolooting(sd, ditem->item_data.nameid))

 To

&& (drop_rate >= sd->state.autoloot || pc_isautolooting(sd, ditem->item_data.nameid))

 

Link to comment
Share on other sites

  • 0

@Patskie Thanks
I now have the problem that you can make @autoloot 0.5 etc. and have less than 1% drop chance, how can I change this?
I tried to set rate = 0 to 100, but then I don't get autoloot turned off because I can't set autoloot 0 or off.

 

ACMD_FUNC(autoloot)
{
	int rate;
	nullpo_retr(-1, sd);
	// autoloot command without value
	if(!message || !*message)
	{
		if (sd->state.autoloot)
			rate = 0;
		else
			rate = 10000;
	} else {
		double drate;
		drate = atof(message);
		rate = (int)(drate*100);
	}
	if (rate < 0) rate = 0;
	if (rate > 10000) rate = 10000;

	sd->state.autoloot = rate;
	if (sd->state.autoloot) {
		snprintf(atcmd_output, sizeof atcmd_output, msg_txt(sd,1187),((double)sd->state.autoloot)/100.); // Autolooting items with drop rates of %0.02f%% and below.
		clif_displaymessage(fd, atcmd_output);
	}else
		clif_displaymessage(fd, msg_txt(sd,1188)); // Autoloot is now off.

	return 0;
}

 

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

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.