diff options
author | Jesusaves <cpntb1@ymail.com> | 2021-04-10 03:00:20 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2021-04-10 03:00:20 -0300 |
commit | ba1e827b6b4c17c35a163e6b55be8c122de632b8 (patch) | |
tree | 819f93d0ffee3697e336471710afb9681f0b8d86 /npc/commands/warp.txt | |
parent | 6e7f3113c0faad9edd4367d100ba9dd77e8d3130 (diff) | |
download | serverdata-ba1e827b6b4c17c35a163e6b55be8c122de632b8.tar.gz serverdata-ba1e827b6b4c17c35a163e6b55be8c122de632b8.tar.bz2 serverdata-ba1e827b6b4c17c35a163e6b55be8c122de632b8.tar.xz serverdata-ba1e827b6b4c17c35a163e6b55be8c122de632b8.zip |
Add several convenience functions. Fix some bugs regarding misuse of readparam()
Diffstat (limited to 'npc/commands/warp.txt')
-rwxr-xr-x | npc/commands/warp.txt | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/npc/commands/warp.txt b/npc/commands/warp.txt deleted file mode 100755 index d2eee4e2..00000000 --- a/npc/commands/warp.txt +++ /dev/null @@ -1,56 +0,0 @@ -- script @warp NPC32767,{ - callfunc "argv_splitter"; - if (@argv$[3] == "" && @argv$[2] == "" && @argv$[1] != "" && @argv[1] < 2) - @argv$[3] = @argv$[1]; - - .@n$ = if_then_else(@argv$[3] != "", "char", "") + "warp"; - if (GM < CMD_WARP && GM < G_SYSOP) goto L_GM; // check if you can use it on self - .@target_id = BL_ID; - if (@argv$[3] != "") set .@target_id, getcharid(3, @argv$[3]); - if (@argv$[3] != "" && !(isloggedin(.@target_id))) goto L_Failed; // do NOT fallback to self - if (@argv$[3] != "" && GM < CMD_CHARWARP && GM < G_SYSOP) goto L_GM; // when target is not self, use charwarp permission - - if (@argv$[0] == "") - @argv$[0] = getmapname(); - - setarray @map_anchor$[0], "", "", "", ""; - callfunc "map2anchor"; - - gmlog "@"+.@n$+" " + @args$; - if (.@target_id != BL_ID) - message strcharinfo(0), .@n$+" : The operation succeeded."; - - @GMWARP_map$ = @map_anchor$[0]; - @GMWARP_x = if_then_else(@argv[1] > 1, @argv[1], @map_anchor$[1]); - @GMWARP_y = if_then_else(@argv[2] > 1, @argv[2], @map_anchor$[2]); - addtimer 0, strnpcinfo(0) + "::OnWarp", .@target_id; - - if (@map_anchor$[3] == "no" && @knows_anchors < 1) - goto L_SuggestAnchors; - end; - -L_SuggestAnchors: - message strcharinfo(0), .@n$+" : The warp command has been improved. You might want to consider using [@@https://www.themanaworld.org/index.php/Dev:GM_Commands/anchors|map anchors@@]."; - @knows_anchors = 1; - end; - -OnWarp: - warp @GMWARP_map$, @GMWARP_x, @GMWARP_y; - @GMWARP_map$ = ""; - @GMWARP_x = 0; - @GMWARP_y = 0; - end; - -L_Failed: - message strcharinfo(0), .@n$+" : Impossible to attach to the target player. Did you try putting the name in \"quotation marks\"?"; - end; - -L_GM: - message strcharinfo(0), .@n$+" : GM command is level "+ if_then_else(@argv$[1] != "", CMD_CHARWARP, CMD_WARP) +", but you are level " + GM; - end; - -OnInit: - registercmd chr(ATCMD_SYMBOL) + "warp", strnpcinfo(0); - registercmd chr(ATCMD_SYMBOL) + "charwarp", strnpcinfo(0); - end; -} |