summaryrefslogtreecommitdiff
path: root/src/map/unit.h
AgeCommit message (Collapse)AuthorFilesLines
2014-07-09Fixed issue with mounts and jobchange, ranger and mechanic mounts weren't ↵panikon1-2/+2
being checked and properly removed in pc_setoption Abstracted running functions into two other methods (unit_run and unit_wugdash) Added checks in skill_dance_switch so it'd be safe to call it whenever it's needed Documented unit_run, unit_run_hit, skill_dance_switch and sc_conf_type
2014-05-10Re-commit of "Fixed order of includes in all source files"Haru1-7/+5
This reverts commit 94657284973f4037596bae468ebfbee5c217e02b.
2014-05-10Revert "Fixed order of includes in all source files"panikon1-5/+7
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-7/+5
- 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-02Introducing HPM Datacheckshennetsind1-5/+6
http://hercules.ws/board/topic/4283-introducing-hpm-datacheck/ Signed-off-by: shennetsind <ind@henn.et>
2013-11-28Follow up fdb6de1aa34086fd4d22ae127437727f556cea3cshennetsind1-1/+1
Modified reflect code so that each reflection source can judge whether to apply or not, necessary for mechanics such as item-bonus reflect triggers even on autoguard while reflect shield does not. Re-added that "reflect shield" overhead display which I mistakenly removed in fdb6de1aa34086fd4d22ae127437727f556cea3c. Added code to refrain damage numbers from overlapping in the client, which would render them illegible. Special Thanks to kyeme, Yommy. http://hercules.ws/board/tracker/issue-7792-safety-wall-reflect-bug-body-relocation-error/ Signed-off-by: shennetsind <ind@henn.et>
2013-11-05Introducing the Hercules Standalone Script Syntax CheckerHaru1-1/+1
- 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-12/+12
- 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-16HPM: Unit.c Interfaceshennetsind1-71/+53
Fully Interfaced Signed-off-by: shennetsind <ind@henn.et>
2013-08-22Fixed Bug #7652shennetsind1-1/+1
damage storage has been changed from int32 to int64 within areas where it could otherwise modified beyond the limit and get screwed up, this solves all related problems within any skills, not only asura. http://hercules.ws/board/tracker/issue-7652-asura-strike-overdamage/ Signed-off-by: shennetsind <ind@henn.et>
2013-07-21Fixed various unit* script commands to work with NPCs (issue #7548)Haru1-0/+1
http://hercules.ws/board/tracker/issue-7548-unitwalk-do-not-work/ Follow-up to 20bdc01. Thanks to Ind for his support and suggestions. Signed-off-by: Haru <haru@dotalux.com>
2012-12-30-Harmonize skillid, skill_num, skillnum, skill, to skill_id and same for ↵glighta1-7/+7
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-52/+52
[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-52/+52
Removed /SAFESEH option from MSVC11 projects. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16968 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-04-29- Updated the unit engine to cache attacker count rather than utilise CPU ↵epoque111-1/+4
intensive block iterations - This update removes two unofficial settings, nothing that will go amiss git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16011 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-04-15Fixed quite a few dozen "comparison is always true due to limited range of ↵shennetsind1-0/+5
data type" warning with gcc on --enable-64bit mode. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15861 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-12-05Merging RREmu into rAthena -- quite a few stuff yet to be renamed, but we'll ↵shennetsind1-0/+4
get it sorted. Some of the stuff included in RREmu that is now part of rAthena: - RE Drop Rate Modifier - RE Experience Rate Modifier - RE Weapon MATK - RE Shield ASPD job-specific penalty - RE Cast Time - Renewal-specific item DEF - 3.1 classes. - All-New Mounts - Official Magical Reflection - And other perks, such as fully-functional @mapflag also merged eAthena 15006 into rAthena. For Bugs, Comments and Suggestions: http://rathena.org/board/tracker/ git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15009 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-04-16* Added support for visible garments/robes.ai4rei1-1/+2
- For SQL apply upgrade_svn14797.sql to upgrade table `char`; for TXT no action is necessary, as it upgrades itself. - This also fixes NPCs not being visible with clients 2011-01-11aRagexeRE+ (bugreport:4865). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14797 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-11-28* Added clr_type enumeration for vanish effect constants.ai4rei1-4/+5
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14517 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-11-23* Added script command pushpc, which is required by newer scripts.ai4rei1-0/+1
- Moved knockback-part of skill_blown into unit_blown, to allow unconditional knockback required by pushpc without copy-pasting code. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14492 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-08-24- Implemented unit_calc_pos (copy from pet_calc_pos) to implement it on ↵zephyrus1-0/+1
Mercenary/Homunculus and don't use x,y-1 always. - Implemented Mercenary walk to master (same packet as Homunculus). - Starting work on Stats but i will need lot of help. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13121 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-04-02* Added more debug information to track the double remove_map'sFlavioJS1-1/+2
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12457 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-03-24* Reorganized the contents of the mapserver's header files.ultramage1-0/+50
- map.h is no longer a generic dumping spot of all the shared structs, and instead, each such structure now resides in its logical component - map.h now only holds mostly map-related things (needs more cleaning) - there's still a lot of room for improvement (reorganization within individual header files, etc...) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12429 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-02-21- Fixed new guilds displaying online-connect member count at 0 rather than ↵skotlex1-0/+3
1, and the guild master not knowing it is one (eg: it cannot edit the guild notice of a newly created guild until relogging). - Fixed acc_reg2 parsing screwing up the char_id and subtracting 2 from it rather than passing it as it is. - Extended the auth_node/auth_db system in chrif.c to handle log in/out and mapserver-change procedures. This way players are not in the main dbs when they are not "active", which blocks potential invalid accesses to them. - Replaced states auth, waiting_disconnect and finalsave with active. - Cleaned some the party/guild login and creation procedures, removed the party_sent/guild_sent states. - Removed a redundant guild_check_member call which is beyond not-needed and into the realm of wasting resources. - clif_parse will no longer process packets from !sd->state.active players, this also makes checking for finalsave uneccessary (since players re already removed from the maps and dbs by this point, so you can't access them in any other way) - Separated the roles of unit_free and map_quit, the former will handle cleaning structures from the player so it can be free'd safely, while the latter performs additional routines which are unique to characters logging out normally (map-server changes will invoke unit_free and bypass map_quit). - Removed pc_isplaying, quit_db, map_knowsaccount, MAPIT_PCISPLAYING among other functions/defines which are no longer needed due to the new login scheme. - Cleand up a bit some code in the clif_send(_sub) functions. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12223 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-12-22Path code cleaning...ultramage1-2/+2
* Added map/path.h, moved path-related function headers to path.h. * Removed the macroed _real() path functions. * Modified some functions to use boolean return values instead of 1/0 or 0/-1. * Modified path_search_long() to allow a NULL output pointer (in which case a temporary local buffer will be used instead). * Removed an unused ->path_half member variable from struct walkpath_data. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11958 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-10-18Fixed some gcc-specific stuff, silenced some more warningsultramage1-3/+3
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11515 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-10-18Fixed numerous /W4 warnings (and created more :)ultramage1-13/+13
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11514 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-08-19* Cleaned/clarified some #include relationships between headersultramage1-1/+3
* Changed clif_sitting() to use 'bl' instead of 'sd' (for non-player objects) * Removed way messed-up script function 'unitdeadsit' * Tagged 'FIXME' lines written by myself git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11040 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-21Applied a consistent look to all header files (copyright, ifdefs)ultramage1-2/+3
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9891 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-01-16- Added function unit_escape to simplify the run-away code a bit in the mob ai.skotlex1-0/+1
- Some cleaning on the mob_ai to enable mobs to run away from their current target when they are rude-attacked by them. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9658 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-31* Refer to http://www.eathena.ws/board/index.php?showtopic=130285FlavioJS1-1/+1
- Renamed pc_checkweighticon to pc_updateweightstatus and cleaned it. - Updated pc_is50overweight to use battle_config.natural_heal_weight_rate. - Added 90% weight check when attacking. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9600 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-09-07- Removed the Warmth "stacking" code.skotlex1-2/+1
- Added back the effect of /doridori to skill-SP regen - Implemented a rough version of Angel of the Sun/Moon/Stars, it has a low chance of triggering on doridori-boosted SP-regen events. - Added sg_angel_skill_ratio to specify rate at which the Angel skill triggers. - Added unit_cancel_combo which takes care of ending a combo time and resuming normal attack 'inmediately' - Cleaned up some the SG_HATE code, you can't change hate targets anymore. - Increased duration of Miracle of the Sun/Moon/Stars to one hour. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8664 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-08-18- Little code cleanuptoms1-0/+2
- Cleaned merc_hom_evolution to avoid free'ing/realloc'ing - Fixed "args of aFree is freed pointer" on Homunc deletion git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8341 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-08-18- Changed unit_free so that it receives which cleartype should be used when ↵skotlex1-1/+1
the character is still on a map. Used this on status_damage so that mobs that do not respawn when killed will properly display the death animation. - Should have fixed the signed/unsigned comparison warnings in the main regen function. - Fixed Energy Coat consuming 10x less SP per hit than it should. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8339 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-20- Corrected the line terminator setting on the unit.* files as pointed out ↵skotlex1-70/+70
by Irmin git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7268 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-17- Added state.running to unit_data to make it easier to check for running ↵skotlex1-0/+1
characters (saves having to get the sc data and check for the corresponding timer all the time) - removed pc_run, pc_walktodir, replaced with unit_run. - moved the code that makes you walk that extra cell to unit_stop_walking, which is now invoked before resetting the walk-target. - Flag &2 in unit_stop_walking is now to make the character force-move that extra tile if the walkpath pos is 0 at hit time. - Added variable walk_count to unit_data to be use as a counter for cells walked for walk-triggered skills (walk path_pos is not good enough since it keeps resetting each time the walk path is updated) - Increased WALK_SKILL_INTERVAL to 5 (it is the closest value that makes the average mob trigger a chase skill every second) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6137 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-13- Changed slave chasing from using unit_walktobl to map_search_freecell + ↵skotlex1-1/+1
unit_walktoxy, since the previous behaviour makes all slaves always end up on the same cell. - Changed some function declarations to take x,y arguments as short rather than int. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6024 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-11- Changed clif_damage/clif_skill_damage to return the walk-delay based on ↵skotlex1-2/+0
the passed on damage-delay. - Changed battle_damage to accept the walk-delay as well. - Removed the walk-delay timers from unit.c, merged them to battle_delay_damage. - Traps will not be displayed when you walk within their range. - Added HT_DETECTING revealing traps. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5997 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-10- Modified the unit_data structure to handle automatically switching between ↵skotlex1-1/+3
chasing and attacking a character. Note that it's a work in progress and not yet properly tested/finished... git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5979 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-23* Minor cleanups.Lance1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5712 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-22- Merged the unit_data structure from jA for handling unit-related data ↵skotlex1-0/+69
(attack times, walking, auto-attack timers, skill related data) - Modified unit_skillcastcancel to receive flag&2, which stands for "cancel casting only if current skill is cancellable" - Battle config options changed from yes/no to BL_TYPE settings: skillrange_by_distance, skill_noreiteration, skill_nofootset, gvg_traps_target_all, skill_log, attack_direction_change, auto_counter_type - Clif.c will disconnect sessions that send an unknown command packet above 0x30000 instead of just ignoring it. - Cleaned up/rewrite of the pet ai, same for pet_calc_pos - Implemented use of mob variable attacked_players as it is used on jA - Cleaned up error reporting during mob-skill loading to be less spamy with non-loaded mobs. - Corrected water_height reading. I forgot to give credits to LittleWolf for providing the water-reading function :X git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5707 54d463be-8e91-2dee-dedb-b68131a5f0ec