diff options
Diffstat (limited to 'doc/script_commands.txt')
-rw-r--r-- | doc/script_commands.txt | 66 |
1 files changed, 49 insertions, 17 deletions
diff --git a/doc/script_commands.txt b/doc/script_commands.txt index a0e3a783d..7015feec1 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -1409,6 +1409,27 @@ getvariableofnpc() should not be used on them. --------------------------------------- +*getvariableofpc(<variable>, <account id>{, <default value>}) + +Returns a reference to a PC variable from the target player. +If <default value> is passed, it will return this value if the player is +not found. + +Examples: + +//This will return the value of @var, note that this can't be used, since +//the value isn't caught. + getvariableofpc(@var, getcharid(CHAR_ID_ACCOUNT, "player")); + +//This will set the .@v variable to the value of the player's @var +//variable. + .@v = getvariableofpc(@var, getcharid(CHAR_ID_ACCOUNT, "player")); + +//This will set the @var variable of the player to 1. + set(getvariableofpc(@var, getcharid(CHAR_ID_ACCOUNT, "player")), 1); + +--------------------------------------- + *goto(<label>) This command will make the script jump to a label, usually used in @@ -4507,26 +4528,17 @@ changebase(Class); // Changes player back to default sprite. --------------------------------------- -*classchange(<view id>, <type>) +*classchange(<view id>, <type> {, <char id>}) This command is very ancient, it's origins are clouded in mystery. -It will send a 'display id change' packet to everyone in the immediate -area of the NPC object, which will supposedly make the NPC look like a -different sprite, an NPC sprite ID, or a monster ID. This effect is not -stored anywhere and will not persist (Which is odd, cause it would be -relatively easy to make it do so) and most importantly, will not work at -all since this command was broken with the introduction of advanced -classes. The code is written with the assumption that the lowest sprite -IDs are the job sprites and the anything beyond them is monster and NPC -sprites, but since the advanced classes rolled in, they got the ID numbers -on the other end of the number pool where monster sprites float. - -As a result it is currently impossible to call this command with a valid -view id. It will do nothing whatsoever if the view ID is below 4047. -Getting it to run will actually just crash the client. +It will send a 'display id change' packet to player with given char ID +or to everyone in the immediate area of the NPC object if char ID is 0 or +not passed, which will make the NPC look like a different sprite, an NPC +sprite ID, or a monster ID. This effect is not stored anywhere and will +not persist. +Note that you can't send a Job sprite ID -It could be a real gem if it can be gotten to actually do what it's -supposed to do, but this will only happen in a later Git revision. +type is not used and should always be 0. --------------------------------------- @@ -8046,6 +8058,26 @@ Example: --------------------------------------- +*chr(<int>) + +Returns a char from its ASCII value. + +Example: + + chr(99); //returns "c" + +--------------------------------------- + +*ord(<chr>) + +Returns the ASCII value of char <chr>. + +Example: + + ord("c"); //returns 99 + +--------------------------------------- + *setchar(<string>, <char>, <index>) Returns the original string with the char at the specified index set to |