summaryrefslogtreecommitdiff
path: root/npc/items/require_stat.txt
diff options
context:
space:
mode:
Diffstat (limited to 'npc/items/require_stat.txt')
-rw-r--r--npc/items/require_stat.txt17
1 files changed, 17 insertions, 0 deletions
diff --git a/npc/items/require_stat.txt b/npc/items/require_stat.txt
new file mode 100644
index 00000000..815f7b5a
--- /dev/null
+++ b/npc/items/require_stat.txt
@@ -0,0 +1,17 @@
+// Unequip if stat not enough
+// callfunc "RequireStat", bDex, 80, EQI_HAND_R;
+function script RequireStat {
+ // If you can equip *anything*, this restriction is moot
+ if (has_permission(PERM_USE_ALL_EQUIPMENT, getcharid(3)))
+ return;
+ // Load stat requisites
+ .@stat = getarg(0);
+ .@min = getarg(1);
+ .@me = getarg(2);
+ .@val = readparam(.@stat);
+ // If the requirement isn't met, we set an unequip trigger.
+ // The item is now removed.
+ if (.@val < .@min)
+ unequip(.@me);
+ return;
+}