* Applied suggestion in tid:76276. Added script commands sit and stand.

- Added a new parameter to readparam, Sitting.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@17174 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
aleos 2013-03-06 15:15:37 +00:00
parent 290638c829
commit 7bbd35a052
5 changed files with 43 additions and 0 deletions

View File

@ -414,6 +414,7 @@ BaseJob 119 1
BaseClass 120 1
killerrid 121 1
killedrid 122 1
Sitting 123 1
bMaxHP 6
bMaxSP 8

View File

@ -5087,6 +5087,14 @@ everything not equippable by the new job class anyway.
---------------------------------------
*sit {"<character name>"};
*stand {"<character name>"};
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 <Monster ID>;
*undisguise;

View File

@ -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,

View File

@ -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;

View File

@ -17398,6 +17398,36 @@ BUILDIN_FUNC(consumeitem)
return 0;
}
/* Make a player sit/stand.
* sit {"<character name>"};
* stand {"<character name>"};
* 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)
**/