summaryrefslogtreecommitdiff
path: root/npc/functions
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-05-01 10:59:43 +0000
committerWildX <wildx@evolonline.org>2019-05-01 10:59:43 +0000
commit1fcfb18c2cf527043ba08b3ac578898b04c08f77 (patch)
tree76346f46fe852ec18c1a894e5bc1a9a76a57d77f /npc/functions
parente478440a8fb70fa0cbc67020f68a849de9949365 (diff)
downloadserverdata-1fcfb18c2cf527043ba08b3ac578898b04c08f77.tar.gz
serverdata-1fcfb18c2cf527043ba08b3ac578898b04c08f77.tar.bz2
serverdata-1fcfb18c2cf527043ba08b3ac578898b04c08f77.tar.xz
serverdata-1fcfb18c2cf527043ba08b3ac578898b04c08f77.zip
Make Mundane walk, instead of jumping.
Maybe he should walk faster than player, as he is scared. I just read npc/funcs/npcmove* to accomplish my task. Thanks, @toams and 4144!
Diffstat (limited to 'npc/functions')
-rw-r--r--npc/functions/math.txt10
-rw-r--r--npc/functions/quest-debug/032-ArtisQuests_MonaDad.txt3
-rw-r--r--npc/functions/util.txt36
3 files changed, 47 insertions, 2 deletions
diff --git a/npc/functions/math.txt b/npc/functions/math.txt
index 004125c7..357407da 100644
--- a/npc/functions/math.txt
+++ b/npc/functions/math.txt
@@ -2,6 +2,7 @@
// Authors:
// 4144
// Reid
+// Jesusalva
// Description:
// Math functions
@@ -38,3 +39,12 @@ function script lognbaselvl {
return .@ret;
}
+
+
+// result is: lower < target <= higher
+// is_between ( lower, higher, target)
+function script is_between {
+ .@val=getarg(2);
+ return (getarg(0) < .@val && getarg(1) >= .@val);
+}
+
diff --git a/npc/functions/quest-debug/032-ArtisQuests_MonaDad.txt b/npc/functions/quest-debug/032-ArtisQuests_MonaDad.txt
index 68ba67fe..bda45b90 100644
--- a/npc/functions/quest-debug/032-ArtisQuests_MonaDad.txt
+++ b/npc/functions/quest-debug/032-ArtisQuests_MonaDad.txt
@@ -14,7 +14,8 @@ function script QuestDebug32 {
GenericQuestDebug ArtisQuests_MonaDad,
l("Does not have the quest"), 0,
- l("Mona's dad is missing"), 1;
+ l("Mona's dad is missing"), 1,
+ l("Mona's dad was rescued"), 3;
if (@menuret < 0)
{
diff --git a/npc/functions/util.txt b/npc/functions/util.txt
index d5fe8bc4..a8e157b2 100644
--- a/npc/functions/util.txt
+++ b/npc/functions/util.txt
@@ -107,6 +107,40 @@ function script get_race {
return .@allskins$[.@g];
else
return .@allskins$[.@g] + " " + .@allraces$[.@g];
-
}
+// gettimeparam(GETTIME_X)
+// Returns the number of seconds/minutes/hours/days/months/years since 01/01/1970
+// This is for truly daily quests, which doesn't imposes a timed wait in hours
+function script gettimeparam {
+ .@p=getarg(0, GETTIME_MINUTE);
+
+ // Seconds (same as gettimetick(2) - use that instead)
+ .@t=gettimetick(2);
+ if (.@p == GETTIME_SECOND)
+ return .@t;
+
+ // Minutes (default)
+ .@t=.@t/60;
+ if (.@p == GETTIME_MINUTE)
+ return .@t;
+
+ // Hours
+ .@t=.@t/60;
+ if (.@p == GETTIME_HOUR)
+ return .@t;
+
+ // Days
+ .@t=.@t/24;
+ if (.@p == GETTIME_DAYOFMONTH)
+ return .@t;
+
+ // Months (estimative)
+ .@t=.@t/30;
+ if (.@p == GETTIME_MONTH)
+ return .@t;
+
+ // Years (estimative, unused, fallback)
+ .@t=.@t/12;
+ return .@t;
+}