diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-02-22 18:26:03 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-02-22 18:26:03 +0300 |
commit | 2114f859d5b1d6984809494870f5266f53d662c7 (patch) | |
tree | 5a0b29b6157b8f509ecc4faaaba2dd60909fb425 /src/emap | |
parent | fb61301d037660e7ff56caa1d49dd2c7c959b15d (diff) | |
download | evol-hercules-2114f859d5b1d6984809494870f5266f53d662c7.tar.gz evol-hercules-2114f859d5b1d6984809494870f5266f53d662c7.tar.bz2 evol-hercules-2114f859d5b1d6984809494870f5266f53d662c7.tar.xz evol-hercules-2114f859d5b1d6984809494870f5266f53d662c7.zip |
Copy setlook script command into plugin. Add support for send changed slot.
Diffstat (limited to 'src/emap')
-rw-r--r-- | src/emap/init.c | 1 | ||||
-rw-r--r-- | src/emap/script.c | 14 | ||||
-rw-r--r-- | src/emap/script.h | 1 |
3 files changed, 16 insertions, 0 deletions
diff --git a/src/emap/init.c b/src/emap/init.c index 5e9deef..53a47df 100644 --- a/src/emap/init.c +++ b/src/emap/init.c @@ -150,6 +150,7 @@ HPExport void plugin_init (void) addScriptCommand("setmount", "i", setMount); addScriptCommand("setskin", "s", setSkin); addScriptCommand("emotion", "i??", emotion); + addScriptCommand("setlook", "ii", setLook); do_init_langs(); diff --git a/src/emap/script.c b/src/emap/script.c index 67c88e0..c60861d 100644 --- a/src/emap/script.c +++ b/src/emap/script.c @@ -1957,3 +1957,17 @@ BUILDIN(emotion) } return true; } + +BUILDIN(setLook) +{ + const int type = script_getnum(st, 2); + const int val = script_getnum(st, 3); + + struct map_session_data *sd = script->rid2sd(st); + if (sd == NULL) + return true; + + pc->changelook(sd, type, val); + send_changelook2(sd, &sd->bl, sd->bl.id, type, val, 0, NULL, 0, AREA); + return true; +} diff --git a/src/emap/script.h b/src/emap/script.h index 51618cb..534eb82 100644 --- a/src/emap/script.h +++ b/src/emap/script.h @@ -75,5 +75,6 @@ BUILDIN(emotion); BUILDIN(findCraftEntry); BUILDIN(useCraft); BUILDIN(getCraftCode); +BUILDIN(setLook); #endif // EVOL_MAP_SCRIPT |