summaryrefslogtreecommitdiff
path: root/src/emap/script.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-09-27 18:30:29 +0300
committerAndrei Karas <akaras@inbox.ru>2015-09-27 18:30:29 +0300
commita04eeef27f16ba4fbe31e5e178313e6e718af4c8 (patch)
tree93ece9f2298ef3883821d65a08c226574699f227 /src/emap/script.c
parent454c1448e30fe9d8cc2e6bc535921b2f7efd58e2 (diff)
downloadplugin-a04eeef27f16ba4fbe31e5e178313e6e718af4c8.tar.gz
plugin-a04eeef27f16ba4fbe31e5e178313e6e718af4c8.tar.bz2
plugin-a04eeef27f16ba4fbe31e5e178313e6e718af4c8.tar.xz
plugin-a04eeef27f16ba4fbe31e5e178313e6e718af4c8.zip
Allow set/get npc sex by working with variable '.sex'.
Diffstat (limited to 'src/emap/script.c')
-rw-r--r--src/emap/script.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/emap/script.c b/src/emap/script.c
index 0df3847..bb414b1 100644
--- a/src/emap/script.c
+++ b/src/emap/script.c
@@ -59,6 +59,13 @@ void escript_set_reg_npc_num(struct script_state* st, struct reg_db *n, int64 *n
ext->language = *val;
hookStop();
}
+ else if (!strcmp(name, ".sex"))
+ {
+ getND();
+ clif->clearunit_area(&nd->bl, CLR_OUTSIGHT);
+ nd->vd->sex = *val;
+ clif->spawn(&nd->bl);
+ }
}
int escript_get_val_npcscope_num(struct script_state* st, struct reg_db *n, struct script_data* data)
@@ -71,6 +78,11 @@ int escript_get_val_npcscope_num(struct script_state* st, struct reg_db *n, stru
hookStop();
return ext->language;
}
+ else if (!strcmp(name, ".sex"))
+ {
+ getNDReturn(0);
+ return nd->vd->sex;
+ }
return 0;
}