Jump to content
  • 0
Sign in to follow this  
Zirius

@recallall includes vendors @autotrade

Question

Hello! I think there is a bug at using @recallall, the vendors that @autotrade are also being recalled. Is this a bug or Hercules allows that? How can I avoid it?

 

Thanks!

Share this post


Link to post
Share on other sites

7 answers to this question

Recommended Posts

  • 0

 

Or you can source edit it (or overwrite with a plugin)

 

find on src/map/atcommand.c the @recallall command:

/*========================================== * Recall All Characters Online To Your Location *------------------------------------------*/ACMD(recallall){	struct map_session_data* pl_sd;	struct s_mapiterator* iter;	int count;		memset(atcmd_output, '0', sizeof(atcmd_output));		if (sd->bl.m >= 0 && map->list[sd->bl.m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {		clif->message(fd, msg_txt(1032)); // You are not authorized to warp someone to your current map.		return false;	}		count = 0;	iter = mapit_getallusers();	for( pl_sd = (TBL_PC*)mapit->first(iter); mapit->exists(iter); pl_sd = (TBL_PC*)mapit->next(iter) ) {		if (sd->status.account_id != pl_sd->status.account_id && pc_get_group_level(sd) >= pc_get_group_level(pl_sd)) {			if (pl_sd->bl.m == sd->bl.m && pl_sd->bl.x == sd->bl.x && pl_sd->bl.y == sd->bl.y)				continue; // Don't waste time warping the character to the same place.			if (pl_sd->bl.m >= 0 && map->list[pl_sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE))				count++;			else {				if (pc_isdead(pl_sd)) { //Wake them up					pc->setstand(pl_sd);					pc->setrestartvalue(pl_sd,1);				}				pc->setpos(pl_sd, sd->mapindex, sd->bl.x, sd->bl.y, CLR_RESPAWN);			}		}	}	mapit->free(iter);		clif->message(fd, msg_txt(92)); // All characters recalled!	if (count) {		sprintf(atcmd_output, msg_txt(1033), count); // Because you are not authorized to warp from some maps, %d player(s) have not been recalled.		clif->message(fd, atcmd_output);	}		return true;}

 

Change line 3343 from:

		if (sd->status.account_id != pl_sd->status.account_id && pc_get_group_level(sd) >= pc_get_group_level(pl_sd)) {

 

to:

		if (sd->status.account_id != pl_sd->status.account_id && pc_get_group_level(sd) >= pc_get_group_level(pl_sd) && !sd->state.autotrade) {

 

Then recompile (or make a plugin that overloads it). Haven't tested but should work. This way, you won't recall anyone on autotrade state.

 

P.S.: Angelmelody's answer works too, but I didn't like this one because this makes you deal with it by a big workload and will make you compile at least the plugins and create a script from scratch; my answer is a 1-line edit or just making a plugin. Much simpler ;P

 

EDIT. Tried recompiling twice on my centos server, but it seems to be not working. No error on console though. The @autotrade are still getting recalled.

just insert this line  into  for loop

 

if(pl_sd->state.autotrade) continue;

Share this post


Link to post
Share on other sites
  • 0

you can use  addrid script command  to recall  all players who isn't  with a vendor

 

through  binding  @recallall  command to overwrite original recall command

 

http://herc.ws/board/topic/3285-script-command-addrid/

Edited by Angelmelody

Share this post


Link to post
Share on other sites
  • 0

Or you can source edit it (or overwrite with a plugin)

 

find on src/map/atcommand.c the @recallall command:

/*========================================== * Recall All Characters Online To Your Location *------------------------------------------*/ACMD(recallall){	struct map_session_data* pl_sd;	struct s_mapiterator* iter;	int count;		memset(atcmd_output, '0', sizeof(atcmd_output));		if (sd->bl.m >= 0 && map->list[sd->bl.m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {		clif->message(fd, msg_txt(1032)); // You are not authorized to warp someone to your current map.		return false;	}		count = 0;	iter = mapit_getallusers();	for( pl_sd = (TBL_PC*)mapit->first(iter); mapit->exists(iter); pl_sd = (TBL_PC*)mapit->next(iter) ) {		if (sd->status.account_id != pl_sd->status.account_id && pc_get_group_level(sd) >= pc_get_group_level(pl_sd)) {			if (pl_sd->bl.m == sd->bl.m && pl_sd->bl.x == sd->bl.x && pl_sd->bl.y == sd->bl.y)				continue; // Don't waste time warping the character to the same place.			if (pl_sd->bl.m >= 0 && map->list[pl_sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE))				count++;			else {				if (pc_isdead(pl_sd)) { //Wake them up					pc->setstand(pl_sd);					pc->setrestartvalue(pl_sd,1);				}				pc->setpos(pl_sd, sd->mapindex, sd->bl.x, sd->bl.y, CLR_RESPAWN);			}		}	}	mapit->free(iter);		clif->message(fd, msg_txt(92)); // All characters recalled!	if (count) {		sprintf(atcmd_output, msg_txt(1033), count); // Because you are not authorized to warp from some maps, %d player(s) have not been recalled.		clif->message(fd, atcmd_output);	}		return true;}

 

Change line 3343 from:

		if (sd->status.account_id != pl_sd->status.account_id && pc_get_group_level(sd) >= pc_get_group_level(pl_sd)) {

 

to:

		if (sd->status.account_id != pl_sd->status.account_id && pc_get_group_level(sd) >= pc_get_group_level(pl_sd) && !sd->state.autotrade) {

 

Then recompile (or make a plugin that overloads it). Haven't tested but should work. This way, you won't recall anyone on autotrade state.

 

P.S.: Angelmelody's answer works too, but I didn't like this one because this makes you deal with it by a big workload and will make you compile at least the plugins and create a script from scratch; my answer is a 1-line edit or just making a plugin. Much simpler ;P

Share this post


Link to post
Share on other sites
  • 0

you can use  addrid script command  to recall  all players who isn't  with a vendor

 

through  binding  @recallall  command to overwrite original recall command

 

http://herc.ws/board/topic/3285-script-command-addrid/

 

Thanks! But haven't really relied on plugins before.

 

 

Or you can source edit it (or overwrite with a plugin)

 

find on src/map/atcommand.c the @recallall command:

/*========================================== * Recall All Characters Online To Your Location *------------------------------------------*/ACMD(recallall){	struct map_session_data* pl_sd;	struct s_mapiterator* iter;	int count;		memset(atcmd_output, '0', sizeof(atcmd_output));		if (sd->bl.m >= 0 && map->list[sd->bl.m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {		clif->message(fd, msg_txt(1032)); // You are not authorized to warp someone to your current map.		return false;	}		count = 0;	iter = mapit_getallusers();	for( pl_sd = (TBL_PC*)mapit->first(iter); mapit->exists(iter); pl_sd = (TBL_PC*)mapit->next(iter) ) {		if (sd->status.account_id != pl_sd->status.account_id && pc_get_group_level(sd) >= pc_get_group_level(pl_sd)) {			if (pl_sd->bl.m == sd->bl.m && pl_sd->bl.x == sd->bl.x && pl_sd->bl.y == sd->bl.y)				continue; // Don't waste time warping the character to the same place.			if (pl_sd->bl.m >= 0 && map->list[pl_sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE))				count++;			else {				if (pc_isdead(pl_sd)) { //Wake them up					pc->setstand(pl_sd);					pc->setrestartvalue(pl_sd,1);				}				pc->setpos(pl_sd, sd->mapindex, sd->bl.x, sd->bl.y, CLR_RESPAWN);			}		}	}	mapit->free(iter);		clif->message(fd, msg_txt(92)); // All characters recalled!	if (count) {		sprintf(atcmd_output, msg_txt(1033), count); // Because you are not authorized to warp from some maps, %d player(s) have not been recalled.		clif->message(fd, atcmd_output);	}		return true;}
 

Change line 3343 from:

		if (sd->status.account_id != pl_sd->status.account_id && pc_get_group_level(sd) >= pc_get_group_level(pl_sd)) {
 

to:

		if (sd->status.account_id != pl_sd->status.account_id && pc_get_group_level(sd) >= pc_get_group_level(pl_sd) && !sd->state.autotrade) {
 

Then recompile (or make a plugin that overloads it). Haven't tested but should work. This way, you won't recall anyone on autotrade state.

 

P.S.: Angelmelody's answer works too, but I didn't like this one because this makes you deal with it by a big workload and will make you compile at least the plugins and create a script from scratch; my answer is a 1-line edit or just making a plugin. Much simpler ;P

Thanks man! source compile would should work on me. Thanks thanks!

Share this post


Link to post
Share on other sites
  • 0

Or you can source edit it (or overwrite with a plugin)

 

find on src/map/atcommand.c the @recallall command:

/*========================================== * Recall All Characters Online To Your Location *------------------------------------------*/ACMD(recallall){	struct map_session_data* pl_sd;	struct s_mapiterator* iter;	int count;		memset(atcmd_output, '0', sizeof(atcmd_output));		if (sd->bl.m >= 0 && map->list[sd->bl.m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {		clif->message(fd, msg_txt(1032)); // You are not authorized to warp someone to your current map.		return false;	}		count = 0;	iter = mapit_getallusers();	for( pl_sd = (TBL_PC*)mapit->first(iter); mapit->exists(iter); pl_sd = (TBL_PC*)mapit->next(iter) ) {		if (sd->status.account_id != pl_sd->status.account_id && pc_get_group_level(sd) >= pc_get_group_level(pl_sd)) {			if (pl_sd->bl.m == sd->bl.m && pl_sd->bl.x == sd->bl.x && pl_sd->bl.y == sd->bl.y)				continue; // Don't waste time warping the character to the same place.			if (pl_sd->bl.m >= 0 && map->list[pl_sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE))				count++;			else {				if (pc_isdead(pl_sd)) { //Wake them up					pc->setstand(pl_sd);					pc->setrestartvalue(pl_sd,1);				}				pc->setpos(pl_sd, sd->mapindex, sd->bl.x, sd->bl.y, CLR_RESPAWN);			}		}	}	mapit->free(iter);		clif->message(fd, msg_txt(92)); // All characters recalled!	if (count) {		sprintf(atcmd_output, msg_txt(1033), count); // Because you are not authorized to warp from some maps, %d player(s) have not been recalled.		clif->message(fd, atcmd_output);	}		return true;}

 

Change line 3343 from:

		if (sd->status.account_id != pl_sd->status.account_id && pc_get_group_level(sd) >= pc_get_group_level(pl_sd)) {

 

to:

		if (sd->status.account_id != pl_sd->status.account_id && pc_get_group_level(sd) >= pc_get_group_level(pl_sd) && !sd->state.autotrade) {

 

Then recompile (or make a plugin that overloads it). Haven't tested but should work. This way, you won't recall anyone on autotrade state.

 

P.S.: Angelmelody's answer works too, but I didn't like this one because this makes you deal with it by a big workload and will make you compile at least the plugins and create a script from scratch; my answer is a 1-line edit or just making a plugin. Much simpler ;P

 

EDIT. Tried recompiling twice on my centos server, but it seems to be not working. No error on console though. The @autotrade are still getting recalled.

Edited by Zirius

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
Answer this question...

×   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...
Sign in to follow this  

×
×
  • Create New...

Important Information

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