summaryrefslogtreecommitdiff
path: root/npc/functions
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-04-27 12:43:48 -0300
committerJesusaves <cpntb1@ymail.com>2020-04-27 12:43:48 -0300
commitabdee2ccaa24f361eef4bc44f11c5b900ae6ce25 (patch)
tree278060590bf34b54b742eb6ee63f9ae1e4a1dea3 /npc/functions
parentb2fc469c9ac9cd9bc3df335ac2acda488ac9d18f (diff)
downloadserverdata-abdee2ccaa24f361eef4bc44f11c5b900ae6ce25.tar.gz
serverdata-abdee2ccaa24f361eef4bc44f11c5b900ae6ce25.tar.bz2
serverdata-abdee2ccaa24f361eef4bc44f11c5b900ae6ce25.tar.xz
serverdata-abdee2ccaa24f361eef4bc44f11c5b900ae6ce25.zip
Sketch, playing with filters, for fake skills implementations
Diffstat (limited to 'npc/functions')
-rw-r--r--npc/functions/filters.txt41
1 files changed, 41 insertions, 0 deletions
diff --git a/npc/functions/filters.txt b/npc/functions/filters.txt
new file mode 100644
index 000000000..77833d5fb
--- /dev/null
+++ b/npc/functions/filters.txt
@@ -0,0 +1,41 @@
+// TMW2 scripts.
+// Authors:
+// Jesusalva
+// Description:
+// Several filters
+
+// filter_always( id )
+function script filter_always {
+ return true;
+}
+
+// filter_onlyme( id )
+function script filter_onlyme {
+ return (getarg(0) == getcharid(3));
+}
+
+// filter_notme( id )
+function script filter_notme {
+ return (getarg(0) != getcharid(3));
+}
+
+// filter_sameguild( id )
+function script filter_sameguild {
+ if (getcharid(2) < 1)
+ return false;
+ return (strcharinfo(2, "~!<mk>@tmw2.org", getarg(0)) == strcharinfo(2));
+}
+
+// filter_sameparty( id )
+function script filter_sameparty {
+ if (getcharid(1) < 1 && getarg(0) != getcharid(3))
+ return false;
+ return (strcharinfo(1, "~!<mk>@tmw2.org", getarg(0)) == strcharinfo(1));
+}
+
+// filter_notboss( id )
+function script filter_notboss {
+ // 32 = MD_BOSS
+ return (!(getunitdata(getarg(0), UDT_MODE) & 32));
+}
+