diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/script_commands.txt | 122 |
1 files changed, 84 insertions, 38 deletions
diff --git a/doc/script_commands.txt b/doc/script_commands.txt index 5fbf652a4..af3d90262 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -7610,10 +7610,9 @@ This will open a book item at the specified page. ======================== --------------------------------------- -*instance_create("<instance name>",<party id>); +*instance_create("<instance name>",<owner id>{,<optional owner_type>}); -Create an instance using the name "<instance name>" for the Party of -<party id>. +Create an instance using the name "<instance name>" for the <owner_id> of owner_type (when not provided, defaults to IOT_PARTY) Most instance_* commands are used in conjunction with this command and depend on the ID this command returns. @@ -7644,30 +7643,32 @@ Example: *instance_destroy {<instance id>}; Destroys instance with the ID <instance id>. If no ID is specified, the -instance the script is attached to is used. If the script is not attached -to an instance, the instance of the currently attached player's party is -used. If no player is currently attached, the command fails and causes the -script to halt. +instance the script is attached to is used. If in the end no instance_id, +is found the command halts the script execution. --------------------------------------- -*instance_attachmap("<map name>",<instance id>{,<use base name>}); +*instance_attachmap("<map name>",<instance id>{,<use base name>{,"<new map name>"}}); Attaches the map "<map name>" to the instance specified with <instance id>. The optional parameter specifies, whether a map requires -emulation for instancing (1) or not (0 = default). +emulation for instancing (1) or not (0 = default). if use base name is specified, +and "<new map name>" too the server will instance the map under the "<new map name>", +name. Returns the resulting map name on success or an empty string on failure. +Example: + instance_attachmap("prontera", .@instance_id,1,"via"); +^ the above creates a instance (or clone) of prontera, on a map called "via" + --------------------------------------- *instance_detachmap "<map name>"{,<instance id>}; Detach the map "<map name>" to the instance with the <instance id>. If no -ID is specified, the instance the script is attached to is used. If the -script is not attached to an instance, the instance of the currently -attached player's party is used. If no player is currently attached, the -command fails and causes the script to halt. +ID is specified, the instance the script is attached to is used. If in the +end no instance_id is found the command halts the script execution. --------------------------------------- @@ -7681,10 +7682,8 @@ the source maps to the instanced maps. *instance_announce <instance id>,"<text>",<flag>{,<fontColor>{,<fontType>{,<fontSize>{,<fontAlign>{,<fontY>}}}}}; Works like announce, but has the <instance id> parameter. If instance id -is 0, the instance the script is attached to is used. If the script is not -attached to an instance, the instance of the currently attached player's -party is used. If no player is currently attached, the command fails and -causes the script to halt. +is -1, the instance the script is attached to is used. If in the +end no instance_id is found the command halts the script execution. --------------------------------------- @@ -7698,10 +7697,8 @@ Attaches the current script to the instance given by <instance id>. Retrieves the unique name given to a copy of an NPC given by "<npc name>" in an instance specified <instance id>. If no ID is specified, the -instance the script is attached to is used. If the script is not attached -to an instance, the instance of the currently attached player's party is -used. If no player is currently attached, the command fails and causes the -script to halt. +instance the script is attached to is used. If in the end no instance_id, +is found the command halts the script execution. --------------------------------------- @@ -7709,22 +7706,18 @@ script to halt. Checks whether or not the given map belongs to specified instance. If no ID is specified, the instance the script is attached to is used. If the -script is not attached to an instance, the instance of the currently -attached player's party is used. If no player is currently attached, the -command fails and causes the script to halt. +script is not attached to an instance, it'll try to check whether the, +player attached to the script possesses an instance with a map matching +"<map name>". If in the end no instance_id is found the command halts the, +script execution. Returns name of the instanced map on success, otherwise an empty string. --------------------------------------- -*instance_id({<type>}); +*instance_id(); -Retrieves the instance id, depending on <type>. If type is not given, it -defaults to 0. - -Type: - 0 - Instance ID the script is attached to. - 1 - Instance ID of the currently attached player's party. +Retrieves the instance id of the script it is being run on. --------------------------------------- @@ -7732,19 +7725,16 @@ Type: Warps all players in the instance <instance id> to <map name> at given coordinates. If no ID is specified, the instance the script is attached to -is used. If the script is not attached to an instance, the instance of the -currently attached player's party is used. If no player is currently -attached, the command fails and causes the script to halt. +is used. If in the end no instance_id is found the command halts the, +script execution. --------------------------------------- *instance_set_timeout <alive timeout>,<idle timeout>{,<instance id>}; Sets the timeout values for an instance given by <instance id>. If no ID -is specified, the instance the script is attached to is used. If the -script is not attached to an instance, the instance of the currently -attached player's party is used. If no player is currently attached, the -command fails and causes the script to halt. +is specified, the instance the script is attached to is used. If in the end, +no instance_id is found the command halts the script execution. Parameter <alive timeout> specifies the total amount of time the instance will exist. Parameter <idle timeout> specifies how long players have, when @@ -8080,3 +8070,59 @@ If the character does not have a mercenary, the command returns "" for name and 0 for all other types. ---------------------------------------- + +========================== +|11.- Queue Commands .| +========================== +--------------------------------------- +Queue Author's note: the following sucks, probably breaks formatting, please fix if you're willing to (you may remove this note) +--------------------------------------- +*queue() +creates a new queue instance, returns created queue id + +--------------------------------------- +*queuesize(<queue_id>) +returns the amount of entries in queue instance of <queue_id>. + +--------------------------------------- +*queueadd(<queue_id>,<var_id>) +adds <var_id> to queue of <queue_id>, returns 1 if <var_id> is already present in the queue, 0 otherwise. + +--------------------------------------- +*queueremove(<queue_id>,<var_id>) +removes <var_id> from queue of <queue_id>, returns 1 if <var_id> is not present in the queue, 0 otherwise. + +--------------------------------------- +*queueopt(<queue_id>,<optionType>,{Optional <option val>}) +modifies <queue_id>'s <optionType>, when <option val> is not present, <optionType> is removed from <queue_id>, when present it modifies <queue_id>'s <optionType> with the new <option val> value. +Currently 3 options are available, HQO_OnDeath (0), HQO_OnLogout (1), HQO_OnMapChange (2) (the constant names are not final). + +Example: + queueopt(.@queue_id,0,"MyNPC::MyOnQueueMemberDeathEventName"); + +--------------------------------------- +*queuedel(<queue_id>) +deletes <queue_id> returns 1 when <queue_id> is not found, 0 otherwise. + +--------------------------------------- +*queueiterator(<queue_id>) +creates a new queue iterator instance, a queue iterator is not a reference to a queue's actual members, it copies the queues members when initialized, this way you can loop through them even if you remove them from the queue + +--------------------------------------- +*qicheck(<queue_iterator_id>) +checks whether there is a next member in the iterator's queue, 1 when it does, 0 otherwise. + +--------------------------------------- +*qiget(<queue_iterator_id>) +obtains the next member in the iterator's queue, returns the next member's id or 0 when it doesnt exist. + +Example: + for( set .@elem,qiget(.@queue_iterator_id); qicheck(.@queue_iterator_id); set .@elem,qiget(.@queue_iterator_id) ) { + //Do something + } + +--------------------------------------- +*qiclear(<queue_iterator_id>) +deletes a queue iterator from memory, returns 1 when it fails, 0 otherwise. + +---------------------------------------
\ No newline at end of file |