summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
Diffstat (limited to 'npc')
-rw-r--r--npc/016-1/marine.txt72
-rw-r--r--npc/functions/util.txt94
2 files changed, 151 insertions, 15 deletions
diff --git a/npc/016-1/marine.txt b/npc/016-1/marine.txt
index b1dbe24df..c5cd3ef26 100644
--- a/npc/016-1/marine.txt
+++ b/npc/016-1/marine.txt
@@ -5,38 +5,46 @@
// Temporary, placeholder.
016-1,19,29,0 script Captain NPC_NARD,{
- .@price=1500;
-
if (BaseLevel < 20)
goto L_TooWeak;
- if (nard_reputation() >= 11)
- .@price-=1000;
- else if (nard_reputation() >= 9)
- .@price-=750;
- else if (nard_reputation() >= 7)
- .@price-=500;
- else if (nard_reputation() >= 5)
- .@price-=250;
mesn;
mesq l("Hi @@.", strcharinfo(0));
next;
mesq l("You are currently at @@.", LOCATION$);
mes "";
- mes l("A ship travel will cost you @@ GP.", .@price);
- if (Zeny >= .@price) {
menu
rif(LOCATION$ != "Tulim", l("To Tulimshar.")), L_TTulim,
rif(LOCATION$ != "Hurns", l("To Hurnscald.")), L_THurns,
l("No, I'll save my money."), -;
- } else {
- mes l("You still need @@ GP to afford it.", (.@price-Zeny));
- }
close;
L_THurns:
+ .@price=2000;
+ .@x=marine_reputation("Hurns");
+
+ if (.@x >= 3)
+ .@price-=1500;
+ else if (.@x >= 2)
+ .@price-=1000;
+ else if (.@x >= 1)
+ .@price-=500;
+
+ mes "";
+ mesn;
+ mesq l("It'll cost you @@ GP.", .@price);
+ mes "";
+
+ if (Zeny < .@price) {
+ mes l("You still need @@ GP to afford it.", (.@price-Zeny));
+ close;
+ }
+
+ if (askyesno() != ASK_YES)
+ close;
+
Zeny=Zeny-.@price;
PC_DEST$="Hurns";
@@ -51,7 +59,41 @@ L_THurns:
warp "016-6", 40, 32;
end;
+
+
+
+
+
+
+
L_TTulim:
+ .@price=2000;
+ .@x=marine_reputation("Tulim");
+
+ if (.@x >= 10)
+ .@price-=1500;
+ else if (.@x >= 8)
+ .@price-=1000;
+ else if (.@x >= 6)
+ .@price-=750;
+ else if (.@x >= 4)
+ .@price-=500;
+ else if (.@x >= 2)
+ .@price-=250;
+
+ mes "";
+ mesn;
+ mesq l("It'll cost you @@ GP.", .@price);
+ mes "";
+
+ if (Zeny < .@price) {
+ mes l("You still need @@ GP to afford it.", (.@price-Zeny));
+ close;
+ }
+
+ if (askyesno() != ASK_YES)
+ close;
+
Zeny=Zeny-.@price;
PC_DEST$="Tulim";
addtimer nard_time(PC_DEST$), "#MarineShip::OnEvent";
diff --git a/npc/functions/util.txt b/npc/functions/util.txt
index 509d4bd15..dfdd763af 100644
--- a/npc/functions/util.txt
+++ b/npc/functions/util.txt
@@ -107,6 +107,100 @@ function script nard_reputation {
}
+/*
+// Calcs maximum reputation for each destination
+function script marine_maxre {
+ if (getarg(0) == "Tulim")
+ return 10;
+ if (getarg(0) == "Hurns")
+ return 3;
+ dispbottom l("Error, marine_maxre invalid @@", getarg(0, "-NO ARGS SUPPLIED-"));
+ return -1;
+}
+*/
+
+// Returns reputation with the La Marine for discounts
+// Takes one argument (PC_DEST$). Grep for "getarg".
+// Before updating this, update marine_maxre too!
+function script marine_reputation {
+ .@nr=0; // Base reputation
+
+ // Tulimshar Quests (10 points)
+ if (getarg(0) == "Tulim") {
+ // Swezanne Quest (+1 rep)
+ if (getq(TulimsharQuest_Swezanne) >= 1)
+ .@nr=.@nr+1;
+
+ // Sailors Quest (+1 rep)
+ if (getq(TulimsharQuest_Sailors) >= 2)
+ .@nr=.@nr+1;
+
+ // Hasan Quest (+1 rep)
+ if (getq(TulimsharQuest_Hasan) >= 5)
+ .@nr=.@nr+1;
+
+ // Dausen Quest (+1 rep)
+ if (getq(TulimsharQuest_WaterForGuard) >= 3)
+ .@nr=.@nr+1;
+
+ // Eugene Quest (+1 rep)
+ if (getq(TulimsharQuests_Fishman) >= 2)
+ .@nr=.@nr+1;
+
+ // Sarah Quest (+1 rep)
+ if (getq(TulimsharQuest_Sarah) >= 1)
+ .@nr=.@nr+1;
+
+ // Silvia Quest (+1 rep)
+ if (getq(TulimsharQuest_Lifestone) >= 2)
+ .@nr=.@nr+1;
+
+ /*
+ // Eisten Quest (+1 rep)
+ if (getq(TulimsharQuest_Eistein) >= 6)
+ .@nr=.@nr+1;
+ */
+
+ // Devoir Quest (+1 rep)
+ if (getq(TulimsharQuest_Devoir) >= 1)
+ .@nr=.@nr+1;
+
+ // Zarkor Quest (+1 rep)
+ if (getq(TulimsharQuest_DarkInvocator) >= 7)
+ .@nr=.@nr+1;
+
+ /*
+ // Anwar Quest (+1 rep)
+ if (getq(TulimsharQuest_AnwarField) >= 99)
+ .@nr=.@nr+1;
+ */
+
+ // Tycoon Quest (+1 rep)
+ if (getq(MineQuest_Tycoon) >= 15)
+ .@nr=.@nr+1;
+
+ // Hurnscald Quests (3 points)
+ } else if (getarg(0) == "Hurns") {
+
+ // Alan Quest (+1 rep)
+ if (getq(HurscaldQuest_ForestBow) >= 2)
+ .@nr=.@nr+1;
+
+ // Gwendolyn Quest (+1 rep)
+ if (getq(HurnscaldQuest_HarkEye) >= 6)
+ .@nr=.@nr+1;
+
+ // Celestia Quest (+1 rep)
+ if (getq(HurnscaldQuest_TeaParty) >= 2)
+ .@nr=.@nr+1;
+
+ }
+
+ //debugmes "Reputation: "+str(.@nr);
+ return .@nr;
+
+}
+
// Returns time for ship travel.
// Can be modified by a factor.