diff options
author | Jesusaves <cpntb1@ymail.com> | 2018-05-31 22:23:29 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2018-05-31 22:23:29 -0300 |
commit | dfec4146ad7989702a29bfd186cd086276863704 (patch) | |
tree | c62d9e9d7a34caee34bfb596057cb6abd01fee10 /server/scripts/script_commands.txt | |
parent | 8e0153903dc7a3d98914a909aaf253f65bb16940 (diff) | |
download | docs-dfec4146ad7989702a29bfd186cd086276863704.tar.gz docs-dfec4146ad7989702a29bfd186cd086276863704.tar.bz2 docs-dfec4146ad7989702a29bfd186cd086276863704.tar.xz docs-dfec4146ad7989702a29bfd186cd086276863704.zip |
Move stuff around
Diffstat (limited to 'server/scripts/script_commands.txt')
-rw-r--r-- | server/scripts/script_commands.txt | 549 |
1 files changed, 276 insertions, 273 deletions
diff --git a/server/scripts/script_commands.txt b/server/scripts/script_commands.txt index 1744a7e..bfb6c95 100644 --- a/server/scripts/script_commands.txt +++ b/server/scripts/script_commands.txt @@ -3304,278 +3304,6 @@ enable (true) or disable (false) the effect on the player. //===================================== --------------------------------------- -*getmapxy("<variable for map name>", <variable for x>, <variable for y>, <type>{, "<search parameter>"}) - -This function will locate a character object, NPC object or pet's -coordinates and place their coordinates into the variables specified when -calling it. It will return 0 if the search was successful, and -1 if the -parameters given were not variables or the search was not successful. - -Type is the type of object to search for: - - UNITTYPE_PC - Character object - UNITTYPE_NPC - NPC object - UNITTYPE_PET - Pet object - UNITTYPE_MOB - Monster object - UNITTYPE_HOM - Homunculus object - UNITTYPE_MER - Mercenary object - UNITTYPE_ELEM - Elemental object - -To look for a monster object, monster GID is required. The function will -always return -1 when search using string. - -The search parameter is optional. If it is not specified, the location of the -invoking character will always be returned for UNITTYPE_PC, the location of the -NPC running this function for UNITTYPE_NPC. If a search parameter is specified, -for UNITTYPE_PC and UNITTYPE_NPC, the character or NPC with the specified name -or GID will be located. - -If type is UNITTYPE_PET, UNITTYPE_HOM, UNITTYPE_MER or UNITTYPE_ELEM the search -will locate the owner's pet/homun/mercenary/elementals if the search parameter -is not provided. It will NOT locate these object by name, but can be done if GID -is provided. - -What a mess. Example, a working and tested one now: - - prontera,164,301,3%TAB%script%TAB%Meh%TAB%730,{ - mes("My name is Meh. I'm here so that Nyah can find me."); - close(); - } - - prontera,164,299,3%TAB%script%TAB%Nyah%TAB%730,{ - mes("My name is Nyah."); - mes("I will now search for Meh all across the world!"); - if (getmapxy(.@mapname$, .@mapx, .@mapy, UNITTYPE_NPC, "Meh") != 0) { - mes("I can't seem to find Meh anywhere!"); - close(); - } - mes("And I found him on map "+.@mapname$+" at X:"+.@mapx+" Y:"+.@mapy+" !"); - close(); - } - -Notice that NPC objects disabled with disablenpc() will still be located. - ---------------------------------------- - -*getmapinfo(<info>{, "<map name>"}) -*getmapinfo(<info>{, <map id>}) - -This command returns various information about a specific map. If the second -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) - -Examples: - getmapinfo(MAPINFO_ID, "map name"); // ID from name - getmapinfo(MAPINFO_NAME, 3); // name from ID - getmapinfo(MAPINFO_ZONE); // zone, ie Normal, PvP, Jail, ... - ---------------------------------------- - -*getunits(<type>, <variable>, <limit>, "<map>"{, <x1>, <y1>, <x2>, <y2>}) - -This function searches a whole map or area for units and adds their GID to -the provided <variable> array. It filters units by <type> and stops searching -after <limit> units have been found. Set <limit> to false (0) if you wish to -disable the limit altogether. - -Type is the type of unit to search for: - - BL_PC - Character object - BL_MOB - Monster object - BL_PET - Pet object - BL_HOM - Homunculus object - BL_MER - Mercenary object - BL_ITEM - Item object (item drops) - BL_SKILL - Skill object (skill fx & sfx) - BL_NPC - NPC object - BL_CHAT - Chat object - BL_ELEM - Elemental object - BL_CHAR - Shorthand for (BL_PC|BL_MOB|BL_HOM|BL_MER|BL_ELEM) - BL_ALL - Any kind of object - -** Do NOT use UNITTYPE_ constants here, they have different values. - -Example: - - .@count = getunits((BL_PC | BL_NPC), .@units, false, "prontera"); - -The above example would search the map "prontera" for all PC and NPC units and -add them to the .@units array, while setting .@count to the amount of units -added to the array (useful in for() loops). - ---------------------------------------- - -*getgmlevel() - -This function will return the (GM) level of player group the account to -which the invoking character belongs. If this is somehow executed from a -console command, 99 will be returned, and 0 will be returned if the -account has no GM level. - -This allows you to make NPC's only accessible for certain GM levels, or -behave specially when talked to by GMs. - - if (getgmlevel() > 0) - mes("What is your command, your godhood?"); - if (getgmlevel() < 99) - end; - ---------------------------------------- - -*setgroupid(<new group id>{, "<character name>"|<account id>}) - -This function will temporary adjust the id of player group the account to which the -player specified if the new group id is available. -Return true if successful, otherwise it will return false. - ---------------------------------------- - -*getgroupid({<account id>}) - -This command returns the id of the group of the attached or specified player. -If the player is not found, returns -1. - ---------------------------------------- - -*gettimetick(<type>) - -Valid types are : - 0 - server's tick (milleseconds), unsigned int, loops every ~50 days - 1 - time since the start of the current day in seconds - 2 - UNIX epoch time (number of seconds elapsed since 1st of January 1970) - ---------------------------------------- - -*gettime(<type>) - -This function returns specified information about the current system time. - -Valid types: - 1 - GETTIME_SECOND - Seconds (of a minute) - 2 - GETTIME_MINUTE - Minutes (of an hour) - 3 - GETTIME_HOUR - Hour (of a day) - 4 - GETTIME_WEEKDAY - Week day (0 for Sunday, 6 is Saturday) - - Additional: SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY - 5 - GETTIME_DAYOFMONTH - Day of the month. - 6 - GETTIME_MONTH - Number of the month. - - Additional: JANUARY, FEBRUARY, MARCH, APRIL, MAY, JUNE, JULY, AUGUST, SEPTEMBER, OCTOBER, NOVEMBER, DECEMBER - 7 - GETTIME_YEAR - Year - 8 - GETTIME_DAYOFYEAR - Day of the year. - -It will only return numbers based on types. -Example : - if (gettime(GETTIME_WEEKDAY) == SATURDAY) { - mes("It's a Saturday. I don't work on Saturdays."); - } else if (gettime(GETTIME_MONTH) == JANUARY) { - mes("It's January. I don't work on January."); - } else if (gettime(GETTIME_MONTH) == OCTOBER && gettime(GETTIME_DAYOFMONTH) == 31) { - mes("It's Halloween."); - } - ---------------------------------------- - -*getcalendartime(<hour>, <minute>{, <day of month>{, <day of week>}}) - -This function returns the timestamp of the next ocurrence of given time. - -Day of Month specifies a day between 1 and 31 in the future, by default its value is -1 (don't use). -Day of Week specifies a day in the week and its valid values are: - 0 - SUNDAY - 1 - MONDAY - 2 - TUESDAY - 3 - WEDNESDAY - 4 - THURSDAY - 5 - FRIDAY - 6 - SATURDAY - -In order to use Day of Week, you must use Day of Month as -1. -If for some reason the command fails, it'll return -1. - -Examples : - getcalendartime(19, 00); // Next 7 pm - getcalendartime(19, 00, 6); // Next day 6 of the month, at 7pm - getcalendartime(19, 10, -1, 1); // Next Monday, at 7:10pm - ---------------------------------------- - -*gettimestr(<format string>, <max length>) - -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 -characters. For a full description see, for example, the description of -'strfmtime' 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)); - -This will print a full date and time like 'YYYY-MM/DD HH:MM:SS'. - ---------------------------------------- - -*getusers(<type>) - -This function will return a number of users on a map or the whole server. -What it returns is specified by Type. - -Type can be one of the following values, which control what is returned: - - 0 - Count of all characters on the map of the invoking character. - 1 - Count of all characters in the entire server. - 8 - Count of all characters on the map of the NPC the script is - running in. - ---------------------------------------- - -*getmapusers("<map name>") - -This function will return the number of users currently located on the -specified map. - -Currently being used in the PVP scripts to check if a PVP room is full of -not, if the number returned it equal to the maximum allowed it will not -let you enter. - -Return -1 if the map name is invalid. - ---------------------------------------- - -*getareausers({"<map name>", }{<x1>, <y1>, <x2>, <y2>}) -*getareausers({"<map name>", }{<radius>}) - -This function will return the count of connected characters which are -located within the specified area. Area can be x1/y1-x2/y2 square, -or radius from npc position. If map name missing, used attached player map. - -This is useful for maps that are split into many buildings, such as all -the "*_in" maps, due to all the shops and houses. - -Examples: - // return players in area npc area on current map. - .@num = getareausers(); - // return players in square (1, 1) - (10, 10) - .@num = "players: " + getareausers(1, 1, 10, 10); - ---------------------------------------- - -*getusersname(); - -This command will give the invoking character a list of names of the -connected characters (including themselves) into an NPC script message -window (see 'mes') paging it by 10 names as if with the next() command. - -You need to put a 'close' after that yourself. --------------------------------------- //===================================== @@ -9019,6 +8747,281 @@ Check getitem2 command for more information of the extra parameters. For examples of usage, see /doc/sample/npc_rodex.txt --------------------------------------- + +*getmapxy("<variable for map name>", <variable for x>, <variable for y>, <type>{, "<search parameter>"}) + +This function will locate a character object, NPC object or pet's +coordinates and place their coordinates into the variables specified when +calling it. It will return 0 if the search was successful, and -1 if the +parameters given were not variables or the search was not successful. + +Type is the type of object to search for: + + UNITTYPE_PC - Character object + UNITTYPE_NPC - NPC object + UNITTYPE_PET - Pet object + UNITTYPE_MOB - Monster object + UNITTYPE_HOM - Homunculus object + UNITTYPE_MER - Mercenary object + UNITTYPE_ELEM - Elemental object + +To look for a monster object, monster GID is required. The function will +always return -1 when search using string. + +The search parameter is optional. If it is not specified, the location of the +invoking character will always be returned for UNITTYPE_PC, the location of the +NPC running this function for UNITTYPE_NPC. If a search parameter is specified, +for UNITTYPE_PC and UNITTYPE_NPC, the character or NPC with the specified name +or GID will be located. + +If type is UNITTYPE_PET, UNITTYPE_HOM, UNITTYPE_MER or UNITTYPE_ELEM the search +will locate the owner's pet/homun/mercenary/elementals if the search parameter +is not provided. It will NOT locate these object by name, but can be done if GID +is provided. + +What a mess. Example, a working and tested one now: + + prontera,164,301,3%TAB%script%TAB%Meh%TAB%730,{ + mes("My name is Meh. I'm here so that Nyah can find me."); + close(); + } + + prontera,164,299,3%TAB%script%TAB%Nyah%TAB%730,{ + mes("My name is Nyah."); + mes("I will now search for Meh all across the world!"); + if (getmapxy(.@mapname$, .@mapx, .@mapy, UNITTYPE_NPC, "Meh") != 0) { + mes("I can't seem to find Meh anywhere!"); + close(); + } + mes("And I found him on map "+.@mapname$+" at X:"+.@mapx+" Y:"+.@mapy+" !"); + close(); + } + +Notice that NPC objects disabled with disablenpc() will still be located. + +--------------------------------------- + +*getmapinfo(<info>{, "<map name>"}) +*getmapinfo(<info>{, <map id>}) + +This command returns various information about a specific map. If the second +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) + +Examples: + getmapinfo(MAPINFO_ID, "map name"); // ID from name + getmapinfo(MAPINFO_NAME, 3); // name from ID + getmapinfo(MAPINFO_ZONE); // zone, ie Normal, PvP, Jail, ... + +--------------------------------------- + +*getunits(<type>, <variable>, <limit>, "<map>"{, <x1>, <y1>, <x2>, <y2>}) + +This function searches a whole map or area for units and adds their GID to +the provided <variable> array. It filters units by <type> and stops searching +after <limit> units have been found. Set <limit> to false (0) if you wish to +disable the limit altogether. + +Type is the type of unit to search for: + + BL_PC - Character object + BL_MOB - Monster object + BL_PET - Pet object + BL_HOM - Homunculus object + BL_MER - Mercenary object + BL_ITEM - Item object (item drops) + BL_SKILL - Skill object (skill fx & sfx) + BL_NPC - NPC object + BL_CHAT - Chat object + BL_ELEM - Elemental object + BL_CHAR - Shorthand for (BL_PC|BL_MOB|BL_HOM|BL_MER|BL_ELEM) + BL_ALL - Any kind of object + +** Do NOT use UNITTYPE_ constants here, they have different values. + +Example: + + .@count = getunits((BL_PC | BL_NPC), .@units, false, "prontera"); + +The above example would search the map "prontera" for all PC and NPC units and +add them to the .@units array, while setting .@count to the amount of units +added to the array (useful in for() loops). + +--------------------------------------- + +*getgmlevel() + +This function will return the (GM) level of player group the account to +which the invoking character belongs. If this is somehow executed from a +console command, 99 will be returned, and 0 will be returned if the +account has no GM level. + +This allows you to make NPC's only accessible for certain GM levels, or +behave specially when talked to by GMs. + + if (getgmlevel() > 0) + mes("What is your command, your godhood?"); + if (getgmlevel() < 99) + end; + +--------------------------------------- + +*setgroupid(<new group id>{, "<character name>"|<account id>}) + +This function will temporary adjust the id of player group the account to which the +player specified if the new group id is available. +Return true if successful, otherwise it will return false. + +--------------------------------------- + +*getgroupid({<account id>}) + +This command returns the id of the group of the attached or specified player. +If the player is not found, returns -1. + +--------------------------------------- + +*gettimetick(<type>) + +Valid types are : + 0 - server's tick (milleseconds), unsigned int, loops every ~50 days + 1 - time since the start of the current day in seconds + 2 - UNIX epoch time (number of seconds elapsed since 1st of January 1970) + +--------------------------------------- + +*gettime(<type>) + +This function returns specified information about the current system time. + +Valid types: + 1 - GETTIME_SECOND - Seconds (of a minute) + 2 - GETTIME_MINUTE - Minutes (of an hour) + 3 - GETTIME_HOUR - Hour (of a day) + 4 - GETTIME_WEEKDAY - Week day (0 for Sunday, 6 is Saturday) + - Additional: SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY + 5 - GETTIME_DAYOFMONTH - Day of the month. + 6 - GETTIME_MONTH - Number of the month. + - Additional: JANUARY, FEBRUARY, MARCH, APRIL, MAY, JUNE, JULY, AUGUST, SEPTEMBER, OCTOBER, NOVEMBER, DECEMBER + 7 - GETTIME_YEAR - Year + 8 - GETTIME_DAYOFYEAR - Day of the year. + +It will only return numbers based on types. +Example : + if (gettime(GETTIME_WEEKDAY) == SATURDAY) { + mes("It's a Saturday. I don't work on Saturdays."); + } else if (gettime(GETTIME_MONTH) == JANUARY) { + mes("It's January. I don't work on January."); + } else if (gettime(GETTIME_MONTH) == OCTOBER && gettime(GETTIME_DAYOFMONTH) == 31) { + mes("It's Halloween."); + } + +--------------------------------------- + +*getcalendartime(<hour>, <minute>{, <day of month>{, <day of week>}}) + +This function returns the timestamp of the next ocurrence of given time. + +Day of Month specifies a day between 1 and 31 in the future, by default its value is -1 (don't use). +Day of Week specifies a day in the week and its valid values are: + 0 - SUNDAY + 1 - MONDAY + 2 - TUESDAY + 3 - WEDNESDAY + 4 - THURSDAY + 5 - FRIDAY + 6 - SATURDAY + +In order to use Day of Week, you must use Day of Month as -1. +If for some reason the command fails, it'll return -1. + +Examples : + getcalendartime(19, 00); // Next 7 pm + getcalendartime(19, 00, 6); // Next day 6 of the month, at 7pm + getcalendartime(19, 10, -1, 1); // Next Monday, at 7:10pm + +--------------------------------------- + +*gettimestr(<format string>, <max length>) + +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 +characters. For a full description see, for example, the description of +'strfmtime' 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)); + +This will print a full date and time like 'YYYY-MM/DD HH:MM:SS'. + +--------------------------------------- + +*getusers(<type>) + +This function will return a number of users on a map or the whole server. +What it returns is specified by Type. + +Type can be one of the following values, which control what is returned: + + 0 - Count of all characters on the map of the invoking character. + 1 - Count of all characters in the entire server. + 8 - Count of all characters on the map of the NPC the script is + running in. + +--------------------------------------- + +*getmapusers("<map name>") + +This function will return the number of users currently located on the +specified map. + +Currently being used in the PVP scripts to check if a PVP room is full of +not, if the number returned it equal to the maximum allowed it will not +let you enter. + +Return -1 if the map name is invalid. + +--------------------------------------- + +*getareausers({"<map name>", }{<x1>, <y1>, <x2>, <y2>}) +*getareausers({"<map name>", }{<radius>}) + +This function will return the count of connected characters which are +located within the specified area. Area can be x1/y1-x2/y2 square, +or radius from npc position. If map name missing, used attached player map. + +This is useful for maps that are split into many buildings, such as all +the "*_in" maps, due to all the shops and houses. + +Examples: + // return players in area npc area on current map. + .@num = getareausers(); + // return players in square (1, 1) - (10, 10) + .@num = "players: " + getareausers(1, 1, 10, 10); + +--------------------------------------- + +*getusersname(); + +This command will give the invoking character a list of names of the +connected characters (including themselves) into an NPC script message +window (see 'mes') paging it by 10 names as if with the next() command. + +You need to put a 'close' after that yourself. + +--------------------------------------- //===================================== 7 - Instance-Related Commands //===================================== @@ -10009,4 +10012,4 @@ Enables the Emblem of the given Clan to the current NPC //===================================== 13 - End of Clan System Related Commands //===================================== ----------------------------------------
\ No newline at end of file +--------------------------------------- |