summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-05-04 01:36:54 -0300
committerJesusaves <cpntb1@ymail.com>2019-05-04 01:36:54 -0300
commit782c9d437638dd54192b9c1f039e8b6dcac0045d (patch)
tree38546f0e487b273008a10e02d4cd722727d4be03 /npc
parent2223520a4364a46248842ea577af08a08de80894 (diff)
downloadserverdata-782c9d437638dd54192b9c1f039e8b6dcac0045d.tar.gz
serverdata-782c9d437638dd54192b9c1f039e8b6dcac0045d.tar.bz2
serverdata-782c9d437638dd54192b9c1f039e8b6dcac0045d.tar.xz
serverdata-782c9d437638dd54192b9c1f039e8b6dcac0045d.zip
Prepare introduction of Warp Crystals, update Lua dialog if hurns is in siege
Diffstat (limited to 'npc')
-rw-r--r--npc/003-2/lua.txt13
-rw-r--r--npc/items/lofteleporter.txt93
-rw-r--r--npc/items/teleporter.txt8
-rw-r--r--npc/scripts.conf1
4 files changed, 111 insertions, 4 deletions
diff --git a/npc/003-2/lua.txt b/npc/003-2/lua.txt
index ad09410af..70c355a01 100644
--- a/npc/003-2/lua.txt
+++ b/npc/003-2/lua.txt
@@ -214,6 +214,19 @@ L_Complete:
mesn;
mesq l("You see the docks on the other side of the town? There should be a ship docked there.");
next;
+ if (!$GAME_STORYLINE < 1) {
+ mesn;
+ mesq l("The ship can bring you to the town of Hurnscald, but we have a problem: It is currently being occupied by a Monster Army.");
+ next;
+ mesn;
+ mesq l("That would be your next destination, but first, the monster army must be driven out!");
+ next;
+ mesn;
+ mesq l("The Game Masters are assembling a party to storm Hurnscald and liberate it. You should try joining it!");
+ next;
+ mesc l(">> Hurnscald must be Liberated first, to continue this story <<"), 1;
+ close;
+ }
mesn;
mesq l("You already got the money. Go there and pay ##B Hurnscald ##b a visit. The ##B mayor ##b should be able to help you.");
next;
diff --git a/npc/items/lofteleporter.txt b/npc/items/lofteleporter.txt
new file mode 100644
index 000000000..c387c1917
--- /dev/null
+++ b/npc/items/lofteleporter.txt
@@ -0,0 +1,93 @@
+// TMW2 scripts.
+// Authors:
+// Pyndragon
+// Jesusalva
+// Description:
+// Hand Teleporter (also saves coordinates - @memo)
+
+- script LoF Teleporter NPC_HIDDEN,{
+ close;
+
+ // Checks if you can warp
+ function loftel_check {
+ getmapxy(.@m$, .@x, .@y, 0);
+ .@is_hurt=(readparam(Hp) < readparam(MaxHp)*9/10); // <90% hp
+ .@is_town=(getmapflag(.@m$, mf_town));
+ return (.@is_hurt && !.@is_town);
+ }
+
+ // Calculate time remaining
+ // (time, .@x)
+ function loftel_time {
+ return gettimetick(2)+max((60*getarg(0))-(getarg(1)*60), 30);
+ }
+
+L_Cooldown:
+ mesn;
+ mesc l("This teleporter is currently recharging.");
+ mesc l("You can use it again in @@.", FuzzyTime(TELEPORTER_TIME));
+ close;
+
+OnUse:
+ if (TELEPORTER_TIME > gettimetick(2))
+ goto L_Cooldown;
+ if (readparam(Hp) < readparam(MaxHp)) {
+ dispbottom l("You are hurt, and cannot use this.");
+ end;
+ }
+ if (BaseLevel < 20) {
+ dispbottom l("This is too powerful to you. Get level 20 before attempting to use.");
+ end;
+ }
+
+ mesn;
+ mesc l("Ozthokk, a great sage from the Land Of Fire, holds secrets of time and space travel.");
+ mesc l("This is not magic, it is science!");
+ mes "";
+ mesc l("PS. Additional reagents may be required for warps.");
+ next;
+
+ .@x=(reputation("LoF")/10)+min(10, countitem(TimeFlask)-1); // up to 10 minutes reduction from quests, and 10 from time flasks
+
+ select
+ l("Don't warp"),
+ l("Land Of Fire Village (@@m)", 50-.@x),
+ rif(TELEPORTERS & TP_FROST, l("Frostia (@@m)", 360-.@x)),
+ rif(TELEPORTERS & TP_HALIN, l("Halinarzo (@@m)", 360-.@x)),
+ rif(GSET_SOULMENHIR_MANUAL, l("Save Point (@@m)", 30-.@x));
+
+ if (@menu == 1)
+ close;
+
+ switch (@menu) {
+ case 1:
+ }
+ if (loftel_check()) {
+ dispbottom l("You are hurt, and cannot use this.");
+ }
+ doevent "shake::OnGM";
+ switch (@menu) {
+ case 2:
+ warp "017-1", 120, 89;
+ TELEPORTER_TIME=loftel_time(50, .@x);
+ LOCATION$="LoF";
+ break;
+ case 3:
+ warp "024-1", 155, 82;
+ TELEPORTER_TIME=loftel_time(360, .@x);
+ LOCATION$="Frostia";
+ break;
+ case 4:
+ warp "009-1", 113, 91;
+ TELEPORTER_TIME=loftel_time(360, .@x);
+ LOCATION$="Halin";
+ break;
+ case 5:
+ warp "Save", 0, 0;
+ TELEPORTER_TIME=loftel_time(30, .@x);
+ //LOCATION$="Save";
+ break;
+ }
+ closedialog;
+ end;
+}
diff --git a/npc/items/teleporter.txt b/npc/items/teleporter.txt
index c387c1917..7c5ad6c4f 100644
--- a/npc/items/teleporter.txt
+++ b/npc/items/teleporter.txt
@@ -3,9 +3,9 @@
// Pyndragon
// Jesusalva
// Description:
-// Hand Teleporter (also saves coordinates - @memo)
+// Warp Crystal
-- script LoF Teleporter NPC_HIDDEN,{
+- script Warp Crystal NPC_HIDDEN,{
close;
// Checks if you can warp
@@ -54,7 +54,7 @@ OnUse:
l("Land Of Fire Village (@@m)", 50-.@x),
rif(TELEPORTERS & TP_FROST, l("Frostia (@@m)", 360-.@x)),
rif(TELEPORTERS & TP_HALIN, l("Halinarzo (@@m)", 360-.@x)),
- rif(GSET_SOULMENHIR_MANUAL, l("Save Point (@@m)", 30-.@x));
+ l("Save Point (@@m)", 30-.@x);
if (@menu == 1)
close;
@@ -85,7 +85,7 @@ OnUse:
case 5:
warp "Save", 0, 0;
TELEPORTER_TIME=loftel_time(30, .@x);
- //LOCATION$="Save";
+ LOCATION$="Save";
break;
}
closedialog;
diff --git a/npc/scripts.conf b/npc/scripts.conf
index 6e1632c41..e5d30d959 100644
--- a/npc/scripts.conf
+++ b/npc/scripts.conf
@@ -69,6 +69,7 @@
"npc/items/books.txt",
"npc/items/croconut.txt",
"npc/items/emptybox.txt",
+"npc/items/lofteleporter.txt",
"npc/items/shovel.txt",
"npc/items/teleporter.txt",