Jump to content
  • 0

Arealoot not reading splash from Greed


Adel

Question


  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  565
  • Reputation:   349
  • Joined:  11/20/11
  • Last Seen:  

I'm trying to increase the range of Arealoot.

At default it is at 3x3 cell radius. The src code is set to read the splash level from Greed, which is currently set to lv 4 (which is 11x11 cell radius). But this part is not working.
Here is the src code below:

/// Request to pick up an item.
/// 009f <id>.L (CZ_ITEM_PICKUP)
/// 0362 <id>.L (CZ_ITEM_PICKUP2)
/// There are various variants of this packet, some of them have padding between fields.
void clif_parse_TakeItem(int fd, struct map_session_data *sd)
{
	struct flooritem_data *fitem;
	int map_object_id,debug_i;
	int skill_greed(struct block_list *bl, va_list ap);

	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 == 1) {
			//debug_i = map_foreachinrange(skill_greed,&sd->bl,3,BL_ITEM,&sd->bl);
			debug_i = map_foreachinrange(skill_greed,&sd->bl,skill_get_splash(BS_GREED,1),BL_ITEM,&sd->bl);

		//ShowDebug("debug_i=%d", debug_i);

		if(debug_i == 0)
			return;
		} 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);
}

And this is the part that is not working.

if (sd->state.arealoot == 1) {
			//debug_i = map_foreachinrange(skill_greed,&sd->bl,3,BL_ITEM,&sd->bl);
			debug_i = map_foreachinrange(skill_greed,&sd->bl,skill_get_splash(BS_GREED,1),BL_ITEM,&sd->bl);

 

Here is a preview of Greed & Arealoot in game.

Greed (with splash lvl 4):

greed.gif

Arealoot:
arealo.gif
 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  236
  • Reputation:   189
  • Joined:  11/27/11
  • Last Seen:  

Here is my solution.

In your function :

		if (pc_cant_act(sd))
			break;

		if(sd->state.arealoot == 1 && map_foreachinallrange(skill_greed, &sd->bl, 5, BL_ITEM, &sd->bl) == 0)
			return;
		else if (!pc_takeitem(sd, fitem))
			break;

In pc.cpp

Change this :

	if (!check_distance_bl(&fitem->bl, &sd->bl, 2) && sd->ud.skill_id!=BS_GREED)
		return false;	// Distance is too far

to this :

	if (sd->state.arealoot == 0 && (!check_distance_bl(&fitem->bl, &sd->bl, 2) && sd->ud.skill_id!=BS_GREED))
		return false;	// Distance is too far

 

  • Upvote 1
  • MVP 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  565
  • Reputation:   349
  • Joined:  11/20/11
  • Last Seen:  

Thank you @Vykimo! Works like a charm/no1

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:  

how to insert this -.-

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