summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--3rdparty/libconfig/extra/gen/clangwarnings.patch2
-rw-r--r--3rdparty/libconfig/grammar.c473
-rw-r--r--3rdparty/libconfig/grammar.h13
-rw-r--r--conf/battle/player.conf3
-rw-r--r--conf/maps.conf6
-rw-r--r--db/const.txt105
-rw-r--r--db/map_index.txt1
-rw-r--r--db/pre-re/item_db.conf15
-rw-r--r--db/re/item_combo_db.txt6
-rw-r--r--db/re/item_db.conf297
-rw-r--r--db/sc_config.txt5
-rw-r--r--doc/item_db.txt5
-rw-r--r--doc/sample/npc_test_time.txt26
-rw-r--r--doc/script_commands.txt212
-rw-r--r--doc/woe_time_explanation.txt77
-rw-r--r--log/empty.txt0
-rw-r--r--npc/airports/airships.txt8
-rw-r--r--npc/custom/bgqueue/flavius.txt8
-rw-r--r--npc/custom/etc/airplane.txt4
-rw-r--r--npc/custom/etc/bank_kafra.txt2
-rw-r--r--npc/custom/events/valentinesdayexp.txt10
-rw-r--r--npc/custom/events/xmas_rings_event.txt2
-rw-r--r--npc/custom/quests/thq/THQS_QuestNPC.txt8
-rw-r--r--npc/custom/woe_controller.txt8
-rw-r--r--npc/events/idul_fitri.txt2
-rw-r--r--npc/other/Global_Functions.txt8
-rw-r--r--npc/other/arena/arena_lvl50.txt8
-rw-r--r--npc/other/arena/arena_lvl60.txt8
-rw-r--r--npc/other/arena/arena_lvl70.txt8
-rw-r--r--npc/other/arena/arena_lvl80.txt8
-rw-r--r--npc/other/arena/arena_party.txt8
-rw-r--r--npc/other/comodo_gambling.txt4
-rw-r--r--npc/pre-re/merchants/shops.txt68
-rw-r--r--npc/quests/first_class/tu_archer.txt4
-rw-r--r--npc/quests/guildrelay.txt60
-rw-r--r--npc/quests/newgears/2010_headgears.txt2
-rw-r--r--npc/quests/partyrelay.txt6
-rw-r--r--npc/quests/quests_ein.txt4
-rw-r--r--npc/quests/quests_lighthalzen.txt8
-rw-r--r--npc/quests/quests_louyang.txt66
-rw-r--r--npc/quests/quests_moscovia.txt17
-rw-r--r--npc/quests/quests_umbala.txt6
-rw-r--r--npc/quests/the_sign_quest.txt19
-rw-r--r--npc/re/instances/OldGlastHeim.txt11
-rw-r--r--npc/re/jobs/novice/academy.txt2
-rw-r--r--npc/re/merchants/shops.txt457
-rw-r--r--npc/re/quests/eden/eden_iro.txt159
-rw-r--r--npc/re/quests/quests_mora.txt2
-rw-r--r--npc/re/woe-fe/invest_main.txt14
-rw-r--r--npc/woe-fe/agit_controller.txt16
-rw-r--r--npc/woe-se/agit_start_se.txt16
-rw-r--r--save/empty.txt0
-rw-r--r--sql-files/item_db.sql10
-rw-r--r--sql-files/item_db_re.sql144
-rw-r--r--src/common/HPMDataCheck.h7
-rw-r--r--src/map/battle.c17
-rw-r--r--src/map/battle.h2
-rw-r--r--src/map/battleground.c163
-rw-r--r--src/map/clif.c79
-rw-r--r--src/map/instance.c4
-rw-r--r--src/map/map.c14
-rw-r--r--src/map/mob.c9
-rw-r--r--src/map/npc.c557
-rw-r--r--src/map/npc.h14
-rw-r--r--src/map/packets_struct.h48
-rw-r--r--src/map/pc.c148
-rw-r--r--src/map/pc.h3
-rw-r--r--src/map/quest.c8
-rw-r--r--src/map/script.c615
-rw-r--r--src/map/script.h55
-rw-r--r--src/map/skill.c8
-rw-r--r--src/map/status.c24
-rw-r--r--src/map/status.h119
-rw-r--r--src/map/unit.c5
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc28
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc7
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.Hooks.inc224
-rw-r--r--tools/HPMHookGen/doxygen.conf3
78 files changed, 2936 insertions, 1666 deletions
diff --git a/3rdparty/libconfig/extra/gen/clangwarnings.patch b/3rdparty/libconfig/extra/gen/clangwarnings.patch
index 65aef9a08..4240f84d2 100644
--- a/3rdparty/libconfig/extra/gen/clangwarnings.patch
+++ b/3rdparty/libconfig/extra/gen/clangwarnings.patch
@@ -2,7 +2,7 @@ diff --git a/grammar.c b/grammar.c
index 3595578..26444f8 100644
--- a/grammar.c
+++ b/grammar.c
-@@ -1187,9 +1187,7 @@ void libconfig_yyerror(void *scanner, struct parse_context *ctx,
+@@ -1211,9 +1211,7 @@ void libconfig_yyerror(void *scanner, struct parse_context *ctx,
YYUSE (ctx);
YYUSE (scan_ctx);
diff --git a/3rdparty/libconfig/grammar.c b/3rdparty/libconfig/grammar.c
index 26444f816..eb00552e2 100644
--- a/3rdparty/libconfig/grammar.c
+++ b/3rdparty/libconfig/grammar.c
@@ -1,9 +1,8 @@
-/* A Bison parser, made by GNU Bison 2.4.3. */
+/* A Bison parser, made by GNU Bison 2.5. */
-/* Skeleton implementation for Bison's Yacc-like parsers in C
+/* Bison implementation for Yacc-like parsers in C
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
- 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -45,7 +44,7 @@
#define YYBISON 1
/* Bison version. */
-#define YYBISON_VERSION "2.4.3"
+#define YYBISON_VERSION "2.5"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@@ -74,7 +73,7 @@
/* Copy the first part of user declarations. */
-/* Line 189 of yacc.c */
+/* Line 268 of yacc.c */
#line 32 "grammar.y"
#include <string.h>
@@ -128,8 +127,8 @@ void libconfig_yyerror(void *scanner, struct parse_context *ctx,
-/* Line 189 of yacc.c */
-#line 133 "grammar.c"
+/* Line 268 of yacc.c */
+#line 132 "grammar.c"
/* Enabling traces. */
#ifndef YYDEBUG
@@ -207,7 +206,7 @@ void libconfig_yyerror(void *scanner, struct parse_context *ctx,
typedef union YYSTYPE
{
-/* Line 214 of yacc.c */
+/* Line 293 of yacc.c */
#line 85 "grammar.y"
int ival;
@@ -217,8 +216,8 @@ typedef union YYSTYPE
-/* Line 214 of yacc.c */
-#line 222 "grammar.c"
+/* Line 293 of yacc.c */
+#line 221 "grammar.c"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
@@ -229,8 +228,8 @@ typedef union YYSTYPE
/* Copy the second part of user declarations. */
-/* Line 264 of yacc.c */
-#line 234 "grammar.c"
+/* Line 343 of yacc.c */
+#line 233 "grammar.c"
#ifdef short
# undef short
@@ -333,11 +332,11 @@ YYID (yyi)
# define alloca _alloca
# else
# define YYSTACK_ALLOC alloca
-# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-# ifndef _STDLIB_H
-# define _STDLIB_H 1
+# ifndef EXIT_SUCCESS
+# define EXIT_SUCCESS 0
# endif
# endif
# endif
@@ -360,24 +359,24 @@ YYID (yyi)
# ifndef YYSTACK_ALLOC_MAXIMUM
# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
# endif
-# if (defined __cplusplus && ! defined _STDLIB_H \
+# if (defined __cplusplus && ! defined EXIT_SUCCESS \
&& ! ((defined YYMALLOC || defined malloc) \
&& (defined YYFREE || defined free)))
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-# ifndef _STDLIB_H
-# define _STDLIB_H 1
+# ifndef EXIT_SUCCESS
+# define EXIT_SUCCESS 0
# endif
# endif
# ifndef YYMALLOC
# define YYMALLOC malloc
-# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
# endif
# endif
# ifndef YYFREE
# define YYFREE free
-# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
void free (void *); /* INFRINGES ON USER NAME SPACE */
# endif
@@ -406,23 +405,7 @@ union yyalloc
((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
+ YYSTACK_GAP_MAXIMUM)
-/* Copy COUNT objects from FROM to TO. The source and destination do
- not overlap. */
-# ifndef YYCOPY
-# if defined __GNUC__ && 1 < __GNUC__
-# define YYCOPY(To, From, Count) \
- __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
-# else
-# define YYCOPY(To, From, Count) \
- do \
- { \
- YYSIZE_T yyi; \
- for (yyi = 0; yyi < (Count); yyi++) \
- (To)[yyi] = (From)[yyi]; \
- } \
- while (YYID (0))
-# endif
-# endif
+# define YYCOPY_NEEDED 1
/* Relocate STACK from its old location to the new one. The
local variables YYSIZE and YYSTACKSIZE give the old and new number of
@@ -442,6 +425,26 @@ union yyalloc
#endif
+#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
+/* Copy COUNT objects from FROM to TO. The source and destination do
+ not overlap. */
+# ifndef YYCOPY
+# if defined __GNUC__ && 1 < __GNUC__
+# define YYCOPY(To, From, Count) \
+ __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
+# else
+# define YYCOPY(To, From, Count) \
+ do \
+ { \
+ YYSIZE_T yyi; \
+ for (yyi = 0; yyi < (Count); yyi++) \
+ (To)[yyi] = (From)[yyi]; \
+ } \
+ while (YYID (0))
+# endif
+# endif
+#endif /* !YYCOPY_NEEDED */
+
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 6
/* YYLAST -- Last index in YYTABLE. */
@@ -583,8 +586,8 @@ static const yytype_uint8 yyr2[] =
0, 1, 0, 4
};
-/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
- STATE-NUM when YYTABLE doesn't specify something else to do. Zero
+/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
+ Performed when YYTABLE doesn't specify something else to do. Zero
means the default is an error. */
static const yytype_uint8 yydefact[] =
{
@@ -627,8 +630,7 @@ static const yytype_int8 yypgoto[] =
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
positive, shift that token. If negative, reduce the rule which
- number is the opposite. If zero, do what YYDEFACT says.
- If YYTABLE_NINF, syntax error. */
+ number is the opposite. If YYTABLE_NINF, syntax error. */
#define YYTABLE_NINF -1
static const yytype_uint8 yytable[] =
{
@@ -638,6 +640,12 @@ static const yytype_uint8 yytable[] =
45, 48, 47, 40, 0, 46, 0, 7
};
+#define yypact_value_is_default(yystate) \
+ ((yystate) == (-26))
+
+#define yytable_value_is_error(yytable_value) \
+ YYID (0)
+
static const yytype_int8 yycheck[] =
{
3, 26, 25, 3, 4, 5, 6, 7, 8, 9,
@@ -691,7 +699,6 @@ do \
{ \
yychar = (Token); \
yylval = (Value); \
- yytoken = YYTRANSLATE (yychar); \
YYPOPSTACK (1); \
goto yybackup; \
} \
@@ -733,19 +740,10 @@ while (YYID (0))
#endif
-/* YY_LOCATION_PRINT -- Print the location on the stream.
- This macro was not mandated originally: define only if we know
- we won't break user code: when these are the locations we know. */
+/* This macro is provided for backward compatibility. */
#ifndef YY_LOCATION_PRINT
-# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
-# define YY_LOCATION_PRINT(File, Loc) \
- fprintf (File, "%d.%d-%d.%d", \
- (Loc).first_line, (Loc).first_column, \
- (Loc).last_line, (Loc).last_column)
-# else
-# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
-# endif
+# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
#endif
@@ -949,7 +947,6 @@ int yydebug;
# define YYMAXDEPTH 10000
#endif
-
#if YYERROR_VERBOSE
@@ -1052,115 +1049,142 @@ yytnamerr (char *yyres, const char *yystr)
}
# endif
-/* Copy into YYRESULT an error message about the unexpected token
- YYCHAR while in state YYSTATE. Return the number of bytes copied,
- including the terminating null byte. If YYRESULT is null, do not
- copy anything; just return the number of bytes that would be
- copied. As a special case, return 0 if an ordinary "syntax error"
- message will do. Return YYSIZE_MAXIMUM if overflow occurs during
- size calculation. */
-static YYSIZE_T
-yysyntax_error (char *yyresult, int yystate, int yychar)
-{
- int yyn = yypact[yystate];
+/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
+ about the unexpected token YYTOKEN for the state stack whose top is
+ YYSSP.
- if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
- return 0;
- else
+ Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
+ not large enough to hold the message. In that case, also set
+ *YYMSG_ALLOC to the required number of bytes. Return 2 if the
+ required number of bytes is too large to store. */
+static int
+yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
+ yytype_int16 *yyssp, int yytoken)
+{
+ YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
+ YYSIZE_T yysize = yysize0;
+ YYSIZE_T yysize1;
+ enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
+ /* Internationalized format string. */
+ const char *yyformat = 0;
+ /* Arguments of yyformat. */
+ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
+ /* Number of reported tokens (one for the "unexpected", one per
+ "expected"). */
+ int yycount = 0;
+
+ /* There are many possibilities here to consider:
+ - Assume YYFAIL is not used. It's too flawed to consider. See
+ <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
+ for details. YYERROR is fine as it does not invoke this
+ function.
+ - If this state is a consistent state with a default action, then
+ the only way this function was invoked is if the default action
+ is an error action. In that case, don't check for expected
+ tokens because there are none.
+ - The only way there can be no lookahead present (in yychar) is if
+ this state is a consistent state with a default action. Thus,
+ detecting the absence of a lookahead is sufficient to determine
+ that there is no unexpected or expected token to report. In that
+ case, just report a simple "syntax error".
+ - Don't assume there isn't a lookahead just because this state is a
+ consistent state with a default action. There might have been a
+ previous inconsistent state, consistent state with a non-default
+ action, or user semantic action that manipulated yychar.
+ - Of course, the expected token list depends on states to have
+ correct lookahead information, and it depends on the parser not
+ to perform extra reductions after fetching a lookahead from the
+ scanner and before detecting a syntax error. Thus, state merging
+ (from LALR or IELR) and default reductions corrupt the expected
+ token list. However, the list is correct for canonical LR with
+ one exception: it will still contain any token that will not be
+ accepted due to an error action in a later state.
+ */
+ if (yytoken != YYEMPTY)
{
- int yytype = YYTRANSLATE (yychar);
- YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
- YYSIZE_T yysize = yysize0;
- YYSIZE_T yysize1;
- int yysize_overflow = 0;
- enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
- char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
- int yyx;
-
-# if 0
- /* This is so xgettext sees the translatable formats that are
- constructed on the fly. */
- YY_("syntax error, unexpected %s");
- YY_("syntax error, unexpected %s, expecting %s");
- YY_("syntax error, unexpected %s, expecting %s or %s");
- YY_("syntax error, unexpected %s, expecting %s or %s or %s");
- YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
-# endif
- char *yyfmt;
- char const *yyf;
- static char const yyunexpected[] = "syntax error, unexpected %s";
- static char const yyexpecting[] = ", expecting %s";
- static char const yyor[] = " or %s";
- char yyformat[sizeof yyunexpected
- + sizeof yyexpecting - 1
- + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
- * (sizeof yyor - 1))];
- char const *yyprefix = yyexpecting;
-
- /* Start YYX at -YYN if negative to avoid negative indexes in
- YYCHECK. */
- int yyxbegin = yyn < 0 ? -yyn : 0;
-
- /* Stay within bounds of both yycheck and yytname. */
- int yychecklim = YYLAST - yyn + 1;
- int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
- int yycount = 1;
-
- yyarg[0] = yytname[yytype];
- yyfmt = yystpcpy (yyformat, yyunexpected);
-
- for (yyx = yyxbegin; yyx < yyxend; ++yyx)
- if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
- {
- if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
- {
- yycount = 1;
- yysize = yysize0;
- yyformat[sizeof yyunexpected - 1] = '\0';
- break;
- }
- yyarg[yycount++] = yytname[yyx];
- yysize1 = yysize + yytnamerr (0, yytname[yyx]);
- yysize_overflow |= (yysize1 < yysize);
- yysize = yysize1;
- yyfmt = yystpcpy (yyfmt, yyprefix);
- yyprefix = yyor;
- }
+ int yyn = yypact[*yyssp];
+ yyarg[yycount++] = yytname[yytoken];
+ if (!yypact_value_is_default (yyn))
+ {
+ /* Start YYX at -YYN if negative to avoid negative indexes in
+ YYCHECK. In other words, skip the first -YYN actions for
+ this state because they are default actions. */
+ int yyxbegin = yyn < 0 ? -yyn : 0;
+ /* Stay within bounds of both yycheck and yytname. */
+ int yychecklim = YYLAST - yyn + 1;
+ int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
+ int yyx;
+
+ for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+ if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
+ && !yytable_value_is_error (yytable[yyx + yyn]))
+ {
+ if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
+ {
+ yycount = 1;
+ yysize = yysize0;
+ break;
+ }
+ yyarg[yycount++] = yytname[yyx];
+ yysize1 = yysize + yytnamerr (0, yytname[yyx]);
+ if (! (yysize <= yysize1
+ && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+ return 2;
+ yysize = yysize1;
+ }
+ }
+ }
- yyf = YY_(yyformat);
- yysize1 = yysize + yystrlen (yyf);
- yysize_overflow |= (yysize1 < yysize);
- yysize = yysize1;
+ switch (yycount)
+ {
+# define YYCASE_(N, S) \
+ case N: \
+ yyformat = S; \
+ break
+ YYCASE_(0, YY_("syntax error"));
+ YYCASE_(1, YY_("syntax error, unexpected %s"));
+ YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
+ YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
+ YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
+ YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
+# undef YYCASE_
+ }
- if (yysize_overflow)
- return YYSIZE_MAXIMUM;
+ yysize1 = yysize + yystrlen (yyformat);
+ if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+ return 2;
+ yysize = yysize1;
- if (yyresult)
- {
- /* Avoid sprintf, as that infringes on the user's name space.
- Don't have undefined behavior even if the translation
- produced a string with the wrong number of "%s"s. */
- char *yyp = yyresult;
- int yyi = 0;
- while ((*yyp = *yyf) != '\0')
- {
- if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
- {
- yyp += yytnamerr (yyp, yyarg[yyi++]);
- yyf += 2;
- }
- else
- {
- yyp++;
- yyf++;
- }
- }
- }
- return yysize;
+ if (*yymsg_alloc < yysize)
+ {
+ *yymsg_alloc = 2 * yysize;
+ if (! (yysize <= *yymsg_alloc
+ && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
+ *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
+ return 1;
}
+
+ /* Avoid sprintf, as that infringes on the user's name space.
+ Don't have undefined behavior even if the translation
+ produced a string with the wrong number of "%s"s. */
+ {
+ char *yyp = *yymsg;
+ int yyi = 0;
+ while ((*yyp = *yyformat) != '\0')
+ if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
+ {
+ yyp += yytnamerr (yyp, yyarg[yyi++]);
+ yyformat += 2;
+ }
+ else
+ {
+ yyp++;
+ yyformat++;
+ }
+ }
+ return 0;
}
#endif /* YYERROR_VERBOSE */
-
/*-----------------------------------------------.
| Release the memory associated to this symbol. |
@@ -1197,6 +1221,7 @@ yydestruct (yymsg, yytype, yyvaluep, scanner, ctx, scan_ctx)
}
}
+
/* Prevent warnings from -Wmissing-prototypes. */
#ifdef YYPARSE_PARAM
#if defined __STDC__ || defined __cplusplus
@@ -1213,12 +1238,9 @@ int yyparse ();
#endif /* ! YYPARSE_PARAM */
-
-
-
-/*-------------------------.
-| yyparse or yypush_parse. |
-`-------------------------*/
+/*----------.
+| yyparse. |
+`----------*/
#ifdef YYPARSE_PARAM
#if (defined __STDC__ || defined __C99__FUNC__ \
@@ -1407,7 +1429,7 @@ yybackup:
/* First try to decide what to do without reference to lookahead token. */
yyn = yypact[yystate];
- if (yyn == YYPACT_NINF)
+ if (yypact_value_is_default (yyn))
goto yydefault;
/* Not known => get a lookahead token if don't already have one. */
@@ -1438,8 +1460,8 @@ yybackup:
yyn = yytable[yyn];
if (yyn <= 0)
{
- if (yyn == 0 || yyn == YYTABLE_NINF)
- goto yyerrlab;
+ if (yytable_value_is_error (yyn))
+ goto yyerrlab;
yyn = -yyn;
goto yyreduce;
}
@@ -1494,7 +1516,7 @@ yyreduce:
{
case 13:
-/* Line 1464 of yacc.c */
+/* Line 1806 of yacc.c */
#line 128 "grammar.y"
{
ctx->setting = config_setting_add(ctx->parent, (yyvsp[(1) - (1)].sval), CONFIG_TYPE_NONE);
@@ -1513,7 +1535,7 @@ yyreduce:
case 15:
-/* Line 1464 of yacc.c */
+/* Line 1806 of yacc.c */
#line 147 "grammar.y"
{
if(IN_LIST())
@@ -1532,7 +1554,7 @@ yyreduce:
case 16:
-/* Line 1464 of yacc.c */
+/* Line 1806 of yacc.c */
#line 162 "grammar.y"
{
if(ctx->parent)
@@ -1542,7 +1564,7 @@ yyreduce:
case 17:
-/* Line 1464 of yacc.c */
+/* Line 1806 of yacc.c */
#line 170 "grammar.y"
{
if(IN_LIST())
@@ -1561,7 +1583,7 @@ yyreduce:
case 18:
-/* Line 1464 of yacc.c */
+/* Line 1806 of yacc.c */
#line 185 "grammar.y"
{
if(ctx->parent)
@@ -1571,21 +1593,21 @@ yyreduce:
case 23:
-/* Line 1464 of yacc.c */
+/* Line 1806 of yacc.c */
#line 199 "grammar.y"
{ parsectx_append_string(ctx, (yyvsp[(1) - (1)].sval)); free((yyvsp[(1) - (1)].sval)); }
break;
case 24:
-/* Line 1464 of yacc.c */
+/* Line 1806 of yacc.c */
#line 200 "grammar.y"
{ parsectx_append_string(ctx, (yyvsp[(2) - (2)].sval)); free((yyvsp[(2) - (2)].sval)); }
break;
case 25:
-/* Line 1464 of yacc.c */
+/* Line 1806 of yacc.c */
#line 205 "grammar.y"
{
if(IN_ARRAY() || IN_LIST())
@@ -1610,7 +1632,7 @@ yyreduce:
case 26:
-/* Line 1464 of yacc.c */
+/* Line 1806 of yacc.c */
#line 225 "grammar.y"
{
if(IN_ARRAY() || IN_LIST())
@@ -1637,7 +1659,7 @@ yyreduce:
case 27:
-/* Line 1464 of yacc.c */
+/* Line 1806 of yacc.c */
#line 247 "grammar.y"
{
if(IN_ARRAY() || IN_LIST())
@@ -1664,7 +1686,7 @@ yyreduce:
case 28:
-/* Line 1464 of yacc.c */
+/* Line 1806 of yacc.c */
#line 269 "grammar.y"
{
if(IN_ARRAY() || IN_LIST())
@@ -1691,7 +1713,7 @@ yyreduce:
case 29:
-/* Line 1464 of yacc.c */
+/* Line 1806 of yacc.c */
#line 291 "grammar.y"
{
if(IN_ARRAY() || IN_LIST())
@@ -1718,7 +1740,7 @@ yyreduce:
case 30:
-/* Line 1464 of yacc.c */
+/* Line 1806 of yacc.c */
#line 313 "grammar.y"
{
if(IN_ARRAY() || IN_LIST())
@@ -1741,7 +1763,7 @@ yyreduce:
case 31:
-/* Line 1464 of yacc.c */
+/* Line 1806 of yacc.c */
#line 331 "grammar.y"
{
if(IN_ARRAY() || IN_LIST())
@@ -1771,7 +1793,7 @@ yyreduce:
case 42:
-/* Line 1464 of yacc.c */
+/* Line 1806 of yacc.c */
#line 387 "grammar.y"
{
if(IN_LIST())
@@ -1790,7 +1812,7 @@ yyreduce:
case 43:
-/* Line 1464 of yacc.c */
+/* Line 1806 of yacc.c */
#line 402 "grammar.y"
{
if(ctx->parent)
@@ -1800,10 +1822,21 @@ yyreduce:
-/* Line 1464 of yacc.c */
-#line 1807 "grammar.c"
+/* Line 1806 of yacc.c */
+#line 1829 "grammar.c"
default: break;
}
+ /* User semantic actions sometimes alter yychar, and that requires
+ that yytoken be updated with the new translation. We take the
+ approach of translating immediately before every use of yytoken.
+ One alternative is translating here after every semantic action,
+ but that translation would be missed if the semantic action invokes
+ YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
+ if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
+ incorrect destructor might then be invoked immediately. In the
+ case of YYERROR or YYBACKUP, subsequent parser actions might lead
+ to an incorrect destructor call or verbose syntax error message
+ before the lookahead is translated. */
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
YYPOPSTACK (yylen);
@@ -1831,6 +1864,10 @@ yyreduce:
| yyerrlab -- here on detecting error |
`------------------------------------*/
yyerrlab:
+ /* Make sure we have latest lookahead translation. See comments at
+ user semantic actions for why this is necessary. */
+ yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
+
/* If not already recovering from an error, report this error. */
if (!yyerrstatus)
{
@@ -1838,37 +1875,36 @@ yyerrlab:
#if ! YYERROR_VERBOSE
yyerror (scanner, ctx, scan_ctx, YY_("syntax error"));
#else
+# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
+ yyssp, yytoken)
{
- YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
- if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
- {
- YYSIZE_T yyalloc = 2 * yysize;
- if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
- yyalloc = YYSTACK_ALLOC_MAXIMUM;
- if (yymsg != yymsgbuf)
- YYSTACK_FREE (yymsg);
- yymsg = (char *) YYSTACK_ALLOC (yyalloc);
- if (yymsg)
- yymsg_alloc = yyalloc;
- else
- {
- yymsg = yymsgbuf;
- yymsg_alloc = sizeof yymsgbuf;
- }
- }
-
- if (0 < yysize && yysize <= yymsg_alloc)
- {
- (void) yysyntax_error (yymsg, yystate, yychar);
- yyerror (scanner, ctx, scan_ctx, yymsg);
- }
- else
- {
- yyerror (scanner, ctx, scan_ctx, YY_("syntax error"));
- if (yysize != 0)
- goto yyexhaustedlab;
- }
+ char const *yymsgp = YY_("syntax error");
+ int yysyntax_error_status;
+ yysyntax_error_status = YYSYNTAX_ERROR;
+ if (yysyntax_error_status == 0)
+ yymsgp = yymsg;
+ else if (yysyntax_error_status == 1)
+ {
+ if (yymsg != yymsgbuf)
+ YYSTACK_FREE (yymsg);
+ yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
+ if (!yymsg)
+ {
+ yymsg = yymsgbuf;
+ yymsg_alloc = sizeof yymsgbuf;
+ yysyntax_error_status = 2;
+ }
+ else
+ {
+ yysyntax_error_status = YYSYNTAX_ERROR;
+ yymsgp = yymsg;
+ }
+ }
+ yyerror (scanner, ctx, scan_ctx, yymsgp);
+ if (yysyntax_error_status == 2)
+ goto yyexhaustedlab;
}
+# undef YYSYNTAX_ERROR
#endif
}
@@ -1927,7 +1963,7 @@ yyerrlab1:
for (;;)
{
yyn = yypact[yystate];
- if (yyn != YYPACT_NINF)
+ if (!yypact_value_is_default (yyn))
{
yyn += YYTERROR;
if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
@@ -1986,8 +2022,13 @@ yyexhaustedlab:
yyreturn:
if (yychar != YYEMPTY)
- yydestruct ("Cleanup: discarding lookahead",
- yytoken, &yylval, scanner, ctx, scan_ctx);
+ {
+ /* Make sure we have latest lookahead translation. See comments at
+ user semantic actions for why this is necessary. */
+ yytoken = YYTRANSLATE (yychar);
+ yydestruct ("Cleanup: discarding lookahead",
+ yytoken, &yylval, scanner, ctx, scan_ctx);
+ }
/* Do not reclaim the symbols of the rule which action triggered
this YYABORT or YYACCEPT. */
YYPOPSTACK (yylen);
@@ -2012,7 +2053,7 @@ yyreturn:
-/* Line 1684 of yacc.c */
+/* Line 2067 of yacc.c */
#line 408 "grammar.y"
diff --git a/3rdparty/libconfig/grammar.h b/3rdparty/libconfig/grammar.h
index 7da95471c..d7fd02cc8 100644
--- a/3rdparty/libconfig/grammar.h
+++ b/3rdparty/libconfig/grammar.h
@@ -1,9 +1,8 @@
-/* A Bison parser, made by GNU Bison 2.4.3. */
+/* A Bison parser, made by GNU Bison 2.5. */
-/* Skeleton interface for Bison's Yacc-like parsers in C
+/* Bison interface for Yacc-like parsers in C
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
- 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -89,7 +88,7 @@
typedef union YYSTYPE
{
-/* Line 1685 of yacc.c */
+/* Line 2068 of yacc.c */
#line 85 "grammar.y"
int ival;
@@ -99,8 +98,8 @@ typedef union YYSTYPE
-/* Line 1685 of yacc.c */
-#line 104 "grammar.h"
+/* Line 2068 of yacc.c */
+#line 103 "grammar.h"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
diff --git a/conf/battle/player.conf b/conf/battle/player.conf
index babd6cfc3..cc2655580 100644
--- a/conf/battle/player.conf
+++ b/conf/battle/player.conf
@@ -51,6 +51,9 @@ basic_skill_check: yes
// Value is also affected by 'invincible_time_inc' mapflag
player_invincible_time: 5000
+// When set to true, it prevent portal abuse for avoid hits. Official value is false.
+fix_warp_hit_delay_abuse: false
+
// The time interval for HP to restore naturally. (in milliseconds)
natural_healhp_interval: 6000
diff --git a/conf/maps.conf b/conf/maps.conf
index 404eb7f3e..529afa9ce 100644
--- a/conf/maps.conf
+++ b/conf/maps.conf
@@ -1115,7 +1115,7 @@ map: 2@gl_k
map: silk_lair
map: evt_bomb
-//Wave Mode Memorial Dungeon
+// Wave Mode Memorial Dungeon
map: 1@def01
map: 1@def02
map: 1@def03
@@ -1133,7 +1133,7 @@ map: 1@spa
map: dali
map: dali02
-//Episode 14.3
+// Episode 14.3
map: moro_vol
map: moro_cav
map: 1@dth1
@@ -1144,7 +1144,7 @@ map: 1@xm_d
map: 1@eom
map: 1@jtb
-//Clock Tower Nightmare Mode
+// Clock Tower Nightmare Mode
map: c_tower2_
map: c_tower3_
diff --git a/db/const.txt b/db/const.txt
index 78d64345e..430407967 100644
--- a/db/const.txt
+++ b/db/const.txt
@@ -1283,6 +1283,11 @@ SC_MTF_MSP 585
SC_MTF_PUMPKIN 586
SC_MTF_HITFLEE 587
+SC_LJOSALFAR 588
+SC_MERMAID_LONGING 589
+
+SC_ACARAJE 590
+
e_gasp 0
e_what 1
e_ho 2
@@ -3249,6 +3254,67 @@ THANATOS_KEEP 10009
4_JP_EDGA_H 10111
4_JP_BRAGOLEM_H 10112
4_EL_AQUA 10113
+4_EP16_NIHIL 10114
+4_EP16_SPICA 10115
+4_EP16_SKIA 10116
+4_EP16_PETER 10117
+4_EP16_CRUX 10118
+4_EP16_GRANZ 10119
+4_EP16_STOLZ 10120
+4_EP16_EGEO 10121
+4_EP16_COOK 10122
+4_EP16_MARK 10123
+4_EP16_TAMARIN 10124
+4_EP16_POE 10125
+4_EP16_ISAAC 10126
+4_EP16_HELMUT 10127
+4_EP16_WOLF 10128
+4_EP16_MEYER 10129
+4_EP16_AGNES 10130
+4_EP16_FOOD 10131
+4_EP16_LOUVIERE 10132
+4_EP16_MAX 10133
+4_EP16_SPIEGEL 10134
+4_MOONLIGHT 10135
+4_MISTRESS 10136
+4_DRACULA 10137
+4_STORMKNIGHT 10138
+4_TATTER 10139
+4_AS_RAGGED_GOLEM 10140
+4_AS_BLOODY_KNIGHT 10141
+4_AS_WIND_GHOST 10142
+4_F_BIJOU 10143
+4_EP16_COOK2 10144
+4_SERVICE_30_M_01 10145
+4_SERVICE_30_F_01 10146
+4_SCR_AT_ROBOTS 10147
+4_F_RANGER 10148
+4_WAG 10149
+4_NPC_TRAP 10150
+4_RAGGLER 10151
+4_DR_PEPE 10152
+4_DR_GAMBERI 10153
+4_DR_AGLIO 10154
+4_DR_OLIO 10155
+4_DR_STELO 10156
+4_DR_TORTEL 10157
+4_BASIL_SLAVE 10158
+4_DOU_JINDO 10159
+4_DOU_SIBA 10160
+4_TARUTUPI 10161
+4_DR_SOLDIER 10162
+4_DR_M_01 10163
+4_DR_M_02 10164
+4_DR_F_01 10165
+4_DR_F_02 10166
+4_DR_KID_01 10167
+4_JP_2015EVT 10168
+4_ALLIGATOR 10169
+4_ANOLIAN 10170
+4_TACNU 10171
+4_CENERE 10172
+4_F_ARUNA_POP2 10173
+4_JACK_HEAD 10174
MER_LIF 6001
MER_AMISTR 6002
@@ -3353,9 +3419,9 @@ IT_AMMO 10
IT_DELAYCONSUME 11
IT_CASH 18
-HQO_OnLogout 1
-HQO_OnDeath 2
-HQO_OnMapChange 3
+QUEUEOPT_LOGOUT 1
+QUEUEOPT_DEATH 2
+QUEUEOPT_MAPCHANGE 3
IOT_NONE 0
IOT_CHAR 1
@@ -3395,3 +3461,36 @@ MOUNT_DRAGON_BROWN 5
MOUNT_DRAGON_GRAY 6
MOUNT_DRAGON_BLUE 7
MOUNT_DRAGON_RED 8
+
+// gettime( <param> )
+GETTIME_SECOND 1
+GETTIME_MINUTE 2
+GETTIME_HOUR 3
+GETTIME_WEEKDAY 4
+GETTIME_DAYOFMONTH 5
+GETTIME_MONTH 6
+GETTIME_YEAR 7
+GETTIME_DAYOFYEAR 8
+
+// Weekday
+SUNDAY 0
+MONDAY 1
+TUESDAY 2
+WEDNESDAY 3
+THURSDAY 4
+FRIDAY 5
+SATURDAY 6
+
+// Month
+JANUARY 1
+FEBRUARY 2
+MARCH 3
+APRIL 4
+MAY 5
+JUNE 6
+JULY 7
+AUGUST 8
+SEPTEMBER 9
+OCTOBER 10
+NOVEMBER 11
+DECEMBER 12
diff --git a/db/map_index.txt b/db/map_index.txt
index 7e43f7cd2..332361071 100644
--- a/db/map_index.txt
+++ b/db/map_index.txt
@@ -934,7 +934,6 @@ moro_cav
c_tower2_
c_tower3_
-
// Only add maps under this line if they are not standard maps!
//======================================================================================
// - Other/Extra maps -
diff --git a/db/pre-re/item_db.conf b/db/pre-re/item_db.conf
index 48d9b091d..c777aa28f 100644
--- a/db/pre-re/item_db.conf
+++ b/db/pre-re/item_db.conf
@@ -16327,7 +16327,7 @@ item_db: (
bonus bMatkRate,20;
bonus bInt,3+(getrefine()/2);
bonus bMaxHP,300+(50*getrefine()/2);
- autobonus "{ bonus bMatkRate,12; bonus buseSPRate,20; }",1,5000,BF_MAGIC,"{ specialeffect2 EF_ENHANCE; }";
+ autobonus "{ bonus bMatkRate,12; bonus bUseSPrate,20; }",1,5000,BF_MAGIC,"{ specialeffect2 EF_ENHANCE; }";
">
},
{
@@ -38844,7 +38844,10 @@ item_db: (
Weight: 100
Loc: 256
View: 433
- Script: <" if(gettime(6)==9&&gettime(5)>=10&&gettime(5)<=24) bonus bAllStats, 4; ">
+ Script: <"
+ if (gettime(GETTIME_MONTH) == SEPTEMBER && gettime(GETTIME_DAYOFMONTH) >= 10 && gettime(GETTIME_DAYOFMONTH) <= 24)
+ bonus bAllStats, 4;
+ ">
},
{
Id: 5433
@@ -63137,8 +63140,8 @@ item_db: (
Buy: 0
Weight: 80
Script: <"
- if(gettime(5)!=MDiceCone) {
- MDiceCone = gettime(5);
+ if (gettime(GETTIME_DAYOFMONTH) != MDiceCone) {
+ MDiceCone = gettime(GETTIME_DAYOFMONTH);
percentheal 50,50;
}
@@ -66688,7 +66691,7 @@ item_db: (
}
Script: <"
specialeffect2 EF_STEAL;
- sc_start SC_INCHITRATE,120000,5;
+ sc_start2 SC_ACARAJE,120000,5,10;
">
},
{
@@ -67486,7 +67489,7 @@ item_db: (
Weight: 10
BuyingStore: true
Script: <"
- sc_start SC_VITATA_500,500000,0;
+ sc_start2 SC_VITATA_500,500000,20,5;
itemheal 0,200;
">
},
diff --git a/db/re/item_combo_db.txt b/db/re/item_combo_db.txt
index 2efef8691..ab17bba21 100644
--- a/db/re/item_combo_db.txt
+++ b/db/re/item_combo_db.txt
@@ -71,10 +71,8 @@
1741:2748,{ bonus bAtk,25; bonus3 bAddEff,Eff_Curse,200,ATF_WEAPON|ATF_LONG|ATF_TARGET; }
1746:1773,{ bonus bLongAtkRate,50; }
1764:18541,{ bonus bCritAtkRate,5; }
-1775:18113,{ bonus bLongAtkRate,70; }
-1776:18113,{ bonus bLongAtkRate,40; }
-1775:18114,{ bonus bLongAtkRate,50; }
-1776:18114,{ bonus bLongAtkRate,20; }
+1775:18114,{ bonus bLongAtkRate,70; }
+1776:18114,{ bonus bLongAtkRate,40; }
1935:2988,{ bonus2 bSkillAtk,CG_ARROWVULCAN,200; bonus2 bSkillUseSP,CG_ARROWVULCAN,20; }
1990:2989,{ bonus2 bSkillAtk,CG_ARROWVULCAN,200; }
2001:2677,{ bonus bMatkRate,10; bonus bDex,2; bonus2 bSubRace,RC_Demon,10; bonus2 bSubRace,RC_Undead,10; }
diff --git a/db/re/item_db.conf b/db/re/item_db.conf
index ef4f99466..b86305fff 100644
--- a/db/re/item_db.conf
+++ b/db/re/item_db.conf
@@ -19125,7 +19125,7 @@ item_db: (
Script: <"
bonus bInt,3+(getrefine()/2);
bonus bMaxHP,300+(50*getrefine()/2);
- autobonus "{ bonus bMatkRate,12; bonus buseSPRate,20; }",1,5000,BF_MAGIC,"{ specialeffect2 EF_ENHANCE; }";
+ autobonus "{ bonus bMatkRate,12; bonus bUseSPrate,20; }",1,5000,BF_MAGIC,"{ specialeffect2 EF_ENHANCE; }";
">
},
{
@@ -28971,7 +28971,6 @@ item_db: (
notrade: true
noselltonpc: true
nocart: true
- nostorage: true
nogstorage: true
nomail: true
noauction: true
@@ -30850,9 +30849,6 @@ item_db: (
Refine: false
Trade: {
nodrop: true
- nogstorage: true
- nomail: true
- noauction: true
}
Script: <" bonus bUseSPrate,-5; ">
},
@@ -30867,9 +30863,6 @@ item_db: (
Refine: false
Trade: {
nodrop: true
- nogstorage: true
- nomail: true
- noauction: true
}
Script: <" bonus bInt,2; ">
},
@@ -30885,9 +30878,6 @@ item_db: (
Refine: false
Trade: {
nodrop: true
- nogstorage: true
- nomail: true
- noauction: true
}
Script: <"
bonus bStr,2;
@@ -30906,9 +30896,6 @@ item_db: (
Refine: false
Trade: {
nodrop: true
- nogstorage: true
- nomail: true
- noauction: true
}
Script: <" autobonus "{ bonus bAspdRate,2; }",10,10000,0,"{ specialeffect2 EF_POTION_BERSERK; }"; ">
},
@@ -30925,9 +30912,6 @@ item_db: (
Refine: false
Trade: {
nodrop: true
- nogstorage: true
- nomail: true
- noauction: true
}
Script: <"
bonus bAllStats,1;
@@ -31787,9 +31771,6 @@ item_db: (
Refine: false
Trade: {
nodrop: true
- nogstorage: true
- nomail: true
- noauction: true
}
Script: <" bonus bInt,2; ">
},
@@ -31805,9 +31786,6 @@ item_db: (
Refine: false
Trade: {
nodrop: true
- nogstorage: true
- nomail: true
- noauction: true
}
Script: <"
bonus bDex,2;
@@ -31826,9 +31804,6 @@ item_db: (
Refine: false
Trade: {
nodrop: true
- nogstorage: true
- nomail: true
- noauction: true
}
Script: <" autobonus "{ bonus bMaxHPrate,10; }",10,10000,0,"{ specialeffect2 EF_POTION_BERSERK; }"; ">
},
@@ -32440,15 +32415,6 @@ item_db: (
Loc: 136
EquipLv: 110
Refine: false
- Trade: {
- nodrop: true
- notrade: true
- nocart: true
- nostorage: true
- nogstorage: true
- nomail: true
- noauction: true
- }
Script: <"
bonus bVit,2;
bonus bHealPower,2;
@@ -32465,15 +32431,6 @@ item_db: (
Loc: 136
EquipLv: 110
Refine: false
- Trade: {
- nodrop: true
- notrade: true
- nocart: true
- nostorage: true
- nogstorage: true
- nomail: true
- noauction: true
- }
Script: <"
bonus bInt,2;
bonus bHealPower,2;
@@ -32490,15 +32447,6 @@ item_db: (
Loc: 136
EquipLv: 110
Refine: false
- Trade: {
- nodrop: true
- notrade: true
- nocart: true
- nostorage: true
- nogstorage: true
- nomail: true
- noauction: true
- }
Script: <"
bonus bDex,2;
bonus bHealPower,2;
@@ -50280,9 +50228,6 @@ item_db: (
Trade: {
nodrop: true
noselltonpc: true
- nogstorage: true
- nomail: true
- noauction: true
}
Script: <"
bonus bDex,3;
@@ -50388,9 +50333,6 @@ item_db: (
View: 431
Trade: {
nodrop: true
- nogstorage: true
- nomail: true
- noauction: true
}
Script: <"
bonus2 bSubEle,Ele_Fire,20;
@@ -50422,7 +50364,10 @@ item_db: (
Weight: 100
Loc: 256
View: 433
- Script: <" if(gettime(6)==9&&gettime(5)>=10&&gettime(5)<=24) bonus bAllStats,4; ">
+ Script: <"
+ if (gettime(GETTIME_MONTH) == SEPTEMBER && gettime(GETTIME_DAYOFMONTH) >= 10 && gettime(GETTIME_DAYOFMONTH) <= 24)
+ bonus bAllStats,4;
+ ">
},
{
Id: 5433
@@ -51232,9 +51177,6 @@ item_db: (
View: 476
Trade: {
nodrop: true
- nogstorage: true
- nomail: true
- noauction: true
}
Script: <"
bonus bMdef,3;
@@ -51254,9 +51196,6 @@ item_db: (
View: 477
Trade: {
nodrop: true
- nogstorage: true
- nomail: true
- noauction: true
}
Script: <"
bonus bAllStats,2;
@@ -51276,9 +51215,6 @@ item_db: (
View: 478
Trade: {
nodrop: true
- nogstorage: true
- nomail: true
- noauction: true
}
Script: <"
bonus bAspdRate,10;
@@ -51298,9 +51234,6 @@ item_db: (
View: 479
Trade: {
nodrop: true
- nogstorage: true
- nomail: true
- noauction: true
}
Script: <" bonus bStr,3; ">
},
@@ -51317,9 +51250,6 @@ item_db: (
View: 480
Trade: {
nodrop: true
- nogstorage: true
- nomail: true
- noauction: true
}
Script: <"
bonus bUnbreakableHelm,0;
@@ -52941,9 +52871,6 @@ item_db: (
View: 479
Trade: {
nodrop: true
- nogstorage: true
- nomail: true
- noauction: true
}
Script: <"
bonus bDex,3;
@@ -59797,7 +59724,6 @@ item_db: (
notrade: true
noselltonpc: true
nocart: true
- nostorage: true
nogstorage: true
nomail: true
noauction: true
@@ -59893,7 +59819,6 @@ item_db: (
notrade: true
noselltonpc: true
nocart: true
- nostorage: true
nogstorage: true
nomail: true
noauction: true
@@ -59909,7 +59834,6 @@ item_db: (
notrade: true
noselltonpc: true
nocart: true
- nostorage: true
nogstorage: true
nomail: true
noauction: true
@@ -61089,9 +61013,6 @@ item_db: (
Trade: {
nodrop: true
noselltonpc: true
- nogstorage: true
- nomail: true
- noauction: true
}
},
{
@@ -64764,6 +64685,14 @@ item_db: (
AegisName: "Solo_Troops_Badge"
Name: "Single Union Badge"
Buy: 0
+ Trade: {
+ nodrop: true
+ notrade: true
+ nocart: true
+ nogstorage: true
+ nomail: true
+ noauction: true
+ }
},
{
Id: 6913
@@ -66427,6 +66356,10 @@ item_db: (
Buy: 0
BuyingStore: true
Trade: {
+ nodrop: true
+ notrade: true
+ nocart: true
+ nostorage: true
nogstorage: true
nomail: true
noauction: true
@@ -71039,8 +70972,6 @@ item_db: (
Weight: 10
Trade: {
noselltonpc: true
- nomail: true
- noauction: true
}
},
{
@@ -71051,8 +70982,6 @@ item_db: (
Weight: 10
Trade: {
noselltonpc: true
- nomail: true
- noauction: true
}
},
{
@@ -71063,8 +70992,6 @@ item_db: (
Weight: 10
Trade: {
noselltonpc: true
- nomail: true
- noauction: true
}
},
{
@@ -71075,8 +71002,6 @@ item_db: (
Weight: 10
Trade: {
noselltonpc: true
- nomail: true
- noauction: true
}
},
{
@@ -71087,8 +71012,6 @@ item_db: (
Weight: 10
Trade: {
noselltonpc: true
- nomail: true
- noauction: true
}
},
{
@@ -71099,8 +71022,6 @@ item_db: (
Weight: 10
Trade: {
noselltonpc: true
- nomail: true
- noauction: true
}
},
{
@@ -71111,8 +71032,6 @@ item_db: (
Weight: 10
Trade: {
noselltonpc: true
- nomail: true
- noauction: true
}
},
{
@@ -71123,8 +71042,6 @@ item_db: (
Weight: 10
Trade: {
noselltonpc: true
- nomail: true
- noauction: true
}
},
{
@@ -71135,8 +71052,6 @@ item_db: (
Weight: 10
Trade: {
noselltonpc: true
- nomail: true
- noauction: true
}
},
{
@@ -71147,8 +71062,6 @@ item_db: (
Weight: 10
Trade: {
noselltonpc: true
- nomail: true
- noauction: true
}
},
{
@@ -71159,8 +71072,6 @@ item_db: (
Weight: 10
Trade: {
noselltonpc: true
- nomail: true
- noauction: true
}
},
{
@@ -71171,8 +71082,6 @@ item_db: (
Weight: 10
Trade: {
noselltonpc: true
- nomail: true
- noauction: true
}
},
{
@@ -73451,9 +73360,6 @@ item_db: (
Buy: 0
Trade: {
nodrop: true
- nogstorage: true
- nomail: true
- noauction: true
}
},
{
@@ -73463,9 +73369,6 @@ item_db: (
Buy: 0
Trade: {
nodrop: true
- nogstorage: true
- nomail: true
- noauction: true
}
},
{
@@ -74004,10 +73907,6 @@ item_db: (
Buy: 20
Trade: {
nodrop: true
- nocart: true
- nogstorage: true
- nomail: true
- noauction: true
}
},
{
@@ -77358,8 +77257,8 @@ item_db: (
Buy: 0
Weight: 80
Script: <"
- if(gettime(5)!=MDiceCone) {
- MDiceCone = gettime(5);
+ if (gettime(GETTIME_DAYOFMONTH) != MDiceCone) {
+ MDiceCone = gettime(GETTIME_DAYOFMONTH);
percentheal 50,50;
}
">
@@ -80077,6 +79976,7 @@ item_db: (
notrade: true
noselltonpc: true
nocart: true
+ nostorage: true
nogstorage: true
nomail: true
noauction: true
@@ -80882,7 +80782,7 @@ item_db: (
Weight: 80
Script: <"
specialeffect2 EF_STEAL;
- sc_start SC_INCHITRATE,120000,5;
+ sc_start2 SC_ACARAJE,120000,5,10;
">
},
{
@@ -81714,7 +81614,7 @@ item_db: (
Weight: 50
BuyingStore: true
Script: <"
- sc_start SC_VITATA_500,500000,0;
+ sc_start2 SC_VITATA_500,500000,20,5;
heal 0,200;
">
},
@@ -83841,12 +83741,6 @@ item_db: (
Type: 0
Buy: 0
Weight: 50
- Trade: {
- nocart: true
- nogstorage: true
- nomail: true
- noauction: true
- }
Script: <" percentheal 3,3; ">
},
{
@@ -84490,7 +84384,7 @@ item_db: (
Buy: 2
Weight: 100
EquipLv: 130
- Script: <" getitem 1776,200; ">
+ Script: <" getitem Siege_Arrow_S,200; ">
},
{
Id: 12678
@@ -84500,7 +84394,7 @@ item_db: (
Buy: 2
Weight: 100
EquipLv: 95
- Script: <" getitem 1775,200; ">
+ Script: <" getitem Siege_Arrow_A,200; ">
},
{
Id: 12679
@@ -85902,6 +85796,15 @@ item_db: (
Id: 12845
AegisName: "Amatsu_Butterfly_Wing"
Name: "Amatsu Butterfly Wing"
+ Trade: {
+ nodrop: true
+ notrade: true
+ nocart: true
+ nostorage: true
+ nogstorage: true
+ nomail: true
+ noauction: true
+ }
},
{
Id: 12846
@@ -85926,6 +85829,7 @@ item_db: (
notrade: true
noselltonpc: true
nocart: true
+ nostorage: true
nogstorage: true
nomail: true
noauction: true
@@ -88832,9 +88736,6 @@ item_db: (
View: 1
Trade: {
nodrop: true
- nogstorage: true
- nomail: true
- noauction: true
}
Script: <"
if(getrefine()>=3) {
@@ -113870,7 +113771,6 @@ item_db: (
Script: <" packageitem(); ">
},
{
-
Id: 16381
AegisName: "WoE_Teleport_Scroll_100_Box"
Name: "WoE Teleport Scroll 100 Box"
@@ -114151,15 +114051,6 @@ item_db: (
Type: 18
Buy: 20
Weight: 10
- Trade: {
- nodrop: true
- notrade: true
- noselltonpc: true
- nocart: true
- nogstorage: true
- nomail: true
- noauction: true
- }
Script: <" getitem 12212,500; ">
},
{
@@ -114169,15 +114060,6 @@ item_db: (
Type: 18
Buy: 20
Weight: 10
- Trade: {
- nodrop: true
- notrade: true
- noselltonpc: true
- nocart: true
- nogstorage: true
- nomail: true
- noauction: true
- }
Script: <" getitem 14529,30; ">
},
{
@@ -114187,15 +114069,6 @@ item_db: (
Type: 18
Buy: 20
Weight: 10
- Trade: {
- nodrop: true
- notrade: true
- noselltonpc: true
- nocart: true
- nogstorage: true
- nomail: true
- noauction: true
- }
Script: <"
getitem 12208,10;
getitem 12210,10;
@@ -114219,15 +114092,6 @@ item_db: (
Type: 18
Buy: 20
Weight: 10
- Trade: {
- nodrop: true
- notrade: true
- noselltonpc: true
- nocart: true
- nogstorage: true
- nomail: true
- noauction: true
- }
Script: <" rentitem 1174,604800; ">
},
{
@@ -114237,15 +114101,6 @@ item_db: (
Type: 18
Buy: 20
Weight: 10
- Trade: {
- nodrop: true
- notrade: true
- noselltonpc: true
- nocart: true
- nogstorage: true
- nomail: true
- noauction: true
- }
Script: <" rentitem 13402,604800; ">
},
{
@@ -114255,15 +114110,6 @@ item_db: (
Type: 18
Buy: 20
Weight: 10
- Trade: {
- nodrop: true
- notrade: true
- noselltonpc: true
- nocart: true
- nogstorage: true
- nomail: true
- noauction: true
- }
Script: <" rentitem 13026,604800; ">
},
{
@@ -114273,15 +114119,6 @@ item_db: (
Type: 18
Buy: 20
Weight: 10
- Trade: {
- nodrop: true
- notrade: true
- noselltonpc: true
- nocart: true
- nogstorage: true
- nomail: true
- noauction: true
- }
Script: <" rentitem 1534,604800; ">
},
{
@@ -114291,15 +114128,6 @@ item_db: (
Type: 18
Buy: 20
Weight: 10
- Trade: {
- nodrop: true
- notrade: true
- noselltonpc: true
- nocart: true
- nogstorage: true
- nomail: true
- noauction: true
- }
Script: <" rentitem 13403,604800; ">
},
{
@@ -114309,15 +114137,6 @@ item_db: (
Type: 18
Buy: 20
Weight: 10
- Trade: {
- nodrop: true
- notrade: true
- noselltonpc: true
- nocart: true
- nogstorage: true
- nomail: true
- noauction: true
- }
Script: <" rentitem 1374,604800; ">
},
{
@@ -114327,15 +114146,6 @@ item_db: (
Type: 18
Buy: 20
Weight: 10
- Trade: {
- nodrop: true
- notrade: true
- noselltonpc: true
- nocart: true
- nogstorage: true
- nomail: true
- noauction: true
- }
Script: <" rentitem 1729,604800; ">
},
{
@@ -114345,15 +114155,6 @@ item_db: (
Type: 18
Buy: 20
Weight: 10
- Trade: {
- nodrop: true
- notrade: true
- noselltonpc: true
- nocart: true
- nogstorage: true
- nomail: true
- noauction: true
- }
Script: <" rentitem 1419,604800; ">
},
{
@@ -123024,6 +122825,7 @@ item_db: (
bonus bUnbreakableHelm,0;
bonus bAllStats,5;
bonus bMdef,5;
+ skill AL_TELEPORT,1;
">
},
{
@@ -123052,6 +122854,7 @@ item_db: (
bonus bUnbreakableHelm,0;
bonus bAllStats,4;
bonus bMdef,5;
+ skill AL_TELEPORT,1;
">
},
{
@@ -123080,6 +122883,7 @@ item_db: (
bonus bUnbreakableHelm,0;
bonus bAllStats,3;
bonus bMdef,5;
+ skill AL_TELEPORT,1;
">
},
{
@@ -125785,7 +125589,6 @@ item_db: (
Name: "Costume Invisible Cap"
Type: 5
Loc: 4096
- View: 0
},
{
Id: 19603
@@ -125803,7 +125606,6 @@ item_db: (
Name: "Costume Invisible Mask"
Type: 5
Loc: 4096
- View: 0
},
{
Id: 19605
@@ -127957,6 +127759,10 @@ item_db: (
Type: 5
Loc: 7168
View: 549
+ Trade: {
+ nomail: true
+ noauction: true
+ }
},
{
Id: 19876
@@ -128005,6 +127811,10 @@ item_db: (
Type: 5
Loc: 1024
View: 1085
+ Trade: {
+ nomail: true
+ noauction: true
+ }
},
{
Id: 19882
@@ -129729,6 +129539,8 @@ item_db: (
Type: 5
Loc: 1024
View: 1239
+ OnEquipScript: <" sc_start SC_LJOSALFAR,-1,0; ">
+ OnUnequipScript: <" sc_end SC_LJOSALFAR; ">
},
{
Id: 20100
@@ -130694,6 +130506,8 @@ item_db: (
Type: 5
Loc: 1024
View: 1299
+ OnEquipScript: <" sc_start SC_MERMAID_LONGING,-1,0; ">
+ OnUnequipScript: <" sc_end SC_MERMAID_LONGING; ">
},
{
Id: 20210
@@ -133213,7 +133027,6 @@ item_db: (
Type: 2
Buy: 20
Weight: 10
- Upper: 63
Script: <" sc_start SC_FOOD_INT,3600000,30; ">
},
{
@@ -133222,7 +133035,6 @@ item_db: (
Name: "Hangul Day Event Box"
Type: 2
Buy: 20
- Upper: 63
Script: <"
getitem 22675,10;
getitem 607,9;
@@ -133234,7 +133046,6 @@ item_db: (
Name: "Death Bin"
Type: 18
Buy: 10
- Upper: 63
EquipLv: 170
Script: <" /* ToDo */ ">
},
@@ -133244,7 +133055,14 @@ item_db: (
Name: "Single Union Christmas Gift"
Type: 2
Buy: 0
- Upper: 63
+ Trade: {
+ nodrop: true
+ notrade: true
+ nocart: true
+ nogstorage: true
+ nomail: true
+ noauction: true
+ }
Script: <" /* ToDo GroupItem */ ">
},
{
@@ -133254,7 +133072,6 @@ item_db: (
Type: 0
Buy: 0
Weight: 50
- Upper: 63
Script: <" percentheal 5,5; ">
},
{
diff --git a/db/sc_config.txt b/db/sc_config.txt
index 650409f6c..9ae43aaa0 100644
--- a/db/sc_config.txt
+++ b/db/sc_config.txt
@@ -397,7 +397,8 @@ SC_MTF_MLEATKED,12
SC_MTF_CRIDAMAGE, 12
SC_FULL_THROTTLE, 18
SC_REBOUND, 18
-SC_TELEKINESIS_INTENSE,18
+SC_TELEKINESIS_INTENSE, 18
+SC_ACARAJE, 64
//Guild Auras should not be saved
SC_LEADERSHIP,78
@@ -439,6 +440,8 @@ SC_MOONSTAR, 207
SC_SUPER_STAR, 207
SC_STRANGELIGHTS, 207
SC_DECORATION_OF_MUSIC, 207
+SC_LJOSALFAR, 207
+SC_MERMAID_LONGING, 207
//Cant Clear
SC_ALL_RIDING, 141
diff --git a/doc/item_db.txt b/doc/item_db.txt
index 6b34b8daf..b2afc5612 100644
--- a/doc/item_db.txt
+++ b/doc/item_db.txt
@@ -34,6 +34,7 @@ item_db: (
Refine: Refineable (boolean, defaults to true)
View: View ID (int, defaults to 0)
BindOnEquip: true/false (boolean, defaults to false)
+ ForceSerial: true/false (boolean, defaults to false)
BuyingStore: true/false (boolean, defaults to false)
Delay: Delay to use item (int, defaults to 0)
KeepAfterUse: true/false (boolean, defaults to false)
@@ -243,6 +244,10 @@ BindOnEquip: Whether the item will automatically bind to the character when it
will display a confirmation dialog the first time it is equipped,
and, if accepted, the item will become character-bound.
+ForceSerial: Whether the item will be given new unique id or not. When the item
+ have this field as true, the item will be unstackable and new uniqueID
+ will be given to each item.
+
BuyingStore: Whether the item can be sold via buyingstore, one must also edit
data\buyingstoreitemlist.txt for client to accept item.
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 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.
---------------------------------------
//=====================================
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!
diff --git a/log/empty.txt b/log/empty.txt
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/log/empty.txt
diff --git a/npc/airports/airships.txt b/npc/airports/airships.txt
index 9a9941e25..58652ab56 100644
--- a/npc/airports/airships.txt
+++ b/npc/airports/airships.txt
@@ -1135,18 +1135,18 @@ airplane_01,32,61,4 script Nils#ein 1_M_03,1,1,{
mes .@line1_1$[.@wordtest];
mes .@line1_2$[.@wordtest];
mes .@line1_3$[.@wordtest];
- .@start_time = gettime(3)*60*60 + gettime(2)*60 + gettime(1);
+ .@start_time = gettime(GETTIME_HOUR)*60*60 + gettime(GETTIME_MINUTE)*60 + gettime(GETTIME_SECOND);
next;
input .@save1$;
- .@end_time = gettime(3)*60*60 + gettime(2)*60 + gettime(1);
+ .@end_time = gettime(GETTIME_HOUR)*60*60 + gettime(GETTIME_MINUTE)*60 + gettime(GETTIME_SECOND);
.@total_time = .@end_time - .@start_time;
mes "[Nils]";
mes .@line2_1$[.@wordtest];
mes .@line2_2$[.@wordtest];
- .@start_time = gettime(3)*60*60 + gettime(2)*60 + gettime(1);
+ .@start_time = gettime(GETTIME_HOUR)*60*60 + gettime(GETTIME_MINUTE)*60 + gettime(GETTIME_SECOND);
next;
input .@save2$;
- .@end_time = gettime(3)*60*60 + gettime(2)*60 + gettime(1);
+ .@end_time = gettime(GETTIME_HOUR)*60*60 + gettime(GETTIME_MINUTE)*60 + gettime(GETTIME_SECOND);
.@total_time = .@total_time + (.@start_time - .@end_time);
.@tasoo = (.@letters[.@wordtest] / .@total_time) * 6;
if ((.@save1$ == .@word1$[.@wordtest]) && (.@save2$ == .@word2$[.@wordtest])) {
diff --git a/npc/custom/bgqueue/flavius.txt b/npc/custom/bgqueue/flavius.txt
index f93821264..99a4d5e0a 100644
--- a/npc/custom/bgqueue/flavius.txt
+++ b/npc/custom/bgqueue/flavius.txt
@@ -33,8 +33,8 @@ OnPlayerListReady:
set $@Croix_QueueBG1, queue();
set $@Guill_QueueBG1, queue();
- queueopt($@Guill_QueueBG1,HQO_OnLogout,"start#bat_b01::OnGuillaumeQuit");
- queueopt($@Croix_QueueBG1,HQO_OnLogout,"start#bat_b01::OnCroixQuit");
+ queueopt($@Guill_QueueBG1, QUEUEOPT_LOGOUT, "start#bat_b01::OnGuillaumeQuit");
+ queueopt($@Croix_QueueBG1, QUEUEOPT_LOGOUT, "start#bat_b01::OnCroixQuit");
set .@i, 0;
@@ -143,8 +143,8 @@ OnPlayerListReady:
bg_warp $@FlaviusBG1_id2,"bat_b01",311,224;
/* after warp */
- queueopt($@Guill_QueueBG1,HQO_OnMapChange,"start#bat_b01::OnGuillaumeQuit");
- queueopt($@Croix_QueueBG1,HQO_OnMapChange,"start#bat_b01::OnCroixQuit");
+ queueopt($@Guill_QueueBG1, QUEUEOPT_MAPCHANGE, "start#bat_b01::OnGuillaumeQuit");
+ queueopt($@Croix_QueueBG1, QUEUEOPT_MAPCHANGE, "start#bat_b01::OnCroixQuit");
donpcevent "countdown#bat_b01::OnEnable";
end;
diff --git a/npc/custom/etc/airplane.txt b/npc/custom/etc/airplane.txt
index fc79584fe..544dbed61 100644
--- a/npc/custom/etc/airplane.txt
+++ b/npc/custom/etc/airplane.txt
@@ -385,7 +385,7 @@ function script F_Itin {
seta:
set @tempo, @tempo + 1;
- set @time, gettime(3);
+ set @time, gettime(GETTIME_HOUR);
set @minutes, 5 * @tempo - 5;
set @minutess, 5 * @tempo - 2;
if(@minutes<10)set @minutes$, "0" + @minutes;
@@ -406,7 +406,7 @@ seta:
setb:
if($@currenttime - 1==@tempo)goto setc;
set @tempo, @tempo + 1;
- set @time, gettime(3) + 1;
+ set @time, gettime(GETTIME_HOUR) + 1;
set @minutes, 5 * @tempo - 5;
set @minutess, 5 * @tempo - 2;
if(@minutes<10)set @minutes$, "0" + @minutes;
diff --git a/npc/custom/etc/bank_kafra.txt b/npc/custom/etc/bank_kafra.txt
index ea662499f..c4e16a9ec 100644
--- a/npc/custom/etc/bank_kafra.txt
+++ b/npc/custom/etc/bank_kafra.txt
@@ -22,7 +22,7 @@
mes"[Maniss]";
mes strcharinfo(0)+", welcome to the 2nd Bank of Prontera!";
- set @kb_int,(gettime(6)*31)+gettime(5); //today's number
+ set @kb_int,(gettime(GETTIME_MONTH)*31)+gettime(GETTIME_DAYOFMONTH); //today's number
set @income,0;
//calculate %
if (#kafrabank<=0 || #kb_int>=@kb_int) goto L_NoIncomeToday;
diff --git a/npc/custom/events/valentinesdayexp.txt b/npc/custom/events/valentinesdayexp.txt
index 4ed24012d..933afc647 100644
--- a/npc/custom/events/valentinesdayexp.txt
+++ b/npc/custom/events/valentinesdayexp.txt
@@ -19,7 +19,7 @@ prontera,156,172,4 script Tine 1_M_MERCHANT,{
// mes "@dsv: "+@dsv;
// mes "ispartneron()=="+ispartneron();
// mes "sex == "+Sex;
-// if(@dsv == gettime(3)+1) mes "@dsv == gettime(3)+1";
+// if(@dsv == gettime(GETTIME_HOUR)+1) mes "@dsv == gettime(GETTIME_HOUR)+1";
mes "[Tine]";
mes "The legend says that on 14th February... on the Day of Saint Valentine...";
@@ -60,14 +60,14 @@ M_INFO:
OnInit:
//559,Hand-made_Chocolate
- setitemscript 559,"{ itemheal 50,50; if(Sex==0 || @dsv == gettime(3)+1 || ispartneron()==0)end; set @dsv,gettime(3)+1; misceffect 113; }";
+ setitemscript 559,"{ itemheal 50,50; if(Sex==0 || @dsv == gettime(GETTIME_HOUR)+1 || ispartneron()==0)end; set @dsv,gettime(GETTIME_HOUR)+1; misceffect 113; }";
//560,Hand-made_White_Chocolate
- setitemscript 560,"{ itemheal 50,50; if(Sex || @dsv == gettime(3)+1 || ispartneron()==0)end; set @dsv,gettime(3)+1; misceffect 113; }";
+ setitemscript 560,"{ itemheal 50,50; if(Sex || @dsv == gettime(GETTIME_HOUR)+1 || ispartneron()==0)end; set @dsv,gettime(GETTIME_HOUR)+1; misceffect 113; }";
//2634,Wedding_Ring_M,Wedding Ring,5,,10,0,,0,,0,127918079,7,1,136,,0,0,0,{ skill 334,1; skill 335,1; skill 336,1; }
- setitemscript 2634,"{ skill 334,1; skill 335,1; skill 336,1; if(@dsv == gettime(3)+1 && ispartneron()){ bonus2 bExpAddRace,5,50; bonus2 bExpAddRace,6,50; bonus2 bExpAddRace,7,50; bonus2 bExpAddRace,8,50; bonus2 bExpAddRace,1,50; } }";
+ setitemscript 2634,"{ skill 334,1; skill 335,1; skill 336,1; if(@dsv == gettime(GETTIME_HOUR)+1 && ispartneron()){ bonus2 bExpAddRace,5,50; bonus2 bExpAddRace,6,50; bonus2 bExpAddRace,7,50; bonus2 bExpAddRace,8,50; bonus2 bExpAddRace,1,50; } }";
//2635,Wedding_Ring_F,Wedding Ring,5,,10,0,,0,,0,127918079,7,0,136,,0,0,0,{ skill 334,1; skill 335,1; skill 336,1; }
- setitemscript 2635,"{ skill 334,1; skill 335,1; skill 336,1; if(@dsv == gettime(3)+1 && ispartneron()){ bonus2 bExpAddRace,0,50; bonus2 bExpAddRace,9,50; bonus2 bExpAddRace,2,50; bonus2 bExpAddRace,3,50; bonus2 bExpAddRace,4,50; } }";
+ setitemscript 2635,"{ skill 334,1; skill 335,1; skill 336,1; if(@dsv == gettime(GETTIME_HOUR)+1 && ispartneron()){ bonus2 bExpAddRace,0,50; bonus2 bExpAddRace,9,50; bonus2 bExpAddRace,2,50; bonus2 bExpAddRace,3,50; bonus2 bExpAddRace,4,50; } }";
end;
}
diff --git a/npc/custom/events/xmas_rings_event.txt b/npc/custom/events/xmas_rings_event.txt
index e031ea129..71be79aa5 100644
--- a/npc/custom/events/xmas_rings_event.txt
+++ b/npc/custom/events/xmas_rings_event.txt
@@ -89,7 +89,7 @@ M_QUEST:
OnInit:
//Santa's Hat
- setitemscript 2236,"{ bonus bMdef,1; bonus bLuk,1; if(isequipped(2636,2637)){if(@xmr == gettime(2))end; set @xmr,gettime(2); misceffect 410; end;} if(isequipped(2636)){if(@xmr == gettime(2))end; set @xmr,gettime(2); misceffect 72;} if(isequipped(2637)){if(@xmr == gettime(2))end; set @xmr,gettime(2); misceffect 338;}}";
+ setitemscript 2236,"{ bonus bMdef,1; bonus bLuk,1; if(isequipped(2636,2637)){if(@xmr == gettime(GETTIME_MINUTE))end; set @xmr,gettime(GETTIME_MINUTE); misceffect 410; end;} if(isequipped(2636)){if(@xmr == gettime(GETTIME_MINUTE))end; set @xmr,gettime(GETTIME_MINUTE); misceffect 72;} if(isequipped(2637)){if(@xmr == gettime(GETTIME_MINUTE))end; set @xmr,gettime(GETTIME_MINUTE); misceffect 338;}}";
//Gold Xmas Ring
setitemscript 2636,"{ bonus bLoseSPWhenUnequip,30; if(isequipped(2236)==0)end; if(getskilllv(\"AL_HEAL\")){skill \"TF_HIDING\",4+isequipped(2637);}else{skill \"AL_HEAL\",1+4*isequipped(2637);} }";
//Silver Xmas Ring
diff --git a/npc/custom/quests/thq/THQS_QuestNPC.txt b/npc/custom/quests/thq/THQS_QuestNPC.txt
index d4e058fb4..9b655625c 100644
--- a/npc/custom/quests/thq/THQS_QuestNPC.txt
+++ b/npc/custom/quests/thq/THQS_QuestNPC.txt
@@ -44,7 +44,7 @@ N_PayZeny:
set On_Quest, 0;
Zeny -= 2500;
//add time delay penalty. You can get another quest after 2 - 3 hours. [Lupus]
- set #THQ_DELAY, (gettime(7)*12*31*24+gettime(6)*31*24+gettime(5)*24+gettime(3)+rand(2,3));
+ set #THQ_DELAY, (gettime(GETTIME_YEAR)*12*31*24+gettime(GETTIME_MONTH)*31*24+gettime(GETTIME_DAYOFMONTH)*24+gettime(GETTIME_HOUR)+rand(2,3));
mes "[Guy]";
mes "Its sad to see someone give a quest up...";
mes "Shame on you.";
@@ -59,7 +59,7 @@ N_ZenyFail:
N_NewQuest:
if (Event_THQS == 0) goto N_Signup;
//checking if time penalty is over [Lupus]
- if (#THQ_DELAY > (gettime(7)*12*31*24 + gettime(6)*31*24 + gettime(5)*24 + gettime(3)) ) goto L_NoQuestsForYet;
+ if (#THQ_DELAY > (gettime(GETTIME_YEAR)*12*31*24 + gettime(GETTIME_MONTH)*31*24 + gettime(GETTIME_DAYOFMONTH)*24 + gettime(GETTIME_HOUR)) ) goto L_NoQuestsForYet;
mes "[Guy]";
mes "Ahh welcome fellow Treasure Hunter.";
mes "You currently have ^FF0000"+#Treasure_Token+"^000000 treasure tokens!!!";
@@ -71,7 +71,7 @@ N_NewQuest:
mes "Ok lets see what quest we can give you today.";
mes "The quest names in ^FF0000This Colour^000000 mean that they are more challanging then the rest, but have better rewards.";
next;
- set #THQ_DELAY,(gettime(7)*12*31*24+gettime(6)*31*24+gettime(5)*24+gettime(3) + 1); //you can get another quest after 1 hour [Lupus]
+ set #THQ_DELAY,(gettime(GETTIME_YEAR)*12*31*24+gettime(GETTIME_MONTH)*31*24+gettime(GETTIME_DAYOFMONTH)*24+gettime(GETTIME_HOUR) + 1); //you can get another quest after 1 hour [Lupus]
emotion 21;
if(@treasure_job==0) set @treasure_job,rand(1,10); //doesn't allow cheaters to pick any quest they want
if(@treasure_job==2) goto N_JobList2;
@@ -100,7 +100,7 @@ N_Signup:
L_NoQuestsForYet:
mes "[Guy]";
mes "I'm afraid there aren't any Quests for you yet.";
- mes "Call in "+ (#THQ_DELAY - (gettime(7)*12*31*24+gettime(6)*31*24+gettime(5)*24+gettime(3)) )+" hours later.";
+ mes "Call in "+ (#THQ_DELAY - (gettime(GETTIME_YEAR)*12*31*24+gettime(GETTIME_MONTH)*31*24+gettime(GETTIME_DAYOFMONTH)*24+gettime(GETTIME_HOUR)) )+" hours later.";
emotion 17;
close;
diff --git a/npc/custom/woe_controller.txt b/npc/custom/woe_controller.txt
index ec5bb3d81..9e35d1ef7 100644
--- a/npc/custom/woe_controller.txt
+++ b/npc/custom/woe_controller.txt
@@ -102,7 +102,7 @@ OnMinute00:
freeloop(1);
if (agitcheck() || agitcheck2()) {
for(set .@i,0; .@i<.Size; set .@i,.@i+4)
- if (gettime(4) == $WOE_CONTROL[.@i] && gettime(3) == $WOE_CONTROL[.@i+2]) {
+ if (gettime(GETTIME_WEEKDAY) == $WOE_CONTROL[.@i] && gettime(GETTIME_HOUR) == $WOE_CONTROL[.@i+2]) {
OnWOEEnd:
announce "The War Of Emperium is over!",bc_all|bc_woe;
agitend; agitend2;
@@ -120,7 +120,7 @@ OnMinute00:
if ((!agitcheck() && !agitcheck2()) || .Init) {
if (!agitcheck() && !agitcheck2()) set .Init,0;
for(set .@i,0; .@i<.Size; set .@i,.@i+4)
- if (gettime(4) == $WOE_CONTROL[.@i] && gettime(3) >= $WOE_CONTROL[.@i+1] && gettime(3) < $WOE_CONTROL[.@i+2]) {
+ if (gettime(GETTIME_WEEKDAY) == $WOE_CONTROL[.@i] && gettime(GETTIME_HOUR) >= $WOE_CONTROL[.@i+1] && gettime(GETTIME_HOUR) < $WOE_CONTROL[.@i+2]) {
deletearray .Active[0],2;
set .Active[0], $WOE_CONTROL[.@i+3];
if (.Init) { agitend; agitend2; }
@@ -208,7 +208,7 @@ while(1) {
if (agitcheck() || agitcheck2()) {
if (.Active[0]) {
for(set .@i,0; .@i<.Size; set .@i,.@i+4)
- if (gettime(4) == $WOE_CONTROL[.@i] && gettime(3) >= $WOE_CONTROL[.@i+1] && gettime(3) < $WOE_CONTROL[.@i+2]) {
+ if (gettime(GETTIME_WEEKDAY) == $WOE_CONTROL[.@i] && gettime(GETTIME_HOUR) >= $WOE_CONTROL[.@i+1] && gettime(GETTIME_HOUR) < $WOE_CONTROL[.@i+2]) {
set .@i, $WOE_CONTROL[.@i+2];
break;
}
@@ -220,7 +220,7 @@ while(1) {
mes "The War of Emperium is ^0055FFactive^000000.";
} else {
for(set .@i,0; .@i<.Size; set .@i,.@i+4)
- if ((gettime(4) == $WOE_CONTROL[.@i] && gettime(3) <= $WOE_CONTROL[.@i+1]) || gettime(4) < $WOE_CONTROL[.@i]) {
+ if ((gettime(GETTIME_WEEKDAY) == $WOE_CONTROL[.@i] && gettime(GETTIME_HOUR) <= $WOE_CONTROL[.@i+1]) || gettime(GETTIME_WEEKDAY) < $WOE_CONTROL[.@i]) {
setarray .@time[0],$WOE_CONTROL[.@i],$WOE_CONTROL[.@i+1];
break;
}
diff --git a/npc/events/idul_fitri.txt b/npc/events/idul_fitri.txt
index 97d018f0a..df24208eb 100644
--- a/npc/events/idul_fitri.txt
+++ b/npc/events/idul_fitri.txt
@@ -12,7 +12,7 @@
prontera,146,92,3 script Cellerb 1_M_MERCHANT,{
mes "[Staff Idul Fitri]";
- if((gettime(6)==10 && (gettime(5)==24 || gettime(5)==25))==0) {
+ if ((gettime(GETTIME_MONTH)==OCTOBER && (gettime(GETTIME_DAYOFMONTH)==24 || gettime(GETTIME_DAYOFMONTH)==25))==0) {
mes "Congratulation! Celebrate Feast Day Of Ramadan Idul Fitri 1427 H.";
specialeffect EF_SANDMAN;
close;
diff --git a/npc/other/Global_Functions.txt b/npc/other/Global_Functions.txt
index ff5b78b2d..dc675f8d0 100644
--- a/npc/other/Global_Functions.txt
+++ b/npc/other/Global_Functions.txt
@@ -46,10 +46,10 @@
// Returns a number with commas based on precision of digits and custom separator.
// -- callfunc "F_InsertComma",<number>{,<precision>,<separator>}
// Examples:
-// callfunc("F_InsertComma",7777777{,<precision>,<separator>}) // returns "7,777,777"
-// callfunc("F_InsertComma",1000000000,3,","}) // returns "1,000,000,000"
-// callfunc("F_InsertComma",1000000000,3,"_"}) // returns "1_000_000_000"
-// callfunc("F_InsertComma",1000000000,4) // returns "10,0000,0000"
+// callfunc("F_InsertComma",7777777) // returns "7,777,777"
+// callfunc("F_InsertComma",1000000000,3,",") // returns "1,000,000,000"
+// callfunc("F_InsertComma",1000000000,3,"_") // returns "1_000_000_000"
+// callfunc("F_InsertComma",1000000000,4) // returns "10,0000,0000"
//////////////////////////////////////////////////////////////////////////////////
function script F_InsertComma {
.@value = getarg(0);
diff --git a/npc/other/arena/arena_lvl50.txt b/npc/other/arena/arena_lvl50.txt
index 9c91c684c..2c1301368 100644
--- a/npc/other/arena/arena_lvl50.txt
+++ b/npc/other/arena/arena_lvl50.txt
@@ -37,8 +37,8 @@ force_1-1,99,20,4 script Heel and Toe#arena 4_F_TELEPORTER,{
OnStart:
initnpctimer;
- $arena_min50st = gettime(2);
- $arena_sec50st = gettime(1);
+ $arena_min50st = gettime(GETTIME_MINUTE);
+ $arena_sec50st = gettime(GETTIME_SECOND);
end;
OnTimer3000:
@@ -774,8 +774,8 @@ OnMyMobDead:
donpcevent "Heel and Toe#arena::On09_End";
donpcevent "arena#50::OnReset_09";
donpcevent "arena#50::OnReset_All";
- $arena_min50end = gettime(2);
- $arena_sec50end = gettime(1);
+ $arena_min50end = gettime(GETTIME_MINUTE);
+ $arena_sec50end = gettime(GETTIME_SECOND);
}
end;
}
diff --git a/npc/other/arena/arena_lvl60.txt b/npc/other/arena/arena_lvl60.txt
index 51c29def1..71f80dcd4 100644
--- a/npc/other/arena/arena_lvl60.txt
+++ b/npc/other/arena/arena_lvl60.txt
@@ -38,8 +38,8 @@ force_2-1,99,20,4 script Minilover#arena 4_F_TELEPORTER,{
OnStart:
initnpctimer;
- $arena_min60st = gettime(2);
- $arena_sec60st = gettime(1);
+ $arena_min60st = gettime(GETTIME_MINUTE);
+ $arena_sec60st = gettime(GETTIME_SECOND);
end;
OnTimer3000:
@@ -784,8 +784,8 @@ OnMyMobDead:
donpcevent "Minilover#arena::On09_End";
donpcevent "arena#60::OnReset_09";
donpcevent "arena#60::OnReset_All";
- $arena_min60end = gettime(2);
- $arena_sec60end = gettime(1);
+ $arena_min60end = gettime(GETTIME_MINUTE);
+ $arena_sec60end = gettime(GETTIME_SECOND);
}
end;
}
diff --git a/npc/other/arena/arena_lvl70.txt b/npc/other/arena/arena_lvl70.txt
index 68805437f..889089107 100644
--- a/npc/other/arena/arena_lvl70.txt
+++ b/npc/other/arena/arena_lvl70.txt
@@ -37,8 +37,8 @@ force_3-1,99,20,4 script Cadillac#arena 4_F_TELEPORTER,{
OnStart:
initnpctimer;
- $arena_min70st = gettime(2);
- $arena_sec70st = gettime(1);
+ $arena_min70st = gettime(GETTIME_MINUTE);
+ $arena_sec70st = gettime(GETTIME_SECOND);
end;
OnTimer3000:
@@ -749,8 +749,8 @@ OnMyMobDead:
donpcevent "Cadillac#arena::On09_End";
donpcevent "arena#70::OnReset_09";
donpcevent "arena#70::OnReset_All";
- $arena_min70end = gettime(2);
- $arena_sec70end = gettime(1);
+ $arena_min70end = gettime(GETTIME_MINUTE);
+ $arena_sec70end = gettime(GETTIME_SECOND);
}
end;
}
diff --git a/npc/other/arena/arena_lvl80.txt b/npc/other/arena/arena_lvl80.txt
index 8690d992b..1529e555d 100644
--- a/npc/other/arena/arena_lvl80.txt
+++ b/npc/other/arena/arena_lvl80.txt
@@ -37,8 +37,8 @@ force_4-1,99,20,4 script Octus#arena 4_F_TELEPORTER,{
OnStart:
initnpctimer;
- $arena_min80st = gettime(2);
- $arena_sec80st = gettime(1);
+ $arena_min80st = gettime(GETTIME_MINUTE);
+ $arena_sec80st = gettime(GETTIME_SECOND);
end;
OnTimer3000:
@@ -730,8 +730,8 @@ OnMyMobDead:
donpcevent "Octus#arena::On09_End";
donpcevent "arena#80::OnReset_09";
donpcevent "arena#80::OnReset_All";
- $arena_min80end = gettime(2);
- $arena_sec80end = gettime(1);
+ $arena_min80end = gettime(GETTIME_MINUTE);
+ $arena_sec80end = gettime(GETTIME_SECOND);
}
end;
}
diff --git a/npc/other/arena/arena_party.txt b/npc/other/arena/arena_party.txt
index 717e69fd3..ac9c5ff53 100644
--- a/npc/other/arena/arena_party.txt
+++ b/npc/other/arena/arena_party.txt
@@ -147,8 +147,8 @@ OnTouch:
force_1-2,99,31,4 script Slipslowrun#party 4_F_TELEPORTER,{
OnStart:
initnpctimer;
- $arena_minptst = gettime(2);
- $arena_secptst = gettime(1);
+ $arena_minptst = gettime(GETTIME_MINUTE);
+ $arena_secptst = gettime(GETTIME_SECOND);
end;
OnTimer2000:
@@ -412,8 +412,8 @@ OnReset:
force_1-2,95,187,0 script force_09_exit WARPNPC,1,1,{
OnTouch:
- $arena_minptend = gettime(2);
- $arena_secptend = gettime(1);
+ $arena_minptend = gettime(GETTIME_MINUTE);
+ $arena_secptend = gettime(GETTIME_SECOND);
warp "prt_are_in",73,139;
donpcevent "#arn_timer_pt::OnEnter";
donpcevent "arena_p::OnReset";
diff --git a/npc/other/comodo_gambling.txt b/npc/other/comodo_gambling.txt
index 3d0e2b389..e5631049b 100644
--- a/npc/other/comodo_gambling.txt
+++ b/npc/other/comodo_gambling.txt
@@ -219,7 +219,7 @@ comodo,219,158,6 script Kachua 4_F_02,{
else if ((.@gamble1 > 150) && (.@gamble1 < 201)) .@item = 2304; // Jacket[1]
else if ((.@gamble1 > 200) && (.@gamble1 < 251)) .@item = 2305; // Adventurer's Suit
else if ((.@gamble1 > 250) && (.@gamble1 < 300)) .@item = 2301; // Cotton Shirt
- else if ((.@gamble1 > 301) && (.@gamble1 < 351)) .@item = 2307; // Mantle
+ else if ((.@gamble1 > 302) && (.@gamble1 < 351)) .@item = 2307; // Mantle
else if ((.@gamble1 > 350) && (.@gamble1 < 401)) .@item = 2309; // Coat
else if ((.@gamble1 > 400) && (.@gamble1 < 402)) .@item = 2322; // Silk Robe[1]
else if ((.@gamble1 > 401) && (.@gamble1 < 403)) .@item = 2310; // Coat[1]
@@ -371,7 +371,7 @@ comodo,219,158,6 script Kachua 4_F_02,{
else if ((.@gamble1 > 0) && (.@gamble1 < 201)) .@item = 2101; // Guard
else if ((.@gamble1 > 204) && (.@gamble1 < 301)) .@item = 2103; // Buckler
else if ((.@gamble1 > 300) && (.@gamble1 < 401)) .@item = 2107; // Mirror Shield
- else if ((.@gamble1 > 401) && (.@gamble1 < 481)) .@item = 2105; // Shield
+ else if ((.@gamble1 > 400) && (.@gamble1 < 481)) .@item = 2105; // Shield
else if ((.@gamble1 > 480) && (.@gamble1 < 501)) .@item = 2108; // Mirror Shield[1]
break;
default: // Cancel button / hack
diff --git a/npc/pre-re/merchants/shops.txt b/npc/pre-re/merchants/shops.txt
index d303f35b4..e18498015 100644
--- a/npc/pre-re/merchants/shops.txt
+++ b/npc/pre-re/merchants/shops.txt
@@ -3,20 +3,74 @@
//===== By: ==================================================
//= Daegaladh
//===== Current Version: =====================================
-//= 1.1
+//= 1.2
//===== Description: =========================================
//= Pre-renewal-specific town shop NPCs.
//===== Additional Comments: =================================
//= 1.0 First version.
//= 1.1 Moved Izlude shops to pre-re/re paths. [Streusel]
+//= 1.2 Converted to trader format. [Frost]
//============================================================
//=======================================================
// Izlude
//=======================================================
-izlude,105,99,0 shop Butcher#iz 1_M_JOBGUIDER,517:-1
-izlude,94,98,4 shop Fruit Gardener#iz 1_M_INNKEEPER,512:-1,513:-1,515:-1,516:-1
-izlude,105,92,7 shop Vendor from Milk Ranch#i 4_F_01,519:-1
-izlude,164,138,4 shop Pet Groomer#iz 4_F_TELEPORTER,537:-1,643:-1,10013:-1,10014:-1,554:-1,6113:-1,6114:-1,6115:-1
-izlude_in,115,61,0 shop Tool Dealer#iz 1_M_01,611:-1,501:-1,502:-1,503:-1,504:-1,506:-1,645:-1,656:-1,601:-1,602:-1,1065:-1,1750:-1
-izlude_in,121,64,3 shop Trading Merchant#iz 4_M_HUMERCHANT,13200:-1,13201:-1,13202:-1,13150:-1,13102:-1,13151:-1,13154:-1,13155:-1,13163:-1,13165:-1,13168:-1
+izlude,105,99,0 trader Butcher#iz 1_M_JOBGUIDER,{
+OnInit:
+ sellitem Meat;
+}
+
+izlude,94,98,4 trader Fruit Gardener#iz 1_M_INNKEEPER,{
+OnInit:
+ sellitem Apple;
+ sellitem Banana;
+ sellitem Carrot;
+ sellitem Sweet_Potato;
+}
+
+izlude,105,92,7 trader Vendor from Milk Ranch#i 4_F_01,{
+OnInit:
+ sellitem Milk;
+}
+
+izlude,164,138,4 trader Pet Groomer#iz 4_F_TELEPORTER,{
+OnInit:
+ sellitem Pet_Food;
+ sellitem Pet_Incubator;
+ sellitem Backpack;
+ sellitem Rocker_Glasses;
+ sellitem Mojji;
+ sellitem Vital_Flower_;
+ sellitem Flame_Gemstone;
+ sellitem Bun_;
+}
+
+izlude_in,115,61,0 trader Tool Dealer#iz 1_M_01,{
+OnInit:
+ sellitem Spectacles;
+ sellitem Red_Potion;
+ sellitem Orange_Potion;
+ sellitem Yellow_Potion;
+ sellitem Green_Potion;
+ sellitem Center_Potion;
+ sellitem Awakening_Potion;
+ sellitem Wing_Of_Fly;
+ sellitem Wing_Of_Butterfly;
+ sellitem Booby_Trap;
+ sellitem Arrow;
+}
+
+izlude_in,121,64,3 trader Trading Merchant#iz 4_M_HUMERCHANT,{
+OnInit:
+ sellitem Bullet;
+ sellitem Silver_Bullet;
+ sellitem Shell_Of_Blood;
+ sellitem Branch;
+ sellitem Crimson_Bolt;
+ sellitem The_Cyclone;
+ sellitem Rolling_Stone;
+ sellitem Black_Rose;
+ sellitem Long_Barrel;
+ sellitem Jungle_Carbine;
+ sellitem Thunder_P;
+}
diff --git a/npc/quests/first_class/tu_archer.txt b/npc/quests/first_class/tu_archer.txt
index e80dbe01d..2ca63f2f5 100644
--- a/npc/quests/first_class/tu_archer.txt
+++ b/npc/quests/first_class/tu_archer.txt
@@ -1400,7 +1400,7 @@ pay_arche,76,135,3 script #Target HIDDEN_NPC,{ end; }
- script ::Acolyte_Tu -1,{
mes "[Acolyte]";
if(tu_archer01 == 14){
- if(gettime(3) >= 18 && gettime(3) < 22){
+ if (gettime(GETTIME_HOUR) >= 18 && gettime(GETTIME_HOUR) < 22) {
mes "H-hello!";
mes "Umm, umm...";
mes "Are you R-Reidin Corse's";
@@ -1500,7 +1500,7 @@ pay_arche,76,135,3 script #Target HIDDEN_NPC,{ end; }
close;
}
} else if(tu_archer01 == 15){
- if((gettime(3) >= 18) && (gettime(3) < 22)){
+ if (gettime(GETTIME_HOUR) >= 18 && gettime(GETTIME_HOUR) < 22) {
mes "^666666Zzzzz...^000000";
mes "Wh-wha...?";
mes "Who are you?";
diff --git a/npc/quests/guildrelay.txt b/npc/quests/guildrelay.txt
index 25282ff56..6c12574f0 100644
--- a/npc/quests/guildrelay.txt
+++ b/npc/quests/guildrelay.txt
@@ -70,7 +70,7 @@
if (strcharinfo(0) == getguildmaster(.@GID)) {
if (guildrelay_q == 100) {
if (guildtime > 22) {
- if ((gettime(3) > 1) && (gettime(3) < guildtime)) {
+ if (gettime(GETTIME_HOUR) > 1 && gettime(GETTIME_HOUR) < guildtime) {
mes "[" + .@name$ + "]";
mes "Oh, you're back. So did you";
mes "rest up enough? I'm sure the";
@@ -127,7 +127,7 @@
}
}
else if (guildtime > 22) {
- if ((gettime(3) > 0) && (gettime(3) < guildtime)) {
+ if (gettime(GETTIME_HOUR) > 0 && gettime(GETTIME_HOUR) < guildtime) {
mes "[" + .@name$ + "]";
mes "Oh, you're back. So did you";
mes "rest up enough? I'm sure the";
@@ -182,8 +182,7 @@
mes "come back to me later.";
close;
}
- }
- else if ((gettime(3) - guildtime) > 2) {
+ } else if (gettime(GETTIME_HOUR) - guildtime > 2) {
mes "[" + .@name$ + "]";
mes "Oh, you're back. So did you";
mes "rest up enough? I'm sure the";
@@ -240,7 +239,9 @@
}
}
else if (guildrelay_q == 150) {
- if (((guildtime > 22) && (gettime(3) > 1) && (gettime(3) < guildtime)) || ((guildtime > 21) && (gettime(3) > 0) && (gettime(3) < guildtime)) || ((gettime(3) - guildtime) > 2)) {
+ if ((guildtime > 22 && gettime(GETTIME_HOUR) > 1 && gettime(GETTIME_HOUR) < guildtime)
+ || (guildtime > 21 && gettime(GETTIME_HOUR) > 0 && gettime(GETTIME_HOUR) < guildtime)
+ || (gettime(GETTIME_HOUR) - guildtime > 2)) {
mes "[" + .@name$ + "]";
mes "Ah, you look well rested,";
mes "master. It is now time for";
@@ -304,12 +305,12 @@
}
}
else if (guildrelay_q == 25) {
- if (((guildtime > 22) && ((gettime(3) > 4) && (gettime(3) < guildtime)))
- || ((guildtime > 21) && ((gettime(3) > 3) && (gettime(3) < guildtime)))
- || ((guildtime > 20) && ((gettime(3) > 2) && (gettime(3) < guildtime)))
- || ((guildtime > 19) && ((gettime(3) > 1) && (gettime(3) < guildtime)))
- || ((guildtime > 18) && ((gettime(3) > 0) && (gettime(3) < guildtime)))
- || ((gettime(3) - guildtime) > 5)) {
+ if ((guildtime > 22 && gettime(GETTIME_HOUR) > 4 && gettime(GETTIME_HOUR) < guildtime)
+ || (guildtime > 21 && gettime(GETTIME_HOUR) > 3 && gettime(GETTIME_HOUR) < guildtime)
+ || (guildtime > 20 && gettime(GETTIME_HOUR) > 2 && gettime(GETTIME_HOUR) < guildtime)
+ || (guildtime > 19 && gettime(GETTIME_HOUR) > 1 && gettime(GETTIME_HOUR) < guildtime)
+ || (guildtime > 18 && gettime(GETTIME_HOUR) > 0 && gettime(GETTIME_HOUR) < guildtime)
+ || gettime(GETTIME_HOUR) - guildtime > 5) {
mes "[" + .@name$ + "]";
mes "Ah, have you rested well,";
mes "master? Please excuse my";
@@ -413,7 +414,7 @@
mes "Hand me the spirit, and allow";
mes "me to give you your guild's reward.";
delitem 7239,1; //Soul_Of_Proceeding
- guildtime = gettime(3);
+ guildtime = gettime(GETTIME_HOUR);
guildrelay_q = 100;
.@incen_item = rand(1,100);
if ((.@incen_item > 0) && (.@incen_item < 25)) {
@@ -481,7 +482,7 @@
mes "challenges that you will all";
mes "face together. Good work!";
delitem 7245,1; //Soul_Of_Friendship
- guildtime = gettime(3);
+ guildtime = gettime(GETTIME_HOUR);
guildrelay_q = 150;
.@incen_item = rand(1,100);
if ((.@incen_item > 0) && (.@incen_item < 16)) {
@@ -574,7 +575,7 @@
mes "Tristan III, and share it with";
mes "guild. Once again, good work.";
delitem 7251,1; //Soul_Of_Victory
- guildtime = gettime(3);
+ guildtime = gettime(GETTIME_HOUR);
guildrelay_q = 25;
.@incen_item = rand(1,100);
if ((.@incen_item > 0) && (.@incen_item < 26)) {
@@ -1409,11 +1410,11 @@
mes "don't you worry about it.";
delitem 7235,1; //Soul_Of_Courage
guildrelay_q = 4;
- guildtime = gettime(3);
+ guildtime = gettime(GETTIME_HOUR);
close;
}
if ((guildtime > 22) && (guildrelay_q == 4) && (BaseJob == Job_Blacksmith)) {
- if ((gettime(3) > 2) && (gettime(3) < guildtime)) {
+ if (gettime(GETTIME_HOUR) > 2 && gettime(GETTIME_HOUR) < guildtime) {
mes "[" + .@name$ + "]";
mes "I guess enough time";
mes "has passed. You ready";
@@ -1427,7 +1428,7 @@
}
}
if ((guildtime > 21) && (guildrelay_q == 4) && (BaseJob == Job_Blacksmith)) {
- if ((gettime(3) > 0101) && (gettime(3) < guildtime)) {
+ if (gettime(GETTIME_HOUR) > 0101 && gettime(GETTIME_HOUR) < guildtime) { // FIXME[Haru]: hour is clearly wrong
mes "[" + .@name$ + "]";
mes "I guess enough time";
mes "has passed. You ready";
@@ -1441,7 +1442,7 @@
}
}
if ((guildtime > 20) && (guildrelay_q == 4) && (BaseJob == Job_Blacksmith)) {
- if ((gettime(3) > 0001) && (gettime(3) < guildtime)) {
+ if (gettime(GETTIME_HOUR) > 0001 && gettime(GETTIME_HOUR) < guildtime) { // FIXME[Haru]: Hour is probably wrong
mes "[" + .@name$ + "]";
mes "I guess enough time";
mes "has passed. You ready";
@@ -1454,7 +1455,7 @@
close;
}
}
- if ((gettime(3) - guildtime > 0300) && (guildrelay_q == 4) && (BaseJob == Job_Blacksmith)) {
+ if (gettime(GETTIME_HOUR) - guildtime > 0300 && guildrelay_q == 4 && BaseJob == Job_Blacksmith) { // FIXME[Haru]: Hour is clearly wrong
mes "[" + .@name$ + "]";
mes "I guess enough time";
mes "has passed. You ready";
@@ -1795,11 +1796,11 @@
mes "in order to be successful.";
delitem 7240,1; //Soul_Of_Confidence
guildrelay_q = 9;
- guildtime = gettime(3);
+ guildtime = gettime(GETTIME_HOUR);
close;
}
if ((guildtime > 22) && (guildrelay_q == 9) && (BaseJob == Job_Sage)) {
- if ((gettime(3) > 02) && (gettime(3) < guildtime)) {
+ if (gettime(GETTIME_HOUR) > 2 && gettime(GETTIME_HOUR) < guildtime) {
mes "[" + .@name$ + "]";
mes "So did you spend some";
mes "quality time with your";
@@ -1830,7 +1831,7 @@
}
}
else if ((guildtime > 21) && (guildrelay_q == 9) && (BaseJob == Job_Sage)) {
- if ((gettime(3) > 01) && (gettime(3) < guildtime)) {
+ if (gettime(GETTIME_HOUR) > 1 && gettime(GETTIME_HOUR) < guildtime) {
mes "[" + .@name$ + "]";
mes "So did you spend some";
mes "quality time with your";
@@ -1861,7 +1862,7 @@
}
}
else if ((guildtime > 20) && (guildrelay_q == 9) && (BaseJob == Job_Sage)) {
- if ((gettime(3) > 0) && (gettime(3) < guildtime)) {
+ if (gettime(GETTIME_HOUR) > 0 && gettime(GETTIME_HOUR) < guildtime) {
mes "[" + .@name$ + "]";
mes "So did you spend some";
mes "quality time with your";
@@ -1890,8 +1891,7 @@
mes "dreams, passions, and goals!";
close;
}
- }
- else if ((gettime(3) - guildtime > 3) && (guildrelay_q == 9) && (BaseJob == Job_Sage)) {
+ } else if (gettime(GETTIME_HOUR) - guildtime > 3 && guildrelay_q == 9 && BaseJob == Job_Sage) {
mes "[" + .@name$ + "]";
mes "So did you spend some";
mes "quality time with your";
@@ -2765,11 +2765,11 @@
mes "to your feelings this time...";
delitem 7249,1; //Soul_Of_Service
guildrelay_q = 21;
- guildtime = gettime(3);
+ guildtime = gettime(GETTIME_HOUR);
close;
}
if ((guildtime > 22) && (guildrelay_q == 21) && (BaseJob == Job_Crusader)) {
- if ((gettime(3) > 2) && (gettime(3) < guildtime)) {
+ if (gettime(GETTIME_HOUR) > 2 && gettime(GETTIME_HOUR) < guildtime) {
mes "[" + .@name$ + "]";
mes "Yes. You've come at just";
mes "the right time. Remember";
@@ -2791,7 +2791,7 @@
}
}
if ((guildtime > 21) && (guildrelay_q == 21) && (BaseJob == Job_Crusader)) {
- if ((gettime(3) > 1) && (gettime(3) < guildtime)) {
+ if (gettime(GETTIME_HOUR) > 1 && gettime(GETTIME_HOUR) < guildtime) {
mes "[" + .@name$ + "]";
mes "Yes. You've come at just";
mes "the right time. Remember";
@@ -2813,7 +2813,7 @@
}
}
if ((guildtime > 20) && (guildrelay_q == 21) && (BaseJob == Job_Crusader)) {
- if ((gettime(3) > 0) && (gettime(3) < guildtime)) {
+ if (gettime(GETTIME_HOUR) > 0 && gettime(GETTIME_HOUR) < guildtime) {
mes "[" + .@name$ + "]";
mes "Yes. You've come at just";
mes "the right time. Remember";
@@ -2834,7 +2834,7 @@
close;
}
}
- if ((gettime(3) - guildtime > 3) && (guildrelay_q == 21) && (BaseJob == Job_Crusader)) {
+ if (gettime(GETTIME_HOUR) - guildtime > 3 && guildrelay_q == 21 && BaseJob == Job_Crusader) {
mes "[" + .@name$ + "]";
mes "Yes. You've come at just";
mes "the right time. Remember";
diff --git a/npc/quests/newgears/2010_headgears.txt b/npc/quests/newgears/2010_headgears.txt
index 844cf5d23..34d1e8b2b 100644
--- a/npc/quests/newgears/2010_headgears.txt
+++ b/npc/quests/newgears/2010_headgears.txt
@@ -1036,7 +1036,7 @@ alberta,120,206,3 script Alonie#Solo_Play_Box 4_M_UMKID,{
mes "My affection-lacked student!";
mes "This is the end of your training!";
next;
- if (gettime(3) < 12) {
+ if (gettime(GETTIME_HOUR) < 12) {
if (checkweight(Solo_Play_Box1,1) == 0) {
mes "[Alonie]";
mes "Playing outside with this heavy bag?";
diff --git a/npc/quests/partyrelay.txt b/npc/quests/partyrelay.txt
index 13ad869c7..151e5c193 100644
--- a/npc/quests/partyrelay.txt
+++ b/npc/quests/partyrelay.txt
@@ -401,7 +401,7 @@ payon,83,327,3 script Gatan#payon::RelayGatan 4_M_04,{
mes "instructions, didn't you?";
close;
}
- .@relaytime = gettime(3);
+ .@relaytime = gettime(GETTIME_HOUR);
if (party_relay == 28) {
mes "[Gatan]";
mes "Say, I don't think it's";
@@ -1837,7 +1837,7 @@ payon,204,221,3 script Bafhail#payon::RelayBafhail 4_M_JOB_BLACKSMITH,{
mes "with any of the other guys?";
close;
}
- .@relaytime = gettime(3);
+ .@relaytime = gettime(GETTIME_HOUR);
if (party_relay == 30) {
mes "[Bafhail]";
mes "Did you give that ticket";
@@ -2471,7 +2471,7 @@ payon,168,314,3 script Lospii#payon::RelayLospii 4_M_KID1,{
mes "have to meet either, but...";
close;
}
- .@relaytime = gettime(3);
+ .@relaytime = gettime(GETTIME_HOUR);
getmapxy(.@m$,.@x,.@y,1,strnpcinfo(3));
.@juwi = getareausers(.@m$,.@x-8,.@y-8,.@x+8,.@y+8);
if (party_relay == 32) {
diff --git a/npc/quests/quests_ein.txt b/npc/quests/quests_ein.txt
index 706e6d1b7..d2bf684a0 100644
--- a/npc/quests/quests_ein.txt
+++ b/npc/quests/quests_ein.txt
@@ -5692,7 +5692,7 @@ OnTouch:
mes "Failure to do so will result";
mes "in lockout. Please wait.";
next;
- .@startseconds = gettime(3)*60*60+gettime(2)*60+gettime(1);
+ .@startseconds = gettime(GETTIME_HOUR)*60*60+gettime(GETTIME_MINUTE)*60+gettime(GETTIME_SECOND);
mes "[Security System]";
switch(rand(1,7)) {
case 1:
@@ -5761,7 +5761,7 @@ OnTouch:
}
next;
input .@input2$;
- .@endtime = gettime(3)*60*60+gettime(2)*60+gettime(1);
+ .@endtime = gettime(GETTIME_HOUR)*60*60+gettime(GETTIME_MINUTE)*60+gettime(GETTIME_SECOND);
.@time = .@endtime-.@startseconds;
mes "[Security System]";
if ((.@input1$ == .@word1$) && (.@input2$ == .@word2$)) {
diff --git a/npc/quests/quests_lighthalzen.txt b/npc/quests/quests_lighthalzen.txt
index 6cadc346a..d7b184f6c 100644
--- a/npc/quests/quests_lighthalzen.txt
+++ b/npc/quests/quests_lighthalzen.txt
@@ -85,7 +85,7 @@ lighthalzen,267,200,3 script Guard#lhz01 4_M_LGTGUARD,{
$@Lhz_Gangster_Alert = 100;
close;
}
- if (gettime(3) >= 22 || gettime(3) < 2) {
+ if (gettime(GETTIME_HOUR) >= 22 || gettime(GETTIME_HOUR) < 2) {
mes "[Guard]";
mes "Zzzz... Zzz...";
mes "ZZZzzzzzzzzzz...";
@@ -152,7 +152,7 @@ lighthalzen,294,223,7 script Guard#lhz02 4_M_LGTGUARD,{
$@Lhz_Gangster_Alert = 100;
close;
}
- if (gettime(3) >= 22 || gettime(3) < 2) {
+ if (gettime(GETTIME_HOUR) >= 22 || gettime(GETTIME_HOUR) < 2) {
mes "[Guard]";
mes "Zzzz... Zzz...";
mes "ZZZzzzzzzzzzz...";
@@ -7378,8 +7378,8 @@ yuno_pre,69,20,4 script Secretary#1 4_F_LGTGIRL,{
mes "Membership Card.^000000";
close;
}
- if(((gettime(3) > 10) && (gettime(3) < 15)) || ((gettime(3) > 19) && (gettime(3) <= 23)))
- {
+ if ((gettime(GETTIME_HOUR) > 10 && gettime(GETTIME_HOUR) < 15)
+ || (gettime(GETTIME_HOUR) > 19 && gettime(GETTIME_HOUR) <= 23)) {
mes "^3355FFYou suavely flash";
mes "your ''Secret Wing''";
mes "Membership Card.^000000";
diff --git a/npc/quests/quests_louyang.txt b/npc/quests/quests_louyang.txt
index 4e59e91cd..c4658a3aa 100644
--- a/npc/quests/quests_louyang.txt
+++ b/npc/quests/quests_louyang.txt
@@ -38,7 +38,7 @@
// Soup Quest :: lou_tre
//============================================================
lou_in02,53,174,7 script Employee#1 4_M_CHNMAN,6,62,{
- if (gettime(3) >= 10 && gettime(3) < 22) {
+ if (gettime(GETTIME_HOUR) >= 10 && gettime(GETTIME_HOUR) < 22) {
mes "[Chang Pai]";
mes "Welcome, welcome!";
mes "We are ready to serve you~!";
@@ -51,7 +51,7 @@ lou_in02,53,174,7 script Employee#1 4_M_CHNMAN,6,62,{
OnTouch:
if (ch_tre == 2 || ch_tre == 3) {
- if (gettime(3) >= 10 && gettime(3) < 14) {
+ if (gettime(GETTIME_HOUR) >= 10 && gettime(GETTIME_HOUR) < 14) {
if (rand(1,10) < 9) {
mes "[Chang Pai]";
mes "Wait, who are you?!";
@@ -63,8 +63,7 @@ OnTouch:
ch_tre = 1;
close;
}
- }
- else if (gettime(3) >= 14 && gettime(3) < 17) {
+ } else if (gettime(GETTIME_HOUR) >= 14 && gettime(GETTIME_HOUR) < 17) {
if (rand(1,10) < 10) {
mes "[Chang Pai]";
mes "Wait, who are you?!";
@@ -76,8 +75,7 @@ OnTouch:
ch_tre = 1;
close;
}
- }
- else if (gettime(3) >= 17 && gettime(3) < 21) {
+ } else if (gettime(GETTIME_HOUR) >= 17 && gettime(GETTIME_HOUR) < 21) {
if (rand(1,10) < 6) {
mes "[Chang Pai]";
mes "Wait, who are you?!";
@@ -113,7 +111,7 @@ OnTouch:
}
lou_in02,76,181,3 script Employee#2 4_M_CHNMAN,2,2,{
- if (gettime(3) >= 10 && gettime(3) < 22) {
+ if (gettime(GETTIME_HOUR) >= 10 && gettime(GETTIME_HOUR) < 22) {
mes "[Huang Jia Xian]";
mes "Welcome~";
mes "Sorry for making you wait. If you wish to rest, please go upstairs.";
@@ -138,7 +136,7 @@ lou_in02,76,181,3 script Employee#2 4_M_CHNMAN,2,2,{
OnTouch:
if (ch_tre == 2 || ch_tre == 3) {
- if (gettime(3) >= 10 && gettime(3) < 14) {
+ if (gettime(GETTIME_HOUR) >= 10 && gettime(GETTIME_HOUR) < 14) {
if (rand(1,10) < 9) {
mes "[Huang Jia Xian]";
mes "What the...?";
@@ -151,8 +149,7 @@ OnTouch:
ch_tre = 1;
close;
}
- }
- else if (gettime(3) >= 14 && gettime(3) < 17) {
+ } else if (gettime(GETTIME_HOUR) >= 14 && gettime(GETTIME_HOUR) < 17) {
if (rand(1,10) < 10) {
mes "[Huang Jia Xian]";
mes "What the...?";
@@ -165,8 +162,7 @@ OnTouch:
ch_tre = 1;
close;
}
- }
- else if (gettime(3) >= 17 && gettime(3) < 22) {
+ } else if (gettime(GETTIME_HOUR) >= 17 && gettime(GETTIME_HOUR) < 22) {
if (rand(1,10) < 6) {
mes "[Huang Jia Xian]";
mes "What the...?";
@@ -203,7 +199,7 @@ OnTouch:
}
lou_in02,61,175,3 script Employee#3 4_F_CHNWOMAN,2,2,{
- if (gettime(3) >= 10 && gettime(3) < 22) {
+ if (gettime(GETTIME_HOUR) >= 10 && gettime(GETTIME_HOUR) < 22) {
if (ch_tre == 5) {
mes "[Ya Hua]";
mes "Welcome, welcome!";
@@ -234,7 +230,7 @@ lou_in02,61,175,3 script Employee#3 4_F_CHNWOMAN,2,2,{
OnTouch:
if (ch_tre == 2 || ch_tre == 3) {
- if (gettime(3) >= 10 && gettime(3) < 14) {
+ if (gettime(GETTIME_HOUR) >= 10 && gettime(GETTIME_HOUR) < 14) {
if (rand(1,10) < 9) {
mes "[Ya Hua]";
mes "What do you think";
@@ -247,8 +243,7 @@ OnTouch:
ch_tre = 1;
close;
}
- }
- else if (gettime(3) >= 14 && gettime(3) < 17) {
+ } else if (gettime(GETTIME_HOUR) >= 14 && gettime(GETTIME_HOUR) < 17) {
if (rand(1,10) < 10) {
mes "[Ya Hua]";
mes "What do you think";
@@ -261,8 +256,7 @@ OnTouch:
ch_tre = 1;
close;
}
- }
- else if (gettime(3) >= 17 && gettime(3) < 22) {
+ } else if (gettime(GETTIME_HOUR) >= 17 && gettime(GETTIME_HOUR) < 22) {
if (rand(1,10) < 6) {
mes "[Ya Hua]";
mes "What do you think";
@@ -367,7 +361,7 @@ lou_in02,62,183,3 script Chef#1-2 4_M_CHNCOOK,2,2,{
OnTouch:
if (ch_tre == 2 || ch_tre == 3) {
- if (gettime(3) >= 10 && gettime(3) < 14) {
+ if (gettime(GETTIME_HOUR) >= 10 && gettime(GETTIME_HOUR) < 14) {
if (rand(1,10) < 9) {
mes "[Wang Shi Long]";
mes "Hey, what do you";
@@ -381,8 +375,7 @@ OnTouch:
warp "louyang",280,161;
close;
}
- }
- else if (gettime(3) >= 14 && gettime(3) < 17) {
+ } else if (gettime(GETTIME_HOUR) >= 14 && gettime(GETTIME_HOUR) < 17) {
if (rand(1,10) < 10) {
mes "[Wang Shi Long]";
mes "Hey, what do you";
@@ -396,8 +389,7 @@ OnTouch:
warp "louyang",280,161;
close;
}
- }
- else if (gettime(3) >= 17 && gettime(3) < 22) {
+ } else if (gettime(GETTIME_HOUR) >= 17 && gettime(GETTIME_HOUR) < 22) {
if (rand(1,10) < 6) {
mes "[Wang Shi Long]";
mes "Hey, what do you";
@@ -720,16 +712,14 @@ lou_in02,50,185,5 script Pot#1 HIDDEN_NPC,{
mes "^3131FFYou take a careful look around.";
mes "It wouldn't be wise to steal this now if anyone is watching.^000000";
next;
- if (gettime(3) >= 10 && gettime(3) < 14) {
+ if (gettime(GETTIME_HOUR) >= 10 && gettime(GETTIME_HOUR) < 14) {
mes "^3131FFThe restaurant doesn't seem busy right now, so there's only a few employees and customers.^000000";
- }
- else if (gettime(3) >= 14 && gettime(3) < 17) {
+ } else if (gettime(GETTIME_HOUR) >= 14 && gettime(GETTIME_HOUR) < 17) {
mes "^3131FFOnly the restaurant";
mes "employees are around,";
mes "and they busy chatting";
mes "amongst each other.^000000";
- }
- else if (gettime(3) >= 17 && gettime(3) < 22) {
+ } else if (gettime(GETTIME_HOUR) >= 17 && gettime(GETTIME_HOUR) < 22) {
mes "^3131FFThe restaurant is filled";
mes "with customers, and the";
mes "hustle and bustle of the";
@@ -770,7 +760,7 @@ lou_in02,50,185,5 script Pot#1 HIDDEN_NPC,{
mes "^3131FFHowever, it's empty.^000000";
close;
}
- if (gettime(3) >= 10 && gettime(3) < 22) {
+ if (gettime(GETTIME_HOUR) >= 10 && gettime(GETTIME_HOUR) < 22) {
mes "[Chef]";
mes "Ah...!";
mes "Please, do not";
@@ -792,16 +782,14 @@ lou_in02,49,185,5 script Pot#2 HIDDEN_NPC,{
mes "^3131FFYou take a careful look around.";
mes "It wouldn't be wise to steal this now if anyone is watching.^000000";
next;
- if (gettime(3) >= 10 && gettime(3) < 14) {
+ if (gettime(GETTIME_HOUR) >= 10 && gettime(GETTIME_HOUR) < 14) {
mes "^3131FFThe restaurant doesn't seem busy right now, so there's only a few employees and customers.^000000";
- }
- else if (gettime(3) >= 14 && gettime(3) < 17) {
+ } else if (gettime(GETTIME_HOUR) >= 14 && gettime(GETTIME_HOUR) < 17) {
mes "^3131FFOnly the restaurant";
mes "employees are around,";
mes "and they busy chatting";
mes "amongst each other.^000000";
- }
- else if (gettime(3) >= 17 && gettime(3) < 22) {
+ } else if (gettime(GETTIME_HOUR) >= 17 && gettime(GETTIME_HOUR) < 22) {
mes "^3131FFThe restaurant is filled";
mes "with customers, and the";
mes "hustle and bustle of the";
@@ -842,7 +830,7 @@ lou_in02,49,185,5 script Pot#2 HIDDEN_NPC,{
mes "an empty pot.^000000";
close;
}
- if (gettime(3) >= 10 && gettime(3) < 22) {
+ if (gettime(GETTIME_HOUR) >= 10 && gettime(GETTIME_HOUR) < 22) {
mes "[Chef]";
mes "Ah...!";
mes "Please, do not";
@@ -894,7 +882,7 @@ lou_in02,58,183,5 script Chef Assistant#lou1 4_M_CHNMONK,5,5,{
OnTouch:
if (ch_tre == 2 || ch_tre == 3) {
- if (gettime(3) >= 10 && gettime(3) < 14) {
+ if (gettime(GETTIME_HOUR) >= 10 && gettime(GETTIME_HOUR) < 14) {
if (rand(1,10) < 9) {
mes "[Jin Wei Ling]";
mes "Wait! Who are you!";
@@ -907,8 +895,7 @@ OnTouch:
ch_tre = 1;
close;
}
- }
- else if (gettime(3) >= 14 && gettime(3) < 17) {
+ } else if (gettime(GETTIME_HOUR) >= 14 && gettime(GETTIME_HOUR) < 17) {
if (rand(1,10) < 10) {
mes "[Jin Wei Ling]";
mes "Wait! Who are you!";
@@ -921,8 +908,7 @@ OnTouch:
ch_tre = 1;
close;
}
- }
- else if (gettime(3) >= 17 && gettime(3) < 22) {
+ } else if (gettime(GETTIME_HOUR) >= 17 && gettime(GETTIME_HOUR) < 22) {
if (rand(1,10) < 6) {
mes "[Jin Wei Ling]";
mes "Wait! Who are you!";
diff --git a/npc/quests/quests_moscovia.txt b/npc/quests/quests_moscovia.txt
index 22226158e..2ae62a0ae 100644
--- a/npc/quests/quests_moscovia.txt
+++ b/npc/quests/quests_moscovia.txt
@@ -752,7 +752,10 @@ moscovia,135,49,5 script Mr. Ibanoff#npc 4_M_RUSBALD,{
mos_whale_edq = 19;
close;
}
- if ((gettime(3) >= 0 && gettime(3) < 3) || (gettime(3) >= 6 && gettime(3) < 9) || (gettime(3) >= 12 && gettime(3) < 15) || (gettime(3) >= 18 && gettime(3) < 21)) {
+ if ((gettime(GETTIME_HOUR) >= 0 && gettime(GETTIME_HOUR) < 3)
+ || (gettime(GETTIME_HOUR) >= 6 && gettime(GETTIME_HOUR) < 9)
+ || (gettime(GETTIME_HOUR) >= 12 && gettime(GETTIME_HOUR) < 15)
+ || (gettime(GETTIME_HOUR) >= 18 && gettime(GETTIME_HOUR) < 21)) {
mes "[Mr. Ibanoff]";
mes "Hmm. It's not a bad time.";
mes "We should hurry up";
@@ -8676,7 +8679,7 @@ OnTouch:
end;
}
if (rhea_rus_hair == 2) {
- if (gettime(3)>=23 || gettime(3)<=5) {
+ if (gettime(GETTIME_HOUR) >= 23 || gettime(GETTIME_HOUR) <= 5) {
mes "- Splash !! -";
next;
if (countitem(523) > 0) {
@@ -8701,7 +8704,7 @@ OnTouch:
mes "And please, tell him to stop suffering and to be happy. This is my request.";
close;
} else if (rhea_rus_hair == 7) {
- if (gettime(3)>=23 || gettime(3)<=5) {
+ if (gettime(GETTIME_HOUR) >= 23 || gettime(GETTIME_HOUR) <= 5) {
mes "- Splash !! -";
next;
if (countitem(523) > 0) {
@@ -9520,11 +9523,13 @@ mosk_fild02,243,270,0 script Marozka#rus31 4_M_LGTGRAND,{
mes "[Marozka]";
mes "I will begin making it now... let me see... Could you please come back to me in an hour?";
rhea_rus_quiz = 4;
- rus_time01 = gettime(3);
- rus_time02 = gettime(4);
+ rus_time01 = gettime(GETTIME_HOUR);
+ rus_time02 = gettime(GETTIME_WEEKDAY);
close;
} else if (rhea_rus_quiz == 4) {
- if (rus_time01 < gettime(3) || rus_time02 < gettime(4) || (rus_time02 == 6 && gettime(4) == 0)) {
+ if (rus_time01 < gettime(GETTIME_HOUR)
+ || rus_time02 < gettime(GETTIME_WEEKDAY)
+ || (rus_time02 == SATURDAY && gettime(GETTIME_WEEKDAY) == SUNDAY)) {
mes "[Marozka]";
mes "Ah, just in time.";
mes "I have finally finished making the 'Golden Thread'. Just wait one more second and it'll be ready.";
diff --git a/npc/quests/quests_umbala.txt b/npc/quests/quests_umbala.txt
index 0ce3aba39..3bcbb7e1d 100644
--- a/npc/quests/quests_umbala.txt
+++ b/npc/quests/quests_umbala.txt
@@ -1126,7 +1126,7 @@ um_in,101,73,3 script Wainatan 4_F_UMWOMAN,{
close;
}
if (um_wind == 1) {
- if (gettime(3) > 18) {
+ if (gettime(GETTIME_HOUR) > 18) {
um_wind = 2;
emotion e_an;
mes "[Wainatan]";
@@ -1170,7 +1170,7 @@ um_in,94,123,5 script Bertztan 4_F_UMWOMAN,{
close;
}
if (um_wind == 2) {
- if (gettime(3) > 18) {
+ if (gettime(GETTIME_HOUR) > 18) {
um_wind = 3;
emotion e_an;
mes "[Bertztan]";
@@ -1222,7 +1222,7 @@ umbala,145,217,3 script Chabimatan 4_F_UMWOMAN,{
close;
}
if (um_wind == 3) {
- if (gettime(3) > 18) {
+ if (gettime(GETTIME_HOUR) > 18) {
um_wind = 4;
emotion e_an;
mes "[Chabimatan]";
diff --git a/npc/quests/the_sign_quest.txt b/npc/quests/the_sign_quest.txt
index b119eb95b..5ce92aa0e 100644
--- a/npc/quests/the_sign_quest.txt
+++ b/npc/quests/the_sign_quest.txt
@@ -553,7 +553,7 @@ prt_in,227,45,0 script Archeologist#sign 1_M_SIGN1,{
mes "this and come back later~";
delitem 7314,1; //The_Sign
sign_q = 138;
- .@stime_s = gettime(3);
+ .@stime_s = gettime(GETTIME_HOUR);
if (.@stime_s < 1) sign_sq = 1;
else if (.@stime_s < 3) sign_sq = 2;
else if (.@stime_s < 5) sign_sq = 3;
@@ -568,7 +568,7 @@ prt_in,227,45,0 script Archeologist#sign 1_M_SIGN1,{
else sign_sq = 12;
}
else if (sign_q == 138) {
- .@stime_s1 = gettime(3);
+ .@stime_s1 = gettime(GETTIME_HOUR);
if (.@stime_s1 < 1) {
if (sign_sq == 11) {
.@pass_s = 1;
@@ -2567,7 +2567,7 @@ aldeba_in,139,103,5 script Monograph#sign HIDDEN_NPC,{
aldeba_in,155,101,3 script Sir Jore#sign 1_M_SIGNALCHE,7,7,{
callfunc "F_UpdateSignVars";
- if ((gettime(3) > 16) && (gettime(3) < 22)) {
+ if (gettime(GETTIME_HOUR) > 16 && gettime(GETTIME_HOUR) < 22) {
if (sign_q == 15) {
mes "["+ strcharinfo(0) +"]";
mes "Excuse me...";
@@ -2857,8 +2857,7 @@ aldeba_in,155,101,3 script Sir Jore#sign 1_M_SIGNALCHE,7,7,{
mes "What's the answer?!";
close;
}
- }
- else if ((gettime(3) > 6) && (gettime(3) < 17)) {
+ } else if (gettime(GETTIME_HOUR) > 6 && gettime(GETTIME_HOUR) < 17) {
mes "^3355FFYou find a tense man";
mes "holding test tubes between";
mes "his fingers, standing in a pile";
@@ -2938,7 +2937,7 @@ OnTouch:
aldeba_in,156,118,4 script Piru Piru#sign 8_F,{
callfunc "F_UpdateSignVars";
mes "[Piru Piru]";
- if ((gettime(3) >= 12) && (gettime(3) <= 24)) { //235959
+ if (gettime(GETTIME_HOUR) >= 12 && gettime(GETTIME_HOUR) <= 24) { //235959
if (sign_q == 17) {
emotion e_sob;
mes "Oh, I'm sooo tired~";
@@ -3018,7 +3017,7 @@ aldeba_in,156,118,4 script Piru Piru#sign 8_F,{
close;
}
}
- else if ((gettime(3) >= 6) && (gettime(3) < 12)) {
+ else if (gettime(GETTIME_HOUR) >= 6 && gettime(GETTIME_HOUR) < 12) {
mes "Everyday we study and";
mes "take notes and test and";
mes "experiment and record";
@@ -4533,7 +4532,7 @@ cmd_in02,88,51,4 script Strange Guy#sign 1_M_SIGNART,{
}
}
else if (sign_q == 27) {
- if ((gettime(3) > 18) && (gettime(3) < 23)) {
+ if (gettime(GETTIME_HOUR) > 18 && gettime(GETTIME_HOUR) < 23) {
mes "Nice, you're here";
mes "just in time. Well,";
mes "all that matters is that";
@@ -7550,7 +7549,7 @@ mjo_dun02,88,295,4 script Flaming Spirit Man 4_M_03,{
mes "But I'll do my best for you.";
delitem 7314,1; //The_Sign
sign_q = 140;
- .@stime_e = gettime(3);
+ .@stime_e = gettime(GETTIME_HOUR);
if (.@stime_e < 2) sign_sq = 1;
else if (.@stime_e < 4) sign_sq = 2;
else if (.@stime_e < 6) sign_sq = 3;
@@ -7566,7 +7565,7 @@ mjo_dun02,88,295,4 script Flaming Spirit Man 4_M_03,{
close;
}
else if (sign_q == 140) {
- .@stime_e1 = gettime(3);
+ .@stime_e1 = gettime(GETTIME_HOUR);
if (.@stime_e1 < 2) {
if (sign_sq == 11) {
.@pass_s1 = 1;
diff --git a/npc/re/instances/OldGlastHeim.txt b/npc/re/instances/OldGlastHeim.txt
index 131b54eb8..1d908ac39 100644
--- a/npc/re/instances/OldGlastHeim.txt
+++ b/npc/re/instances/OldGlastHeim.txt
@@ -29,8 +29,7 @@ glast_01,204,273,6 script Hugin#ghinstance 4_M_SAGE_C,{
.@p_name$ = getpartyname(.@party_id);
.@md_name$ = "Old Glast Heim";
- if (!instance_check_party(.@party_id,2)) {
- //custom
+ if (!instance_check_party(.@party_id,2)) { // Custom
mes "[Hugin]";
mes "Where are your party members?";
close;
@@ -145,6 +144,8 @@ glast_01,204,273,6 script Hugin#ghinstance 4_M_SAGE_C,{
end;
}
OnInstanceInit:
+ donpcevent instance_npcname("Varmunt#ghinstance1")+"::OnEnable";
+ end;
OnDisable:
hideonnpc instance_npcname("Varmunt#ghinstance1");
end;
@@ -515,7 +516,7 @@ OnTimer85000:
monster .@map$,145,99,"Abyss Knight",2470,1,.@label$;
monster .@map$,154,99,"Abyss Knight",2470,1,.@label$;
- for(.@i = 1; .@i<=22; ++.@i)
+ for(.@i = 1; .@i<=22; .@i++)
hideoffnpc instance_npcname(".#ghinstance"+.@i);
donpcevent instance_npcname(".#ghinstance22")+"::OnTalkK";
@@ -1479,7 +1480,7 @@ OnEnable:
end;
OnMyMobDead:
.@map$ = instance_mapname("2@gl_k");
- --.MyMobs;
+ .MyMobs--;
if (.MyMobs == 0) {
mapannounce .@map$, "A being with an evil aura seems to be appearing in this region.",bc_map,"0xFFFF00";
donpcevent instance_npcname("#ghmemorialmob06")+"::OnDisable2";
@@ -1588,7 +1589,7 @@ OnEnable:
end;
OnMyMobDead:
.@map$ = instance_mapname("2@gl_k");
- --.MyMobs;
+ .MyMobs--;
if (.MyMobs == 0) {
mapannounce .@map$, "A being with an evil aura seems to be appearing in this region.",bc_map,"0xFFFF00";
donpcevent instance_npcname("#ghmemorialmob09")+"::OnEnable";
diff --git a/npc/re/jobs/novice/academy.txt b/npc/re/jobs/novice/academy.txt
index f9449f398..a7fb905e8 100644
--- a/npc/re/jobs/novice/academy.txt
+++ b/npc/re/jobs/novice/academy.txt
@@ -12849,7 +12849,7 @@ izlude_d,153,126,1 duplicate(Refinery Owner Han#iz) Refinery Owner Han#iz_d 4_M_
}
if (countitem(.@material) > 0 && Zeny >= .@price) {
delitem .@material, 1;
- Zeny -= .@material;
+ Zeny -= .@price;
} else {
mes "[Refining Machine Wagjak]";
mes "^FF0000- error number 8282 -^000000";
diff --git a/npc/re/merchants/shops.txt b/npc/re/merchants/shops.txt
index c90f89a5a..220d76476 100644
--- a/npc/re/merchants/shops.txt
+++ b/npc/re/merchants/shops.txt
@@ -3,7 +3,7 @@
//===== By: ==================================================
//= Hercules Dev Team
//===== Current Version: =====================================
-//= 1.7
+//= 1.9
//===== Description: =========================================
//= Renewal-specific town shop NPCs.
//===== Additional Comments: =================================
@@ -15,113 +15,445 @@
//= 1.5 Added Dewata merchants. [Lemongrass]
//= 1.6 Added Mora and Port Malaya merchants.
//= 1.7 Added Izlude duplicates. [Euphy]
+//= 1.8 Converted to trader format. [Frost]
+//= 1.9 Change the item sequence of Black Marketeer according to kRO. [Frost]
//============================================================
//=======================================================
// Comodo
//=======================================================
-comodo,106,213,5 shop Tropic Fruit Dealer 4_F_07,6258:-1
-comodo,196,162,3 shop Harive#candy 4_M_MINSTREL,11513:-1,6144:-1
+comodo,106,213,5 trader Tropic Fruit Dealer 4_F_07,{
+OnInit:
+ sellitem Comodo_Tropic_Fruit;
+}
+
+comodo,196,162,3 trader Harive#candy 4_M_MINSTREL,{
+OnInit:
+ sellitem Protect_Neck_Candy;
+ sellitem Heartbroken_Tears;
+}
//=======================================================
// Dewata
//=======================================================
-dewata,218,164,4 shop Weapon Dealer 4_M_DEWMAN,1207:-1,1216:-1,1107:-1,1122:-1,1116:-1,1154:-1,1407:-1,1457:-1,1354:-1,1519:-1
-dewata,182,164,6 shop Tool Dealer 4_M_DEWMAN,611:-1,1750:-1,501:-1,502:-1,503:-1,504:-1,645:-1,656:-1,601:-1,602:-1,1065:-1,2239:-1,713:-1
-dewata,145,267,6 shop Fruit Gardener 4_M_DEWOLDWOMAN,512:-1,513:-1,515:-1,516:-1,535:-1
-dewata,158,182,6 shop Armor Dealer 4_M_DEWMAN,2211:-1,2401:-1,2403:-1,2501:-1,2503:-1,2101:-1,2103:-1,2305:-1,2321:-1,2332:-1,2328:-1,2627:-1
+dewata,218,164,4 trader Weapon Dealer 4_M_DEWMAN,{
+OnInit:
+ sellitem Main_Gauche;
+ sellitem Stiletto;
+ sellitem Blade;
+ sellitem Ring_Pommel_Saber;
+ sellitem Katana;
+ sellitem Bastard_Sword;
+ sellitem Pike;
+ sellitem Partizan;
+ sellitem Hammer;
+ sellitem Chain;
+}
+
+dewata,182,164,6 trader Tool Dealer 4_M_DEWMAN,{
+OnInit:
+ sellitem Spectacles;
+ sellitem Arrow;
+ sellitem Red_Potion;
+ sellitem Orange_Potion;
+ sellitem Yellow_Potion;
+ sellitem White_Potion;
+ sellitem Center_Potion;
+ sellitem Awakening_Potion;
+ sellitem Wing_Of_Fly;
+ sellitem Wing_Of_Butterfly;
+ sellitem Booby_Trap;
+ sellitem One_Eyed_Glass;
+ sellitem Empty_Bottle;
+}
+
+dewata,145,267,6 trader Fruit Gardener 4_M_DEWOLDWOMAN,{
+OnInit:
+ sellitem Apple;
+ sellitem Banana;
+ sellitem Carrot;
+ sellitem Sweet_Potato;
+ sellitem Pumpkin;
+}
+
+dewata,158,182,6 trader Armor Dealer 4_M_DEWMAN,{
+OnInit:
+ sellitem Bandana;
+ sellitem Sandals;
+ sellitem Shoes;
+ sellitem Hood;
+ sellitem Muffler;
+ sellitem Guard;
+ sellitem Buckler;
+ sellitem Adventure_Suit;
+ sellitem Silk_Robe;
+ sellitem Silver_Robe;
+ sellitem Wooden_Mail;
+ sellitem Belt;
+}
//=======================================================
// Einbroch
//=======================================================
-einbroch,122,250,4 shop Black Marketeer#ein 1_M_03,2139:-1,2800:-1,2801:-1,2802:-1,2803:-1,2804:-1,2805:-1,2806:-1,2807:-1,18000:-1,18001:-1,18002:-1,18003:-1,18004:-1,12392:-1,12393:-1,12394:-1,6145:-1,6146:-1,6147:-1,6186:-1,2808:-1
+einbroch,122,250,4 trader Black Marketeer#ein 1_M_03,{
+OnInit:
+ sellitem Flame_Thrower;
+ sellitem Accelerator;
+ sellitem Hovering_Booster;
+ sellitem Suicidal_Device;
+ sellitem Shape_Shifter;
+ sellitem Cooling_Device;
+ sellitem Mag_Field_Generator;
+ sellitem Barrier_Builder;
+ sellitem Repair_Kit;
+ sellitem Cannon_Ball;
+ sellitem Holy_Cannon_Ball;
+ sellitem Dark_Cannon_Ball;
+ sellitem Soul_Cannon_Ball;
+ sellitem Iron_Cannon_Ball;
+ sellitem Vulcan_Bullet;
+ sellitem Magic_Gear_Fuel;
+ sellitem Liquid_Condensed_Bullet;
+ sellitem Monkey_Wrench;
+ sellitem Camouflage_Generator;
+ sellitem RepairA;
+ sellitem RepairB;
+ sellitem RepairC;
+}
//=======================================================
// El Dicastes
//=======================================================
-dic_in01,238,107,5 shop Peddler#dic 4_M_HUMERCHANT,601:-1,602:-1,611:-1,610:-1
-dicastes01,207,200,6 shop Points Merchant#dic 1_F_01,6360:-1,6361:-1,6362:-1,6363:-1
+dic_in01,238,107,5 trader Peddler#dic 4_M_HUMERCHANT,{
+OnInit:
+ sellitem Wing_Of_Fly;
+ sellitem Wing_Of_Butterfly;
+ sellitem Spectacles;
+ sellitem Leaf_Of_Yggdrasil;
+}
+
+dicastes01,207,200,6 trader Points Merchant#dic 1_F_01,{
+OnInit:
+ sellitem Scarlet_Pts;
+ sellitem Indigo_Pts;
+ sellitem Yellow_Wish_Pts;
+ sellitem Lime_Green_Pts;
+}
//=======================================================
// Izlude
//=======================================================
-izlude,124,165,4 shop Fruit Gardener#iz 1_M_INNKEEPER,512:-1,513:-1,515:-1,516:-1
+izlude,124,165,4 trader Fruit Gardener#iz 1_M_INNKEEPER,{
+OnInit:
+ sellitem Apple;
+ sellitem Banana;
+ sellitem Carrot;
+ sellitem Sweet_Potato;
+}
+
izlude_a,124,165,4 duplicate(Fruit Gardener#iz) Fruit Gardener#iz_a 1_M_INNKEEPER
izlude_b,124,165,4 duplicate(Fruit Gardener#iz) Fruit Gardener#iz_b 1_M_INNKEEPER
izlude_c,124,165,4 duplicate(Fruit Gardener#iz) Fruit Gardener#iz_c 1_M_INNKEEPER
izlude_d,124,165,4 duplicate(Fruit Gardener#iz) Fruit Gardener#iz_d 1_M_INNKEEPER
-izlude,160,186,0 shop Butcher#iz 1_M_JOBGUIDER,517:-1
+
+izlude,160,186,0 trader Butcher#iz 1_M_JOBGUIDER,{
+OnInit:
+ sellitem Meat;
+}
+
izlude_a,160,186,0 duplicate(Butcher#iz) Butcher#iz_a 1_M_JOBGUIDER
izlude_b,160,186,0 duplicate(Butcher#iz) Butcher#iz_b 1_M_JOBGUIDER
izlude_c,160,186,0 duplicate(Butcher#iz) Butcher#iz_c 1_M_JOBGUIDER
izlude_d,160,186,0 duplicate(Butcher#iz) Butcher#iz_d 1_M_JOBGUIDER
-izlude,128,158,7 shop Vendor from Milk Ranch#i 4_F_01,519:-1
+
+izlude,128,158,7 trader Vendor from Milk Ranch#i 4_F_01,{
+OnInit:
+ sellitem Milk;
+}
+
izlude_a,128,158,7 duplicate(Vendor from Milk Ranch#i) Vendor from Milk Ranch#a 4_F_01
izlude_b,128,158,7 duplicate(Vendor from Milk Ranch#i) Vendor from Milk Ranch#b 4_F_01
izlude_c,128,158,7 duplicate(Vendor from Milk Ranch#i) Vendor from Milk Ranch#c 4_F_01
izlude_d,128,158,7 duplicate(Vendor from Milk Ranch#i) Vendor from Milk Ranch#d 4_F_01
-izlude_in,72,98,3 shop Pet Groomer#iz 4_F_TELEPORTER,537:-1,643:-1,10013:-1,10014:-1,554:-1,6113:-1,6114:-1,6115:-1
-izlude_in,57,110,0 shop Tool Dealer#iz 1_M_01,611:-1,501:-1,502:-1,503:-1,504:-1,506:-1,645:-1,656:-1,601:-1,602:-1,1065:-1,1750:-1
-izlude_in,72,102,3 shop Trading Merchant#iz 4_M_HUMERCHANT,13200:-1,13201:-1,13202:-1,13150:-1,13102:-1,13151:-1,13154:-1,13155:-1,13163:-1,13165:-1,13168:-1
+
+izlude_in,72,98,3 trader Pet Groomer#iz 4_F_TELEPORTER,{
+OnInit:
+ sellitem Pet_Food;
+ sellitem Pet_Incubator;
+ sellitem Backpack;
+ sellitem Rocker_Glasses;
+ sellitem Mojji;
+ sellitem Vital_Flower_;
+ sellitem Flame_Gemstone;
+ sellitem Bun_;
+}
+
+izlude_in,57,110,0 trader Tool Dealer#iz 1_M_01,{
+OnInit:
+ sellitem Spectacles;
+ sellitem Red_Potion;
+ sellitem Orange_Potion;
+ sellitem Yellow_Potion;
+ sellitem White_Potion;
+ sellitem Green_Potion;
+ sellitem Center_Potion;
+ sellitem Awakening_Potion;
+ sellitem Wing_Of_Fly;
+ sellitem Wing_Of_Butterfly;
+ sellitem Booby_Trap;
+ sellitem Arrow;
+}
+
+izlude_in,72,102,3 trader Trading Merchant#iz 4_M_HUMERCHANT,{
+OnInit:
+ sellitem Bullet;
+ sellitem Silver_Bullet;
+ sellitem Shell_Of_Blood;
+ sellitem Branch;
+ sellitem Crimson_Bolt;
+ sellitem The_Cyclone;
+ sellitem Rolling_Stone;
+ sellitem Black_Rose;
+ sellitem Long_Barrel;
+ sellitem Jungle_Carbine;
+ sellitem Thunder_P;
+}
//=======================================================
// Juno
//=======================================================
-s_atelier,114,117,1 shop Part-Timer#sc_yuno 4_F_03,6123:-1,6120:-1
+s_atelier,114,117,1 trader Part-Timer#sc_yuno 4_F_03,{
+OnInit:
+ sellitem Surface_Paint;
+ sellitem Face_Paint;
+}
//=======================================================
// Lighthalzen
//=======================================================
-lighthalzen,337,240,4 shop Trap Specialist#lhz 1_F_01,7940:-1,12341:-1
-lhz_in03,181,17,4 shop Black Marketeer#lhz 1_M_03,2139:-1,2800:-1,2801:-1,2802:-1,2803:-1,2804:-1,2805:-1,2806:-1,2807:-1,18000:-1,18001:-1,18002:-1,18003:-1,18004:-1,12392:-1,12393:-1,12394:-1,6145:-1,6146:-1,6147:-1,6186:-1,2808:-1
-s_atelier,15,65,5 shop Part-Timer#sc_lgt 4_M_ORIENT02,6123:-1,6120:-1
+lighthalzen,337,240,4 trader Trap Specialist#lhz 1_F_01,{
+OnInit:
+ sellitem Special_Alloy_Trap;
+ sellitem Special_Alloy_Trap_Box;
+}
+
+lhz_in03,181,17,4 trader Black Marketeer#lhz 1_M_03,{
+OnInit:
+ sellitem Flame_Thrower;
+ sellitem Accelerator;
+ sellitem Hovering_Booster;
+ sellitem Suicidal_Device;
+ sellitem Shape_Shifter;
+ sellitem Cooling_Device;
+ sellitem Mag_Field_Generator;
+ sellitem Barrier_Builder;
+ sellitem Repair_Kit;
+ sellitem Cannon_Ball;
+ sellitem Holy_Cannon_Ball;
+ sellitem Dark_Cannon_Ball;
+ sellitem Soul_Cannon_Ball;
+ sellitem Iron_Cannon_Ball;
+ sellitem Vulcan_Bullet;
+ sellitem Magic_Gear_Fuel;
+ sellitem Liquid_Condensed_Bullet;
+ sellitem Monkey_Wrench;
+ sellitem Camouflage_Generator;
+ sellitem RepairA;
+ sellitem RepairB;
+ sellitem RepairC;
+}
+
+s_atelier,15,65,5 trader Part-Timer#sc_lgt 4_M_ORIENT02,{
+OnInit:
+ sellitem Surface_Paint;
+ sellitem Face_Paint;
+}
//=======================================================
// Malangdo
//=======================================================
-malangdo,232,163,5 shop Tool Dealer Myo 4_CAT_ADV2,611:-1,1750:-1,645:-1,656:-1,601:-1,602:-1,1065:-1,713:-1
+malangdo,232,163,5 trader Tool Dealer Myo 4_CAT_ADV2,{
+OnInit:
+ sellitem Spectacles;
+ sellitem Arrow;
+ sellitem Center_Potion;
+ sellitem Awakening_Potion;
+ sellitem Wing_Of_Fly;
+ sellitem Wing_Of_Butterfly;
+ sellitem Booby_Trap;
+ sellitem Empty_Bottle;
+}
//=======================================================
// Mora
//=======================================================
-mora,100,118,4 shop Tool Dealer#mora 4_M_RAFLE_OLD,11522:-1,11523:-1,11524:-1,602:-1,601:-1,611:-1,1773:-1,1774:-1
-mora,138,110,4 shop Mora Chef 4_F_RAFLE_PK,11519:-1
+mora,100,118,4 trader Tool Dealer#mora 4_M_RAFLE_OLD,{
+OnInit:
+ sellitem Red_Raffle_Sap;
+ sellitem Yellow_Raffle_Sap;
+ sellitem White_Raffle_Sap;
+ sellitem Wing_Of_Butterfly;
+ sellitem Wing_Of_Fly;
+ sellitem Spectacles;
+ sellitem Arrow_Of_Elf;
+ sellitem Hunting_Arrow;
+}
+
+mora,138,110,4 trader Mora Chef 4_F_RAFLE_PK,{
+OnInit:
+ sellitem Beef_Toast;
+}
//=======================================================
// Mid Camp
//=======================================================
-mid_camp,129,284,4 shop Trap Specialist#mid 1_F_01,7940:-1,12341:-1
-mid_camp,184,263,4 shop Black Marketeer#mid 1_M_03,2139:-1,2800:-1,2801:-1,2802:-1,2803:-1,2804:-1,2805:-1,2806:-1,2807:-1,18000:-1,18001:-1,18002:-1,18003:-1,18004:-1,12392:-1,12393:-1,12394:-1,6145:-1,6146:-1,6147:-1,6186:-1,2808:-1
+mid_camp,129,284,4 trader Trap Specialist#mid 1_F_01,{
+OnInit:
+ sellitem Special_Alloy_Trap;
+ sellitem Special_Alloy_Trap_Box;
+}
+
+mid_camp,184,263,4 trader Black Marketeer#mid 1_M_03,{
+OnInit:
+ sellitem Flame_Thrower;
+ sellitem Accelerator;
+ sellitem Hovering_Booster;
+ sellitem Suicidal_Device;
+ sellitem Shape_Shifter;
+ sellitem Cooling_Device;
+ sellitem Mag_Field_Generator;
+ sellitem Barrier_Builder;
+ sellitem Repair_Kit;
+ sellitem Cannon_Ball;
+ sellitem Holy_Cannon_Ball;
+ sellitem Dark_Cannon_Ball;
+ sellitem Soul_Cannon_Ball;
+ sellitem Iron_Cannon_Ball;
+ sellitem Vulcan_Bullet;
+ sellitem Magic_Gear_Fuel;
+ sellitem Liquid_Condensed_Bullet;
+ sellitem Monkey_Wrench;
+ sellitem Camouflage_Generator;
+ sellitem RepairA;
+ sellitem RepairB;
+ sellitem RepairC;
+}
//=======================================================
// Payon
//=======================================================
-payon,123,109,4 shop Trap Specialist#pay 1_F_01,7940:-1,12341:-1
+payon,123,109,4 trader Trap Specialist#pay 1_F_01,{
+OnInit:
+ sellitem Special_Alloy_Trap;
+ sellitem Special_Alloy_Trap_Box;
+}
//=======================================================
// Port Malaya
//=======================================================
-ma_in01,73,22,3 shop Weapon Dealer#ma 4_M_DEWMAN,1207:-1,1216:-1,1107:-1,1122:-1,1116:-1,1154:-1,1407:-1,1457:-1,1354:-1,1519:-1
-ma_in01,22,23,3 shop Tool Dealer#ma 4_M_DEWMAN,611:-1,1750:-1,501:-1,502:-1,503:-1,504:-1,645:-1,656:-1,601:-1,602:-1,1065:-1,2239:-1
-malaya,150,261,3 shop Fruit Gardener#ma 4_M_DEWOLDWOMAN,512:-1,513:-1,515:-1,516:-1,535:-1
-ma_in01,67,13,5 shop Armor Dealer#ma 4_M_DEWMAN,2211:-1,2401:-1,2403:-1,2501:-1,2503:-1,2101:-1,2103:-1,2305:-1,2321:-1,2332:-1,2328:-1,2627:-1
+ma_in01,73,22,3 trader Weapon Dealer#ma 4_M_DEWMAN,{
+OnInit:
+ sellitem Main_Gauche;
+ sellitem Stiletto;
+ sellitem Blade;
+ sellitem Ring_Pommel_Saber;
+ sellitem Katana;
+ sellitem Bastard_Sword;
+ sellitem Pike;
+ sellitem Partizan;
+ sellitem Hammer;
+ sellitem Chain;
+}
+
+ma_in01,22,23,3 trader Tool Dealer#ma 4_M_DEWMAN,{
+OnInit:
+ sellitem Spectacles;
+ sellitem Arrow;
+ sellitem Red_Potion;
+ sellitem Orange_Potion;
+ sellitem Yellow_Potion;
+ sellitem White_Potion;
+ sellitem Center_Potion;
+ sellitem Awakening_Potion;
+ sellitem Wing_Of_Fly;
+ sellitem Wing_Of_Butterfly;
+ sellitem Booby_Trap;
+ sellitem One_Eyed_Glass;
+}
+
+malaya,150,261,3 trader Fruit Gardener#ma 4_M_DEWOLDWOMAN,{
+OnInit:
+ sellitem Apple;
+ sellitem Banana;
+ sellitem Carrot;
+ sellitem Sweet_Potato;
+ sellitem Pumpkin;
+}
+
+ma_in01,67,13,5 trader Armor Dealer#ma 4_M_DEWMAN,{
+OnInit:
+ sellitem Bandana;
+ sellitem Sandals;
+ sellitem Shoes;
+ sellitem Hood;
+ sellitem Muffler;
+ sellitem Guard;
+ sellitem Buckler;
+ sellitem Adventure_Suit;
+ sellitem Silk_Robe;
+ sellitem Silver_Robe;
+ sellitem Wooden_Mail;
+ sellitem Belt;
+}
//=======================================================
// Prontera
//=======================================================
-//prontera,104,88,5 shop Stuff Gimme 4_M_MASKMAN,616:-1
-prt_in,109,68,4 shop Trap Specialist#prt 1_F_01,7940:-1,12341:-1
-prt_in,175,137,4 shop Black Marketeer#prt 1_M_03,2139:-1,2800:-1,2801:-1,2802:-1,2803:-1,2804:-1,2805:-1,2806:-1,2807:-1,18000:-1,18001:-1,18002:-1,18003:-1,18004:-1,12392:-1,12393:-1,12394:-1,6145:-1,6146:-1,6147:-1,6186:-1,2808:-1
-s_atelier,17,110,1 shop Part-Timer#sc_prt 1_F_02,6123:-1,6120:-1
+/*
+prontera,104,88,5 trader Stuff Gimme 4_M_MASKMAN,{
+OnInit:
+ sellitem Old_Card_Album;
+}
+*/
-//=======================================================
-// Rachel
-//=======================================================
-ra_in01,263,281,4 shop Trap Specialist#ra 1_F_01,7940:-1,12341:-1
-ra_in01,257,266,4 shop Black Marketeer#ra 1_M_03,2139:-1,2800:-1,2801:-1,2802:-1,2803:-1,2804:-1,2805:-1,2806:-1,2807:-1,18000:-1,18001:-1,18002:-1,18003:-1,18004:-1,12392:-1,12393:-1,12394:-1,6145:-1,6146:-1,6147:-1,6186:-1,2808:-1
-s_atelier,137,60,3 shop Part-Timer#sc_ra 1_F_GYPSY,6123:-1,6120:-1
+prt_in,109,68,4 trader Trap Specialist#prt 1_F_01,{
+OnInit:
+ sellitem Special_Alloy_Trap;
+ sellitem Special_Alloy_Trap_Box;
+}
+
+prt_in,175,137,4 trader Black Marketeer#prt 1_M_03,{
+OnInit:
+ sellitem Flame_Thrower;
+ sellitem Accelerator;
+ sellitem Hovering_Booster;
+ sellitem Suicidal_Device;
+ sellitem Shape_Shifter;
+ sellitem Cooling_Device;
+ sellitem Mag_Field_Generator;
+ sellitem Barrier_Builder;
+ sellitem Repair_Kit;
+ sellitem Cannon_Ball;
+ sellitem Holy_Cannon_Ball;
+ sellitem Dark_Cannon_Ball;
+ sellitem Soul_Cannon_Ball;
+ sellitem Iron_Cannon_Ball;
+ sellitem Vulcan_Bullet;
+ sellitem Magic_Gear_Fuel;
+ sellitem Liquid_Condensed_Bullet;
+ sellitem Monkey_Wrench;
+ sellitem Camouflage_Generator;
+ sellitem RepairA;
+ sellitem RepairB;
+ sellitem RepairC;
+}
+
+s_atelier,17,110,1 trader Part-Timer#sc_prt 1_F_02,{
+OnInit:
+ sellitem Surface_Paint;
+ sellitem Face_Paint;
+}
-// Ninja Shops
prontera,178,244,3 trader Amatsu Trader#nin 4_M_01,{
OnInit:
sellitem Shuriken;
@@ -129,6 +461,7 @@ OnInit:
sellitem Flash_Shuriken;
sellitem Sharp_Leaf_Shuriken;
sellitem Thorn_Needle_Shuriken;
+ sellitem Explosive_Kunai;
sellitem Makibishi;
sellitem Arm_Guard;
sellitem Fox_Armguard;
@@ -136,8 +469,50 @@ OnInit:
sellitem Flame_Stone;
sellitem Ice_Stone;
sellitem Wind_Stone;
+ sellitem Shadow_Orb;
sellitem Charm_Fire;
sellitem Charm_Ice;
sellitem Charm_Wind;
sellitem Charm_Earth;
}
+
+//=======================================================
+// Rachel
+//=======================================================
+ra_in01,263,281,4 trader Trap Specialist#ra 1_F_01,{
+OnInit:
+ sellitem Special_Alloy_Trap;
+ sellitem Special_Alloy_Trap_Box;
+}
+
+ra_in01,257,266,4 trader Black Marketeer#ra 1_M_03,{
+OnInit:
+ sellitem Flame_Thrower;
+ sellitem Accelerator;
+ sellitem Hovering_Booster;
+ sellitem Suicidal_Device;
+ sellitem Shape_Shifter;
+ sellitem Cooling_Device;
+ sellitem Mag_Field_Generator;
+ sellitem Barrier_Builder;
+ sellitem Repair_Kit;
+ sellitem Cannon_Ball;
+ sellitem Holy_Cannon_Ball;
+ sellitem Dark_Cannon_Ball;
+ sellitem Soul_Cannon_Ball;
+ sellitem Iron_Cannon_Ball;
+ sellitem Vulcan_Bullet;
+ sellitem Magic_Gear_Fuel;
+ sellitem Liquid_Condensed_Bullet;
+ sellitem Monkey_Wrench;
+ sellitem Camouflage_Generator;
+ sellitem RepairA;
+ sellitem RepairB;
+ sellitem RepairC;
+}
+
+s_atelier,137,60,3 trader Part-Timer#sc_ra 1_F_GYPSY,{
+OnInit:
+ sellitem Surface_Paint;
+ sellitem Face_Paint;
+}
diff --git a/npc/re/quests/eden/eden_iro.txt b/npc/re/quests/eden/eden_iro.txt
index 4f65498ea..45dc608ac 100644
--- a/npc/re/quests/eden/eden_iro.txt
+++ b/npc/re/quests/eden/eden_iro.txt
@@ -3,7 +3,7 @@
//===== By: ==================================================
//= -SkittleNugget-
//===== Current Version: =====================================
-//= 1.2
+//= 1.3
//===== Description: =========================================
//= Eden scripts custom to iRO (disabled by default).
//= You may need iRO's data.grf to view some of the items.
@@ -11,6 +11,7 @@
//= 1.0 First version.
//= 1.1 Edited and added more NPCs, lots of placeholders. [Euphy]
//= 1.2 Added Mail Annex Station scripts, commented out. [Euphy]
+//= 1.3 Converted Kafra Cash Shop NPC's and Mail Annex Tool Dealer to trader format. [Frost]
//============================================================
// Acolyte Warper (part of other/acolyte_warp.txt)
@@ -603,7 +604,6 @@ L_Exchange:
return;
}
-
// Kafra Stacker
//============================================================
moc_para01,41,169,2 script Kafra Stacker#eden 4_M_ALCHE_B,{
@@ -674,12 +674,132 @@ moc_para01,38,162,2 script Code the Redeemer#Give1 4_M_YOUNGKNIGHT,{
//============================================================
/* Due to the irregularity of iRO's databases, some of these sprites may not display properly. */
-moc_para01,32,171,6 cashshop Kafra Headgears#eden1 4_F_KAFRA3,14024:500,14098:150,17081:300,14097:500,14094:1000,14017:400,14099:300
-moc_para01,35,174,2 cashshop Kafra Dye Shop#dyes2 4_F_KAFRA4,6287:150
-moc_para01,37,170,2 cashshop Kafra Consumables#eden3 4_F_KAFRA6,13810:5,14167:400,16556:100,14111:75,14075:25,16419:30,14107:70,14104:50,14112:25,14082:30,14091:60,14088:30,14085:60,14169:40,14170:40,14172:40,14173:40,14171:40,14174:40,14159:100,14160:100,14161:100,14162:100,14163:100:14164:100,16420:1500
-moc_para01,32,174,2 cashshop Kafra Rental Items#eden 4_F_KAFRA7,16683:150,16682:50,14126:250,14125:250,16430:250,14137:250,14127:250,14118:250,14119:250,14132:250,16425:250,14124:250,14133:250,14130:250,16424:250,14136:250,14122:250,16426:250,14135:250,14134:250,14138:250,16428:250,16431:250,14139:250,14131:250,16429:250,16427:250
-moc_para01,37,172,2 cashshop Kafra Costume#eden5 4_F_KAFRA8,16974:300,16972:600,16973:150,16975:150,16977:150,17014:150,17015:150
-moc_para01,35,168,1 cashshop Kafra Utility Shop#eden 4_F_KAFRA5,16677:25,13990:400,16396:100,16394:100,17106:500,6241:10,6240:10,6225:15,6226:15,14002:5,6294:500,7776:50,7619:30,7620:30,12208:40,14156:400,12210:40,14158:400,14042:50,14044:50,14046:50,14048:50,14114:50,14166:40,16418:500,16381:400,14165:100,14157:100,14178:100
+moc_para01,32,171,6 trader Kafra Headgears#eden1 4_F_KAFRA3,{
+OnInit:
+ tradertype(NST_CASH);
+ sellitem F_Robo_Eye_Box,500;
+ sellitem F_Pecopeco_Hairband_Box,150;
+ sellitem Yggdrasil_Crown_Box,300;
+ sellitem F_Chick_Hat_Box,500;
+ sellitem F_Flying_Angel_Box,1000;
+ sellitem F_All_In_One_Ring_Box,400;
+ sellitem F_Red_Glasses_Box,300;
+}
+
+moc_para01,35,174,2 trader Kafra Dye Shop#dyes2 4_F_KAFRA4,{
+OnInit:
+ tradertype(NST_CASH);
+ sellitem F_Clothing_Dye_Coupon,150;
+}
+
+moc_para01,37,170,2 trader Kafra Consumables#eden3 4_F_KAFRA6,{
+OnInit:
+ tradertype(NST_CASH);
+ sellitem Blue_Potion_Box,5;
+ sellitem F_Neuralizer_Box,400;
+ sellitem FPr_Reset_Stone_Box,100;
+ sellitem F_Abrasive_Box10,75;
+ sellitem F_G_O_I_Box10,25;
+ sellitem Greed_Scroll_Box_30,30;
+ sellitem F_M_Life_Potion_Box,70;
+ sellitem F_S_Life_Potion_Box,50;
+ sellitem F_Regeneration_Box5,25;
+ sellitem FS_Def_Potion_Box10,30;
+ sellitem FB_Mdef_Potion_Box10,60;
+ sellitem FS_Mdef_Potion_Box10,30;
+ sellitem FB_Def_Potion_Box10,60;
+ sellitem F_Blessing_10_Scroll_Box,40;
+ sellitem F_Inc_Agi_10_Scroll_Box,40;
+ sellitem F_Assumptio_5_Scroll_Box,40;
+ sellitem F_Wind_Walk_10_Scroll_Box,40;
+ sellitem F_Aspersio_5_Scroll_Box,40;
+ sellitem F_Adrenaline_Scroll_Box,40;
+ sellitem F_Str_Dish_Box,100;
+ sellitem F_Agi_Dish_Box,100;
+ sellitem F_Int_Dish_Box,100;
+ sellitem F_Dex_Dish_Box,100;
+ sellitem F_Luk_Dish_Box,100;
+ sellitem F_Vit_Dish_Box,100;
+ sellitem Adventurer_Pack,1500;
+}
+
+moc_para01,32,174,2 trader Kafra Rental Items#eden 4_F_KAFRA7,{
+OnInit:
+ tradertype(NST_CASH);
+ sellitem B_Halter_Box_30Days,150;
+ sellitem Boarding_Halter_Box,50;
+ sellitem F_Apple_Of_Archer_Box,250;
+ sellitem F_Asura_Box,250;
+ sellitem Rudra_Bow_Box,250;
+ sellitem F_Brooch_Box,250;
+ sellitem F_Bunny_Band_Box,250;
+ sellitem F_Combat_Knife_Box,250;
+ sellitem F_Counter_Dagger_Box,250;
+ sellitem F_Critical_Ring_Box,250;
+ sellitem Cutlus_Box,250;
+ sellitem F_Diary_Of_Great_Sage,250;
+ sellitem F_Earring_Box,250;
+ sellitem F_Elven_Ears_Box,250;
+ sellitem Executioner_Box_,250;
+ sellitem F_Glove_Box,250;
+ sellitem F_Right_Epsilon_Box,250;
+ sellitem Moonlight_Dagger_Box,250;
+ sellitem F_Necklace_Box,250;
+ sellitem F_Ring_Box,250;
+ sellitem F_Rosary_Box,250;
+ sellitem Solar_Sword_Box_,250;
+ sellitem Pole_Axe_Box_,250;
+ sellitem F_Safety_Ring_Box,250;
+ sellitem F_Steel_Flower_Box,250;
+ sellitem Tomahawk_Box_,250;
+ sellitem Wrench_Box,250;
+}
+
+moc_para01,37,172,2 trader Kafra Costume#eden5 4_F_KAFRA8,{
+OnInit:
+ tradertype(NST_CASH);
+ sellitem Comin_Actor_Box,300;
+ sellitem Weather_Report_Box,600;
+ sellitem Yellow_Hat_Box,150;
+ sellitem Singing_Bird_Box,150;
+ sellitem Red_Minicrown_Box,150;
+ sellitem Butterfly_ear_Box,150;
+ sellitem Stuckhead_Screw_Box,150;
+}
+
+moc_para01,35,168,1 trader Kafra Utility Shop#eden 4_F_KAFRA5,{
+OnInit:
+ tradertype(NST_CASH);
+ sellitem Universal_Catalog_Gold_Box10,25;
+ sellitem Job_Manual50_Box,400;
+ sellitem HD_Elu_Box10,100;
+ sellitem HD_Ori_Box10,100;
+ sellitem Max_Weight_Up_10Box,500;
+ sellitem HD_Elunium,10;
+ sellitem HD_Oridecon,10;
+ sellitem HD_Carnium,15;
+ sellitem HD_Bradium,15;
+ sellitem Adv_Siege_Supply_Box,5;
+ sellitem F_Marriage_Covenant,500;
+ sellitem Max_Weight_Up_Scroll,50;
+ sellitem Enriched_Elunium,30;
+ sellitem Enriched_Oridecon,30;
+ sellitem Battle_Manual,40;
+ sellitem F_Battle_Manual_Box,400;
+ sellitem Bubble_Gum,40;
+ sellitem F_Bubble_Gum_Box,400;
+ sellitem F_WOB_Rune_Box10,50;
+ sellitem F_WOB_Schwaltz_Box10,50;
+ sellitem F_WOB_Rachel_Box10,50;
+ sellitem F_WOB_Local_Box10,50;
+ sellitem F_Dun_Tele_Scroll_Box10,50;
+ sellitem F_Giant_Fly_Wing_Box,40;
+ sellitem Giant_Fly_Wing_Box_500,500;
+ sellitem WoE_Teleport_Scroll_100_Box,400;
+ sellitem F_Kafra_Card_Box,100;
+ sellitem F_Insurance_Package,100;
+ sellitem F_Token_Of_Siegfried_Box,100;
+}
// Duplicate NPCs
//============================================================
@@ -829,6 +949,25 @@ auction_03,152,42,4 script Kafra Employee#annex 4_F_KAFRA1,{
}
}
-auction_03,145,47,2 shop Tool Dealer#annex 4_M_01,611:-1,501:-1,502:-1,503:-1,506:-1,504:-1,645:-1,656:-1,657:-1,601:-1,602:-1,1065:-1,911:-1,910:-1,717:-1,1092:-1,1093:-1,713:400
-
+auction_03,145,47,2 trader Tool Dealer#annex 4_M_01,{
+OnInit:
+ sellitem Spectacles;
+ sellitem Red_Potion;
+ sellitem Orange_Potion;
+ sellitem Yellow_Potion;
+ sellitem Green_Potion;
+ sellitem White_Potion;
+ sellitem Center_Potion;
+ sellitem Awakening_Potion;
+ sellitem Berserk_Potion;
+ sellitem Wing_Of_Fly;
+ sellitem Wing_Of_Butterfly;
+ sellitem Booby_Trap;
+ sellitem Scell;
+ sellitem Garlet;
+ sellitem Blue_Gemstone;
+ sellitem Empty_Cylinder;
+ sellitem Empty_Potion;
+ sellitem Empty_Bottle,400;
+}
*/
diff --git a/npc/re/quests/quests_mora.txt b/npc/re/quests/quests_mora.txt
index 55a60de98..53b63e881 100644
--- a/npc/re/quests/quests_mora.txt
+++ b/npc/re/quests/quests_mora.txt
@@ -2519,7 +2519,7 @@ mora,31,138,6 script Raffle Researcher#ep14 4_M_RAFLE_OR,{
close;
}
// NPC disabled from 12am ~ 5am.
- if (gettime(3) >= 0 && gettime(3) < 5) {
+ if (gettime(GETTIME_HOUR) >= 0 && gettime(GETTIME_HOUR) < 5) {
if (ep14_1_muk > 0) {
mes "[Raffle Researcher]";
mes "Don't humans sleep?";
diff --git a/npc/re/woe-fe/invest_main.txt b/npc/re/woe-fe/invest_main.txt
index 9ed49ce7a..b0f594f7f 100644
--- a/npc/re/woe-fe/invest_main.txt
+++ b/npc/re/woe-fe/invest_main.txt
@@ -62,31 +62,31 @@ $@vfund_*_extra
- script #invest_timer -1,{
OnClock0000: // Open investments on Wed (1 hour after WoE)
- if (gettime(4) == 3 && !agitcheck()) {
+ if (gettime(GETTIME_WEEKDAY) == WEDNESDAY && !agitcheck()) {
$2011_agit_invest = 1;
donpcevent "#fund_master::OnInvest_start";
}
end;
OnClock1200: // Close investments on Fri (60 hours after investments open)
- if (gettime(4) == 5 && !agitcheck()) {
+ if (gettime(GETTIME_WEEKDAY) == FRIDAY && !agitcheck()) {
$2011_agit_invest = 2;
donpcevent "#fund_master::OnInvest_stop";
}
end;
OnClock1235: // Open dungeons on Fri (at least 31 minutes after investments close)
- if (gettime(4) == 5 && !agitcheck())
+ if (gettime(GETTIME_WEEKDAY) == FRIDAY && !agitcheck())
donpcevent "#fund_master::OnResult";
end;
OnClock2000: // Close dungeons on Tues (1 hour before WoE)
- if (gettime(4) == 2)
+ if (gettime(GETTIME_WEEKDAY) == TUESDAY)
donpcevent "#fund_master::OnReset";
end;
}
function script F_Invest_Status {
- .@day = gettime(4);
- .@hour = gettime(3);
- .@minute = gettime(2);
+ .@day = gettime(GETTIME_WEEKDAY);
+ .@hour = gettime(GETTIME_HOUR);
+ .@minute = gettime(GETTIME_MINUTE);
// Inactive.
if (agitcheck())
diff --git a/npc/woe-fe/agit_controller.txt b/npc/woe-fe/agit_controller.txt
index 8d038c322..3644ad67b 100644
--- a/npc/woe-fe/agit_controller.txt
+++ b/npc/woe-fe/agit_controller.txt
@@ -7,10 +7,6 @@
//= 2.0a
//===== Description: =========================================
//= Auto Start for War of Emperium
-//=============================================
-//= gettime(3): Gets hour (24 hour time)
-//= gettime(4): Gets day of week 1=Monday, 2=Tuesday,
-//= 3=Wednesday, 4=Thursday, etc.
//===== Additional Comments: =================================
//= v1.1a changed OnInit to OnAgitInit.[kobra_k88]
//= v1.2 added gettime checks. removed $AgitStarted var.[kobra_k88]
@@ -44,9 +40,9 @@ OnClock1800: //end time for Sat(6)
OnAgitInit:
// starting time checks
- if((gettime(4)==2) && (gettime(3)>=21 && gettime(3)<23) ||
- (gettime(4)==4) && (gettime(3)>=21 && gettime(3)<23) ||
- (gettime(4)==6) && (gettime(3)>=16 && gettime(3)<18)) {
+ 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)) {
if (!agitcheck()) {
agitstart;
callsub S_DisplayOwners;
@@ -55,9 +51,9 @@ OnAgitInit:
}
// end time checks
- if ((gettime(4)==2) && (gettime(3)==23) ||
- (gettime(4)==4) && (gettime(3)==23) ||
- (gettime(4)==6) && (gettime(3)==18)) {
+ if ((gettime(GETTIME_WEEKDAY) == 2 && gettime(GETTIME_HOUR) == 23) ||
+ (gettime(GETTIME_WEEKDAY) == 4 && gettime(GETTIME_HOUR) == 23) ||
+ (gettime(GETTIME_WEEKDAY) == 6 && gettime(GETTIME_HOUR) == 18)) {
if (agitcheck()) {
agitend;
callsub S_DisplayOwners;
diff --git a/npc/woe-se/agit_start_se.txt b/npc/woe-se/agit_start_se.txt
index 74f03cb28..c225d9874 100644
--- a/npc/woe-se/agit_start_se.txt
+++ b/npc/woe-se/agit_start_se.txt
@@ -7,10 +7,6 @@
//===== Description: =========================================
//= Auto Start for War of Emperium
//= To know how to set up WoE times, go to doc\woe_time_explanation.txt
-//=============================================
-//= gettime(3): Gets hour (24 hour time)
-//= gettime(4): Gets day of week 1=Monday, 2=Tuesday,
-//= 3=Wednesday, 4=Thursday, etc.
//===== Additional Comments: =================================
//= 1.0 Copy/Paste of the original setter.
//============================================================
@@ -27,9 +23,9 @@ OnClock2300: //end time for Sat(6)
OnAgitInit2:
// starting time checks
- if((gettime(4)==2) && (gettime(3)>=18 && gettime(3)<21) ||
- (gettime(4)==4) && (gettime(3)>=18 && gettime(3)<21) ||
- (gettime(4)==6) && (gettime(3)>=22 && gettime(3)<23)) {
+ if((gettime(GETTIME_WEEKDAY) == 2 && gettime(GETTIME_HOUR) >= 18 && gettime(GETTIME_HOUR) < 21) ||
+ (gettime(GETTIME_WEEKDAY) == 4 && gettime(GETTIME_HOUR) >= 18 && gettime(GETTIME_HOUR) < 21) ||
+ (gettime(GETTIME_WEEKDAY) == 6 && gettime(GETTIME_HOUR) >= 22 && gettime(GETTIME_HOUR) < 23)) {
if (!agitcheck2()) {
agitstart2;
}
@@ -37,9 +33,9 @@ OnAgitInit2:
}
// end time checks
- if ((gettime(4)==2) && (gettime(3)==21) ||
- (gettime(4)==4) && (gettime(3)==21) ||
- (gettime(4)==6) && (gettime(3)==23)) {
+ if ((gettime(GETTIME_WEEKDAY) == 2 && gettime(GETTIME_HOUR) == 21) ||
+ (gettime(GETTIME_WEEKDAY) == 4 && gettime(GETTIME_HOUR) == 21) ||
+ (gettime(GETTIME_WEEKDAY) == 6 && gettime(GETTIME_HOUR) == 23)) {
if (agitcheck2()) {
agitend2;
}
diff --git a/save/empty.txt b/save/empty.txt
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/save/empty.txt
diff --git a/sql-files/item_db.sql b/sql-files/item_db.sql
index 74413d762..4688c1690 100644
--- a/sql-files/item_db.sql
+++ b/sql-files/item_db.sql
@@ -1077,7 +1077,7 @@ REPLACE INTO `item_db` VALUES ('2000','Destruction_Rod','Staff of Destruction','
REPLACE INTO `item_db` VALUES ('2001','Divine_Cross','Divine Cross','4','20','10','1500','120','0','0','1','0','33024','63','2','34','4','70',NULL,'1','23','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bAtkEle,Ele_Holy; bonus bMatkRate,15; bonus bDex,4; bonus2 bSubRace,RC_Demon,15; bonus2 bSubRace,RC_Undead,15;','','');
REPLACE INTO `item_db` VALUES ('2002','Krieger_Twohand_Staff1','Glorious Destruction Staff','4','20','10','0','70','0','0','1','0','99092','63','2','34','4','80',NULL,'1','23','0','0','0','0','499',NULL,'0',NULL,'0',NULL,'0','bonus bMatkRate,getrefine(); bonus2 bMagicAddRace,RC_DemiPlayer,15; bonus2 bIgnoreMdefRate,RC_DemiPlayer,25; bonus bUnbreakableWeapon,0; if(getrefine()>5) { bonus2 bMagicAddRace,RC_DemiPlayer,(getrefine()-5)*2; bonus2 bIgnoreMdefRate,RC_DemiPlayer,5+(getrefine()-5)*2; } if(getrefine()>8) { bonus5 bAutoSpellOnSkill,WZ_STORMGUST,MG_SAFETYWALL,10,200,1; bonus5 bAutoSpellOnSkill,WZ_METEOR,MG_SAFETYWALL,10,200,1; bonus5 bAutoSpellOnSkill,WZ_VERMILION,MG_SAFETYWALL,10,200,1; }','','');
REPLACE INTO `item_db` VALUES ('2003','Destruction_Rod_M','Staff of Destruction','4','20','10','2500','130','0','0','1','1','512','2','2','34','4','80',NULL,'1','23','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','bonus bMatkRate,25+getrefine()/2; bonus bInt,3; bonus bAgi,10; bonus bUseSPrate,(getrefine()*2); bonus3 bAutoSpellWhenHit,WZ_JUPITEL,5,(getrefine()*20); bonus2 bCastrate,HW_MAGICPOWER,-50;','','');
-REPLACE INTO `item_db` VALUES ('2004','Kronos','Kronos','4','20','10','1000','30','0','0','1','0','66052','2','2','34','4','50',NULL,'1','23','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bMatkRate,20; bonus bInt,3+(getrefine()/2); bonus bMaxHP,300+(50*getrefine()/2); autobonus \"{ bonus bMatkRate,12; bonus buseSPRate,20; }\",1,5000,BF_MAGIC,\"{ specialeffect2 EF_ENHANCE; }\";','','');
+REPLACE INTO `item_db` VALUES ('2004','Kronos','Kronos','4','20','10','1000','30','0','0','1','0','66052','2','2','34','4','50',NULL,'1','23','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bMatkRate,20; bonus bInt,3+(getrefine()/2); bonus bMaxHP,300+(50*getrefine()/2); autobonus \"{ bonus bMatkRate,12; bonus bUseSPrate,20; }\",1,5000,BF_MAGIC,\"{ specialeffect2 EF_ENHANCE; }\";','','');
REPLACE INTO `item_db` VALUES ('2005','Dea_Staff','Dea Staff','4','20','10','1000','30','0','0','1','1','33040','2','2','34','3','50',NULL,'1','23','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bAtkEle,Ele_Holy; bonus bMatkRate,15+getrefine()/2; bonus bInt,6; bonus bVit,2; autobonus3 \"{ }\",20,1000,AL_HEAL,\"{ specialeffect2 EF_MAGICALATTHIT; heal 0,200; }\";','','');
REPLACE INTO `item_db` VALUES ('2006','G_Staff_Of_Light','Staff Of Light','4','20','10','1900','80','0','0','1','0','8454660','63','2','34','4','60',NULL,'1','23','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','//bonus bMatk,150; bonus bAtkEle,Ele_Holy; bonus bInt,6;','','');
REPLACE INTO `item_db` VALUES ('2101','Guard','Guard','5','500','250','300','0','0','3','0','0','4294967295','63','2','32','0','0',NULL,'1','1','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
@@ -2581,7 +2581,7 @@ REPLACE INTO `item_db` VALUES ('5428','Bread_Bag1','RWC Anniversary Bread Envelo
REPLACE INTO `item_db` VALUES ('5429','Bogy_Cap','Bogy Cap','5','20','10','100','0','0','2','0','1','4294967295','63','2','256','0','0',NULL,'1','430','0','0','0','0','73',NULL,'0',NULL,'0',NULL,'0','bonus bHPrecovRate, 5; bonus bSPrecovRate, 5;','','');
REPLACE INTO `item_db` VALUES ('5430','Sacred_Torch_Coronet','Torch Cap','5','20','10','0','0','0','3','0','0','4294967295','63','2','256','0','0',NULL,'0','431','0','0','0','0','65',NULL,'0',NULL,'0',NULL,'0','bonus2 bSubEle,Ele_Fire,20; skill MG_FIREBOLT,5;','','');
REPLACE INTO `item_db` VALUES ('5431','Chicken_Hat','Chicken Hat','5','20','10','1000','0','0','0','0','1','4294967295','63','2','256','0','30',NULL,'1','432','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus3 bAutoSpell,MC_LOUD,1,30; bonus bAspdRate,5;','','');
-REPLACE INTO `item_db` VALUES ('5432','Brazil_Baseball_Cap','bRO 4th Anniversary Hat','5','20','10','100','0','0','0','0','0','4294967295','63','2','256','0','0',NULL,'1','433','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','if(gettime(6)==9&&gettime(5)>=10&&gettime(5)<=24) bonus bAllStats, 4;','','');
+REPLACE INTO `item_db` VALUES ('5432','Brazil_Baseball_Cap','bRO 4th Anniversary Hat','5','20','10','100','0','0','0','0','0','4294967295','63','2','256','0','0',NULL,'1','433','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','if (gettime(GETTIME_MONTH) == SEPTEMBER && gettime(GETTIME_DAYOFMONTH) >= 10 && gettime(GETTIME_DAYOFMONTH) <= 24) bonus bAllStats, 4;','','');
REPLACE INTO `item_db` VALUES ('5433','Golden_Wreath','Golden Laurel','5','20','10','100','0','0','0','0','0','4294967295','63','2','256','0','0',NULL,'1','434','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('5435','Coke_Hat','Red Minstrel Hat','5','20','10','100','0','0','1','0','1','4294967295','63','2','256','0','40',NULL,'1','436','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bInt,1; bonus bMaxSP,80; bonus bMdef,3; if(getrefine()>5) { bonus bMdef,getrefine()-5; bonus bMaxSP,(getrefine()-5)*10; }','','');
REPLACE INTO `item_db` VALUES ('5436','Bride\'s_Corolla','Bride\'s Corolla','5','20','10','200','0','0','1','0','0','4294967295','63','2','256','0','0',NULL,'1','437','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bLuk,3; bonus bMdef,2;','','');
@@ -4439,7 +4439,7 @@ REPLACE INTO `item_db` VALUES ('12129','Fantastic_Cooking_Kits','Fantastic Cooki
REPLACE INTO `item_db` VALUES ('12130','Cookie_Bag','Cookie Bag','2','2','1','70','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','1','0','0',NULL,'0',NULL,'0',NULL,'0','getrandgroupitem 12130,1; getrandgroupitem 12130,1; getrandgroupitem 12130,1;','','');
REPLACE INTO `item_db` VALUES ('12131','Lucky_Potion','Lucky Potion','0','2','1','100','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('12132','Red_Bag','Santa\'s Bag','2','0','0','200','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','1','0','0',NULL,'0',NULL,'0',NULL,'0','sc_start SC_XMAS,600000,0;','','');
-REPLACE INTO `item_db` VALUES ('12133','Ice_Cream_','McDonald\'s Ice Cone','0','0','0','80','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','if(gettime(5)!=MDiceCone) { MDiceCone = gettime(5); percentheal 50,50; }','','');
+REPLACE INTO `item_db` VALUES ('12133','Ice_Cream_','McDonald\'s Ice Cone','0','0','0','80','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','if (gettime(GETTIME_DAYOFMONTH) != MDiceCone) { MDiceCone = gettime(GETTIME_DAYOFMONTH); percentheal 50,50; }','','');
REPLACE INTO `item_db` VALUES ('12134','Red_Envelope','Red Envelope','2','1','0','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','Zeny += rand(1000,10000);','','');
REPLACE INTO `item_db` VALUES ('12135','Green_Ale','Green Ale','2','20','10','30','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','percentheal 50,50; sc_start SC_CONFUSION,10000,0,1000,SCFLAG_NONE;','','');
REPLACE INTO `item_db` VALUES ('12136','Women\'s_Bundle','Women\'s Bundle','2','0','0','100','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','getitem callfunc(\"F_RandMes\",4,558,529,2668,7518),1;','','');
@@ -4678,7 +4678,7 @@ REPLACE INTO `item_db` VALUES ('12371','Magical_Lithography','Magical Lithograph
REPLACE INTO `item_db` VALUES ('12372','Hell_Contract','Hell Contract','2','20','10','50','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','1','0','0',NULL,'1',NULL,'0',NULL,'0','pet 1379;','','');
REPLACE INTO `item_db` VALUES ('12373','Boy\'s_Naivety','Boy\'s Pure Heart','2','20','10','50','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','1','0','0',NULL,'1',NULL,'0',NULL,'0','pet 1370;','','');
REPLACE INTO `item_db` VALUES ('12374','Flaming_Ice','Ice Fireworks','2','20','10','50','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','1','0','0',NULL,'1',NULL,'0',NULL,'0','pet 1837;','','');
-REPLACE INTO `item_db` VALUES ('12375','Acaraje','Akaraje','2','0','0','80','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','457',NULL,'0',NULL,'0',NULL,'0','specialeffect2 EF_STEAL; sc_start SC_INCHITRATE,120000,5;','','');
+REPLACE INTO `item_db` VALUES ('12375','Acaraje','Akaraje','2','0','0','80','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','457',NULL,'0',NULL,'0',NULL,'0','specialeffect2 EF_STEAL; sc_start2 SC_ACARAJE,120000,5,10;','','');
REPLACE INTO `item_db` VALUES ('12376','Mysterious_Can2','Mysterious Can2','2','10','5','100','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','1','0','0',NULL,'1',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('12377','Mysterious_PET_Bottle2','Mysterious PET Bottle2','2','10','5','100','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','1','0','0',NULL,'1',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('12378','2009_Rice_Cake_Soup','Rice Cake Soup','2','10','5','100','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
@@ -4739,7 +4739,7 @@ REPLACE INTO `item_db` VALUES ('12432','Siroma_Icetea','Siroma Iced Tea','2','0'
REPLACE INTO `item_db` VALUES ('12433','Drocera_Herb_Stew','Drosera Herb Salad','2','0','0','50','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','1','0','0',NULL,'0',NULL,'0',NULL,'0','sc_start SC_DROCERA_HERB_STEAMED,300000,20;','','');
REPLACE INTO `item_db` VALUES ('12434','Petti_Tail_Noodle','Petite Tail Noodles','2','0','0','50','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','1','0','0',NULL,'0',NULL,'0',NULL,'0','sc_start SC_PUTTI_TAILS_NOODLES,300000,20;','','');
REPLACE INTO `item_db` VALUES ('12435','Black_Thing','Black Mass','2','0','0','50','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','sc_start SC_STOMACHACHE,60000,rand(5,10);','','');
-REPLACE INTO `item_db` VALUES ('12436','Vitata500','Vitata 500','0','10','5','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','1','0','0',NULL,'0',NULL,'0',NULL,'0','sc_start SC_VITATA_500,500000,0; itemheal 0,200;','','');
+REPLACE INTO `item_db` VALUES ('12436','Vitata500','Vitata 500','0','10','5','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','1','0','0',NULL,'0',NULL,'0',NULL,'0','sc_start2 SC_VITATA_500,500000,20,5; itemheal 0,200;','','');
REPLACE INTO `item_db` VALUES ('12437','Enrich_Celermine_Juice','Concentrated Ceromain Soup','2','10','5','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','1','0','0',NULL,'0',NULL,'0',NULL,'0','sc_start SC_EXTRACT_SALAMINE_JUICE,500000,10;','','');
REPLACE INTO `item_db` VALUES ('12438','F_Giant_Fly_Wing','F Giant Fly Wing','2','2','1','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('12439','F_Battle_Manual','F Battle Manual','2','2','1','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
diff --git a/sql-files/item_db_re.sql b/sql-files/item_db_re.sql
index dd8e4302c..134337cd7 100644
--- a/sql-files/item_db_re.sql
+++ b/sql-files/item_db_re.sql
@@ -1210,7 +1210,7 @@ REPLACE INTO `item_db` VALUES ('2000','Destruction_Rod','Staff of Destruction','
REPLACE INTO `item_db` VALUES ('2001','Divine_Cross','Divine Cross','4','20','10','1500','120','210','0','1','0','33024','63','2','34','4','70',NULL,'1','23','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bAtkEle,Ele_Holy; bonus bDex,4; bonus2 bAddRaceTolerance,RC_Demon,15; bonus2 bAddRaceTolerance,RC_Undead,15;','','');
REPLACE INTO `item_db` VALUES ('2002','Krieger_Twohand_Staff1','Glorious Destruction Staff','4','20','10','0','70','210','0','1','0','8487700','63','2','34','4','80',NULL,'1','23','0','0','0','0','499',NULL,'0',NULL,'0',NULL,'0','bonus bMatkRate,getrefine(); bonus2 bMagicAddRace,RC_DemiPlayer,15; bonus2 bIgnoreMdefRate,RC_DemiPlayer,25; bonus bUnbreakableWeapon,0; if(getrefine()>5) { bonus2 bMagicAddRace,RC_DemiPlayer,(min(getrefine(),14)-5)*2; bonus2 bIgnoreMdefRate,RC_DemiPlayer,5+(min(getrefine(),14)-5)*2; } if(getrefine()>8) { bonus5 bAutoSpellOnSkill,WZ_STORMGUST,MG_SAFETYWALL,10,200,1; bonus5 bAutoSpellOnSkill,WZ_METEOR,MG_SAFETYWALL,10,200,1; bonus5 bAutoSpellOnSkill,WZ_VERMILION,MG_SAFETYWALL,10,200,1; }','','');
REPLACE INTO `item_db` VALUES ('2003','Destruction_Rod_M','Staff of Destruction','4','20','10','2500','130','280','0','1','1','512','58','2','34','4','80',NULL,'1','23','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','bonus bMatkRate,getrefine()/2; bonus bInt,3; bonus bAgi,10; bonus bUseSPrate,(getrefine()*2); bonus3 bAutoSpellWhenHit,WZ_JUPITEL,5,(getrefine()*20); bonus2 bVariableCastrate,HW_MAGICPOWER,-50;','','');
-REPLACE INTO `item_db` VALUES ('2004','Kronos','Kronos','4','20','10','1000','30','240','0','1','0','66052','58','2','34','4','50',NULL,'1','23','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bInt,3+(getrefine()/2); bonus bMaxHP,300+(50*getrefine()/2); autobonus \"{ bonus bMatkRate,12; bonus buseSPRate,20; }\",1,5000,BF_MAGIC,\"{ specialeffect2 EF_ENHANCE; }\";','','');
+REPLACE INTO `item_db` VALUES ('2004','Kronos','Kronos','4','20','10','1000','30','240','0','1','0','66052','58','2','34','4','50',NULL,'1','23','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bInt,3+(getrefine()/2); bonus bMaxHP,300+(50*getrefine()/2); autobonus \"{ bonus bMatkRate,12; bonus bUseSPrate,20; }\",1,5000,BF_MAGIC,\"{ specialeffect2 EF_ENHANCE; }\";','','');
REPLACE INTO `item_db` VALUES ('2005','Dea_Staff','Dea Staff','4','20','10','1000','30','220','0','1','1','33040','58','2','34','3','50',NULL,'1','23','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bAtkEle,Ele_Holy; bonus bMatkRate,getrefine()/2; bonus bInt,6; bonus bVit,2; autobonus3 \"{ }\",20,1000,AL_HEAL,\"{ specialeffect2 EF_MAGICALATTHIT; heal 0,200; }\";','','');
REPLACE INTO `item_db` VALUES ('2006','G_Staff_Of_Light','Guardian Of Light Wand','4','20','10','1900','80','150','0','1','0','8454660','63','2','34','4','60',NULL,'1','23','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bAtkEle,Ele_Holy; bonus bInt,6;','','');
REPLACE INTO `item_db` VALUES ('2007','Golden_Rod_Staff','Golden Rod Staff','4','20','10','900','30','230','0','1','2','512','56','2','34','4','100',NULL,'1','23','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bAtkEle,Ele_Wind; bonus bInt,3; bonus2 bSkillAtk,WZ_JUPITEL,12;','','');
@@ -1801,7 +1801,7 @@ REPLACE INTO `item_db` VALUES ('2682','Ring_Of_Water','Ring of Water','5','20','
REPLACE INTO `item_db` VALUES ('2683','Ring_Of_Fire','Ring of Fire','5','20','10','100','0','0','1','0','0','2147483646','63','2','136','0','20',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bSubEle,Ele_Fire,5;','','');
REPLACE INTO `item_db` VALUES ('2684','Ring_Of_Wind','Ring of Wind','5','20','10','100','0','0','1','0','0','2147483646','63','2','136','0','20',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bSubEle,Ele_Wind,5;','','');
REPLACE INTO `item_db` VALUES ('2685','Ring_Of_Earth','Ring of Earth','5','20','10','100','0','0','1','0','0','2147483646','63','2','136','0','20',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bSubEle,Ele_Earth,5;','','');
-REPLACE INTO `item_db` VALUES ('2686','Elven_Ears_C','Rental Elven Ears','5','1','0','0','0','0','2','0','0','2147483646','63','2','512','0','0',NULL,'0','73','0','0','0','0','507',NULL,'0',NULL,'0',NULL,'0','bonus bInt,1;','','');
+REPLACE INTO `item_db` VALUES ('2686','Elven_Ears_C','Rental Elven Ears','5','1','0','0','0','0','2','0','0','2147483646','63','2','512','0','0',NULL,'0','73','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','bonus bInt,1;','','');
REPLACE INTO `item_db` VALUES ('2687','Steel_Flower_C','Rental Steel Flower','5','1','0','0','0','0','1','0','0','2147483646','63','2','1','0','0',NULL,'0','56','0','0','0','0','507',NULL,'0',NULL,'0',NULL,'0','bonus2 bSubRace,RC_Plant,3;','','');
REPLACE INTO `item_db` VALUES ('2688','Critical_Ring_C','Rental Critical Ring','5','1','0','0','0','0','0','0','0','2147483646','63','2','136','0','0',NULL,'0','0','0','0','0','0','507',NULL,'0',NULL,'0',NULL,'0','bonus bCritical,10;','','');
REPLACE INTO `item_db` VALUES ('2689','Earring_C','Rental Earring','5','1','0','0','0','0','0','0','0','2147483646','63','2','136','0','0',NULL,'0','0','0','0','0','0','507',NULL,'0',NULL,'0',NULL,'0','bonus bInt,3;','','');
@@ -1892,11 +1892,11 @@ REPLACE INTO `item_db` VALUES ('2773','Krieger_Ring2','Glorious Popularized Ring
REPLACE INTO `item_db` VALUES ('2774','Krieger_Ring3','Glorious Mass-Production Ring','5','20','10','0','0','0','0','0','0','2147483646','63','2','136','0','0',NULL,'0','0','0','0','0','0','499',NULL,'0',NULL,'0',NULL,'0','bonus bAllStats,1;','','');
REPLACE INTO `item_db` VALUES ('2775','Lure','Lure','5','20','10','100','0','0','0','0','0','4294967295','63','2','136','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('2776','Cool_Towel','Adventurer\'s Trusty Towel','5','20','10','100','0','0','0','0','1','4294967295','63','2','136','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','sc_start SC_SUMMER,-1,0;','sc_end SC_SUMMER;');
-REPLACE INTO `item_db` VALUES ('2777','Shaman_Ring','Shaman Ring','5','20','10','100','0','0','0','0','1','4294967295','63','2','136','0','0',NULL,'0','0','0','0','0','0','449',NULL,'0',NULL,'0',NULL,'0','bonus bUseSPrate,-5;','','');
-REPLACE INTO `item_db` VALUES ('2778','Shaman_Earing','Shaman Earrings','5','20','10','100','0','0','0','0','0','4294967295','63','2','136','0','0',NULL,'0','0','0','0','0','0','449',NULL,'0',NULL,'0',NULL,'0','bonus bInt,2;','','');
-REPLACE INTO `item_db` VALUES ('2779','Dark_Knight_Belt','Dark Knight Belt','5','20','10','500','0','0','1','0','0','4294967295','63','2','136','0','0',NULL,'0','0','0','0','0','0','449',NULL,'0',NULL,'0',NULL,'0','bonus bStr,2; bonus bAgi,1;','','');
-REPLACE INTO `item_db` VALUES ('2780','Dark_Knight_Glove','Dark Knight Glove','5','20','10','500','0','0','1','0','0','4294967295','63','2','136','0','0',NULL,'0','0','0','0','0','0','449',NULL,'0',NULL,'0',NULL,'0','autobonus \"{ bonus bAspdRate,2; }\",10,10000,0,\"{ specialeffect2 EF_POTION_BERSERK; }\";','','');
-REPLACE INTO `item_db` VALUES ('2781','Aumdura\'s_Grace','Aumdura\'s Benefit','5','20','10','100','0','0','1','0','1','4294967295','63','2','136','0','0',NULL,'0','0','0','0','0','0','449',NULL,'0',NULL,'0',NULL,'0','bonus bAllStats,1; bonus bMdef,1;','','');
+REPLACE INTO `item_db` VALUES ('2777','Shaman_Ring','Shaman Ring','5','20','10','100','0','0','0','0','1','4294967295','63','2','136','0','0',NULL,'0','0','0','0','0','0','1',NULL,'0',NULL,'0',NULL,'0','bonus bUseSPrate,-5;','','');
+REPLACE INTO `item_db` VALUES ('2778','Shaman_Earing','Shaman Earrings','5','20','10','100','0','0','0','0','0','4294967295','63','2','136','0','0',NULL,'0','0','0','0','0','0','1',NULL,'0',NULL,'0',NULL,'0','bonus bInt,2;','','');
+REPLACE INTO `item_db` VALUES ('2779','Dark_Knight_Belt','Dark Knight Belt','5','20','10','500','0','0','1','0','0','4294967295','63','2','136','0','0',NULL,'0','0','0','0','0','0','1',NULL,'0',NULL,'0',NULL,'0','bonus bStr,2; bonus bAgi,1;','','');
+REPLACE INTO `item_db` VALUES ('2780','Dark_Knight_Glove','Dark Knight Glove','5','20','10','500','0','0','1','0','0','4294967295','63','2','136','0','0',NULL,'0','0','0','0','0','0','1',NULL,'0',NULL,'0',NULL,'0','autobonus \"{ bonus bAspdRate,2; }\",10,10000,0,\"{ specialeffect2 EF_POTION_BERSERK; }\";','','');
+REPLACE INTO `item_db` VALUES ('2781','Aumdura\'s_Grace','Aumdura\'s Benefit','5','20','10','100','0','0','1','0','1','4294967295','63','2','136','0','0',NULL,'0','0','0','0','0','0','1',NULL,'0',NULL,'0',NULL,'0','bonus bAllStats,1; bonus bMdef,1;','','');
REPLACE INTO `item_db` VALUES ('2782','Ring_Of_Wise_King','Ring of the Ancient Wise King','5','20','10','100','0','0','0','0','0','4294967295','63','2','136','0','0',NULL,'0','0','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','bonus bMaxHP,50; bonus bMaxSP,20;','','');
REPLACE INTO `item_db` VALUES ('2783','Eyes_Stone_Ring','Eye Stone Ring','5','20','10','100','0','0','0','0','1','4294967295','63','2','136','0','70',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bCritical,2; bonus bMaxSP,25;','','');
REPLACE INTO `item_db` VALUES ('2784','Oh_Holy_Night','Christmas Musicbox','5','20','10','100','0','0','0','0','0','4294967295','63','2','136','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','skill ALL_WEWISH,1;','','');
@@ -1940,9 +1940,9 @@ REPLACE INTO `item_db` VALUES ('2821','Acolyte_Manual','Acolyte Manual','5','0',
REPLACE INTO `item_db` VALUES ('2822','Archer_Manual','Archer Manual','5','0','0','100','0','0','0','0','0','1','47','2','136','0','1','12','0','0','0','0','0','0','499',NULL,'0',NULL,'0',NULL,'0','bonus bMaxSP,100; skill AC_OWL,1; skill AC_CONCENTRATION,1;','','');
REPLACE INTO `item_db` VALUES ('2823','Merchant_Manual','Merchant Manual','5','0','0','100','0','0','0','0','0','1','47','2','136','0','1','12','0','0','0','0','0','0','499',NULL,'0',NULL,'0',NULL,'0','bonus bMaxSP,100; skill MC_DISCOUNT,1; skill MC_OVERCHARGE,10; skill MC_IDENTIFY,1; skill MC_MAMMONITE,1;','','');
REPLACE INTO `item_db` VALUES ('2824','Mage_Manual','Mage Manual','5','0','0','100','0','0','0','0','0','1','47','2','136','0','1','12','0','0','0','0','0','0','499',NULL,'0',NULL,'0',NULL,'0','bonus bMaxSP,100; skill MG_SRECOVERY,1; skill MG_COLDBOLT,1; skill MG_FIREWALL,1; skill MG_FIREBOLT,1;','','');
-REPLACE INTO `item_db` VALUES ('2825','Shaman_EaringB','Shaman Earrings','5','20','10','100','0','0','0','0','0','4294967295','63','2','136','0','0',NULL,'0','0','0','0','0','0','449',NULL,'0',NULL,'0',NULL,'0','bonus bInt,2;','','');
-REPLACE INTO `item_db` VALUES ('2826','Dark_Knight_BeltB','Dark Knight Belt','5','20','10','500','0','0','1','0','0','4294967295','63','2','136','0','0',NULL,'0','0','0','0','0','0','449',NULL,'0',NULL,'0',NULL,'0','bonus bDex,2; bonus bAgi,1;','','');
-REPLACE INTO `item_db` VALUES ('2827','Dark_Knight_GloveB','Dark Knight Glove','5','20','10','500','0','0','1','0','0','4294967295','63','2','136','0','0',NULL,'0','0','0','0','0','0','449',NULL,'0',NULL,'0',NULL,'0','autobonus \"{ bonus bMaxHPrate,10; }\",10,10000,0,\"{ specialeffect2 EF_POTION_BERSERK; }\";','','');
+REPLACE INTO `item_db` VALUES ('2825','Shaman_EaringB','Shaman Earrings','5','20','10','100','0','0','0','0','0','4294967295','63','2','136','0','0',NULL,'0','0','0','0','0','0','1',NULL,'0',NULL,'0',NULL,'0','bonus bInt,2;','','');
+REPLACE INTO `item_db` VALUES ('2826','Dark_Knight_BeltB','Dark Knight Belt','5','20','10','500','0','0','1','0','0','4294967295','63','2','136','0','0',NULL,'0','0','0','0','0','0','1',NULL,'0',NULL,'0',NULL,'0','bonus bDex,2; bonus bAgi,1;','','');
+REPLACE INTO `item_db` VALUES ('2827','Dark_Knight_GloveB','Dark Knight Glove','5','20','10','500','0','0','1','0','0','4294967295','63','2','136','0','0',NULL,'0','0','0','0','0','0','1',NULL,'0',NULL,'0',NULL,'0','autobonus \"{ bonus bMaxHPrate,10; }\",10,10000,0,\"{ specialeffect2 EF_POTION_BERSERK; }\";','','');
REPLACE INTO `item_db` VALUES ('2828','Upg_Clip','Upg Clip','5','20','10','100','0','0','0','0','1','4294967295','63','2','136','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bMaxHPrate,3; bonus bMaxSP,30;','','');
REPLACE INTO `item_db` VALUES ('2829','Greed_Clip','Greed Clip','5','0','0','0','0','0','0','0','0','2147483646','63','2','136','0','10',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('2830','Magingiorde_C','Ephemeral Magingiorde','5','20','10','0','0','0','2','0','0','4294967295','63','2','136','0','94',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bStr,40; bonus bMdef,7;','','');
@@ -1979,9 +1979,9 @@ REPLACE INTO `item_db` VALUES ('2860','Aqua_Orb','Aqua Orb','5','20','10','200',
REPLACE INTO `item_db` VALUES ('2861','Crimson_Orb','Crimson Orb','5','20','10','200','0','0','2','0','0','512','56','2','136','0','100',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bMdef,2; bonus bInt,1; bonus2 bSubEle,Ele_Fire,15; bonus3 bAutoSpellWhenHit,WZ_SIGHTRASHER,3,30;','','');
REPLACE INTO `item_db` VALUES ('2862','Forest_Orb','Forest Orb','5','20','10','200','0','0','2','0','0','512','56','2','136','0','100',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bMdef,2; bonus bInt,1; bonus2 bSubEle,Ele_Earth,15; bonus3 bAutoSpellWhenHit,WZ_QUAGMIRE,3,30;','','');
REPLACE INTO `item_db` VALUES ('2863','Ring_Of_Valkyrie','Ring of The Valkyrie','5','0','0','0','0','0','2','0','0','4294967295','63','2','136','0','0',NULL,'0','0','0','0','0','0','507',NULL,'0',NULL,'0',NULL,'0','bonus2 bExpAddRace,RC_Boss,5; bonus2 bExpAddRace,RC_NonBoss,5;','','');
-REPLACE INTO `item_db` VALUES ('2864','Light_Of_Cure','Light Of Cure','5','20','10','0','0','0','0','0','0','256','56','2','136','0','110',NULL,'0','0','0','0','0','0','499',NULL,'0',NULL,'0',NULL,'0','bonus bVit,2; bonus bHealPower,2;','','');
-REPLACE INTO `item_db` VALUES ('2865','Seal_Of_Cathedral','Seal Of Cathedral','5','20','10','0','0','0','0','0','0','256','56','2','136','0','110',NULL,'0','0','0','0','0','0','499',NULL,'0',NULL,'0',NULL,'0','bonus bInt,2; bonus bHealPower,2;','','');
-REPLACE INTO `item_db` VALUES ('2866','Ring_Of_Archbishop','Ring Of Archbishop','5','20','10','0','0','0','0','0','0','256','56','2','136','0','110',NULL,'0','0','0','0','0','0','499',NULL,'0',NULL,'0',NULL,'0','bonus bDex,2; bonus bHealPower,2;','','');
+REPLACE INTO `item_db` VALUES ('2864','Light_Of_Cure','Light Of Cure','5','20','10','0','0','0','0','0','0','256','56','2','136','0','110',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bVit,2; bonus bHealPower,2;','','');
+REPLACE INTO `item_db` VALUES ('2865','Seal_Of_Cathedral','Seal Of Cathedral','5','20','10','0','0','0','0','0','0','256','56','2','136','0','110',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bInt,2; bonus bHealPower,2;','','');
+REPLACE INTO `item_db` VALUES ('2866','Ring_Of_Archbishop','Ring Of Archbishop','5','20','10','0','0','0','0','0','0','256','56','2','136','0','110',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bDex,2; bonus bHealPower,2;','','');
REPLACE INTO `item_db` VALUES ('2867','Broken_Bamboo_Piece','Broken Bamboo Piece','5','20','10','100','0','0','2','0','0','4294967295','63','2','136','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bMdef,2;','','');
REPLACE INTO `item_db` VALUES ('2868','Green_Batik','Green Batik','5','20','10','100','0','0','1','0','0','2147483646','63','2','136','0','45',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bStr,1; bonus bInt,1; bonus bDex,1; bonus bMdef,1;','','');
REPLACE INTO `item_db` VALUES ('2869','Colorful_Ketupat','Colorful Ketupat','5','20','10','100','0','0','0','0','0','2147483646','63','2','136','0','45',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bStr,1; bonus bInt,1; bonus bDex,1;','','');
@@ -3284,16 +3284,16 @@ REPLACE INTO `item_db` VALUES ('5419','Evolved_Leaf','Leaves Of Grass','5','20',
REPLACE INTO `item_db` VALUES ('5420','Mask_Of_Ifrit','Ifrit Mask','5','20','10','800','0','0','12','0','1','2147483646','63','2','769','0','50',NULL,'0','421','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bStr,2; bonus bInt,2; bonus bMdef,5; bonus2 bSubEle,Ele_Fire,10; bonus2 bSubEle,Ele_Water,-10; skill MG_SIGHT,1; bonus3 bAutoSpellWhenHit,WZ_METEOR,3,50; bonus3 bAutoSpell,MG_FIREBOLT,3,50;','','sc_end SC_SIGHT;');
REPLACE INTO `item_db` VALUES ('5421','Ifrit\'s_Ear','Ifrit\'s Ears','5','20','10','300','0','0','0','0','0','2147483646','63','2','512','0','50',NULL,'0','422','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bUnbreakableHelm,0; bonus bInt,1; bonus bStr,1; bonus bMdef,3; bonus2 bSkillAtk,MG_FIREBOLT,2; bonus2 bSkillAtk,WZ_FIREPILLAR,2; bonus2 bSkillAtk,WZ_METEOR,2; bonus2 bSkillAtk,SM_BASH,2; bonus2 bSkillAtk,SM_MAGNUM,2; bonus2 bSkillAtk,KN_PIERCE,2; bonus2 bSubEle,Ele_Fire,5; bonus2 bSubEle,Ele_Water,-5;','','');
REPLACE INTO `item_db` VALUES ('5422','Linguistic_Book_Cap','Linguistic Book Hat','5','20','10','70','0','0','0','0','0','4294967295','63','2','256','0','0',NULL,'1','423','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bInt,1; bonus bMdef,2;','','');
-REPLACE INTO `item_db` VALUES ('5423','Lovecap_China','I LOVE CHINA','5','20','10','250','0','0','10','0','0','4294967295','63','2','256','0','0',NULL,'0','424','0','0','0','0','457',NULL,'0',NULL,'0',NULL,'0','bonus bDex,3; bonus2 bAddRaceTolerance,RC_DemiPlayer,10;','','');
+REPLACE INTO `item_db` VALUES ('5423','Lovecap_China','I LOVE CHINA','5','20','10','250','0','0','10','0','0','4294967295','63','2','256','0','0',NULL,'0','424','0','0','0','0','9',NULL,'0',NULL,'0',NULL,'0','bonus bDex,3; bonus2 bAddRaceTolerance,RC_DemiPlayer,10;','','');
REPLACE INTO `item_db` VALUES ('5424','Fanta_Orange_Can','Fanta Orange Can Hat','5','20','10','100','0','0','3','0','1','4294967295','63','2','256','0','0',NULL,'1','425','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('5425','Fanta_Grape_Can','Fanta Grape Can Hat','5','20','10','100','0','0','3','0','1','4294967295','63','2','256','0','0',NULL,'1','426','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('5426','Karada_Meguri_Tea_Hat','Karada Meguricha Hat','5','20','10','100','0','0','3','0','1','4294967295','63','2','256','0','0',NULL,'1','427','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bLuk,1;','','');
REPLACE INTO `item_db` VALUES ('5427','Royal_Milk_Tea_Hat','Black Tea Kochakaden Hat','5','20','10','100','0','0','3','0','1','4294967295','63','2','256','0','0',NULL,'1','428','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bAgi,1;','','');
REPLACE INTO `item_db` VALUES ('5428','Bread_Bag1','RWC Anniversary Bread Envelope','5','20','10','100','0','0','0','0','0','4294967295','63','2','769','0','0',NULL,'1','429','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','bonus2 bAddRaceTolerance,RC_DemiPlayer,12;','','');
REPLACE INTO `item_db` VALUES ('5429','Bogy_Cap','Dokebi Hat','5','20','10','100','0','0','4','0','1','4294967295','63','2','256','0','0',NULL,'1','430','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bHPrecovRate,5; bonus bSPrecovRate,5;','','');
-REPLACE INTO `item_db` VALUES ('5430','Sacred_Torch_Coronet','Promethean Crown','5','20','10','250','0','0','6','0','0','4294967295','63','2','256','0','0',NULL,'0','431','0','0','0','0','449',NULL,'0',NULL,'0',NULL,'0','bonus2 bSubEle,Ele_Fire,20; skill MG_FIREBOLT,5;','','');
+REPLACE INTO `item_db` VALUES ('5430','Sacred_Torch_Coronet','Promethean Crown','5','20','10','250','0','0','6','0','0','4294967295','63','2','256','0','0',NULL,'0','431','0','0','0','0','1',NULL,'0',NULL,'0',NULL,'0','bonus2 bSubEle,Ele_Fire,20; skill MG_FIREBOLT,5;','','');
REPLACE INTO `item_db` VALUES ('5431','Chicken_Hat','Chicken Hat','5','20','10','1000','0','0','0','0','1','4294967295','63','2','256','0','30',NULL,'1','432','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus3 bAutoSpell,MC_LOUD,1,30; bonus bAspdRate,5;','','');
-REPLACE INTO `item_db` VALUES ('5432','Brazil_Baseball_Cap','bRO 4th Anniversary Hat','5','20','10','100','0','0','0','0','0','4294967295','63','2','256','0','0',NULL,'1','433','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','if(gettime(6)==9&&gettime(5)>=10&&gettime(5)<=24) bonus bAllStats,4;','','');
+REPLACE INTO `item_db` VALUES ('5432','Brazil_Baseball_Cap','bRO 4th Anniversary Hat','5','20','10','100','0','0','0','0','0','4294967295','63','2','256','0','0',NULL,'1','433','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','if (gettime(GETTIME_MONTH) == SEPTEMBER && gettime(GETTIME_DAYOFMONTH) >= 10 && gettime(GETTIME_DAYOFMONTH) <= 24) bonus bAllStats,4;','','');
REPLACE INTO `item_db` VALUES ('5433','Golden_Wreath','Champion\'s Wreath','5','20','10','100','0','0','0','0','0','4294967295','63','2','256','0','0',NULL,'1','434','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('5434','Cola_Can','Coca-Cola Bottle','5','20','10','100','0','0','3','0','1','4294967295','63','2','256','0','0',NULL,'1','435','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('5435','Coke_Hat','Coca-Cola Hat','5','20','10','100','0','0','2','0','1','4294967295','63','2','256','0','40',NULL,'1','436','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bInt,1; bonus bMaxSP,80; bonus bMdef,3; if(getrefine()>5) { bonus bMdef,getrefine()-5; bonus bMaxSP,(getrefine()-5)*10; }','','');
@@ -3340,11 +3340,11 @@ REPLACE INTO `item_db` VALUES ('5475','Cube_Mask','Quove Hat','5','20','10','100
REPLACE INTO `item_db` VALUES ('5476','Hairband_Of_Grandpeco','Grand Peco Headdress','5','20','10','800','0','0','5','0','0','4294967295','63','2','768','0','0',NULL,'1','473','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bStr,2; bonus bMaxHPrate,-10; bonus2 bAddRace2,RC2_Orc,15;','','');
REPLACE INTO `item_db` VALUES ('5477','Bro_Flag','Brazilian Flag Hat','5','20','10','100','0','0','2','0','1','4294967295','63','2','256','0','30',NULL,'1','474','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('5478','Classic_Hat','Classic Hat','5','20','10','500','0','0','4','0','0','4294967295','63','2','256','0','0',NULL,'1','475','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bStr,2; bonus bMaxHP,300;','','');
-REPLACE INTO `item_db` VALUES ('5479','Shaman\'s_Hair_Ornament','Shaman\'s Hair Decoration','5','20','10','300','0','0','2','0','0','4294967295','63','2','256','0','0',NULL,'1','476','0','0','0','0','449',NULL,'0',NULL,'0',NULL,'0','bonus bMdef,3; bonus bMaxHP,50; bonus2 bSubEle,Ele_Neutral,5;','','');
-REPLACE INTO `item_db` VALUES ('5480','Bizofnil_Wing_Deco','Bijofnil Wings','5','20','10','1000','0','0','6','0','0','4294967295','63','2','256','0','0',NULL,'1','477','0','0','0','0','449',NULL,'0',NULL,'0',NULL,'0','bonus bAllStats,2; bonus3 bAutoSpell,PR_IMPOSITIO,3,3;','','');
-REPLACE INTO `item_db` VALUES ('5481','Hermose_Cap','Hermode Cap','5','20','10','1000','0','0','2','0','1','4294967295','63','2','256','0','0',NULL,'1','478','0','0','0','0','449',NULL,'0',NULL,'0',NULL,'0','bonus bAspdRate,10; bonus bBaseAtk,-20; bonus bMatkRate,-10;','','');
-REPLACE INTO `item_db` VALUES ('5482','Dark_Knight_Mask','Dark Knight Mask','5','20','10','3000','0','0','5','0','0','4294967295','63','2','769','0','0',NULL,'1','479','0','0','0','0','449',NULL,'0',NULL,'0',NULL,'0','bonus bStr,3;','','');
-REPLACE INTO `item_db` VALUES ('5483','Odin_Mask','Odin Mask','5','20','10','100','0','0','1','0','0','4294967295','63','2','513','0','0',NULL,'0','480','0','0','0','0','449',NULL,'0',NULL,'0',NULL,'0','bonus bUnbreakableHelm,0; bonus bHit,-10; bonus2 bAddRace,RC_DemiPlayer,6;','','');
+REPLACE INTO `item_db` VALUES ('5479','Shaman\'s_Hair_Ornament','Shaman\'s Hair Decoration','5','20','10','300','0','0','2','0','0','4294967295','63','2','256','0','0',NULL,'1','476','0','0','0','0','1',NULL,'0',NULL,'0',NULL,'0','bonus bMdef,3; bonus bMaxHP,50; bonus2 bSubEle,Ele_Neutral,5;','','');
+REPLACE INTO `item_db` VALUES ('5480','Bizofnil_Wing_Deco','Bijofnil Wings','5','20','10','1000','0','0','6','0','0','4294967295','63','2','256','0','0',NULL,'1','477','0','0','0','0','1',NULL,'0',NULL,'0',NULL,'0','bonus bAllStats,2; bonus3 bAutoSpell,PR_IMPOSITIO,3,3;','','');
+REPLACE INTO `item_db` VALUES ('5481','Hermose_Cap','Hermode Cap','5','20','10','1000','0','0','2','0','1','4294967295','63','2','256','0','0',NULL,'1','478','0','0','0','0','1',NULL,'0',NULL,'0',NULL,'0','bonus bAspdRate,10; bonus bBaseAtk,-20; bonus bMatkRate,-10;','','');
+REPLACE INTO `item_db` VALUES ('5482','Dark_Knight_Mask','Dark Knight Mask','5','20','10','3000','0','0','5','0','0','4294967295','63','2','769','0','0',NULL,'1','479','0','0','0','0','1',NULL,'0',NULL,'0',NULL,'0','bonus bStr,3;','','');
+REPLACE INTO `item_db` VALUES ('5483','Odin_Mask','Odin Mask','5','20','10','100','0','0','1','0','0','4294967295','63','2','513','0','0',NULL,'0','480','0','0','0','0','1',NULL,'0',NULL,'0',NULL,'0','bonus bUnbreakableHelm,0; bonus bHit,-10; bonus2 bAddRace,RC_DemiPlayer,6;','','');
REPLACE INTO `item_db` VALUES ('5484','Taiwan_Flag_Hat','Holidays Hat','5','20','10','500','0','0','8','0','0','4294967295','63','2','256','0','0',NULL,'0','482','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bStr,5; bonus bInt,5; bonus bVit,5; bonus bDex,5; bonus bAgi,5; bonus bLuk,5;','','');
REPLACE INTO `item_db` VALUES ('5485','Tiger_Face','Tiger Face','5','20','10','1000','0','0','3','0','0','4294967295','63','2','769','0','60',NULL,'1','483','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bAddRaceTolerance,RC_Brute,5; bonus2 bAddRace,RC_Brute,5; bonus2 bMagicAddRace,RC_Brute,5;','','');
REPLACE INTO `item_db` VALUES ('5486','J_Anniversary_Hat','Anniversary Hat','5','20','10','300','0','0','6','0','0','4294967295','63','2','256','0','0',NULL,'1','395','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bAllStats,2;','','');
@@ -3438,7 +3438,7 @@ REPLACE INTO `item_db` VALUES ('5573','Bogy_Horn','Dokebi Horn','5','20','10','1
REPLACE INTO `item_db` VALUES ('5574','Pencil_In_Mouth','Well-Chewed Pencil','5','20','10','100','0','0','0','0','0','4294967295','63','2','1','0','10',NULL,'0','555','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bUnbreakableHelm,0; bonus bDex,2; bonus bHitRate,3;','','');
REPLACE INTO `item_db` VALUES ('5575','Onigiri_Hat','Rice Ball Hat','5','20','10','100','0','0','6','0','1','4294967295','63','2','256','0','30',NULL,'0','556','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('5576','Japan_Winecup','Wine Cup','5','20','10','100','0','0','0','0','0','4294967295','63','2','1','0','0',NULL,'0','557','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bUnbreakableHelm,0;','','');
-REPLACE INTO `item_db` VALUES ('5577','Dark_Knight_MaskB','Dark Knight Mask','5','20','10','3000','0','0','5','0','0','4294967295','63','2','769','0','0',NULL,'1','479','0','0','0','0','449',NULL,'0',NULL,'0',NULL,'0','bonus bDex,3; bonus bStr,3;','','');
+REPLACE INTO `item_db` VALUES ('5577','Dark_Knight_MaskB','Dark Knight Mask','5','20','10','3000','0','0','5','0','0','4294967295','63','2','769','0','0',NULL,'1','479','0','0','0','0','1',NULL,'0',NULL,'0',NULL,'0','bonus bDex,3; bonus bStr,3;','','');
REPLACE INTO `item_db` VALUES ('5578','Voyage_Hat','Voyage Hat','5','200','100','10','0','0','1','0','0','4294967295','63','2','256','0','0',NULL,'1','236','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bAgi,2;','','');
REPLACE INTO `item_db` VALUES ('5579','Wanderer\'s_Sakkat','Wanderer\'s Sakkat','5','20','10','300','0','0','2','0','1','4294967295','63','2','768','0','0',NULL,'1','558','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bAgi,2; bonus bFlee,3; if(getrefine()>6) { bonus bFlee,2; bonus bAgi,2; } if(getrefine()>8) { bonus bCritical,10; bonus bAspdRate,8; }','','');
REPLACE INTO `item_db` VALUES ('5580','Red_Beret','Red Beret','5','20','10','100','0','0','3','0','0','4294967295','63','2','256','0','0',NULL,'0','559','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bAddRace,RC_DemiPlayer,5; bonus2 bAddRace,RC_Player,5; bonus2 bAddRaceTolerance,RC_DemiPlayer,5; bonus2 bAddRaceTolerance,RC_Player,5;','','');
@@ -3885,14 +3885,14 @@ REPLACE INTO `item_db` VALUES ('6132','Ticket_Incubus','Incubus Exchange Coupon'
REPLACE INTO `item_db` VALUES ('6133','Ticket_Miyabi_Ningyo','Miyabi Ningyo Exchange Coupon','3','0','0','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','507',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('6134','Ticket_Whisper','Giant Whisper Exchange Coupon','3','0','0','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','507',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('6135','Ticket_Wicked_Nymph','Evil Nymph Exchange Coupon','3','0','0','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','507',NULL,'0',NULL,'0',NULL,'0','','','');
-REPLACE INTO `item_db` VALUES ('6136','Ticket_Medusa','Medusa Exchange Coupon','3','0','0','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','507',NULL,'0',NULL,'0',NULL,'0','','','');
+REPLACE INTO `item_db` VALUES ('6136','Ticket_Medusa','Medusa Exchange Coupon','3','0','0','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('6137','Ticket_Stoneshooter','Stone Shooter Exchange Coupon','3','0','0','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','507',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('6138','Ticket_Marionette','Marionette Exchange Coupon','3','0','0','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','507',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('6139','Ticket_Leafcat','Leaf Cat Exchange Coupon','3','0','0','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','507',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('6140','Ticket_Dullahan','Dullahan Exchange Coupon','3','0','0','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','507',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('6141','Ticket_Shinobi','Shinobi Exchange Coupon','3','0','0','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','507',NULL,'0',NULL,'0',NULL,'0','','','');
-REPLACE INTO `item_db` VALUES ('6142','Ticket_Golem','Golem Exchange Coupon','3','0','0','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','507',NULL,'0',NULL,'0',NULL,'0','','','');
-REPLACE INTO `item_db` VALUES ('6143','Ticket_Civil_Servant','Civil Servant Exchange Coupon','3','0','0','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','507',NULL,'0',NULL,'0',NULL,'0','','','');
+REPLACE INTO `item_db` VALUES ('6142','Ticket_Golem','Golem Exchange Coupon','3','0','0','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','','','');
+REPLACE INTO `item_db` VALUES ('6143','Ticket_Civil_Servant','Civil Servant Exchange Coupon','3','0','0','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('6144','Heartbroken_Tears','Regrettable Tears','3','1250','625','2','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','1','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('6145','Vulcan_Bullet','Vulcan Bullet','3','12','6','2','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','1','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('6146','Magic_Gear_Fuel','Magic Gear Fuel','3','375','187','30','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','1','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
@@ -3990,7 +3990,7 @@ REPLACE INTO `item_db` VALUES ('6238','Guarantee_Weapon_11Up','Safe to 11 Weapon
REPLACE INTO `item_db` VALUES ('6239','Guarantee_Armor_11Up','Safe to 11 Armor Certificate','3','0','0','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('6240','HD_Oridecon','HD Oridecon','3','20','10','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('6241','HD_Elunium','HD Elunium','3','20','10','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','','','');
-REPLACE INTO `item_db` VALUES ('6242','Midgard_Coin','Midgard Coin','3','20','10','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','457',NULL,'0',NULL,'0',NULL,'0','','','');
+REPLACE INTO `item_db` VALUES ('6242','Midgard_Coin','Midgard Coin','3','20','10','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','9',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('6243','Exchange_Coupon','WPS Point Token','3','0','0','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('6244','Gun_Powder','Gun Powder','3','10','5','1','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','1','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('6245','Black_Powder','Black Powder','3','125','62','1','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','1','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
@@ -4343,7 +4343,7 @@ REPLACE INTO `item_db` VALUES ('6682','Bag_Of_Selling_Goods','Bag Of Selling Goo
REPLACE INTO `item_db` VALUES ('6712','Lovely_Stick','Love Wand','3','0','0','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('6804','Organic_Pumpkin','Organic Pumpkin','3','20','10','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('6805','Inorganic_Pumpkin','Inorganic Pumpkin','3','20','10','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
-REPLACE INTO `item_db` VALUES ('6821','Solo_Troops_Badge','Single Union Badge','3','0','0','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
+REPLACE INTO `item_db` VALUES ('6821','Solo_Troops_Badge','Single Union Badge','3','0','0','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','467',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('6913','Sacred_Rosary','Sacred Rosary','3','0','0','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','507',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('6914','Black_Soul','Black Soul','3','0','0','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','499',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('6915','Captured_Soul','Captured Soul','3','0','0','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','499',NULL,'0',NULL,'0',NULL,'0','','','');
@@ -4545,7 +4545,7 @@ REPLACE INTO `item_db` VALUES ('7195','Air_Rifle','Slingshot','3','210','105','1
REPLACE INTO `item_db` VALUES ('7196','Shoulder_Protection','Shoulder Protector','3','230','115','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','1','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('7197','Tough_Vines','Tough Vines','3','500','250','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','1','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('7198','Great_Leaf','Huge Leaf','3','610','305','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','1','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
-REPLACE INTO `item_db` VALUES ('7199','Coupon','Event Tickets','3','0','0','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','1','0','448',NULL,'0',NULL,'0',NULL,'0','','','');
+REPLACE INTO `item_db` VALUES ('7199','Coupon','Event Tickets','3','0','0','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','1','0','499',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('7200','Flexible_String','Elastic Band','3','380','190','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','1','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('7201','Log','Log','3','250','125','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','1','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('7202','Beetle_Nipper','Pincher of Beetle','3','290','145','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','1','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
@@ -5022,18 +5022,18 @@ REPLACE INTO `item_db` VALUES ('7726','Token_Of_King','Token of King','3','20','
REPLACE INTO `item_db` VALUES ('7727','HP_Doctor_Ticket','HP Doctor Ticket','3','0','0','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','499',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('7728','SP_Doctor_Ticket','SP Doctor Ticket','3','0','0','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','499',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('7729','Rok_Star_Badge','Rok Star Badge','3','20','10','100','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','499',NULL,'0',NULL,'0',NULL,'0','','','');
-REPLACE INTO `item_db` VALUES ('7730','Mission_Certificate1','Mission Ticket 1','3','0','0','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','392',NULL,'0',NULL,'0',NULL,'0','','','');
-REPLACE INTO `item_db` VALUES ('7731','Mission_Certificate2','Mission Ticket 2','3','0','0','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','392',NULL,'0',NULL,'0',NULL,'0','','','');
-REPLACE INTO `item_db` VALUES ('7732','Mission_Certificate3','Mission Ticket 3','3','0','0','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','392',NULL,'0',NULL,'0',NULL,'0','','','');
-REPLACE INTO `item_db` VALUES ('7733','Mission_Certificate4','Mission Ticket 4','3','0','0','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','392',NULL,'0',NULL,'0',NULL,'0','','','');
-REPLACE INTO `item_db` VALUES ('7734','Mission_Certificate5','Mission Ticket 5','3','0','0','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','392',NULL,'0',NULL,'0',NULL,'0','','','');
-REPLACE INTO `item_db` VALUES ('7735','Mission_Certificate6','Mission Ticket 6','3','0','0','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','392',NULL,'0',NULL,'0',NULL,'0','','','');
-REPLACE INTO `item_db` VALUES ('7736','Mission_Certificate7','Mission Ticket 7','3','0','0','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','392',NULL,'0',NULL,'0',NULL,'0','','','');
-REPLACE INTO `item_db` VALUES ('7737','Mission_Certificate8','Mission Ticket 8','3','0','0','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','392',NULL,'0',NULL,'0',NULL,'0','','','');
-REPLACE INTO `item_db` VALUES ('7738','Mission_Certificate9','Mission Ticket 9','3','0','0','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','392',NULL,'0',NULL,'0',NULL,'0','','','');
-REPLACE INTO `item_db` VALUES ('7739','Mission_Certificate10','Mission Ticket 10','3','0','0','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','392',NULL,'0',NULL,'0',NULL,'0','','','');
-REPLACE INTO `item_db` VALUES ('7740','Mission_Certificate11','Mission Ticket 11','3','0','0','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','392',NULL,'0',NULL,'0',NULL,'0','','','');
-REPLACE INTO `item_db` VALUES ('7741','Mission_Certificate12','Mission Ticket 12','3','0','0','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','392',NULL,'0',NULL,'0',NULL,'0','','','');
+REPLACE INTO `item_db` VALUES ('7730','Mission_Certificate1','Mission Ticket 1','3','0','0','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','8',NULL,'0',NULL,'0',NULL,'0','','','');
+REPLACE INTO `item_db` VALUES ('7731','Mission_Certificate2','Mission Ticket 2','3','0','0','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','8',NULL,'0',NULL,'0',NULL,'0','','','');
+REPLACE INTO `item_db` VALUES ('7732','Mission_Certificate3','Mission Ticket 3','3','0','0','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','8',NULL,'0',NULL,'0',NULL,'0','','','');
+REPLACE INTO `item_db` VALUES ('7733','Mission_Certificate4','Mission Ticket 4','3','0','0','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','8',NULL,'0',NULL,'0',NULL,'0','','','');
+REPLACE INTO `item_db` VALUES ('7734','Mission_Certificate5','Mission Ticket 5','3','0','0','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','8',NULL,'0',NULL,'0',NULL,'0','','','');
+REPLACE INTO `item_db` VALUES ('7735','Mission_Certificate6','Mission Ticket 6','3','0','0','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','8',NULL,'0',NULL,'0',NULL,'0','','','');
+REPLACE INTO `item_db` VALUES ('7736','Mission_Certificate7','Mission Ticket 7','3','0','0','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','8',NULL,'0',NULL,'0',NULL,'0','','','');
+REPLACE INTO `item_db` VALUES ('7737','Mission_Certificate8','Mission Ticket 8','3','0','0','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','8',NULL,'0',NULL,'0',NULL,'0','','','');
+REPLACE INTO `item_db` VALUES ('7738','Mission_Certificate9','Mission Ticket 9','3','0','0','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','8',NULL,'0',NULL,'0',NULL,'0','','','');
+REPLACE INTO `item_db` VALUES ('7739','Mission_Certificate10','Mission Ticket 10','3','0','0','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','8',NULL,'0',NULL,'0',NULL,'0','','','');
+REPLACE INTO `item_db` VALUES ('7740','Mission_Certificate11','Mission Ticket 11','3','0','0','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','8',NULL,'0',NULL,'0',NULL,'0','','','');
+REPLACE INTO `item_db` VALUES ('7741','Mission_Certificate12','Mission Ticket 12','3','0','0','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','8',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('7742','Kaong','Kaong','3','2','1','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('7743','Gulaman','Gulaman','3','2','1','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('7744','Leche_Flan','Leche Flan','3','2','1','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
@@ -5249,8 +5249,8 @@ REPLACE INTO `item_db` VALUES ('7955','Lost_Card1','Forgotten Card 1','3','10','
REPLACE INTO `item_db` VALUES ('7956','Lost_Card2','Forgotten Card 2','3','10','5','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('7957','Lost_Card3','Forgotten Card 3','3','10','5','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('7958','Lost_Card4','Forgotten Card 4','3','10','5','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
-REPLACE INTO `item_db` VALUES ('7959','Ancient_Gold_Coin','UP Coin','3','0','0','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','449',NULL,'0',NULL,'0',NULL,'0','','','');
-REPLACE INTO `item_db` VALUES ('7960','Ancient_Silver_Coin','Ancient Silver','3','0','0','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','449',NULL,'0',NULL,'0',NULL,'0','','','');
+REPLACE INTO `item_db` VALUES ('7959','Ancient_Gold_Coin','UP Coin','3','0','0','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','1',NULL,'0',NULL,'0',NULL,'0','','','');
+REPLACE INTO `item_db` VALUES ('7960','Ancient_Silver_Coin','Ancient Silver','3','0','0','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','1',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('7961','Weapon_Exchange','Weapon Exchange Ticket','3','0','0','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','499',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('7962','Treasure_Map1','Treasure Map1','3','10','5','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','499',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('7963','Treasure_Map2','Treasure Map2','3','10','5','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','499',NULL,'0',NULL,'0',NULL,'0','','','');
@@ -5317,7 +5317,7 @@ REPLACE INTO `item_db` VALUES ('9024','Bapho_Jr._Egg','Bapho Jr. Egg','7','20','
REPLACE INTO `item_db` VALUES ('9025','Bongun_Egg','Bongun Egg','7','20','10','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('9026','Zherlthsh_Egg','Zealotus Egg','7','20','10','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('9027','Alice_Egg','Alice Egg','7','20','10','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
-REPLACE INTO `item_db` VALUES ('9028','Rice_Cake_Egg','Hard Rice Cake','7','20','10','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','465',NULL,'0',NULL,'0',NULL,'0','','','');
+REPLACE INTO `item_db` VALUES ('9028','Rice_Cake_Egg','Hard Rice Cake','7','20','10','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','1',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('9029','Santa_Goblin_Egg','X-mas Goblin\'s Egg','7','20','10','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('9030','Chung_E_Egg','Green Maiden Egg','7','20','10','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('9031','Spring_Rabbit_Egg','Spring Rabbit Egg','7','20','10','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
@@ -5656,7 +5656,7 @@ REPLACE INTO `item_db` VALUES ('12129','Fantastic_Cooking_Kits','Fantastic Cooki
REPLACE INTO `item_db` VALUES ('12130','Cookie_Bag','Cookie Bag','2','2','1','70','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','1','0','0',NULL,'0',NULL,'0',NULL,'0','getrandgroupitem 12130,1; getrandgroupitem 12130,1; getrandgroupitem 12130,1;','','');
REPLACE INTO `item_db` VALUES ('12131','Lucky_Potion','Lucky Potion','0','2','1','100','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('12132','Red_Bag','Santa\'s Bag','2','0','0','200','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','1','0','0',NULL,'0',NULL,'0',NULL,'0','sc_start SC_XMAS,600000,0;','','');
-REPLACE INTO `item_db` VALUES ('12133','Ice_Cream_','McDonald\'s Ice Cone','0','0','0','80','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','if(gettime(5)!=MDiceCone) { MDiceCone = gettime(5); percentheal 50,50; }','','');
+REPLACE INTO `item_db` VALUES ('12133','Ice_Cream_','McDonald\'s Ice Cone','0','0','0','80','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','if (gettime(GETTIME_DAYOFMONTH) != MDiceCone) { MDiceCone = gettime(GETTIME_DAYOFMONTH); percentheal 50,50; }','','');
REPLACE INTO `item_db` VALUES ('12134','Red_Envelope','Red Envelope','2','1','0','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','Zeny += rand(1000,10000);','','');
REPLACE INTO `item_db` VALUES ('12135','Green_Ale','Green Ale','2','20','10','30','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','percentheal 50,50; sc_start SC_CONFUSION,10000,0,1000,SCFLAG_NONE;','','');
REPLACE INTO `item_db` VALUES ('12136','Women\'s_Bundle','Women\'s Bundle','2','0','0','100','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','getitem callfunc(\"F_RandMes\",4,558,529,2668,7518),1;','','');
@@ -5834,7 +5834,7 @@ REPLACE INTO `item_db` VALUES ('12310','Spray_Of_Flowers','Spray Of Flowers','2'
REPLACE INTO `item_db` VALUES ('12311','Large_Spray_Of_Flowers','Huge Spray Of Flowers','11','0','0','100','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','467',NULL,'1',NULL,'0',NULL,'0','itemskill ALL_PARTYFLEE,1;','','');
REPLACE INTO `item_db` VALUES ('12312','Thick_Manual50','Thick Battle Manual','2','0','0','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','sc_start SC_CASH_PLUSEXP,3600000,50;','','');
REPLACE INTO `item_db` VALUES ('12313','Protection_Of_Angel','Guardian Angel','2','0','0','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','499',NULL,'1',NULL,'0',NULL,'0','itemskill ALL_ANGEL_PROTECT,1;','','');
-REPLACE INTO `item_db` VALUES ('12314','Noive_Box','Noive Box','2','0','0','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','','','');
+REPLACE INTO `item_db` VALUES ('12314','Noive_Box','Noive Box','2','0','0','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','507',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('12315','Goddess_Bless','Goddess Of Blessing','2','0','0','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('12316','Angel_Bless','Angel Of Blessing','2','0','0','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('12317','Powder_Snow','Snow Powder','2','0','0','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','end;','','');
@@ -5895,7 +5895,7 @@ REPLACE INTO `item_db` VALUES ('12371','Magical_Lithography','Magical Lithograph
REPLACE INTO `item_db` VALUES ('12372','Hell_Contract','Hell Contract','2','20','10','50','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','1','0','0',NULL,'1',NULL,'0',NULL,'0','pet 1379;','','');
REPLACE INTO `item_db` VALUES ('12373','Boy\'s_Naivety','Boy\'s Pure Heart','2','20','10','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','1','0','0',NULL,'1',NULL,'0',NULL,'0','pet 1370;','','');
REPLACE INTO `item_db` VALUES ('12374','Flaming_Ice','Ice Fireworks','2','20','10','50','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','1','0','0',NULL,'1',NULL,'0',NULL,'0','pet 1837;','','');
-REPLACE INTO `item_db` VALUES ('12375','Acaraje','Akaraje','2','0','0','80','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','specialeffect2 EF_STEAL; sc_start SC_INCHITRATE,120000,5;','','');
+REPLACE INTO `item_db` VALUES ('12375','Acaraje','Akaraje','2','0','0','80','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','specialeffect2 EF_STEAL; sc_start2 SC_ACARAJE,120000,5,10;','','');
REPLACE INTO `item_db` VALUES ('12376','Mysterious_Can2','Mysterious Can2','2','10','5','100','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','1','0','0',NULL,'1',NULL,'0',NULL,'0','percentheal 3,0; itemskill PR_GLORIA,2;','','');
REPLACE INTO `item_db` VALUES ('12377','Mysterious_PET_Bottle2','Mysterious PET Bottle2','2','10','5','100','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','1','0','0',NULL,'1',NULL,'0',NULL,'0','percentheal 0,3; itemskill PR_MAGNIFICAT,1;','','');
REPLACE INTO `item_db` VALUES ('12378','2009_Rice_Cake_Soup','Rice Cake Soup','2','10','5','100','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','percentheal 50,50;','','');
@@ -5956,7 +5956,7 @@ REPLACE INTO `item_db` VALUES ('12432','Siroma_Icetea','Siroma Icetea','2','1000
REPLACE INTO `item_db` VALUES ('12433','Drocera_Herb_Stew','Drosera Herb Stew','2','1000','500','50','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','1','0','0',NULL,'0',NULL,'0',NULL,'0','sc_start SC_DROCERA_HERB_STEAMED,300000,20;','','');
REPLACE INTO `item_db` VALUES ('12434','Petti_Tail_Noodle','Petite Tail Noodles','2','1000','500','50','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','1','0','0',NULL,'0',NULL,'0',NULL,'0','sc_start SC_PUTTI_TAILS_NOODLES,300000,20;','','');
REPLACE INTO `item_db` VALUES ('12435','Black_Thing','Black Thing','2','1000','500','50','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','sc_start SC_STOMACHACHE,60000,rand(5,10);','','');
-REPLACE INTO `item_db` VALUES ('12436','Vitata500','Vitata500','0','100','50','50','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','1','0','0',NULL,'0',NULL,'0',NULL,'0','sc_start SC_VITATA_500,500000,0; heal 0,200;','','');
+REPLACE INTO `item_db` VALUES ('12436','Vitata500','Vitata500','0','100','50','50','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','1','0','0',NULL,'0',NULL,'0',NULL,'0','sc_start2 SC_VITATA_500,500000,20,5; heal 0,200;','','');
REPLACE INTO `item_db` VALUES ('12437','Enrich_Celermine_Juice','Enrich Celermine Juice','2','100','50','50','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','1','0','0',NULL,'0',NULL,'0',NULL,'0','sc_start SC_EXTRACT_SALAMINE_JUICE,500000,10;','','');
REPLACE INTO `item_db` VALUES ('12438','F_Giant_Fly_Wing','Giant Fly Wing','2','2','1','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('12439','F_Battle_Manual','Old Battle Manual','2','2','1','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
@@ -6136,7 +6136,7 @@ REPLACE INTO `item_db` VALUES ('12620','Dgrade_Pocket','Dgrade Pocket','2','20',
REPLACE INTO `item_db` VALUES ('12621','Egrade_Pocket','Egrade Pocket','2','20','10','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','packageitem();','','');
REPLACE INTO `item_db` VALUES ('12622','Boarding_Halter','Halter Lead','11','20','10','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','3000','507',NULL,'0',NULL,'0',NULL,'0','setcashmount();','','');
REPLACE INTO `item_db` VALUES ('12623','High_Weapon_Box','High Weapon Box','2','20','10','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','getrandgroupitem 12623,1;','','');
-REPLACE INTO `item_db` VALUES ('12624','Delicious_Jelly','Delicious Jelly','0','0','0','50','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','464',NULL,'0',NULL,'0',NULL,'0','percentheal 3,3;','','');
+REPLACE INTO `item_db` VALUES ('12624','Delicious_Jelly','Delicious Jelly','0','0','0','50','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','percentheal 3,3;','','');
REPLACE INTO `item_db` VALUES ('12625','Sapa_Feat_Cert_Pack','Proof Of Sapha\'s Honor Package','2','0','0','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('12626','Wander_Man_Scroll','Wanderman Scroll','11','20','10','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('12627','Wicked_Nymph_Scroll','Wicked Nymph Scroll','11','20','10','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
@@ -6186,8 +6186,8 @@ REPLACE INTO `item_db` VALUES ('12673','Lucky_Egg_C10','Lucky Egg C10','2','20',
REPLACE INTO `item_db` VALUES ('12674','God_Material_Box','God Material Box','2','20','10','500','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('12675','Sg_Weapon_Supply_Box','Siege Weapon Supply Box','2','20','10','500','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','getrandgroupitem 12675,1;','','');
REPLACE INTO `item_db` VALUES ('12676','Sg_Violet_Potion_Box','Siege Violet Potion Box','2','20','10','200','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','getitem 11547,50;','','');
-REPLACE INTO `item_db` VALUES ('12677','Siege_Arrow_Quiver_S','Siege Arrow Quiver S','2','2','1','100','0','0','0','0','0','4294967295','63','2','0','0','130',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','getitem 1776,200;','','');
-REPLACE INTO `item_db` VALUES ('12678','Siege_Arrow_Quiver_A','Siege Arrow Quiver A','2','2','1','100','0','0','0','0','0','4294967295','63','2','0','0','95',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','getitem 1775,200;','','');
+REPLACE INTO `item_db` VALUES ('12677','Siege_Arrow_Quiver_S','Siege Arrow Quiver S','2','2','1','100','0','0','0','0','0','4294967295','63','2','0','0','130',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','getitem Siege_Arrow_S,200;','','');
+REPLACE INTO `item_db` VALUES ('12678','Siege_Arrow_Quiver_A','Siege Arrow Quiver A','2','2','1','100','0','0','0','0','0','4294967295','63','2','0','0','95',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','getitem Siege_Arrow_A,200;','','');
REPLACE INTO `item_db` VALUES ('12679','Sg_White_Potion_Box','Siege White Potion Box','2','20','10','200','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','getitem 11548,30;','','');
REPLACE INTO `item_db` VALUES ('12680','Sg_Blue_Potion_Box','Siege Blue Potion Box','2','20','10','200','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','getitem 11549,10;','','');
REPLACE INTO `item_db` VALUES ('12681','Nestea_Lemon','Nestea Lemon','2','0','0','50','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
@@ -6314,9 +6314,9 @@ REPLACE INTO `item_db` VALUES ('12814','Slapping_Herb','Sadagui','11','0','0','1
REPLACE INTO `item_db` VALUES ('12815','Yggdrasil_Dust','Sequoia Dust','11','0','0','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','itemskill ECL_SEQUOIADUST,1;','','');
REPLACE INTO `item_db` VALUES ('12818','High_Weapon_Box_','Advanced Weapons Box','2','0','0','0','0','0','0','0','0','4294967295','63','2','0','0','100',NULL,'0','0','0','0','0','0','507',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('12831','Potion_Box','Potion Box','2','0','0','50','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','getitem 545,100; getitem 546,100; getitem 547,100; getitem 505,100;','','');
-REPLACE INTO `item_db` VALUES ('12845','Amatsu_Butterfly_Wing','Amatsu Butterfly Wing','3','0','0','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
+REPLACE INTO `item_db` VALUES ('12845','Amatsu_Butterfly_Wing','Amatsu Butterfly Wing','3','0','0','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','499',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('12846','Little_Unripe_Apple','Little Unripe Apple','2','10','5','50','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'1',NULL,'0',NULL,'0','pet 2398;','','');
-REPLACE INTO `item_db` VALUES ('12847','Old_Equipment_Box','Old Equipment Box','0','0','0','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','','','');
+REPLACE INTO `item_db` VALUES ('12847','Old_Equipment_Box','Old Equipment Box','0','0','0','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','507',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('12848','Falcon_Flute','Falcon Flute','11','0','0','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','if(getskilllv(HT_FALCON)) { if(checkoption(Option_Wug)||checkoption(Option_Wugrider)) end; if(checkfalcon()==1) { setfalcon 0; } else { setfalcon 1; } }','','');
REPLACE INTO `item_db` VALUES ('12849','Combination_Kit','Union Kit','2','0','0','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('12850','Heaven_Scroll','Heaven Scroll','11','20','10','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
@@ -6472,7 +6472,7 @@ REPLACE INTO `item_db` VALUES ('13045','Kamaitachi_I','Kamaitachi','4','0','0','
REPLACE INTO `item_db` VALUES ('13046','Krieg','Krieg','4','20','10','500','110','0','0','1','3','135232','58','2','2','2','50',NULL,'1','1','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus3 bAddEffOnSkill,RG_BACKSTAP,Eff_Bleeding,1000; bonus2 bSkillAtk,RG_BACKSTAP,15;','','');
REPLACE INTO `item_db` VALUES ('13047','Weihna','Weihna','4','20','10','500','135','0','0','1','2','135232','58','2','2','3','50',NULL,'1','1','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus3 bAddEffOnSkill,RG_RAID,Eff_Poison,1000; autobonus \"{ bonus2 bAddRace,RC_NonBoss,10; bonus2 bAddRace,RC_Boss,10; }\",5,5000,BF_WEAPON|BF_SHORT,\"{ specialeffect2 EF_POTION_BERSERK; }\";','','');
REPLACE INTO `item_db` VALUES ('13048','Damascus_C','Damascus','4','0','0','0','153','0','0','1','0','579821294','63','2','2','3','0',NULL,'0','1','0','0','0','0','507',NULL,'0',NULL,'0',NULL,'0','bonus2 bAddSize,Size_Small,40; bonus2 bAddSize,Size_Medium,40; bonus2 bAddSize,Size_Large,40;','','');
-REPLACE INTO `item_db` VALUES ('13049','Lacma','Lacma','4','20','10','650','45','0','0','1','1','579821295','63','2','2','3','0',NULL,'1','1','0','0','0','0','449',NULL,'0',NULL,'0',NULL,'0','if(getrefine()>=3) { bonus bAtk,40; bonus bMatk,40; } if(getrefine()>=6) { bonus2 bAddSize,Size_Medium,8; autobonus \"{ bonus bNoSizeFix,0; }\",10,5000,0,\"{ specialeffect2 EF_ENHANCE; }\"; } if(getrefine()>=9) bonus2 bAddSize,Size_Medium,20; if(getrefine()>=12) bonus bNoSizeFix,0;','','');
+REPLACE INTO `item_db` VALUES ('13049','Lacma','Lacma','4','20','10','650','45','0','0','1','1','579821295','63','2','2','3','0',NULL,'1','1','0','0','0','0','1',NULL,'0',NULL,'0',NULL,'0','if(getrefine()>=3) { bonus bAtk,40; bonus bMatk,40; } if(getrefine()>=6) { bonus2 bAddSize,Size_Medium,8; autobonus \"{ bonus bNoSizeFix,0; }\",10,5000,0,\"{ specialeffect2 EF_ENHANCE; }\"; } if(getrefine()>=9) bonus2 bAddSize,Size_Medium,20; if(getrefine()>=12) bonus bNoSizeFix,0;','','');
REPLACE INTO `item_db` VALUES ('13050','P_Dagger1','Eden Dagger I','4','0','0','0','124','60','0','1','0','579821295','63','2','2','2','26',NULL,'0','1','0','0','0','0','499',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('13051','P_Dagger2','Eden Dagger II','4','0','0','0','158','70','0','1','0','579821295','63','2','2','2','40',NULL,'0','1','0','0','0','0','499',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('13052','Tourist_Dagger','Traveler\'s Dagger','4','0','0','500','51','0','0','1','0','579821295','63','2','2','1','0',NULL,'0','1','0','0','0','0','499',NULL,'0',NULL,'0',NULL,'0','bonus bUnbreakableWeapon,0; bonus bAgi,2;','','');
@@ -7834,17 +7834,17 @@ REPLACE INTO `item_db` VALUES ('16412','Ice_Wing_Ear_Box','Ice Wing Ear Box','18
REPLACE INTO `item_db` VALUES ('16413','FIce_Wing_Ear_Box','FIce Wing Ear Box','18','20','10','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','getitem 5610,1;','','');
REPLACE INTO `item_db` VALUES ('16414','Turtle_Hat_Box','Turtle Hat Box','18','20','10','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','getitem 5611,1;','','');
REPLACE INTO `item_db` VALUES ('16415','FTurtle_Hat_Box','Turtle Hat Box','18','20','10','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','getitem 5611,1;','','');
-REPLACE INTO `item_db` VALUES ('16418','Giant_Fly_Wing_Box_500','Giant Fly Wing Box 500','18','20','10','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','getitem 12212,500;','','');
-REPLACE INTO `item_db` VALUES ('16419','Greed_Scroll_Box_30','Greed Scroll 30 Box','18','20','10','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','getitem 14529,30;','','');
-REPLACE INTO `item_db` VALUES ('16420','Adventurer_Pack','Adventurer Pack','18','20','10','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','getitem 12208,10; getitem 12210,10; getitem 12216,20; getitem 12215,20; getitem 7621,10; getitem 12209,10; getitem 12211,5; getitem 12450,10; getitem 12448,10; getitem 12446,10; getitem 12206,10; getitem 12445,10; getitem 12447,10;','','');
-REPLACE INTO `item_db` VALUES ('16424','Executioner_Box_','Executioner Box','18','20','10','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','rentitem 1174,604800;','','');
-REPLACE INTO `item_db` VALUES ('16425','Cutlus_Box','Cutlus Box','18','20','10','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','rentitem 13402,604800;','','');
-REPLACE INTO `item_db` VALUES ('16426','Moonlight_Dagger_Box','Moonlight Dagger Box','18','20','10','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','rentitem 13026,604800;','','');
-REPLACE INTO `item_db` VALUES ('16427','Wrench_Box','Wrench Box','18','20','10','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','rentitem 1534,604800;','','');
-REPLACE INTO `item_db` VALUES ('16428','Solar_Sword_Box_','Solar Sword Box','18','20','10','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','rentitem 13403,604800;','','');
-REPLACE INTO `item_db` VALUES ('16429','Tomahawk_Box_','Tomahawk Box','18','20','10','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','rentitem 1374,604800;','','');
-REPLACE INTO `item_db` VALUES ('16430','Rudra_Bow_Box','Rudra Bow Box','18','20','10','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','rentitem 1729,604800;','','');
-REPLACE INTO `item_db` VALUES ('16431','Pole_Axe_Box_','Pole Axe Box','18','20','10','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','rentitem 1419,604800;','','');
+REPLACE INTO `item_db` VALUES ('16418','Giant_Fly_Wing_Box_500','Giant Fly Wing Box 500','18','20','10','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','getitem 12212,500;','','');
+REPLACE INTO `item_db` VALUES ('16419','Greed_Scroll_Box_30','Greed Scroll 30 Box','18','20','10','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','getitem 14529,30;','','');
+REPLACE INTO `item_db` VALUES ('16420','Adventurer_Pack','Adventurer Pack','18','20','10','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','getitem 12208,10; getitem 12210,10; getitem 12216,20; getitem 12215,20; getitem 7621,10; getitem 12209,10; getitem 12211,5; getitem 12450,10; getitem 12448,10; getitem 12446,10; getitem 12206,10; getitem 12445,10; getitem 12447,10;','','');
+REPLACE INTO `item_db` VALUES ('16424','Executioner_Box_','Executioner Box','18','20','10','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','rentitem 1174,604800;','','');
+REPLACE INTO `item_db` VALUES ('16425','Cutlus_Box','Cutlus Box','18','20','10','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','rentitem 13402,604800;','','');
+REPLACE INTO `item_db` VALUES ('16426','Moonlight_Dagger_Box','Moonlight Dagger Box','18','20','10','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','rentitem 13026,604800;','','');
+REPLACE INTO `item_db` VALUES ('16427','Wrench_Box','Wrench Box','18','20','10','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','rentitem 1534,604800;','','');
+REPLACE INTO `item_db` VALUES ('16428','Solar_Sword_Box_','Solar Sword Box','18','20','10','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','rentitem 13403,604800;','','');
+REPLACE INTO `item_db` VALUES ('16429','Tomahawk_Box_','Tomahawk Box','18','20','10','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','rentitem 1374,604800;','','');
+REPLACE INTO `item_db` VALUES ('16430','Rudra_Bow_Box','Rudra Bow Box','18','20','10','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','rentitem 1729,604800;','','');
+REPLACE INTO `item_db` VALUES ('16431','Pole_Axe_Box_','Pole Axe Box','18','20','10','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','rentitem 1419,604800;','','');
REPLACE INTO `item_db` VALUES ('16436','Libra_Crown_Box','Libra Crown Box','18','20','10','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','getitem 5662,1;','','');
REPLACE INTO `item_db` VALUES ('16438','Libra_Diadem_Box','Libra Diadem Box','18','20','10','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','getitem 5663,1;','','');
REPLACE INTO `item_db` VALUES ('16440','Filir_Wing_Box','Filir Wings Box','18','20','10','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','getitem 5664,1;','','');
@@ -8454,9 +8454,9 @@ REPLACE INTO `item_db` VALUES ('18824','Mask_Of_Bankrupt','Mask Of Bankrupt','5'
REPLACE INTO `item_db` VALUES ('18825','Bankruptcy_Of_Heart_','Bankruptcy Of Heart','5','20','10','1200','0','0','8','0','1','4294967295','63','2','256','0','38',NULL,'1','107','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bInt,1; bonus bDex,1;','','');
REPLACE INTO `item_db` VALUES ('18826','Chun_Tree_Hat','Chun Tree Hat','5','20','10','300','0','0','0','0','1','4294967295','63','2','256','0','0',NULL,'1','939','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bInt,2; bonus bVit,2;','','');
REPLACE INTO `item_db` VALUES ('18827','Valkyrie_Circlet','Valkyrie Circlet','5','20','10','300','0','0','10','0','1','4294967295','63','2','256','0','50',NULL,'1','940','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bStr,1; bonus2 bAddEle,Ele_Dark,10; bonus2 bAddRace,RC_Demon,10;','','');
-REPLACE INTO `item_db` VALUES ('18828','2012RMSCNO1','RMSC2012 Champion Headgear','5','0','0','1000','0','0','20','0','1','4294967295','63','2','256','0','95',NULL,'0','942','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','bonus bUnbreakableHelm,0; bonus bAllStats,5; bonus bMdef,5;','','');
-REPLACE INTO `item_db` VALUES ('18829','2012RMSCNO2','RMSC2012 1st Runner Headgear','5','0','0','1000','0','0','20','0','1','4294967295','63','2','256','0','95',NULL,'0','943','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','bonus bUnbreakableHelm,0; bonus bAllStats,4; bonus bMdef,5;','','');
-REPLACE INTO `item_db` VALUES ('18830','2012RMSCNO3','RMSC2012 2nd Runner Headgear','5','0','0','1000','0','0','20','0','1','4294967295','63','2','256','0','95',NULL,'0','944','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','bonus bUnbreakableHelm,0; bonus bAllStats,3; bonus bMdef,5;','','');
+REPLACE INTO `item_db` VALUES ('18828','2012RMSCNO1','RMSC2012 Champion Headgear','5','0','0','1000','0','0','20','0','1','4294967295','63','2','256','0','95',NULL,'0','942','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','bonus bUnbreakableHelm,0; bonus bAllStats,5; bonus bMdef,5; skill AL_TELEPORT,1;','','');
+REPLACE INTO `item_db` VALUES ('18829','2012RMSCNO2','RMSC2012 1st Runner Headgear','5','0','0','1000','0','0','20','0','1','4294967295','63','2','256','0','95',NULL,'0','943','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','bonus bUnbreakableHelm,0; bonus bAllStats,4; bonus bMdef,5; skill AL_TELEPORT,1;','','');
+REPLACE INTO `item_db` VALUES ('18830','2012RMSCNO3','RMSC2012 2nd Runner Headgear','5','0','0','1000','0','0','20','0','1','4294967295','63','2','256','0','95',NULL,'0','944','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','bonus bUnbreakableHelm,0; bonus bAllStats,3; bonus bMdef,5; skill AL_TELEPORT,1;','','');
REPLACE INTO `item_db` VALUES ('18831','2012RMSCNO4','RMSC2012 Special Headgear','5','0','0','1000','0','0','20','0','1','4294967295','63','2','256','0','95',NULL,'0','945','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bUnbreakableHelm,0; bonus bAllStats,2; bonus bMdef,5;','','');
REPLACE INTO `item_db` VALUES ('18832','Rolf_Von_Gigue_666','Rolf Von Gigue 666','5','20','10','300','0','0','0','0','0','4294967295','63','2','256','0','0',NULL,'1','946','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('18833','Marin_Crown','Marin Crown','5','0','0','10','0','0','3','0','1','4294967295','63','2','256','0','0',NULL,'1','948','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bAllStats,1; bonus bMdef,2; bonus3 bAutoSpellWhenHit,MG_FROSTDIVER,3,10; bonus3 bAutoSpell,MG_COLDBOLT,5,10;','','');
@@ -8911,13 +8911,13 @@ REPLACE INTO `item_db` VALUES ('19869','C_Antiquity_Helmet','Costume Antiquity H
REPLACE INTO `item_db` VALUES ('19871','C_DecorationOfMusic_Accessory','Decoration of Music','5','20','10','0','0','0','0','0','0','4294967295','63','2','2048','0','0',NULL,'0','1074','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','sc_start SC_DECORATION_OF_MUSIC,-1,0;','sc_end SC_DECORATION_OF_MUSIC;');
REPLACE INTO `item_db` VALUES ('19873','C_Carnival_Hat','Costume Carnival Hat','5','0','0','0','0','0','0','0','0','4294967295','63','2','1024','0','0',NULL,'1','505','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('19874','C_Carnival_Circlet','Costume Carnival Circlet','5','0','0','0','0','0','0','0','0','4294967295','63','2','1024','0','0',NULL,'1','506','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
-REPLACE INTO `item_db` VALUES ('19875','C_Love_Rabbit_Hood','Costume Love Rabbit Hood','5','0','0','0','0','0','0','0','0','4294967295','63','2','7168','0','0',NULL,'1','549','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
+REPLACE INTO `item_db` VALUES ('19875','C_Love_Rabbit_Hood','Costume Love Rabbit Hood','5','0','0','0','0','0','0','0','0','4294967295','63','2','7168','0','0',NULL,'1','549','0','0','0','0','384',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('19876','C_Rabbit_Ear_Hat','Costume Rabbit Ear Hat','5','0','0','0','0','0','0','0','0','4294967295','63','2','1024','0','0',NULL,'1','384','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('19877','C_Eyes_Of_Darkness','Costume Eyes Of Darkness','5','0','0','0','0','0','0','0','0','4294967295','63','2','2048','0','0',NULL,'1','467','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('19878','C_Drooping_Bunny','Costume Drooping Bunny','5','0','0','0','0','0','0','0','0','4294967295','63','2','1024','0','0',NULL,'1','249','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('19879','C_Black_Bunny_Band','Costume Black Bunny Band','5','0','0','0','0','0','0','0','0','4294967295','63','2','1024','0','0',NULL,'1','267','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('19880','C_Golden_Tiara','Costume Golden Tiara','5','0','0','0','0','0','0','0','0','4294967295','63','2','1024','0','0',NULL,'1','232','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
-REPLACE INTO `item_db` VALUES ('19881','C_Pretty_Rabbit_Hood','Costume Pretty Rabbit Hood','5','0','0','0','0','0','0','0','0','4294967295','63','2','1024','0','0',NULL,'1','1085','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
+REPLACE INTO `item_db` VALUES ('19881','C_Pretty_Rabbit_Hood','Costume Pretty Rabbit Hood','5','0','0','0','0','0','0','0','0','4294967295','63','2','1024','0','0',NULL,'1','1085','0','0','0','0','384',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('19882','C_Flowerpot_Mask','Costume Flowerpot Mask','5','0','0','0','0','0','0','0','0','4294967295','63','2','6144','0','0',NULL,'1','1086','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('19883','C_Piamette_Hood','Costume Piamette Hood','5','0','0','0','0','0','0','0','0','4294967295','63','2','1024','0','0',NULL,'1','1087','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('19884','C_Vanargand_Helm','Costume Vanargand Helm','5','0','0','0','0','0','0','0','0','4294967295','63','2','1024','0','0',NULL,'1','804','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
@@ -9111,7 +9111,7 @@ REPLACE INTO `item_db` VALUES ('20095','C_Red_Ribbon','Costume Red Ribbon','5','
REPLACE INTO `item_db` VALUES ('20096','C_Blue_Ribbonn','Costume Blue Ribbonn','5','0','0','0','0','0','0','0','0','4294967295','63','2','1024','0','0',NULL,'1','441','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('20097','C_White_Ribbon','Costume White Ribbon','5','0','0','0','0','0','0','0','0','4294967295','63','2','1024','0','0',NULL,'1','442','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('20098','C_Vampire_Hairband','Costume Vampire Hairband','5','0','0','0','0','0','0','0','0','4294967295','63','2','1024','0','0',NULL,'1','1238','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
-REPLACE INTO `item_db` VALUES ('20099','C_Ljosalfar','Costume Ljosalfar','5','0','0','0','0','0','0','0','0','4294967295','63','2','1024','0','0',NULL,'1','1239','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
+REPLACE INTO `item_db` VALUES ('20099','C_Ljosalfar','Costume Ljosalfar','5','0','0','0','0','0','0','0','0','4294967295','63','2','1024','0','0',NULL,'1','1239','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','sc_start SC_LJOSALFAR,-1,0;','sc_end SC_LJOSALFAR;');
REPLACE INTO `item_db` VALUES ('20100','C_Volume_Fhat','Costume Volume Fhat','5','0','0','0','0','0','0','0','0','4294967295','63','2','1024','0','0',NULL,'1','1240','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('20101','C_Bragi_Wing_Ears','Costume Bragi Wing Ears','5','0','0','0','0','0','0','0','0','4294967295','63','2','1024','0','0',NULL,'1','1241','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('20102','C_Horse_King_J','Costume Horse King_J','5','0','0','0','0','0','0','0','0','4294967295','63','2','7168','0','0',NULL,'1','1189','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
@@ -9221,7 +9221,7 @@ REPLACE INTO `item_db` VALUES ('20205','C_Fancy_Flower','Costume Fancy Flower','
REPLACE INTO `item_db` VALUES ('20206','C_Chicken_Hat1','Costume Chicken Hat1','5','0','0','0','0','0','0','0','0','4294967295','63','2','7168','0','0',NULL,'1','1296','0','0','0','0','467',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('20207','C_Striped_Hairband','Costume Striped Hairband','5','0','0','0','0','0','0','0','0','4294967295','63','2','1024','0','0',NULL,'1','133','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('20208','C_Necktie','Costume Necktie','5','0','0','0','0','0','0','0','0','4294967295','63','2','1024','0','0',NULL,'1','443','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
-REPLACE INTO `item_db` VALUES ('20209','C_Mermaid_Bubbles','Costume Mermaid Bubbles','5','0','0','0','0','0','0','0','0','4294967295','63','2','1024','0','0',NULL,'1','1299','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
+REPLACE INTO `item_db` VALUES ('20209','C_Mermaid_Bubbles','Costume Mermaid Bubbles','5','0','0','0','0','0','0','0','0','4294967295','63','2','1024','0','0',NULL,'1','1299','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','sc_start SC_MERMAID_LONGING,-1,0;','sc_end SC_MERMAID_LONGING;');
REPLACE INTO `item_db` VALUES ('20210','C_Chicken_Hat2','Costume Chicken Hat2','5','0','0','0','0','0','0','0','0','4294967295','63','2','7168','0','0',NULL,'1','1297','0','0','0','0','467',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('20211','C_Chicken_Hat3','Costume Chicken Hat3','5','0','0','0','0','0','0','0','0','4294967295','63','2','7168','0','0',NULL,'1','1298','0','0','0','0','467',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('20212','C_Loki_&_Nidhoggur_dolls','Costume Loki & Nidhoggur dolls','5','0','0','0','0','0','0','0','0','4294967295','63','2','1024','0','0',NULL,'1','1304','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
@@ -9421,7 +9421,7 @@ REPLACE INTO `item_db` VALUES ('22670','DARK_INVITATION','Invitation of Darkness
REPLACE INTO `item_db` VALUES ('22675','Mysterious_Scroll','Mysterious Scroll','2','20','10','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','sc_start SC_FOOD_INT,3600000,30;','','');
REPLACE INTO `item_db` VALUES ('22676','Hangul_Day_Event_Box','Hangul Day Event Box','2','20','10','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','getitem 22675,10; getitem 607,9;','','');
REPLACE INTO `item_db` VALUES ('22679','Death_Bin','Death Bin','18','10','5','0','0','0','0','0','0','4294967295','63','2','0','0','170',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
-REPLACE INTO `item_db` VALUES ('22685','Solo_Christmas_Gift','Single Union Christmas Gift','2','0','0','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
+REPLACE INTO `item_db` VALUES ('22685','Solo_Christmas_Gift','Single Union Christmas Gift','2','0','0','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','467',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('22686','Solo_Cookie','Single Cookie','0','0','0','50','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','percentheal 5,5;','','');
REPLACE INTO `item_db` VALUES ('22777','Buff_Gift_Set','Buff Gift Set','2','20','10','100','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','getitem 14534,5; getitem 12215,5; getitem 12216,5;','','');
REPLACE INTO `item_db` VALUES ('22837','Integer_Time','Integer Time','2','0','0','0','0','0','0','0','0','4294967295','63','2','0','0','50',NULL,'0','0','0','0','0','0','507',NULL,'0',NULL,'0',NULL,'0','TmpRouletteBronze += 1;','','');
diff --git a/src/common/HPMDataCheck.h b/src/common/HPMDataCheck.h
index 923b6ccbf..5b9158a6d 100644
--- a/src/common/HPMDataCheck.h
+++ b/src/common/HPMDataCheck.h
@@ -492,6 +492,7 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
{ "packet_itemlist_equip", sizeof(struct packet_itemlist_equip), SERVER_TYPE_MAP },
{ "packet_itemlist_normal", sizeof(struct packet_itemlist_normal), SERVER_TYPE_MAP },
{ "packet_maptypeproperty2", sizeof(struct packet_maptypeproperty2), SERVER_TYPE_MAP },
+ { "packet_mission_info_sub", sizeof(struct packet_mission_info_sub), SERVER_TYPE_MAP },
{ "packet_monster_hp", sizeof(struct packet_monster_hp), SERVER_TYPE_MAP },
{ "packet_notify_bounditem", sizeof(struct packet_notify_bounditem), SERVER_TYPE_MAP },
{ "packet_npc_market_open", sizeof(struct packet_npc_market_open), SERVER_TYPE_MAP },
@@ -499,6 +500,8 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
{ "packet_npc_market_result_ack", sizeof(struct packet_npc_market_result_ack), SERVER_TYPE_MAP },
{ "packet_package_item_announce", sizeof(struct packet_package_item_announce), SERVER_TYPE_MAP },
{ "packet_party_leader_changed", sizeof(struct packet_party_leader_changed), SERVER_TYPE_MAP },
+ { "packet_quest_list_header", sizeof(struct packet_quest_list_header), SERVER_TYPE_MAP },
+ { "packet_quest_list_info", sizeof(struct packet_quest_list_info), SERVER_TYPE_MAP },
{ "packet_roulette_close_ack", sizeof(struct packet_roulette_close_ack), SERVER_TYPE_MAP },
{ "packet_roulette_generate_ack", sizeof(struct packet_roulette_generate_ack), SERVER_TYPE_MAP },
{ "packet_roulette_info_ack", sizeof(struct packet_roulette_info_ack), SERVER_TYPE_MAP },
@@ -586,8 +589,6 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
#ifdef MAP_SCRIPT_H
{ "Script_Config", sizeof(struct Script_Config), SERVER_TYPE_MAP },
{ "casecheck_data", sizeof(struct casecheck_data), SERVER_TYPE_MAP },
- { "hQueue", sizeof(struct hQueue), SERVER_TYPE_MAP },
- { "hQueueIterator", sizeof(struct hQueueIterator), SERVER_TYPE_MAP },
{ "reg_db", sizeof(struct reg_db), SERVER_TYPE_MAP },
{ "script_array", sizeof(struct script_array), SERVER_TYPE_MAP },
{ "script_code", sizeof(struct script_code), SERVER_TYPE_MAP },
@@ -595,6 +596,8 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
{ "script_function", sizeof(struct script_function), SERVER_TYPE_MAP },
{ "script_interface", sizeof(struct script_interface), SERVER_TYPE_MAP },
{ "script_label_entry", sizeof(struct script_label_entry), SERVER_TYPE_MAP },
+ { "script_queue", sizeof(struct script_queue), SERVER_TYPE_MAP },
+ { "script_queue_iterator", sizeof(struct script_queue_iterator), SERVER_TYPE_MAP },
{ "script_retinfo", sizeof(struct script_retinfo), SERVER_TYPE_MAP },
{ "script_stack", sizeof(struct script_stack), SERVER_TYPE_MAP },
{ "script_state", sizeof(struct script_state), SERVER_TYPE_MAP },
diff --git a/src/map/battle.c b/src/map/battle.c
index be508dae0..10990f013 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -229,10 +229,13 @@ int battle_delay_damage_sub(int tid, int64 tick, int id, intptr_t data) {
src = map->id2bl(dat->src_id);
//Check to see if you haven't teleported. [Skotlex]
- if( src
- && (target->type != BL_PC || ((TBL_PC*)target)->invincible_timer == INVALID_TIMER)
- && (dat->skill_id == MO_EXTREMITYFIST || (target->m == src->m && check_distance_bl(src, target, dat->distance)) )
- ) {
+ if (src && (
+ battle_config.fix_warp_hit_delay_abuse ?
+ (dat->skill_id == MO_EXTREMITYFIST || target->m != src->m || check_distance_bl(src, target, dat->distance))
+ :
+ ((target->type != BL_PC || ((TBL_PC*)target)->invincible_timer == INVALID_TIMER)
+ && (dat->skill_id == MO_EXTREMITYFIST || (target->m == src->m && check_distance_bl(src, target, dat->distance))))
+ )) {
map->freeblock_lock();
status_fix_damage(src, target, dat->damage, dat->delay);
if( dat->attack_type && !status->isdead(target) && dat->additional_effects )
@@ -3007,8 +3010,13 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam
#endif
if(sc->data[SC_DEFENDER] &&
+#ifdef RENEWAL
((flag&(BF_LONG|BF_WEAPON)) == (BF_LONG|BF_WEAPON) || skill_id == CR_ACIDDEMONSTRATION))
+#else
+ (flag&(BF_LONG|BF_WEAPON)) == (BF_LONG|BF_WEAPON)) // In pre-re Defender doesn't reduce damage from Acid Demonstration
+#endif
damage = damage * ( 100 - sc->data[SC_DEFENDER]->val2 ) / 100;
+
#ifndef RENEWAL
if(sc->data[SC_GS_ADJUSTMENT] &&
(flag&(BF_LONG|BF_WEAPON)) == (BF_LONG|BF_WEAPON))
@@ -7131,6 +7139,7 @@ static const struct battle_data {
{ "boss_icewall_walk_block", &battle_config.boss_icewall_walk_block, 0, 0, 255, },
{ "feature.roulette", &battle_config.feature_roulette, 1, 0, 1, },
{ "show_monster_hp_bar", &battle_config.show_monster_hp_bar, 1, 0, 1, },
+ { "fix_warp_hit_delay_abuse", &battle_config.fix_warp_hit_delay_abuse, 0, 0, 1, },
};
#ifndef STATS_OPT_OUT
/**
diff --git a/src/map/battle.h b/src/map/battle.h
index 0ebc0aeb9..eeecaaf89 100644
--- a/src/map/battle.h
+++ b/src/map/battle.h
@@ -509,6 +509,8 @@ struct Battle_Config {
int feature_roulette;
int show_monster_hp_bar; // [Frost]
+
+ int fix_warp_hit_delay_abuse;
};
/* criteria for battle_config.idletime_critera */
diff --git a/src/map/battleground.c b/src/map/battleground.c
index cc5384d21..208b4b99f 100644
--- a/src/map/battleground.c
+++ b/src/map/battleground.c
@@ -471,24 +471,34 @@ struct bg_arena *bg_name2arena (char *name) {
}
return NULL;
}
-int bg_id2pos ( int queue_id, int account_id ) {
- struct hQueue *queue = script->queue(queue_id);
- if( queue ) {
- int i, pos = 1;
- for(i = 0; i < queue->size; i++ ) {
- if( queue->item[i] > 0 ) {
- if( queue->item[i] == account_id ) {
- return pos;
- }
- pos++;
- }
+
+/**
+ * Returns a character's position in a battleground's queue.
+ *
+ * @param queue_id The ID of the battleground's queue.
+ * @param account_id The character's account ID.
+ *
+ * @return the position (starting at 1).
+ * @retval 0 if the queue doesn't exist or the given account ID isn't present in it.
+ */
+int bg_id2pos(int queue_id, int account_id)
+{
+ struct script_queue *queue = script->queue(queue_id);
+ if (queue) {
+ int i;
+ ARR_FIND(0, VECTOR_LENGTH(queue->entries), i, VECTOR_INDEX(queue->entries, i) == account_id);
+ if (i != VECTOR_LENGTH(queue->entries)) {
+ return i+1;
}
}
return 0;
}
-void bg_queue_ready_ack (struct bg_arena *arena, struct map_session_data *sd, bool response) {
+
+void bg_queue_ready_ack(struct bg_arena *arena, struct map_session_data *sd, bool response)
+{
nullpo_retv(arena);
nullpo_retv(sd);
+
if( arena->begin_timer == INVALID_TIMER || !sd->bg_queue.arena || sd->bg_queue.arena != arena ) {
bg->queue_pc_cleanup(sd);
return;
@@ -496,18 +506,18 @@ void bg_queue_ready_ack (struct bg_arena *arena, struct map_session_data *sd, bo
if( !response )
bg->queue_pc_cleanup(sd);
else {
- struct hQueue *queue = &script->hq[arena->queue_id];
+ struct script_queue *queue = script->queue(arena->queue_id);
int i, count = 0;
sd->bg_queue.ready = 1;
- for( i = 0; i < queue->size; i++ ) {
- if (queue->item[i] > 0 && (sd = map->id2sd(queue->item[i])) != NULL) {
- if( sd->bg_queue.ready == 1 )
- count++;
- }
+ for (i = 0; i < VECTOR_LENGTH(queue->entries); i++) {
+ struct map_session_data *tsd = map->id2sd(VECTOR_INDEX(queue->entries, i));
+
+ if (tsd != NULL && tsd->bg_queue.ready == 1)
+ count++;
}
/* check if all are ready then cancel timer, and start game */
- if( count == queue->items ) {
+ if (count == VECTOR_LENGTH(queue->entries)) {
timer->delete(arena->begin_timer,bg->begin_timer);
arena->begin_timer = INVALID_TIMER;
bg->begin(arena);
@@ -531,7 +541,7 @@ void bg_queue_player_cleanup(struct map_session_data *sd) {
sd->bg_queue.type = 0;
}
void bg_match_over(struct bg_arena *arena, bool canceled) {
- struct hQueue *queue = &script->hq[arena->queue_id];
+ struct script_queue *queue = script->queue(arena->queue_id);
int i;
nullpo_retv(arena);
@@ -539,19 +549,20 @@ void bg_match_over(struct bg_arena *arena, bool canceled) {
return;
arena->ongoing = false;
- for( i = 0; i < queue->size; i++ ) {
- struct map_session_data * sd = NULL;
+ for (i = 0; i < VECTOR_LENGTH(queue->entries); i++) {
+ struct map_session_data *sd = map->id2sd(VECTOR_INDEX(queue->entries, i));
- if (queue->item[i] > 0 && (sd = map->id2sd(queue->item[i])) != NULL) {
- if( sd->bg_queue.arena ) {
- bg->team_leave(sd, 0);
- bg->queue_pc_cleanup(sd);
- }
- if (canceled)
- clif->messagecolor_self(sd->fd, COLOR_RED, "BG Match Canceled: not enough players");
- else
- pc_setglobalreg(sd, script->add_str(arena->delay_var), (unsigned int)time(NULL));
+ if (sd == NULL)
+ continue;
+
+ if (sd->bg_queue.arena) {
+ bg->team_leave(sd, 0);
+ bg->queue_pc_cleanup(sd);
}
+ if (canceled)
+ clif->messagecolor_self(sd->fd, COLOR_RED, "BG Match Canceled: not enough players");
+ else
+ pc_setglobalreg(sd, script->add_str(arena->delay_var), (unsigned int)time(NULL));
}
arena->begin_timer = INVALID_TIMER;
@@ -560,19 +571,20 @@ void bg_match_over(struct bg_arena *arena, bool canceled) {
script->queue_clear(arena->queue_id);
}
void bg_begin(struct bg_arena *arena) {
- struct hQueue *queue = &script->hq[arena->queue_id];
+ struct script_queue *queue = script->queue(arena->queue_id);
int i, count = 0;
nullpo_retv(arena);
- for( i = 0; i < queue->size; i++ ) {
- struct map_session_data * sd = NULL;
+ for (i = 0; i < VECTOR_LENGTH(queue->entries); i++) {
+ struct map_session_data *sd = map->id2sd(VECTOR_INDEX(queue->entries, i));
- if (queue->item[i] > 0 && (sd = map->id2sd(queue->item[i])) != NULL) {
- if( sd->bg_queue.ready == 1 )
- count++;
- else
- bg->queue_pc_cleanup(sd);
- }
+ if (sd == NULL)
+ continue;
+
+ if (sd->bg_queue.ready == 1)
+ count++;
+ else
+ bg->queue_pc_cleanup(sd);
}
/* TODO/FIXME? I *think* it should check what kind of queue the player used, then check if his party/guild
* (his team) still meet the join criteria (sort of what bg->can_queue does)
@@ -591,25 +603,24 @@ void bg_begin(struct bg_arena *arena) {
mapreg->setregstr(script->add_str("$@bg_delay_var$"),bg->gdelay_var);
count = 0;
- for( i = 0; i < queue->size; i++ ) {
- struct map_session_data * sd = NULL;
-
- if (queue->item[i] > 0 && (sd = map->id2sd(queue->item[i])) != NULL) {
- if( sd->bg_queue.ready == 1 ) {
- mapreg->setreg(reference_uid(script->add_str("$@bg_member"), count), sd->status.account_id);
- mapreg->setreg(reference_uid(script->add_str("$@bg_member_group"), count),
- sd->bg_queue.type == BGQT_GUILD ? sd->status.guild_id :
- sd->bg_queue.type == BGQT_PARTY ? sd->status.party_id :
- 0
- );
- mapreg->setreg(reference_uid(script->add_str("$@bg_member_type"), count),
- sd->bg_queue.type == BGQT_GUILD ? 1 :
- sd->bg_queue.type == BGQT_PARTY ? 2 :
- 0
- );
- count++;
- }
- }
+ for (i = 0; i < VECTOR_LENGTH(queue->entries); i++) {
+ struct map_session_data *sd = map->id2sd(VECTOR_INDEX(queue->entries, i));
+
+ if (sd == NULL || sd->bg_queue.ready != 1)
+ continue;
+
+ mapreg->setreg(reference_uid(script->add_str("$@bg_member"), count), sd->status.account_id);
+ mapreg->setreg(reference_uid(script->add_str("$@bg_member_group"), count),
+ sd->bg_queue.type == BGQT_GUILD ? sd->status.guild_id :
+ sd->bg_queue.type == BGQT_PARTY ? sd->status.party_id :
+ 0
+ );
+ mapreg->setreg(reference_uid(script->add_str("$@bg_member_type"), count),
+ sd->bg_queue.type == BGQT_GUILD ? 1 :
+ sd->bg_queue.type == BGQT_PARTY ? 2 :
+ 0
+ );
+ count++;
}
mapreg->setreg(script->add_str("$@bg_member_size"),count);
@@ -645,15 +656,15 @@ int bg_afk_timer(int tid, int64 tick, int id, intptr_t data) {
}
void bg_queue_pregame(struct bg_arena *arena) {
- struct hQueue *queue;
+ struct script_queue *queue;
int i;
-
nullpo_retv(arena);
- queue = &script->hq[arena->queue_id];
- for( i = 0; i < queue->size; i++ ) {
- struct map_session_data * sd = NULL;
- if (queue->item[i] > 0 && (sd = map->id2sd(queue->item[i])) != NULL) {
+ queue = script->queue(arena->queue_id);
+ for (i = 0; i < VECTOR_LENGTH(queue->entries); i++) {
+ struct map_session_data *sd = map->id2sd(VECTOR_INDEX(queue->entries, i));
+
+ if (sd != NULL) {
clif->bgqueue_battlebegins(sd,arena->id,SELF);
}
}
@@ -667,9 +678,11 @@ int bg_fillup_timer(int tid, int64 tick, int id, intptr_t data) {
void bg_queue_check(struct bg_arena *arena) {
int count;
-
+ struct script_queue *queue;
nullpo_retv(arena);
- count = script->hq[arena->queue_id].items;
+
+ queue = script->queue(arena->queue_id);
+ count = VECTOR_LENGTH(queue->entries);
if( count == arena->max_players ) {
if( arena->fillup_timer != INVALID_TIMER ) {
timer->delete(arena->fillup_timer,bg->fillup_timer);
@@ -682,7 +695,7 @@ void bg_queue_check(struct bg_arena *arena) {
}
void bg_queue_add(struct map_session_data *sd, struct bg_arena *arena, enum bg_queue_types type) {
enum BATTLEGROUNDS_QUEUE_ACK result = bg->can_queue(sd,arena,type);
- struct hQueue *queue;
+ struct script_queue *queue = NULL;
int i, count = 0;
nullpo_retv(sd);
@@ -718,7 +731,7 @@ void bg_queue_add(struct map_session_data *sd, struct bg_arena *arena, enum bg_q
break;
}
- if( !(queue = script->queue(arena->queue_id)) || (queue->items+count) > arena->max_players ) {
+ if( !(queue = script->queue(arena->queue_id)) || (VECTOR_LENGTH(queue->entries)+count) > arena->max_players ) {
clif->bgqueue_ack(sd,BGQA_FAIL_PPL_OVERAMOUNT,arena->id);
return;
}
@@ -729,8 +742,8 @@ void bg_queue_add(struct map_session_data *sd, struct bg_arena *arena, enum bg_q
sd->bg_queue.arena = arena;
sd->bg_queue.ready = 0;
script->queue_add(arena->queue_id,sd->status.account_id);
- clif->bgqueue_joined(sd,script->hq[arena->queue_id].items);
- clif->bgqueue_update_info(sd,arena->id,script->hq[arena->queue_id].items);
+ clif->bgqueue_joined(sd, VECTOR_LENGTH(queue->entries));
+ clif->bgqueue_update_info(sd,arena->id, VECTOR_LENGTH(queue->entries));
break;
case BGQT_PARTY: {
struct party_data *p = party->search(sd->status.party_id);
@@ -740,8 +753,8 @@ void bg_queue_add(struct map_session_data *sd, struct bg_arena *arena, enum bg_q
p->data[i].sd->bg_queue.arena = arena;
p->data[i].sd->bg_queue.ready = 0;
script->queue_add(arena->queue_id,p->data[i].sd->status.account_id);
- clif->bgqueue_joined(p->data[i].sd,script->hq[arena->queue_id].items);
- clif->bgqueue_update_info(p->data[i].sd,arena->id,script->hq[arena->queue_id].items);
+ clif->bgqueue_joined(p->data[i].sd, VECTOR_LENGTH(queue->entries));
+ clif->bgqueue_update_info(p->data[i].sd,arena->id, VECTOR_LENGTH(queue->entries));
}
}
break;
@@ -753,8 +766,8 @@ void bg_queue_add(struct map_session_data *sd, struct bg_arena *arena, enum bg_q
sd->guild->member[i].sd->bg_queue.arena = arena;
sd->guild->member[i].sd->bg_queue.ready = 0;
script->queue_add(arena->queue_id,sd->guild->member[i].sd->status.account_id);
- clif->bgqueue_joined(sd->guild->member[i].sd,script->hq[arena->queue_id].items);
- clif->bgqueue_update_info(sd->guild->member[i].sd,arena->id,script->hq[arena->queue_id].items);
+ clif->bgqueue_joined(sd->guild->member[i].sd, VECTOR_LENGTH(queue->entries));
+ clif->bgqueue_update_info(sd->guild->member[i].sd,arena->id, VECTOR_LENGTH(queue->entries));
}
break;
}
diff --git a/src/map/clif.c b/src/map/clif.c
index d499cf67f..621f0b44a 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -610,12 +610,12 @@ bool clif_send(const void* buf, int len, struct block_list* bl, enum send_target
case BG_QUEUE:
if( sd && sd->bg_queue.arena ) {
- struct hQueue *queue = &script->hq[sd->bg_queue.arena->queue_id];
+ struct script_queue *queue = script->queue(sd->bg_queue.arena->queue_id);
- for( i = 0; i < queue->size; i++ ) {
- struct map_session_data *qsd = NULL;
+ for (i = 0; i < VECTOR_LENGTH(queue->entries); i++) {
+ struct map_session_data *qsd = map->id2sd(VECTOR_INDEX(queue->entries, i));
- if (queue->item[i] > 0 && (qsd = map->id2sd(queue->item[i])) != NULL) {
+ if (qsd != NULL) {
WFIFOHEAD(qsd->fd,len);
memcpy(WFIFOP(qsd->fd,0), buf, len);
WFIFOSET(qsd->fd,len);
@@ -15480,41 +15480,56 @@ void clif_parse_PartyTick(int fd, struct map_session_data* sd)
/// Sends list of all quest states (ZC_ALL_QUEST_LIST).
/// 02b1 <packet len>.W <num>.L { <quest id>.L <active>.B }*num
+/// 097a <packet len>.W <num>.L { <quest id>.L <active>.B <remaining time>.L <time>.L <count>.W { <mob_id>.L <killed>.W <total>.W <mob name>.24B }*count }*num
void clif_quest_send_list(struct map_session_data *sd)
{
- int fd = sd->fd;
- int i;
-#if PACKETVER >= 20141022
- int info_len = 15;
- int len;
+ int i, len, real_len;
+ uint8 *buf = NULL;
+ struct packet_quest_list_header *packet = NULL;
nullpo_retv(sd);
- len = sd->avail_quests*info_len+8;
- WFIFOHEAD(fd,len);
- WFIFOW(fd, 0) = 0x97a;
-#else
- int info_len = 5;
- int len;
- nullpo_retv(sd);
- len = sd->avail_quests*info_len+8;
- WFIFOHEAD(fd,len);
- WFIFOW(fd, 0) = 0x2b1;
-#endif
- WFIFOW(fd, 2) = len;
- WFIFOL(fd, 4) = sd->avail_quests;
+
+ len = sizeof(struct packet_quest_list_header)
+ + sd->avail_quests * (sizeof(struct packet_quest_list_info)
+ + MAX_QUEST_OBJECTIVES * sizeof(struct packet_mission_info_sub)); // >= than the actual length
+ buf = aMalloc(len);
+ packet = (struct packet_quest_list_header *)WBUFP(buf, 0);
+ real_len = sizeof(*packet);
+
+ packet->PacketType = questListType;
+ packet->questCount = sd->avail_quests;
for (i = 0; i < sd->avail_quests; i++) {
- #if PACKETVER >= 20141022
+ struct packet_quest_list_info *info = (struct packet_quest_list_info *)(buf+real_len);
+#if PACKETVER >= 20141022
struct quest_db *qi = quest->db(sd->quest_log[i].quest_id);
- #endif
- WFIFOL(fd, i*info_len+8) = sd->quest_log[i].quest_id;
- WFIFOB(fd, i*info_len+12) = sd->quest_log[i].state;
- #if PACKETVER >= 20141022
- WFIFOL(fd, i*info_len+13) = sd->quest_log[i].time - qi->time;
- WFIFOL(fd, i*info_len+17) = sd->quest_log[i].time;
- WFIFOW(fd, i*info_len+21) = qi->objectives_count;
- #endif
+ int j;
+#endif // PACKETVER >= 20141022
+ real_len += sizeof(*info);
+
+ info->questID = sd->quest_log[i].quest_id;
+ info->active = sd->quest_log[i].state;
+#if PACKETVER >= 20141022
+ info->quest_svrTime = sd->quest_log[i].time - qi->time;
+ info->quest_endTime = sd->quest_log[i].time;
+ info->hunting_count = qi->objectives_count;
+
+ for (j = 0; j < qi->objectives_count; j++) {
+ struct mob_db *mob_data;
+ Assert_retb(j < MAX_QUEST_OBJECTIVES);
+ real_len += sizeof(info->objectives[j]);
+
+ mob_data = mob->db(qi->objectives[j].mob);
+
+ info->objectives[j].mob_id = qi->objectives[j].mob;
+ info->objectives[j].huntCount = sd->quest_log[i].count[j];
+ info->objectives[j].maxCount = qi->objectives[j].count;
+ safestrncpy(info->objectives[j].mobName, mob_data->jname, sizeof(info->objectives[j].mobName));
+ }
+#endif // PACKETVER >= 20141022
}
- WFIFOSET(fd, len);
+ packet->PacketLength = real_len;
+ clif->send(buf, real_len, &sd->bl, SELF);
+ aFree(buf);
}
/// Sends list of all quest missions (ZC_ALL_QUEST_MISSION).
diff --git a/src/map/instance.c b/src/map/instance.c
index 545ffe1e7..45e407dfc 100644
--- a/src/map/instance.c
+++ b/src/map/instance.c
@@ -94,9 +94,9 @@ int instance_create(int owner_id, const char *name, enum instance_owner_type typ
}
if( type != IOT_NONE && *icptr ) {
- ARR_FIND(0, *icptr, i, strcmp(instance->list[iptr[i]].name,name) == 0 );
+ ARR_FIND(0, *icptr, i, iptr[i] != -1 && strcmp(instance->list[iptr[i]].name, name) == 0 );
if( i != *icptr )
- return -4;/* already got this instance */
+ return -4; /* already got this instance */
}
ARR_FIND(0, instance->instances, i, instance->list[i].state == INSTANCE_FREE);
diff --git a/src/map/map.c b/src/map/map.c
index cd2ba17c2..fff1593a4 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -1802,16 +1802,16 @@ int map_quit(struct map_session_data *sd) {
skill->cooldown_save(sd);
pc->itemcd_do(sd,false);
- for( i = 0; i < sd->queues_count; i++ ) {
- struct hQueue *queue;
- if( (queue = script->queue(sd->queues[i])) && queue->onLogOut[0] != '\0' ) {
- npc->event(sd, queue->onLogOut, 0);
+ for (i = 0; i < VECTOR_LENGTH(sd->script_queues); i++) {
+ struct script_queue *queue = script->queue(VECTOR_INDEX(sd->script_queues, i));
+ if (queue && queue->event_logout[0] != '\0') {
+ npc->event(sd, queue->event_logout, 0);
}
}
/* two times, the npc event above may assign a new one or delete others */
- for( i = 0; i < sd->queues_count; i++ ) {
- if( sd->queues[i] != -1 )
- script->queue_remove(sd->queues[i],sd->status.account_id);
+ while (VECTOR_LENGTH(sd->script_queues)) {
+ int qid = VECTOR_LAST(sd->script_queues);
+ script->queue_remove(qid, sd->status.account_id);
}
npc->script_event(sd, NPCE_LOGOUT);
diff --git a/src/map/mob.c b/src/map/mob.c
index 2b519462d..6cbbd3a2a 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -142,17 +142,11 @@ void mvptomb_create(struct mob_data *md, char *killer, time_t time)
if ( md->tomb_nid )
mob->mvptomb_destroy(md);
- nd = npc->create_npc(md->bl.m, md->bl.x, md->bl.y);
+ nd = npc->create_npc(TOMB, md->bl.m, md->bl.x, md->bl.y, md->ud.dir, MOB_TOMB);
md->tomb_nid = nd->bl.id;
- nd->dir = md->ud.dir;
- nd->bl.type = BL_NPC;
safestrncpy(nd->name, msg_txt(856), sizeof(nd->name)); // "Tomb"
- nd->class_ = 565;
- nd->speed = 200;
- nd->subtype = TOMB;
-
nd->u.tomb.md = md;
nd->u.tomb.kill_time = time;
@@ -165,7 +159,6 @@ void mvptomb_create(struct mob_data *md, char *killer, time_t time)
map->addblock(&nd->bl);
status->set_viewdata(&nd->bl, nd->class_);
clif->spawn(&nd->bl);
-
}
void mvptomb_destroy(struct mob_data *md) {
diff --git a/src/map/npc.c b/src/map/npc.c
index 7044fefcf..9573c1c6f 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -53,8 +53,8 @@ static int npc_mob=0;
static int npc_delay_mob=0;
static int npc_cache_mob=0;
-static char *npc_last_path;
-static char *npc_last_ref;
+static const char *npc_last_path;
+static const char *npc_last_ref;
struct npc_path_data *npc_last_npd;
//For holding the view data of npc classes. [Skotlex]
@@ -2244,16 +2244,9 @@ int npc_unload(struct npc_data* nd, bool single)
npc_chat->finalize(nd); // deallocate npc PCRE data structures
#endif
- if( single && nd->path ) {
- struct npc_path_data* npd = NULL;
- if( nd->path && nd->path != npc_last_ref ) {
- npd = strdb_get(npc->path_db, nd->path);
- }
-
- if( npd && --npd->references == 0 ) {
- strdb_remove(npc->path_db, nd->path);/* remove from db */
- aFree(nd->path);/* remove now that no other instances exist */
- }
+ if (single && nd->path != NULL) {
+ npc->releasepathreference(nd->path);
+ nd->path = NULL;
}
if( single && nd->bl.m != -1 )
@@ -2404,6 +2397,64 @@ void npc_delsrcfile(const char* name)
}
}
+/**
+ * Retains a reference to filepath, for use in nd->path
+ *
+ * @param filepath The file path to retain.
+ * @return A retained reference to filepath.
+ */
+const char *npc_retainpathreference(const char *filepath)
+{
+ struct npc_path_data * npd = NULL;
+ nullpo_ret(filepath);
+
+ if (npc_last_path == filepath) {
+ if (npc_last_npd != NULL)
+ npc_last_npd->references++;
+ return npc_last_ref;
+ }
+
+ if ((npd = strdb_get(npc->path_db,filepath)) == NULL) {
+ CREATE(npd, struct npc_path_data, 1);
+ strdb_put(npc->path_db, filepath, npd);
+
+ CREATE(npd->path, char, strlen(filepath)+1);
+ safestrncpy(npd->path, filepath, strlen(filepath)+1);
+
+ npd->references = 0;
+ }
+
+ npd->references++;
+
+ npc_last_npd = npd;
+ npc_last_ref = npd->path;
+ npc_last_path = filepath;
+
+ return npd->path;
+}
+
+/**
+ * Releases a previously retained filepath.
+ *
+ * @param filepath The file path to release.
+ */
+void npc_releasepathreference(const char *filepath)
+{
+ struct npc_path_data* npd = NULL;
+
+ nullpo_retv(filepath);
+
+ if (filepath != npc_last_ref) {
+ npd = strdb_get(npc->path_db, filepath);
+ }
+
+ if (npd != NULL && --npd->references == 0) {
+ char *npcpath = npd->path;
+ strdb_remove(npc->path_db, filepath);/* remove from db */
+ aFree(npcpath);
+ }
+}
+
/// Parses and sets the name and exname of a npc.
/// Assumes that m, x and y are already set in nd.
void npc_parsename(struct npc_data* nd, const char* name, const char* start, const char* buffer, const char* filepath) {
@@ -2458,31 +2509,6 @@ void npc_parsename(struct npc_data* nd, const char* name, const char* start, con
ShowDebug("other npc in '%s' :\n display name '%s'\n unique name '%s'\n map=%s, x=%d, y=%d\n",dnd->path, dnd->name, dnd->exname, other_mapname, dnd->bl.x, dnd->bl.y);
safestrncpy(nd->exname, newname, sizeof(nd->exname));
}
-
- if( npc_last_path != filepath ) {
- struct npc_path_data * npd = NULL;
-
- if( !(npd = strdb_get(npc->path_db,filepath) ) ) {
- CREATE(npd, struct npc_path_data, 1);
- strdb_put(npc->path_db, filepath, npd);
-
- CREATE(npd->path, char, strlen(filepath)+1);
- safestrncpy(npd->path, filepath, strlen(filepath)+1);
-
- npd->references = 0;
- }
-
- nd->path = npd->path;
- npd->references++;
-
- npc_last_npd = npd;
- npc_last_ref = npd->path;
- npc_last_path = (char*) filepath;
- } else {
- nd->path = npc_last_ref;
- if( npc_last_npd )
- npc_last_npd->references++;
- }
}
// Parse View
@@ -2534,17 +2560,39 @@ bool npc_viewisid(const char * viewid)
return true;
}
-struct npc_data* npc_create_npc(int m, int x, int y)
+/**
+ * Creates a new NPC.
+ *
+ * @remark
+ * When creating a npc with subtype TOMB, no ID is assigned. The caller
+ * must assign the dead mob ID after the NPC is created.
+ *
+ * @param subtype The NPC subtype.
+ * @param m The map id.
+ * @param x The x coordinate on map.
+ * @param y The y coordinate on map.
+ * @param dir The facing direction.
+ * @param class_ The NPC view class.
+ * @return A pointer to the created NPC data (ownership passed to the caller).
+ */
+struct npc_data *npc_create_npc(enum npc_subtype subtype, int m, int x, int y, uint8 dir, int16 class_)
{
struct npc_data *nd;
CREATE(nd, struct npc_data, 1);
- nd->bl.id = npc->get_new_npc_id();
+ nd->subtype = subtype;
+ nd->bl.type = BL_NPC;
+ if (subtype != TOMB) {
+ nd->bl.id = npc->get_new_npc_id();
+ }
nd->bl.prev = nd->bl.next = NULL;
nd->bl.m = m;
nd->bl.x = x;
nd->bl.y = y;
+ nd->dir = dir;
nd->area_size = AREA_SIZE + 1;
+ nd->class_ = class_;
+ nd->speed = 200;
return nd;
}
@@ -2554,8 +2602,7 @@ struct npc_data* npc_add_warp(char* name, short from_mapid, short from_x, short
int i, flag = 0;
struct npc_data *nd;
- nd = npc->create_npc(from_mapid, from_x, from_y);
- map->addnpc(from_mapid, nd);
+ nd = npc->create_npc(WARP, from_mapid, from_x, from_y, 0, battle_config.warp_point_debug ? WARP_DEBUG_CLASS : WARP_CLASS);
safestrncpy(nd->exname, name, ARRAYLENGTH(nd->exname));
if (npc->name2id(nd->exname) != NULL)
@@ -2568,26 +2615,13 @@ struct npc_data* npc_add_warp(char* name, short from_mapid, short from_x, short
snprintf(nd->exname, ARRAYLENGTH(nd->exname), "warp%d_%d_%d_%d", i, from_mapid, from_x, from_y);
safestrncpy(nd->name, nd->exname, ARRAYLENGTH(nd->name));
- if( battle_config.warp_point_debug )
- nd->class_ = WARP_DEBUG_CLASS;
- else
- nd->class_ = WARP_CLASS;
- nd->speed = 200;
-
nd->u.warp.mapindex = to_mapindex;
nd->u.warp.x = to_x;
nd->u.warp.y = to_y;
nd->u.warp.xs = xs;
nd->u.warp.ys = xs;
- nd->bl.type = BL_NPC;
- nd->subtype = WARP;
- npc->setcells(nd);
- map->addblock(&nd->bl);
- status->set_viewdata(&nd->bl, nd->class_);
- nd->ud = &npc->base_ud;
- if( map->list[nd->bl.m].users )
- clif->spawn(&nd->bl);
- strdb_put(npc->name_db, nd->exname, nd);
+
+ npc->add_to_location(nd);
return nd;
}
@@ -2623,15 +2657,9 @@ const char* npc_parse_warp(char* w1, char* w2, char* w3, char* w4, const char* s
return strchr(start,'\n');;//try next
}
- nd = npc->create_npc(m, x, y);
- map->addnpc(m, nd);
+ nd = npc->create_npc(WARP, m, x, y, 0, battle_config.warp_point_debug ? WARP_DEBUG_CLASS : WARP_CLASS);
npc->parsename(nd, w3, start, buffer, filepath);
-
- if (!battle_config.warp_point_debug)
- nd->class_ = WARP_CLASS;
- else
- nd->class_ = WARP_DEBUG_CLASS;
- nd->speed = 200;
+ nd->path = npc->retainpathreference(filepath);
nd->u.warp.mapindex = i;
nd->u.warp.x = to_x;
@@ -2639,15 +2667,8 @@ const char* npc_parse_warp(char* w1, char* w2, char* w3, char* w4, const char* s
nd->u.warp.xs = xs;
nd->u.warp.ys = ys;
npc_warp++;
- nd->bl.type = BL_NPC;
- nd->subtype = WARP;
- npc->setcells(nd);
- map->addblock(&nd->bl);
- status->set_viewdata(&nd->bl, nd->class_);
- nd->ud = &npc->base_ud;
- if( map->list[nd->bl.m].users )
- clif->spawn(&nd->bl);
- strdb_put(npc->name_db, nd->exname, nd);
+
+ npc->add_to_location(nd);
return strchr(start,'\n');// continue
}
@@ -2666,7 +2687,7 @@ const char* npc_parse_shop(char* w1, char* w2, char* w3, char* w4, const char* s
size_t items_count = 40; // Starting items size
char *p;
- int x, y, dir, m, i;
+ int x, y, dir, m, i, class_;
struct npc_data *nd;
enum npc_subtype type;
@@ -2765,31 +2786,18 @@ const char* npc_parse_shop(char* w1, char* w2, char* w3, char* w4, const char* s
return strchr(start,'\n');// continue
}
- nd = npc->create_npc(m, x, y);
+ class_ = m == -1 ? -1 : npc->parseview(w4, start, buffer, filepath);
+ nd = npc->create_npc(type, m, x, y, dir, class_);
CREATE(nd->u.shop.shop_item, struct npc_item_list, i);
memcpy(nd->u.shop.shop_item, items, sizeof(items[0])*i);
aFree(items);
nd->u.shop.count = i;
npc->parsename(nd, w3, start, buffer, filepath);
- nd->class_ = m == -1 ? -1 : npc->parseview(w4, start, buffer, filepath);
- nd->speed = 200;
+ nd->path = npc->retainpathreference(filepath);
++npc_shop;
- nd->bl.type = BL_NPC;
- nd->subtype = type;
- if( m >= 0 ) {// normal shop npc
- map->addnpc(m,nd);
- map->addblock(&nd->bl);
- status->set_viewdata(&nd->bl, nd->class_);
- nd->ud = &npc->base_ud;
- nd->dir = dir;
- if( map->list[nd->bl.m].users )
- clif->spawn(&nd->bl);
- } else {// 'floating' shop
- map->addiddb(&nd->bl);
- }
- strdb_put(npc->name_db, nd->exname, nd);
+ npc->add_to_location(nd);
return strchr(start,'\n');// continue
}
@@ -2889,7 +2897,7 @@ const char* npc_parse_script(char* w1, char* w2, char* w3, char* w4, const char*
{
int x, y, dir = 0, m, xs = 0, ys = 0; // [Valaris] thanks to fov
struct script_code *scriptroot;
- int i;
+ int i, class_;
const char* end;
const char* script_start;
@@ -2946,39 +2954,74 @@ const char* npc_parse_script(char* w1, char* w2, char* w3, char* w4, const char*
npc->convertlabel_db(label_list,filepath);
}
- nd = npc->create_npc(m, x, y);
- if( sscanf(w4, "%*[^,],%d,%d", &xs, &ys) == 2 )
- {// OnTouch area defined
+ class_ = m == -1 ? -1 : npc->parseview(w4, start, buffer, filepath);
+ nd = npc->create_npc(SCRIPT, m, x, y, dir, class_);
+ if (sscanf(w4, "%*[^,],%d,%d", &xs, &ys) == 2) {
+ // OnTouch area defined
nd->u.scr.xs = xs;
nd->u.scr.ys = ys;
- }
- else
- {// no OnTouch area
+ } else {
+ // no OnTouch area
nd->u.scr.xs = -1;
nd->u.scr.ys = -1;
}
npc->parsename(nd, w3, start, buffer, filepath);
- nd->class_ = m == -1 ? -1 : npc->parseview(w4, start, buffer, filepath);
- nd->speed = 200;
+ nd->path = npc->retainpathreference(filepath);
nd->u.scr.script = scriptroot;
nd->u.scr.label_list = label_list;
nd->u.scr.label_list_num = label_list_num;
if( options&NPO_TRADER )
nd->u.scr.trader = true;
nd->u.scr.shop = NULL;
-
++npc_script;
- nd->bl.type = BL_NPC;
- nd->subtype = SCRIPT;
+ npc->add_to_location(nd);
- if( m >= 0 ) {
- map->addnpc(m, nd);
- nd->ud = &npc->base_ud;
- nd->dir = dir;
+ //-----------------------------------------
+ // Loop through labels to export them as necessary
+ for (i = 0; i < nd->u.scr.label_list_num; i++) {
+ if (npc->event_export(nd, i)) {
+ ShowWarning("npc_parse_script: duplicate event %s::%s in file '%s'.\n",
+ nd->exname, nd->u.scr.label_list[i].name, filepath);
+ if (retval) *retval = EXIT_FAILURE;
+ }
+ npc->timerevent_export(nd, i);
+ }
+
+ nd->u.scr.timerid = INVALID_TIMER;
+
+ if( options&NPO_ONINIT ) {
+ char evname[EVENT_NAME_LENGTH];
+ struct event_data *ev;
+
+ snprintf(evname, ARRAYLENGTH(evname), "%s::OnInit", nd->exname);
+
+ if( ( ev = (struct event_data*)strdb_get(npc->ev_db, evname) ) ) {
+
+ //Execute OnInit
+ script->run_npc(nd->u.scr.script,ev->pos,0,nd->bl.id);
+
+ }
+ }
+
+ return end;
+}
+
+/**
+ * Registers the NPC and adds it to its location (on map or floating).
+ *
+ * @param nd The NPC to register.
+ */
+void npc_add_to_location(struct npc_data *nd)
+{
+ nullpo_retv(nd);
+
+ if (nd->bl.m >= 0) {
+ map->addnpc(nd->bl.m, nd);
npc->setcells(nd);
map->addblock(&nd->bl);
- if( nd->class_ >= 0 ) {
+ nd->ud = &npc->base_ud;
+ if (nd->class_ >= 0) {
status->set_viewdata(&nd->bl, nd->class_);
if( map->list[nd->bl.m].users )
clif->spawn(&nd->bl);
@@ -2988,35 +3031,120 @@ const char* npc_parse_script(char* w1, char* w2, char* w3, char* w4, const char*
map->addiddb(&nd->bl);
}
strdb_put(npc->name_db, nd->exname, nd);
+}
+
+/**
+ * Duplicates a script (@see npc_duplicate_sub)
+ */
+bool npc_duplicate_script_sub(struct npc_data *nd, const struct npc_data *snd, int xs, int ys, int options)
+{
+ int i;
+ bool retval = true;
+
+ ++npc_script;
+ nd->u.scr.xs = xs;
+ nd->u.scr.ys = ys;
+ nd->u.scr.script = snd->u.scr.script;
+ nd->u.scr.label_list = snd->u.scr.label_list;
+ nd->u.scr.label_list_num = snd->u.scr.label_list_num;
+ nd->u.scr.shop = snd->u.scr.shop;
+ nd->u.scr.trader = snd->u.scr.trader;
+
+ //add the npc to its location
+ npc->add_to_location(nd);
- //-----------------------------------------
// Loop through labels to export them as necessary
for (i = 0; i < nd->u.scr.label_list_num; i++) {
if (npc->event_export(nd, i)) {
- ShowWarning("npc_parse_script: duplicate event %s::%s in file '%s'.\n",
- nd->exname, nd->u.scr.label_list[i].name, filepath);
- if (retval) *retval = EXIT_FAILURE;
+ ShowWarning("npc_parse_duplicate: duplicate event %s::%s in file '%s'.\n",
+ nd->exname, nd->u.scr.label_list[i].name, nd->path);
+ retval = false;
}
npc->timerevent_export(nd, i);
}
nd->u.scr.timerid = INVALID_TIMER;
- if( options&NPO_ONINIT ) {
+ if (options&NPO_ONINIT) {
+ // From npc_parse_script
char evname[EVENT_NAME_LENGTH];
struct event_data *ev;
snprintf(evname, ARRAYLENGTH(evname), "%s::OnInit", nd->exname);
- if( ( ev = (struct event_data*)strdb_get(npc->ev_db, evname) ) ) {
-
+ if ((ev = (struct event_data*)strdb_get(npc->ev_db, evname)) != NULL) {
//Execute OnInit
script->run_npc(nd->u.scr.script,ev->pos,0,nd->bl.id);
-
}
}
+ return retval;
+}
- return end;
+/**
+ * Duplicates a shop or cash shop (@see npc_duplicate_sub)
+ */
+bool npc_duplicate_shop_sub(struct npc_data *nd, const struct npc_data *snd, int xs, int ys, int options)
+{
+ ++npc_shop;
+ nd->u.shop.shop_item = snd->u.shop.shop_item;
+ nd->u.shop.count = snd->u.shop.count;
+
+ //add the npc to its location
+ npc->add_to_location(nd);
+
+ return true;
+}
+
+/**
+ * Duplicates a warp (@see npc_duplicate_sub)
+ */
+bool npc_duplicate_warp_sub(struct npc_data *nd, const struct npc_data *snd, int xs, int ys, int options)
+{
+ ++npc_warp;
+ nd->u.warp.xs = xs;
+ nd->u.warp.ys = ys;
+ nd->u.warp.mapindex = snd->u.warp.mapindex;
+ nd->u.warp.x = snd->u.warp.x;
+ nd->u.warp.y = snd->u.warp.y;
+
+ //Add the npc to its location
+ npc->add_to_location(nd);
+
+ return true;
+}
+
+/**
+ * Duplicates a warp, shop, cashshop or script.
+ *
+ * @param nd An already initialized NPC data. Expects bl->m, bl->x, bl->y,
+ * name, exname, path, dir, class_, speed, subtype to be already
+ * filled.
+ * @param snd The source NPC to duplicate.
+ * @param class_ The npc view class.
+ * @param dir The facing direction.
+ * @param xs The x-span, if any.
+ * @param ys The y-span, if any.
+ * @param options The NPC options.
+ * @retval false if there were any issues while creating and validating the NPC.
+ */
+bool npc_duplicate_sub(struct npc_data *nd, const struct npc_data *snd, int xs, int ys, int options)
+{
+ nd->src_id = snd->bl.id;
+ switch (nd->subtype) {
+ case SCRIPT:
+ return npc->duplicate_script_sub(nd, snd, xs, ys, options);
+
+ case SHOP:
+ case CASHSHOP:
+ return npc->duplicate_shop_sub(nd, snd, xs, ys, options);
+
+ case WARP:
+ return npc->duplicate_warp_sub(nd, snd, xs, ys, options);
+
+ case TOMB:
+ return false;
+ }
+ return false;
}
/// Duplicate a warp, shop, cashshop or script. [Orcao]
@@ -3029,12 +3157,10 @@ const char* npc_parse_script(char* w1, char* w2, char* w3, char* w4, const char*
const char* npc_parse_duplicate(char* w1, char* w2, char* w3, char* w4, const char* start, const char* buffer, const char* filepath, int options, int *retval) {
int x, y, dir, m, xs = -1, ys = -1;
char srcname[128];
- int i;
- const char* end;
+ const char *end;
size_t length;
- int src_id;
- int type;
+ int class_;
struct npc_data* nd;
struct npc_data* dnd;
@@ -3056,18 +3182,16 @@ const char* npc_parse_duplicate(char* w1, char* w2, char* w3, char* w4, const ch
if (retval) *retval = EXIT_FAILURE;
return end;// next line, try to continue
}
- src_id = dnd->bl.id;
- type = dnd->subtype;
// get placement
- if ((type==SHOP || type==CASHSHOP || type==SCRIPT) && strcmp(w1, "-") == 0) {
+ if ((dnd->subtype==SHOP || dnd->subtype==CASHSHOP || dnd->subtype==SCRIPT) && strcmp(w1, "-") == 0) {
// floating shop/chashshop/script
x = y = dir = 0;
m = -1;
} else {
char mapname[32];
int fields = sscanf(w1, "%31[^,],%d,%d,%d", mapname, &x, &y, &dir);
- if (type == WARP && fields == 3) {
+ if (dnd->subtype == WARP && fields == 3) {
// <map name>,<x>,<y>
dir = 0;
} else if (fields != 4) {
@@ -3090,107 +3214,40 @@ const char* npc_parse_duplicate(char* w1, char* w2, char* w3, char* w4, const ch
return end;//try next
}
- if( type == WARP && sscanf(w4, "%d,%d", &xs, &ys) == 2 );// <spanx>,<spany>
- else if( type == SCRIPT && sscanf(w4, "%*[^,],%d,%d", &xs, &ys) == 2);// <sprite id>,<triggerX>,<triggerY>
- else if( type == WARP ) {
+ if (dnd->subtype == WARP && sscanf(w4, "%d,%d", &xs, &ys) == 2) { // <spanx>,<spany>
+ ;
+ } else if (dnd->subtype == SCRIPT && sscanf(w4, "%*[^,],%d,%d", &xs, &ys) == 2) { // <sprite id>,<triggerX>,<triggerY>
+ ;
+ } else if (dnd->subtype == WARP) {
ShowError("npc_parse_duplicate: Invalid span format for duplicate warp in file '%s', line '%d'. Skipping line...\n * w1=%s\n * w2=%s\n * w3=%s\n * w4=%s\n", filepath, strline(buffer,start-buffer), w1, w2, w3, w4);
if (retval) *retval = EXIT_FAILURE;
return end;// next line, try to continue
}
- nd = npc->create_npc(m, x, y);
+ class_ = m == -1 ? -1 : npc->parseview(w4, start, buffer, filepath);
+ nd = npc->create_npc(dnd->subtype, m, x, y, dir, class_);
npc->parsename(nd, w3, start, buffer, filepath);
- nd->class_ = m == -1 ? -1 : npc->parseview(w4, start, buffer, filepath);
- nd->speed = 200;
- nd->src_id = src_id;
- nd->bl.type = BL_NPC;
- nd->subtype = (enum npc_subtype)type;
- switch( type ) {
- case SCRIPT:
- ++npc_script;
- nd->u.scr.xs = xs;
- nd->u.scr.ys = ys;
- nd->u.scr.script = dnd->u.scr.script;
- nd->u.scr.label_list = dnd->u.scr.label_list;
- nd->u.scr.label_list_num = dnd->u.scr.label_list_num;
- nd->u.scr.shop = dnd->u.scr.shop;
- nd->u.scr.trader = dnd->u.scr.trader;
- break;
-
- case SHOP:
- case CASHSHOP:
- ++npc_shop;
- nd->u.shop.shop_item = dnd->u.shop.shop_item;
- nd->u.shop.count = dnd->u.shop.count;
- break;
-
- case WARP:
- ++npc_warp;
- if( !battle_config.warp_point_debug )
- nd->class_ = WARP_CLASS;
- else
- nd->class_ = WARP_DEBUG_CLASS;
- nd->u.warp.xs = xs;
- nd->u.warp.ys = ys;
- nd->u.warp.mapindex = dnd->u.warp.mapindex;
- nd->u.warp.x = dnd->u.warp.x;
- nd->u.warp.y = dnd->u.warp.y;
- break;
- }
-
- //Add the npc to its location
- if( m >= 0 ) {
- map->addnpc(m, nd);
- nd->ud = &npc->base_ud;
- nd->dir = dir;
- npc->setcells(nd);
- map->addblock(&nd->bl);
- if( nd->class_ >= 0 ) {
- status->set_viewdata(&nd->bl, nd->class_);
- if( map->list[nd->bl.m].users )
- clif->spawn(&nd->bl);
- }
- } else {
- // we skip map->addnpc, but still add it to the list of ID's
- map->addiddb(&nd->bl);
- }
- strdb_put(npc->name_db, nd->exname, nd);
-
- if( type != SCRIPT )
- return end;
-
- //-----------------------------------------
- // Loop through labels to export them as necessary
- for (i = 0; i < nd->u.scr.label_list_num; i++) {
- if (npc->event_export(nd, i)) {
- ShowWarning("npc_parse_duplicate: duplicate event %s::%s in file '%s'.\n",
- nd->exname, nd->u.scr.label_list[i].name, filepath);
- if (retval) *retval = EXIT_FAILURE;
- }
- npc->timerevent_export(nd, i);
+ nd->path = npc->retainpathreference(filepath);
+ if (!npc->duplicate_sub(nd, dnd, xs, ys, options)) {
+ if (retval) *retval = EXIT_FAILURE;
}
- nd->u.scr.timerid = INVALID_TIMER;
-
- if (options&NPO_ONINIT) {
- // From npc_parse_script
- char evname[EVENT_NAME_LENGTH];
- struct event_data *ev;
-
- snprintf(evname, ARRAYLENGTH(evname), "%s::OnInit", nd->exname);
-
- if( ( ev = (struct event_data*)strdb_get(npc->ev_db, evname) ) ) {
-
- //Execute OnInit
- script->run_npc(nd->u.scr.script,ev->pos,0,nd->bl.id);
-
- }
- }
return end;
}
-int npc_duplicate4instance(struct npc_data *snd, int16 m) {
+/**
+ * Duplicates an NPC for instancing purposes.
+ *
+ * @param snd The NPC to duplicate.
+ * @param m The instanced map ID.
+ * @return success state.
+ * @retval 0 in case of successful creation.
+ */
+int npc_duplicate4instance(struct npc_data *snd, int16 m)
+{
char newname[NAME_LENGTH];
+ int dm = -1, im = -1, xs = -1, ys = -1;
+ struct npc_data *nd = NULL;
if( m == -1 || map->list[m].instance_id == -1 )
return 1;
@@ -3201,50 +3258,35 @@ int npc_duplicate4instance(struct npc_data *snd, int16 m) {
return 1;
}
- if( snd->subtype == WARP ) { // Adjust destination, if instanced
- struct npc_data *wnd = NULL; // New NPC
- int dm = map->mapindex2mapid(snd->u.warp.mapindex), im;
- if( dm < 0 ) return 1;
-
- if( ( im = instance->mapid2imapid(dm, map->list[m].instance_id) ) == -1 ) {
+ switch (snd->subtype) {
+ case SCRIPT:
+ xs = snd->u.scr.xs;
+ ys = snd->u.scr.ys;
+ break;
+ case WARP:
+ xs = snd->u.warp.xs;
+ ys = snd->u.warp.ys;
+ // Adjust destination, if instanced
+ if ((dm = map->mapindex2mapid(snd->u.warp.mapindex)) < 0) {
+ return 1;
+ }
+ if ((im = instance->mapid2imapid(dm, map->list[m].instance_id)) == -1) {
ShowError("npc_duplicate4instance: warp (%s) leading to instanced map (%s), but instance map is not attached to current instance.\n", map->list[dm].name, snd->exname);
return 1;
}
+ break;
+ default: // Other types have no xs/ys
+ break;
+ }
- wnd = npc->create_npc(m, snd->bl.x, snd->bl.y);
- map->addnpc(m, wnd);
- safestrncpy(wnd->name, "", ARRAYLENGTH(wnd->name));
- safestrncpy(wnd->exname, newname, ARRAYLENGTH(wnd->exname));
- wnd->class_ = WARP_CLASS;
- wnd->speed = 200;
- wnd->u.warp.mapindex = map_id2index(im);
- wnd->u.warp.x = snd->u.warp.x;
- wnd->u.warp.y = snd->u.warp.y;
- wnd->u.warp.xs = snd->u.warp.xs;
- wnd->u.warp.ys = snd->u.warp.ys;
- wnd->bl.type = BL_NPC;
- wnd->subtype = WARP;
- npc->setcells(wnd);
- map->addblock(&wnd->bl);
- status->set_viewdata(&wnd->bl, wnd->class_);
- wnd->ud = &npc->base_ud;
- if( map->list[wnd->bl.m].users )
- clif->spawn(&wnd->bl);
- strdb_put(npc->name_db, wnd->exname, wnd);
- } else {
- static char w1[50], w2[50], w3[50], w4[50];
- const char* stat_buf = "- call from instancing subsystem -\n";
-
- snprintf(w1, sizeof(w1), "%s,%d,%d,%d", map->list[m].name, snd->bl.x, snd->bl.y, snd->dir);
- snprintf(w2, sizeof(w2), "duplicate(%s)", snd->exname);
- snprintf(w3, sizeof(w3), "%s::%s", snd->name, newname);
-
- if( snd->u.scr.xs >= 0 && snd->u.scr.ys >= 0 )
- snprintf(w4, sizeof(w4), "%d,%d,%d", snd->class_, snd->u.scr.xs, snd->u.scr.ys); // Touch Area
- else
- snprintf(w4, sizeof(w4), "%d", snd->class_);
-
- npc->parse_duplicate(w1, w2, w3, w4, stat_buf, stat_buf, "INSTANCING", NPO_NONE, NULL);
+ nd = npc->create_npc(snd->subtype, m, snd->bl.x, snd->bl.y, snd->dir, snd->class_);
+ safestrncpy(nd->name, snd->name, sizeof(nd->name));
+ safestrncpy(nd->exname, newname, sizeof(nd->exname));
+ nd->path = npc->retainpathreference("INSTANCING");
+ npc->duplicate_sub(nd, snd, xs, ys, NPO_NONE);
+ if (nd->subtype == WARP) {
+ // Adjust destination, if instanced
+ nd->u.warp.mapindex = map_id2index(im);
}
return 0;
@@ -4732,6 +4774,8 @@ void npc_defaults(void) {
npc->clearsrcfile = npc_clearsrcfile;
npc->addsrcfile = npc_addsrcfile;
npc->delsrcfile = npc_delsrcfile;
+ npc->retainpathreference = npc_retainpathreference;
+ npc->releasepathreference = npc_releasepathreference;
npc->parsename = npc_parsename;
npc->parseview = npc_parseview;
npc->viewisid = npc_viewisid;
@@ -4742,6 +4786,11 @@ void npc_defaults(void) {
npc->convertlabel_db = npc_convertlabel_db;
npc->skip_script = npc_skip_script;
npc->parse_script = npc_parse_script;
+ npc->add_to_location = npc_add_to_location;
+ npc->duplicate_script_sub = npc_duplicate_script_sub;
+ npc->duplicate_shop_sub = npc_duplicate_shop_sub;
+ npc->duplicate_warp_sub = npc_duplicate_warp_sub;
+ npc->duplicate_sub = npc_duplicate_sub;
npc->parse_duplicate = npc_parse_duplicate;
npc->duplicate4instance = npc_duplicate4instance;
npc->setcells = npc_setcells;
diff --git a/src/map/npc.h b/src/map/npc.h
index bf3d1494d..60be1fbe4 100644
--- a/src/map/npc.h
+++ b/src/map/npc.h
@@ -70,7 +70,7 @@ struct npc_data {
unsigned short stat_point;
struct npc_parse *chatdb;
- char* path;/* path dir */
+ const char *path; ///< Source path reference
enum npc_subtype subtype;
int src_id;
union {
@@ -111,6 +111,7 @@ struct npc_data {
enum actor_classes {
WARP_CLASS = 45,
HIDDEN_WARP_CLASS = 139,
+ MOB_TOMB = 565,
WARP_DEBUG_CLASS = 722,
FLAG_CLASS = 722,
INVISIBLE_CLASS = 32767,
@@ -120,7 +121,7 @@ enum actor_classes {
#define MAX_NPC_CLASS 1000
// New NPC range
#define MAX_NPC_CLASS2_START 10001
-#define MAX_NPC_CLASS2_END 10110
+#define MAX_NPC_CLASS2_END 10174
//Script NPC events.
enum npce_event {
@@ -225,10 +226,12 @@ struct npc_interface {
void (*clearsrcfile) (void);
void (*addsrcfile) (const char *name);
void (*delsrcfile) (const char *name);
+ const char *(*retainpathreference) (const char *filepath);
+ void (*releasepathreference) (const char *filepath);
void (*parsename) (struct npc_data *nd, const char *name, const char *start, const char *buffer, const char *filepath);
int (*parseview) (const char *w4, const char *start, const char *buffer, const char *filepath);
bool (*viewisid) (const char *viewid);
- struct npc_data* (*create_npc) (int m, int x, int y);
+ struct npc_data *(*create_npc) (enum npc_subtype subtype, int m, int x, int y, uint8 dir, int16 class_);
struct npc_data* (*add_warp) (char *name, short from_mapid, short from_x, short from_y, short xs, short ys, unsigned short to_mapindex, short to_x, short to_y);
const char* (*parse_warp) (char *w1, char *w2, char *w3, char *w4, const char *start, const char *buffer, const char *filepath, int *retval);
const char* (*parse_shop) (char *w1, char *w2, char *w3, char *w4, const char *start, const char *buffer, const char *filepath, int *retval);
@@ -236,6 +239,11 @@ struct npc_interface {
void (*convertlabel_db) (struct npc_label_list *label_list, const char *filepath);
const char* (*skip_script) (const char *start, const char *buffer, const char *filepath, int *retval);
const char* (*parse_script) (char *w1, char *w2, char *w3, char *w4, const char *start, const char *buffer, const char *filepath, int options, int *retval);
+ void (*add_to_location) (struct npc_data *nd);
+ bool (*duplicate_script_sub) (struct npc_data *nd, const struct npc_data *snd, int xs, int ys, int options);
+ bool (*duplicate_shop_sub) (struct npc_data *nd, const struct npc_data *snd, int xs, int ys, int options);
+ bool (*duplicate_warp_sub) (struct npc_data *nd, const struct npc_data *snd, int xs, int ys, int options);
+ bool (*duplicate_sub) (struct npc_data *nd, const struct npc_data *snd, int xs, int ys, int options);
const char* (*parse_duplicate) (char* w1, char* w2, char* w3, char* w4, const char* start, const char* buffer, const char* filepath, int options, int *retval);
int (*duplicate4instance) (struct npc_data *snd, int16 m);
void (*setcells) (struct npc_data *nd);
diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h
index 8f9747747..58c17ef0a 100644
--- a/src/map/packets_struct.h
+++ b/src/map/packets_struct.h
@@ -257,6 +257,13 @@ enum packet_headers {
rouletteinfoackType = 0xa1c,
roulettgenerateackType = 0xa20,
roulettercvitemackType = 0xa22,
+#if 0 // Unknown
+ questListType = 0x9f8, ///< ZC_ALL_QUEST_LIST3
+#elif PACKETVER >= 20141022
+ questListType = 0x97a, ///< ZC_ALL_QUEST_LIST2
+#else // PACKETVER < 20141022
+ questListType = 0x2b1, ///< ZC_ALL_QUEST_LIST
+#endif // PACKETVER >= 20141022
};
#if !defined(sun) && (!defined(__NETBSD__) || __NetBSD_Version__ >= 600000000) // NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute
@@ -1101,6 +1108,47 @@ struct packet_hotkey {
} hotkey[MAX_HOTKEYS];
} __attribute__((packed));
+/**
+ * MISSION_HUNT_INFO
+ */
+struct packet_mission_info_sub {
+ int32 mob_id;
+ int16 huntCount;
+ int16 maxCount;
+ char mobName[NAME_LENGTH];
+} __attribute__((packed));
+
+/**
+ * PACKET_ZC_ALL_QUEST_LIST2_INFO (PACKETVER >= 20141022)
+ * PACKET_ZC_ALL_QUEST_LIST3_INFO (PACKETVER Unknown) / unused
+ */
+struct packet_quest_list_info {
+ int32 questID;
+ int8 active;
+#if PACKETVER >= 20141022
+ int32 quest_svrTime;
+ int32 quest_endTime;
+ int16 hunting_count;
+ struct packet_mission_info_sub objectives[]; // Note: This will be < MAX_QUEST_OBJECTIVES
+#endif // PACKETVER >= 20141022
+} __attribute__((packed));
+
+/**
+ * Header for:
+ * PACKET_ZC_ALL_QUEST_LIST (PACKETVER < 20141022)
+ * PACKET_ZC_ALL_QUEST_LIST2 (PACKETVER >= 20141022)
+ * PACKET_ZC_ALL_QUEST_LIST3 (PACKETVER Unknown) / unused
+ *
+ * @remark
+ * Contains (is followed by) a variable-length array of packet_quest_list_info
+ */
+struct packet_quest_list_header {
+ uint16 PacketType;
+ uint16 PacketLength;
+ int32 questCount;
+ //struct packet_quest_list_info list[]; // Variable-length
+} __attribute__((packed));
+
#if !defined(sun) && (!defined(__NETBSD__) || __NetBSD_Version__ >= 600000000) // NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute
#pragma pack(pop)
#endif // not NetBSD < 6 / Solaris
diff --git a/src/map/pc.c b/src/map/pc.c
index 4d4f41521..43adf331b 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -1126,8 +1126,7 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim
sd->bg_queue.client_has_bg_data = 0;
sd->bg_queue.type = 0;
- sd->queues = NULL;
- sd->queues_count = 0;
+ VECTOR_INIT(sd->script_queues);
sd->state.dialog = 0;
@@ -2186,6 +2185,7 @@ int pc_bonus_subele(struct map_session_data* sd, unsigned char ele, short rate,
int pc_bonus(struct map_session_data *sd,int type,int val) {
struct status_data *bst;
int bonus;
+ int i;
nullpo_ret(sd);
bst = &sd->base_status;
@@ -2436,20 +2436,48 @@ int pc_bonus(struct map_session_data *sd,int type,int val) {
sd->matk_rate += val;
break;
case SP_IGNORE_DEF_ELE:
- if(val >= ELE_MAX) {
+ if( (val >= ELE_MAX && val != ELE_ALL) || (val < ELE_NEUTRAL) ) {
ShowError("pc_bonus: SP_IGNORE_DEF_ELE: Invalid element %d\n", val);
break;
}
- if(!sd->state.lr_flag)
- sd->right_weapon.ignore_def_ele |= 1<<val;
- else if(sd->state.lr_flag == 1)
- sd->left_weapon.ignore_def_ele |= 1<<val;
+ if ( val == ELE_ALL ) {
+ for ( i = ELE_NEUTRAL; i < ELE_MAX; i++ ) {
+ if(!sd->state.lr_flag)
+ sd->right_weapon.ignore_def_ele |= 1<<i;
+ else if(sd->state.lr_flag == 1)
+ sd->left_weapon.ignore_def_ele |= 1<<i;
+ }
+ } else {
+ if(!sd->state.lr_flag)
+ sd->right_weapon.ignore_def_ele |= 1<<val;
+ else if(sd->state.lr_flag == 1)
+ sd->left_weapon.ignore_def_ele |= 1<<val;
+ }
break;
case SP_IGNORE_DEF_RACE:
- if(!sd->state.lr_flag)
- sd->right_weapon.ignore_def_race |= 1<<val;
- else if(sd->state.lr_flag == 1)
- sd->left_weapon.ignore_def_race |= 1<<val;
+ if (val == RC_MAX || (val > RC_NONDEMIPLAYER && val != RC_ALL) || val < RC_FORMLESS ) {
+ ShowWarning("pc_bonus: SP_IGNORE_DEF_RACE: Invalid Race(%d)\n",val);
+ break;
+ }
+ if ( val >= RC_MAX ) {
+ for ( i = RC_FORMLESS; i < RC_BOSS; i++ ) {
+ if ( (val == RC_NONPLAYER && i == RC_PLAYER) ||
+ (val == RC_NONDEMIHUMAN && i == RC_DEMIHUMAN) ||
+ (val == RC_DEMIPLAYER && (i != RC_PLAYER && i != RC_DEMIHUMAN)) ||
+ (val == RC_NONDEMIPLAYER && (i == RC_PLAYER || i == RC_DEMIHUMAN))
+ )
+ continue;
+ if(!sd->state.lr_flag)
+ sd->right_weapon.ignore_def_race |= 1<<i;
+ else if(sd->state.lr_flag == 1)
+ sd->left_weapon.ignore_def_race |= 1<<i;
+ }
+ } else {
+ if(!sd->state.lr_flag)
+ sd->right_weapon.ignore_def_race |= 1<<val;
+ else if(sd->state.lr_flag == 1)
+ sd->left_weapon.ignore_def_race |= 1<<val;
+ }
break;
case SP_ATK_RATE:
if(sd->state.lr_flag != 2)
@@ -2470,16 +2498,40 @@ int pc_bonus(struct map_session_data *sd,int type,int val) {
}
break;
case SP_IGNORE_MDEF_ELE:
- if(val >= ELE_MAX) {
+ if( (val >= ELE_MAX && val != ELE_ALL) || (val < ELE_NEUTRAL) ) {
ShowError("pc_bonus: SP_IGNORE_MDEF_ELE: Invalid element %d\n", val);
break;
}
- if(sd->state.lr_flag != 2)
- sd->bonus.ignore_mdef_ele |= 1<<val;
+ if (sd->state.lr_flag != 2) {
+ if ( val == ELE_ALL ) {
+ for ( i = ELE_NEUTRAL; i < ELE_MAX; i++ ) {
+ sd->bonus.ignore_mdef_ele |= 1<<i;
+ }
+ } else {
+ sd->bonus.ignore_mdef_ele |= 1<<val;
+ }
+ }
break;
case SP_IGNORE_MDEF_RACE:
- if(sd->state.lr_flag != 2)
- sd->bonus.ignore_mdef_race |= 1<<val;
+ if (val == RC_MAX || (val > RC_NONDEMIPLAYER && val != RC_ALL) || val < RC_FORMLESS ) {
+ ShowWarning("pc_bonus: SP_IGNORE_MDEF_RACE: Invalid Race(%d)\n",val);
+ break;
+ }
+ if(sd->state.lr_flag != 2) {
+ if ( val >= RC_MAX ) {
+ for ( i = RC_FORMLESS; i < RC_BOSS; i++ ) {
+ if ( (val == RC_NONPLAYER && i == RC_PLAYER) ||
+ (val == RC_NONDEMIHUMAN && i == RC_DEMIHUMAN) ||
+ (val == RC_DEMIPLAYER && (i != RC_PLAYER && i != RC_DEMIHUMAN)) ||
+ (val == RC_NONDEMIPLAYER && (i == RC_PLAYER || i == RC_DEMIHUMAN))
+ )
+ continue;
+ sd->bonus.ignore_mdef_race |= 1<<i;
+ }
+ } else {
+ sd->bonus.ignore_mdef_race |= 1<<val;
+ }
+ }
break;
case SP_PERFECT_HIT_RATE:
if(sd->state.lr_flag != 2 && sd->bonus.perfect_hit < val)
@@ -2494,24 +2546,48 @@ int pc_bonus(struct map_session_data *sd,int type,int val) {
sd->critical_rate+=val;
break;
case SP_DEF_RATIO_ATK_ELE:
- if(val >= ELE_MAX) {
+ if( (val >= ELE_MAX && val != ELE_ALL) || (val < ELE_NEUTRAL) ) {
ShowError("pc_bonus: SP_DEF_RATIO_ATK_ELE: Invalid element %d\n", val);
break;
}
- if(!sd->state.lr_flag)
- sd->right_weapon.def_ratio_atk_ele |= 1<<val;
- else if(sd->state.lr_flag == 1)
- sd->left_weapon.def_ratio_atk_ele |= 1<<val;
+ if ( val == ELE_ALL ) {
+ for ( i = ELE_NEUTRAL; i < ELE_MAX; i++ ) {
+ if(!sd->state.lr_flag)
+ sd->right_weapon.def_ratio_atk_ele |= 1<<i;
+ else if(sd->state.lr_flag == 1)
+ sd->left_weapon.def_ratio_atk_ele |= 1<<i;
+ }
+ } else {
+ if(!sd->state.lr_flag)
+ sd->right_weapon.def_ratio_atk_ele |= 1<<val;
+ else if(sd->state.lr_flag == 1)
+ sd->left_weapon.def_ratio_atk_ele |= 1<<val;
+ }
break;
case SP_DEF_RATIO_ATK_RACE:
- if(val >= RC_MAX) {
- ShowError("pc_bonus: SP_DEF_RATIO_ATK_RACE: Invalid race %d\n", val);
+ if (val == RC_MAX || (val > RC_NONDEMIPLAYER && val != RC_ALL) || val < RC_FORMLESS ) {
+ ShowWarning("pc_bonus: SP_DEF_RATIO_ATK_RACE: Invalid Race(%d)\n",val);
break;
}
- if(!sd->state.lr_flag)
- sd->right_weapon.def_ratio_atk_race |= 1<<val;
- else if(sd->state.lr_flag == 1)
- sd->left_weapon.def_ratio_atk_race |= 1<<val;
+ if ( val >= RC_MAX ) {
+ for ( i = RC_FORMLESS; i < RC_BOSS; i++ ) {
+ if ( (val == RC_NONPLAYER && i == RC_PLAYER) ||
+ (val == RC_NONDEMIHUMAN && i == RC_DEMIHUMAN) ||
+ (val == RC_DEMIPLAYER && (i != RC_PLAYER && i != RC_DEMIHUMAN)) ||
+ (val == RC_NONDEMIPLAYER && (i == RC_PLAYER || i == RC_DEMIHUMAN))
+ )
+ continue;
+ if(!sd->state.lr_flag)
+ sd->right_weapon.def_ratio_atk_race |= 1<<i;
+ else if(sd->state.lr_flag == 1)
+ sd->left_weapon.def_ratio_atk_race |= 1<<i;
+ }
+ } else {
+ if(!sd->state.lr_flag)
+ sd->right_weapon.def_ratio_atk_race |= 1<<val;
+ else if(sd->state.lr_flag == 1)
+ sd->left_weapon.def_ratio_atk_race |= 1<<val;
+ }
break;
case SP_HIT_RATE:
if(sd->state.lr_flag != 2)
@@ -5449,11 +5525,11 @@ int pc_setpos(struct map_session_data* sd, unsigned short map_index, int x, int
int i;
sd->state.pmap = sd->bl.m;
- for( i = 0; i < sd->queues_count; i++ ) {
- struct hQueue *queue;
- if( (queue = script->queue(sd->queues[i])) && queue->onMapChange[0] != '\0' ) {
- pc->setregstr(sd, script->add_str("QMapChangeTo"), map->list[m].name);
- npc->event(sd, queue->onMapChange, 0);
+ for (i = 0; i < VECTOR_LENGTH(sd->script_queues); i++) {
+ struct script_queue *queue = script->queue(VECTOR_INDEX(sd->script_queues, i));
+ if (queue && queue->event_mapchange[0] != '\0') {
+ pc->setregstr(sd, script->add_str("@Queue_Destination_Map$"), map->list[m].name);
+ npc->event(sd, queue->event_mapchange, 0);
}
}
@@ -7557,10 +7633,10 @@ int pc_dead(struct map_session_data *sd,struct block_list *src) {
npc->event(sd, bgd->die_event, 0);
}
- for( i = 0; i < sd->queues_count; i++ ) {
- struct hQueue *queue;
- if( (queue = script->queue(sd->queues[i])) && queue->onDeath[0] != '\0' )
- npc->event(sd, queue->onDeath, 0);
+ for (i = 0; i < VECTOR_LENGTH(sd->script_queues); i++ ) {
+ struct script_queue *queue = script->queue(VECTOR_INDEX(sd->script_queues, i));
+ if (queue && queue->event_death[0] != '\0')
+ npc->event(sd, queue->event_death, 0);
}
npc->script_event(sd,NPCE_DIE);
diff --git a/src/map/pc.h b/src/map/pc.h
index 2c8b24acf..62571f12a 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -531,8 +531,7 @@ END_ZEROED_BLOCK;
enum bg_queue_types type;
} bg_queue;
- int *queues;
- unsigned int queues_count;
+ VECTOR_DECL(int) script_queues;
/* Made Possible Thanks to Yommy~! */
unsigned int cryptKey; ///< Packet obfuscation key to be used for the next received packet
diff --git a/src/map/quest.c b/src/map/quest.c
index 790e96253..e4216b18e 100644
--- a/src/map/quest.c
+++ b/src/map/quest.c
@@ -59,18 +59,24 @@ struct quest_db *quest_db(int quest_id) {
* @param sd Player's data
* @return 0 in case of success, nonzero otherwise (i.e. the player has no quests)
*/
-int quest_pc_login(TBL_PC *sd) {
+int quest_pc_login(TBL_PC *sd)
+{
+#if PACKETVER < 20141022
int i;
+#endif
if(sd->avail_quests == 0)
return 1;
clif->quest_send_list(sd);
+
+#if PACKETVER < 20141022
clif->quest_send_mission(sd);
for( i = 0; i < sd->avail_quests; i++ ) {
// TODO[Haru]: is this necessary? Does quest_send_mission not take care of this?
clif->quest_update_objective(sd, &sd->quest_log[i]);
}
+#endif
return 0;
}
diff --git a/src/map/script.c b/src/map/script.c
index 006daf7b9..cfc7ed052 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -4627,22 +4627,16 @@ void do_final_script(void) {
aFree(script->buildin);
- if( script->hqs ) {
- for( i = 0; i < script->hqs; i++ ) {
- if( script->hq[i].item != NULL )
- aFree(script->hq[i].item);
- }
+ for (i = 0; i < VECTOR_LENGTH(script->hq); i++) {
+ VECTOR_CLEAR(VECTOR_INDEX(script->hq, i).entries);
}
- if (script->hqis && script->hqi) {
- for( i = 0; i < script->hqis; i++ ) {
- if( script->hqi[i].item != NULL )
- aFree(script->hqi[i].item);
- }
+ VECTOR_CLEAR(script->hq);
+
+ for (i = 0; i < VECTOR_LENGTH(script->hqi); i++) {
+ VECTOR_CLEAR(VECTOR_INDEX(script->hqi, i).entries);
}
- if( script->hq != NULL )
- aFree(script->hq);
- if( script->hqi != NULL )
- aFree(script->hqi);
+ VECTOR_CLEAR(script->hqi);
+
if( script->word_buf != NULL )
aFree(script->word_buf);
@@ -5020,6 +5014,9 @@ void do_init_script(bool minimal) {
ers_chunk_size(script->st_ers, 10);
ers_chunk_size(script->stack_ers, 10);
+ VECTOR_INIT(script->hq);
+ VECTOR_INIT(script->hqi);
+
script->parse_builtin();
script->read_constdb();
script->hardcoded_constants();
@@ -18789,329 +18786,434 @@ BUILDIN(montransform) {
return true;
}
-struct hQueue *script_hqueue_get(int idx) {
- if( idx < 0 || idx >= script->hqs || script->hq[idx].size == -1 )
+/**
+ * Returns the queue with he given index, if it exists.
+ *
+ * @param idx The queue index.
+ *
+ * @return The queue, or NULL if it doesn't exist.
+ */
+struct script_queue *script_hqueue_get(int idx)
+{
+ if (idx < 0 || idx >= VECTOR_LENGTH(script->hq) || !VECTOR_INDEX(script->hq, idx).valid)
return NULL;
- return &script->hq[idx];
+ return &VECTOR_INDEX(script->hq, idx);
}
-int script_hqueue_create(void) {
- int idx = script->hqs;
+
+/**
+ * Creates a new queue.
+ *
+ * @return The index of the created queue.
+ */
+int script_hqueue_create(void)
+{
+ struct script_queue *queue = NULL;
int i;
- for(i = 0; i < script->hqs; i++) {
- if( script->hq[i].size == -1 ) {
- break;
- }
+ ARR_FIND(0, VECTOR_LENGTH(script->hq), i, !VECTOR_INDEX(script->hq, i).valid);
+
+ if (i == VECTOR_LENGTH(script->hq)) {
+ VECTOR_ENSURE(script->hq, 1, 1);
+ VECTOR_PUSHZEROED(script->hq);
}
+ queue = &VECTOR_INDEX(script->hq, i);
- if( i == script->hqs ) {
- RECREATE(script->hq, struct hQueue, ++script->hqs);
- script->hq[ idx ].item = NULL;
- } else
- idx = i;
-
- script->hq[ idx ].id = idx;
- script->hq[ idx ].size = 0;
- script->hq[ idx ].items = 0;
- script->hq[ idx ].onDeath[0] = '\0';
- script->hq[ idx ].onLogOut[0] = '\0';
- script->hq[ idx ].onMapChange[0] = '\0';
- return idx;
-}
-/* set .@id,queue(); */
-/* creates queue, returns created queue id */
-BUILDIN(queue) {
+ memset(&VECTOR_INDEX(script->hq, i), 0, sizeof(VECTOR_INDEX(script->hq, i)));
+
+ queue->id = i;
+ queue->valid = true;
+ return i;
+}
+
+/**
+ * Script command queue: Creates a queue and returns its id.
+ *
+ * @code{.herc}
+ * .@queue_id = queue();
+ * @endcode
+ */
+BUILDIN(queue)
+{
script_pushint(st,script->queue_create());
return true;
}
-/* set .@length,queuesize(.@queue_id); */
-/* returns queue length */
-BUILDIN(queuesize) {
+
+/**
+ * Script command queuesize: Returns the length of the given queue.
+ *
+ * Returns 0 on error.
+ *
+ * \code{.herc}
+ * .@size = queuesize(<queue id>);
+ * \endcode
+ */
+BUILDIN(queuesize)
+{
int idx = script_getnum(st, 2);
- if( idx < 0 || idx >= script->hqs || script->hq[idx].size == -1 ) {
+ if (idx < 0 || idx >= VECTOR_LENGTH(script->hq) || !VECTOR_INDEX(script->hq, idx).valid) {
ShowWarning("buildin_queuesize: unknown queue id %d\n",idx);
script_pushint(st, 0);
- } else {
- script_pushint(st, script->hq[ idx ].items);
+ return true;
}
+ script_pushint(st, VECTOR_LENGTH(VECTOR_INDEX(script->hq, idx).entries));
return true;
}
+
+/**
+ * Adds an entry to the given queue.
+ *
+ * @param idx The queue index.
+ * @param var The entry to add.
+ * @retval false if the queue is invalid or the entry is already in the queue.
+ * @retval true in case of success.
+ */
bool script_hqueue_add(int idx, int var)
{
- if( idx < 0 || idx >= script->hqs || script->hq[idx].size == -1 ) {
- ShowWarning("script_hqueue_add: unknown queue id %d\n",idx);
- return true;
- } else {
- int i;
- for (i = 0; i < script->hq[idx].size; i++) {
- if (script->hq[idx].item[i] == var) {
- return true;
- }
- }
-
- if (i == script->hq[idx].size) {
- struct map_session_data *sd;
-
- for (i = 0; i < script->hq[idx].size; i++) {
- if( script->hq[idx].item[i] == 0 ) {
- break;
- }
- }
+ int i;
+ struct map_session_data *sd = NULL;
+ struct script_queue *queue = NULL;
- if (i == script->hq[idx].size)
- RECREATE(script->hq[idx].item, int, ++script->hq[idx].size);
+ if (idx < 0 || idx >= VECTOR_LENGTH(script->hq) || !VECTOR_INDEX(script->hq, idx).valid) {
+ ShowWarning("script_hqueue_add: unknown queue id %d\n",idx);
+ return false;
+ }
- script->hq[idx].item[i] = var;
- script->hq[idx].items++;
- if (var >= START_ACCOUNT_NUM && (sd = map->id2sd(var)) != NULL) {
- for (i = 0; i < sd->queues_count; i++) {
- if (sd->queues[i] == -1) {
- break;
- }
- }
+ queue = &VECTOR_INDEX(script->hq, idx);
- if (i == sd->queues_count)
- RECREATE(sd->queues, int, ++sd->queues_count);
+ ARR_FIND(0, VECTOR_LENGTH(queue->entries), i, VECTOR_INDEX(queue->entries, i) == var);
+ if (i != VECTOR_LENGTH(queue->entries)) {
+ return false; // Entry already exists
+ }
- sd->queues[i] = idx;
- }
+ VECTOR_ENSURE(queue->entries, 1, 1);
+ VECTOR_PUSH(queue->entries, var);
- }
+ if (var >= START_ACCOUNT_NUM && (sd = map->id2sd(var)) != NULL) {
+ VECTOR_ENSURE(sd->script_queues, 1, 1);
+ VECTOR_PUSH(sd->script_queues, idx);
}
- return false;
+ return true;
}
-/* queueadd(.@queue_id,.@var_id); */
-/* adds a new entry to the queue, returns 1 if already in queue, 0 otherwise */
-BUILDIN(queueadd) {
+
+/**
+ * Script command queueadd: Adds a new entry to the given queue.
+ *
+ * Returns 0 (false) if already in queue or in case of error, 1 (true)
+ * otherwise.
+ *
+ * @code{.herc}
+ * .@size = queuesize(.@queue_id);
+ * @endcode
+ */
+BUILDIN(queueadd)
+{
int idx = script_getnum(st, 2);
int var = script_getnum(st, 3);
- script_pushint(st,script->queue_add(idx,var)?1:0);
+ if (script->queue_add(idx, var))
+ script_pushint(st, 1);
+ else
+ script_pushint(st, 0);
return true;
}
-bool script_hqueue_remove(int idx, int var) {
- if( idx < 0 || idx >= script->hqs || script->hq[idx].size == -1 ) {
- ShowWarning("script_hqueue_remove: unknown queue id %d (used with var %d)\n",idx,var);
- return true;
- } else {
- int i;
- for(i = 0; i < script->hq[idx].size; i++) {
- if( script->hq[idx].item[i] == var ) {
- break;
- }
- }
+/**
+ * Removes an entry from the given queue.
+ *
+ * @param idx The queue index.
+ * @param var The entry to remove.
+ * @retval true if the entry was removed.
+ * @retval false if the entry wasn't in queue.
+ */
+bool script_hqueue_remove(int idx, int var)
+{
+ int i;
+ struct map_session_data *sd = NULL;
+ struct script_queue *queue = NULL;
- if( i != script->hq[idx].size ) {
- struct map_session_data *sd;
+ if (idx < 0 || idx >= VECTOR_LENGTH(script->hq) || !VECTOR_INDEX(script->hq, idx).valid) {
+ ShowWarning("script_hqueue_remove: unknown queue id %d (used with var %d)\n",idx,var);
+ return false;
+ }
- script->hq[idx].item[i] = -1;
- script->hq[idx].items--;
+ queue = &VECTOR_INDEX(script->hq, idx);
- if (var >= START_ACCOUNT_NUM && (sd = map->id2sd(var)) != NULL) {
- for(i = 0; i < sd->queues_count; i++) {
- if( sd->queues[i] == idx ) {
- break;
- }
- }
+ ARR_FIND(0, VECTOR_LENGTH(queue->entries), i, VECTOR_INDEX(queue->entries, i) == var);
+ if (i == VECTOR_LENGTH(queue->entries))
+ return false;
- if( i != sd->queues_count )
- sd->queues[i] = -1;
- }
+ VECTOR_ERASE(queue->entries, i);
- }
+ if (var >= START_ACCOUNT_NUM && (sd = map->id2sd(var)) != NULL) {
+ ARR_FIND(0, VECTOR_LENGTH(sd->script_queues), i, VECTOR_INDEX(sd->script_queues, i) == queue->id);
+
+ if (i != VECTOR_LENGTH(sd->script_queues))
+ VECTOR_ERASE(sd->script_queues, i);
}
- return false;
+ return true;
}
-/* queueremove(.@queue_id,.@var_id); */
-/* removes a entry from the queue, returns 1 if not in queue, 0 otherwise */
-BUILDIN(queueremove) {
+
+/**
+ * Script command queueremove: Removes an entry from a queue.
+ *
+ * Returns 1 (true) on success, 0 (false) if the item wasn't in queue.
+ *
+ * @code{.herc}
+ * queueremove(.@queue_id, .@value);
+ * @endcode
+ */
+BUILDIN(queueremove)
+{
int idx = script_getnum(st, 2);
int var = script_getnum(st, 3);
- script_pushint(st, script->queue_remove(idx,var)?1:0);
+ if (script->queue_remove(idx,var))
+ script_pushint(st, 1);
+ else
+ script_pushint(st, 0);
return true;
}
-/* queueopt(.@queue_id,optionType,<optional val>); */
-/* modifies the queue's options, when val is not provided the option is removed */
-/* when OnMapChange event is triggered, it sets a temp char var @QMapChangeTo$ with the destination map name */
-/* returns 1 when fails, 0 on success */
-BUILDIN(queueopt) {
+/**
+ * Script command queueopt: Modifies the options of a queue.
+ *
+ * When the option value isn't provided, the option is removed.
+ *
+ * Returns 1 (true) on success, 0 (false) on failure.
+ *
+ * The optionType is one of:
+ * - QUEUEOPT_DEATH
+ * - QUEUEOPT_LOGOUT
+ * - QUEUEOPT_MAPCHANGE
+ *
+ * When the QUEUEOPT_MAPCHANGE event is triggered, it sets a temporary
+ * character variable \c @Queue_Destination_Map$ with the destination map name.
+ *
+ * @code{.herc}
+ * queueopt(.@queue_id, optionType, <optional val>);
+ * @endcode
+ */
+BUILDIN(queueopt)
+{
int idx = script_getnum(st, 2);
int var = script_getnum(st, 3);
+ struct script_queue *queue = NULL;
- if( idx < 0 || idx >= script->hqs || script->hq[idx].size == -1 ) {
+ if (idx < 0 || idx >= VECTOR_LENGTH(script->hq) || !VECTOR_INDEX(script->hq, idx).valid) {
ShowWarning("buildin_queueopt: unknown queue id %d\n",idx);
- script_pushint(st, 1);
- } else if( var <= HQO_NONE || var >= HQO_MAX ) {
- ShowWarning("buildin_queueopt: unknown optionType %d\n",var);
- script_pushint(st, 1);
- } else {
- switch( (enum hQueueOpt)var ) {
- case HQO_OnDeath:
- if( script_hasdata(st, 4) )
- safestrncpy(script->hq[idx].onDeath, script_getstr(st, 4), EVENT_NAME_LENGTH);
- else
- script->hq[idx].onDeath[0] = '\0';
- break;
- case HQO_onLogOut:
- if( script_hasdata(st, 4) )
- safestrncpy(script->hq[idx].onLogOut, script_getstr(st, 4), EVENT_NAME_LENGTH);
- else
- script->hq[idx].onLogOut[0] = '\0';
- break;
- case HQO_OnMapChange:
- if( script_hasdata(st, 4) )
- safestrncpy(script->hq[idx].onMapChange, script_getstr(st, 4), EVENT_NAME_LENGTH);
- else
- script->hq[idx].onMapChange[0] = '\0';
- break;
- default:
- ShowWarning("buildin_queueopt: unsupported optionType %d\n",var);
- script_pushint(st, 1);
- break;
- }
+ script_pushint(st, 0);
+ return true;
}
+ queue = &VECTOR_INDEX(script->hq, idx);
+
+ switch (var) {
+ case SQO_ONDEATH:
+ if (script_hasdata(st, 4))
+ safestrncpy(queue->event_death, script_getstr(st, 4), EVENT_NAME_LENGTH);
+ else
+ queue->event_death[0] = '\0';
+ break;
+ case SQO_ONLOGOUT:
+ if (script_hasdata(st, 4))
+ safestrncpy(queue->event_logout, script_getstr(st, 4), EVENT_NAME_LENGTH);
+ else
+ queue->event_logout[0] = '\0';
+ break;
+ case SQO_ONMAPCHANGE:
+ if (script_hasdata(st, 4))
+ safestrncpy(queue->event_mapchange, script_getstr(st, 4), EVENT_NAME_LENGTH);
+ else
+ queue->event_mapchange[0] = '\0';
+ break;
+ default:
+ ShowWarning("buildin_queueopt: unsupported optionType %d\n",var);
+ script_pushint(st, 0);
+ return true;
+ }
+ script_pushint(st, 1);
return true;
}
+
+/**
+ * Deletes a queue.
+ *
+ * @param idx The queue index.
+ *
+ * @retval true if the queue was correctly deleted.
+ * @retval false if the queue didn't exist.
+ */
bool script_hqueue_del(int idx)
{
- if( idx < 0 || idx >= script->hqs || script->hq[idx].size == -1 ) {
- ShowWarning("script_queue_del: unknown queue id %d\n",idx);
- return true;
- } else {
- int i;
- for (i = 0; i < script->hq[idx].size; i++) {
- struct map_session_data *sd;
- if (script->hq[idx].item[i] >= START_ACCOUNT_NUM && (sd = map->id2sd(script->hq[idx].item[i])) != NULL) {
- int j;
- for(j = 0; j < sd->queues_count; j++) {
- if( sd->queues[j] == script->hq[idx].item[i] ) {
- break;
- }
- }
+ if (!script->queue_clear(idx))
+ return false;
- if( j != sd->queues_count )
- sd->queues[j] = -1;
- }
- script->hq[idx].item[i] = 0;
- }
+ VECTOR_INDEX(script->hq, idx).valid = false;
- script->hq[idx].size = -1;
- script->hq[idx].items = 0;
- }
- return false;
+ return true;
}
-/* queuedel(.@queue_id); */
-/* deletes queue of id .@queue_id, returns 1 if id not found, 0 otherwise */
-BUILDIN(queuedel) {
+
+/**
+ * Script command queuedel: Deletes a queue.
+ *
+ * Returns 1 (true) on success, 0 (false) if the queue doesn't exist.
+ *
+ * @code{.herc}
+ * queuedel(.@queue_id);
+ * @endcode
+ */
+BUILDIN(queuedel)
+{
int idx = script_getnum(st, 2);
- script_pushint(st,script->queue_del(idx)?1:0);
+ if (script->queue_del(idx))
+ script_pushint(st, 1);
+ else
+ script_pushint(st, 0);
return true;
}
-void script_hqueue_clear(int idx) {
- if( idx < 0 || idx >= script->hqs || script->hq[idx].size == -1 ) {
+
+/**
+ * Clears a queue.
+ *
+ * @param idx The queue index.
+ *
+ * @retval true if the queue was correctly cleared.
+ * @retval false if the queue didn't exist.
+ */
+bool script_hqueue_clear(int idx)
+{
+ struct script_queue *queue = NULL;
+
+ if (idx < 0 || idx >= VECTOR_LENGTH(script->hq) || !VECTOR_INDEX(script->hq, idx).valid) {
ShowWarning("script_hqueue_clear: unknown queue id %d\n",idx);
- return;
- } else {
- struct map_session_data *sd;
- int i, j;
+ return false;
+ }
- for(i = 0; i < script->hq[idx].size; i++) {
- if( script->hq[idx].item[i] > 0 ) {
+ queue = &VECTOR_INDEX(script->hq, idx);
- if (script->hq[idx].item[i] >= START_ACCOUNT_NUM && (sd = map->id2sd(script->hq[idx].item[i])) != NULL) {
- for(j = 0; j < sd->queues_count; j++) {
- if( sd->queues[j] == idx ) {
- break;
- }
- }
+ while (VECTOR_LENGTH(queue->entries) > 0) {
+ int entry = VECTOR_POP(queue->entries);
+ struct map_session_data *sd = NULL;
- if( j != sd->queues_count )
- sd->queues[j] = -1;
- }
- script->hq[idx].item[i] = 0;
- }
+ if (entry >= START_ACCOUNT_NUM && (sd = map->id2sd(entry)) != NULL) {
+ int i;
+ ARR_FIND(0, VECTOR_LENGTH(sd->script_queues), i, VECTOR_INDEX(sd->script_queues, i) == queue->id);
+
+ if (i != VECTOR_LENGTH(sd->script_queues))
+ VECTOR_ERASE(sd->script_queues, i);
}
- script->hq[idx].items = 0;
}
- return;
+ VECTOR_CLEAR(queue->entries);
+
+ return true;
}
-/* set .@id, queueiterator(.@queue_id); */
-/* creates a new queue iterator, returns its id */
-BUILDIN(queueiterator) {
+
+/**
+ * Script command queueiterator: Creates a new queue iterator.
+ *
+ * Returns the iterator's id or -1 in case of failure.
+ *
+ * @code{.herc}
+ * .@id = queueiterator(.@queue_id);
+ * @endcode
+ */
+BUILDIN(queueiterator)
+{
int qid = script_getnum(st, 2);
- struct hQueue *queue = NULL;
- int idx = script->hqis;
+ struct script_queue *queue = NULL;
+ struct script_queue_iterator *iter = NULL;
int i;
- if( qid < 0 || qid >= script->hqs || script->hq[qid].size == -1 || !(queue = script->queue(qid)) ) {
+ if (qid < 0 || qid >= VECTOR_LENGTH(script->hq) || !VECTOR_INDEX(script->hq, qid).valid || !(queue = script->queue(qid))) {
ShowWarning("queueiterator: invalid queue id %d\n",qid);
+ script_pushint(st, -1);
return true;
}
- /* what if queue->size is 0? (iterating a empty queue?) */
- if( queue->size <= 0 ) {
- ShowWarning("queueiterator: attempting to iterate on on empty queue id %d!\n",qid);
- return true;
- }
+ ARR_FIND(0, VECTOR_LENGTH(script->hqi), i, !VECTOR_INDEX(script->hqi, i).valid);
- for(i = 0; i < script->hqis; i++) {
- if( script->hqi[i].items == -1 ) {
- break;
- }
+ if (i == VECTOR_LENGTH(script->hqi)) {
+ VECTOR_ENSURE(script->hqi, 1, 1);
+ VECTOR_PUSHZEROED(script->hqi);
}
- if( i == script->hqis ) {
- RECREATE(script->hqi, struct hQueueIterator, ++script->hqis);
- script->hqi[ idx ].item = NULL;
- } else
- idx = i;
-
- RECREATE(script->hqi[ idx ].item, int, queue->size);
+ iter = &VECTOR_INDEX(script->hqi, i);
- memcpy(script->hqi[idx].item, queue->item, sizeof(int)*queue->size);
+ VECTOR_ENSURE(iter->entries, VECTOR_LENGTH(queue->entries), 1);
+ VECTOR_PUSHARRAY(iter->entries, VECTOR_DATA(queue->entries), VECTOR_LENGTH(queue->entries));
- script->hqi[ idx ].items = queue->size;
- script->hqi[ idx ].pos = 0;
+ iter->pos = 0;
+ iter->valid = true;
- script_pushint(st,idx);
+ script_pushint(st, i);
return true;
}
-/* Queue Iterator Get Next */
-/* returns next/first member in the iterator, 0 if none */
-BUILDIN(qiget) {
+
+/**
+ * Script command qiget: returns the next/first member in the iterator.
+ *
+ * Returns 0 if there's no next item.
+ *
+ * @code{.herc}
+ * for (.@i = qiget(.@iter); qicheck(.@iter); .@i = qiget(.@iter)) {
+ * // ...
+ * }
+ * @endcode
+ */
+BUILDIN(qiget)
+{
int idx = script_getnum(st, 2);
+ struct script_queue_iterator *it = NULL;
- if( idx < 0 || idx >= script->hqis ) {
+ if (idx < 0 || idx >= VECTOR_LENGTH(script->hqi) || !VECTOR_INDEX(script->hqi, idx).valid) {
ShowWarning("buildin_qiget: unknown queue iterator id %d\n",idx);
script_pushint(st, 0);
- } else if (script->hqi[idx].pos >= script->hqi[idx].items) {
- script_pushint(st, 0);
- } else {
- struct hQueueIterator *it = &script->hqi[idx];
- script_pushint(st, it->item[it->pos++]);
+ return true;
}
+ it = &VECTOR_INDEX(script->hqi, idx);
+
+ if (it->pos >= VECTOR_LENGTH(it->entries)) {
+ if (it->pos == VECTOR_LENGTH(it->entries))
+ ++it->pos; // Move beyond the last position to invalidate qicheck
+ script_pushint(st, 0);
+ return true;
+ }
+ script_pushint(st, VECTOR_INDEX(it->entries, it->pos++));
return true;
}
-/* Queue Iterator Check */
-/* returns 1:0 if there is a next member in the iterator */
-BUILDIN(qicheck) {
+
+/**
+ * Script command qicheck: Checks if the current member in the given iterator (from the last call to qiget) exists.
+ *
+ * Returns 1 if it exists, 0 otherwise.
+ *
+ * @code{.herc}
+ * for (.@i = qiget(.@iter); qicheck(.@iter); .@i = qiget(.@iter)) {
+ * // ...
+ * }
+ * @endcode
+ */
+BUILDIN(qicheck)
+{
int idx = script_getnum(st, 2);
+ struct script_queue_iterator *it = NULL;
- if( idx < 0 || idx >= script->hqis ) {
+ if (idx < 0 || idx >= VECTOR_LENGTH(script->hqi) || !VECTOR_INDEX(script->hqi, idx).valid) {
ShowWarning("buildin_qicheck: unknown queue iterator id %d\n",idx);
script_pushint(st, 0);
- } else if (script->hqi[idx].pos >= script->hqi[idx].items) {
+ return true;
+ }
+
+ it = &VECTOR_INDEX(script->hqi, idx);
+
+ if (it->pos <= 0 || it->pos > VECTOR_LENGTH(it->entries)) {
script_pushint(st, 0);
} else {
script_pushint(st, 1);
@@ -19119,20 +19221,37 @@ BUILDIN(qicheck) {
return true;
}
-/* Queue Iterator Check */
-BUILDIN(qiclear) {
+
+/**
+ * Script command qiclear: Destroys a queue iterator.
+ *
+ * Returns true (1) on success, false (0) on failure.
+ *
+ * @code{.herc}
+ * qiclear(.@iter);
+ * @endcode
+ */
+BUILDIN(qiclear)
+{
int idx = script_getnum(st, 2);
+ struct script_queue_iterator *it = NULL;
- if( idx < 0 || idx >= script->hqis ) {
+ if (idx < 0 || idx >= VECTOR_LENGTH(script->hqi) || !VECTOR_INDEX(script->hqi, idx).valid) {
ShowWarning("buildin_qiclear: unknown queue iterator id %d\n",idx);
- script_pushint(st, 1);
- } else {
- script->hqi[idx].items = -1;
script_pushint(st, 0);
+ return true;
}
+ it = &VECTOR_INDEX(script->hqi, idx);
+
+ VECTOR_CLEAR(it->entries);
+ it->pos = 0;
+ it->valid = false;
+
+ script_pushint(st, 1);
return true;
}
+
/**
* packageitem({<optional container_item_id>})
* when no item id is provided it tries to assume it comes from the current item id being processed (if any)
@@ -19208,7 +19327,7 @@ BUILDIN(bg_join_team) {
sd = script->rid2sd(st);
if( !sd )
- script_pushint(st, 1);
+ script_pushint(st, -1);
else
script_pushint(st,bg->team_join(team_id, sd)?0:1);
@@ -20366,7 +20485,7 @@ void script_parse_builtin(void) {
BUILDIN_DEF(showevent, "i?"),
/**
- * hQueue [Ind/Hercules]
+ * script_queue [Ind/Hercules]
**/
BUILDIN_DEF(queue,""),
BUILDIN_DEF(queuesize,"i"),
@@ -20573,10 +20692,6 @@ void script_defaults(void) {
script->stack_ers = NULL;
script->array_ers = NULL;
- script->hq = NULL;
- script->hqi = NULL;
- script->hqs = script->hqis = 0;
-
script->buildin = NULL;
script->buildin_count = 0;
diff --git a/src/map/script.h b/src/map/script.h
index ff660dec8..b153cf81a 100644
--- a/src/map/script.h
+++ b/src/map/script.h
@@ -223,12 +223,13 @@ typedef enum c_op {
#endif // PCRE_SUPPORT
} c_op;
-enum hQueueOpt {
- HQO_NONE,
- HQO_onLogOut,
- HQO_OnDeath,
- HQO_OnMapChange,
- HQO_MAX,
+/// Script queue options
+enum ScriptQueueOptions {
+ SQO_NONE, ///< No options set
+ SQO_ONLOGOUT, ///< Execute event on logout
+ SQO_ONDEATH, ///< Execute event on death
+ SQO_ONMAPCHANGE, ///< Execute event on map change
+ SQO_MAX,
};
enum e_script_state { RUN,STOP,END,RERUNLINE,GOTO,RETFUNC,CLOSE };
@@ -391,22 +392,27 @@ struct script_stack {
struct reg_db scope; ///< scope variables
};
-/* [Ind/Hercules] */
-struct hQueue {
- int id;
- int *item;
- int items;/* how many actual items are in the array */
- int size;/* size of the *item array, not the current amount of items in it since it can have empty slots */
- /* events */
- char onLogOut[EVENT_NAME_LENGTH];
- char onDeath[EVENT_NAME_LENGTH];
- char onMapChange[EVENT_NAME_LENGTH];
+/**
+ * Data structure to represent a script queue.
+ * @author Ind/Hercules
+ */
+struct script_queue {
+ int id; ///< Queue identifier
+ VECTOR_DECL(int) entries; ///< Items in the queue.
+ bool valid; ///< Whether the queue is valid.
+ /// Events
+ char event_logout[EVENT_NAME_LENGTH]; ///< Logout event
+ char event_death[EVENT_NAME_LENGTH]; ///< Death event
+ char event_mapchange[EVENT_NAME_LENGTH]; ///< Map change event
};
-struct hQueueIterator {
- int *item;
- int items;
- int pos;
+/**
+ * Iterator for a struct script_queue.
+ */
+struct script_queue_iterator {
+ VECTOR_DECL(int) entries; ///< Entries in the queue (iterator's cached copy)
+ bool valid; ///< Whether the queue is valid (initialized - not necessarily having entries available)
+ int pos; ///< Iterator's cursor
};
struct script_state {
@@ -515,9 +521,8 @@ struct script_interface {
struct eri *st_ers;
struct eri *stack_ers;
/* */
- struct hQueue *hq;
- struct hQueueIterator *hqi;
- int hqs, hqis;
+ VECTOR_DECL(struct script_queue) hq;
+ VECTOR_DECL(struct script_queue_iterator) hqi;
/* */
char **buildin;
unsigned int buildin_count;
@@ -667,12 +672,12 @@ struct script_interface {
void (*setd_sub) (struct script_state *st, struct map_session_data *sd, const char *varname, int elem, void *value, struct reg_db *ref);
void (*attach_state) (struct script_state* st);
/* */
- struct hQueue *(*queue) (int idx);
+ struct script_queue *(*queue) (int idx);
bool (*queue_add) (int idx, int var);
bool (*queue_del) (int idx);
bool (*queue_remove) (int idx, int var);
int (*queue_create) (void);
- void (*queue_clear) (int idx);
+ bool (*queue_clear) (int idx);
/* */
const char * (*parse_curly_close) (const char *p);
const char * (*parse_syntax_close) (const char *p);
diff --git a/src/map/skill.c b/src/map/skill.c
index cdf1c031f..8984bf0fa 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -11878,8 +11878,8 @@ int skill_unit_onplace_timer(struct skill_unit *src, struct block_list *bl, int6
//Take into account these hit more times than the timer interval can handle.
do
skill->attack(BF_MAGIC,ss,&src->bl,bl,sg->skill_id,sg->skill_lv,tick+count*sg->interval,0);
- while(--src->val2 && x == bl->x && y == bl->y
- && ++count < SKILLUNITTIMER_INTERVAL/sg->interval && !status->isdead(bl));
+ while (src->alive != 0 && --src->val2 != 0 && x == bl->x && y == bl->y
+ && ++count < SKILLUNITTIMER_INTERVAL/sg->interval && !status->isdead(bl));
if (src->val2<=0)
skill->delunit(src);
@@ -11961,8 +11961,8 @@ int skill_unit_onplace_timer(struct skill_unit *src, struct block_list *bl, int6
sg->limit = DIFF_TICK32(tick,sg->tick);
break;
}
- } while( x == bl->x && y == bl->y && sg->alive_count
- && ++count < SKILLUNITTIMER_INTERVAL/sg->interval && !status->isdead(bl) );
+ } while (src->alive != 0 && x == bl->x && y == bl->y && sg->alive_count != 0
+ && ++count < SKILLUNITTIMER_INTERVAL/sg->interval && !status->isdead(bl));
map->freeblock_unlock();
}
break;
diff --git a/src/map/status.c b/src/map/status.c
index 7a7a4f415..4cd73d3ac 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -823,6 +823,7 @@ void initChangeTables(void) {
status->dbs->IconChangeTable[SC_L_LIFEPOTION] = SI_L_LIFEPOTION;
status->dbs->IconChangeTable[SC_ATKER_BLOOD] = SI_ATKER_BLOOD;
status->dbs->IconChangeTable[SC_TARGET_BLOOD] = SI_TARGET_BLOOD;
+ status->dbs->IconChangeTable[SC_ACARAJE] = SI_ACARAJE;
// Mercenary Bonus Effects
status->dbs->IconChangeTable[SC_MER_FLEE] = SI_MER_FLEE;
status->dbs->IconChangeTable[SC_MER_ATK] = SI_MER_ATK;
@@ -918,6 +919,8 @@ void initChangeTables(void) {
status->dbs->IconChangeTable[SC_SUPER_STAR] = SI_SUPER_STAR;
status->dbs->IconChangeTable[SC_STRANGELIGHTS] = SI_STRANGELIGHTS;
status->dbs->IconChangeTable[SC_DECORATION_OF_MUSIC] = SI_DECORATION_OF_MUSIC;
+ status->dbs->IconChangeTable[SC_LJOSALFAR] = SI_LJOSALFAR;
+ status->dbs->IconChangeTable[SC_MERMAID_LONGING] = SI_MERMAID_LONGING;
//Other SC which are not necessarily associated to skills.
status->dbs->ChangeFlagTable[SC_ATTHASTE_POTION1] = SCB_ASPD;
@@ -1006,12 +1009,13 @@ void initChangeTables(void) {
status->dbs->ChangeFlagTable[SC_MUSTLE_M] |= SCB_MAXHP;
status->dbs->ChangeFlagTable[SC_LIFE_FORCE_F] |= SCB_MAXSP;
status->dbs->ChangeFlagTable[SC_EXTRACT_WHITE_POTION_Z] |= SCB_REGEN;
- status->dbs->ChangeFlagTable[SC_VITATA_500] |= SCB_REGEN;
+ status->dbs->ChangeFlagTable[SC_VITATA_500] |= SCB_REGEN | SCB_MAXSP;
status->dbs->ChangeFlagTable[SC_EXTRACT_SALAMINE_JUICE] |= SCB_ASPD;
status->dbs->ChangeFlagTable[SC_REBOUND] |= SCB_SPEED|SCB_REGEN;
status->dbs->ChangeFlagTable[SC_DEFSET] |= SCB_DEF|SCB_DEF2;
status->dbs->ChangeFlagTable[SC_MDEFSET] |= SCB_MDEF|SCB_MDEF2;
status->dbs->ChangeFlagTable[SC_MYSTERIOUS_POWDER] |= SCB_MAXHP;
+ status->dbs->ChangeFlagTable[SC_ACARAJE] |= SCB_HIT | SCB_ASPD;
status->dbs->ChangeFlagTable[SC_ALL_RIDING] = SCB_SPEED;
status->dbs->ChangeFlagTable[SC_WEDDING] = SCB_SPEED;
@@ -1024,6 +1028,8 @@ void initChangeTables(void) {
status->dbs->ChangeFlagTable[SC_SUPER_STAR] |= SCB_NONE;
status->dbs->ChangeFlagTable[SC_STRANGELIGHTS] |= SCB_NONE;
status->dbs->ChangeFlagTable[SC_DECORATION_OF_MUSIC] |= SCB_NONE;
+ status->dbs->ChangeFlagTable[SC_LJOSALFAR] |= SCB_NONE;
+ status->dbs->ChangeFlagTable[SC_MERMAID_LONGING] |= SCB_NONE;
/* status->dbs->DisplayType Table [Ind/Hercules] */
status->dbs->DisplayType[SC_ALL_RIDING] = true;
@@ -1052,6 +1058,8 @@ void initChangeTables(void) {
status->dbs->DisplayType[SC_SUPER_STAR] = true;
status->dbs->DisplayType[SC_STRANGELIGHTS] = true;
status->dbs->DisplayType[SC_DECORATION_OF_MUSIC] = true;
+ status->dbs->DisplayType[SC_LJOSALFAR] = true;
+ status->dbs->DisplayType[SC_MERMAID_LONGING] = true;
if( !battle_config.display_hallucination ) //Disable Hallucination.
status->dbs->IconChangeTable[SC_ILLUSION] = SI_BLANK;
@@ -3322,8 +3330,8 @@ void status_calc_regen_rate(struct block_list *bl, struct regen_data *regen, str
regen->flag &=~RGN_SP;
if(sc->data[SC_EXTRACT_WHITE_POTION_Z])
regen->rate.hp += regen->rate.hp * sc->data[SC_EXTRACT_WHITE_POTION_Z]->val1/100;
- if(sc->data[SC_VITATA_500])
- regen->rate.sp += regen->rate.sp * sc->data[SC_VITATA_500]->val1/100;
+ if (sc->data[SC_VITATA_500])
+ regen->rate.sp += regen->rate.sp * sc->data[SC_VITATA_500]->val1 / 100;
}
/// Recalculates parts of an object's battle status according to the specified flags.
/// @param flag bitfield of values from enum scb_flag
@@ -4786,7 +4794,9 @@ signed short status_calc_hit(struct block_list *bl, struct status_change *sc, in
hit /= 2;
if(sc->data[SC_ILLUSIONDOPING])
hit -= hit * (5 + sc->data[SC_ILLUSIONDOPING]->val1) / 100; //custom
-
+ if (sc->data[SC_ACARAJE])
+ hit += sc->data[SC_ACARAJE]->val1;
+
return (short)cap_value(hit,1,SHRT_MAX);
}
@@ -5471,6 +5481,8 @@ short status_calc_aspd(struct block_list *bl, struct status_change *sc, short fl
bonus += sc->data[SC_GS_GATLINGFEVER]->val1;
if (sc->data[SC_STAR_COMFORT])
bonus += 3 * sc->data[SC_STAR_COMFORT]->val1;
+ if (sc->data[SC_ACARAJE])
+ bonus += sc->data[SC_ACARAJE]->val2;
}
return (bonus + pots);
@@ -5632,6 +5644,8 @@ short status_calc_aspd_rate(struct block_list *bl, struct status_change *sc, int
aspd_rate += sc->data[SC_PAIN_KILLER]->val2 * 10;
if( sc->data[SC_GOLDENE_FERSE])
aspd_rate -= sc->data[SC_GOLDENE_FERSE]->val3 * 10;
+ if (sc->data[SC_ACARAJE])
+ aspd_rate += sc->data[SC_ACARAJE]->val2 * 10;
return (short)cap_value(aspd_rate,0,SHRT_MAX);
}
@@ -5742,6 +5756,8 @@ unsigned int status_calc_maxsp(struct block_list *bl, struct status_change *sc,
maxsp += maxsp * sc->data[SC_LIFE_FORCE_F]->val1/100;
if(sc->data[SC_EARTH_INSIGNIA] && sc->data[SC_EARTH_INSIGNIA]->val1 == 3)
maxsp += 50;
+ if (sc->data[SC_VITATA_500])
+ maxsp += maxsp * sc->data[SC_VITATA_500]->val2 / 100;
return cap_value(maxsp,1,UINT_MAX);
}
diff --git a/src/map/status.h b/src/map/status.h
index d49bca8b4..7635248d0 100644
--- a/src/map/status.h
+++ b/src/map/status.h
@@ -742,6 +742,11 @@ typedef enum sc_type {
SC_MTF_MSP,
SC_MTF_PUMPKIN,
SC_MTF_HITFLEE,
+
+ SC_LJOSALFAR,
+ SC_MERMAID_LONGING,
+
+ SC_ACARAJE, // 590
SC_MAX, //Automatically updated max, used in for's to check we are within bounds.
} sc_type;
@@ -1490,7 +1495,7 @@ enum si_type {
SI_2013_VALENTINE2 = 732,
SI_2013_VALENTINE3 = 733,
SI_ILLUSIONDOPING = 734,
- //SI_ = 735,
+ //SI_WIDEWEB = 735,
SI_CHILL = 736,
SI_BURNT = 737,
//SI_PCCAFE_PLAY_TIME = 738,
@@ -1536,7 +1541,6 @@ enum si_type {
//SI_ZONGZI_POUCH_TRANS = 777,
SI_HEAT_BARREL_AFTER = 778,
SI_DECORATION_OF_MUSIC = 779,
-
//SI_OVERSEAEXPUP = 780,
//SI_CLOWN_N_GYPSY_CARD = 781,
//SI_OPEN_NPC_MARKET = 782,
@@ -1557,14 +1561,119 @@ enum si_type {
//SI_MTF_CRIDAMAGE2 = 797,
//SI_MTF_SPDRAIN = 798,
//SI_ACUO_MINT_GUM = 799,
- // ...
+
+ //SI_S_HEALPOTION = 800,
+ //SI_REUSE_LIMIT_S_HEAL_POTION = 801,
+ //SI_PLAYTIME_STATISTICS = 802,
+ //SI_GN_CHANGEMATERIAL_OPERATOR = 803,
+ //SI_GN_MIX_COOKING_OPERATOR = 804,
+ //SI_GN_MAKEBOMB_OPERATOR = 805,
+ //SI_GN_S_PHARMACY_OPERATOR = 806,
+ //SI_SO_EL_ANALYSIS_DISASSEMBLY_OPERATOR = 807,
+ //SI_SO_EL_ANALYSIS_COMBINATION_OPERATOR = 808,
+ //SI_NC_MAGICDECOY_OPERATOR = 809,
//SI_GUILD_STORAGE = 810,
- // ...
+ //SI_GC_POISONINGWEAPON_OPERATOR = 811,
+ //SI_WS_WEAPONREFINE_OPERATOR = 812,
+ //SI_BS_REPAIRWEAPON_OPERATOR = 813,
+ //SI_GET_MAILBOX = 814,
//SI_JUMPINGCLAN = 815,
- // ...
+ //SI_JP_OTP = 816,
+ //SI_HANDICAPTOLERANCE_LEVELGAP = 817,
//SI_MTF_RANGEATK2 = 818,
//SI_MTF_ASPD2 = 819,
//SI_MTF_MATK2 = 820,
+ //SI_QSCARABA = 825,
+ SI_LJOSALFAR = 826,
+ //SI_PAD_READER_KNIGHT = 827,
+ //SI_PAD_READER_CRUSADER = 828,
+ //SI_PAD_READER_BLACKSMITH = 829,
+ //SI_PAD_READER_ALCHEMIST = 830,
+ //SI_PAD_READER_ASSASSIN = 831,
+ //SI_PAD_READER_ROGUE = 832,
+ //SI_PAD_READER_WIZARD = 833,
+ //SI_PAD_READER_SAGE = 834,
+ //SI_PAD_READER_PRIEST = 835,
+ //SI_PAD_READER_MONK = 836,
+ //SI_PAD_READER_HUNTER = 837,
+ //SI_PAD_READER_BARD = 838,
+ //SI_PAD_READER_DANCER = 839,
+ //SI_PAD_READER_TAEKWON = 840,
+ //SI_PAD_READER_NINJA = 841,
+ //SI_PAD_READER_GUNSLINGER = 842,
+ //SI_PAD_READER_SUPERNOVICE = 843,
+ //SI_ESSENCE_OF_TIME = 844,
+ //SI_MTF_MARIONETTE = 860,
+ //SI_MTF_LUDE = 861,
+ //SI_MTF_CRUISER = 862,
+ SI_MERMAID_LONGING = 863,
+ //SI_DRACULA_CARD = 865,
+ //SI_LIMIT_POWER_BOOSTER = 867,
+ //SI_TIME_ACCESSORY = 872,
+ //SI_EP16_DEF = 873,
+ //SI_NORMAL_ATKED_SP = 874,
+ //SI_BODYSTATE_STONECURSE = 875,
+ //SI_BODYSTATE_FREEZING = 876,
+ //SI_BODYSTATE_STUN = 877,
+ //SI_BODYSTATE_SLEEP = 878,
+ //SI_BODYSTATE_UNDEAD = 879,
+ //SI_BODYSTATE_STONECURSE_ING = 880,
+ //SI_BODYSTATE_BURNNING = 881,
+ //SI_BODYSTATE_IMPRISON = 882,
+ //SI_HEALTHSTATE_POISON = 883,
+ //SI_HEALTHSTATE_CURSE = 884,
+ //SI_HEALTHSTATE_SILENCE = 885,
+ //SI_HEALTHSTATE_CONFUSION = 886,
+ //SI_HEALTHSTATE_BLIND = 887,
+ //SI_HEALTHSTATE_ANGELUS = 888,
+ //SI_HEALTHSTATE_BLOODING = 889,
+ //SI_HEALTHSTATE_HEAVYPOISON = 890,
+ //SI_HEALTHSTATE_FEAR = 891,
+ //SI_CHERRY_BLOSSOM_CAKE = 892,
+ //SI_SU_STOOP = 893,
+ //SI_CATNIPPOWDER = 894,
+ //SI_ATTACK_PROPERTY_NOTHING = 897,
+ //SI_ATTACK_PROPERTY_WATER = 898,
+ //SI_ATTACK_PROPERTY_GROUND = 899,
+
+ //SI_ATTACK_PROPERTY_FIRE = 900,
+ //SI_ATTACK_PROPERTY_WIND = 901,
+ //SI_ATTACK_PROPERTY_POISON = 902,
+ //SI_ATTACK_PROPERTY_SAINT = 903,
+ //SI_ATTACK_PROPERTY_DARKNESS = 904,
+ //SI_ATTACK_PROPERTY_TELEKINESIS = 905,
+ //SI_ATTACK_PROPERTY_UNDEAD = 906,
+ //SI_RESIST_PROPERTY_NOTHING = 907,
+ //SI_RESIST_PROPERTY_WATER = 908,
+ //SI_RESIST_PROPERTY_GROUND = 909,
+ //SI_RESIST_PROPERTY_FIRE = 910,
+ //SI_RESIST_PROPERTY_WIND = 911,
+ //SI_RESIST_PROPERTY_POISON = 912,
+ //SI_RESIST_PROPERTY_SAINT = 913,
+ //SI_RESIST_PROPERTY_DARKNESS = 914,
+ //SI_RESIST_PROPERTY_TELEKINESIS = 915,
+ //SI_RESIST_PROPERTY_UNDEAD = 916,
+ //SI_PERIOD_RECEIVEITEM = 922,
+ //SI_PERIOD_PLUSEXP = 923,
+ //SI_PERIOD_PLUSJOBEXP = 924,
+ //SI_RUNEHELM = 925,
+ //SI_HELM_VERKANA = 926,
+ //SI_HELM_RHYDO = 927,
+ //SI_HELM_TURISUS = 928,
+ //SI_HELM_HAGALAS = 929,
+ //SI_HELM_ISIA = 930,
+ //SI_HELM_ASIR = 931,
+ //SI_HELM_URJ = 932,
+ //SI_SV_ROOTTWIST = 896,
+ //SI_BITESCAR = 917,
+ //SI_ARCLOUSEDASH = 918,
+ //SI_TUNAPARTY = 919,
+ //SI_SHRIMP = 920,
+ //SI_FRESHSHRIMP = 921,
+ //SI_SUHIDE = 933,
+ //SI_SPRITEMABLE = 937,
+ //SI_DORAM_BUF_01 = 935,
+ //SI_DORAM_BUF_02 = 936,
SI_MAX,
};
diff --git a/src/map/unit.c b/src/map/unit.c
index 7c253c5c2..3046db9e1 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -2645,10 +2645,7 @@ int unit_free(struct block_list *bl, clr_type clrtype) {
aFree(sd->instance);
sd->instance = NULL;
}
- if( sd->queues != NULL ) {
- aFree(sd->queues);
- sd->queues = NULL;
- }
+ VECTOR_CLEAR(sd->script_queues);
if( sd->quest_log != NULL ) {
aFree(sd->quest_log);
sd->quest_log = NULL;
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
index 258fc0512..c74cc8b7f 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
@@ -3593,6 +3593,10 @@ struct {
struct HPMHookPoint *HP_npc_addsrcfile_post;
struct HPMHookPoint *HP_npc_delsrcfile_pre;
struct HPMHookPoint *HP_npc_delsrcfile_post;
+ struct HPMHookPoint *HP_npc_retainpathreference_pre;
+ struct HPMHookPoint *HP_npc_retainpathreference_post;
+ struct HPMHookPoint *HP_npc_releasepathreference_pre;
+ struct HPMHookPoint *HP_npc_releasepathreference_post;
struct HPMHookPoint *HP_npc_parsename_pre;
struct HPMHookPoint *HP_npc_parsename_post;
struct HPMHookPoint *HP_npc_parseview_pre;
@@ -3615,6 +3619,16 @@ struct {
struct HPMHookPoint *HP_npc_skip_script_post;
struct HPMHookPoint *HP_npc_parse_script_pre;
struct HPMHookPoint *HP_npc_parse_script_post;
+ struct HPMHookPoint *HP_npc_add_to_location_pre;
+ struct HPMHookPoint *HP_npc_add_to_location_post;
+ struct HPMHookPoint *HP_npc_duplicate_script_sub_pre;
+ struct HPMHookPoint *HP_npc_duplicate_script_sub_post;
+ struct HPMHookPoint *HP_npc_duplicate_shop_sub_pre;
+ struct HPMHookPoint *HP_npc_duplicate_shop_sub_post;
+ struct HPMHookPoint *HP_npc_duplicate_warp_sub_pre;
+ struct HPMHookPoint *HP_npc_duplicate_warp_sub_post;
+ struct HPMHookPoint *HP_npc_duplicate_sub_pre;
+ struct HPMHookPoint *HP_npc_duplicate_sub_post;
struct HPMHookPoint *HP_npc_parse_duplicate_pre;
struct HPMHookPoint *HP_npc_parse_duplicate_post;
struct HPMHookPoint *HP_npc_duplicate4instance_pre;
@@ -9358,6 +9372,10 @@ struct {
int HP_npc_addsrcfile_post;
int HP_npc_delsrcfile_pre;
int HP_npc_delsrcfile_post;
+ int HP_npc_retainpathreference_pre;
+ int HP_npc_retainpathreference_post;
+ int HP_npc_releasepathreference_pre;
+ int HP_npc_releasepathreference_post;
int HP_npc_parsename_pre;
int HP_npc_parsename_post;
int HP_npc_parseview_pre;
@@ -9380,6 +9398,16 @@ struct {
int HP_npc_skip_script_post;
int HP_npc_parse_script_pre;
int HP_npc_parse_script_post;
+ int HP_npc_add_to_location_pre;
+ int HP_npc_add_to_location_post;
+ int HP_npc_duplicate_script_sub_pre;
+ int HP_npc_duplicate_script_sub_post;
+ int HP_npc_duplicate_shop_sub_pre;
+ int HP_npc_duplicate_shop_sub_post;
+ int HP_npc_duplicate_warp_sub_pre;
+ int HP_npc_duplicate_warp_sub_post;
+ int HP_npc_duplicate_sub_pre;
+ int HP_npc_duplicate_sub_post;
int HP_npc_parse_duplicate_pre;
int HP_npc_parse_duplicate_post;
int HP_npc_duplicate4instance_pre;
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
index f793c9505..a3f7f6b3e 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
@@ -1832,6 +1832,8 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(npc->clearsrcfile, HP_npc_clearsrcfile) },
{ HP_POP(npc->addsrcfile, HP_npc_addsrcfile) },
{ HP_POP(npc->delsrcfile, HP_npc_delsrcfile) },
+ { HP_POP(npc->retainpathreference, HP_npc_retainpathreference) },
+ { HP_POP(npc->releasepathreference, HP_npc_releasepathreference) },
{ HP_POP(npc->parsename, HP_npc_parsename) },
{ HP_POP(npc->parseview, HP_npc_parseview) },
{ HP_POP(npc->viewisid, HP_npc_viewisid) },
@@ -1843,6 +1845,11 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(npc->convertlabel_db, HP_npc_convertlabel_db) },
{ HP_POP(npc->skip_script, HP_npc_skip_script) },
{ HP_POP(npc->parse_script, HP_npc_parse_script) },
+ { HP_POP(npc->add_to_location, HP_npc_add_to_location) },
+ { HP_POP(npc->duplicate_script_sub, HP_npc_duplicate_script_sub) },
+ { HP_POP(npc->duplicate_shop_sub, HP_npc_duplicate_shop_sub) },
+ { HP_POP(npc->duplicate_warp_sub, HP_npc_duplicate_warp_sub) },
+ { HP_POP(npc->duplicate_sub, HP_npc_duplicate_sub) },
{ HP_POP(npc->parse_duplicate, HP_npc_parse_duplicate) },
{ HP_POP(npc->duplicate4instance, HP_npc_duplicate4instance) },
{ HP_POP(npc->setcells, HP_npc_setcells) },
diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
index b0bc853b3..fafa4d748 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
@@ -48031,6 +48031,59 @@ void HP_npc_delsrcfile(const char *name) {
}
return;
}
+const char* HP_npc_retainpathreference(const char *filepath) {
+ int hIndex = 0;
+ const char* retVal___ = NULL;
+ if( HPMHooks.count.HP_npc_retainpathreference_pre ) {
+ const char* (*preHookFunc) (const char *filepath);
+ *HPMforce_return = false;
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_retainpathreference_pre; hIndex++ ) {
+ preHookFunc = HPMHooks.list.HP_npc_retainpathreference_pre[hIndex].func;
+ retVal___ = preHookFunc(filepath);
+ }
+ if( *HPMforce_return ) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.npc.retainpathreference(filepath);
+ }
+ if( HPMHooks.count.HP_npc_retainpathreference_post ) {
+ const char* (*postHookFunc) (const char* retVal___, const char *filepath);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_retainpathreference_post; hIndex++ ) {
+ postHookFunc = HPMHooks.list.HP_npc_retainpathreference_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, filepath);
+ }
+ }
+ return retVal___;
+}
+void HP_npc_releasepathreference(const char *filepath) {
+ int hIndex = 0;
+ if( HPMHooks.count.HP_npc_releasepathreference_pre ) {
+ void (*preHookFunc) (const char *filepath);
+ *HPMforce_return = false;
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_releasepathreference_pre; hIndex++ ) {
+ preHookFunc = HPMHooks.list.HP_npc_releasepathreference_pre[hIndex].func;
+ preHookFunc(filepath);
+ }
+ if( *HPMforce_return ) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.npc.releasepathreference(filepath);
+ }
+ if( HPMHooks.count.HP_npc_releasepathreference_post ) {
+ void (*postHookFunc) (const char *filepath);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_releasepathreference_post; hIndex++ ) {
+ postHookFunc = HPMHooks.list.HP_npc_releasepathreference_post[hIndex].func;
+ postHookFunc(filepath);
+ }
+ }
+ return;
+}
void HP_npc_parsename(struct npc_data *nd, const char *name, const char *start, const char *buffer, const char *filepath) {
int hIndex = 0;
if( HPMHooks.count.HP_npc_parsename_pre ) {
@@ -48111,15 +48164,15 @@ bool HP_npc_viewisid(const char *viewid) {
}
return retVal___;
}
-struct npc_data* HP_npc_create_npc(int m, int x, int y) {
+struct npc_data* HP_npc_create_npc(enum npc_subtype subtype, int m, int x, int y, uint8 dir, int16 class_) {
int hIndex = 0;
struct npc_data* retVal___ = NULL;
if( HPMHooks.count.HP_npc_create_npc_pre ) {
- struct npc_data* (*preHookFunc) (int *m, int *x, int *y);
+ struct npc_data* (*preHookFunc) (enum npc_subtype *subtype, int *m, int *x, int *y, uint8 *dir, int16 *class_);
*HPMforce_return = false;
for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_create_npc_pre; hIndex++ ) {
preHookFunc = HPMHooks.list.HP_npc_create_npc_pre[hIndex].func;
- retVal___ = preHookFunc(&m, &x, &y);
+ retVal___ = preHookFunc(&subtype, &m, &x, &y, &dir, &class_);
}
if( *HPMforce_return ) {
*HPMforce_return = false;
@@ -48127,13 +48180,13 @@ struct npc_data* HP_npc_create_npc(int m, int x, int y) {
}
}
{
- retVal___ = HPMHooks.source.npc.create_npc(m, x, y);
+ retVal___ = HPMHooks.source.npc.create_npc(subtype, m, x, y, dir, class_);
}
if( HPMHooks.count.HP_npc_create_npc_post ) {
- struct npc_data* (*postHookFunc) (struct npc_data* retVal___, int *m, int *x, int *y);
+ struct npc_data* (*postHookFunc) (struct npc_data* retVal___, enum npc_subtype *subtype, int *m, int *x, int *y, uint8 *dir, int16 *class_);
for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_create_npc_post; hIndex++ ) {
postHookFunc = HPMHooks.list.HP_npc_create_npc_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &m, &x, &y);
+ retVal___ = postHookFunc(retVal___, &subtype, &m, &x, &y, &dir, &class_);
}
}
return retVal___;
@@ -48326,6 +48379,140 @@ const char* HP_npc_parse_script(char *w1, char *w2, char *w3, char *w4, const ch
}
return retVal___;
}
+void HP_npc_add_to_location(struct npc_data *nd) {
+ int hIndex = 0;
+ if( HPMHooks.count.HP_npc_add_to_location_pre ) {
+ void (*preHookFunc) (struct npc_data *nd);
+ *HPMforce_return = false;
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_add_to_location_pre; hIndex++ ) {
+ preHookFunc = HPMHooks.list.HP_npc_add_to_location_pre[hIndex].func;
+ preHookFunc(nd);
+ }
+ if( *HPMforce_return ) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.npc.add_to_location(nd);
+ }
+ if( HPMHooks.count.HP_npc_add_to_location_post ) {
+ void (*postHookFunc) (struct npc_data *nd);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_add_to_location_post; hIndex++ ) {
+ postHookFunc = HPMHooks.list.HP_npc_add_to_location_post[hIndex].func;
+ postHookFunc(nd);
+ }
+ }
+ return;
+}
+bool HP_npc_duplicate_script_sub(struct npc_data *nd, const struct npc_data *snd, int xs, int ys, int options) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if( HPMHooks.count.HP_npc_duplicate_script_sub_pre ) {
+ bool (*preHookFunc) (struct npc_data *nd, const struct npc_data *snd, int *xs, int *ys, int *options);
+ *HPMforce_return = false;
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_duplicate_script_sub_pre; hIndex++ ) {
+ preHookFunc = HPMHooks.list.HP_npc_duplicate_script_sub_pre[hIndex].func;
+ retVal___ = preHookFunc(nd, snd, &xs, &ys, &options);
+ }
+ if( *HPMforce_return ) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.npc.duplicate_script_sub(nd, snd, xs, ys, options);
+ }
+ if( HPMHooks.count.HP_npc_duplicate_script_sub_post ) {
+ bool (*postHookFunc) (bool retVal___, struct npc_data *nd, const struct npc_data *snd, int *xs, int *ys, int *options);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_duplicate_script_sub_post; hIndex++ ) {
+ postHookFunc = HPMHooks.list.HP_npc_duplicate_script_sub_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, nd, snd, &xs, &ys, &options);
+ }
+ }
+ return retVal___;
+}
+bool HP_npc_duplicate_shop_sub(struct npc_data *nd, const struct npc_data *snd, int xs, int ys, int options) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if( HPMHooks.count.HP_npc_duplicate_shop_sub_pre ) {
+ bool (*preHookFunc) (struct npc_data *nd, const struct npc_data *snd, int *xs, int *ys, int *options);
+ *HPMforce_return = false;
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_duplicate_shop_sub_pre; hIndex++ ) {
+ preHookFunc = HPMHooks.list.HP_npc_duplicate_shop_sub_pre[hIndex].func;
+ retVal___ = preHookFunc(nd, snd, &xs, &ys, &options);
+ }
+ if( *HPMforce_return ) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.npc.duplicate_shop_sub(nd, snd, xs, ys, options);
+ }
+ if( HPMHooks.count.HP_npc_duplicate_shop_sub_post ) {
+ bool (*postHookFunc) (bool retVal___, struct npc_data *nd, const struct npc_data *snd, int *xs, int *ys, int *options);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_duplicate_shop_sub_post; hIndex++ ) {
+ postHookFunc = HPMHooks.list.HP_npc_duplicate_shop_sub_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, nd, snd, &xs, &ys, &options);
+ }
+ }
+ return retVal___;
+}
+bool HP_npc_duplicate_warp_sub(struct npc_data *nd, const struct npc_data *snd, int xs, int ys, int options) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if( HPMHooks.count.HP_npc_duplicate_warp_sub_pre ) {
+ bool (*preHookFunc) (struct npc_data *nd, const struct npc_data *snd, int *xs, int *ys, int *options);
+ *HPMforce_return = false;
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_duplicate_warp_sub_pre; hIndex++ ) {
+ preHookFunc = HPMHooks.list.HP_npc_duplicate_warp_sub_pre[hIndex].func;
+ retVal___ = preHookFunc(nd, snd, &xs, &ys, &options);
+ }
+ if( *HPMforce_return ) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.npc.duplicate_warp_sub(nd, snd, xs, ys, options);
+ }
+ if( HPMHooks.count.HP_npc_duplicate_warp_sub_post ) {
+ bool (*postHookFunc) (bool retVal___, struct npc_data *nd, const struct npc_data *snd, int *xs, int *ys, int *options);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_duplicate_warp_sub_post; hIndex++ ) {
+ postHookFunc = HPMHooks.list.HP_npc_duplicate_warp_sub_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, nd, snd, &xs, &ys, &options);
+ }
+ }
+ return retVal___;
+}
+bool HP_npc_duplicate_sub(struct npc_data *nd, const struct npc_data *snd, int xs, int ys, int options) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if( HPMHooks.count.HP_npc_duplicate_sub_pre ) {
+ bool (*preHookFunc) (struct npc_data *nd, const struct npc_data *snd, int *xs, int *ys, int *options);
+ *HPMforce_return = false;
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_duplicate_sub_pre; hIndex++ ) {
+ preHookFunc = HPMHooks.list.HP_npc_duplicate_sub_pre[hIndex].func;
+ retVal___ = preHookFunc(nd, snd, &xs, &ys, &options);
+ }
+ if( *HPMforce_return ) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.npc.duplicate_sub(nd, snd, xs, ys, options);
+ }
+ if( HPMHooks.count.HP_npc_duplicate_sub_post ) {
+ bool (*postHookFunc) (bool retVal___, struct npc_data *nd, const struct npc_data *snd, int *xs, int *ys, int *options);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_duplicate_sub_post; hIndex++ ) {
+ postHookFunc = HPMHooks.list.HP_npc_duplicate_sub_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, nd, snd, &xs, &ys, &options);
+ }
+ }
+ return retVal___;
+}
const char* HP_npc_parse_duplicate(char *w1, char *w2, char *w3, char *w4, const char *start, const char *buffer, const char *filepath, int options, int *retval) {
int hIndex = 0;
const char* retVal___ = NULL;
@@ -59762,11 +59949,11 @@ void HP_script_attach_state(struct script_state *st) {
}
return;
}
-struct hQueue* HP_script_queue(int idx) {
+struct script_queue* HP_script_queue(int idx) {
int hIndex = 0;
- struct hQueue* retVal___ = NULL;
+ struct script_queue* retVal___ = NULL;
if( HPMHooks.count.HP_script_queue_pre ) {
- struct hQueue* (*preHookFunc) (int *idx);
+ struct script_queue* (*preHookFunc) (int *idx);
*HPMforce_return = false;
for(hIndex = 0; hIndex < HPMHooks.count.HP_script_queue_pre; hIndex++ ) {
preHookFunc = HPMHooks.list.HP_script_queue_pre[hIndex].func;
@@ -59781,7 +59968,7 @@ struct hQueue* HP_script_queue(int idx) {
retVal___ = HPMHooks.source.script.queue(idx);
}
if( HPMHooks.count.HP_script_queue_post ) {
- struct hQueue* (*postHookFunc) (struct hQueue* retVal___, int *idx);
+ struct script_queue* (*postHookFunc) (struct script_queue* retVal___, int *idx);
for(hIndex = 0; hIndex < HPMHooks.count.HP_script_queue_post; hIndex++ ) {
postHookFunc = HPMHooks.list.HP_script_queue_post[hIndex].func;
retVal___ = postHookFunc(retVal___, &idx);
@@ -59897,31 +60084,32 @@ int HP_script_queue_create(void) {
}
return retVal___;
}
-void HP_script_queue_clear(int idx) {
+bool HP_script_queue_clear(int idx) {
int hIndex = 0;
+ bool retVal___ = false;
if( HPMHooks.count.HP_script_queue_clear_pre ) {
- void (*preHookFunc) (int *idx);
+ bool (*preHookFunc) (int *idx);
*HPMforce_return = false;
for(hIndex = 0; hIndex < HPMHooks.count.HP_script_queue_clear_pre; hIndex++ ) {
preHookFunc = HPMHooks.list.HP_script_queue_clear_pre[hIndex].func;
- preHookFunc(&idx);
+ retVal___ = preHookFunc(&idx);
}
if( *HPMforce_return ) {
*HPMforce_return = false;
- return;
+ return retVal___;
}
}
{
- HPMHooks.source.script.queue_clear(idx);
+ retVal___ = HPMHooks.source.script.queue_clear(idx);
}
if( HPMHooks.count.HP_script_queue_clear_post ) {
- void (*postHookFunc) (int *idx);
+ bool (*postHookFunc) (bool retVal___, int *idx);
for(hIndex = 0; hIndex < HPMHooks.count.HP_script_queue_clear_post; hIndex++ ) {
postHookFunc = HPMHooks.list.HP_script_queue_clear_post[hIndex].func;
- postHookFunc(&idx);
+ retVal___ = postHookFunc(retVal___, &idx);
}
}
- return;
+ return retVal___;
}
const char* HP_script_parse_curly_close(const char *p) {
int hIndex = 0;
diff --git a/tools/HPMHookGen/doxygen.conf b/tools/HPMHookGen/doxygen.conf
index 380a3d8de..ec55967b1 100644
--- a/tools/HPMHookGen/doxygen.conf
+++ b/tools/HPMHookGen/doxygen.conf
@@ -265,7 +265,8 @@ ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
-INCLUDE_PATH = ../../src
+INCLUDE_PATH = ../../src \
+ ../../3rdparty
INCLUDE_FILE_PATTERNS =
PREDEFINED = __attribute__(x)= \
HPMHOOKGEN