summaryrefslogtreecommitdiff
path: root/src/map/mercenary.c
AgeCommit message (Collapse)AuthorFilesLines
2016-04-04Add missing checks into mercenary.cAndrei Karas1-2/+15
2016-02-27Replaced various '-1' with the correct constantHaru1-7/+11
INFINITE_DURATION, INVALID_TIMER, SC_NONE, INDEX_NOT_FOUND, depending on context. Signed-off-by: Haru <haru@dotalux.com>
2016-02-24Added const qualifier to several variable/argument pointersHaru1-1/+2
- This is necessary for compatibility with a const RFIFOP. Signed-off-by: Haru <haru@dotalux.com>
2016-01-06Replaced the remaining explicit casts with BL_CAST/BL_UCASTHaru1-1/+2
Signed-off-by: Haru <haru@dotalux.com>
2015-12-28Added merc_id, replaced numeric mercenary IDs with enum membersHaru1-15/+15
Signed-off-by: Haru <haru@dotalux.com>
2015-12-15Added GPL-compliant header to all sources and build scriptsHaru1-4/+20
Signed-off-by: Haru <haru@dotalux.com>
2015-10-19rename malloc.c/h to memmgr.Andrei Karas1-1/+1
2015-09-25More aggressive whitespace cleanup. Follow up to 51329e6Haru1-11/+10
Signed-off-by: Haru <haru@dotalux.com>
2015-08-15HPM compatibility improvementsHaru1-0/+2
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-07-25Reduce memory usage in HPM in mercenary.cAndrei Karas1-2/+4
2015-06-19Removed ".." from include directivesHaru1-30/+30
- Include directives are now directory-independent. - This will allow building plugins from other directories in future. Signed-off-by: Haru <haru@dotalux.com>
2015-01-1727 Fixesshennetsind1-1/+1
Addressing out of bounds read/write, pointless null checks on already deferenced variables. Special Thanks to 4144 and Haruna! Signed-off-by: shennetsind <ind@henn.et>
2014-09-20Replaced hardcoded values with constants for status_change_start's flagHaru1-1/+1
- 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-05-13Removed trailing whitespace (sources)Haru1-1/+1
Signed-off-by: Haru <haru@dotalux.com>
2014-05-10Re-commit of "Fixed order of includes in all source files"Haru1-26/+28
This reverts commit 94657284973f4037596bae468ebfbee5c217e02b.
2014-05-10Revert "Fixed order of includes in all source files"panikon1-28/+26
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-26/+28
- 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-02-14sc sourcesshennetsind1-1/+1
Signed-off-by: shennetsind <ind@henn.et>
2013-11-06Merge pull request #217 from HerculesWS/script-checkershennetsind1-1/+4
Introducing the Hercules Standalone Script Syntax Checker
2013-11-06Modified status_calc_shennetsind1-1/+1
Replaces the previous 'first' flag with a multi-option flag capable of selectively determining calls where the recalculation must not be hold by delayed damage, and therefore must take place immediately. This fixes issues caused by actions that require immediate recalculation e.g. on-level-up max_hp update, also modified @baselevel where status_calc was being called after the heal and not before, causing it not to be fully healed. Special Thanks to Haruna! <3 Signed-off-by: shennetsind <ind@henn.et>
2013-11-05Introducing the Hercules Standalone Script Syntax CheckerHaru1-1/+4
- Added a command line argument '--script-check' to check a script's syntax without running the server (and without requiring a SQL connection). Usage: ./map-server --script-check /path/to/the/script.txt - For convenience, a script-checker bash script is provided, to set the path correctly when called from a different directory. Usage: /path/to/Hercules/script-checker /path/to/the/script/to/check.txt - While the script checker will supposedly work under windows as well, no convenience scripts are currently provided for platforms other than UNIX (feel free to open a pull request with a .bat launcher or whatever you like) - Integration with IDEs or text editors is possible. In fact, I already have a fully functional plugin for vim (through vim-syntastic), and if there's enough interest, I'll publish it. - screenshot: http://d.pr/i/NOBD - If you want an online checker, http://haru.ws/scriptchecker/ is running this code, without modifications and will be kept up to date (without any warranty though.) - Special thanks to Ind, Yommy, Streusel, who helped making this possible, in a way or another.
2013-10-26Changed 'tick' variables to 64 bitHaru1-2/+2
- This fixes an issue with timers that stop working after about 24-49 days when the tick overflows (note that this may happen much earlier than that, and at hard to predict times, on some systems) - Updated the RDTSC help message in the configure script to also warn users about issues with SpeedStep enabled systems. - On Windows, tick() still has a resolution of 10~15ms (or even as low as 100ms on some systems). A TODO comment (thanks, Ai4rei) was added for a follow-up patch, as I want this one to be as small as possible) - Note: on Windows versions earlier than 6.x (Vista, Server 2008), the tick overflow issue is NOT fixed, since they don't support the function used to retrieve a 64 bit tick. This isn't a big issue, since those platforms are already - or going soon to be - out of their extended support period, and it's already advisable to upgrade, for other reasons. If you're the unfortunate user of such a system, it is recommended that you reboot your machine at least once every 49 days for Hercules to work reliably. - Note: To clear some doubts, since I've already been asked, this has absolutely NOTHING to do with 32/64 bit CPUs or OSes. It's all about a variable's size, not the size of registers of your CPU, and your 32bit CPU will be able to handle this just fine. Signed-off-by: Haru <haru@dotalux.com>
2013-09-28HPM: Mercenary.c Completedshennetsind1-20/+23
Moved missing declarations of interest into the interface. Signed-off-by: shennetsind <ind@henn.et>
2013-09-27Renamed iMap interface to mapHaru1-14/+10
Signed-off-by: Haru <haru@dotalux.com>
2013-09-27Renamed iStatus interface to statusHaru1-4/+3
Signed-off-by: Haru <haru@dotalux.com>
2013-09-25Renamed local variables that would conflict with a rename of iStatus to statusHaru1-34/+31
Signed-off-by: Haru <haru@dotalux.com>
2013-09-25Renamed iTimer interface to timer.shennetsind1-4/+4
Also removed duplicate mentions of timer within calls to shorten.
2013-09-16HPM: Npc.c Interfaceshennetsind1-1/+1
Fully Interfaced. Special Thanks to Haruna Signed-off-by: shennetsind <ind@henn.et>
2013-09-16HPM: Unit.c Interfaceshennetsind1-4/+4
Fully Interfaced Signed-off-by: shennetsind <ind@henn.et>
2013-07-29Fixed Bug #7597 / Follow up b7171479a47490ff80bf04849f763158d6d96facshennetsind1-551/+551
http://hercules.ws/board/tracker/issue-7597-server-crash/ Signed-off-by: shennetsind <ind@henn.et>
2013-07-29Added mercenary interfaceSusu1-511/+551
2013-07-29Added intif interfaceSusu1-2/+2
2013-07-04- Added interface iStatus (needed to renamed it because A LOT of variables ↵Susu1-2/+2
are already called 'status')
2013-06-13Hercules Renewal Phase : Renewalmalufett1-1/+1
Rename SC names to eagis standard. Implement SC Configuration.(see db/sc_config.txt) Skill updates and fixes. Some code optimization. Signed-off-by: malufett <malufett.eat.my.binaries@gmail.com>
2013-06-07Hercules Renewal Phase One : pc, party, map, timerSusu1-10/+10
Added iPc, iParty, iMap, iTimer to HPM exported interfaces
2013-05-15HPM Updateshennetsind1-2/+2
Made SQL and strlib functions HPM-friendly, special thanks to Yommy for bringing the issue up. Added partial map.c support, for the all-handy map[] array, beware that soon the whole map.c renewal design will be commit and when that happens your usage of map.c functions in plugins might require some updates. Signed-off-by: shennetsind <ind@henn.et>
2013-03-29Hercules Renewal: clif.cshennetsind1-8/+8
1st Phase Complete. http://hercules.ws/board/topic/237-hercules-renewal/ Signed-off-by: shennetsind <ind@henn.et>
2013-02-16Updating the Headers across source filesshennetsind1-1/+1
And adding missing ones. Signed-off-by: shennetsind <ind@henn.et>
2013-02-07Fixing mistake in modified source code headersshennetsind1-1/+1
Signed-off-by: shennetsind <ind@henn.et>
2013-01-31Fixed Bug #3080shennetsind1-4/+5
Replaced strncpy with safestrncpy where I found would be beneficial. http://hercules.ws/board/tracker/issue-3080-safestrncpy-instead-of-strncpy-where-applicable/ Also modifying headers accordingly. Signed-off-by: shennetsind <ind@henn.et>
2012-12-30-Harmonize skillid, skill_num, skillnum, skill, to skill_id and same for ↵glighta1-9/+9
skill_lv -Optimise type from int to int16 in order to reduce ram consumtion. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@17065 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-12-05- Undid r16968: SVN Replaced with source:/trunk/src/@16966 (tid:74924).brianluau1-316/+324
[16969:16991/trunk/src/] will be re-committed in the next 24 hours. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16992 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-11-25Applied AStyle code formating as discussed on tid:74602.greenboxal21-324/+316
Removed /SAFESEH option from MSVC11 projects. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16968 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-11-09- Removed backup.pl (for TXT servers) and vs9-to-vs8.php (outdated versions);momacabu1-9/+1
- Merged @killmonster2 with @killmonster tid:73632; - Fixed bugreport:6764, auction code was misplaced; - Follow up to r16753 (bugreport:6523), fixed bugreport:6673, using Gravitational Field with Safety Wall would keep the character immobilized. Blame myself, thankyou Lunar for the fix; - Fixed bugreport:6514, @slaveclone wouldn't be targeted by monster. Thanks to zippy; - Fixed bugreport:6837, some code was duplicated; - Fixed bugreport:6768, removed some leftovers from TXT removal; - Fixed bugreport:6868, Unequipping a weapon with Incantation Samurai card will not kill you if you have less than 999 hp and are on a non-pvp map; - Fixed wrong bit field on ai field in mob_data structure. Credits to Ind. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16881 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-10-29-Add some src basic documentation.glighta1-1/+1
-Change some remaining -1 for status ending timer. -Move some hardcoded msg in msg_athena -Small optimisation on battle_attr_fix git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16835 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-09-08Fixed bugreport:6587 removed unused parameters in several damage/heal ↵shennetsind1-1/+1
functions from minions git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16760 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-01-17Enabled Mersenne Twister MT19937 as random number generator instead of ↵gepard19841-2/+3
standard `rand()` function (follow-up to r14865, r14870). - It fixes issues caused by RAND_MAX being only 32k in Windows system (bugreport:1927, bugreport:86). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15483 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-12-13* Merged changes up to eAthena 15033.eathenabot1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15098 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-06-30Replaced custom type 'intptr' with standard 'intptr_t'.ultramage1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14873 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-01-14* Replaced remaining occurences of '-1' with 'INVALID_TIMER', where ↵ai4rei1-1/+1
appropriate (follow up to r12998). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14670 54d463be-8e91-2dee-dedb-b68131a5f0ec