@recallall includes vendors @autotrade

Zirius

New member
Messages
261
Points
0
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!

 
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

 
Last edited by a moderator:
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!

 
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.

 
Last edited by a moderator:
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;

 
Thanks! Its working. 
default_biggrin.png


 
Back
Top