summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--npc/000-1/exit.txt12
-rw-r--r--npc/commands/ucp.txt2
-rw-r--r--npc/config/location.txt15
-rw-r--r--npc/items/teleporter.txt2
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;
}