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.txt862
1 files changed, 509 insertions, 353 deletions
diff --git a/doc/script_commands.txt b/doc/script_commands.txt
index 29e9edee4..383a3c301 100644
--- a/doc/script_commands.txt
+++ b/doc/script_commands.txt
@@ -4,7 +4,7 @@
//= A reference manual for the eAthena scripting language.
//= Commands are sorted depending on their functionality.
//===== Version ===========================================
-//= 3.28.20091119
+//= 3.34.20101217
//=========================================================
//= 1.0 - First release, filled will as much info as I could
//= remember or figure out, most likely there are errors,
@@ -137,6 +137,22 @@
//= Added info on strcharinfo(3) [Skotlex]
//= 3.29.20101123
//= Added 'pushpc' command. [Ai4rei]
+//= 3.30.20101126
+//= Added 'setfont', 'mercenary_create', 'mercenary_heal',
+//= 'mercenary_sc_start', 'mercenary_get_calls', 'mercenary_set_calls',
+//= 'mercenary_get_faith' and 'mercenary_set_faith' commands. [Ai4rei]
+//= 3.31.20101130
+//= Added 'progressbar' command. [Ai4rei]
+//= 3.32.20101208
+//= Updated description for commands 'next', 'return', 'attachrid',
+//= 'detachrid', 'itemskill', 'openstorage', 'skilleffect', 'donpcevent',
+//= 'day', 'night', 'atoi', 'axtoi', 'jump_zero', 'getelementofarray',
+//= 'changebase', 'kickwaitingroomall', 'cutin' and 'charcommand'. [Ai4rei]
+//= 3.33.20101212
+//= Updated description of 'playBGM' and 'playBGMall' to reflect the actual
+//= behavior. [Ai4rei]
+//= 3.34.20101217
+//= Spellcheck. [Ai4rei]
//=========================================================
This document is a reference manual for all the scripting commands and functions
@@ -219,7 +235,7 @@ Another configuration file option of relevance is:
delnpc: <path to a filename>
-This will unload a specifiled script filename from memory, which, while
+This will unload a specified script filename from memory, which, while
seemingly useless, may sometimes be required.
Whenever '//' is encountered in a line upon reading, everything beyond this on
@@ -299,7 +315,7 @@ the database by adjoining the level after the name with a comma. eg:
Event is a script event to be executed when the mob is killed. The event must
be in the form "NPCName::OnEventName" to execute, and the event name label
-should start with "On". As with all events, if the NPC is an on-touch npc, the
+should start with "On". As with all events, if the NPC is an on-touch NPC, the
player who triggers the script must be within 'trigger' range for the event to
work.
@@ -309,21 +325,21 @@ special ai mobs (which by default attack other monsters instead of players).
You can add these, so using 10 will spawn small monsters that attack other
mobs (if you specify both 2 and 4, the small version takes priority).
-** Npc names
+** NPC names
-/!\ WARNING: this applies to warps, npcs, duplicates and shops /!\
+/!\ WARNING: this applies to warps, NPCs, duplicates and shops /!\
-Npc names are kinda special and are formatted this way:
+NPC names are kinda special and are formatted this way:
<Display name>{::<Unique name>}
-All npcs need to have a unique name that is used for identification purposes.
-When you have to identify a npc by it's name, you should use <Unique name>.
+All NPCs need to have a unique name that is used for identification purposes.
+When you have to identify a NPC by it's name, you should use <Unique name>.
If <Unique name> is not provided, use <Display name> instead.
The client has a special feature when displaying names:
if the display name contains a '#' character, it hides that part of the name.
-ex: if your npc is named 'Hunter#hunter1', it will be displayed as 'Hunter'
+ex: if your NPC is named 'Hunter#hunter1', it will be displayed as 'Hunter'
<Display name> must be at most 24 characters in length.
<Unique name> must be at most 24 characters in length.
@@ -492,15 +508,16 @@ implemented (but NEVER documented by Lance. Shame on you...).
Item and pet scripts
--------------------
-Each item in the item database has two special fields - EquipScript and
-UseScript. The first is script code run every time a character equips the item,
+Each item in the item database has three special fields - Script , OnEquip_Script
+and OnUnequip_Script. The first is script code run every time a character equips the item,
with the RID of the equipping character. Every time they unequip an item, all
temporary bonuses given by the script commands are cleared, and all the scripts
are executed once again to rebuild them. This also happens in several other
situations (like upon login) but the full list is currently unknown.
-UseScript is a piece of script code run whenever the item is used by a character
-by doubleclicking on it.
+OnEquip_Script is a piece of script code run whenever the item is used by a character
+by doubleclicking on it. OnUnequip_Script runs whenever the
+equipment is unequip by a character
Not all script commands work properly in the item scripts. Where commands and
functions are known to be meant specifically for use in item scripts, they are
@@ -519,7 +536,7 @@ Numbers
Beside the common decimal numbers, which are nothing special whatsoever (though
do not expect to use fractions, since ALL numbers are integer in this language),
the script engine also handles hexadecimal numbers, which are otherwise
-identical. Writing a number like '0x<hex digits>' will make it recognised as a
+identical. Writing a number like '0x<hex digits>' will make it recognized as a
hexadecimal value. Notice that 0x10 is equal to 16. Also notice that if you try
to 'mes 0x10' it will print '16'.
@@ -533,7 +550,7 @@ data.
Variables are divided into and uniquely identified by the combination of:
prefix - determines the scope and extent (or lifetime) of the variable
-name - an identifier consisting of '_' and alfanumeric characters
+name - an identifier consisting of '_' and alphanumeric characters
postfix - determines the type of the variable: integer or string
Scope can be:
@@ -549,8 +566,10 @@ permanent - They still exist when the server resets.
temporary - They cease to exist when the server resets.
Prefix: scope and extent
-nothing - A permanent variable attached to the character, the default
- variable type.
+nothing - A permanent variable attached to the character, the default variable
+ type. They are stored with all the account data in "save\athena.txt"
+ in TXT versions and in the SQL versions in the `global_reg_value`
+ table using type 3.
"@" - A temporary variable attached to the character.
SVN versions before 2094 revision and RC5 version will also treat
'l' as a temporary variable prefix, so beware of having variable
@@ -562,8 +581,8 @@ nothing - A permanent variable attached to the character, the default
This is important for scripts which are called with no RID
attached, that is, not triggered by a specific character object.
"." - A NPC variable.
- They exist in the NPC and dissapear when the server restarts or the
- npc is reloaded. Can be accessed from inside the NPC or by calling
+ They exist in the NPC and disappear when the server restarts or the
+ NPC is reloaded. Can be accessed from inside the NPC or by calling
'getvariableofnpc'.
".@" - A scope variable.
They are unique to the instance and scope. Each instance has it's
@@ -597,8 +616,8 @@ Examples:
$name$ - permanent global string variable
$@name - temporary global integer variable
$@name$ - temporary global string variable
- .name - npc integer variable
- .name$ - npc string variable
+ .name - NPC integer variable
+ .name$ - NPC string variable
.@name - scope integer variable
.@name$ - scope string variable
#name - permanent local account integer variable
@@ -623,7 +642,7 @@ BaseLevel - Current base level
SkillPoint - Amount of skill points remaining
Class - Current job
Upper - 1 if the character is an advanced job class.
-Zeny - Current amount of zeny
+Zeny - Current amount of Zeny
Sex - Character's gender, 0 if female, 1 if male.
Weight - The weight the character currently carries.
MaxWeight - The maximum weight the character can carry.
@@ -650,7 +669,7 @@ While these behave as variables, do not always expect to just set them - it is
not certain whether this will work for all of them. Whenever there is a command
or a function to set something, it's usually preferable to use that instead. The
notable exception is Zeny, which you can and often will address directly -
-setting it will make the character own this number of zeny.
+setting it will make the character own this number of Zeny.
If you try to set Zeny to a negative number, the script will be terminated with an error.
Strings
@@ -686,11 +705,11 @@ This will make @arrayofnumbers[100] equal to 10.
Notice that index numbering always starts with 0. Arrays cannot hold more than
128 variables. (So the last one can't have a number higher than 127)
-And array indices probably can't be negative. Nobody tested what happens when
+And array indexes probably can't be negative. Nobody tested what happens when
you try to get a negatively numbered variable from an array, but it's not going
to be pretty. :)
-Arrays can naturaly store strings:
+Arrays can naturally store strings:
@menulines$[0] is the 0th element of the @menulines$ array of strings. Notice
the '$', normally denoting a string variable, before the square brackets that
@@ -747,7 +766,7 @@ common mathematical operations or conditional operators
+ - will add two numbers. If you try to add two strings, the result will be a
string glued together at the +. You can add a number to a string, and the
result will be a string. No other math operators work with strings.
-- - will subtract two numbers.
+- - will subtract two numbers.
* - will multiply two numbers.
/ - will divide two numbers. Note that this is an integer division, i.e.
7/2 is not equal 3.5, it's equal 3.
@@ -807,18 +826,18 @@ Logical bitwise operators work only on numbers, and they are the following:
The second mes command would display 4, which is the same as 16 / 2 = 8. 8 / 2 = 4.
& - And.
| - Or.
- The bitwise operator AND (&) is used to test two values against eachother,
+ The bitwise operator AND (&) is used to test two values against each other,
and results in setting bits which are active in both arguments. This can
be used for a few things, but in eAthena this operator is usually used to
- create bitmasks in scripts.
+ create bit-masks in scripts.
The bitwise operator OR (|)sets to 1 a binary position if the binary position
of one of the numbers is 1. This way a variable can hold several values we can check,
- known as bitmaks. A variable currently can hold up to 32 bitmasks (from position 0
+ known as bit-mask. A variable currently can hold up to 32 bit-masks (from position 0
to position 1). This is a cheap(skate) and easy way to avoid using arrays to store several checks
that a player can have.
- A bitmask basically is (ab)using the variables bits to set various options in
+ A bit-mask basically is (ab)using the variables bits to set various options in
one variable. With the current limit if variables it is possible to store 32
different options in one variable (by using the bits on position 0 to 31).
@@ -831,7 +850,7 @@ Logical bitwise operators work only on numbers, and they are the following:
The & (AND) operator sets bits which are active (1) in both arguments, so in the
example 1010 & 0010, only the 2^1 bit is active (1) in both. Resulting in the bit
0010, which is 2.
- - Basic example of creating and using a bit mask:
+ - Basic example of creating and using a bit-mask:
set @options,2|4|16; //(note: this is the same as 2+4+16, or 22)
if (@options & 1) mes "Option 1 is activated";
if (@options & 2) mes "Option 2 is activated";
@@ -844,7 +863,7 @@ Logical bitwise operators work only on numbers, and they are the following:
The bitwise operator XOR (eXclusive OR) sets a binary position to 0 if both
numbers have the same value in the said position. On the other hand, it
sets to 1 if they have different values in the said binary position.
- This is another way of setting and unsetting bits in bitmasks.
+ This is another way of setting and unsetting bits in bit-masks.
Example:
- First let's set the quests that are currently in progress:
@@ -860,10 +879,56 @@ Logical bitwise operators work only on numbers, and they are the following:
if( inProgress&1 && isComplete ){
// this will unset the bit for quest 1 (inProgress has that bit set to 1)
set inProgress,inProgress^1;
- mes "Quest 1 complete!! You unlocked the secrets of the Xor dinasty, use them wisely.";
+ mes "Quest 1 complete!! You unlocked the secrets of the Xor dynasty, use them wisely.";
+ close;
+ }
+
+Unary operators with only with a single number, which follows the operator, and
+are following:
+
+ - - Negation.
+ The sign of the number will be reversed. If the number was positive, it will
+ become negative and vice versa.
+
+ Example:
+ set .@myvar,10;
+ mes "Negative 10 is "+(-.@myvar);
+
+ ! - Logical Not.
+ Reverses the boolean result of an expression. True will become false and
+ false will become true.
+
+ Example:
+ if(!callfunc("F_dosomething"))
+ {
+ mes "Doing something failed.";
close;
}
+ ~ - Bitwise Not.
+ Reverses each bit in a number, also known as one's complement. Cleared bits
+ are set, and set bits are cleared.
+
+ Example:
+ - Ensure, that quest 2 is disabled, while keeping all other active, if they are.
+ set inProgress,inProgress&(~2); // same as set inProgress,inProgress&0xfffffffd
+
+Ternary operators take three expressions (numbers, strings or boolean), and are
+following:
+
+ ?: - Conditional operator
+ Very useful e.g. to replace
+
+ if(Sex) mes "..."; else mes "...";
+
+ clauses with simple
+
+ mes "Welcome, " + (Sex?"Mr.":"Mrs.") + " " + strcharinfo(0);
+
+ or to replace any other simple if-else clauses. It might be worth
+ mentioning that ?: has low priority and has to be enclosed with
+ parenthesis in most (if not all) cases.
+
Labels
------
@@ -912,12 +977,12 @@ done with @agitstart GM command or with 'AgitStart' script command. OnAgitEnd
will do likewise for the end of WoE. OnAgitInit will run when castle data is
loaded from the char-server by the map server.
-No RID will be attached while any of the abovementioned labels are triggered, so
+No RID will be attached while any of the above mentioned labels are triggered, so
no character or account-based variables will be accessible, until you attach a
RID with 'attachrid' (see below).
-The above also applies to, the last three laels, the only difference is that
-these labels are used exclusively for WoE SE, and are called independantly.
+The above also applies to, the last three labels, the only difference is that
+these labels are used exclusively for WoE SE, and are called independently.
OnTouch:
@@ -953,7 +1018,7 @@ OnPCLoadMapEvent:
This special label will trigger once a player steps in a map marked with the
'loadevent' mapflag and attach its RID. The fact that this label requires a
mapflag for it to work is because, otherwise, it'd be server-wide and trigger
-everytime a player would change maps. Imagine the server load with 1,000 players
+every time a player would change maps. Imagine the server load with 1,000 players
(oh the pain...)
Only the special labels which are not associated with any script command are
@@ -963,7 +1028,7 @@ manner, but they are described with their associated commands.
On<label name>:
These special labels are used with Mob scripts mostly, and script commands
-that requires you to point/link a command to a mob or another npc, giving a label
+that requires you to point/link a command to a mob or another NPC, giving a label
name to start from. The label name can be any of your liking, but must be
Example:
@@ -981,6 +1046,15 @@ OnThisMobDeath:
Each time you kill one, that announce will appear in blue to everyone.
+"Global" labels
+
+There's a catch with labels and doevent. If you call a label (using doevent)
+and called label is in NPC that has trigger area, that label must end with
+"Global" to work globally (i.e. if RID is outside of the trigger area, which
+usually happens since otherwise there would be no point calling the label with
+doevent, because OnTouch would do the job). For further reference look for
+npc_event in npc.c.
+
Scripting commands and functions
--------------------------------
@@ -1008,9 +1082,10 @@ From here on, we will have the commands sorted as follow:
4.- Player-related commands.
5.- Mob / NPC -related commands.
6.- Other commands.
-7.- Instance Commands.
-8.- Quest Log Commands.
+7.- Instance commands.
+8.- Quest Log commands.
9.- Battleground commands.
+10.- Mercenary commands.
=====================
|1.- Basic commands.|
@@ -1049,9 +1124,14 @@ either side solves the problem.
*next;
-This command will create a 'next' button in the message window for the invoking
-character. If no window is currently on screen, it will be created. Used to
-segment NPC talking, this command is used A LOT. See 'mes'.
+This command will display a 'next' button in the message window for the
+invoking character. Clicking on it will cause the window to clear and display
+a new one. Used to segment NPC-talking, next is often used in combination with
+'mes' and 'close'.
+
+If no window is currently on screen, one will be created, but once the invoking
+character clicks on it, a warning is thrown on the server console and the script
+will terminate.
mes "[Woman]";
mes "This would appear on the page";
@@ -1098,7 +1178,7 @@ Don't expect things to run smoothly if you don't make your scripts 'end'.
*end;
This command will stop the execution for this particular script. The two
-versions are prefectly equivalent. It is the normal way to end a script which
+versions are perfectly equivalent. It is the normal way to end a script which
does not use 'mes'.
if (BaseLevel<=10) goto L_Lvl10;
@@ -1134,7 +1214,7 @@ This command will set a variable to the value that the expression results in.
This is the only way to set a variable directly.
This is the most basic script command and is used a lot whenever you try to do
-anything more advanced than just printing text into a messagebox.
+anything more advanced than just printing text into a message box.
set @x,100;
@@ -1184,7 +1264,7 @@ Returns a reference to a NPC variable (. prefix) from the target NPC.
This can only be used to get . variables.
Example(s):
-//This will return the value of .var, note that this can't be used, since the value isn't catched.
+//This will return the value of .var, note that this can't be used, since the value isn't caught.
getvariableofnpc(.var,"TargetNPC");
//This will set the .v variable to the value of the TargetNPC's .var variable.
@@ -1418,8 +1498,8 @@ allow the player to enter text. Otherwise, only numbers will be allowed.
Normally you may not input a negative number with this command.
This is done to prevent exploits in badly written scripts, which would
-let people, for example, put negative amounts of zeny into a bank script and
-receive free zeny as a result.
+let people, for example, put negative amounts of Zeny into a bank script and
+receive free Zeny as a result.
Since trunk r12192 the command has two optional arguments and a return value.
The default value of 'min' and 'max' can be set with 'input_min_value' and
@@ -1507,7 +1587,7 @@ S_CheckFull:
return;
Example 2: callsub used repeatedly, with different arguments
-// notice how the zeny check/delete is reused, instead of copy-pasting for every warp
+// notice how the Zeny check/delete is reused, instead of copy-pasting for every warp
switch(select("Abyss Lake:Amatsu Dungeon:Anthell:Ayothaya Dungeon:Beacon Island, Pharos") {
case 1: callsub S_DunWarp,"hu_fild05",192,207;
case 2: callsub S_DunWarp,"ama_in02",119,181;
@@ -1527,7 +1607,7 @@ S_DunWarp:
set Zeny, Zeny-100;
warp getarg(0),getarg(1),getarg(2);
} else {
- mes "Dungeon warp costs 100 zeny.";
+ mes "Dungeon warp costs 100 Zeny.";
}
close;
@@ -1588,9 +1668,13 @@ in the previous example getarg(2,-1) would be 3 and getarg(3,-1) would be -1
*return {<value>};
-When you use callsub or callfunc, this command allows you to go back to the
-calling script. You can optionally return with a value telling the calling
-program what exactly happened.
+This command causes the script execution to leave previously called function
+with callfunc or script with callsub and return to the location, where the call
+originated from. Optionally a return value can be supplied, when the call was
+done using the function form.
+
+Using this command outside of functions or scripts referenced by callsub will
+result in error and termination of the script.
callfunc "<your function>";// when nothing is returned
set <variable>,callfunc("<your function>");// when a value is being returned
@@ -1605,9 +1689,9 @@ program what exactly happened.
(Skotlex stop being so selfish and give us all the commands T~T! J/k lol :P)
-This works like callfunc, but doesn't support arguments like callfunc. It's used for cleaner
-and fast script that doesn't require arguments for it to work. Also they must be inside a script.
-They're not separated scripts and they work more like labels.
+This works like callfunc. It's used for cleaner and fast scripting. Also they
+must be inside a script. They're not separated scripts and they work more like
+labels with arguments.
Note it looks like the normal declaration
@@ -1615,10 +1699,10 @@ Usage:
You first Declare the function with function <function name>;.
-Put the rest of your code. You can use then <function name>; to call the function. If it returns a value is unsure,
-test it if you want and give us some comments ;3
+Put the rest of your code. You can use then <function name>; to call the
+function. It can also return a value when used with parentheses.
-And at least, but inside the script itself, put the function <function name> {<code>}.
+And at last, but inside the script itself, put the function <function name> {<code>}.
Example:
@@ -1638,7 +1722,7 @@ if (Zeny > 50) && (BaseLevel > 50) {
set @needed,50-BaseLevel;
mes "You either are Level "+BaseLevel+", thus you need "+@needed+" more levels";
-mes "to be able to use this npc; or you don't have enough zeny, so get some please";
+mes "to be able to use this NPC; or you don't have enough Zeny, so get some please";
close;
function SF_Selling {
@@ -1667,6 +1751,24 @@ function SF_Selling {
return;
}
+Example with parameters and return value:
+
+prontera,150,150,0 script TestNPC 123,{
+ function MyAdd;
+
+ mes "Enter two numbers.";
+ next;
+ input .@a;
+ input .@b;
+ mes .@a+" + "+.@b+" = "+MyAdd(.@a,.@b);
+ close;
+
+ function MyAdd
+ {
+ return getarg(0)+getarg(1);
+ }
+}
+
---------------------------------------
@@ -1721,7 +1823,7 @@ Example 3:
if (@var==1) mes "This is the first time you have talked to me";
if (@var==2) mes "This is the second time you have talked to me";
if (@var==3) mes "This is the third time you have talked to me";
- if (@var==4) mes "This is the forth time you have talked to me, but I think I am getting amnesia, I have forgoten about you";
+ if (@var==4) mes "This is the forth time you have talked to me, but I think I am getting amnesia, I have forgotten about you";
if (@var==4) set @var,0;
close;
@@ -1733,7 +1835,7 @@ Example 4:
mes "Can you please bring me an apple?";
close;
L_GiveApple:
- mes "Oh an apple, I didnt want it, I just wanted to see one";
+ mes "Oh an apple, I didn't want it, I just wanted to see one";
close;
Example 5:
@@ -1801,7 +1903,7 @@ if (<condition)
}
Remember that if you plan to do several actions upon the condition being false, and
-you forget to use the curlies (the { } ), the second action will be executed regardless
+you forget to use the curly braces (the { } ), the second action will be executed regardless
the output of the condition, unless of course, you stop the execution of the script if the
condition is true (that is, in the first grouping using a return; , and end; or a close; )
@@ -1826,10 +1928,12 @@ else if (<condition 2>)
This command works kinda 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'.
+the specified label like in 'goto'. While 'if' is more generally useful, for
+some cases this could be an optimization.
-While 'if' is more generally useful, for some cases this could be an
-optimisation.
+The main reason for this command is that other control statements, like
+'switch', 'for' or 'while', are disassembled into simple expressions together
+with this command when a script is parsed.
---------------------------------------
@@ -1897,8 +2001,8 @@ Example 2:
*do { <statement>; } while (<condition>);
-The 'do...while' is the only posttest loop structure available in this script
-language. With a posttest, the statements are executed once before the condition
+The 'do...while' is the only post-test loop structure available in this script
+language. With a post-test, the statements are executed once before the condition
is tested. When the condition is true, the statement(s) are repeated. When the
condition is false, control is transferred to the statement following the
'do...while' loop expression.
@@ -2030,7 +2134,7 @@ returned when requesting that information.
*strnpcinfo(<type>)
-This function will return the various parts of the name of the calling npc.
+This function will return the various parts of the name of the calling NPC.
Whatever it returns is determined by type.
0 - The NPC's display name (visible#hidden)
@@ -2062,16 +2166,13 @@ This will make @arraysize == 6. But if you try this:
*getelementofarray(<array name>,<index>)
-This function will return an array's element when given an index.
-
- // This will find the 2nd array value
- getelementofarray(@array,1)
+This command retrieves the value of the element of given array at given index.
+This is equivalent to using:
-Pretty pointless now when we have
+ array[index]
- @array[1]
-
-which has the same effect.
+The reason for this is, that this short form is internally converted into a call
+to getelementofarray, when the script is loaded.
---------------------------------------
@@ -2099,9 +2200,9 @@ putting
StatusPoint
will give you the same result, and some of these parameters work just like
-variables (i.e. you can 'set Zeny,100' to make the character have 100 zeny,
-destroying whatever zeny they had before, or 'set Zeny,Zeny+100' to give them
-100 zeny)
+variables (i.e. you can 'set Zeny,100' to make the character have 100 Zeny,
+destroying whatever Zeny they had before, or 'set Zeny,Zeny+100' to give them
+100 Zeny)
You can also use this command to get stat values:
@@ -2194,7 +2295,7 @@ else.
Upon executing this,
-$@partymembername$[] is a global temporary stringarray which contains all the
+$@partymembername$[] is a global temporary string array which contains all the
names of these party members
(only set when type is 0 or not specified)
@@ -2249,7 +2350,7 @@ Example:
*getpartyleader(<party id>{,<type>})
This function returns some information about the given party-id's leader.
-When type is ommitted, the default information retrieved is the leader's name.
+When type is omitted, the default information retrieved is the leader's name.
Possible types are:
1: Leader account id
@@ -2266,7 +2367,7 @@ returns "null" instead of the character name, and -1 for the other types.
*getlook(<type>)
-This function will return the number for the currentcharacter look value
+This function will return the number for the current character look value
specified by type. See 'setlook' for valid look types.
This can be used to make a certain script behave differently for characters
@@ -2277,7 +2378,7 @@ dressed in black. :)
*getsavepoint(<information type>)
This function will return information about the invoking character's save point.
-You can use it to let a character swap between several recorded savepoints.
+You can use it to let a character swap between several recorded save points.
Available information types are:
0 - Map name (a string)
@@ -2293,7 +2394,7 @@ Available information types are:
*getequipid(<equipment slot>)
This function returns the item ID of the item equipped in the equipment slot
-specified on the invoking character. If nothing is equpped there, it returns -1.
+specified on the invoking character. If nothing is equipped there, it returns -1.
Valid equipment slots are:
EQI_HEAD_TOP (1) - Upper head gear
@@ -2310,8 +2411,8 @@ EQI_HEAD_LOW (10) - Lower Headgear (beards, some masks)
Notice that a few items occupy several equipment slots, and if the character is
wearing such an item, 'getequipid' will return it's ID number for either slot.
-Can be used to check if you have something equiped, or if you haven't got
-something equiped:
+Can be used to check if you have something equipped, or if you haven't got
+something equipped:
if(getequipid(EQI_HEAD_TOP)==2234) goto L_WearingTiara;
mes "Come back when you have a Tiara on";
@@ -2417,7 +2518,7 @@ see 'getequipid'.
*getequiprefinerycnt(<equipment slot>)
-Returns the current number of plusses for the item in the specified equipment
+Returns the current number of pluses for the item in the specified equipment
slot. For a list of equipment slots see 'getequipid'.
Can be used to check if you have reached a maximum refine value, default for
@@ -2465,7 +2566,7 @@ Or for the left hand, cause it can hold a weapon or a shield:
}
close;
L_NothingEquiped:
- mes "Seems you have nothing equiped";
+ mes "Seems you have nothing equipped";
close;
---------------------------------------
@@ -2474,7 +2575,7 @@ Or for the left hand, cause it can hold a weapon or a shield:
This function calculates and returns the percent value chance to successfully
refine the item found in the specified equipment slot of the invoking character
-by +1. There is no actual formula, the sucess rate for a given weapon level of
+by +1. There is no actual formula, the success rate for a given weapon level of
a certain refine level is found in the db/refine_db.txt file. For a list of
equipment slots see 'getequipid'.
@@ -2527,7 +2628,7 @@ recreate these items perfectly if they are destroyed. Here's what you get:
@inventorylist_card3[] inscribed on the items, so you can explicitly check
@inventorylist_card4[] if the character owns an item made by a specific
craftsman.
-@inventorylist_expire[] - expire time (Unix timestamp). 0 means never expires.
+@inventorylist_expire[] - expire time (Unix time stamp). 0 means never expires.
@inventorylist_count - the number of items in these lists.
This could be handy to save/restore a character's inventory, since no other
@@ -2557,7 +2658,7 @@ While this function was meant for item scripts, it will work outside them:
*getrefine()
-This function will return the number of plusses the weapon currently equipped on
+This function will return the number of pluses the weapon currently equipped on
the invoking character has been refined for.
While this function was meant for item scripts, it will work outside them:
@@ -2689,7 +2790,7 @@ This function will return the GM level of the account to which the invoking
character belongs. If this is somehow executed from a console command, 99 will
be returned, and 0 will be returned if the account has no GM level.
-This allows you to make NPC's only accessable for certain GM levels, or behave
+This allows you to make NPC's only accessible for certain GM levels, or behave
specially when talked to by GMs.
if (getgmlevel()) mes "What is your command, your godhood?";
@@ -2755,15 +2856,12 @@ This will print a full date and time like 'YYYY-MM/DD HH:MM:SS'.
This function will return a number of users on a map or the whole server. What
it returns is specified by Type.
-Type is a bitmask, add up to get the effects you want:
+Type can be one of the following values, which control what will be returned:
- 8 - This will count all characters on the same map as the current NPC.
- (By default, it will count people on the same map as the character)
- 7 - Return the amount of players for the entire server.
- (By default, only the players on the map will be counted.)
-
-So 'getusers(0)' will return the number of characters on the same map as the
-invoking character, while 'getusers(7)' will give the count for entire server.
+ 0 - Count of all characters on the map of the invoking character.
+ 1 - Count of all characters in the entire server.
+ 8 - Count of all characters on the map of the NPC the script is
+ running in.
---------------------------------------
@@ -2827,9 +2925,9 @@ ID number. If there is no such guild, "null" will be returned.
// In this example it would return "MissDjax" cause she owns "AlcoROhics" (10007)
mes getguildmaster(10007)+" runs "+getguildname(10007);
-Can be used to check if the character is the guildmaster of the specified guild.
+Can be used to check if the character is the guild master of the specified guild.
-Maybe you want to make a room only guildmasters can enter:
+Maybe you want to make a room only guild masters can enter:
set @GID,getcharid(2);
if(@GID==0) goto L_NoGuild;
@@ -2848,8 +2946,8 @@ Maybe you want to make a room only guildmasters can enter:
*getguildmasterid(<guild id>)
-This function will return the character ID number of the guildmaster of the
-guild specified by the ID. 0 if the character is not a guildmaster of any guild.
+This function will return the character ID number of the guild master of the
+guild specified by the ID. 0 if the character is not a guild master of any guild.
---------------------------------------
@@ -2874,9 +2972,9 @@ Valid types of data are:
of an 'OnAgitInit:' event mentioned at the beginning of this document.
1 - Guild ID
2 - Castle Economy score.
- 3 - Castle Defence score.
+ 3 - Castle Defense score.
4 - Number of times the economy was invested in today.
- 5 - Number of times the defence was invested in today.
+ 5 - Number of times the defense was invested in today.
9 - Will return 1 if a Kafra was hired for this castle, 0 otherwise.
10 - Is 1 if the 1st guardian is present (Soldier Guardian)
11 - Is 1 if the 2nd guardian is present (Soldier Guardian)
@@ -3126,16 +3224,16 @@ other length limits and asking them to try to input something else.
*skillpointcount()
-Returns the total amount of skill points a character posesses (SkillPoint+SP's used in skills)
-This command can be used to check the currently attached characters total amount of skillpoints.
-This means the skillpoints used in skill are counted, and added to SkillPoints (number of skill points not used).
+Returns the total amount of skill points a character possesses (SkillPoint+SP's used in skills)
+This command can be used to check the currently attached characters total amount of skill points.
+This means the skill points used in skill are counted, and added to SkillPoints (number of skill points not used).
Example:
-//This will set the temp character variable @skillPoints to the amount of skillpoints,
+//This will set the temp character variable @skillPoints to the amount of skill points,
//and then tell the player the value.
set @skillPoints, skillPointCount();
- mes "You have "+@skillPoints+" skillpoints in total!";
+ mes "You have "+@skillPoints+" skill points in total!";
//Self-explanatory... :P
if (skillPointCount() > 20)
@@ -3168,7 +3266,7 @@ currently work due to a bug.
*playerattached()
Returns the ID of the player currently attached to the script. It will return
-0 if noone is attached, or if the attached player no longer exists on the map
+0 if no one is attached, or if the attached player no longer exists on the map
server. It is wise to check for the attached player in script functions that
deal with timers as there's no guarantee the player will still be logged on
when the timer triggers. Note that the ID of a player is actually their
@@ -3194,7 +3292,7 @@ abuse or create some very unfair errors.
This function, in addition to checking to see if the player is capable of
holding a set amount of items, also ensures the player has room in their
-inventory for the item(s) they will be receciving.
+inventory for the item(s) they will be receiving.
Like 'getitem', this function will also accept an 'english name' from the
database as an argument.
@@ -3205,13 +3303,13 @@ database as an argument.
getitem 502,10;
close;
L_OverWeight:
- mes "Sorry you cannot hold this ammount of apples";
+ mes "Sorry you cannot hold this amount of apples";
close;
Or to put this another way:
if (checkweight("APPLE",10)) goto L_Getapples;
- mes "Sorry you cannot hold this ammount of apples";
+ mes "Sorry you cannot hold this amount of apples";
close;
L_Getapples:
getitem 502,10;
@@ -3227,7 +3325,7 @@ This function will return the state of the configuration option
'basic_skill_check' in 'battle_athena.conf'. It returns 1 if the option is
enabled and 0 if it isn't. If the 'basic_skill_check' option is enabled, which
it is by default, characters must have a certain number of basic skill levels to
-sit, request a trade, use emoticons, etc. Making your script behave differently
+sit, request a trade, use emotions, etc. Making your script behave differently
depending on whether the characters must actually have the skill to do all these
things might in some cases be required.
@@ -3282,7 +3380,7 @@ Option numbers valid for the third version (opt2) of this command are:
0x10 - Blinded.
0x80 - Deadly poisoned.
-Option numbers (except for opt1) are bitmasks - you can add them up to check
+Option numbers (except for opt1) are bit-masks - you can add them up to check
for several states, but the functions will return true if at least one of them
is in effect.
@@ -3333,7 +3431,7 @@ and 0 if they don't.
If <flag> is 0 this command will remove the mount from the character.
Otherwise it give the invoking character a PecoPeco (if they are a Knight
-series class) or a GrandPeco (if they are a Crusader seriesclass). Unlike
+series class) or a GrandPeco (if they are a Crusader series class). 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
@@ -3349,7 +3447,7 @@ bird and 0 if they don't.
*checkchatting ({"<Player Name>"})
If the player's name is given, this command checks for that player
-to be online and wether he/she is chatting or vending.
+to be online and whether he/she is chatting or vending.
When no name is given, the attached player is used for checking.
Returns true or false (1 or 0) when the player is chatting/vending or not.
@@ -3393,7 +3491,7 @@ more:
This function will return 1 if the invoking character has all of the item
IDs given equipped (if card IDs are passed, then it checks if the cards are
-inserted into slots in the equipment they are currently wearing). Theorically
+inserted into slots in the equipment they are currently wearing). Theoretically
there is no limit to the number of items that may be tested for at the same time.
If even one of the items given is not equipped, 0 will be returned.
@@ -3447,18 +3545,13 @@ For a list of equipment slots see 'getequipid'.
*attachrid(<account ID>)
*detachrid;
-A 'RID' is an ID of a character who caused the NPC script to run, as has been
-explained above in the introduction section. Quite a bit of commands want a RID
-to work, since they wouldn't know where to send information otherwise. And in
-quite a few cases the script gets invoked with a RID of zero (like through
-OnTime special labels). If an NPC script needs this, it can attach a specified
-character's id to itself. by calling the 'attachrid' function.
-
-'attachrid' returns 1 if the character was found online and 0 if it wasn't.
+These commands allow the manipulation of the script's currently attached player.
+While attachrid allows attaching of a different player by using it's account id
+for the parameter rid, detachrid makes the following commands run, as if the
+script was never invoked by a player.
-This could also be used, while running in a script invoked by a character
-through talking to an NPC, to mess with other characters.
-Detaching the RID will make the RID of the script zero.
+In case, that the player cannot be attached, such as, when the player went
+offline in the mean time, attachrid returns 0, otherwise 1.
---------------------------------------
@@ -3489,7 +3582,7 @@ window.
*warp "<map name>",<x>,<y>;
-This command will take the invoking character to the specifed map, and if
+This command will take the invoking character to the specified map, and if
wanted, specified coordinates too, but these can be random.
warp "place",50,55;
@@ -3508,7 +3601,7 @@ on all official maps. If you're using custom maps, beware.
There are also three special 'map names' you can use.
"Random" will warp the player randomly on the current map.
-"Save" and "SavePoint" will warp the player back to their savepoint.
+"Save" and "SavePoint" will warp the player back to their save point.
---------------------------------------
@@ -3542,7 +3635,7 @@ See also 'warp'.
Warps a party to specified map and coordinate given the party ID, which you can get with
getcharid(1). You can also request another party id given a member's name with getcharid(1,<player_name>).
-You can use the following "map names" for special warping behaviour:
+You can use the following "map names" for special warping behavior:
Random: All party members are randomly warped in their current map (as if they
all used a fly wing)
SavePointAll: All party members are warped to their respective save point.
@@ -3635,7 +3728,7 @@ etc, etc. Since which kind of effect is shown depends on what item was used,
using it in an NPC script will not have a desired effect.
There is also a nice example on using this with the 'rand' function, to give you
-a random ammount of healing.
+a random amount of healing.
// This will heal anything thing from 100 to 150 HP and no SP
itemheal rand(100,150),0;
@@ -3651,7 +3744,7 @@ by a set value - it adds percent of their maximum HP/SP.
percentheal 0,100; // This will heal 100% SP
percentheal 50,50; // This will heal 50% HP and 50% SP
-So the amount that this will heal will depend on the total ammount of HP or SP
+So the amount that this will heal will depend on the total amount of HP or SP
you have maximum. Like 'heal', this will not call up any animations or effects.
---------------------------------------
@@ -3756,8 +3849,6 @@ It would be entered in the equip bonus section of an item
2338,Wedding_Dress,Wedding Dress,5,43000,,500,,0,,0,119529470,7,0,16,,0,1,0,{ bonus bMdef,15; changebase 22; }
-This command only works when inside item scripts.
-
---------------------------------------
*classchange <view id>,<type>;
@@ -3809,7 +3900,7 @@ You can also use the "set" command with the constants defined in 'db/const.txt':
set BaseExp,BaseExp+10000;
set JobExp,JobExp+5000;
-You can also reduce the ammount of experience points:
+You can also reduce the amount of experience points:
set BaseExp,BaseExp-10000;
@@ -3828,12 +3919,12 @@ a palette number that exists/is usable by the client you use.
'changelook' works the same, but is only client side (it doesn't save the look value).
// This will change your hair(6), so that it uses palette 8, what ever your
- // palette 8 is, your hair will use that colour
+ // palette 8 is, your hair will use that color
setlook 6,8;
// This will change your clothes(7), so they are using palette 1, whatever
- // your palette 1 is, your clothes will then use that set of colours.
+ // your palette 1 is, your clothes will then use that set of colors.
setlook 7,1;
@@ -3850,7 +3941,7 @@ Here are the possible look types:
8 - Shield
9 - Shoes
-Whatever 'shoes' means is anybody's guess, ask Gravity - the client does nothing
+Whatever 'shoes' means is anyone's guess, ask Gravity - the client does nothing
with this value. It still wants it from the server though, so it is kept, but
normally doesn't do a thing.
@@ -3866,7 +3957,7 @@ However, it might be an easy way to quickly check for empty view IDs for
sprites, which is essential for making custom headgear.
Since a lot of people have different palettes for hair and clothes, it's
-impossible to tell you what all the colour numbers are. If you want a serious
+impossible to tell you what all the color numbers are. If you want a serious
example, there is a Stylist script inside the default eAthena installation that
you can look at, this may help you create a Stylist of your own:
'custom\dye.txt'
@@ -3876,7 +3967,7 @@ you can look at, this may help you create a Stylist of your own:
*pushpc <direction>,<cells>;
This command will push the currently attached player to given direction by given
-amount of square cells. Direction is the same as used when declaring npcs, and
+amount of square cells. Direction is the same as used when declaring NPCs, and
can be specified by using one of the DIR_* constants (db/const.txt).
The knock-back is not restricted by items or map flags, only obstacles are taken
@@ -3951,7 +4042,7 @@ Those parameters that are different from 'getitem' are:
identify - Whether you want the item to be identified or not, 0 unidentified,
1 identified.
-refine - For how many plusses will it be refined.
+refine - For how many pluses will it be refined.
It will not let you refine an item higher than +10, if you
specify more it'll still be 10.
attribute - Whether the item is broken (1) or not (0) and NOT an elemental
@@ -4044,7 +4135,7 @@ E.g: item name and character name, or with character id, etc...
Create a item signed with the given character's name.
This is the same as using the hard(ly) explained way with getitem2.
-The command returns 1 when the item is created succesfully, or 0 when failed.
+The command returns 1 when the item is created successfully, or 0 when failed.
Failure occurs when there is:
- no player attached
- Item name or ID is not valid
@@ -4071,7 +4162,7 @@ the character will receive a message in their chat window. The character will
also receive warning messages in their chat window before the item disappears.
This command can not be used to rent stackable items. Rental items cannot be
-dropped, traded, sold to npcs, or placed in guild storage. (i.e. trade mask 75)
+dropped, traded, sold to NPCs, or placed in guild storage. (i.e. trade mask 75)
Note: 'delitem' in an NPC script can still remove rental items.
---------------------------------------
@@ -4186,7 +4277,7 @@ getitem groupranditem(15),1;
*enable_items;
*disable_items;
-These commands enable item usage while an npc is running. When enable_items is
+These commands enable item usage while an NPC is running. When enable_items is
run, items can be used during scripts until disable_items is called.
To avoid possible exploits, when enable_items is invoked, it will only enable
item usage while running that script in particular. Note that if a different
@@ -4199,14 +4290,13 @@ effect is still in effect).
*itemskill <skill id>,<skill level>;
*itemskill "<skill name>",<skill level>;
-This is a command meant for item scripts to replicate single-use skills. It will
-not work properly in NPC scripts a lot of the time because casting a skill is
-not allowed when there is a message window or menu on screen. If there isn't one
-cause you've made sure to run this when they already closed it, it should work
-just fine and even show a targeting pointer if this is a targeting skill.
+This command meant for item scripts to replicate single-use skills in usable
+items. It will not work properly, if there is a visible dialog window or menu.
+If the skill is self or auto-targeting, it will be used immediately otherwise a
+target cursor is shown.
-// When you use Anodyne, you will cast Endure(8) level 1,
-// and "Endure" will appear above your head as you use it.
+// When Anodyne is used, it will cast Endure (8), Level 1, as if the actual
+// skill has been used from skill tree.
605,Anodyne,Anodyne,11,2000,0,100,,,,,10477567,2,,,,,{ itemskill 8,1; },{}
@@ -4259,7 +4349,7 @@ Whatever the type is, it will also show a failure effect on screen.
*repair <broken item number>;
-This command repairs a broken peice of equipment, using the same list of broken
+This command repairs a broken piece of equipment, using the same list of broken
items as available through 'getbrokenid'.
The official scripts seem to use the repair command as a function instead:
@@ -4344,14 +4434,13 @@ Example(s):
*openstorage;
-This will open a character's Kafra storage window on the client connected to the
-invoking character. It does not check wherever it is run from, so you can allow
-any feasible NPC to open a kafra storage. (It's not certain whether this works
-in item scripts, but if it does, it could be interesting.)
+This will open character's Kafra storage window on the client connected to the
+invoking character. It can be used from any kind of NPC or item script, not just
+limited to Kafra Staff.
-The storage window might not open if a message box or a trade deal is present on
-screen already, so you should at least make sure the message box is closed
-before you open storage.
+The storage window opens regardless of whether there are open NPC dialogs or
+not, but it is preferred to close the dialog before displaying the storage
+window, to avoid any disruption when both windows overlap.
mes "I will now open your stash for you";
close2;
@@ -4403,7 +4492,7 @@ This will also fail and return 2 if the character does not belong to any guild.
*guildchangegm(<guild id>,<new master's name>)
This function will change the Guild Master of a guild. The ID is the guild's
-id, and the new guildmaster's name must be passed.
+id, and the new guild master's name must be passed.
Returns 1 on success, 0 otherwise.
@@ -4422,7 +4511,7 @@ any guild.
This command will bump up the specified guild skill by the specified number of
levels. This refers to the invoking character and will only work if the invoking
-character is a member of a guild AND it's guildmaster, otherwise no failure
+character is a member of a guild AND it's guild master, otherwise no failure
message will be given and no error will occur, but nothing will happen - same
about the guild skill trying to exceed the possible maximum. The full list of
guild skills is available in 'db/skill_db.txt', these are all the GD_ skills at
@@ -4455,16 +4544,16 @@ This is a character reset command, meant mostly for rebirth script supporting
Advanced jobs, which will reset the invoking character's stats and level
depending on the action type given. Valid action types are:
- 1 - Base level 1, Job level 1, 0 skill points, 0 base xp, 0 job xp, wipes the
+ 1 - Base level 1, Job level 1, 0 skill points, 0 base exp, 0 job exp, wipes the
status effects (only the ones settable by 'setoption'), sets all stats to 1.
If the new job is 'Novice High', give 100 status points, give First Aid and
Play Dead skills.
- 2 - Base level 1, Job level 1, 0 skill points, 0 base xp, 0 job xp.
+ 2 - Base level 1, Job level 1, 0 skill points, 0 base exp, 0 job exp.
Skills and attribute values are not altered.
- 3 - Base level 1, base xp 0. Nothing else is changed.
- 4 - Job level 1, job xp 0. Nothing else is changed.
+ 3 - Base level 1, base exp 0. Nothing else is changed.
+ 4 - Job level 1, job exp 0. Nothing else is changed.
-In all cases it will also unequip everything the character has on.
+In all cases everything the character has on will be unequipped.
Even though it doesn't return a value, it is used as a function in the official
rebirth scripts. Ask AppleGirl why.
@@ -4546,23 +4635,26 @@ should be rather obvious.
*skilleffect <skill id>,<number>;
*skilleffect "<skill name>",<number>;
-This command will display the visual and sound effects of a specified skill (see
-'db/skill_db.txt' for a full list of skills) on the invoking character's sprite.
-Nothing but the special effects and animation will happen. If the skill's normal
-effect displays a floating number, the number given will float up.
+This command displays visual and aural effects of given skill on currently
+attached character. The number parameter is for skill whose visual effect
+involves displaying of a number (healing or damaging). Note, that this command
+will not actually use the skill, it is intended for scripts, which simulate
+skill usage by the NPC, such as buffs, by setting appropriate status and
+displaying the skill's effect.
- // This will heal the character with 2000 hp, buff with
- // Bless 10 and Increase AGI 5, and display appropriate
- // effects.
- mes "Blessed be!";
- skilleffect 28,2000;
+ mes "Be blessed!";
+ // Heal of 2000 HP
heal 2000,0;
- skilleffect 34,0;
- // That's bless 10.
+ skilleffect 28,2000;
+ // Blessing Level 10
sc_start 10,240000,10;
- skilleffect 29,0;
- // That's agi 5
+ skilleffect 34,0;
+ // Increase AGI Level 5
sc_start 12,140000,5;
+ skilleffect 29,0;
+
+This will heal the character with 2000 HP, buff it with Blessing Lv 10 and
+Increase AGI Lv 5, and display appropriate effects.
---------------------------------------
@@ -4780,7 +4872,7 @@ the invoking character. Example can be found in the wedding script.
*divorce()
-This function will un-marry the invoking character from whoever they were
+This function will "un-marry" the invoking character from whoever they were
married to. Both will no longer be each other's marriage partner, (at least in
current SVN, which prevents the cases of multi-spouse problems). It will return
1 upon success or 0 if the character was not married at all.
@@ -4813,7 +4905,7 @@ Example(s):
*pcblockmove <id>,<option>;
Prevents the given ID from moving when the option != 0, 0 enables the ID to move again.
-ID should be able to be GID of a monster/npc or AID from a character.
+ID should be able to be GID of a monster/NPC or AID from a character.
Example(s):
@@ -4835,7 +4927,7 @@ Example(s):
This command will spawn a monster on the specified coordinates on the specified
map. If the script is invoked by a character, a special map name, "this", will
-be recognised to mean the name of the map the invoking character is located at.
+be recognized to mean the name of the map the invoking character is located at.
This command works fine in the item scripts.
The same command arguments mean the same things as described above in the
@@ -4940,8 +5032,8 @@ they were spawned or what they are. As of r12873, The behavior has changed sligh
In light of a label behavior fix for mob spawning commands that will now allow the label to
trigger when there is no player, killmonsterall has also been modified to support this.
-Using this the normal/old way means labels dont trigger when a player didn't
-attack/kill a monster. This is because it breaks compatability with older scripts if
+Using this the normal/old way means labels don't trigger when a player didn't
+attack/kill a monster. This is because it breaks compatibility with older scripts if
forced to use the new method. However, if you wish to use the new label type with this
command, simply use 1 for type. Any other number won't be recognized.
@@ -4986,7 +5078,7 @@ four arguments serve the same purpose as in the monster script command, The
If <master id> is given, the clone will be a 'slave/minion' of it. Master_id
must be a character id of another online player.
-The mode can be specified to determine the behaviour of the clone, it's
+The mode can be specified to determine the behavior of the clone, it's
values are the same as the ones used for the mode field in the mob_db. The
default mode is aggressive, assists, can move, can attack.
@@ -5027,11 +5119,11 @@ summon "--ja--",-1;
*homevolution;
This command will try to evolve the current player's homunculus.
-If it doesn't work, the /swt emoticon is shown.
+If it doesn't work, the /swt emotion is shown.
To evolve a homunculus, the invoking player must have a homunculus,
the homunculus must not be the last evolution and
-the homunculus must be on at least 91000/100000 intimacy with it's owner.
+the homunculus must have above 91000 intimacy with it's owner.
---------------------------------------
@@ -5040,7 +5132,7 @@ the homunculus must be on at least 91000/100000 intimacy with it's owner.
This is one command, but can be used in two ways. If only the first argument is given,
the unit whose GID is given will start walking towards the map with the given mapid
-(we believe these are the mapindexes found in db/map_index.txt).
+(we believe these are the map-indexes found in db/map_index.txt).
When 2 arguments are passed, the given unit will walk to the given x,y coordinates on
the map where the unit currently is.
@@ -5050,7 +5142,7 @@ Example(s):
//Will move/walk the poring we made to the coordinates 150,150
unitwalk .GID,150,150;
-//Will move the poring towards alberta (if my assumed mapindexes are correct).
+//Will move the poring towards alberta (if my assumed map-indexes are correct).
unitwalk .GID,3;
---------------------------------------
@@ -5095,7 +5187,7 @@ unfortunately, not detectable by Ruwach or Sight.
As they are now, these commands are pointless, it is suggested to use
'disablenpc'/'enablenpc', because these two commands actually unload the NPC
sprite location and other accompanying data from memory when it is not used.
-However, you can use these for some quest ideas (such as cloaking npcs talking
+However, you can use these for some quest ideas (such as cloaking NPCs talking
while hidden then revealing.... you can wonder around =P
---------------------------------------
@@ -5125,21 +5217,16 @@ invoked by the RID that was active in the script that issued a 'doevent'.
*donpcevent "{NPC NAME}::<event label>";
-This command is kinda confusing cause it performs in two completely different
-ways.
+This command invokes the event label code within an another NPC or NPCs. If
+event label has the form "NpcName::OnLabel", then only given NPC's event label
+will be invoked (much like 'goto' into another NPC). If the form is "::OnLabel"
+(NpcName omitted), the event code of all NPCs with given label will be invoked,
+one after another. In both cases the invoked script will run without an attached
+RID, whether or not the invoking script was attached to a player. The event
+label name is required to start with On.
-If the event label is phrased like "::<label name>", all NPC objects that have a
-specified label in them will be invoked as if by a 'doevent', but no RID
-whatsoever will be attached while they execute.
-
-Otherwise, if the label is given as "<NPC name>::<label name>", a label within
-the NPC object that runs this command will be called, but as if it was running
-inside another, specified NPC object. No RID will be attached to it in this case
-either.
-
-This can be used for making another NPC react to an action that you have done
-with the NPC that has this command in it, i.e. show an emotion, or say
-something.
+This command can be used to make other NPCs act, as if they were responding to
+the invoking NPC's actions, such as using an emotion or talking.
place,100,100,1%TAB%script%TAB%NPC%TAB%53,{
mes "Hey NPC2 copy what I do";
@@ -5161,8 +5248,8 @@ something.
end;
}
-This will make both NPC perform the same random emotion from 1 to 30, and the
-emotion will appear above each of their heads.
+Whichever of the both NPCs is talked to, both will show a random emotion at the
+same time.
---------------------------------------
@@ -5191,8 +5278,8 @@ complete the effect.
*setnpcdisplay("<npc name>", "<display name>")
*setnpcdisplay("<npc name>", <class id>)
-Changes the display name and/or display class of the target npc.
-Returns 0 is successful, 1 if the npc does not exist.
+Changes the display name and/or display class of the target NPC.
+Returns 0 is successful, 1 if the NPC does not exist.
Size is 0 = normal 1 = small 2 = big.
Since trunk r11779
@@ -5202,19 +5289,19 @@ Since trunk r11779
5,1.- Time-related commands
\\
---------------------------------------
-*addtimer <ticks>,"<NPC object name>::<label>";
-*deltimer "<NPC object name>::<event label>";
-*addtimercount <ticks>,"<NPC object name>::<event label>";
+*addtimer <ticks>,"NPC::OnLabel";
+*deltimer "NPC::OnLabel";
+*addtimercount <ticks>,"NPC::OnLabel";
-These commands will create and manage a player-based timer: 'addtimer' to
-create, 'deltimer' to destroy and 'addtimercount' to delay it by the specified
-number of ticks. For all three cases, the event label given is the identifier of
-that timer. A player can have multiple timers running at the same time, and
-there can even be multiple timers referencing the same label.
+These commands will create, destroy, and delay a countdown timer - 'addtimer' to
+create, 'deltimer' to destroy and 'addtimercount' to delay it by the specified
+number of ticks. For all three cases, the event label given is the identifier of
+that timer. The timer runs on the character object that is attached to the script,
+and can have multiple instances. When the label is run, it is run as if the player that
+the timer runs on has clicked the NPC.
-When this timer runs out, a new execution thread will start in the specified NPC
-object at the specified label, and the script will run attached to that player.
-If the specified label is not found, the map server will happily print an error.
+When this timer runs out, a new execution thread will start in the specified NPC
+object at the specified label.
The ticks are given in 1/1000ths of a second.
@@ -5276,7 +5363,7 @@ NOTE: You need to attach the RID before the timer _before_ you start it to
get a player-attached timer. Otherwise it'll stay a NPC timer (no effect).
If the player that is attached to the npctimer logs out, the "OnTimerQuit:"
-event label of that npc will be triggered, so you can do the appropiate
+event label of that NPC will be triggered, so you can do the appropriate
cleanup (the player is still attached when this event is triggered).
The 'setnpctimer' command will explicitly set the timer to a given tick.
@@ -5291,6 +5378,8 @@ The 'setnpctimer' command will explicitly set the timer to a given tick.
Example 1:
<NPC Header> {
+ // We need to use attachnpctimer because the mes command below needs RID attach
+ attachnpctimer;
initnpctimer;
npctalk "I cant talk right now, give me 10 seconds";
end;
@@ -5310,9 +5399,11 @@ Example 1:
npctalk "1";
end;
OnTimer10000:
- stopnpctimer; // This command is indeed not neccessary here because timer automaticly stopped due to no remaining events.
+ stopnpctimer;
mes "[Man]";
mes "Ok we can talk now";
+ detachnpctimer;
+ // and remember attachnpctimer and detachnpctimer can only use while the NPC timer is not running !
}
Example 2:
@@ -5325,8 +5416,8 @@ Example 2:
end;
// This OnInit label will run when the script is loaded, so that the timer
- // is initialised immediately as the server starts. It is dropped back to 0
- // every time the NPC says something, so it will cycle continiously.
+ // is initialized immediately as the server starts. It is dropped back to 0
+ // every time the NPC says something, so it will cycle continuously.
OnInit:
initnpctimer;
end;
@@ -5357,7 +5448,7 @@ Example 4:
These commands are used to control the pause of a NPC.
sleep and sleep2 will pause the script for the given amount of milliseconds.
-Awake is used to cancel a sleep. When awake is callen on a NPC it will run as
+Awake is used to cancel a sleep. When awake is called on a NPC it will run as
if the sleep timer ran out, and thus making the script continue. Sleep and sleep2
basically do the same, but the main difference is that sleep will not keep the rid,
while sleep2 does.
@@ -5368,6 +5459,17 @@ Examples:
awake "NPC"; //Cancels any running sleep timers on the NPC 'NPC'.
---------------------------------------
+
+*progressbar "<color>",<seconds>;
+
+This command works almost like sleep2, but displays a progress bar
+above the head of the currently attached character (like cast bar).
+Once the given amount of seconds passes, the script resumes. If the
+character moves while the progress bar progresses, it is aborted and
+the script ends. The color format is in RGB (0xRRGGBB). The color is
+currently ignored by the client and appears always green.
+
+---------------------------------------
//
5,1.- End of time-related commands
//
@@ -5387,7 +5489,7 @@ The flag values are coded as constants in db/const.txt to make them easier to us
Target flags:
- bc_all: Broadcast message is sent server-wide (default).
- bc_map: Message is sent to everyone in the same map as the source of the broadcast (see below).
-- bc_area: Message is sent to players in the vecinity of the source.
+- bc_area: Message is sent to players in the vicinity of the source.
- bc_self: Message is sent only to current player.
You cannot use more than one target flag.
@@ -5395,7 +5497,7 @@ Source flags:
- bc_pc: Broadcast source is the attached player (default).
- bc_npc: Broadcast source is the NPC, not the player attached to the script
(useful when a player is not attached or the message should be sent to those
- nearby the npc).
+ nearby the NPC).
You cannot use more than one source flag.
Special flags:
@@ -5434,7 +5536,7 @@ but it can be used instead in NPCs to "preview" an announce.
*mapannounce "<map name>","<text>",<flag>{,<fontColor>{,<fontType>{,<fontSize>{,<fontAlign>{,<fontY>}}}}}};
This command will work like 'announce' but will only broadcast to characters
-currently residing on the specified map. The flag and optional paramaters
+currently residing on the specified map. The flag and optional parameters
parameters are the same as in 'announce', but target and source flags are ignored.
---------------------------------------
@@ -5478,7 +5580,7 @@ can be found in the doc/sample/npc_dynamic_shop.txt file.
This example shows how to use the labels and their set variables to create a dynamic shop.
Note 1: These labels will only be triggered if a npcshop* command is executed, this is
-because these commands set a special data on the shop npc,named master_nd in the source.
+because these commands set a special data on the shop NPC,named master_nd in the source.
The OnSellItem and OnBuyItem are triggered in the NPC whose master_nd is given in the shop.
This was found out thanks to 'Hondacrx', noticing the OnBuyItem wasn't triggered unless
npcshopitem was used. After rechecking the source, I found what caused this.
@@ -5487,7 +5589,7 @@ npcshopitem was used. After rechecking the source, I found what caused this.
*npcshopitem "<name>",<item id>,<price>{,<item id>,<price>{,<item id>,<price>{,...}}}
-This command lets you override the contents of an existing npc shop. The
+This command lets you override the contents of an existing NPC shop. The
current sell list will be wiped, and only the items specified with the price
specified will be for sale.
@@ -5500,7 +5602,7 @@ Note that you cannot use -1 to specify default selling price!
*npcshopadditem "<name>",<item id>,<price>{,<item id>,<price>{,<item id>,<price>{,...}}}
This command will add more items at the end of the selling list for the
-specified npc shop. If you specify an item already for sell, that item will
+specified NPC shop. If you specify an item already for sell, that item will
appear twice on the sell list.
The function returns 1 if shop was updated successfully, or 0 if not found.
@@ -5511,7 +5613,7 @@ Note that you cannot use -1 to specify default selling price!
*npcshopdelitem "<name>",<item id>{,<item id>{,<item id>{,...}}}
-This command will remove items from the specified npc shop.
+This command will remove items from the specified NPC shop.
If the item to remove exists more than once on the shop, all instances will be
removed.
@@ -5522,7 +5624,7 @@ value is only to confirm that the shop was indeed found.
*npcshopattach "<name>"{,<flag>}
-This command will attach the current script to the given npc shop.
+This command will attach the current script to the given NPC shop.
When a script is attached to a shop, the events "OnBuyItem" and "OnSellItem"
of your script will be executed whenever a player buys/sells from the shop.
Additionally, the arrays @bought_nameid[], @bought_quantity[] or @sold_nameid[]
@@ -5530,7 +5632,7 @@ and @sold_quantity[] will be filled up with the items and quantities
bought/sold.
The optional parameter specifies whether to attach ("1") or detach ("0") from
-the shop (the default is to attach). Note that detaching will detach any npc
+the shop (the default is to attach). Note that detaching will detach any NPC
attached to the shop, even if it's from another script, while attaching will
override any other script that may be already attached.
@@ -5542,7 +5644,7 @@ The function returns 0 if the shop was not found, 1 otherwise.
This command will create a chat room, owned by the NPC object running this
script and displayed above the NPC sprite.
-The maximum length of a chatroom name is 60 letters.
+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. If the
optional event and trigger parameters are given, the event label
@@ -5608,7 +5710,7 @@ but no eathena script uses these at the moment.
*getwaitingroomstate(<information type>{,"<NPC object name>"})
-This function will return information about the wating room state for the
+This function will return information about the waiting room state for the
attached waiting room or for a waiting room attached to the specified NPC if
any.
@@ -5660,10 +5762,7 @@ example.
*kickwaitingroomall {"<NPC object name>"};
-This command would kick everybody out of a specified waiting room chat. IF it
-was properly linked into the script interpreter which it isn't, even though the
-code for it is in place. Expect this to become available in upcoming SVN
-releases.
+This command kicks everybody out of a specified waiting room chat.
---------------------------------------
@@ -5672,7 +5771,7 @@ releases.
This command sets the 'nosave' flag for the specified map and also gives an
alternate respawn-upon-relogin point.
-It does not make a map impossible to make a savepoint on as you would normally
+It does not make a map impossible to make a save point on as you would normally
think, 'savepoint' will still work. It will, however, make the specified map
kick the reconnecting players off to the alternate map given to the coordinates
specified.
@@ -5757,14 +5856,14 @@ will mean randomly shuffling everyone on the same map.
This command goes through the specified map and for each player and monster
found there does stuff.
-Flag is a bitmask (add up numbers to get effects you want)
- 1 - warp all guild members to their savepoints.
- 2 - warp all non-guild members to their savepoints.
- 4 - remove all monsters which are not guardian or emperium.
+Flag is a bit-mask (add up numbers to get effects you want)
+ 1 - warp all guild members to their save points.
+ 2 - warp all non-guild members to their save points.
+ 4 - remove all monsters which are not guardian or Emperium.
-Flag 7 will, therefore, mean 'wipe all mobs but guardians and the emperium and
+Flag 7 will, therefore, mean 'wipe all mobs but guardians and the Emperium and
kick all characters out', which is what the official scripts do upon castle
-surrender. Upon start of WoE, the scripts do 2 (warp all intruiders out).
+surrender. Upon start of WoE, the scripts do 2 (warp all intruders out).
Characters not belonging to any guild will warp out regardless of the flag setting.
@@ -5833,7 +5932,7 @@ Temporary guardians are not saved with the castle and can't be accessed by guard
*guardianinfo("<map name>", <guardian number>, <type>)
This function will return various info about the specified guardian, or -1
-if it fails for some reason. It is primarily used in the castle manager npc.
+if it fails for some reason. It is primarily used in the castle manager NPC.
Map name and guardian number (value between 0 and 7) define the target.
Type indicates what information to return:
@@ -5869,7 +5968,7 @@ computed based on the speed and motion coordinates. The effect is rather
unnerving.
Only a few NPC sprites have walking animations, and those that do, do not get
-the animation invoked when moving the NPC, due to the problem in the npc walking
+the animation invoked when moving the NPC, due to the problem in the NPC walking
code, which looks a bit silly. You might have better success by defining a job-
sprite based sprite id in 'db/mob-avail.txt' with this.
@@ -5885,7 +5984,7 @@ this command just moves the NPC. It basically warps out and in on the current an
Example(s):
-//This will move Bugga from it's current position to the coords 100,20 (if those coords are walkable (legit)).
+//This will move Bugga from it's current position to the coordinates 100,20 (if those coordinates are walkable (legit)).
moveNPC "Bugga",100,20;
---------------------------------------
@@ -5908,7 +6007,7 @@ will not be displayed anywhere else.
*logmes "<message>";
-This command will write the message given to the map server npc log file, as
+This command will write the message given to the map server NPC log file, as
specified in 'conf/log_athena.conf'. In the TXT version of the server, the log
file is 'log/npclog.log' by default. In the SQL version, if SQL logging is
enabled, the message will go to the 'npclog' table, otherwise, it will go to the
@@ -5924,7 +6023,7 @@ This command will send a message to the chat window of all currently connected
characters.
If NPC name is specified, the message will be sent as if the sender would be
-the npc with the said name.
+the NPC with the said name.
---------------------------------------
@@ -5944,7 +6043,7 @@ rand(2,10) would result in 2,3,4,5,6,7,8,9 or 10
This command will mark places on the mini map in the client connected to the
invoking character. It uses the normal X and Y coordinates from the main map.
-The colors of the marks are defined using a hexidecimal number, same as the ones
+The colors of the marks are defined using a hexadecimal number, same as the ones
used to color text in 'mes' output, but are written as hexadecimal numbers in C.
(They look like 0x<six numbers>.)
@@ -5977,40 +6076,39 @@ memory of where the points are set whatsoever.
*cutin "<filename>",<position>;
-This command will display a picture stored in the GRF file in the client for the
-player.
-
-The files are taken from '\data\texture\유저인터페이스\illust' directory in the
-GRF file. Also it seems that card cutins from \cardbmp will work here as well.
-Only bitmaps (images stored in the bitmap format) will actually get displayed.
-The '.bmp' extension is optional.
-The client has no problem rendering huge 4096x4096 bitmaps, but usually they're
-around 500x500. Bright magenta (color FF00FF) is considered to be transparent in
-these pictures. You can easily add and alter them, but how to do this is outside
-of the scope of this document.
-
-The position determines just where on screen the picture will appear:
- 0 - bottom left corner
- 1 - bottom middle
- 2 - bottom right corner
- 3 - middle of screen in a movable window with an empty title bar.
- 4 - middle of screen without the window header, but still movable.
- 255 - will remove the cutin previously displayed.
-
-Giving an empty string for the filename and 255 for the position will remove all
-cutin pictures. Any other position value will not cause a script error but will
-cause the player's client to curl up and die. Only one cutin may be on screen at
-any given time, any new cutins will replace it.
+This command will display a picture, usually an NPC illustration, also called
+cutin, for the currently attached client. The position parameter determines the
+placement of the illustration and takes following values:
+
+ 0 - bottom left corner
+ 1 - bottom middle
+ 2 - bottom right corner
+ 3 - middle of screen in a movable window with an empty title bar
+ 4 - middle of screen without the window header, but still movable
- // This will display the picture of the 7th kafra,
- // the one in orange and the mini-skirt :P
- cutin "kafra_7",2;
- // This will remove the displayed picture.
- cutin "Kafra_7",255;
+The picture is read from data\texture\유저인터페이스\illust, from both the GRF archive
+and data folder, and is required to be a bitmap. The file extension .bmp can be
+omitted. Magenta color (#ff00ff) is considered transparent. There is no limit
+placed on the size of the illustrations by the client, although loading of large
+pictures (about 700x700 and larger) causes the client to freeze shortly (lag).
+Typically the size is about 320x480. New illustrations can be added by just
+putting the new file into the location above.
- // This will remove all pictures displayed.
+The client is able to display only one cutin at the same time and each new one
+will cause the old one to disappear. To delete the currently displayed
+illustration without displaying a new one, an empty file name and position 255
+must be used.
+
+ // Displays the Comodo Kafra illustration in lower right corner.
+ cutin "kafra_7",2;
+
+ // Typical way to end a script, which displayed an illustration during a
+ // dialog with a player.
+ mes "See you.";
+ close2;
cutin "",255;
+ end;
---------------------------------------
@@ -6027,9 +6125,9 @@ A full list of pet IDs can be found inside 'db/pet_db.txt'
*emotion <emotion number>{,<target>}{,"<target name>"};
-This command makes an object display an emoticon sprite above their own as
+This command makes an object display an emotion sprite above their own as
if they were doing that emotion. For a full list of emotion numbers,
-see 'db/const.txt' under 'e_'. The inobvious ones are 'e_what' (a question mark)
+see 'db/const.txt' under 'e_'. The not so obvious ones are 'e_what' (a question mark)
and 'e_gasp' (the exclamation mark).
The optional target parameter specifies who will get the emotion on top of
@@ -6045,7 +6143,7 @@ event labels. If specified name is not found, command does nothing.
This command, if run from an NPC object that has a sprite, will call up a
specified effect number, centered on the NPC sprite. If the running code does
-not have an object ID (a 'floating' npc) or is not running from an NPC object at
+not have an object ID (a 'floating' NPC) or is not running from an NPC object at
all (an item script) the effect will be centered on the character who's RID got
attached to the script, if any. For usable item scripts, this command will
create an effect centered on the player using the item.
@@ -6060,7 +6158,7 @@ those that actually work may differ greatly between client versions.
These two commands will play a sound effect to either the invoking character
only ('soundeffect') or multiple characters ('soundeffectall'). If the running
-code does not have an object ID (a 'floating' npc) or is not running from an NPC
+code does not have an object ID (a 'floating' NPC) or is not running from an NPC
object at all (an item script) the sound will be centered on the character who's
RID got attached to the script, if any. If it does, it will be centered on that
object. (an NPC sprite)
@@ -6077,19 +6175,16 @@ You can add your own effects this way, naturally.
---------------------------------------
*playBGM "<BGM filename>"
-*playBGMall "<BGM filename>",{,"<map name>"}{,<x0>,<y0>,<x1>,<y1>}
+*playBGMall "<BGM filename>"{,"<map name>"{,<x0>,<y0>,<x1>,<y1>}}
These two commands will play a Background Music to either the invoking character
-only ('playBGM') or multiple characters ('playBGMall'). If the running
-code does not have an object ID (a 'floating' npc) or is not running from an NPC
-object at all (an item script) the sound will be centered on the character who's
-RID got attached to the script, if any. If it does, it will be centered on that
-object. (an NPC sprite)
+only ('playBGM') or multiple characters ('playBGMall').
BGM filename is the filename in /BGM/ folder. It has to be in .mp3 extension.
It's not required to specify the extension inside the script.
-If coordinates are omitted, BGM will be broadcasted on the entire map.
+If coordinates are omitted, BGM will be broadcasted on the entire map. If the map name
+is omitted as well the BGM will be played for the entire server.
You can add your own BGMs this way, naturally.
@@ -6150,40 +6245,30 @@ For the position, the x and y are given in the unitSkillUsePos.
*day;
*night;
-These two commands will switch the entire server between day and night mode.
-Depending on the configuration, it may cause differing client effects. If your
-server is set to cycle between day and night, it will eventually return to that
-cycle.
-
-This example will set the night time to start at 03 AM and end at 08 AM, and the
-nighttime will persist if the server restarts during the night, if the automated
-day/night switching is turned off in the configuration files. Figure it out on
-your own:
+These two commands will switch the entire server between day and night mode
+respectively. If your server is set to cycle between day and night by
+configuration, it will eventually return to that cycle.
-%TAB%script%TAB%DayNight%TAB%-1,{
-
end;
-
-OnClock0300:
-
-OnClock0800:
-
+OnClock0600:
+ day;
+ end;
OnInit:
-
- set $@minutesfrommidnight, gettime(3)*60+gettime(2);
-
- set $@night_start, 180; // 03:00
- set $@night_end, 480; // 08:00
-
- if ($@minutesfrommidnight>=$@night_start && $@minutesfrommidnight<$@night_end) goto StartNight;
-
- goto StartDay;
- StartNight:
+ // setting correct mode upon server start-up
+ if(gettime(3)>=6 && gettime(3)<18)
+ {
+ end;
+ }
+OnClock1800:
night;
end;
- StartDay:
- day;
- end; }
+}
+
+This script allows to emulate the day/night cycle as the server does, but also
+allows triggering additional effects upon change, like announces, gifts, etc.
+The day/night cycle set by configuration should be disabled, when this script is
+used.
---------------------------------------
@@ -6201,7 +6286,7 @@ They will make the NPC object listen for text spoken publicly by players and
match it against regular expression patterns, then trigger labels associated
with these regular expression patterns.
-Patterns are organised into sets, which are referred to by a set number. You can
+Patterns are organized into sets, which are referred to by a set number. You can
have multiple sets patterns, and multiple patterns may be active at once.
Numbers for pattern sets start at 1.
@@ -6219,7 +6304,7 @@ set number in this case will deactivate all pattern sets defined.
pattern set in it's place.
Using regular expressions is high wizardry. But with this high wizardry comes
-unparallelled power of text manipulation. For an explanation of what a regular
+unparalleled power of text manipulation. For an explanation of what a regular
expression pattern is, see a few web pages:
http://www.regular-expressions.info/
@@ -6227,8 +6312,8 @@ http://www.weitz.de/regex-coach/
For an example of this in use, see 'npc\sample\npc_pcre.txt'.
-With this you could, for example, automagically punish players for asking for
-zeny in public places, or alternatively, automagically give them zeny instead if
+With this you could, for example, automatically punish players for asking for
+Zeny in public places, or alternatively, automatically give them Zeny instead if
they want it so much.
---------------------------------------
@@ -6343,9 +6428,9 @@ setitemscript 2637,"";
*atoi ("<string>")
*axtoi ("<string>")
-These commands are used to convert strings to numbers.
-atoi will convert string using normal number (0,1,2,3,etc) while axtoi converts them to
-hexadecimal numbers (0,1,11,01).
+These commands are used to convert strings to numbers. 'atoi' will interpret
+given string as a decimal number (base 10), while 'axtoi' interprets strings as
+hexadecimal numbers (base 16).
Example:
@@ -6380,6 +6465,26 @@ The first letter is position 0.
---------------------------------------
+*setfont <font>
+
+This command sets the current RO client interface font to one of the
+fonts stored in data\*.eot by using an ID of the font. When the ID
+of the currently used font is used, default interface font is used
+again.
+
+ 0 - Default
+ 1 - RixLoveangel
+ 2 - RixSquirrel
+ 3 - NHCgogo
+ 4 - RixDiary
+ 5 - RixMiniHeart
+ 6 - RixFreshman
+ 7 - RixKid
+ 8 - RixMagic
+ 9 - RixJJangu
+
+---------------------------------------
+
* The Pet AI commands
These commands will only work if the invoking character has a pet, and are meant
@@ -6417,7 +6522,7 @@ when pet performance is activated.
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/skill_db.txt'.
-'petheal' works the same as 'petskillsupport' but has the skill ID hardcoded to
+'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.
@@ -6434,11 +6539,11 @@ inflicted and the specified number of attacks.
All commands with delays and durations will only make the behavior active for
the specified duration of seconds, with a delay of the specified number of
-seconds between activations. Rates are a chance of the effect occuring and are
+seconds between activations. Rates are a chance of the effect occurring and are
given in percent. 'bonusrate' is added to the normal rate if the pet intimacy is
at the maximum possible.
-The behavior modified with the abovementioned commands will only be exibited if
+The behavior modified with the above mentioned commands will only be exhibited if
the pet is loyal and appropriate configuration options are set in
'battle_athena.conf'.
@@ -6470,7 +6575,7 @@ This is still usable outside item scripts.
This command will create a pet egg and put it in the invoking character's
inventory. The kind of pet is specified by pet ID numbers listed in
-'db/pet_db.txt'. The egg is created exactly as if the character just successfuly
+'db/pet_db.txt'. The egg is created exactly as if the character just successfully
caught a pet in the normal way.
// This will make you a poring:
@@ -6484,7 +6589,7 @@ server and the egg will disappear when anyone tries to hatch it.
*homshuffle;
-This will recalculate the homunculus stats acording to its level, of the
+This will recalculate the homunculus stats according to its level, of the
current invoking character.
---------------------------------------
@@ -6493,7 +6598,7 @@ current invoking character.
Each map cell has several 'flags' that specify the properties of that cell.
These include terrain properties (walkability, shootability, presence of water),
-skills (basilica, land protector, ...) and other (npc nearby, no vending, ...).
+skills (basilica, land protector, ...) and other (NPC nearby, no vending, ...).
Each of these can be 'on' or 'off'. Together they define a cell's behavior.
This command lets you alter these flags for all map cells in the specified
@@ -6570,7 +6675,7 @@ Example:
Creates an invisible wall, an array of "setcell" starting from x,y and doing a
line of the given size in the given direction. The difference with setcell is
-this one update client part too to avoid the glith problem. Directions are the
+this one update client part too to avoid the glitch problem. Directions are the
same as NPC sprite facing directions: 0=north, 1=northwest, 2=west, etc.
---------------------------------------
@@ -6596,7 +6701,7 @@ on the ID this command returns.
Example:
// Store the Party ID of the invoking character.
set .@party_id, getcharid(1);
- // Atempt to create an instance using that party ID.
+ // Attempt to create an instance using that party ID.
set .@id, instance_create("Endless Tower", .@party_id, ID_ENDLESS);
if (.@id == -1) { // Party ID is in use by another instance.
...
@@ -6627,20 +6732,20 @@ Initiate the instance of <Instance ID>.
*instance_announce <Instance ID>,"<text>",<flag>{,<color>};
-Works like announce, but has the <Instance ID> paramter, where 0 = active instance?
+Works like announce, but has the <Instance ID> parameter, where 0 = active instance?
---------------------------------------
*instance_attach(<Instance ID>);
-Attaches a script to the proviced <Instance ID>?
+Attaches a script to the provided <Instance ID>?
---------------------------------------
*instance_npcname("<NPC Name>",<Instance ID>)
Retrieve the unique name given to a copy of an NPC for an instance, the given
-"<NPC Name>" that belonds to instance <Instance ID>. Can be used with such commands
+"<NPC Name>" that belongs to instance <Instance ID>. Can be used with such commands
as enablenpc and disablenpc, donpcevent, etc.
---------------------------------------
@@ -6653,13 +6758,13 @@ Check if the player has been queued for the <Map Name> instance.
*instance_id(<?>)
-Apparantly returns the ID the player is currently attached too.
+Apparently returns the ID the player is currently attached too.
---------------------------------------
*instance_warpall "<Map Name>",<x>,<y>;
-Warp all palyers in the instance to <map name> and given coordinates.
+Warp all players in the instance to <map name> and given coordinates.
---------------------------------------
@@ -6702,11 +6807,11 @@ Add quest of the <ID2> to the the quest log, and the state is "active".
*checkquest(<ID>{,PLAYTIME|HUNTING})
-If no additonal argument supplied, return the state of the quest:
+If no additional argument supplied, return the state of the quest:
-1 = Quest not started (not in quest log)
0 = Quest has been given, but the state is "inactive"
1 = Quest has been given, and the state is "active"
- 2 = Quest comepleted
+ 2 = Quest completed
If parameter "PLAYTIME" is supplied:
-1 = Quest not started (not in quest log)
@@ -6723,13 +6828,13 @@ If parameter "HUNTING" is supplied:
---------------------------------------
*showevent <state>, <color>;
-Show a colored mark in the mini-map like "viewpoint" and an emoticon on top of a NPC.
+Show a colored mark in the mini-map like "viewpoint" and an emotion on top of a NPC.
This is used to indicate that a NPC has a quest or an event to certain player/s.
state can be:
- 0 = disable ( Used to disable and remove the mark and the emoticon from the NPC. )
- 1 = exclamation emoticon ( Used to show an important quest event to certain player. )
- 2 = interrogation emoticon ( Used to show an non-important quest event to certain player. )
+ 0 = disable ( Used to disable and remove the mark and the emotion from the NPC. )
+ 1 = exclamation emotion ( Used to show an important quest event to certain player. )
+ 2 = interrogation emotion ( Used to show an non-important quest event to certain player. )
Other value may cause client crashes.
color can be:
@@ -6757,7 +6862,7 @@ Unlike the prior command, the latter will attach a GROUP in a waiting room to th
sets the array $@arenamembers[0] where 0 holds the IDs of the first group, and 1 holds the IDs of the second.
Example:
- // Battle Group will be refered to as $@KvM01BG_id1, and when they die, respawn at bat_c01,52,129.
+ // Battle Group will be referred to as $@KvM01BG_id1, and when they die, respawn at bat_c01,52,129.
set $@KvM01BG_id1, waitingroom2bg("bat_c01",52,129,"KvM01_BG::OnGuillaumeQuit","KvM01_BG::OnGuillaumeDie");
end;
@@ -6867,5 +6972,56 @@ This command will force the update of the displayed scoreboard.
----------------------------------------
+==========================
+|10.- Mercenary commands.|
+==========================
+---------------------------------------
+
+*mercenary_create <class>,<contract time>;
+
+This command summons a mercenary of given class, for given amount of
+time in milliseconds. Typically used in item scripts of mercenary
+scrolls.
+
+----------------------------------------
+
+*mercenary_heal <hp>,<sp>;
+
+This command works like 'heal', but affects the mercenary of the
+currently attached character.
+
+----------------------------------------
+
+*mercenary_sc_start <type>,<tick>,<val1>;
+
+This command works like 'sc_start', but affects the mercenary of the
+currently attached character.
+
+----------------------------------------
+
+*mercenary_get_calls(<guild>);
+*mercenary_set_calls <guild>,<value>;
+
+Sets or gets the mercenary calls value for given guild for currently
+attached character. Guild can be one or the following constants:
+
+ ARCH_MERC_GUILD
+ SPEAR_MERC_GUILD
+ SWORD_MERC_GUILD
+
+----------------------------------------
+
+*mercenary_get_faith(<guild>);
+*mercenary_set_faith <guild>,<value>;
+
+Sets or gets the mercenary faith value for given guild for currently
+attached character. Guild can be one or the following constants:
+
+ ARCH_MERC_GUILD
+ SPEAR_MERC_GUILD
+ SWORD_MERC_GUILD
+
+---------------------------------------
+
Whew.
That's about all of them.