diff --git a/db/const.txt b/db/const.txt index 47cd5582bf..c89d7fa16e 100644 --- a/db/const.txt +++ b/db/const.txt @@ -414,6 +414,7 @@ BaseJob 119 1 BaseClass 120 1 killerrid 121 1 killedrid 122 1 +Sitting 123 1 bMaxHP 6 bMaxSP 8 diff --git a/doc/script_commands.txt b/doc/script_commands.txt index be69779493..632a4abfb6 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -5087,6 +5087,14 @@ everything not equippable by the new job class anyway. --------------------------------------- +*sit {""}; +*stand {""}; + +These commands will make a character sit if standing and stanf if sitting. +If no character is specified, the command will run for the invoking character. + +--------------------------------------- + *disguise ; *undisguise; diff --git a/src/map/map.h b/src/map/map.h index 277111692f..da04dc9197 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -367,6 +367,7 @@ enum _sp { SP_BASECLASS=120, //Hmm.. why 100+19? I just use the next one... [Skotlex] SP_KILLERRID=121, SP_KILLEDRID=122, + SP_SITTING=123, // Mercenaries SP_MERCFLEE=165, SP_MERCKILLS=189, SP_MERCFAITH=190, diff --git a/src/map/pc.c b/src/map/pc.c index a64ec248f0..4832a83e06 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -6910,6 +6910,7 @@ int pc_readparam(struct map_session_data* sd,int type) case SP_FAME: val = sd->status.fame; break; case SP_KILLERRID: val = sd->killerrid; break; case SP_KILLEDRID: val = sd->killedrid; break; + case SP_SITTING: val = pc_issit(sd)?1:0; break; case SP_CRITICAL: val = sd->battle_status.cri/10; break; case SP_ASPD: val = (2000-sd->battle_status.amotion)/10; break; case SP_BASE_ATK: val = sd->battle_status.batk; break; diff --git a/src/map/script.c b/src/map/script.c index bfc134ed43..67e3e8e054 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -17398,6 +17398,36 @@ BUILDIN_FUNC(consumeitem) return 0; } +/* Make a player sit/stand. + * sit {""}; + * stand {""}; + * Note: Use readparam(Sitting) which returns 1 or 0 (sitting or standing). */ +BUILDIN_FUNC(sit) +{ + TBL_PC *sd; + + if( script_hasdata(st, 2) ) + sd = map_nick2sd(script_getstr(st, 2)); + else + sd = script_rid2sd(st); + + if( sd == NULL) + return 0; + + if( pc_issit(sd) ) { + pc_setstand(sd); + skill_sit(sd, 0); + clif_standing(&sd->bl); + } else { + unit_stop_walking(&sd->bl, 1|4); + pc_setsit(sd); + skill_sit(sd, 1); + clif_sitting(&sd->bl); + } + + return 0; +} + // declarations that were supposed to be exported from npc_chat.c #ifdef PCRE_SUPPORT BUILDIN_FUNC(defpattern); @@ -17844,6 +17874,8 @@ struct script_function buildin_func[] = { BUILDIN_DEF(npcskill,"viii"), BUILDIN_DEF(consumeitem,"v"), BUILDIN_DEF(delequip,"i"), + BUILDIN_DEF(sit,"?"), + BUILDIN_DEF2(sit,"stand","?"), /** * @commands (script based) **/