diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/item_db.txt | 10 | ||||
-rw-r--r-- | doc/sample/npc_test_time.txt | 26 | ||||
-rw-r--r-- | doc/script_commands.txt | 84 | ||||
-rw-r--r-- | doc/woe_time_explanation.txt | 77 |
4 files changed, 103 insertions, 94 deletions
diff --git a/doc/item_db.txt b/doc/item_db.txt index b2afc5612..087725025 100644 --- a/doc/item_db.txt +++ b/doc/item_db.txt @@ -42,13 +42,13 @@ item_db: ( override: GroupID (int, defaults to 100) nodrop: true/false (boolean, defaults to false) notrade: true/false (boolean, defaults to false) - partneroverride: true/false (boolean, defaults to false) - noselltonpc: true/false (boolean, defaults to false) - nocart: true/false (boolean, defaults to false) nostorage: true/false (boolean, defaults to false) - nogstorage: true/false (boolean, defaults to false) + nocart: true/false (boolean, defaults to false) + noselltonpc: true/false (boolean, defaults to false) nomail: true/false (boolean, defaults to false) - noauction: true/false (boolean, defaults to false) + noauction: true/false (boolean, defaults to false) + nogstorage: true/false (boolean, defaults to false) + partneroverride: true/false (boolean, defaults to false) } Nouse: { (defaults to no restrictions) override: GroupID (int, defaults to 100) diff --git a/doc/sample/npc_test_time.txt b/doc/sample/npc_test_time.txt index 2af1dadd8..c3d4eae1d 100644 --- a/doc/sample/npc_test_time.txt +++ b/doc/sample/npc_test_time.txt @@ -3,23 +3,23 @@ //===== By: ================================================== //= rAthena Dev Team //===== Current Version: ===================================== -//= 20070315 -//===== Description: ========================================= +//= 20151115 +//===== Description: ========================================= //= Demonstrates time commands. //============================================================ prontera,157,181,6 script Time Sample 8W_SOLDIER,{ mes "[Time Sample]"; - mes "System Tick : " + gettimetick(0); - mes " Time Tick : " + gettimetick(1); - mes " GetTime(0) : " + gettime(0); - mes " GetTime(1) : " + gettime(1) + " (Sec)"; - mes " GetTime(2) : " + gettime(2) + " (Min)"; - mes " GetTime(3) : " + gettime(3) + " (Hour)"; - mes " GetTime(4) : " + gettime(4) + " (WeekDay)"; - mes " GetTime(5) : " + gettime(5) + " (MonthDay)"; - mes " GetTime(6) : " + gettime(6) + " (Month)"; - mes " GetTime(7) : " + gettime(7) + " (Year)"; - mes " GetTimeStr : " + gettimestr("%Y-%m/%d %H:%M:%S",19); + mes " System Tick : " + gettimetick(0); + mes " Time Tick : " + gettimetick(1); + mes " GETTIME_SECOND : " + gettime(GETTIME_SECOND) + " (Sec)"; + mes " GETTIME_MINUTE : " + gettime(GETTIME_MINUTE) + " (Min)"; + mes " GETTIME_HOUR : " + gettime(GETTIME_HOUR) + " (Hour)"; + mes " GETTIME_WEEKDAY : " + gettime(GETTIME_WEEKDAY) + " (WeekDay)"; + mes "GETTIME_DAYOFMONTH : " + gettime(GETTIME_DAYOFMONTH) + " (MonthDay)"; + mes " GETTIME_MONTH : " + gettime(GETTIME_MONTH) + " (Month)"; + mes " GETTIME_YEAR : " + gettime(GETTIME_YEAR) + " (Year)"; + mes " GETTIME_DAYOFYEAR : " + gettime(GETTIME_DAYOFYEAR) + " (Day of Year)"; + mes " gettimestr : " + gettimestr("%Y-%m/%d %H:%M:%S",19); close; } diff --git a/doc/script_commands.txt b/doc/script_commands.txt index 218bb4803..f5fdab851 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -2777,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. --------------------------------------- @@ -3181,30 +3182,28 @@ Valid types are : This function returns specified information about the current system time. -Valid types are listed in const.txt: - 1 - SECOND - Seconds (of a minute) - 2 - MINUTE - Minutes (of an hour) - 3 - HOUR - Hour (of a day) - 4 - WEEKDAY - Week day (0 for Sunday, 6 is Saturday) - - Additional: (SUNDAY,MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY,SATURDAY) - 5 - DAYOFMONTH - Day of the month. - 6 - MONTH - Number of the month. - - Additional: ( JANUARY,FEBRUARY,MARCH,APRIL,MAY,JUNE,JULY,AUGUST,SEPTEMBER,OCTOBER,NOVEMBER,DECEMBER) - 7 - YEAR - Year. - 8 - DAYOFYEAR - Day of the year. +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(WEEKDAY) == SATURDAY ) { + 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."; } - else if ( gettime(MONTH) == JANUARY ) { - mes "It's a January. I don't work on January."; - } - else if ( gettime(MONTH) == OCTOBER && gettime(DAYOFMONTH) == 31 ) { - mes "It's a Halloween."; - } - + --------------------------------------- *gettimestr(<format string>,<max length>) @@ -3249,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>}) @@ -7578,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; @@ -8964,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. --------------------------------------- @@ -8984,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. --------------------------------------- @@ -9011,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. --------------------------------------- @@ -9030,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. --------------------------------------- //===================================== diff --git a/doc/woe_time_explanation.txt b/doc/woe_time_explanation.txt index 9f288eae7..d030355f8 100644 --- a/doc/woe_time_explanation.txt +++ b/doc/woe_time_explanation.txt @@ -3,7 +3,7 @@ //===== By: ================================================== //= erKURITA //===== Current Version: ===================================== -//= 20120717 +//= 20151115 //===== Description: ========================================= //= Details on the behavior of the default WoE controller. //============================================================ @@ -15,19 +15,8 @@ OnClock<time> triggers when <time> is reached. The format is HHMM, where H = hour, M = minute. OnClock2350: would run at 23:50, server time. -gettime(<type>) is a function that checks for certain -information regarding time. The types are: - - 1 - Seconds (of a minute) - 2 - Minutes (of an hour) - 3 - Hour (of a day), ranging from 0 to 23 - 4 - Weekday, ranging from 0 (Sunday) to 6 (Saturday) - 5 - Day of the month - 6 - Number of the month - 7 - Year - 8 - Day of the year - -This way, we can check for a desired minute, hour, day, month, etc. +gettime(<type>) is a function that checks for certain information regarding +time. For more information about it, see script_commands.txt. ------------------------------------------------------------------------------- @@ -40,45 +29,36 @@ Now the structure: These 4 labels will run one after the other, reaching the next check: - if((gettime(4)==2) && (gettime(3)>=21 && gettime(3)<23)) goto L_Start; - if((gettime(4)==4) && (gettime(3)>=21 && gettime(3)<23)) goto L_Start; - if((gettime(4)==6) && (gettime(3)>=16 && gettime(3)<18)) goto L_Start; + if ((gettime(GETTIME_WEEKDAY) == TUESDAY && gettime(GETTIME_HOUR) >= 21 && gettime(GETTIME_HOUR) < 23) || + (gettime(GETTIME_WEEKDAY) == THURSDAY && gettime(GETTIME_HOUR) >= 21 && gettime(GETTIME_HOUR) < 23) || + (gettime(GETTIME_WEEKDAY) == SATURDAY && gettime(GETTIME_HOUR) >= 16 && gettime(GETTIME_HOUR) < 18)) { + agitstart(); + } This part will check for the times. Since both Start and End times run through the same chain of commands, these are important checks to ensure it's the right time. Let's take the following example: - if((gettime(4)==2) && (gettime(3)>=21 && gettime(3)<23)) + if (gettime(GETTIME_WEEKDAY) == TUESDAY && gettime(GETTIME_HOUR) >= 21 && gettime(GETTIME_HOUR) < 23) -The first gettime() is checking for a type 4, the day of the week, and it's -comparing it to the one desired, which is 2 (Tuesday). The function will +The first gettime() is checking for type GETTIME_WEEKDAY, the day of the week, +and it's comparing it to the one desired, which is TUESDAY. The function will return either 1 (true) or 0 (false). -The second gettime is checking type 3, the hour, and it's comparing +The second gettime is checking type GETTIME_HOUR, the hour, and it's comparing it to 21. If the first part is greater than or equal to (>=) the second part, the comparison will return 1. The third and last gettime is checking again for the hour, but the time has to be less than the specified time (in this case, 23). -Now, look at the parentheses. Parentheses are very important when making comparisons -and conditions. Check the order of these. I'll place dummy characters for this example: - - if ((X && (Y && Z)) goto L_Start; - -It's saying, if Y and Z are true, the condition is met. Now let's use another set -of dummy characters. We're checking if (Y && Z) = G: - - if (X && G) goto L_Start; - -It's saying that if X and G are true, the condition is met, thus proceeding to L_Start. - Now, the last part of the script, regarding the end of WoE time: - if((gettime(4)==2) && (gettime(3)==23)) goto L_End; - if((gettime(4)==4) && (gettime(3)==23)) goto L_End; - if((gettime(4)==6) && (gettime(3)==18)) goto L_End; - end; + if ((gettime(GETTIME_WEEKDAY) == TUESDAY && gettime(GETTIME_HOUR) == 23) || + (gettime(GETTIME_WEEKDAY) == THURSDAY && gettime(GETTIME_HOUR) == 23) || + (gettime(GETTIME_WEEKDAY) == SATURDAY && gettime(GETTIME_HOUR) == 18)) { + agitend(); + } This is the same as before, but it's checking for the day in the first gettime() and the hour on the second. If both conditions are true, WoE will end. We're checking @@ -95,8 +75,23 @@ An example of how to set the WoE so it starts on Monday, at 4 pm and ends up at OnClock1600: // 16:00 = 4 pm OnClock2200: // 22:00 = 10 pm - OnAgitInit: // This can only be written once: put OnClock above and the checks below. - - if ((gettime(4)==1) && (gettime(3)>=16 && gettime(3)<22)) goto L_Start; - if ((gettime(4)==1) && (gettime(3)==22) goto L_End; + OnAgitInit: // This label should appear once and only once in the script + + // starting time checks + if (gettime(GETTIME_WEEKDAY) == MONDAY && gettime(GETTIME_HOUR) >= 16 && gettime(GETTIME_HOUR) < 22) { + if (!agitcheck()) { + agitstart; + callsub S_DisplayOwners; + } + end; + } + + // end time checks + if (gettime(GETTIME_WEEKDAY) == MONDAY && gettime(GETTIME_HOUR) == 22) { + if (agitcheck()) { + agitend; + callsub S_DisplayOwners; + } + end; + } end; // Don't forget this! |