diff options
Diffstat (limited to 'world/map/npc/functions')
-rw-r--r-- | world/map/npc/functions/ferry.txt | 4 | ||||
-rw-r--r-- | world/map/npc/functions/time.txt | 57 | ||||
-rw-r--r-- | world/map/npc/functions/travelers.txt | 7 |
3 files changed, 59 insertions, 9 deletions
diff --git a/world/map/npc/functions/ferry.txt b/world/map/npc/functions/ferry.txt index 3d5f8ebb..aad92b14 100644 --- a/world/map/npc/functions/ferry.txt +++ b/world/map/npc/functions/ferry.txt @@ -40,8 +40,6 @@ L_NextDock: donpcevent "#k1sound::OnCommandDing"; donpcevent "#k2sound::OnCommandDing"; - //mapannounce "035-2", " Koga - Main:* Now arriving in "+$@MainDocks$[$@MainCurrentDock]+".", 0; - //mapannounce "036-2", " Koga - Candor:* Now arriving in "+$@CandorDocks$[$@CandorCurrentDock]+".", 0; initnpctimer; if($@MainCurrentDock == 2) goto L_k1city1; @@ -52,8 +50,6 @@ L_NextDock: OnTimer8000: if ($@DockTickCount > $@DockLeaveCount) goto L_NextDock; - //mapannounce "035-2", "Koga - Main:* Now docked in "+$@MainDocks$[$@MainCurrentDock]+", Departing soon", 0; - //mapannounce "036-2", "Koga - Candor:* Now docked in "+$@CandorDocks$[$@CandorCurrentDock]+", Departing soon", 0; set $@DockTickCount, $@DockTickCount + 1; initnpctimer; end; diff --git a/world/map/npc/functions/time.txt b/world/map/npc/functions/time.txt index 695c4cec..7d16a200 100644 --- a/world/map/npc/functions/time.txt +++ b/world/map/npc/functions/time.txt @@ -61,13 +61,20 @@ function|script|time_stamp // HumanTime - returns a human-readable time // author: meko -// Variables: +// Internal variables: +// @separator$, @unit$, @unit2$, @unit3$, @unit4$, @unit5$ +// @seconds, @minutes, @hours, @days + +// Public Variables: // input @ms integer // output @time$ string function|script|HumanTime { set @time$, "now"; + if(@seconds) set @ms, @ms + (@seconds * 1000); + if(@minutes) set @ms, @ms + (@minutes * 60000); + if(@days) set @ms, @ms + (@days * 1440000); if(@ms < 1000) goto L_Millis; // under 1 second we have nothing to count set @seconds, @ms / 1000; set @ms, @ms % 1000; @@ -77,8 +84,11 @@ function|script|HumanTime if(@minutes < 60) goto L_Minutes; set @hours, @minutes / 60; set @minutes, @minutes % 60; - if(@hours < 60) goto L_Hours; - return; + if(@hours < 24) goto L_Hours; + set @days, @hours / 24; + set @hours, @hours % 24; + if(@days) goto L_Days; + goto L_Clean; L_Millis: set @time$, @ms + "ms"; @@ -91,7 +101,7 @@ L_Seconds: if(@ms > 1) set @unit2$, "milliseconds"; set @time$, @seconds + " " + @unit$; if(@ms) set @time$, @time$ + " and " + @ms + " " + @unit2$; - return; + goto L_Clean; L_Minutes: set @unit$, "minute"; @@ -105,7 +115,7 @@ L_Minutes: if(@ms) set @separator$, ", "; if(@seconds) set @time$, @time$ + @separator$ + @seconds + " " + @unit2$; if(@ms) set @time$, @time$ + " and " + @ms + " " + @unit3$; - return; + goto L_Clean; L_Hours: set @unit$, "hour"; @@ -124,5 +134,42 @@ L_Hours: if(@ms) set @separator$, ", "; if(@seconds) set @time$, @time$ + @separator$ + @seconds + " " + @unit3$; if(@ms) set @time$, @time$ + " and " + @ms + " " + @unit4$; + goto L_Clean; + +L_Days: + set @unit$, "day"; + if(@hours > 1) set @unit$, "days"; + set @unit2$, "hour"; + if(@hours > 1) set @unit2$, "hours"; + set @unit3$, "minute"; + if(@minutes > 1) set @unit3$, "minutes"; + set @unit4$, "second"; + if(@seconds > 1) set @unit4$, "seconds"; + set @unit5$, "millisecond"; + if(@ms > 1) set @unit5$, "milliseconds"; + set @time$, @days + " " + @unit$; + set @separator$, " and "; + if(@minutes || @seconds || @ms) set @separator$, ", "; + if(@hours) set @time$, @time$ + @separator$ + @hours + " " + @unit2$; + set @separator$, " and "; + if(@seconds || @ms) set @separator$, ", "; + if(@minutes) set @time$, @time$ + @separator$ + @minutes + " " + @unit3$; + set @separator$, " and "; + if(@ms) set @separator$, ", "; + if(@seconds) set @time$, @time$ + @separator$ + @seconds + " " + @unit3$; + if(@ms) set @time$, @time$ + " and " + @ms + " " + @unit4$; + goto L_Clean; + +L_Clean: + set @unit$, ""; + set @unit2$, ""; + set @unit3$, ""; + set @unit4$, ""; + set @unit5$, ""; + set @seconds, 0; + set @minutes, 0; + set @hours, 0; + set @days, 0; + set @separator$, ""; return; } diff --git a/world/map/npc/functions/travelers.txt b/world/map/npc/functions/travelers.txt index a1db712e..07b084d9 100644 --- a/world/map/npc/functions/travelers.txt +++ b/world/map/npc/functions/travelers.txt @@ -189,6 +189,13 @@ L_TravelPachua: set @NextLocationMap$, "006-1"; set @NextLocationX, 28; set @NextLocationY, 97; + if(QUEST_MIRIAM_start != 0) goto L_Cheat; + goto L_TravelChecks; + +L_Cheat: + set QUEST_MIRIAM_cheat, 1; + set QUEST_MIRIAM_run, gettimetick(2) - QUEST_MIRIAM_start; + set QUEST_MIRIAM_start, 0; goto L_TravelChecks; L_TravelBarbarians: |