summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/script_commands.txt206
1 files changed, 156 insertions, 50 deletions
diff --git a/doc/script_commands.txt b/doc/script_commands.txt
index 7efcc77ad..7e00e50dc 100644
--- a/doc/script_commands.txt
+++ b/doc/script_commands.txt
@@ -974,14 +974,14 @@ Within executable script code, some lines can be labels:
<label name>:
Labels are points of reference in your script, which can be used to route
-execution with 'goto', 'menu' and 'jump_zero' commands, invoked with
-'doevent' and 'donpcevent' commands and are otherwise essential. A label's
-name may not be longer than 22 characters. (23rd is the ':'.) There is
-some confusion in the source about whether it's 22, 23 or 24 all over the
-place, so keeping labels under 22 characters could be wise. It may only
-contain alphanumeric characters and underscore. In addition to labels you
-name yourself, there are also some special labels which the script engine
-will start execution from if a special event happens:
+execution with 'goto' and 'menu' commands, invoked with 'doevent', 'donpcevent'
+and 'callsub' commands and are otherwise essential. A label's name may not be
+longer than 22 characters. (23rd is the ':'.) There is some confusion in the
+source about whether it's 22, 23 or 24 all over the place, so keeping labels
+under 22 characters could be wise. It may only contain alphanumeric characters
+and underscore. In addition to labels you name yourself, there are also some
+special labels which the script engine will start execution from if a special
+event happens:
OnClock<hour><minute>:
OnMinute<minute>:
@@ -2058,6 +2058,14 @@ else if (<condition 2>) {
*jump_zero (<condition>),<label>;
+ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+ @ /!\ This command is deprecated @
+ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+
+This command is deprecated and it should not be used in new scripts, as it is
+scheduled to be removed at any time on or after November 27th, 2014. Please
+consider using 'if', 'switch', 'for', 'while', as appropriate.
+
This command works like an 'if'+'goto' combination in one go. (See 'if').
If the condition is false (equal to zero) this command will immediately
jump to the specified label like in 'goto'.
@@ -3819,50 +3827,78 @@ falcon and 0 if they don't.
---------------------------------------
-*setriding {<flag>};
-*checkriding()
+*setmount {<flag>};
+*checkmount()
-If <flag> is 0 this command will remove the mount from the character.
+If <flag> is MOUNT_NONE (or 0) this command will remove the mount from the
+character.
-Otherwise it gives the invoking character a combat mount specific to their
-class.
+Otherwise it gives the invoking character the desired combat mount, where
+allowed by their class and skills.
+
+If no flag is specified, the mount is automatically chosen according to the
+character's class and skills.
+
+The following flag values are accepted:
+
+ MOUNT_NONE:
+ - Dismount
+ MOUNT_PECO:
+ - PecoPeco (Knight series class)
+ - GrandPeco (Crusader series class)
+ - Gryphon (Royal Guard)
+ MOUNT_WUG:
+ - Warg (Ranger)
+ MOUNT_MADO:
+ - Mado Gear (Mechanic)
+ MOUNT_DRAGON:
+ MOUNT_DRAGON_GREEN:
+ MOUNT_DRAGON_BROWN:
+ MOUNT_DRAGON_GRAY:
+ MOUNT_DRAGON_BLUE:
+ MOUNT_DRAGON_RED:
+ - Dragon (Rune Knight)
+ if MOUNT_DRAGON is specified, a the default (green) dragon will be used.
- - PecoPeco (Knight series class)
+Unlike 'setfalcon' and 'setcart' this will not work at all if they aren't of a
+class which can ride a mount.
- - GrandPeco (Crusader series class)
+The accompanying function will return 0 if the invoking character is not on a
+mount, and a non-zero value (according to the above constants) if they are.
+Note: in case of dragons, the returned value will always be MOUNT_DRAGON,
+regardless of color.
- - Dragon (Rune Knight)
- The color of the dragon can be passed through the flag value using
- either values 1 ~ 5 or the following constants:
- DRAGON_GREEN
- DRAGON_BROWN
- DRAGON_GRAY
- DRAGON_BLUE
- DRAGON_RED
+ if (checkmount())
+ mes "Leave your mount outside! No riding mounts on the floor here!";
- - Gryphon (Royal Guard)
+ if (checkmount() == MOUNT_DRAGON)
+ mes "Wow, your dragon is cool! Can I pet it?";
- - Warg (Ranger)
-
- - Mado Gear (Mechanic)
+---------------------------------------
-Unlike 'setfalcon' and 'setcart' this will not work at all if they aren't of a
-class which can ride a mount.
+*setriding {<flag>};
+*checkriding()
-Note: The character needs to have the specific skill for their mount.
+[ DEPRECATED - Please use setmount / checkmount]
+
+If <flag> is 0 this command will remove the mount from the character.
+Otherwise it gives the invoking character a PecoPeco (if they are a Knight
+series class), a GrandPeco (if they are a Crusader series class), or
+a Gryphon (if they are a Royal Guard). Unlike 'setfalcon' and 'setcart'
+this will not work at all if they aren't of a class which can ride.
+Note: the character needs to have the skill KN_RIDING to gain a mount.
The accompanying function will return 1 if the invoking character is
-on a mount and 0 if they aren't.
+riding a bird and 0 if they aren't.
- if (checkriding())
- mes "Leave your mount outside! No riding mounts on the floor here!";
+ if (checkriding()) mes "PLEASE leave your bird outside! No riding birds on the floor here!";
---------------------------------------
*setdragon {<color>};
*checkdragon()
-[ DEPRECATED - Please use setriding]
+[ DEPRECATED - Please use setmount / checkmount]
The 'setdragon' function toggles mounting a dragon for the invoking
character. It will return 1 if successful, 0 otherwise.
@@ -3885,7 +3921,7 @@ riding a dragon and 0 if they aren't.
*setmadogear {<flag>};
*checkmadogear()
-[ DEPRECATED - Please use setriding]
+[ DEPRECATED - Please use setmount / checkmount]
If <flag> is 0 this command will remove the mount from the character.
Otherwise it gives the invoking character a Mado (if they are a Mechanic).
@@ -3895,10 +3931,10 @@ Mado and 0 if they don't.
---------------------------------------
-*setmounting;
-*ismounting()
+*setcashmount;
+*hascashmount()
-The 'setmounting' function toggles cash mount for the invoking character.
+The 'setcashmount' function toggles cash mount for the invoking character.
It will return 1 if successful, 0 otherwise.
Note: Character must not be mounting a non-cash mount (eg. dragon, peco,
@@ -7284,12 +7320,16 @@ when not provided, "group level char" defaults to 99.
(1 = log, 0 = no log), default is to not log.
The following variables are set upon execution:
- .@atcmd_command$ = The name of the @command used.
- .@atcmd_parameters$[] = Array containing the given parameters,
- starting from an index of 0.
- .@atcmd_numparameters = The number of parameters defined.
+ .@atcmd_command$ = The name of the @command used.
+ .@atcmd_parameters$[] = Array containing the given parameters,
+ starting from an index of 0.
+ .@atcmd_numparameters = The number of parameters defined.
-Example:
+Parameters are split on spaces. Multiple spaces aren't grouped together, and
+will create multiple (empty) arguments.
+Any leading spaces before the first parameter will be omitted.
+
+Usage example:
When a user types the command "@test", an angel effect will be shown.
@@ -7302,6 +7342,50 @@ OnAtcommand:
end;
}
+Parameter splitting example:
+ @mycommand
+ .@atcmd_numparameters -> 0
+ .@atcmd_parameters$ -> { }
+ @mycommand<space><space>
+ .@atcmd_numparameters -> 0
+ .@atcmd_parameters$ -> { }
+ @mycommand<space>foo
+ .@atcmd_numparameters -> 1
+ .@atcmd_parameters$ -> { "foo" }
+ @mycommand<space><space>foo
+ .@atcmd_numparameters -> 1
+ .@atcmd_parameters$ -> { "foo" }
+ @mycommand<space>foo<space>bar
+ .@atcmd_numparameters -> 2
+ .@atcmd_parameters$ -> { "foo", "bar" }
+ @mycommand<space>foo<space><space>bar
+ .@atcmd_numparameters -> 3
+ .@atcmd_parameters$ -> { "foo", "", "bar" }
+ @mycommand<space>foo<space>
+ .@atcmd_numparameters -> 2
+ .@atcmd_parameters$ -> { "foo", "" }
+ @mycommand<space>foo<space><space>
+ .@atcmd_numparameters -> 3
+ .@atcmd_parameters$ -> { "foo", "", "" }
+
+The called event label needs to take care of joining arguments together, in
+case it expects spaces. For example:
+
+- script atcmd_example -1,{
+OnInit:
+ bindatcmd "test",strnpcinfo(3)+"::OnAtcommand";
+ end;
+OnAtcommand:
+ // This command expects a character name (that may contain spaces) as
+ // the only parameter.
+ .@name$ = "";
+ for (.@i = 0; .@i < .@atcmd_numparameters; ++.@i) {
+ .@name$ += (.@i > 0 ? " " : "") + .@atcmd_parameters$[.@i];
+ }
+ dispbottom("The specified name is: '" + .@name$ + "'");
+ end;
+}
+
---------------------------------------
*unbindatcmd "command";
@@ -7887,17 +7971,24 @@ reached or when pet performance is activated.
*petskillsupport <skill id>,<skill level>,<delay>,<percent hp>,<percent sp>;
*petskillsupport "<skill name>",<skill level>,<delay>,<percent hp>,<percent sp>;
-*petheal <level>,<delay>,<percent hp>,<percent sp>;
This will make the pet use a specified support skill on the owner whenever
the HP and SP are below the given percent values, with a specified delay
time between activations. The skill numbers are as per
'db/(pre-)re/skill_db.txt'.
-'petheal' works the same as 'petskillsupport' but has the skill ID
-hard-coded to 28 (Heal). This command is deprecated.
It's not quite certain who's stats will be used for the skills cast, the
character's or the pets. Probably, Skotlex can answer that question.
+*petheal <level>,<delay>,<percent hp>,<percent sp>;
+
+ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+ @ /!\ This command is deprecated @
+ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+
+The petheal command is deprecated and it should not be used in new scripts, as
+it is scheduled to be removed after November 27th, 2014. Please consider using
+petskillsupport by specifying the AL_HEAL skill id instead.
+
*petskillattack <skill id>,<skill level>,<rate>,<bonusrate>;
*petskillattack "<skill name>",<skill level>,<rate>,<bonusrate>;
*petskillattack2 <skill id>,<damage>,<number of attacks>,<rate>,<bonusrate>;
@@ -8346,7 +8437,13 @@ Add quest of the <ID2> to the the quest log, and the state is "active".
*checkquest(<ID>{,PLAYTIME|HUNTING})
-DEPRECATED - use questprogress instead.
+ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+ @ /!\ This command is deprecated @
+ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+
+This command is deprecated and it should not be used in new scripts, as it
+is scheduled to be removed on or after November 28th, 2014. Please consider
+using questprogress() instead. Or, in special cases, questactive().
If no additional argument supplied, return the state of the quest:
-1 = Quest not started (not in quest log)
@@ -8373,23 +8470,32 @@ If parameter "HUNTING" is supplied:
*questprogress(<ID>{,PLAYTIME|HUNTING})
-If no additional argument supplied, return the state of the quest:
+If no additional argument supplied, return the state of the quest:
0 = Quest not started (not in quest log)
1 = Quest has been given
2 = Quest completed
-If parameter "PLAYTIME" is supplied:
+If parameter 'PLAYTIME' is supplied:
0 = Quest not started (not in quest log)
1 = The time limit has not yet been reached
2 = The time limit has been reached
-If parameter "HUNTING" is supplied:
+If parameter 'HUNTING' is supplied:
0 = Quest not started (not in quest log)
1 = Player hasn't killed all of the target monsters
2 = Player has killed all of the target monsters
---------------------------------------
+*questactive(<ID>)
+
+Check whether the given quest is in its active state.
+
+Returns true if the quest is active, false otherwise (quest not started,
+inactive or completed)
+
+---------------------------------------
+
*showevent <icon>{,<mark color>}
Show an emotion on top of a NPC, and optionally,