summaryrefslogtreecommitdiff
path: root/npc/004-2/mirio.txt
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2022-02-04 15:34:04 -0300
committerJesusaves <cpntb1@ymail.com>2022-02-04 15:34:04 -0300
commiteba87fde79daedc5721daeda218e0a96e3d3307d (patch)
treeaaae340e293f6903b719d4835a2149f29c9cfcad /npc/004-2/mirio.txt
parent94a5f33d0d97652e9bcd75948a713c0f114c92e5 (diff)
downloadserverdata-eba87fde79daedc5721daeda218e0a96e3d3307d.tar.gz
serverdata-eba87fde79daedc5721daeda218e0a96e3d3307d.tar.bz2
serverdata-eba87fde79daedc5721daeda218e0a96e3d3307d.tar.xz
serverdata-eba87fde79daedc5721daeda218e0a96e3d3307d.zip
Theoretically, this is Mirio's Quest
Diffstat (limited to 'npc/004-2/mirio.txt')
-rw-r--r--npc/004-2/mirio.txt127
1 files changed, 122 insertions, 5 deletions
diff --git a/npc/004-2/mirio.txt b/npc/004-2/mirio.txt
index 672919f45..ae087b009 100644
--- a/npc/004-2/mirio.txt
+++ b/npc/004-2/mirio.txt
@@ -4,25 +4,31 @@
// Description:
// Part of Speed Run Quest
// Structure:
-// HalinarzoQuest_Speed( state, time, bonus )
+// HalinarzoQuest_Speed( state, time, record )
-004-2,146,115,0 script Mirio NPC_INDIGENOUS_YOUNG,{
+004-2,146,115,0 script Mirio NPC_INDIGENOUS_YOUNG,1,1,{
function neutral;
function naked;
function disarmed;
function hungry;
function speed;
+ function start;
function slow;
+ function running;
+ function restricted;
+ function retry;
.@q = getq(HalinarzoQuest_Speed);
.@t = getq2(HalinarzoQuest_Speed);
- .@b = getq3(HalinarzoQuest_Speed);
+ .@r = getq3(HalinarzoQuest_Speed);
if (BaseLevel < 40) neutral();
if (getequipid(EQI_HEAD_MID) < 1) naked();
if (getequipid(EQI_HEAD_TOP) < 1) naked();
if (getequipid(EQI_HAND_R) < 1) disarmed();
if (getequipid(EQI_HAND_L) < 1) disarmed();
+ if (@pachua) running();
if (.@q <= 0) hungry();
if (.@q == 1) speed();
+ if (.@q < 10) retry();
neutral();
close;
@@ -47,7 +53,13 @@ function disarmed {
function slow {
mesn;
- mesq l("...Try allocating some points in agility before we continue. I think %d should be suffice.", 40);
+ mesq l("...Try allocating some points in agility before we continue. I think %d should be suffice.", getarg(0, 40));
+ close;
+}
+
+function restricted {
+ mesn;
+ mesq l("Sorry, but this quest cannot be done by staff.");
close;
}
@@ -96,13 +108,118 @@ function hungry {
close;
}
+/////////////////////////////////////////////////////////////////////////////////
function speed {
- if (readparam2(bAgi) < 40) speed();
+ if (is_staff() && !$@GM_OVERRIDE && !debug) restricted();
+ if (readparam2(bAgi) < 40) slow();
mesn;
mesq l("Have you thought on my proposal? I'll only charge you %d GP or a %s for each attempt made.", .price, getitemlink(.alt));
+ next;
+ select
+ l("Not now, thanks."),
+ rif(Zeny >= .price, l("I'll pay the GP.")),
+ rif(countitem(.alt), l("I'll give you the item."));
+ mes "";
+ if (@menu == 1) close;
+ if (@menu == 2) Zeny -= .price;
+ if (@menu == 3) delitem .alt, 1;
+ start();
+ return;
+}
+
+function start {
+ mesn;
+ mesq l("Great! It is simple, really. Pachua and I are scouting the desert. Run as fast as you can to Pachua, and then run back here. Pachua will send a smoke signal when you talk to him, so I'll know you haven't cheated.");
+ next;
+ mesn;
+ mesq l("Try to make a good time, and... Good luck! On my signal, 3, 2, 1...");
+ next;
+ setq2 HalinarzoQuest_Speed, gettimetick(2) + 1; // Grace time due @refresh
+ @pachua = 1;
+ slide 146, 115;
+ closeclientdialog;
+ // META: How they know your name? ...Via label, obviously.
+ npctalk3 l("GO! Run, %s, RUN!!!!", strcharinfo(0));
+ atcommand("@refresh");
+ close;
+}
+
+function running {
+ if (@pachua < 2) {
+ npctalk3 l("What are you waiting for?! Get running, Pachua is waiting!");
+ closeclientdialog;
+ close;
+ }
+ // Pachua == 2, completed the run
+ .@to = getq2(HalinarzoQuest_Speed);
+ .@q = getq(HalinarzoQuest_Speed);
+ .@t = gettimetick(2) - .@to;
+ .@r = getq3(HalinarzoQuest_Speed);
+ @pachua = 0;
+ mesn;
+ mesq l("...And stop! You took %s this time!", FuzzyTime(.@t));
+ if (.@t < 15) {
+ mesc l("That's obviously impossible, so I'll voiding your result!");
+ close;
+ }
+ if (.@t < .@r) {
+ mesc l("That's %d seconds better than your previous record!", .@r - .@t);
+ }
+ if (!.@r || .@t < .@r)
+ setq3 HalinarzoQuest_Speed, .@t;
+ setq2 HalinarzoQuest_Speed, 0;
+ next;
+ // Condition
+ .@g = 320 - (.@q * 20);
+ if (.@t > .@g) {
+ mesn;
+ mesq l("You took more than %s to do this, that is lame! Better luck next time.", FuzzyTime(.@g));
+ // Consolation Prize
+ if (.@t < 450) {
+ next;
+ mesn;
+ mesq l("...Well, I'll refund you 10% because it was not utterly terrible.");
+ Zeny += .price / 10;
+ }
+ // MISSION FAILED
+ mesc l("RACE FAILED."), 1;
+ close;
+ }
+ // Ooh, you did it!
+ setq1 HalinarzoQuest_Speed, .@q + 1;
+ getexp 2500, 0;
+ mesn;
+ mesq l("I'm proud of you!");
+ if (getq(HalinarzoQuest_Speed) < 10)
+ mesc l("Feel free to try again whenever.");
close;
}
+function retry {
+ if (is_staff() && !$@GM_OVERRIDE && !debug) restricted;
+ .@q = getq(HalinarzoQuest_Speed);
+ .@p = .price * .@q;
+ .@s = 40 + (.@q * 5);
+ if (readparam2(bAgi) < .@s) slow(.@s);
+ mesn;
+ mesq l("To retry, I will charge you %d GP or %d %s for each attempt made. You'll have less time to finish as well.", .@p, .@q, getitemlink(.alt));
+ next;
+ select
+ l("Not now, thanks."),
+ rif(Zeny >= .@p, l("I'll pay the GP.")),
+ rif(countitem(.alt) >= .@q, l("I'll give you the item."));
+ mes "";
+ if (@menu == 1) close;
+ if (@menu == 2) Zeny -= .@p;
+ if (@menu == 3) delitem .alt, .@q;
+ start();
+ return;
+}
+
+OnTouch:
+ if (@pachua) running();
+ end;
+
OnInit:
.distance = 4;
.sex = G_MALE;