summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
Diffstat (limited to 'npc')
-rw-r--r--npc/002-4/nard.txt18
-rw-r--r--npc/002-5/main.txt46
-rw-r--r--npc/functions/util.txt24
3 files changed, 62 insertions, 26 deletions
diff --git a/npc/002-4/nard.txt b/npc/002-4/nard.txt
index 9ff46c1a1..982c0cf27 100644
--- a/npc/002-4/nard.txt
+++ b/npc/002-4/nard.txt
@@ -192,25 +192,35 @@ L_Travel:
L_TCandor:
Zeny=Zeny-.@price;
- LOCATION$="Candor";
+ PC_DEST$="Candor";
mes "";
mesn;
mesq l("Candor Island, then? Yes, that is a pretty island, right?");
next;
mesq l("I was planning to go there soon, anyway. All aboard!");
- close;
+ close2;
+ addtimer nard_time(PC_DEST$), "#NardShip::OnEvent";
+ @timer_navio_running = 1;
+ warp "002-5", 39, 26;
+ end;
L_TTulim:
Zeny=Zeny-.@price;
- LOCATION$="Tulim";
+ PC_DEST$="Tulim";
+ addtimer nard_time(PC_DEST$), "#NardShip::OnEvent";
+ @timer_navio_running = 1;
mes "";
mesn;
mesq l("Tulimshar, right? The oldest human city-state!");
next;
mesq l("I was planning to go there soon, anyway. All aboard!");
- close;
+ close2;
+ addtimer nard_time(PC_DEST$), "#NardShip::OnEvent";
+ @timer_navio_running = 1;
+ warp "002-5", 39, 26;
+ end;
L_Close:
close;
diff --git a/npc/002-5/main.txt b/npc/002-5/main.txt
index 52609ff17..226f592bb 100644
--- a/npc/002-5/main.txt
+++ b/npc/002-5/main.txt
@@ -1,48 +1,50 @@
// TMW2 script
// Originals from TMW-BR
-// TODO WARNING: File not yet modified. DO NOT USE.
+// Imported by Jesusalva
-002-5,28,27,0 script #teleporterNavio NPC_HIDDEN,117,29,{
+002-5,28,27,0 script #NardShip NPC_HIDDEN,117,29,{
end;
OnEvent:
- if (PC_DEST == 1) goto L_Destino1;
- if (PC_DEST == 2) goto L_Destino2;
- if (PC_DEST == 3) goto L_Destino3;
+ if (PC_DEST$ == "Candor") goto L_Candor;
+ else if (PC_DEST$ == "Tulim") goto L_Tulim;
+ else goto L_Error;
end;
-L_Destino1:
- message strcharinfo(0), "" + strcharinfo(0) + " desembarcou na Ilha de Bhramir.";
- warp "007", 21, 94;
- PC_DEST = 0;
+L_Candor:
+ PC_DEST$ = "";
@timer_navio_running = 0;
+ warp "005-1", 42, 107;
+ message strcharinfo(0), l("@@ disembarks at Candor Island.", strcharinfo(0));
end;
-L_Destino2:
- message strcharinfo(0), "" + strcharinfo(0) + " desembarcou no Polo Norte.";
- warp "010", 178, 67;
- PC_DEST = 0;
+L_Tulim:
+ PC_DEST$ = "";
@timer_navio_running = 0;
+ warp "003-1", 81, 68;
+ message strcharinfo(0), l("@@ disembarks at Tulimshar.", strcharinfo(0));
end;
-L_Destino3:
- message strcharinfo(0), "" + strcharinfo(0) + " desembarcou nas Terras Desconhecidas.";
- warp "org016", 51, 102;
- PC_DEST = 0;
+L_Error:
+ debugmes "ERROR: PLAYER INVALID PC_DEST ON #NardShip: " + PC_DEST$;
+ PC_DEST$ = "";
@timer_navio_running = 0;
+ warp "000-1", 22, 22;
+ dispbottom l("An error on your travel happened. Please report.");
end;
}
+// Do not add .distance here.
002-5,40,26,0 script Elmo#002-5 NPC_ELMO,{
- set @porto, 0; // Em alto mar
- //callfunc "CapitaoMirc";
- hello;
+ npctalk3 l("It won't be long before we reach our destination...");
close2;
- if (PC_DEST != 0 && @timer_navio_running == 0) goto L_Timer;
+ // If player logged out during travel, this Elmo can reset player travel time.
+ if (PC_DEST$ != "" && @timer_navio_running == 0) goto L_Timer;
end;
L_Timer:
- addtimer 42000, "#teleporterNavio::OnEvent";
+ addtimer nard_time(PC_DEST$), "#NardShip::OnEvent";
@timer_navio_running = 1;
end;
+
}
diff --git a/npc/functions/util.txt b/npc/functions/util.txt
index 10c9fbbfa..78ba1f519 100644
--- a/npc/functions/util.txt
+++ b/npc/functions/util.txt
@@ -91,4 +91,28 @@ function script nard_reputation {
}
+// Returns time for ship travel.
+// Can be modified by a factor.
+function script nard_time {
+ // Estimates time to move by ship from LOCATION$ to getarg(0)
+
+ // Candor
+ if (LOCATION$ == "Candor") {
+ if (getarg(0) == "Tulim")
+ return 42000;
+
+ }
+ // Candor
+ if (LOCATION$ == "Tulim") {
+ if (getarg(0) == "Candor")
+ return 42000;
+
+ }
+
+ // Error
+ debugmes "ERROR, INVALID LOCATION AND DESTINATION";
+ debugmes l("@@ -> @@", LOCATION$, getarg(0));
+ dispbottom l("An error on your travel time happened. Please report.");
+ return 99999999999;
+}