From acccacb1dd80c3fb61c00e071b3eaa47e3194107 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sat, 4 Jul 2020 17:08:04 -0300 Subject: How did it miss the whole file =/ --- npc/functions/teleporter.txt | 54 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 npc/functions/teleporter.txt (limited to 'npc') diff --git a/npc/functions/teleporter.txt b/npc/functions/teleporter.txt new file mode 100644 index 000000000..40376eee5 --- /dev/null +++ b/npc/functions/teleporter.txt @@ -0,0 +1,54 @@ +// TMW2 Script +// Authors: +// Jesusalva +// Description: +// Link portals to soul menhirs like the teleporters from old +// The price is temporary. This feature got in because no ship in Nivalis Port +// PS. Anise => “Aisen” Anagram + +// TeleporterGate(TP_CURRENT) +function script TeleporterGate { + .@TP=getarg(0); + + // Validate + .@x=array_find($@LOCMASTER_TP, .@TP); + if (.@x < 0) + return Exception("Invalid Teleport Point: "+.@TP); + + // Obtain current Teleport Point (.@IF) + .@x=array_find($@LOCMASTER_MAP$, getmap()); + .@IF=$@LOCMASTER_TP[.@x]; + + if (!(TELEPORTERS & .@TP)) { + TELEPORTERS=TELEPORTERS|.@TP; + mesn "Anise Inc."; + mesc l("Location Registered. You are now capable to use this warp gate."); + next; + } + mesc l("Where should I warp to?"); + mesc l("Cost: 1 @@", getitemlink(PileOfAsh)), 1; + if (!countitem(PileOfAsh)) + close; + next; + menuint + rif(TELEPORTERS & TP_FROST && .@IF != TP_FROST, l("Frostia")), TP_FROST, + rif(TELEPORTERS & TP_HALIN && .@IF != TP_FROST, l("Halinarzo")), TP_HALIN, + rif(TELEPORTERS & TP_LILIT && .@IF != TP_FROST, l("Lilit")), TP_LILIT, + rif(TELEPORTERS & TP_TULIM && .@IF != TP_FROST, l("Tulimshar")), TP_TULIM, + rif(TELEPORTERS & TP_HURNS && .@IF != TP_FROST, l("Hurnscald")), TP_HURNS, + rif(TELEPORTERS & TP_NIVAL && .@IF != TP_FROST, l("Nivalis")), TP_NIVAL, + rif(TELEPORTERS & TP_LOF && .@IF != TP_LOF, l("Land Of Fire")), TP_LOF, + rif(TELEPORTERS & TP_FORT && .@IF != TP_FORT, l("Fortress Island")), TP_FORT, + rif(TELEPORTERS & TP_BOSSR && .@IF != TP_BOSSR, l("Moubootaur Maze")), TP_BOOSR, + l("None"), -1; + mes ""; + if (@menu != -1) + delitem PileOfAsh, 1; + closedialog; + + // Retrieve location specifics and warp + .@x=array_find($@LOCMASTER_TP, .@TP); + warp $@LOCMASTER_MAP$[.@x], $@LOCMASTER_X[.@x], $@LOCMASTER_Y[.@x]; + return; +} + -- cgit v1.2.3-60-g2f50