diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/map/init.c | 3 | ||||
-rw-r--r-- | src/map/script.c | 29 | ||||
-rw-r--r-- | src/map/script.h | 3 |
3 files changed, 35 insertions, 0 deletions
diff --git a/src/map/init.c b/src/map/init.c index acf6de5..22e7142 100644 --- a/src/map/init.c +++ b/src/map/init.c @@ -86,6 +86,9 @@ HPExport void plugin_init (void) addScriptCommand("setnpcdistance", "i", setNpcDistance); addScriptCommand("setpcsit", "*", setPcSit); addScriptCommand("getpcsit", "*", getPcSit); + addScriptCommand("showavatar", "*", showAvatar); + addScriptCommand("setavatardir", "i", setAvatarDir); + addScriptCommand("setavataraction", "i", setAvatarAction); do_init_langs(); 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; +} diff --git a/src/map/script.h b/src/map/script.h index 1af650f..5993e37 100644 --- a/src/map/script.h +++ b/src/map/script.h @@ -31,5 +31,8 @@ BUILDIN(setNpcSex); BUILDIN(setPcSit); BUILDIN(getPcSit); BUILDIN(setNpcDistance); +BUILDIN(showAvatar); +BUILDIN(setAvatarDir); +BUILDIN(setAvatarAction); #endif // EVOL_MAP_SCRIPT |