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.txt212
1 files changed, 147 insertions, 65 deletions
diff --git a/doc/script_commands.txt b/doc/script_commands.txt
index 831e0a744..546122475 100644
--- a/doc/script_commands.txt
+++ b/doc/script_commands.txt
@@ -225,8 +225,8 @@ current scripts have a zero in there.
** Define an NPC object.
-<map name>,<x>,<y>,<facing>%TAB%script%TAB%<NPC Name>%TAB%<sprite id>,{<code>}
-<map name>,<x>,<y>,<facing>%TAB%script%TAB%<NPC Name>%TAB%<sprite id>,<triggerX>,<triggerY>,{<code>}
+<map name>,<x>,<y>,<facing>%TAB%script%TAB%<NPC Name>%TAB%<sprite>,{<code>}
+<map name>,<x>,<y>,<facing>%TAB%script%TAB%<NPC Name>%TAB%<sprite>,<triggerX>,<triggerY>,{<code>}
This will place an NPC object on a specified map at the specified
location, and is a top-level command you will use the most in your custom
@@ -240,16 +240,17 @@ increments of 45 degrees, where 0 means facing towards the top of the map.
(So to turn the sprite towards the bottom of the map, you use facing 4,
and to make it look southeast it's facing 5.)
-Sprite id is the sprite number used to display this particular NPC. For a
-full list of sprite id numbers see http://kalen.s79.xrea.com/npc/npce.shtml
-You may also use a monster's ID number instead to display a monster sprite
+Sprite is the sprite identifier used to display this particular NPC. For a
+full list of sprite numbers see http://kalen.s79.xrea.com/npc/npce.shtml as
+well as db/const.txt.
+You may also use a monster's ID constant instead to display a monster sprite
for this NPC, in npcs that have view ids of mobs it's encouraged to use
OnTouch events with a 2,2 range and with an 'end' after the header to avoid
bugs (for more info on why see npc_click@map/npc.c). It is possible to use a job
sprite as well, but you must first define it as a monster sprite in 'mob_avail.txt',
a full description on how to do this is not in the scope of this manual.
-A '-1' sprite id will make the NPC invisible (and unclickable).
-A '111' sprite id will make an NPC which does not have a sprite, but is
+A '-1' sprite will make the NPC invisible (and unclickable).
+A 'HIDDEN_NPC' sprite will make an NPC which does not have a sprite, but is
still clickable, which is useful if you want to make a clickable object of
the 3D terrain.
@@ -279,8 +280,8 @@ what these floating NPC objects are for. More on that below.
** Define a shop/cashshop NPC.
--%TAB%shop%TAB%<NPC Name>%TAB%<sprite id>,<itemid>:<price>{,<itemid>:<price>...}
-<map name>,<x>,<y>,<facing>%TAB%shop%TAB%<NPC Name>%TAB%<sprite id>,<itemid>:<price>{,<itemid>:<price>...}
+-%TAB%shop%TAB%<NPC Name>%TAB%<sprite>,<itemid>:<price>{,<itemid>:<price>...}
+<map name>,<x>,<y>,<facing>%TAB%shop%TAB%<NPC Name>%TAB%<sprite>,<itemid>:<price>{,<itemid>:<price>...}
This will define a shop NPC, which, when triggered (which can only be done
by clicking) will cause a shop window to come up. No code whatsoever runs
@@ -301,7 +302,7 @@ items here. The layout used to define sale items still count, and
"<price>" refers to how many points will be spent purchasing the them.
** Define a trader NPC
-<map name>,<x>,<y>,<facing>%TAB%trader%TAB%<NPC Name>%TAB%<sprite id>,{<code>}
+<map name>,<x>,<y>,<facing>%TAB%trader%TAB%<NPC Name>%TAB%<sprite>,{<code>}
-%TAB%trader%TAB%<NPC Name>%TAB%-1,{<code>}
All the standards that are valid to script objects are also valid for trader objects
@@ -326,16 +327,16 @@ more information regarding how to use this NPC type.
** Define an warp/shop/cashshop/NPC duplicate.
warp: <map name>,<x>,<y>{,<facing>}%TAB%duplicate(<label>)%TAB%<NPC Name>%TAB%<spanx>,<spany>
-shop/cashshop/npc: -%TAB%duplicate(<label>)%TAB%<NPC Name>%TAB%<sprite id>
-shop/cashshop/npc: <map name>,<x>,<y>,<facing>%TAB%duplicate(<label>)%TAB%<NPC Name>%TAB%<sprite id>
-npc: -%TAB%duplicate(<label>)%TAB%<NPC Name>%TAB%<sprite id>,<triggerX>,<triggerY>
-npc: <map name>,<x>,<y>,<facing>%TAB%duplicate(<label>)%TAB%<NPC Name>%TAB%<sprite id>,<triggerX>,<triggerY>
+shop/cashshop/npc: -%TAB%duplicate(<label>)%TAB%<NPC Name>%TAB%<sprite>
+shop/cashshop/npc: <map name>,<x>,<y>,<facing>%TAB%duplicate(<label>)%TAB%<NPC Name>%TAB%<sprite>
+npc: -%TAB%duplicate(<label>)%TAB%<NPC Name>%TAB%<sprite>,<triggerX>,<triggerY>
+npc: <map name>,<x>,<y>,<facing>%TAB%duplicate(<label>)%TAB%<NPC Name>%TAB%<sprite>,<triggerX>,<triggerY>
This will duplicate an warp/shop/cashshop/NPC referred to by 'label'.
Warp duplicates inherit the target location.
Shop/cashshop duplicates inherit the item list.
NPC duplicates inherit the script code.
-The rest (name, location, facing, sprite ID, span/trigger area) is
+The rest (name, location, facing, sprite, span/trigger area) is
obtained from the definition of the duplicate (not inherited).
** Define a function object
@@ -2322,6 +2323,14 @@ Whatever it returns is determined by type.
---------------------------------------
+*charid2rid(<char id>)
+
+This function returns the RID of the character with the given character ID.
+
+If the character is offline or doesn't exist, 0 is returned.
+
+---------------------------------------
+
*getarraysize(<array name>)
This function returns highest index of the array that is filled.
@@ -3974,36 +3983,12 @@ night mode or day mode:
if (!isnight()) mes "I only prowl in the night.";
---------------------------------------
-
-*checkre(<type>)
-
-Checks if a renewal feature is enabled or not in renewal.h, and returns 1
-if enabled and 0 for disabled. The renewal feature to check is determined
-by the type parameter.
-
- 0 - RENEWAL (game renewal server mode)
- 1 - RENEWAL_CAST (renewal cast time)
- 2 - RENEWAL_DROP (renewal drop rate algorithms)
- 3 - RENEWAL_EXP (renewal exp rate algorithms)
- 4 - RENEWAL_LVDMG (renewal level modifier on damage)
- 5 - RENEWAL_EDP (renewal enchant deadly poison algorithm)
- 6 - RENEWAL_ASPD (renewal ASPD)
- @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
- @ /!\ This command is deprecated @
- @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-
-This command is deprecated and it should not be used in new scripts, as it
-is likely to be removed at a later time. Please consider using the respective
-constants RENEWAL, RENEWAL_CAST, RENEWAL_DROP, RENEWAL_EXP, RENEWAL_LVDMG,
-RENEWAL_EDP, RENEWAL_ASPD instead.
-
----------------------------------------
//=====================================
3.1 - Checking Item-Related Commands
//=====================================
---------------------------------------
-*isequipped(<id>{,<id>{,<id>{,<id>}}})
+*isequipped(<item id>{,<item id>{,<item id>{,<item id>}}})
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
@@ -4016,19 +4001,22 @@ If even one of the items given is not equipped, 0 will be returned.
if (isequipped(4001,4005,4033,4196)) mes "Wow! You're wearing a full complement of possible poring cards!";
// (Poring)
if (isequipped(4001)) mes "A poring card is useful, don't you think?";
+ // (Earring)
+ if (isequipped(2622)) mes "You got a pair of nice Earring.";
The function was meant for item scripts to support the cards released by
Gravity in February 2005, but it will work just fine in normal NPC scripts.
---------------------------------------
-*isequippedcnt(<card id>{,<card id>{,<card id>{,<card id>}}})
+*isequippedcnt(<item id>{,<item id>{,<item id>{,<item id>}}})
This function is similar to 'isequipped', but instead of 1 or 0, it will
-return the number of cards in the list given that were found on the
+return the number of equipped items/cards in the list given that were found on the
invoking character.
if (isequippedcnt(4001,4005,4033,4196) == 4) mes "Finally got all four poring cards?";
+ if (isequippedcnt(5353,2622) == 2) mes "You equipped both Helm of Sun and Earring.";
---------------------------------------
@@ -4101,7 +4089,14 @@ chat window.
---------------------------------------
-*warp "<map name>",<x>,<y>;
+*showscript "<message>"{,<GID>};
+
+Makes attached player or GID says a message like shouting a skill name, the message
+will be seen to everyone around but not in chat window.
+
+---------------------------------------
+
+*warp "<map name>",<x>,<y>{,<flag>};
This command will take the invoking character to the specified map, and if
wanted, specified coordinates too, but these can be random.
@@ -4124,6 +4119,10 @@ 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 save point.
+If flag parameter is set to 0, after player warped will be not stopped
+currend running npc script. Running script after warp can be issue for
+Gravity client if warp to other maps.
+
---------------------------------------
*areawarp "<from map name>",<x1>,<y1>,<x2>,<y2>,"<to map name>",<x3>,<y3>{,<x4>,<y4>};
@@ -4458,6 +4457,14 @@ they will also have their skills reset upon 'changesex'.
---------------------------------------
+*changecharsex;
+
+This command is exactly same as changesex, with an exception that,
+character sex will be changed instead of account sex.
+Requires client 2014-10-22 or greater.
+
+---------------------------------------
+
*getexp <base xp>,<job xp>;
This command will give the invoking character a specified number of base
@@ -4503,16 +4510,19 @@ the look value).
Here are the possible look types:
-0 - Base sprite
-1 - VAR_HEAD - Hairstyle
-2 - VAR_WEAPON - Weapon
-3 - VAR_HEAD_TOP - Head top
-4 - VAR_HEAD_MID - Head mid
-5 - VAR_HEAD_BOTTOM - Head bottom
-6 - VAR_HEADPALETTE - Hair color
-7 - VAR_BODYPALETTE - Clothes color
-8 - VAR_SHIELD - Shield
-9 - VAR_SHOES - Shoes
+ 0 - LOOK_BASE Base sprite
+ 1 - LOOK_HAIR Hairstyle
+ 2 - LOOK_WEAPON Weapon
+ 3 - LOOK_HEAD_BOTTOM Head bottom
+ 4 - LOOK_HEAD_TOP Head top
+ 5 - LOOK_HEAD_MID Head mid
+ 6 - LOOK_HAIR_COLOR Hair color
+ 7 - LOOK_CLOTHES_COLOR Clothes color
+ 8 - LOOK_SHIELD Shield
+ 9 - LOOK_SHOES Shoes
+ 10 - LOOK_BODY Body(N/A)
+ 11 - LOOK_FLOOR FLOOR(N/A)
+ 12 - LOOK_ROBE Robe
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
@@ -4983,8 +4993,8 @@ Returns the item_id of a random item picked from the item container specified. T
are different item containers and they are specified in 'db/(pre-)re/item_group.conf'.
Example:
- getitem groupranditem 603,1;
- getitem groupranditem Old_Blue_Box,1;
+ getitem groupranditem(603),1;
+ getitem groupranditem(Old_Blue_Box),1;
---------------------------------------
@@ -5832,7 +5842,7 @@ Examples:
---------------------------------------
*pcblockmove <id>,<option>;
-
+
Prevents the given ID from moving when the option != 0, and 0 enables the
ID to move again. The ID can either be the GID of a monster/NPC or account
ID of a character, and will run for the attached player if zero is
@@ -6302,7 +6312,7 @@ A debug message also shows on the console when no events are triggered.
---------------------------------------
-*npctalk "<message>";
+*npctalk "<message>"{,"<npc name>"};
This command will display a message to the surrounding area as if the NPC
object running it was a player talking - that is, above their head and in
@@ -6312,6 +6322,7 @@ the message to complete the effect.
// This will make everyone in the area see the NPC greet the character
// who just invoked it.
npctalk "Hello "+strcharinfo(0)+", how are you?";
+ npctalk "Hello "+strcharinfo(0)+", how are you?","Another_NPC_Name";
---------------------------------------
@@ -6496,8 +6507,8 @@ Example 4:
---------------------------------------
-*sleep {<milliseconds>};
-*sleep2 {<milliseconds>};
+*sleep <milliseconds>;
+*sleep2 <milliseconds>;
*awake "<NPC name>";
These commands are used to control the pause of a NPC.
@@ -6795,7 +6806,8 @@ if any.
The valid information types are:
- 0 - Number of users currently chatting.
+ 0 - Number of users currently in the waiting room
+ $@chatmembers[] - list of user account_id
1 - Maximum number of users allowed.
2 - Will return 1 if the waiting room has a trigger set.
0 otherwise.
@@ -6808,6 +6820,10 @@ The valid information types are:
32 - Whether or not the waiting room is full.
33 - Whether the amount of users in the waiting room is higher than the
trigger number.
+ 34 - Minimum Base Level to enter waiting room.
+ 35 - Maximum Base Level to enter waiting room.
+ 36 - Minimum Zeny to enter waiting room.
+
---------------------------------------
@@ -7210,7 +7226,7 @@ determines the placement of the illustration and takes following values:
3 - middle of screen in a movable window with an empty title bar
4 - middle of screen without the window header, but still movable
-The picture is read from data\texture\???????\illust, from both the
+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
@@ -7646,10 +7662,23 @@ Example:
---------------------------------------
+*log10(<number>)
+
+Returns log base 10 of the number.
+
+Note: The value is truncated to integer.
+
+Example:
+ .@i = log10(100); // .@i will be 2
+
+---------------------------------------
+
*sqrt(<number>)
Returns square-root of number.
+Note: The value is truncated to integer.
+
Example:
.@i = sqrt(25); // .@i will be 5
@@ -7659,6 +7688,10 @@ Example:
Returns distance between 2 points.
+Note: When Hercules is configured to use circular areas, the Euclidean distance
+is returned, otherwise the Chebyshev distance. The value is truncated to
+integer.
+
Example:
.@i = distance(100,200,101,202);
@@ -7784,7 +7817,7 @@ mes axtoi("11"); // Displays 17 (1 = 1, 10 = 16)
---------------------------------------
-*compare(<string>,<substring>)
+*compare("<string>","<substring>")
This command returns 1 or 0 when the substring is in the main string (1)
or not (0). This command is not case sensitive.
@@ -7797,7 +7830,26 @@ Examples:
//dothat; will not be executed ('Blood butterfly' does not contain 'Bloody').
if (compare("Blood Butterfly","Bloody"))
dothat;
+
+---------------------------------------
+*strcmp("<string>","<string>")
+
+This command compares two strings and is similar to strcmp in C.
+
+Return Values:
+ >0 : String 1 > String 2
+ 0 : Strings are equal
+ <0 : String 1 < String 2
+
+Examples:
+ .@a = strcmp("abcdef","ABCDEF");
+ if (.@a > 0){
+ mes ".@a is greater than 0."; //Output is this.
+ }else{
+ mes ".@a is less or equal to 0";
+ }
+
---------------------------------------
*getstrlen("<string>")
@@ -8749,18 +8801,48 @@ following:
----------------------------------------
-*bg_getareausers(<battle group>,<map name>,<x0>,<y0>,<x1>,<y1>);
+*bg_getareausers(<battle group>,"<map_name>",<x0>,<y0>,<x1>,<y1>);
Retrieves amount of players belonging to given battle group on given map
within an specified rectangular area.
----------------------------------------
-*bg_updatescore "<mapname>",<Guillaume Score>,<Croix Score>;
+*bg_updatescore "<map_name>",<Guillaume Score>,<Croix Score>;
This command will force the update of the displayed scoreboard.
It is only usable when the map is defined as a Type 2 Battleground:
-mapflag%TAB%<mapname>%TAB%battleground%TAB%2
+mapflag%TAB%<map_name>%TAB%battleground%TAB%2
+
+----------------------------------------
+
+*bg_create_team "<map_name>",<Respawn X>,<Respawn Y>;
+
+This command will create a new BG Team.
+When player dies, they will be respawned map_name,X,Y as mentioned.
+
+Command will return -1 if BG Creation is failed,
+else it will return the BG ID(Also known as TeamID).
+
+----------------------------------------
+
+*bg_join_team <Team_ID>{,<account_id>};
+
+This command will make the attached player join to Team with ID as mentioned.
+If account_id is provided, command will look for that player, instead of the attached player.
+
+Command will return -1 if Player is not found, 0 if join is failed, 1 upon successful.
+
+----------------------------------------
+
+*bg_match_over "<Arena Name>"{,<Cancelled>};
+
+This command will end the battleground Arena
+(Arena Name as referred to, in conf/battlegrounds.conf)
+If Cancelled is not provided, it will set the join delay, as mentioned in conf/battlegrounds.conf
+else, it will just destroy the Teams and queue's.
+
+Command will return 0 when successful, else it will return 1.
---------------------------------------
//=====================================