summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/emap/script.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/emap/script.c b/src/emap/script.c
index 95aa747..3d67429 100644
--- a/src/emap/script.c
+++ b/src/emap/script.c
@@ -65,11 +65,13 @@ void escript_set_reg_npc_num(struct script_state* st, struct reg_db *n, int64 *n
clif->clearunit_area(&nd->bl, CLR_OUTSIGHT);
nd->vd->sex = *val;
clif->spawn(&nd->bl);
+ hookStop();
}
else if (!strcmp(name, ".distance"))
{
getND();
nd->area_size = *val;
+ hookStop();
}
else if (!strcmp(name, ".dir"))
{
@@ -83,16 +85,27 @@ void escript_set_reg_npc_num(struct script_state* st, struct reg_db *n, int64 *n
nd->dir = newdir;
npc->enable(nd->name, 1);
+ hookStop();
}
else if (!strcmp(name, ".x"))
{
ShowWarning("you cant assign '.x'\n");
script->reportsrc(st);
+ hookStop();
}
else if (!strcmp(name, ".y"))
{
ShowWarning("you cant assign '.y'.\n");
script->reportsrc(st);
+ hookStop();
+ }
+ else if (!strcmp(name, ".class"))
+ {
+ getND();
+ int class_ = *val;
+ if (nd->class_ != class_)
+ npc->setclass(nd, class_);
+ hookStop();
}
}
@@ -136,6 +149,12 @@ int escript_get_val_npcscope_num(struct script_state* st, struct reg_db *n, stru
hookStop();
return nd->bl.y;
}
+ else if (!strcmp(name, ".class"))
+ {
+ getNDReturn(0);
+ hookStop();
+ return nd->class_;
+ }
return 0;
}