summaryrefslogtreecommitdiff
path: root/npc/functions/main.txt
diff options
context:
space:
mode:
Diffstat (limited to 'npc/functions/main.txt')
-rw-r--r--npc/functions/main.txt13
1 files changed, 13 insertions, 0 deletions
diff --git a/npc/functions/main.txt b/npc/functions/main.txt
index b94aa8ac..c46f04d4 100644
--- a/npc/functions/main.txt
+++ b/npc/functions/main.txt
@@ -528,6 +528,19 @@ function script set_aggro {
return;
}
+// Makes a monster passive
+// unset_aggro( monster{, mode=MD_AGGRESSIVE} )
+function script unset_aggro {
+ .@m=getarg(0);
+ .@x=getarg(1, MD_AGGRESSIVE);
+ .@op=getunitdata(.@m, UDT_MODE);
+ if (.@op & .@x) {
+ .@op=.@op^.@x;
+ setunitdata(.@m, UDT_MODE, .@op);
+ }
+ return;
+}
+
// Special function which makes a date as a number
// numdate( - )
function script numdate {