diff options
Diffstat (limited to 'src/map/script.c')
-rw-r--r-- | src/map/script.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/map/script.c b/src/map/script.c index 1d0f036..585dfec 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -11,9 +11,12 @@ #include "../../../common/socket.h" #include "../../../common/strlib.h" #include "../../../map/clif.h" +#include "../../../map/npc.h" #include "../../../map/pc.h" #include "../../../map/script.h" +#include "map/script.h" +#include "map/send.h" #include "map/session.h" #include "map/sessionext.h" @@ -63,3 +66,39 @@ BUILDIN(setLang) getData(); data->language = script_getnum(st, 2); } + +BUILDIN(setCamNpc) +{ + TBL_PC *sd = script->rid2sd(st); + if (!sd) + return 1; + + struct npc_data *nd = NULL; + + int x = 0; + int y = 0; + + if (script_hasdata(st, 2)) + { + nd = npc->name2id (script_getstr(st, 2)); + } + else + { + if (!st->oid) + return 1; + + nd = (struct npc_data *) map->id2bl (st->oid); + } + if (!nd || sd->bl.m != nd->bl.m) + return 1; + + if (script_hasdata(st, 3) && script_hasdata(st, 4)) + { + x = script_getnum(st, 3); + y = script_getnum(st, 4); + } + + send_npccommand2(script->rid2sd (st), st->oid, 2, nd->bl.id, x, y); + + return 0; +} |