summaryrefslogtreecommitdiff
path: root/doc/script_commands.txt
diff options
context:
space:
mode:
Diffstat (limited to 'doc/script_commands.txt')
-rw-r--r--doc/script_commands.txt107
1 files changed, 86 insertions, 21 deletions
diff --git a/doc/script_commands.txt b/doc/script_commands.txt
index bee02aa3b..b4c033a93 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
@@ -2341,7 +2362,7 @@ deleted.
//=====================================
---------------------------------------
-*strcharinfo(<type>)
+*strcharinfo(<type>{, <default value>{, <GID>}})
This function will return either the name, party name or guild name for
the invoking character. Whatever it returns is determined by type.
@@ -2349,6 +2370,10 @@ the invoking character. Whatever it returns is determined by type.
(1) PC_PARTY - The name of the party they're in if any.
(2) PC_GUILD - The name of the guild they're in if any.
(3) PC_MAP - The name of the map the character is in.
+
+If <GID> is passed, it will return the value of the specified player instead
+the attached player. If the player is not found, it will return
+<default value>, if any, or else return an empty string.
If a character is not a member of any party or guild, an empty string will
be returned when requesting that information.
@@ -2358,7 +2383,7 @@ using only numbers reduces script readability
---------------------------------------
-*strnpcinfo(<type>)
+*strnpcinfo(<type>{, <default value>{, <GID>}})
This function will return the various parts of the name of the calling NPC.
Whatever it returns is determined by type.
@@ -2369,6 +2394,10 @@ Whatever it returns is determined by type.
(3) NPC_NAME_UNIQUE - The NPC's unique name (::name)
(4) NPC_MAP - The name of the map the NPC is in.
+If <GID> is passed, it will return the value of the specified NPC instead of
+the attached NPC. If the NPC is not found, it will return <default value>,
+if any, or else return an empty string.
+
---------------------------------------
*charid2rid(<char id>)
@@ -4510,26 +4539,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.
+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
-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 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.
---------------------------------------
@@ -4980,7 +5000,32 @@ will be used.
---------------------------------------
-*cleanarea("<map name>", <x1>, <y1>, <x2>, <y2>)
+*makeitem2(<item id>,<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,{"<map name>",<X>,<Y>,<range>})
+*makeitem2("<item name>",<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,{"<map name>",<X>,<Y>,<range>})
+
+This script command work like 'makeitem', but it has additional parameters
+to expand the usage of the scritp command.
+
+Parameter List:
+ itemid - ID / Name of an item
+ amount - Amount you want produced (Value: 1~MAX_AMOUNT)
+ - if item type is Armor/Wepaon/PetEgg/PetArmor, amount will be limit to 1
+ identify - Item to be identified (1) or not (0)
+ refine - Refine count of item. (Value: 0 ~ MAX_REFINE)
+ attribute - Item is broken (1) or not (0)
+ card1,2,3,4 - Card IDs that compound on each slot
+
+Optional Parameter List:
+ map name - Map name (Default to attached player map)
+ X,Y - The coordinate of item will be dropped
+ If value = 0, it's drop random across the map
+ If value = -1, its drop around player
+ range - Range of item drop around player. (Value: 1 ~ battle_config.area_size, Default: 3)
+ Default value will be used if no player are attached to the script.
+
+---------------------------------------
+
+*cleanarea("<map name>",<x1>,<y1>,<x2>,<y2>)
*cleanmap("<map name>")
These commands will clear all items lying on the ground on the specified
@@ -6832,7 +6877,7 @@ The maximum length of a chat room name is 60 letters.
The limit is the maximum number of people allowed to enter the chat room.
The attached NPC is included in this count. If the optional event and
trigger parameters are given, the event label
-("<NPC object name>::<label name>") will be invoked as if with a doevent()
+("<NPC object name>::<label name>") will be invoked as if with a donpcevent()
upon the number of people in the chat room reaching the given triggering
amount.
@@ -8024,6 +8069,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