summaryrefslogtreecommitdiff
path: root/src/map/mob.c
AgeCommit message (Collapse)AuthorFilesLines
2007-01-21Typo huntultramage1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9684 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-14/+12
- 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
2007-01-15- The NPC elemental attacks will display a skill animation again.skotlex1-2/+2
- Mob instant cast skills will use their adelay now. - Spirit of Wizard won't work on Ganbantein - The pc normalize job function will consider you as novice if you don't have maxed out basic skill. - Cleaned up pc_calc_skilltree and related functions so that the id is left as 0 when you can't raise the skill even if you meet the prerequisites. This is to prevent raising quest/soul/marriage skills through packets. - Slaves should lock unto their master's target even if they are not attacking yet (eg: in chase mode) - Updated the Summon Slave skill to use the slave distance define as valid distance to spawn from master. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9656 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-01-15- Fixed Joint Beat's speed penalty.skotlex1-1/+2
- Added a pc_authok check to prevent the case in which somehow another character of the same account manages to log in as well. - The pc normalize job function will now recognize you as a novice if you don't have NV_BASIC maxed. - Accessories will now by default go into the rigth-side rather than the left-side of the equip window. - Added a check in the mob_ai_subhard function to make mobs unlock targets which have their invincible timer set. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9655 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-01-12Disambiguationultramage1-2/+2
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9645 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-01-10Combined most of the txt/sql mobdb reading codeultramage1-532/+277
- mob.c is now some 10kB less redundant (now using a common function) - automatically filled in some missing parts of the txt part (view_range_rate, chase_range_rate, line counting, etc) - also cleaned it up significantly git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9640 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-01-07Undid the memset->malloc_set replacementultramage1-21/+21
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9626 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-26- Cleaned up some more the code so it works for -DTURBOskotlex1-7/+12
- Cleaned the pvpoff @ and script commands. - mob_get_random_id now has two additional flags to specify that the monster to acquire should not be a boss type (4) or that it should give exp (8). - TK_MISSION will now pick any mob from the DB as long as it is not a boss type and it gives base exp. - Fixed the double-stone issue when hitting a petrified character. - Minor cleanups git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9573 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-23- Moved "#include <limits.h>" to cbasetypes.h to ensure it's included before ↵FlavioJS1-1/+1
checking if UINT_MAX has been defined. - Minor changes in pc_readdb related to max_level being unsigned. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9561 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-21- Added back cropping the attack delay to attack motion for those weird mobs ↵skotlex1-0/+6
that have a aDelay less than their aMotion time. - Made the Note 4 comment clearer in the battle config files. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9548 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-19- Reverted the mob ThinkTime update, that field is again aDelay as it ↵skotlex1-16/+6
apparently should be. - Fixed one small compilation error. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9522 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-18- Added hom_setting to specify which homunculus 'quirks' are in effect. The ↵skotlex1-1/+2
default activates all of them, if you set them to 0 then homuncs will not be treated in any special matter, pretty much like standard mobs. if I missed any 'quirky' homunc behaviour from it, report it so it can be added to the list. - Made flooritem_lifetime a int so you can specify much longer life times (the default of 60k was already very close to the max of 65k) - Removed monster_ai 0x80 since it's now handled by hom_setting. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9519 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-12- Mobs now by default are "everyone's" enemy, so mobs are able to hit each ↵skotlex1-9/+11
another. - Added monster_ai&0x400 to use the previous 'smart' criteria that prevents mobs from fighting each another. - Moved "unsetting" the angry mode from the mob_ai to the mob_damage function, where it'll work regardless of who hits the mob. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9481 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-12- Minor changes to ers.FlavioJS1-2/+2
- Removed unused/hardly used cbasetypes typedefs. - Updated txt-converter's makefile to include utils.o git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9473 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-08- Fixed crash when looters became full.skotlex1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9437 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-08- Moved attackedcount to md->state and made it an unsigned char.skotlex1-28/+16
- Autospell delay time is now the skill's full delay. - Removed variable attackedplayers, since Aegis is state driven, the best approximation to Aegis would be to use the last player that hit the mob. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9436 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-07- Cleaned up implementation of NPC_EMOTION/NPC_EMOTION_ON. Now val0 is the ↵skotlex1-5/+21
emotion, val1 sets the mode, val2 adds to the mode, val3 removes from the mode. val4 asks to remove the previous mode change. - Updated the mob skill reading code so it accepts hexadecimals in the 'val' fields. Also, it will optimize the NPC values so that when you set a mob's mode to their db mode, it will just remove the previous mode. - NPC_EMOTION_ON will now automatically move it's new mode to val2 since it should add a mode, and if this mode doesn't has the aggressive bit, it will remove it. See this "ancient" hypothesis on how NPC_EMOTION_ON should work for the details: http://www.eathena.ws/board/index.php?showtopic=63606 - Updated mob_skill_db to account for the updated mob modes on NPC_EMOTION skills. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9433 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-06- Gave a minimum think time to the dummy mob and to clones.skotlex1-0/+2
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9423 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-06- Cleaned up the implementation of map_foreachinmovearea so that the number ↵skotlex1-117/+116
of arguments passed is less. - Moved setting a mob's chase/attack states from the mob_ai to unit_attack and unit_walktobl. - Cleaned the change-target/cast-sensor code to account for the new mob modes. - Cleaned up a bit the mob ai sub hard function. - Made the monster_active_enable config setting take effect on mob load. - Updated the doc explaining mob modes. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9422 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-04- Oops, fixed sql compile error.skotlex1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9407 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-04- Fixed HVAN_INSTRUCT int bonuses.skotlex1-104/+108
- Renamed mob_db's "adelay" column to ThinkTime and made the mob.c code use it instead of MIN_MOBTHINKTIME. The adelay of mobs will also be equal to their thinktime unless their thinktime is less than their attack motion. - Cleaned the mob_db reading code a bit. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9406 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-04- Repairing items via scripts no longer displays "item has been repaired"skotlex1-1/+2
- Status Recovery again makes mobs unlock their current target. - Moved requesting party/guilds from the char-server from pc_authok to pc_reg_received, since map_nick2sd and map_getallsd won't work until the characters are authentified. Also removed the guild master setting from clif_parse_LoadEndAck to pc_reg_received since guild master setting will work there. - Fixed homun hunger timer being started on login even when hom is vaporized/dead. - Fixed mvp exp attacker bonus applying incorrectly. - Removed duplicate msg_athena.conf entries 619 and 620 for Ninja/Gunslinger. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9401 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-03- Fixed even share exp flutuating as described in:FlavioJS1-2/+1
http://www.eathena.ws/board/index.php?showtopic=126139 thanks to TheUltraMague for the fix. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9397 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-02- Fixed passive mobs becoming increasingly unlikely to retaliate to attacks ↵skotlex1-1/+1
after they got inflicted by a disabling status change. - Changed the "is_boss" define to check for mode MD_BOSS instead of giving mvp exp. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9384 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-11-29- HT_PHANTASMIC no longer knocks back even when it misses.skotlex1-14/+20
- Earned exp by dead homuns will now be lost (same treatment as earned exp from players that died) - Some minor cleaning in mob_dead git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9361 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-11-28- Modified the way Storm Gust freeze's counter works. Now it checks for the ↵skotlex1-2/+2
caster of the Storm Gust, if it's the same as the previous hit, the counter is increased, otherwise, the ID is updated and the counter is changed to 1. - Fixed always receiving at least 1 bexp/jexp even when the mob gives no exp at all. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9345 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-11-27- Fixed clif.c dumping unknown packets by default... (oops, used an #ifdef ↵skotlex1-1/+1
where an #if had to go) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9335 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-11-27- Corrected KiriKage's range so it works correctly when used by non-players ↵skotlex1-0/+3
or when use weapon's range is used. - Changed service for you's flags so it affects all players on range. - Corrected the skill animation for Absorb Spirits - Cleaned up a bit the implementation of how Gravity Field blocks the caster from moving. - Mob class-changing will fail if the new class is the same as the previous one. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9325 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-11-24- Added all the missing FIFOHEADs in the login/sql servers (required for ↵skotlex1-1/+1
TURBO support) - Fixed the fact that the TURBO code breaks when you attempt to handle more than one connection at a time within the same function. However this broke map-server compilation, therefore, don't use TURBO yet! It needs more fixing (and I need more time to fix it) - While at it, cleaned a few packet implementations in the char/login servers which were not only ugly, but had some really stupid flaws within (stuff like escaping a string, and then using the non-escaped variable to insert to SQL? T_T) And will someone explain me why the TXT servers are coded much more cleanly, and without such horribly broken code as I find in the SQL ones? T_T; git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9307 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-11-22- Modified slaves_inherit_speed and slaves_inherit_mode so you get better ↵skotlex1-21/+28
control of when to copy/remove modes/speed. - Reenabled usage of mode MD_CHANGETARGET, so mobs with mode 0x200 will be able to switch targets while attacking. - Simplified some more the chase-changetarget function. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9294 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-11-20- The max level of NPC_SPLASHATTACK is now 1.skotlex1-17/+17
- Implemented NPC_DEFENDER. Reduces ranged Physical+Misc damage by 80% - Improved the battle config reader so it accepts hexadecimal values. Updated the monster_ai description to make use of this. - Added monster_ai&0x200. When set, mob skill delays are shared. That is, if the mob has several lines with the same skill, when the skill is used, the delay will be set to all of them, not just the one entry used. - Cleaned mob.c to use hex values when refering mob_ai - Corrected NPC_BARRIER so it grants 100 def/mdef (and not just mdef) - Weapon ATK bonuses will now only apply to watk and NOT watk2 on players (on players watk2 is refine bonus) - Corrected NPC_KEEPING. it should give 90 def, not 100 git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9277 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-11-20- Raised the amount of skills that can stack on a single cell before the ↵skotlex1-0/+1
"in-area/out-area" detection code breaks to 24 (from 8) - Fixed a crash in clif_SkillInfoBlock if the passed player already disconnected. - Added limiting drop rate to 100% from item-bonuses that depend on the mob's level so that "@autoloot 100" will catch them. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9270 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-11-09- Fixed status-change loading not working.skotlex1-1/+1
- Fixed permanent mob-spawn script-events not working. - AL_CURE won't confuse undead players. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9187 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-11-08- Moved the duel functions to pc.c since they are so totally out of place in ↵skotlex1-14/+22
atcommand.c - Fixed Spider Web not ending when hit by a fireelemental attack. - Cast-time reductions from status changes will not be executed until right before casting, to prevent status changes from ending when attempting to cast and the attempt fails (invalid cells, not enough sp, wrong target, etc, etc) - Added check to prevent Wand of Hermod from seeking for a partner to encore, since the partner is supposed to be the warp. - Moved the duel auto-reject on logout from map_quit to unit_free - Corrected the mob spawn reading code so that the event-name can be up to 50 characters long (which is the actual event length) and so that it can read spaces within them, it will also strip the leading/trailing quotes if you use them so that the event is actually found on mob-death (so you can do stuff like "My NPC::OnDead" as a valid event). - Moved the homunc inherit speed from the master from status_calc_pc to LoadEndAck, since the hom's speed matches that of the master each time the master changes maps. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9173 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-11-07- Fixed map_foreachiddb and map_foreachpc so they don't encapsulate the ↵skotlex1-7/+2
variable arguments into a double va_arg list. Thanks to the Ultra Mage for the tip. - Cleaned up the clif_hate/mob_info functions with the correct fields/usage as explained by Rayce. - Implemented clif_feel_hate_reset packet to properly display the Angel of the Sun/Moon/Stars, thanks again to Rayce for the relevant information. - LP will again block all land-stuff from being placed down on top of it for the exception of Song/Dance/Encores. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9162 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-11-06- Corrected Kaupe so it doesn't ends on the first part of Soul Destroyer.skotlex1-9/+8
- Applied some cleaning to the way Tatami Gaeshi knocks back. - Cleaned up the way mobskill_use checks for the correct event. It should fix unlimited mob-skill-casting issues. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9154 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-10-31- When Kaizel (or super novice rebirth skill) triggers, you get debuffed now.skotlex1-3/+3
- Modified the player_cloak_check_type and monster_cloak_check_type settings. 1 makes it check for walls, 2 makes cloaking NOT end on normal attacks, and 4 makes cloaking NOT end when using skills. The default setting for players is still 1, but for mobs the default has been changed to 4. - Non-players can now use all skills while hidden. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9109 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-10-31- Added a check to prevent adding negative damage to the total accumulated ↵skotlex1-3/+12
damage in mob_damage. - Implemented the property where the first attacker get's double exp-share than the others. Due to the way exp calculation is done, this bonus will not apply when you use exp_calc_type 1 (damage/max_hp) instead of the default (damage/total-damage). For now this bonus is done after calculating who is the MVP character instead of before. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9107 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-10-30- Corrected GS skill ranges using Aegis data. All their targetted skills ↵skotlex1-1/+2
have a base range of 9 T_T, and Dust (Choke) has a range of 2. - Updated the code so mobs can use ChainAction as a targetted skill. - Added GroundDrift effects for Wind (Stun) and Fire (knockback). The knockback value is unknown, so 3 is used for now. - Cleaned up some more the steal code, now you can't steal the last slot regardless of skill level used. - Added consideration of Chain Action when cloning GunSlingers. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9100 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-10-28- Fixed mob-skill event "skillused" not triggering at all.skotlex1-2/+2
- Summoned mobs will only be removed from a map if their master is also removed (dynamic mobs) - Minor cleanups git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9088 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-10-25- Made the exp bonus settings be adjustable:skotlex1-4/+11
- exp_bonus_attacker: Indicates how much additional exp a mob gives per additional attacker (eg: 10 -> +10%*attacker) - exp_bonus_max_attacker: Indicates at which number of attackers the bonus is capped (eg: 5 -> 5 attackers, so a mob yield the same exp whether 5 or 10 people attack it) - Changed the way the party_even_share_bonus setting works. It now uses a simple linear bonus increase (eg: 10 -> +10%*party member) - The defaults are as explained by Tharis: +25%/attacker, capped at 12 attackers, no party bonus. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9067 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-10-23- Removed NJ_TOBIDOUGU adding damage to W_HUUMA weapons which somehow got ↵skotlex1-1/+2
readded. - When nonplayers use Cloaking, it will be forced to level 10 since mobs shouldn't have movement/attack restrictions while walking cloaked. - Should fix a warning in int_homun.c git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9043 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-10-20- Added config setting "summon_flora_setting", which it you can decide now ↵skotlex1-7/+16
two things: a. Whether or not players can harm your floras outside versus grounds, and b. Whether or not you can summon out and mix different types of plants at the same time. - Likely fixed pc_steal_item always failing to steal (it was attempting to steal random item IDs...) - Cleaned up a bit the mob on-death event so that when the killer is a homunculus, it's master will be taken. Also, the variable killerrid will be set before running the script to specify who delivered the final blow. If the killerrid matches with the script attached player, you can be sure your player did the final blow to the mob, otherwise, the attached player is who did the most damage to the mob. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9026 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-10-19- Cleaned up the log.c file.skotlex1-5/+5
- Splitted log_pick into log_pick_pc and log_pick_mob to avoid ugly type-casting. - Fixed log_chat not recording anything if the server is compiled in SQL mode and sql_logs is turned off (it should then record to a plain txt file) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9017 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-10-11- Corrected the mob damagelog structure so that you can't exploit it by ↵skotlex1-50/+36
switching characters. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8963 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-10-06- Disabling status abnormalities will now reset a mob's target.skotlex1-0/+6
- Mob morphing also resets their target now. - Monk combos no longer can ignore skill delay (delay skill for all their combo-related skills is ASPD) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8945 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-09-27- Merged some splash changes from stable. Sharp-Shooting will now display a ↵skotlex1-0/+10
skill animation. - The no_spawn_on_player setting will now also work for static mobs, but only if the setting is set to 100 or higher. - Some small cleanups. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8887 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-09-20- A mob's HP is set temporarily to 0 before invoking it's on-death script, ↵skotlex1-0/+2
prevents said scripts being able to "rekill" the mob indefinitely (if stuff like killmonster is used within) - Some small cleanups in chat.c git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8829 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-09-17- Fixed NPC_INVISIBLE's cloak ending after attacking once.skotlex1-0/+3
- Fixed SG_FUSION being castable without Soul Link state. - Moved the item-use restriction SC checks from clif.c to pc_use_item, fixed Gravitation blocking potion usage on it's area of effect. - Sphere Marines and Summoned Flora are now inmune to class-changing. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8782 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-09-16- Added monster_ai&256. When set, a monster will pick a random starting ↵skotlex1-2/+2
position to begin checking versus it's skills, otherwise, it will always begin checking from the beginning. - Added NPC_CHANGEUNDEAD to the skill_cast_db, fixes it apparently doing "nothing". git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8778 54d463be-8e91-2dee-dedb-b68131a5f0ec