summaryrefslogtreecommitdiff
path: root/src/map/script.c
AgeCommit message (Collapse)AuthorFilesLines
2014-10-24Restored ability to differentiate between active and inactive questsHaru1-0/+18
- Added the questactive script command. - While this information may not be needed by official scripts, it was offered by the now deprecated checkquest, and as such it is made available again. Signed-off-by: Haru <haru@dotalux.com>
2014-10-24Re-commit of 4ac673941714032ada6d26fb60936ec510bbe496 (part 2)Taylor Locke1-4/+59
Some Quality of Life Changes - checkquest deprecated; Use questprogress instead for a more logical quest log checking command. Signed-off-by: Haru <haru@dotalux.com>
2014-10-24Re-commit of 4ac673941714032ada6d26fb60936ec510bbe496 (part 1)Taylor Locke1-0/+24
Some Quality of Life Changes - getbrokencount command added to get amount of broken equipment. Signed-off-by: Haru <haru@dotalux.com>
2014-10-18Renamed DeprecationWarning to DeprecationCaseWarning, since that's what it ↵Haru1-1/+1
is about. Signed-off-by: Haru <haru@dotalux.com>
2014-10-18Revert "Some Quality of Life Changes"Haru1-102/+5
- This reverts commit 4ac673941714032ada6d26fb60936ec510bbe496. - The commit breaks some legacy code. It'll be pushed again once some things are fixed. Signed-off-by: Haru <haru@dotalux.com>
2014-10-18Some Quality of Life ChangesTaylor Locke1-5/+102
checkquest deprecated; Use questprogress instead for a more logical quest log checking command. getbrokencount command added to get amount of broken equipment. setdragon and setmadogear deprecated; use setriding instead. setriding now handles all combat mounts.
2014-10-15Fixes some typo on replacestr.dastgir1-1/+1
(Bug:8396)
2014-09-23Fixed bug 8365AnnieRuru1-2/+0
*unittalk script command will send the message twice to the invoking character hercules.ws/board/tracker/issue-8365-bug-unittalk-twice-message/
2014-09-20Fixed Bug 8301shennetsind1-2/+4
reloadscript now clears npc-spawned (by warpportal script command) warps properly. Special Thanks to Emistry, Cydh http://hercules.ws/board/tracker/issue-8301-warpportal-reloadscript-map-server-error/ Signed-off-by: shennetsind <ind@henn.et>
2014-09-20Replaced hardcoded values with constants for status_change_start's flagHaru1-12/+7
- Please use the values from enum scstart_flag when calling status_change_start or related functions. - This also applies to the sc_start script commands. Signed-off-by: Haru <haru@dotalux.com>
2014-09-16Follow: ↵Michieru1-3/+3
https://github.com/HerculesWS/Hercules/commit/8ab61745b81d1cf0602c7998f590aac8749187da This fixed all mob size problem :) Fix estin estun not working properly (bug:7891)
2014-09-03Add *getguildmember script commandAnnieRuru1-0/+44
its so frustrating that rathena already having this for month, but we don't have =/ https://github.com/rathena/rathena/commit/eba1539
2014-09-01Add MAX_REFINE as hard-coded constantAnnieRuru1-0/+1
MAX_REFINE has different value for renewal(20) and non-renewal(10) and some server even adjust this value so its better to add this constant so there's no need to add a configuration when making custom refiner scripts
2014-08-31follow upAnnieRuru1-2/+2
https://github.com/HerculesWS/Hercules/commit/a06e53479131c25ce2343c431c688c57b3bfa2c0 to mimic the *sc_start documentation to rathena and fixed return 0; into return true; thx to Litro for bringing up http://hercules.ws/board/topic/6997-debug-whats-wrong/
2014-08-29Fix status def calculation (bug:8306)Michieru1-93/+55
Updated script command 'sc_start' to allow for more variables and options rAthena 17326 (bug:8217) Fix Cart Tornado damage to official elemental crashing/memory error (thanks to Ind)
2014-08-20Follow-up to b294026e6614a652c23bb0cea8a0d4dc69d8b125Haru1-1/+1
- Added documentation for the pc->search_item function and formalized its return values. If the searched item is not found, now it returns the newly introduced constant INDEX_NOT_FOUND. - Updated pc->search_item checks to make use of INDEX_NOT_FOUND. - Fixed an issue with anvils not detected by the weapon forginc code, if they were in the first position of the inventory. - Added ITEMID constants for the four anvil types. Signed-off-by: Haru <haru@dotalux.com>
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>