viewing paste recallmap | Diff

Posted on the | Last edited on
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
# 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),
Viewed 1671 times, submitted by Streusel.