Jump to content
  • 0

Changing autoloot to work only 1% or above


Question

6 answers to this question

Recommended Posts

  • 0
Posted
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.

  • 0
Posted

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.

  • 0
Posted

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

 

  • 0
Posted

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

 

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