Jump to content
  • 0

@Arealoot


Dragonis1701

Question


  • Group:  Members
  • Topic Count:  45
  • Topics Per Day:  0.01
  • Content Count:  96
  • Reputation:   7
  • Joined:  05/25/12
  • Last Seen:  

So, I've looked at hercules' plugin for @arealoot and saw that it used greed's code to help do what it wanted. I decided to try and use it for myself and convert it over to rAthena but I'm having a bit of trouble. I don't dabble that much in the source, so I'm not very good at it but this is what I have so far:
 

Incorrect code removed.

It compiles but it does not change anything. It does give me a warning, though. This one: "1>c:\rathena\src\map\pc.c(4254): warning C4047: '==' : 'int (__cdecl *)(map_session_data *,flooritem_data *)' differs in levels of indirection from 'int'" I  think I understand what it means but I'm not sure how to fix it. Please help. =X

Edited by Dragonis1701
Link to comment
Share on other sites

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  12
  • Reputation:   3
  • Joined:  06/16/18
  • Last Seen:  

@wakefield21 I've just tryed on lastest Rathena's version and i see no compile errors or map-server errors, i don't see where your error can come from ^^

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  115
  • Reputation:   4
  • Joined:  08/14/16
  • Last Seen:  

3 hours ago, Metahego said:

@wakefield21 I've just tryed on lastest Rathena's version and i see no compile errors or map-server errors, i don't see where your error can come from ^^

As i said on my reply @Metahego this is what happens, if I don’t use the @arealoot command (meaning disabled) and I drop items on the ground that’s where the error comes in, however if you use the @arealoot command then drop again an item the error will now be gone. Yeah I agree there are no error on compiling but the errors comes in if the command is still disable.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  12
  • Reputation:   3
  • Joined:  06/16/18
  • Last Seen:  

@wakefield21 i try with @arealoot active and disactive, and i didn't see any error i my console, i don't know how to reproduce yours ^^
 

I think it come from this function

void clif_parse_TakeItem(int fd, struct map_session_data *sd)
{
	struct flooritem_data *fitem;
	int map_object_id;
	int skill_greed(struct block_list *bl, va_list ap);

	//First we declare a variable that gets the return value
	int debug_i = 0;

	map_object_id = RFIFOL(fd,packet_db[RFIFOW(fd,0)].pos[0]);

	fitem = (struct flooritem_data*)map_id2bl(map_object_id);

	do {
		if (pc_isdead(sd)) {
			clif_clearunit_area(&sd->bl, CLR_DEAD);
			break;
		}

		if (fitem == NULL || fitem->bl.type != BL_ITEM || fitem->bl.m != sd->bl.m)
			break;

		if (pc_cant_act(sd))
			break;

		if (sd->state.arealoot) {
				//Config in .\conf\import\battle_conf.txt
				int range = battle_config.arealoot_range;

				//Show range value in the console if need it
				//ShowDebug("arealoot_range: %d\n", range);

				//Now we give the variable
				debug_i = map_foreachinrange(skill_greed, &sd->bl, range, BL_ITEM, &sd->bl);

				//Now we print it to the map-server console so you can see what it is while playing
				//ShowDebug("@arealoot commands, debug_i = %d\n", debug_i);
				
				//Give fail packet if no item was looted
				if (debug_i != 0)
					break;
		}
		else {
			if (!pc_takeitem(sd, fitem))
				break;
		}
		return;
	} while (0);
	// Client REQUIRES a fail packet or you can no longer pick items.
	clif_additem(sd,0,0,6);
}

have you exact the same as me ?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  115
  • Reputation:   4
  • Joined:  08/14/16
  • Last Seen:  

@Metahego fixed the problem now with these :

23 hours ago, Metahego said:

@wakefield21 i try with @arealoot active and disactive, and i didn't see any error i my console, i don't know how to reproduce yours ^^
 

I think it come from this function


void clif_parse_TakeItem(int fd, struct map_session_data *sd)
{
	struct flooritem_data *fitem;
	int map_object_id;
	int skill_greed(struct block_list *bl, va_list ap);

	//First we declare a variable that gets the return value
	int debug_i = 0;

	map_object_id = RFIFOL(fd,packet_db[RFIFOW(fd,0)].pos[0]);

	fitem = (struct flooritem_data*)map_id2bl(map_object_id);

	do {
		if (pc_isdead(sd)) {
			clif_clearunit_area(&sd->bl, CLR_DEAD);
			break;
		}

		if (fitem == NULL || fitem->bl.type != BL_ITEM || fitem->bl.m != sd->bl.m)
			break;

		if (pc_cant_act(sd))
			break;

		if (sd->state.arealoot) {
				//Config in .\conf\import\battle_conf.txt
				int range = battle_config.arealoot_range;

				//Show range value in the console if need it
				//ShowDebug("arealoot_range: %d\n", range);

				//Now we give the variable
				debug_i = map_foreachinrange(skill_greed, &sd->bl, range, BL_ITEM, &sd->bl);

				//Now we print it to the map-server console so you can see what it is while playing
				//ShowDebug("@arealoot commands, debug_i = %d\n", debug_i);
				
				//Give fail packet if no item was looted
				if (debug_i != 0)
					break;
		}
		else {
			if (!pc_takeitem(sd, fitem))
				break;
		}
		return;
	} while (0);
	// Client REQUIRES a fail packet or you can no longer pick items.
	clif_additem(sd,0,0,6);
}

have you exact the same as me ?

Thanks a lot. ?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  102
  • Reputation:   2
  • Joined:  07/01/13
  • Last Seen:  

Hello guys,

I'm stuck at this error:

image.png.eeb4f71d6791d88fd936f5303aca8026.png

Any idea how to fix it?

image.png

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  9
  • Reputation:   0
  • Joined:  06/18/12
  • Last Seen:  

Now Its Workx ! After Diff manual change

Edited by rabmaster
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  18
  • Reputation:   0
  • Joined:  03/02/12
  • Last Seen:  

On 2/3/2019 at 9:31 AM, Metahego said:

Finally i make this .diff manualy, it work on my rathena's version

Edit: Resolved some issues, and added possibility to config range in battle_conf
But don't know why, when i put range to 10 that make not difference with 3

 

@arealoot.diff

 

whenever @arealoot is disabled, and you try to pick up an item, you will be able to pick it up but it also displays the message You cannot get the item.

image.png.91fa0a12ba7b74a8916889f2d0752dc7.png

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