From 85712c4f2ccfa9c3cec4bd0c9f515f5061a9351c Mon Sep 17 00:00:00 2001 From: mekolat Date: Tue, 21 Jun 2016 16:32:06 -0400 Subject: add atcommand `@w` (works like `@go`) --- npc/commands/warp.txt | 231 ++++++++++++++++++++++++++++++++++++++++++++++++++ npc/scripts.conf | 1 + 2 files changed, 232 insertions(+) create mode 100644 npc/commands/warp.txt (limited to 'npc') diff --git a/npc/commands/warp.txt b/npc/commands/warp.txt new file mode 100644 index 00000000..f8e25bc0 --- /dev/null +++ b/npc/commands/warp.txt @@ -0,0 +1,231 @@ +// @w atcommand +// warps using anchors or map name +// +// group lv: 1 +// group char lv: 2 +// log: True +// +// usage: +// @w [, x [, y]] +// #w "char" [, x [, y]] +// +// example: +// @w artis +// #w "char" artis + +- script @w 32767,{ + end; + +OnCall: + .@m$ = strtoupper(.@atcmd_parameters$[0]); // sanitize + + // ------------------------------------ + // ARTIS + if (startswith(.@m$, "ART")) + { + .@map$ = "001-1"; + .@x = 89; + .@y = 86; + } + + else if (startswith(.@m$, "LIGHT")) + { + .@map$ = "001-2-0"; + .@x = 37; + .@y = 32; + } + + else if (.@m$ == "NOBLE") + { + .@map$ = "001-2-1"; + .@x = 37; + .@y = 37; + } + + else if (startswith(.@m$, "MOON")) + { + .@map$ = "001-2-2"; + .@x = 39; + .@y = 34; + } + + else if (startswith(.@m$, "LIB")) + { + .@map$ = "001-2-4"; + .@x = 49; + .@y = 37; + } + + else if (startswith(.@m$, "CITY")) + { + .@map$ = "001-2-7"; + .@x = 36; + .@y = 38; + } + + else if (.@m$ == "NOBLE2") + { + .@map$ = "001-2-10"; + .@x = 40; + .@y = 38; + } + + else if (.@m$ == "NOBLE3") + { + .@map$ = "001-2-11"; + .@x = 45; + .@y = 33; + } + + else if (.@m$ == "NOBLE4") + { + .@map$ = "001-2-12"; + .@x = 34; + .@y = 32; + } + + else if (.@m$ == "NOBLE5") + { + .@map$ = "001-2-15"; + .@x = 34; + .@y = 38; + } + + else if (startswith(.@m$, "HARB")) + { + .@map$ = "001-2-16"; + .@x = 32; + .@y = 33; + } + + else if (startswith(.@m$, "WARE")) + { + .@map$ = "001-2-18"; + .@x = 39; + .@y = 31; + } + + else if (startswith(.@m$, "MERCH") || startswith(.@m$, "BANK")) + { + .@map$ = "001-2-19"; + .@x = 29; + .@y = 31; + } + + else if (.@m$ == "SHIP2") + { + .@map$ = "001-2-21"; + .@x = 30; + .@y = 28; + } + + else if (startswith(.@m$, "ALCH")) + { + .@map$ = "001-2-26"; + .@x = 30; + .@y = 32; + } + + else if (startswith(.@m$, "BLACK")) + { + .@map$ = "001-2-27"; + .@x = 35; + .@y = 32; + } + + else if (startswith(.@m$, "PLUSH")) + { + .@map$ = "001-2-28"; + .@x = 32; + .@y = 32; + } + + else if (startswith(.@m$, "LEG")) + { + .@map$ = "001-2-33"; + .@x = 34; + .@y = 36; + } + + + // ------------------------------------ + // BOAT + else if (.@m$ == "START") + { + .@map$ = "000-0"; + .@x = 22; + .@y = 24; + } + + else if (.@m$ == "START2") + { + .@map$ = "000-0-0"; + .@x = 26; + .@y = 28; + } + + else if (.@m$ == "START3") + { + .@map$ = "000-0-1"; + .@x = 26; + .@y = 28; + } + + else if (startswith(.@m$, "DRA")) + { + .@map$ = "000-1"; + .@x = 77; + .@y = 110; + } + + else if (startswith(.@m$, "FIRST")) + { + .@map$ = "000-2-0"; + .@x = 27; + .@y = 27; + } + + else if (startswith(.@m$, "SECOND")) + { + .@map$ = "000-2-1"; + .@x = 53; + .@y = 33; + } + + else if (.@m$ == "HOLD") + { + .@map$ = "000-2-2"; + .@x = 43; + .@y = 30; + } + + else if (startswith(.@m$, "NARD")) + { + .@map$ = "000-2-3"; + .@x = 21; + .@y = 27; + } + + else if (startswith(.@m$, "ALIG")) + { + .@map$ = "000-2-4"; + .@x = 36; + .@y = 29; + } + + + if (.@map$ == "") + { + .@map$ = .@atcmd_parameters$[0]; + } + if (.@atcmd_parameters$[2] != "") + { + .@x = atoi(.@atcmd_parameters$[1]); + .@y = atoi(.@atcmd_parameters$[2]); + } + warp .@map$, .@x, .@y; + end; + +OnInit: + bindatcmd "w", "@w::OnCall", 1, 2, 1; +} diff --git a/npc/scripts.conf b/npc/scripts.conf index 85d55303..2aa6f6e2 100644 --- a/npc/scripts.conf +++ b/npc/scripts.conf @@ -34,6 +34,7 @@ npc: npc/functions/string.txt // custom atcommands npc: npc/commands/music.txt +npc: npc/commands/warp.txt // Maps specific scripts import: npc/_import.txt -- cgit v1.2.3-60-g2f50