summaryrefslogtreecommitdiff
path: root/src/map/mob.c
AgeCommit message (Collapse)AuthorFilesLines
2006-04-18- Fixed the delete_timer (@summons, alchemist plants) not invoking ↵skotlex1-0/+2
unit_free, hence causing memory leaks and the like. - Applied jA's patch to fix a bug in the scripting engine in regards to priority of operators. Thanks to End of Exam for the information. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6161 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-17- Added state.running to unit_data to make it easier to check for running ↵skotlex1-2/+2
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-7/+9
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-12- Added cast time to pick stone of 3 secs and 500ms delayskotlex1-0/+1
- Removed area of effect of Assumptio. - Added "can't act" delay update when an auto-spell triggers. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6021 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-12- Simplified the mob-drops structure by using a single timer with a linked ↵skotlex1-70/+75
list of drops instead of separate timers for each drop. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6014 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-12- Removed the piece of code that "guesses" that job classes between 24 and ↵skotlex1-2/+0
68 are advanced classes from mob_avail reading since they conflict with NJ/GS. Use the correct class numbers from now on! git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6000 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-11- Fixed Looted items always dropping in quantities of 1.skotlex1-1/+1
- Removed the check that deletes Magnus Exorcism cells after they hit once. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5984 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-11- Multiple optimizations to the unit_data auto-chase upgrade, also ↵skotlex1-23/+18
simplified the mob and pet ai routines. - Simplified the walk routines to half the number of timers required for walking. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5982 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-11- Fixes to the unit_data update that lets characters auto-chase while attacking.skotlex1-3/+2
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5980 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-10- Modified the unit_data structure to handle automatically switching between ↵skotlex1-146/+23
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-04-09- Modified @warp/@rura to prevent causing pc_setpos position error messages.skotlex1-0/+1
- Fixed the mob's last_thinktime not being updated on mob_spawn, causing them to not "think". git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5971 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-09- Fixed @npcmove not sending the correct packets to make the moving refresh ↵skotlex1-2/+3
client-side. - Fixed mobs with aggressive + looter mode never looting. - skill_wall_check now also checks for pits so that skill effects don't go through them. - Now you can't leave/be-kicked from a guild inside guild castles. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5969 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-09- Small code cleanups. One should lower a bit function overhead when using ↵skotlex1-1/+1
mob_ai&32 git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5967 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-09- Mob_ai update. The attacked checks will trigger even if the mob can't ↵skotlex1-10/+3
move. Being attacked while the mob can't move no longer will trigger rude-attacked skills. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5964 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-08- Fixed @movenpcskotlex1-12/+9
- Cleaned up and improved the lootsearch routine to pick nearest item. - Added INVISIBLE_CLASS to the list of classes supported by npc_get_viewdata - Fixed trying to set the view_data for npcs who are located on a map, but have no visual data. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5959 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-08- Added function status_change_init to initialize all the sc timers. Added ↵skotlex1-4/+3
sc_data initialization to the npc structures who were missing them. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5953 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-08- Likely fixed a mob not returning to their original class view on respawn ↵skotlex1-4/+3
after they changed class. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5952 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-07- Moved the devotion damage reduction to the block that only executes if ↵skotlex1-0/+4
flag is zero in battle_damage. - skill_castcancel won't trigger on battle_damage when the passed flag is 1 - The flag in battle_heal is now used to determine whether Berserk blocks the healing or not. - Moved the Fusion HP penalty to battle_calc_weapon_attack - Some cleaning to use battle_heal/damage rather than pc_heal/damage where appropiate. - cleaned up the deadly-poison hp reduction code. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5949 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-06- Corrected the Soul Drain formula, thanks to Haplo for pointing it out.skotlex1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5932 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-06- Changed the random warping of mobs with no players from mob_spawn to ↵skotlex1-1/+1
unit_warp, which prevents MSC_SPAWN from being retriggered for already spawned mobs. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5928 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-03- Modified Rude-Attacked behaviour so that such skills only triggers when ↵skotlex1-3/+17
the rude-attacked count is greater than 3. - Added config setting slaves_inherit_mode to determine whether slaves take on their master's aggressive/passive status (defaults to yes) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5890 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-03- Cleaned up (fixed?) a possible overflow in pc_isUseitem, thanks to foobar.skotlex1-1/+1
- When you have the wrong ammo-type equipped the skill-failed message is now "skill can't be used with this weapon", which is less misleading than "please equip arrows first". - Corrected pet-equipment display (I originally assumed they went in the shield view-position, when they actually go in the head-bottom position). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5883 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-02- Added a missing memset on ers_alloc'ing mob loot which was making data ↵skotlex1-0/+1
from looted items fill in normal drop info. - Some more work on the display of Brandish Spear... git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5871 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-01- Fixes to the mob_ai routines. Prevent casting rude-attacked skills in ↵skotlex1-9/+16
situations that shouldn't be considered as so. Fixed mobs failing to chase after enemies when range-attacked out of their view_range. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5848 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-01- Added structure view_data to handle sprite information for all characters ↵skotlex1-75/+36
(equipment, weapons, hair, dyes, etc). Unified a bunch of clif functions now that you only need to handle the view_data (so instead of clif_spawn[pc/mob/npc/pet] you just have clif_spawn) - Fixed the clif_change_class packet (it should check for non players classes, not a class above MAX_PC_CLASS), it fixes morphing enemies. - Rewrote the way cloth dye packets are resent to optimize bandwidth usage. - Fixed the npc_item_flag thing (enable_items/disable_items script command) - Rewrote the disguise implementation to be bandwidth friendly. - Modified the hide options to change your class to INVISIBLE_CLASS, since such classes don't even get their view packets sent around. - Rewrote several clif functions to adapt to the new view_data class; - Added class 139 to npcdb_checkid which was required by some npcs in the swordman quest? o.O git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5833 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-30- the auth function in login.c won't jstrescapecpy passwords that were ↵skotlex1-4/+4
encrypted. - Moved the Endure and Gravitation sc ends to battle_damage from pc_damage. - Endure level 11 and above are now considered infinite-endure. - Set the minimum pet hungry delay to 10 - modified function skill_delayfix to only receive skill/lv, actual time is now always acquired from skill_get_delay. It also now will never return a value below min_skill_delay_limit. - Modified brandish spear so you won't see the skill-animation for every targetted mob. Also cleaned it up to use map_foreachincell calls. - splitted skill_cast_fix into skill_cast_fix and skill_cast_fix_sc, the first does cast adjustments based on dex and server settings, the later only based on sc changes. Mobs use the later while everyone else use the former (which invokes the later when appropiate) - Added the Steel Body icon to auto-berserk. - Now you can't cast auto-counter while the previous one is active. - For the duration of Berserk, infinite-endure is activated. - Added Veider's suggestion to do a hack-report when players request the name of an invisible/cloaked character. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5813 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-29- Applied a fix to not do xs/ys checks on npc_doevent when the npc is not on ↵skotlex1-12/+14
a map. - You can't return to egg a pet that has run away now. - Added ers support to the delayed mob drops. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5800 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-29- Some cleaning of the mob_ai. Mobs should stop chasing once you are beyond ↵skotlex1-32/+40
their min_chase range. Improved rude-attacked checking when mobs can't move. - range3 is now used as min-chase value of mobs. - Added a debug message when status_change_timer fails. - Fixed tick direct modifications increasing duration instead of decreasing it. - Fixed inf2 of Jump-Kick to make it a "combo-skill" so that it may do a BCT_ENEMY check. - When sd->state.skill_flag is set, auto-targetting through combo-skills is disabled. - You can't SG_FEEL maps already memorized. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5796 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-28- Fixed summon mobs being able to cast "summon" skills.skotlex1-0/+2
- Summoned mobs will inherit the size and ai properties of the master. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5790 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-24- Another mob_summon fix. Slave summoning SHOULD be working now.skotlex1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5735 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-24- Fixed skillidx not being set whenever a mob uses a skill.skotlex1-2/+9
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5734 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-24- Added function map_search_freecell to locate an available cell around an ↵skotlex1-94/+32
area (for recall/warping skills) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5732 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-23- Changed Preserve's cost to 30spskotlex1-1/+1
- Fixed Arrow Shower, UNT_MAGIC_SKILLS was renamed to UNT_ATTACK_SKILLS - Fixed skill_use_pos checking target tile CELL_CHKNOPASS as invalid instead of CELL_CHKNOREACH git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5708 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-22- Merged the unit_data structure from jA for handling unit-related data ↵skotlex1-1450/+394
(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
2006-03-20- Added monster_ai&16 setting for executing the hard ai on ALL mobs in maps ↵skotlex1-11/+19
with players instead of just mobs in the vecinity of players. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5687 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-19* Recoded getmobdata script function. Fixed mob_damage typo sd -> mvp_sd. ↵Lance1-13/+12
Cleanep up confusing indentation in clif.c. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5661 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-17* Fixed misleading and inaccurately documented events and added a missing flag. Lance1-9/+11
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5649 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-17* Another compiler warning...Lance1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5639 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-16* mob_chat_sub fix. Added buildin_pcblockmove. Lance1-2/+2
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5628 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-16* BL_PC and BL_MOB control script commands (experimental).Lance1-3/+15
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5627 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-16- Fixed mob random walk interval being set to up to 6K seconds in some ↵skotlex1-1/+1
instances. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5621 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-15- Removed the hardcoded duration of 30seconds for sleep.skotlex1-1/+1
- Fixed rangecheck for pet skill usage of INF_SELF_SKILL - Removed inall/exall from atcommand.conf since those two do not exist! (pointed out by Ancyker) - @me now uses entry 270 in msg_athena as output format. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5615 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-15- Added battle config options item_rate_adddrop, item_drop_add_min and ↵skotlex1-1/+6
item_drop_add_max to control drop rate of card-acquired loot bonuses. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5610 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-14- Fixed WZ_WATERBALL + HW_MAGICPOWERskotlex1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5601 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-12- Updated clone skill copy to consider combo-skills.skotlex1-10/+18
- no_spawn_on_player won't work on mobs with no respawn delays now. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5581 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-09- Some small cleanups in mob_read_mobavail (or however it is named)skotlex1-3/+3
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5542 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-09- Moved a bunch of sc_effects that should be cancelled on hit from ↵skotlex1-9/+0
mob_damage/pc_damage to battle_damage. - Changed ITEM_NAME_LENGTH to 50. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5533 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-09- Fixed a bug that was making the no_spawn_on_player setting useless.skotlex1-1/+2
- Added Deadly Poison and Bleeding to status_get_sc_def, meaning that now vit does increases defense against being inflicted from it. - Fixed a crash and an infinite loop in @whodrops @.@ - Expanded the item_db column sizes for the names to 50. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5526 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-08- Mobs will now chase you even if you hit them from outside their range of view.skotlex1-7/+13
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5519 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-08- Items now store the top MAX_SEARCH drops from mobs and lists them through ↵skotlex1-6/+26
the new atcommand @whodrops. All merged from my server, of course =D git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5515 54d463be-8e91-2dee-dedb-b68131a5f0ec