summaryrefslogtreecommitdiff
path: root/src/map/script.h
AgeCommit message (Collapse)AuthorFilesLines
2016-03-20Removed unnecessary typedefs from sql.hHaru1-2/+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-1/+1
Signed-off-by: Haru <haru@dotalux.com>
2016-03-20Added separate char* and const char* data types to struct script_dataHaru1-11/+16
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-1/+1
Signed-off-by: Haru <haru@dotalux.com>
2016-03-11Hardcore Parameters from constant database to avoid synchronize issues with ↵hemagx1-0/+1
source now defining new parameters in the constants.conf database is deprecated and should be defined in source instead
2016-01-29Merge pull request #1108 from 4144/pcreconfigureHaru1-2/+0
Enable pcre by default in configure and show error if pcre missing.
2016-01-25Added source support for special comments in the constdbHaru1-0/+1
- To be used by the constdb2doc plugin Signed-off-by: Haru <haru@dotalux.com>
2016-01-21Remove unused PCRE_SUPPORT define.Andrei Karas1-2/+0
2016-01-13Added support to mark constants in db/constants.conf as deprecatedHaru1-2/+2
Signed-off-by: Haru <haru@dotalux.com>
2016-01-06Change all TBL_PC to struct map_session_data as per style guidelineshemagx1-5/+5
Signed-off-by: Haru <haru@dotalux.com>
2015-12-25Implemented NoViewIDDastgir1-1/+2
(http://herc.ws/board/topic/10020-official-mapflag-to-disable-viewid/) Closes #926 as merged Signed-off-by: Haru <haru@dotalux.com>
2015-12-20Add script->id2sd function to throw error properly if player not foundAnnieRuru1-0/+3
- included script->charid2sd and script->nick2sd
2015-12-15Added GPL-compliant header to all sources and build scriptsHaru1-4/+20
Signed-off-by: Haru <haru@dotalux.com>
2015-12-15Added const qualifier to the w1~w4 arguments of npc_parse_scriptHaru1-1/+1
Signed-off-by: Haru <haru@dotalux.com>
2015-11-14Changed struct script_queue_iterator::item into a VECTOR and Renamed to ↵Haru1-3/+3
::entries Signed-off-by: Haru <haru@dotalux.com>
2015-11-14Changed struct script_queue::item into a VECTOR and Renamed to ::entriesHaru1-5/+4
Signed-off-by: Haru <haru@dotalux.com>
2015-11-14Renamed hQueue/hQueueIterator/hQueueOpt to latest standardsHaru1-23/+30
Signed-off-by: Haru <haru@dotalux.com>
2015-11-14Changed script->hq and script->hqi into VECTOR typeHaru1-3/+2
Signed-off-by: Haru <haru@dotalux.com>
2015-10-01Split function set_reg and get_val into functions based on variable types.Andrei Karas1-0/+16
2015-08-15HPM compatibility improvementsHaru1-3/+3
Improved compatibility, portability and standards conformance. - Since it is not possible to portably and reliably re-use the core's symbols in plugins, symbols are no longer exported unless explicitly required, in the UNIX builds. This mimics the Windows behavior and adds HPM compatibility to OSes such as FreeBSD. Credits to Andrei Karas for making this possible. - For convenience, it is no longer necessary to call GET_SYMBOL, since the plugin will automatically import all the available symbols when it's loaded, depending on the included headers. - Plugins are now supposed to include the "common/hercules.h" header before including anything else. Incluing common/HPMi.h, common/cbasetypes.h or conf/core.h is no longer necessary, as those are guaranteed to be automatically included by hercules.h. - HPM API version bumped to 1.1. Signed-off-by: Haru <haru@dotalux.com>
2015-08-10Add script interface function run_pet. It do same thing as run.Andrei Karas1-0/+1
2015-08-10Add script interface function run_npc. It do same thing as run.Andrei Karas1-1/+2
2015-08-10Move unequip item script function call into function ↵Andrei Karas1-0/+1
script_run_item_unequip_script.
2015-08-10Move equip item script function call into function script_run_item_equip_script.Andrei Karas1-0/+2
2015-08-10Move use item script function call into function script_run_use_script.Andrei Karas1-0/+1
2015-06-19Removed ".." from include directivesHaru1-7/+7
- Include directives are now directory-independent. - This will allow building plugins from other directories in future. Signed-off-by: Haru <haru@dotalux.com>
2015-03-15Follow up 330e31cc71ece055908acb1eb967b4009ebc9c46shennetsind1-0/+1
Fixed an issue caused by unescaped characters being written and read out of the .pot unproperly. This commit also causes map server to print the file it wrote to when terminating Signed-off-by: shennetsind <ind@henn.et>
2015-02-23Hercules Ultimate Localization Designshennetsind1-0/+52
Servers can now run on any number of languages, without editing npc files. Designed by Haruna and Ind http://hercules.ws/board/topic/8687-hercules-ultimate-localization-design/ Signed-off-by: shennetsind <ind@henn.et>
2015-01-12Blocked compilation of plugins that use unavailable functionsHaru1-0/+2
- Rather than failing at runtime, plugins that try to access non-interfaced, unavailable functions or variables, will now show an error at compile-time. Signed-off-by: Haru <haru@dotalux.com>
2014-12-16Add function what call OnUntouch event.Andrei Karas1-0/+1
2014-11-16Whitespace cleanup (no code changes)Haru1-9/+9
This includes, and is not limited to: mixed or wrong indentation, excess whitespace (horizontal and vertical), misalignment, trailing spaces. Signed-off-by: Haru <haru@dotalux.com>
2014-11-14Add ability to add deprecated command from scripts and plugins.Andrei Karas1-1/+1
2014-10-28Removed some temporary case-check error messages.Haru1-2/+1
- Control flow statements (break, case, continue, default, do, for, if, switch, whilei, else) and sub-function declarations (function) will no longer show a custom error message when they are incorrectly capitalized. - Note: This does not mean that they are no longer case-sensitive. This only means that no special message will be shown in case such an error is detected. The script engine will throw a normal error, as it would with any other kind of typo, rather than treating this as a special case. Enough time was given to update third party scripts, and it is now time to clean up our parsing code and get rid of these special warnings. - Variables, labels and commands will still show a warning for the time being, since the side-effects of silently ignoring it could be quite dangerous. An alternative approach to the case-check will be presented in future. For now, those who want to disable it (and save a bit on execution time and memory use), can simply comment out the #define ENABLE_CASE_CHECK line in script.h, as usual. Signed-off-by: Haru <haru@dotalux.com>
2014-10-28Removed some temporary case-check error messages.Haru1-1/+0
- Top level commands (function, warp, shop, cashshop, script, trader, duplicate, monster, boss_monster, mapflag) will no longer show a custom error message when they are incorrectly capitalized. - Note: This does not mean that the commands are no longer case-sensitive. This only means that no special message will be shown in case such an error is detected. The script engine will throw a normal error, as it would with any other kind of typo, rather than treating this as a special case. Enough time was given to update third party scripts, and it is now time to clean up our parsing code and get rid of these special warnings. Signed-off-by: Haru <haru@dotalux.com>
2014-10-27Added source support to mark script commands as deprecatedHaru1-0/+4
- Commands marked as deprecated will trigger a warning when the script is loaded. (there are currently no commands marked as such, but some will come soon) Signed-off-by: Haru <haru@dotalux.com>
2014-10-18Renamed DeprecationWarning to DeprecationCaseWarning, since that's what it ↵Haru1-3/+3
is about. Signed-off-by: Haru <haru@dotalux.com>
2014-07-11Fixed reserved __identifier violationsHaru1-3/+3
- Complies with CERT DCL37-C - Fixes issue #293 (special thanks to elfring) Signed-off-by: Haru <haru@dotalux.com>
2014-05-16Follow-up to b6b3f58795288701d0e162d43fa6f0a47af913b3Haru1-1/+1
- Includes in some files weren't sorted alphabetically. Special thanks to KeiKun. Signed-off-by: Haru <haru@dotalux.com>
2014-05-10Re-commit of "Fixed order of includes in all source files"Haru1-5/+7
This reverts commit 94657284973f4037596bae468ebfbee5c217e02b.
2014-05-10Revert "Fixed order of includes in all source files"panikon1-7/+5
This reverts commit b6b3f58795288701d0e162d43fa6f0a47af913b3. Fixes issue 8184 http://hercules.ws/board/tracker/issue-8184-cart-related/
2014-05-09Fixed order of includes in all source filesHaru1-5/+7
- Changed order according to the (upcoming) code style guidelines. - Fixes several issues caused by missing headers when their include order is changed or in plugins. Signed-off-by: Haru <haru@dotalux.com>
2014-05-09Return EXIT_FAILURE if a script parse error occurred.Haru1-1/+1
- This affects normal execution as well as ./script-checker runs. Signed-off-by: Haru <haru@dotalux.com>
2014-03-17Added regular expression matching script commands and operatorsHaru1-0/+4
- The script command pcre_match and the operator ~= will return the number of regular expression matches in a given string (roughly equivalent to the php function preg_match or the perl operator =~) - The operator ~! is the opposite of ~= (roughly equivalent to the perl operator !~) - See script_commands and npc/custom/test.txt for more information. Signed-off-by: Haru <haru@dotalux.com>
2014-03-14Added internal awareness of active script instancesshennetsind1-1/+2
Fixes the following issues: - donpcevent could cause a crash when used to a event of the same npc - input/other-dialog-interactions could cause a crash when sending data to a disabled-fakenpc-id'd. Special Thanks to Haruna, ossi0110. Signed-off-by: shennetsind <ind@henn.et>
2014-03-10Fixed a crash caused by NPC variable references in callfuncHaru1-0/+3
- Fixes bugreport:8074, thanks to ahmadshidqi http://hercules.ws/board/tracker/issue-8074-help-crash/ - Also fixed some DBMap allocation mistakes introduced in 4f3156b. - Added testcases to the self-test script. - Made possible thanks to Ind. Signed-off-by: Haru <haru@dotalux.com>
2014-03-05Corrected same-reference check to work on vars with the same name in ↵Haru1-0/+7
different scopes - Fixes bugreport:8008, special thanks to KeyWorld http://hercules.ws/board/tracker/issue-8008-copyarray-fail-on-a-referenced-array-argument/ Signed-off-by: Haru <haru@dotalux.com>
2014-03-05Ref redesign, part 3Haru1-13/+13
- Updated several functions to properly use the data structures defined in parts 1 and 2. - Special thanks to Ind for his help on this, as well as the previous two parts. - Fixes some crashes related to variable references passed back and forth between nested callfunc/callsub scopes (related: 2669e9a, 3259f89, 4f2de07) Signed-off-by: Haru <haru@dotalux.com>
2014-03-05Ref redesign, part 2Haru1-12/+18
- Reorganized regs var/array DBMaps into a specific reg_db structure Signed-off-by: Haru <haru@dotalux.com>
2014-03-05Ref redesign, part 1Haru1-11/+0
- Moved string and numeric mapregs into the same DBMap (for consistency with the other reg types.) Signed-off-by: Haru <haru@dotalux.com>
2014-02-26Improved mapindex_name2id errors for scriptsshennetsind1-0/+1
NPC Error is now printed as well as the original message as proposed by Emistry in http://hercules.ws/board/topic/1864-mapindex-name2id-display-which-npc-caused-this/ Special Thanks to Haru! Signed-off-by: shennetsind <ind@henn.et>