From c3710c2dbc65bbbece65b8cf0492015bde27c3c1 Mon Sep 17 00:00:00 2001 From: gumi Date: Mon, 13 Jul 2020 21:39:34 +0000 Subject: update script commands for hercules v2020.06.28 --- server/scripts/script_commands.txt | 564 ++++++++++++++++++++++++++++--------- 1 file 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' 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'. To make calculations in base 2 (binary), you can use +the binary notation like '0b'. + +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 { +{public | private} *function ; +{public | private} *function { } -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 ; 2. Call the function anywhere within the script. - It can also return a value when used with parentheses. - ; - 3. Define the function within the script. + (); + 3. Define the function by adding its script. {} + 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)); } -} --------------------------------------- +*({...}) +*""::({...}) +*callfunctionofnpc("", ""{, ...}); + +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("") 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() +*getequiprefinerycnt({, {, }}) -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: - inventory index, refer *getinventorylist() - true/false (true = favorite item, false = otherwise) @@ -3221,11 +3278,11 @@ Valid Parameters: *autofavoriteitem(, ) -This function will auto set an item as favorite when is obtained. +This function will auto set an item as favorite when 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 - true/false (true = favorite item, false = otherwise) @@ -3268,6 +3325,7 @@ Example: --------------------------------------- *getiteminfo(, ) +*getiteminfo("", ) *setiteminfo(, , ) 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({, }) +*getguildinfo({, ""}) + +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 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() + @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + @ /!\ 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, ) + --------------------------------------- *getguildmaster() + @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + @ /!\ 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, ) + --------------------------------------- *getguildmasterid() + @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + @ /!\ 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, ) + --------------------------------------- *getcastlename("") @@ -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({}) +*setmount({{, }}) *checkmount() If 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 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("", , , , "", ) +*warpparty("", , , {{, }, ""{, }}) 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, ). -You can use the following "map names" for special warping behavior: +You can use the following 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 is not 0, warpparty() ignores nowarp/noreturn restrictions +of the warped character's current map. defaults to 0. + +If you specify a , 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("", , , , {""}) +*warpguild("", , , {{, }, ""}) 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, ). -You can use the following "map names" for special warping behavior: +You can use the following 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 is not 0, warpguild() ignores nowarp/noreturn restrictions +of the warped character's current map. defaults to 0. + +If you specify a , 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({}) +*enableitemuse({}) +*disable_items({}) +*disableitemuse({}) + +These commands enable/disable item actions while interacting with a NPC. +When disable_items() is invoked, item actions defined by 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 is omitted all item actions will be disabled. +The enable_items() command enables item actions defined by during +scripts until disable_items() is invoked or the script has terminated. +If 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(, , {flag}) -*itemskill("", , {flag}) +*itemskill(, {, }) +*itemskill("", {, }) 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 is a bitmask to manipulate how the skill is cast. +Since 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 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() @@ -6006,6 +6185,16 @@ Used in reset NPC's (duh!). --------------------------------------- +*resetfeel({}) +*resethate({}) + +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(, , {, , {, }}) *sc_start2(, , , {, , {, }}) *sc_start4(, , , , , {, , {, }}) @@ -6156,6 +6345,15 @@ Example usage: --------------------------------------- +*specialeffectnum(, , {, {, {, }}}) +*specialeffectnum(, , {, {, ""{, }}}) + +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({, {, {, }}}) *removespecialeffect({, {, ""{, }}}) @@ -6436,17 +6634,22 @@ Examples: --------------------------------------- -*setpcblock(,