diff options
author | Andrei Karas <akaras@inbox.ru> | 2018-12-15 23:26:40 -0200 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2018-12-15 23:27:06 -0200 |
commit | 372f7afe9a68b1cd7c5b93dde1e4dfe1933bf17f (patch) | |
tree | 17699a13dcf493d6f7b5bbe3a6eda4fcf59cc377 /server/scripts/script_commands.txt | |
parent | 0ff42afddfc1ba6350b78bb0d9c6272025282767 (diff) | |
download | docs-372f7afe9a68b1cd7c5b93dde1e4dfe1933bf17f.tar.gz docs-372f7afe9a68b1cd7c5b93dde1e4dfe1933bf17f.tar.bz2 docs-372f7afe9a68b1cd7c5b93dde1e4dfe1933bf17f.tar.xz docs-372f7afe9a68b1cd7c5b93dde1e4dfe1933bf17f.zip |
Hercules Update
Diffstat (limited to 'server/scripts/script_commands.txt')
-rw-r--r-- | server/scripts/script_commands.txt | 208 |
1 files changed, 154 insertions, 54 deletions
diff --git a/server/scripts/script_commands.txt b/server/scripts/script_commands.txt index 3f5489d..94e6d66 100644 --- a/server/scripts/script_commands.txt +++ b/server/scripts/script_commands.txt @@ -268,8 +268,8 @@ increments of 45 degrees, where 0 means facing towards the top of the map. and to make it look southeast it's facing 5.) Sprite is the sprite identifier used to display this particular NPC. For a -full list of sprite numbers see http://kalen.s79.xrea.com/npc/npce.shtml as -well as db/constants.conf. +full list of sprite numbers see http://nn.ai4rei.net/dev/npclist/ as +well as doc/constants.md. You may also use a monster's ID constant instead to display a monster sprite for this NPC, in npcs that have view ids of mobs it's encouraged to use OnTouch events with a 2,2 range and with an 'end' after the header to avoid @@ -557,7 +557,7 @@ suffix is 32. Some variables are special, that is, they are already defined for you by the scripting engine. You can see the full list somewhere in -'db/constants.conf', which is a file you should read, since it also +'doc/constants.md', which is a file you should read, since it also allows you to replace lots of numbered arguments for many commands with easier to read text. The special variables most commonly used are all permanent character-based variables: @@ -720,7 +720,7 @@ Variable References Hard-coded constants -------------------- Most of the constants defined by the scripting engine can be found in -'db/constants.conf' and have the same value independently of settings +'doc/constants.md' and have the same value independently of settings that are core related, but there are constants that can be used to retrieve core information that's set when the server is compiled. @@ -735,10 +735,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_MENU_OPTIONS - Maximum NPC menu options +MAX_MENU_LENGTH - Maximum NPC menu string length Send targets and status options are also hard-coded and can be found -in src/map/script.c::script_hardcoded_constants or in functions that -currently use them. +in 'doc/constants.md'. Operators --------- @@ -1622,21 +1623,24 @@ perfectly equivalent. --------------------------------------- *select("<option>"{, "<option>", ...}) -*prompt("<option>"{, "<option>", ...}) This function is a handy replacement for 'menu' that doesn't use a complex -label structure. It will return the number of menu option picked, -starting with 1. Like 'menu', it will also set the variable @menu to -contain the option the user picked. +label structure. It will return the number of the menu option picked, +starting with 1. If the player presses cancel, the script is terminated. - if (select("Yes:No") == 1) + if (select("Yes", "No") == 1) mes("You said yes, I know."); And like 'menu', the selected option is consistent with grouped options and empty options. -'prompt' works almost the same as select, except that when a character -clicks the Cancel button, this function will return 255 instead. +--------------------------------------- + +*prompt("<option>"{, "<option>", ...}) + +This function behaves exactly like select(), but when a player presses cancel +it returns MAX_MENU_OPTIONS and the script is not terminated. You almost always +want to use select() rather than prompt(). --------------------------------------- @@ -1998,18 +2002,35 @@ prontera,150,150,0 script TestNPC 123,{ *is_function("<function name>") -This command checks whether a function exists. -It returns 1 if function is found, or 0 if it isn't. +This command checks whether or not a function exists and returns its type. +Returns false if it cannot be found. + +return values: + + FUNCTION_IS_COMMAND - built-in script command (eg: mes, select, ...) + FUNCTION_IS_GLOBAL - user-defined global function (callable with callfunc) + FUNCTION_IS_LOCAL - user-defined local function + FUNCTION_IS_LABEL - user-defined label function (callable with callsub) Example: - function script try { + function script func1 { dothat(); } - script test FAKE_NPC,{ - .@try = is_function("try"); // 1 - .@not = is_function("notafunction"); // 0 + function func2 { + do_something(); + } + + func3: + end; + + is_function("func1"); // FUNCTION_IS_GLOBAL + is_function("func2"); // FUNCTION_IS_LOCAL + is_function("func3"); // FUNCTION_IS_LABEL + is_function("select"); // FUNCTION_IS_COMMAND + is_function("invalid"); // false } --------------------------------------- @@ -2498,7 +2519,7 @@ arrays: This function will return the basic stats of an invoking character, referred to by the parameter number. Instead of a number, you can use a -parameter name if it is defined in 'db/constants.conf'. +parameter name if it is defined in 'doc/constants.md'. Example parameters: @@ -2579,15 +2600,12 @@ playerattached() to check for the character attached to the script. --------------------------------------- -*getnpcid(<type>{, "<npc name>"}) +*getnpcid({"<npc name>"}) Retrieves IDs of the currently invoked NPC. If a unique npc name is given, -IDs of that NPC are retrieved instead. Type specifies what ID to retrieve -and can be one of the following: - - 0 - Unit ID (GID) +IDs of that NPC are retrieved instead. -If an invalid type is given or the NPC does not exist, 0 is returned. +If the NPC does not exist, 0 is returned. --------------------------------------- @@ -3244,6 +3262,7 @@ Valid types are: 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) Check sample in doc/sample/getiteminfo.txt @@ -3595,7 +3614,7 @@ mob database and return the info set by TYPE argument. 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 constants.conf: +Valid types are listed in doc/constants.md: MOB_NAME 0 MOB_LV 1 MOB_MAXHP 2 @@ -3746,7 +3765,7 @@ effect being inflicted, in percent. } You can see the full list of available effect types you can possibly -inflict in 'db/constants.conf' under 'Eff_'. +inflict in 'doc/constants.md' under 'Status effects'. --------------------------------------- //===================================== @@ -4396,7 +4415,7 @@ This command will change the job class of the invoking character. This command does work with numbers, but you can also use job names. The full list of job names and the numbers they correspond to can be found in -'db/constants.conf'. +'doc/constants.md'. 'upper flag' can alternatively be used to specify the type of job one changes to. For example, jobchange(Job_Swordman, 1); will change the @@ -4544,7 +4563,7 @@ Is subject to EXP bonuses and to the `quest_exp_rate` config option. getexp(10000, 5000); You can also assign directly to the parameters defined in -'db/constants.conf': +'doc/constants.md': BaseExp += 10000; JobExp += 5000; @@ -4623,7 +4642,7 @@ installation that you can look at: 'npc/custom/stylist.txt' This command will push the currently attached player to given direction by given amount of square cells. Direction is the same as used when declaring NPCs, and can be specified by using one of the DIR_* constants -(db/constants.conf). +(doc/constants.md). The knock-back is not restricted by items or map flags, only obstacles are taken into account. If there is not enough space to perform the push (e.g. @@ -5578,7 +5597,7 @@ These commands will bestow a status effect on a character. The <effect type> determines which status is invoked. This can be either a number or constant, with the common statuses (mostly negative) found in -'db/constants.conf' with the 'SC_' prefix. A full list is located in +'doc/constants.md' under 'Status Changes'. A full list is located in 'src/map/status.h', though they are not currently documented. The duration of the status is given in <ticks>, or milleseconds. @@ -5719,6 +5738,17 @@ Example usage: --------------------------------------- +*removespecialeffect(<effect number>{, <send_target>{, <unit id>{, <account id>}}}) +*removespecialeffect(<effect number>{, <send_target>{, "<NPC Name>"{, <account id>}}}) + +Works for: + main client from version 2018-10-02 + re client from version 2018-10-02 +This command will remove special effect. All parameters same with specialeffect. +Examples and detailed explanation about parameters see in specialeffect. + +--------------------------------------- + *specialeffect2(<effect number>{, <send_target>{, "<Player Name>"}}) @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@ -6331,7 +6361,7 @@ Examples: *unitemote(<GID>, <Emote>) Okay, these commands should be fairly self explaining. -For the emotions, you can look in db/constants.conf for prefixes with e_ +For the emotions, you can look in 'doc/constants.md' under 'Emotes' PS: unitwarp() supports a <GID> of zero, which causes the executor of the PS: unittalk() can receive 3 extra parameters: show_name: @@ -6754,7 +6784,7 @@ This command will broadcast a message to all or most players, similar to The region the broadcast is heard in (target), source of the broadcast and the color the message will come up as is determined by the flags. -The flag values are coded as constants in db/constants.conf to make them +The flag values are coded as constants in doc/constants.md to make them easier to use. Target flags: @@ -7080,7 +7110,7 @@ to the coordinates specified. This command marks a specified map with a map flag given. Map flags alter the behavior of the map, you can see the list of the available ones in -'db/constants.conf' under 'mf_'. +'doc/constants.md' under 'Mapflags'. The map flags alter the behavior of the map regarding teleporting (mf_nomemo, mf_noteleport, mf_nowarp), storing location when @@ -7353,15 +7383,19 @@ solution rather than sending the map and the monster_id. //===================================== --------------------------------------- -*debugmes("<message>") +*debugmes("<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. + +Example: -This command will send the message to the server console (map-server -window). It will not be displayed anywhere else. -// // Displays "NAME has clicked me!" in the map-server window. - debugmes(strcharinfo(PC_NAME)+" has clicked me!"); + debugmes("%s has clicked me!", strcharinfo(PC_NAME)); + + debugmes("\033[0;32mHello World"); // supports ANSI escape sequences - debugmes("\033[38D\033[K ==Message== \n"); // enable colour code. --------------------------------------- *logmes("<message>"{, <log type>}) @@ -7531,7 +7565,7 @@ A full list of pet IDs can be found inside 'db/pet_db.txt' This command makes an object display an emotion sprite above their own as if they were doing that emotion. For a full list of emotion numbers, see -'db/constants.conf' under 'e_'. The not so obvious ones are 'e_what' (a +'doc/constants.md' under 'Emotes'. The not so obvious ones are 'e_what' (a question mark) and 'e_gasp' (the exclamation mark). The optional target parameter specifies who will get the emotion on top of @@ -7784,7 +7818,7 @@ built-in atcommands and custom atcommands. *has_permission("<permission>"{, <account id>}) Check if the attached or specified player has the specified permission -and returns true or false accordingly. See doc/permissions.txt for +and returns true or false accordingly. See doc/permissions.md for details about permissions. Valid <permission> are: @@ -8257,6 +8291,18 @@ Example: --------------------------------------- +*data_to_string(<data>) + +Returns a string representation of the given data, similar to the .toString() +method in JavaScript. + +Example: + + data_to_string(DATATYPE_VAR) // "DATATYPE_VAR" + data_to_string(.@foo) // ".@foo" + +--------------------------------------- + *charisalpha("<string>", <position>) This function will return true if the character number Position in the given @@ -8596,14 +8642,14 @@ same time. This command will make the pet give a bonus to the owner's stat (bonus type - bInt, bVit, bDex, bAgi, bLuk, bStr, bSpeedRate - for a full list, see the -values starting with 'b' in 'db/constants.conf'). +'doc/constants.md' under 'Bonuses / Parameter IDs'). *petrecovery(<status type>, <delay>) This command will make the pet cure a specified status condition. The curing actions will occur once every <delay> seconds. For a full list of -status conditions that can be cured, see the list of 'SC_' status -condition constants in 'db/constants.conf' +status conditions that can be cured, see the list of 'Status Changes' status +condition constants in 'doc/constants.md' *petloot(<max items>) @@ -8698,7 +8744,7 @@ Each of these can be 'on' or 'off'. Together they define a cell's behavior. This command lets you alter these flags for all map cells in the specified (x1,y1)-(x2,y2) rectangle. 'type' defines which flag to modify. Possible options include cell_walkable, -cell_shootable, cell_basilica. For a full list, see constants.conf. +cell_shootable, cell_basilica. For a full list, see 'doc/constants.md'. 'flag' can be false (clear flat) or true (set flag). Example: @@ -8735,7 +8781,7 @@ remove a nonwalkable row of cells after the barricade mobs. This command will return true or false, depending on whether the specified cell has the 'type' flag set or not. There are various types to check, all mimicking the server's cell_chk enumeration. The types can be found in -db/constants.conf. +'doc/constants.md' under 'Cell checks'. The meaning of the individual types can be confusing, so here's an overview: @@ -9365,10 +9411,11 @@ supported types: values QINFO_SEX: sex QINFO_BASE_LEVEL: min, max QINFO_JOB_LEVEL: min, max - QINFO_ITEM: item_id, amount // append to the items list on each use + QINFO_ITEM: item_id, min amount, max amount // append to the items list on each use QINFO_HOMUN_LEVEL: min QINFO_HOMUN_TYPE: homunculus_type (0 - regular, 1 - evolved, 2 - S) QINFO_QUEST: quest_id, state // append to the quests list on each use + QINFO_MERCENARY_CLASS: mercenary_class --------------------------------------- @@ -9976,9 +10023,9 @@ Applicable Data Types (available as constants) - 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 constants.conf for Unit AI Types) - UDT_SCOPTION: Status Options. (see constants.conf for Unit Option Types) - UDT_SEX: Gender of the unit. (see constants.conf for Genders) + 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) @@ -10041,9 +10088,9 @@ Applicable Data types (available as constants) - 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 constants.conf for Unit AI Types) - UDT_SCOPTION: Status Options. (see constants.conf for Unit Option Types) - UDT_SEX: Gender of the unit. (see constants.conf for Genders) + 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) @@ -10155,3 +10202,56 @@ the available flags are: Opens the styling shop on client --------------------------------------- + +*msgtable(<message_id>{, <color>}) + +Show in client message by <message_id> from msg string table +with optional <color>. + +--------------------------------------- + +*msgtable2(<message_id>, <param>{, <color>}) + +Show in client message by <message_id> from msg string table. +<param> is parameter for this message. Can be string or int. +Optional <color> can be used for set color for whole message. + +--------------------------------------- + +*camerainfo() + +Show or hide camera info window. +Works for 20160525 clients or newer. + +--------------------------------------- + +*changecamera(<range>, <rotation>, <latitude>{, <target>}) + +Change camera range, rotation, latitude. +The optional target parameter specifies who will get changed +camera. +Works for 20160525 clients or newer. + +--------------------------------------- + +*achievement_progress(<ach_id>, <obj_idx>, <progress>, <incremental>{, <account_id>}); + +Make the player progress in the specified achievement. +aid - achievement ID +obj_idx - achievement objective index. +progress - objective progress towards goal. +incremental - (boolean) true to add the progress towards the goal, + false to use the progress only as a comparand. +account_id - (optional) AID to perform on (default to attached player). + +returns progress on success and false on failure + +--------------------------------------- + +*itempreview(<index>) + +Update already opened preview window with item from + inventory with given index. +Works for 20181017 RE and main clients or newer. + +--------------------------------------- |