summaryrefslogtreecommitdiff
path: root/npc/functions/main.txt
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2021-04-13 12:45:06 -0300
committerJesusaves <cpntb1@ymail.com>2021-04-13 12:45:06 -0300
commitf58b9f150388f1d1c829c2bfcff820f998f6b278 (patch)
tree4e7f6c54c276a2c4a8be9d22c8a2747d8bd13d02 /npc/functions/main.txt
parent70c4cda878f92670d49268be15f0545d1ea99897 (diff)
downloadserverdata-f58b9f150388f1d1c829c2bfcff820f998f6b278.tar.gz
serverdata-f58b9f150388f1d1c829c2bfcff820f998f6b278.tar.bz2
serverdata-f58b9f150388f1d1c829c2bfcff820f998f6b278.tar.xz
serverdata-f58b9f150388f1d1c829c2bfcff820f998f6b278.zip
Split files to be more ordely, add (or finish adding) the Abizit skill
Diffstat (limited to 'npc/functions/main.txt')
-rw-r--r--npc/functions/main.txt96
1 files changed, 52 insertions, 44 deletions
diff --git a/npc/functions/main.txt b/npc/functions/main.txt
index bb1887d2..e274bd91 100644
--- a/npc/functions/main.txt
+++ b/npc/functions/main.txt
@@ -468,7 +468,57 @@ function script Exception {
}
return getarg(2, 0);
+}
+
+// mescordialog(text, color, {dialog=1})
+function script mescordialog {
+ if (getarg(2, true))
+ mesc getarg(0), getarg(1);
+ else
+ dispbottom col(getarg(0), getarg(1));
+ return;
+}
+// Delayed healing. Takes 3~5 seconds. Variates with Vit up to +100%.
+// The vit can have an additional 20% bonus as well.
+function script itheal {
+ .@bas=getarg(0);
+ .@vit=readbattleparam(getcharid(3), UDT_VIT);
+ .@vit=cap_value(.@vit-1, 0, 100);
+ if (getargcount() > 2)
+ .@tim=getarg(3);
+ else
+ .@tim=rand2(3,5);
+ .@min=.@bas*(100+.@vit)/100;
+ .@max=.@bas*(100+.@vit*120/100)/100;
+ // Now divide the HP values by the time
+ .@min=max(1, .@min/.@tim);
+ .@max=max(1, .@max/.@tim);
+ callfunc("SC_Bonus", .@tim, SC_S_LIFEPOTION, .@min, .@max);
+ if (getarg(1,0) > 0)
+ heal 0, getarg(1, 0);
+ return;
+}
+
+// sqldate({day variation, month variation})
+function script sqldate {
+ .@d=gettime(GETTIME_DAYOFMONTH)+getarg(0, 0);
+ .@m=gettime(GETTIME_MONTH)+getarg(1, 0);
+ .@y=gettime(GETTIME_YEAR);
+ // Overflow prevention
+ if (.@d <= 0) {
+ .@d=1;
+ }
+ while (.@m > 12) {
+ .@y+=1;
+ .@m-=12;
+ }
+ while (.@m < 1) {
+ .@y-=1;
+ .@m+=12;
+ }
+ .@strdate$=sprintf("%04d-%02d-%02d %02d:%02d:%02d", .@y, .@m, .@d, gettime(GETTIME_HOUR), gettime(GETTIME_MINUTE), gettime(GETTIME_SECOND));
+ return .@strdate$;
}
// Linking functions
@@ -628,50 +678,8 @@ function script updateskill {
}
function script learnskill {
- if (getskilllv(getarg(0)) < getarg(1))
- skill getarg(0), getarg(1), 0;
- return;
-}
-
-// Delayed healing. Takes 3~5 seconds. Variates with Vit up to +100%.
-// The vit can have an additional 20% bonus as well.
-function script itheal {
- .@bas=getarg(0);
- .@vit=readbattleparam(getcharid(3), UDT_VIT);
- .@vit=cap_value(.@vit-1, 0, 100);
- if (getargcount() > 2)
- .@tim=getarg(3);
- else
- .@tim=rand2(3,5);
- .@min=.@bas*(100+.@vit)/100;
- .@max=.@bas*(100+.@vit*120/100)/100;
- // Now divide the HP values by the time
- .@min=max(1, .@min/.@tim);
- .@max=max(1, .@max/.@tim);
- callfunc("SC_Bonus", .@tim, SC_S_LIFEPOTION, .@min, .@max);
- if (getarg(1,0) > 0)
- heal 0, getarg(1, 0);
+ if (getskilllv(getarg(0)) < getarg(1, 1))
+ skill getarg(0), getarg(1, 1), 0;
return;
}
-// sqldate({day variation, month variation})
-function script sqldate {
- .@d=gettime(GETTIME_DAYOFMONTH)+getarg(0, 0);
- .@m=gettime(GETTIME_MONTH)+getarg(1, 0);
- .@y=gettime(GETTIME_YEAR);
- // Overflow prevention
- if (.@d <= 0) {
- .@d=1;
- }
- while (.@m > 12) {
- .@y+=1;
- .@m-=12;
- }
- while (.@m < 1) {
- .@y-=1;
- .@m+=12;
- }
- .@strdate$=sprintf("%04d-%02d-%02d %02d:%02d:%02d", .@y, .@m, .@d, gettime(GETTIME_HOUR), gettime(GETTIME_MINUTE), gettime(GETTIME_SECOND));
- return .@strdate$;
-}
-