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.txt15
1 files changed, 14 insertions, 1 deletions
diff --git a/npc/functions/main.txt b/npc/functions/main.txt
index 0b89ae72..c46f04d4 100644
--- a/npc/functions/main.txt
+++ b/npc/functions/main.txt
@@ -66,7 +66,7 @@ function script mesq {
}
function script g {
- return Sex == 0 ? getarg(0) : getarg(1);
+ return Sex ? getarg(1) : getarg(0);
}
function script b {
@@ -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 {