summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--npc/functions/main.txt34
1 files changed, 34 insertions, 0 deletions
diff --git a/npc/functions/main.txt b/npc/functions/main.txt
index 4a0c9c22..bf69551e 100644
--- a/npc/functions/main.txt
+++ b/npc/functions/main.txt
@@ -748,3 +748,37 @@ function script learnskill {
return;
}
+function script spawndummy {
+ // spawndummy(map, x, y, ID{, name{, event}})
+ .@m$=getarg(0);
+ .@x=getarg(1);
+ .@y=getarg(2);
+ .@id=getarg(3);
+ .@n$=getarg(4, strmobinfo(1, .@id));
+ .@e$=getarg(5, "");
+ // Create monster, with optional event
+ if (.@e$ == "")
+ .@u=monster(.@m$, .@x, .@y, .@n$, .@id, 1);
+ else
+ .@u=monster(.@m$, .@x, .@y, .@n$, .@id, 1, .@e$);
+ // Reset unit data for script use
+ setunitdata(.@u, UDT_LEVEL, 1);
+ setunitdata(.@u, UDT_HP, 1);
+ setunitdata(.@u, UDT_MAXHP, 1);
+ setunitdata(.@u, UDT_SP, 1);
+ setunitdata(.@u, UDT_MAXSP, 1);
+ setunitdata(.@u, UDT_MODE, 0); // Stoic mode
+ setunitdata(.@u, UDT_ATKRANGE, 1);
+ setunitdata(.@u, UDT_ATKMIN, 1);
+ setunitdata(.@u, UDT_ATKMAX, 1);
+ setunitdata(.@u, UDT_MATKMIN, 1);
+ setunitdata(.@u, UDT_MATKMAX, 1);
+ setunitdata(.@u, UDT_DEF, 1);
+ setunitdata(.@u, UDT_MDEF, 1);
+ setunitdata(.@u, UDT_HIT, 1);
+ setunitdata(.@u, UDT_FLEE, 1);
+ setunitdata(.@u, UDT_CRIT, 1);
+ setunitdata(.@u, UDT_LOOKDIR, DOWN);
+ return .@u;
+}
+