summaryrefslogtreecommitdiff
path: root/npc/functions/main.txt
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2021-04-10 03:00:20 -0300
committerJesusaves <cpntb1@ymail.com>2021-04-10 03:00:20 -0300
commitba1e827b6b4c17c35a163e6b55be8c122de632b8 (patch)
tree819f93d0ffee3697e336471710afb9681f0b8d86 /npc/functions/main.txt
parent6e7f3113c0faad9edd4367d100ba9dd77e8d3130 (diff)
downloadserverdata-ba1e827b6b4c17c35a163e6b55be8c122de632b8.tar.gz
serverdata-ba1e827b6b4c17c35a163e6b55be8c122de632b8.tar.bz2
serverdata-ba1e827b6b4c17c35a163e6b55be8c122de632b8.tar.xz
serverdata-ba1e827b6b4c17c35a163e6b55be8c122de632b8.zip
Add several convenience functions. Fix some bugs regarding misuse of readparam()
Diffstat (limited to 'npc/functions/main.txt')
-rw-r--r--npc/functions/main.txt37
1 files changed, 9 insertions, 28 deletions
diff --git a/npc/functions/main.txt b/npc/functions/main.txt
index a3e222e8..eac02526 100644
--- a/npc/functions/main.txt
+++ b/npc/functions/main.txt
@@ -307,6 +307,13 @@ function script die {
return;
}
+// Returns if a map is on PVP Mode or Not
+// ispvpmap( {mapid} )
+function script ispvpmap {
+ .@mapa$=getarg(0, getmapname());
+ return (getmapflag(.@mapa$, mf_pvp) || getmapflag(.@mapa$, mf_pvp_noparty) || getmapflag(.@mapa$, mf_pvpnoguild));
+}
+
// TMW2 Custom Functions
/////////////////////////////////////////////
@@ -602,33 +609,7 @@ function script registercmd {
return;
}
-//////////////////////////////////////////////////////////////////////
-// maptimer("<map>", <tick>, "<npc>::<event>")
-function script maptimer {
- .@c = getunits(BL_PC, .@players, false, getarg(0));
- for (.@i = 0; .@i < .@c; .@i++) {
- addtimer(getarg(1), getarg(2), .@players[.@i]);
- }
- return .@i;
-}
-
-// areatimer("<map>", <x1>, <y1>, <x2>, <y2>, <tick>, "<npc>::<event>")
-function script areatimer {
- // Legacy
- if (getargcount() > 7)
- .@ox=1;
- // Variables
- .@m$=getarg(.@ox); .@ox+=1;
- .@x1=getarg(.@ox); .@ox+=1;
- .@y1=getarg(.@ox); .@ox+=1;
- .@x2=getarg(.@ox); .@ox+=1;
- .@y2=getarg(.@ox); .@ox+=1;
- .@tk=getarg(.@ox); .@ox+=1;
- .@e$=getarg(.@ox); .@ox+=1;
- .@c = getunits(BL_PC, .@players, false, .@m$, .@x1, .@y1, .@x2, .@y2);
- for (.@i = 0; .@i < .@c; .@i++) {
- addtimer(.@tk, .@e$, .@players[.@i]);
- }
- return .@i;
+function script iscollision {
+ return checknpccell(getarg(0), getarg(1), getarg(2), cell_chkpass);
}