summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgumi <git@gumi.ca>2020-07-13 21:39:34 +0000
committergumi <git@gumi.ca>2020-07-13 21:39:34 +0000
commitc3710c2dbc65bbbece65b8cf0492015bde27c3c1 (patch)
tree895312ecad4c7090b8ad0683abe094006d7142a9
parentde338b70b9b583a1c479392301a574ed393824d7 (diff)
downloaddocs-c3710c2dbc65bbbece65b8cf0492015bde27c3c1.tar.gz
docs-c3710c2dbc65bbbece65b8cf0492015bde27c3c1.tar.bz2
docs-c3710c2dbc65bbbece65b8cf0492015bde27c3c1.tar.xz
docs-c3710c2dbc65bbbece65b8cf0492015bde27c3c1.zip
update script commands for hercules v2020.06.28
-rw-r--r--server/scripts/script_commands.txt564
1 files changed, 438 insertions, 126 deletions
diff --git a/server/scripts/script_commands.txt b/server/scripts/script_commands.txt
index bab4287..db37ef2 100644
--- a/server/scripts/script_commands.txt
+++ b/server/scripts/script_commands.txt
@@ -324,11 +324,13 @@ The types that a trader object can have are the following:
and need to be refurbished)
- NST_CUSTOM (3) Custom Shop (any currency, item/var/etca, check sample)
- NST_BARTER (4) Barter Shop (each item with own item currency)
+- NST_EXPANDED_BARTER (5) Expanded Barter Shop (buy items and spend zeny and items)
Unless otherwise specified via *tradertype an trader object will be defined as
NST_ZENY.
Note: NST_MARKET is only available with PACKETVER 20131223 or newer.
-Note: NST_BARTER is only available with PACKETVER 20181226 zero or newer.
+Note: NST_BARTER is only available with PACKETVER 20190116 main or 20190116 RE or 20181226 zero or newer.
+Note: NST_EXPANDED_BARTER is only available with PACKETVER 20190904 main or 20190904 RE or 20190828 zero or newer.
See '12 - NPC Trader-Related Commands' and /doc/sample/npc_trader_sample.txt for
more information regarding how to use this NPC type.
@@ -432,17 +434,39 @@ marked as usable in pet scripts to work in there reliably.
Numbers
-------
+The Hercules scripting engine supports 4 types of number literals:
+
+type base syntax
+----------------------------------------------
+decimal 10 255
+hexadecimal 16 0xFF
+octal 8 0o377
+binary 2 0b11111111
+
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 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'.
+Also notice that if you try to 'mes 0x10' it will print '16'. If you wish
+to make calculations in base 8, you can also use the octal notation like
+'0o<octal digits>'. To make calculations in base 2 (binary), you can use
+the binary notation like '0b<binary digits>'.
+
+The following are all equivalent:
+ 255 == 0xFF == 0o377 == 0b11111111
Number values can't exceed the limits of an integer variable: Any number
greater than INT_MAX (2147483647) or smaller than INT_MIN (-2147483648) will
be capped to those values and will cause a warning to be reported.
+Underscores can also be used as visual separators for digit grouping purposes:
+ 2_147_483_647
+ 0x7FFF_FFFF
+
+Keep in mind that number literals cannot start or end with a separator and no
+more than one separator can be used in a row (so 12_3___456 is illegal).
+
Variables
---------
@@ -534,7 +558,9 @@ variables or an empty string ("", nothing between the quotes) for string
variables. Once you set it to that, the variable is as good as forgotten
forever, and no trace remains of it even if it was stored with character
or account data. The maximum length of variable name including prefix and
-suffix is 32.
+suffix is 32. Permanent string variables (name$, $name$, #name$, ##name$)
+can store text with a maximum length of 255 characters. All other string
+type variables have no such limitation.
Some variables are special, that is, they are already defined for you by
the scripting engine. You can see the full list somewhere in
@@ -1032,6 +1058,11 @@ will only execute once and will not execute if the map server reconnects
to the char server later. Note that all those events will be executed upon
scripts reloading.
+OnNPCUnload:
+
+OnNPCUnload will be executed when a NPC is unloaded.
+OnNPCUnload is called when @reloadscript, @reloadnpc, @unloadnpc or @unloadnpcfile is used.
+
OnAgitStart:
OnAgitEnd:
OnAgitInit:
@@ -1703,7 +1734,8 @@ The default value of 'min' and 'max' can be set with 'input_min_value' and
For numeric inputs the value is capped to the range [min, max]. Returns 1
if the value was higher than 'max', -1 if lower than 'min' and 0 otherwise.
For string inputs it returns 1 if the string was longer than 'max', -1 is
-shorter than 'min' and 0 otherwise.
+shorter than 'min' and 0 otherwise. Note that an input string has a maximum
+length of 70 characters.
---------------------------------------
@@ -1935,58 +1967,64 @@ will result in error and termination of the script.
---------------------------------------
-*function <function name>;
-*<function name>{(<argument>, ...<argument>)};
-*function <function name> {
+{public | private} *function <function name>;
+{public | private} *function <function name> {
<code>
}
-This works like callfunc(), and is used for cleaner and faster scripting.
-The function must be defined and used within a script, and works like a
-label with arguments.
-Note that the name may only contain alphanumeric characters and underscore.
+In its first form, this syntax declares a local function so it can later be
+defined. In its second form, the syntax both declares and defines a local
+function. Local functions must be defined before being used. Note that the name
+may only contain alphanumeric characters and underscore. Once defined, they can
+be called from the current script as if they were regular built-in commands, and
+can also be called from other scripts if they are marked as public. Local
+functions may be marked as public by simply adding "public" prior to the
+function definition. Functions not marked as public are private by default and
+cannot be called from another script.
Usage:
1. Declare the function.
function <function name>;
2. Call the function anywhere within the script.
- It can also return a value when used with parentheses.
- <function name>;
- 3. Define the function within the script.
+ <function name>();
+ 3. Define the function by adding its script.
<function name> {<code>}
+ Step 1 is optional if the function is defined prior to being called.
+
Example:
-prontera,154,189,4 script Item Seller 767,{
/* Function declaration */
- function SF_Selling;
+ function MyFunction;
- if (Zeny > 50) {
- mes("Welcome!");
- /* Function call */
- SF_Selling();
- } else {
- mes("You need 50z, sorry!");
- }
- close();
+ /* Function call */
+ MyFunction();
/* Function definition */
- function SF_Selling {
- mes("Would you like to buy a phracon for 50z?");
- next();
- if (select("Yes", "No, thanks") == 1) {
- Zeny -= 50;
- getitem(Phracon, 1);
- mes("Thank you!");
- }
+ function MyFunction {
+ // (do something)
return;
}
-}
+
+
+Example with public functions:
+
+ /* Function declaration + definition */
+ public function myFunction {
+ /* notice the "public" before the "function" keyword */
+ return;
+ }
+
+ /* Local call */
+ myFunction();
+
+ /* Call from another script */
+ "npc name"::myFunction();
+
Example with parameters and return value:
-prontera,150,150,0 script TestNPC 123,{
/* Function declaration */
function MyAdd;
@@ -1995,18 +2033,35 @@ prontera,150,150,0 script TestNPC 123,{
input(.@a);
input(.@b);
/* Function call */
- mes(.@a+" + "+.@b+" = "+MyAdd(.@a, .@b));
+ mesf("%i + %i = %i", .@a, .@b, MyAdd(.@a, .@b));
close();
/* Function definition */
function MyAdd {
- return(getarg(0)+getarg(1));
+ return (getarg(0) + getarg(1));
}
-}
---------------------------------------
+*<function name>({<arg>...})
+*"<npc name>"::<function name>({<arg>...})
+*callfunctionofnpc("<function name>", "<npc name>"{, <arg>...});
+
+In its first form, calls a previously defined local function. In its second
+form, calls a previously defined public local function of another NPC. If the
+name of the target NPC or the name of the local function is not known
+beforehand, callfunctionofnpc() can be used instead of the second form.
+See function() above for more details.
+
+Example:
+
+ MyFunction(arg1, arg2, arg3);
+ "MyNPC"::MyFunction(arg1, arg2, arg3);
+ callfunctionofnpc("MyNPC", "MyFunction", arg1, arg2, arg3);
+
+---------------------------------------
+
*is_function("<function name>")
This command checks whether or not a function exists and returns its type.
@@ -2208,11 +2263,11 @@ Multiple statements can be grouped with { }, curly braces, just like with
the 'if' statement.
Example 1:
- while (switch(select("Yes", "No") == 2))
+ while (select("Yes", "No") == 2)
mes("You picked no.");
Example 2: multiple statements
- while (switch(select("Yes", "No") == 2 )) {
+ while (select("Yes", "No") == 2) {
mes("Why did you pick no?");
mes("You should pick yes instead!");
}
@@ -2999,18 +3054,20 @@ of equipment slots see getequipid().
---------------------------------------
-*getequiprefinerycnt(<equipment slot>)
+*getequiprefinerycnt(<equipment slot>{, <equipment slot>{, <equipment slot>}})
-Returns the current number of pluses for the item in the specified
-equipment slot. For a list of equipment slots see 'getequipid'.
+Returns the total of refine of item equipped in the equipment slots.
+For a list of equipment slots, see 'getequipid'.
-Can be used to check if you have reached a maximum refine value, default
-for this is +10:
+For example:
+ if (getequiprefinerycnt(EQI_HEAD_TOP) > 10) {
+ mes("You equipped a headgear (top) with above 10 refine.");
+ }
- if (getequiprefinerycnt(EQI_HEAD_TOP) < 10)
- mes("I will now upgrade your "+getequipname(EQI_HEAD_TOP));
- else
- mes("Sorry, it's not possible to refine hats better than +10");
+For example:
+ if (getequiprefinerycnt(EQI_ARMOR, EQI_SHOES) > 20) {
+ mes("Total refine of Armor and Shoes exceed 20.");
+ }
---------------------------------------
@@ -3153,7 +3210,7 @@ recreate these items perfectly if they are destroyed. Here's what you get:
@inventorylist_expire[] - expire time (Unix time stamp). 0 means never
expires.
@inventorylist_bound[] - whether it is an account bounded item or not.
-@inventorylist_favorite[] - whether it is favorite (inside favorite tab) or not.
+@inventorylist_favorite[] - whether it is favorite (inside favorite tab) or not.
@inventorylist_count - the number of items in these lists.
This could be handy to save/restore a character's inventory, since no
@@ -3213,7 +3270,7 @@ This function will set an item in inventory as favorite or not.
If its favorite item, it will be moved to favorite tab, else move out from favorite tab.
Note: Cant change favorite flag of an equipped item.
-Valid Parameters:
+Valid Parameters:
<idx> - inventory index, refer *getinventorylist()
<flag> - true/false (true = favorite item, false = otherwise)
@@ -3221,11 +3278,11 @@ Valid Parameters:
*autofavoriteitem(<item_id>, <flag>)
-This function will auto set an item as favorite when <item_id> is obtained.
+This function will auto set an item as favorite when <item_id> is obtained.
If its favorite item, it will be auto moved to favorite tab, else move out from favorite tab.
This setting affect not only attached player, but also everyone player globally.
-Valid Parameters:
+Valid Parameters:
<item_id> - item ID
<flag> - true/false (true = favorite item, false = otherwise)
@@ -3268,6 +3325,7 @@ Example:
---------------------------------------
*getiteminfo(<item ID>, <type>)
+*getiteminfo("<item name>", <type>)
*setiteminfo(<item ID>, <type>, <value>)
This function will look up the item with the specified ID number in the
@@ -3276,26 +3334,52 @@ It will return -1 if there is no such item.
Valid types are:
- ITEMINFO_BUYPRICE - Buy Price
- ITEMINFO_SELLPRICE - Sell Price
- ITEMINFO_TYPE - Item Type
- ITEMINFO_MAXCHANCE - Max drop chance of this item e.g. 1 = 0.01% , etc..
- if = 0, then monsters don't drop it at all (rare or a quest item)
- if = 10000, then this item is sold in NPC shops only
- ITEMINFO_SEX - Sex
- ITEMINFO_LOC - Equip location
- ITEMINFO_WEIGHT - Weight (note: 1/10 of unit)
- ITEMINFO_ATK - Attack
- ITEMINFO_DEF - Defense
- ITEMINFO_RANGE - Range
- ITEMINFO_SLOTS - Slots
- ITEMINFO_SUBTYPE - Item subtype
- ITEMINFO_ELV - Equip min. level
- ITEMINFO_WLV - Weapon level
- ITEMINFO_VIEWID - View ID ("Sprite" field in the Item DB)
- ITEMINFO_MATK - MATK (only relevant if RENEWAL is set)
- ITEMINFO_VIEWSPRITE - View Sprite ("ViewSprite" field in the Item DB)
- ITEMINFO_TRADE - Trade Restriction (see "doc/constant.md": item trade restriction)
+ ITEMINFO_ID - Item ID (getiteminfo() only!)
+ ITEMINFO_AEGISNAME - Unique name to reference the item (getiteminfo() only!)
+ ITEMINFO_NAME - Display name (getiteminfo() only!)
+ ITEMINFO_BUYPRICE - Buy Price
+ ITEMINFO_SELLPRICE - Sell Price
+ ITEMINFO_TYPE - Item Type
+ ITEMINFO_MAXCHANCE - Max drop chance of this item e.g. 1 = 0.01% , etc..
+ if = 0, then monsters don't drop it at all (rare or a quest item)
+ if = 10000, then this item is sold in NPC shops only
+ ITEMINFO_SEX - Sex
+ ITEMINFO_LOC - Equip location
+ ITEMINFO_WEIGHT - Weight (note: 1/10 of unit)
+ ITEMINFO_ATK - Attack
+ ITEMINFO_DEF - Defense
+ ITEMINFO_RANGE - Range
+ ITEMINFO_SLOTS - Slots
+ ITEMINFO_SUBTYPE - Item subtype
+ ITEMINFO_ELV - Equip min. level
+ ITEMINFO_ELV_MAX - Equip max. level
+ ITEMINFO_WLV - Weapon level
+ ITEMINFO_VIEWID - View ID ("Sprite" field in the Item DB)
+ ITEMINFO_MATK - MATK (only relevant if RENEWAL is set)
+ ITEMINFO_VIEWSPRITE - View Sprite ("ViewSprite" field in the Item DB)
+ ITEMINFO_TRADE - Trade Restriction (see "doc/constant.md": item trade restriction)
+ ITEMINFO_DELAY - Delay
+ ITEMINFO_DROPEFFECT_MODE - Drop effect mode
+ ITEMINFO_CLASS_BASE_1 - Class base 1
+ ITEMINFO_CLASS_BASE_2 - Class base 2
+ ITEMINFO_CLASS_BASE_3 - Class base 3
+ ITEMINFO_CLASS_UPPER - Class Upper
+ ITEMINFO_FLAG_NO_REFINE - No refine flag
+ ITEMINFO_FLAG_DELAY_CONSUME - Delay consume flag
+ ITEMINFO_FLAG_AUTOEQUIP - Auto equip flag
+ ITEMINFO_FLAG_AUTO_FAVORITE - Auto favorite flag
+ ITEMINFO_FLAG_BUYINGSTORE - Buying store flag
+ ITEMINFO_FLAG_BINDONEQUIP - Bind on equip flag
+ ITEMINFO_FLAG_KEEPAFTERUSE - Keep after use flag
+ ITEMINFO_FLAG_FORCE_SERIAL - Force serial flag
+ ITEMINFO_FLAG_NO_OPTIONS - No random item options flag
+ ITEMINFO_FLAG_DROP_ANNOUNCE - Drop announce flag
+ ITEMINFO_FLAG_SHOWDROPEFFECT - Shopw drop effect flag
+ ITEMINFO_STACK_AMOUNT - Stack amount
+ ITEMINFO_STACK_FLAG - Stack amount flag (1: inventory, 2:cart, 4:storage: 8:guildstorage)
+ ITEMINFO_ITEM_USAGE_FLAG - Item usage flag
+ ITEMINFO_ITEM_USAGE_OVERRIDE - Item usage override
+ ITEMINFO_GM_LV_TRADE_OVERRIDE - Min. GM level override trade restriction
Check sample in doc/sample/getiteminfo.txt
@@ -3679,8 +3763,38 @@ You need to put a 'close' after that yourself.
//=====================================
---------------------------------------
+*getguildinfo(<info type>{, <guild id>})
+*getguildinfo(<info type>{, "<guild name>"})
+
+This command returns misc info about the guild of the attached player. If a
+guild id or guild name is specified it will be used instead. If the target guild
+does not exist it returns an empty string or -1 depending on whether a string
+or an integer was requested.
+
+Valid <info type> are:
+ GUILDINFO_NAME - guild name
+ GUILDINFO_ID - guild id
+ GUILDINFO_LEVEL - current level
+ GUILDINFO_EXP - current exp
+ GUILDINFO_NEXT_EXP - exp required to reach the next level
+ GUILDINFO_SKILL_POINTS - available skill points
+ GUILDINFO_ONLINE - number of online members
+ GUILDINFO_AV_LEVEL - average member level
+ GUILDINFO_MAX_MEMBERS - guild capacity
+ GUILDINFO_MASTER_NAME - name of the guild master
+ GUILDINFO_MASTER_CID - char id of the guild master
+
+Example:
+ getguildinfo(GUILDINFO_MASTER_NAME, getcharid(CHAR_ID_GUILD, "Haru"))
+
+---------------------------------------
+
*getguildname(<guild id>)
+ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+ @ /!\ This command is deprecated @
+ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+
This function returns a guild's name given an ID number. If there is no
such guild, "null" will be returned;
@@ -3694,10 +3808,18 @@ such guild, "null" will be returned;
This is used all over the WoE controlling scripts. You could also use it
for a guild-based event.
+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 use getguildinfo instead:
+ getguildinfo(GUILDINFO_NAME, <guild id>)
+
---------------------------------------
*getguildmaster(<guild id>)
+ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+ @ /!\ This command is deprecated @
+ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+
This function return the name of the master of the guild which has the
specified ID number. If there is no such guild, "null" will be returned.
@@ -3721,14 +3843,26 @@ Maybe you want to make a room only guild masters can enter:
mes("Sorry you don't own the guild you are in");
close();
+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 use getguildinfo instead:
+ getguildinfo(GUILDINFO_MASTER_NAME, <guild id>)
+
---------------------------------------
*getguildmasterid(<guild id>)
+ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+ @ /!\ This command is deprecated @
+ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+
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.
+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 use getguildinfo instead:
+ getguildinfo(GUILDINFO_MASTER_CID, <guild id>)
+
---------------------------------------
*getcastlename("<map name>")
@@ -3931,7 +4065,7 @@ These fields are associate in 'db/(pre-)re/pet_db.conf'. Valid types are:
PETINFO_ACCESSORYFLAG - return 1 if the pet currently equipping accessory, return 0 otherwise.
PETINFO_EVO_EGGID - Pet Evolve EggID
PETINFO_AUTOFEED - Pet AutoFeed flag.
-
+
If the invoking player doesn't own a pet, this command will
return "null" for type PETINFO_NAME, and return 0 for other types.
@@ -4303,7 +4437,7 @@ falcon and false if they don't.
---------------------------------------
-*setmount({<flag>})
+*setmount({<flag>{, <type>}})
*checkmount()
If <flag> is MOUNT_NONE this command will remove the mount from the
@@ -4339,6 +4473,12 @@ The following flag values are accepted:
Unlike 'setfalcon' and 'setcart' this will not work at all if they aren't of a
class which can ride a mount.
+For clients PACKETVER_MAIN_NUM >= 20191120 || PACKETVER_RE_NUM >= 20191106
+you can pass a <type> flag which specifies the madogear wanted.
+The Available types:
+ MADO_ROBOT
+ MADO_SUITE
+
The accompanying function will return MOUNT_NONE if the invoking
character is not on a mount, and a non-zero value (according to the
above constants) if they are.
@@ -4609,13 +4749,13 @@ See also warp().
---------------------------------------
-*warpparty("<to_mapname>", <x>, <y>, <party_id>, "<from_mapname>", <include_leader>)
+*warpparty("<to map name>", <x>, <y>, <party id>{{, <ignore mapflags>}, "<from map name>"{, <include leader>}})
Warps a party to specified map and coordinate given the party ID, which
you can get with getcharid(CHAR_ID_PARTY). You can also request another party id given
a member's name with getcharid(CHAR_ID_PARTY, <player_name>).
-You can use the following "map names" for special warping behavior:
+You can use the following <to map name> 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.
@@ -4626,8 +4766,10 @@ Leader: All party members are warped to the leader's position. The
leader must be online and in the current map-server for
this to work.
-If you specify a from_mapname, warpparty() will only affect those on
-that map.
+If <ignore mapflags> is not 0, warpparty() ignores nowarp/noreturn restrictions
+of the warped character's current map. <ignore mapflags> defaults to 0.
+
+If you specify a <from map name>, warpparty() will only affect those on that map.
You can exclude Party leader from warping, by keeping include_leader option as false.
@@ -4655,13 +4797,13 @@ Example:
---------------------------------------
-*warpguild("<mapname>", <x>, <y>, <guild_id>, {"<from_mapname>"})
+*warpguild("<to map name>", <x>, <y>, <guild id>{{, <ignore mapflags>}, "<from map name>"})
Warps a guild to specified map and coordinate given the guild id, which
you can get with getcharid(CHAR_ID_GUILD). You can also request another guild id given
the member's name with getcharid(CHAR_ID_GUILD, <player_name>).
-You can use the following "map names" for special warping behavior:
+You can use the following <to map name> for special warping behavior:
Random: All guild members are randomly warped in their current map
(as if they all used a fly wing)
SavePointAll: All guild members are warped to their respective save point.
@@ -4669,12 +4811,19 @@ SavePoint: All guild members are warped to the save point of the
currently attached player (will fail if there's no player
attached).
-If you specify a from_mapname, warpguild() will only affect those on that map.
+If <ignore mapflags> is not 0, warpguild() ignores nowarp/noreturn restrictions
+of the warped character's current map. <ignore mapflags> defaults to 0.
+
+If you specify a <from map name>, warpguild() will only affect those on that map.
Example:
- warpguild("prontera", x, y, Guild_ID);
- warpguild("prontera", x, y, Guild_ID, "payon"); // warp member from Payon map only.
+ warpguild("prontera", x, y, Guild_ID); // Warp all guild members to Prontera,
+ // but check nowarp/noreturn restriction of their current map.
+ warpguild("prontera", x, y, Guild_ID, 1); // Warp all guild members to Prontera.
+ warpguild("prontera", x, y, Guild_ID, "payon"); // Warp guild members from Payon to Prontera,
+ // but check nowarp/noreturn restriction of Payon.
+ warpguild("prontera", x, y, Guild_ID, 1, "payon"); // Warp guild members from Payon to Prontera.
---------------------------------------
@@ -5176,11 +5325,11 @@ bound to the target character as specified by the bound type. All items created
in this manner cannot be dropped, sold, vended, auctioned, or mailed, and in
some cases cannot be traded or stored.
-Valid bound types are:
- 1 - Account Bound
- 2 - Guild Bound
- 3 - Party Bound
- 4 - Character Bound
+Valid item bound types are:
+ 1 - IBT_ACCOUNT - Account Bound
+ 2 - IBT_GUILD - Guild Bound
+ 3 - IBT_PARTY - Party Bound
+ 4 - IBT_CHARACTER - Character Bound
---------------------------------------
@@ -5221,12 +5370,12 @@ If a bound type is not specified or a bound type of 0 is used, it will search th
of any type, so long as the other parameters match. In all cases, this command will return the bound type of the
item found, or 0 if the specified item was not found.
-Valid bound types are:
- 0 - All Bound types.
- 1 - Account Bound
- 2 - Guild Bound
- 3 - Party Bound
- 4 - Character Bound
+Valid item bound types are:
+ 0 - IBT_ANY - Any Bound
+ 1 - IBT_ACCOUNT - Account Bound
+ 2 - IBT_GUILD - Guild Bound
+ 3 - IBT_PARTY - Party Bound
+ 4 - IBT_CHARACTER - Character Bound
Optional Parameters:
bound_type - checks to see if the item has the specified bound type.
@@ -5244,7 +5393,7 @@ Example:
close();
// This will also check if you have a bound (any type) 1205 (Cutter).
- if (checkbound(Cutter, 0)) {
+ if (checkbound(Cutter, IBT_ANY)) {
mes("You have a bound Cutter");
} else {
mes("You do not have a bound Cutter");
@@ -5259,8 +5408,8 @@ Example:
}
close();
- // This will check if the item found, has a bound type of 2 (guild_bound)
- if (checkbound(Cutter) == 2) {
+ // This will check if the item found, has a bound type of IBT_GUILD
+ if (checkbound(Cutter) == IBT_GUILD) {
mes("You have a guild_bound Cutter");
} else {
mes("You do not have a guild_bound Cutter.");
@@ -5268,7 +5417,7 @@ Example:
close();
// This will check if you have a 'guild_bound' +7 1205 (Cutter).
- if (checkbound(Cutter, 2, 7)) {
+ if (checkbound(Cutter, IBT_GUILD, 7)) {
mes("You have a +7 guild_bound Cutter.");
} else {
mes("You don't have the required item.");
@@ -5536,39 +5685,69 @@ Example:
---------------------------------------
-*enable_items()
-*disable_items()
+*enable_items({<flag>})
+*enableitemuse({<flag>})
+*disable_items({<flag>})
+*disableitemuse({<flag>})
+
+These commands enable/disable item actions while interacting with a NPC.
+When disable_items() is invoked, item actions defined by <flag> are disabled
+during scripts until enable_items() is called or the script has terminated.
+To avoid possible exploits, when disable_items() is invoked, it will only
+disable item actions while running that script in particular.
+Note that if a different script also invokes disable_items(), it will override
+the last call so you may want to call this command at the start of your
+script without assuming the effect is still in effect.
+If <flag> is omitted all item actions will be disabled.
+The enable_items() command enables item actions defined by <flag> during
+scripts until disable_items() is invoked or the script has terminated.
+If <flag> is omitted it defaults to 'item_enabled_npc' battle flag.
+For a list of supported flags have a look at the description of
+'item_enabled_npc' battle flag in 'conf/map/battle/items.conf'.
+Unless disable_items() or enable_items() is invoked the script will use
+'item_enabled_npc' battle flag by default.
-These commands enable/disable changing of equipments while an NPC is
-running. When disable_items() is run, equipments cannot be changed
-during scripts until enable_items() is called or the script has
-terminated. To avoid possible exploits, when disable_items() is invoked,
-it will only disable changing equips while running that script in
-particular. Note that if a different script also calls disable_items(),
-it will override the last call (so you may want to call this command at
-the start of your script without assuming the effect is still in
-effect).
-If 'item_enabled_npc' option is set to true in 'conf/map/battle/items.conf' all
-NPC are allowing changing of equipment by default except for those have been
-set with 'disable_items'.
+Example:
+
+ // This will disable changing equipment during this script.
+ disable_items(ITEMENABLEDNPC_EQUIP);
---------------------------------------
-*itemskill(<skill id>, <skill level>, {flag})
-*itemskill("<skill name>", <skill level>, {flag})
+*itemskill(<skill id>, <skill level>{, <flag>})
+*itemskill("<skill name>", <skill level>{, <flag>})
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.
-Flag is a optional param and, when present, the command will not check for
-skill requirements.
+By default, all skill requirements are ignored.
+Optional argument <flag> is a bitmask to manipulate how the skill is cast.
+Since <flag> is a bitmask, the flags can be summed up.
+Possible flags are:
+ - 0x00 - ISF_NONE - Skill is cast as if it has been used from skill tree.
+ (Same like <flag> was omitted.)
+ - 0x01 - ISF_CHECKCONDITIONS - Skill requirements are checked and consumed.
+ (SP are never checked/consumed.)
+ - 0x02 - ISF_INSTANTCAST - Skill is cast instantaneously.
+ - 0x04 - ISF_CASTONSELF - Skill is forcefully cast on invoking character,
+ without showing the target selection cursor.
+
+Important: Items which use itemskill() should be of type IT_USABLE.
+ If the item type is IT_DELAYCONSUME and ISF_CHECKCONDITIONS isn't set,
+ the item won't be consumed when using the item!
// When Anodyne is used, it will cast Endure, Level 1, as if the actual skill
// has been used from skill tree.
itemskill(SM_ENDURE, 1);
+// Instantaneously cast Level 10 Increase Agility on invoking character,
+// with checking/consuming skill requirements (15 HP).
+ itemskill(AL_INCAGI, 10, ISF_CHECKCONDITIONS | ISF_INSTANTCAST | ISF_CASTONSELF);
+// Instaed of using the constants, one could also do it like this:
+ itemskill(AL_INCAGI, 10, 7);
+
---------------------------------------
*itemeffect(<item id>)
@@ -6006,6 +6185,16 @@ Used in reset NPC's (duh!).
---------------------------------------
+*resetfeel({<account id>})
+*resethate({<account id>})
+
+The first resets a character's 'Feeling' maps.
+The second resets a character's 'Hatred' targets.
+
+If no RID is given, will run with the current attached player.
+
+---------------------------------------
+
*sc_start(<effect type>, <ticks>, <value 1>{, <rate>, <flag>{, <GID>}})
*sc_start2(<effect type>, <ticks>, <value 1>, <value 2>{, <rate>, <flag>{, <GID>}})
*sc_start4(<effect type>, <ticks>, <value 1>, <value 2>, <value 3>, <value 4>{, <rate>, <flag>{, <GID>}})
@@ -6156,6 +6345,15 @@ Example usage:
---------------------------------------
+*specialeffectnum(<effect number>, <num1>, <num2>{, <send_target>{, <unit id>{, <account id>}}})
+*specialeffectnum(<effect number>, <num1>, <num2>{, <send_target>{, "<NPC Name>"{, <account id>}}})
+
+Works same as specialeffect but also send effect numbers to client.
+For PACKETVER >= 20191127 support two numbers (num1, num2).
+For older packet versions only num1 supported.
+
+---------------------------------------
+
*removespecialeffect(<effect number>{, <send_target>{, <unit id>{, <account id>}}})
*removespecialeffect(<effect number>{, <send_target>{, "<NPC Name>"{, <account id>}}})
@@ -6436,17 +6634,22 @@ Examples:
---------------------------------------
-*setpcblock(<type>,<option>)
-*checkpcblock()
+*setpcblock(<type>, <option>{, <account id>})
+*checkpcblock({<account id>})
-Prevents the player from doing the following action.
+Prevents a character from doing the following action.
For setpcblock, when the <option> is true(1) will block them, and false(0)
will allow those actions again.
+The setpcblock command returns 1 on success or 0 if no character was attached.
+
The checkpcblock command returned value is a bit mask of the currently
enabled block flags (or PCBLOCK_NONE when none is set).
+Parameter <account id> is optional for both commands.
+If omitted, the currently attached character is used.
+
The <type> listed are a bit mask of the following:
PCBLOCK_NONE (only used by checkpcblock)
PCBLOCK_MOVE
@@ -6457,6 +6660,7 @@ The <type> listed are a bit mask of the following:
PCBLOCK_IMMUNE
PCBLOCK_SITSTAND
PCBLOCK_COMMANDS
+ PCBLOCK_NPC
Examples:
@@ -6853,6 +7057,37 @@ Examples:
---------------------------------------
+*unitiswalking({<GID>})
+
+This command checks, if a unit is walking or not.
+If <GID> is omitted, the currently attached character is used.
+Returns 1 if the unit is walking, 0 if the unit is not walking and -1 on error.
+
+Note: There's no differentiation between script and client initiated walking.
+
+Example:
+
+prontera,155,185,5 script Check Walking 1_F_MARIA,{
+ mes("Enter character name.");
+ mes("");
+ input(.@name$);
+ .@GID = getcharid(CHAR_ID_ACCOUNT, .@name$);
+ if (.@GID != 0) {
+ .@iswalking = unitiswalking(.@GID);
+ if (.@iswalking == 1)
+ mesf("%s is walking.", .@name$);
+ else if (.@iswalking == 0)
+ mesf("%s is not walking.", .@name$);
+ else
+ mesf("Can't get %s's walking state.", .@name$);
+ } else {
+ mesf("%s not found!", .@name$);
+ }
+ close();
+}
+
+---------------------------------------
+
*unitkill(<GID>)
*unitwarp(<GID>, <Mapname>, <x>, <y>)
*unitattack(<GID>, <Target ID>)
@@ -6935,6 +7170,18 @@ NPCs talking while hidden then revealing... you can wonder around =P).
---------------------------------------
+*cloakonnpc("<NPC object name>"{, <account_id>})
+*cloakoffnpc("<NPC object name>"{, <account_id>})
+
+These commands are used to apply the cloaking effect on npcs
+this is a visual effect only and it does NOT stop the player
+from interacting with the npc.
+
+If an account_id is specified then the effect will only display to the given id,
+otherwise it's displayed to the entire npc area.
+
+---------------------------------------
+
*doevent("<NPC object name>::<event label>")
This command will start a new execution thread in a specified NPC object
@@ -7280,6 +7527,16 @@ if GID is not given use the attached player.
//=====================================
---------------------------------------
+*loudhailer("<message>"{, "<color>"})
+
+Announces a colored text in '<char_name> Shouts : <message>' format.
+<color> must be a string in "RRGGBB" format. If <color> is omitted,
+white ("FFFFFF") will be used.
+This command is specially created for the Megaphone_ item (12221),
+but will work in NPCs, too.
+
+---------------------------------------
+
*announce("<text>", <flag>{, <fontColor>{, <fontType>{, <fontSize>{, <fontAlign>{, <fontY>}}}}})
This command will broadcast a message to all or most players, similar to
@@ -9147,6 +9404,12 @@ currently used font is used, default interface font is used again.
---------------------------------------
+*getfont()
+
+This command return the player's current font.
+if no player is attached it would always return a 0, which is also the default font.
+
+---------------------------------------'
*showdigit(<value>{, <type>})
Displays given numeric 'value' in large digital clock font on top of the
@@ -9401,13 +9664,19 @@ For examples of usage, see /doc/sample/npc_rodex.txt
//=====================================
---------------------------------------
-*instance_create("<instance name>", <owner id>{, <optional owner_type>})
+*instance_create("<instance_name>", <owner_id>{, <owner_type>})
-Create an instance using the name "<instance name>" for the <owner_id> of
-owner_type (when not provided, defaults to IOT_PARTY). Most instance_*
+Creates an instance using the name "<instance_name>" for the <owner_id> of
+<owner_type> (when not provided, defaults to IOT_PARTY). Most instance_*
commands are used in conjunction with this command and depend on the
ID this command returns.
+Valid <owner_type> values:
+- IOT_NONE (0) - <owner_id> can be any arbitrary number.
+- IOT_CHAR (1) - <owner_id> is account ID.
+- IOT_PARTY (2) - <owner_id> is party ID.
+- IOT_GUILD (3) - <owner_id> is guild ID.
+
Example:
// Store the Party ID of the invoking character.
.@party_id = getcharid(CHAR_ID_PARTY);
@@ -9418,11 +9687,9 @@ Example:
// ...
} else if (.@id == -2) { // Invalid Party ID
// ...
- } else if (.@id == -3) { // No free instances (MAX_INSTANCE exceeded)
- // ...
} else if (.@id == -4) { // Already exists
// ...
- } else (.@id < 0) { // Unspecified error while queuing instance.
+ } else if (.@id < 0) { // Unspecified error while queuing instance.
// ...
}
@@ -10180,6 +10447,7 @@ when the optional NPC_Name param is used.
*sellitem(<Item_ID>{, <price>{, <qty>}})
*sellitem(<Item_ID>, <qty>, <currency_id>, <currency_amount>)
+*sellitem(<Item_ID>, <zeny>, <qty>{, <currency_id1>, <currency_amount1>{, <currency_refine1>}{, ...}})
adds (or modifies) <Item_ID> data to the shop,
when <price> is not provided (or when it is -1) itemdb default is used.
@@ -10188,7 +10456,37 @@ qty is only necessary for NST_MARKET trader types.
when <Item_ID> is already in the shop,
the previous data (price/qty), is overwritten with the new.
-currency_id and currency_amount can be used only with shop type NST_BARTER
+currency_id and currency_amount can be used only with shop type NST_BARTER.
+zeny, currency_id1, currency_amount1, currency_refine1, can be used only with
+shop type NST_EXPANDED_BARTER.
+
+---------------------------------------
+
+*startsellitem(<Item_ID>, <zeny>, <qty>)
+
+Starts adding item into expanded barter shop (NST_EXPANDED_BARTER).
+Before this command possible to use commands *sellitemcurrency.
+Need PACKETVER 20190904 main or 20190904 RE or 20190828 zero or newer.
+
+Alternative way for add item to expanded barter shop is *sellitem with
+currency parameters.
+
+---------------------------------------
+
+*sellitemcurrency(<Item_ID>, <qty>{, <refine>})
+
+adds <Item_ID> as currency into expanded barter shop (NST_EXPANDED_BARTER)
+If <refine> set to -1, mean for any refine level.
+if <refine> missing used value -1.
+
+Need PACKETVER 20190904 main or 20190904 RE or 20190828 zero or newer.
+
+---------------------------------------
+
+*endsellitem()
+
+Complete adding item into expanded barter shop (NST_EXPANDED_BARTER).
+Need PACKETVER 20190904 main or 20190904 RE or 20190828 zero or newer.
---------------------------------------
@@ -10479,6 +10777,14 @@ returns progress on success and false on failure
---------------------------------------
+*achievement_iscompleted(<ach_id>{, <account_id>})
+
+Checks whether the attached player have completed all the given achievement objectives.
+
+returns true if yes and false if no.
+
+---------------------------------------
+
*itempreview(<index>)
Update already opened preview window with item from
@@ -10591,3 +10897,9 @@ Opens refinery user interface for the player
returns true on success and false on failure
---------------------------------------
+*openlapineddukddakboxui(<item_id>)
+
+Opens lapine ddukddak user interface for the player
+returns true on success and false on failure
+
+---------------------------------------