summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/emap/init.c1
-rw-r--r--src/emap/script.c14
-rw-r--r--src/emap/script.h1
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