summaryrefslogtreecommitdiff
path: root/src/map/unit.c
AgeCommit message (Collapse)AuthorFilesLines
2011-10-16* Changed function-like macros into inline functions where it seemed ↵ai4rei1-3/+7
appropriate (topic:264007). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14976 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-08-23- Rewrote/updated the SC_COMBO logic. Got rid of state.combo and added usage ↵Skotlex1-15/+16
of packet 0x7e1 (PACKET_ZC_SKILLINFO_UPDATE2) to report skill inf changes. - Cleaned up a bit the function clif_setlevel (these functions should be as lightweight as possible...) - Fixed the server sending twice the skill tree during login. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14939 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-06-30Replaced custom type 'intptr' with standard 'intptr_t'.ultramage1-8/+8
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14873 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-06-11* Fixed party invite packet 0xfe (ZC_REQ_JOIN_GROUP) using account id of the ↵ai4rei1-1/+1
inviter rather than party id. - Added support for new party invite packet 0x2c6 (ZC_PARTY_JOIN_REQ), introduction date guessed. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14844 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-04-16* Some cleanups related to player and monster states.ai4rei1-1/+1
- Moved user_font and bg_id out of states as they are data, not states. - Reordered members of state structs so that bitfields are packed together (less memory gets wasted). - Other insignificant code tweaks. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14795 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-04-09* Moved duel code into a separate file.ai4rei1-0/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14785 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-03-27* Added separate character state for vending (like for buyingstore), instead ↵ai4rei1-3/+2
of vender_id != 0 (follow up to r14682, related r14713). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14762 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-03-06* Implemented search store info system (aka. vending and buying store ↵ai4rei1-0/+1
search) together with related items. - Requires 2010-08-03aRagexeRE or later and can be disabled in 'conf/battle/feature.conf'. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14732 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-02-19* Implemented buying store system (aka. reverse vending, purchase shop) ↵ai4rei1-0/+2
together with related skill and items, without NPCs. - For SQL apply upgrade_svn14713_log.sql to upgrade tables `picklog` and `zenylog`; for TXT no action is necessary. - Requires 2010-04-20aRagexeRE or later and can be disabled in 'conf/battle/feature.conf'. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14713 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-01-14* Replaced remaining occurences of '-1' with 'INVALID_TIMER', where ↵ai4rei1-65/+65
appropriate (follow up to r12998). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14670 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-01-08* Fixed kill steal protection result in skill casting (unit_skilluse_id2) ↵ai4rei1-2/+3
not getting evaluated (bugreport:1808, since r12203). - Moved kill steal protection in skill casting to be only executed, after the actual target has been determined and validated (since r12203). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14658 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-12-02* Removed clif_weather_sub and clif_misceffect2 in favor of ↵ai4rei1-1/+1
clif_specialeffect_single and clif_specialeffect (all of them are ZC_NOTIFY_EFFECT2). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14541 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-11-29* Insignificant code tweaks: removal of excess function declarations and ↵ai4rei1-2/+0
self assignments. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14520 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-11-28* Added emotion_type enumeration for clif_emotion constants.ai4rei1-1/+1
- Made clif_parse_Emotion use clif_emotion, rather than having it's code inlined. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14518 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-11-28* Added clr_type enumeration for vanish effect constants.ai4rei1-13/+13
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14517 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-11-28* Removed 'negative clrtype is used for skipping unauthed objects from ↵ai4rei1-30/+19
saving' introduced in r9975, as it is no longer required/used (follow up to r12223). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14515 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-11-24* Fixed calls to pc_delautobonus assuming map_session_data::autobonus2 and ↵ai4rei1-2/+2
map_session_data::autobonus3 arrays having the same size as map_session_data::autobonus (since r13915). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14497 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-11-23* Various small cleanups.ai4rei1-29/+53
- Fixed truncation warnings in @statuspoint, @skillpoint and @str/@agi/@vit/@int/@dex/@luk (since r14436). - Fixed data type inconsistency in @statuspoint and @skillpoint (since r5762, related r13541). - Silenced truncation warnings in CR_ACIDDEMONSTRATION damage calculation and cardfix application (since r13700). - Reformatted unit_blown to make it look cleaner (follow up to r14492). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14493 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-11-23* Added script command pushpc, which is required by newer scripts.ai4rei1-0/+48
- 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
2010-10-09Replaced all nullpo_retr() calls which returned 0 with nullpo_ret() calls.Paradox924X1-22/+22
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14414 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-12-24Fixed a memleak that occurs when a player exits while waiting on a script ↵ultramage1-6/+5
select() or menu() (caused by r12481). The change made the attached script not deallocate to avoid a crash when changing mapservers, however deallocation must occur here since scripts waiting for user input are unable to free themselves. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14213 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-11-26* NPC event code cleanups.Inkfish1-7/+5
- removed the 'OnMyMobDead' dead code. It's never supported though documented. - removed the 'feature' that events only trigger when the player is in the OnTouch area IF it's specified. It's never documented and breaks official scripts. - some cleanups and bug fixes to OnTouch_. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14173 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-11-03* Added battle_config.mob_slave_keep_target config option (monster.conf)L0ne_W0lf1-1/+4
- When yes (default) MVP slaves will always keep their prior targets. - When no the old behavior of switching to the closest target is enabled. * Updated MAX_MOB_DB to 4000 (Monsters are starting to appear in the 2k ranges) * Changed default respawn time (when 0) to 500 from 5000. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14119 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-10-27* Cast time of Emergency Call is doubled if you master of High Jump. Inkfish1-1/+5
* High Jump can't be used on PvP maps. * Fixed a potential null pointer from last commit. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14106 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-10-25* Implemented the official version of 'OnTouch' named as 'OnTouch_'.(it can ↵Inkfish1-0/+10
be defined in script_athena.conf) * Adapted 'map_foreachinarea' to 'map_forsomeinarea' so that it allows you to specify the number of bl you wanna operate on. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14097 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-08-15Fixed self skills affecting target unit when used within combo delay for ↵Inkfish1-2/+6
Asura and Flying Kick. (bugreport:3495) (follow up to r13900) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14007 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-08-12- Optimization to instance system.zephyrus1-1/+2
* Removed the crc feature to generate instance npc names. The instance npc name will be "dup_" + instanceid + "_" + srcnpcid. * Removed the big array under map structure and coded in a different way. It was only used to generate map names, but i just used the instance_id + "origin map name". * Moved all instance features to separated files. * Moved the npc duplication for instances into npc.c as Ultramage says (removed npcname_db from npc.h). * Added recomendations for scripts commands by Saithis. - Testing required, i will prepare Endless Tower script soon. I hope this do almost anything in bugreport 3276. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14003 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-07-29- Fixed a bug cleaning instance variable on party when instance is destroy.zephyrus1-0/+1
- Fixed a bug on Yuno Castle 2 and 3, not killing guardians. - Moved battleground team leave on unit remove map to prevent a crash on multimap servers. - Fixed a bug on checking range with the wrong target. Fix a crash on Item 2002 at refine >= 9. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13979 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-07-29* Kaahi heals no matter if attack connects. (bugreport:2440)Inkfish1-2/+2
* Fixed a typo causing skillitem always resets skill delay. (bugreport:3431) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13977 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-06-30Fixed sql char deletion code using a broken pet deletion query (ran very ↵ultramage1-4/+4
slow, and had a typo in a binary shift operation) (bugreport:3304). Fixed change r13774 to the code responsible for deciding whether to move 1 extra cell when stopping walking; it had its logic inverted by mistake (bugreport:3312). Cleaned up the itemlist, cartlist and storagelist gm command code: - fixed buffer overflows in all three functions (bugreport:456). - merged all three atcommand functions into a single one; the appropriate behavior is detected from the command's name. - using the StringBuf class instead of static-size buffers and string operations for more efficient and safe processing. - using 'jname' (the one without underscores) as the primary item name in the list, and not using the aegis name for cards at all (since it's almost identical). - fixed forged item details never being displayed due to a missing strcat(). - extended item info (crafted/named items, pet eggs) will now be displayed for storage and cart list as well. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13920 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-06-28* Implemented script command "autobonus". [Inkfish]Inkfish1-2/+5
- "autobonus" is similar to "bonusautoscript", however it has a timer of its own. - Updated itemdb changing items bonus using "bonusautoscript + sc_start" mode to "autobonus + bonus" mode. - Remove bonusautoscript and status changes that was needed by bonusautoscript and is no longer in use. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13915 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-06-20- Instancing System (Thanks to Sirius White who did most of the code, with ↵zephyrus1-0/+5
some of my work to implement client side information, some optimizations and bugfixes). Also thanks to contributions from UEAUP team and Orcao. - Fixed a bug on areamobuseskill and changed it to make it as Aegis. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13901 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-06-20* Changed Asura Strike/Jump Kick to target skill to get rid of the "target ↵Inkfish1-4/+4
delay". (bugreport:2174) - skill tree will be re-sent on status change to handle using these two skills during combo. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13900 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-06-15Improving the r13888 crashfix to cover similar crash scenarios discovered:ultramage1-1/+1
Reordered code in status_change_end(SC_DANCING) so that an ensemble's skill unit group is deleted only after removing both performers' status changes. Modified the call to skill_delunitgroup() IN status_change_end(SC_DANCING) so that it always processes the group's true owner and not others (bugreport:3253). Replaced calls to skill_stop_dancing() with status_change_end(SC_DANCING), since it now provides identical functionality. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13891 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-06-05Oops, I messed up the condition on my last commitInkfish1-2/+2
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13845 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-06-05* Fixed turning off a skill needed to meet the requirements. (bugreport:3175)Inkfish1-7/+5
* Skills used through items not having aftercast delay or cast time now don't overwrite the former canact_tick. (topic:220921) * Multiple autoscripts now can trigger at once. * Applied a temp fix for autoscripts crashing server.(bugreport:3154) * Implemented SC_JEXPBOOST (thanks to GMJobbie for the diff). (bugreport:3177) * Implemented SC_IGNOREDEF. (topic:217330) * SC_DEFRATIOATK won't affect boss monsters. (topic:217330) * Fixed skip_teleport_lv1_menu made lv2 skip menu as well. (bugreport:3183) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13844 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-06-03* Some clean ups on autocast and itemskill code. (see topic:220921 for some ↵Inkfish1-1/+1
info) - Autocasted Teleport now skips the menu. - Fixed nullpo info when defensive autocasts are triggered. (follow up to r13815) - Fixed Warp portal used in item script never worked. - Item skills now bypass skill delay check. - Implemented SM_SELFPROVOKE. - Updated item db using 'itemskill' for some items. * Basic skills will never be reset. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13841 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-05-27* skill_check_condition clean up (bugreport:2770, bugreport:2957, ↵Inkfish1-2/+2
bugreport:3010) - Weapon, SP, HP and state are checked at the beginning of cast. - Required items and ammos are checked at the end of cast. - SP and status change required are removed at the end of cast without checking again. - Required items are removed only if the skill is successfully used. - Autocasts won't check for requirements but will remove them if you have them(except for SP/HP). Hope won't cause any problems... git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13815 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-05-22NPC_STOP now stops both sides and will be canceled if either side teleports ↵Inkfish1-1/+2
or dies.(bugreport:3099) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13803 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-05-22* The delay icon doesn't appear during casting now. (bugreport:3101)Inkfish1-4/+0
* Status icon of ASPD potions doesn't overriding each other now.(bugreport:3095) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13802 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-05-20* Now fiberlocking a fiberlocked target doesn't renew the timer but instead ↵Inkfish1-1/+1
increases its fireweakness [Inkfish] - This makes doublecasting firebolts on a double fiberlocked target having double damage from both 2 bolts possible = =(bugreport:3061) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13799 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-05-19* Miracle should only be dispelled on map change.Inkfish1-1/+0
* The "party invite" and "view equip" state messages are ought to be sent on every map change instead of login. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13793 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-05-15Cleaning/fixing the previous commits a bitultramage1-3/+3
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13775 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-05-15- Fixed a bunch of invalid memory access bugs as reported by Valgrind.skotlex1-26/+19
- Updated unit_stop_walking to not move character an extra cell when it is already half-way there unless flag 0x4 is passed. (bugreport:3078) - Fixed the monster MD_CASTSENSOR code not correctly setting the monster's aggressive state. - Corrected a few compiler warnings - Changed a bit the code for SC_BOSSMAPINFO so it is not so hideously ugly. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13774 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-05-12* Removed DEF reduction display when casting GrandCross.Inkfish1-19/+9
- This might not be official and led to repeated calculation. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13758 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-05-07* Fixed splash damage from Baphomet Card might miss. [Inkfish]Inkfish1-10/+30
* Check if group unit is expired before processing it. (bugreport:3054) [Inkfish] * Fixed Grand Corss outdated behavior (bugreport:1590) [Inkfish] - use new damage formula - DEF is reduced to 2/3 during cast time - block shields switching within attack duration - monsters don't damage themselves any more - intervals between hits are 300ms git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13736 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-05-03* Block equipments switching for some skills (bugreport:2900)Inkfish1-0/+18
- cannot change equipments during Arrow Vulcan's cast time - cannot change equipments within Desperado's attack duration git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13724 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-04-28- Avoid setting the canwalk delay after being hit if the target is already ↵skotlex1-2/+2
unable to move. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13706 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-03-25Fixed skill delay paw print icons showing for far too long.Sara1-2/+2
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13624 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-03-24Some fixes to my previous commit.Sara1-4/+4
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13618 54d463be-8e91-2dee-dedb-b68131a5f0ec