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.txt955
1 files changed, 712 insertions, 243 deletions
diff --git a/doc/script_commands.txt b/doc/script_commands.txt
index c3cc8a799..3b77aeb2c 100644
--- a/doc/script_commands.txt
+++ b/doc/script_commands.txt
@@ -266,8 +266,8 @@ direction across Y. Walking into that area will trigger the NPC. If no
'OnTouch:' special label is present in the NPC code, the execution will
start from the beginning of the script, otherwise, it will start from the
'OnTouch:' label. Monsters can also trigger the NPC, though the label
-'OnTouchNPC:' is used in this case. If player left area npc will called
-if present label 'OnUnTouch'.
+'OnTouchNPC:' is used in this case, and using mobattached() will return
+monster GID. If player left the area will trigger the label 'OnUnTouch'.
The code part is the script code that will execute whenever the NPC is
triggered. It may contain commands and function calls, descriptions of
@@ -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.
@@ -716,8 +718,11 @@ MAX_BANK_ZENY - Maximum Zeny in the bank
MAX_BG_MEMBERS - Maximum BattleGround members
MAX_CHAT_USERS - Maximum Chat users
MAX_REFINE - Maximum Refine level
+MAX_ITEM_ID - Maximum Item ID
MAX_MENU_OPTIONS - Maximum NPC menu options
MAX_MENU_LENGTH - Maximum NPC menu string length
+MOB_CLONE_START - Clone ID start from this range
+MOB_CLONE_END - Clone ID end with this range
Send targets and status options are also hard-coded and can be found
in 'doc/constants.md'.
@@ -1029,6 +1034,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:
@@ -1228,7 +1238,7 @@ you have to set it back to black unless you want all the rest of the text be in
that color:
mes("This is ^FF0000 red ^000000 and this is ^00FF00 green, ^000000 so.");
- mes(callfunc("F_MesColor", C_BLUE) +"This message is now in BLUE");
+ mesf("%sThis message is now in BLUE.", F_MesColor(C_BLUE));
Notice that the text coloring is handled purely by the client. If you use
non-English characters, the color codes might get screwed if they stick to
@@ -1252,6 +1262,14 @@ This will allow you to visit 'Google' with the in-game browser using default dim
Clicking 'Bing!' will open the in-game browser using the specified dimensions. (800x600)
+If you're using client from 2013-01-30 onwards, you can also use <ITEMLINK> to show
+the item's description. Gravity changed this into <ITEM> since 2015-07-29 onwards.
+
+ mes("Bring me an <ITEM>Apple<INFO>512</INFO></ITEM>.");
+ mesf("Bring me an %s.", F_MesItemInfo(Apple));
+
+This will show the item name and a clickable link for the item description.
+
---------------------------------------
*mesf("<format>"{, <param>{, <param>{, ...}}})
@@ -1290,6 +1308,21 @@ and the script will terminate.
---------------------------------------
+*mesclear();
+
+This command will clear the dialog text and continue the script without player interaction.
+
+Example:
+ mes("This is how the 'mesclear' script command works.");
+ sleep2 3000;
+ mesclear(); // This will clear the dialog and continue to the next one.
+ mes("I will show you again.");
+ sleep2 3000;
+ mesclear(); // This will clear the dialog and continue to the next one.
+ mes("Bye!");
+
+---------------------------------------
+
*close()
This command will create a 'close' button in the message window for the
@@ -2182,11 +2215,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!");
}
@@ -2973,18 +3006,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.");
+ }
---------------------------------------
@@ -3113,6 +3148,7 @@ invoking character has in its inventory, including all the data needed to
recreate these items perfectly if they are destroyed. Here's what you get:
@inventorylist_id[] - array of item ids.
+@inventorylist_idx[] - array of item inventory index.
@inventorylist_amount[] - their corresponding item amounts.
@inventorylist_equip[] - will return the slot the item is equipped on, if at all.
@inventorylist_refine[] - for how much it is refined.
@@ -3125,7 +3161,8 @@ recreate these items perfectly if they are destroyed. Here's what you get:
made by a specific craftsman.
@inventorylist_expire[] - expire time (Unix time stamp). 0 means never
expires.
-@inventorylist_bound - whether it is an account bounded item or not.
+@inventorylist_bound[] - whether it is an account bounded item 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
@@ -3179,6 +3216,30 @@ runs of getcartinventorylist().
---------------------------------------
+*setfavoriteitemidx(<idx>, <flag>)
+
+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:
+ <idx> - inventory index, refer *getinventorylist()
+ <flag> - true/false (true = favorite item, false = otherwise)
+
+---------------------------------------
+
+*autofavoriteitem(<item_id>, <flag>)
+
+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:
+ <item_id> - item ID
+ <flag> - true/false (true = favorite item, false = otherwise)
+
+---------------------------------------
+
*cardscnt()
This function will return the number of cards inserted into the weapon
@@ -3216,6 +3277,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
@@ -3224,26 +3286,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
@@ -3317,6 +3405,24 @@ This will set a Hat Effect onto the player. The state field allows you to
enable (true) or disable (false) the effect on the player.
---------------------------------------
+
+*identify(<Item ID>)
+
+This function identifies the first <Item ID> item in attached player's inventory.
+
+Returns -2 if an error happens, -1 if no unidentified <Item ID> was found.
+Otherwise, returns the idx of the identified item.
+
+---------------------------------------
+
+*identifyidx(<Inventory Index>)
+
+This will identify item at attached player's <Inventory Index> inventory index.
+
+Returns true if the item was identified, false otherwise.
+Note: If the item was already identified, it returns false.
+
+---------------------------------------
//=====================================
2.1 - End of Item-Related Commands
//=====================================
@@ -3383,11 +3489,12 @@ argument is omitted, it will try to use the map of the attached NPC, or the
map of the attached player if the NPC can't be found.
Valid <info> are:
- MAPINFO_NAME name of the map
- MAPINFO_ID numeric ID of the map
- MAPINFO_ZONE name of the zone used by the map
- MAPINFO_SIZE_X width of the map (cells on the x axis)
- MAPINFO_SIZE_Y height of the map (cells on the y axis)
+ MAPINFO_NAME name of the map
+ MAPINFO_ID numeric ID of the map
+ MAPINFO_ZONE name of the zone used by the map
+ MAPINFO_SIZE_X width of the map (cells on the x axis)
+ MAPINFO_SIZE_Y height of the map (cells on the y axis)
+ MAPINFO_NPC_COUNT total number of NPC in the map
Examples:
getmapinfo(MAPINFO_ID, "map name"); // ID from name
@@ -3529,20 +3636,21 @@ Examples :
---------------------------------------
-*gettimestr(<format string>, <max length>)
+*gettimestr(<format string>, <max length>{, <timestamp>})
This function will return a string containing time data as specified by
the format string.
-This uses the C function 'strfmtime', which obeys special format
+This uses the C function 'strftime', which obeys special format
characters. For a full description see, for example, the description of
-'strfmtime' at http://www.delorie.com/gnu/docs/glibc/libc_437.html
+'strftime' at http://www.delorie.com/gnu/docs/glibc/libc_437.html
All the format characters given in there should properly work.
Max length is the maximum length of a time string to generate.
The example given in Hercules sample scripts works like this:
mes(gettimestr("%Y-%m/%d %H:%M:%S", 21));
+ mes(gettimestr("%Y-%m/%d %H:%M:%S", 21, getcalendartime(0, 0)));
This will print a full date and time like 'YYYY-MM/DD HH:MM:SS'.
@@ -3607,8 +3715,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;
@@ -3622,10 +3760,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.
@@ -3649,14 +3795,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>")
@@ -3771,6 +3929,18 @@ getarraysize(), because it is not cleared between runs of getguildmember().
For usage examples, see getpartymember().
---------------------------------------
+
+*getguildonline(<guild id>{, <type>});
+
+Returns the amount of players online in the specified guild id.
+Returns -1 if the guild was not found.
+
+Valid <type> are:
+ GUILD_ONLINE_ALL Returns the total amount of players online in the guild.
+ GUILD_ONLINE_VENDOR Returns the total amount of vendors online in the guild.
+ GUILD_ONLINE_NO_VENDOR Returns the total amount of non-vendors online in the guild.
+
+---------------------------------------
//=====================================
2.2 - End of Guild-Related Commands
//=====================================
@@ -3831,26 +4001,34 @@ how many skills a character has.
*getpetinfo(<type>)
-This function will return pet information for the pet the invoking
-character currently has active. Valid types are:
+This command will return the currently active pet information of the invoking character.
+These fields are associate in 'db/(pre-)re/pet_db.conf'. Valid types are:
- 0 - Unique pet ID number as stored by the char server and distinguishing
- it from all other pets the characters actually have. This value is
- currently useless, at most you can use it to tell pets apart reliably.
- 1 - Pet class number as per 'db/pet_db.txt' - will tell you what kind of
- a pet it is.
- 2 - Pet name. Will return "null" if there's no pet.
- 3 - Pet friendly level (intimacy score). 1000 is full loyalty.
- 4 - Pet hungry level. 100 is completely full.
- 5 - Pet rename flag. 0 means this pet has not been named yet.
+ PETINFO_ID - Pet Database ID, stored in `pet` table to distinguish from other pets.
+ PETINFO_CLASS - Pet class ID. (Id field)
+ PETINFO_NAME - Pet Name, return "null" if there's no active pet.
+ PETINFO_INTIMACY - Pet Intimacy level. 1000 is full loyalty.
+ PETINFO_HUNGRY - Pet hungry level. 100 is completely full.
+ PETINFO_RENAME - Pet rename flag. 0 means this pet has not been named yet.
+ PETINFO_GID - Pet Game ID
+ PETINFO_EGGITEM - Pet EggItem
+ PETINFO_FOODITEM - Pet FoodItem
+ PETINFO_ACCESSORYITEM - Pet AccessoryItem
+ 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 2, and return 0 for other types.
+If the invoking player doesn't own a pet, this command will
+return "null" for type PETINFO_NAME, and return 0 for other types.
---------------------------------------
*petstat(<flag>)
+ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+ @ /!\ This command is deprecated @
+ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+
Returns current pet status, all are integers except name.
Returns 0 or "" if the player doesn't have pets.
@@ -3864,6 +4042,9 @@ PET_INTIMATE
Example:
.@i = petstat(PET_CLASS);
+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 'getpetinfo' instead.
+
---------------------------------------
*getmonsterinfo(<mob ID>, <type>)
@@ -3874,29 +4055,30 @@ It will return -1 if there is no such monster (or the type value is
invalid), or "null" if you requested the monster's name.
Valid types are listed in doc/constants.md:
- MOB_NAME 0
- MOB_LV 1
- MOB_MAXHP 2
- MOB_BASEEXP 3
- MOB_JOBEXP 4
- MOB_ATK1 5
- MOB_ATK2 6
- MOB_DEF 7
- MOB_MDEF 8
- MOB_STR 9
- MOB_AGI 10
- MOB_VIT 11
- MOB_INT 12
- MOB_DEX 13
- MOB_LUK 14
- MOB_RANGE 15
- MOB_RANGE2 16
- MOB_RANGE3 17
- MOB_SIZE 18
- MOB_RACE 19
- MOB_ELEMENT 20
- MOB_MODE 21
- MOB_MVPEXP 22
+ MOB_NAME 0
+ MOB_LV 1
+ MOB_MAXHP 2
+ MOB_BASEEXP 3
+ MOB_JOBEXP 4
+ MOB_ATK1 5
+ MOB_ATK2 6
+ MOB_DEF 7
+ MOB_MDEF 8
+ MOB_STR 9
+ MOB_AGI 10
+ MOB_VIT 11
+ MOB_INT 12
+ MOB_DEX 13
+ MOB_LUK 14
+ MOB_RANGE 15
+ MOB_RANGE2 16
+ MOB_RANGE3 17
+ MOB_SIZE 18
+ MOB_RACE 19
+ MOB_ELEMENT 20
+ MOB_MODE 21
+ MOB_MVPEXP 22
+ MOB_DMG_TAKEN_RATE 23
Check sample in doc/sample/getmonsterinfo.txt
@@ -4207,7 +4389,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
@@ -4243,6 +4425,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.
@@ -4441,11 +4629,14 @@ if <color> field is left out.
---------------------------------------
-*showscript("<message>"{, <GID>})
+*showscript("<message>"{, <GID>{, <send_target>}})
Makes the attached player or GID, display a message similiar to a chat,
this will be seen by everyone near the invoking character but will not
be displayed in the chat window.
+send_target: (optional)
+ AREA: show the message to everyone within the view range (default)
+ SELF: show the message to the given unit GID only
---------------------------------------
@@ -4510,13 +4701,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.
@@ -4527,8 +4718,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.
@@ -4556,13 +4749,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.
@@ -4570,12 +4763,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.
---------------------------------------
@@ -5077,11 +5277,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
---------------------------------------
@@ -5122,12 +5322,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.
@@ -5145,7 +5345,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");
@@ -5160,8 +5360,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.");
@@ -5169,7 +5369,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.");
@@ -5317,6 +5517,34 @@ Check getitem2() to understand its expanded parameters.
---------------------------------------
+*delitemidx(<index>{, <amount>{, <account id>}})
+
+This command will remove an item at the given inventory index. Unlike the
+'delitem()' counterpart, this doesn't check invalid Item ID, making it useful to remove
+invalid item IDs in player's inventory.
+
+If <amount> is not specified, this will remove all of the items at the specified index.
+Note that items with the 'ForceSerial' flag, not yet merged through 'mergeitem()', will only
+be removed at the given index.
+
+The only way to get the inventory index is by using 'getinventorylist()'. After deleting
+an item at the given index, that index can remain empty until the player relogs, so you
+should recall 'getinventorylist()' again. If you try to delete an item at an invalid index, the
+script will terminate with an error.
+
+This command is also useful to remove rental/bound items because 'delitem()'
+does not discriminate at choosing which item to remove.
+
+Example:
+
+ // This will remove all invalid Item ID in player's inventory
+ getinventorylist();
+ for (.@i = 0; .@i < @inventorylist_count; ++.@i)
+ if (getiteminfo(@inventorylist_id[.@i], ITEMINFO_TYPE) == -1)
+ delitemidx(@inventorylist_idx[.@i]);
+
+---------------------------------------
+
*countitem(<item id>)
*countitem("<item name>")
@@ -5427,21 +5655,40 @@ set with 'disable_items'.
---------------------------------------
-*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>)
@@ -5719,6 +5966,10 @@ storage window, to avoid any disruption when both windows overlap.
openstorage();
end;
+The mapflag 'nostorage' when set to type '2' (or 3), will not open the
+account storage. Unless the character group has the permission 'bypass_nostorage'.
+In case blocked by mapflag, returns 0.
+
---------------------------------------
*openmail()
@@ -5780,6 +6031,10 @@ time.
This will also fail and return 2 if the attached character does not belong
to any guild.
+The mapflag 'nogstorage' when set to type '2' (or 3), will not open the
+guild storage. Unless the character group has the permission 'bypass_nostorage'.
+In case blocked by mapflag, returns 1.
+
---------------------------------------
*guildchangegm(<guild id>, <new master's name>)
@@ -5871,6 +6126,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>}})
@@ -6021,6 +6286,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>}}})
@@ -6074,7 +6348,7 @@ Amount can be negative. See statusup().
---------------------------------------
-*needed_status_point(<type>, <val>, {<char_id>});
+*needed_status_point(<type>, <val>);
Returns the number of stat points needed to change the specified stat <type> by <val>.
If <val> is negative, returns the number of stat points that would be needed to
@@ -6301,17 +6575,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
@@ -6322,6 +6601,7 @@ The <type> listed are a bit mask of the following:
PCBLOCK_IMMUNE
PCBLOCK_SITSTAND
PCBLOCK_COMMANDS
+ PCBLOCK_NPC
Examples:
@@ -6332,7 +6612,7 @@ Examples:
setpcblock(PCBLOCK_ATTACK|PCBLOCK_SKILL, true);
// Re-enables attack, skills and item use
- setpcblock(PCBLOCK_ATTACK|PCBLOCK_SKILL|PCBLOCK_ITEM, false);
+ setpcblock(PCBLOCK_ATTACK|PCBLOCK_SKILL|PCBLOCK_USEITEM, false);
// checkpcblock related checks
if ((checkpcblock() & PCBLOCK_IMMUNE) != 0)
@@ -6483,7 +6763,7 @@ This command will kill all monsters that were spawned with monster() or
areamonster() and have a specified event label attached to them. Commonly
used to get rid of remaining quest monsters once the quest is complete.
-If the label is given as "All", all monsters which have their respawn
+If the label is given as "all", all monsters which have their respawn
times set to -1 (like all the monsters summoned with 'monster' or
'areamonster' script command, and all monsters summoned with GM commands,
but no other ones - that is, all non-permanent monsters) on the specified
@@ -6505,6 +6785,14 @@ other number for this parameter won't be recognized.
---------------------------------------
+*killmonstergid(<GID>);
+
+This command will kill the specific monster GID. The difference between
+this command and 'unitkill', is this command does not trigger monster's
+event label.
+
+---------------------------------------
+
*strmobinfo(<type>, <monster id>)
This function will return information about a monster record in the
@@ -6593,6 +6881,17 @@ will run as if by donpcevent().
---------------------------------------
+*mobattached()
+
+This command will return RID of the monster running from 'OnTouchNPC:' label.
+
+
+// Kill any monster entering npc's trigger area
+OnTouchNPC:
+ killmonstergid mobattached();
+
+---------------------------------------
+
*homevolution()
This command will try to evolve the current player's homunculus.
@@ -6699,6 +6998,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>)
@@ -6781,6 +7111,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
@@ -7737,6 +8079,10 @@ solution rather than sending the map and the monster_id.
*debugmes("<format string>"{, <param>{, ...}})
+ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+ @ /!\ This command is deprecated @
+ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+
This command will print a message in the server console (map-server window),
after applying the same format-string replacements as sprintf(). It will not be
displayed anywhere else. Returns true on success.
@@ -7750,6 +8096,29 @@ Example:
---------------------------------------
+*consolemes("<type>", "<format string>"{,<param>{, ...}})
+
+This command will print a message in the server console (map-server window),
+after applying the same format-string replacements as sprintf(). It will not be
+displayed anywhere else. Returns true on success.
+
+List of available <type> are:
+ CONSOLEMES_DEBUG = 0
+ CONSOLEMES_ERROR = 1
+ CONSOLEMES_WARNING = 2
+ CONSOLEMES_INFO = 3
+ CONSOLEMES_STATUS = 4
+ CONSOLEMES_NOTICE = 5
+
+Example:
+
+ // Displays "NAME has clicked me!" in the map-server window.
+ consolemes(CONSOLEMES_DEBUG, "%s has clicked me!", strcharinfo(PC_NAME));
+
+ consolemes(CONSOLEMES_DEBUG, "\033[0;32mHello World"); // supports ANSI escape sequences
+
+---------------------------------------
+
*logmes("<message>"{, <log type>})
This command will write the message given to the map server log files, as
@@ -8202,6 +8571,7 @@ Valid <permission> are:
PERM_DISABLE_STORE
PERM_DISABLE_EXP
PERM_DISABLE_SKILL_USAGE
+ PERM_BYPASS_NOSTORAGE
Example:
@@ -8462,6 +8832,18 @@ Example:
---------------------------------------
+*cap_value(<number>, <min>, <max>)
+
+Returns the number but capped between <min> and <max>.
+
+Example:
+ // capped between 0 ~ 100
+ .@value = cap_value(10, 0, 100); // .@value will be equal to 10
+ .@value = cap_value(1000, 0, 100); // .@value will be equal to 100
+ .@value = cap_value(-10, 3, 100); // .@value will be equal to 3
+
+---------------------------------------
+
*md5("<string>")
Returns the md5 checksum of a number or string.
@@ -8953,6 +9335,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
@@ -9616,6 +10004,11 @@ is run when they relog.
<On Death Event> refers to an NPC label that attaches to the character and
is run when they die. Can be "" for empty.
+If "-" is supplied for <mapname>, this will remove the 1 second automatic
+respawn on the battleground map. This allows for better manipulation of
+<On Death Event>. The player will have to be warped to desired location
+at the end of <On Death Event>.
+
Unlike the prior command, the latter will attach a GROUP in a waiting room
to the battleground, and sets the array $@arenamembers[0] where 0 holds
the IDs of the first group, and 1 holds the IDs of the second.
@@ -9747,6 +10140,8 @@ mapflag%TAB%<map_name>%TAB%battleground%TAB%2
This command will create a new BG Team.
When player dies, they will be respawned map_name,X,Y as mentioned.
+If "-" is supplied for the map name, this will remove the 1 second automatic
+respawn on the battleground map.
Command will return -1 if BG Creation is failed,
else it will return the BG ID(Also known as TeamID).
@@ -9836,17 +10231,18 @@ If char id is given, the information of that character is retrieved
instead. Type specifies what information to retrieve and can be one of the
following:
- 0 - Database ID
- 1 - Class
- 2 - Name
- 3 - Faith value for this mercenary's guild, if any
- 4 - Calls value for this mercenary's guild, if any
- 5 - Kill count
- 6 - Remaining life time in msec
- 7 - Level
+ MERCINFO_ID - Mercenary Database ID
+ MERCINFO_CLASS - Mercenary Class
+ MERCINFO_NAME - Mercenary Name
+ MERCINFO_FAITH - Mercenary faith value for this mercenary's guild, if any
+ MERCINFO_CALLS - Mercenary calls value for this mercenary's guild, if any
+ MERCINFO_KILLCOUNT - Mercenary kill count
+ MERCINFO_LIFETIME - Mercenary remaining life time in mili-second
+ MERCINFO_LEVEL - Mercenary Level
+ MERCINFO_GID - Mercenary Game ID
-If the character does not have a mercenary, the command returns ""
-for name and 0 for all other types.
+If the character does not have a mercenary, the command returns "" for MERCINFO_NAME
+and 0 for all other types.
---------------------------------------
//=====================================
@@ -9978,6 +10374,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.
@@ -9986,7 +10383,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.
---------------------------------------
@@ -10033,131 +10460,131 @@ Returns the amount of still-available <Item_ID> in the shop (on a NST_MARKET tra
---------------------------------------
-*setunitdata(<GUID>, <DataType>, <Val1> {,<Val2>,<Val3>})
+*setunitdata(<GID>, <DataType>, <Val>)
Sets or alters the data in real-time for game objects of the following types -
NPCs, Pets, Monsters, Homunuculus', Mercenaries, Elementals.
Applicable Data Types (available as constants) -
- Data Types Description (parameter type)
- UDT_SIZE: Unit Size (int)
- UDT_LEVEL: Level (int)
- UDT_HP: Current HP (int)
- UDT_MAXHP: Max HP (int)
- UDT_SP: SP (int)
- UDT_MAXSP: MAX SP (int)
- UDT_MASTERAID: Master Account ID (for Summons) (int)
- UDT_MASTERCID: Master Char ID (for Summons) (int)
- UDT_MAPIDXY: Warp a Unit to a map. (Val1 = (string) MapName, Val2 = (int) x, Val3 = (int) y)
- UDT_WALKTOXY: Make a unit walk to certain co-ordinates. (Val1 = (int) x, Val2 = (int) y)
- UDT_SPEED: Unit Speed. (int)
- UDT_MODE: Mode (Mobs only) (int)
- UDT_AI: Unit AI Type (see doc/constants.md for Unit AI Types)
- UDT_SCOPTION: Status Options. (see doc/constants.md for Unit Option Types)
- UDT_SEX: Gender of the unit. (see doc/constants.md for Genders)
- UDT_CLASS: Class of the unit. (Monster ID) (int)
- UDT_HAIRSTYLE: Hair Style ID. (int)
- UDT_HAIRCOLOR: Hair Color ID. (int)
- UDT_HEADBOTTOM: Headgear Bottom Sprite ID. (int)
- UDT_HEADMIDDLE: Headgear Middle Sprite ID. (int)
- UDT_HEADTOP: Headgear Top Sprite ID. (int)
- UDT_CLOTHCOLOR: Cloth Color ID. (int)
- UDT_SHIELD: Shield Sprite ID. (int)
- UDT_WEAPON: Weapon Sprite ID. (int)
- UDT_LOOKDIR: Face direction. (int)
- UDT_CANMOVETICK: Stop a unit from move for n seconds. (int)
- UDT_STR: Unit STR. (int)
- UDT_AGI: Unit AGI. (int)
- UDT_VIT: Unit VIT. (int)
- UDT_INT: Unit INT. (int)
- UDT_DEX: Unit DEX. (int)
- UDT_LUK: Unit LUK. (int)
- UDT_ATKRANGE: Attack range of a unit. (int)
- UDT_ATKMIN: Min Atk of a unit. (int)
- UDT_ATKMAX: Max Atk of a unit. (int)
- UDT_MATKMIN: Min MATK of a unit. (int)
- UDT_MATKMAX: Max MATK of a unit. (int)
- UDT_DEF: DEF. (int)
- UDT_MDEF: MDEF. (int)
- UDT_HIT: HIT. (int)
- UDT_FLEE: FLEE. (int)
- UDT_PDODGE: Perfect Dodge. (int)
- UDT_CRIT: Critical Rate. (int)
- UDT_RACE: Race. (Eg. string constants RC_DemiHuman or Integer 7).
- UDT_ELETYPE: Element. (Eg. string constants Ele_Neutral or Integer 0).
- UDT_ELELEVEL: Element Level (int).
- UDT_AMOTION: AMotion Rate (int).
- UDT_ADELAY: ADelay Rate (int).
- UDT_DMOTION: DMotion Rate (int).
- UDT_HUNGER: Hunger Rate (int) - for summons.
- UDT_INTIMACY: Intimacy Rate (int) - for summons.
- UDT_LIFETIME: LifeTime (int) - for summons.
- UDT_MERC_KILLCOUNT: Kill count for mercenaries (int).
- UDT_STATADD: Status Points (int) - for NPCs.
+ Data Types Description (parameter type)
+ UDT_SIZE: Unit Size
+ UDT_LEVEL: Level
+ UDT_HP: Current HP
+ UDT_MAXHP: Max HP
+ UDT_SP: SP
+ UDT_MAXSP: MAX SP
+ UDT_MASTERAID: Master Account ID (for Summons)
+ UDT_MASTERCID: Master Char ID (for Summons)
+ UDT_SPEED: Unit Speed.
+ UDT_MODE: Mode (Mobs only)
+ UDT_AI: Unit AI Type (see doc/constants.md for Unit AI Types)
+ UDT_SCOPTION: Status Options. (see doc/constants.md for Unit Option Types)
+ UDT_SEX: Gender of the unit. (see doc/constants.md for Genders)
+ UDT_CLASS: Class of the unit. (Monster ID)
+ UDT_HAIRSTYLE: Hair Style ID.
+ UDT_HAIRCOLOR: Hair Color ID.
+ UDT_HEADBOTTOM: Headgear Bottom Sprite ID.
+ UDT_HEADMIDDLE: Headgear Middle Sprite ID.
+ UDT_HEADTOP: Headgear Top Sprite ID.
+ UDT_CLOTHCOLOR: Cloth Color ID.
+ UDT_SHIELD: Shield Sprite ID.
+ UDT_WEAPON: Weapon Sprite ID.
+ UDT_LOOKDIR: Face direction.
+ UDT_CANMOVETICK: Stop a unit from move for n seconds.
+ UDT_STR: Unit STR.
+ UDT_AGI: Unit AGI.
+ UDT_VIT: Unit VIT.
+ UDT_INT: Unit INT.
+ UDT_DEX: Unit DEX.
+ UDT_LUK: Unit LUK.
+ UDT_ATKRANGE: Attack range of a unit.
+ UDT_ATKMIN: Min Atk of a unit.
+ UDT_ATKMAX: Max Atk of a unit.
+ UDT_MATKMIN: Min MATK of a unit.
+ UDT_MATKMAX: Max MATK of a unit.
+ UDT_DEF: DEF.
+ UDT_MDEF: MDEF.
+ UDT_HIT: HIT.
+ UDT_FLEE: FLEE.
+ UDT_PDODGE: Perfect Dodge.
+ UDT_CRIT: Critical Rate.
+ UDT_RACE: Race. (Eg. constants RC_DemiHuman or Integer 7).
+ UDT_ELETYPE: Element. (Eg. constants Ele_Neutral or Integer 0).
+ UDT_ELELEVEL: Element Level.
+ UDT_AMOTION: AMotion Rate.
+ UDT_ADELAY: ADelay Rate.
+ UDT_DMOTION: DMotion Rate.
+ UDT_HUNGER: Hunger Rate - for summons.
+ UDT_INTIMACY: Intimacy Rate - for summons.
+ UDT_LIFETIME: LifeTime - for summons.
+ UDT_MERC_KILLCOUNT: Kill count for mercenaries
+ UDT_STATADD: Status Points - for NPCs.
+ UDT_GROUP: group id
+ UDT_DAMAGE_TAKEN_RATE: damage taken rate of a unit.
returns 0 if value could not be set, 1 if successful.
---------------------------------------
-*getunitdata (<GUID>,<DataType>{,<Variable>})
+*getunitdata (<GID>,<DataType>)
-Retrieves real-time data of a game object. For data with multiple return values,
-an array variable may be passed to store the data in.
+Retrieves real-time data of a game object.
Applicable Data types (available as constants) -
- Data Types Description (return type)
- UDT_SIZE: Unit Size (int)
- UDT_LEVEL: Level (int)
- UDT_HP: Current HP (int)
- UDT_MAXHP: Max HP (int)
- UDT_SP: SP (int)
- UDT_MAXSP: MAX SP (int)
- UDT_MASTERAID: Master Account ID (for Summons) (int)
- UDT_MASTERCID: Master Char ID (for Summons) (int)
- UDT_MAPIDXY: Warp a Unit to a map. (Val1 = (string) MapName, Val2 = (int) x, Val3 = (int) y)
- UDT_SPEED: Unit Speed. (int)
- UDT_MODE: Mode (Mobs only) (int)
- UDT_AI: Unit AI Type (see doc/constants.md for Unit AI Types)
- UDT_SCOPTION: Status Options. (see doc/constants.md for Unit Option Types)
- UDT_SEX: Gender of the unit. (see doc/constants.md for Genders)
- UDT_CLASS: Class of the unit. (Monster ID) (int)
- UDT_HAIRSTYLE: Hair Style ID. (int)
- UDT_HAIRCOLOR: Hair Color ID. (int)
- UDT_HEADBOTTOM: Headgear Bottom Sprite ID. (int)
- UDT_HEADMIDDLE: Headgear Middle Sprite ID. (int)
- UDT_HEADTOP: Headgear Top Sprite ID. (int)
- UDT_CLOTHCOLOR: Cloth Color ID. (int)
- UDT_SHIELD: Shield Sprite ID. (int)
- UDT_WEAPON: Weapon Sprite ID. (int)
- UDT_LOOKDIR: Face direction. (int)
- UDT_CANMOVETICK: Stop a unit from move for n seconds. (int)
- UDT_STR: Unit STR. (int)
- UDT_AGI: Unit AGI. (int)
- UDT_VIT: Unit VIT. (int)
- UDT_INT: Unit INT. (int)
- UDT_DEX: Unit DEX. (int)
- UDT_LUK: Unit LUK. (int)
- UDT_ATKRANGE: Attack range of a unit. (int)
- UDT_ATKMIN: Min Atk of a unit. (int)
- UDT_ATKMAX: Max Atk of a unit. (int)
- UDT_MATKMIN: Min MATK of a unit. (int)
- UDT_MATKMAX: Max MATK of a unit. (int)
- UDT_DEF: DEF. (int)
- UDT_MDEF: MDEF. (int)
- UDT_HIT: HIT. (int)
- UDT_FLEE: FLEE. (int)
- UDT_PDODGE: Perfect Dodge. (int)
- UDT_CRIT: Critical Rate. (int)
- UDT_RACE: Race. (Eg. string constants RC_DemiHuman or Integer 7).
- UDT_ELETYPE: Element. (Eg. string constants Ele_Neutral or Integer 0).
- UDT_ELELEVEL: Element Level (int).
- UDT_AMOTION: AMotion Rate (int).
- UDT_ADELAY: ADelay Rate (int).
- UDT_DMOTION: DMotion Rate (int).
- UDT_HUNGER: Hunger Rate (int) - for summons.
- UDT_INTIMACY: Intimacy Rate (int) - for summons.
- UDT_LIFETIME: LifeTime (int) - for summons.
- UDT_MERC_KILLCOUNT: Kill count for mercenaries (int).
+ Data Types Description (return type)
+ UDT_SIZE: Unit Size
+ UDT_LEVEL: Level
+ UDT_HP: Current HP
+ UDT_MAXHP: Max HP
+ UDT_SP: SP
+ UDT_MAXSP: MAX SP
+ UDT_MASTERAID: Master Account ID (for Summons)
+ UDT_MASTERCID: Master Char ID (for Summons)
+ UDT_SPEED: Unit Speed.
+ UDT_MODE: Mode (Mobs only)
+ UDT_AI: Unit AI Type (see doc/constants.md for Unit AI Types)
+ UDT_SCOPTION: Status Options. (see doc/constants.md for Unit Option Types)
+ UDT_SEX: Gender of the unit. (see doc/constants.md for Genders)
+ UDT_CLASS: Class of the unit. (Monster ID)
+ UDT_HAIRSTYLE: Hair Style ID.
+ UDT_HAIRCOLOR: Hair Color ID.
+ UDT_HEADBOTTOM: Headgear Bottom Sprite ID.
+ UDT_HEADMIDDLE: Headgear Middle Sprite ID.
+ UDT_HEADTOP: Headgear Top Sprite ID.
+ UDT_CLOTHCOLOR: Cloth Color ID.
+ UDT_SHIELD: Shield Sprite ID.
+ UDT_WEAPON: Weapon Sprite ID.
+ UDT_LOOKDIR: Face direction.
+ UDT_CANMOVETICK: Stop a unit from move for n seconds.
+ UDT_STR: Unit STR.
+ UDT_AGI: Unit AGI.
+ UDT_VIT: Unit VIT.
+ UDT_INT: Unit INT.
+ UDT_DEX: Unit DEX.
+ UDT_LUK: Unit LUK.
+ UDT_ATKRANGE: Attack range of a unit.
+ UDT_ATKMIN: Min Atk of a unit.
+ UDT_ATKMAX: Max Atk of a unit.
+ UDT_MATKMIN: Min MATK of a unit.
+ UDT_MATKMAX: Max MATK of a unit.
+ UDT_DEF: DEF.
+ UDT_MDEF: MDEF.
+ UDT_HIT: HIT.
+ UDT_FLEE: FLEE.
+ UDT_PDODGE: Perfect Dodge.
+ UDT_CRIT: Critical Rate.
+ UDT_RACE: Race. (Eg. constants RC_DemiHuman or Integer 7).
+ UDT_ELETYPE: Element. (Eg. constants Ele_Neutral or Integer 0).
+ UDT_ELELEVEL: Element Level.
+ UDT_AMOTION: AMotion Rate.
+ UDT_ADELAY: ADelay Rate.
+ UDT_DMOTION: DMotion Rate.
+ UDT_HUNGER: Hunger Rate - for summons.
+ UDT_INTIMACY: Intimacy Rate - for summons.
+ UDT_LIFETIME: LifeTime - for summons.
+ UDT_MERC_KILLCOUNT: Kill count for mercenaries.
+ UDT_GROUP: group id
+ UDT_DAMAGE_TAKEN_RATE: damage taken rate of a unit.
returns -1 if value could not be retrieved.
@@ -10277,6 +10704,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
@@ -10308,7 +10743,7 @@ Works for 20170830 RE and main and for any zero clients
---------------------------------------
-*expandInventoryAck(<result>{, <itemId>})
+*expandinventoryack(<result>{, <itemId>})
Send initial inventory expansion result.
Normally this function should be called from script label
@@ -10326,7 +10761,7 @@ Works for 20181212 zero clients
---------------------------------------
-*expandInventoryResult(<result>)
+*expandinventoryresult(<result>)
Send final inventory expansion result.
Normally this function should be called from script label
@@ -10343,7 +10778,7 @@ Works for 20181212 zero clients
---------------------------------------
-*expandInventory(<value>)
+*expandinventory(<value>)
Adjust player inventory to given value.
Maximum inventory size is MAX_INVENTORY.
@@ -10354,10 +10789,44 @@ Current max inventory size can be read by function getInventorySize().
---------------------------------------
-*getInventorySize()
+*getinventorysize()
Return current player max inventory size.
This value always smaller or equal to MAX_INVENTORY.
Size can be changed by group of functions expandInventory*
---------------------------------------
+
+*getunittitle(<GID>)
+
+Return unit title string.
+Works for 20180207 main clients, 20171129 re clients, 20171130 zero clients
+
+---------------------------------------
+
+*setunittitle(<GID>, <title>)
+
+Set unit title string.
+Invisible for players, because current implimentation using title id only.
+Works for 20180207 main clients, 20171129 re clients, 20171130 zero clients
+
+---------------------------------------
+
+*closeroulette()
+
+Force close roulette window.
+Works for 20141008 main clients, 20140903 re, any zero.
+
+---------------------------------------
+*openrefineryui()
+
+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
+
+---------------------------------------