diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-09-27 21:16:45 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-09-27 21:16:45 +0300 |
commit | 9e4be5dcf5bd2bc1674b93441a6ef57283a1e14b (patch) | |
tree | cbaa0cca9fc6ba310f94722049f605b5606f2025 /src/emap/script.c | |
parent | b1b7c5a06d59bd7c31e152c9981353b78d32a843 (diff) | |
download | plugin-9e4be5dcf5bd2bc1674b93441a6ef57283a1e14b.tar.gz plugin-9e4be5dcf5bd2bc1674b93441a6ef57283a1e14b.tar.bz2 plugin-9e4be5dcf5bd2bc1674b93441a6ef57283a1e14b.tar.xz plugin-9e4be5dcf5bd2bc1674b93441a6ef57283a1e14b.zip |
Allow get/set npc class by variable '.class'.
Diffstat (limited to 'src/emap/script.c')
-rw-r--r-- | src/emap/script.c | 19 |
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; } |