summaryrefslogtreecommitdiff
path: root/doc/script_commands.txt
diff options
context:
space:
mode:
Diffstat (limited to 'doc/script_commands.txt')
-rw-r--r--doc/script_commands.txt212
1 files changed, 141 insertions, 71 deletions
diff --git a/doc/script_commands.txt b/doc/script_commands.txt
index 146e58a45..f5fdab851 100644
--- a/doc/script_commands.txt
+++ b/doc/script_commands.txt
@@ -1030,6 +1030,12 @@ The above also applies to, the last three labels, the only difference is
that these labels are used exclusively for WoE SE, and are called
independently.
+OnInstanceInit:
+
+This label will be executed when an instance is created and initialized through
+the 'instance_init' command. It will run again if @reloadscript is used while
+an instance is in progress.
+
OnTouch:
This label will be executed if a trigger area is defined for the NPC
@@ -2771,6 +2777,7 @@ See 'getequipid' for a full list of valid equipment slots.
Given the database ID number of an item, this function will return the
text stored in the 'japanese name' field (which, in Hercules, stores an
English name the players would normally see on screen).
+Return "null" if no such item exist.
---------------------------------------
@@ -3162,20 +3169,12 @@ invoking player belongs.
---------------------------------------
-*gettimetick(<tick type>)
-
-This function will return the system time in UNIX epoch time (if tick type
-is 2) or the time since the start of the current day in seconds if tick
-type is 1.
-Passing 0 will make it return the server's tick, which is a measurement in
-milliseconds used by the server's timer system. The server's tick is an
-unsigned int which loops every ~50 days.
+*gettimetick(<type>)
-Just in case you don't know, UNIX epoch time is the number of seconds
-elapsed since 1st of January 1970, and is useful to see, for example,
-for how long the character has been online with OnPCLoginEvent and
-OnPCLogoutEvent, which could allow you to make an 'online time counted for
-conviction only' jail script.
+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)
---------------------------------------
@@ -3183,18 +3182,27 @@ conviction only' jail script.
This function returns specified information about the current system time.
-1 - Seconds (of a minute)
-2 - Minutes (of an hour)
-3 - Hour (of a day)
-4 - Week day (0 for Sunday, 6 is Saturday)
-5 - Day of the month.
-6 - Number of the month.
-7 - Year.
-8 - Day of the year.
-
-It will only return numbers.
-
- if (gettime(4)==6) mes "It's a Saturday. I don't work on Saturdays.";
+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.";
+ }
---------------------------------------
@@ -3240,6 +3248,8 @@ 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>})
@@ -3538,29 +3548,29 @@ 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 const.txt:
- MOB_NAME 0
- MOB_LV 1
- MOB_MAXHP 2
- MOB_BASEEXP 3
- MOB_JOBEXP 4
- MOB_ATK1 5
- MOB_ATK2 6
- MOB_DEF 7
- MOB_MDEF 8
- MOB_STR 9
- MOB_AGI 10
- MOB_VIT 11
- MOB_INT 12
- MOB_DEX 13
- MOB_LUK 14
- MOB_RANGE 15
- MOB_RANGE2 16
- MOB_RANGE3 17
- MOB_SIZE 18
- MOB_RACE 19
- MOB_ELEMENT 20
- MOB_MODE 21
- MOB_MVPEXP 22
+ MOB_NAME 0
+ MOB_LV 1
+ MOB_MAXHP 2
+ MOB_BASEEXP 3
+ MOB_JOBEXP 4
+ MOB_ATK1 5
+ MOB_ATK2 6
+ MOB_DEF 7
+ MOB_MDEF 8
+ MOB_STR 9
+ MOB_AGI 10
+ MOB_VIT 11
+ MOB_INT 12
+ MOB_DEX 13
+ MOB_LUK 14
+ MOB_RANGE 15
+ MOB_RANGE2 16
+ MOB_RANGE3 17
+ MOB_SIZE 18
+ MOB_RACE 19
+ MOB_ELEMENT 20
+ MOB_MODE 21
+ MOB_MVPEXP 22
Check sample in doc/sample/getmonsterinfo.txt
@@ -4457,6 +4467,14 @@ they will also have their skills reset upon 'changesex'.
---------------------------------------
+*changecharsex;
+
+This command is exactly same as changesex, with an exception that,
+character sex will be changed instead of account sex.
+Requires client 2014-10-22 or greater.
+
+---------------------------------------
+
*getexp <base xp>,<job xp>;
This command will give the invoking character a specified number of base
@@ -4985,8 +5003,8 @@ Returns the item_id of a random item picked from the item container specified. T
are different item containers and they are specified in 'db/(pre-)re/item_group.conf'.
Example:
- getitem groupranditem 603,1;
- getitem groupranditem Old_Blue_Box,1;
+ getitem groupranditem(603),1;
+ getitem groupranditem(Old_Blue_Box),1;
---------------------------------------
@@ -5292,6 +5310,15 @@ Example:
---------------------------------------
+*mergeitem;
+
+mergeitem opens the item merge window,
+The Item merge window shows all stackable item(same ItemID) with different
+serial, that can be merged into one stack.
+Check sample: npc/other/item_merge.txt
+
+---------------------------------------
+
*delequip <equipment slot>;
This command will destroy whatever is currently equipped in the invoking
@@ -6499,8 +6526,8 @@ Example 4:
---------------------------------------
-*sleep {<milliseconds>};
-*sleep2 {<milliseconds>};
+*sleep <milliseconds>;
+*sleep2 <milliseconds>;
*awake "<NPC name>";
These commands are used to control the pause of a NPC.
@@ -7552,7 +7579,7 @@ OnClock0600:
end;
OnInit:
// setting correct mode upon server start-up
- if(gettime(3)>=6 && gettime(3)<18) end;
+ if (gettime(GETTIME_HOUR) >= 6 && gettime(GETTIME_HOUR) < 18) end;
OnClock1800:
night;
end;
@@ -8793,18 +8820,48 @@ following:
----------------------------------------
-*bg_getareausers(<battle group>,<map name>,<x0>,<y0>,<x1>,<y1>);
+*bg_getareausers(<battle group>,"<map_name>",<x0>,<y0>,<x1>,<y1>);
Retrieves amount of players belonging to given battle group on given map
within an specified rectangular area.
----------------------------------------
-*bg_updatescore "<mapname>",<Guillaume Score>,<Croix Score>;
+*bg_updatescore "<map_name>",<Guillaume Score>,<Croix Score>;
This command will force the update of the displayed scoreboard.
It is only usable when the map is defined as a Type 2 Battleground:
-mapflag%TAB%<mapname>%TAB%battleground%TAB%2
+mapflag%TAB%<map_name>%TAB%battleground%TAB%2
+
+----------------------------------------
+
+*bg_create_team "<map_name>",<Respawn X>,<Respawn Y>;
+
+This command will create a new BG Team.
+When player dies, they will be respawned map_name,X,Y as mentioned.
+
+Command will return -1 if BG Creation is failed,
+else it will return the BG ID(Also known as TeamID).
+
+----------------------------------------
+
+*bg_join_team <Team_ID>{,<account_id>};
+
+This command will make the attached player join to Team with ID as mentioned.
+If account_id is provided, command will look for that player, instead of the attached player.
+
+Command will return -1 if Player is not found, 0 if join is failed, 1 upon successful.
+
+----------------------------------------
+
+*bg_match_over "<Arena Name>"{,<Cancelled>};
+
+This command will end the battleground Arena
+(Arena Name as referred to, in conf/battlegrounds.conf)
+If Cancelled is not provided, it will set the join delay, as mentioned in conf/battlegrounds.conf
+else, it will just destroy the Teams and queue's.
+
+Command will return 0 when successful, else it will return 1.
---------------------------------------
//=====================================
@@ -8908,17 +8965,21 @@ Returns the amount of entries in the queue instance of <queue_id>.
---------------------------------------
-*queueadd(<queue_id>,<var_id>);
+*queueadd(<queue_id>, <var_id>);
+
+Adds <var_id> to queue of <queue_id>.
-Adds <var_id> to queue of <queue_id>, returning 1 if <var_id> is already
-present in the queue, otherwise returning 0.
+Returns false if <var_id> couldn't be added (was already present in the queue),
+true otherwise.
---------------------------------------
-*queueremove(<queue_id>,<var_id>);
+*queueremove(<queue_id>, <var_id>);
-Removes <var_id> from queue of <queue_id>, returning 1 if <var_id> is not
-present in the queue, otherwise returning 0.
+Removes <var_id> from queue of <queue_id>.
+
+Returns false if <var_id> couldn't be removed (wasn't present in the queue),
+true otherwise.
---------------------------------------
@@ -8928,20 +8989,26 @@ Modifies <queue_id>'s <optionType>. When <option val> is not present
<optionType> is removed from <queue_id>. When present it modifies
<queue_id>'s <optionType> with the new <option val> value.
+Returns true on success, false on failure.
+
Currently 3 options are available:
-HQO_OnDeath (1), HQO_OnLogout (2), HQO_OnMapChange (3)
+- QUEUEOPT_DEATH (1)
+- QUEUEOPT_LOGOUT (2)
+- QUEUEOPT_MAPCHANGE (3)
-Note: The constant names are not final.
+When the QUEUEOPT_MAPCHANGE event is triggered, it sets a temp char var
+@Queue_Destination_Map$ with the destination map name.
Example:
- queueopt(.@queue_id,0,"MyNPC::MyOnQueueMemberDeathEventName");
+ queueopt(.@queue_id, QUEUEOPT_DEATH, "MyNPC::MyOnQueueMemberDeathEventName");
---------------------------------------
*queuedel(<queue_id>);
-Deletes <queue_id> and returns 1 when <queue_id> is not found, otherwise
-0 is returned.
+Deletes the queue <queue_id>.
+
+Returns false if the queue wasn't found, true otherwise.
---------------------------------------
@@ -8955,8 +9022,10 @@ even if you remove them from the queue.
---------------------------------------
*qicheck(<queue_iterator_id>);
-checks whether there is a next member in the iterator's queue, 1 when
-it does, 0 otherwise.
+
+Checks whether the current member in the iterator's queue exists.
+
+Returns 1 when it does, 0 otherwise.
---------------------------------------
@@ -8974,8 +9043,9 @@ Example:
*qiclear(<queue_iterator_id>);
-Deletes a queue iterator from memory and returns 1 when it fails,
-otherwise 0 is returned.
+Deletes a queue iterator from memory.
+
+Returns false when it fails, otherwise 1 is returned.
---------------------------------------
//=====================================