diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/atcommands.txt | 20 | ||||
-rw-r--r-- | doc/constants.md | 181 | ||||
-rw-r--r-- | doc/mob_db.txt | 68 | ||||
-rw-r--r-- | doc/option_drop_group.md | 97 | ||||
-rw-r--r-- | doc/script_commands.txt | 424 |
5 files changed, 562 insertions, 228 deletions
diff --git a/doc/atcommands.txt b/doc/atcommands.txt index b455d9151..dd8ad0969 100644 --- a/doc/atcommands.txt +++ b/doc/atcommands.txt @@ -692,9 +692,23 @@ Repairs all broken items in your inventory. --------------------------------------- -@dropall - -Drops all inventory and equipped items onto the floor. +@dropall {<item type>} + +Drops all items based on the item type. + +Valid item types: + -1 = All Items (default) + 0 = Healing Items + 2 = Useable Items + 3 = Etc Items + 4 = Weapons + 5 = Armors + 6 = Cards + 7 = Pet Eggs + 8 = Pet Armors + 10 = Ammunition Items + 11 = Delayed-Consumable Items + 18 = Cash Items --------------------------------------- diff --git a/doc/constants.md b/doc/constants.md index 8b3acbfdf..835b49036 100644 --- a/doc/constants.md +++ b/doc/constants.md @@ -1407,13 +1407,13 @@ - `e_panic`: 79 - `e_whisp`: 80 -### petstat +### petstat - deprecated, use *getpetinfo -- `PET_CLASS`: 1 -- `PET_NAME`: 2 -- `PET_LEVEL`: 3 -- `PET_HUNGRY`: 4 -- `PET_INTIMATE`: 5 +- `PET_CLASS`: 1 **(DEPRECATED)** +- `PET_NAME`: 2 **(DEPRECATED)** +- `PET_LEVEL`: 3 **(DEPRECATED)** +- `PET_HUNGRY`: 4 **(DEPRECATED)** +- `PET_INTIMATE`: 5 **(DEPRECATED)** ### getmonsterinfo @@ -3762,66 +3762,6 @@ - `SEX_MALE`: 1 - `SEX_ANY`: 2 -### Script Unit Data Types - -- `UDT_TYPE`: 0 -- `UDT_SIZE`: 1 -- `UDT_LEVEL`: 2 -- `UDT_HP`: 3 -- `UDT_MAXHP`: 4 -- `UDT_SP`: 5 -- `UDT_MAXSP`: 6 -- `UDT_MASTERAID`: 7 -- `UDT_MASTERCID`: 8 -- `UDT_MAPIDXY`: 9 -- `UDT_WALKTOXY`: 10 -- `UDT_SPEED`: 11 -- `UDT_MODE`: 12 -- `UDT_AI`: 13 -- `UDT_SCOPTION`: 14 -- `UDT_SEX`: 15 -- `UDT_CLASS`: 16 -- `UDT_HAIRSTYLE`: 17 -- `UDT_HAIRCOLOR`: 18 -- `UDT_HEADBOTTOM`: 19 -- `UDT_HEADMIDDLE`: 20 -- `UDT_HEADTOP`: 21 -- `UDT_CLOTHCOLOR`: 22 -- `UDT_SHIELD`: 23 -- `UDT_WEAPON`: 24 -- `UDT_LOOKDIR`: 25 -- `UDT_CANMOVETICK`: 26 -- `UDT_STR`: 27 -- `UDT_AGI`: 28 -- `UDT_VIT`: 29 -- `UDT_INT`: 30 -- `UDT_DEX`: 31 -- `UDT_LUK`: 32 -- `UDT_ATKRANGE`: 33 -- `UDT_ATKMIN`: 34 -- `UDT_ATKMAX`: 35 -- `UDT_MATKMIN`: 36 -- `UDT_MATKMAX`: 37 -- `UDT_DEF`: 38 -- `UDT_MDEF`: 39 -- `UDT_HIT`: 40 -- `UDT_FLEE`: 41 -- `UDT_PDODGE`: 42 -- `UDT_CRIT`: 43 -- `UDT_RACE`: 44 -- `UDT_ELETYPE`: 45 -- `UDT_ELELEVEL`: 46 -- `UDT_AMOTION`: 47 -- `UDT_ADELAY`: 48 -- `UDT_DMOTION`: 49 -- `UDT_HUNGER`: 50 -- `UDT_INTIMACY`: 51 -- `UDT_LIFETIME`: 52 -- `UDT_MERC_KILLCOUNT`: 53 -- `UDT_STATADD`: 54 -- `UDT_ROBE`: 55 -- `UDT_BODY2`: 56 - ### HatEffect Constants - `HAT_EF_BLOSSOM_FLUTTERING`: 1 @@ -3989,8 +3929,12 @@ - `MAX_BG_MEMBERS`: 30 - `MAX_CHAT_USERS`: 20 - `MAX_REFINE`: 20 +- `MAX_ITEM_ID`: 65535 - `MAX_MENU_OPTIONS`: 255 - `MAX_MENU_LENGTH`: 2048 +- `MOB_CLONE_START`: 4001 +- `MOB_CLONE_END`: 5000 +- `MAX_NPC_PER_MAP`: 512 ### status options @@ -4258,6 +4202,16 @@ - `MAPINFO_SIZE_X`: 2 - `MAPINFO_SIZE_Y`: 3 - `MAPINFO_ZONE`: 4 +- `MAPINFO_NPC_COUNT`: 5 + +### consolemes options + +- `CONSOLEMES_DEBUG`: 0 +- `CONSOLEMES_ERROR`: 1 +- `CONSOLEMES_WARNING`: 2 +- `CONSOLEMES_INFO`: 3 +- `CONSOLEMES_STATUS`: 4 +- `CONSOLEMES_NOTICE`: 5 ### set/getiteminfo options @@ -4280,6 +4234,34 @@ - `ITEMINFO_VIEWSPRITE`: 16 - `ITEMINFO_TRADE`: 17 +### getmercinfo options + +- `MERCINFO_ID,`: 0 +- `MERCINFO_CLASS`: 1 +- `MERCINFO_NAME`: 2 +- `MERCINFO_FAITH`: 3 +- `MERCINFO_CALLS`: 4 +- `MERCINFO_KILLCOUNT`: 5 +- `MERCINFO_LIFETIME`: 6 +- `MERCINFO_LEVEL`: 7 +- `MERCINFO_GID`: 8 + +### getpetinfo options + +- `PETINFO_ID`: 0 +- `PETINFO_CLASS`: 1 +- `PETINFO_NAME`: 2 +- `PETINFO_INTIMACY`: 3 +- `PETINFO_HUNGRY`: 4 +- `PETINFO_RENAME`: 5 +- `PETINFO_GID`: 6 +- `PETINFO_EGGITEM`: 7 +- `PETINFO_FOODITEM`: 8 +- `PETINFO_ACCESSORYITEM`: 9 +- `PETINFO_ACCESSORYFLAG`: 10 +- `PETINFO_EVO_EGGID`: 11 +- `PETINFO_AUTOFEED`: 12 + ### monster skill states - `MSS_ANY`: -1 @@ -4415,6 +4397,67 @@ - `NST_CUSTOM`: 3 - `NST_BARTER`: 4 +### script unit data types + +- `UDT_TYPE`: 0 +- `UDT_SIZE`: 1 +- `UDT_LEVEL`: 2 +- `UDT_HP`: 3 +- `UDT_MAXHP`: 4 +- `UDT_SP`: 5 +- `UDT_MAXSP`: 6 +- `UDT_MASTERAID`: 7 +- `UDT_MASTERCID`: 8 +- `UDT_MAPIDXY`: 9 **(DEPRECATED)** +- `UDT_WALKTOXY`: 10 **(DEPRECATED)** +- `UDT_SPEED`: 11 +- `UDT_MODE`: 12 +- `UDT_AI`: 13 +- `UDT_SCOPTION`: 14 +- `UDT_SEX`: 15 +- `UDT_CLASS`: 16 +- `UDT_HAIRSTYLE`: 17 +- `UDT_HAIRCOLOR`: 18 +- `UDT_HEADBOTTOM`: 19 +- `UDT_HEADMIDDLE`: 20 +- `UDT_HEADTOP`: 21 +- `UDT_CLOTHCOLOR`: 22 +- `UDT_SHIELD`: 23 +- `UDT_WEAPON`: 24 +- `UDT_LOOKDIR`: 25 +- `UDT_CANMOVETICK`: 26 +- `UDT_STR`: 27 +- `UDT_AGI`: 28 +- `UDT_VIT`: 29 +- `UDT_INT`: 30 +- `UDT_DEX`: 31 +- `UDT_LUK`: 32 +- `UDT_ATKRANGE`: 33 +- `UDT_ATKMIN`: 34 +- `UDT_ATKMAX`: 35 +- `UDT_MATKMIN`: 36 +- `UDT_MATKMAX`: 37 +- `UDT_DEF`: 38 +- `UDT_MDEF`: 39 +- `UDT_HIT`: 40 +- `UDT_FLEE`: 41 +- `UDT_PDODGE`: 42 +- `UDT_CRIT`: 43 +- `UDT_RACE`: 44 +- `UDT_ELETYPE`: 45 +- `UDT_ELELEVEL`: 46 +- `UDT_AMOTION`: 47 +- `UDT_ADELAY`: 48 +- `UDT_DMOTION`: 49 +- `UDT_HUNGER`: 50 +- `UDT_INTIMACY`: 51 +- `UDT_LIFETIME`: 52 +- `UDT_MERC_KILLCOUNT`: 53 +- `UDT_STATPOINT`: 54 +- `UDT_ROBE`: 55 +- `UDT_BODY2`: 56 +- `UDT_GROUP`: 57 + ### Renewal - `RENEWAL`: 1 @@ -17854,6 +17897,12 @@ - `Chest_Of_Death`: 22679 - `Solo_Christmas_Gift`: 22685 - `Solo_Cookie`: 22686 +- `STR_Soul_Potion`: 22702 +- `AGI_Soul_Potion`: 22703 +- `VIT_Soul_Potion`: 22704 +- `INT_Soul_Potion`: 22705 +- `DEX_Soul_Potion`: 22706 +- `LUK_Soul_Potion`: 22707 - `Bullet_Case_Blood_`: 22737 - `Bullet_Case_Silver_`: 22738 - `Sphere_Case_Wind_`: 22739 diff --git a/doc/mob_db.txt b/doc/mob_db.txt index 29d2ab465..d62181048 100644 --- a/doc/mob_db.txt +++ b/doc/mob_db.txt @@ -63,10 +63,14 @@ mob_db: ( MvpExp: mvp experience (int, defaults to 0) MvpDrops: { AegisName: chance (string: int) + // or + AegisName: (chance, "Option Drop Group") // ... } Drops: { - AegisName: chance (string: int) + AegisName: chance (string: int) + // or + AegisName: (chance, "Option Drop Group") // ... } }, @@ -199,21 +203,55 @@ MvpExp: Base Experience given by the monster to the player who inflict more atta MvpDrops: Sets monster mvp drops list. Requires to have MvpExp to trigger. - Accepted values are AegisName as defined on item_db.conf and a chance. + There are two ways to define a drop: + 1) The first one is used for simple drops and uses the item AegisName + as defined on item_db.conf and a chance. + Format: + AegisName: chance Chance is an integer from 1 to 10000 (10000 = 100%). - Required format: - MvpDrops: { - AegisName: chance - // ... - } - When not specified, becomes false. + + 2) The second way to define a drop allows setting a random option drop + group to be used by this drop. + Format: + AegisName: (chance, "Option Drop Group") + + The item drop chance refers to the chance of dropping this item, same as chance in the first option. + the "Option Drop Group" parameter refers to an entry on option_drop_group database file. The specified + entry will be used when this item is dropped in order to add random options to the dropped equipment. + + A monster drop list may use both format for different items. + Required Format: + Drops: { + AegisName: chance + // or + AegisName: (chance, "Option Drop Group") + } + + When not specified, becomes false (no drops). Drops: Sets monster drops list. - Accepted values are AegisName as defined on item_db.conf and a chance. + There are two ways to define a drop: + 1) The first one is used for simple drops and uses the item AegisName + as defined on item_db.conf and a chance. + Format: + AegisName: chance Chance is an integer from 1 to 10000 (10000 = 100%). - Required format: - Drops: { - AegisName: chance - // ... - } - When not specified, becomes false. + + 2) The second way to define a drop allows setting a random option drop + group to be used by this drop. + Format: + AegisName: (chance, "Option Drop Group") + + The item drop chance refers to the chance of dropping this item, same as chance in the first option. + the "Option Drop Group" parameter refers to an entry on option_drop_group database file. The specified + entry will be used when this item is dropped in order to add random options to the dropped equipment. + + A monster drop list may use both format for different items. + Required Format: + Drops: { + AegisName: chance + // or + AegisName: (chance, "Option Drop Group") + } + + When not specified, becomes false (no drops). diff --git a/doc/option_drop_group.md b/doc/option_drop_group.md new file mode 100644 index 000000000..325cf9fe2 --- /dev/null +++ b/doc/option_drop_group.md @@ -0,0 +1,97 @@ +# Option Drop Group Database + +## Description +Explanation of the `db/option_drop_groups.conf` file and structure. + +This database file allows the creation of groups of random options +that will be added to certain equipments when dropped. After creating +a group in this database file, you may set up drops in `mob_db` to use +it in order to get items with these options. For more information on +adding option drop groups to `mob_db`, check `doc/mob_db.txt` documentation file. + +Each item may have up to `MAX_ITEM_OPTION` options at the same time, +in this document, each of these independent options will be called +`option slot`. One drop group will define the possibilities of random +options for each of these slots. + +## Entries Format + +``` +<Group Name Constant>: ( + { // Option Slot 1 + Rate: (int) chance of filling option slot 1 (100 = 1%) + + // Possible options for slot 1 + // min/max value : int, defaults to 0 + // chance : int, 100 = 1% if not set, will be 100%/number of possibiltiies + OptionName: value + // or + OptionName: [min value, max value] + // or + OptionName: [min value, max value, chance] + // ... (as many as you want) + }, + // ... (up to MAX_ITEM_OPTION) +), +``` + +### `Group Name Constant` +This is the group name, it is how this group is referenced in other files +(e.g. mob_db). It must be globally unique, as it is a server constant, and +must contain only letters, numbers and " _ ". + +### `Rate` +This is the chance of this option slot to drop. In other words, this is the +chance of getting this slot filled with something, where something is given +by the list of `OptionName` that follows. + +Rate is an integer value where 100 means 1%. + +### `OptionName` +Adds `OptionName` as one option that may fill this slot when it drops. + +The details of this option may be specified in one of 3 ways: + +#### `OptionName: value` +The chance of this option being picked is auto calculated (see below), +and if this option is chosen, its value will be `value`. + +#### `OptionName: [min, max]` +The chance of this option being picked is auto calculated (see below), +and if this option is chosen, its value will be a random integer between +`min` and `max` (both included). + +#### `OptionName: [min, max, chance]` +The chance of this option being picked is `chance`, and if this option is chosen, +its value will be a random integer between `min` and `max` (both included). + +#### Auto calculated chances +When chance is not specified in an option, it will be auto calculated by +the server as being `100%/num`, when `num` is the number of possibilities +in this option slot. + +For example, if you specify 3 possible options, all of them without +a `chance` defined, all of them will have 33.33% chance of being +picked (100%/3). If you set the chance of one of them to 50%, you +will have one option with 50% chance, and each of the others with +33.33% chance. + +## Example +``` +MYITEM: ( + { // Option Slot 1 + Rate: 10000 // It has 100% of chance of being filled + + // This slot may have one of the following options: + WEAPON_ATTR_WIND: 5, // WEAPON_ATTR_WIND Lv5 (33.33%) + WEAPON_ATTR_GROUND: [2, 4] // WEAPON_ATTR_GROUND Lv 2~4 (33.33%) + WEAPON_ATTR_POISON: [1, 4, 8000] // WEAPON_ATTR_POISON Lv 1~4 (80%) + }, + { // Option Slot 2 + Rate: 5000 // It has 50% of chance of being filled + + // If filled, may have one of the following options: + WEAPON_ATTR_WATER: 4 // WEAPON_ATTR_WATER Lv4 (100%) + } +) +``` diff --git a/doc/script_commands.txt b/doc/script_commands.txt index 065b75c2b..bdcc11712 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 @@ -716,8 +716,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'. @@ -1228,7 +1231,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 +1255,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 +1301,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 @@ -3113,6 +3139,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 +3152,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 @@ -3383,11 +3411,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 +3558,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'. @@ -3831,26 +3861,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: - - 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. +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: -If the invoking player doesn't own a pet, this command will return -"null" for type 2, and return 0 for other types. + 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 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 +3902,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>) @@ -4441,11 +4482,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 --------------------------------------- @@ -6102,7 +6146,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 @@ -6360,7 +6404,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) @@ -6511,7 +6555,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 @@ -6533,6 +6577,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 @@ -6621,6 +6673,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. @@ -7765,6 +7828,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. @@ -7778,6 +7845,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 @@ -8490,6 +8580,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. @@ -9644,6 +9746,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. @@ -9775,6 +9882,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). @@ -9864,17 +9973,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. --------------------------------------- //===================================== @@ -10061,131 +10171,129 @@ 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_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) (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. + 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 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_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) (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_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 returns -1 if value could not be retrieved. @@ -10389,3 +10497,31 @@ 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 + +--------------------------------------- |