diff options
Diffstat (limited to 'doc/script_commands.txt')
-rw-r--r-- | doc/script_commands.txt | 170 |
1 files changed, 156 insertions, 14 deletions
diff --git a/doc/script_commands.txt b/doc/script_commands.txt index 953cc86f3..57d47b1b5 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -714,6 +714,8 @@ MAX_BANK_ZENY - Maximum Zeny in the bank MAX_BG_MEMBERS - Maximum BattleGround members MAX_CHAT_USERS - Maximum Chat users MAX_REFINE - Maximum Refine level +MAX_MENU_OPTIONS - Maximum NPC menu options +MAX_MENU_LENGTH - Maximum NPC menu string length Send targets and status options are also hard-coded and can be found in 'doc/constants.md'. @@ -1600,21 +1602,24 @@ perfectly equivalent. --------------------------------------- *select("<option>"{, "<option>", ...}) -*prompt("<option>"{, "<option>", ...}) This function is a handy replacement for 'menu' that doesn't use a complex -label structure. It will return the number of menu option picked, -starting with 1. Like 'menu', it will also set the variable @menu to -contain the option the user picked. +label structure. It will return the number of the menu option picked, +starting with 1. If the player presses cancel, the script is terminated. - if (select("Yes:No") == 1) + if (select("Yes", "No") == 1) mes("You said yes, I know."); And like 'menu', the selected option is consistent with grouped options and empty options. -'prompt' works almost the same as select, except that when a character -clicks the Cancel button, this function will return 255 instead. +--------------------------------------- + +*prompt("<option>"{, "<option>", ...}) + +This function behaves exactly like select(), but when a player presses cancel +it returns MAX_MENU_OPTIONS and the script is not terminated. You almost always +want to use select() rather than prompt(). --------------------------------------- @@ -2574,15 +2579,12 @@ playerattached() to check for the character attached to the script. --------------------------------------- -*getnpcid(<type>{, "<npc name>"}) +*getnpcid({"<npc name>"}) Retrieves IDs of the currently invoked NPC. If a unique npc name is given, -IDs of that NPC are retrieved instead. Type specifies what ID to retrieve -and can be one of the following: - - 0 - Unit ID (GID) +IDs of that NPC are retrieved instead. -If an invalid type is given or the NPC does not exist, 0 is returned. +If the NPC does not exist, 0 is returned. --------------------------------------- @@ -3239,6 +3241,7 @@ Valid types are: ITEMINFO_VIEWID - View ID ("Sprite" field in the Item DB) ITEMINFO_MATK - MATK (only relevant if RENEWAL is set) ITEMINFO_VIEWSPRITE - View Sprite ("ViewSprite" field in the Item DB) + ITEMINFO_TRADE - Trade Restriction (see "doc/constant.md": item trade restriction) Check sample in doc/sample/getiteminfo.txt @@ -5992,6 +5995,17 @@ Example usage: --------------------------------------- +*removespecialeffect(<effect number>{, <send_target>{, <unit id>{, <account id>}}}) +*removespecialeffect(<effect number>{, <send_target>{, "<NPC Name>"{, <account id>}}}) + +Works for: + main client from version 2018-10-02 + re client from version 2018-10-02 +This command will remove special effect. All parameters same with specialeffect. +Examples and detailed explanation about parameters see in specialeffect. + +--------------------------------------- + *specialeffect2(<effect number>{, <send_target>{, "<Player Name>"}}) @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@ -8130,7 +8144,7 @@ built-in atcommands and custom atcommands. *has_permission("<permission>"{, <account id>}) Check if the attached or specified player has the specified permission -and returns true or false accordingly. See doc/permissions.txt for +and returns true or false accordingly. See doc/permissions.md for details about permissions. Valid <permission> are: @@ -8603,6 +8617,18 @@ Example: --------------------------------------- +*data_to_string(<data>) + +Returns a string representation of the given data, similar to the .toString() +method in JavaScript. + +Example: + + data_to_string(DATATYPE_VAR) // "DATATYPE_VAR" + data_to_string(.@foo) // ".@foo" + +--------------------------------------- + *charisalpha("<string>", <position>) This function will return true if the character number Position in the given @@ -9434,6 +9460,7 @@ supported types: values QINFO_HOMUN_LEVEL: min QINFO_HOMUN_TYPE: homunculus_type (0 - regular, 1 - evolved, 2 - S) QINFO_QUEST: quest_id, state // append to the quests list on each use + QINFO_MERCENARY_CLASS: mercenary_class --------------------------------------- @@ -10188,3 +10215,118 @@ Show in client message by <message_id> from msg string table. Optional <color> can be used for set color for whole message. --------------------------------------- + +*camerainfo() + +Show or hide camera info window. +Works for 20160525 clients or newer. + +--------------------------------------- + +*changecamera(<range>, <rotation>, <latitude>{, <target>}) + +Change camera range, rotation, latitude. +The optional target parameter specifies who will get changed +camera. +Works for 20160525 clients or newer. + +--------------------------------------- + +*achievement_progress(<ach_id>, <obj_idx>, <progress>, <incremental>{, <account_id>}); + +Make the player progress in the specified achievement. +aid - achievement ID +obj_idx - achievement objective index. +progress - objective progress towards goal. +incremental - (boolean) true to add the progress towards the goal, + false to use the progress only as a comparand. +account_id - (optional) AID to perform on (default to attached player). + +returns progress on success and false on failure + +--------------------------------------- + +*itempreview(<index>) + +Update already opened preview window with item from + inventory with given index. +Works for 20181017 RE and main clients or newer. + +--------------------------------------- + +*enchantitem(<equip_pos>, <card_slot>, <card_id>); + +Insert card into equipped item in EQI_* slot. +card_slot - can be 0 to 3. +card_id - any card item id. + +returns true if all parameters correct +false in other case. +Works for 20160831 main, 20151118 RE, any zero version + +--------------------------------------- + +*servicemessage("<message>", <color>{, <account_id>}) +*servicemessage("<message>", <color>{, <player_name>}) + +That command will send a service message to the chat window of the character +specified by account ID or name, or to connected to npc player. +It will not be seen by anyone else. + +Works for 20170830 RE and main and for any zero clients + +--------------------------------------- + +*expandInventoryAck(<result>{, <itemId>}) + +Send initial inventory expansion result. +Normally this function should be called from script label +inventory_expansion::OnInventoryExpandRequest. + +Valid result statuses: + EXPAND_INVENTORY_ASK_CONFIRMATION - force client to ask player about inventory expansion + EXPAND_INVENTORY_FAILED - other failed reason + EXPAND_INVENTORY_OTHER_WORK - failed because player busy with other work + EXPAND_INVENTORY_MISSING_ITEM - failed because missing item + EXPAND_INVENTORY_MAX_SIZE - failed because inventory size already maximum + +ItemId make sense only if result is EXPAND_INVENTORY_ASK_CONFIRMATION +Works for 20181212 zero clients + +--------------------------------------- + +*expandInventoryResult(<result>) + +Send final inventory expansion result. +Normally this function should be called from script label +inventory_expansion::OnInventoryExpandConfirmed. + +Valid result values: + EXPAND_INVENTORY_RESULT_SUCCESS - success message + EXPAND_INVENTORY_RESULT_FAILED - other failed reason + EXPAND_INVENTORY_RESULT_OTHER_WORK - failed because player busy with other work + EXPAND_INVENTORY_RESULT_MISSING_ITEM - failed because missing item + EXPAND_INVENTORY_RESULT_MAX_SIZE - failed because inventory size already maximum + +Works for 20181212 zero clients + +--------------------------------------- + +*expandInventory(<value>) + +Adjust player inventory to given value. +Maximum inventory size is MAX_INVENTORY. +Minimum inventory size is FIXED_INVENTORY_SIZE. +For supported clients it send inventory change packet. For old clients, +this change is silent. +Current max inventory size can be read by function getInventorySize(). + +--------------------------------------- + +*getInventorySize() + +Return current player max inventory size. +This value always smaller or equal to MAX_INVENTORY. +Size can be changed by group of functions expandInventory* + +--------------------------------------- |