Zirius 1 Posted August 19, 2014 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! Quote Share this post Link to post Share on other sites
0 Angelmelody 221 Posted August 21, 2014 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; 1 Zirius reacted to this Quote Share this post Link to post Share on other sites
0 benzanaz 0 Posted August 19, 2014 thats normal. Quote Share this post Link to post Share on other sites
0 Angelmelody 221 Posted August 19, 2014 (edited) 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 August 19, 2014 by Angelmelody 1 Zirius reacted to this Quote Share this post Link to post Share on other sites
0 jaBote 438 Posted August 19, 2014 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 1 Zirius reacted to this Quote Share this post Link to post Share on other sites
0 Zirius 1 Posted August 21, 2014 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! Quote Share this post Link to post Share on other sites
0 Zirius 1 Posted August 21, 2014 (edited) 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 August 21, 2014 by Zirius Quote Share this post Link to post Share on other sites
0 Zirius 1 Posted August 21, 2014 Thanks! Its working. Quote Share this post Link to post Share on other sites
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