summaryrefslogtreecommitdiff
path: root/src/map/script.c
AgeCommit message (Collapse)AuthorFilesLines
2014-08-07Corrected several format-string errors through the codeHaru1-22/+21
- Functions that expect a printf-style format string are now marked as such, so that gcc/clang will emit a warning warn you if you mismatch format string and arguments. Signed-off-by: Haru <haru@dotalux.com>
2014-07-11Fixed issue with quest exp and bonuses, issue: 8247 ↵panikon1-1/+1
http://hercules.ws/board/index.php?app=tracker&showissue=8247 Corrected *getexp documentation Documented and changed pc_gainexp type
2014-07-11Fixed reserved __identifier violationsHaru1-24/+24
- Complies with CERT DCL37-C - Fixes issue #293 (special thanks to elfring) Signed-off-by: Haru <haru@dotalux.com>
2014-07-08Minor script core fixespanikon1-100/+131
Removed useless calls in script.c Removed nullpo calls in script.c, scripts shouldn't crash the server Added checks in several functions in order to prevent possible crashes *resetstatus, *resetskill, *skillpointcount, *changesex, *successremovecards, *failedremovecards, *getequipcardid, *skilleffect, *atcommand, *cardscnt, *equip, *useatcmd Corrected *specialeffect2 behaviour, when no player was attached and another player name was supplied it would stop script execution instead of displaying the effect
2014-07-06Fixed issue with getlookpanikon1-0/+2
Follow up to 2e6016f, increased MAX_SKILL_TREE in order to fit WE_BABY in Expanded Super Novice
2014-05-30Fixed typos inside src/Shido1-1/+1
2014-05-24Fixed issue in *guildskill, lvl could be set to negative values. (issue: ↵panikon1-1/+1
8214) http://hercules.ws/board/tracker/issue-8214-guildskill-lead-to-negative-guild-skill-level/
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-10Changed set_reg behavior on pc_setparam failure, now it won't simply END the ↵panikon1-1/+5
script, if a dialog window is open it'll also CLOSE it. Corrected Zeny formula in THQS
2014-05-10Moved MAX_CARTS and NEW_CARTS defines into common/mmo.hHaru1-1/+2
- Fixes bugreport:8184, allowing re-commit of 94657284973f4037596bae468ebfbee5c217e02b Signed-off-by: Haru <haru@dotalux.com>
2014-05-10Re-commit of "Fixed order of includes in all source files"Haru1-38/+41
This reverts commit 94657284973f4037596bae468ebfbee5c217e02b.
2014-05-10Revert "Fixed order of includes in all source files"panikon1-41/+38
This reverts commit b6b3f58795288701d0e162d43fa6f0a47af913b3. Fixes issue 8184 http://hercules.ws/board/tracker/issue-8184-cart-related/
2014-05-10Optimized THQS_TTShop.txt and corrected a minor mistakepanikon1-0/+2
Added npc_market_data_db to inter-server.conf Added shop message to messages.conf Fixed small typo in clif_GM_kickack
2014-05-09Fixed order of includes in all source filesHaru1-38/+41
- 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-8/+11
- This affects normal execution as well as ./script-checker runs. Signed-off-by: Haru <haru@dotalux.com>
2014-05-07#Fixed issue 8175panikon1-0/+3
*http://hercules.ws/board/tracker/issue-8175-missing-delequip/ *Documentation wrote by @emistry #Added return values for *delequip
2014-05-06Bug fixes and other changespanikon1-6/+29
#Fixed issue where a corrupted map cache would lead to a crash *Moved Big-endian compatibility functions to common/utils.h #Fixed issue 8162 *http://hercules.ws/board/tracker/issue-8162-loadnpc-doesnt-trigger-oninit-of-duplicate-npcs/ *Added options to npc_parse_duplicate #Fixed issue 8169 *http://hercules.ws/board/tracker/issue-8169-script-command-guildskill-skill-idlevel-not-working-as-intended/ *Changed *guildskill behavior, now it behaves exactly as depicted in the documentation *Updated *guildskill documentation #Added missing GBI types to mapif_parse_GuildBasicInfoChange now it's possible to change guild exp, lv, skill point and skill information #GeoIP revamp *GeoIP module was partially rewritten *Added several data checks to prevent corruption and crashes *Updated GeoIP database *See https://github.com/maxmind/geoip-api-c/blob/master/libGeoIP/GeoIP.c for more information #Added packetver checks regarding NST_MARKET *Now *tradertype warns if user is trying to use this feature with older clients
2014-04-19Fixed issue: 8146panikon1-0/+2
* http://hercules.ws/board/tracker/issue-8146-reloaditemdb-item-combo-db-crash/
2014-04-17Added sysinfo (System Information) functionalitiesHaru1-14/+3
- More informative messages are displayed during startup, to make it easier to identify what system and environment Hercules is running. - Git/SVN revision detection is improved, separating the source version (cached at compile time) from the runtime version, in case the user updated their working copy without recompiling the server. Git version detection is also more reliable, in case a non-default branch is used. - The get_revision script command has been removed (as it was useless to begin with, after the switch to git). An alternative will be provided later, for feature-probing purposes. - The patch was tested under Linux (Gentoo / gcc 4.7 on i686 and x86_64, Debian 6 / gcc 4.4 on i686, Raspbian / gcc 4.6 on armv6l, CentOS 5 / gcc 4.1 on i686, CentOS 6 / gcc 4.4 on x86_64, Linux Mint 15 / gcc 4.7 on x86_64, OS X Mountain Lion / clang 5.0 and gcc 4.8 on x86_64, Cygwin-NT-5.1/gcc 4.8 on i686, FreeBSD 8 / gcc 4.2 on i386, FreeBSD 9 / gcc 4.2 on amd64, FreeBSD 10 / clang 3.3 on amd64, NetBSD 5 / gcc 4.1 on i386, NetBSD 6 / gcc 4.5 on amd64, OpenBSD 5 / gcc 4.2 on amd64, Solaris 11 / gcc 4.5 on i86pc, Windows 7 / Visual Studio 2012 on x86, Windows 8 / Visual Studio 2010 on WOW64, Windows 8.1 / Visual Studio 2013 on WOW64. Signed-off-by: Haru <haru@dotalux.com>
2014-04-04Fixed issue: 8131panikon1-1/+1
http://hercules.ws/board/tracker/issue-8131-sc-chat/ -Documented SC_NOCHAT -Corrected the way that pc_setparam was handling SP_MANNER -Added documentation on *sc_status regarding SC_NOCHAT, to mute a user via script you should set Manner
2014-03-29Fixed getmapxy crashshennetsind1-1/+19
getmapxy was failing to validate whether the variables passed met the necessary criteria. As reported in http://hercules.ws/board/topic/5113-map-crash-after-getmapxy/ by Javanese Signed-off-by: shennetsind <ind@henn.et>
2014-03-29Fixed Bug 8125shennetsind1-0/+7
using skilleffect on a sitting character no longer causes it to be unable to move. http://hercules.ws/board/tracker/issue-8125-sit-soul-link-npc-stuck/ Signed-off-by: shennetsind <ind@henn.et>
2014-03-18Merge branch 'master' of https://github.com/HerculesWS/Herculesshennetsind1-4/+93
2014-03-18BG Queue Fixes & +++shennetsind1-1/+1
Fixed issue where players would be able to join a ongoing game when queueing by meeting the criteria. Fixed/Implemented the maximum_afk_seconds setting. Fixed issue with the maxPlayers arena setting that'd cause the maximum to be less than specified. Added a new battlegrounds.conf setting "allowedTypes" for arenas in order for further customisation. Expect a few more soon. Special Thanks to AnnieRuru Signed-off-by: shennetsind <ind@henn.et>
2014-03-17Added regular expression matching script commands and operatorsHaru1-4/+93
- 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-16Merge branch 'master' of https://github.com/HerculesWS/Herculesshennetsind1-1/+4
2014-03-16Fixed Bug 8093shennetsind1-0/+12
Special Thanks to Haruna for pinpointing the cause, developing test cases and contributing to the final solution :3 http://hercules.ws/board/tracker/issue-8093-memory-leak-after-stop-server-cant-fix/ Signed-off-by: shennetsind <ind@henn.et>
2014-03-17Fix addtimer will report error when hit MAX_EVENTTIMERAnnieRuru1-1/+4
Fix bug 7965 http://hercules.ws/board/tracker/issue-7965-
2014-03-15Follow up f4b1ff7426b1c4cd5e8cac37f7e3983cc03c706eshennetsind1-0/+5
Memory leak from bug report 8090 which was created in f4b1ff7426b1c4cd5e8cac37f7e3983cc03c706e when I somehow managed to assume all instances consuming memory would be active. Special Thanks to LordOdin! http://hercules.ws/board/tracker/issue-8090-memory-leak/ Signed-off-by: shennetsind <ind@henn.et>
2014-03-14Follow up 1007d606645c16d5246761976b7648809edb8b1dshennetsind1-4/+4
A bonus. Fixed unitwalk's non-x/y possibility, NPCs can now be set to chase players around for as long as they keep walking, which opens a number of possibilities e.g. help npc y get thru z. Signed-off-by: shennetsind <ind@henn.et>
2014-03-14Added internal awareness of active script instancesshennetsind1-4/+21
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-11Fixed getvariableofnpcshennetsind1-0/+3
Would crash when target npc's variable database is empty. Special Thanks to Haruna, ossi0110 Signed-off-by: shennetsind <ind@henn.et>
2014-03-11Merge pull request #265 from AnnieRuru/request_1shennetsind1-0/+34
set_constant the send_target
2014-03-10Fixed a crash caused by NPC variable references in callfuncHaru1-13/+41
- 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-10set_constant the send_targetAnnieRuru1-0/+34
fix bug 8049 http://hercules.ws/board/tracker/issue-8049-specialeffect-target-self-doesnt-work/
2014-03-05Corrected same-reference check to work on vars with the same name in ↵Haru1-14/+11
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-128/+125
- 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-81/+91
- Reorganized regs var/array DBMaps into a specific reg_db structure Signed-off-by: Haru <haru@dotalux.com>
2014-02-27Cleaned up messages.confHaru1-1/+1
- Removed some unused messages. - Re-mapped some duplicate IDs - fixes bugreport:8057, thanks to AnnieRuru http://hercules.ws/board/tracker/issue-8057-jobname-with-invalid-id-return-tomb/ - Fixed some issues with the message range loaded by the char server. - Reworded some messages, fixed typos in others. Note for translation users: some messages have been remapped to new IDs. You'll need to remap them in your custom translations as well. The list of changes is as follows: - Removed messages (you can safely remove them from your translations): 15, 26-27, 35, 48-52, 57-58, 65-69, 82-83, 86-87, 91, 101, 140-142, 164, 189-194, 199-200, 202-203, 209-211, 215-218, 267-268, 275, 289-290, 380-385, 387-388, 401, 497, 499, 535-537, 922, 995, 1063, 1079, 1291-1294 - New messages (you need to add them to your translations): 15 - Moved messages (you need to change their IDs in your translations file): * [Unknown Job] 656 -> 620, * [Job names] 681~693 -> 656~668 * [Tombstone related] 656~661 -> 856~861 * [Etc messages] 662~680 -> 862~880 * [@version] 1436 -> 1294 * [Hercules Chat] 1475 -> 1436 Signed-off-by: Haru <haru@dotalux.com>
2014-02-26Improved mapindex_name2id errors for scriptsshennetsind1-15/+30
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>
2014-02-26Introducing #define npc constantsshennetsind1-0/+11
As proposed by AnnieRuru in http://hercules.ws/board/topic/4320-getserverdef/ They're input directly by the server, Haru's idea! (Thank you). Also introducing the MAX_CHAT_USERS define as requested by AnnieRuru. Signed-off-by: shennetsind <ind@henn.et>
2014-02-26Removed Option_ constants from const.txt, now input directly from the sourceshennetsind1-0/+39
a benefit, for example, would be that the compounds are always up to date regardless if new members are added, also added a new compound OPTION_COSTUME Special Thanks to Haruna, and AnnieRuru for pointing out constdb's outdatedness. Signed-off-by: shennetsind <ind@henn.et>
2014-02-22Changed function types related to SG days in date.cpanikon1-1/+1
Changed types in clif.c: bool clif_setip -> map:ip_set, map: char_ip_set changed as well bool clif_setbindip bool clif_send bool clif_spawn void clif_homskillinfoblock bool clif_sub_guild_invite Note that return values of those types have changed, so if any modification uses their return values it should be changed. clif_disp_onlyself replaced as a macro clif_viewequip_fail replaced as a macro Merged clif_skillup and clif_guild_skillup as they were using the same packet Added packet_len() values in clif_updatestatus
2014-02-19Fixed issue 8034panikon1-1/+2
http://hercules.ws/board/tracker/issue-8034-map-crash-scripts/
2014-02-19Readding last merge as last revert was unintended. Sorry for the trouble.panikon1-14/+30
2014-02-19Revert "Merge branch 'master' of https://github.com/HerculesWS/Hercules"panikon1-30/+14
This reverts commit c4a9dd3f2804b75c1d49b5ab58a3ba80ea4303c2, reversing changes made to 58544d7f610261a903b3e843a795efd7571b2d56.
2014-02-19Fixed Bug 8025shennetsind1-5/+21
Temporary fix for data->ref on array handling, will be dropped once Haru's data->ref redesign is commit. Special Thanks to AnnieRuru http://hercules.ws/board/tracker/issue-8025-callfunc-getarraysize-getarg-server-crash/ Signed-off-by: shennetsind <ind@henn.et>
2014-02-14sc sourcesshennetsind1-9/+9
Signed-off-by: shennetsind <ind@henn.et>
2014-02-11Fixed issue with referenced array operationsshennetsind1-15/+18
Did not affect write/read, except getarraysize and deletearray. Special Thanks to Haru! Signed-off-by: shennetsind <ind@henn.et>
2014-02-10Modified successrefitem script commandshennetsind1-5/+8
Added a new optional parameter to specify upgrade quantity, so its consistent with downrefitem which provides a optional parameter to specify downgrade quantity. As proposed by kyeme in http://hercules.ws/board/topic/2403-successrefitem/ Signed-off-by: shennetsind <ind@henn.et>