summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/emap/script.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/emap/script.c b/src/emap/script.c
index 3d67429..002d581 100644
--- a/src/emap/script.c
+++ b/src/emap/script.c
@@ -107,6 +107,15 @@ void escript_set_reg_npc_num(struct script_state* st, struct reg_db *n, int64 *n
npc->setclass(nd, class_);
hookStop();
}
+ else if (!strcmp(name, ".speed"))
+ {
+ getND();
+
+ unit->bl2ud2(&nd->bl); // ensure nd->ud is safe to edit
+ nd->speed = *val;
+ nd->ud->state.speed_changed = 1;
+ hookStop();
+ }
}
int escript_get_val_npcscope_num(struct script_state* st, struct reg_db *n, struct script_data* data)
@@ -155,6 +164,12 @@ int escript_get_val_npcscope_num(struct script_state* st, struct reg_db *n, stru
hookStop();
return nd->class_;
}
+ else if (!strcmp(name, ".speed"))
+ {
+ getNDReturn(0);
+ hookStop();
+ return nd->speed;
+ }
return 0;
}