summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorMatheus Macabu <mkbu95@gmail.com>2013-07-04 19:19:52 -0300
committerMatheus Macabu <mkbu95@gmail.com>2013-07-04 19:19:52 -0300
commite8adea6f0cbad25b5ac21944b16099cce155d050 (patch)
treebf393e8b5ce364fb8f0524353b4e0f862ec68026 /src/map/script.c
parent0f2899cf48bd4a324e92dc33dc2bc28d1edcdae3 (diff)
downloadhercules-e8adea6f0cbad25b5ac21944b16099cce155d050.tar.gz
hercules-e8adea6f0cbad25b5ac21944b16099cce155d050.tar.bz2
hercules-e8adea6f0cbad25b5ac21944b16099cce155d050.tar.xz
hercules-e8adea6f0cbad25b5ac21944b16099cce155d050.zip
Implemented sitting set of script commands: sit(), stand(), issit() as per suggested in topic #1204. See documentation for more information on these commands.
Also fixed leftover from db_use_sql split. Signed-off-by: Matheus Macabu <mkbu95@gmail.com>
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c59
1 files changed, 59 insertions, 0 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 4a90290cf..3ba8ea9fc 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -16679,6 +16679,61 @@ BUILDIN(freeloop) {
return true;
}
+BUILDIN(sit)
+{
+ struct map_session_data *sd = NULL;
+
+ if (script_hasdata(st, 2))
+ sd = iMap->nick2sd(script_getstr(st, 2));
+
+ if (sd == NULL)
+ sd = script_rid2sd(st);
+
+ if (!pc_issit(sd))
+ {
+ pc_setsit(sd);
+ skill->sit(sd,1);
+ clif->sitting(&sd->bl);
+ }
+ return true;
+}
+
+BUILDIN(stand)
+{
+ struct map_session_data *sd = NULL;
+
+ if (script_hasdata(st, 2))
+ sd = iMap->nick2sd(script_getstr(st, 2));
+
+ if (sd == NULL)
+ sd = script_rid2sd(st);
+
+ if (pc_issit(sd))
+ {
+ pc->setstand(sd);
+ skill->sit(sd,0);
+ clif->standing(&sd->bl);
+ }
+ return true;
+}
+
+BUILDIN(issit)
+{
+ struct map_session_data *sd = NULL;
+
+ if (script_hasdata(st, 2))
+ sd = iMap->nick2sd(script_getstr(st, 2));
+
+ if (sd == NULL)
+ sd = script_rid2sd(st);
+
+ if (pc_issit(sd))
+ script_pushint(st, 1);
+ else
+ script_pushint(st, 0);
+ return true;
+}
+
/**
* @commands (script based)
**/
@@ -17962,6 +18017,10 @@ void script_parse_builtin(void) {
BUILDIN_DEF(packageitem,"?"),
+ BUILDIN_DEF(sit, "?"),
+ BUILDIN_DEF(stand, "?"),
+ BUILDIN_DEF(issit, "?"),
+
/* New BG Commands [Hercules] */
BUILDIN_DEF(bg_create_team,"sii"),
BUILDIN_DEF(bg_join_team,"i?"),