# Recallmap patch for Hercules build 8629562
# Authored by MarkZD - http://rathena.org/board/topic/73701-recallmap-command/?p=153487
Index: src/map/atcommand.c
--- src/map/atcommand.c
+++ src/map/atcommand.c
@@ -9186,4 +1986,57 @@
}
+/**
+* Recall Map, authored by MarkZD
+**/
+
+ACMD_FUNC(recallmap)
+{
+short mapindex;
+struct map_session_data* pl_sd;
+struct s_mapiterator* iter;
+int count;
+
+nullpo_retr(-1, sd);
+if (!message || !*message){
+ clif_displaymessage(fd, msg_txt(909)); // Please enter a map (usage: @recallmap <mapname>).
+ return -1;
+}
+
+mapindex = map_mapname2mapid(message);
+
+if (mapindex < 0) {
+ clif_displaymessage(fd, msg_txt(1)); // Map not found.
+ return -1;
+}
+count = 0;
+iter = mapit_getallusers();
+for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) )
+{
+ if(pl_sd->bl.m == mapindex)
+ {
+ if (sd->status.account_id != pl_sd->status.account_id && pc_get_group_level(sd) >= pc_get_group_level(pl_sd))
+ {
+ if (map[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_displaymessage(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_displaymessage(fd, atcmd_output);
+}
+return 0;
+}
/**
* Fills the reference of available commands in atcommand DBMap
**/
@@ -9196,2 +9196,3 @@
AtCommandInfo atcommand_base[] = {
+ ACMD_DEF(recallmap),
ACMD_DEF2("warp", mapmove),