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.txt111
1 files changed, 103 insertions, 8 deletions
diff --git a/doc/script_commands.txt b/doc/script_commands.txt
index f767f890d..bdcc11712 100644
--- a/doc/script_commands.txt
+++ b/doc/script_commands.txt
@@ -1231,7 +1231,7 @@ you have to set it back to black unless you want all the rest of the text be in
that color:
mes("This is ^FF0000 red ^000000 and this is ^00FF00 green, ^000000 so.");
- mes(callfunc("F_MesColor", C_BLUE) +"This message is now in BLUE");
+ mesf("%sThis message is now in BLUE.", F_MesColor(C_BLUE));
Notice that the text coloring is handled purely by the client. If you use
non-English characters, the color codes might get screwed if they stick to
@@ -1255,6 +1255,14 @@ This will allow you to visit 'Google' with the in-game browser using default dim
Clicking 'Bing!' will open the in-game browser using the specified dimensions. (800x600)
+If you're using client from 2013-01-30 onwards, you can also use <ITEMLINK> to show
+the item's description. Gravity changed this into <ITEM> since 2015-07-29 onwards.
+
+ mes("Bring me an <ITEM>Apple<INFO>512</INFO></ITEM>.");
+ mesf("Bring me an %s.", F_MesItemInfo(Apple));
+
+This will show the item name and a clickable link for the item description.
+
---------------------------------------
*mesf("<format>"{, <param>{, <param>{, ...}}})
@@ -1293,6 +1301,21 @@ and the script will terminate.
---------------------------------------
+*mesclear();
+
+This command will clear the dialog text and continue the script without player interaction.
+
+Example:
+ mes("This is how the 'mesclear' script command works.");
+ sleep2 3000;
+ mesclear(); // This will clear the dialog and continue to the next one.
+ mes("I will show you again.");
+ sleep2 3000;
+ mesclear(); // This will clear the dialog and continue to the next one.
+ mes("Bye!");
+
+---------------------------------------
+
*close()
This command will create a 'close' button in the message window for the
@@ -3129,7 +3152,8 @@ recreate these items perfectly if they are destroyed. Here's what you get:
made by a specific craftsman.
@inventorylist_expire[] - expire time (Unix time stamp). 0 means never
expires.
-@inventorylist_bound - whether it is an account bounded item or not.
+@inventorylist_bound[] - whether it is an account bounded item or not.
+@inventorylist_favorite[] - whether it is favorite (inside favorite tab) or not.
@inventorylist_count - the number of items in these lists.
This could be handy to save/restore a character's inventory, since no
@@ -3387,11 +3411,12 @@ argument is omitted, it will try to use the map of the attached NPC, or the
map of the attached player if the NPC can't be found.
Valid <info> are:
- MAPINFO_NAME name of the map
- MAPINFO_ID numeric ID of the map
- MAPINFO_ZONE name of the zone used by the map
- MAPINFO_SIZE_X width of the map (cells on the x axis)
- MAPINFO_SIZE_Y height of the map (cells on the y axis)
+ MAPINFO_NAME name of the map
+ MAPINFO_ID numeric ID of the map
+ MAPINFO_ZONE name of the zone used by the map
+ MAPINFO_SIZE_X width of the map (cells on the x axis)
+ MAPINFO_SIZE_Y height of the map (cells on the y axis)
+ MAPINFO_NPC_COUNT total number of NPC in the map
Examples:
getmapinfo(MAPINFO_ID, "map name"); // ID from name
@@ -5336,6 +5361,34 @@ Check getitem2() to understand its expanded parameters.
---------------------------------------
+*delitemidx(<index>{, <amount>{, <account id>}})
+
+This command will remove an item at the given inventory index. Unlike the
+'delitem()' counterpart, this doesn't check invalid Item ID, making it useful to remove
+invalid item IDs in player's inventory.
+
+If <amount> is not specified, this will remove all of the items at the specified index.
+Note that items with the 'ForceSerial' flag, not yet merged through 'mergeitem()', will only
+be removed at the given index.
+
+The only way to get the inventory index is by using 'getinventorylist()'. After deleting
+an item at the given index, that index can remain empty until the player relogs, so you
+should recall 'getinventorylist()' again. If you try to delete an item at an invalid index, the
+script will terminate with an error.
+
+This command is also useful to remove rental/bound items because 'delitem()'
+does not discriminate at choosing which item to remove.
+
+Example:
+
+ // This will remove all invalid Item ID in player's inventory
+ getinventorylist();
+ for (.@i = 0; .@i < @inventorylist_count; ++.@i)
+ if (getiteminfo(@inventorylist_id[.@i], ITEMINFO_TYPE) == -1)
+ delitemidx(@inventorylist_idx[.@i]);
+
+---------------------------------------
+
*countitem(<item id>)
*countitem("<item name>")
@@ -6502,7 +6555,7 @@ This command will kill all monsters that were spawned with monster() or
areamonster() and have a specified event label attached to them. Commonly
used to get rid of remaining quest monsters once the quest is complete.
-If the label is given as "All", all monsters which have their respawn
+If the label is given as "all", all monsters which have their respawn
times set to -1 (like all the monsters summoned with 'monster' or
'areamonster' script command, and all monsters summoned with GM commands,
but no other ones - that is, all non-permanent monsters) on the specified
@@ -8527,6 +8580,18 @@ Example:
---------------------------------------
+*cap_value(<number>, <min>, <max>)
+
+Returns the number but capped between <min> and <max>.
+
+Example:
+ // capped between 0 ~ 100
+ .@value = cap_value(10, 0, 100); // .@value will be equal to 10
+ .@value = cap_value(1000, 0, 100); // .@value will be equal to 100
+ .@value = cap_value(-10, 3, 100); // .@value will be equal to 3
+
+---------------------------------------
+
*md5("<string>")
Returns the md5 checksum of a number or string.
@@ -10165,6 +10230,7 @@ Applicable Data Types (available as constants) -
UDT_LIFETIME: LifeTime - for summons.
UDT_MERC_KILLCOUNT: Kill count for mercenaries
UDT_STATADD: Status Points - for NPCs.
+ UDT_GROUP: group id
returns 0 if value could not be set, 1 if successful.
@@ -10227,6 +10293,7 @@ Applicable Data types (available as constants) -
UDT_INTIMACY: Intimacy Rate - for summons.
UDT_LIFETIME: LifeTime - for summons.
UDT_MERC_KILLCOUNT: Kill count for mercenaries.
+ UDT_GROUP: group id
returns -1 if value could not be retrieved.
@@ -10430,3 +10497,31 @@ This value always smaller or equal to MAX_INVENTORY.
Size can be changed by group of functions expandInventory*
---------------------------------------
+
+*getunittitle(<GID>)
+
+Return unit title string.
+Works for 20180207 main clients, 20171129 re clients, 20171130 zero clients
+
+---------------------------------------
+
+*setunittitle(<GID>, <title>)
+
+Set unit title string.
+Invisible for players, because current implimentation using title id only.
+Works for 20180207 main clients, 20171129 re clients, 20171130 zero clients
+
+---------------------------------------
+
+*closeroulette()
+
+Force close roulette window.
+Works for 20141008 main clients, 20140903 re, any zero.
+
+---------------------------------------
+*openrefineryui()
+
+Opens refinery user interface for the player
+returns true on success and false on failure
+
+---------------------------------------