diff options
32 files changed, 645 insertions, 274 deletions
diff --git a/3rdparty/libconfig/extra/gen/scanner.l b/3rdparty/libconfig/extra/gen/scanner.l index bdc57a8d4..4b3048fab 100644 --- a/3rdparty/libconfig/extra/gen/scanner.l +++ b/3rdparty/libconfig/extra/gen/scanner.l @@ -100,7 +100,7 @@ float ([-+]?([0-9]*)?\.[0-9]*([eE][-+]?[0-9]+)?)|([-+]?([0-9]+)(\.[0 comment (#|\/\/).*$ include_open ^[ \t]*@include[ \t]+\" -%x COMMENT STRING INCLUDE +%x COMMENT STRING INCLUDE SCRIPTBLOCK %% @@ -129,6 +129,14 @@ include_open ^[ \t]*@include[ \t]+\" return(TOK_STRING); } +\<\" { BEGIN SCRIPTBLOCK; } +<SCRIPTBLOCK>([^\"]|\"[^\>])+ { scanctx_append_string(yyextra, yytext); } +<SCRIPTBLOCK>\"\> { + yylval->sval = scanctx_take_string(yyextra); + BEGIN INITIAL; + return(TOK_STRING); + } + {include_open} { BEGIN INCLUDE; } <INCLUDE>[^\"\\]+ { scanctx_append_string(yyextra, yytext); } <INCLUDE>\\\\ { scanctx_append_string(yyextra, "\\"); } diff --git a/3rdparty/libconfig/scanner.c b/3rdparty/libconfig/scanner.c index 55e029f9f..6de72c2fd 100644 --- a/3rdparty/libconfig/scanner.c +++ b/3rdparty/libconfig/scanner.c @@ -365,8 +365,8 @@ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); *yy_cp = '\0'; \ yyg->yy_c_buf_p = yy_cp; -#define YY_NUM_RULES 42 -#define YY_END_OF_BUFFER 43 +#define YY_NUM_RULES 45 +#define YY_END_OF_BUFFER 46 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -374,20 +374,21 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[103] = +static yyconst flex_int16_t yy_accept[112] = { 0, - 0, 0, 0, 0, 0, 0, 0, 0, 43, 41, - 22, 21, 21, 5, 41, 37, 38, 29, 41, 24, - 30, 41, 31, 31, 23, 39, 29, 29, 35, 36, - 25, 26, 22, 41, 3, 4, 3, 6, 15, 14, - 17, 20, 42, 22, 0, 40, 29, 30, 31, 30, - 0, 1, 0, 30, 0, 32, 0, 29, 29, 22, - 0, 0, 2, 6, 12, 0, 11, 10, 7, 8, - 9, 17, 19, 18, 0, 30, 30, 0, 0, 30, - 32, 33, 29, 29, 0, 0, 0, 30, 34, 29, - 27, 0, 13, 34, 28, 0, 0, 0, 0, 0, - - 16, 0 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 46, 44, 25, 24, 24, 5, 44, 40, 41, 32, + 44, 27, 33, 44, 34, 34, 26, 42, 44, 32, + 32, 38, 39, 28, 29, 25, 44, 3, 4, 3, + 6, 15, 14, 20, 23, 45, 17, 45, 25, 0, + 43, 32, 33, 34, 33, 0, 1, 0, 33, 0, + 35, 0, 16, 32, 32, 25, 0, 0, 2, 6, + 12, 0, 11, 10, 7, 8, 9, 20, 22, 21, + 17, 0, 18, 0, 33, 33, 0, 0, 33, 35, + 36, 32, 32, 0, 0, 0, 33, 37, 32, 30, + + 0, 13, 37, 31, 0, 0, 0, 0, 0, 19, + 0 } ; static yyconst flex_int32_t yy_ec[256] = @@ -397,15 +398,15 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 6, 7, 1, 1, 1, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 18, - 18, 18, 18, 18, 18, 18, 18, 19, 20, 1, - 21, 1, 1, 22, 23, 24, 24, 24, 25, 26, - 27, 27, 27, 27, 27, 28, 27, 27, 27, 27, - 27, 29, 30, 31, 32, 27, 27, 33, 27, 27, - 34, 35, 36, 1, 8, 1, 23, 24, 37, 38, - - 39, 40, 27, 27, 41, 27, 27, 42, 27, 43, - 27, 27, 27, 44, 30, 45, 46, 27, 27, 33, - 27, 27, 47, 1, 48, 1, 1, 1, 1, 1, + 18, 18, 18, 18, 18, 18, 18, 19, 20, 21, + 22, 23, 1, 24, 25, 26, 26, 26, 27, 28, + 29, 29, 29, 29, 29, 30, 29, 29, 29, 29, + 29, 31, 32, 33, 34, 29, 29, 35, 29, 29, + 36, 37, 38, 1, 8, 1, 25, 26, 39, 40, + + 41, 42, 29, 29, 43, 29, 29, 44, 29, 45, + 29, 29, 29, 46, 32, 47, 48, 29, 29, 35, + 29, 29, 49, 1, 50, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -422,119 +423,125 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[49] = +static yyconst flex_int32_t yy_meta[51] = { 0, 1, 1, 1, 1, 1, 2, 1, 3, 1, 1, 3, 1, 1, 3, 1, 1, 4, 4, 1, 1, - 1, 1, 4, 4, 4, 4, 3, 3, 3, 3, - 3, 3, 3, 1, 2, 1, 4, 4, 4, 4, - 3, 3, 3, 3, 3, 3, 1, 1 + 1, 1, 1, 1, 4, 4, 4, 4, 3, 3, + 3, 3, 3, 3, 3, 1, 2, 1, 4, 4, + 4, 4, 3, 3, 3, 3, 3, 3, 1, 1 } ; -static yyconst flex_int16_t yy_base[113] = +static yyconst flex_int16_t yy_base[124] = { 0, - 0, 47, 47, 48, 46, 47, 48, 49, 203, 204, - 200, 204, 204, 204, 198, 204, 204, 0, 45, 204, - 39, 50, 62, 71, 204, 204, 177, 41, 204, 204, - 204, 204, 69, 158, 204, 204, 182, 0, 204, 69, - 0, 204, 59, 195, 193, 204, 0, 80, 100, 104, - 118, 204, 192, 106, 130, 166, 0, 64, 61, 98, - 152, 149, 204, 0, 204, 0, 204, 204, 204, 204, - 204, 0, 204, 204, 50, 55, 116, 139, 109, 120, - 204, 161, 155, 115, 127, 0, 132, 141, 135, 121, - 0, 120, 204, 204, 0, 106, 78, 72, 106, 159, - - 204, 204, 165, 169, 173, 177, 179, 183, 187, 99, - 72, 70 + 0, 49, 49, 50, 48, 49, 50, 51, 214, 213, + 218, 221, 215, 221, 221, 221, 213, 221, 221, 0, + 47, 221, 41, 55, 62, 66, 221, 221, 209, 189, + 32, 221, 221, 221, 221, 67, 170, 221, 221, 196, + 0, 221, 64, 0, 221, 61, 205, 187, 207, 205, + 221, 0, 77, 97, 99, 111, 221, 204, 103, 119, + 170, 0, 221, 46, 71, 98, 153, 126, 221, 0, + 221, 0, 221, 221, 221, 221, 221, 0, 221, 221, + 164, 146, 221, 57, 117, 124, 131, 129, 135, 221, + 138, 135, 123, 127, 0, 137, 139, 132, 131, 0, + + 117, 221, 221, 0, 112, 99, 91, 111, 157, 221, + 221, 172, 176, 180, 184, 188, 190, 194, 198, 202, + 104, 98, 68 } ; -static yyconst flex_int16_t yy_def[113] = +static yyconst flex_int16_t yy_def[124] = { 0, - 102, 1, 103, 103, 104, 104, 105, 105, 102, 102, - 102, 102, 102, 102, 106, 102, 102, 107, 102, 102, - 102, 102, 102, 102, 102, 102, 107, 107, 102, 102, - 102, 102, 102, 102, 102, 102, 102, 108, 102, 102, - 109, 102, 102, 102, 106, 102, 107, 102, 102, 102, - 102, 102, 106, 102, 102, 102, 110, 107, 107, 102, - 102, 102, 102, 108, 102, 111, 102, 102, 102, 102, - 102, 109, 102, 102, 102, 102, 102, 102, 102, 102, - 102, 110, 107, 107, 102, 112, 102, 102, 102, 107, - 107, 102, 102, 102, 107, 102, 102, 102, 102, 102, - - 102, 0, 102, 102, 102, 102, 102, 102, 102, 102, - 102, 102 + 111, 1, 112, 112, 113, 113, 114, 114, 115, 115, + 111, 111, 111, 111, 111, 111, 116, 111, 111, 117, + 111, 111, 111, 111, 111, 111, 111, 111, 111, 117, + 117, 111, 111, 111, 111, 111, 111, 111, 111, 111, + 118, 111, 111, 119, 111, 111, 120, 120, 111, 116, + 111, 117, 111, 111, 111, 111, 111, 116, 111, 111, + 111, 121, 111, 117, 117, 111, 111, 111, 111, 118, + 111, 122, 111, 111, 111, 111, 111, 119, 111, 111, + 120, 120, 111, 111, 111, 111, 111, 111, 111, 111, + 121, 117, 117, 111, 123, 111, 111, 111, 117, 117, + + 111, 111, 111, 117, 111, 111, 111, 111, 111, 111, + 0, 111, 111, 111, 111, 111, 111, 111, 111, 111, + 111, 111, 111 } ; -static yyconst flex_int16_t yy_nxt[253] = +static yyconst flex_int16_t yy_nxt[272] = { 0, - 10, 11, 12, 13, 13, 14, 15, 10, 16, 17, - 18, 19, 20, 19, 21, 22, 23, 24, 25, 26, - 25, 10, 18, 18, 18, 27, 18, 18, 18, 18, - 28, 18, 18, 29, 10, 30, 18, 18, 18, 27, - 18, 18, 18, 18, 28, 18, 31, 32, 33, 36, - 36, 39, 39, 42, 42, 50, 50, 37, 37, 48, - 52, 49, 49, 51, 73, 53, 76, 76, 34, 59, - 60, 76, 76, 93, 65, 86, 54, 51, 49, 49, - 40, 40, 43, 43, 59, 54, 55, 49, 49, 56, - 61, 83, 84, 74, 57, 55, 50, 50, 56, 60, - - 55, 66, 82, 67, 51, 83, 84, 100, 68, 55, - 99, 69, 70, 71, 54, 98, 49, 49, 51, 61, - 50, 50, 77, 77, 55, 80, 80, 56, 51, 75, - 78, 75, 77, 77, 76, 76, 80, 80, 55, 91, - 78, 79, 51, 79, 78, 95, 80, 80, 88, 88, - 87, 97, 87, 91, 78, 88, 88, 88, 88, 95, - 100, 96, 94, 92, 101, 35, 35, 35, 35, 38, - 38, 38, 38, 41, 41, 41, 41, 45, 45, 45, - 45, 47, 47, 64, 90, 64, 64, 72, 89, 72, - 72, 85, 62, 81, 46, 46, 44, 63, 62, 58, - - 46, 44, 102, 9, 102, 102, 102, 102, 102, 102, - 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, - 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, - 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, - 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, - 102, 102 + 12, 13, 14, 15, 15, 16, 17, 12, 18, 19, + 20, 21, 22, 21, 23, 24, 25, 26, 27, 28, + 29, 27, 12, 12, 20, 20, 20, 30, 20, 20, + 20, 20, 31, 20, 20, 32, 12, 33, 20, 20, + 20, 30, 20, 20, 20, 20, 31, 20, 34, 35, + 36, 39, 39, 42, 42, 45, 45, 55, 55, 40, + 40, 53, 65, 54, 54, 57, 79, 56, 66, 71, + 58, 102, 37, 85, 85, 92, 59, 65, 54, 54, + 59, 56, 54, 54, 43, 43, 46, 46, 60, 92, + 67, 61, 60, 55, 55, 61, 62, 80, 72, 66, + + 73, 95, 60, 56, 93, 74, 60, 91, 75, 76, + 77, 59, 109, 54, 54, 55, 55, 56, 93, 86, + 86, 67, 84, 60, 84, 56, 61, 85, 85, 87, + 88, 108, 88, 85, 85, 89, 89, 60, 107, 56, + 86, 86, 96, 87, 96, 89, 89, 97, 97, 100, + 87, 89, 89, 97, 97, 97, 97, 104, 109, 106, + 105, 103, 110, 100, 87, 101, 99, 98, 111, 82, + 94, 104, 38, 38, 38, 38, 41, 41, 41, 41, + 44, 44, 44, 44, 47, 47, 47, 47, 50, 50, + 50, 50, 52, 52, 70, 68, 70, 70, 78, 90, + + 78, 78, 81, 81, 81, 81, 51, 51, 49, 83, + 82, 69, 68, 64, 63, 51, 49, 111, 48, 48, + 11, 111, 111, 111, 111, 111, 111, 111, 111, 111, + 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, + 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, + 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, + 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, + 111 } ; -static yyconst flex_int16_t yy_chk[253] = +static yyconst flex_int16_t yy_chk[272] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 4, 5, 6, 7, 8, 21, 21, 3, 4, 19, - 22, 19, 19, 21, 43, 22, 75, 75, 2, 28, - 33, 76, 76, 112, 40, 111, 23, 21, 23, 23, - 5, 6, 7, 8, 28, 24, 23, 24, 24, 23, - 33, 58, 59, 43, 23, 24, 48, 48, 24, 60, - - 23, 40, 110, 40, 48, 58, 59, 99, 40, 24, - 98, 40, 40, 40, 49, 97, 49, 49, 48, 60, - 50, 50, 54, 54, 49, 79, 79, 49, 50, 51, - 54, 51, 77, 77, 51, 51, 80, 80, 49, 84, - 77, 55, 50, 55, 54, 90, 55, 55, 87, 87, - 78, 96, 78, 84, 77, 78, 78, 88, 88, 90, - 100, 92, 89, 85, 100, 103, 103, 103, 103, 104, - 104, 104, 104, 105, 105, 105, 105, 106, 106, 106, - 106, 107, 107, 108, 83, 108, 108, 109, 82, 109, - 109, 62, 61, 56, 53, 45, 44, 37, 34, 27, - - 15, 11, 9, 102, 102, 102, 102, 102, 102, 102, - 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, - 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, - 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, - 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, - 102, 102 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 2, 3, 4, 5, 6, 7, 8, 23, 23, 3, + 4, 21, 31, 21, 21, 24, 46, 23, 36, 43, + 24, 123, 2, 84, 84, 64, 25, 31, 25, 25, + 26, 23, 26, 26, 5, 6, 7, 8, 25, 64, + 36, 25, 26, 53, 53, 26, 25, 46, 43, 66, + + 43, 122, 25, 53, 65, 43, 26, 121, 43, 43, + 43, 54, 108, 54, 54, 55, 55, 53, 65, 59, + 59, 66, 56, 54, 56, 55, 54, 56, 56, 59, + 60, 107, 60, 85, 85, 60, 60, 54, 106, 55, + 86, 86, 87, 59, 87, 88, 88, 87, 87, 93, + 86, 89, 89, 96, 96, 97, 97, 99, 109, 105, + 101, 98, 109, 93, 86, 94, 92, 91, 82, 81, + 68, 99, 112, 112, 112, 112, 113, 113, 113, 113, + 114, 114, 114, 114, 115, 115, 115, 115, 116, 116, + 116, 116, 117, 117, 118, 67, 118, 118, 119, 61, + + 119, 119, 120, 120, 120, 120, 58, 50, 49, 48, + 47, 40, 37, 30, 29, 17, 13, 11, 10, 9, + 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, + 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, + 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, + 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, + 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, + 111 } ; /* Table of booleans, true if rule could match eol. */ -static yyconst flex_int32_t yy_rule_can_match_eol[43] = +static yyconst flex_int32_t yy_rule_can_match_eol[46] = { 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, }; + 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, }; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. @@ -619,12 +626,13 @@ static unsigned long long fromhex(const char *s) } -#line 623 "scanner.c" +#line 630 "scanner.c" #define INITIAL 0 #define COMMENT 1 #define STRING 2 #define INCLUDE 3 +#define SCRIPTBLOCK 4 #define YY_EXTRA_TYPE struct scan_context * @@ -853,7 +861,7 @@ YY_DECL #line 105 "scanner.l" -#line 857 "scanner.c" +#line 865 "scanner.c" yylval = yylval_param; @@ -909,13 +917,13 @@ yy_match: while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 103 ) + if ( yy_current_state >= 112 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_current_state != 102 ); + while ( yy_current_state != 111 ); yy_cp = yyg->yy_last_accepting_cpos; yy_current_state = yyg->yy_last_accepting_state; @@ -1035,7 +1043,7 @@ YY_RULE_SETUP case 16: YY_RULE_SETUP #line 132 "scanner.l" -{ BEGIN INCLUDE; } +{ BEGIN SCRIPTBLOCK; } YY_BREAK case 17: /* rule 17 can match eol */ @@ -1046,16 +1054,36 @@ YY_RULE_SETUP case 18: YY_RULE_SETUP #line 134 "scanner.l" -{ scanctx_append_string(yyextra, "\\"); } +{ + yylval->sval = scanctx_take_string(yyextra); + BEGIN INITIAL; + return(TOK_STRING); + } YY_BREAK case 19: YY_RULE_SETUP -#line 135 "scanner.l" -{ scanctx_append_string(yyextra, "\""); } +#line 140 "scanner.l" +{ BEGIN INCLUDE; } YY_BREAK case 20: +/* rule 20 can match eol */ +YY_RULE_SETUP +#line 141 "scanner.l" +{ scanctx_append_string(yyextra, yytext); } + YY_BREAK +case 21: YY_RULE_SETUP -#line 136 "scanner.l" +#line 142 "scanner.l" +{ scanctx_append_string(yyextra, "\\"); } + YY_BREAK +case 22: +YY_RULE_SETUP +#line 143 "scanner.l" +{ scanctx_append_string(yyextra, "\""); } + YY_BREAK +case 23: +YY_RULE_SETUP +#line 144 "scanner.l" { const char *error; FILE *fp = scanctx_push_include(yyextra, @@ -1078,123 +1106,124 @@ YY_RULE_SETUP BEGIN INITIAL; } YY_BREAK -case 21: -/* rule 21 can match eol */ +case 24: +/* rule 24 can match eol */ YY_RULE_SETUP -#line 160 "scanner.l" +#line 168 "scanner.l" { /* ignore */ } YY_BREAK -case 22: +case 25: YY_RULE_SETUP -#line 161 "scanner.l" +#line 169 "scanner.l" { /* ignore */ } YY_BREAK -case 23: +case 26: YY_RULE_SETUP -#line 163 "scanner.l" +#line 171 "scanner.l" { return(TOK_EQUALS); } YY_BREAK -case 24: +case 27: YY_RULE_SETUP -#line 164 "scanner.l" +#line 172 "scanner.l" { return(TOK_COMMA); } YY_BREAK -case 25: +case 28: YY_RULE_SETUP -#line 165 "scanner.l" +#line 173 "scanner.l" { return(TOK_GROUP_START); } YY_BREAK -case 26: +case 29: YY_RULE_SETUP -#line 166 "scanner.l" +#line 174 "scanner.l" { return(TOK_GROUP_END); } YY_BREAK -case 27: +case 30: YY_RULE_SETUP -#line 167 "scanner.l" +#line 175 "scanner.l" { yylval->ival = 1; return(TOK_BOOLEAN); } YY_BREAK -case 28: +case 31: YY_RULE_SETUP -#line 168 "scanner.l" +#line 176 "scanner.l" { yylval->ival = 0; return(TOK_BOOLEAN); } YY_BREAK -case 29: +case 32: YY_RULE_SETUP -#line 169 "scanner.l" +#line 177 "scanner.l" { yylval->sval = yytext; return(TOK_NAME); } YY_BREAK -case 30: +case 33: YY_RULE_SETUP -#line 170 "scanner.l" +#line 178 "scanner.l" { yylval->fval = atof(yytext); return(TOK_FLOAT); } YY_BREAK -case 31: +case 34: YY_RULE_SETUP -#line 171 "scanner.l" +#line 179 "scanner.l" { yylval->ival = atoi(yytext); return(TOK_INTEGER); } YY_BREAK -case 32: +case 35: YY_RULE_SETUP -#line 172 "scanner.l" +#line 180 "scanner.l" { yylval->llval = atoll(yytext); return(TOK_INTEGER64); } YY_BREAK -case 33: +case 36: YY_RULE_SETUP -#line 173 "scanner.l" +#line 181 "scanner.l" { yylval->ival = strtoul(yytext, NULL, 16); return(TOK_HEX); } YY_BREAK -case 34: +case 37: YY_RULE_SETUP -#line 177 "scanner.l" +#line 185 "scanner.l" { yylval->llval = fromhex(yytext); return(TOK_HEX64); } YY_BREAK -case 35: +case 38: YY_RULE_SETUP -#line 178 "scanner.l" +#line 186 "scanner.l" { return(TOK_ARRAY_START); } YY_BREAK -case 36: +case 39: YY_RULE_SETUP -#line 179 "scanner.l" +#line 187 "scanner.l" { return(TOK_ARRAY_END); } YY_BREAK -case 37: +case 40: YY_RULE_SETUP -#line 180 "scanner.l" +#line 188 "scanner.l" { return(TOK_LIST_START); } YY_BREAK -case 38: +case 41: YY_RULE_SETUP -#line 181 "scanner.l" +#line 189 "scanner.l" { return(TOK_LIST_END); } YY_BREAK -case 39: +case 42: YY_RULE_SETUP -#line 182 "scanner.l" +#line 190 "scanner.l" { return(TOK_SEMICOLON); } YY_BREAK -case 40: +case 43: *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ yyg->yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 183 "scanner.l" +#line 191 "scanner.l" { /* ignore */ } YY_BREAK -case 41: +case 44: YY_RULE_SETUP -#line 184 "scanner.l" +#line 192 "scanner.l" { return(TOK_GARBAGE); } YY_BREAK case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(COMMENT): case YY_STATE_EOF(STRING): case YY_STATE_EOF(INCLUDE): -#line 186 "scanner.l" +case YY_STATE_EOF(SCRIPTBLOCK): +#line 194 "scanner.l" { YY_BUFFER_STATE buf = (YY_BUFFER_STATE)scanctx_pop_include( yyextra); @@ -1207,12 +1236,12 @@ case YY_STATE_EOF(INCLUDE): yyterminate(); } YY_BREAK -case 42: +case 45: YY_RULE_SETUP -#line 197 "scanner.l" +#line 205 "scanner.l" ECHO; YY_BREAK -#line 1216 "scanner.c" +#line 1245 "scanner.c" case YY_END_OF_BUFFER: { @@ -1506,7 +1535,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 103 ) + if ( yy_current_state >= 112 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -1535,11 +1564,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 103 ) + if ( yy_current_state >= 112 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 102); + yy_is_jam = (yy_current_state == 111); (void)yyg; return yy_is_jam ? 0 : yy_current_state; @@ -2346,4 +2375,4 @@ void libconfig_yyfree (void * ptr , yyscan_t yyscanner) #define YYTABLES_NAME "yytables" -#line 197 "scanner.l" +#line 205 "scanner.l" diff --git a/3rdparty/libconfig/scanner.h b/3rdparty/libconfig/scanner.h index da1134498..181bc5c94 100644 --- a/3rdparty/libconfig/scanner.h +++ b/3rdparty/libconfig/scanner.h @@ -226,6 +226,7 @@ void libconfig_yyfree (void * ,yyscan_t yyscanner ); #define COMMENT 1 #define STRING 2 #define INCLUDE 3 +#define SCRIPTBLOCK 4 #endif @@ -333,8 +334,8 @@ extern int libconfig_yylex \ #undef YY_DECL #endif -#line 197 "scanner.l" +#line 205 "scanner.l" -#line 339 "scanner.h" +#line 340 "scanner.h" #undef libconfig_yyIN_HEADER #endif /* libconfig_yyHEADER_H */ diff --git a/conf/atcommand.conf b/conf/atcommand.conf index fc2a1af73..df4972067 100644 --- a/conf/atcommand.conf +++ b/conf/atcommand.conf @@ -56,6 +56,7 @@ aliases: { accinfo: ["accountinfo"] itemreset: ["clearinventory"] channel: ["main"] + autoloottype: ["aloottype"] } /* List of commands that should not be logged at all */ diff --git a/conf/groups.conf b/conf/groups.conf index 7c97352dc..9403e34f6 100644 --- a/conf/groups.conf +++ b/conf/groups.conf @@ -120,6 +120,7 @@ groups: ( noks: true autoloot: true alootid: true + autoloottype: true autotrade: true request: true go: true diff --git a/conf/help.txt b/conf/help.txt index 211ed5b19..a65c7de70 100644 --- a/conf/help.txt +++ b/conf/help.txt @@ -300,3 +300,8 @@ reloadscript: "Reload all scripts." gat: "For debugging (you inspect around gat)" send: "For debugging (packet variety)" nuke: "Params: <char name>\n" "Blow somebody up, including those surrounding them." +autoloottype: "Manage a list of autolooting item types.\n" +" To add an item type to the list, use \"@autoloottype +<type name>\".\n" +" To remove an item type, use \"@autoloottype -<type name>\".\n" +" Type List: healing, usable, etc, weapon, armor, card, petegg, petarmor, ammo.\n" +" \"@autoloottype reset\" will clear your autoloottype list." diff --git a/conf/messages.conf b/conf/messages.conf index 5d0fd7ba6..a9f0a5984 100644 --- a/conf/messages.conf +++ b/conf/messages.conf @@ -1534,5 +1534,17 @@ //CashShop mapflag 1489: Cash Shop is disabled in this map + +// @autoloottype +1490: You're already autolooting this item type. +1491: Item type not found. +1492: Autolooting item type: '%s' +1493: You're currently not autolooting this item type. +1494: Removed item type: '%s' from your autoloottype list. +1495: Your autoloottype list is empty. +1496: Item types on your autoloottype list: +1497: Your autoloottype list has been reset. + + //Custom translations import: conf/import/msg_conf.txt @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in c4af60e. +# From configure.in 0219c4d. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69. # @@ -691,6 +691,10 @@ ac_user_opts=' enable_option_checking enable_manager enable_packetver +enable_packetver_re +with_key1 +with_key2 +with_key3 enable_debug enable_buildbot enable_rdtsc @@ -1323,8 +1327,9 @@ Optional Features: --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-manager=ARG memory managers: no, builtin, memwatch, dmalloc, gcollect, bcheck (defaults to builtin) - --enable-packetver=ARG Sets the PACKETVER define of the map-server. (see - src/map/clif.h) + --enable-packetver=ARG Sets the PACKETVER define. (see src/common/mmo.h) + --disable-packetver-re Sets or unsets the PACKETVER_RE define - see + src/common/mmo.h (currently enabled by default) --enable-debug[=ARG] Compiles extra debug code. (disabled by default) (available options: yes, no, gdb) --enable-buildbot[=ARG] (available options: yes, no) @@ -1352,6 +1357,12 @@ Optional Features: Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-key1[=ARG] Set the first obfuscation key (ignored unless the + other two are also specified) + --with-key2[=ARG] Set the second obfuscation key (ignored unless the + other two are also specified) + --with-key3[=ARG] Set the third obfuscation key (ignored unless the + other two are also specified) --with-maxconn[=ARG] optionally set the maximum connections the core can handle (default: 16384) NOT USED YET - EXPERIMENTAL --with-mysql[=ARG] optionally specify the path to the mysql_config @@ -3461,6 +3472,79 @@ fi # +# packetver-RE +# +# Check whether --enable-packetver-re was given. +if test "${enable_packetver_re+set}" = set; then : + enableval=$enable_packetver_re; + enable_packetver_re="$enableval" + case $enableval in + "no");; + "yes");; + *) as_fn_error $? "invalid argument --enable-packetver-re=$enableval... stopping" "$LINENO" 5;; + esac + +else + enable_packetver_re="yes" + +fi + + + +# +# Obfuscation keys +# + +# Check whether --with-key1 was given. +if test "${with_key1+set}" = set; then : + withval=$with_key1; + obfuscationkey1="$( expr "0x$withval" : '0*x*\(0x[A-Fa-f0-9]\{8\}\)' )" + if ! expr "x$obfuscationkey1" : 'x0x[A-Fa-f0-9]\{8\}' >/dev/null 2>&1; then + obfuscationkey1="" + fi + +else + + obfuscationkey1="" + + +fi + + +# Check whether --with-key2 was given. +if test "${with_key2+set}" = set; then : + withval=$with_key2; + obfuscationkey2="$( expr "0x$withval" : '0*x*\(0x[A-Fa-f0-9]\{8\}\)' )" + if ! expr "x$obfuscationkey2" : 'x0x[A-Fa-f0-9]\{8\}' >/dev/null 2>&1; then + obfuscationkey2="" + fi + +else + + obfuscationkey2="" + + +fi + + +# Check whether --with-key3 was given. +if test "${with_key3+set}" = set; then : + withval=$with_key3; + obfuscationkey3="$( expr "0x$withval" : '0*x*\(0x[A-Fa-f0-9]\{8\}\)' )" + if ! expr "x$obfuscationkey3" : 'x0x[A-Fa-f0-9]\{8\}' >/dev/null 2>&1; then + obfuscationkey3="" + fi + +else + + obfuscationkey3="" + + +fi + + + +# # debug # # Check whether --enable-debug was given. @@ -5361,6 +5445,24 @@ if test -n "$enable_packetver" ; then CFLAGS="$CFLAGS -DPACKETVER=$enable_packetver" fi +# +# Packetver-RE +# +case $enable_packetver_re in + "yes") + # default value + CFLAGS="$CFLAGS -DDISABLE_PACKETVER_RE" + ;; + "no") + ;; +esac + +# +# Obfuscation keys +# +if test -n "$obfuscationkey1" -a -n "$obfuscationkey2" -a -n "$obfuscationkey3"; then + CFLAGS="$CFLAGS -DOBFUSCATIONKEY1=$obfuscationkey1 -DOBFUSCATIONKEY2=$obfuscationkey2 -DOBFUSCATIONKEY3=$obfuscationkey3" +fi # # Debug @@ -6376,7 +6478,7 @@ esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MinGW" >&5 $as_echo_n "checking for MinGW... " >&6; } -if test -n "`$CC --version | grep -i mingw`" ; then +if test -n "`$CC --version 2>/dev/null | grep -i mingw`" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } CPPFLAGS="$CPPFLAGS -DMINGW" diff --git a/configure.in b/configure.in index b79e51f6d..98c493a03 100644 --- a/configure.in +++ b/configure.in @@ -46,7 +46,7 @@ AC_ARG_ENABLE( [packetver], AC_HELP_STRING( [--enable-packetver=ARG], - [Sets the PACKETVER define of the map-server. (see src/map/clif.h)] + [Sets the PACKETVER define. (see src/common/mmo.h)] ), [enable_packetver="$enableval"], [enable_packetver=""] @@ -54,6 +54,80 @@ AC_ARG_ENABLE( # +# packetver-RE +# +AC_ARG_ENABLE( + [packetver-re], + AC_HELP_STRING( + [--disable-packetver-re], + [Sets or unsets the PACKETVER_RE define - see src/common/mmo.h (currently enabled by default)] + ), + [ + enable_packetver_re="$enableval" + case $enableval in + "no");; + "yes");; + *) AC_MSG_ERROR([[invalid argument --enable-packetver-re=$enableval... stopping]]);; + esac + ], + [enable_packetver_re="yes"] +) + + +# +# Obfuscation keys +# +AC_ARG_WITH( + [key1], + AC_HELP_STRING( + [--with-key1@<:@=ARG@:>@], + [Set the first obfuscation key (ignored unless the other two are also specified)] + ), + [ + obfuscationkey1="$( expr "0x$withval" : '0*x*\(0x@<:@A-Fa-f0-9@:>@\{8\}\)' )" + if ! expr "x$obfuscationkey1" : 'x0x@<:@A-Fa-f0-9@:>@\{8\}' >/dev/null 2>&1; then + obfuscationkey1="" + fi + ], + [ + obfuscationkey1="" + ] +) +AC_ARG_WITH( + [key2], + AC_HELP_STRING( + [--with-key2@<:@=ARG@:>@], + [Set the second obfuscation key (ignored unless the other two are also specified)] + ), + [ + obfuscationkey2="$( expr "0x$withval" : '0*x*\(0x@<:@A-Fa-f0-9@:>@\{8\}\)' )" + if ! expr "x$obfuscationkey2" : 'x0x@<:@A-Fa-f0-9@:>@\{8\}' >/dev/null 2>&1; then + obfuscationkey2="" + fi + ], + [ + obfuscationkey2="" + ] +) +AC_ARG_WITH( + [key3], + AC_HELP_STRING( + [--with-key3@<:@=ARG@:>@], + [Set the third obfuscation key (ignored unless the other two are also specified)] + ), + [ + obfuscationkey3="$( expr "0x$withval" : '0*x*\(0x@<:@A-Fa-f0-9@:>@\{8\}\)' )" + if ! expr "x$obfuscationkey3" : 'x0x@<:@A-Fa-f0-9@:>@\{8\}' >/dev/null 2>&1; then + obfuscationkey3="" + fi + ], + [ + obfuscationkey3="" + ] +) + + +# # debug # AC_ARG_ENABLE( @@ -771,6 +845,24 @@ if test -n "$enable_packetver" ; then CFLAGS="$CFLAGS -DPACKETVER=$enable_packetver" fi +# +# Packetver-RE +# +case $enable_packetver_re in + "yes") + # default value + CFLAGS="$CFLAGS -DDISABLE_PACKETVER_RE" + ;; + "no") + ;; +esac + +# +# Obfuscation keys +# +if test -n "$obfuscationkey1" -a -n "$obfuscationkey2" -a -n "$obfuscationkey3"; then + CFLAGS="$CFLAGS -DOBFUSCATIONKEY1=$obfuscationkey1 -DOBFUSCATIONKEY2=$obfuscationkey2 -DOBFUSCATIONKEY3=$obfuscationkey3" +fi # # Debug @@ -1035,7 +1127,7 @@ esac AC_SUBST([DLLEXT]) AC_MSG_CHECKING([for MinGW]) -if test -n "`$CC --version | grep -i mingw`" ; then +if test -n "`$CC --version 2>/dev/null | grep -i mingw`" ; then AC_MSG_RESULT([yes]) CPPFLAGS="$CPPFLAGS -DMINGW" if test -z "$fd_setsize" ; then diff --git a/db/re/refine_db.txt b/db/re/refine_db.txt index a9b7fedd1..2b78a9d44 100644 --- a/db/re/refine_db.txt +++ b/db/re/refine_db.txt @@ -27,15 +27,14 @@ // Chance: // 100 = 100% // -// Note: Chances for +11 and higher are not verified - 10% is a rumor from iRO wiki. // A note about renewal Armors, there may or may not be another bonus, according to iRO wiki: Every upgrade gives floor[( 3 + current upgrade ) / 4] equipment DEF) -0,0,0,0,100:100,100:100,100:100,100:100,60:200,40:200,40:200,20:200,20:300,10:300,100:300,100:300,100:400,100:400,90:400,60:400,60:500,30:500,30:500,10:500 +0,0,0,0,100:100,100:100,100:100,100:100,60:200,40:200,40:200,20:200,20:300,10:300,8:300,8:300,8:400,8:400,7:400,7:400,7:500,7:500,5:500,5:500 // Level 1 weapons -1,200,8,300,100:0,100:0,100:0,100:0,100:0,100:0,100:0,60:0,40:0,20:0,100:0,100:0,100:0,100:0,100:0,100:300,100:300,90:300,60:300,20:300 +1,200,8,300,100:0,100:0,100:0,100:0,100:0,100:0,100:0,60:0,40:0,20:0,18:0,18:0,18:0,18:0,18:0,17:300,17:300,17:300,15:300,15:300 // Level 2 weapons -2,300,7,500,100:0,100:0,100:0,100:0,100:0,100:0,60:0,40:0,20:0,20:0,100:0,100:0,100:0,100:0,100:0,100:600,90:600,60:600,30:600,20:600 +2,300,7,500,100:0,100:0,100:0,100:0,100:0,100:0,60:0,40:0,20:0,20:0,18:0,18:0,18:0,18:0,18:0,17:600,17:600,17:600,15:600,15:600 // Level 3 weapons -3,500,6,800,100:0,100:0,100:0,100:0,100:0,60:0,50:0,20:0,20:0,20:0,100:0,100:0,100:0,100:0,100:0,90:900,75:900,30:900,30:900,20:900 +3,500,6,800,100:0,100:0,100:0,100:0,100:0,60:0,50:0,20:0,20:0,20:0,18:0,18:0,18:0,18:0,18:0,17:900,17:900,17:900,15:900,15:900 // Level 4 weapons -4,700,5,1400,100:0,100:0,100:0,100:0,60:0,40:0,40:0,20:0,20:0,10:0,100:0,100:0,100:0,100:0,90:0,60:1200,60:1200,30:1200,30:1200,10:1200 +4,700,5,1400,100:0,100:0,100:0,100:0,60:0,40:0,40:0,20:0,20:0,10:0,8:0,8:0,8:0,8:0,8:0,7:1200,7:1200,7:1200,5:1200,5:1200 diff --git a/doc/atcommands.txt b/doc/atcommands.txt index 42b085cd6..b2c765d6a 100644 --- a/doc/atcommands.txt +++ b/doc/atcommands.txt @@ -337,6 +337,16 @@ By default, 10 items can be autolooted at one time. --------------------------------------- +@autoloottype <+/-><type name> +@autoloottype reset + +Starts or stops autolooting a specified item type. +Type List: healing, usable, etc, weapon, armor, card, petegg, petarmor, ammo. +Typing "reset" will clear the autoloot item list. + +--------------------------------------- + + @mobsearch <monster name> Locates and displays the position of a certain mob on the current map. diff --git a/doc/script_commands.txt b/doc/script_commands.txt index f2ba9f6ba..f0016b104 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -207,7 +207,7 @@ Ex: if your NPC is named 'Hunter#hunter1', it will be displayed as 'Hunter' ** Define a warp point -<from map name>,<fromX>,<fromY>,<facing>%TAB%warp%TAB%<warp name>%TAB%<spanx>,<spany>,<to map name>,<toX>,<toY> +<from map name>,<fromX>,<fromY>{,<facing>}%TAB%warp%TAB%<warp name>%TAB%<spanx>,<spany>,<to map name>,<toX>,<toY> This will define a warp NPC that will warp a player between maps, and while most arguments of that are obvious, some deserve special mention. @@ -299,7 +299,7 @@ items here. The layout used to define sale items still count, and ** Define an warp/shop/cashshop/NPC duplicate. -warp: <map name>,<x>,<y>,<facing>%TAB%duplicate(<label>)%TAB%<NPC Name>%TAB%<spanx>,<spany> +warp: <map name>,<x>,<y>{,<facing>}%TAB%duplicate(<label>)%TAB%<NPC Name>%TAB%<spanx>,<spany> shop/cashshop/npc: -%TAB%duplicate(<label>)%TAB%<NPC Name>%TAB%<sprite id> shop/cashshop/npc: <map name>,<x>,<y>,<facing>%TAB%duplicate(<label>)%TAB%<NPC Name>%TAB%<sprite id> npc: -%TAB%duplicate(<label>)%TAB%<NPC Name>%TAB%<sprite id>,<triggerX>,<triggerY> diff --git a/npc/instances/EndlessTower.txt b/npc/instances/EndlessTower.txt index 7d1bee6aa..e39cfbbff 100644 --- a/npc/instances/EndlessTower.txt +++ b/npc/instances/EndlessTower.txt @@ -1252,7 +1252,7 @@ OnTimer5000: end; } -1@tower,12,393,0 script 1FGate102tower 45,2,2,{ +1@tower,12,393,0 script 1FGate102tower WARPNPC,2,2,{ end; OnInstanceInit: @@ -1323,7 +1323,7 @@ L_Display: 1@tower,184,51,0 duplicate(1FGate102tower) 23FGate102tower WARPNPC,2,2 1@tower,270,51,0 duplicate(1FGate102tower) 24FGate102tower WARPNPC,2,2 -1@tower,355,51,0 script 25FGate102tower 45,2,2,{ +1@tower,355,51,0 script 25FGate102tower WARPNPC,2,2,{ end; OnInstanceInit: @@ -1347,7 +1347,7 @@ OnTimer120000: end; } -1@tower,355,51,0 script 25FGate102tower-2 45,2,2,{ +1@tower,355,51,0 script 25FGate102tower-2 WARPNPC,2,2,{ end; OnInstanceInit: @@ -2244,4 +2244,4 @@ OnTimer1000: stopnpctimer; donpcevent instance_npcname("#Effect30")+"::OnEnable"; end; -}
\ No newline at end of file +} diff --git a/npc/other/hugel_bingo.txt b/npc/other/hugel_bingo.txt index 2bd8f1d55..0a47b4f00 100644 --- a/npc/other/hugel_bingo.txt +++ b/npc/other/hugel_bingo.txt @@ -276,7 +276,7 @@ OnTimer460000: end; } -que_bingo,49,125,0 script 1a#bingo 139,1,1,{ +que_bingo,49,125,0 script 1a#bingo HIDDEN_WARP_NPC,1,1,{ end; OnInit: diff --git a/npc/other/turbo_track.txt b/npc/other/turbo_track.txt index b135cd093..dea910aa3 100644 --- a/npc/other/turbo_track.txt +++ b/npc/other/turbo_track.txt @@ -1918,7 +1918,7 @@ turbo_n_1,222,45,0 duplicate(TurboHint_4#tt_main) #n1NoWayOut5 -1,1,1 turbo_n_1,222,61,0 duplicate(TurboHint_4#tt_main) #n1NoWayOut6 -1,1,1 turbo_n_1,222,65,0 duplicate(TurboHint_4#tt_main) #n1NoWayOut7 -1,1,1 -- script cos_end#tt_main 01,{ +- script cos_end#tt_main -1,{ function GetNumber; OnTouch: set .@w$,callfunc("F_tt"); diff --git a/npc/quests/first_class/tu_acolyte.txt b/npc/quests/first_class/tu_acolyte.txt index fde13dbae..c788462bd 100644 --- a/npc/quests/first_class/tu_acolyte.txt +++ b/npc/quests/first_class/tu_acolyte.txt @@ -1778,7 +1778,7 @@ prt_monk,223,123,3 script Eavesdrop#tu HIDDEN_NPC,{ } } -sec_in02,17,156,3 script 1st Job Quest Reset 726,{ +sec_in02,17,156,3 script 1st Job Quest Reset 4_F_JOB_BLACKSMITH,{ callfunc "F_GM_NPC"; mes "[1st Job Quest]"; mes "Which would you like to reset?"; diff --git a/npc/quests/quests_ein.txt b/npc/quests/quests_ein.txt index 243c47fc7..51d7e5869 100644 --- a/npc/quests/quests_ein.txt +++ b/npc/quests/quests_ein.txt @@ -4073,7 +4073,7 @@ ein_in01,67,242,3 script Zelmeto 4_M_REPAIR,{ } } -ein_in01,49,232,3 script 2nd Control Panel#ins 111,{ +ein_in01,49,232,3 script 2nd Control Panel#ins HIDDEN_NPC,{ if ((EinFactory == 1) || (EinFactory == 2)) { changequest 8017,8018; set EinFactory,2; @@ -4088,7 +4088,7 @@ ein_in01,49,232,3 script 2nd Control Panel#ins 111,{ end; } -ein_in01,108,217,3 script 3rd Pressure Governor#1 111,{ +ein_in01,108,217,3 script 3rd Pressure Governor#1 HIDDEN_NPC,{ if ((EinFactory == 3) || (EinFactory == 4)) { changequest 8019,8020; set EinFactory,4; diff --git a/npc/quests/quests_juperos.txt b/npc/quests/quests_juperos.txt index b46c8a82c..3c51ead24 100644 --- a/npc/quests/quests_juperos.txt +++ b/npc/quests/quests_juperos.txt @@ -4904,7 +4904,7 @@ OnTimer26000: donpcevent "GuardEnd#ufe::OnDisable"; } -jupe_ele,41,33,0 script 4F Enter#ufe 45,4,4,{ +jupe_ele,41,33,0 script 4F Enter#ufe WARPNPC,4,4,{ OnInit: disablenpc "4F Enter#ufe"; end; diff --git a/npc/quests/quests_moscovia.txt b/npc/quests/quests_moscovia.txt index 6f00c6e7c..d868926b6 100644 --- a/npc/quests/quests_moscovia.txt +++ b/npc/quests/quests_moscovia.txt @@ -9298,7 +9298,7 @@ moc_pryd04,126,120,0 script Soldier#rus26 4_M_RUSMAN1,{ //---------------------------------------------------------------------------- // Marozka's Dungeon (Golden Thread) //---------------------------------------------------------------------------- -mosk_dun01,45,250,3 script 1#rus27 45,3,3,{ +mosk_dun01,45,250,3 script 1#rus27 WARPNPC,3,3,{ end; OnTouch: warp "mosk_que",49,22; diff --git a/npc/quests/thana_quest.txt b/npc/quests/thana_quest.txt index bb70a4166..8aebaae31 100644 --- a/npc/quests/thana_quest.txt +++ b/npc/quests/thana_quest.txt @@ -868,7 +868,7 @@ L_Request: return; } -tha_t02,227,163,0 script 3rdf_warp#tt 45,1,1,{ +tha_t02,227,163,0 script 3rdf_warp#tt WARPNPC,1,1,{ end; OnInit: disablenpc "3rdf_warp#tt"; @@ -2310,4 +2310,4 @@ OnTouch: } mes "A mysterious power is blocking my path."; close; -}
\ No newline at end of file +} diff --git a/npc/re/merchants/refine.txt b/npc/re/merchants/refine.txt index fa1853520..fa5bab042 100644 --- a/npc/re/merchants/refine.txt +++ b/npc/re/merchants/refine.txt @@ -102,10 +102,10 @@ function script refinenew { set .@material,6224; //Bradium set .@price,100000; switch(getequipweaponlv(.@part)) { - case 1: set .@safe,17; break; - case 2: set .@safe,16; break; - case 3: set .@safe,15; break; - case 4: set .@safe,14; break; + case 1: set .@safe,10; break; + case 2: set .@safe,10; break; + case 3: set .@safe,10; break; + case 4: set .@safe,10; break; } mes "["+ getarg(0) +"]"; mes "Hmm a weapon, is that ok?"; @@ -115,7 +115,7 @@ function script refinenew { set .@type$,"armor"; set .@material,6223; //Carnium set .@price,100000; - set .@safe,14; + set .@safe,10; mes "["+ getarg(0) +"]"; mes "Hmm an armor, is that ok?"; mes "If you want to refine this armor,"; @@ -187,7 +187,7 @@ function script refinenew { if (rand(100) < 80) { mes "["+ getarg(0) +"]"; mes "Clang! Clang! Clang! Clang!"; - downrefitem .@part; + downrefitem .@part, 3; // Failed refine attempts decrease the item's refine level by 3 next; emotion (!rand(5))?e_cash:e_omg; mes "["+ getarg(0) +"]"; @@ -296,7 +296,7 @@ function script refinenew { if (rand(100) < 80) { mes "["+ getarg(0) +"]"; mes "Clang! Clang! Clang! Clang!"; - downrefitem .@part; + downrefitem .@part, 3; // Failed refine attempts decrease the item's refine level by 3 next; emotion (!rand(5))?e_cash:e_omg; mes "["+ getarg(0) +"]"; diff --git a/npc/re/quests/eden/86-90.txt b/npc/re/quests/eden/86-90.txt index 60bbac0e2..1fced3a16 100644 --- a/npc/re/quests/eden/86-90.txt +++ b/npc/re/quests/eden/86-90.txt @@ -13,7 +13,7 @@ //= 1.3 Updated to match the official script. [Euphy] //============================================================ -moc_para01,48,175,3 script 4_M_04-90 Mission Board 857,{ +moc_para01,48,175,3 script 4_M_04-90 Mission Board 4_BOARD3,{ if (countitem(6219) < 1) { mes "Wait a minute!"; mes "-You need to have an-"; diff --git a/npc/re/quests/eden/91-99.txt b/npc/re/quests/eden/91-99.txt index 0c3c6b12f..62a6512f6 100644 --- a/npc/re/quests/eden/91-99.txt +++ b/npc/re/quests/eden/91-99.txt @@ -13,7 +13,7 @@ //= 1.3 Updated to match the official script. [Euphy] //============================================================ -moc_para01,48,177,3 script 4_F_02-99 Mission Board 857,{ +moc_para01,48,177,3 script 4_F_02-99 Mission Board 4_BOARD3,{ if (countitem(6219) < 1) { mes "Wait a minute!"; mes "-You need to have an-"; diff --git a/npc/re/quests/quests_dicastes.txt b/npc/re/quests/quests_dicastes.txt index 020aff699..9375cf27b 100644 --- a/npc/re/quests/quests_dicastes.txt +++ b/npc/re/quests/quests_dicastes.txt @@ -436,7 +436,7 @@ dic_in01,254,119,0 script Item Storage#01 CLEAR_NPC,{ end; } -sec_in02,10,42,1 script 13.3 Related Reset 449,{ +sec_in02,10,42,1 script 13.3 Related Reset 4_MAN_BENKUNI,{ callfunc "F_GM_NPC"; mes "[Reset]"; mes "Resets all quest windows including daily and map quests for 13.3."; diff --git a/npc/re/quests/quests_malangdo.txt b/npc/re/quests/quests_malangdo.txt index ea03d66bb..62b356c23 100644 --- a/npc/re/quests/quests_malangdo.txt +++ b/npc/re/quests/quests_malangdo.txt @@ -2468,7 +2468,7 @@ OnTouch: close; } -malangdo,246,184,0 script 1st Rate Point 111,{ +malangdo,246,184,0 script 1st Rate Point HIDDEN_NPC,{ if (checkweight(1201,1) == 0) { mes " - Notice !! -"; mes " - Since you have too many items - "; diff --git a/src/common/mmo.h b/src/common/mmo.h index 349912a39..5f4da6eb0 100644 --- a/src/common/mmo.h +++ b/src/common/mmo.h @@ -48,18 +48,18 @@ // 20120307 - 2012-03-07aRagexeRE+ - 0x970 #ifndef PACKETVER - #define PACKETVER 20120418 -#endif +#define PACKETVER 20120418 +#endif // PACKETVER +#ifndef DISABLE_PACKETVER_RE // Comment the following line if your client is NOT ragexeRE (required because of conflicting packets in ragexe vs ragexeRE). #define PACKETVER_RE +#endif // DISABLE_PACKETVER_RE // Client support for experimental RagexeRE UI present in 2012-04-10 and 2012-04-18 -#ifdef PACKETVER_RE -#if (PACKETVER == 20120410) || (PACKETVER == 20120418) - #define PARTY_RECRUIT -#endif -#endif +#if defined(PACKETVER_RE) && ( PACKETVER == 20120410 || PACKETVER == 20120418 ) +#define PARTY_RECRUIT +#endif // PACKETVER_RE && (PACKETVER == 20120410 || PACKETVER == 10120418) // Comment the following line to disable sc_data saving. [Skotlex] #define ENABLE_SC_SAVING diff --git a/src/map/atcommand.c b/src/map/atcommand.c index eda7de19a..0ba977ff4 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -5603,16 +5603,16 @@ ACMD(autolootitem) } else if (!strcmp(message,"reset")) action = 4; - } - - if (action < 3) // add or remove - { - if ((item_data = itemdb->exists(atoi(message))) == NULL) - item_data = itemdb->search_name(message); - if (!item_data) { - // No items founds in the DB with Id or Name - clif->message(fd, msg_txt(1189)); // Item not found. - return false; + + if (action < 3) // add or remove + { + if ((item_data = itemdb->exists(atoi(message))) == NULL) + item_data = itemdb->search_name(message); + if (!item_data) { + // No items founds in the DB with Id or Name + clif->message(fd, msg_txt(1189)); // Item not found. + return false; + } } } @@ -5680,6 +5680,103 @@ ACMD(autolootitem) } /*========================================== + * @autoloottype + * Credits: + * chriser,Aleos + *------------------------------------------*/ +ACMD(autoloottype) { + int i; + uint8 action = 3; // 1=add, 2=remove, 3=help+list (default), 4=reset + enum item_types type = -1; + int ITEM_NONE = 0; + + if (message && *message) { + if (message[0] == '+') { + message++; + action = 1; + } else if (message[0] == '-') { + message++; + action = 2; + } else if (strcmp(message,"reset") == 0) { + action = 4; + } + + if (action < 3) { + // add or remove + if (strncmp(message, "healing", 3) == 0) + type = IT_HEALING; + else if (strncmp(message, "usable", 3) == 0) + type = IT_USABLE; + else if (strncmp(message, "etc", 3) == 0) + type = IT_ETC; + else if (strncmp(message, "weapon", 3) == 0) + type = IT_WEAPON; + else if (strncmp(message, "armor", 3) == 0) + type = IT_ARMOR; + else if (strncmp(message, "card", 3) == 0) + type = IT_CARD; + else if (strncmp(message, "petegg", 4) == 0) + type = IT_PETEGG; + else if (strncmp(message, "petarmor", 4) == 0) + type = IT_PETARMOR; + else if (strncmp(message, "ammo", 3) == 0) + type = IT_AMMO; + else { + clif->message(fd, msg_txt(1491)); // Item type not found. + return false; + } + } + } + + switch (action) { + case 1: + if (sd->state.autoloottype&(1<<type)) { + clif->message(fd, msg_txt(1490)); // You're already autolooting this item type. + return false; + } + sd->state.autoloottype |= (1<<type); // Stores the type + sprintf(atcmd_output, msg_txt(1492), itemdb->typename(type)); // Autolooting item type: '%s' + clif->message(fd, atcmd_output); + break; + case 2: + if (!(sd->state.autoloottype&(1<<type))) { + clif->message(fd, msg_txt(1493)); // You're currently not autolooting this item type. + return false; + } + sd->state.autoloottype &= ~(1<<type); + sprintf(atcmd_output, msg_txt(1494), itemdb->typename(type)); // Removed item type: '%s' from your autoloottype list. + clif->message(fd, atcmd_output); + break; + case 3: + clif->message(fd, msg_txt(38)); // Invalid location number, or name. + + { + // attempt to find the text help string + const char *text = atcommand_help_string(info); + if (text) clif->messageln(fd, text); // send the text to the client + } + + if (sd->state.autoloottype == ITEM_NONE) { + clif->message(fd, msg_txt(1495)); // Your autoloottype list is empty. + } else { + clif->message(fd, msg_txt(1496)); // Item types on your autoloottype list: + for(i=0; i < IT_MAX; i++) { + if (sd->state.autoloottype&(1<<i)) { + sprintf(atcmd_output, " '%s'", itemdb->typename(i)); + clif->message(fd, atcmd_output); + } + } + } + break; + case 4: + sd->state.autoloottype = ITEM_NONE; + clif->message(fd, msg_txt(1497)); // Your autoloottype list has been reset. + break; + } + return true; +} + +/*========================================== * It is made to snow. *------------------------------------------*/ ACMD(snow) { @@ -9383,6 +9480,7 @@ void atcommand_basecommands(void) { ACMD_DEF(changelook), ACMD_DEF(autoloot), ACMD_DEF2("alootid", autolootitem), + ACMD_DEF(autoloottype), ACMD_DEF(mobinfo), ACMD_DEF(exp), ACMD_DEF(version), diff --git a/src/map/npc.c b/src/map/npc.c index f0bdd7bd0..d78b3f8d4 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -1944,7 +1944,7 @@ void npc_parsename(struct npc_data* nd, const char* name, const char* start, con if( p ) { // <Display name>::<Unique name> size_t len = p-name; if( len > NAME_LENGTH ) { - ShowWarning("npc_parsename: Display name of '%s' is too long (len=%u) in file '%s', line'%d'. Truncating to %u characters.\n", name, (unsigned int)len, filepath, strline(buffer,start-buffer), NAME_LENGTH); + ShowWarning("npc_parsename: Display name of '%s' is too long (len=%u) in file '%s', line '%d'. Truncating to %u characters.\n", name, (unsigned int)len, filepath, strline(buffer,start-buffer), NAME_LENGTH); safestrncpy(nd->name, name, sizeof(nd->name)); } else { memcpy(nd->name, name, len); @@ -1952,19 +1952,19 @@ void npc_parsename(struct npc_data* nd, const char* name, const char* start, con } len = strlen(p+2); if( len > NAME_LENGTH ) - ShowWarning("npc_parsename: Unique name of '%s' is too long (len=%u) in file '%s', line'%d'. Truncating to %u characters.\n", name, (unsigned int)len, filepath, strline(buffer,start-buffer), NAME_LENGTH); + ShowWarning("npc_parsename: Unique name of '%s' is too long (len=%u) in file '%s', line '%d'. Truncating to %u characters.\n", name, (unsigned int)len, filepath, strline(buffer,start-buffer), NAME_LENGTH); safestrncpy(nd->exname, p+2, sizeof(nd->exname)); } else {// <Display name> size_t len = strlen(name); if( len > NAME_LENGTH ) - ShowWarning("npc_parsename: Name '%s' is too long (len=%u) in file '%s', line'%d'. Truncating to %u characters.\n", name, (unsigned int)len, filepath, strline(buffer,start-buffer), NAME_LENGTH); + ShowWarning("npc_parsename: Name '%s' is too long (len=%u) in file '%s', line '%d'. Truncating to %u characters.\n", name, (unsigned int)len, filepath, strline(buffer,start-buffer), NAME_LENGTH); safestrncpy(nd->name, name, sizeof(nd->name)); safestrncpy(nd->exname, name, sizeof(nd->exname)); } if( *nd->exname == '\0' || strstr(nd->exname,"::") != NULL ) {// invalid snprintf(newname, ARRAYLENGTH(newname), "0_%d_%d_%d", nd->bl.m, nd->bl.x, nd->bl.y); - ShowWarning("npc_parsename: Invalid unique name in file '%s', line'%d'. Renaming '%s' to '%s'.\n", filepath, strline(buffer,start-buffer), nd->exname, newname); + ShowWarning("npc_parsename: Invalid unique name in file '%s', line '%d'. Renaming '%s' to '%s'.\n", filepath, strline(buffer,start-buffer), nd->exname, newname); safestrncpy(nd->exname, newname, sizeof(nd->exname)); } @@ -1981,7 +1981,7 @@ void npc_parsename(struct npc_data* nd, const char* name, const char* start, con strcpy(this_mapname, (nd->bl.m == -1 ? "(not on a map)" : mapindex_id2name(map_id2index(nd->bl.m)))); strcpy(other_mapname, (dnd->bl.m == -1 ? "(not on a map)" : mapindex_id2name(map_id2index(dnd->bl.m)))); - ShowWarning("npc_parsename: Duplicate unique name in file '%s', line'%d'. Renaming '%s' to '%s'.\n", filepath, strline(buffer,start-buffer), nd->exname, newname); + ShowWarning("npc_parsename: Duplicate unique name in file '%s', line '%d'. Renaming '%s' to '%s'.\n", filepath, strline(buffer,start-buffer), nd->exname, newname); ShowDebug("this npc:\n display name '%s'\n unique name '%s'\n map=%s, x=%d, y=%d\n", nd->name, nd->exname, this_mapname, nd->bl.x, nd->bl.y); 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)); @@ -2240,7 +2240,7 @@ const char* npc_parse_shop(char* w1, char* w2, char* w3, char* w4, const char* s } if( type == SHOP && value*0.75 < id->value_sell*1.24 ) {// Exploit possible: you can buy and sell back with profit - ShowWarning("npc_parse_shop: Item %s [%d] discounted buying price (%d->%d) is less than overcharged selling price (%d->%d) at file '%s', line '%d'.\n", + ShowWarning("npc_parse_shop: Item %s [%d] discounted buying price (%d->%d) is less than overcharged selling price (%d->%d) in file '%s', line '%d'.\n", id->name, nameid, value, (int)(value*0.75), id->value_sell, (int)(id->value_sell*1.24), filepath, strline(buffer,start-buffer)); } //for logs filters, atcommands and iteminfo script command @@ -2308,7 +2308,7 @@ void npc_convertlabel_db(struct npc_label_list* label_list, const char *filepath // here we check if the label fit into the buffer if( len > 23 ) { - ShowError("npc_parse_script: label name longer than 23 chars! '%s'\n (%s)", lname, filepath); + ShowError("npc_parse_script: label name longer than 23 chars! (%s) in file '%s'.\n", lname, filepath); return; } @@ -2332,7 +2332,7 @@ const char* npc_skip_script(const char* start, const char* buffer, const char* f p = strchr(start,'{'); if( p == NULL ) { - ShowError("npc_skip_script: Missing left curly in file '%s', line'%d'.", filepath, strline(buffer,start-buffer)); + ShowError("npc_skip_script: Missing left curly in file '%s', line '%d'.\n", filepath, strline(buffer,start-buffer)); return NULL;// can't continue } @@ -2368,7 +2368,7 @@ const char* npc_skip_script(const char* start, const char* buffer, const char* f } else if( *p == '\0' ) {// end of buffer - ShowError("Missing %d right curlys at file '%s', line '%d'.\n", curly_count, filepath, strline(buffer,p-buffer)); + ShowError("Missing %d right curlys in file '%s', line '%d'.\n", curly_count, filepath, strline(buffer,p-buffer)); return NULL;// can't continue } } @@ -2478,7 +2478,7 @@ const char* npc_parse_script(char* w1, char* w2, char* w3, char* w4, const char* // 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 (%s)\n", + ShowWarning("npc_parse_script: duplicate event %s::%s in file '%s'.\n", nd->exname, nd->u.scr.label_list[i].name, filepath); } npc->timerevent_export(nd, i); @@ -2529,14 +2529,14 @@ const char* npc_parse_duplicate(char* w1, char* w2, char* w3, char* w4, const ch // get the npc being duplicated if( w2[length-1] != ')' || length <= 11 || length-11 >= sizeof(srcname) ) {// does not match 'duplicate(%127s)', name is empty or too long - ShowError("npc_parse_script: bad duplicate name in file '%s', line '%d' : %s\n", filepath, strline(buffer,start-buffer), w2); + ShowError("npc_parse_script: bad duplicate name in file '%s', line '%d': %s\n", filepath, strline(buffer,start-buffer), w2); return end;// next line, try to continue } safestrncpy(srcname, w2+10, length-10); dnd = npc->name2id(srcname); if( dnd == NULL) { - ShowError("npc_parse_script: original npc not found for duplicate in file '%s', line '%d' : %s\n", filepath, strline(buffer,start-buffer), srcname); + ShowError("npc_parse_script: original npc not found for duplicate in file '%s', line '%d': %s\n", filepath, strline(buffer,start-buffer), srcname); return end;// next line, try to continue } src_id = dnd->bl.id; @@ -2547,8 +2547,10 @@ const char* npc_parse_duplicate(char* w1, char* w2, char* w3, char* w4, const ch x = y = dir = 0; m = -1; } else { - if( sscanf(w1, "%31[^,],%d,%d,%d", mapname, &x, &y, &dir) != 4 )// <map name>,<x>,<y>,<facing> - { + int fields = sscanf(w1, "%31[^,],%d,%d,%d", mapname, &x, &y, &dir); + if( type == WARP && fields == 3 ) { // <map name>,<x>,<y> + dir = 0; + } else if( fields != 4 ) {// <map name>,<x>,<y>,<facing> ShowError("npc_parse_duplicate: Invalid placement format for duplicate 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); return end;// next line, try to continue } @@ -2636,7 +2638,7 @@ const char* npc_parse_duplicate(char* w1, char* w2, char* w3, char* w4, const ch // 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 (%s)\n", + ShowWarning("npc_parse_duplicate: duplicate event %s::%s in file '%s'.\n", nd->exname, nd->u.scr.label_list[i].name, filepath); } npc->timerevent_export(nd, i); @@ -2919,7 +2921,7 @@ const char* npc_parse_function(char* w1, char* w2, char* w3, char* w4, const cha if (func_db->put(func_db, DB->str2key(w3), DB->ptr2data(scriptroot), &old_data)) { struct script_code *oldscript = (struct script_code*)DB->data2ptr(&old_data); - ShowInfo("npc_parse_function: Overwriting user function [%s] (%s:%d)\n", w3, filepath, strline(buffer,start-buffer)); + ShowWarning("npc_parse_function: Overwriting user function [%s] in file '%s', line '%d'.\n", w3, filepath, strline(buffer,start-buffer)); script->free_vars(oldscript->script_vars); aFree(oldscript->script_buf); aFree(oldscript); @@ -2977,33 +2979,33 @@ const char* npc_parse_mob(char* w1, char* w2, char* w3, char* w4, const char* st mobspawn.m = (unsigned short)m; if( x < 0 || x >= map->list[mobspawn.m].xs || y < 0 || y >= map->list[mobspawn.m].ys ) { - ShowError("npc_parse_mob: Spawn coordinates out of range: %s (%d,%d), map size is (%d,%d) - %s %s (file '%s', line '%d').\n", map->list[mobspawn.m].name, x, y, (map->list[mobspawn.m].xs-1), (map->list[mobspawn.m].ys-1), w1, w3, filepath, strline(buffer,start-buffer)); + ShowError("npc_parse_mob: Spawn coordinates out of range: %s (%d,%d), map size is (%d,%d) - %s %s in file '%s', line '%d'.\n", map->list[mobspawn.m].name, x, y, (map->list[mobspawn.m].xs-1), (map->list[mobspawn.m].ys-1), w1, w3, filepath, strline(buffer,start-buffer)); return strchr(start,'\n');// skip and continue } // check monster ID if exists! if( mob->db_checkid(class_) == 0 ) { - ShowError("npc_parse_mob: Unknown mob ID %d (file '%s', line '%d').\n", class_, filepath, strline(buffer,start-buffer)); + ShowError("npc_parse_mob: Unknown mob ID %d in file '%s', line '%d'.\n", class_, filepath, strline(buffer,start-buffer)); return strchr(start,'\n');// skip and continue } if( num < 1 || num > 1000 ) { - ShowError("npc_parse_mob: Invalid number of monsters %d, must be inside the range [1,1000] (file '%s', line '%d').\n", num, filepath, strline(buffer,start-buffer)); + ShowError("npc_parse_mob: Invalid number of monsters %d, must be inside the range [1,1000] in file '%s', line '%d'.\n", num, filepath, strline(buffer,start-buffer)); return strchr(start,'\n');// skip and continue } if( (mobspawn.state.size < 0 || mobspawn.state.size > 2) && size != -1 ) { - ShowError("npc_parse_mob: Invalid size number %d for mob ID %d (file '%s', line '%d').\n", mobspawn.state.size, class_, filepath, strline(buffer, start - buffer)); + ShowError("npc_parse_mob: Invalid size number %d for mob ID %d in file '%s', line '%d'.\n", mobspawn.state.size, class_, filepath, strline(buffer, start - buffer)); return strchr(start, '\n'); } if( (mobspawn.state.ai < 0 || mobspawn.state.ai > 4) && ai != -1 ) { - ShowError("npc_parse_mob: Invalid ai %d for mob ID %d (file '%s', line '%d').\n", mobspawn.state.ai, class_, filepath, strline(buffer, start - buffer)); + ShowError("npc_parse_mob: Invalid ai %d for mob ID %d in file '%s', line '%d'.\n", mobspawn.state.ai, class_, filepath, strline(buffer, start - buffer)); return strchr(start, '\n'); } if( (mob_lv == 0 || mob_lv > MAX_LEVEL) && mob_lv != -1 ) { - ShowError("npc_parse_mob: Invalid level %d for mob ID %d (file '%s', line '%d').\n", mob_lv, class_, filepath, strline(buffer, start - buffer)); + ShowError("npc_parse_mob: Invalid level %d for mob ID %d in file '%s', line '%d'.\n", mob_lv, class_, filepath, strline(buffer, start - buffer)); return strchr(start, '\n'); } @@ -3033,7 +3035,7 @@ const char* npc_parse_mob(char* w1, char* w2, char* w3, char* w4, const char* st } if(mobspawn.delay1>0xfffffff || mobspawn.delay2>0xfffffff) { - ShowError("npc_parse_mob: Invalid spawn delays %u %u (file '%s', line '%d').\n", mobspawn.delay1, mobspawn.delay2, filepath, strline(buffer,start-buffer)); + ShowError("npc_parse_mob: Invalid spawn delays %u %u in file '%s', line '%d'.\n", mobspawn.delay1, mobspawn.delay2, filepath, strline(buffer,start-buffer)); return strchr(start,'\n');// skip and continue } @@ -3047,7 +3049,7 @@ const char* npc_parse_mob(char* w1, char* w2, char* w3, char* w4, const char* st //Verify dataset. if( !mob->parse_dataset(&mobspawn) ) { - ShowError("npc_parse_mob: Invalid dataset for monster ID %d (file '%s', line '%d').\n", class_, filepath, strline(buffer,start-buffer)); + ShowError("npc_parse_mob: Invalid dataset for monster ID %d in file '%s', line '%d'.\n", class_, filepath, strline(buffer,start-buffer)); return strchr(start,'\n');// skip and continue } @@ -3141,7 +3143,7 @@ const char* npc_parse_mapflag(char* w1, char* w2, char* w3, char* w4, const char map->list[m].save.x = savex; map->list[m].save.y = savey; if (!map->list[m].save.map) { - ShowWarning("npc_parse_mapflag: Specified save point map '%s' for mapflag 'nosave' not found (file '%s', line '%d'), using 'SavePoint'.\n * w1=%s\n * w2=%s\n * w3=%s\n * w4=%s\n", savemap, filepath, strline(buffer,start-buffer), w1, w2, w3, w4); + ShowWarning("npc_parse_mapflag: Specified save point map '%s' for mapflag 'nosave' not found in file '%s', line '%d', using 'SavePoint'.\n * w1=%s\n * w2=%s\n * w3=%s\n * w4=%s\n", savemap, filepath, strline(buffer,start-buffer), w1, w2, w3, w4); map->list[m].save.x = -1; map->list[m].save.y = -1; } @@ -3179,11 +3181,11 @@ const char* npc_parse_mapflag(char* w1, char* w2, char* w3, char* w4, const char map->list[m].flag.gvg = 0; map->list[m].flag.gvg_dungeon = 0; map->list[m].flag.gvg_castle = 0; - ShowWarning("npc_parse_mapflag: You can't set PvP and GvG flags for the same map! Removing GvG flags from %s (file '%s', line '%d').\n", map->list[m].name, filepath, strline(buffer,start-buffer)); + ShowWarning("npc_parse_mapflag: You can't set PvP and GvG flags for the same map! Removing GvG flags from %s in file '%s', line '%d'.\n", map->list[m].name, filepath, strline(buffer,start-buffer)); } if( state && map->list[m].flag.battleground ) { map->list[m].flag.battleground = 0; - ShowWarning("npc_parse_mapflag: You can't set PvP and BattleGround flags for the same map! Removing BattleGround flag from %s (file '%s', line '%d').\n", map->list[m].name, filepath, strline(buffer,start-buffer)); + ShowWarning("npc_parse_mapflag: You can't set PvP and BattleGround flags for the same map! Removing BattleGround flag from %s in file '%s', line '%d'.\n", map->list[m].name, filepath, strline(buffer,start-buffer)); } if( state && (zone = strdb_get(map->zone_db, MAP_ZONE_PVP_NAME)) && map->list[m].zone != zone ) { map->zone_change(m,zone,start,buffer,filepath); @@ -3229,11 +3231,11 @@ const char* npc_parse_mapflag(char* w1, char* w2, char* w3, char* w4, const char map->list[m].flag.gvg = state; if( state && map->list[m].flag.pvp ) { map->list[m].flag.pvp = 0; - ShowWarning("npc_parse_mapflag: You can't set PvP and GvG flags for the same map! Removing PvP flag from %s (file '%s', line '%d').\n", map->list[m].name, filepath, strline(buffer,start-buffer)); + ShowWarning("npc_parse_mapflag: You can't set PvP and GvG flags for the same map! Removing PvP flag from %s in file '%s', line '%d'.\n", map->list[m].name, filepath, strline(buffer,start-buffer)); } if( state && map->list[m].flag.battleground ) { map->list[m].flag.battleground = 0; - ShowWarning("npc_parse_mapflag: You can't set GvG and BattleGround flags for the same map! Removing BattleGround flag from %s (file '%s', line '%d').\n", map->list[m].name, filepath, strline(buffer,start-buffer)); + ShowWarning("npc_parse_mapflag: You can't set GvG and BattleGround flags for the same map! Removing BattleGround flag from %s in file '%s', line '%d'.\n", map->list[m].name, filepath, strline(buffer,start-buffer)); } if( state && (zone = strdb_get(map->zone_db, MAP_ZONE_GVG_NAME)) && map->list[m].zone != zone ) { map->zone_change(m,zone,start,buffer,filepath); @@ -3261,13 +3263,13 @@ const char* npc_parse_mapflag(char* w1, char* w2, char* w3, char* w4, const char if( map->list[m].flag.battleground && map->list[m].flag.pvp ) { map->list[m].flag.pvp = 0; - ShowWarning("npc_parse_mapflag: You can't set PvP and BattleGround flags for the same map! Removing PvP flag from %s (file '%s', line '%d').\n", map->list[m].name, filepath, strline(buffer,start-buffer)); + ShowWarning("npc_parse_mapflag: You can't set PvP and BattleGround flags for the same map! Removing PvP flag from %s in file '%s', line '%d'.\n", map->list[m].name, filepath, strline(buffer,start-buffer)); } if( map->list[m].flag.battleground && (map->list[m].flag.gvg || map->list[m].flag.gvg_dungeon || map->list[m].flag.gvg_castle) ) { map->list[m].flag.gvg = 0; map->list[m].flag.gvg_dungeon = 0; map->list[m].flag.gvg_castle = 0; - ShowWarning("npc_parse_mapflag: You can't set GvG and BattleGround flags for the same map! Removing GvG flag from %s (file '%s', line '%d').\n", map->list[m].name, filepath, strline(buffer,start-buffer)); + ShowWarning("npc_parse_mapflag: You can't set GvG and BattleGround flags for the same map! Removing GvG flag from %s in file '%s', line '%d'.\n", map->list[m].name, filepath, strline(buffer,start-buffer)); } if( state && (zone = strdb_get(map->zone_db, MAP_ZONE_BG_NAME)) && map->list[m].zone != zone ) { @@ -3368,11 +3370,11 @@ const char* npc_parse_mapflag(char* w1, char* w2, char* w3, char* w4, const char } if( modifier[0] == '\0' ) { - ShowWarning("npc_parse_mapflag: Missing 5th param for 'adjust_unit_duration' flag! removing flag from %s (file '%s', line '%d').\n", map->list[m].name, filepath, strline(buffer,start-buffer)); + ShowWarning("npc_parse_mapflag: Missing 5th param for 'adjust_unit_duration' flag! removing flag from %s in file '%s', line '%d'.\n", map->list[m].name, filepath, strline(buffer,start-buffer)); } else if( !( skill_id = skill->name2id(skill_name) ) || !skill->get_unit_id( skill->name2id(skill_name), 0) ) { - ShowWarning("npc_parse_mapflag: Unknown skill (%s) for 'adjust_unit_duration' flag! removing flag from %s (file '%s', line '%d').\n",skill_name, map->list[m].name, filepath, strline(buffer,start-buffer)); + ShowWarning("npc_parse_mapflag: Unknown skill (%s) for 'adjust_unit_duration' flag! removing flag from %s in file '%s', line '%d'.\n",skill_name, map->list[m].name, filepath, strline(buffer,start-buffer)); } else if ( atoi(modifier) < 1 || atoi(modifier) > USHRT_MAX ) { - ShowWarning("npc_parse_mapflag: Invalid modifier '%d' for skill '%s' for 'adjust_unit_duration' flag! removing flag from %s (file '%s', line '%d').\n", atoi(modifier), skill_name, map->list[m].name, filepath, strline(buffer,start-buffer)); + ShowWarning("npc_parse_mapflag: Invalid modifier '%d' for skill '%s' for 'adjust_unit_duration' flag! removing flag from %s in file '%s', line '%d'.\n", atoi(modifier), skill_name, map->list[m].name, filepath, strline(buffer,start-buffer)); } else { int idx = map->list[m].unit_count; @@ -3422,11 +3424,11 @@ const char* npc_parse_mapflag(char* w1, char* w2, char* w3, char* w4, const char } if( modifier[0] == '\0' ) { - ShowWarning("npc_parse_mapflag: Missing 5th param for 'adjust_skill_damage' flag! removing flag from %s (file '%s', line '%d').\n", map->list[m].name, filepath, strline(buffer,start-buffer)); + ShowWarning("npc_parse_mapflag: Missing 5th param for 'adjust_skill_damage' flag! removing flag from %s in file '%s', line '%d'.\n", map->list[m].name, filepath, strline(buffer,start-buffer)); } else if( !( skill_id = skill->name2id(skill_name) ) ) { - ShowWarning("npc_parse_mapflag: Unknown skill (%s) for 'adjust_skill_damage' flag! removing flag from %s (file '%s', line '%d').\n", skill_name, map->list[m].name, filepath, strline(buffer,start-buffer)); + ShowWarning("npc_parse_mapflag: Unknown skill (%s) for 'adjust_skill_damage' flag! removing flag from %s in file '%s', line '%d'.\n", skill_name, map->list[m].name, filepath, strline(buffer,start-buffer)); } else if ( atoi(modifier) < 1 || atoi(modifier) > USHRT_MAX ) { - ShowWarning("npc_parse_mapflag: Invalid modifier '%d' for skill '%s' for 'adjust_skill_damage' flag! removing flag from %s (file '%s', line '%d').\n", atoi(modifier), skill_name, map->list[m].name, filepath, strline(buffer,start-buffer)); + ShowWarning("npc_parse_mapflag: Invalid modifier '%d' for skill '%s' for 'adjust_skill_damage' flag! removing flag from %s in file '%s', line '%d'.\n", atoi(modifier), skill_name, map->list[m].name, filepath, strline(buffer,start-buffer)); } else { int idx = map->list[m].skill_count; @@ -3464,7 +3466,7 @@ const char* npc_parse_mapflag(char* w1, char* w2, char* w3, char* w4, const char struct map_zone_data *zone; if( !(zone = strdb_get(map->zone_db, w4)) ) { - ShowWarning("npc_parse_mapflag: Invalid zone '%s'! removing flag from %s (file '%s', line '%d').\n", w4, map->list[m].name, filepath, strline(buffer,start-buffer)); + ShowWarning("npc_parse_mapflag: Invalid zone '%s'! removing flag from %s in file '%s', line '%d'.\n", w4, map->list[m].name, filepath, strline(buffer,start-buffer)); } else if( map->list[m].zone != zone ) { map->zone_change(m,zone,start,buffer,filepath); } @@ -3489,7 +3491,7 @@ const char* npc_parse_mapflag(char* w1, char* w2, char* w3, char* w4, const char } else if ( !strcmpi(w3,"nocashshop") ) { map->list[m].flag.nocashshop = (state) ? 1 : 0; } else - ShowError("npc_parse_mapflag: unrecognized mapflag '%s' (file '%s', line '%d').\n", w3, filepath, strline(buffer,start-buffer)); + ShowError("npc_parse_mapflag: unrecognized mapflag '%s' in file '%s', line '%d'.\n", w3, filepath, strline(buffer,start-buffer)); return strchr(start,'\n');// continue } diff --git a/src/map/packets.h b/src/map/packets.h index 918f0a10f..55a85e182 100644 --- a/src/map/packets.h +++ b/src/map/packets.h @@ -2646,4 +2646,8 @@ packet(0x020d,-1); packetKeys(0x7E241DE0,0x5E805580,0x3D807D80); /* Thanks to Shakto */ #endif +#if defined(OBFUSCATIONKEY1) && defined(OBFUSCATIONKEY2) && defined(OBFUSCATIONKEY3) + packetKeys(OBFUSCATIONKEY1,OBFUSCATIONKEY2,OBFUSCATIONKEY3); +#endif + #endif /* _PACKETS_H_ */ diff --git a/src/map/pc.c b/src/map/pc.c index 1ed66a313..d1d76fd4c 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -9414,10 +9414,16 @@ void pc_overheat(struct map_session_data *sd, int val) { */ bool pc_isautolooting(struct map_session_data *sd, int nameid) { - int i; - if( !sd->state.autolooting ) + int i = 0; + + if (sd->state.autoloottype && sd->state.autoloottype&(1<<itemdb_type(nameid))) + return true; + + if (!sd->state.autolooting) return false; + ARR_FIND(0, AUTOLOOTITEM_SIZE, i, sd->state.autolootid[i] == nameid); + return (i != AUTOLOOTITEM_SIZE); } diff --git a/src/map/pc.h b/src/map/pc.h index 05e8ba7b4..7ae92c9a5 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -166,6 +166,7 @@ struct map_session_data { short pmap; // Previous map on Map Change unsigned short autoloot; unsigned short autolootid[AUTOLOOTITEM_SIZE]; // [Zephyrus] + unsigned short autoloottype; unsigned int autolooting : 1; //performance-saver, autolooting state for @alootid unsigned short autobonus; //flag to indicate if an autobonus is activated. [Inkfish] unsigned int gmaster_flag : 1; diff --git a/src/map/script.c b/src/map/script.c index 944759f39..3b0557235 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -1904,9 +1904,9 @@ void script_errorwarning_sub(StringBuf *buf, const char* src, const char* file, } if( line >= 0 ) - StrBuf->Printf(buf, "script error on %s line %d\n", file, line); + StrBuf->Printf(buf, "script error in file '%s' line %d\n", file, line); else - StrBuf->Printf(buf, "script error on %s item ID %d\n", file, -line); + StrBuf->Printf(buf, "script error in file '%s' item ID %d\n", file, -line); StrBuf->Printf(buf, " %s\n", error_msg); for(j = 0; j < 5; j++ ) { |