diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-11-29 18:51:58 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-11-29 18:51:58 +0300 |
commit | 3c4e409e9080783ecc01d93aa53ddf04f6f93ff0 (patch) | |
tree | 1e41f38a02a616979ac99c11a96529e3c1bc8402 /src/map/script.c | |
parent | c4d320e72a4060408c97a0207e9b82433cec9418 (diff) | |
download | plugin-3c4e409e9080783ecc01d93aa53ddf04f6f93ff0.tar.gz plugin-3c4e409e9080783ecc01d93aa53ddf04f6f93ff0.tar.bz2 plugin-3c4e409e9080783ecc01d93aa53ddf04f6f93ff0.tar.xz plugin-3c4e409e9080783ecc01d93aa53ddf04f6f93ff0.zip |
Add script command for control npc avatar.
New script commands:
showavatar [id] - show or hide avatar.
setavatardir - set avatar direction.
setavataraction - set avatar action.
Diffstat (limited to 'src/map/script.c')
-rw-r--r-- | src/map/script.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/map/script.c b/src/map/script.c index 51e5818..12902ac 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -664,3 +664,32 @@ BUILDIN(setNpcDistance) data->areaSize = script_getnum(st, 2); return true; } + +BUILDIN(showAvatar) +{ + int id = 0; + if (script_hasdata(st, 2)) + id = script_getnum(st, 2); + + send_npccommand2(script->rid2sd (st), st->oid, 6, id, 0, 0); + return true; +} + +BUILDIN(setAvatarDir) +{ + int newdir = script_getnum(st, 2); + + if (newdir < 0) + newdir = 0; + else if (newdir > 7) + newdir = 7; + + send_npccommand2(script->rid2sd (st), st->oid, 7, newdir, 0, 0); + return true; +} + +BUILDIN(setAvatarAction) +{ + send_npccommand2(script->rid2sd (st), st->oid, 8, script_getnum(st, 2), 0, 0); + return true; +} |