summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
Diffstat (limited to 'npc')
-rw-r--r--npc/017-1/_import.txt1
-rw-r--r--npc/017-1/drowned_man.txt163
-rw-r--r--npc/018-5-0/_import.txt5
-rw-r--r--npc/018-5-0/_mobs.txt3
-rw-r--r--npc/018-5-0/_warps.txt3
-rw-r--r--npc/018-5-0/core.txt28
-rw-r--r--npc/_import.txt1
-rw-r--r--npc/functions/main.txt3
8 files changed, 206 insertions, 1 deletions
diff --git a/npc/017-1/_import.txt b/npc/017-1/_import.txt
index b122baf2e..51b49f981 100644
--- a/npc/017-1/_import.txt
+++ b/npc/017-1/_import.txt
@@ -4,6 +4,7 @@
"npc/017-1/_mobs.txt",
"npc/017-1/_warps.txt",
"npc/017-1/boringnpc.txt",
+"npc/017-1/drowned_man.txt",
"npc/017-1/estate.txt",
"npc/017-1/fairy_collector.txt",
"npc/017-1/guards.txt",
diff --git a/npc/017-1/drowned_man.txt b/npc/017-1/drowned_man.txt
new file mode 100644
index 000000000..1b0477b08
--- /dev/null
+++ b/npc/017-1/drowned_man.txt
@@ -0,0 +1,163 @@
+// TMW2/TMWBR Script
+// Author:
+// Jesusalva
+// Description:
+// Access to Lilit - He aids you in jumping off the bridge and reaching Lilit
+// Of course, to swim such large distance, you need to have plenty vit and str...
+// Right spot: (164,230) - Between the crack (shallow) and the plant (shallow).
+
+// .@q = LilitQuest_Access
+// 0 - Access not granted
+// 1 - Access granted
+// 2 - Tree Minigame complete.
+
+// TODO: Only allow "I want to swim" if the game knows you know about Lilit
+// That is what Saulc wants, after all
+
+017-1,160,227,0 script #DrownedMan NPC_NO_SPRITE,{
+ if (!isin("017-1", 158, 222, 1))
+ end;
+ mesc l("Someone seems to be drowned in the water.");
+ select
+ l("Hello! Do you need help?"),
+ l("Why shouldn't I jump here?"),
+ l("But I want to swim!");
+ mes "";
+ switch (@menu)
+ {
+ case 1:
+ mesn l("Drowned Man");
+ mesq l("I'm afraid you can't help me... I still have one HP left.");
+ next;
+ mesn l("Drowned Man");
+ mesq l("I also broke my bones, and I was equipping a weapon which prevents HP regen...");
+ next;
+ mesn l("Drowned Man");
+ mesq l("I did some tritan friends, though. They teached me how to breath underwater. It's not so bad.");
+ next;
+ mesn l("Drowned Man");
+ mesq l("In the first eight months I wanted to go back, but now I'm pretty used to living here. Please don't rescue me.");
+ break;
+ case 2:
+ mesn l("Drowned Man");
+ mesq l("Because it may be a fatal fall!");
+ next;
+ mesn l("Drowned Man");
+ mesq l("Look the height of this bridge! Worse, the water around here is pretty shallow.");
+ next;
+ mesn l("Drowned Man");
+ mesq l("Well, there might be a deep water spot, but it would still be dangerous.");
+ next;
+ mesn l("Drowned Man");
+ mesq l("Unless you're looking forward a death penalty, DO NOT JUMP!");
+ // We're in town, are you stupid >.>
+ break;
+ case 3:
+ mesn l("Drowned Man");
+ mesq l("Well, you see, you can't jump very far. And the water near land is shallow.");
+ next;
+ mesn l("Drowned Man");
+ mesq l("I guess, there might be a single spot where water is a bit deeper, but I wasn't lucky.");
+ next;
+ mesn l("Drowned Man");
+ mes l("Remember to store somewhere any heavy stuff you might be carrying.");
+ mes l("I guess you cannot bring more than 1kg with full health. Less, if you're hurt.");
+ next;
+ mesn l("Drowned Man");
+ mesq l("Also, you need vitality and strength to survive the swimming trip. The closest island is very far away.");
+ mesc l("You need at least 35 str and 35 vit to do the trip safely - bonuses not counted - or you will lose HP."); // Can be safely mixed
+ break;
+ }
+ close;
+
+OnWarn:
+ npctalkonce l("@@, don't jump there! It may be fatal!", strcharinfo(0));
+ end;
+
+// DO NOT LOWER
+OnInit:
+ .distance=7;
+ end;
+}
+
+// Warning Event
+017-1,158,222,0 script #DrownedManArea NPC_NO_SPRITE,0,0,{
+ end;
+OnTouch:
+ doevent("#DrownedMan::OnWarn");
+ end;
+OnInit:
+ .distance=1;
+ end;
+}
+
+
+// Any Jump. Code is obfuscated to inhibit cheaters :<
+// Of course, I could use a blackbox too, but this is not the purpose.
+// You don't want to solve the map hint, then you'll solve my formula!! /tableflip
+017-1,162,226,0 script #JumpArea01 NPC_NO_SPRITE,0,0,{
+ // TODO: Check if you want to jump
+ if (!isin("017-1", 158, 222, 1))
+ end;
+ mesc l("Are you really going to jump here?");
+ next;
+ if (askyesno() == ASK_YES) {
+ closeclientdialog;
+ slide .x, .y;
+ if (VarDiffValue(5220, 5270, .x*32) && VarDiffValue(7330, 7390, .y*32))
+ goto L_GoodJump;
+ dispbottom l("The water was too shallow...");
+ percentheal -100, -100;
+ end;
+ }
+ closeclientdialog;
+ end;
+
+L_GoodJump:
+ dispbottom l("You jump in deep waters.");
+ // You can only carry exact 1kg with full health.
+ // Weight will be 1000g - so penalty will be 100% HP.
+ .@penalty=max(0, (Weight/10)-1);
+ percentheal -.@penalty, 0;
+
+ // vit/str counts on swimming minigame
+ mesn l("Drowned Man");
+ mesq l("Good job! I wish you luck, because now you need to SWIM!");
+ next;
+ closeclientdialog;
+ addtimer(3000, "#01850SwimmingCtrl::OnLoop");
+ warp "018-5-0", 20, 25;
+ end;
+
+OnInit:
+ .distance=9;
+ end;
+}
+
+017-1,162,227,0 duplicate(#JumpArea01) #JumpArea02 NPC_NO_SPRITE
+017-1,162,228,0 duplicate(#JumpArea01) #JumpArea03 NPC_NO_SPRITE
+017-1,162,229,0 duplicate(#JumpArea01) #JumpArea04 NPC_NO_SPRITE
+017-1,162,230,0 duplicate(#JumpArea01) #JumpArea05 NPC_NO_SPRITE
+017-1,162,231,0 duplicate(#JumpArea01) #JumpArea06 NPC_NO_SPRITE
+
+017-1,163,226,0 duplicate(#JumpArea01) #JumpArea07 NPC_NO_SPRITE
+017-1,163,227,0 duplicate(#JumpArea01) #JumpArea08 NPC_NO_SPRITE
+017-1,163,228,0 duplicate(#JumpArea01) #JumpArea09 NPC_NO_SPRITE
+017-1,163,229,0 duplicate(#JumpArea01) #JumpArea10 NPC_NO_SPRITE
+017-1,163,230,0 duplicate(#JumpArea01) #JumpArea11 NPC_NO_SPRITE
+017-1,163,231,0 duplicate(#JumpArea01) #JumpArea12 NPC_NO_SPRITE
+
+017-1,164,226,0 duplicate(#JumpArea01) #JumpArea13 NPC_NO_SPRITE
+017-1,164,227,0 duplicate(#JumpArea01) #JumpArea14 NPC_NO_SPRITE
+017-1,164,228,0 duplicate(#JumpArea01) #JumpArea15 NPC_NO_SPRITE
+017-1,164,229,0 duplicate(#JumpArea01) #JumpArea16 NPC_NO_SPRITE
+017-1,164,230,0 duplicate(#JumpArea01) #JumpArea17 NPC_NO_SPRITE
+017-1,164,231,0 duplicate(#JumpArea01) #JumpArea18 NPC_NO_SPRITE
+
+017-1,165,226,0 duplicate(#JumpArea01) #JumpArea19 NPC_NO_SPRITE
+017-1,165,227,0 duplicate(#JumpArea01) #JumpArea20 NPC_NO_SPRITE
+017-1,165,228,0 duplicate(#JumpArea01) #JumpArea21 NPC_NO_SPRITE
+017-1,165,229,0 duplicate(#JumpArea01) #JumpArea22 NPC_NO_SPRITE
+017-1,165,230,0 duplicate(#JumpArea01) #JumpArea23 NPC_NO_SPRITE
+017-1,165,231,0 duplicate(#JumpArea01) #JumpArea24 NPC_NO_SPRITE
+
diff --git a/npc/018-5-0/_import.txt b/npc/018-5-0/_import.txt
new file mode 100644
index 000000000..d7a946e8f
--- /dev/null
+++ b/npc/018-5-0/_import.txt
@@ -0,0 +1,5 @@
+// Map 018-5-0: Heroes' Hold - Exchange Hall
+// This file is generated automatically. All manually added changes will be removed when running the Converter.
+"npc/018-5-0/_mobs.txt",
+"npc/018-5-0/_warps.txt",
+"npc/018-5-0/core.txt",
diff --git a/npc/018-5-0/_mobs.txt b/npc/018-5-0/_mobs.txt
new file mode 100644
index 000000000..90eb88b59
--- /dev/null
+++ b/npc/018-5-0/_mobs.txt
@@ -0,0 +1,3 @@
+// This file is generated automatically. All manually added changes will be removed when running the Converter.
+// Map 018-5-0: Heroes' Hold - Exchange Hall mobs
+018-5-0,79,38,59,18 monster Bluepar 1177,40,30000,30000
diff --git a/npc/018-5-0/_warps.txt b/npc/018-5-0/_warps.txt
new file mode 100644
index 000000000..2b05b6099
--- /dev/null
+++ b/npc/018-5-0/_warps.txt
@@ -0,0 +1,3 @@
+// This file is generated automatically. All manually added changes will be removed when running the Converter.
+// Map 018-5-0: Heroes' Hold - Exchange Hall warps
+018-5-0,139,25,0 warp #018-5-0_139_25 0,9,018-5,39,133
diff --git a/npc/018-5-0/core.txt b/npc/018-5-0/core.txt
new file mode 100644
index 000000000..38bef9df1
--- /dev/null
+++ b/npc/018-5-0/core.txt
@@ -0,0 +1,28 @@
+// TMW-2 Script
+// Author:
+// Jesusalva
+// Description:
+// Controls the swimming minigame. Basically, you lose 1% HP if lack total status.
+
+018-5-0,0,0,0 script #01850SwimmingCtrl NPC_HIDDEN,{
+ end;
+
+OnLoop:
+ if (getmap() != "018-5-0")
+ end;
+ if (ispcdead())
+ end;
+ // Sum everything - you can have 70 str instead of splitting in 35 str and 35 vit
+ .@status=readparam(bStr)+readparam(bVit);
+ .@reqst=.reqstr+.reqvit;
+ debugmes "Got %d/%d (%d), heal %d", .@status,.@reqst,.@status-.@reqst,min(0, .@status-.@reqst);
+ //percentheal min(0, .@status-.@reqst), 0;
+ heal (min(0, .@status-.@reqst)*3), 0;
+ addtimer(3000, "#01850SwimmingCtrl::OnLoop");
+ end;
+
+OnInit:
+ .reqstr=35;
+ .reqvit=35;
+ end;
+}
diff --git a/npc/_import.txt b/npc/_import.txt
index 046ca49b6..bf599254f 100644
--- a/npc/_import.txt
+++ b/npc/_import.txt
@@ -115,6 +115,7 @@
@include "npc/018-4-1/_import.txt"
@include "npc/018-4-2/_import.txt"
@include "npc/018-4/_import.txt"
+@include "npc/018-5-0/_import.txt"
@include "npc/018-5-1/_import.txt"
@include "npc/018-5-2/_import.txt"
@include "npc/018-5-boss/_import.txt"
diff --git a/npc/functions/main.txt b/npc/functions/main.txt
index 56090e926..01559de24 100644
--- a/npc/functions/main.txt
+++ b/npc/functions/main.txt
@@ -257,7 +257,8 @@ function script any_of {
/////////////////////////////////////////////
// Function meant to be used by Grand Hunter Quest
-// VarDiffValue ( old, new, target)
+// result is: lower < target <= higher
+// VarDiffValue ( lower, higher, target)
function script VarDiffValue {
.@val=getarg(2);
return (getarg(0) < .@val && getarg(1) >= .@val);