Jump to content

Recommended Posts

I don't really see why you have to add the property.

in_process 

Since you turn it back to false in the same execution context/if block. Thanks btw!

Edited by Valiente

Share this post


Link to post
Share on other sites

I don't really see why you have to add the property.

in_process 

Since you turn it back to false in the same execution context/if block. Thanks btw!

int pc_takeitem_pre(struct map_session_data **sd_, struct flooritem_data **fitem_)
{
	struct area_p_data *data;
	struct map_session_data *sd = *sd_;
	struct flooritem_data *fitem = *fitem_;
	data = adb_search(sd);
	if (data->arealoot && data->in_process==false) {
		data->in_process = true;
		map->foreachinrange(skill->greed, &fitem->bl, arealoot_range, BL_ITEM, &sd->bl);
		hookStop();
		data->in_process = false;
		return 1;
	}
	return 1;
}

in_process is used in pc_takeitem preHook,

if you see in_process is set to true and it invokes skill->greed, skill->greed also invokes pc_takeitem, which would make it into possibility of infinite loop.

so to prevent this, I set in_process to true, so that the nested calls won't be executing foreachinrange(see if condition, it checks if in_process is false).

Share this post


Link to post
Share on other sites

Try ask or rathena forum? At herc forum this is bit offtopic

 

Share this post


Link to post
Share on other sites
13 hours ago, HD Scripts said:

Someboy teachs me to implement this src on rathena? no plugins

It's better to ask this kind of thing at rA forum itself. If there's something which is common to both emulator, you can ask it anywhere, but since your request is rA specific, just ask there (and I am sure there already might be topic for this)

Share this post


Link to post
Share on other sites
12 hours ago, HD Scripts said:

I'm use Hercules now... But, i can implement this src command? No plugins, command.

Sorry, I won't do that(it needs to be updated too frequently), but it's easy to see plugin code(pre/post hook) and change to src 

Share this post


Link to post
Share on other sites

I have successfully installed the plugin. But when I use @arealoot, it says that @arealoot is Unknown Command.

 

Update: @arealoot command is working now. But its still only getting 1 item. instead of 3x3 area items.

Edited by KhnKhymKh

Share this post


Link to post
Share on other sites
On 9/13/2020 at 12:24 PM, rabmaster said:

its not work

 


arealoot.c:17:10: fatal error: ../common/malloc.h: No such file or directory
 #include "../common/malloc.h"

The plugin is perfectly working on the latest HERC.

Check and use this code:

https://github.com/dastgirp/HPM-Plugins/blob/master/src/plugins/%40arealoot.c

And do not forget to mention the plugin name in \conf\plugins.conf

Edited by Timokha

Share this post


Link to post
Share on other sites
On 10/25/2018 at 6:02 PM, KhnKhymKh said:

I have successfully installed the plugin. But when I use @arealoot, it says that @arealoot is Unknown Command.

 

Update: @arealoot command is working now. But its still only getting 1 item. instead of 3x3 area items.

same here using the latest Hercules as of this writing, does anyone can help to fix this issue?

Share this post


Link to post
Share on other sites
On 4/17/2024 at 2:08 PM, gleynn said:

same here using the latest Hercules as of this writing, does anyone can help to fix this issue?

 

I'm using this @arealoot plugin attached and it's working perfectly. (Collecting all items at once)

arealoot.c

Share this post


Link to post
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
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.

Loading...

×
×
  • Create New...

Important Information

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