summaryrefslogtreecommitdiff
path: root/src/map/script.c
AgeCommit message (Collapse)AuthorFilesLines
2016-09-12Add script command navigateto. Add packet for this command.Andrei Karas1-0/+55
Based on rAthena commits: commit 4f13007fec7f08c265620a71c3bc4806d186c0f1 Author: Lemongrass3110 <lemongrass@kstp.at> Date: Sun Mar 6 21:48:47 2016 +0100 commit 809f220b9f5ef70ee062ee56ae6e8d5f56cb5d32 Author: aleos89 <aleos89@users.noreply.github.com> Date: Sun Mar 6 16:15:54 2016 -0500 commit 179f73424934d528ebe494dfb66503c182eacb09 Author: aleos89 <aleos89@users.noreply.github.com> Date: Sun Mar 6 16:10:15 2016 -0500
2016-09-11Clarified/rewritten part of script_array_ensure_zero()Haru1-9/+12
- There exists a case where st is NULL, such as when called by script->cleararray_pc(). This documents such possibility. - Fixes Coverity CID 152760 - Follow-up to 0f803e7 Signed-off-by: Haru <haru@dotalux.com>
2016-09-11Changed GD_MAX check to be non-inclusiveHaru1-1/+1
- GD_MAX is not a valid guild skill ID - Fixes Coverity CID 152761 - Follow-up to 0f803e7 Signed-off-by: Haru <haru@dotalux.com>
2016-09-10Add missing checks into script.cAndrei Karas1-60/+208
2016-08-20Re-added HPM support for configuration settingsHaru1-1/+2
Plugin settings should be relative to the the libconfig file root. For example, a configuration setting of type HPCT_CHAR will be relative to the root of conf/char/char-server.conf. In order to add a configuration entry inside the char_configuration block, the full configuration path (slash-delimited) should be passed to addCharConf(), as in the following example: `addCharConf("char_configuration/my_setting", my_parser_function);` Signed-off-by: Haru <haru@dotalux.com>
2016-08-19Ported script.conf to libconfigHaru1-41/+44
Ported to modern Hercules and cleaned up from Panikon's commits: a0e4da63ef3afcd896603398e2468876681ac54a, b5f487c2676833492a6d4044b5d1f1bb1e552b04 Signed-off-by: Haru <haru@dotalux.com>
2016-07-14Changed chat_data::minLvl and chat_data::maxLvl to int and renamed to ↵Haru1-2/+2
min_level and max_level Fixes several -Wsign-compare issues Signed-off-by: Haru <haru@dotalux.com>
2016-07-12Interface md5calc.chemagx1-2/+2
2016-07-10HULD: Improved .po file parser to properly read concatenated stringsHaru1-57/+141
- For compliance with gettext's .po file specifications Signed-off-by: Haru <haru@dotalux.com>
2016-07-04Add one check for possible script issue.Andrei Karas1-3/+15
2016-06-30Use item attribute as flags varible. Now only ATTR_BROKEN flag exists.Andrei Karas1-6/+8
2016-06-25Corrected an issue that prevented changing default languagesHaru1-12/+26
The script->get_translation_file_name() is more robust (and actually works) now. Signed-off-by: Haru <haru@dotalux.com>
2016-06-25Added mesf() command (combination of mes() and sprintf())Haru1-0/+33
Signed-off-by: Haru <haru@dotalux.com>
2016-06-25Added _$() macro to the script engine to mark a translatable string as ↵Haru1-2/+9
format string - Strings passed to sprintf should use the _$() macro instead of _(), to generate the .pot translation template with a directive to correctly handle the % sign. - Strings passed through _() are instead explicitly marked as regular (non format) strings if they contain '%'. Signed-off-by: Haru <haru@dotalux.com>
2016-06-25Split sprintf logic out of buildin_sprintf (to be used by other commands as ↵Haru1-214/+234
well)
2016-06-25Removed the uncommon (and useless) multi-argument variant of mes()Haru1-12/+3
Signed-off-by: Haru <haru@dotalux.com>
2016-06-25Moved translations template generator to a pluginHaru1-77/+0
Signed-off-by: Haru <haru@dotalux.com>
2016-06-25Improved the format of the exported .pot translation templateHaru1-1/+1
Signed-off-by: Haru <haru@dotalux.com>
2016-06-25Split translation handling out of parse_simpleexpr_string()Haru1-73/+81
Signed-off-by: Haru <haru@dotalux.com>
2016-06-25Split parse_simpleexpr() in specialized sub-functions (HPM compatibility)Haru1-178/+212
- parse_simpleexpr_paren() - parse_simpleexpr_number() - parse_simplexpr_string() - parse_simpleexpr_name() Signed-off-by: Haru <haru@dotalux.com>
2016-06-25Correctly escaped special characters in the generated_translations.potHaru1-15/+11
Signed-off-by: Haru <haru@dotalux.com>
2016-06-25Improved handling of nested function calls by the HULDHaru1-17/+14
Signed-off-by: Haru <haru@dotalux.com>
2016-06-25Re-implemented BUILDIN(sprintf)Haru1-93/+188
- The function now checks its arguments, rather than passing them to the system implementation (safer against arbitrary memory access or wrong variable type) - Implemented positional ('%1$d') specifiers (POSIX style) - See script_commands.txt for details about the supported format specifiers. Signed-off-by: Haru <haru@dotalux.com>
2016-06-25Changed script->translation_buf to a VECTORHaru1-25/+24
Signed-off-by: Haru <haru@dotalux.com>
2016-06-25Replaced script_code::script_buf with a VECTORHaru1-36/+43
- Fixes various signed/unsigned comparisons. Signed-off-by: Haru <haru@dotalux.com>
2016-06-25Replaced script->buf with a VECTORHaru1-121/+119
- Fixes various signed/unsigned comparisons. Signed-off-by: Haru <haru@dotalux.com>
2016-06-25Replaced struct script_string_buf definition with a VECTORHaru1-80/+73
- Fixes various signed/unsigned comparisons. Signed-off-by: Haru <haru@dotalux.com>
2016-05-14Removed leftover definition of BUILDIN(checkre)Haru1-62/+0
- The command was already deprecated in ca877ec and removed in 7e93d08 - Resolves #1288 Signed-off-by: Haru <haru@dotalux.com>
2016-05-08Fixed various issues pointed out by cppcheckHaru1-31/+23
Signed-off-by: Haru <haru@dotalux.com>
2016-04-29Fix issues found by new warnings.Andrei Karas1-0/+1
2016-04-23Removed the 'len' argument from clif_disp_onlyself() and clif->disp_message()Haru1-1/+1
- The argument was redundant, since the passed value is always the same as the passed string's length (it doesn't make sense otherwise). The argument is implicit now. Less typing and less errors. Signed-off-by: Haru <haru@dotalux.com>
2016-04-23Corrected the type of the 'length' argument of various broadcast-related ↵Haru1-14/+25
functions - Variable types were changed to int - Corrects several warnings in VS2015 - Affected functions: `clif->broadcast()`, `clif->broadcast2()`, `intif->broadcast()`, `intif->broadcast2()` Signed-off-by: Haru <haru@dotalux.com>
2016-04-23Changed map_session_data::chatID to int (and renamed to chat_id)Haru1-1/+1
- Chat IDs are signed integers. - Resolves various warnings, depending on the compiler settings. Signed-off-by: Haru <haru@dotalux.com>
2016-04-04Merge pull request #1210 from HerculesWS/wcast_qualAndrei Karas1-148/+178
Added -Wcast-qual compiler flag
2016-04-02Unittalk script cmd shouldn't display the hidden name of npcAngelmelody1-1/+5
Signed-off-by: Haru <haru@dotalux.com>
2016-03-20Dropped typedef from DBMapHaru1-4/+6
Signed-off-by: Haru <haru@dotalux.com>
2016-03-20Dropped typedef from DBIteratorHaru1-11/+14
Signed-off-by: Haru <haru@dotalux.com>
2016-03-20Dropped typedefs from union DBKey and struct DBDataHaru1-4/+7
Signed-off-by: Haru <haru@dotalux.com>
2016-03-20Removed unnecessary typedefs from sql.hHaru1-1/+2
- Sql -> struct Sql - SqlStmt -> struct SqlStmt - SqlDataType -> enum SqlDataType This is expected to improve compile time, by removing #include cycles (and forward declaring instead) Signed-off-by: Haru <haru@dotalux.com>
2016-03-20Added const qualifier to the value argument of script->setd_subHaru1-4/+4
Signed-off-by: Haru <haru@dotalux.com>
2016-03-20Added separate char* and const char* data types to struct script_dataHaru1-69/+84
Used, respectively, by C_STR and C_CONSTSTR Signed-off-by: Haru <haru@dotalux.com>
2016-03-20Changed script->get_val to return a const pointerHaru1-14/+17
Signed-off-by: Haru <haru@dotalux.com>
2016-03-20Added const qualifier to some typecastsHaru1-41/+44
Signed-off-by: Haru <haru@dotalux.com>
2016-03-19Enable use of specialeffect 74,SELF,<npc>;Victor1-12/+14
Partly based on #1134 Closes #1134 as merged Signed-off-by: Haru <haru@dotalux.com>
2016-03-19status_get_name returns NULL instead of Unknown, Changed all functions to ↵Dastgir1-3/+3
use clif_get_bl_name
2016-03-11Hardcore Parameters from constant database to avoid synchronize issues with ↵hemagx1-0/+47
source now defining new parameters in the constants.conf database is deprecated and should be defined in source instead
2016-02-28Changed mob mode field to 32 bit, for future expansionHaru1-3/+4
Signed-off-by: Haru <haru@dotalux.com>
2016-02-27Corrected return value for some BUILDIN() functionsHaru1-4/+4
- The functions were returning `(bool)-1` instead of `false` in case of error, or `(bool)0` instead of `true` in case of success. Signed-off-by: Haru <haru@dotalux.com>
2016-02-27Replaced various '-1' with the correct constantHaru1-1/+1
INFINITE_DURATION, INVALID_TIMER, SC_NONE, INDEX_NOT_FOUND, depending on context. Signed-off-by: Haru <haru@dotalux.com>
2016-02-24Removed unnecessary explicit casts of the value of WBUFPHaru1-1/+1
- WBUFP now returns a pointer to void, which automatically casts to any non-const or const pointer. Signed-off-by: Haru <haru@dotalux.com>