diff options
author | Jesusaves <cpntb1@ymail.com> | 2020-07-04 13:39:01 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2020-07-04 13:39:01 -0300 |
commit | 2050c457b7aaf14e0dc6e6b2b4793da1be6f828b (patch) | |
tree | 92c91b5ac643612864a9ffe0ff12d3f1d57dfdec /npc | |
parent | 7c057bc19b36c71171a2c4155df5422f93b2c455 (diff) | |
download | serverdata-2050c457b7aaf14e0dc6e6b2b4793da1be6f828b.tar.gz serverdata-2050c457b7aaf14e0dc6e6b2b4793da1be6f828b.tar.bz2 serverdata-2050c457b7aaf14e0dc6e6b2b4793da1be6f828b.tar.xz serverdata-2050c457b7aaf14e0dc6e6b2b4793da1be6f828b.zip |
Update some old, precarious code
Diffstat (limited to 'npc')
-rw-r--r-- | npc/000-1/exit.txt | 12 | ||||
-rw-r--r-- | npc/commands/ucp.txt | 2 | ||||
-rw-r--r-- | npc/config/location.txt | 15 | ||||
-rw-r--r-- | npc/items/teleporter.txt | 2 |
4 files changed, 17 insertions, 14 deletions
diff --git a/npc/000-1/exit.txt b/npc/000-1/exit.txt index c35491fb9..e1a73bf9f 100644 --- a/npc/000-1/exit.txt +++ b/npc/000-1/exit.txt @@ -28,17 +28,5 @@ OnTalkNearby: warp "002-1", 53, 38; end; -// Save your location to last visited town for @ucp. I won't hate you for this. -OnSetLX: - @lx=array_find($@LOCMASTER_LOC$, LOCATION$); - savepoint $@LOCMASTER_MAP$[@lx], $@LOCMASTER_X[@lx], $@LOCMASTER_Y[@lx]; - end; - -// Warp you according to LX -OnVisitLX: - @lx=array_find($@LOCMASTER_LOC$, LOCATION$); - warp $@LOCMASTER_MAP$[@lx], $@LOCMASTER_X[@lx], $@LOCMASTER_Y[@lx]; - end; - } diff --git a/npc/commands/ucp.txt b/npc/commands/ucp.txt index 7bda91a7b..5ad0c0182 100644 --- a/npc/commands/ucp.txt +++ b/npc/commands/ucp.txt @@ -258,7 +258,7 @@ function script UserCtrlPanel { // Update savepoint if needed if (@unsaved) { if (!GSET_SOULMENHIR_MANUAL) savepoint "000-1", 22, 22; - else doevent "Emergency Exit::OnSetLX"; + else ResaveRespawn(); } break; case 2: diff --git a/npc/config/location.txt b/npc/config/location.txt index 5a069545b..04b2c84d7 100644 --- a/npc/config/location.txt +++ b/npc/config/location.txt @@ -18,3 +18,18 @@ OnInit: //debugmes "Locmaster: Index 5: %s [%s.gat (%d, %d)]", $@LOCMASTER_LOC$[5], $@LOCMASTER_MAP$[5], $@LOCMASTER_X[5], $@LOCMASTER_Y[5]; end; } + +// Resaves your respawn point +function script ResaveRespawn { + .@i=array_find($@LOCMASTER_LOC$, LOCATION$); + savepoint $@LOCMASTER_MAP$[.@i], $@LOCMASTER_X[.@i], $@LOCMASTER_Y[.@i]; + return; +} + +// Warps you to last visited town +function script ReturnTown { + .@i=array_find($@LOCMASTER_LOC$, LOCATION$); + warp $@LOCMASTER_MAP$[.@i], $@LOCMASTER_X[.@i], $@LOCMASTER_Y[.@i]; + return; +} + diff --git a/npc/items/teleporter.txt b/npc/items/teleporter.txt index c85dacd6f..d08f006c7 100644 --- a/npc/items/teleporter.txt +++ b/npc/items/teleporter.txt @@ -49,6 +49,6 @@ OnUse: // Save new location and warp you there EnterTown(@dest$); - doevent "Emergency Exit::OnVisitLX"; + ReturnTown(); end; } |